_ZN11addressbook6Person25internal_default_instanceEv:
  322|      2|  static inline const Person* internal_default_instance() {
  323|      2|    return reinterpret_cast<const Person*>(
  324|      2|               &_Person_default_instance_);
  325|      2|  }
_ZN11addressbook6Person16default_instanceEv:
  319|      2|  static const Person& default_instance() {
  320|      2|    return *internal_default_instance();
  321|      2|  }

_ZN4brpc19http_parser_executeEPNS_11http_parserEPKNS_20http_parser_settingsEPKcm:
  694|  1.29k|{
  695|  1.29k|  char c, ch;
  696|  1.29k|  int8_t unhex_val;
  697|  1.29k|  const char *p = data;
  698|  1.29k|  const char *header_field_mark = 0;
  699|  1.29k|  const char *header_value_mark = 0;
  700|  1.29k|  const char *url_mark = 0;
  701|  1.29k|  const char *body_mark = 0;
  702|  1.29k|  const char *status_mark = 0;
  703|  1.29k|  const unsigned int lenient = parser->lenient_http_headers;
  704|  1.29k|  const unsigned int allow_chunked_length = parser->allow_chunked_length;
  705|       |
  706|       |  /* We're in an error state. Don't bother doing anything. */
  707|  1.29k|  if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {
  ------------------
  |  |  204|  1.29k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  ------------------
  |  Branch (707:7): [True: 0, False: 1.29k]
  ------------------
  708|      0|    return 0;
  709|      0|  }
  710|       |
  711|  1.29k|  if (len == 0) {
  ------------------
  |  Branch (711:7): [True: 0, False: 1.29k]
  ------------------
  712|      0|    switch (parser->state) {
  713|      0|      case s_body_identity_eof:
  ------------------
  |  Branch (713:7): [True: 0, False: 0]
  ------------------
  714|       |        /* Use of CALLBACK_NOTIFY() here would erroneously return 1 byte read if
  715|       |         * we got paused.
  716|       |         */
  717|      0|        CALLBACK_NOTIFY_NOADVANCE(message_complete);
  ------------------
  |  |   81|      0|#define CALLBACK_NOTIFY_NOADVANCE(FOR)  CALLBACK_NOTIFY_(FOR, p - data)
  |  |  ------------------
  |  |  |  |   61|      0|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|      0|do {                                                                 \
  |  |  |  |   63|      0|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|      0|                                                                     \
  |  |  |  |   65|      0|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|      0|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   67|      0|      SET_ERRNO(HPE_CB_##FOR);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   68|      0|    }                                                                \
  |  |  |  |   69|      0|                                                                     \
  |  |  |  |   70|      0|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|      0|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|      0|  }                                                                  \
  |  |  |  |   75|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (717:9): [True: 0, False: 0]
  ------------------
  718|      0|        return 0;
  719|       |
  720|      0|      case s_dead:
  ------------------
  |  Branch (720:7): [True: 0, False: 0]
  ------------------
  721|      0|      case s_start_req_or_res:
  ------------------
  |  Branch (721:7): [True: 0, False: 0]
  ------------------
  722|      0|      case s_start_res:
  ------------------
  |  Branch (722:7): [True: 0, False: 0]
  ------------------
  723|      0|      case s_start_req:
  ------------------
  |  Branch (723:7): [True: 0, False: 0]
  ------------------
  724|      0|        return 0;
  725|       |
  726|      0|      default:
  ------------------
  |  Branch (726:7): [True: 0, False: 0]
  ------------------
  727|      0|        SET_ERRNO(HPE_INVALID_EOF_STATE);
  ------------------
  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |   55|      0|do {                                                                 \
  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |   57|      0|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  ------------------
  ------------------
  728|      0|        return 1;
  729|      0|    }
  730|      0|  }
  731|       |
  732|       |
  733|  1.29k|  if (parser->state == s_header_field)
  ------------------
  |  Branch (733:7): [True: 0, False: 1.29k]
  ------------------
  734|      0|    header_field_mark = data;
  735|  1.29k|  if (parser->state == s_header_value)
  ------------------
  |  Branch (735:7): [True: 0, False: 1.29k]
  ------------------
  736|      0|    header_value_mark = data;
  737|  1.29k|  switch (parser->state) {
  ------------------
  |  Branch (737:11): [True: 0, False: 1.29k]
  ------------------
  738|      0|  case s_req_path:
  ------------------
  |  Branch (738:3): [True: 0, False: 1.29k]
  ------------------
  739|      0|  case s_req_scheme:
  ------------------
  |  Branch (739:3): [True: 0, False: 1.29k]
  ------------------
  740|      0|  case s_req_scheme_slash:
  ------------------
  |  Branch (740:3): [True: 0, False: 1.29k]
  ------------------
  741|      0|  case s_req_scheme_slash_slash:
  ------------------
  |  Branch (741:3): [True: 0, False: 1.29k]
  ------------------
  742|      0|  case s_req_server_start:
  ------------------
  |  Branch (742:3): [True: 0, False: 1.29k]
  ------------------
  743|      0|  case s_req_server:
  ------------------
  |  Branch (743:3): [True: 0, False: 1.29k]
  ------------------
  744|      0|  case s_req_server_with_at:
  ------------------
  |  Branch (744:3): [True: 0, False: 1.29k]
  ------------------
  745|      0|  case s_req_query_string_start:
  ------------------
  |  Branch (745:3): [True: 0, False: 1.29k]
  ------------------
  746|      0|  case s_req_query_string:
  ------------------
  |  Branch (746:3): [True: 0, False: 1.29k]
  ------------------
  747|      0|  case s_req_fragment_start:
  ------------------
  |  Branch (747:3): [True: 0, False: 1.29k]
  ------------------
  748|      0|  case s_req_fragment:
  ------------------
  |  Branch (748:3): [True: 0, False: 1.29k]
  ------------------
  749|      0|    url_mark = data;
  750|      0|    break;
  751|      0|  case s_res_status:
  ------------------
  |  Branch (751:3): [True: 0, False: 1.29k]
  ------------------
  752|      0|    status_mark = data;
  753|      0|    break;
  754|  1.29k|  }
  755|       |
  756|   121k|  for (p=data; p != data + len; p++) {
  ------------------
  |  Branch (756:16): [True: 120k, False: 826]
  ------------------
  757|   120k|    ch = *p;
  758|       |
  759|   120k|    if (PARSING_HEADER(parser->state)) {
  ------------------
  |  |  393|   120k|#define PARSING_HEADER(state) (state <= s_headers_done)
  |  |  ------------------
  |  |  |  Branch (393:31): [True: 120k, False: 6]
  |  |  ------------------
  ------------------
  760|   120k|      ++parser->nread;
  761|       |      /* Don't allow the total size of the HTTP headers (including the status
  762|       |       * line) to exceed HTTP_MAX_HEADER_SIZE.  This check is here to protect
  763|       |       * embedders against denial-of-service attacks where the attacker feeds
  764|       |       * us a never-ending header that the embedder keeps buffering.
  765|       |       *
  766|       |       * This check is arguably the responsibility of embedders but we're doing
  767|       |       * it on the embedder's behalf because most won't bother and this way we
  768|       |       * make the web a little safer.  HTTP_MAX_HEADER_SIZE is still far bigger
  769|       |       * than any reasonable request or response so this should never affect
  770|       |       * day-to-day operation.
  771|       |       */
  772|   120k|      if (parser->nread > (BRPC_HTTP_MAX_HEADER_SIZE)) {
  ------------------
  |  |   61|   120k|# define BRPC_HTTP_MAX_HEADER_SIZE (80*1024)
  ------------------
  |  Branch (772:11): [True: 0, False: 120k]
  ------------------
  773|      0|        SET_ERRNO(HPE_HEADER_OVERFLOW);
  ------------------
  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |   55|      0|do {                                                                 \
  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |   57|      0|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  ------------------
  ------------------
  774|      0|        goto error;
  775|      0|      }
  776|   120k|    }
  777|       |
  778|   135k|    reexecute_byte:
  779|   135k|    switch (parser->state) {
  780|       |
  781|    389|      case s_dead:
  ------------------
  |  Branch (781:7): [True: 389, False: 135k]
  ------------------
  782|       |        /* this state is used after a 'Connection: close' message
  783|       |         * the parser will error out if it reads another message
  784|       |         */
  785|    389|        if (ch == CR || ch == LF)
  ------------------
  |  |  474|    778|#define CR                  '\r'
  ------------------
                      if (ch == CR || ch == LF)
  ------------------
  |  |  475|    195|#define LF                  '\n'
  ------------------
  |  Branch (785:13): [True: 194, False: 195]
  |  Branch (785:25): [True: 194, False: 1]
  ------------------
  786|    388|          break;
  787|       |
  788|      1|        SET_ERRNO(HPE_CLOSED_CONNECTION);
  ------------------
  |  |   54|      1|#define SET_ERRNO(e)                                                 \
  |  |   55|      1|do {                                                                 \
  |  |   56|      1|  parser->http_errno = (e);                                          \
  |  |   57|      1|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 1]
  |  |  ------------------
  ------------------
  789|      1|        goto error;
  790|       |
  791|      0|      case s_start_req_or_res:
  ------------------
  |  Branch (791:7): [True: 0, False: 135k]
  ------------------
  792|      0|      {
  793|      0|        if (ch == CR || ch == LF)
  ------------------
  |  |  474|      0|#define CR                  '\r'
  ------------------
                      if (ch == CR || ch == LF)
  ------------------
  |  |  475|      0|#define LF                  '\n'
  ------------------
  |  Branch (793:13): [True: 0, False: 0]
  |  Branch (793:25): [True: 0, False: 0]
  ------------------
  794|      0|          break;
  795|      0|        parser->flags = 0;
  796|      0|        parser->uses_transfer_encoding = 0;
  797|      0|        parser->content_length = ULLONG_MAX;
  798|       |
  799|      0|        if (ch == 'H') {
  ------------------
  |  Branch (799:13): [True: 0, False: 0]
  ------------------
  800|      0|          parser->state = s_res_or_resp_H;
  801|       |
  802|      0|          CALLBACK_NOTIFY(message_begin);
  ------------------
  |  |   78|      0|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|      0|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|      0|do {                                                                 \
  |  |  |  |   63|      0|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|      0|                                                                     \
  |  |  |  |   65|      0|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|      0|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   67|      0|      SET_ERRNO(HPE_CB_##FOR);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   68|      0|    }                                                                \
  |  |  |  |   69|      0|                                                                     \
  |  |  |  |   70|      0|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|      0|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|      0|  }                                                                  \
  |  |  |  |   75|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (802:11): [True: 0, False: 0]
  ------------------
  803|      0|        } else {
  804|      0|          parser->type = HTTP_REQUEST;
  805|      0|          parser->state = s_start_req;
  806|      0|          goto reexecute_byte;
  807|      0|        }
  808|       |
  809|      0|        break;
  810|      0|      }
  811|       |
  812|      0|      case s_res_or_resp_H:
  ------------------
  |  Branch (812:7): [True: 0, False: 135k]
  ------------------
  813|      0|        if (ch == 'T') {
  ------------------
  |  Branch (813:13): [True: 0, False: 0]
  ------------------
  814|      0|          parser->type = HTTP_RESPONSE;
  815|      0|          parser->state = s_res_HT;
  816|      0|        } else {
  817|      0|          if (ch != 'E') {
  ------------------
  |  Branch (817:15): [True: 0, False: 0]
  ------------------
  818|      0|            SET_ERRNO(HPE_INVALID_CONSTANT);
  ------------------
  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |   55|      0|do {                                                                 \
  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |   57|      0|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  ------------------
  ------------------
  819|      0|            goto error;
  820|      0|          }
  821|       |
  822|      0|          parser->type = HTTP_REQUEST;
  823|      0|          parser->method = HTTP_HEAD;
  824|      0|          parser->index = 2;
  825|      0|          parser->state = s_req_method;
  826|      0|        }
  827|      0|        break;
  828|       |
  829|  2.59k|      case s_start_res:
  ------------------
  |  Branch (829:7): [True: 2.59k, False: 132k]
  ------------------
  830|  2.59k|      {
  831|  2.59k|        parser->flags = 0;
  832|  2.59k|        parser->uses_transfer_encoding = 0;
  833|  2.59k|        parser->content_length = ULLONG_MAX;
  834|       |
  835|  2.59k|        switch (ch) {
  836|  1.80k|          case 'H':
  ------------------
  |  Branch (836:11): [True: 1.80k, False: 786]
  ------------------
  837|  1.80k|            parser->state = s_res_H;
  838|  1.80k|            break;
  839|       |
  840|    199|          case CR:
  ------------------
  |  |  474|    199|#define CR                  '\r'
  ------------------
  |  Branch (840:11): [True: 199, False: 2.39k]
  ------------------
  841|    772|          case LF:
  ------------------
  |  |  475|    772|#define LF                  '\n'
  ------------------
  |  Branch (841:11): [True: 573, False: 2.01k]
  ------------------
  842|    772|            break;
  843|       |
  844|     14|          default:
  ------------------
  |  Branch (844:11): [True: 14, False: 2.57k]
  ------------------
  845|     14|            SET_ERRNO(HPE_INVALID_CONSTANT);
  ------------------
  |  |   54|     14|#define SET_ERRNO(e)                                                 \
  |  |   55|     14|do {                                                                 \
  |  |   56|     14|  parser->http_errno = (e);                                          \
  |  |   57|     14|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 14]
  |  |  ------------------
  ------------------
  846|     14|            goto error;
  847|  2.59k|        }
  848|       |
  849|  2.57k|        CALLBACK_NOTIFY(message_begin);
  ------------------
  |  |   78|  2.57k|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|  2.57k|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|  2.57k|do {                                                                 \
  |  |  |  |   63|  2.57k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|  2.57k|                                                                     \
  |  |  |  |   65|  2.57k|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 2.57k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|  2.57k|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 2.57k]
  |  |  |  |  ------------------
  |  |  |  |   67|      0|      SET_ERRNO(HPE_CB_##FOR);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   68|      0|    }                                                                \
  |  |  |  |   69|  2.57k|                                                                     \
  |  |  |  |   70|  2.57k|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|  2.57k|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  2.57k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 2.57k]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|  2.57k|  }                                                                  \
  |  |  |  |   75|  2.57k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 2.57k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (849:9): [True: 2.57k, False: 0]
  ------------------
  850|  2.57k|        break;
  851|  2.57k|      }
  852|       |
  853|  2.57k|      case s_res_H:
  ------------------
  |  Branch (853:7): [True: 1.80k, False: 133k]
  ------------------
  854|  1.80k|        STRICT_CHECK(ch != 'T');
  ------------------
  |  |  513|  1.80k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  1.80k|do {                                                                 \
  |  |  515|  1.80k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 12, False: 1.78k]
  |  |  ------------------
  |  |  516|     12|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|     12|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|     12|do {                                                                 \
  |  |  |  |   56|     12|  parser->http_errno = (e);                                          \
  |  |  |  |   57|     12|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|     12|    goto error;                                                      \
  |  |  518|     12|  }                                                                  \
  |  |  519|  1.80k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 1.78k]
  |  |  ------------------
  ------------------
  855|  1.78k|        parser->state = s_res_HT;
  856|  1.78k|        break;
  857|       |
  858|  1.78k|      case s_res_HT:
  ------------------
  |  Branch (858:7): [True: 1.78k, False: 133k]
  ------------------
  859|  1.78k|        STRICT_CHECK(ch != 'T');
  ------------------
  |  |  513|  1.78k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  1.78k|do {                                                                 \
  |  |  515|  1.78k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 11, False: 1.77k]
  |  |  ------------------
  |  |  516|     11|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|     11|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|     11|do {                                                                 \
  |  |  |  |   56|     11|  parser->http_errno = (e);                                          \
  |  |  |  |   57|     11|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|     11|    goto error;                                                      \
  |  |  518|     11|  }                                                                  \
  |  |  519|  1.78k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 1.77k]
  |  |  ------------------
  ------------------
  860|  1.77k|        parser->state = s_res_HTT;
  861|  1.77k|        break;
  862|       |
  863|  1.77k|      case s_res_HTT:
  ------------------
  |  Branch (863:7): [True: 1.77k, False: 133k]
  ------------------
  864|  1.77k|        STRICT_CHECK(ch != 'P');
  ------------------
  |  |  513|  1.77k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  1.77k|do {                                                                 \
  |  |  515|  1.77k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 13, False: 1.76k]
  |  |  ------------------
  |  |  516|     13|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|     13|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|     13|do {                                                                 \
  |  |  |  |   56|     13|  parser->http_errno = (e);                                          \
  |  |  |  |   57|     13|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 13]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|     13|    goto error;                                                      \
  |  |  518|     13|  }                                                                  \
  |  |  519|  1.77k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 1.76k]
  |  |  ------------------
  ------------------
  865|  1.76k|        parser->state = s_res_HTTP;
  866|  1.76k|        break;
  867|       |
  868|  1.76k|      case s_res_HTTP:
  ------------------
  |  Branch (868:7): [True: 1.76k, False: 133k]
  ------------------
  869|  1.76k|        STRICT_CHECK(ch != '/');
  ------------------
  |  |  513|  1.76k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  1.76k|do {                                                                 \
  |  |  515|  1.76k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 1, False: 1.76k]
  |  |  ------------------
  |  |  516|      1|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|      1|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|      1|do {                                                                 \
  |  |  |  |   56|      1|  parser->http_errno = (e);                                          \
  |  |  |  |   57|      1|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|      1|    goto error;                                                      \
  |  |  518|      1|  }                                                                  \
  |  |  519|  1.76k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 1.76k]
  |  |  ------------------
  ------------------
  870|  1.76k|        parser->state = s_res_first_http_major;
  871|  1.76k|        break;
  872|       |
  873|  1.76k|      case s_res_first_http_major:
  ------------------
  |  Branch (873:7): [True: 1.76k, False: 133k]
  ------------------
  874|  1.76k|        if (ch < '0' || ch > '9') {
  ------------------
  |  Branch (874:13): [True: 8, False: 1.75k]
  |  Branch (874:25): [True: 4, False: 1.74k]
  ------------------
  875|     12|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|     12|#define SET_ERRNO(e)                                                 \
  |  |   55|     12|do {                                                                 \
  |  |   56|     12|  parser->http_errno = (e);                                          \
  |  |   57|     12|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 12]
  |  |  ------------------
  ------------------
  876|     12|          goto error;
  877|     12|        }
  878|       |
  879|  1.74k|        parser->http_major = ch - '0';
  880|  1.74k|        parser->state = s_res_http_major;
  881|  1.74k|        break;
  882|       |
  883|       |      /* major HTTP version or dot */
  884|  1.96k|      case s_res_http_major:
  ------------------
  |  Branch (884:7): [True: 1.96k, False: 133k]
  ------------------
  885|  1.96k|      {
  886|  1.96k|        if (ch == '.') {
  ------------------
  |  Branch (886:13): [True: 1.70k, False: 263]
  ------------------
  887|  1.70k|          parser->state = s_res_first_http_minor;
  888|  1.70k|          break;
  889|  1.70k|        }
  890|       |
  891|    263|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|    263|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 253, False: 10]
  |  |  |  Branch (478:44): [True: 247, False: 6]
  |  |  ------------------
  ------------------
  892|     16|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|     16|#define SET_ERRNO(e)                                                 \
  |  |   55|     16|do {                                                                 \
  |  |   56|     16|  parser->http_errno = (e);                                          \
  |  |   57|     16|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 16]
  |  |  ------------------
  ------------------
  893|     16|          goto error;
  894|     16|        }
  895|       |
  896|    247|        parser->http_major *= 10;
  897|    247|        parser->http_major += ch - '0';
  898|       |
  899|    247|        if (parser->http_major > 999) {
  ------------------
  |  Branch (899:13): [True: 4, False: 243]
  ------------------
  900|      4|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|      4|#define SET_ERRNO(e)                                                 \
  |  |   55|      4|do {                                                                 \
  |  |   56|      4|  parser->http_errno = (e);                                          \
  |  |   57|      4|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 4]
  |  |  ------------------
  ------------------
  901|      4|          goto error;
  902|      4|        }
  903|       |
  904|    243|        break;
  905|    247|      }
  906|       |
  907|       |      /* first digit of minor HTTP version */
  908|  1.69k|      case s_res_first_http_minor:
  ------------------
  |  Branch (908:7): [True: 1.69k, False: 133k]
  ------------------
  909|  1.69k|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|  1.69k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 1.69k, False: 6]
  |  |  |  Branch (478:44): [True: 1.68k, False: 6]
  |  |  ------------------
  ------------------
  910|     12|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|     12|#define SET_ERRNO(e)                                                 \
  |  |   55|     12|do {                                                                 \
  |  |   56|     12|  parser->http_errno = (e);                                          \
  |  |   57|     12|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 12]
  |  |  ------------------
  ------------------
  911|     12|          goto error;
  912|     12|        }
  913|       |
  914|  1.68k|        parser->http_minor = ch - '0';
  915|  1.68k|        parser->state = s_res_http_minor;
  916|  1.68k|        break;
  917|       |
  918|       |      /* minor HTTP version or end of request line */
  919|  1.91k|      case s_res_http_minor:
  ------------------
  |  Branch (919:7): [True: 1.91k, False: 133k]
  ------------------
  920|  1.91k|      {
  921|  1.91k|        if (ch == ' ') {
  ------------------
  |  Branch (921:13): [True: 1.64k, False: 272]
  ------------------
  922|  1.64k|          parser->state = s_res_first_status_code;
  923|  1.64k|          break;
  924|  1.64k|        }
  925|       |
  926|    272|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|    272|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 263, False: 9]
  |  |  |  Branch (478:44): [True: 258, False: 5]
  |  |  ------------------
  ------------------
  927|     14|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|     14|#define SET_ERRNO(e)                                                 \
  |  |   55|     14|do {                                                                 \
  |  |   56|     14|  parser->http_errno = (e);                                          \
  |  |   57|     14|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 14]
  |  |  ------------------
  ------------------
  928|     14|          goto error;
  929|     14|        }
  930|       |
  931|    258|        parser->http_minor *= 10;
  932|    258|        parser->http_minor += ch - '0';
  933|       |
  934|    258|        if (parser->http_minor > 999) {
  ------------------
  |  Branch (934:13): [True: 3, False: 255]
  ------------------
  935|      3|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|      3|#define SET_ERRNO(e)                                                 \
  |  |   55|      3|do {                                                                 \
  |  |   56|      3|  parser->http_errno = (e);                                          \
  |  |   57|      3|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 3]
  |  |  ------------------
  ------------------
  936|      3|          goto error;
  937|      3|        }
  938|       |
  939|    255|        break;
  940|    258|      }
  941|       |
  942|  1.86k|      case s_res_first_status_code:
  ------------------
  |  Branch (942:7): [True: 1.86k, False: 133k]
  ------------------
  943|  1.86k|      {
  944|  1.86k|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|  1.86k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 1.62k, False: 235]
  |  |  |  Branch (478:44): [True: 1.62k, False: 4]
  |  |  ------------------
  ------------------
  945|    239|          if (ch == ' ') {
  ------------------
  |  Branch (945:15): [True: 226, False: 13]
  ------------------
  946|    226|            break;
  947|    226|          }
  948|       |
  949|     13|          SET_ERRNO(HPE_INVALID_STATUS);
  ------------------
  |  |   54|     13|#define SET_ERRNO(e)                                                 \
  |  |   55|     13|do {                                                                 \
  |  |   56|     13|  parser->http_errno = (e);                                          \
  |  |   57|     13|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 13]
  |  |  ------------------
  ------------------
  950|     13|          goto error;
  951|    239|        }
  952|  1.62k|        parser->status_code = ch - '0';
  953|  1.62k|        parser->state = s_res_status_code;
  954|  1.62k|        break;
  955|  1.86k|      }
  956|       |
  957|  4.73k|      case s_res_status_code:
  ------------------
  |  Branch (957:7): [True: 4.73k, False: 130k]
  ------------------
  958|  4.73k|      {
  959|  4.73k|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|  4.73k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 3.13k, False: 1.60k]
  |  |  |  Branch (478:44): [True: 3.13k, False: 2]
  |  |  ------------------
  ------------------
  960|  1.60k|          switch (ch) {
  961|  1.06k|            case ' ':
  ------------------
  |  Branch (961:13): [True: 1.06k, False: 544]
  ------------------
  962|  1.06k|              parser->state = s_res_status_start;
  963|  1.06k|              break;
  964|     99|            case CR:
  ------------------
  |  |  474|     99|#define CR                  '\r'
  ------------------
  |  Branch (964:13): [True: 99, False: 1.50k]
  ------------------
  965|     99|              parser->state = s_res_line_almost_done;
  966|     99|              break;
  967|    436|            case LF:
  ------------------
  |  |  475|    436|#define LF                  '\n'
  ------------------
  |  Branch (967:13): [True: 436, False: 1.16k]
  ------------------
  968|    436|              parser->state = s_header_field_start;
  969|    436|              break;
  970|      9|            default:
  ------------------
  |  Branch (970:13): [True: 9, False: 1.59k]
  ------------------
  971|      9|              SET_ERRNO(HPE_INVALID_STATUS);
  ------------------
  |  |   54|      9|#define SET_ERRNO(e)                                                 \
  |  |   55|      9|do {                                                                 \
  |  |   56|      9|  parser->http_errno = (e);                                          \
  |  |   57|      9|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 9]
  |  |  ------------------
  ------------------
  972|      9|              goto error;
  973|  1.60k|          }
  974|  1.59k|          break;
  975|  1.60k|        }
  976|       |
  977|  3.13k|        parser->status_code *= 10;
  978|  3.13k|        parser->status_code += ch - '0';
  979|       |
  980|  3.13k|        if (parser->status_code > 999) {
  ------------------
  |  Branch (980:13): [True: 3, False: 3.12k]
  ------------------
  981|      3|          SET_ERRNO(HPE_INVALID_STATUS);
  ------------------
  |  |   54|      3|#define SET_ERRNO(e)                                                 \
  |  |   55|      3|do {                                                                 \
  |  |   56|      3|  parser->http_errno = (e);                                          \
  |  |   57|      3|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 3]
  |  |  ------------------
  ------------------
  982|      3|          goto error;
  983|      3|        }
  984|       |
  985|  3.12k|        break;
  986|  3.13k|      }
  987|       |
  988|  3.12k|      case s_res_status_start:
  ------------------
  |  Branch (988:7): [True: 1.06k, False: 134k]
  ------------------
  989|  1.06k|      {
  990|  1.06k|        if (ch == CR) {
  ------------------
  |  |  474|  1.06k|#define CR                  '\r'
  ------------------
  |  Branch (990:13): [True: 430, False: 630]
  ------------------
  991|    430|          parser->state = s_res_line_almost_done;
  992|    430|          break;
  993|    430|        }
  994|       |
  995|    630|        if (ch == LF) {
  ------------------
  |  |  475|    630|#define LF                  '\n'
  ------------------
  |  Branch (995:13): [True: 104, False: 526]
  ------------------
  996|    104|          parser->state = s_header_field_start;
  997|    104|          break;
  998|    104|        }
  999|       |
 1000|    526|        MARK(status);
  ------------------
  |  |  112|    526|#define MARK(FOR)                                                    \
  |  |  113|    526|do {                                                                 \
  |  |  114|    526|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 526, False: 0]
  |  |  ------------------
  |  |  115|    526|    FOR##_mark = p;                                                  \
  |  |  116|    526|  }                                                                  \
  |  |  117|    526|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 526]
  |  |  ------------------
  ------------------
 1001|    526|        parser->state = s_res_status;
 1002|    526|        parser->index = 0;
 1003|    526|        break;
 1004|    630|      }
 1005|       |
 1006|  2.19k|      case s_res_status:
  ------------------
  |  Branch (1006:7): [True: 2.19k, False: 133k]
  ------------------
 1007|  2.19k|        if (ch == CR) {
  ------------------
  |  |  474|  2.19k|#define CR                  '\r'
  ------------------
  |  Branch (1007:13): [True: 245, False: 1.94k]
  ------------------
 1008|    245|          parser->state = s_res_line_almost_done;
 1009|    245|          CALLBACK_DATA(status);
  ------------------
  |  |  105|    245|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|    245|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    245|do {                                                                 \
  |  |  |  |   86|    245|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    245|                                                                     \
  |  |  |  |   88|    245|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 245, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|    245|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 0, False: 245]
  |  |  |  |  ------------------
  |  |  |  |   90|      0|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|        SET_ERRNO(HPE_CB_##FOR);                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|      }                                                              \
  |  |  |  |   93|      0|                                                                     \
  |  |  |  |   94|      0|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|      0|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|      0|    }                                                                \
  |  |  |  |   99|    245|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    245|  }                                                                  \
  |  |  |  |  101|    245|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 245]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1009:11): [True: 245, False: 0]
  ------------------
 1010|    245|          break;
 1011|    245|        }
 1012|       |
 1013|  1.94k|        if (ch == LF) {
  ------------------
  |  |  475|  1.94k|#define LF                  '\n'
  ------------------
  |  Branch (1013:13): [True: 271, False: 1.67k]
  ------------------
 1014|    271|          parser->state = s_header_field_start;
 1015|    271|          CALLBACK_DATA(status);
  ------------------
  |  |  105|    271|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|    271|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    271|do {                                                                 \
  |  |  |  |   86|    271|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    271|                                                                     \
  |  |  |  |   88|    271|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 271, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|    271|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 0, False: 271]
  |  |  |  |  ------------------
  |  |  |  |   90|      0|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|        SET_ERRNO(HPE_CB_##FOR);                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|      }                                                              \
  |  |  |  |   93|      0|                                                                     \
  |  |  |  |   94|      0|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|      0|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|      0|    }                                                                \
  |  |  |  |   99|    271|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    271|  }                                                                  \
  |  |  |  |  101|    271|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 271]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1015:11): [True: 271, False: 0]
  ------------------
 1016|    271|          break;
 1017|    271|        }
 1018|       |
 1019|  1.67k|        break;
 1020|       |
 1021|  1.67k|      case s_res_line_almost_done:
  ------------------
  |  Branch (1021:7): [True: 759, False: 134k]
  ------------------
 1022|    759|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|    759|# define STRICT_CHECK(cond)                                          \
  |  |  514|    759|do {                                                                 \
  |  |  515|    759|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 2, False: 757]
  |  |  ------------------
  |  |  516|      2|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|      2|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|      2|do {                                                                 \
  |  |  |  |   56|      2|  parser->http_errno = (e);                                          \
  |  |  |  |   57|      2|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|      2|    goto error;                                                      \
  |  |  518|      2|  }                                                                  \
  |  |  519|    759|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 757]
  |  |  ------------------
  ------------------
 1023|    757|        parser->state = s_header_field_start;
 1024|    757|        break;
 1025|       |
 1026|  3.98k|      case s_start_req:
  ------------------
  |  Branch (1026:7): [True: 3.98k, False: 131k]
  ------------------
 1027|  3.98k|      {
 1028|  3.98k|        if (ch == CR || ch == LF)
  ------------------
  |  |  474|  7.97k|#define CR                  '\r'
  ------------------
                      if (ch == CR || ch == LF)
  ------------------
  |  |  475|  3.12k|#define LF                  '\n'
  ------------------
  |  Branch (1028:13): [True: 857, False: 3.12k]
  |  Branch (1028:25): [True: 876, False: 2.25k]
  ------------------
 1029|  1.73k|          break;
 1030|  2.25k|        parser->flags = 0;
 1031|  2.25k|        parser->uses_transfer_encoding = 0;
 1032|  2.25k|        parser->content_length = ULLONG_MAX;
 1033|       |
 1034|  2.25k|        if (!IS_ALPHA(ch)) {
  ------------------
  |  |  477|  2.25k|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|  2.25k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|  2.24k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |  |  Branch (477:30): [True: 2.24k, False: 9]
  |  |  |  Branch (477:49): [True: 2.23k, False: 9]
  |  |  ------------------
  ------------------
 1035|     18|          SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|     18|#define SET_ERRNO(e)                                                 \
  |  |   55|     18|do {                                                                 \
  |  |   56|     18|  parser->http_errno = (e);                                          \
  |  |   57|     18|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 18]
  |  |  ------------------
  ------------------
 1036|     18|          goto error;
 1037|     18|        }
 1038|       |
 1039|  2.23k|        parser->method = (enum http_method) 0;
 1040|  2.23k|        parser->index = 1;
 1041|  2.23k|        switch (ch) {
 1042|     28|          case 'C': parser->method = HTTP_CONNECT; /* or COPY, CHECKOUT */ break;
  ------------------
  |  Branch (1042:11): [True: 28, False: 2.20k]
  ------------------
 1043|      2|          case 'D': parser->method = HTTP_DELETE; break;
  ------------------
  |  Branch (1043:11): [True: 2, False: 2.23k]
  ------------------
 1044|  2.08k|          case 'G': parser->method = HTTP_GET; break;
  ------------------
  |  Branch (1044:11): [True: 2.08k, False: 152]
  ------------------
 1045|      2|          case 'H': parser->method = HTTP_HEAD; break;
  ------------------
  |  Branch (1045:11): [True: 2, False: 2.23k]
  ------------------
 1046|      4|          case 'L': parser->method = HTTP_LOCK; break;
  ------------------
  |  Branch (1046:11): [True: 4, False: 2.23k]
  ------------------
 1047|     49|          case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH, MKCALENDAR */ break;
  ------------------
  |  Branch (1047:11): [True: 49, False: 2.18k]
  ------------------
 1048|      1|          case 'N': parser->method = HTTP_NOTIFY; break;
  ------------------
  |  Branch (1048:11): [True: 1, False: 2.23k]
  ------------------
 1049|      2|          case 'O': parser->method = HTTP_OPTIONS; break;
  ------------------
  |  Branch (1049:11): [True: 2, False: 2.23k]
  ------------------
 1050|     40|          case 'P': parser->method = HTTP_POST;
  ------------------
  |  Branch (1050:11): [True: 40, False: 2.19k]
  ------------------
 1051|       |            /* or PROPFIND|PROPPATCH|PUT|PATCH|PURGE */
 1052|     40|            break;
 1053|      3|          case 'R': parser->method = HTTP_REPORT; break;
  ------------------
  |  Branch (1053:11): [True: 3, False: 2.23k]
  ------------------
 1054|     10|          case 'S': parser->method = HTTP_SUBSCRIBE; /* or SEARCH */ break;
  ------------------
  |  Branch (1054:11): [True: 10, False: 2.22k]
  ------------------
 1055|      1|          case 'T': parser->method = HTTP_TRACE; break;
  ------------------
  |  Branch (1055:11): [True: 1, False: 2.23k]
  ------------------
 1056|      7|          case 'U': parser->method = HTTP_UNLOCK; /* or UNSUBSCRIBE */ break;
  ------------------
  |  Branch (1056:11): [True: 7, False: 2.22k]
  ------------------
 1057|      3|          default:
  ------------------
  |  Branch (1057:11): [True: 3, False: 2.23k]
  ------------------
 1058|      3|            SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|      3|#define SET_ERRNO(e)                                                 \
  |  |   55|      3|do {                                                                 \
  |  |   56|      3|  parser->http_errno = (e);                                          \
  |  |   57|      3|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 3]
  |  |  ------------------
  ------------------
 1059|      3|            goto error;
 1060|  2.23k|        }
 1061|  2.23k|        parser->state = s_req_method;
 1062|       |
 1063|  2.23k|        CALLBACK_NOTIFY(message_begin);
  ------------------
  |  |   78|  2.23k|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|  2.23k|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|  2.23k|do {                                                                 \
  |  |  |  |   63|  2.23k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|  2.23k|                                                                     \
  |  |  |  |   65|  2.23k|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 2.23k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|  2.23k|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 2.23k]
  |  |  |  |  ------------------
  |  |  |  |   67|      0|      SET_ERRNO(HPE_CB_##FOR);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   68|      0|    }                                                                \
  |  |  |  |   69|  2.23k|                                                                     \
  |  |  |  |   70|  2.23k|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|  2.23k|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  2.23k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 2.23k]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|  2.23k|  }                                                                  \
  |  |  |  |   75|  2.23k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 2.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1063:9): [True: 2.23k, False: 0]
  ------------------
 1064|       |
 1065|  2.23k|        break;
 1066|  2.23k|      }
 1067|       |
 1068|  6.55k|      case s_req_method:
  ------------------
  |  Branch (1068:7): [True: 6.55k, False: 128k]
  ------------------
 1069|  6.55k|      {
 1070|  6.55k|        const char *matcher;
 1071|  6.55k|        if (ch == '\0') {
  ------------------
  |  Branch (1071:13): [True: 2, False: 6.55k]
  ------------------
 1072|      2|          SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|      2|#define SET_ERRNO(e)                                                 \
  |  |   55|      2|do {                                                                 \
  |  |   56|      2|  parser->http_errno = (e);                                          \
  |  |   57|      2|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 2]
  |  |  ------------------
  ------------------
 1073|      2|          goto error;
 1074|      2|        }
 1075|       |
 1076|  6.55k|        matcher = method_strings[parser->method];
 1077|  6.55k|        if (ch == ' ' && matcher[parser->index] == '\0') {
  ------------------
  |  Branch (1077:13): [True: 2.09k, False: 4.46k]
  |  Branch (1077:26): [True: 2.08k, False: 8]
  ------------------
 1078|  2.08k|          parser->state = s_req_spaces_before_url;
 1079|  4.47k|        } else if (ch == matcher[parser->index]) {
  ------------------
  |  Branch (1079:20): [True: 4.29k, False: 176]
  ------------------
 1080|  4.29k|          ; /* nada */
 1081|  4.29k|        } else if (parser->method == HTTP_CONNECT) {
  ------------------
  |  Branch (1081:20): [True: 24, False: 152]
  ------------------
 1082|     24|          if (parser->index == 1 && ch == 'H') {
  ------------------
  |  Branch (1082:15): [True: 2, False: 22]
  |  Branch (1082:37): [True: 1, False: 1]
  ------------------
 1083|      1|            parser->method = HTTP_CHECKOUT;
 1084|     23|          } else if (parser->index == 2  && ch == 'P') {
  ------------------
  |  Branch (1084:22): [True: 16, False: 7]
  |  Branch (1084:45): [True: 4, False: 12]
  ------------------
 1085|      4|            parser->method = HTTP_COPY;
 1086|     19|          } else {
 1087|     19|            SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|     19|#define SET_ERRNO(e)                                                 \
  |  |   55|     19|do {                                                                 \
  |  |   56|     19|  parser->http_errno = (e);                                          \
  |  |   57|     19|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 19]
  |  |  ------------------
  ------------------
 1088|     19|            goto error;
 1089|     19|          }
 1090|    152|        } else if (parser->method == HTTP_MKCOL) {
  ------------------
  |  Branch (1090:20): [True: 46, False: 106]
  ------------------
 1091|     46|          if (parser->index == 1 && ch == 'O') {
  ------------------
  |  Branch (1091:15): [True: 23, False: 23]
  |  Branch (1091:37): [True: 1, False: 22]
  ------------------
 1092|      1|            parser->method = HTTP_MOVE;
 1093|     45|          } else if (parser->index == 1 && ch == 'E') {
  ------------------
  |  Branch (1093:22): [True: 22, False: 23]
  |  Branch (1093:44): [True: 1, False: 21]
  ------------------
 1094|      1|            parser->method = HTTP_MERGE;
 1095|     44|          } else if (parser->index == 1 && ch == '-') {
  ------------------
  |  Branch (1095:22): [True: 21, False: 23]
  |  Branch (1095:44): [True: 1, False: 20]
  ------------------
 1096|      1|            parser->method = HTTP_MSEARCH;
 1097|     43|          } else if (parser->index == 2 && ch == 'A') {
  ------------------
  |  Branch (1097:22): [True: 14, False: 29]
  |  Branch (1097:44): [True: 4, False: 10]
  ------------------
 1098|      4|            parser->method = HTTP_MKACTIVITY;
 1099|     39|          } else if (parser->index == 3 && ch == 'A') {
  ------------------
  |  Branch (1099:22): [True: 7, False: 32]
  |  Branch (1099:44): [True: 2, False: 5]
  ------------------
 1100|      2|            parser->method = HTTP_MKCALENDAR;
 1101|     37|          } else {
 1102|     37|            SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|     37|#define SET_ERRNO(e)                                                 \
  |  |   55|     37|do {                                                                 \
  |  |   56|     37|  parser->http_errno = (e);                                          \
  |  |   57|     37|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 37]
  |  |  ------------------
  ------------------
 1103|     37|            goto error;
 1104|     37|          }
 1105|    106|        } else if (parser->method == HTTP_SUBSCRIBE) {
  ------------------
  |  Branch (1105:20): [True: 10, False: 96]
  ------------------
 1106|     10|          if (parser->index == 1 && ch == 'E') {
  ------------------
  |  Branch (1106:15): [True: 7, False: 3]
  |  Branch (1106:37): [True: 1, False: 6]
  ------------------
 1107|      1|            parser->method = HTTP_SEARCH;
 1108|      9|          } else {
 1109|      9|            SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|      9|#define SET_ERRNO(e)                                                 \
  |  |   55|      9|do {                                                                 \
  |  |   56|      9|  parser->http_errno = (e);                                          \
  |  |   57|      9|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 9]
  |  |  ------------------
  ------------------
 1110|      9|            goto error;
 1111|      9|          }
 1112|     96|        } else if (parser->index == 1 && parser->method == HTTP_POST) {
  ------------------
  |  Branch (1112:20): [True: 51, False: 45]
  |  Branch (1112:42): [True: 39, False: 12]
  ------------------
 1113|     39|          if (ch == 'R') {
  ------------------
  |  Branch (1113:15): [True: 3, False: 36]
  ------------------
 1114|      3|            parser->method = HTTP_PROPFIND; /* or HTTP_PROPPATCH */
 1115|     36|          } else if (ch == 'U') {
  ------------------
  |  Branch (1115:22): [True: 15, False: 21]
  ------------------
 1116|     15|            parser->method = HTTP_PUT; /* or HTTP_PURGE */
 1117|     21|          } else if (ch == 'A') {
  ------------------
  |  Branch (1117:22): [True: 1, False: 20]
  ------------------
 1118|      1|            parser->method = HTTP_PATCH;
 1119|     20|          } else {
 1120|     20|            SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|     20|#define SET_ERRNO(e)                                                 \
  |  |   55|     20|do {                                                                 \
  |  |   56|     20|  parser->http_errno = (e);                                          \
  |  |   57|     20|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 20]
  |  |  ------------------
  ------------------
 1121|     20|            goto error;
 1122|     20|          }
 1123|     57|        } else if (parser->index == 2) {
  ------------------
  |  Branch (1123:20): [True: 31, False: 26]
  ------------------
 1124|     31|          if (parser->method == HTTP_PUT) {
  ------------------
  |  Branch (1124:15): [True: 12, False: 19]
  ------------------
 1125|     12|            if (ch == 'R') {
  ------------------
  |  Branch (1125:17): [True: 1, False: 11]
  ------------------
 1126|      1|              parser->method = HTTP_PURGE;
 1127|     11|            } else {
 1128|     11|              SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|     11|#define SET_ERRNO(e)                                                 \
  |  |   55|     11|do {                                                                 \
  |  |   56|     11|  parser->http_errno = (e);                                          \
  |  |   57|     11|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 11]
  |  |  ------------------
  ------------------
 1129|     11|              goto error;
 1130|     11|            }
 1131|     19|          } else if (parser->method == HTTP_UNLOCK) {
  ------------------
  |  Branch (1131:22): [True: 7, False: 12]
  ------------------
 1132|      7|            if (ch == 'S') {
  ------------------
  |  Branch (1132:17): [True: 2, False: 5]
  ------------------
 1133|      2|              parser->method = HTTP_UNSUBSCRIBE;
 1134|      5|            } else {
 1135|      5|              SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|      5|#define SET_ERRNO(e)                                                 \
  |  |   55|      5|do {                                                                 \
  |  |   56|      5|  parser->http_errno = (e);                                          \
  |  |   57|      5|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 5]
  |  |  ------------------
  ------------------
 1136|      5|              goto error;
 1137|      5|            }
 1138|     12|          } else {
 1139|     12|            SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|     12|#define SET_ERRNO(e)                                                 \
  |  |   55|     12|do {                                                                 \
  |  |   56|     12|  parser->http_errno = (e);                                          \
  |  |   57|     12|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 12]
  |  |  ------------------
  ------------------
 1140|     12|            goto error;
 1141|     12|          }
 1142|     31|        } else if (parser->index == 4 && parser->method == HTTP_PROPFIND && ch == 'P') {
  ------------------
  |  Branch (1142:20): [True: 6, False: 20]
  |  Branch (1142:42): [True: 2, False: 4]
  |  Branch (1142:77): [True: 1, False: 1]
  ------------------
 1143|      1|          parser->method = HTTP_PROPPATCH;
 1144|     25|        } else {
 1145|     25|          SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|     25|#define SET_ERRNO(e)                                                 \
  |  |   55|     25|do {                                                                 \
  |  |   56|     25|  parser->http_errno = (e);                                          \
  |  |   57|     25|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 25]
  |  |  ------------------
  ------------------
 1146|     25|          goto error;
 1147|     25|        }
 1148|       |
 1149|  6.41k|        ++parser->index;
 1150|  6.41k|        break;
 1151|  6.55k|      }
 1152|       |
 1153|  2.27k|      case s_req_spaces_before_url:
  ------------------
  |  Branch (1153:7): [True: 2.27k, False: 133k]
  ------------------
 1154|  2.27k|      {
 1155|  2.27k|        if (ch == ' ') break;
  ------------------
  |  Branch (1155:13): [True: 200, False: 2.07k]
  ------------------
 1156|       |
 1157|  2.07k|        MARK(url);
  ------------------
  |  |  112|  2.07k|#define MARK(FOR)                                                    \
  |  |  113|  2.07k|do {                                                                 \
  |  |  114|  2.07k|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 2.07k, False: 0]
  |  |  ------------------
  |  |  115|  2.07k|    FOR##_mark = p;                                                  \
  |  |  116|  2.07k|  }                                                                  \
  |  |  117|  2.07k|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 2.07k]
  |  |  ------------------
  ------------------
 1158|  2.07k|        if (parser->method == HTTP_CONNECT) {
  ------------------
  |  Branch (1158:13): [True: 4, False: 2.07k]
  ------------------
 1159|      4|          parser->state = s_req_server_start;
 1160|      4|        }
 1161|       |
 1162|       |        /* Don't change parser->state when the new state is s_dead otherwise
 1163|       |           parser->state is always s_dead after failure which is not
 1164|       |           informational for debugging. The parser is known to be failed by
 1165|       |           checking http_errno.
 1166|       |        */
 1167|  2.07k|        enum state new_state = parse_url_char((enum state)parser->state, ch);
 1168|  2.07k|        if (new_state == s_dead) {
  ------------------
  |  Branch (1168:13): [True: 4, False: 2.07k]
  ------------------
 1169|      4|          SET_ERRNO(HPE_INVALID_URL);
  ------------------
  |  |   54|      4|#define SET_ERRNO(e)                                                 \
  |  |   55|      4|do {                                                                 \
  |  |   56|      4|  parser->http_errno = (e);                                          \
  |  |   57|      4|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 4]
  |  |  ------------------
  ------------------
 1170|      4|          goto error;
 1171|      4|        }
 1172|  2.07k|        parser->state = new_state;
 1173|       |
 1174|  2.07k|        break;
 1175|  2.07k|      }
 1176|       |
 1177|    416|      case s_req_scheme:
  ------------------
  |  Branch (1177:7): [True: 416, False: 135k]
  ------------------
 1178|    595|      case s_req_scheme_slash:
  ------------------
  |  Branch (1178:7): [True: 179, False: 135k]
  ------------------
 1179|    771|      case s_req_scheme_slash_slash:
  ------------------
  |  Branch (1179:7): [True: 176, False: 135k]
  ------------------
 1180|    944|      case s_req_server_start:
  ------------------
  |  Branch (1180:7): [True: 173, False: 135k]
  ------------------
 1181|    944|      {
 1182|    944|        enum state new_state;
 1183|    944|        switch (ch) {
 1184|       |          /* No whitespace allowed here */
 1185|      4|          case ' ':
  ------------------
  |  Branch (1185:11): [True: 4, False: 940]
  ------------------
 1186|      5|          case CR:
  ------------------
  |  |  474|      5|#define CR                  '\r'
  ------------------
  |  Branch (1186:11): [True: 1, False: 943]
  ------------------
 1187|      6|          case LF:
  ------------------
  |  |  475|      6|#define LF                  '\n'
  ------------------
  |  Branch (1187:11): [True: 1, False: 943]
  ------------------
 1188|      6|            SET_ERRNO(HPE_INVALID_URL);
  ------------------
  |  |   54|      6|#define SET_ERRNO(e)                                                 \
  |  |   55|      6|do {                                                                 \
  |  |   56|      6|  parser->http_errno = (e);                                          \
  |  |   57|      6|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 6]
  |  |  ------------------
  ------------------
 1189|      6|            goto error;
 1190|    938|          default:
  ------------------
  |  Branch (1190:11): [True: 938, False: 6]
  ------------------
 1191|    938|            new_state = parse_url_char((enum state)parser->state, ch);
 1192|    938|            if (new_state == s_dead) {
  ------------------
  |  Branch (1192:17): [True: 9, False: 929]
  ------------------
 1193|      9|              SET_ERRNO(HPE_INVALID_URL);
  ------------------
  |  |   54|      9|#define SET_ERRNO(e)                                                 \
  |  |   55|      9|do {                                                                 \
  |  |   56|      9|  parser->http_errno = (e);                                          \
  |  |   57|      9|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 9]
  |  |  ------------------
  ------------------
 1194|      9|              goto error;
 1195|      9|            }
 1196|    929|            parser->state = new_state;
 1197|    944|        }
 1198|       |
 1199|    929|        break;
 1200|    944|      }
 1201|       |
 1202|    929|      case s_req_server:
  ------------------
  |  Branch (1202:7): [True: 450, False: 135k]
  ------------------
 1203|    652|      case s_req_server_with_at:
  ------------------
  |  Branch (1203:7): [True: 202, False: 135k]
  ------------------
 1204|  4.22k|      case s_req_path:
  ------------------
  |  Branch (1204:7): [True: 3.57k, False: 131k]
  ------------------
 1205|  4.50k|      case s_req_query_string_start:
  ------------------
  |  Branch (1205:7): [True: 279, False: 135k]
  ------------------
 1206|  5.09k|      case s_req_query_string:
  ------------------
  |  Branch (1206:7): [True: 596, False: 134k]
  ------------------
 1207|  5.66k|      case s_req_fragment_start:
  ------------------
  |  Branch (1207:7): [True: 565, False: 134k]
  ------------------
 1208|  6.39k|      case s_req_fragment:
  ------------------
  |  Branch (1208:7): [True: 735, False: 134k]
  ------------------
 1209|  6.39k|      {
 1210|  6.39k|        enum state new_state;
 1211|  6.39k|        switch (ch) {
 1212|      7|          case CR:
  ------------------
  |  |  474|      7|#define CR                  '\r'
  ------------------
  |  Branch (1212:11): [True: 7, False: 6.39k]
  ------------------
 1213|    461|          case LF:
  ------------------
  |  |  475|    461|#define LF                  '\n'
  ------------------
  |  Branch (1213:11): [True: 454, False: 5.94k]
  ------------------
 1214|    461|            parser->http_major = 0;
 1215|    461|            parser->http_minor = 9;
 1216|    461|            parser->state = (ch == CR) ?
  ------------------
  |  |  474|    461|#define CR                  '\r'
  ------------------
  |  Branch (1216:29): [True: 7, False: 454]
  ------------------
 1217|      7|              s_req_line_almost_done :
 1218|    461|              s_header_field_start;
 1219|    461|            CALLBACK_DATA(url);
  ------------------
  |  |  105|    461|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|    461|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    461|do {                                                                 \
  |  |  |  |   86|    461|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    461|                                                                     \
  |  |  |  |   88|    461|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 461, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|    461|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 461, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|    461|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 461]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|        SET_ERRNO(HPE_CB_##FOR);                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|      }                                                              \
  |  |  |  |   93|    461|                                                                     \
  |  |  |  |   94|    461|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|    461|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    461|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 461]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|    461|    }                                                                \
  |  |  |  |   99|    461|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    461|  }                                                                  \
  |  |  |  |  101|    461|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 461]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1219:13): [True: 461, False: 0]
  ------------------
 1220|    461|            break;
 1221|  1.49k|          case ' ':
  ------------------
  |  Branch (1221:11): [True: 1.49k, False: 4.90k]
  ------------------
 1222|  1.49k|            parser->state = s_req_http_start;
 1223|  1.49k|            CALLBACK_DATA(url);
  ------------------
  |  |  105|  1.49k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|  1.49k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  1.49k|do {                                                                 \
  |  |  |  |   86|  1.49k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  1.49k|                                                                     \
  |  |  |  |   88|  1.49k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 1.49k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|  1.49k|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 1.49k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|  1.49k|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 1.49k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|        SET_ERRNO(HPE_CB_##FOR);                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|      }                                                              \
  |  |  |  |   93|  1.49k|                                                                     \
  |  |  |  |   94|  1.49k|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|  1.49k|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.49k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 1.49k]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|  1.49k|    }                                                                \
  |  |  |  |   99|  1.49k|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|  1.49k|  }                                                                  \
  |  |  |  |  101|  1.49k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 1.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1223:13): [True: 1.49k, False: 0]
  ------------------
 1224|  1.49k|            break;
 1225|  4.44k|          default:
  ------------------
  |  Branch (1225:11): [True: 4.44k, False: 1.95k]
  ------------------
 1226|  4.44k|            new_state = parse_url_char((enum state)parser->state, ch);
 1227|  4.44k|            if (new_state == s_dead) {
  ------------------
  |  Branch (1227:17): [True: 13, False: 4.42k]
  ------------------
 1228|     13|              SET_ERRNO(HPE_INVALID_URL);
  ------------------
  |  |   54|     13|#define SET_ERRNO(e)                                                 \
  |  |   55|     13|do {                                                                 \
  |  |   56|     13|  parser->http_errno = (e);                                          \
  |  |   57|     13|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 13]
  |  |  ------------------
  ------------------
 1229|     13|              goto error;
 1230|     13|            }
 1231|  4.42k|            parser->state = new_state;
 1232|  6.39k|        }
 1233|  6.38k|        break;
 1234|  6.39k|      }
 1235|       |
 1236|  6.38k|      case s_req_http_start:
  ------------------
  |  Branch (1236:7): [True: 1.69k, False: 133k]
  ------------------
 1237|  1.69k|        switch (ch) {
 1238|  1.48k|          case 'H':
  ------------------
  |  Branch (1238:11): [True: 1.48k, False: 212]
  ------------------
 1239|  1.48k|            parser->state = s_req_http_H;
 1240|  1.48k|            break;
 1241|    210|          case ' ':
  ------------------
  |  Branch (1241:11): [True: 210, False: 1.48k]
  ------------------
 1242|    210|            break;
 1243|      2|          default:
  ------------------
  |  Branch (1243:11): [True: 2, False: 1.69k]
  ------------------
 1244|      2|            SET_ERRNO(HPE_INVALID_CONSTANT);
  ------------------
  |  |   54|      2|#define SET_ERRNO(e)                                                 \
  |  |   55|      2|do {                                                                 \
  |  |   56|      2|  parser->http_errno = (e);                                          \
  |  |   57|      2|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 2]
  |  |  ------------------
  ------------------
 1245|      2|            goto error;
 1246|  1.69k|        }
 1247|  1.69k|        break;
 1248|       |
 1249|  1.69k|      case s_req_http_H:
  ------------------
  |  Branch (1249:7): [True: 1.47k, False: 134k]
  ------------------
 1250|  1.47k|        STRICT_CHECK(ch != 'T');
  ------------------
  |  |  513|  1.47k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  1.47k|do {                                                                 \
  |  |  515|  1.47k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 11, False: 1.46k]
  |  |  ------------------
  |  |  516|     11|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|     11|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|     11|do {                                                                 \
  |  |  |  |   56|     11|  parser->http_errno = (e);                                          \
  |  |  |  |   57|     11|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|     11|    goto error;                                                      \
  |  |  518|     11|  }                                                                  \
  |  |  519|  1.47k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 1.46k]
  |  |  ------------------
  ------------------
 1251|  1.46k|        parser->state = s_req_http_HT;
 1252|  1.46k|        break;
 1253|       |
 1254|  1.46k|      case s_req_http_HT:
  ------------------
  |  Branch (1254:7): [True: 1.46k, False: 134k]
  ------------------
 1255|  1.46k|        STRICT_CHECK(ch != 'T');
  ------------------
  |  |  513|  1.46k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  1.46k|do {                                                                 \
  |  |  515|  1.46k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 7, False: 1.45k]
  |  |  ------------------
  |  |  516|      7|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|      7|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|      7|do {                                                                 \
  |  |  |  |   56|      7|  parser->http_errno = (e);                                          \
  |  |  |  |   57|      7|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|      7|    goto error;                                                      \
  |  |  518|      7|  }                                                                  \
  |  |  519|  1.46k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1256|  1.45k|        parser->state = s_req_http_HTT;
 1257|  1.45k|        break;
 1258|       |
 1259|  1.45k|      case s_req_http_HTT:
  ------------------
  |  Branch (1259:7): [True: 1.45k, False: 134k]
  ------------------
 1260|  1.45k|        STRICT_CHECK(ch != 'P');
  ------------------
  |  |  513|  1.45k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  1.45k|do {                                                                 \
  |  |  515|  1.45k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 11, False: 1.44k]
  |  |  ------------------
  |  |  516|     11|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|     11|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|     11|do {                                                                 \
  |  |  |  |   56|     11|  parser->http_errno = (e);                                          \
  |  |  |  |   57|     11|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|     11|    goto error;                                                      \
  |  |  518|     11|  }                                                                  \
  |  |  519|  1.45k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 1.44k]
  |  |  ------------------
  ------------------
 1261|  1.44k|        parser->state = s_req_http_HTTP;
 1262|  1.44k|        break;
 1263|       |
 1264|  1.44k|      case s_req_http_HTTP:
  ------------------
  |  Branch (1264:7): [True: 1.44k, False: 134k]
  ------------------
 1265|  1.44k|        STRICT_CHECK(ch != '/');
  ------------------
  |  |  513|  1.44k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  1.44k|do {                                                                 \
  |  |  515|  1.44k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 8, False: 1.43k]
  |  |  ------------------
  |  |  516|      8|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|      8|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|      8|do {                                                                 \
  |  |  |  |   56|      8|  parser->http_errno = (e);                                          \
  |  |  |  |   57|      8|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|      8|    goto error;                                                      \
  |  |  518|      8|  }                                                                  \
  |  |  519|  1.44k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 1.43k]
  |  |  ------------------
  ------------------
 1266|  1.43k|        parser->state = s_req_first_http_major;
 1267|  1.43k|        break;
 1268|       |
 1269|       |      /* first digit of major HTTP version */
 1270|  1.43k|      case s_req_first_http_major:
  ------------------
  |  Branch (1270:7): [True: 1.43k, False: 134k]
  ------------------
 1271|  1.43k|        if (ch < '1' || ch > '9') {
  ------------------
  |  Branch (1271:13): [True: 7, False: 1.43k]
  |  Branch (1271:25): [True: 4, False: 1.42k]
  ------------------
 1272|     11|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|     11|#define SET_ERRNO(e)                                                 \
  |  |   55|     11|do {                                                                 \
  |  |   56|     11|  parser->http_errno = (e);                                          \
  |  |   57|     11|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 11]
  |  |  ------------------
  ------------------
 1273|     11|          goto error;
 1274|     11|        }
 1275|       |
 1276|  1.42k|        parser->http_major = ch - '0';
 1277|  1.42k|        parser->state = s_req_http_major;
 1278|  1.42k|        break;
 1279|       |
 1280|       |      /* major HTTP version or dot */
 1281|  2.17k|      case s_req_http_major:
  ------------------
  |  Branch (1281:7): [True: 2.17k, False: 133k]
  ------------------
 1282|  2.17k|      {
 1283|  2.17k|        if (ch == '.') {
  ------------------
  |  Branch (1283:13): [True: 1.38k, False: 789]
  ------------------
 1284|  1.38k|          parser->state = s_req_first_http_minor;
 1285|  1.38k|          break;
 1286|  1.38k|        }
 1287|       |
 1288|    789|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|    789|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 780, False: 9]
  |  |  |  Branch (478:44): [True: 773, False: 7]
  |  |  ------------------
  ------------------
 1289|     16|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|     16|#define SET_ERRNO(e)                                                 \
  |  |   55|     16|do {                                                                 \
  |  |   56|     16|  parser->http_errno = (e);                                          \
  |  |   57|     16|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 16]
  |  |  ------------------
  ------------------
 1290|     16|          goto error;
 1291|     16|        }
 1292|       |
 1293|    773|        parser->http_major *= 10;
 1294|    773|        parser->http_major += ch - '0';
 1295|       |
 1296|    773|        if (parser->http_major > 999) {
  ------------------
  |  Branch (1296:13): [True: 4, False: 769]
  ------------------
 1297|      4|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|      4|#define SET_ERRNO(e)                                                 \
  |  |   55|      4|do {                                                                 \
  |  |   56|      4|  parser->http_errno = (e);                                          \
  |  |   57|      4|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 4]
  |  |  ------------------
  ------------------
 1298|      4|          goto error;
 1299|      4|        }
 1300|       |
 1301|    769|        break;
 1302|    773|      }
 1303|       |
 1304|       |      /* first digit of minor HTTP version */
 1305|  1.38k|      case s_req_first_http_minor:
  ------------------
  |  Branch (1305:7): [True: 1.38k, False: 134k]
  ------------------
 1306|  1.38k|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|  1.38k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 1.37k, False: 2]
  |  |  |  Branch (478:44): [True: 1.37k, False: 1]
  |  |  ------------------
  ------------------
 1307|      3|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|      3|#define SET_ERRNO(e)                                                 \
  |  |   55|      3|do {                                                                 \
  |  |   56|      3|  parser->http_errno = (e);                                          \
  |  |   57|      3|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 3]
  |  |  ------------------
  ------------------
 1308|      3|          goto error;
 1309|      3|        }
 1310|       |
 1311|  1.37k|        parser->http_minor = ch - '0';
 1312|  1.37k|        parser->state = s_req_http_minor;
 1313|  1.37k|        break;
 1314|       |
 1315|       |      /* minor HTTP version or end of request line */
 1316|  1.60k|      case s_req_http_minor:
  ------------------
  |  Branch (1316:7): [True: 1.60k, False: 133k]
  ------------------
 1317|  1.60k|      {
 1318|  1.60k|        if (ch == CR) {
  ------------------
  |  |  474|  1.60k|#define CR                  '\r'
  ------------------
  |  Branch (1318:13): [True: 319, False: 1.28k]
  ------------------
 1319|    319|          parser->state = s_req_line_almost_done;
 1320|    319|          break;
 1321|    319|        }
 1322|       |
 1323|  1.28k|        if (ch == LF) {
  ------------------
  |  |  475|  1.28k|#define LF                  '\n'
  ------------------
  |  Branch (1323:13): [True: 1.02k, False: 262]
  ------------------
 1324|  1.02k|          parser->state = s_header_field_start;
 1325|  1.02k|          break;
 1326|  1.02k|        }
 1327|       |
 1328|       |        /* XXX allow spaces after digit? */
 1329|       |
 1330|    262|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|    262|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 252, False: 10]
  |  |  |  Branch (478:44): [True: 248, False: 4]
  |  |  ------------------
  ------------------
 1331|     14|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|     14|#define SET_ERRNO(e)                                                 \
  |  |   55|     14|do {                                                                 \
  |  |   56|     14|  parser->http_errno = (e);                                          \
  |  |   57|     14|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 14]
  |  |  ------------------
  ------------------
 1332|     14|          goto error;
 1333|     14|        }
 1334|       |
 1335|    248|        parser->http_minor *= 10;
 1336|    248|        parser->http_minor += ch - '0';
 1337|       |
 1338|    248|        if (parser->http_minor > 999) {
  ------------------
  |  Branch (1338:13): [True: 4, False: 244]
  ------------------
 1339|      4|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|      4|#define SET_ERRNO(e)                                                 \
  |  |   55|      4|do {                                                                 \
  |  |   56|      4|  parser->http_errno = (e);                                          \
  |  |   57|      4|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 4]
  |  |  ------------------
  ------------------
 1340|      4|          goto error;
 1341|      4|        }
 1342|       |
 1343|    244|        break;
 1344|    248|      }
 1345|       |
 1346|       |      /* end of request line */
 1347|    322|      case s_req_line_almost_done:
  ------------------
  |  Branch (1347:7): [True: 322, False: 135k]
  ------------------
 1348|    322|      {
 1349|    322|        if (ch != LF) {
  ------------------
  |  |  475|    322|#define LF                  '\n'
  ------------------
  |  Branch (1349:13): [True: 1, False: 321]
  ------------------
 1350|      1|          SET_ERRNO(HPE_LF_EXPECTED);
  ------------------
  |  |   54|      1|#define SET_ERRNO(e)                                                 \
  |  |   55|      1|do {                                                                 \
  |  |   56|      1|  parser->http_errno = (e);                                          \
  |  |   57|      1|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1351|      1|          goto error;
 1352|      1|        }
 1353|       |
 1354|    321|        parser->state = s_header_field_start;
 1355|    321|        break;
 1356|    322|      }
 1357|       |
 1358|  8.27k|      case s_header_field_start:
  ------------------
  |  Branch (1358:7): [True: 8.27k, False: 127k]
  ------------------
 1359|  8.27k|      {
 1360|  8.27k|        if (ch == CR) {
  ------------------
  |  |  474|  8.27k|#define CR                  '\r'
  ------------------
  |  Branch (1360:13): [True: 115, False: 8.15k]
  ------------------
 1361|    115|          parser->state = s_headers_almost_done;
 1362|    115|          break;
 1363|    115|        }
 1364|       |
 1365|  8.15k|        if (ch == LF) {
  ------------------
  |  |  475|  8.15k|#define LF                  '\n'
  ------------------
  |  Branch (1365:13): [True: 2.78k, False: 5.37k]
  ------------------
 1366|       |          /* they might be just sending \n instead of \r\n so this would be
 1367|       |           * the second \n to denote the end of headers*/
 1368|  2.78k|          parser->state = s_headers_almost_done;
 1369|  2.78k|          goto reexecute_byte;
 1370|  2.78k|        }
 1371|       |
 1372|  5.37k|        c = TOKEN(ch);
  ------------------
  |  |  491|  5.37k|#define TOKEN(c)            ((c == ' ') ? ' ' : tokens[(unsigned char)c])
  |  |  ------------------
  |  |  |  Branch (491:30): [True: 94, False: 5.27k]
  |  |  ------------------
  ------------------
 1373|       |
 1374|  5.37k|        if (!c) {
  ------------------
  |  Branch (1374:13): [True: 10, False: 5.36k]
  ------------------
 1375|     10|          SET_ERRNO(HPE_INVALID_HEADER_TOKEN);
  ------------------
  |  |   54|     10|#define SET_ERRNO(e)                                                 \
  |  |   55|     10|do {                                                                 \
  |  |   56|     10|  parser->http_errno = (e);                                          \
  |  |   57|     10|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 10]
  |  |  ------------------
  ------------------
 1376|     10|          goto error;
 1377|     10|        }
 1378|       |
 1379|  5.36k|        MARK(header_field);
  ------------------
  |  |  112|  5.36k|#define MARK(FOR)                                                    \
  |  |  113|  5.36k|do {                                                                 \
  |  |  114|  5.36k|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 5.36k, False: 0]
  |  |  ------------------
  |  |  115|  5.36k|    FOR##_mark = p;                                                  \
  |  |  116|  5.36k|  }                                                                  \
  |  |  117|  5.36k|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 5.36k]
  |  |  ------------------
  ------------------
 1380|       |
 1381|  5.36k|        parser->index = 0;
 1382|  5.36k|        parser->state = s_header_field;
 1383|       |
 1384|  5.36k|        switch (c) {
 1385|  2.87k|          case 'c':
  ------------------
  |  Branch (1385:11): [True: 2.87k, False: 2.48k]
  ------------------
 1386|  2.87k|            parser->header_state = h_C;
 1387|  2.87k|            break;
 1388|       |
 1389|    519|          case 'p':
  ------------------
  |  Branch (1389:11): [True: 519, False: 4.84k]
  ------------------
 1390|    519|            parser->header_state = h_matching_proxy_connection;
 1391|    519|            break;
 1392|       |
 1393|    450|          case 't':
  ------------------
  |  Branch (1393:11): [True: 450, False: 4.91k]
  ------------------
 1394|    450|            parser->header_state = h_matching_transfer_encoding;
 1395|    450|            break;
 1396|       |
 1397|    697|          case 'u':
  ------------------
  |  Branch (1397:11): [True: 697, False: 4.66k]
  ------------------
 1398|    697|            parser->header_state = h_matching_upgrade;
 1399|    697|            break;
 1400|       |
 1401|    818|          default:
  ------------------
  |  Branch (1401:11): [True: 818, False: 4.54k]
  ------------------
 1402|    818|            parser->header_state = h_general;
 1403|    818|            break;
 1404|  5.36k|        }
 1405|  5.36k|        break;
 1406|  5.36k|      }
 1407|       |
 1408|  28.7k|      case s_header_field:
  ------------------
  |  Branch (1408:7): [True: 28.7k, False: 106k]
  ------------------
 1409|  28.7k|      {
 1410|  28.7k|        c = TOKEN(ch);
  ------------------
  |  |  491|  28.7k|#define TOKEN(c)            ((c == ' ') ? ' ' : tokens[(unsigned char)c])
  |  |  ------------------
  |  |  |  Branch (491:30): [True: 1.18k, False: 27.5k]
  |  |  ------------------
  ------------------
 1411|       |
 1412|  28.7k|        if (c) {
  ------------------
  |  Branch (1412:13): [True: 23.6k, False: 5.14k]
  ------------------
 1413|  23.6k|          switch (parser->header_state) {
 1414|  2.46k|            case h_general:
  ------------------
  |  Branch (1414:13): [True: 2.46k, False: 21.1k]
  ------------------
 1415|  2.46k|              break;
 1416|       |
 1417|  2.86k|            case h_C:
  ------------------
  |  Branch (1417:13): [True: 2.86k, False: 20.7k]
  ------------------
 1418|  2.86k|              parser->index++;
 1419|  2.86k|              parser->header_state = (c == 'o' ? h_CO : h_general);
  ------------------
  |  Branch (1419:39): [True: 2.77k, False: 86]
  ------------------
 1420|  2.86k|              break;
 1421|       |
 1422|  2.75k|            case h_CO:
  ------------------
  |  Branch (1422:13): [True: 2.75k, False: 20.8k]
  ------------------
 1423|  2.75k|              parser->index++;
 1424|  2.75k|              parser->header_state = (c == 'n' ? h_CON : h_general);
  ------------------
  |  Branch (1424:39): [True: 2.71k, False: 44]
  ------------------
 1425|  2.75k|              break;
 1426|       |
 1427|  2.70k|            case h_CON:
  ------------------
  |  Branch (1427:13): [True: 2.70k, False: 20.9k]
  ------------------
 1428|  2.70k|              parser->index++;
 1429|  2.70k|              switch (c) {
 1430|  1.95k|                case 'n':
  ------------------
  |  Branch (1430:17): [True: 1.95k, False: 748]
  ------------------
 1431|  1.95k|                  parser->header_state = h_matching_connection;
 1432|  1.95k|                  break;
 1433|    540|                case 't':
  ------------------
  |  Branch (1433:17): [True: 540, False: 2.16k]
  ------------------
 1434|    540|                  parser->header_state = h_matching_content_length;
 1435|    540|                  break;
 1436|    208|                default:
  ------------------
  |  Branch (1436:17): [True: 208, False: 2.49k]
  ------------------
 1437|    208|                  parser->header_state = h_general;
 1438|    208|                  break;
 1439|  2.70k|              }
 1440|  2.70k|              break;
 1441|       |
 1442|       |            /* connection */
 1443|       |
 1444|  9.71k|            case h_matching_connection:
  ------------------
  |  Branch (1444:13): [True: 9.71k, False: 13.8k]
  ------------------
 1445|  9.71k|              parser->index++;
 1446|  9.71k|              if (parser->index > sizeof(CONNECTION)-1
  ------------------
  |  |  121|  9.71k|#define CONNECTION "connection"
  ------------------
  |  Branch (1446:19): [True: 0, False: 9.71k]
  ------------------
 1447|  9.71k|                  || c != CONNECTION[parser->index]) {
  ------------------
  |  |  121|  9.71k|#define CONNECTION "connection"
  ------------------
  |  Branch (1447:22): [True: 322, False: 9.39k]
  ------------------
 1448|    322|                parser->header_state = h_general;
 1449|  9.39k|              } else if (parser->index == sizeof(CONNECTION)-2) {
  ------------------
  |  |  121|  9.39k|#define CONNECTION "connection"
  ------------------
  |  Branch (1449:26): [True: 1.54k, False: 7.85k]
  ------------------
 1450|  1.54k|                parser->header_state = h_connection;
 1451|  1.54k|              }
 1452|  9.71k|              break;
 1453|       |
 1454|       |            /* proxy-connection */
 1455|       |
 1456|    444|            case h_matching_proxy_connection:
  ------------------
  |  Branch (1456:13): [True: 444, False: 23.1k]
  ------------------
 1457|    444|              parser->index++;
 1458|    444|              if (parser->index > sizeof(PROXY_CONNECTION)-1
  ------------------
  |  |  120|    444|#define PROXY_CONNECTION "proxy-connection"
  ------------------
  |  Branch (1458:19): [True: 0, False: 444]
  ------------------
 1459|    444|                  || c != PROXY_CONNECTION[parser->index]) {
  ------------------
  |  |  120|    444|#define PROXY_CONNECTION "proxy-connection"
  ------------------
  |  Branch (1459:22): [True: 235, False: 209]
  ------------------
 1460|    235|                parser->header_state = h_general;
 1461|    235|              } else if (parser->index == sizeof(PROXY_CONNECTION)-2) {
  ------------------
  |  |  120|    209|#define PROXY_CONNECTION "proxy-connection"
  ------------------
  |  Branch (1461:26): [True: 0, False: 209]
  ------------------
 1462|      0|                parser->header_state = h_connection;
 1463|      0|              }
 1464|    444|              break;
 1465|       |
 1466|       |            /* content-length */
 1467|       |
 1468|    498|            case h_matching_content_length:
  ------------------
  |  Branch (1468:13): [True: 498, False: 23.1k]
  ------------------
 1469|    498|              parser->index++;
 1470|    498|              if (parser->index > sizeof(CONTENT_LENGTH)-1
  ------------------
  |  |  122|    498|#define CONTENT_LENGTH "content-length"
  ------------------
  |  Branch (1470:19): [True: 0, False: 498]
  ------------------
 1471|    498|                  || c != CONTENT_LENGTH[parser->index]) {
  ------------------
  |  |  122|    498|#define CONTENT_LENGTH "content-length"
  ------------------
  |  Branch (1471:22): [True: 388, False: 110]
  ------------------
 1472|    388|                parser->header_state = h_general;
 1473|    388|              } else if (parser->index == sizeof(CONTENT_LENGTH)-2) {
  ------------------
  |  |  122|    110|#define CONTENT_LENGTH "content-length"
  ------------------
  |  Branch (1473:26): [True: 0, False: 110]
  ------------------
 1474|      0|                parser->header_state = h_content_length;
 1475|      0|              }
 1476|    498|              break;
 1477|       |
 1478|       |            /* transfer-encoding */
 1479|       |
 1480|    471|            case h_matching_transfer_encoding:
  ------------------
  |  Branch (1480:13): [True: 471, False: 23.1k]
  ------------------
 1481|    471|              parser->index++;
 1482|    471|              if (parser->index > sizeof(TRANSFER_ENCODING)-1
  ------------------
  |  |  123|    471|#define TRANSFER_ENCODING "transfer-encoding"
  ------------------
  |  Branch (1482:19): [True: 0, False: 471]
  ------------------
 1483|    471|                  || c != TRANSFER_ENCODING[parser->index]) {
  ------------------
  |  |  123|    471|#define TRANSFER_ENCODING "transfer-encoding"
  ------------------
  |  Branch (1483:22): [True: 229, False: 242]
  ------------------
 1484|    229|                parser->header_state = h_general;
 1485|    242|              } else if (parser->index == sizeof(TRANSFER_ENCODING)-2) {
  ------------------
  |  |  123|    242|#define TRANSFER_ENCODING "transfer-encoding"
  ------------------
  |  Branch (1485:26): [True: 0, False: 242]
  ------------------
 1486|      0|                parser->header_state = h_transfer_encoding;
 1487|      0|                parser->uses_transfer_encoding = 1;
 1488|      0|              }
 1489|    471|              break;
 1490|       |
 1491|       |            /* upgrade */
 1492|       |
 1493|    797|            case h_matching_upgrade:
  ------------------
  |  Branch (1493:13): [True: 797, False: 22.8k]
  ------------------
 1494|    797|              parser->index++;
 1495|    797|              if (parser->index > sizeof(UPGRADE)-1
  ------------------
  |  |  124|    797|#define UPGRADE "upgrade"
  ------------------
  |  Branch (1495:19): [True: 0, False: 797]
  ------------------
 1496|    797|                  || c != UPGRADE[parser->index]) {
  ------------------
  |  |  124|    797|#define UPGRADE "upgrade"
  ------------------
  |  Branch (1496:22): [True: 429, False: 368]
  ------------------
 1497|    429|                parser->header_state = h_general;
 1498|    429|              } else if (parser->index == sizeof(UPGRADE)-2) {
  ------------------
  |  |  124|    368|#define UPGRADE "upgrade"
  ------------------
  |  Branch (1498:26): [True: 0, False: 368]
  ------------------
 1499|      0|                parser->header_state = h_upgrade;
 1500|      0|              }
 1501|    797|              break;
 1502|       |
 1503|    903|            case h_connection:
  ------------------
  |  Branch (1503:13): [True: 903, False: 22.7k]
  ------------------
 1504|    903|            case h_content_length:
  ------------------
  |  Branch (1504:13): [True: 0, False: 23.6k]
  ------------------
 1505|    903|            case h_transfer_encoding:
  ------------------
  |  Branch (1505:13): [True: 0, False: 23.6k]
  ------------------
 1506|    903|            case h_upgrade:
  ------------------
  |  Branch (1506:13): [True: 0, False: 23.6k]
  ------------------
 1507|    903|              if (ch != ' ') parser->header_state = h_general;
  ------------------
  |  Branch (1507:19): [True: 204, False: 699]
  ------------------
 1508|    903|              break;
 1509|       |
 1510|      0|            default:
  ------------------
  |  Branch (1510:13): [True: 0, False: 23.6k]
  ------------------
 1511|      0|              assert(0 && "Unknown header_state");
  ------------------
  |  Branch (1511:15): [Folded, False: 0]
  |  Branch (1511:15): [True: 0, Folded]
  |  Branch (1511:15): [Folded, False: 0]
  ------------------
 1512|      0|              break;
 1513|  23.6k|          }
 1514|  23.6k|          break;
 1515|  23.6k|        }
 1516|       |
 1517|  5.14k|        if (ch == ':') {
  ------------------
  |  Branch (1517:13): [True: 5.12k, False: 20]
  ------------------
 1518|  5.12k|          parser->state = s_header_value_discard_ws;
 1519|  5.12k|          CALLBACK_DATA(header_field);
  ------------------
  |  |  105|  5.12k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|  5.12k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  5.12k|do {                                                                 \
  |  |  |  |   86|  5.12k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  5.12k|                                                                     \
  |  |  |  |   88|  5.12k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 5.12k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|  5.12k|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 5.12k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|  5.12k|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 5.12k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|        SET_ERRNO(HPE_CB_##FOR);                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|      }                                                              \
  |  |  |  |   93|  5.12k|                                                                     \
  |  |  |  |   94|  5.12k|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|  5.12k|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  5.12k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 5.12k]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|  5.12k|    }                                                                \
  |  |  |  |   99|  5.12k|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|  5.12k|  }                                                                  \
  |  |  |  |  101|  5.12k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 5.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1519:11): [True: 5.12k, False: 0]
  ------------------
 1520|  5.12k|          break;
 1521|  5.12k|        }
 1522|       |
 1523|     20|        SET_ERRNO(HPE_INVALID_HEADER_TOKEN);
  ------------------
  |  |   54|     20|#define SET_ERRNO(e)                                                 \
  |  |   55|     20|do {                                                                 \
  |  |   56|     20|  parser->http_errno = (e);                                          \
  |  |   57|     20|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 20]
  |  |  ------------------
  ------------------
 1524|     20|        goto error;
 1525|  5.14k|      }
 1526|       |
 1527|  5.98k|      case s_header_value_discard_ws:
  ------------------
  |  Branch (1527:7): [True: 5.98k, False: 129k]
  ------------------
 1528|  5.98k|        if (ch == ' ' || ch == '\t') break;
  ------------------
  |  Branch (1528:13): [True: 268, False: 5.71k]
  |  Branch (1528:26): [True: 196, False: 5.52k]
  ------------------
 1529|       |
 1530|  5.52k|        if (ch == CR) {
  ------------------
  |  |  474|  5.52k|#define CR                  '\r'
  ------------------
  |  Branch (1530:13): [True: 213, False: 5.31k]
  ------------------
 1531|    213|          parser->state = s_header_value_discard_ws_almost_done;
 1532|    213|          break;
 1533|    213|        }
 1534|       |
 1535|  5.31k|        if (ch == LF) {
  ------------------
  |  |  475|  5.31k|#define LF                  '\n'
  ------------------
  |  Branch (1535:13): [True: 2.33k, False: 2.97k]
  ------------------
 1536|  2.33k|          parser->state = s_header_value_discard_lws;
 1537|  2.33k|          break;
 1538|  2.33k|        }
 1539|       |
 1540|       |        /* FALLTHROUGH */
 1541|       |
 1542|  3.67k|      case s_header_value_start:
  ------------------
  |  Branch (1542:7): [True: 695, False: 134k]
  ------------------
 1543|  3.67k|      {
 1544|  3.67k|        MARK(header_value);
  ------------------
  |  |  112|  3.67k|#define MARK(FOR)                                                    \
  |  |  113|  3.67k|do {                                                                 \
  |  |  114|  3.67k|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 3.67k, False: 0]
  |  |  ------------------
  |  |  115|  3.67k|    FOR##_mark = p;                                                  \
  |  |  116|  3.67k|  }                                                                  \
  |  |  117|  3.67k|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 3.67k]
  |  |  ------------------
  ------------------
 1545|       |
 1546|  3.67k|        parser->state = s_header_value;
 1547|  3.67k|        parser->index = 0;
 1548|       |
 1549|  3.67k|        c = LOWER(ch);
  ------------------
  |  |  476|  3.67k|#define LOWER(c)            (unsigned char)(c | 0x20)
  ------------------
 1550|       |
 1551|  3.67k|        switch (parser->header_state) {
 1552|      0|          case h_upgrade:
  ------------------
  |  Branch (1552:11): [True: 0, False: 3.67k]
  ------------------
 1553|      0|            parser->flags |= F_UPGRADE;
 1554|      0|            parser->header_state = h_general;
 1555|      0|            break;
 1556|       |
 1557|      0|          case h_transfer_encoding:
  ------------------
  |  Branch (1557:11): [True: 0, False: 3.67k]
  ------------------
 1558|       |            /* looking for 'Transfer-Encoding: chunked' */
 1559|      0|            if ('c' == c) {
  ------------------
  |  Branch (1559:17): [True: 0, False: 0]
  ------------------
 1560|      0|              parser->header_state = h_matching_transfer_encoding_chunked;
 1561|      0|            } else {
 1562|      0|              parser->header_state = h_matching_transfer_encoding_token;
 1563|      0|            }
 1564|      0|            break;
 1565|       |
 1566|       |          /* Multi-value `Transfer-Encoding` header */
 1567|      0|          case h_matching_transfer_encoding_token_start:
  ------------------
  |  Branch (1567:11): [True: 0, False: 3.67k]
  ------------------
 1568|      0|            break;
 1569|       |
 1570|      0|          case h_content_length:
  ------------------
  |  Branch (1570:11): [True: 0, False: 3.67k]
  ------------------
 1571|      0|            if (!IS_NUM(ch)) {
  ------------------
  |  |  478|      0|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 0, False: 0]
  |  |  |  Branch (478:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1572|      0|              SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
  ------------------
  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |   55|      0|do {                                                                 \
  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |   57|      0|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1573|      0|              goto error;
 1574|      0|            }
 1575|       |
 1576|      0|            if (parser->flags & F_CONTENTLENGTH) {
  ------------------
  |  Branch (1576:17): [True: 0, False: 0]
  ------------------
 1577|      0|              SET_ERRNO(HPE_UNEXPECTED_CONTENT_LENGTH);
  ------------------
  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |   55|      0|do {                                                                 \
  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |   57|      0|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1578|      0|              goto error;
 1579|      0|            }
 1580|       |
 1581|      0|            parser->flags |= F_CONTENTLENGTH;
 1582|      0|            parser->content_length = ch - '0';
 1583|      0|            break;
 1584|       |
 1585|  1.32k|          case h_connection:
  ------------------
  |  Branch (1585:11): [True: 1.32k, False: 2.34k]
  ------------------
 1586|       |            /* looking for 'Connection: keep-alive' */
 1587|  1.32k|            if (c == 'k') {
  ------------------
  |  Branch (1587:17): [True: 234, False: 1.09k]
  ------------------
 1588|    234|              parser->header_state = h_matching_connection_keep_alive;
 1589|       |            /* looking for 'Connection: close' */
 1590|  1.09k|            } else if (c == 'c') {
  ------------------
  |  Branch (1590:24): [True: 703, False: 389]
  ------------------
 1591|    703|              parser->header_state = h_matching_connection_close;
 1592|    703|            } else {
 1593|    389|              parser->header_state = h_general;
 1594|    389|            }
 1595|  1.32k|            break;
 1596|       |
 1597|  2.34k|          default:
  ------------------
  |  Branch (1597:11): [True: 2.34k, False: 1.32k]
  ------------------
 1598|  2.34k|            parser->header_state = h_general;
 1599|  2.34k|            break;
 1600|  3.67k|        }
 1601|  3.67k|        break;
 1602|  3.67k|      }
 1603|       |
 1604|  13.4k|      case s_header_value:
  ------------------
  |  Branch (1604:7): [True: 13.4k, False: 122k]
  ------------------
 1605|  13.4k|      {
 1606|       |
 1607|  13.4k|        if (ch == CR) {
  ------------------
  |  |  474|  13.4k|#define CR                  '\r'
  ------------------
  |  Branch (1607:13): [True: 211, False: 13.2k]
  ------------------
 1608|    211|          parser->state = s_header_almost_done;
 1609|    211|          CALLBACK_DATA(header_value);
  ------------------
  |  |  105|    211|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|    211|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    211|do {                                                                 \
  |  |  |  |   86|    211|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    211|                                                                     \
  |  |  |  |   88|    211|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 211, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|    211|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 211, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|    211|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 211]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|        SET_ERRNO(HPE_CB_##FOR);                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|      }                                                              \
  |  |  |  |   93|    211|                                                                     \
  |  |  |  |   94|    211|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|    211|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    211|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 211]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|    211|    }                                                                \
  |  |  |  |   99|    211|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    211|  }                                                                  \
  |  |  |  |  101|    211|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 211]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1609:11): [True: 211, False: 0]
  ------------------
 1610|    211|          break;
 1611|    211|        }
 1612|       |
 1613|  13.2k|        if (ch == LF) {
  ------------------
  |  |  475|  13.2k|#define LF                  '\n'
  ------------------
  |  Branch (1613:13): [True: 3.33k, False: 9.93k]
  ------------------
 1614|  3.33k|          parser->state = s_header_almost_done;
 1615|  3.33k|          CALLBACK_DATA_NOADVANCE(header_value);
  ------------------
  |  |  109|  3.33k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|  3.33k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  3.33k|do {                                                                 \
  |  |  |  |   86|  3.33k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  3.33k|                                                                     \
  |  |  |  |   88|  3.33k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 3.33k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|  3.33k|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 3.33k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|  3.33k|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 3.33k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|        SET_ERRNO(HPE_CB_##FOR);                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|      }                                                              \
  |  |  |  |   93|  3.33k|                                                                     \
  |  |  |  |   94|  3.33k|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|  3.33k|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  3.33k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 3.33k]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|  3.33k|    }                                                                \
  |  |  |  |   99|  3.33k|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|  3.33k|  }                                                                  \
  |  |  |  |  101|  3.33k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 3.33k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1615:11): [True: 3.33k, False: 0]
  ------------------
 1616|  3.33k|          goto reexecute_byte;
 1617|  3.33k|        }
 1618|       |
 1619|  9.93k|        if (!lenient && !IS_HEADER_CHAR(ch)) {
  ------------------
  |  |  510|  9.93k|  (ch == CR || ch == LF || ch == 9 || ((unsigned char)ch > 31 && ch != 127))
  |  |  ------------------
  |  |  |  |  474|  19.8k|#define CR                  '\r'
  |  |  ------------------
  |  |                 (ch == CR || ch == LF || ch == 9 || ((unsigned char)ch > 31 && ch != 127))
  |  |  ------------------
  |  |  |  |  475|  19.8k|#define LF                  '\n'
  |  |  ------------------
  |  |  |  Branch (510:4): [True: 0, False: 9.93k]
  |  |  |  Branch (510:16): [True: 0, False: 9.93k]
  |  |  |  Branch (510:28): [True: 222, False: 9.71k]
  |  |  |  Branch (510:40): [True: 9.70k, False: 9]
  |  |  |  Branch (510:66): [True: 9.70k, False: 1]
  |  |  ------------------
  ------------------
  |  Branch (1619:13): [True: 9.93k, False: 0]
  ------------------
 1620|     10|          SET_ERRNO(HPE_INVALID_HEADER_TOKEN);
  ------------------
  |  |   54|     10|#define SET_ERRNO(e)                                                 \
  |  |   55|     10|do {                                                                 \
  |  |   56|     10|  parser->http_errno = (e);                                          \
  |  |   57|     10|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 10]
  |  |  ------------------
  ------------------
 1621|     10|          goto error;
 1622|     10|        }
 1623|       |
 1624|  9.92k|        c = LOWER(ch);
  ------------------
  |  |  476|  9.92k|#define LOWER(c)            (unsigned char)(c | 0x20)
  ------------------
 1625|       |
 1626|  9.92k|        switch (parser->header_state) {
 1627|  6.57k|          case h_general:
  ------------------
  |  Branch (1627:11): [True: 6.57k, False: 3.34k]
  ------------------
 1628|  6.57k|            break;
 1629|       |
 1630|      0|          case h_connection:
  ------------------
  |  Branch (1630:11): [True: 0, False: 9.92k]
  ------------------
 1631|      0|          case h_transfer_encoding:
  ------------------
  |  Branch (1631:11): [True: 0, False: 9.92k]
  ------------------
 1632|      0|            assert(0 && "Shouldn't get here.");
  ------------------
  |  Branch (1632:13): [Folded, False: 0]
  |  Branch (1632:13): [True: 0, Folded]
  |  Branch (1632:13): [Folded, False: 0]
  ------------------
 1633|      0|            break;
 1634|       |
 1635|      0|          case h_content_length:
  ------------------
  |  Branch (1635:11): [True: 0, False: 9.92k]
  ------------------
 1636|      0|          {
 1637|      0|            uint64_t t;
 1638|       |
 1639|      0|            if (ch == ' ') break;
  ------------------
  |  Branch (1639:17): [True: 0, False: 0]
  ------------------
 1640|       |
 1641|      0|            if (!IS_NUM(ch)) {
  ------------------
  |  |  478|      0|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 0, False: 0]
  |  |  |  Branch (478:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1642|      0|              SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
  ------------------
  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |   55|      0|do {                                                                 \
  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |   57|      0|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1643|      0|              goto error;
 1644|      0|            }
 1645|       |
 1646|      0|            t = parser->content_length;
 1647|      0|            t *= 10;
 1648|      0|            t += ch - '0';
 1649|       |
 1650|       |            /* Overflow? Test against a conservative limit for simplicity. */
 1651|      0|            if ((ULLONG_MAX - 10) / 10 < parser->content_length) {
  ------------------
  |  Branch (1651:17): [True: 0, False: 0]
  ------------------
 1652|      0|              SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
  ------------------
  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |   55|      0|do {                                                                 \
  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |   57|      0|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1653|      0|              goto error;
 1654|      0|            }
 1655|       |
 1656|      0|            parser->content_length = t;
 1657|      0|            break;
 1658|      0|          }
 1659|       |
 1660|       |          /* Transfer-Encoding: chunked */
 1661|      0|          case h_matching_transfer_encoding_token_start:
  ------------------
  |  Branch (1661:11): [True: 0, False: 9.92k]
  ------------------
 1662|       |            /* looking for 'Transfer-Encoding: chunked' */
 1663|      0|            if ('c' == c) {
  ------------------
  |  Branch (1663:17): [True: 0, False: 0]
  ------------------
 1664|      0|              parser->header_state = h_matching_transfer_encoding_chunked;
 1665|      0|            } else if (TOKEN(c)) {
  ------------------
  |  |  491|      0|#define TOKEN(c)            ((c == ' ') ? ' ' : tokens[(unsigned char)c])
  |  |  ------------------
  |  |  |  Branch (491:29): [True: 0, False: 0]
  |  |  |  Branch (491:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1666|       |              /* NOTE(gejun): Not use strict mode for these macros since the additional
 1667|       |               * characeters seem to be OK.
 1668|       |               */
 1669|       |
 1670|       |              /* TODO(indutny): similar code below does this, but why?
 1671|       |               * At the very least it seems to be inconsistent given that
 1672|       |               * h_matching_transfer_encoding_token does not check for
 1673|       |               * `STRICT_TOKEN`
 1674|       |               */
 1675|      0|              parser->header_state = h_matching_transfer_encoding_token;
 1676|      0|            } else if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (1676:24): [True: 0, False: 0]
  |  Branch (1676:36): [True: 0, False: 0]
  ------------------
 1677|       |              /* Skip lws */
 1678|      0|            } else {
 1679|      0|              parser->header_state = h_general;
 1680|      0|            }
 1681|      0|            break;
 1682|       |
 1683|       |          /* Transfer-Encoding: chunked */
 1684|      0|          case h_matching_transfer_encoding_chunked:
  ------------------
  |  Branch (1684:11): [True: 0, False: 9.92k]
  ------------------
 1685|      0|            parser->index++;
 1686|      0|            if (parser->index > sizeof(CHUNKED)-1
  ------------------
  |  |  125|      0|#define CHUNKED "chunked"
  ------------------
  |  Branch (1686:17): [True: 0, False: 0]
  ------------------
 1687|      0|                || c != CHUNKED[parser->index]) {
  ------------------
  |  |  125|      0|#define CHUNKED "chunked"
  ------------------
  |  Branch (1687:20): [True: 0, False: 0]
  ------------------
 1688|      0|              parser->header_state = h_matching_transfer_encoding_token;
 1689|      0|            } else if (parser->index == sizeof(CHUNKED)-2) {
  ------------------
  |  |  125|      0|#define CHUNKED "chunked"
  ------------------
  |  Branch (1689:24): [True: 0, False: 0]
  ------------------
 1690|      0|              parser->header_state = h_transfer_encoding_chunked;
 1691|      0|            }
 1692|      0|            break;
 1693|       |
 1694|      0|          case h_matching_transfer_encoding_token:
  ------------------
  |  Branch (1694:11): [True: 0, False: 9.92k]
  ------------------
 1695|      0|            if (ch == ',') {
  ------------------
  |  Branch (1695:17): [True: 0, False: 0]
  ------------------
 1696|      0|              parser->header_state = h_matching_transfer_encoding_token_start;
 1697|      0|              parser->index = 0;
 1698|      0|            }
 1699|      0|            break;
 1700|       |
 1701|       |          /* looking for 'Connection: keep-alive' */
 1702|    469|          case h_matching_connection_keep_alive:
  ------------------
  |  Branch (1702:11): [True: 469, False: 9.45k]
  ------------------
 1703|    469|            parser->index++;
 1704|    469|            if (parser->index > sizeof(KEEP_ALIVE)-1
  ------------------
  |  |  126|    469|#define KEEP_ALIVE "keep-alive"
  ------------------
  |  Branch (1704:17): [True: 0, False: 469]
  ------------------
 1705|    469|                || c != KEEP_ALIVE[parser->index]) {
  ------------------
  |  |  126|    469|#define KEEP_ALIVE "keep-alive"
  ------------------
  |  Branch (1705:20): [True: 224, False: 245]
  ------------------
 1706|    224|              parser->header_state = h_general;
 1707|    245|            } else if (parser->index == sizeof(KEEP_ALIVE)-2) {
  ------------------
  |  |  126|    245|#define KEEP_ALIVE "keep-alive"
  ------------------
  |  Branch (1707:24): [True: 0, False: 245]
  ------------------
 1708|      0|              parser->header_state = h_connection_keep_alive;
 1709|      0|            }
 1710|    469|            break;
 1711|       |
 1712|       |          /* looking for 'Connection: close' */
 1713|  2.19k|          case h_matching_connection_close:
  ------------------
  |  Branch (1713:11): [True: 2.19k, False: 7.73k]
  ------------------
 1714|  2.19k|            parser->index++;
 1715|  2.19k|            if (parser->index > sizeof(CLOSE)-1 || c != CLOSE[parser->index]) {
  ------------------
  |  |  127|  2.19k|#define CLOSE "close"
  ------------------
                          if (parser->index > sizeof(CLOSE)-1 || c != CLOSE[parser->index]) {
  ------------------
  |  |  127|  2.19k|#define CLOSE "close"
  ------------------
  |  Branch (1715:17): [True: 0, False: 2.19k]
  |  Branch (1715:52): [True: 210, False: 1.98k]
  ------------------
 1716|    210|              parser->header_state = h_general;
 1717|  1.98k|            } else if (parser->index == sizeof(CLOSE)-2) {
  ------------------
  |  |  127|  1.98k|#define CLOSE "close"
  ------------------
  |  Branch (1717:24): [True: 479, False: 1.50k]
  ------------------
 1718|    479|              parser->header_state = h_connection_close;
 1719|    479|            }
 1720|  2.19k|            break;
 1721|       |
 1722|      0|          case h_transfer_encoding_chunked:
  ------------------
  |  Branch (1722:11): [True: 0, False: 9.92k]
  ------------------
 1723|      0|            if (ch != ' ') parser->header_state = h_matching_transfer_encoding_token;
  ------------------
  |  Branch (1723:17): [True: 0, False: 0]
  ------------------
 1724|      0|            break;
 1725|       |
 1726|      0|          case h_connection_keep_alive:
  ------------------
  |  Branch (1726:11): [True: 0, False: 9.92k]
  ------------------
 1727|    687|          case h_connection_close:
  ------------------
  |  Branch (1727:11): [True: 687, False: 9.23k]
  ------------------
 1728|    687|            if (ch != ' ') parser->header_state = h_general;
  ------------------
  |  Branch (1728:17): [True: 261, False: 426]
  ------------------
 1729|    687|            break;
 1730|       |
 1731|      0|          default:
  ------------------
  |  Branch (1731:11): [True: 0, False: 9.92k]
  ------------------
 1732|      0|            parser->state = s_header_value;
 1733|      0|            parser->header_state = h_general;
 1734|      0|            break;
 1735|  9.92k|        }
 1736|  9.92k|        break;
 1737|  9.92k|      }
 1738|       |
 1739|  9.92k|      case s_header_almost_done:
  ------------------
  |  Branch (1739:7): [True: 3.54k, False: 131k]
  ------------------
 1740|  3.54k|      {
 1741|  3.54k|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|  3.54k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  3.54k|do {                                                                 \
  |  |  515|  3.54k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 1, False: 3.54k]
  |  |  ------------------
  |  |  516|      1|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|      1|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|      1|do {                                                                 \
  |  |  |  |   56|      1|  parser->http_errno = (e);                                          \
  |  |  |  |   57|      1|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|      1|    goto error;                                                      \
  |  |  518|      1|  }                                                                  \
  |  |  519|  3.54k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 1742|       |
 1743|  3.54k|        parser->state = s_header_value_lws;
 1744|  3.54k|        break;
 1745|  3.54k|      }
 1746|       |
 1747|  3.53k|      case s_header_value_lws:
  ------------------
  |  Branch (1747:7): [True: 3.53k, False: 131k]
  ------------------
 1748|  3.53k|      {
 1749|  3.53k|        if (ch == ' ' || ch == '\t') {
  ------------------
  |  Branch (1749:13): [True: 384, False: 3.15k]
  |  Branch (1749:26): [True: 311, False: 2.84k]
  ------------------
 1750|    695|          parser->state = s_header_value_start;
 1751|    695|          goto reexecute_byte;
 1752|    695|        }
 1753|       |
 1754|       |        /* finished the header */
 1755|  2.84k|        switch (parser->header_state) {
 1756|      0|          case h_connection_keep_alive:
  ------------------
  |  Branch (1756:11): [True: 0, False: 2.84k]
  ------------------
 1757|      0|            parser->flags |= F_CONNECTION_KEEP_ALIVE;
 1758|      0|            break;
 1759|    211|          case h_connection_close:
  ------------------
  |  Branch (1759:11): [True: 211, False: 2.62k]
  ------------------
 1760|    211|            parser->flags |= F_CONNECTION_CLOSE;
 1761|    211|            break;
 1762|      0|          case h_transfer_encoding_chunked:
  ------------------
  |  Branch (1762:11): [True: 0, False: 2.84k]
  ------------------
 1763|      0|            parser->flags |= F_CHUNKED;
 1764|      0|            break;
 1765|  2.62k|          default:
  ------------------
  |  Branch (1765:11): [True: 2.62k, False: 211]
  ------------------
 1766|  2.62k|            break;
 1767|  2.84k|        }
 1768|       |
 1769|  2.84k|        parser->state = s_header_field_start;
 1770|  2.84k|        goto reexecute_byte;
 1771|  2.84k|      }
 1772|       |
 1773|    212|      case s_header_value_discard_ws_almost_done:
  ------------------
  |  Branch (1773:7): [True: 212, False: 135k]
  ------------------
 1774|    212|      {
 1775|    212|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|    212|# define STRICT_CHECK(cond)                                          \
  |  |  514|    212|do {                                                                 \
  |  |  515|    212|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 1, False: 211]
  |  |  ------------------
  |  |  516|      1|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|      1|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|      1|do {                                                                 \
  |  |  |  |   56|      1|  parser->http_errno = (e);                                          \
  |  |  |  |   57|      1|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|      1|    goto error;                                                      \
  |  |  518|      1|  }                                                                  \
  |  |  519|    212|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 211]
  |  |  ------------------
  ------------------
 1776|    211|        parser->state = s_header_value_discard_lws;
 1777|    211|        break;
 1778|    212|      }
 1779|       |
 1780|  2.53k|      case s_header_value_discard_lws:
  ------------------
  |  Branch (1780:7): [True: 2.53k, False: 132k]
  ------------------
 1781|  2.53k|      {
 1782|  2.53k|        if (ch == ' ' || ch == '\t') {
  ------------------
  |  Branch (1782:13): [True: 237, False: 2.29k]
  |  Branch (1782:26): [True: 203, False: 2.09k]
  ------------------
 1783|    440|          parser->state = s_header_value_discard_ws;
 1784|    440|          break;
 1785|  2.09k|        } else {
 1786|       |          /* header value was empty */
 1787|  2.09k|          MARK(header_value);
  ------------------
  |  |  112|  2.09k|#define MARK(FOR)                                                    \
  |  |  113|  2.09k|do {                                                                 \
  |  |  114|  2.09k|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 2.09k, False: 0]
  |  |  ------------------
  |  |  115|  2.09k|    FOR##_mark = p;                                                  \
  |  |  116|  2.09k|  }                                                                  \
  |  |  117|  2.09k|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 2.09k]
  |  |  ------------------
  ------------------
 1788|  2.09k|          parser->state = s_header_field_start;
 1789|  2.09k|          CALLBACK_DATA_NOADVANCE(header_value);
  ------------------
  |  |  109|  2.09k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|  2.09k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  2.09k|do {                                                                 \
  |  |  |  |   86|  2.09k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  2.09k|                                                                     \
  |  |  |  |   88|  2.09k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 2.09k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|  2.09k|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 2.09k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|  2.09k|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 2.09k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|        SET_ERRNO(HPE_CB_##FOR);                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|      }                                                              \
  |  |  |  |   93|  2.09k|                                                                     \
  |  |  |  |   94|  2.09k|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|  2.09k|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  2.09k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 2.09k]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|  2.09k|    }                                                                \
  |  |  |  |   99|  2.09k|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|  2.09k|  }                                                                  \
  |  |  |  |  101|  2.09k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 2.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1789:11): [True: 2.09k, False: 0]
  ------------------
 1790|  2.09k|          goto reexecute_byte;
 1791|  2.09k|        }
 1792|  2.53k|      }
 1793|       |
 1794|  2.89k|      case s_headers_almost_done:
  ------------------
  |  Branch (1794:7): [True: 2.89k, False: 132k]
  ------------------
 1795|  2.89k|      {
 1796|  2.89k|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|  2.89k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  2.89k|do {                                                                 \
  |  |  515|  2.89k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 1, False: 2.89k]
  |  |  ------------------
  |  |  516|      1|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|      1|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|      1|do {                                                                 \
  |  |  |  |   56|      1|  parser->http_errno = (e);                                          \
  |  |  |  |   57|      1|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|      1|    goto error;                                                      \
  |  |  518|      1|  }                                                                  \
  |  |  519|  2.89k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 2.89k]
  |  |  ------------------
  ------------------
 1797|       |
 1798|  2.89k|        if (parser->flags & F_TRAILING) {
  ------------------
  |  Branch (1798:13): [True: 0, False: 2.89k]
  ------------------
 1799|       |          /* End of a chunked request */
 1800|      0|          parser->state = NEW_MESSAGE();
  ------------------
  |  |  520|      0|# define NEW_MESSAGE() (http_should_keep_alive(parser) ? start_state : s_dead)
  |  |  ------------------
  |  |  |  |  503|      0|#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (503:22): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (520:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1801|      0|          CALLBACK_NOTIFY(message_complete);
  ------------------
  |  |   78|      0|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|      0|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|      0|do {                                                                 \
  |  |  |  |   63|      0|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|      0|                                                                     \
  |  |  |  |   65|      0|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|      0|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   67|      0|      SET_ERRNO(HPE_CB_##FOR);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   68|      0|    }                                                                \
  |  |  |  |   69|      0|                                                                     \
  |  |  |  |   70|      0|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|      0|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|      0|  }                                                                  \
  |  |  |  |   75|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1801:11): [True: 0, False: 0]
  ------------------
 1802|      0|          break;
 1803|      0|        }
 1804|       |
 1805|       |        /* Cannot use transfer-encoding and a content-length header together
 1806|       |           per the HTTP specification. (RFC 7230 Section 3.3.3) */
 1807|  2.89k|        if ((parser->uses_transfer_encoding == 1) &&
  ------------------
  |  Branch (1807:13): [True: 0, False: 2.89k]
  ------------------
 1808|      0|             (parser->flags & F_CONTENTLENGTH)) {
  ------------------
  |  Branch (1808:14): [True: 0, False: 0]
  ------------------
 1809|       |          /* Allow it for lenient parsing as long as `Transfer-Encoding` is
 1810|       |           * not `chunked` or allow_length_with_encoding is set
 1811|       |           */
 1812|      0|          if (parser->flags & F_CHUNKED) {
  ------------------
  |  Branch (1812:15): [True: 0, False: 0]
  ------------------
 1813|      0|            if (!allow_chunked_length) {
  ------------------
  |  Branch (1813:17): [True: 0, False: 0]
  ------------------
 1814|      0|              SET_ERRNO(HPE_UNEXPECTED_CONTENT_LENGTH);
  ------------------
  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |   55|      0|do {                                                                 \
  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |   57|      0|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1815|      0|              goto error;
 1816|      0|            }
 1817|      0|          } else if (!lenient) {
  ------------------
  |  Branch (1817:22): [True: 0, False: 0]
  ------------------
 1818|      0|            SET_ERRNO(HPE_UNEXPECTED_CONTENT_LENGTH);
  ------------------
  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |   55|      0|do {                                                                 \
  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |   57|      0|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1819|      0|            goto error;
 1820|      0|          }
 1821|      0|        }
 1822|       |
 1823|  2.89k|        parser->state = s_headers_done;
 1824|       |
 1825|       |        /* Here we call the headers_complete callback. This is somewhat
 1826|       |         * different than other callbacks because if the user returns 1, we
 1827|       |         * will interpret that as saying that this message has no body. This
 1828|       |         * is needed for the annoying case of recieving a response to a HEAD
 1829|       |         * request.
 1830|       |         *
 1831|       |         * We'd like to use CALLBACK_NOTIFY_NOADVANCE() here but we cannot, so
 1832|       |         * we have to simulate it by handling a change in errno below.
 1833|       |         */
 1834|  2.89k|        if (settings->on_headers_complete) {
  ------------------
  |  Branch (1834:13): [True: 2.89k, False: 0]
  ------------------
 1835|  2.89k|          switch (settings->on_headers_complete(parser)) {
 1836|  2.89k|            case 0:
  ------------------
  |  Branch (1836:13): [True: 2.89k, False: 0]
  ------------------
 1837|  2.89k|              break;
 1838|       |
 1839|      0|            case 1:
  ------------------
  |  Branch (1839:13): [True: 0, False: 2.89k]
  ------------------
 1840|      0|              parser->flags |= F_SKIPBODY;
 1841|      0|              break;
 1842|       |
 1843|      0|            default:
  ------------------
  |  Branch (1843:13): [True: 0, False: 2.89k]
  ------------------
 1844|      0|              SET_ERRNO(HPE_CB_headers_complete);
  ------------------
  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |   55|      0|do {                                                                 \
  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |   57|      0|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1845|      0|              return p - data; /* Error */
 1846|  2.89k|          }
 1847|  2.89k|        }
 1848|       |
 1849|  2.89k|        if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {
  ------------------
  |  |  204|  2.89k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  ------------------
  |  Branch (1849:13): [True: 0, False: 2.89k]
  ------------------
 1850|      0|          return p - data;
 1851|      0|        }
 1852|       |
 1853|  2.89k|        goto reexecute_byte;
 1854|  2.89k|      }
 1855|       |
 1856|  2.89k|      case s_headers_done:
  ------------------
  |  Branch (1856:7): [True: 2.89k, False: 132k]
  ------------------
 1857|  2.89k|      {
 1858|  2.89k|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|  2.89k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  2.89k|do {                                                                 \
  |  |  515|  2.89k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 0, False: 2.89k]
  |  |  ------------------
  |  |  516|      0|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |   57|      0|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|      0|    goto error;                                                      \
  |  |  518|      0|  }                                                                  \
  |  |  519|  2.89k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 2.89k]
  |  |  ------------------
  ------------------
 1859|       |
 1860|  2.89k|        parser->nread = 0;
 1861|       |
 1862|       |        /* Exit, the rest of the connect is in a different protocol. */
 1863|  2.89k|        if (parser->method == HTTP_CONNECT) {
  ------------------
  |  Branch (1863:13): [True: 2, False: 2.89k]
  ------------------
 1864|      2|          parser->state = NEW_MESSAGE();
  ------------------
  |  |  520|      2|# define NEW_MESSAGE() (http_should_keep_alive(parser) ? start_state : s_dead)
  |  |  ------------------
  |  |  |  |  503|      1|#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (503:22): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (520:25): [True: 1, False: 1]
  |  |  ------------------
  ------------------
 1865|      2|          CALLBACK_NOTIFY(message_complete);
  ------------------
  |  |   78|      2|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|      2|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|      2|do {                                                                 \
  |  |  |  |   63|      2|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|      2|                                                                     \
  |  |  |  |   65|      2|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|      2|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |   67|      0|      SET_ERRNO(HPE_CB_##FOR);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   68|      0|    }                                                                \
  |  |  |  |   69|      2|                                                                     \
  |  |  |  |   70|      2|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|      2|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      2|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|      2|  }                                                                  \
  |  |  |  |   75|      2|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1865:11): [True: 2, False: 0]
  ------------------
 1866|      2|          return (p - data) + 1;
 1867|      2|        }
 1868|       |
 1869|  2.89k|        if (parser->flags & F_SKIPBODY) {
  ------------------
  |  Branch (1869:13): [True: 0, False: 2.89k]
  ------------------
 1870|      0|          parser->state = NEW_MESSAGE();
  ------------------
  |  |  520|      0|# define NEW_MESSAGE() (http_should_keep_alive(parser) ? start_state : s_dead)
  |  |  ------------------
  |  |  |  |  503|      0|#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (503:22): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (520:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1871|      0|          CALLBACK_NOTIFY(message_complete);
  ------------------
  |  |   78|      0|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|      0|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|      0|do {                                                                 \
  |  |  |  |   63|      0|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|      0|                                                                     \
  |  |  |  |   65|      0|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|      0|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   67|      0|      SET_ERRNO(HPE_CB_##FOR);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   68|      0|    }                                                                \
  |  |  |  |   69|      0|                                                                     \
  |  |  |  |   70|      0|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|      0|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|      0|  }                                                                  \
  |  |  |  |   75|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1871:11): [True: 0, False: 0]
  ------------------
 1872|  2.89k|        } else if (parser->flags & F_CHUNKED) {
  ------------------
  |  Branch (1872:20): [True: 0, False: 2.89k]
  ------------------
 1873|       |          /* chunked encoding - ignore Content-Length header */
 1874|      0|          parser->state = s_chunk_size_start;
 1875|  2.89k|        } else if (parser->uses_transfer_encoding == 1) {
  ------------------
  |  Branch (1875:20): [True: 0, False: 2.89k]
  ------------------
 1876|      0|          if (parser->type == HTTP_REQUEST && !lenient) {
  ------------------
  |  Branch (1876:15): [True: 0, False: 0]
  |  Branch (1876:47): [True: 0, False: 0]
  ------------------
 1877|       |            /* RFC 7230 3.3.3 */
 1878|       |            /* If a Transfer-Encoding header field
 1879|       |            * is present in a request and the chunked transfer coding is not
 1880|       |            * the final encoding, the message body length cannot be determined
 1881|       |            * reliably; the server MUST respond with the 400 (Bad Request)
 1882|       |            * status code and then close the connection.
 1883|       |            */
 1884|      0|            SET_ERRNO(HPE_INVALID_TRANSFER_ENCODING);
  ------------------
  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |   55|      0|do {                                                                 \
  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |   57|      0|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1885|      0|            return (p - data); /* Error */
 1886|      0|          } else {
 1887|       |            /* RFC 7230 3.3.3 */
 1888|       |            /* If a Transfer-Encoding header field is present in a response and
 1889|       |            * the chunked transfer coding is not the final encoding, the
 1890|       |            * message body length is determined by reading the connection until
 1891|       |            * it is closed by the server.
 1892|       |            */
 1893|      0|              parser->state = s_body_identity_eof;
 1894|      0|          }
 1895|  2.89k|        } else {
 1896|  2.89k|          if (parser->content_length == 0) {
  ------------------
  |  Branch (1896:15): [True: 0, False: 2.89k]
  ------------------
 1897|       |            /* Content-Length header given but zero: Content-Length: 0\r\n */
 1898|      0|            parser->state = NEW_MESSAGE();
  ------------------
  |  |  520|      0|# define NEW_MESSAGE() (http_should_keep_alive(parser) ? start_state : s_dead)
  |  |  ------------------
  |  |  |  |  503|      0|#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (503:22): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (520:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1899|      0|            CALLBACK_NOTIFY(message_complete);
  ------------------
  |  |   78|      0|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|      0|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|      0|do {                                                                 \
  |  |  |  |   63|      0|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|      0|                                                                     \
  |  |  |  |   65|      0|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|      0|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   67|      0|      SET_ERRNO(HPE_CB_##FOR);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   68|      0|    }                                                                \
  |  |  |  |   69|      0|                                                                     \
  |  |  |  |   70|      0|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|      0|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|      0|  }                                                                  \
  |  |  |  |   75|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1899:13): [True: 0, False: 0]
  ------------------
 1900|  2.89k|          } else if (parser->content_length != ULLONG_MAX) {
  ------------------
  |  Branch (1900:22): [True: 0, False: 2.89k]
  ------------------
 1901|       |            /* Content-Length header given and non-zero */
 1902|      0|            parser->state = s_body_identity;
 1903|  2.89k|          } else {
 1904|  2.89k|            if (parser->type == HTTP_REQUEST ||
  ------------------
  |  Branch (1904:17): [True: 1.35k, False: 1.53k]
  ------------------
 1905|  2.86k|                !http_message_needs_eof(parser)) {
  ------------------
  |  Branch (1905:17): [True: 1.50k, False: 32]
  ------------------
 1906|       |              /* Assume content-length 0 - read the next */
 1907|  2.86k|              parser->state = NEW_MESSAGE();
  ------------------
  |  |  520|  2.86k|# define NEW_MESSAGE() (http_should_keep_alive(parser) ? start_state : s_dead)
  |  |  ------------------
  |  |  |  |  503|  2.83k|#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (503:22): [True: 1.33k, False: 1.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (520:25): [True: 2.83k, False: 25]
  |  |  ------------------
  ------------------
 1908|  2.86k|              CALLBACK_NOTIFY(message_complete);
  ------------------
  |  |   78|  2.86k|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|  2.86k|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|  2.86k|do {                                                                 \
  |  |  |  |   63|  2.86k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|  2.86k|                                                                     \
  |  |  |  |   65|  2.86k|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 2.86k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|  2.86k|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 2.86k]
  |  |  |  |  ------------------
  |  |  |  |   67|      0|      SET_ERRNO(HPE_CB_##FOR);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   68|      0|    }                                                                \
  |  |  |  |   69|  2.86k|                                                                     \
  |  |  |  |   70|  2.86k|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|  2.86k|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  2.86k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 2.86k]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|  2.86k|  }                                                                  \
  |  |  |  |   75|  2.86k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 2.86k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1908:15): [True: 2.86k, False: 0]
  ------------------
 1909|  2.86k|            } else {
 1910|       |              /* Read body until EOF */
 1911|     32|              parser->state = s_body_identity_eof;
 1912|     32|            }
 1913|  2.89k|          }
 1914|  2.89k|        }
 1915|       |
 1916|  2.89k|        break;
 1917|  2.89k|      }
 1918|       |
 1919|  2.89k|      case s_body_identity:
  ------------------
  |  Branch (1919:7): [True: 0, False: 135k]
  ------------------
 1920|      0|      {
 1921|      0|        uint64_t to_read = MIN(parser->content_length,
  ------------------
  |  |   37|      0|# define MIN(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (37:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1922|      0|                               (uint64_t) ((data + len) - p));
 1923|       |
 1924|      0|        assert(parser->content_length != 0
  ------------------
  |  Branch (1924:9): [True: 0, False: 0]
  |  Branch (1924:9): [True: 0, False: 0]
  |  Branch (1924:9): [True: 0, False: 0]
  ------------------
 1925|      0|            && parser->content_length != ULLONG_MAX);
 1926|       |
 1927|       |        /* The difference between advancing content_length and p is because
 1928|       |         * the latter will automaticaly advance on the next loop iteration.
 1929|       |         * Further, if content_length ends up at 0, we want to see the last
 1930|       |         * byte again for our message complete callback.
 1931|       |         */
 1932|      0|        MARK(body);
  ------------------
  |  |  112|      0|#define MARK(FOR)                                                    \
  |  |  113|      0|do {                                                                 \
  |  |  114|      0|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  115|      0|    FOR##_mark = p;                                                  \
  |  |  116|      0|  }                                                                  \
  |  |  117|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1933|      0|        parser->content_length -= to_read;
 1934|      0|        p += to_read - 1;
 1935|       |
 1936|      0|        if (parser->content_length == 0) {
  ------------------
  |  Branch (1936:13): [True: 0, False: 0]
  ------------------
 1937|      0|          parser->state = s_message_done;
 1938|       |
 1939|       |          /* Mimic CALLBACK_DATA_NOADVANCE() but with one extra byte.
 1940|       |           *
 1941|       |           * The alternative to doing this is to wait for the next byte to
 1942|       |           * trigger the data callback, just as in every other case. The
 1943|       |           * problem with this is that this makes it difficult for the test
 1944|       |           * harness to distinguish between complete-on-EOF and
 1945|       |           * complete-on-length. It's not clear that this distinction is
 1946|       |           * important for applications, but let's keep it for now.
 1947|       |           */
 1948|      0|          CALLBACK_DATA_(body, p - body_mark + 1, p - data);
  ------------------
  |  |   84|      0|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |   85|      0|do {                                                                 \
  |  |   86|      0|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |   87|      0|                                                                     \
  |  |   88|      0|  if (FOR##_mark) {                                                  \
  |  |  ------------------
  |  |  |  Branch (88:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   89|      0|    if (settings->on_##FOR) {                                        \
  |  |  ------------------
  |  |  |  Branch (89:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   90|      0|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  ------------------
  |  |  |  Branch (90:11): [True: 0, False: 0]
  |  |  ------------------
  |  |   91|      0|        SET_ERRNO(HPE_CB_##FOR);                                     \
  |  |  ------------------
  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |   57|      0|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   92|      0|      }                                                              \
  |  |   93|      0|                                                                     \
  |  |   94|      0|      /* We either errored above or got paused; get out */           \
  |  |   95|      0|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  ------------------
  |  |  |  |  204|      0|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  ------------------
  |  |  |  Branch (95:11): [True: 0, False: 0]
  |  |  ------------------
  |  |   96|      0|        return (ER);                                                 \
  |  |   97|      0|      }                                                              \
  |  |   98|      0|    }                                                                \
  |  |   99|      0|    FOR##_mark = NULL;                                               \
  |  |  100|      0|  }                                                                  \
  |  |  101|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (101:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1948:11): [True: 0, False: 0]
  ------------------
 1949|      0|          goto reexecute_byte;
 1950|      0|        }
 1951|       |
 1952|      0|        break;
 1953|      0|      }
 1954|       |
 1955|       |      /* read until EOF */
 1956|      6|      case s_body_identity_eof:
  ------------------
  |  Branch (1956:7): [True: 6, False: 135k]
  ------------------
 1957|      6|        MARK(body);
  ------------------
  |  |  112|      6|#define MARK(FOR)                                                    \
  |  |  113|      6|do {                                                                 \
  |  |  114|      6|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 6, False: 0]
  |  |  ------------------
  |  |  115|      6|    FOR##_mark = p;                                                  \
  |  |  116|      6|  }                                                                  \
  |  |  117|      6|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 6]
  |  |  ------------------
  ------------------
 1958|      6|        p = data + len - 1;
 1959|       |
 1960|      6|        break;
 1961|       |
 1962|      0|      case s_message_done:
  ------------------
  |  Branch (1962:7): [True: 0, False: 135k]
  ------------------
 1963|      0|        parser->state = NEW_MESSAGE();
  ------------------
  |  |  520|      0|# define NEW_MESSAGE() (http_should_keep_alive(parser) ? start_state : s_dead)
  |  |  ------------------
  |  |  |  |  503|      0|#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (503:22): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (520:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1964|      0|        CALLBACK_NOTIFY(message_complete);
  ------------------
  |  |   78|      0|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|      0|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|      0|do {                                                                 \
  |  |  |  |   63|      0|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|      0|                                                                     \
  |  |  |  |   65|      0|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|      0|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   67|      0|      SET_ERRNO(HPE_CB_##FOR);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   68|      0|    }                                                                \
  |  |  |  |   69|      0|                                                                     \
  |  |  |  |   70|      0|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|      0|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|      0|  }                                                                  \
  |  |  |  |   75|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1964:9): [True: 0, False: 0]
  ------------------
 1965|      0|        break;
 1966|       |
 1967|      0|      case s_chunk_size_start:
  ------------------
  |  Branch (1967:7): [True: 0, False: 135k]
  ------------------
 1968|      0|      {
 1969|      0|        assert(parser->nread == 1);
  ------------------
  |  Branch (1969:9): [True: 0, False: 0]
  ------------------
 1970|      0|        assert(parser->flags & F_CHUNKED);
  ------------------
  |  Branch (1970:9): [True: 0, False: 0]
  ------------------
 1971|       |
 1972|      0|        unhex_val = unhex[(unsigned char)ch];
 1973|      0|        if (unhex_val == -1) {
  ------------------
  |  Branch (1973:13): [True: 0, False: 0]
  ------------------
 1974|      0|          SET_ERRNO(HPE_INVALID_CHUNK_SIZE);
  ------------------
  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |   55|      0|do {                                                                 \
  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |   57|      0|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1975|      0|          goto error;
 1976|      0|        }
 1977|       |
 1978|      0|        parser->content_length = unhex_val;
 1979|      0|        parser->state = s_chunk_size;
 1980|      0|        break;
 1981|      0|      }
 1982|       |
 1983|      0|      case s_chunk_size:
  ------------------
  |  Branch (1983:7): [True: 0, False: 135k]
  ------------------
 1984|      0|      {
 1985|      0|        uint64_t t;
 1986|       |
 1987|      0|        assert(parser->flags & F_CHUNKED);
  ------------------
  |  Branch (1987:9): [True: 0, False: 0]
  ------------------
 1988|       |
 1989|      0|        if (ch == CR) {
  ------------------
  |  |  474|      0|#define CR                  '\r'
  ------------------
  |  Branch (1989:13): [True: 0, False: 0]
  ------------------
 1990|      0|          parser->state = s_chunk_size_almost_done;
 1991|      0|          break;
 1992|      0|        }
 1993|       |
 1994|      0|        unhex_val = unhex[(unsigned char)ch];
 1995|       |
 1996|      0|        if (unhex_val == -1) {
  ------------------
  |  Branch (1996:13): [True: 0, False: 0]
  ------------------
 1997|      0|          if (ch == ';' || ch == ' ') {
  ------------------
  |  Branch (1997:15): [True: 0, False: 0]
  |  Branch (1997:28): [True: 0, False: 0]
  ------------------
 1998|      0|            parser->state = s_chunk_parameters;
 1999|      0|            break;
 2000|      0|          }
 2001|       |
 2002|      0|          SET_ERRNO(HPE_INVALID_CHUNK_SIZE);
  ------------------
  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |   55|      0|do {                                                                 \
  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |   57|      0|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2003|      0|          goto error;
 2004|      0|        }
 2005|       |
 2006|      0|        t = parser->content_length;
 2007|      0|        t *= 16;
 2008|      0|        t += unhex_val;
 2009|       |
 2010|       |        /* Overflow? Test against a conservative limit for simplicity. */
 2011|      0|        if ((ULLONG_MAX - 16) / 16 < parser->content_length) {
  ------------------
  |  Branch (2011:13): [True: 0, False: 0]
  ------------------
 2012|      0|          SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
  ------------------
  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |   55|      0|do {                                                                 \
  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |   57|      0|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2013|      0|          goto error;
 2014|      0|        }
 2015|       |
 2016|      0|        parser->content_length = t;
 2017|      0|        break;
 2018|      0|      }
 2019|       |
 2020|      0|      case s_chunk_parameters:
  ------------------
  |  Branch (2020:7): [True: 0, False: 135k]
  ------------------
 2021|      0|      {
 2022|      0|        assert(parser->flags & F_CHUNKED);
  ------------------
  |  Branch (2022:9): [True: 0, False: 0]
  ------------------
 2023|       |        /* just ignore this shit. TODO check for overflow */
 2024|      0|        if (ch == CR) {
  ------------------
  |  |  474|      0|#define CR                  '\r'
  ------------------
  |  Branch (2024:13): [True: 0, False: 0]
  ------------------
 2025|      0|          parser->state = s_chunk_size_almost_done;
 2026|      0|          break;
 2027|      0|        }
 2028|      0|        break;
 2029|      0|      }
 2030|       |
 2031|      0|      case s_chunk_size_almost_done:
  ------------------
  |  Branch (2031:7): [True: 0, False: 135k]
  ------------------
 2032|      0|      {
 2033|      0|        assert(parser->flags & F_CHUNKED);
  ------------------
  |  Branch (2033:9): [True: 0, False: 0]
  ------------------
 2034|      0|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|      0|# define STRICT_CHECK(cond)                                          \
  |  |  514|      0|do {                                                                 \
  |  |  515|      0|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  516|      0|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |   57|      0|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|      0|    goto error;                                                      \
  |  |  518|      0|  }                                                                  \
  |  |  519|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2035|       |
 2036|      0|        parser->nread = 0;
 2037|       |
 2038|      0|        if (parser->content_length == 0) {
  ------------------
  |  Branch (2038:13): [True: 0, False: 0]
  ------------------
 2039|      0|          parser->flags |= F_TRAILING;
 2040|      0|          parser->state = s_header_field_start;
 2041|      0|        } else {
 2042|      0|          parser->state = s_chunk_data;
 2043|      0|        }
 2044|      0|        break;
 2045|      0|      }
 2046|       |
 2047|      0|      case s_chunk_data:
  ------------------
  |  Branch (2047:7): [True: 0, False: 135k]
  ------------------
 2048|      0|      {
 2049|      0|        uint64_t to_read = MIN(parser->content_length,
  ------------------
  |  |   37|      0|# define MIN(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (37:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2050|      0|                               (uint64_t) ((data + len) - p));
 2051|       |
 2052|      0|        assert(parser->flags & F_CHUNKED);
  ------------------
  |  Branch (2052:9): [True: 0, False: 0]
  ------------------
 2053|      0|        assert(parser->content_length != 0
  ------------------
  |  Branch (2053:9): [True: 0, False: 0]
  |  Branch (2053:9): [True: 0, False: 0]
  |  Branch (2053:9): [True: 0, False: 0]
  ------------------
 2054|      0|            && parser->content_length != ULLONG_MAX);
 2055|       |
 2056|       |        /* See the explanation in s_body_identity for why the content
 2057|       |         * length and data pointers are managed this way.
 2058|       |         */
 2059|      0|        MARK(body);
  ------------------
  |  |  112|      0|#define MARK(FOR)                                                    \
  |  |  113|      0|do {                                                                 \
  |  |  114|      0|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  115|      0|    FOR##_mark = p;                                                  \
  |  |  116|      0|  }                                                                  \
  |  |  117|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2060|      0|        parser->content_length -= to_read;
 2061|      0|        p += to_read - 1;
 2062|       |
 2063|      0|        if (parser->content_length == 0) {
  ------------------
  |  Branch (2063:13): [True: 0, False: 0]
  ------------------
 2064|      0|          parser->state = s_chunk_data_almost_done;
 2065|      0|        }
 2066|       |
 2067|      0|        break;
 2068|      0|      }
 2069|       |
 2070|      0|      case s_chunk_data_almost_done:
  ------------------
  |  Branch (2070:7): [True: 0, False: 135k]
  ------------------
 2071|      0|        assert(parser->flags & F_CHUNKED);
  ------------------
  |  Branch (2071:9): [True: 0, False: 0]
  ------------------
 2072|      0|        assert(parser->content_length == 0);
  ------------------
  |  Branch (2072:9): [True: 0, False: 0]
  ------------------
 2073|      0|        STRICT_CHECK(ch != CR);
  ------------------
  |  |  513|      0|# define STRICT_CHECK(cond)                                          \
  |  |  514|      0|do {                                                                 \
  |  |  515|      0|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  516|      0|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |   57|      0|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|      0|    goto error;                                                      \
  |  |  518|      0|  }                                                                  \
  |  |  519|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2074|      0|        parser->state = s_chunk_data_done;
 2075|      0|        CALLBACK_DATA(body);
  ------------------
  |  |  105|      0|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|      0|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|      0|do {                                                                 \
  |  |  |  |   86|      0|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|      0|                                                                     \
  |  |  |  |   88|      0|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|      0|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|      0|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|        SET_ERRNO(HPE_CB_##FOR);                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|      }                                                              \
  |  |  |  |   93|      0|                                                                     \
  |  |  |  |   94|      0|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|      0|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|      0|    }                                                                \
  |  |  |  |   99|      0|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|      0|  }                                                                  \
  |  |  |  |  101|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2075:9): [True: 0, False: 0]
  ------------------
 2076|      0|        break;
 2077|       |
 2078|      0|      case s_chunk_data_done:
  ------------------
  |  Branch (2078:7): [True: 0, False: 135k]
  ------------------
 2079|      0|        assert(parser->flags & F_CHUNKED);
  ------------------
  |  Branch (2079:9): [True: 0, False: 0]
  ------------------
 2080|      0|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|      0|# define STRICT_CHECK(cond)                                          \
  |  |  514|      0|do {                                                                 \
  |  |  515|      0|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  516|      0|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |   57|      0|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|      0|    goto error;                                                      \
  |  |  518|      0|  }                                                                  \
  |  |  519|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2081|      0|        parser->nread = 0;
 2082|      0|        parser->state = s_chunk_size_start;
 2083|      0|        break;
 2084|       |
 2085|      0|      default:
  ------------------
  |  Branch (2085:7): [True: 0, False: 135k]
  ------------------
 2086|      0|        assert(0 && "unhandled state");
  ------------------
  |  Branch (2086:9): [Folded, False: 0]
  |  Branch (2086:9): [True: 0, Folded]
  |  Branch (2086:9): [Folded, False: 0]
  ------------------
 2087|      0|        SET_ERRNO(HPE_INVALID_INTERNAL_STATE);
  ------------------
  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |   55|      0|do {                                                                 \
  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |   57|      0|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2088|      0|        goto error;
 2089|   135k|    }
 2090|   135k|  }
 2091|       |
 2092|       |  /* Run callbacks for any marks that we have leftover after we ran our of
 2093|       |   * bytes. There should be at most one of these set, so it's OK to invoke
 2094|       |   * them in series (unset marks will not result in callbacks).
 2095|       |   *
 2096|       |   * We use the NOADVANCE() variety of callbacks here because 'p' has already
 2097|       |   * overflowed 'data' and this allows us to correct for the off-by-one that
 2098|       |   * we'd otherwise have (since CALLBACK_DATA() is meant to be run with a 'p'
 2099|       |   * value that's in-bounds).
 2100|       |   */
 2101|       |
 2102|  1.29k|  assert(((header_field_mark ? 1 : 0) +
  ------------------
  |  Branch (2102:3): [True: 219, False: 607]
  |  Branch (2102:3): [True: 115, False: 711]
  |  Branch (2102:3): [True: 88, False: 738]
  |  Branch (2102:3): [True: 6, False: 820]
  |  Branch (2102:3): [True: 10, False: 816]
  |  Branch (2102:3): [True: 826, False: 0]
  ------------------
 2103|    826|          (header_value_mark ? 1 : 0) +
 2104|    826|          (url_mark ? 1 : 0)  +
 2105|    826|          (body_mark ? 1 : 0) +
 2106|    826|          (status_mark ? 1 : 0)) <= 1);
 2107|       |
 2108|    826|  CALLBACK_DATA_NOADVANCE(header_field);
  ------------------
  |  |  109|    826|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|    826|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    826|do {                                                                 \
  |  |  |  |   86|    826|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    826|                                                                     \
  |  |  |  |   88|    826|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 219, False: 607]
  |  |  |  |  ------------------
  |  |  |  |   89|    219|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 219, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|    219|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 219]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|        SET_ERRNO(HPE_CB_##FOR);                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|      }                                                              \
  |  |  |  |   93|    219|                                                                     \
  |  |  |  |   94|    219|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|    219|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    219|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 219]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|    219|    }                                                                \
  |  |  |  |   99|    219|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    219|  }                                                                  \
  |  |  |  |  101|    826|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 826]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2108:3): [True: 826, False: 0]
  ------------------
 2109|    826|  CALLBACK_DATA_NOADVANCE(header_value);
  ------------------
  |  |  109|    826|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|    826|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    826|do {                                                                 \
  |  |  |  |   86|    826|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    826|                                                                     \
  |  |  |  |   88|    826|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 115, False: 711]
  |  |  |  |  ------------------
  |  |  |  |   89|    115|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 115, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|    115|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 115]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|        SET_ERRNO(HPE_CB_##FOR);                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|      }                                                              \
  |  |  |  |   93|    115|                                                                     \
  |  |  |  |   94|    115|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|    115|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    115|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 115]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|    115|    }                                                                \
  |  |  |  |   99|    115|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    115|  }                                                                  \
  |  |  |  |  101|    826|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 826]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2109:3): [True: 826, False: 0]
  ------------------
 2110|    826|  CALLBACK_DATA_NOADVANCE(url);
  ------------------
  |  |  109|    826|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|    826|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    826|do {                                                                 \
  |  |  |  |   86|    826|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    826|                                                                     \
  |  |  |  |   88|    826|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 88, False: 738]
  |  |  |  |  ------------------
  |  |  |  |   89|     88|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 88, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|     88|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 88]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|        SET_ERRNO(HPE_CB_##FOR);                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|      }                                                              \
  |  |  |  |   93|     88|                                                                     \
  |  |  |  |   94|     88|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|     88|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|     88|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 88]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|     88|    }                                                                \
  |  |  |  |   99|     88|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|     88|  }                                                                  \
  |  |  |  |  101|    826|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 826]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2110:3): [True: 826, False: 0]
  ------------------
 2111|    826|  CALLBACK_DATA_NOADVANCE(body);
  ------------------
  |  |  109|    826|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|    826|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    826|do {                                                                 \
  |  |  |  |   86|    826|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    826|                                                                     \
  |  |  |  |   88|    826|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 6, False: 820]
  |  |  |  |  ------------------
  |  |  |  |   89|      6|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|      6|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 6]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|        SET_ERRNO(HPE_CB_##FOR);                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|      }                                                              \
  |  |  |  |   93|      6|                                                                     \
  |  |  |  |   94|      6|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|      6|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      6|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 6]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|      6|    }                                                                \
  |  |  |  |   99|      6|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|      6|  }                                                                  \
  |  |  |  |  101|    826|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 826]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2111:3): [True: 826, False: 0]
  ------------------
 2112|    826|  CALLBACK_DATA_NOADVANCE(status);
  ------------------
  |  |  109|    826|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|    826|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    826|do {                                                                 \
  |  |  |  |   86|    826|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    826|                                                                     \
  |  |  |  |   88|    826|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 10, False: 816]
  |  |  |  |  ------------------
  |  |  |  |   89|     10|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 0, False: 10]
  |  |  |  |  ------------------
  |  |  |  |   90|      0|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|        SET_ERRNO(HPE_CB_##FOR);                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |  |  |  |  |   55|      0|do {                                                                 \
  |  |  |  |  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |  |  |  |  |   57|      0|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|      }                                                              \
  |  |  |  |   93|      0|                                                                     \
  |  |  |  |   94|      0|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|      0|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|      0|    }                                                                \
  |  |  |  |   99|     10|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|     10|  }                                                                  \
  |  |  |  |  101|    826|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 826]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2112:3): [True: 826, False: 0]
  ------------------
 2113|       |
 2114|    826|  return len;
 2115|       |
 2116|    468|error:
 2117|    468|  if (HTTP_PARSER_ERRNO(parser) == HPE_OK) {
  ------------------
  |  |  204|    468|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  ------------------
  |  Branch (2117:7): [True: 0, False: 468]
  ------------------
 2118|      0|    SET_ERRNO(HPE_UNKNOWN);
  ------------------
  |  |   54|      0|#define SET_ERRNO(e)                                                 \
  |  |   55|      0|do {                                                                 \
  |  |   56|      0|  parser->http_errno = (e);                                          \
  |  |   57|      0|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2119|      0|  }
 2120|       |
 2121|    468|  return (p - data);
 2122|    826|}
_ZN4brpc22http_message_needs_eofEPKNS_11http_parserE:
 2128|  4.36k|{
 2129|  4.36k|  if (parser->type == HTTP_REQUEST) {
  ------------------
  |  Branch (2129:7): [True: 1.33k, False: 3.03k]
  ------------------
 2130|  1.33k|    return 0;
 2131|  1.33k|  }
 2132|       |
 2133|       |  /* See RFC 2616 section 4.4 */
 2134|  3.03k|  if (parser->status_code / 100 == 1 || /* 1xx e.g. Continue */
  ------------------
  |  Branch (2134:7): [True: 2.77k, False: 258]
  ------------------
 2135|    258|      parser->status_code == 204 ||     /* No Content */
  ------------------
  |  Branch (2135:7): [True: 80, False: 178]
  ------------------
 2136|    178|      parser->status_code == 304 ||     /* Not Modified */
  ------------------
  |  Branch (2136:7): [True: 146, False: 32]
  ------------------
 2137|  3.00k|      parser->flags & F_SKIPBODY) {     /* response to a HEAD request */
  ------------------
  |  Branch (2137:7): [True: 0, False: 32]
  ------------------
 2138|  3.00k|    return 0;
 2139|  3.00k|  }
 2140|       |
 2141|       |  /* RFC 7230 3.3.3, see `s_headers_almost_done` */
 2142|     32|  if ((parser->uses_transfer_encoding == 1) &&
  ------------------
  |  Branch (2142:7): [True: 0, False: 32]
  ------------------
 2143|      0|      (parser->flags & F_CHUNKED) == 0) {
  ------------------
  |  Branch (2143:7): [True: 0, False: 0]
  ------------------
 2144|      0|    return 1;
 2145|      0|  }
 2146|       |
 2147|     32|  if ((parser->flags & F_CHUNKED) || parser->content_length != ULLONG_MAX) {
  ------------------
  |  Branch (2147:7): [True: 0, False: 32]
  |  Branch (2147:38): [True: 0, False: 32]
  ------------------
 2148|      0|    return 0;
 2149|      0|  }
 2150|       |
 2151|     32|  return 1;
 2152|     32|}
_ZN4brpc22http_should_keep_aliveEPKNS_11http_parserE:
 2157|  2.86k|{
 2158|  2.86k|  if (parser->http_major > 0 && parser->http_minor > 0) {
  ------------------
  |  Branch (2158:7): [True: 2.83k, False: 24]
  |  Branch (2158:33): [True: 2.83k, False: 1]
  ------------------
 2159|       |    /* HTTP/1.1 */
 2160|  2.83k|    if (parser->flags & F_CONNECTION_CLOSE) {
  ------------------
  |  Branch (2160:9): [True: 1, False: 2.83k]
  ------------------
 2161|      1|      return 0;
 2162|      1|    }
 2163|  2.83k|  } else {
 2164|       |    /* HTTP/1.0 or earlier */
 2165|     25|    if (!(parser->flags & F_CONNECTION_KEEP_ALIVE)) {
  ------------------
  |  Branch (2165:9): [True: 25, False: 0]
  ------------------
 2166|     25|      return 0;
 2167|     25|    }
 2168|     25|  }
 2169|       |
 2170|  2.83k|  return !http_message_needs_eof(parser);
 2171|  2.86k|}
_ZN4brpc16http_parser_initEPNS_11http_parserENS_16http_parser_typeE:
 2183|  1.29k|{
 2184|  1.29k|  void *data = parser->data; /* preserve application data */
 2185|  1.29k|  memset(parser, 0, sizeof(*parser));
 2186|  1.29k|  parser->data = data;
 2187|  1.29k|  parser->type = t;
 2188|  1.29k|  parser->state = (t == HTTP_REQUEST ? s_start_req : (t == HTTP_RESPONSE ? s_start_res : s_start_req_or_res));
  ------------------
  |  Branch (2188:20): [True: 942, False: 354]
  |  Branch (2188:55): [True: 354, False: 0]
  ------------------
 2189|  1.29k|  parser->http_errno = HPE_OK;
 2190|  1.29k|}
_ZN4brpc21http_parser_parse_urlEPKcmiPNS_15http_parser_urlE:
 2345|    783|{
 2346|    783|  enum state s;
 2347|    783|  const char *p;
 2348|    783|  enum http_parser_url_fields uf, old_uf;
 2349|    783|  int found_at = 0;
 2350|       |
 2351|    783|  u->port = u->field_set = 0;
 2352|    783|  s = is_connect ? s_req_server_start : s_req_spaces_before_url;
  ------------------
  |  Branch (2352:7): [True: 686, False: 97]
  ------------------
 2353|    783|  old_uf = UF_MAX;
 2354|       |
 2355|  23.7k|  for (p = buf; p < buf + buflen; p++) {
  ------------------
  |  Branch (2355:17): [True: 23.0k, False: 629]
  ------------------
 2356|  23.0k|    s = parse_url_char(s, *p);
 2357|       |
 2358|       |    /* Figure out the next field that we're operating on */
 2359|  23.0k|    switch (s) {
 2360|    154|      case s_dead:
  ------------------
  |  Branch (2360:7): [True: 154, False: 22.9k]
  ------------------
 2361|    154|        return 1;
 2362|       |
 2363|       |      /* Skip delimeters */
 2364|     17|      case s_req_scheme_slash:
  ------------------
  |  Branch (2364:7): [True: 17, False: 23.0k]
  ------------------
 2365|     28|      case s_req_scheme_slash_slash:
  ------------------
  |  Branch (2365:7): [True: 11, False: 23.0k]
  ------------------
 2366|     29|      case s_req_server_start:
  ------------------
  |  Branch (2366:7): [True: 1, False: 23.0k]
  ------------------
 2367|     83|      case s_req_query_string_start:
  ------------------
  |  Branch (2367:7): [True: 54, False: 23.0k]
  ------------------
 2368|    532|      case s_req_fragment_start:
  ------------------
  |  Branch (2368:7): [True: 449, False: 22.6k]
  ------------------
 2369|    532|        continue;
 2370|       |
 2371|    429|      case s_req_scheme:
  ------------------
  |  Branch (2371:7): [True: 429, False: 22.6k]
  ------------------
 2372|    429|        uf = UF_SCHEME;
 2373|    429|        break;
 2374|       |
 2375|    437|      case s_req_server_with_at:
  ------------------
  |  Branch (2375:7): [True: 437, False: 22.6k]
  ------------------
 2376|    437|        found_at = 1;
 2377|       |        // fall through
 2378|  19.4k|      case s_req_server:
  ------------------
  |  Branch (2378:7): [True: 19.0k, False: 4.08k]
  ------------------
 2379|  19.4k|        uf = UF_HOST;
 2380|  19.4k|        break;
 2381|       |
 2382|    817|      case s_req_path:
  ------------------
  |  Branch (2382:7): [True: 817, False: 22.2k]
  ------------------
 2383|    817|        uf = UF_PATH;
 2384|    817|        break;
 2385|       |
 2386|    836|      case s_req_query_string:
  ------------------
  |  Branch (2386:7): [True: 836, False: 22.2k]
  ------------------
 2387|    836|        uf = UF_QUERY;
 2388|    836|        break;
 2389|       |
 2390|    878|      case s_req_fragment:
  ------------------
  |  Branch (2390:7): [True: 878, False: 22.2k]
  ------------------
 2391|    878|        uf = UF_FRAGMENT;
 2392|    878|        break;
 2393|       |
 2394|      0|      default:
  ------------------
  |  Branch (2394:7): [True: 0, False: 23.0k]
  ------------------
 2395|      0|        assert(!"Unexpected state");
  ------------------
  |  Branch (2395:9): [Folded, False: 0]
  ------------------
 2396|      0|        return 1;
 2397|  23.0k|    }
 2398|       |
 2399|       |    /* Nothing's changed; soldier on */
 2400|  22.4k|    if (uf == old_uf) {
  ------------------
  |  Branch (2400:9): [True: 21.6k, False: 803]
  ------------------
 2401|  21.6k|      u->field_data[uf].len++;
 2402|  21.6k|      continue;
 2403|  21.6k|    }
 2404|       |
 2405|    803|    u->field_data[uf].off = p - buf;
 2406|    803|    u->field_data[uf].len = 1;
 2407|       |
 2408|    803|    u->field_set |= (1 << uf);
 2409|    803|    old_uf = uf;
 2410|    803|  }
 2411|       |
 2412|       |  /* host must be present if there is a scheme */
 2413|       |  /* parsing http:///toto will fail */
 2414|    629|  if ((u->field_set & ((1 << UF_SCHEME) | (1 << UF_HOST))) != 0) {
  ------------------
  |  Branch (2414:7): [True: 532, False: 97]
  ------------------
 2415|    532|    if (http_parse_host(buf, u, found_at) != 0) {
  ------------------
  |  Branch (2415:9): [True: 347, False: 185]
  ------------------
 2416|    347|      return 1;
 2417|    347|    }
 2418|    532|  }
 2419|       |
 2420|       |  /* CONNECT requests can only contain "hostname:port" */
 2421|    282|  if (is_connect && u->field_set != ((1 << UF_HOST)|(1 << UF_PORT))) {
  ------------------
  |  Branch (2421:7): [True: 266, False: 16]
  |  Branch (2421:21): [True: 150, False: 116]
  ------------------
 2422|    150|    return 1;
 2423|    150|  }
 2424|       |
 2425|    132|  if (u->field_set & (1 << UF_PORT)) {
  ------------------
  |  Branch (2425:7): [True: 116, False: 16]
  ------------------
 2426|       |    /* Don't bother with endp; we've already validated the string */
 2427|    116|    unsigned long v = strtoul(buf + u->field_data[UF_PORT].off, NULL, 10);
 2428|       |
 2429|       |    /* Ports have a max value of 2^16 */
 2430|    116|    if (v > 0xffff) {
  ------------------
  |  Branch (2430:9): [True: 89, False: 27]
  ------------------
 2431|     89|      return 1;
 2432|     89|    }
 2433|       |
 2434|     27|    u->port = (uint16_t) v;
 2435|     27|  }
 2436|       |
 2437|     43|  return 0;
 2438|    132|}
http_parser.cpp:_ZN4brpcL14parse_url_charENS_5stateEc:
  552|  30.5k|{
  553|  30.5k|  if (ch == ' ' || ch == '\r' || ch == '\n') {
  ------------------
  |  Branch (553:7): [True: 2, False: 30.5k]
  |  Branch (553:20): [True: 1, False: 30.5k]
  |  Branch (553:34): [True: 2, False: 30.5k]
  ------------------
  554|      5|    return s_dead;
  555|      5|  }
  556|       |
  557|  30.5k|#if BRPC_HTTP_PARSER_STRICT
  558|  30.5k|  if (ch == '\t' || ch == '\f') {
  ------------------
  |  Branch (558:7): [True: 1, False: 30.5k]
  |  Branch (558:21): [True: 1, False: 30.5k]
  ------------------
  559|      2|    return s_dead;
  560|      2|  }
  561|  30.5k|#endif
  562|       |
  563|  30.5k|  switch (s) {
  564|  2.16k|    case s_req_spaces_before_url:
  ------------------
  |  Branch (564:5): [True: 2.16k, False: 28.3k]
  ------------------
  565|       |      /* Proxied requests are followed by scheme of an absolute URI (alpha).
  566|       |       * All methods except CONNECT are followed by '/' or '*'.
  567|       |       */
  568|       |
  569|  2.16k|      if (ch == '/' || ch == '*') {
  ------------------
  |  Branch (569:11): [True: 1.52k, False: 641]
  |  Branch (569:24): [True: 377, False: 264]
  ------------------
  570|  1.90k|        return s_req_path;
  571|  1.90k|      }
  572|       |
  573|    264|      if (IS_ALPHA(ch)) {
  ------------------
  |  |  477|    264|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|    264|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|    251|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |  |  Branch (477:30): [True: 251, False: 13]
  |  |  |  Branch (477:49): [True: 243, False: 8]
  |  |  ------------------
  ------------------
  574|    243|        return s_req_scheme;
  575|    243|      }
  576|       |
  577|     21|      break;
  578|       |
  579|    828|    case s_req_scheme:
  ------------------
  |  Branch (579:5): [True: 828, False: 29.7k]
  ------------------
  580|    828|      if (IS_ALPHA(ch)) {
  ------------------
  |  |  477|    828|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|    828|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|    620|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |  |  Branch (477:30): [True: 620, False: 208]
  |  |  |  Branch (477:49): [True: 613, False: 7]
  |  |  ------------------
  ------------------
  581|    613|        return s;
  582|    613|      }
  583|       |
  584|    215|      if (ch == ':') {
  ------------------
  |  Branch (584:11): [True: 197, False: 18]
  ------------------
  585|    197|        return s_req_scheme_slash;
  586|    197|      }
  587|       |
  588|     18|      break;
  589|       |
  590|    196|    case s_req_scheme_slash:
  ------------------
  |  Branch (590:5): [True: 196, False: 30.3k]
  ------------------
  591|    196|      if (ch == '/') {
  ------------------
  |  Branch (591:11): [True: 187, False: 9]
  ------------------
  592|    187|        return s_req_scheme_slash_slash;
  593|    187|      }
  594|       |
  595|      9|      break;
  596|       |
  597|    186|    case s_req_scheme_slash_slash:
  ------------------
  |  Branch (597:5): [True: 186, False: 30.3k]
  ------------------
  598|    186|      if (ch == '/') {
  ------------------
  |  Branch (598:11): [True: 174, False: 12]
  ------------------
  599|    174|        return s_req_server_start;
  600|    174|      }
  601|       |
  602|     12|      break;
  603|       |
  604|    486|    case s_req_server_with_at:
  ------------------
  |  Branch (604:5): [True: 486, False: 30.0k]
  ------------------
  605|    486|      if (ch == '@') {
  ------------------
  |  Branch (605:11): [True: 2, False: 484]
  ------------------
  606|      2|        return s_dead;
  607|      2|      }
  608|       |
  609|       |    /* FALLTHROUGH */
  610|  1.34k|    case s_req_server_start:
  ------------------
  |  Branch (610:5): [True: 862, False: 29.6k]
  ------------------
  611|  20.4k|    case s_req_server:
  ------------------
  |  Branch (611:5): [True: 19.0k, False: 11.4k]
  ------------------
  612|  20.4k|      if (ch == '/') {
  ------------------
  |  Branch (612:11): [True: 152, False: 20.2k]
  ------------------
  613|    152|        return s_req_path;
  614|    152|      }
  615|       |
  616|  20.2k|      if (ch == '?') {
  ------------------
  |  Branch (616:11): [True: 114, False: 20.1k]
  ------------------
  617|    114|        return s_req_query_string_start;
  618|    114|      }
  619|       |
  620|  20.1k|      if (ch == '@') {
  ------------------
  |  Branch (620:11): [True: 640, False: 19.5k]
  ------------------
  621|    640|        return s_req_server_with_at;
  622|    640|      }
  623|       |
  624|  19.5k|      if (IS_USERINFO_CHAR(ch) || ch == '[' || ch == ']') {
  ------------------
  |  |  484|  39.0k|#define IS_USERINFO_CHAR(c) (IS_ALPHANUM(c) || IS_MARK(c) || (c) == '%' || \
  |  |  ------------------
  |  |  |  |  479|  39.0k|#define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  477|  39.0k|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|  19.5k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|  4.22k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (477:30): [True: 4.22k, False: 15.3k]
  |  |  |  |  |  |  |  Branch (477:49): [True: 2.60k, False: 1.62k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  478|  16.9k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (478:30): [True: 5.81k, False: 11.1k]
  |  |  |  |  |  |  |  Branch (478:44): [True: 2.82k, False: 2.99k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_USERINFO_CHAR(c) (IS_ALPHANUM(c) || IS_MARK(c) || (c) == '%' || \
  |  |  ------------------
  |  |  |  |  481|  33.6k|#define IS_MARK(c)          ((c) == '-' || (c) == '_' || (c) == '.' || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (481:30): [True: 604, False: 13.4k]
  |  |  |  |  |  Branch (481:44): [True: 501, False: 12.9k]
  |  |  |  |  |  Branch (481:58): [True: 1.18k, False: 11.8k]
  |  |  |  |  ------------------
  |  |  |  |  482|  14.0k|  (c) == '!' || (c) == '~' || (c) == '*' || (c) == '\'' || (c) == '(' || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (482:3): [True: 4.12k, False: 7.68k]
  |  |  |  |  |  Branch (482:17): [True: 611, False: 7.07k]
  |  |  |  |  |  Branch (482:31): [True: 295, False: 6.77k]
  |  |  |  |  |  Branch (482:45): [True: 760, False: 6.01k]
  |  |  |  |  |  Branch (482:60): [True: 634, False: 5.38k]
  |  |  |  |  ------------------
  |  |  |  |  483|  33.6k|  (c) == ')')
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (483:3): [True: 496, False: 4.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (484:62): [True: 405, False: 4.48k]
  |  |  ------------------
  |  |  485|  19.5k|  (c) == ';' || (c) == ':' || (c) == '&' || (c) == '=' || (c) == '+' || \
  |  |  ------------------
  |  |  |  Branch (485:3): [True: 274, False: 4.20k]
  |  |  |  Branch (485:17): [True: 851, False: 3.35k]
  |  |  |  Branch (485:31): [True: 732, False: 2.62k]
  |  |  |  Branch (485:45): [True: 279, False: 2.34k]
  |  |  |  Branch (485:59): [True: 320, False: 2.02k]
  |  |  ------------------
  |  |  486|  19.5k|  (c) == '$' || (c) == ',')
  |  |  ------------------
  |  |  |  Branch (486:3): [True: 445, False: 1.57k]
  |  |  |  Branch (486:17): [True: 1.05k, False: 526]
  |  |  ------------------
  ------------------
  |  Branch (624:35): [True: 258, False: 268]
  |  Branch (624:48): [True: 207, False: 61]
  ------------------
  625|  19.4k|        return s_req_server;
  626|  19.4k|      }
  627|       |
  628|     61|      break;
  629|       |
  630|  3.01k|    case s_req_path:
  ------------------
  |  Branch (630:5): [True: 3.01k, False: 27.5k]
  ------------------
  631|  3.01k|      if (IS_URL_CHAR(ch)) {
  ------------------
  |  |  498|  3.01k|    (BIT_AT(normal_url_char, (unsigned char)c) || ((c) & 0x80))
  |  |  ------------------
  |  |  |  |   46|  6.03k|  (!!((unsigned int) (a)[(unsigned int) (i) >> 3] &                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:3): [True: 1.71k, False: 1.29k]
  |  |  |  |  ------------------
  |  |  |  |   47|  6.03k|   (1 << ((unsigned int) (i) & 7))))
  |  |  ------------------
  |  |  |  Branch (498:51): [True: 635, False: 664]
  |  |  ------------------
  ------------------
  632|  2.35k|        return s;
  633|  2.35k|      }
  634|       |
  635|    664|      switch (ch) {
  ------------------
  |  Branch (635:15): [True: 650, False: 14]
  ------------------
  636|    222|        case '?':
  ------------------
  |  Branch (636:9): [True: 222, False: 442]
  ------------------
  637|    222|          return s_req_query_string_start;
  638|       |
  639|    428|        case '#':
  ------------------
  |  Branch (639:9): [True: 428, False: 236]
  ------------------
  640|    428|          return s_req_fragment_start;
  641|    664|      }
  642|       |
  643|     14|      break;
  644|       |
  645|    264|    case s_req_query_string_start:
  ------------------
  |  Branch (645:5): [True: 264, False: 30.2k]
  ------------------
  646|  1.47k|    case s_req_query_string:
  ------------------
  |  Branch (646:5): [True: 1.21k, False: 29.3k]
  ------------------
  647|  1.47k|        if (IS_URL_CHAR(ch)) {
  ------------------
  |  |  498|  1.47k|    (BIT_AT(normal_url_char, (unsigned char)c) || ((c) & 0x80))
  |  |  ------------------
  |  |  |  |   46|  2.95k|  (!!((unsigned int) (a)[(unsigned int) (i) >> 3] &                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:3): [True: 714, False: 763]
  |  |  |  |  ------------------
  |  |  |  |   47|  2.95k|   (1 << ((unsigned int) (i) & 7))))
  |  |  ------------------
  |  |  |  Branch (498:51): [True: 374, False: 389]
  |  |  ------------------
  ------------------
  648|  1.08k|          return s_req_query_string;
  649|  1.08k|        }
  650|    389|        switch (ch) {
  ------------------
  |  Branch (650:17): [True: 377, False: 12]
  ------------------
  651|    356|          case '?':
  ------------------
  |  Branch (651:11): [True: 356, False: 33]
  ------------------
  652|       |            /* allow extra '?' in query string */
  653|    356|            return s_req_query_string;
  654|     21|          case '#':
  ------------------
  |  Branch (654:11): [True: 21, False: 368]
  ------------------
  655|     21|            return s_req_fragment_start;
  656|    389|        }
  657|     12|        break;
  658|       |
  659|    932|    case s_req_fragment_start:
  ------------------
  |  Branch (659:5): [True: 932, False: 29.6k]
  ------------------
  660|    932|        if (IS_URL_CHAR(ch)) {
  ------------------
  |  |  498|    932|    (BIT_AT(normal_url_char, (unsigned char)c) || ((c) & 0x80))
  |  |  ------------------
  |  |  |  |   46|  1.86k|  (!!((unsigned int) (a)[(unsigned int) (i) >> 3] &                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:3): [True: 141, False: 791]
  |  |  |  |  ------------------
  |  |  |  |   47|  1.86k|   (1 << ((unsigned int) (i) & 7))))
  |  |  ------------------
  |  |  |  Branch (498:51): [True: 209, False: 582]
  |  |  ------------------
  ------------------
  661|    350|          return s_req_fragment;
  662|    350|        }
  663|    582|        switch (ch) {
  ------------------
  |  Branch (663:17): [True: 571, False: 11]
  ------------------
  664|      3|          case '?':
  ------------------
  |  Branch (664:11): [True: 3, False: 579]
  ------------------
  665|      3|            return s_req_fragment;
  666|    568|          case '#':
  ------------------
  |  Branch (666:11): [True: 568, False: 14]
  ------------------
  667|    568|            return s;
  668|    582|        }
  669|     11|        break;
  670|       |
  671|  1.29k|    case s_req_fragment:
  ------------------
  |  Branch (671:5): [True: 1.29k, False: 29.2k]
  ------------------
  672|  1.29k|        if (IS_URL_CHAR(ch)) {
  ------------------
  |  |  498|  1.29k|    (BIT_AT(normal_url_char, (unsigned char)c) || ((c) & 0x80))
  |  |  ------------------
  |  |  |  |   46|  2.59k|  (!!((unsigned int) (a)[(unsigned int) (i) >> 3] &                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:3): [True: 529, False: 770]
  |  |  |  |  ------------------
  |  |  |  |   47|  2.59k|   (1 << ((unsigned int) (i) & 7))))
  |  |  ------------------
  |  |  |  Branch (498:51): [True: 505, False: 265]
  |  |  ------------------
  ------------------
  673|  1.03k|          return s;
  674|  1.03k|        }
  675|    265|        switch (ch) {
  ------------------
  |  Branch (675:17): [True: 252, False: 13]
  ------------------
  676|    183|          case '?':
  ------------------
  |  Branch (676:11): [True: 183, False: 82]
  ------------------
  677|    252|          case '#':
  ------------------
  |  Branch (677:11): [True: 69, False: 196]
  ------------------
  678|    252|            return s;
  679|    265|        }
  680|     13|        break;
  681|       |
  682|     13|    default:
  ------------------
  |  Branch (682:5): [True: 0, False: 30.5k]
  ------------------
  683|      0|      break;
  684|  30.5k|  }
  685|       |
  686|       |  /* We should never fall out of the switch above unless there's an error */
  687|    171|  return s_dead;
  688|  30.5k|}
http_parser.cpp:_ZN4brpcL15http_parse_hostEPKcPNS_15http_parser_urlEi:
 2270|    532|http_parse_host(const char * buf, struct http_parser_url *u, int found_at) {
 2271|    532|  enum http_host_state s;
 2272|       |
 2273|    532|  const char *p;
 2274|    532|  size_t buflen = u->field_data[UF_HOST].off + u->field_data[UF_HOST].len;
 2275|       |
 2276|    532|  u->field_data[UF_HOST].len = 0;
 2277|       |
 2278|    532|  s = found_at ? s_http_userinfo_start : s_http_host_start;
  ------------------
  |  Branch (2278:7): [True: 176, False: 356]
  ------------------
 2279|       |
 2280|  14.7k|  for (p = buf + u->field_data[UF_HOST].off; p < buf + buflen; p++) {
  ------------------
  |  Branch (2280:46): [True: 14.3k, False: 363]
  ------------------
 2281|  14.3k|    enum http_host_state new_s = http_parse_host_char(s, *p);
 2282|       |
 2283|  14.3k|    if (new_s == s_http_host_dead) {
  ------------------
  |  Branch (2283:9): [True: 169, False: 14.1k]
  ------------------
 2284|    169|      return 1;
 2285|    169|    }
 2286|       |
 2287|  14.1k|    switch(new_s) {
 2288|  1.91k|      case s_http_host:
  ------------------
  |  Branch (2288:7): [True: 1.91k, False: 12.2k]
  ------------------
 2289|  1.91k|        if (s != s_http_host) {
  ------------------
  |  Branch (2289:13): [True: 225, False: 1.69k]
  ------------------
 2290|    225|          u->field_data[UF_HOST].off = p - buf;
 2291|    225|        }
 2292|  1.91k|        u->field_data[UF_HOST].len++;
 2293|  1.91k|        break;
 2294|       |
 2295|  1.06k|      case s_http_host_v6:
  ------------------
  |  Branch (2295:7): [True: 1.06k, False: 13.1k]
  ------------------
 2296|  1.06k|        if (s != s_http_host_v6) {
  ------------------
  |  Branch (2296:13): [True: 55, False: 1.00k]
  ------------------
 2297|     55|          u->field_data[UF_HOST].off = p - buf;
 2298|     55|        }
 2299|  1.06k|        u->field_data[UF_HOST].len++;
 2300|  1.06k|        break;
 2301|       |
 2302|  1.80k|      case s_http_host_port:
  ------------------
  |  Branch (2302:7): [True: 1.80k, False: 12.3k]
  ------------------
 2303|  1.80k|        if (s != s_http_host_port) {
  ------------------
  |  Branch (2303:13): [True: 120, False: 1.68k]
  ------------------
 2304|    120|          u->field_data[UF_PORT].off = p - buf;
 2305|    120|          u->field_data[UF_PORT].len = 0;
 2306|    120|          u->field_set |= (1 << UF_PORT);
 2307|    120|        }
 2308|  1.80k|        u->field_data[UF_PORT].len++;
 2309|  1.80k|        break;
 2310|       |
 2311|  9.04k|      case s_http_userinfo:
  ------------------
  |  Branch (2311:7): [True: 9.04k, False: 5.15k]
  ------------------
 2312|  9.04k|        if (s != s_http_userinfo) {
  ------------------
  |  Branch (2312:13): [True: 164, False: 8.88k]
  ------------------
 2313|    164|          u->field_data[UF_USERINFO].off = p - buf ;
 2314|    164|          u->field_data[UF_USERINFO].len = 0;
 2315|    164|          u->field_set |= (1 << UF_USERINFO);
 2316|    164|        }
 2317|  9.04k|        u->field_data[UF_USERINFO].len++;
 2318|  9.04k|        break;
 2319|       |
 2320|    372|      default:
  ------------------
  |  Branch (2320:7): [True: 372, False: 13.8k]
  ------------------
 2321|    372|        break;
 2322|  14.1k|    }
 2323|  14.1k|    s = new_s;
 2324|  14.1k|  }
 2325|       |
 2326|       |  /* Make sure we don't end somewhere unexpected */
 2327|    363|  switch (s) {
 2328|    142|    case s_http_host_start:
  ------------------
  |  Branch (2328:5): [True: 142, False: 221]
  ------------------
 2329|    143|    case s_http_host_v6_start:
  ------------------
  |  Branch (2329:5): [True: 1, False: 362]
  ------------------
 2330|    177|    case s_http_host_v6:
  ------------------
  |  Branch (2330:5): [True: 34, False: 329]
  ------------------
 2331|    178|    case s_http_host_port_start:
  ------------------
  |  Branch (2331:5): [True: 1, False: 362]
  ------------------
 2332|    178|    case s_http_userinfo:
  ------------------
  |  Branch (2332:5): [True: 0, False: 363]
  ------------------
 2333|    178|    case s_http_userinfo_start:
  ------------------
  |  Branch (2333:5): [True: 0, False: 363]
  ------------------
 2334|    178|      return 1;
 2335|    185|    default:
  ------------------
  |  Branch (2335:5): [True: 185, False: 178]
  ------------------
 2336|    185|      break;
 2337|    363|  }
 2338|       |
 2339|    185|  return 0;
 2340|    363|}
http_parser.cpp:_ZN4brpcL20http_parse_host_charENS_15http_host_stateEc:
 2205|  14.3k|http_parse_host_char(enum http_host_state s, const char ch) {
 2206|  14.3k|  switch(s) {
 2207|  9.04k|    case s_http_userinfo:
  ------------------
  |  Branch (2207:5): [True: 9.04k, False: 5.32k]
  ------------------
 2208|  9.22k|    case s_http_userinfo_start:
  ------------------
  |  Branch (2208:5): [True: 176, False: 14.1k]
  ------------------
 2209|  9.22k|      if (ch == '@') {
  ------------------
  |  Branch (2209:11): [True: 172, False: 9.05k]
  ------------------
 2210|    172|        return s_http_host_start;
 2211|    172|      }
 2212|       |
 2213|  9.05k|      if (IS_USERINFO_CHAR(ch)) {
  ------------------
  |  |  484|  9.05k|#define IS_USERINFO_CHAR(c) (IS_ALPHANUM(c) || IS_MARK(c) || (c) == '%' || \
  |  |  ------------------
  |  |  |  |  479|  18.1k|#define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  477|  18.1k|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|  9.05k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|  1.02k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (477:30): [True: 1.02k, False: 8.03k]
  |  |  |  |  |  |  |  Branch (477:49): [True: 585, False: 435]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  478|  8.46k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (478:30): [True: 1.34k, False: 7.12k]
  |  |  |  |  |  |  |  Branch (478:44): [True: 291, False: 1.05k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_USERINFO_CHAR(c) (IS_ALPHANUM(c) || IS_MARK(c) || (c) == '%' || \
  |  |  ------------------
  |  |  |  |  481|  17.2k|#define IS_MARK(c)          ((c) == '-' || (c) == '_' || (c) == '.' || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (481:30): [True: 216, False: 7.95k]
  |  |  |  |  |  Branch (481:44): [True: 200, False: 7.75k]
  |  |  |  |  |  Branch (481:58): [True: 216, False: 7.54k]
  |  |  |  |  ------------------
  |  |  |  |  482|  8.17k|  (c) == '!' || (c) == '~' || (c) == '*' || (c) == '\'' || (c) == '(' || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (482:3): [True: 4.00k, False: 3.53k]
  |  |  |  |  |  Branch (482:17): [True: 231, False: 3.30k]
  |  |  |  |  |  Branch (482:31): [True: 198, False: 3.10k]
  |  |  |  |  |  Branch (482:45): [True: 212, False: 2.89k]
  |  |  |  |  |  Branch (482:60): [True: 345, False: 2.55k]
  |  |  |  |  ------------------
  |  |  |  |  483|  17.2k|  (c) == ')')
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (483:3): [True: 331, False: 2.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (484:62): [True: 208, False: 2.01k]
  |  |  ------------------
  |  |  485|  9.05k|  (c) == ';' || (c) == ':' || (c) == '&' || (c) == '=' || (c) == '+' || \
  |  |  ------------------
  |  |  |  Branch (485:3): [True: 209, False: 1.80k]
  |  |  |  Branch (485:17): [True: 197, False: 1.60k]
  |  |  |  Branch (485:31): [True: 465, False: 1.14k]
  |  |  |  Branch (485:45): [True: 209, False: 931]
  |  |  |  Branch (485:59): [True: 212, False: 719]
  |  |  ------------------
  |  |  486|  9.05k|  (c) == '$' || (c) == ',')
  |  |  ------------------
  |  |  |  Branch (486:3): [True: 229, False: 490]
  |  |  |  Branch (486:17): [True: 486, False: 4]
  |  |  ------------------
  ------------------
 2214|  9.04k|        return s_http_userinfo;
 2215|  9.04k|      }
 2216|      4|      break;
 2217|       |
 2218|    386|    case s_http_host_start:
  ------------------
  |  Branch (2218:5): [True: 386, False: 13.9k]
  ------------------
 2219|    386|      if (ch == '[') {
  ------------------
  |  Branch (2219:11): [True: 67, False: 319]
  ------------------
 2220|     67|        return s_http_host_v6_start;
 2221|     67|      }
 2222|       |
 2223|    319|      if (IS_HOST_CHAR(ch)) {
  ------------------
  |  |  493|    319|  (IS_ALPHANUM(c) || (c) == '.' || (c) == '-' || (c) == '_')
  |  |  ------------------
  |  |  |  |  479|    638|#define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  477|    638|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|    319|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|    149|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (477:30): [True: 149, False: 170]
  |  |  |  |  |  |  |  Branch (477:49): [True: 120, False: 29]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  478|    199|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (478:30): [True: 116, False: 83]
  |  |  |  |  |  |  |  Branch (478:44): [True: 70, False: 46]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (493:22): [True: 11, False: 118]
  |  |  |  Branch (493:36): [True: 9, False: 109]
  |  |  |  Branch (493:50): [True: 15, False: 94]
  |  |  ------------------
  ------------------
 2224|    225|        return s_http_host;
 2225|    225|      }
 2226|       |
 2227|     94|      break;
 2228|       |
 2229|  1.85k|    case s_http_host:
  ------------------
  |  Branch (2229:5): [True: 1.85k, False: 12.5k]
  ------------------
 2230|  1.85k|      if (IS_HOST_CHAR(ch)) {
  ------------------
  |  |  493|  1.85k|  (IS_ALPHANUM(c) || (c) == '.' || (c) == '-' || (c) == '_')
  |  |  ------------------
  |  |  |  |  479|  3.70k|#define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  477|  3.70k|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|  1.85k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|    671|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (477:30): [True: 671, False: 1.17k]
  |  |  |  |  |  |  |  Branch (477:49): [True: 386, False: 285]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  478|  1.46k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (478:30): [True: 940, False: 524]
  |  |  |  |  |  |  |  Branch (478:44): [True: 525, False: 415]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (493:22): [True: 248, False: 691]
  |  |  |  Branch (493:36): [True: 254, False: 437]
  |  |  |  Branch (493:50): [True: 281, False: 156]
  |  |  ------------------
  ------------------
 2231|  1.69k|        return s_http_host;
 2232|  1.69k|      }
 2233|       |
 2234|       |    /* FALLTHROUGH */
 2235|    163|    case s_http_host_v6_end:
  ------------------
  |  Branch (2235:5): [True: 7, False: 14.3k]
  ------------------
 2236|    163|      if (ch == ':') {
  ------------------
  |  Branch (2236:11): [True: 126, False: 37]
  ------------------
 2237|    126|        return s_http_host_port_start;
 2238|    126|      }
 2239|       |
 2240|     37|      break;
 2241|       |
 2242|  1.02k|    case s_http_host_v6:
  ------------------
  |  Branch (2242:5): [True: 1.02k, False: 13.3k]
  ------------------
 2243|  1.02k|      if (ch == ']') {
  ------------------
  |  Branch (2243:11): [True: 7, False: 1.01k]
  ------------------
 2244|      7|        return s_http_host_v6_end;
 2245|      7|      }
 2246|       |
 2247|       |    /* FALLTHROUGH */
 2248|  1.08k|    case s_http_host_v6_start:
  ------------------
  |  Branch (2248:5): [True: 66, False: 14.3k]
  ------------------
 2249|  1.08k|      if (IS_HEX(ch) || ch == ':' || ch == '.') {
  ------------------
  |  |  480|  2.17k|#define IS_HEX(c)           (IS_NUM(c) || (LOWER(c) >= 'a' && LOWER(c) <= 'f'))
  |  |  ------------------
  |  |  |  |  478|  2.17k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (478:30): [True: 739, False: 346]
  |  |  |  |  |  Branch (478:44): [True: 275, False: 464]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_HEX(c)           (IS_NUM(c) || (LOWER(c) >= 'a' && LOWER(c) <= 'f'))
  |  |  ------------------
  |  |  |  |  476|    810|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |               #define IS_HEX(c)           (IS_NUM(c) || (LOWER(c) >= 'a' && LOWER(c) <= 'f'))
  |  |  ------------------
  |  |  |  |  476|    245|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |  |  Branch (480:44): [True: 245, False: 565]
  |  |  |  Branch (480:63): [True: 229, False: 16]
  |  |  ------------------
  ------------------
  |  Branch (2249:25): [True: 216, False: 365]
  |  Branch (2249:38): [True: 340, False: 25]
  ------------------
 2250|  1.06k|        return s_http_host_v6;
 2251|  1.06k|      }
 2252|       |
 2253|     25|      break;
 2254|       |
 2255|  1.68k|    case s_http_host_port:
  ------------------
  |  Branch (2255:5): [True: 1.68k, False: 12.6k]
  ------------------
 2256|  1.80k|    case s_http_host_port_start:
  ------------------
  |  Branch (2256:5): [True: 125, False: 14.2k]
  ------------------
 2257|  1.80k|      if (IS_NUM(ch)) {
  ------------------
  |  |  478|  1.80k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 1.80k, False: 6]
  |  |  |  Branch (478:44): [True: 1.80k, False: 3]
  |  |  ------------------
  ------------------
 2258|  1.80k|        return s_http_host_port;
 2259|  1.80k|      }
 2260|       |
 2261|      9|      break;
 2262|       |
 2263|      9|    default:
  ------------------
  |  Branch (2263:5): [True: 0, False: 14.3k]
  ------------------
 2264|      0|      break;
 2265|  14.3k|  }
 2266|    169|  return s_http_host_dead;
 2267|  14.3k|}

_ZN7bthread11EpollThreadC2Ev:
  119|      2|        : _epfd(-1)
  120|      2|        , _stop(false)
  121|      2|        , _tid(0) {
  122|      2|    }
_ZN7bthread9LazyArrayIPN5butil6atomicIiEELm262144ELm256EEC2Ev:
   56|      2|    LazyArray() {
   57|      2|        memset(static_cast<void*>(_blocks), 0, sizeof(butil::atomic<Block*>) * NBLOCK);
   58|      2|    }

key.cpp:_ZN7bthreadL13get_key_countEPv:
  417|      2|static int get_key_count(void*) {
  418|      2|    BAIDU_SCOPED_LOCK(bthread::s_key_mutex);
  ------------------
  |  |   47|      2|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      2|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      2|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      2|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  419|      2|    return (int)nkey - (int)nfreekey;
  420|      2|}
key.cpp:_ZN7bthreadL18get_keytable_countEPv:
  421|      2|static size_t get_keytable_count(void*) {
  422|      2|    return nkeytable.load(butil::memory_order_relaxed);
  423|      2|}
key.cpp:_ZN7bthreadL19get_keytable_memoryEPv:
  424|      2|static size_t get_keytable_memory(void*) {
  425|      2|    const size_t n = nkeytable.load(butil::memory_order_relaxed);
  426|      2|    const size_t nsub = nsubkeytable.load(butil::memory_order_relaxed);
  427|      2|    return n * sizeof(KeyTable) + nsub * sizeof(SubKeyTable);
  428|      2|}

_ZN7bthread28first_sys_pthread_mutex_lockEP15pthread_mutex_t:
  496|      2|int first_sys_pthread_mutex_lock(pthread_mutex_t* mutex) {
  497|      2|    pthread_once(&init_sys_mutex_lock_once, init_sys_mutex_lock);
  498|      2|    return sys_pthread_mutex_lock(mutex);
  499|      2|}
pthread_mutex_init:
 1299|    190|                       const pthread_mutexattr_t* __restrict mutexattr) {
 1300|    190|    INIT_MUTEX_OWNER_MAP_ENTRY(mutex, mutexattr);
  ------------------
  |  |  787|    190|#define INIT_MUTEX_OWNER_MAP_ENTRY(mutex, mutexattr) ((void)0)
  ------------------
 1301|    190|    return bthread::sys_pthread_mutex_init(mutex, mutexattr);
 1302|    190|}
pthread_mutex_lock:
 1309|    190|int pthread_mutex_lock(pthread_mutex_t* mutex) {
 1310|    190|    return bthread::pthread_mutex_lock_impl(mutex);
 1311|    190|}
pthread_mutex_unlock:
 1324|    190|int pthread_mutex_unlock(pthread_mutex_t* mutex) {
 1325|    190|    return bthread::pthread_mutex_unlock_impl(mutex);
 1326|    190|}
mutex.cpp:_ZN7bthreadL19init_sys_mutex_lockEv:
  439|      2|static void init_sys_mutex_lock() {
  440|       |// When bRPC library is linked as a shared library, need to make sure bRPC
  441|       |// shared library is loaded before the pthread shared library. Otherwise,
  442|       |// it may cause runtime error: undefined symbol: pthread_mutex_xxx.
  443|       |// Alternatively, static linking can also avoid this problem.
  444|      2|#if defined(OS_LINUX)
  445|       |    // TODO: may need dlvsym when GLIBC has multiple versions of a same symbol.
  446|       |    // http://blog.fesnel.com/blog/2009/08/25/preloading-with-multiple-symbol-versions
  447|      2|    if (_dl_sym) {
  ------------------
  |  Branch (447:9): [True: 0, False: 2]
  ------------------
  448|      0|        sys_pthread_mutex_init = (MutexInitOp)_dl_sym(
  449|      0|            RTLD_NEXT, "pthread_mutex_init", (void*)init_sys_mutex_lock);
  450|      0|        sys_pthread_mutex_destroy = (MutexOp)_dl_sym(
  451|      0|            RTLD_NEXT, "pthread_mutex_destroy", (void*)init_sys_mutex_lock);
  452|      0|        sys_pthread_mutex_lock = (MutexOp)_dl_sym(
  453|      0|            RTLD_NEXT, "pthread_mutex_lock", (void*)init_sys_mutex_lock);
  454|      0|        sys_pthread_mutex_unlock = (MutexOp)_dl_sym(
  455|      0|            RTLD_NEXT, "pthread_mutex_unlock", (void*)init_sys_mutex_lock);
  456|      0|        sys_pthread_mutex_trylock = (MutexOp)_dl_sym(
  457|      0|            RTLD_NEXT, "pthread_mutex_trylock", (void*)init_sys_mutex_lock);
  458|      0|#if HAS_PTHREAD_MUTEX_TIMEDLOCK
  459|      0|        sys_pthread_mutex_timedlock = (TimedMutexOp)_dl_sym(
  460|      0|            RTLD_NEXT, "pthread_mutex_timedlock", (void*)init_sys_mutex_lock);
  461|      0|#endif // HAS_PTHREAD_MUTEX_TIMEDLOCK
  462|      2|    } else {
  463|       |        // _dl_sym may be undefined reference in some system, fallback to dlsym
  464|      2|        sys_pthread_mutex_init = (MutexInitOp)dlsym(RTLD_NEXT, "pthread_mutex_init");
  465|      2|        sys_pthread_mutex_destroy = (MutexOp)dlsym(RTLD_NEXT, "pthread_mutex_destroy");
  466|      2|        sys_pthread_mutex_lock = (MutexOp)dlsym(RTLD_NEXT, "pthread_mutex_lock");
  467|      2|        sys_pthread_mutex_unlock = (MutexOp)dlsym(RTLD_NEXT, "pthread_mutex_unlock");
  468|      2|        sys_pthread_mutex_trylock = (MutexOp)dlsym(RTLD_NEXT, "pthread_mutex_trylock");
  469|      2|#if HAS_PTHREAD_MUTEX_TIMEDLOCK
  470|      2|        sys_pthread_mutex_timedlock = (TimedMutexOp)dlsym(RTLD_NEXT, "pthread_mutex_timedlock");
  471|      2|#endif // HAS_PTHREAD_MUTEX_TIMEDLOCK
  472|      2|    }
  473|       |#elif defined(OS_MACOSX)
  474|       |    // TODO: look workaround for dlsym on mac
  475|       |    sys_pthread_mutex_init = (MutexInitOp)dlsym(RTLD_NEXT, "pthread_mutex_init");
  476|       |    sys_pthread_mutex_destroy = (MutexOp)dlsym(RTLD_NEXT, "pthread_mutex_destroy");
  477|       |    sys_pthread_mutex_lock = (MutexOp)dlsym(RTLD_NEXT, "pthread_mutex_lock");
  478|       |    sys_pthread_mutex_trylock = (MutexOp)dlsym(RTLD_NEXT, "pthread_mutex_trylock");
  479|       |    sys_pthread_mutex_unlock = (MutexOp)dlsym(RTLD_NEXT, "pthread_mutex_unlock");
  480|       |#endif
  481|      2|}
_ZN7bthread23pthread_mutex_lock_implEP15pthread_mutex_t:
  973|    190|BUTIL_FORCE_INLINE int pthread_mutex_lock_impl(pthread_mutex_t* mutex) {
  974|       |    return internal::pthread_mutex_lock_impl(mutex, NULL);
  975|    190|}
_ZN7bthread8internal23pthread_mutex_lock_implI15pthread_mutex_tEEiPT_PK8timespec:
  870|    190|BUTIL_FORCE_INLINE int pthread_mutex_lock_impl(Mutex* mutex, const struct timespec* abstime) {
  871|       |    // Don't change behavior of lock when profiler is off.
  872|    190|    if (!g_cp ||
  ------------------
  |  Branch (872:9): [True: 190, False: 0]
  ------------------
  873|       |        // collecting code including backtrace() and submit() may call
  874|       |        // pthread_mutex_lock and cause deadlock. Don't sample.
  875|    190|        tls_inside_lock) {
  ------------------
  |  Branch (875:9): [True: 0, False: 0]
  ------------------
  876|    190|        return pthread_mutex_lock_internal(mutex, abstime);
  877|    190|    }
  878|       |    // Don't slow down non-contended locks.
  879|      0|    int rc = pthread_mutex_trylock_internal(mutex);
  880|      0|    if (rc != EBUSY) {
  ------------------
  |  Branch (880:9): [True: 0, False: 0]
  ------------------
  881|      0|        return rc;
  882|      0|    }
  883|       |    // Ask bvar::Collector if this (contended) locking should be sampled
  884|      0|    const size_t sampling_range = bvar::is_collectable(&g_cp_sl);
  885|       |
  886|      0|    bthread_contention_site_t* csite = NULL;
  887|      0|#ifndef DONT_SPEEDUP_PTHREAD_CONTENTION_PROFILER_WITH_TLS
  888|      0|    TLSPthreadContentionSites& fast_alt = tls_csites;
  889|      0|    if (fast_alt.cp_version != g_cp_version) {
  ------------------
  |  Branch (889:9): [True: 0, False: 0]
  ------------------
  890|      0|        fast_alt.cp_version = g_cp_version;
  891|      0|        fast_alt.count = 0;
  892|      0|    }
  893|      0|    if (fast_alt.count < TLS_MAX_COUNT) {
  ------------------
  |  Branch (893:9): [True: 0, False: 0]
  ------------------
  894|      0|        MutexAndContentionSite& entry = fast_alt.list[fast_alt.count++];
  895|      0|        entry.mutex = mutex;
  896|      0|        csite = &entry.csite;
  897|      0|        if (!bvar::is_sampling_range_valid(sampling_range)) {
  ------------------
  |  Branch (897:13): [True: 0, False: 0]
  ------------------
  898|      0|            make_contention_site_invalid(&entry.csite);
  899|      0|            return pthread_mutex_lock_internal(mutex, abstime);
  900|      0|        }
  901|      0|    }
  902|      0|#endif
  903|      0|    if (!bvar::is_sampling_range_valid(sampling_range)) {  // don't sample
  ------------------
  |  Branch (903:9): [True: 0, False: 0]
  ------------------
  904|      0|        return pthread_mutex_lock_internal(mutex, abstime);
  905|      0|    }
  906|       |    // Lock and monitor the waiting time.
  907|      0|    const int64_t start_ns = butil::cpuwide_time_ns();
  908|      0|    rc = pthread_mutex_lock_internal(mutex, abstime);
  909|      0|    if (!rc) { // Inside lock
  ------------------
  |  Branch (909:9): [True: 0, False: 0]
  ------------------
  910|      0|        if (!csite) {
  ------------------
  |  Branch (910:13): [True: 0, False: 0]
  ------------------
  911|      0|            csite = add_pthread_contention_site(mutex);
  912|      0|            if (csite == NULL) {
  ------------------
  |  Branch (912:17): [True: 0, False: 0]
  ------------------
  913|      0|                return rc;
  914|      0|            }
  915|      0|        }
  916|      0|        csite->duration_ns = butil::cpuwide_time_ns() - start_ns;
  917|      0|        csite->sampling_range = sampling_range;
  918|      0|    } // else rare
  919|      0|    return rc;
  920|      0|}
_ZN7bthread8internal27pthread_mutex_lock_internalEP15pthread_mutex_tPK8timespec:
  798|    190|                                                   const struct timespec* abstime) {
  799|    190|    int rc = 0;
  800|    190|    if (NULL == abstime) {
  ------------------
  |  Branch (800:9): [True: 190, False: 0]
  ------------------
  801|    190|        FIND_SYS_PTHREAD_MUTEX_OWNER_MAP_ENTRY(mutex);
  ------------------
  |  |  789|    190|#define FIND_SYS_PTHREAD_MUTEX_OWNER_MAP_ENTRY(mutex) ((void)0)
  ------------------
  802|    190|        SYS_PTHREAD_MUTEX_CHECK_OWNER;
  ------------------
  |  |  790|    190|#define SYS_PTHREAD_MUTEX_CHECK_OWNER ((void)0)
  ------------------
  803|    190|        rc = sys_pthread_mutex_lock(mutex);
  804|    190|        if (0 == rc) {
  ------------------
  |  Branch (804:13): [True: 190, False: 0]
  ------------------
  805|    190|            SYS_PTHREAD_MUTEX_SET_OWNER;
  ------------------
  |  |  791|    190|#define SYS_PTHREAD_MUTEX_SET_OWNER ((void)0)
  ------------------
  806|    190|        }
  807|    190|    } else {
  808|      0|        rc = sys_pthread_mutex_timedlock(mutex, abstime);
  809|      0|        if (0 == rc) {
  ------------------
  |  Branch (809:13): [True: 0, False: 0]
  ------------------
  810|      0|            FIND_SYS_PTHREAD_MUTEX_OWNER_MAP_ENTRY(mutex);
  ------------------
  |  |  789|      0|#define FIND_SYS_PTHREAD_MUTEX_OWNER_MAP_ENTRY(mutex) ((void)0)
  ------------------
  811|      0|            SYS_PTHREAD_MUTEX_SET_OWNER;
  ------------------
  |  |  791|      0|#define SYS_PTHREAD_MUTEX_SET_OWNER ((void)0)
  ------------------
  812|      0|        }
  813|      0|    }
  814|    190|    if (0 == rc) {
  ------------------
  |  Branch (814:9): [True: 190, False: 0]
  ------------------
  815|    190|        ADD_TLS_PTHREAD_LOCK_COUNT;
  ------------------
  |  |  554|    190|#define ADD_TLS_PTHREAD_LOCK_COUNT ((void)0)
  ------------------
  816|    190|    }
  817|    190|    return rc;
  818|    190|}
_ZN7bthread25pthread_mutex_unlock_implEP15pthread_mutex_t:
  988|    190|BUTIL_FORCE_INLINE int pthread_mutex_unlock_impl(pthread_mutex_t* mutex) {
  989|    190|    return internal::pthread_mutex_unlock_impl(mutex);
  990|    190|}
_ZN7bthread8internal25pthread_mutex_unlock_implI15pthread_mutex_tEEiPT_:
  928|    190|BUTIL_FORCE_INLINE int pthread_mutex_unlock_impl(Mutex* mutex) {
  929|       |    // Don't change behavior of unlock when profiler is off.
  930|    190|    if (!g_cp || tls_inside_lock) {
  ------------------
  |  Branch (930:9): [True: 190, False: 0]
  |  Branch (930:18): [True: 0, False: 0]
  ------------------
  931|       |        // This branch brings an issue that an entry created by
  932|       |        // add_pthread_contention_site may not be cleared. Thus we add a
  933|       |        // 16-bit rolling version in the entry to find out such entry.
  934|    190|        return pthread_mutex_unlock_internal(mutex);
  935|    190|    }
  936|      0|    int64_t unlock_start_ns = 0;
  937|      0|    bool miss_in_tls = true;
  938|      0|    bthread_contention_site_t saved_csite = {0,0};
  939|      0|#ifndef DONT_SPEEDUP_PTHREAD_CONTENTION_PROFILER_WITH_TLS
  940|      0|    TLSPthreadContentionSites& fast_alt = tls_csites;
  941|      0|    for (int i = fast_alt.count - 1; i >= 0; --i) {
  ------------------
  |  Branch (941:38): [True: 0, False: 0]
  ------------------
  942|      0|        if (fast_alt.list[i].mutex == mutex) {
  ------------------
  |  Branch (942:13): [True: 0, False: 0]
  ------------------
  943|      0|            if (is_contention_site_valid(fast_alt.list[i].csite)) {
  ------------------
  |  Branch (943:17): [True: 0, False: 0]
  ------------------
  944|      0|                saved_csite = fast_alt.list[i].csite;
  945|      0|                unlock_start_ns = butil::cpuwide_time_ns();
  946|      0|            }
  947|      0|            fast_alt.list[i] = fast_alt.list[--fast_alt.count];
  948|      0|            miss_in_tls = false;
  949|      0|            break;
  950|      0|        }
  951|      0|    }
  952|      0|#endif
  953|       |    // Check the map to see if the lock is sampled. Notice that we're still
  954|       |    // inside critical section.
  955|      0|    if (miss_in_tls) {
  ------------------
  |  Branch (955:9): [True: 0, False: 0]
  ------------------
  956|      0|        if (remove_pthread_contention_site(mutex, &saved_csite)) {
  ------------------
  |  Branch (956:13): [True: 0, False: 0]
  ------------------
  957|      0|            unlock_start_ns = butil::cpuwide_time_ns();
  958|      0|        }
  959|      0|    }
  960|      0|    const int rc = pthread_mutex_unlock_internal(mutex);
  961|       |    // [Outside lock]
  962|      0|    if (unlock_start_ns) {
  ------------------
  |  Branch (962:9): [True: 0, False: 0]
  ------------------
  963|      0|        const int64_t unlock_end_ns = butil::cpuwide_time_ns();
  964|      0|        saved_csite.duration_ns += unlock_end_ns - unlock_start_ns;
  965|      0|        submit_contention(saved_csite, unlock_end_ns);
  966|      0|    }
  967|      0|    return rc;
  968|    190|}
_ZN7bthread8internal29pthread_mutex_unlock_internalEP15pthread_mutex_t:
  843|    190|BUTIL_FORCE_INLINE int pthread_mutex_unlock_internal(pthread_mutex_t* mutex) {
  844|    190|    SYS_PTHREAD_MUTEX_RESET_OWNER(mutex);
  ------------------
  |  |  792|    190|#define SYS_PTHREAD_MUTEX_RESET_OWNER(mutex) ((void)0)
  ------------------
  845|    190|    SUB_TLS_PTHREAD_LOCK_COUNT;
  ------------------
  |  |  555|    190|#define SUB_TLS_PTHREAD_LOCK_COUNT ((void)0)
  ------------------
  846|    190|    return sys_pthread_mutex_unlock(mutex);
  847|    190|}

stack.cpp:_ZN7bthreadL15get_stack_countEPv:
   50|      2|static int64_t get_stack_count(void*) {
   51|      2|    return s_stack_count.load(butil::memory_order_relaxed);
   52|      2|}

_ZN5butil13static_atomicIlE4loadESt12memory_order:
  293|      2|    T load(memory_order o) { return ref().load(o); }
_ZN5butil13static_atomicIlE3refEv:
  316|      2|    atomic<T>& ref() {
  317|       |        // Suppress strict-alias warnings.
  318|      2|        atomic<T>* p = reinterpret_cast<atomic<T>*>(&val);
  319|      2|        return *p;
  320|      2|    }
_ZN5butil13static_atomicImE4loadESt12memory_order:
  293|      6|    T load(memory_order o) { return ref().load(o); }
_ZN5butil13static_atomicImE3refEv:
  316|      6|    atomic<T>& ref() {
  317|       |        // Suppress strict-alias warnings.
  318|      6|        atomic<T>* p = reinterpret_cast<atomic<T>*>(&val);
  319|      6|        return *p;
  320|      6|    }
_ZN5butil6atomicIPN7bthread9LazyArrayIPNS0_IiEELm262144ELm256EE5BlockEEC2Ev:
  234|   524k|    atomic() {}

atomicops_internals_x86_gcc.cc:_ZN12_GLOBAL__N_123AtomicOpsx86InitializerC2Ev:
   88|      2|  AtomicOpsx86Initializer() {
   89|      2|    AtomicOps_Internalx86CPUFeaturesInit();
   90|      2|  }
atomicops_internals_x86_gcc.cc:_ZN12_GLOBAL__N_136AtomicOps_Internalx86CPUFeaturesInitEv:
   48|      2|void AtomicOps_Internalx86CPUFeaturesInit() {
   49|      2|  uint32_t eax;
   50|      2|  uint32_t ebx;
   51|      2|  uint32_t ecx;
   52|      2|  uint32_t edx;
   53|       |
   54|       |  // Get vendor string (issue CPUID with eax = 0)
   55|      2|  cpuid(eax, ebx, ecx, edx, 0);
  ------------------
  |  |   30|      2|  asm("mov %%rbx, %%rdi\n"     \
  |  |   31|      2|      "cpuid\n"                \
  |  |   32|      2|      "xchg %%rdi, %%rbx\n"    \
  |  |   33|      2|      : "=a" (a), "=D" (b), "=c" (c), "=d" (d) : "a" (inp))
  ------------------
   56|      2|  char vendor[13];
   57|      2|  memcpy(vendor, &ebx, 4);
   58|      2|  memcpy(vendor + 4, &edx, 4);
   59|      2|  memcpy(vendor + 8, &ecx, 4);
   60|      2|  vendor[12] = 0;
   61|       |
   62|       |  // get feature flags in ecx/edx, and family/model in eax
   63|      2|  cpuid(eax, ebx, ecx, edx, 1);
  ------------------
  |  |   30|      2|  asm("mov %%rbx, %%rdi\n"     \
  |  |   31|      2|      "cpuid\n"                \
  |  |   32|      2|      "xchg %%rdi, %%rbx\n"    \
  |  |   33|      2|      : "=a" (a), "=D" (b), "=c" (c), "=d" (d) : "a" (inp))
  ------------------
   64|       |
   65|      2|  int family = (eax >> 8) & 0xf;        // family and model fields
   66|      2|  int model = (eax >> 4) & 0xf;
   67|      2|  if (family == 0xf) {                  // use extended family and model fields
  ------------------
  |  Branch (67:7): [True: 0, False: 2]
  ------------------
   68|      0|    family += (eax >> 20) & 0xff;
   69|      0|    model += ((eax >> 16) & 0xf) << 4;
   70|      0|  }
   71|       |
   72|       |  // Opteron Rev E has a bug in which on very rare occasions a locked
   73|       |  // instruction doesn't act as a read-acquire barrier if followed by a
   74|       |  // non-locked read-modify-write instruction.  Rev F has this bug in
   75|       |  // pre-release versions, but not in versions released to customers,
   76|       |  // so we test only for Rev E, which is family 15, model 32..63 inclusive.
   77|      2|  if (strcmp(vendor, "AuthenticAMD") == 0 &&       // AMD
  ------------------
  |  Branch (77:7): [True: 0, False: 2]
  ------------------
   78|      0|      family == 15 &&
  ------------------
  |  Branch (78:7): [True: 0, False: 0]
  ------------------
   79|      0|      32 <= model && model <= 63) {
  ------------------
  |  Branch (79:7): [True: 0, False: 0]
  |  Branch (79:22): [True: 0, False: 0]
  ------------------
   80|      0|    AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug = true;
   81|      2|  } else {
   82|      2|    AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug = false;
   83|      2|  }
   84|      2|}

_ZN5butil6subtle13Release_StoreEPVll:
  181|      2|inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
  182|      2|  ATOMICOPS_COMPILER_BARRIER();
  ------------------
  |  |   24|      2|#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
  ------------------
  183|       |
  184|      2|  *ptr = value; // An x86 store acts as a release barrier
  185|       |                // for current AMD/Intel chips as of Jan 2008.
  186|       |                // See also Acquire_Load(), below.
  187|       |
  188|       |  // When new chips come out, check:
  189|       |  //  IA-32 Intel Architecture Software Developer's Manual, Volume 3:
  190|       |  //  System Programming Guide, Chatper 7: Multiple-processor management,
  191|       |  //  Section 7.2, Memory Ordering.
  192|       |  // Last seen at:
  193|       |  //   http://developer.intel.com/design/pentium4/manuals/index_new.htm
  194|       |  //
  195|       |  // x86 stores/loads fail to act as barriers for a few instructions (clflush
  196|       |  // maskmovdqu maskmovq movntdq movnti movntpd movntps movntq) but these are
  197|       |  // not generated by the compiler, and are rare.  Users of these instructions
  198|       |  // need to know about cache behaviour in any case since all of these involve
  199|       |  // either flushing cache lines or non-temporal cache hints.
  200|      2|}
_ZN5butil6subtle12Acquire_LoadEPVKl:
  206|      8|inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
  207|      8|  Atomic64 value = *ptr; // An x86 load acts as a acquire barrier,
  208|       |                         // for current AMD/Intel chips as of Jan 2008.
  209|       |                         // See also Release_Store(), above.
  210|      8|  ATOMICOPS_COMPILER_BARRIER();
  ------------------
  |  |   24|      8|#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
  ------------------
  211|      8|  return value;
  212|      8|}

_ZN5butil8demangleB5cxx11EPKc:
   30|     50|std::string demangle(const char* name) {
   31|       |    // mangled_name
   32|       |    //   A NULL-terminated character string containing the name to
   33|       |    //   be demangled.
   34|       |    // output_buffer:
   35|       |    //   A region of memory, allocated with malloc, of *length bytes,
   36|       |    //   into which the demangled name is stored. If output_buffer is
   37|       |    //   not long enough, it is expanded using realloc. output_buffer
   38|       |    //   may instead be NULL; in that case, the demangled name is placed
   39|       |    //   in a region of memory allocated with malloc.
   40|       |    // length
   41|       |    //   If length is non-NULL, the length of the buffer containing the
   42|       |    //   demangled name is placed in *length.
   43|       |    // status
   44|       |    //   *status is set to one of the following values:
   45|       |    //    0: The demangling operation succeeded.
   46|       |    //   -1: A memory allocation failure occurred.
   47|       |    //   -2: mangled_name is not a valid name under the C++ ABI
   48|       |    //       mangling rules.
   49|       |    //   -3: One of the arguments is invalid.
   50|     50|    int status = 0;
   51|     50|    char* buf = abi::__cxa_demangle(name, NULL, NULL, &status);
   52|     50|    if (status == 0 && buf) {
  ------------------
  |  Branch (52:9): [True: 50, False: 0]
  |  Branch (52:24): [True: 50, False: 0]
  ------------------
   53|     50|        std::string s(buf);
   54|     50|        free(buf);
   55|     50|        return s;
   56|     50|    }
   57|      0|    return std::string(name);
   58|     50|}

_ZNK5butil13DefaultHasherINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEclERKS6_:
  562|     16|    std::size_t operator()(const std::string& s) const {
  563|     16|        std::size_t result = 0;
  564|    340|        for (std::string::const_iterator i = s.begin(); i != s.end(); ++i) {
  ------------------
  |  Branch (564:57): [True: 324, False: 16]
  ------------------
  565|    324|            result = result * 101 + *i;
  566|    324|        }
  567|     16|        return result;        
  568|     16|    }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE6BucketC2Ev:
  283|  1.08k|        Bucket() : next((Bucket*)-1UL) {}
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE26init_buckets_and_thumbnailEPNSE_6BucketEPmm:
  369|    128|                                           size_t nbucket) {
  370|  66.6k|        for (size_t i = 0; i < nbucket; ++i) {
  ------------------
  |  Branch (370:28): [True: 66.5k, False: 128]
  ------------------
  371|  66.5k|            buckets[i].set_invalid();
  372|  66.5k|        }
  373|    128|        buckets[nbucket].next = NULL;
  374|    128|        if (_Sparse) {
  ------------------
  |  Branch (374:13): [Folded, False: 128]
  ------------------
  375|      0|            bit_array_clear(thumbnail, nbucket);
  376|      0|        }
  377|    128|    }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE6Bucket11set_invalidEv:
  292|  66.5k|        void set_invalid() { next = (Bucket*)-1UL; }
_ZNK5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE5emptyEv:
  274|     64|    bool empty() const { return _size == 0; }
_ZNK5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE18is_default_bucketsEv:
  363|    128|    bool is_default_buckets() const {
  364|    128|        return _buckets == (Bucket*)(&_default_buckets);
  365|    128|    }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE16init_load_factorEj:
  355|     64|    void init_load_factor(u_int load_factor) {
  356|     64|        if (_is_default_load_factor) {
  ------------------
  |  Branch (356:13): [True: 64, False: 0]
  ------------------
  357|     64|            _is_default_load_factor = false;
  358|     64|            _load_factor = load_factor;
  359|     64|        }
  360|     64|    }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE14is_too_crowdedEmmj:
  351|     64|    static bool is_too_crowded(size_t size, size_t nbucket, u_int load_factor) {
  352|     64|        return size * 100 >= nbucket * load_factor;
  353|     64|    }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoC2EPNSE_6BucketEPmm:
  327|     64|            : buckets(b), thumbnail(t), nbucket(n) {}
_ZNK5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE6Bucket8is_validEv:
  291|  1.16k|        bool is_valid() const { return next != (const Bucket*)-1UL; }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE6BucketC2ERKS6_:
  284|      8|        explicit Bucket(const _K& k) : next(NULL) {
  285|      8|            element_space_.Init(k);
  286|      8|        }
_ZN5butil14FlatMapElementINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryEEC2ERKS6_:
  486|      8|    explicit FlatMapElement(const K& k) : _key(k), _value(T()) {}
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE6Bucket7elementEv:
  294|      8|        Element& element() { return *element_space_; }
_ZN5butil14FlatMapElementINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryEE10second_refEv:
  496|      8|    T& second_ref() { return _value; }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE13get_allocatorEv:
  344|     64|    allocator_type& get_allocator() { return _pool.get_allocator(); }

_ZN5butil13flatmap_roundEm:
   61|     64|inline size_t flatmap_round(size_t nbucket) {
   62|       |#ifdef FLAT_MAP_ROUND_BUCKET_BY_USE_NEXT_PRIME    
   63|       |    return find_next_prime(nbucket);
   64|       |#else
   65|       |    // the lowerbound fixes the corner case of nbucket=0 which results in coredump during seeking the map.
   66|     64|    return nbucket <= 8 ? 8 : find_power2(nbucket);
  ------------------
  |  Branch (66:12): [True: 0, False: 64]
  ------------------
   67|     64|#endif
   68|     64|}
_ZN5butil11find_power2Em:
   45|     64|inline uint64_t find_power2(uint64_t b) {
   46|     64|    b -= 1;
   47|     64|    b |= (b >> 1);
   48|     64|    b |= (b >> 2);
   49|     64|    b |= (b >> 4);
   50|     64|    b |= (b >> 8);
   51|     64|    b |= (b >> 16);
   52|     64|    b |= (b >> 32);
   53|     64|    return b + 1;
   54|     64|}
_ZN5butil11flatmap_modEmm:
   70|     16|inline size_t flatmap_mod(size_t hash_code, size_t nbucket) {
   71|       |#ifdef FLAT_MAP_ROUND_BUCKET_BY_USE_NEXT_PRIME
   72|       |    return hash_code % nbucket;
   73|       |#else
   74|     16|    return hash_code & (nbucket - 1);
   75|     16|#endif
   76|     16|}
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EEC2ERKSA_RKSC_RKSD_:
  221|     64|    : _size(0)
  222|     64|    , _nbucket(DEFAULT_NBUCKET)
  223|     64|    , _buckets((Bucket*)(&_default_buckets))
  224|     64|    , _thumbnail(_S ? _default_thumbnail : NULL)
  ------------------
  |  Branch (224:18): [Folded, False: 64]
  ------------------
  225|     64|    , _load_factor(80)
  226|     64|    , _is_default_load_factor(true)
  227|     64|    , _hashfn(hashfn)
  228|     64|    , _eql(eql)
  229|     64|    , _pool(alloc) {
  230|     64|    init_buckets_and_thumbnail(_buckets, _thumbnail, _nbucket);
  231|     64|}
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE4initEmj:
  320|     64|int FlatMap<_K, _T, _H, _E, _S, _A, _M>::init(size_t nbucket, u_int load_factor) {
  321|     64|    if (nbucket <= _nbucket || load_factor < 10 || load_factor > 100 ||
  ------------------
  |  Branch (321:9): [True: 0, False: 64]
  |  Branch (321:32): [True: 0, False: 64]
  |  Branch (321:52): [True: 0, False: 64]
  ------------------
  322|     64|        !_is_default_load_factor || !empty() || !is_default_buckets()) {
  ------------------
  |  Branch (322:9): [True: 0, False: 64]
  |  Branch (322:37): [True: 0, False: 64]
  |  Branch (322:49): [True: 0, False: 64]
  ------------------
  323|      0|        return 0;
  324|      0|    }
  325|       |
  326|     64|    init_load_factor(load_factor);
  327|     64|    return resize(nbucket) ? 0 : -1;
  ------------------
  |  Branch (327:12): [True: 64, False: 0]
  ------------------
  328|     64|}
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE6resizeEm:
  755|     64|bool FlatMap<_K, _T, _H, _E, _S, _A, _M>::resize(size_t nbucket) {
  756|     64|    optional<NewBucketsInfo> info = new_buckets_and_thumbnail(_size, nbucket);
  757|     64|    if (!info.has_value()) {
  ------------------
  |  Branch (757:9): [True: 0, False: 64]
  ------------------
  758|      0|        return false;
  759|      0|    }
  760|       |
  761|     64|    for (iterator it = begin(); it != end(); ++it) {
  ------------------
  |  Branch (761:33): [True: 0, False: 64]
  ------------------
  762|      0|        const key_type& key = Element::first_ref_from_value(*it);
  763|      0|        const size_t index = flatmap_mod(_hashfn(key), info->nbucket);
  764|      0|        Bucket& first_node = info->buckets[index];
  765|      0|        if (!first_node.is_valid()) {
  ------------------
  |  Branch (765:13): [True: 0, False: 0]
  ------------------
  766|      0|            if (_S) {
  ------------------
  |  Branch (766:17): [Folded, False: 0]
  ------------------
  767|      0|                bit_array_set(info->thumbnail, index);
  768|      0|            }
  769|      0|            new (&first_node) Bucket(key);
  770|      0|            first_node.element().second_ref() =
  771|      0|                Element::second_movable_ref_from_value(*it);
  772|      0|        } else {
  773|      0|            Bucket* newp = new (_pool.get()) Bucket(key);
  774|      0|            newp->element().second_ref() =
  775|      0|                Element::second_movable_ref_from_value(*it);
  776|      0|            newp->next = first_node.next;
  777|      0|            first_node.next = newp;
  778|      0|        }
  779|      0|    }
  780|     64|    size_t saved_size = _size;
  781|     64|    clear();
  782|     64|    if (!is_default_buckets()) {
  ------------------
  |  Branch (782:9): [True: 0, False: 64]
  ------------------
  783|      0|        get_allocator().Free(_buckets);
  784|      0|        if (_S) {
  ------------------
  |  Branch (784:13): [Folded, False: 0]
  ------------------
  785|      0|            bit_array_free(_thumbnail);
  786|      0|        }
  787|      0|    }
  788|     64|    _nbucket = info->nbucket;
  789|     64|    _buckets = info->buckets;
  790|     64|    _thumbnail = info->thumbnail;
  791|     64|    _size = saved_size;
  792|       |
  793|     64|    return true;
  794|     64|}
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE25new_buckets_and_thumbnailEmm:
  716|     64|                                                               size_t new_nbucket) {
  717|     64|    size_t bump = 0;
  718|     64|    do {
  719|       |        // The first iteration uses 'new_nbucket + 0' ensures that when new_nbucket is a power
  720|       |        // of 2 and is already sufficient to accommodate `size`, it does not need to be doubled.
  721|       |        // Subsequent use of 'new_nbucket + 1' avoids an infinite loop.
  722|     64|        new_nbucket = flatmap_round(new_nbucket + bump);
  723|     64|        bump = 1;
  724|     64|    } while (is_too_crowded(size, new_nbucket, _load_factor));
  ------------------
  |  Branch (724:14): [True: 0, False: 64]
  ------------------
  725|     64|    if (_nbucket == new_nbucket) {
  ------------------
  |  Branch (725:9): [True: 0, False: 64]
  ------------------
  726|      0|        return nullopt;
  727|      0|    }
  728|       |    // Note: need an extra bucket to let iterator know where buckets end.
  729|     64|    auto buckets = (Bucket*)get_allocator().Alloc(
  730|     64|        sizeof(Bucket) * (new_nbucket + 1/*note*/));
  731|     64|    auto guard = MakeScopeGuard([buckets, this]() {
  732|     64|        get_allocator().Free(buckets);
  733|     64|    });
  734|     64|    if (NULL == buckets) {
  ------------------
  |  Branch (734:9): [True: 0, False: 64]
  ------------------
  735|      0|        LOG(FATAL) << "Fail to new Buckets";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  736|      0|        return nullopt;
  737|      0|    }
  738|       |
  739|     64|    uint64_t* thumbnail = NULL;
  740|     64|    if (_S) {
  ------------------
  |  Branch (740:9): [Folded, False: 64]
  ------------------
  741|      0|        thumbnail = bit_array_malloc(new_nbucket);
  742|      0|        if (NULL == thumbnail) {
  ------------------
  |  Branch (742:13): [True: 0, False: 0]
  ------------------
  743|      0|            LOG(FATAL) << "Fail to new thumbnail";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  744|      0|            return nullopt;
  745|      0|        }
  746|      0|    }
  747|       |
  748|     64|    guard.dismiss();
  749|     64|    init_buckets_and_thumbnail(buckets, thumbnail, new_nbucket);
  750|     64|    return NewBucketsInfo{buckets, thumbnail, new_nbucket};
  751|     64|}
_ZNK5butil15FlatMapIteratorINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EEESt4pairIKS7_S9_EEneERKSJ_:
  106|     64|    { return _node != rhs._node; }
_ZN5butil15FlatMapIteratorINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EEESt4pairIKS7_S9_EE23find_and_set_valid_nodeEv:
  137|    128|    void find_and_set_valid_node() {
  138|  1.15k|        for (; !_entry->is_valid(); ++_entry);
  ------------------
  |  Branch (138:16): [True: 1.02k, False: 128]
  ------------------
  139|    128|        _node = _entry;
  140|    128|    }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE5clearEv:
  512|     64|void FlatMap<_K, _T, _H, _E, _S, _A, _M>::clear() {
  513|     64|    if (0 == _size) {
  ------------------
  |  Branch (513:9): [True: 64, False: 0]
  ------------------
  514|     64|        return;
  515|     64|    }
  516|      0|    _size = 0;
  517|      0|    if (NULL != _buckets) {
  ------------------
  |  Branch (517:9): [True: 0, False: 0]
  ------------------
  518|      0|        for (size_t i = 0; i < _nbucket; ++i) {
  ------------------
  |  Branch (518:28): [True: 0, False: 0]
  ------------------
  519|      0|            Bucket& first_node = _buckets[i];
  520|      0|            if (first_node.is_valid()) {
  ------------------
  |  Branch (520:17): [True: 0, False: 0]
  ------------------
  521|      0|                first_node.destroy_element();
  522|      0|                Bucket* p = first_node.next;
  523|      0|                while (p) {
  ------------------
  |  Branch (523:24): [True: 0, False: 0]
  ------------------
  524|      0|                    Bucket* next_p = p->next;
  525|      0|                    p->destroy_element();
  526|      0|                    _pool.back(p);
  527|      0|                    p = next_p;
  528|      0|                }
  529|      0|                first_node.set_invalid();
  530|      0|            }
  531|      0|        }
  532|      0|    }
  533|      0|    if (NULL != _thumbnail) {
  ------------------
  |  Branch (533:9): [True: 0, False: 0]
  ------------------
  534|      0|        bit_array_clear(_thumbnail, _nbucket);
  535|      0|    }
  536|      0|}
_ZNK5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE4seekIS6_EEPS8_RKT_:
  548|      8|_T* FlatMap<_K, _T, _H, _E, _S, _A, _M>::seek(const K2& key) const {
  549|      8|    Bucket& first_node = _buckets[flatmap_mod(_hashfn(key), _nbucket)];
  550|      8|    if (!first_node.is_valid()) {
  ------------------
  |  Branch (550:9): [True: 8, False: 0]
  ------------------
  551|      8|        return NULL;
  552|      8|    }
  553|      0|    if (_eql(first_node.element().first_ref(), key)) {
  ------------------
  |  Branch (553:9): [True: 0, False: 0]
  ------------------
  554|      0|        return &first_node.element().second_ref();
  555|      0|    }
  556|      0|    Bucket *p = first_node.next;
  557|      0|    while (p) {
  ------------------
  |  Branch (557:12): [True: 0, False: 0]
  ------------------
  558|      0|        if (_eql(p->element().first_ref(), key)) {
  ------------------
  |  Branch (558:13): [True: 0, False: 0]
  ------------------
  559|      0|            return &p->element().second_ref();
  560|      0|        }
  561|      0|        p = p->next;
  562|      0|    }
  563|      0|    return NULL;
  564|      0|}
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EEixILb0EEENSt9enable_ifIXntT_ERS8_E4typeERKS6_:
  592|      8|FlatMap<_K, _T, _H, _E, _S, _A, _M>::operator[](const key_type& key) {
  593|      8|    const size_t index = flatmap_mod(_hashfn(key), _nbucket);
  594|      8|    Bucket& first_node = _buckets[index];
  595|      8|    if (!first_node.is_valid()) {
  ------------------
  |  Branch (595:9): [True: 8, False: 0]
  ------------------
  596|      8|        ++_size;
  597|      8|        if (_S) {
  ------------------
  |  Branch (597:13): [Folded, False: 8]
  ------------------
  598|      0|            bit_array_set(_thumbnail, index);
  599|      0|        }
  600|      8|        new (&first_node) Bucket(key);
  601|      8|        return first_node.element().second_ref();
  602|      8|    }
  603|      0|    Bucket *p = &first_node;
  604|      0|    while (true) {
  ------------------
  |  Branch (604:12): [True: 0, Folded]
  ------------------
  605|      0|        if (_eql(p->element().first_ref(), key)) {
  ------------------
  |  Branch (605:13): [True: 0, False: 0]
  ------------------
  606|      0|            return p->element().second_ref();
  607|      0|        }
  608|      0|        if (NULL == p->next) {
  ------------------
  |  Branch (608:13): [True: 0, False: 0]
  ------------------
  609|      0|            if (is_too_crowded(_size) && resize(_nbucket + 1)) {
  ------------------
  |  Branch (609:17): [True: 0, False: 0]
  |  Branch (609:42): [True: 0, False: 0]
  ------------------
  610|      0|                return operator[](key);
  611|      0|            }
  612|       |            // Fail to resize is OK.
  613|      0|            ++_size;
  614|      0|            Bucket* newp = new (_pool.get()) Bucket(key);
  615|      0|            p->next = newp;
  616|      0|            return newp->element().second_ref();
  617|      0|        }
  618|      0|        p = p->next;
  619|      0|    }
  620|      0|}
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE5beginEv:
  820|     64|FlatMap<_K, _T, _H, _E, _S, _A, _M>::begin() {
  821|     64|    return iterator(this, 0);
  822|     64|}
_ZN5butil15FlatMapIteratorINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EEESt4pairIKS7_S9_EEC2EPKSF_m:
   92|    128|    FlatMapIterator(const Map* map, size_t pos) {
   93|    128|        _entry = map->_buckets + pos;
   94|    128|        find_and_set_valid_node();
   95|    128|    }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE3endEv:
  827|     64|FlatMap<_K, _T, _H, _E, _S, _A, _M>::end() {
  828|     64|    return iterator(this, _nbucket);
  829|     64|}

_ZN5butil8LinkNodeIN4bvar6detail7SamplerEE18InsertBeforeAsListEPS4_:
  102|      8|  void InsertBeforeAsList(LinkNode<T>* e) {
  103|      8|    LinkNode<T>* prev = this->previous_;
  104|      8|    prev->next_ = e;
  105|      8|    this->previous_ = e->previous_;
  106|      8|    e->previous_->next_ = this;
  107|      8|    e->previous_ = prev;
  108|      8|  }
_ZN5butil10LinkedListIN4bvar6detail13AgentCombinerIPNS2_7SamplerES5_NS2_14CombineSamplerEE5AgentEEC2Ev:
  167|      2|  LinkedList() {}
_ZN5butil8LinkNodeIN4bvar6detail13AgentCombinerIPNS2_7SamplerES5_NS2_14CombineSamplerEE5AgentEEC2Ev:
   88|    106|  LinkNode() : previous_(this), next_(this) {}
_ZNK5butil10LinkedListIN4bvar6detail13AgentCombinerIPNS2_7SamplerES5_NS2_14CombineSamplerEE5AgentEE4headEv:
  179|      2|  LinkNode<T>* head() const {
  180|      2|    return root_.next();
  181|      2|  }
_ZNK5butil10LinkedListIN4bvar6detail13AgentCombinerIPNS2_7SamplerES5_NS2_14CombineSamplerEE5AgentEE3endEv:
  187|      4|  const LinkNode<T>* end() const {
  188|      4|    return &root_;
  189|      4|  }
_ZN5butil8LinkNodeIN4bvar6detail13AgentCombinerIPNS2_7SamplerES5_NS2_14CombineSamplerEE5AgentEE5valueEv:
  150|      2|  T* value() {
  151|      2|    return static_cast<T*>(this);
  152|      2|  }
_ZNK5butil8LinkNodeIN4bvar6detail13AgentCombinerIPNS2_7SamplerES5_NS2_14CombineSamplerEE5AgentEE4nextEv:
  141|      4|  LinkNode<T>* next() const {
  142|      4|    return next_;
  143|      4|  }
_ZN5butil8LinkNodeIN4bvar6detail7SamplerEEC2Ev:
   88|     10|  LinkNode() : previous_(this), next_(this) {}
_ZNK5butil8LinkNodeIN4bvar6detail7SamplerEE4nextEv:
  141|     10|  LinkNode<T>* next() const {
  142|     10|    return next_;
  143|     10|  }
_ZN5butil8LinkNodeIN4bvar6detail7SamplerEE5valueEv:
  150|      8|  T* value() {
  151|      8|    return static_cast<T*>(this);
  152|      8|  }
_ZN5butil10LinkedListIN4bvar6detail13AgentCombinerIPNS2_7SamplerES5_NS2_14CombineSamplerEE5AgentEE6AppendEPNS_8LinkNodeIS8_EE:
  170|      2|  void Append(LinkNode<T>* e) {
  171|      2|    e->InsertBefore(&root_);
  172|      2|  }
_ZN5butil8LinkNodeIN4bvar6detail13AgentCombinerIPNS2_7SamplerES5_NS2_14CombineSamplerEE5AgentEE12InsertBeforeEPS9_:
   94|      2|  void InsertBefore(LinkNode<T>* e) {
   95|      2|    this->next_ = e;
   96|      2|    this->previous_ = e->previous_;
   97|      2|    e->previous_->next_ = this;
   98|      2|    e->previous_ = this;
   99|      2|  }

_ZN5butil9nullopt_tC2ENS_8internal20optional_forbidden_tE:
   59|     12|    explicit nullopt_t(internal::optional_forbidden_t) noexcept {}
_ZN5butil8optionalINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEEC2EOSG_:
  198|     64|    optional(T&& value) : _engaged(true) {
  199|     64|        _storage.Init(std::move(value));
  200|     64|    }
_ZNK5butil8optionalINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEE9has_valueEv:
  309|     64|    bool has_value() const { return _engaged; }
_ZN5butil8optionalINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEEptEv:
  300|    192|    T* operator->() {
  301|    192|        return _storage.get();
  302|    192|    }
_ZN5butil8optionalINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEED2Ev:
  233|     64|    ~optional() {
  234|     64|        reset();
  235|     64|    }
_ZN5butil8optionalINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEE5resetEv:
  377|     64|    void reset() {
  378|     64|        if (_engaged) {
  ------------------
  |  Branch (378:13): [True: 64, False: 0]
  ------------------
  379|     64|            _storage.Destroy();
  380|     64|            _engaged = false;
  381|     64|        }
  382|     64|    }

_ZN5butil5debug10StackTraceC2Eb:
  766|      2|StackTrace::StackTrace(bool exclude_self) {
  767|       |  // NOTE: This code MUST be async-signal safe (it's used by in-process
  768|       |  // stack dumping signal handler). NO malloc or stdio is allowed here.
  769|       |
  770|      2|  if (GetStackTrace) {
  ------------------
  |  Branch (770:7): [True: 0, False: 2]
  ------------------
  771|      0|    count_ = GetStackTrace(trace_, arraysize(trace_), exclude_self ? 1 : 0);
  ------------------
  |  |  122|      0|#define arraysize(array) (sizeof(::butil::ArraySizeHelper(array)))
  ------------------
  |  Branch (771:55): [True: 0, False: 0]
  ------------------
  772|      2|  } else {
  773|      2|#if !defined(__UCLIBC__)
  774|       |    // Though the backtrace API man page does not list any possible negative
  775|       |    // return values, we take no chance.
  776|      2|    count_ = butil::saturated_cast<size_t>(backtrace(trace_, arraysize(trace_)));
  ------------------
  |  |  122|      2|#define arraysize(array) (sizeof(::butil::ArraySizeHelper(array)))
  ------------------
  777|      2|    if (exclude_self && count_ > 1) {
  ------------------
  |  Branch (777:9): [True: 0, False: 2]
  |  Branch (777:25): [True: 0, False: 0]
  ------------------
  778|       |      // Skip the top frame.
  779|      0|      memmove(trace_, trace_ + 1, (count_ - 1) * sizeof(void*));
  780|      0|      count_--;
  781|      0|    }
  782|       |#else
  783|       |    count_ = 0;
  784|       |#endif
  785|      2|  }
  786|      2|}

_ZN5butil23DescribeCustomizedErrnoEiPKcS1_:
   40|      2|    int error_code, const char* error_name, const char* description) {
   41|      2|    BAIDU_SCOPED_LOCK(modify_desc_mutex);
  ------------------
  |  |   47|      2|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      2|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      2|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      2|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   42|      2|    if (error_code < ERRNO_BEGIN || error_code >= ERRNO_END) {
  ------------------
  |  Branch (42:9): [True: 0, False: 2]
  |  Branch (42:37): [True: 0, False: 2]
  ------------------
   43|       |        // error() is a non-portable GNU extension that should not be used.
   44|      0|        fprintf(stderr, "Fail to define %s(%d) which is out of range, abort.",
   45|      0|              error_name, error_code);
   46|      0|        _exit(1);
   47|      0|    }
   48|      2|    const char* desc = errno_desc[error_code - ERRNO_BEGIN];
   49|      2|    if (desc) {
  ------------------
  |  Branch (49:9): [True: 0, False: 2]
  ------------------
   50|      0|        if (strcmp(desc, description) == 0) {
  ------------------
  |  Branch (50:13): [True: 0, False: 0]
  ------------------
   51|      0|            fprintf(stderr, "WARNING: Detected shared library loading\n");
   52|      0|            return -1;
   53|      0|        }
   54|      2|    } else {
   55|       |#if defined(OS_MACOSX)
   56|       |        const int rc = strerror_r(error_code, tls_error_buf, ERROR_BUFSIZE);
   57|       |        if (rc != EINVAL)
   58|       |#else
   59|      2|        desc = strerror_r(error_code, tls_error_buf, ERROR_BUFSIZE);
   60|      2|        if (desc && strncmp(desc, "Unknown error", 13) != 0)
  ------------------
  |  Branch (60:13): [True: 2, False: 0]
  |  Branch (60:21): [True: 0, False: 2]
  ------------------
   61|      0|#endif
   62|      0|        {
   63|      0|            fprintf(stderr, "WARNING: Fail to define %s(%d) which is already defined as `%s'",
   64|      0|                    error_name, error_code, desc);
   65|      0|        }
   66|      2|    }
   67|      2|    errno_desc[error_code - ERRNO_BEGIN] = description;
   68|      2|    return 0;  // must
   69|      2|}

_ZN5butil13AlignedMemoryILm24ELm8EE9void_dataEv:
   71|    320|      void* void_data() { return static_cast<void*>(data_); }     \
_ZN5butil13AlignedMemoryILm48ELm8EE9void_dataEv:
   71|     16|      void* void_data() { return static_cast<void*>(data_); }     \
_ZN5butil13AlignedMemoryILm24ELm8EE7data_asINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS9_EENS_14DefaultEqualToIS9_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEEEPT_v:
   76|    256|      Type* data_as() { return static_cast<Type*>(void_data()); } \
_ZN5butil13AlignedMemoryILm48ELm8EE7data_asINS_14FlatMapElementINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryEEEEEPT_v:
   76|      8|      Type* data_as() { return static_cast<Type*>(void_data()); } \

_ZN5butil17ManualConstructorINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEE4InitIJSG_EEEvDpOT_:
   62|     64|    void Init(Args&&... args) {
   63|     64|        new (_space.void_data()) Type(std::forward<Args>(args)...);
   64|     64|    }
_ZN5butil17ManualConstructorINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEE3getEv:
   47|    256|    Type* get() {
   48|    256|        return _space.template data_as<Type>();
   49|    256|    }
_ZN5butil17ManualConstructorINS_14FlatMapElementINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryEEEE4InitIJRKS7_EEEvDpOT_:
   62|      8|    void Init(Args&&... args) {
   63|      8|        new (_space.void_data()) Type(std::forward<Args>(args)...);
   64|      8|    }
_ZN5butil17ManualConstructorINS_14FlatMapElementINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryEEEEdeEv:
   58|      8|    Type& operator*() { return *get(); }
_ZN5butil17ManualConstructorINS_14FlatMapElementINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryEEEE3getEv:
   47|      8|    Type* get() {
   48|      8|        return _space.template data_as<Type>();
   49|      8|    }
_ZN5butil17ManualConstructorINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEE7DestroyEv:
   66|     64|     void Destroy() { get()->~Type(); }

_ZN5butil14MakeScopeGuardIZNS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE25new_buckets_and_thumbnailEmmEUlvE_EENS_10ScopeGuardIT_St9enable_ifIXsr14is_result_voidISI_EE5valueEvEEEOSI_:
   76|     64|ScopeGuard<Callback> MakeScopeGuard(Callback&& callback) noexcept {
   77|     64|    return ScopeGuard<Callback>{ std::forward<Callback>(callback)};
   78|     64|}
_ZN5butil10ScopeGuardIZNS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE25new_buckets_and_thumbnailEmmEUlvE_St9enable_ifILb1EvEEC2EOSG_:
   64|     64|        :_callback(std::forward<Callback>(callback))
   65|     64|        , _dismiss(false) {}
_ZN5butil10ScopeGuardIZNS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE25new_buckets_and_thumbnailEmmEUlvE_St9enable_ifILb1EvEE7dismissEv:
   50|     64|    void dismiss() noexcept {
   51|     64|        _dismiss = true;
   52|     64|    }
_ZN5butil10ScopeGuardIZNS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE25new_buckets_and_thumbnailEmmEUlvE_St9enable_ifILb1EvEED2Ev:
   44|     64|    ~ScopeGuard() noexcept {
   45|     64|        if(!_dismiss) {
  ------------------
  |  Branch (45:12): [True: 0, False: 64]
  ------------------
   46|      0|            _callback();
   47|      0|        }
   48|     64|    }

_ZN5butil19get_leaky_singletonIN4bvar6detail16SamplerCollectorEEEPT_v:
   60|      8|inline T* get_leaky_singleton() {
   61|      8|    const butil::subtle::AtomicWord value = butil::subtle::Acquire_Load(
   62|      8|        &GetLeakySingleton<T>::g_leaky_singleton_untyped);
   63|      8|    if (value) {
  ------------------
  |  Branch (63:9): [True: 6, False: 2]
  ------------------
   64|      6|        return reinterpret_cast<T*>(value);
   65|      6|    }
   66|      2|    pthread_once(&GetLeakySingleton<T>::g_create_leaky_singleton_once,
   67|      2|                 GetLeakySingleton<T>::create_leaky_singleton);
   68|      2|    return reinterpret_cast<T*>(
   69|      2|        GetLeakySingleton<T>::g_leaky_singleton_untyped);
   70|      8|}
_ZN5butil17GetLeakySingletonIN4bvar6detail16SamplerCollectorEE22create_leaky_singletonEv:
   47|      2|void GetLeakySingleton<T>::create_leaky_singleton() {
   48|      2|    T* obj = create_leaky_singleton_obj<T>();
   49|      2|    butil::subtle::Release_Store(
   50|      2|        &g_leaky_singleton_untyped,
   51|      2|        reinterpret_cast<butil::subtle::AtomicWord>(obj));
   52|      2|}
_ZN5butil26create_leaky_singleton_objIN4bvar6detail16SamplerCollectorEEEPT_v:
   29|      2|T* create_leaky_singleton_obj() {
   30|      2|    return new T();
   31|      2|}

_ZN5butil14saturated_castImiEET_T0_:
   36|      2|inline Dst saturated_cast(Src value) {
   37|       |  // Optimization for floating point values, which already saturate.
   38|      2|  if (std::numeric_limits<Dst>::is_iec559)
  ------------------
  |  Branch (38:7): [Folded, False: 2]
  ------------------
   39|      0|    return static_cast<Dst>(value);
   40|       |
   41|      2|  switch (internal::DstRangeRelationToSrcRange<Dst>(value)) {
  ------------------
  |  Branch (41:11): [True: 2, False: 0]
  ------------------
   42|      2|    case internal::RANGE_VALID:
  ------------------
  |  Branch (42:5): [True: 2, False: 0]
  ------------------
   43|      2|      return static_cast<Dst>(value);
   44|       |
   45|      0|    case internal::RANGE_UNDERFLOW:
  ------------------
  |  Branch (45:5): [True: 0, False: 2]
  ------------------
   46|      0|      return std::numeric_limits<Dst>::min();
   47|       |
   48|      0|    case internal::RANGE_OVERFLOW:
  ------------------
  |  Branch (48:5): [True: 0, False: 2]
  ------------------
   49|      0|      return std::numeric_limits<Dst>::max();
   50|       |
   51|       |    // Should fail only on attempting to assign NaN to a saturated integer.
   52|      0|    case internal::RANGE_INVALID:
  ------------------
  |  Branch (52:5): [True: 0, False: 2]
  ------------------
   53|      0|      CHECK(false);
  ------------------
  |  |  617|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
   54|      0|      return std::numeric_limits<Dst>::max();
   55|      2|  }
   56|       |
   57|      0|  NOTREACHED();
  ------------------
  |  | 1224|      2|#define NOTREACHED() DCHECK(false)
  |  |  ------------------
  |  |  |  |  846|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (472:7): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (472:7): [True: 0, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  847|      0|    << "Check failed: " #condition ". "
  |  |  ------------------
  ------------------
   58|      0|  return static_cast<Dst>(value);
   59|      2|}

_ZN5butil8internal26DstRangeRelationToSrcRangeImiEENS0_15RangeConstraintET0_:
  205|      2|inline RangeConstraint DstRangeRelationToSrcRange(Src value) {
  206|      2|  COMPILE_ASSERT(std::numeric_limits<Src>::is_specialized,
  ------------------
  |  |  241|      2|#define COMPILE_ASSERT(expr, msg)  BAIDU_CASSERT(expr, msg)
  |  |  ------------------
  |  |  |  |  196|      2|#define BAIDU_CASSERT(expr, msg) static_assert(expr, #msg)
  |  |  ------------------
  ------------------
  207|      2|                 argument_must_be_numeric);
  208|      2|  COMPILE_ASSERT(std::numeric_limits<Dst>::is_specialized,
  ------------------
  |  |  241|      2|#define COMPILE_ASSERT(expr, msg)  BAIDU_CASSERT(expr, msg)
  |  |  ------------------
  |  |  |  |  196|      2|#define BAIDU_CASSERT(expr, msg) static_assert(expr, #msg)
  |  |  ------------------
  ------------------
  209|      2|                 result_must_be_numeric);
  210|      2|  return DstRangeRelationToSrcRangeImpl<Dst, Src>::Check(value);
  211|      2|}
_ZN5butil8internal30DstRangeRelationToSrcRangeImplImiLNS0_21IntegerRepresentationE0ELS2_1ELNS0_26NumericRangeRepresentationE0EE5CheckEi:
  195|      2|  static RangeConstraint Check(Src value) {
  196|      2|    return (MaxExponent<Dst>::value >= MaxExponent<Src>::value)
  ------------------
  |  Branch (196:12): [True: 2, Folded]
  ------------------
  197|      2|               ? GetRangeConstraint(true, value >= static_cast<Src>(0))
  198|      2|               : GetRangeConstraint(
  199|      0|                     value <= static_cast<Src>(std::numeric_limits<Dst>::max()),
  200|      0|                     value >= static_cast<Src>(0));
  201|      2|  }
_ZN5butil8internal18GetRangeConstraintEbb:
  107|      2|                                   bool is_in_lower_bound) {
  108|      2|  return GetRangeConstraint((is_in_upper_bound ? 0 : RANGE_OVERFLOW) |
  ------------------
  |  Branch (108:30): [True: 2, False: 0]
  ------------------
  109|      2|                            (is_in_lower_bound ? 0 : RANGE_UNDERFLOW));
  ------------------
  |  Branch (109:30): [True: 2, False: 0]
  ------------------
  110|      2|}
_ZN5butil8internal18GetRangeConstraintEi:
   97|      2|inline RangeConstraint GetRangeConstraint(int integer_range_constraint) {
   98|      2|  DCHECK(integer_range_constraint >= RANGE_VALID &&
  ------------------
  |  |  846|      2|    BAIDU_LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
  |  |  ------------------
  |  |  |  |  472|      8|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:7): [True: 2, False: 0]
  |  |  |  |  |  Branch (472:7): [True: 2, False: 0]
  |  |  |  |  |  Branch (472:7): [True: 2, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  847|      0|    << "Check failed: " #condition ". "
  ------------------
   99|      2|         integer_range_constraint <= RANGE_INVALID);
  100|      2|  return static_cast<RangeConstraint>(integer_range_constraint);
  101|      2|}

_ZN5butil30RegisterFlagValidatorOrDieImplIbEEbPKT_PFbPKcS1_E:
   64|     18|    const T* flag, bool (*validate_fn)(const char*, T val)) {
   65|     18|    static_assert(!butil::is_same<std::string, T>::value,
   66|     18|                  "Not support string flags");
   67|     18|    if (::GFLAGS_NAMESPACE::RegisterFlagValidator(flag, validate_fn)) {
  ------------------
  |  Branch (67:9): [True: 18, False: 0]
  ------------------
   68|     18|        return true;
   69|     18|    }
   70|       |    // Error printed by gflags does not have newline. Add one to it.
   71|      0|    char newline = '\n';
   72|      0|    butil::ignore_result(write(2, &newline, 1));
   73|      0|    _exit(1);
   74|     18|}
_ZN5butil30RegisterFlagValidatorOrDieImplIiEEbPKT_PFbPKcS1_E:
   64|     26|    const T* flag, bool (*validate_fn)(const char*, T val)) {
   65|     26|    static_assert(!butil::is_same<std::string, T>::value,
   66|     26|                  "Not support string flags");
   67|     26|    if (::GFLAGS_NAMESPACE::RegisterFlagValidator(flag, validate_fn)) {
  ------------------
  |  Branch (67:9): [True: 26, False: 0]
  ------------------
   68|     26|        return true;
   69|     26|    }
   70|       |    // Error printed by gflags does not have newline. Add one to it.
   71|      0|    char newline = '\n';
   72|      0|    butil::ignore_result(write(2, &newline, 1));
   73|      0|    _exit(1);
   74|     26|}
_ZN5butil30RegisterFlagValidatorOrDieImplIjEEbPKT_PFbPKcS1_E:
   64|      2|    const T* flag, bool (*validate_fn)(const char*, T val)) {
   65|      2|    static_assert(!butil::is_same<std::string, T>::value,
   66|      2|                  "Not support string flags");
   67|      2|    if (::GFLAGS_NAMESPACE::RegisterFlagValidator(flag, validate_fn)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 0]
  ------------------
   68|      2|        return true;
   69|      2|    }
   70|       |    // Error printed by gflags does not have newline. Add one to it.
   71|      0|    char newline = '\n';
   72|      0|    butil::ignore_result(write(2, &newline, 1));
   73|      0|    _exit(1);
   74|      2|}

_ZNSt10lock_guardI15pthread_mutex_tEC2ERS0_:
  155|     22|    explicit lock_guard(pthread_mutex_t & mutex) : _pmutex(&mutex) {
  156|     22|#if !defined(NDEBUG)
  157|     22|        const int rc = pthread_mutex_lock(_pmutex);
  158|     22|        if (rc) {
  ------------------
  |  Branch (158:13): [True: 0, False: 22]
  ------------------
  159|      0|            LOG(FATAL) << "Fail to lock pthread_mutex_t=" << _pmutex << ", " << berror(rc);
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  160|      0|            _pmutex = NULL;
  161|      0|        }
  162|       |#else
  163|       |        pthread_mutex_lock(_pmutex);
  164|       |#endif  // NDEBUG
  165|     22|    }
_ZNSt10lock_guardI15pthread_mutex_tED2Ev:
  167|     22|    ~lock_guard() {
  168|     22|#ifndef NDEBUG
  169|     22|        if (_pmutex) {
  ------------------
  |  Branch (169:13): [True: 22, False: 0]
  ------------------
  170|     22|            pthread_mutex_unlock(_pmutex);
  171|     22|        }
  172|       |#else
  173|       |        pthread_mutex_unlock(_pmutex);
  174|       |#endif
  175|     22|    }

_ZN5butil11PtAllocator5AllocEm:
   35|     64|    void* Alloc(size_t n) { return malloc(n); }
_ZN5butil18SingleThreadedPoolILm56ELm1024ELm16ENS_11PtAllocatorEEC2ERKS1_:
   65|     64|        : _free_nodes(NULL), _blocks(NULL), _allocator(alloc) {}
_ZN5butil18SingleThreadedPoolILm56ELm1024ELm16ENS_11PtAllocatorEE13get_allocatorEv:
  136|     64|    Allocator& get_allocator() { return _allocator; }

_ZN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2EPKc:
  186|      8|      : ptr_(str),
  187|      8|        length_((str == NULL) ? 0 : STRING_TYPE::traits_type::length(str)) {}
  ------------------
  |  Branch (187:17): [True: 0, False: 8]
  ------------------
_ZN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Ev:
  184|      8|  BasicStringPiece() : ptr_(NULL), length_(0) {}
_ZN5butil9back_charERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  468|     16|inline char back_char(const std::string& s) { return s[s.size() - 1]; }
_ZNK5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE4dataEv:
  208|    178|  const value_type* data() const { return ptr_; }
_ZNK5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE4sizeEv:
  209|    194|  size_type size() const { return length_; }
_ZNK5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5emptyEv:
  211|     16|  bool empty() const { return length_ == 0; }

_ZN5butil5MutexC2Ev:
   50|    116|    Mutex() {
   51|       |#if defined(OS_WIN)
   52|       |    // The second parameter is the spin count, for short-held locks it avoid the
   53|       |    // contending thread from going to sleep which helps performance greatly.
   54|       |        ::InitializeCriticalSectionAndSpinCount(&_native_handle, 2000);
   55|       |#elif defined(OS_POSIX)
   56|       |        pthread_mutex_init(&_native_handle, NULL);
   57|    116|#endif
   58|    116|    }
_ZN5butil5Mutex4lockEv:
   70|     24|    void lock() {
   71|       |#if defined(OS_WIN)
   72|       |        ::EnterCriticalSection(&_native_handle);
   73|       |#elif defined(OS_POSIX)
   74|       |        pthread_mutex_lock(&_native_handle);
   75|     24|#endif
   76|     24|    }
_ZN5butil5Mutex6unlockEv:
   80|     24|    void unlock() {
   81|       |#if defined(OS_WIN)
   82|       |        ::LeaveCriticalSection(&_native_handle);
   83|       |#elif defined(OS_POSIX)
   84|       |        pthread_mutex_unlock(&_native_handle);
   85|     24|#endif
   86|     24|    }
_ZN5butil4LockC2Ev:
  126|    106|    Lock() {}
_ZN5butil4Lock7AcquireEv:
  128|     16|    void Acquire() { lock(); }
_ZN5butil4Lock7ReleaseEv:
  129|     16|    void Release() { unlock(); }
_ZNK5butil4Lock14AssertAcquiredEv:
  131|     16|    void AssertAcquired() const {}
_ZN5butil8AutoLockC2ERNS_4LockE:
  139|     16|    explicit AutoLock(Lock& lock) : lock_(lock) {
  140|     16|        lock_.Acquire();
  141|     16|    }
_ZN5butil8AutoLockD2Ev:
  147|     16|    ~AutoLock() {
  148|     16|        lock_.AssertAcquired();
  149|     16|        lock_.Release();
  150|     16|    }

_ZN5butil6detail29get_or_new_thread_exit_helperEv:
   99|      2|detail::ThreadExitHelper* get_or_new_thread_exit_helper() {
  100|      2|    pthread_once(&detail::thread_atexit_once, detail::make_thread_atexit_key);
  101|       |
  102|      2|    detail::ThreadExitHelper* h =
  103|      2|        (detail::ThreadExitHelper*)pthread_getspecific(detail::thread_atexit_key);
  104|      2|    if (NULL == h) {
  ------------------
  |  Branch (104:9): [True: 2, False: 0]
  ------------------
  105|      2|        h = new (std::nothrow) detail::ThreadExitHelper;
  106|      2|        if (NULL != h) {
  ------------------
  |  Branch (106:13): [True: 2, False: 0]
  ------------------
  107|      2|            pthread_setspecific(detail::thread_atexit_key, h);
  108|      2|        }
  109|      2|    }
  110|      2|    return h;
  111|      2|}
_ZN5butil13thread_atexitEPFvPvES0_:
  124|      2|int thread_atexit(void (*fn)(void*), void* arg) {
  125|      2|    if (NULL == fn) {
  ------------------
  |  Branch (125:9): [True: 0, False: 2]
  ------------------
  126|      0|        errno = EINVAL;
  127|      0|        return -1;
  128|      0|    }
  129|      2|    detail::ThreadExitHelper* h = detail::get_or_new_thread_exit_helper();
  130|      2|    if (h) {
  ------------------
  |  Branch (130:9): [True: 2, False: 0]
  ------------------
  131|      2|        return h->add(fn, arg);
  132|      2|    }
  133|      2|    errno = ENOMEM;
  134|      0|    return -1;
  135|      2|}
_ZN5butil13thread_atexitEPFvvE:
  137|      2|int thread_atexit(void (*fn)()) {
  138|      2|    if (NULL == fn) {
  ------------------
  |  Branch (138:9): [True: 0, False: 2]
  ------------------
  139|      0|        errno = EINVAL;
  140|      0|        return -1;
  141|      0|    }
  142|      2|    return thread_atexit(detail::call_single_arg_fn, (void*)fn);
  143|      2|}
thread_local.cpp:_ZN5butil6detailL22make_thread_atexit_keyEv:
   89|      2|static void make_thread_atexit_key() {
   90|      2|    if (pthread_key_create(&thread_atexit_key, delete_thread_exit_helper) != 0) {
  ------------------
  |  Branch (90:9): [True: 0, False: 2]
  ------------------
   91|      0|        fprintf(stderr, "Fail to create thread_atexit_key, abort\n");
   92|      0|        abort();
   93|      0|    }
   94|       |    // If caller is not pthread, delete_thread_exit_helper will not be called.
   95|       |    // We have to rely on atexit().
   96|      2|    atexit(helper_exit_global);
   97|      2|}
_ZN5butil6detail16ThreadExitHelper3addEPFvPvES2_:
   45|      2|    int add(Fn fn, void* arg) {
   46|      2|        try {
   47|      2|            if (_fns.capacity() < 16) {
  ------------------
  |  Branch (47:17): [True: 2, False: 0]
  ------------------
   48|      2|                _fns.reserve(16);
   49|      2|            }
   50|      2|            _fns.emplace_back(fn, arg);
   51|      2|        } catch (...) {
   52|      0|            errno = ENOMEM;
   53|      0|            return -1;
   54|      0|        }
   55|      2|        return 0;
   56|      2|    }

_ZN5butil14PlatformThread13SetNameSimpleEPKc:
   60|      2|void PlatformThread::SetNameSimple(const char* name) {
   61|      2|#if !defined(OS_NACL)
   62|       |  // On linux we can get the thread names to show up in the debugger by setting
   63|       |  // the process name for the LWP.  We don't want to do this for the main
   64|       |  // thread because that would rename the process, causing tools like killall
   65|       |  // to stop working.
   66|      2|  if (PlatformThread::CurrentId() == getpid())
  ------------------
  |  Branch (66:7): [True: 0, False: 2]
  ------------------
   67|      0|    return;
   68|       |
   69|       |  // http://0pointer.de/blog/projects/name-your-threads.html
   70|       |  // Set the name for the LWP (which gets truncated to 15 characters).
   71|       |  // Note that glibc also has a 'pthread_setname_np' api, but it may not be
   72|       |  // available everywhere and it's only benefit over using prctl directly is
   73|       |  // that it can set the name of threads other than the current thread.
   74|      2|  int err = prctl(PR_SET_NAME, name);
   75|       |  // We expect EPERM failures in sandboxed processes, just ignore those.
   76|      2|  if (err < 0 && errno != EPERM)
  ------------------
  |  Branch (76:7): [True: 0, False: 2]
  |  Branch (76:18): [True: 0, False: 0]
  ------------------
   77|      0|    DPLOG(ERROR) << "prctl(PR_SET_NAME)";
  ------------------
  |  |  749|      0|    BAIDU_LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   78|      2|#endif  //  !defined(OS_NACL)
   79|      2|}

_ZN5butil14PlatformThread9CurrentIdEv:
  145|      2|PlatformThreadId PlatformThread::CurrentId() {
  146|       |  // Pthreads doesn't have the concept of a thread ID, so we have to reach down
  147|       |  // into the kernel.
  148|       |#if defined(OS_MACOSX)
  149|       |  return pthread_mach_thread_np(pthread_self());
  150|       |#elif defined(OS_LINUX)
  151|      2|  return syscall(__NR_gettid);
  152|       |#elif defined(OS_ANDROID)
  153|       |  return gettid();
  154|       |#elif defined(OS_SOLARIS) || defined(OS_QNX)
  155|       |  return pthread_self();
  156|       |#elif defined(OS_NACL) && defined(__GLIBC__)
  157|       |  return pthread_self();
  158|       |#elif defined(OS_NACL) && !defined(__GLIBC__)
  159|       |  // Pointers are 32-bits in NaCl.
  160|       |  return reinterpret_cast<int32_t>(pthread_self());
  161|       |#elif defined(OS_POSIX)
  162|       |  return reinterpret_cast<int64_t>(pthread_self());
  163|       |#endif
  164|      2|}

_ZN5butil15gettimeofday_usEv:
  338|      4|inline int64_t gettimeofday_us() {
  339|      4|    timeval now;
  340|       |    gettimeofday(&now, NULL);
  341|      4|    return now.tv_sec * 1000000L + now.tv_usec;
  342|      4|}

_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIPNS0_7SamplerES4_NS0_14CombineSamplerEE5AgentEE16create_new_agentEv:
   89|      2|    inline static AgentId create_new_agent() {
   90|      2|        BAIDU_SCOPED_LOCK(_s_mutex);
  ------------------
  |  |   47|      2|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      2|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      2|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      2|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   91|      2|        AgentId agent_id = 0;
   92|      2|        if (!_get_free_ids().empty()) {
  ------------------
  |  Branch (92:13): [True: 0, False: 2]
  ------------------
   93|      0|            agent_id = _get_free_ids().back();
   94|      0|            _get_free_ids().pop_back();
   95|      2|        } else {
   96|      2|            agent_id = _s_agent_kinds++;
   97|      2|        }
   98|      2|        return agent_id;
   99|      2|    }
_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIPNS0_7SamplerES4_NS0_14CombineSamplerEE5AgentEE13_get_free_idsEv:
  172|      2|    inline static std::deque<AgentId> &_get_free_ids() {
  173|      2|        if (__builtin_expect(!_s_free_ids, 0)) {
  ------------------
  |  Branch (173:13): [True: 2, False: 0]
  ------------------
  174|      2|            _s_free_ids = new (std::nothrow) std::deque<AgentId>();
  175|      2|            RELEASE_ASSERT(_s_free_ids);
  ------------------
  |  |  476|      2|    do {                            \
  |  |  477|      2|        if (!(condition)) {         \
  |  |  ------------------
  |  |  |  Branch (477:13): [True: 0, False: 2]
  |  |  ------------------
  |  |  478|      0|            ::abort();              \
  |  |  479|      0|        }                           \
  |  |  480|      2|    } while (false)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  176|      2|        }
  177|      2|        return *_s_free_ids;
  178|      2|    }
_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIPNS0_7SamplerES4_NS0_14CombineSamplerEE5AgentEE13get_tls_agentEi:
  114|      8|    inline static Agent* get_tls_agent(AgentId id) {
  115|      8|        if (__builtin_expect(id >= 0, 1)) {
  ------------------
  |  Branch (115:13): [True: 8, False: 0]
  ------------------
  116|      8|            if (_s_tls_blocks) {
  ------------------
  |  Branch (116:17): [True: 6, False: 2]
  ------------------
  117|      6|                const size_t block_id = (size_t)id / ELEMENTS_PER_BLOCK;
  118|      6|                if (block_id < _s_tls_blocks->size()) {
  ------------------
  |  Branch (118:21): [True: 6, False: 0]
  ------------------
  119|      6|                    ThreadBlock* const tb = (*_s_tls_blocks)[block_id];
  120|      6|                    if (tb) {
  ------------------
  |  Branch (120:25): [True: 6, False: 0]
  ------------------
  121|      6|                        return tb->at(id - block_id * ELEMENTS_PER_BLOCK);
  122|      6|                    }
  123|      6|                }
  124|      6|            }
  125|      8|        }
  126|      2|        return NULL;
  127|      8|    }
_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIPNS0_7SamplerES4_NS0_14CombineSamplerEE5AgentEE11ThreadBlock2atEm:
   83|      8|        inline Agent* at(size_t offset) { return _agents + offset; };
_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIPNS0_7SamplerES4_NS0_14CombineSamplerEE5AgentEE23get_or_create_tls_agentEi:
  130|      2|    inline static Agent* get_or_create_tls_agent(AgentId id) {
  131|      2|        if (__builtin_expect(id < 0, 0)) {
  ------------------
  |  Branch (131:13): [True: 0, False: 2]
  ------------------
  132|      0|            CHECK(false) << "Invalid id=" << id;
  ------------------
  |  |  617|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
  133|      0|            return NULL;
  134|      0|        }
  135|      2|        if (_s_tls_blocks == NULL) {
  ------------------
  |  Branch (135:13): [True: 2, False: 0]
  ------------------
  136|      2|            _s_tls_blocks = new (std::nothrow) std::vector<ThreadBlock *>;
  137|      2|            if (__builtin_expect(_s_tls_blocks == NULL, 0)) {
  ------------------
  |  Branch (137:17): [True: 0, False: 2]
  ------------------
  138|      0|                LOG(FATAL) << "Fail to create vector, " << berror();
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  139|      0|                return NULL;
  140|      0|            }
  141|      2|            butil::thread_atexit(_destroy_tls_blocks);
  142|      2|        }
  143|      2|        const size_t block_id = (size_t)id / ELEMENTS_PER_BLOCK; 
  144|      2|        if (block_id >= _s_tls_blocks->size()) {
  ------------------
  |  Branch (144:13): [True: 2, False: 0]
  ------------------
  145|       |            // The 32ul avoid pointless small resizes.
  146|      2|            _s_tls_blocks->resize(std::max(block_id + 1, 32ul));
  147|      2|        }
  148|      2|        ThreadBlock* tb = (*_s_tls_blocks)[block_id];
  149|      2|        if (tb == NULL) {
  ------------------
  |  Branch (149:13): [True: 2, False: 0]
  ------------------
  150|      2|            ThreadBlock *new_block = new (std::nothrow) ThreadBlock;
  151|      2|            if (__builtin_expect(new_block == NULL, 0)) {
  ------------------
  |  Branch (151:17): [True: 0, False: 2]
  ------------------
  152|      0|                return NULL;
  153|      0|            }
  154|      2|            tb = new_block;
  155|      2|            (*_s_tls_blocks)[block_id] = new_block;
  156|      2|        }
  157|      2|        return tb->at(id - block_id * ELEMENTS_PER_BLOCK);
  158|      2|    }

_ZN4bvar6detail22call_op_returning_voidINS0_14CombineSamplerEPNS0_7SamplerES4_EEvRKT_RT0_RKT1_:
   28|     10|    const Op& op, T1& v1, const T2& v2) {
   29|     10|    return op(v1, v2);
   30|     10|}

_ZN4bvar6detail13AgentCombinerIPNS0_7SamplerES3_NS0_14CombineSamplerEEC2ES3_S3_RKS4_:
  227|      2|        : _id(AgentGroup::create_new_agent())
  228|      2|        , _op(op)
  229|      2|        , _global_result(result_identity)
  230|      2|        , _result_identity(result_identity)
  231|      2|        , _element_identity(element_identity) {
  232|      2|    }
_ZN4bvar6detail13AgentCombinerIPNS0_7SamplerES3_NS0_14CombineSamplerEE5Agent5resetERKS3_RKSt10shared_ptrIS5_E:
  175|      2|        void reset(const ElementTp& val, const self_shared_type& c) {
  176|      2|            combiner = c;
  177|      2|            element.store(val);
  178|      2|        }
_ZN4bvar6detail16ElementContainerIPNS0_7SamplerEvE5storeERKS3_:
   81|      2|    void store(const T& new_value) {
   82|      2|        butil::AutoLock guard(_lock);
   83|      2|        _value = new_value;
   84|      2|    }
_ZNK4bvar6detail13AgentCombinerIPNS0_7SamplerES3_NS0_14CombineSamplerEE2opEv:
  335|      8|    const BinaryOp& op() const { return _op; }
_ZN4bvar6detail13AgentCombinerIPNS0_7SamplerES3_NS0_14CombineSamplerEE16reset_all_agentsEv:
  261|      2|    ResultTp reset_all_agents() {
  262|      2|        ElementTp prev;
  263|      2|        butil::AutoLock guard(_lock);
  264|      2|        ResultTp tmp = _global_result;
  265|      2|        _global_result = _result_identity;
  266|      2|        for (butil::LinkNode<Agent>* node = _agents.head();
  267|      4|             node != _agents.end(); node = node->next()) {
  ------------------
  |  Branch (267:14): [True: 2, False: 2]
  ------------------
  268|      2|            node->value()->element.exchange(&prev, _element_identity);
  269|      2|            call_op_returning_void(_op, tmp, prev);
  270|      2|        }
  271|      2|        return tmp;
  272|      2|    }
_ZN4bvar6detail16ElementContainerIPNS0_7SamplerEvE8exchangeEPS3_RKS3_:
   86|      2|    void exchange(T* prev, const T& new_value) {
   87|      2|        butil::AutoLock guard(_lock);
   88|      2|        *prev = _value;
   89|      2|        _value = new_value;
   90|      2|    }
_ZN4bvar6detail13AgentCombinerIPNS0_7SamplerES3_NS0_14CombineSamplerEE23get_or_create_tls_agentEv:
  300|      8|    Agent* get_or_create_tls_agent() {
  301|      8|        Agent* agent = AgentGroup::get_tls_agent(_id);
  302|      8|        if (!agent) {
  ------------------
  |  Branch (302:13): [True: 2, False: 6]
  ------------------
  303|       |            // Create the agent
  304|      2|            agent = AgentGroup::get_or_create_tls_agent(_id);
  305|      2|            if (NULL == agent) {
  ------------------
  |  Branch (305:17): [True: 0, False: 2]
  ------------------
  306|      0|                LOG(FATAL) << "Fail to create agent";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  307|      0|                return NULL;
  308|      0|            }
  309|      2|        }
  310|      8|        if (!agent->combiner.expired()) {
  ------------------
  |  Branch (310:13): [True: 6, False: 2]
  ------------------
  311|      6|            return agent;
  312|      6|        }
  313|      2|        agent->reset(_element_identity, this->shared_from_this());
  314|       |        // TODO: Is uniqueness-checking necessary here?
  315|      2|        {
  316|      2|            butil::AutoLock guard(_lock);
  317|      2|            _agents.Append(agent);
  318|      2|        }
  319|      2|        return agent;
  320|      8|    }
_ZN4bvar6detail16ElementContainerIPNS0_7SamplerEvE6modifyINS0_14CombineSamplerES3_EEvRKT_RKT0_:
   93|      8|    void modify(const Op &op, const T1 &value2) {
   94|      8|        butil::AutoLock guard(_lock);
   95|      8|        call_op_returning_void(op, _value, value2);
   96|      8|    }

_ZN4bvar6detail16SamplerCollector3runEv:
  135|      2|void SamplerCollector::run() {
  136|      2|    ::usleep(FLAGS_bvar_sampler_thread_start_delay_us);
  137|       |    
  138|       |#ifndef UNIT_TEST
  139|       |    // NOTE:
  140|       |    // * Following vars can't be created on thread's stack since this thread
  141|       |    //   may be abandoned at any time after forking.
  142|       |    // * They can't created inside the constructor of SamplerCollector as well,
  143|       |    //   which results in deadlock.
  144|       |    if (s_cumulated_time_bvar == NULL) {
  145|       |        s_cumulated_time_bvar =
  146|       |            new PassiveStatus<double>(get_cumulated_time, this);
  147|       |    }
  148|       |    if (s_sampling_thread_usage_bvar == NULL) {
  149|       |        s_sampling_thread_usage_bvar =
  150|       |            new bvar::PerSecond<bvar::PassiveStatus<double> >(
  151|       |                    "bvar_sampler_collector_usage", s_cumulated_time_bvar, 10);
  152|       |    }
  153|       |#endif
  154|       |
  155|      2|    butil::LinkNode<Sampler> root;
  156|      2|    int consecutive_nosleep = 0;
  157|      4|    while (!_stop) {
  ------------------
  |  Branch (157:12): [True: 2, False: 2]
  ------------------
  158|      2|        int64_t abstime = butil::gettimeofday_us();
  159|      2|        Sampler* s = this->reset();
  160|      2|        if (s) {
  ------------------
  |  Branch (160:13): [True: 2, False: 0]
  ------------------
  161|      2|            s->InsertBeforeAsList(&root);
  162|      2|        }
  163|     10|        for (butil::LinkNode<Sampler>* p = root.next(); p != &root;) {
  ------------------
  |  Branch (163:57): [True: 8, False: 2]
  ------------------
  164|       |            // We may remove p from the list, save next first.
  165|      8|            butil::LinkNode<Sampler>* saved_next = p->next();
  166|      8|            Sampler* s = p->value();
  167|      8|            s->_mutex.lock();
  168|      8|            if (!s->_used) {
  ------------------
  |  Branch (168:17): [True: 0, False: 8]
  ------------------
  169|      0|                s->_mutex.unlock();
  170|      0|                p->RemoveFromList();
  171|      0|                delete s;
  172|      8|            } else {
  173|      8|                s->take_sample();
  174|      8|                s->_mutex.unlock();
  175|      8|            }
  176|      8|            p = saved_next;
  177|      8|        }
  178|      2|        bool slept = false;
  179|      2|        int64_t now = butil::gettimeofday_us();
  180|      2|        _cumulated_time_us += now - abstime;
  181|      2|        abstime += 1000000L;
  182|      4|        while (abstime > now) {
  ------------------
  |  Branch (182:16): [True: 2, False: 2]
  ------------------
  183|      2|            ::usleep(abstime - now);
  184|      2|            slept = true;
  185|      2|            now = butil::gettimeofday_us();
  186|      2|        }
  187|      2|        if (slept) {
  ------------------
  |  Branch (187:13): [True: 0, False: 2]
  ------------------
  188|      0|            consecutive_nosleep = 0;
  189|      2|        } else {            
  190|      2|            if (++consecutive_nosleep >= WARN_NOSLEEP_THRESHOLD) {
  ------------------
  |  Branch (190:17): [True: 0, False: 2]
  ------------------
  191|      0|                consecutive_nosleep = 0;
  192|      0|                LOG(WARNING) << "bvar is busy at sampling for "
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  193|      0|                             << WARN_NOSLEEP_THRESHOLD << " seconds!";
  194|      0|            }
  195|      2|        }
  196|      2|    }
  197|      2|}
_ZN4bvar6detail7SamplerC2Ev:
  199|      8|Sampler::Sampler() : _used(true) {}
_ZN4bvar6detail7Sampler8scheduleEv:
  205|      8|void Sampler::schedule() {
  206|       |    // since the SamplerCollector is initialized before the program starts
  207|       |    // flags will not take effect if used in the SamplerCollector constructor
  208|      8|    if (FLAGS_bvar_enable_sampling) {
  ------------------
  |  Branch (208:9): [True: 8, False: 0]
  ------------------
  209|      8|        *butil::get_leaky_singleton<SamplerCollector>() << this;
  210|      8|    }
  211|      8|}
_ZN4bvar6detail16SamplerCollectorC2Ev:
   66|      2|        : _created(false)
   67|      2|        , _stop(false)
   68|      2|        , _cumulated_time_us(0) {
   69|      2|        create_sampling_thread();
   70|      2|    }
_ZN4bvar6detail16SamplerCollector22create_sampling_threadEv:
   91|      2|    void create_sampling_thread() {
   92|      2|        const int rc = pthread_create(&_tid, NULL, sampling_thread, this);
   93|      2|        if (rc != 0) {
  ------------------
  |  Branch (93:13): [True: 0, False: 2]
  ------------------
   94|      0|            LOG(FATAL) << "Fail to create sampling_thread, " << berror(rc);
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   95|      2|        } else {
   96|      2|            _created = true;
   97|      2|            if (!registered_atfork) {
  ------------------
  |  Branch (97:17): [True: 2, False: 0]
  ------------------
   98|      2|                registered_atfork = true;
   99|      2|                pthread_atfork(NULL, NULL, child_callback_atfork);
  100|      2|            }
  101|      2|        }
  102|      2|    }
_ZN4bvar6detail16SamplerCollector15sampling_threadEPv:
  111|      2|    static void* sampling_thread(void* arg) {
  112|      2|        butil::PlatformThread::SetNameSimple("bvar_sampler");
  113|      2|        static_cast<SamplerCollector*>(arg)->run();
  114|       |        return NULL;
  115|      2|    }
_ZNK4bvar6detail14CombineSamplerclERPNS0_7SamplerES3_:
   36|     10|    void operator()(Sampler* & s1, Sampler* s2) const {
   37|     10|        if (s2 == NULL) {
  ------------------
  |  Branch (37:13): [True: 0, False: 10]
  ------------------
   38|      0|            return;
   39|      0|        }
   40|     10|        if (s1 == NULL) {
  ------------------
  |  Branch (40:13): [True: 4, False: 6]
  ------------------
   41|      4|            s1 = s2;
   42|      4|            return;
   43|      4|        }
   44|      6|        s1->InsertBeforeAsList(s2);
   45|      6|    }

_ZN4bvar6detail6SeriesIlNS0_5AddToIlEEEC2ERKS3_:
  218|      2|    explicit Series(const Op& op) : Base(op) {}
_ZN4bvar6detail10SeriesBaseIlNS0_5AddToIlEEEC2ERKS3_:
  103|      2|        : _op(op)
  104|      2|        , _nsecond(0)
  105|      2|        , _nminute(0)
  106|      2|        , _nhour(0)
  107|      2|        , _nday(0) {
  108|       |        pthread_mutex_init(&_mutex, NULL);
  109|      2|    }
_ZN4bvar6detail10SeriesBaseIlNS0_5AddToIlEEE4DataC2Ev:
  127|      2|        Data() {
  128|       |            // is_pod does not work for gcc 3.4
  129|      2|            if (butil::is_integral<T>::value ||
  ------------------
  |  Branch (129:17): [True: 2, Folded]
  ------------------
  130|      2|                butil::is_floating_point<T>::value) {
  ------------------
  |  Branch (130:17): [Folded, False: 0]
  ------------------
  131|      2|                memset(static_cast<void*>(_array), 0, sizeof(_array));
  132|      2|            }
  133|      2|        }
_ZN4bvar6detail10SeriesBaseIlNS0_5AddToIlEEE6appendERKl:
  114|      2|    void append(const T& value) {
  115|      2|        BAIDU_SCOPED_LOCK(_mutex);
  ------------------
  |  |   47|      2|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      2|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      2|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      2|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|      2|        return append_second(value, _op);
  117|      2|    }
_ZN4bvar6detail10SeriesBaseIlNS0_5AddToIlEEE13append_secondERKlRKS3_:
  161|      2|void SeriesBase<T, Op>::append_second(const T& value, const Op& op) {
  162|      2|    _data.second(_nsecond) = value;
  163|      2|    ++_nsecond;
  164|      2|    if (_nsecond >= 60) {
  ------------------
  |  Branch (164:9): [True: 0, False: 2]
  ------------------
  165|      0|        _nsecond = 0;
  166|      0|        T tmp = _data.second(0);
  167|      0|        for (int i = 1; i < 60; ++i) {
  ------------------
  |  Branch (167:25): [True: 0, False: 0]
  ------------------
  168|      0|            call_op_returning_void(op, tmp, _data.second(i));
  169|      0|        }
  170|      0|        DivideOnAddition<T, Op>::inplace_divide(tmp, op, 60);
  171|      0|        append_minute(tmp, op);
  172|      0|    }
  173|      2|}
_ZN4bvar6detail10SeriesBaseIlNS0_5AddToIlEEE4Data6secondEi:
  135|      2|        T& second(int index) { return _array[index]; }
_ZN4bvar6detail6SeriesImNS0_5AddToImEEEC2ERKS3_:
  218|      4|    explicit Series(const Op& op) : Base(op) {}
_ZN4bvar6detail10SeriesBaseImNS0_5AddToImEEEC2ERKS3_:
  103|      4|        : _op(op)
  104|      4|        , _nsecond(0)
  105|      4|        , _nminute(0)
  106|      4|        , _nhour(0)
  107|      4|        , _nday(0) {
  108|       |        pthread_mutex_init(&_mutex, NULL);
  109|      4|    }
_ZN4bvar6detail10SeriesBaseImNS0_5AddToImEEE4DataC2Ev:
  127|      4|        Data() {
  128|       |            // is_pod does not work for gcc 3.4
  129|      4|            if (butil::is_integral<T>::value ||
  ------------------
  |  Branch (129:17): [True: 4, Folded]
  ------------------
  130|      4|                butil::is_floating_point<T>::value) {
  ------------------
  |  Branch (130:17): [Folded, False: 0]
  ------------------
  131|      4|                memset(static_cast<void*>(_array), 0, sizeof(_array));
  132|      4|            }
  133|      4|        }
_ZN4bvar6detail10SeriesBaseImNS0_5AddToImEEE6appendERKm:
  114|      4|    void append(const T& value) {
  115|      4|        BAIDU_SCOPED_LOCK(_mutex);
  ------------------
  |  |   47|      4|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      4|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      4|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      4|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|      4|        return append_second(value, _op);
  117|      4|    }
_ZN4bvar6detail10SeriesBaseImNS0_5AddToImEEE13append_secondERKmRKS3_:
  161|      4|void SeriesBase<T, Op>::append_second(const T& value, const Op& op) {
  162|      4|    _data.second(_nsecond) = value;
  163|      4|    ++_nsecond;
  164|      4|    if (_nsecond >= 60) {
  ------------------
  |  Branch (164:9): [True: 0, False: 4]
  ------------------
  165|      0|        _nsecond = 0;
  166|      0|        T tmp = _data.second(0);
  167|      0|        for (int i = 1; i < 60; ++i) {
  ------------------
  |  Branch (167:25): [True: 0, False: 0]
  ------------------
  168|      0|            call_op_returning_void(op, tmp, _data.second(i));
  169|      0|        }
  170|      0|        DivideOnAddition<T, Op>::inplace_divide(tmp, op, 60);
  171|      0|        append_minute(tmp, op);
  172|      0|    }
  173|      4|}
_ZN4bvar6detail10SeriesBaseImNS0_5AddToImEEE4Data6secondEi:
  135|      4|        T& second(int index) { return _array[index]; }
_ZN4bvar6detail6SeriesIiNS0_5AddToIiEEEC2ERKS3_:
  218|      2|    explicit Series(const Op& op) : Base(op) {}
_ZN4bvar6detail10SeriesBaseIiNS0_5AddToIiEEEC2ERKS3_:
  103|      2|        : _op(op)
  104|      2|        , _nsecond(0)
  105|      2|        , _nminute(0)
  106|      2|        , _nhour(0)
  107|      2|        , _nday(0) {
  108|       |        pthread_mutex_init(&_mutex, NULL);
  109|      2|    }
_ZN4bvar6detail10SeriesBaseIiNS0_5AddToIiEEE4DataC2Ev:
  127|      2|        Data() {
  128|       |            // is_pod does not work for gcc 3.4
  129|      2|            if (butil::is_integral<T>::value ||
  ------------------
  |  Branch (129:17): [True: 2, Folded]
  ------------------
  130|      2|                butil::is_floating_point<T>::value) {
  ------------------
  |  Branch (130:17): [Folded, False: 0]
  ------------------
  131|      2|                memset(static_cast<void*>(_array), 0, sizeof(_array));
  132|      2|            }
  133|      2|        }
_ZN4bvar6detail10SeriesBaseIiNS0_5AddToIiEEE6appendERKi:
  114|      2|    void append(const T& value) {
  115|      2|        BAIDU_SCOPED_LOCK(_mutex);
  ------------------
  |  |   47|      2|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      2|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      2|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      2|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|      2|        return append_second(value, _op);
  117|      2|    }
_ZN4bvar6detail10SeriesBaseIiNS0_5AddToIiEEE13append_secondERKiRKS3_:
  161|      2|void SeriesBase<T, Op>::append_second(const T& value, const Op& op) {
  162|      2|    _data.second(_nsecond) = value;
  163|      2|    ++_nsecond;
  164|      2|    if (_nsecond >= 60) {
  ------------------
  |  Branch (164:9): [True: 0, False: 2]
  ------------------
  165|      0|        _nsecond = 0;
  166|      0|        T tmp = _data.second(0);
  167|      0|        for (int i = 1; i < 60; ++i) {
  ------------------
  |  Branch (167:25): [True: 0, False: 0]
  ------------------
  168|      0|            call_op_returning_void(op, tmp, _data.second(i));
  169|      0|        }
  170|      0|        DivideOnAddition<T, Op>::inplace_divide(tmp, op, 60);
  171|      0|        append_minute(tmp, op);
  172|      0|    }
  173|      2|}
_ZN4bvar6detail10SeriesBaseIiNS0_5AddToIiEEE4Data6secondEi:
  135|      2|        T& second(int index) { return _array[index]; }

_ZNK4bvar13PassiveStatusIlE9get_valueEv:
  139|      2|    Tp get_value() const {
  140|      2|        return (_getfn ? _getfn(_arg) : Tp());
  ------------------
  |  Branch (140:17): [True: 2, False: 0]
  ------------------
  141|      2|    }
_ZN4bvar13PassiveStatusIlE11expose_implERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESC_NS_13DisplayFilterE:
  172|      2|                    DisplayFilter display_filter) override {
  173|      2|        const int rc = Variable::expose_impl(prefix, name, display_filter);
  174|      2|        if (ADDITIVE &&
  ------------------
  |  Branch (174:13): [True: 2, Folded]
  ------------------
  175|      2|            rc == 0 &&
  ------------------
  |  Branch (175:13): [True: 2, False: 0]
  ------------------
  176|      2|            _series_sampler == NULL &&
  ------------------
  |  Branch (176:13): [True: 2, False: 0]
  ------------------
  177|      2|            FLAGS_save_series) {
  ------------------
  |  Branch (177:13): [True: 2, False: 0]
  ------------------
  178|      2|            _series_sampler = new SeriesSampler(this);
  179|      2|            _series_sampler->schedule();
  180|      2|        }
  181|      2|        return rc;
  182|      2|    }
_ZN4bvar13PassiveStatusIlE13SeriesSamplerC2EPS1_:
   58|      2|            : _owner(owner), _vector_names(NULL), _series(Op()) {}
_ZN4bvar13PassiveStatusIlE13SeriesSampler11take_sampleEv:
   62|      2|        void take_sample() override { _series.append(_owner->get_value()); }
_ZN4bvar13PassiveStatusIlEC2ERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPFlPvESD_:
   81|      2|        : _getfn(getfn)
   82|      2|        , _arg(arg)
   83|      2|        , _sampler(NULL)
   84|      2|        , _series_sampler(NULL) {
   85|      2|        expose(name);
   86|      2|    }
_ZNK4bvar13PassiveStatusImE9get_valueEv:
  139|      4|    Tp get_value() const {
  140|      4|        return (_getfn ? _getfn(_arg) : Tp());
  ------------------
  |  Branch (140:17): [True: 4, False: 0]
  ------------------
  141|      4|    }
_ZN4bvar13PassiveStatusImE11expose_implERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESC_NS_13DisplayFilterE:
  172|      4|                    DisplayFilter display_filter) override {
  173|      4|        const int rc = Variable::expose_impl(prefix, name, display_filter);
  174|      4|        if (ADDITIVE &&
  ------------------
  |  Branch (174:13): [True: 4, Folded]
  ------------------
  175|      4|            rc == 0 &&
  ------------------
  |  Branch (175:13): [True: 4, False: 0]
  ------------------
  176|      4|            _series_sampler == NULL &&
  ------------------
  |  Branch (176:13): [True: 4, False: 0]
  ------------------
  177|      4|            FLAGS_save_series) {
  ------------------
  |  Branch (177:13): [True: 4, False: 0]
  ------------------
  178|      4|            _series_sampler = new SeriesSampler(this);
  179|      4|            _series_sampler->schedule();
  180|      4|        }
  181|      4|        return rc;
  182|      4|    }
_ZN4bvar13PassiveStatusImE13SeriesSamplerC2EPS1_:
   58|      4|            : _owner(owner), _vector_names(NULL), _series(Op()) {}
_ZN4bvar13PassiveStatusImE13SeriesSampler11take_sampleEv:
   62|      4|        void take_sample() override { _series.append(_owner->get_value()); }
_ZN4bvar13PassiveStatusIiEC2ERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPFiPvESD_:
   81|      2|        : _getfn(getfn)
   82|      2|        , _arg(arg)
   83|      2|        , _sampler(NULL)
   84|      2|        , _series_sampler(NULL) {
   85|      2|        expose(name);
   86|      2|    }
_ZNK4bvar13PassiveStatusIiE9get_valueEv:
  139|      2|    Tp get_value() const {
  140|      2|        return (_getfn ? _getfn(_arg) : Tp());
  ------------------
  |  Branch (140:17): [True: 2, False: 0]
  ------------------
  141|      2|    }
_ZN4bvar13PassiveStatusIiE11expose_implERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESC_NS_13DisplayFilterE:
  172|      2|                    DisplayFilter display_filter) override {
  173|      2|        const int rc = Variable::expose_impl(prefix, name, display_filter);
  174|      2|        if (ADDITIVE &&
  ------------------
  |  Branch (174:13): [True: 2, Folded]
  ------------------
  175|      2|            rc == 0 &&
  ------------------
  |  Branch (175:13): [True: 2, False: 0]
  ------------------
  176|      2|            _series_sampler == NULL &&
  ------------------
  |  Branch (176:13): [True: 2, False: 0]
  ------------------
  177|      2|            FLAGS_save_series) {
  ------------------
  |  Branch (177:13): [True: 2, False: 0]
  ------------------
  178|      2|            _series_sampler = new SeriesSampler(this);
  179|      2|            _series_sampler->schedule();
  180|      2|        }
  181|      2|        return rc;
  182|      2|    }
_ZN4bvar13PassiveStatusIiE13SeriesSamplerC2EPS1_:
   58|      2|            : _owner(owner), _vector_names(NULL), _series(Op()) {}
_ZN4bvar13PassiveStatusIiE13SeriesSampler11take_sampleEv:
   62|      2|        void take_sample() override { _series.append(_owner->get_value()); }
_ZN4bvar13PassiveStatusImEC2ERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPFmPvESD_:
   81|      4|        : _getfn(getfn)
   82|      4|        , _arg(arg)
   83|      4|        , _sampler(NULL)
   84|      4|        , _series_sampler(NULL) {
   85|      4|        expose(name);
   86|      4|    }

_ZN4bvar7ReducerIPNS_6detail7SamplerENS1_14CombineSamplerENS1_6VoidOpEEC2ERKS3_RKS4_RKS5_:
  204|      2|        : _combiner(std::make_shared<combiner_type>(identity, identity, op))
  205|      2|        , _sampler(NULL) , _series_sampler(NULL) , _inv_op(inv_op) {}
_ZN4bvar7ReducerIPNS_6detail7SamplerENS1_14CombineSamplerENS1_6VoidOpEE5resetEv:
  238|      2|    T reset() { return _combiner->reset_all_agents(); }
_ZN4bvar7ReducerIPNS_6detail7SamplerENS1_14CombineSamplerENS1_6VoidOpEElsERKS3_:
  302|      8|    typename butil::add_cr_non_integral<T>::type value) {
  303|       |    // It's wait-free for most time
  304|      8|    agent_type* agent = _combiner->get_or_create_tls_agent();
  305|      8|    if (__builtin_expect(!agent, 0)) {
  ------------------
  |  Branch (305:9): [True: 0, False: 8]
  ------------------
  306|      0|        LOG(FATAL) << "Fail to create agent";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  307|      0|        return *this;
  308|      0|    }
  309|      8|    agent->element.modify(_combiner->op(), value);
  310|      8|    return *this;
  311|      8|}

_ZN4bvar8Variable11expose_implERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESB_NS_13DisplayFilterE:
  131|      8|                          DisplayFilter display_filter) {
  132|      8|    if (name.empty()) {
  ------------------
  |  Branch (132:9): [True: 0, False: 8]
  ------------------
  133|      0|        LOG(ERROR) << "Parameter[name] is empty";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  134|      0|        return -1;
  135|      0|    }
  136|       |    // NOTE: It's impossible to atomically erase from a submap and insert into
  137|       |    // another submap without a global lock. When the to-be-exposed name
  138|       |    // already exists, there's a chance that we can't insert back previous
  139|       |    // name. But it should be fine generally because users are unlikely to
  140|       |    // expose a variable more than once and calls to expose() are unlikely
  141|       |    // to contend heavily.
  142|       |
  143|       |    // remove previous pointer from the map if needed.
  144|      8|    hide();
  145|       |
  146|       |    // Build the name.
  147|      8|    _name.clear();
  148|      8|    _name.reserve((prefix.size() + name.size()) * 5 / 4);
  149|      8|    if (!prefix.empty()) {
  ------------------
  |  Branch (149:9): [True: 0, False: 8]
  ------------------
  150|      0|        to_underscored_name(&_name, prefix);
  151|      0|        if (!_name.empty() && butil::back_char(_name) != '_') {
  ------------------
  |  Branch (151:13): [True: 0, False: 0]
  |  Branch (151:31): [True: 0, False: 0]
  ------------------
  152|      0|            _name.push_back('_');
  153|      0|        }
  154|      0|    }
  155|      8|    to_underscored_name(&_name, name);
  156|       |    
  157|      8|    VarMapWithLock& m = get_var_map(_name);
  158|      8|    {
  159|      8|        BAIDU_SCOPED_LOCK(m.mutex);
  ------------------
  |  |   47|      8|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      8|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      8|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      8|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  160|      8|        VarEntry* entry = m.seek(_name);
  161|      8|        if (entry == NULL) {
  ------------------
  |  Branch (161:13): [True: 8, False: 0]
  ------------------
  162|      8|            entry = &m[_name];
  163|      8|            entry->var = this;
  164|      8|            entry->display_filter = display_filter;
  165|      8|            return 0;
  166|      8|        }
  167|      8|    }
  168|      0|    RELEASE_ASSERT_VERBOSE(!FLAGS_bvar_abort_on_same_name,
  ------------------
  |  |  489|      0|    do {                                                                            \
  |  |  490|      0|        if (!(condition)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (490:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  491|      0|            ASSERT_LOG("Assert failure: " #condition ". " #fmt, ## __VA_ARGS__);    \
  |  |  ------------------
  |  |  |  |  469|      0|    do {                                                                \
  |  |  |  |  470|      0|        std::string log = butil::string_printf(fmt, ## __VA_ARGS__);    \
  |  |  |  |  471|      0|        LOG(FATAL) << log;                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  472|      0|    } while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  492|      0|            ::abort();                                                              \
  |  |  493|      0|        }                                                                           \
  |  |  494|      0|    } while (false)
  |  |  ------------------
  |  |  |  Branch (494:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  169|      0|                           "Abort due to name conflict");
  170|      0|    if (!s_bvar_may_abort) {
  ------------------
  |  Branch (170:9): [True: 0, False: 0]
  ------------------
  171|       |        // Mark name conflict occurs, If this conflict happens before
  172|       |        // initialization of bvar_abort_on_same_name, the validator will
  173|       |        // abort the program if needed.
  174|      0|        s_bvar_may_abort = true;
  175|      0|    }
  176|       |        
  177|      0|    LOG(ERROR) << "Already exposed `" << _name << "' whose value is `"
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  178|      0|               << describe_exposed(_name) << '\'';
  179|      0|    _name.clear();
  180|      0|    return -1;
  181|      0|}
_ZN4bvar8Variable4hideEv:
  187|      8|bool Variable::hide() {
  188|      8|    if (_name.empty()) {
  ------------------
  |  Branch (188:9): [True: 8, False: 0]
  ------------------
  189|      8|        return false;
  190|      8|    }
  191|      0|    VarMapWithLock& m = get_var_map(_name);
  192|      0|    BAIDU_SCOPED_LOCK(m.mutex);
  ------------------
  |  |   47|      0|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      0|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      0|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      0|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  193|      0|    VarEntry* entry = m.seek(_name);
  194|      0|    if (entry) {
  ------------------
  |  Branch (194:9): [True: 0, False: 0]
  ------------------
  195|      0|        CHECK_EQ(1UL, m.erase(_name));
  ------------------
  |  |  692|      0|#define CHECK_EQ(val1, val2) BAIDU_CHECK_OP(EQ, ==, val1, val2)
  |  |  ------------------
  |  |  |  |  630|      0|    if (std::string* _result =                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (630:22): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  631|      0|        ::logging::Check##name##Impl((val1), (val2),                    \
  |  |  |  |  632|      0|                                     #val1 " " #op " " #val2))          \
  |  |  |  |  633|      0|        ::logging::LogMessage(__FILE__, __LINE__, __func__, _result).stream().SetCheck()
  |  |  ------------------
  ------------------
  196|      0|    } else {
  197|      0|        CHECK(false) << "`" << _name << "' must exist";
  ------------------
  |  |  617|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
  198|      0|    }
  199|      0|    _name.clear();
  200|      0|    return true;
  201|      8|}
_ZN4bvar19to_underscored_nameEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKN5butil16BasicStringPieceIS5_EE:
  942|      8|void to_underscored_name(std::string* name, const butil::StringPiece& src) {
  943|      8|    name->reserve(name->size() + src.size() + 8/*just guess*/);
  944|    170|    for (const char* p = src.data(); p != src.data() + src.size(); ++p) {
  ------------------
  |  Branch (944:38): [True: 162, False: 8]
  ------------------
  945|    162|        if (isalpha(*p)) {
  ------------------
  |  Branch (945:13): [True: 146, False: 16]
  ------------------
  946|    146|            if (*p < 'a') { // upper cases
  ------------------
  |  Branch (946:17): [True: 0, False: 146]
  ------------------
  947|      0|                if (p != src.data() && !isupper(p[-1]) &&
  ------------------
  |  Branch (947:21): [True: 0, False: 0]
  |  Branch (947:40): [True: 0, False: 0]
  ------------------
  948|      0|                    butil::back_char(*name) != '_') {
  ------------------
  |  Branch (948:21): [True: 0, False: 0]
  ------------------
  949|      0|                    name->push_back('_');
  950|      0|                }
  951|      0|                name->push_back(*p - 'A' + 'a');
  952|    146|            } else {
  953|    146|                name->push_back(*p);
  954|    146|            }
  955|    146|        } else if (isdigit(*p)) {
  ------------------
  |  Branch (955:20): [True: 0, False: 16]
  ------------------
  956|      0|            name->push_back(*p);
  957|     16|        } else if (name->empty() || butil::back_char(*name) != '_') {
  ------------------
  |  Branch (957:20): [True: 0, False: 16]
  |  Branch (957:37): [True: 16, False: 0]
  ------------------
  958|     16|            name->push_back('_');
  959|     16|        }
  960|    162|    }
  961|      8|}
_ZN4bvar11get_var_mapERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  119|      8|inline VarMapWithLock& get_var_map(const std::string& name) {
  120|      8|    VarMapWithLock& m = get_var_maps()[sub_map_index(name)];
  121|      8|    return m;
  122|      8|}
_ZN4bvar13sub_map_indexERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  102|      8|inline size_t sub_map_index(const std::string& str) {
  103|      8|    if (str.empty()) {
  ------------------
  |  Branch (103:9): [True: 0, False: 8]
  ------------------
  104|      0|        return 0;
  105|      0|    }
  106|      8|    size_t h = 0;
  107|       |    // we're assume that str is ended with '\0', which may not be in general
  108|    170|    for (const char* p  = str.c_str(); *p; ++p) {
  ------------------
  |  Branch (108:40): [True: 162, False: 8]
  ------------------
  109|    162|        h = h * 5 + *p;
  110|    162|    }
  111|      8|    return h & (SUB_MAP_COUNT - 1);
  112|      8|}
_ZN4bvar12get_var_mapsEv:
  114|      8|inline VarMapWithLock* get_var_maps() {
  115|      8|    pthread_once(&s_var_maps_once, init_var_maps);
  116|      8|    return s_var_maps;
  117|      8|}
variable.cpp:_ZN4bvarL13init_var_mapsEv:
   96|      2|static void init_var_maps() {
   97|       |    // It's probably slow to initialize all sub maps, but rpc often expose 
   98|       |    // variables before user. So this should not be an issue to users.
   99|      2|    s_var_maps = new VarMapWithLock[SUB_MAP_COUNT];
  100|      2|}
_ZN4bvar14VarMapWithLockC2Ev:
   78|     64|    VarMapWithLock() {
   79|     64|        if (init(1024) != 0) {
  ------------------
  |  Branch (79:13): [True: 0, False: 64]
  ------------------
   80|      0|            LOG(WARNING) << "Fail to init VarMap";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|      0|        }
   82|       |
   83|     64|        pthread_mutexattr_t attr;
   84|     64|        pthread_mutexattr_init(&attr);
   85|     64|        pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
   86|     64|        pthread_mutex_init(&mutex, &attr);
   87|     64|        pthread_mutexattr_destroy(&attr);
   88|     64|    }
_ZN4bvar8VarEntryC2Ev:
   67|      8|    VarEntry() : var(NULL), display_filter(DISPLAY_ON_ALL) {}

_ZN4bvar8VariableC2Ev:
  120|     10|    Variable() {}
_ZN4bvar8Variable6exposeERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEENS_13DisplayFilterE:
  150|      8|               DisplayFilter display_filter = DISPLAY_ON_ALL) {
  151|      8|        return expose_impl(butil::StringPiece(), name, display_filter);
  152|      8|    }

LLVMFuzzerTestOneInput:
   35|  2.08k|{
   36|  2.08k|    if (size < kMinInputLength || size > kMaxInputLength){
  ------------------
  |  |   22|  4.17k|#define kMinInputLength 5
  ------------------
                  if (size < kMinInputLength || size > kMaxInputLength){
  ------------------
  |  |   23|  2.08k|#define kMaxInputLength 4096
  ------------------
  |  Branch (36:9): [True: 4, False: 2.08k]
  |  Branch (36:35): [True: 3, False: 2.07k]
  ------------------
   37|      7|        return 1;
   38|      7|    }
   39|       |
   40|       |    // Use first byte to select mode
   41|  2.07k|    uint8_t mode = data[0] % 4;
   42|  2.07k|    const uint8_t *payload = data + 1;
   43|  2.07k|    size_t payload_size = size - 1;
   44|       |
   45|  2.07k|    switch (mode) {
  ------------------
  |  Branch (45:13): [True: 2.07k, False: 0]
  ------------------
   46|    942|        case 0: {
  ------------------
  |  Branch (46:9): [True: 942, False: 1.13k]
  ------------------
   47|       |            // Fuzz low-level HTTP request parsing
   48|    942|            brpc::http_parser parser;
   49|    942|            brpc::http_parser_init(&parser, brpc::HTTP_REQUEST);
   50|    942|            brpc::http_parser_settings settings;
   51|    942|            memset(&settings, 0, sizeof(settings));
   52|    942|            settings.on_url = on_url_cb;
   53|    942|            settings.on_header_field = on_header_field_cb;
   54|    942|            settings.on_header_value = on_header_value_cb;
   55|    942|            settings.on_body = on_body_cb;
   56|    942|            settings.on_message_begin = on_message_begin_cb;
   57|    942|            settings.on_headers_complete = on_headers_complete_cb;
   58|    942|            settings.on_message_complete = on_message_complete_cb;
   59|    942|            brpc::http_parser_execute(&parser, &settings,
   60|    942|                               reinterpret_cast<const char*>(payload), payload_size);
   61|    942|            break;
   62|      0|        }
   63|    354|        case 1: {
  ------------------
  |  Branch (63:9): [True: 354, False: 1.72k]
  ------------------
   64|       |            // Fuzz low-level HTTP response parsing
   65|    354|            brpc::http_parser parser;
   66|    354|            brpc::http_parser_init(&parser, brpc::HTTP_RESPONSE);
   67|    354|            brpc::http_parser_settings settings;
   68|    354|            memset(&settings, 0, sizeof(settings));
   69|    354|            settings.on_url = on_url_cb;
   70|    354|            settings.on_header_field = on_header_field_cb;
   71|    354|            settings.on_header_value = on_header_value_cb;
   72|    354|            settings.on_body = on_body_cb;
   73|    354|            settings.on_message_begin = on_message_begin_cb;
   74|    354|            settings.on_headers_complete = on_headers_complete_cb;
   75|    354|            settings.on_message_complete = on_message_complete_cb;
   76|    354|            brpc::http_parser_execute(&parser, &settings,
   77|    354|                               reinterpret_cast<const char*>(payload), payload_size);
   78|    354|            break;
   79|      0|        }
   80|     97|        case 2: {
  ------------------
  |  Branch (80:9): [True: 97, False: 1.98k]
  ------------------
   81|       |            // Fuzz URL parsing (not connect)
   82|     97|            brpc::http_parser_url u;
   83|     97|            brpc::http_parser_parse_url(reinterpret_cast<const char*>(payload),
   84|     97|                                       payload_size, 0, &u);
   85|     97|            break;
   86|      0|        }
   87|    686|        case 3: {
  ------------------
  |  Branch (87:9): [True: 686, False: 1.39k]
  ------------------
   88|       |            // Fuzz URL parsing (connect mode)
   89|    686|            brpc::http_parser_url u;
   90|    686|            brpc::http_parser_parse_url(reinterpret_cast<const char*>(payload),
   91|    686|                                       payload_size, 1, &u);
   92|    686|            break;
   93|      0|        }
   94|  2.07k|    }
   95|       |
   96|  2.07k|    return 0;
   97|  2.07k|}
fuzz_http_parser.cpp:_ZL9on_url_cbPN4brpc11http_parserEPKcm:
   25|  2.04k|static int on_url_cb(brpc::http_parser* p, const char* at, size_t length) { return 0; }
fuzz_http_parser.cpp:_ZL18on_header_field_cbPN4brpc11http_parserEPKcm:
   26|  5.34k|static int on_header_field_cb(brpc::http_parser* p, const char* at, size_t length) { return 0; }
fuzz_http_parser.cpp:_ZL18on_header_value_cbPN4brpc11http_parserEPKcm:
   27|  5.76k|static int on_header_value_cb(brpc::http_parser* p, const char* at, size_t length) { return 0; }
fuzz_http_parser.cpp:_ZL10on_body_cbPN4brpc11http_parserEPKcm:
   28|      6|static int on_body_cb(brpc::http_parser* p, const char* at, size_t length) { return 0; }
fuzz_http_parser.cpp:_ZL19on_message_begin_cbPN4brpc11http_parserE:
   29|  4.80k|static int on_message_begin_cb(brpc::http_parser* p) { return 0; }
fuzz_http_parser.cpp:_ZL22on_headers_complete_cbPN4brpc11http_parserE:
   30|  2.89k|static int on_headers_complete_cb(brpc::http_parser* p) { return 0; }
fuzz_http_parser.cpp:_ZL22on_message_complete_cbPN4brpc11http_parserE:
   31|  2.86k|static int on_message_complete_cb(brpc::http_parser* p) { return 0; }

