_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.41k|{
  695|  1.41k|  char c, ch;
  696|  1.41k|  int8_t unhex_val;
  697|  1.41k|  const char *p = data;
  698|  1.41k|  const char *header_field_mark = 0;
  699|  1.41k|  const char *header_value_mark = 0;
  700|  1.41k|  const char *url_mark = 0;
  701|  1.41k|  const char *body_mark = 0;
  702|  1.41k|  const char *status_mark = 0;
  703|  1.41k|  const unsigned int lenient = parser->lenient_http_headers;
  704|  1.41k|  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.41k|  if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {
  ------------------
  |  |  204|  1.41k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  ------------------
  |  Branch (707:7): [True: 0, False: 1.41k]
  ------------------
  708|      0|    return 0;
  709|      0|  }
  710|       |
  711|  1.41k|  if (len == 0) {
  ------------------
  |  Branch (711:7): [True: 0, False: 1.41k]
  ------------------
  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.41k|  if (parser->state == s_header_field)
  ------------------
  |  Branch (733:7): [True: 0, False: 1.41k]
  ------------------
  734|      0|    header_field_mark = data;
  735|  1.41k|  if (parser->state == s_header_value)
  ------------------
  |  Branch (735:7): [True: 0, False: 1.41k]
  ------------------
  736|      0|    header_value_mark = data;
  737|  1.41k|  switch (parser->state) {
  ------------------
  |  Branch (737:11): [True: 0, False: 1.41k]
  ------------------
  738|      0|  case s_req_path:
  ------------------
  |  Branch (738:3): [True: 0, False: 1.41k]
  ------------------
  739|      0|  case s_req_scheme:
  ------------------
  |  Branch (739:3): [True: 0, False: 1.41k]
  ------------------
  740|      0|  case s_req_scheme_slash:
  ------------------
  |  Branch (740:3): [True: 0, False: 1.41k]
  ------------------
  741|      0|  case s_req_scheme_slash_slash:
  ------------------
  |  Branch (741:3): [True: 0, False: 1.41k]
  ------------------
  742|      0|  case s_req_server_start:
  ------------------
  |  Branch (742:3): [True: 0, False: 1.41k]
  ------------------
  743|      0|  case s_req_server:
  ------------------
  |  Branch (743:3): [True: 0, False: 1.41k]
  ------------------
  744|      0|  case s_req_server_with_at:
  ------------------
  |  Branch (744:3): [True: 0, False: 1.41k]
  ------------------
  745|      0|  case s_req_query_string_start:
  ------------------
  |  Branch (745:3): [True: 0, False: 1.41k]
  ------------------
  746|      0|  case s_req_query_string:
  ------------------
  |  Branch (746:3): [True: 0, False: 1.41k]
  ------------------
  747|      0|  case s_req_fragment_start:
  ------------------
  |  Branch (747:3): [True: 0, False: 1.41k]
  ------------------
  748|      0|  case s_req_fragment:
  ------------------
  |  Branch (748:3): [True: 0, False: 1.41k]
  ------------------
  749|      0|    url_mark = data;
  750|      0|    break;
  751|      0|  case s_res_status:
  ------------------
  |  Branch (751:3): [True: 0, False: 1.41k]
  ------------------
  752|      0|    status_mark = data;
  753|      0|    break;
  754|  1.41k|  }
  755|       |
  756|   124k|  for (p=data; p != data + len; p++) {
  ------------------
  |  Branch (756:16): [True: 123k, False: 951]
  ------------------
  757|   123k|    ch = *p;
  758|       |
  759|   123k|    if (PARSING_HEADER(parser->state)) {
  ------------------
  |  |  393|   123k|#define PARSING_HEADER(state) (state <= s_headers_done)
  |  |  ------------------
  |  |  |  Branch (393:31): [True: 123k, False: 3]
  |  |  ------------------
  ------------------
  760|   123k|      ++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|   123k|      if (parser->nread > (BRPC_HTTP_MAX_HEADER_SIZE)) {
  ------------------
  |  |   61|   123k|# define BRPC_HTTP_MAX_HEADER_SIZE (80*1024)
  ------------------
  |  Branch (772:11): [True: 0, False: 123k]
  ------------------
  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|   123k|    }
  777|       |
  778|   138k|    reexecute_byte:
  779|   138k|    switch (parser->state) {
  780|       |
  781|    389|      case s_dead:
  ------------------
  |  Branch (781:7): [True: 389, False: 137k]
  ------------------
  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: 138k]
  ------------------
  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: 138k]
  ------------------
  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.78k|      case s_start_res:
  ------------------
  |  Branch (829:7): [True: 2.78k, False: 135k]
  ------------------
  830|  2.78k|      {
  831|  2.78k|        parser->flags = 0;
  832|  2.78k|        parser->uses_transfer_encoding = 0;
  833|  2.78k|        parser->content_length = ULLONG_MAX;
  834|       |
  835|  2.78k|        switch (ch) {
  836|  2.02k|          case 'H':
  ------------------
  |  Branch (836:11): [True: 2.02k, False: 766]
  ------------------
  837|  2.02k|            parser->state = s_res_H;
  838|  2.02k|            break;
  839|       |
  840|    197|          case CR:
  ------------------
  |  |  474|    197|#define CR                  '\r'
  ------------------
  |  Branch (840:11): [True: 197, False: 2.58k]
  ------------------
  841|    755|          case LF:
  ------------------
  |  |  475|    755|#define LF                  '\n'
  ------------------
  |  Branch (841:11): [True: 558, False: 2.22k]
  ------------------
  842|    755|            break;
  843|       |
  844|     11|          default:
  ------------------
  |  Branch (844:11): [True: 11, False: 2.77k]
  ------------------
  845|     11|            SET_ERRNO(HPE_INVALID_CONSTANT);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
  846|     11|            goto error;
  847|  2.78k|        }
  848|       |
  849|  2.77k|        CALLBACK_NOTIFY(message_begin);
  ------------------
  |  |   78|  2.77k|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|  2.77k|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|  2.77k|do {                                                                 \
  |  |  |  |   63|  2.77k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|  2.77k|                                                                     \
  |  |  |  |   65|  2.77k|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 2.77k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|  2.77k|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 2.77k]
  |  |  |  |  ------------------
  |  |  |  |   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.77k|                                                                     \
  |  |  |  |   70|  2.77k|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|  2.77k|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  2.77k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 2.77k]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|  2.77k|  }                                                                  \
  |  |  |  |   75|  2.77k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 2.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (849:9): [True: 2.77k, False: 0]
  ------------------
  850|  2.77k|        break;
  851|  2.77k|      }
  852|       |
  853|  2.77k|      case s_res_H:
  ------------------
  |  Branch (853:7): [True: 2.01k, False: 136k]
  ------------------
  854|  2.01k|        STRICT_CHECK(ch != 'T');
  ------------------
  |  |  513|  2.01k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  2.01k|do {                                                                 \
  |  |  515|  2.01k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 12, False: 2.00k]
  |  |  ------------------
  |  |  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|  2.01k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 2.00k]
  |  |  ------------------
  ------------------
  855|  2.00k|        parser->state = s_res_HT;
  856|  2.00k|        break;
  857|       |
  858|  2.00k|      case s_res_HT:
  ------------------
  |  Branch (858:7): [True: 2.00k, False: 136k]
  ------------------
  859|  2.00k|        STRICT_CHECK(ch != 'T');
  ------------------
  |  |  513|  2.00k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  2.00k|do {                                                                 \
  |  |  515|  2.00k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 13, False: 1.98k]
  |  |  ------------------
  |  |  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|  2.00k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 1.98k]
  |  |  ------------------
  ------------------
  860|  1.98k|        parser->state = s_res_HTT;
  861|  1.98k|        break;
  862|       |
  863|  1.98k|      case s_res_HTT:
  ------------------
  |  Branch (863:7): [True: 1.98k, False: 136k]
  ------------------
  864|  1.98k|        STRICT_CHECK(ch != 'P');
  ------------------
  |  |  513|  1.98k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  1.98k|do {                                                                 \
  |  |  515|  1.98k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 10, False: 1.97k]
  |  |  ------------------
  |  |  516|     10|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|     10|    goto error;                                                      \
  |  |  518|     10|  }                                                                  \
  |  |  519|  1.98k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 1.97k]
  |  |  ------------------
  ------------------
  865|  1.97k|        parser->state = s_res_HTTP;
  866|  1.97k|        break;
  867|       |
  868|  1.97k|      case s_res_HTTP:
  ------------------
  |  Branch (868:7): [True: 1.97k, False: 136k]
  ------------------
  869|  1.97k|        STRICT_CHECK(ch != '/');
  ------------------
  |  |  513|  1.97k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  1.97k|do {                                                                 \
  |  |  515|  1.97k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 1, False: 1.97k]
  |  |  ------------------
  |  |  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.97k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 1.97k]
  |  |  ------------------
  ------------------
  870|  1.97k|        parser->state = s_res_first_http_major;
  871|  1.97k|        break;
  872|       |
  873|  1.97k|      case s_res_first_http_major:
  ------------------
  |  Branch (873:7): [True: 1.97k, False: 136k]
  ------------------
  874|  1.97k|        if (ch < '0' || ch > '9') {
  ------------------
  |  Branch (874:13): [True: 9, False: 1.96k]
  |  Branch (874:25): [True: 5, False: 1.95k]
  ------------------
  875|     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]
  |  |  ------------------
  ------------------
  876|     14|          goto error;
  877|     14|        }
  878|       |
  879|  1.95k|        parser->http_major = ch - '0';
  880|  1.95k|        parser->state = s_res_http_major;
  881|  1.95k|        break;
  882|       |
  883|       |      /* major HTTP version or dot */
  884|  2.19k|      case s_res_http_major:
  ------------------
  |  Branch (884:7): [True: 2.19k, False: 136k]
  ------------------
  885|  2.19k|      {
  886|  2.19k|        if (ch == '.') {
  ------------------
  |  Branch (886:13): [True: 1.90k, False: 286]
  ------------------
  887|  1.90k|          parser->state = s_res_first_http_minor;
  888|  1.90k|          break;
  889|  1.90k|        }
  890|       |
  891|    286|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|    286|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 274, False: 12]
  |  |  |  Branch (478:44): [True: 269, False: 5]
  |  |  ------------------
  ------------------
  892|     17|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|     17|#define SET_ERRNO(e)                                                 \
  |  |   55|     17|do {                                                                 \
  |  |   56|     17|  parser->http_errno = (e);                                          \
  |  |   57|     17|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 17]
  |  |  ------------------
  ------------------
  893|     17|          goto error;
  894|     17|        }
  895|       |
  896|    269|        parser->http_major *= 10;
  897|    269|        parser->http_major += ch - '0';
  898|       |
  899|    269|        if (parser->http_major > 999) {
  ------------------
  |  Branch (899:13): [True: 3, False: 266]
  ------------------
  900|      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]
  |  |  ------------------
  ------------------
  901|      3|          goto error;
  902|      3|        }
  903|       |
  904|    266|        break;
  905|    269|      }
  906|       |
  907|       |      /* first digit of minor HTTP version */
  908|  1.90k|      case s_res_first_http_minor:
  ------------------
  |  Branch (908:7): [True: 1.90k, False: 136k]
  ------------------
  909|  1.90k|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|  1.90k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 1.89k, False: 6]
  |  |  |  Branch (478:44): [True: 1.89k, False: 5]
  |  |  ------------------
  ------------------
  910|     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]
  |  |  ------------------
  ------------------
  911|     11|          goto error;
  912|     11|        }
  913|       |
  914|  1.89k|        parser->http_minor = ch - '0';
  915|  1.89k|        parser->state = s_res_http_minor;
  916|  1.89k|        break;
  917|       |
  918|       |      /* minor HTTP version or end of request line */
  919|  2.13k|      case s_res_http_minor:
  ------------------
  |  Branch (919:7): [True: 2.13k, False: 136k]
  ------------------
  920|  2.13k|      {
  921|  2.13k|        if (ch == ' ') {
  ------------------
  |  Branch (921:13): [True: 1.84k, False: 289]
  ------------------
  922|  1.84k|          parser->state = s_res_first_status_code;
  923|  1.84k|          break;
  924|  1.84k|        }
  925|       |
  926|    289|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|    289|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 280, False: 9]
  |  |  |  Branch (478:44): [True: 274, False: 6]
  |  |  ------------------
  ------------------
  927|     15|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|     15|#define SET_ERRNO(e)                                                 \
  |  |   55|     15|do {                                                                 \
  |  |   56|     15|  parser->http_errno = (e);                                          \
  |  |   57|     15|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 15]
  |  |  ------------------
  ------------------
  928|     15|          goto error;
  929|     15|        }
  930|       |
  931|    274|        parser->http_minor *= 10;
  932|    274|        parser->http_minor += ch - '0';
  933|       |
  934|    274|        if (parser->http_minor > 999) {
  ------------------
  |  Branch (934:13): [True: 3, False: 271]
  ------------------
  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|    271|        break;
  940|    274|      }
  941|       |
  942|  2.06k|      case s_res_first_status_code:
  ------------------
  |  Branch (942:7): [True: 2.06k, False: 136k]
  ------------------
  943|  2.06k|      {
  944|  2.06k|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|  2.06k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 1.82k, False: 244]
  |  |  |  Branch (478:44): [True: 1.82k, False: 2]
  |  |  ------------------
  ------------------
  945|    246|          if (ch == ' ') {
  ------------------
  |  Branch (945:15): [True: 236, False: 10]
  ------------------
  946|    236|            break;
  947|    236|          }
  948|       |
  949|     10|          SET_ERRNO(HPE_INVALID_STATUS);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
  950|     10|          goto error;
  951|    246|        }
  952|  1.82k|        parser->status_code = ch - '0';
  953|  1.82k|        parser->state = s_res_status_code;
  954|  1.82k|        break;
  955|  2.06k|      }
  956|       |
  957|  5.42k|      case s_res_status_code:
  ------------------
  |  Branch (957:7): [True: 5.42k, False: 132k]
  ------------------
  958|  5.42k|      {
  959|  5.42k|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|  5.42k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 3.62k, False: 1.80k]
  |  |  |  Branch (478:44): [True: 3.62k, False: 2]
  |  |  ------------------
  ------------------
  960|  1.80k|          switch (ch) {
  961|  1.02k|            case ' ':
  ------------------
  |  Branch (961:13): [True: 1.02k, False: 782]
  ------------------
  962|  1.02k|              parser->state = s_res_status_start;
  963|  1.02k|              break;
  964|    131|            case CR:
  ------------------
  |  |  474|    131|#define CR                  '\r'
  ------------------
  |  Branch (964:13): [True: 131, False: 1.67k]
  ------------------
  965|    131|              parser->state = s_res_line_almost_done;
  966|    131|              break;
  967|    641|            case LF:
  ------------------
  |  |  475|    641|#define LF                  '\n'
  ------------------
  |  Branch (967:13): [True: 641, False: 1.16k]
  ------------------
  968|    641|              parser->state = s_header_field_start;
  969|    641|              break;
  970|     10|            default:
  ------------------
  |  Branch (970:13): [True: 10, False: 1.79k]
  ------------------
  971|     10|              SET_ERRNO(HPE_INVALID_STATUS);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
  972|     10|              goto error;
  973|  1.80k|          }
  974|  1.79k|          break;
  975|  1.80k|        }
  976|       |
  977|  3.62k|        parser->status_code *= 10;
  978|  3.62k|        parser->status_code += ch - '0';
  979|       |
  980|  3.62k|        if (parser->status_code > 999) {
  ------------------
  |  Branch (980:13): [True: 3, False: 3.61k]
  ------------------
  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.61k|        break;
  986|  3.62k|      }
  987|       |
  988|  3.61k|      case s_res_status_start:
  ------------------
  |  Branch (988:7): [True: 1.01k, False: 137k]
  ------------------
  989|  1.01k|      {
  990|  1.01k|        if (ch == CR) {
  ------------------
  |  |  474|  1.01k|#define CR                  '\r'
  ------------------
  |  Branch (990:13): [True: 312, False: 707]
  ------------------
  991|    312|          parser->state = s_res_line_almost_done;
  992|    312|          break;
  993|    312|        }
  994|       |
  995|    707|        if (ch == LF) {
  ------------------
  |  |  475|    707|#define LF                  '\n'
  ------------------
  |  Branch (995:13): [True: 389, False: 318]
  ------------------
  996|    389|          parser->state = s_header_field_start;
  997|    389|          break;
  998|    389|        }
  999|       |
 1000|    318|        MARK(status);
  ------------------
  |  |  112|    318|#define MARK(FOR)                                                    \
  |  |  113|    318|do {                                                                 \
  |  |  114|    318|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 318, False: 0]
  |  |  ------------------
  |  |  115|    318|    FOR##_mark = p;                                                  \
  |  |  116|    318|  }                                                                  \
  |  |  117|    318|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 318]
  |  |  ------------------
  ------------------
 1001|    318|        parser->state = s_res_status;
 1002|    318|        parser->index = 0;
 1003|    318|        break;
 1004|    707|      }
 1005|       |
 1006|    766|      case s_res_status:
  ------------------
  |  Branch (1006:7): [True: 766, False: 137k]
  ------------------
 1007|    766|        if (ch == CR) {
  ------------------
  |  |  474|    766|#define CR                  '\r'
  ------------------
  |  Branch (1007:13): [True: 97, False: 669]
  ------------------
 1008|     97|          parser->state = s_res_line_almost_done;
 1009|     97|          CALLBACK_DATA(status);
  ------------------
  |  |  105|     97|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|     97|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|     97|do {                                                                 \
  |  |  |  |   86|     97|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|     97|                                                                     \
  |  |  |  |   88|     97|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 97, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|     97|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 0, False: 97]
  |  |  |  |  ------------------
  |  |  |  |   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|     97|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|     97|  }                                                                  \
  |  |  |  |  101|     97|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 97]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1009:11): [True: 97, False: 0]
  ------------------
 1010|     97|          break;
 1011|     97|        }
 1012|       |
 1013|    669|        if (ch == LF) {
  ------------------
  |  |  475|    669|#define LF                  '\n'
  ------------------
  |  Branch (1013:13): [True: 210, False: 459]
  ------------------
 1014|    210|          parser->state = s_header_field_start;
 1015|    210|          CALLBACK_DATA(status);
  ------------------
  |  |  105|    210|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|    210|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    210|do {                                                                 \
  |  |  |  |   86|    210|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    210|                                                                     \
  |  |  |  |   88|    210|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 210, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|    210|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 0, False: 210]
  |  |  |  |  ------------------
  |  |  |  |   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|    210|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    210|  }                                                                  \
  |  |  |  |  101|    210|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 210]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1015:11): [True: 210, False: 0]
  ------------------
 1016|    210|          break;
 1017|    210|        }
 1018|       |
 1019|    459|        break;
 1020|       |
 1021|    522|      case s_res_line_almost_done:
  ------------------
  |  Branch (1021:7): [True: 522, False: 137k]
  ------------------
 1022|    522|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|    522|# define STRICT_CHECK(cond)                                          \
  |  |  514|    522|do {                                                                 \
  |  |  515|    522|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 3, False: 519]
  |  |  ------------------
  |  |  516|      3|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|      3|    goto error;                                                      \
  |  |  518|      3|  }                                                                  \
  |  |  519|    522|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 519]
  |  |  ------------------
  ------------------
 1023|    519|        parser->state = s_header_field_start;
 1024|    519|        break;
 1025|       |
 1026|  3.47k|      case s_start_req:
  ------------------
  |  Branch (1026:7): [True: 3.47k, False: 134k]
  ------------------
 1027|  3.47k|      {
 1028|  3.47k|        if (ch == CR || ch == LF)
  ------------------
  |  |  474|  6.95k|#define CR                  '\r'
  ------------------
                      if (ch == CR || ch == LF)
  ------------------
  |  |  475|  2.85k|#define LF                  '\n'
  ------------------
  |  Branch (1028:13): [True: 626, False: 2.85k]
  |  Branch (1028:25): [True: 449, False: 2.40k]
  ------------------
 1029|  1.07k|          break;
 1030|  2.40k|        parser->flags = 0;
 1031|  2.40k|        parser->uses_transfer_encoding = 0;
 1032|  2.40k|        parser->content_length = ULLONG_MAX;
 1033|       |
 1034|  2.40k|        if (!IS_ALPHA(ch)) {
  ------------------
  |  |  477|  2.40k|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|  2.40k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|  2.39k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |  |  Branch (477:30): [True: 2.39k, False: 7]
  |  |  |  Branch (477:49): [True: 2.38k, False: 10]
  |  |  ------------------
  ------------------
 1035|     17|          SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|     17|#define SET_ERRNO(e)                                                 \
  |  |   55|     17|do {                                                                 \
  |  |   56|     17|  parser->http_errno = (e);                                          \
  |  |   57|     17|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 17]
  |  |  ------------------
  ------------------
 1036|     17|          goto error;
 1037|     17|        }
 1038|       |
 1039|  2.38k|        parser->method = (enum http_method) 0;
 1040|  2.38k|        parser->index = 1;
 1041|  2.38k|        switch (ch) {
 1042|     29|          case 'C': parser->method = HTTP_CONNECT; /* or COPY, CHECKOUT */ break;
  ------------------
  |  Branch (1042:11): [True: 29, False: 2.35k]
  ------------------
 1043|      2|          case 'D': parser->method = HTTP_DELETE; break;
  ------------------
  |  Branch (1043:11): [True: 2, False: 2.38k]
  ------------------
 1044|  2.18k|          case 'G': parser->method = HTTP_GET; break;
  ------------------
  |  Branch (1044:11): [True: 2.18k, False: 205]
  ------------------
 1045|     21|          case 'H': parser->method = HTTP_HEAD; break;
  ------------------
  |  Branch (1045:11): [True: 21, False: 2.36k]
  ------------------
 1046|      3|          case 'L': parser->method = HTTP_LOCK; break;
  ------------------
  |  Branch (1046:11): [True: 3, False: 2.38k]
  ------------------
 1047|     52|          case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH, MKCALENDAR */ break;
  ------------------
  |  Branch (1047:11): [True: 52, False: 2.33k]
  ------------------
 1048|      1|          case 'N': parser->method = HTTP_NOTIFY; break;
  ------------------
  |  Branch (1048:11): [True: 1, False: 2.38k]
  ------------------
 1049|      3|          case 'O': parser->method = HTTP_OPTIONS; break;
  ------------------
  |  Branch (1049:11): [True: 3, False: 2.38k]
  ------------------
 1050|     66|          case 'P': parser->method = HTTP_POST;
  ------------------
  |  Branch (1050:11): [True: 66, False: 2.32k]
  ------------------
 1051|       |            /* or PROPFIND|PROPPATCH|PUT|PATCH|PURGE */
 1052|     66|            break;
 1053|      2|          case 'R': parser->method = HTTP_REPORT; break;
  ------------------
  |  Branch (1053:11): [True: 2, False: 2.38k]
  ------------------
 1054|     14|          case 'S': parser->method = HTTP_SUBSCRIBE; /* or SEARCH */ break;
  ------------------
  |  Branch (1054:11): [True: 14, False: 2.37k]
  ------------------
 1055|      2|          case 'T': parser->method = HTTP_TRACE; break;
  ------------------
  |  Branch (1055:11): [True: 2, False: 2.38k]
  ------------------
 1056|      8|          case 'U': parser->method = HTTP_UNLOCK; /* or UNSUBSCRIBE */ break;
  ------------------
  |  Branch (1056:11): [True: 8, False: 2.37k]
  ------------------
 1057|      2|          default:
  ------------------
  |  Branch (1057:11): [True: 2, False: 2.38k]
  ------------------
 1058|      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]
  |  |  ------------------
  ------------------
 1059|      2|            goto error;
 1060|  2.38k|        }
 1061|  2.38k|        parser->state = s_req_method;
 1062|       |
 1063|  2.38k|        CALLBACK_NOTIFY(message_begin);
  ------------------
  |  |   78|  2.38k|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|  2.38k|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|  2.38k|do {                                                                 \
  |  |  |  |   63|  2.38k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|  2.38k|                                                                     \
  |  |  |  |   65|  2.38k|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 2.38k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|  2.38k|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 2.38k]
  |  |  |  |  ------------------
  |  |  |  |   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.38k|                                                                     \
  |  |  |  |   70|  2.38k|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|  2.38k|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  2.38k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 2.38k]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|  2.38k|  }                                                                  \
  |  |  |  |   75|  2.38k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 2.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1063:9): [True: 2.38k, False: 0]
  ------------------
 1064|       |
 1065|  2.38k|        break;
 1066|  2.38k|      }
 1067|       |
 1068|  6.99k|      case s_req_method:
  ------------------
  |  Branch (1068:7): [True: 6.99k, False: 131k]
  ------------------
 1069|  6.99k|      {
 1070|  6.99k|        const char *matcher;
 1071|  6.99k|        if (ch == '\0') {
  ------------------
  |  Branch (1071:13): [True: 3, False: 6.99k]
  ------------------
 1072|      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]
  |  |  ------------------
  ------------------
 1073|      3|          goto error;
 1074|      3|        }
 1075|       |
 1076|  6.99k|        matcher = method_strings[parser->method];
 1077|  6.99k|        if (ch == ' ' && matcher[parser->index] == '\0') {
  ------------------
  |  Branch (1077:13): [True: 2.22k, False: 4.77k]
  |  Branch (1077:26): [True: 2.21k, False: 8]
  ------------------
 1078|  2.21k|          parser->state = s_req_spaces_before_url;
 1079|  4.77k|        } else if (ch == matcher[parser->index]) {
  ------------------
  |  Branch (1079:20): [True: 4.56k, False: 212]
  ------------------
 1080|  4.56k|          ; /* nada */
 1081|  4.56k|        } else if (parser->method == HTTP_CONNECT) {
  ------------------
  |  Branch (1081:20): [True: 24, False: 188]
  ------------------
 1082|     24|          if (parser->index == 1 && ch == 'H') {
  ------------------
  |  Branch (1082:15): [True: 3, False: 21]
  |  Branch (1082:37): [True: 1, False: 2]
  ------------------
 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|    188|        } else if (parser->method == HTTP_MKCOL) {
  ------------------
  |  Branch (1090:20): [True: 49, False: 139]
  ------------------
 1091|     49|          if (parser->index == 1 && ch == 'O') {
  ------------------
  |  Branch (1091:15): [True: 26, False: 23]
  |  Branch (1091:37): [True: 2, False: 24]
  ------------------
 1092|      2|            parser->method = HTTP_MOVE;
 1093|     47|          } else if (parser->index == 1 && ch == 'E') {
  ------------------
  |  Branch (1093:22): [True: 24, False: 23]
  |  Branch (1093:44): [True: 2, False: 22]
  ------------------
 1094|      2|            parser->method = HTTP_MERGE;
 1095|     45|          } else if (parser->index == 1 && ch == '-') {
  ------------------
  |  Branch (1095:22): [True: 22, False: 23]
  |  Branch (1095:44): [True: 1, False: 21]
  ------------------
 1096|      1|            parser->method = HTTP_MSEARCH;
 1097|     44|          } else if (parser->index == 2 && ch == 'A') {
  ------------------
  |  Branch (1097:22): [True: 15, False: 29]
  |  Branch (1097:44): [True: 4, False: 11]
  ------------------
 1098|      4|            parser->method = HTTP_MKACTIVITY;
 1099|     40|          } else if (parser->index == 3 && ch == 'A') {
  ------------------
  |  Branch (1099:22): [True: 6, False: 34]
  |  Branch (1099:44): [True: 2, False: 4]
  ------------------
 1100|      2|            parser->method = HTTP_MKCALENDAR;
 1101|     38|          } else {
 1102|     38|            SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|     38|#define SET_ERRNO(e)                                                 \
  |  |   55|     38|do {                                                                 \
  |  |   56|     38|  parser->http_errno = (e);                                          \
  |  |   57|     38|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 38]
  |  |  ------------------
  ------------------
 1103|     38|            goto error;
 1104|     38|          }
 1105|    139|        } else if (parser->method == HTTP_SUBSCRIBE) {
  ------------------
  |  Branch (1105:20): [True: 14, False: 125]
  ------------------
 1106|     14|          if (parser->index == 1 && ch == 'E') {
  ------------------
  |  Branch (1106:15): [True: 12, False: 2]
  |  Branch (1106:37): [True: 1, False: 11]
  ------------------
 1107|      1|            parser->method = HTTP_SEARCH;
 1108|     13|          } else {
 1109|     13|            SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1110|     13|            goto error;
 1111|     13|          }
 1112|    125|        } else if (parser->index == 1 && parser->method == HTTP_POST) {
  ------------------
  |  Branch (1112:20): [True: 70, False: 55]
  |  Branch (1112:42): [True: 62, False: 8]
  ------------------
 1113|     62|          if (ch == 'R') {
  ------------------
  |  Branch (1113:15): [True: 4, False: 58]
  ------------------
 1114|      4|            parser->method = HTTP_PROPFIND; /* or HTTP_PROPPATCH */
 1115|     58|          } else if (ch == 'U') {
  ------------------
  |  Branch (1115:22): [True: 36, False: 22]
  ------------------
 1116|     36|            parser->method = HTTP_PUT; /* or HTTP_PURGE */
 1117|     36|          } else if (ch == 'A') {
  ------------------
  |  Branch (1117:22): [True: 1, False: 21]
  ------------------
 1118|      1|            parser->method = HTTP_PATCH;
 1119|     21|          } else {
 1120|     21|            SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|     21|#define SET_ERRNO(e)                                                 \
  |  |   55|     21|do {                                                                 \
  |  |   56|     21|  parser->http_errno = (e);                                          \
  |  |   57|     21|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 21]
  |  |  ------------------
  ------------------
 1121|     21|            goto error;
 1122|     21|          }
 1123|     63|        } else if (parser->index == 2) {
  ------------------
  |  Branch (1123:20): [True: 36, False: 27]
  ------------------
 1124|     36|          if (parser->method == HTTP_PUT) {
  ------------------
  |  Branch (1124:15): [True: 16, False: 20]
  ------------------
 1125|     16|            if (ch == 'R') {
  ------------------
  |  Branch (1125:17): [True: 2, False: 14]
  ------------------
 1126|      2|              parser->method = HTTP_PURGE;
 1127|     14|            } else {
 1128|     14|              SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1129|     14|              goto error;
 1130|     14|            }
 1131|     20|          } else if (parser->method == HTTP_UNLOCK) {
  ------------------
  |  Branch (1131:22): [True: 7, False: 13]
  ------------------
 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|     13|          } else {
 1139|     13|            SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1140|     13|            goto error;
 1141|     13|          }
 1142|     36|        } else if (parser->index == 4 && parser->method == HTTP_PROPFIND && ch == 'P') {
  ------------------
  |  Branch (1142:20): [True: 11, False: 16]
  |  Branch (1142:42): [True: 3, False: 8]
  |  Branch (1142:77): [True: 1, False: 2]
  ------------------
 1143|      1|          parser->method = HTTP_PROPPATCH;
 1144|     26|        } else {
 1145|     26|          SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|     26|#define SET_ERRNO(e)                                                 \
  |  |   55|     26|do {                                                                 \
  |  |   56|     26|  parser->http_errno = (e);                                          \
  |  |   57|     26|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 26]
  |  |  ------------------
  ------------------
 1146|     26|          goto error;
 1147|     26|        }
 1148|       |
 1149|  6.84k|        ++parser->index;
 1150|  6.84k|        break;
 1151|  6.99k|      }
 1152|       |
 1153|  2.40k|      case s_req_spaces_before_url:
  ------------------
  |  Branch (1153:7): [True: 2.40k, False: 135k]
  ------------------
 1154|  2.40k|      {
 1155|  2.40k|        if (ch == ' ') break;
  ------------------
  |  Branch (1155:13): [True: 201, False: 2.20k]
  ------------------
 1156|       |
 1157|  2.20k|        MARK(url);
  ------------------
  |  |  112|  2.20k|#define MARK(FOR)                                                    \
  |  |  113|  2.20k|do {                                                                 \
  |  |  114|  2.20k|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 2.20k, False: 0]
  |  |  ------------------
  |  |  115|  2.20k|    FOR##_mark = p;                                                  \
  |  |  116|  2.20k|  }                                                                  \
  |  |  117|  2.20k|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 2.20k]
  |  |  ------------------
  ------------------
 1158|  2.20k|        if (parser->method == HTTP_CONNECT) {
  ------------------
  |  Branch (1158:13): [True: 4, False: 2.20k]
  ------------------
 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.20k|        enum state new_state = parse_url_char((enum state)parser->state, ch);
 1168|  2.20k|        if (new_state == s_dead) {
  ------------------
  |  Branch (1168:13): [True: 2, False: 2.20k]
  ------------------
 1169|      2|          SET_ERRNO(HPE_INVALID_URL);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1170|      2|          goto error;
 1171|      2|        }
 1172|  2.20k|        parser->state = new_state;
 1173|       |
 1174|  2.20k|        break;
 1175|  2.20k|      }
 1176|       |
 1177|    497|      case s_req_scheme:
  ------------------
  |  Branch (1177:7): [True: 497, False: 137k]
  ------------------
 1178|    792|      case s_req_scheme_slash:
  ------------------
  |  Branch (1178:7): [True: 295, False: 137k]
  ------------------
 1179|  1.08k|      case s_req_scheme_slash_slash:
  ------------------
  |  Branch (1179:7): [True: 292, False: 137k]
  ------------------
 1180|  1.37k|      case s_req_server_start:
  ------------------
  |  Branch (1180:7): [True: 289, False: 137k]
  ------------------
 1181|  1.37k|      {
 1182|  1.37k|        enum state new_state;
 1183|  1.37k|        switch (ch) {
 1184|       |          /* No whitespace allowed here */
 1185|      3|          case ' ':
  ------------------
  |  Branch (1185:11): [True: 3, False: 1.37k]
  ------------------
 1186|      5|          case CR:
  ------------------
  |  |  474|      5|#define CR                  '\r'
  ------------------
  |  Branch (1186:11): [True: 2, False: 1.37k]
  ------------------
 1187|      6|          case LF:
  ------------------
  |  |  475|      6|#define LF                  '\n'
  ------------------
  |  Branch (1187:11): [True: 1, False: 1.37k]
  ------------------
 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|  1.36k|          default:
  ------------------
  |  Branch (1190:11): [True: 1.36k, False: 6]
  ------------------
 1191|  1.36k|            new_state = parse_url_char((enum state)parser->state, ch);
 1192|  1.36k|            if (new_state == s_dead) {
  ------------------
  |  Branch (1192:17): [True: 7, False: 1.36k]
  ------------------
 1193|      7|              SET_ERRNO(HPE_INVALID_URL);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1194|      7|              goto error;
 1195|      7|            }
 1196|  1.36k|            parser->state = new_state;
 1197|  1.37k|        }
 1198|       |
 1199|  1.36k|        break;
 1200|  1.37k|      }
 1201|       |
 1202|  1.36k|      case s_req_server:
  ------------------
  |  Branch (1202:7): [True: 507, False: 137k]
  ------------------
 1203|    715|      case s_req_server_with_at:
  ------------------
  |  Branch (1203:7): [True: 208, False: 138k]
  ------------------
 1204|  3.51k|      case s_req_path:
  ------------------
  |  Branch (1204:7): [True: 2.79k, False: 135k]
  ------------------
 1205|  3.69k|      case s_req_query_string_start:
  ------------------
  |  Branch (1205:7): [True: 179, False: 138k]
  ------------------
 1206|  3.98k|      case s_req_query_string:
  ------------------
  |  Branch (1206:7): [True: 292, False: 137k]
  ------------------
 1207|  4.52k|      case s_req_fragment_start:
  ------------------
  |  Branch (1207:7): [True: 538, False: 137k]
  ------------------
 1208|  5.14k|      case s_req_fragment:
  ------------------
  |  Branch (1208:7): [True: 625, False: 137k]
  ------------------
 1209|  5.14k|      {
 1210|  5.14k|        enum state new_state;
 1211|  5.14k|        switch (ch) {
 1212|      9|          case CR:
  ------------------
  |  |  474|      9|#define CR                  '\r'
  ------------------
  |  Branch (1212:11): [True: 9, False: 5.13k]
  ------------------
 1213|    504|          case LF:
  ------------------
  |  |  475|    504|#define LF                  '\n'
  ------------------
  |  Branch (1213:11): [True: 495, False: 4.65k]
  ------------------
 1214|    504|            parser->http_major = 0;
 1215|    504|            parser->http_minor = 9;
 1216|    504|            parser->state = (ch == CR) ?
  ------------------
  |  |  474|    504|#define CR                  '\r'
  ------------------
  |  Branch (1216:29): [True: 9, False: 495]
  ------------------
 1217|      9|              s_req_line_almost_done :
 1218|    504|              s_header_field_start;
 1219|    504|            CALLBACK_DATA(url);
  ------------------
  |  |  105|    504|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|    504|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    504|do {                                                                 \
  |  |  |  |   86|    504|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    504|                                                                     \
  |  |  |  |   88|    504|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 504, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|    504|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 504, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|    504|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 504]
  |  |  |  |  ------------------
  |  |  |  |   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|    504|                                                                     \
  |  |  |  |   94|    504|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|    504|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    504|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 504]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|    504|    }                                                                \
  |  |  |  |   99|    504|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    504|  }                                                                  \
  |  |  |  |  101|    504|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 504]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1219:13): [True: 504, False: 0]
  ------------------
 1220|    504|            break;
 1221|  1.57k|          case ' ':
  ------------------
  |  Branch (1221:11): [True: 1.57k, False: 3.57k]
  ------------------
 1222|  1.57k|            parser->state = s_req_http_start;
 1223|  1.57k|            CALLBACK_DATA(url);
  ------------------
  |  |  105|  1.57k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|  1.57k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  1.57k|do {                                                                 \
  |  |  |  |   86|  1.57k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  1.57k|                                                                     \
  |  |  |  |   88|  1.57k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 1.57k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|  1.57k|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 1.57k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|  1.57k|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 1.57k]
  |  |  |  |  ------------------
  |  |  |  |   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.57k|                                                                     \
  |  |  |  |   94|  1.57k|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|  1.57k|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.57k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 1.57k]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|  1.57k|    }                                                                \
  |  |  |  |   99|  1.57k|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|  1.57k|  }                                                                  \
  |  |  |  |  101|  1.57k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 1.57k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1223:13): [True: 1.57k, False: 0]
  ------------------
 1224|  1.57k|            break;
 1225|  3.06k|          default:
  ------------------
  |  Branch (1225:11): [True: 3.06k, False: 2.07k]
  ------------------
 1226|  3.06k|            new_state = parse_url_char((enum state)parser->state, ch);
 1227|  3.06k|            if (new_state == s_dead) {
  ------------------
  |  Branch (1227:17): [True: 13, False: 3.05k]
  ------------------
 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|  3.05k|            parser->state = new_state;
 1232|  5.14k|        }
 1233|  5.13k|        break;
 1234|  5.14k|      }
 1235|       |
 1236|  5.13k|      case s_req_http_start:
  ------------------
  |  Branch (1236:7): [True: 1.75k, False: 136k]
  ------------------
 1237|  1.75k|        switch (ch) {
 1238|  1.55k|          case 'H':
  ------------------
  |  Branch (1238:11): [True: 1.55k, False: 197]
  ------------------
 1239|  1.55k|            parser->state = s_req_http_H;
 1240|  1.55k|            break;
 1241|    195|          case ' ':
  ------------------
  |  Branch (1241:11): [True: 195, False: 1.55k]
  ------------------
 1242|    195|            break;
 1243|      2|          default:
  ------------------
  |  Branch (1243:11): [True: 2, False: 1.75k]
  ------------------
 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.75k|        }
 1247|  1.75k|        break;
 1248|       |
 1249|  1.75k|      case s_req_http_H:
  ------------------
  |  Branch (1249:7): [True: 1.55k, False: 136k]
  ------------------
 1250|  1.55k|        STRICT_CHECK(ch != 'T');
  ------------------
  |  |  513|  1.55k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  1.55k|do {                                                                 \
  |  |  515|  1.55k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 10, False: 1.54k]
  |  |  ------------------
  |  |  516|     10|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|     10|    goto error;                                                      \
  |  |  518|     10|  }                                                                  \
  |  |  519|  1.55k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 1.54k]
  |  |  ------------------
  ------------------
 1251|  1.54k|        parser->state = s_req_http_HT;
 1252|  1.54k|        break;
 1253|       |
 1254|  1.54k|      case s_req_http_HT:
  ------------------
  |  Branch (1254:7): [True: 1.54k, False: 136k]
  ------------------
 1255|  1.54k|        STRICT_CHECK(ch != 'T');
  ------------------
  |  |  513|  1.54k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  1.54k|do {                                                                 \
  |  |  515|  1.54k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 8, False: 1.53k]
  |  |  ------------------
  |  |  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.54k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 1.53k]
  |  |  ------------------
  ------------------
 1256|  1.53k|        parser->state = s_req_http_HTT;
 1257|  1.53k|        break;
 1258|       |
 1259|  1.53k|      case s_req_http_HTT:
  ------------------
  |  Branch (1259:7): [True: 1.53k, False: 136k]
  ------------------
 1260|  1.53k|        STRICT_CHECK(ch != 'P');
  ------------------
  |  |  513|  1.53k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  1.53k|do {                                                                 \
  |  |  515|  1.53k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 12, False: 1.52k]
  |  |  ------------------
  |  |  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.53k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 1.52k]
  |  |  ------------------
  ------------------
 1261|  1.52k|        parser->state = s_req_http_HTTP;
 1262|  1.52k|        break;
 1263|       |
 1264|  1.52k|      case s_req_http_HTTP:
  ------------------
  |  Branch (1264:7): [True: 1.52k, False: 136k]
  ------------------
 1265|  1.52k|        STRICT_CHECK(ch != '/');
  ------------------
  |  |  513|  1.52k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  1.52k|do {                                                                 \
  |  |  515|  1.52k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 10, False: 1.51k]
  |  |  ------------------
  |  |  516|     10|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|     10|    goto error;                                                      \
  |  |  518|     10|  }                                                                  \
  |  |  519|  1.52k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 1.51k]
  |  |  ------------------
  ------------------
 1266|  1.51k|        parser->state = s_req_first_http_major;
 1267|  1.51k|        break;
 1268|       |
 1269|       |      /* first digit of major HTTP version */
 1270|  1.50k|      case s_req_first_http_major:
  ------------------
  |  Branch (1270:7): [True: 1.50k, False: 136k]
  ------------------
 1271|  1.50k|        if (ch < '1' || ch > '9') {
  ------------------
  |  Branch (1271:13): [True: 8, False: 1.50k]
  |  Branch (1271:25): [True: 5, False: 1.49k]
  ------------------
 1272|     13|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1273|     13|          goto error;
 1274|     13|        }
 1275|       |
 1276|  1.49k|        parser->http_major = ch - '0';
 1277|  1.49k|        parser->state = s_req_http_major;
 1278|  1.49k|        break;
 1279|       |
 1280|       |      /* major HTTP version or dot */
 1281|  1.98k|      case s_req_http_major:
  ------------------
  |  Branch (1281:7): [True: 1.98k, False: 136k]
  ------------------
 1282|  1.98k|      {
 1283|  1.98k|        if (ch == '.') {
  ------------------
  |  Branch (1283:13): [True: 1.45k, False: 535]
  ------------------
 1284|  1.45k|          parser->state = s_req_first_http_minor;
 1285|  1.45k|          break;
 1286|  1.45k|        }
 1287|       |
 1288|    535|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|    535|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 527, False: 8]
  |  |  |  Branch (478:44): [True: 521, False: 6]
  |  |  ------------------
  ------------------
 1289|     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]
  |  |  ------------------
  ------------------
 1290|     14|          goto error;
 1291|     14|        }
 1292|       |
 1293|    521|        parser->http_major *= 10;
 1294|    521|        parser->http_major += ch - '0';
 1295|       |
 1296|    521|        if (parser->http_major > 999) {
  ------------------
  |  Branch (1296:13): [True: 3, False: 518]
  ------------------
 1297|      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]
  |  |  ------------------
  ------------------
 1298|      3|          goto error;
 1299|      3|        }
 1300|       |
 1301|    518|        break;
 1302|    521|      }
 1303|       |
 1304|       |      /* first digit of minor HTTP version */
 1305|  1.44k|      case s_req_first_http_minor:
  ------------------
  |  Branch (1305:7): [True: 1.44k, False: 136k]
  ------------------
 1306|  1.44k|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|  1.44k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 1.44k, False: 2]
  |  |  |  Branch (478:44): [True: 1.44k, 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.44k|        parser->http_minor = ch - '0';
 1312|  1.44k|        parser->state = s_req_http_minor;
 1313|  1.44k|        break;
 1314|       |
 1315|       |      /* minor HTTP version or end of request line */
 1316|  1.65k|      case s_req_http_minor:
  ------------------
  |  Branch (1316:7): [True: 1.65k, False: 136k]
  ------------------
 1317|  1.65k|      {
 1318|  1.65k|        if (ch == CR) {
  ------------------
  |  |  474|  1.65k|#define CR                  '\r'
  ------------------
  |  Branch (1318:13): [True: 315, False: 1.34k]
  ------------------
 1319|    315|          parser->state = s_req_line_almost_done;
 1320|    315|          break;
 1321|    315|        }
 1322|       |
 1323|  1.34k|        if (ch == LF) {
  ------------------
  |  |  475|  1.34k|#define LF                  '\n'
  ------------------
  |  Branch (1323:13): [True: 1.09k, False: 252]
  ------------------
 1324|  1.09k|          parser->state = s_header_field_start;
 1325|  1.09k|          break;
 1326|  1.09k|        }
 1327|       |
 1328|       |        /* XXX allow spaces after digit? */
 1329|       |
 1330|    252|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|    252|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 240, False: 12]
  |  |  |  Branch (478:44): [True: 235, False: 5]
  |  |  ------------------
  ------------------
 1331|     17|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|     17|#define SET_ERRNO(e)                                                 \
  |  |   55|     17|do {                                                                 \
  |  |   56|     17|  parser->http_errno = (e);                                          \
  |  |   57|     17|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 17]
  |  |  ------------------
  ------------------
 1332|     17|          goto error;
 1333|     17|        }
 1334|       |
 1335|    235|        parser->http_minor *= 10;
 1336|    235|        parser->http_minor += ch - '0';
 1337|       |
 1338|    235|        if (parser->http_minor > 999) {
  ------------------
  |  Branch (1338:13): [True: 3, False: 232]
  ------------------
 1339|      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]
  |  |  ------------------
  ------------------
 1340|      3|          goto error;
 1341|      3|        }
 1342|       |
 1343|    232|        break;
 1344|    235|      }
 1345|       |
 1346|       |      /* end of request line */
 1347|    317|      case s_req_line_almost_done:
  ------------------
  |  Branch (1347:7): [True: 317, False: 137k]
  ------------------
 1348|    317|      {
 1349|    317|        if (ch != LF) {
  ------------------
  |  |  475|    317|#define LF                  '\n'
  ------------------
  |  Branch (1349:13): [True: 1, False: 316]
  ------------------
 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|    316|        parser->state = s_header_field_start;
 1355|    316|        break;
 1356|    317|      }
 1357|       |
 1358|  8.91k|      case s_header_field_start:
  ------------------
  |  Branch (1358:7): [True: 8.91k, False: 129k]
  ------------------
 1359|  8.91k|      {
 1360|  8.91k|        if (ch == CR) {
  ------------------
  |  |  474|  8.91k|#define CR                  '\r'
  ------------------
  |  Branch (1360:13): [True: 214, False: 8.70k]
  ------------------
 1361|    214|          parser->state = s_headers_almost_done;
 1362|    214|          break;
 1363|    214|        }
 1364|       |
 1365|  8.70k|        if (ch == LF) {
  ------------------
  |  |  475|  8.70k|#define LF                  '\n'
  ------------------
  |  Branch (1365:13): [True: 2.93k, False: 5.76k]
  ------------------
 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.93k|          parser->state = s_headers_almost_done;
 1369|  2.93k|          goto reexecute_byte;
 1370|  2.93k|        }
 1371|       |
 1372|  5.76k|        c = TOKEN(ch);
  ------------------
  |  |  491|  5.76k|#define TOKEN(c)            ((c == ' ') ? ' ' : tokens[(unsigned char)c])
  |  |  ------------------
  |  |  |  Branch (491:30): [True: 223, False: 5.54k]
  |  |  ------------------
  ------------------
 1373|       |
 1374|  5.76k|        if (!c) {
  ------------------
  |  Branch (1374:13): [True: 8, False: 5.75k]
  ------------------
 1375|      8|          SET_ERRNO(HPE_INVALID_HEADER_TOKEN);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1376|      8|          goto error;
 1377|      8|        }
 1378|       |
 1379|  5.75k|        MARK(header_field);
  ------------------
  |  |  112|  5.75k|#define MARK(FOR)                                                    \
  |  |  113|  5.75k|do {                                                                 \
  |  |  114|  5.75k|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 5.75k, False: 0]
  |  |  ------------------
  |  |  115|  5.75k|    FOR##_mark = p;                                                  \
  |  |  116|  5.75k|  }                                                                  \
  |  |  117|  5.75k|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 5.75k]
  |  |  ------------------
  ------------------
 1380|       |
 1381|  5.75k|        parser->index = 0;
 1382|  5.75k|        parser->state = s_header_field;
 1383|       |
 1384|  5.75k|        switch (c) {
 1385|  2.94k|          case 'c':
  ------------------
  |  Branch (1385:11): [True: 2.94k, False: 2.81k]
  ------------------
 1386|  2.94k|            parser->header_state = h_C;
 1387|  2.94k|            break;
 1388|       |
 1389|    760|          case 'p':
  ------------------
  |  Branch (1389:11): [True: 760, False: 4.99k]
  ------------------
 1390|    760|            parser->header_state = h_matching_proxy_connection;
 1391|    760|            break;
 1392|       |
 1393|    507|          case 't':
  ------------------
  |  Branch (1393:11): [True: 507, False: 5.25k]
  ------------------
 1394|    507|            parser->header_state = h_matching_transfer_encoding;
 1395|    507|            break;
 1396|       |
 1397|    608|          case 'u':
  ------------------
  |  Branch (1397:11): [True: 608, False: 5.15k]
  ------------------
 1398|    608|            parser->header_state = h_matching_upgrade;
 1399|    608|            break;
 1400|       |
 1401|    941|          default:
  ------------------
  |  Branch (1401:11): [True: 941, False: 4.81k]
  ------------------
 1402|    941|            parser->header_state = h_general;
 1403|    941|            break;
 1404|  5.75k|        }
 1405|  5.75k|        break;
 1406|  5.75k|      }
 1407|       |
 1408|  32.4k|      case s_header_field:
  ------------------
  |  Branch (1408:7): [True: 32.4k, False: 105k]
  ------------------
 1409|  32.4k|      {
 1410|  32.4k|        c = TOKEN(ch);
  ------------------
  |  |  491|  32.4k|#define TOKEN(c)            ((c == ' ') ? ' ' : tokens[(unsigned char)c])
  |  |  ------------------
  |  |  |  Branch (491:30): [True: 881, False: 31.6k]
  |  |  ------------------
  ------------------
 1411|       |
 1412|  32.4k|        if (c) {
  ------------------
  |  Branch (1412:13): [True: 26.9k, False: 5.50k]
  ------------------
 1413|  26.9k|          switch (parser->header_state) {
 1414|  3.20k|            case h_general:
  ------------------
  |  Branch (1414:13): [True: 3.20k, False: 23.7k]
  ------------------
 1415|  3.20k|              break;
 1416|       |
 1417|  2.92k|            case h_C:
  ------------------
  |  Branch (1417:13): [True: 2.92k, False: 24.0k]
  ------------------
 1418|  2.92k|              parser->index++;
 1419|  2.92k|              parser->header_state = (c == 'o' ? h_CO : h_general);
  ------------------
  |  Branch (1419:39): [True: 2.82k, False: 92]
  ------------------
 1420|  2.92k|              break;
 1421|       |
 1422|  2.80k|            case h_CO:
  ------------------
  |  Branch (1422:13): [True: 2.80k, False: 24.1k]
  ------------------
 1423|  2.80k|              parser->index++;
 1424|  2.80k|              parser->header_state = (c == 'n' ? h_CON : h_general);
  ------------------
  |  Branch (1424:39): [True: 2.77k, False: 30]
  ------------------
 1425|  2.80k|              break;
 1426|       |
 1427|  2.76k|            case h_CON:
  ------------------
  |  Branch (1427:13): [True: 2.76k, False: 24.2k]
  ------------------
 1428|  2.76k|              parser->index++;
 1429|  2.76k|              switch (c) {
 1430|  1.96k|                case 'n':
  ------------------
  |  Branch (1430:17): [True: 1.96k, False: 802]
  ------------------
 1431|  1.96k|                  parser->header_state = h_matching_connection;
 1432|  1.96k|                  break;
 1433|    602|                case 't':
  ------------------
  |  Branch (1433:17): [True: 602, False: 2.16k]
  ------------------
 1434|    602|                  parser->header_state = h_matching_content_length;
 1435|    602|                  break;
 1436|    200|                default:
  ------------------
  |  Branch (1436:17): [True: 200, False: 2.56k]
  ------------------
 1437|    200|                  parser->header_state = h_general;
 1438|    200|                  break;
 1439|  2.76k|              }
 1440|  2.76k|              break;
 1441|       |
 1442|       |            /* connection */
 1443|       |
 1444|  9.79k|            case h_matching_connection:
  ------------------
  |  Branch (1444:13): [True: 9.79k, False: 17.1k]
  ------------------
 1445|  9.79k|              parser->index++;
 1446|  9.79k|              if (parser->index > sizeof(CONNECTION)-1
  ------------------
  |  |  121|  9.79k|#define CONNECTION "connection"
  ------------------
  |  Branch (1446:19): [True: 0, False: 9.79k]
  ------------------
 1447|  9.79k|                  || c != CONNECTION[parser->index]) {
  ------------------
  |  |  121|  9.79k|#define CONNECTION "connection"
  ------------------
  |  Branch (1447:22): [True: 336, False: 9.45k]
  ------------------
 1448|    336|                parser->header_state = h_general;
 1449|  9.45k|              } else if (parser->index == sizeof(CONNECTION)-2) {
  ------------------
  |  |  121|  9.45k|#define CONNECTION "connection"
  ------------------
  |  Branch (1449:26): [True: 1.54k, False: 7.90k]
  ------------------
 1450|  1.54k|                parser->header_state = h_connection;
 1451|  1.54k|              }
 1452|  9.79k|              break;
 1453|       |
 1454|       |            /* proxy-connection */
 1455|       |
 1456|  3.33k|            case h_matching_proxy_connection:
  ------------------
  |  Branch (1456:13): [True: 3.33k, False: 23.6k]
  ------------------
 1457|  3.33k|              parser->index++;
 1458|  3.33k|              if (parser->index > sizeof(PROXY_CONNECTION)-1
  ------------------
  |  |  120|  3.33k|#define PROXY_CONNECTION "proxy-connection"
  ------------------
  |  Branch (1458:19): [True: 0, False: 3.33k]
  ------------------
 1459|  3.33k|                  || c != PROXY_CONNECTION[parser->index]) {
  ------------------
  |  |  120|  3.33k|#define PROXY_CONNECTION "proxy-connection"
  ------------------
  |  Branch (1459:22): [True: 322, False: 3.01k]
  ------------------
 1460|    322|                parser->header_state = h_general;
 1461|  3.01k|              } else if (parser->index == sizeof(PROXY_CONNECTION)-2) {
  ------------------
  |  |  120|  3.01k|#define PROXY_CONNECTION "proxy-connection"
  ------------------
  |  Branch (1461:26): [True: 194, False: 2.82k]
  ------------------
 1462|    194|                parser->header_state = h_connection;
 1463|    194|              }
 1464|  3.33k|              break;
 1465|       |
 1466|       |            /* content-length */
 1467|       |
 1468|    626|            case h_matching_content_length:
  ------------------
  |  Branch (1468:13): [True: 626, False: 26.3k]
  ------------------
 1469|    626|              parser->index++;
 1470|    626|              if (parser->index > sizeof(CONTENT_LENGTH)-1
  ------------------
  |  |  122|    626|#define CONTENT_LENGTH "content-length"
  ------------------
  |  Branch (1470:19): [True: 0, False: 626]
  ------------------
 1471|    626|                  || c != CONTENT_LENGTH[parser->index]) {
  ------------------
  |  |  122|    626|#define CONTENT_LENGTH "content-length"
  ------------------
  |  Branch (1471:22): [True: 384, False: 242]
  ------------------
 1472|    384|                parser->header_state = h_general;
 1473|    384|              } else if (parser->index == sizeof(CONTENT_LENGTH)-2) {
  ------------------
  |  |  122|    242|#define CONTENT_LENGTH "content-length"
  ------------------
  |  Branch (1473:26): [True: 0, False: 242]
  ------------------
 1474|      0|                parser->header_state = h_content_length;
 1475|      0|              }
 1476|    626|              break;
 1477|       |
 1478|       |            /* transfer-encoding */
 1479|       |
 1480|    425|            case h_matching_transfer_encoding:
  ------------------
  |  Branch (1480:13): [True: 425, False: 26.5k]
  ------------------
 1481|    425|              parser->index++;
 1482|    425|              if (parser->index > sizeof(TRANSFER_ENCODING)-1
  ------------------
  |  |  123|    425|#define TRANSFER_ENCODING "transfer-encoding"
  ------------------
  |  Branch (1482:19): [True: 0, False: 425]
  ------------------
 1483|    425|                  || c != TRANSFER_ENCODING[parser->index]) {
  ------------------
  |  |  123|    425|#define TRANSFER_ENCODING "transfer-encoding"
  ------------------
  |  Branch (1483:22): [True: 229, False: 196]
  ------------------
 1484|    229|                parser->header_state = h_general;
 1485|    229|              } else if (parser->index == sizeof(TRANSFER_ENCODING)-2) {
  ------------------
  |  |  123|    196|#define TRANSFER_ENCODING "transfer-encoding"
  ------------------
  |  Branch (1485:26): [True: 0, False: 196]
  ------------------
 1486|      0|                parser->header_state = h_transfer_encoding;
 1487|      0|                parser->uses_transfer_encoding = 1;
 1488|      0|              }
 1489|    425|              break;
 1490|       |
 1491|       |            /* upgrade */
 1492|       |
 1493|    471|            case h_matching_upgrade:
  ------------------
  |  Branch (1493:13): [True: 471, False: 26.5k]
  ------------------
 1494|    471|              parser->index++;
 1495|    471|              if (parser->index > sizeof(UPGRADE)-1
  ------------------
  |  |  124|    471|#define UPGRADE "upgrade"
  ------------------
  |  Branch (1495:19): [True: 0, False: 471]
  ------------------
 1496|    471|                  || c != UPGRADE[parser->index]) {
  ------------------
  |  |  124|    471|#define UPGRADE "upgrade"
  ------------------
  |  Branch (1496:22): [True: 262, False: 209]
  ------------------
 1497|    262|                parser->header_state = h_general;
 1498|    262|              } else if (parser->index == sizeof(UPGRADE)-2) {
  ------------------
  |  |  124|    209|#define UPGRADE "upgrade"
  ------------------
  |  Branch (1498:26): [True: 0, False: 209]
  ------------------
 1499|      0|                parser->header_state = h_upgrade;
 1500|      0|              }
 1501|    471|              break;
 1502|       |
 1503|    634|            case h_connection:
  ------------------
  |  Branch (1503:13): [True: 634, False: 26.3k]
  ------------------
 1504|    634|            case h_content_length:
  ------------------
  |  Branch (1504:13): [True: 0, False: 26.9k]
  ------------------
 1505|    634|            case h_transfer_encoding:
  ------------------
  |  Branch (1505:13): [True: 0, False: 26.9k]
  ------------------
 1506|    634|            case h_upgrade:
  ------------------
  |  Branch (1506:13): [True: 0, False: 26.9k]
  ------------------
 1507|    634|              if (ch != ' ') parser->header_state = h_general;
  ------------------
  |  Branch (1507:19): [True: 212, False: 422]
  ------------------
 1508|    634|              break;
 1509|       |
 1510|      0|            default:
  ------------------
  |  Branch (1510:13): [True: 0, False: 26.9k]
  ------------------
 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|  26.9k|          }
 1514|  26.9k|          break;
 1515|  26.9k|        }
 1516|       |
 1517|  5.50k|        if (ch == ':') {
  ------------------
  |  Branch (1517:13): [True: 5.49k, False: 11]
  ------------------
 1518|  5.49k|          parser->state = s_header_value_discard_ws;
 1519|  5.49k|          CALLBACK_DATA(header_field);
  ------------------
  |  |  105|  5.49k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|  5.49k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  5.49k|do {                                                                 \
  |  |  |  |   86|  5.49k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  5.49k|                                                                     \
  |  |  |  |   88|  5.49k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 5.49k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|  5.49k|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 5.49k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|  5.49k|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 5.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|  5.49k|                                                                     \
  |  |  |  |   94|  5.49k|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|  5.49k|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  5.49k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 5.49k]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|  5.49k|    }                                                                \
  |  |  |  |   99|  5.49k|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|  5.49k|  }                                                                  \
  |  |  |  |  101|  5.49k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 5.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1519:11): [True: 5.49k, False: 0]
  ------------------
 1520|  5.49k|          break;
 1521|  5.49k|        }
 1522|       |
 1523|     11|        SET_ERRNO(HPE_INVALID_HEADER_TOKEN);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1524|     11|        goto error;
 1525|  5.50k|      }
 1526|       |
 1527|  6.28k|      case s_header_value_discard_ws:
  ------------------
  |  Branch (1527:7): [True: 6.28k, False: 131k]
  ------------------
 1528|  6.28k|        if (ch == ' ' || ch == '\t') break;
  ------------------
  |  Branch (1528:13): [True: 220, False: 6.06k]
  |  Branch (1528:26): [True: 195, False: 5.86k]
  ------------------
 1529|       |
 1530|  5.86k|        if (ch == CR) {
  ------------------
  |  |  474|  5.86k|#define CR                  '\r'
  ------------------
  |  Branch (1530:13): [True: 202, False: 5.66k]
  ------------------
 1531|    202|          parser->state = s_header_value_discard_ws_almost_done;
 1532|    202|          break;
 1533|    202|        }
 1534|       |
 1535|  5.66k|        if (ch == LF) {
  ------------------
  |  |  475|  5.66k|#define LF                  '\n'
  ------------------
  |  Branch (1535:13): [True: 3.02k, False: 2.64k]
  ------------------
 1536|  3.02k|          parser->state = s_header_value_discard_lws;
 1537|  3.02k|          break;
 1538|  3.02k|        }
 1539|       |
 1540|       |        /* FALLTHROUGH */
 1541|       |
 1542|  3.24k|      case s_header_value_start:
  ------------------
  |  Branch (1542:7): [True: 602, False: 137k]
  ------------------
 1543|  3.24k|      {
 1544|  3.24k|        MARK(header_value);
  ------------------
  |  |  112|  3.24k|#define MARK(FOR)                                                    \
  |  |  113|  3.24k|do {                                                                 \
  |  |  114|  3.24k|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 3.24k, False: 0]
  |  |  ------------------
  |  |  115|  3.24k|    FOR##_mark = p;                                                  \
  |  |  116|  3.24k|  }                                                                  \
  |  |  117|  3.24k|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 3.24k]
  |  |  ------------------
  ------------------
 1545|       |
 1546|  3.24k|        parser->state = s_header_value;
 1547|  3.24k|        parser->index = 0;
 1548|       |
 1549|  3.24k|        c = LOWER(ch);
  ------------------
  |  |  476|  3.24k|#define LOWER(c)            (unsigned char)(c | 0x20)
  ------------------
 1550|       |
 1551|  3.24k|        switch (parser->header_state) {
 1552|      0|          case h_upgrade:
  ------------------
  |  Branch (1552:11): [True: 0, False: 3.24k]
  ------------------
 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.24k]
  ------------------
 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.24k]
  ------------------
 1568|      0|            break;
 1569|       |
 1570|      0|          case h_content_length:
  ------------------
  |  Branch (1570:11): [True: 0, False: 3.24k]
  ------------------
 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.49k|          case h_connection:
  ------------------
  |  Branch (1585:11): [True: 1.49k, False: 1.75k]
  ------------------
 1586|       |            /* looking for 'Connection: keep-alive' */
 1587|  1.49k|            if (c == 'k') {
  ------------------
  |  Branch (1587:17): [True: 252, False: 1.24k]
  ------------------
 1588|    252|              parser->header_state = h_matching_connection_keep_alive;
 1589|       |            /* looking for 'Connection: close' */
 1590|  1.24k|            } else if (c == 'c') {
  ------------------
  |  Branch (1590:24): [True: 875, False: 365]
  ------------------
 1591|    875|              parser->header_state = h_matching_connection_close;
 1592|    875|            } else {
 1593|    365|              parser->header_state = h_general;
 1594|    365|            }
 1595|  1.49k|            break;
 1596|       |
 1597|  1.75k|          default:
  ------------------
  |  Branch (1597:11): [True: 1.75k, False: 1.49k]
  ------------------
 1598|  1.75k|            parser->header_state = h_general;
 1599|  1.75k|            break;
 1600|  3.24k|        }
 1601|  3.24k|        break;
 1602|  3.24k|      }
 1603|       |
 1604|  10.6k|      case s_header_value:
  ------------------
  |  Branch (1604:7): [True: 10.6k, False: 127k]
  ------------------
 1605|  10.6k|      {
 1606|       |
 1607|  10.6k|        if (ch == CR) {
  ------------------
  |  |  474|  10.6k|#define CR                  '\r'
  ------------------
  |  Branch (1607:13): [True: 197, False: 10.4k]
  ------------------
 1608|    197|          parser->state = s_header_almost_done;
 1609|    197|          CALLBACK_DATA(header_value);
  ------------------
  |  |  105|    197|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|    197|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    197|do {                                                                 \
  |  |  |  |   86|    197|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    197|                                                                     \
  |  |  |  |   88|    197|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 197, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|    197|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 197, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|    197|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 197]
  |  |  |  |  ------------------
  |  |  |  |   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|    197|                                                                     \
  |  |  |  |   94|    197|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|    197|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    197|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 197]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|    197|    }                                                                \
  |  |  |  |   99|    197|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    197|  }                                                                  \
  |  |  |  |  101|    197|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 197]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1609:11): [True: 197, False: 0]
  ------------------
 1610|    197|          break;
 1611|    197|        }
 1612|       |
 1613|  10.4k|        if (ch == LF) {
  ------------------
  |  |  475|  10.4k|#define LF                  '\n'
  ------------------
  |  Branch (1613:13): [True: 2.91k, False: 7.51k]
  ------------------
 1614|  2.91k|          parser->state = s_header_almost_done;
 1615|  2.91k|          CALLBACK_DATA_NOADVANCE(header_value);
  ------------------
  |  |  109|  2.91k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|  2.91k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  2.91k|do {                                                                 \
  |  |  |  |   86|  2.91k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  2.91k|                                                                     \
  |  |  |  |   88|  2.91k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 2.91k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|  2.91k|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 2.91k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|  2.91k|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 2.91k]
  |  |  |  |  ------------------
  |  |  |  |   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.91k|                                                                     \
  |  |  |  |   94|  2.91k|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|  2.91k|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  2.91k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 2.91k]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|  2.91k|    }                                                                \
  |  |  |  |   99|  2.91k|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|  2.91k|  }                                                                  \
  |  |  |  |  101|  2.91k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 2.91k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1615:11): [True: 2.91k, False: 0]
  ------------------
 1616|  2.91k|          goto reexecute_byte;
 1617|  2.91k|        }
 1618|       |
 1619|  7.51k|        if (!lenient && !IS_HEADER_CHAR(ch)) {
  ------------------
  |  |  510|  7.51k|  (ch == CR || ch == LF || ch == 9 || ((unsigned char)ch > 31 && ch != 127))
  |  |  ------------------
  |  |  |  |  474|  15.0k|#define CR                  '\r'
  |  |  ------------------
  |  |                 (ch == CR || ch == LF || ch == 9 || ((unsigned char)ch > 31 && ch != 127))
  |  |  ------------------
  |  |  |  |  475|  15.0k|#define LF                  '\n'
  |  |  ------------------
  |  |  |  Branch (510:4): [True: 0, False: 7.51k]
  |  |  |  Branch (510:16): [True: 0, False: 7.51k]
  |  |  |  Branch (510:28): [True: 198, False: 7.31k]
  |  |  |  Branch (510:40): [True: 7.30k, False: 8]
  |  |  |  Branch (510:66): [True: 7.30k, False: 1]
  |  |  ------------------
  ------------------
  |  Branch (1619:13): [True: 7.51k, False: 0]
  ------------------
 1620|      9|          SET_ERRNO(HPE_INVALID_HEADER_TOKEN);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1621|      9|          goto error;
 1622|      9|        }
 1623|       |
 1624|  7.50k|        c = LOWER(ch);
  ------------------
  |  |  476|  7.50k|#define LOWER(c)            (unsigned char)(c | 0x20)
  ------------------
 1625|       |
 1626|  7.50k|        switch (parser->header_state) {
 1627|  3.30k|          case h_general:
  ------------------
  |  Branch (1627:11): [True: 3.30k, False: 4.19k]
  ------------------
 1628|  3.30k|            break;
 1629|       |
 1630|      0|          case h_connection:
  ------------------
  |  Branch (1630:11): [True: 0, False: 7.50k]
  ------------------
 1631|      0|          case h_transfer_encoding:
  ------------------
  |  Branch (1631:11): [True: 0, False: 7.50k]
  ------------------
 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: 7.50k]
  ------------------
 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: 7.50k]
  ------------------
 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: 7.50k]
  ------------------
 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: 7.50k]
  ------------------
 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|    584|          case h_matching_connection_keep_alive:
  ------------------
  |  Branch (1702:11): [True: 584, False: 6.91k]
  ------------------
 1703|    584|            parser->index++;
 1704|    584|            if (parser->index > sizeof(KEEP_ALIVE)-1
  ------------------
  |  |  126|    584|#define KEEP_ALIVE "keep-alive"
  ------------------
  |  Branch (1704:17): [True: 0, False: 584]
  ------------------
 1705|    584|                || c != KEEP_ALIVE[parser->index]) {
  ------------------
  |  |  126|    584|#define KEEP_ALIVE "keep-alive"
  ------------------
  |  Branch (1705:20): [True: 227, False: 357]
  ------------------
 1706|    227|              parser->header_state = h_general;
 1707|    357|            } else if (parser->index == sizeof(KEEP_ALIVE)-2) {
  ------------------
  |  |  126|    357|#define KEEP_ALIVE "keep-alive"
  ------------------
  |  Branch (1707:24): [True: 0, False: 357]
  ------------------
 1708|      0|              parser->header_state = h_connection_keep_alive;
 1709|      0|            }
 1710|    584|            break;
 1711|       |
 1712|       |          /* looking for 'Connection: close' */
 1713|  2.86k|          case h_matching_connection_close:
  ------------------
  |  Branch (1713:11): [True: 2.86k, False: 4.64k]
  ------------------
 1714|  2.86k|            parser->index++;
 1715|  2.86k|            if (parser->index > sizeof(CLOSE)-1 || c != CLOSE[parser->index]) {
  ------------------
  |  |  127|  2.86k|#define CLOSE "close"
  ------------------
                          if (parser->index > sizeof(CLOSE)-1 || c != CLOSE[parser->index]) {
  ------------------
  |  |  127|  2.86k|#define CLOSE "close"
  ------------------
  |  Branch (1715:17): [True: 0, False: 2.86k]
  |  Branch (1715:52): [True: 220, False: 2.64k]
  ------------------
 1716|    220|              parser->header_state = h_general;
 1717|  2.64k|            } else if (parser->index == sizeof(CLOSE)-2) {
  ------------------
  |  |  127|  2.64k|#define CLOSE "close"
  ------------------
  |  Branch (1717:24): [True: 627, False: 2.01k]
  ------------------
 1718|    627|              parser->header_state = h_connection_close;
 1719|    627|            }
 1720|  2.86k|            break;
 1721|       |
 1722|      0|          case h_transfer_encoding_chunked:
  ------------------
  |  Branch (1722:11): [True: 0, False: 7.50k]
  ------------------
 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: 7.50k]
  ------------------
 1727|    751|          case h_connection_close:
  ------------------
  |  Branch (1727:11): [True: 751, False: 6.75k]
  ------------------
 1728|    751|            if (ch != ' ') parser->header_state = h_general;
  ------------------
  |  Branch (1728:17): [True: 409, False: 342]
  ------------------
 1729|    751|            break;
 1730|       |
 1731|      0|          default:
  ------------------
  |  Branch (1731:11): [True: 0, False: 7.50k]
  ------------------
 1732|      0|            parser->state = s_header_value;
 1733|      0|            parser->header_state = h_general;
 1734|      0|            break;
 1735|  7.50k|        }
 1736|  7.50k|        break;
 1737|  7.50k|      }
 1738|       |
 1739|  7.50k|      case s_header_almost_done:
  ------------------
  |  Branch (1739:7): [True: 3.10k, False: 135k]
  ------------------
 1740|  3.10k|      {
 1741|  3.10k|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|  3.10k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  3.10k|do {                                                                 \
  |  |  515|  3.10k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 1, False: 3.10k]
  |  |  ------------------
  |  |  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.10k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 3.10k]
  |  |  ------------------
  ------------------
 1742|       |
 1743|  3.10k|        parser->state = s_header_value_lws;
 1744|  3.10k|        break;
 1745|  3.10k|      }
 1746|       |
 1747|  3.09k|      case s_header_value_lws:
  ------------------
  |  Branch (1747:7): [True: 3.09k, False: 135k]
  ------------------
 1748|  3.09k|      {
 1749|  3.09k|        if (ch == ' ' || ch == '\t') {
  ------------------
  |  Branch (1749:13): [True: 373, False: 2.72k]
  |  Branch (1749:26): [True: 229, False: 2.49k]
  ------------------
 1750|    602|          parser->state = s_header_value_start;
 1751|    602|          goto reexecute_byte;
 1752|    602|        }
 1753|       |
 1754|       |        /* finished the header */
 1755|  2.49k|        switch (parser->header_state) {
 1756|      0|          case h_connection_keep_alive:
  ------------------
  |  Branch (1756:11): [True: 0, False: 2.49k]
  ------------------
 1757|      0|            parser->flags |= F_CONNECTION_KEEP_ALIVE;
 1758|      0|            break;
 1759|    209|          case h_connection_close:
  ------------------
  |  Branch (1759:11): [True: 209, False: 2.28k]
  ------------------
 1760|    209|            parser->flags |= F_CONNECTION_CLOSE;
 1761|    209|            break;
 1762|      0|          case h_transfer_encoding_chunked:
  ------------------
  |  Branch (1762:11): [True: 0, False: 2.49k]
  ------------------
 1763|      0|            parser->flags |= F_CHUNKED;
 1764|      0|            break;
 1765|  2.28k|          default:
  ------------------
  |  Branch (1765:11): [True: 2.28k, False: 209]
  ------------------
 1766|  2.28k|            break;
 1767|  2.49k|        }
 1768|       |
 1769|  2.49k|        parser->state = s_header_field_start;
 1770|  2.49k|        goto reexecute_byte;
 1771|  2.49k|      }
 1772|       |
 1773|    199|      case s_header_value_discard_ws_almost_done:
  ------------------
  |  Branch (1773:7): [True: 199, False: 138k]
  ------------------
 1774|    199|      {
 1775|    199|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|    199|# define STRICT_CHECK(cond)                                          \
  |  |  514|    199|do {                                                                 \
  |  |  515|    199|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 1, False: 198]
  |  |  ------------------
  |  |  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|    199|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 198]
  |  |  ------------------
  ------------------
 1776|    198|        parser->state = s_header_value_discard_lws;
 1777|    198|        break;
 1778|    199|      }
 1779|       |
 1780|  3.21k|      case s_header_value_discard_lws:
  ------------------
  |  Branch (1780:7): [True: 3.21k, False: 135k]
  ------------------
 1781|  3.21k|      {
 1782|  3.21k|        if (ch == ' ' || ch == '\t') {
  ------------------
  |  Branch (1782:13): [True: 216, False: 2.99k]
  |  Branch (1782:26): [True: 199, False: 2.79k]
  ------------------
 1783|    415|          parser->state = s_header_value_discard_ws;
 1784|    415|          break;
 1785|  2.79k|        } else {
 1786|       |          /* header value was empty */
 1787|  2.79k|          MARK(header_value);
  ------------------
  |  |  112|  2.79k|#define MARK(FOR)                                                    \
  |  |  113|  2.79k|do {                                                                 \
  |  |  114|  2.79k|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 2.79k, False: 0]
  |  |  ------------------
  |  |  115|  2.79k|    FOR##_mark = p;                                                  \
  |  |  116|  2.79k|  }                                                                  \
  |  |  117|  2.79k|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 2.79k]
  |  |  ------------------
  ------------------
 1788|  2.79k|          parser->state = s_header_field_start;
 1789|  2.79k|          CALLBACK_DATA_NOADVANCE(header_value);
  ------------------
  |  |  109|  2.79k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|  2.79k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  2.79k|do {                                                                 \
  |  |  |  |   86|  2.79k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  2.79k|                                                                     \
  |  |  |  |   88|  2.79k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 2.79k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|  2.79k|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 2.79k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|  2.79k|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 2.79k]
  |  |  |  |  ------------------
  |  |  |  |   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.79k|                                                                     \
  |  |  |  |   94|  2.79k|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|  2.79k|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  2.79k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 2.79k]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|  2.79k|    }                                                                \
  |  |  |  |   99|  2.79k|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|  2.79k|  }                                                                  \
  |  |  |  |  101|  2.79k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 2.79k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1789:11): [True: 2.79k, False: 0]
  ------------------
 1790|  2.79k|          goto reexecute_byte;
 1791|  2.79k|        }
 1792|  3.21k|      }
 1793|       |
 1794|  3.14k|      case s_headers_almost_done:
  ------------------
  |  Branch (1794:7): [True: 3.14k, False: 135k]
  ------------------
 1795|  3.14k|      {
 1796|  3.14k|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|  3.14k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  3.14k|do {                                                                 \
  |  |  515|  3.14k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 2, False: 3.14k]
  |  |  ------------------
  |  |  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|  3.14k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 3.14k]
  |  |  ------------------
  ------------------
 1797|       |
 1798|  3.14k|        if (parser->flags & F_TRAILING) {
  ------------------
  |  Branch (1798:13): [True: 0, False: 3.14k]
  ------------------
 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|  3.14k|        if ((parser->uses_transfer_encoding == 1) &&
  ------------------
  |  Branch (1807:13): [True: 0, False: 3.14k]
  ------------------
 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|  3.14k|        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|  3.14k|        if (settings->on_headers_complete) {
  ------------------
  |  Branch (1834:13): [True: 3.14k, False: 0]
  ------------------
 1835|  3.14k|          switch (settings->on_headers_complete(parser)) {
 1836|  3.14k|            case 0:
  ------------------
  |  Branch (1836:13): [True: 3.14k, False: 0]
  ------------------
 1837|  3.14k|              break;
 1838|       |
 1839|      0|            case 1:
  ------------------
  |  Branch (1839:13): [True: 0, False: 3.14k]
  ------------------
 1840|      0|              parser->flags |= F_SKIPBODY;
 1841|      0|              break;
 1842|       |
 1843|      0|            default:
  ------------------
  |  Branch (1843:13): [True: 0, False: 3.14k]
  ------------------
 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|  3.14k|          }
 1847|  3.14k|        }
 1848|       |
 1849|  3.14k|        if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {
  ------------------
  |  |  204|  3.14k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  ------------------
  |  Branch (1849:13): [True: 0, False: 3.14k]
  ------------------
 1850|      0|          return p - data;
 1851|      0|        }
 1852|       |
 1853|  3.14k|        goto reexecute_byte;
 1854|  3.14k|      }
 1855|       |
 1856|  3.14k|      case s_headers_done:
  ------------------
  |  Branch (1856:7): [True: 3.14k, False: 135k]
  ------------------
 1857|  3.14k|      {
 1858|  3.14k|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|  3.14k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  3.14k|do {                                                                 \
  |  |  515|  3.14k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 0, False: 3.14k]
  |  |  ------------------
  |  |  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|  3.14k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 3.14k]
  |  |  ------------------
  ------------------
 1859|       |
 1860|  3.14k|        parser->nread = 0;
 1861|       |
 1862|       |        /* Exit, the rest of the connect is in a different protocol. */
 1863|  3.14k|        if (parser->method == HTTP_CONNECT) {
  ------------------
  |  Branch (1863:13): [True: 2, False: 3.14k]
  ------------------
 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|  3.14k|        if (parser->flags & F_SKIPBODY) {
  ------------------
  |  Branch (1869:13): [True: 0, False: 3.14k]
  ------------------
 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|  3.14k|        } else if (parser->flags & F_CHUNKED) {
  ------------------
  |  Branch (1872:20): [True: 0, False: 3.14k]
  ------------------
 1873|       |          /* chunked encoding - ignore Content-Length header */
 1874|      0|          parser->state = s_chunk_size_start;
 1875|  3.14k|        } else if (parser->uses_transfer_encoding == 1) {
  ------------------
  |  Branch (1875:20): [True: 0, False: 3.14k]
  ------------------
 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|  3.14k|        } else {
 1896|  3.14k|          if (parser->content_length == 0) {
  ------------------
  |  Branch (1896:15): [True: 0, False: 3.14k]
  ------------------
 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|  3.14k|          } else if (parser->content_length != ULLONG_MAX) {
  ------------------
  |  Branch (1900:22): [True: 0, False: 3.14k]
  ------------------
 1901|       |            /* Content-Length header given and non-zero */
 1902|      0|            parser->state = s_body_identity;
 1903|  3.14k|          } else {
 1904|  3.14k|            if (parser->type == HTTP_REQUEST ||
  ------------------
  |  Branch (1904:17): [True: 1.42k, False: 1.72k]
  ------------------
 1905|  3.10k|                !http_message_needs_eof(parser)) {
  ------------------
  |  Branch (1905:17): [True: 1.68k, False: 34]
  ------------------
 1906|       |              /* Assume content-length 0 - read the next */
 1907|  3.10k|              parser->state = NEW_MESSAGE();
  ------------------
  |  |  520|  3.10k|# define NEW_MESSAGE() (http_should_keep_alive(parser) ? start_state : s_dead)
  |  |  ------------------
  |  |  |  |  503|  3.08k|#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (503:22): [True: 1.39k, False: 1.68k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (520:25): [True: 3.08k, False: 26]
  |  |  ------------------
  ------------------
 1908|  3.10k|              CALLBACK_NOTIFY(message_complete);
  ------------------
  |  |   78|  3.10k|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|  3.10k|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|  3.10k|do {                                                                 \
  |  |  |  |   63|  3.10k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|  3.10k|                                                                     \
  |  |  |  |   65|  3.10k|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 3.10k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|  3.10k|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 3.10k]
  |  |  |  |  ------------------
  |  |  |  |   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|  3.10k|                                                                     \
  |  |  |  |   70|  3.10k|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|  3.10k|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  3.10k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 3.10k]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|  3.10k|  }                                                                  \
  |  |  |  |   75|  3.10k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 3.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1908:15): [True: 3.10k, False: 0]
  ------------------
 1909|  3.10k|            } else {
 1910|       |              /* Read body until EOF */
 1911|     34|              parser->state = s_body_identity_eof;
 1912|     34|            }
 1913|  3.14k|          }
 1914|  3.14k|        }
 1915|       |
 1916|  3.14k|        break;
 1917|  3.14k|      }
 1918|       |
 1919|  3.14k|      case s_body_identity:
  ------------------
  |  Branch (1919:7): [True: 0, False: 138k]
  ------------------
 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|      3|      case s_body_identity_eof:
  ------------------
  |  Branch (1956:7): [True: 3, False: 138k]
  ------------------
 1957|      3|        MARK(body);
  ------------------
  |  |  112|      3|#define MARK(FOR)                                                    \
  |  |  113|      3|do {                                                                 \
  |  |  114|      3|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 3, False: 0]
  |  |  ------------------
  |  |  115|      3|    FOR##_mark = p;                                                  \
  |  |  116|      3|  }                                                                  \
  |  |  117|      3|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 3]
  |  |  ------------------
  ------------------
 1958|      3|        p = data + len - 1;
 1959|       |
 1960|      3|        break;
 1961|       |
 1962|      0|      case s_message_done:
  ------------------
  |  Branch (1962:7): [True: 0, False: 138k]
  ------------------
 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: 138k]
  ------------------
 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: 138k]
  ------------------
 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: 138k]
  ------------------
 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: 138k]
  ------------------
 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: 138k]
  ------------------
 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: 138k]
  ------------------
 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: 138k]
  ------------------
 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: 138k]
  ------------------
 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|   138k|    }
 2090|   138k|  }
 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.41k|  assert(((header_field_mark ? 1 : 0) +
  ------------------
  |  Branch (2102:3): [True: 252, False: 699]
  |  Branch (2102:3): [True: 125, False: 826]
  |  Branch (2102:3): [True: 103, False: 848]
  |  Branch (2102:3): [True: 3, False: 948]
  |  Branch (2102:3): [True: 11, False: 940]
  |  Branch (2102:3): [True: 951, False: 0]
  ------------------
 2103|    951|          (header_value_mark ? 1 : 0) +
 2104|    951|          (url_mark ? 1 : 0)  +
 2105|    951|          (body_mark ? 1 : 0) +
 2106|    951|          (status_mark ? 1 : 0)) <= 1);
 2107|       |
 2108|    951|  CALLBACK_DATA_NOADVANCE(header_field);
  ------------------
  |  |  109|    951|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|    951|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    951|do {                                                                 \
  |  |  |  |   86|    951|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    951|                                                                     \
  |  |  |  |   88|    951|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 252, False: 699]
  |  |  |  |  ------------------
  |  |  |  |   89|    252|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 252, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|    252|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 252]
  |  |  |  |  ------------------
  |  |  |  |   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|    252|                                                                     \
  |  |  |  |   94|    252|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|    252|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    252|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 252]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|    252|    }                                                                \
  |  |  |  |   99|    252|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    252|  }                                                                  \
  |  |  |  |  101|    951|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 951]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2108:3): [True: 951, False: 0]
  ------------------
 2109|    951|  CALLBACK_DATA_NOADVANCE(header_value);
  ------------------
  |  |  109|    951|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|    951|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    951|do {                                                                 \
  |  |  |  |   86|    951|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    951|                                                                     \
  |  |  |  |   88|    951|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 125, False: 826]
  |  |  |  |  ------------------
  |  |  |  |   89|    125|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 125, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|    125|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 125]
  |  |  |  |  ------------------
  |  |  |  |   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|    125|                                                                     \
  |  |  |  |   94|    125|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|    125|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    125|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 125]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|    125|    }                                                                \
  |  |  |  |   99|    125|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    125|  }                                                                  \
  |  |  |  |  101|    951|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 951]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2109:3): [True: 951, False: 0]
  ------------------
 2110|    951|  CALLBACK_DATA_NOADVANCE(url);
  ------------------
  |  |  109|    951|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|    951|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    951|do {                                                                 \
  |  |  |  |   86|    951|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    951|                                                                     \
  |  |  |  |   88|    951|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 103, False: 848]
  |  |  |  |  ------------------
  |  |  |  |   89|    103|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 103, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|    103|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 103]
  |  |  |  |  ------------------
  |  |  |  |   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|    103|                                                                     \
  |  |  |  |   94|    103|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|    103|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    103|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 103]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|    103|    }                                                                \
  |  |  |  |   99|    103|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    103|  }                                                                  \
  |  |  |  |  101|    951|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 951]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2110:3): [True: 951, False: 0]
  ------------------
 2111|    951|  CALLBACK_DATA_NOADVANCE(body);
  ------------------
  |  |  109|    951|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|    951|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    951|do {                                                                 \
  |  |  |  |   86|    951|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    951|                                                                     \
  |  |  |  |   88|    951|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 3, False: 948]
  |  |  |  |  ------------------
  |  |  |  |   89|      3|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|      3|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |   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|                                                                     \
  |  |  |  |   94|      3|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|      3|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      3|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|      3|    }                                                                \
  |  |  |  |   99|      3|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|      3|  }                                                                  \
  |  |  |  |  101|    951|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 951]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2111:3): [True: 951, False: 0]
  ------------------
 2112|    951|  CALLBACK_DATA_NOADVANCE(status);
  ------------------
  |  |  109|    951|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|    951|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    951|do {                                                                 \
  |  |  |  |   86|    951|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    951|                                                                     \
  |  |  |  |   88|    951|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 11, False: 940]
  |  |  |  |  ------------------
  |  |  |  |   89|     11|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 0, False: 11]
  |  |  |  |  ------------------
  |  |  |  |   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|     11|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|     11|  }                                                                  \
  |  |  |  |  101|    951|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 951]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2112:3): [True: 951, False: 0]
  ------------------
 2113|       |
 2114|    951|  return len;
 2115|       |
 2116|    464|error:
 2117|    464|  if (HTTP_PARSER_ERRNO(parser) == HPE_OK) {
  ------------------
  |  |  204|    464|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  ------------------
  |  Branch (2117:7): [True: 0, False: 464]
  ------------------
 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|    464|  return (p - data);
 2122|    951|}
_ZN4brpc22http_message_needs_eofEPKNS_11http_parserE:
 2128|  4.80k|{
 2129|  4.80k|  if (parser->type == HTTP_REQUEST) {
  ------------------
  |  Branch (2129:7): [True: 1.39k, False: 3.40k]
  ------------------
 2130|  1.39k|    return 0;
 2131|  1.39k|  }
 2132|       |
 2133|       |  /* See RFC 2616 section 4.4 */
 2134|  3.40k|  if (parser->status_code / 100 == 1 || /* 1xx e.g. Continue */
  ------------------
  |  Branch (2134:7): [True: 3.06k, False: 336]
  ------------------
 2135|    336|      parser->status_code == 204 ||     /* No Content */
  ------------------
  |  Branch (2135:7): [True: 150, False: 186]
  ------------------
 2136|    186|      parser->status_code == 304 ||     /* Not Modified */
  ------------------
  |  Branch (2136:7): [True: 152, False: 34]
  ------------------
 2137|  3.37k|      parser->flags & F_SKIPBODY) {     /* response to a HEAD request */
  ------------------
  |  Branch (2137:7): [True: 0, False: 34]
  ------------------
 2138|  3.37k|    return 0;
 2139|  3.37k|  }
 2140|       |
 2141|       |  /* RFC 7230 3.3.3, see `s_headers_almost_done` */
 2142|     34|  if ((parser->uses_transfer_encoding == 1) &&
  ------------------
  |  Branch (2142:7): [True: 0, False: 34]
  ------------------
 2143|      0|      (parser->flags & F_CHUNKED) == 0) {
  ------------------
  |  Branch (2143:7): [True: 0, False: 0]
  ------------------
 2144|      0|    return 1;
 2145|      0|  }
 2146|       |
 2147|     34|  if ((parser->flags & F_CHUNKED) || parser->content_length != ULLONG_MAX) {
  ------------------
  |  Branch (2147:7): [True: 0, False: 34]
  |  Branch (2147:38): [True: 0, False: 34]
  ------------------
 2148|      0|    return 0;
 2149|      0|  }
 2150|       |
 2151|     34|  return 1;
 2152|     34|}
_ZN4brpc22http_should_keep_aliveEPKNS_11http_parserE:
 2157|  3.10k|{
 2158|  3.10k|  if (parser->http_major > 0 && parser->http_minor > 0) {
  ------------------
  |  Branch (2158:7): [True: 3.08k, False: 25]
  |  Branch (2158:33): [True: 3.08k, False: 1]
  ------------------
 2159|       |    /* HTTP/1.1 */
 2160|  3.08k|    if (parser->flags & F_CONNECTION_CLOSE) {
  ------------------
  |  Branch (2160:9): [True: 1, False: 3.08k]
  ------------------
 2161|      1|      return 0;
 2162|      1|    }
 2163|  3.08k|  } else {
 2164|       |    /* HTTP/1.0 or earlier */
 2165|     26|    if (!(parser->flags & F_CONNECTION_KEEP_ALIVE)) {
  ------------------
  |  Branch (2165:9): [True: 26, False: 0]
  ------------------
 2166|     26|      return 0;
 2167|     26|    }
 2168|     26|  }
 2169|       |
 2170|  3.08k|  return !http_message_needs_eof(parser);
 2171|  3.10k|}
_ZN4brpc16http_parser_initEPNS_11http_parserENS_16http_parser_typeE:
 2183|  1.41k|{
 2184|  1.41k|  void *data = parser->data; /* preserve application data */
 2185|  1.41k|  memset(parser, 0, sizeof(*parser));
 2186|  1.41k|  parser->data = data;
 2187|  1.41k|  parser->type = t;
 2188|  1.41k|  parser->state = (t == HTTP_REQUEST ? s_start_req : (t == HTTP_RESPONSE ? s_start_res : s_start_req_or_res));
  ------------------
  |  Branch (2188:20): [True: 1.03k, False: 384]
  |  Branch (2188:55): [True: 384, False: 0]
  ------------------
 2189|  1.41k|  parser->http_errno = HPE_OK;
 2190|  1.41k|}
_ZN4brpc21http_parser_parse_urlEPKcmiPNS_15http_parser_urlE:
 2345|    799|{
 2346|    799|  enum state s;
 2347|    799|  const char *p;
 2348|    799|  enum http_parser_url_fields uf, old_uf;
 2349|    799|  int found_at = 0;
 2350|       |
 2351|    799|  u->port = u->field_set = 0;
 2352|    799|  s = is_connect ? s_req_server_start : s_req_spaces_before_url;
  ------------------
  |  Branch (2352:7): [True: 698, False: 101]
  ------------------
 2353|    799|  old_uf = UF_MAX;
 2354|       |
 2355|  24.4k|  for (p = buf; p < buf + buflen; p++) {
  ------------------
  |  Branch (2355:17): [True: 23.7k, False: 644]
  ------------------
 2356|  23.7k|    s = parse_url_char(s, *p);
 2357|       |
 2358|       |    /* Figure out the next field that we're operating on */
 2359|  23.7k|    switch (s) {
 2360|    155|      case s_dead:
  ------------------
  |  Branch (2360:7): [True: 155, False: 23.6k]
  ------------------
 2361|    155|        return 1;
 2362|       |
 2363|       |      /* Skip delimeters */
 2364|     19|      case s_req_scheme_slash:
  ------------------
  |  Branch (2364:7): [True: 19, False: 23.7k]
  ------------------
 2365|     29|      case s_req_scheme_slash_slash:
  ------------------
  |  Branch (2365:7): [True: 10, False: 23.7k]
  ------------------
 2366|     30|      case s_req_server_start:
  ------------------
  |  Branch (2366:7): [True: 1, False: 23.7k]
  ------------------
 2367|     91|      case s_req_query_string_start:
  ------------------
  |  Branch (2367:7): [True: 61, False: 23.7k]
  ------------------
 2368|    557|      case s_req_fragment_start:
  ------------------
  |  Branch (2368:7): [True: 466, False: 23.3k]
  ------------------
 2369|    557|        continue;
 2370|       |
 2371|    429|      case s_req_scheme:
  ------------------
  |  Branch (2371:7): [True: 429, False: 23.3k]
  ------------------
 2372|    429|        uf = UF_SCHEME;
 2373|    429|        break;
 2374|       |
 2375|    415|      case s_req_server_with_at:
  ------------------
  |  Branch (2375:7): [True: 415, False: 23.3k]
  ------------------
 2376|    415|        found_at = 1;
 2377|       |        // fall through
 2378|  20.3k|      case s_req_server:
  ------------------
  |  Branch (2378:7): [True: 19.9k, False: 3.86k]
  ------------------
 2379|  20.3k|        uf = UF_HOST;
 2380|  20.3k|        break;
 2381|       |
 2382|    689|      case s_req_path:
  ------------------
  |  Branch (2382:7): [True: 689, False: 23.0k]
  ------------------
 2383|    689|        uf = UF_PATH;
 2384|    689|        break;
 2385|       |
 2386|    795|      case s_req_query_string:
  ------------------
  |  Branch (2386:7): [True: 795, False: 22.9k]
  ------------------
 2387|    795|        uf = UF_QUERY;
 2388|    795|        break;
 2389|       |
 2390|    828|      case s_req_fragment:
  ------------------
  |  Branch (2390:7): [True: 828, False: 22.9k]
  ------------------
 2391|    828|        uf = UF_FRAGMENT;
 2392|    828|        break;
 2393|       |
 2394|      0|      default:
  ------------------
  |  Branch (2394:7): [True: 0, False: 23.7k]
  ------------------
 2395|      0|        assert(!"Unexpected state");
  ------------------
  |  Branch (2395:9): [Folded, False: 0]
  ------------------
 2396|      0|        return 1;
 2397|  23.7k|    }
 2398|       |
 2399|       |    /* Nothing's changed; soldier on */
 2400|  23.0k|    if (uf == old_uf) {
  ------------------
  |  Branch (2400:9): [True: 22.2k, False: 821]
  ------------------
 2401|  22.2k|      u->field_data[uf].len++;
 2402|  22.2k|      continue;
 2403|  22.2k|    }
 2404|       |
 2405|    821|    u->field_data[uf].off = p - buf;
 2406|    821|    u->field_data[uf].len = 1;
 2407|       |
 2408|    821|    u->field_set |= (1 << uf);
 2409|    821|    old_uf = uf;
 2410|    821|  }
 2411|       |
 2412|       |  /* host must be present if there is a scheme */
 2413|       |  /* parsing http:///toto will fail */
 2414|    644|  if ((u->field_set & ((1 << UF_SCHEME) | (1 << UF_HOST))) != 0) {
  ------------------
  |  Branch (2414:7): [True: 546, False: 98]
  ------------------
 2415|    546|    if (http_parse_host(buf, u, found_at) != 0) {
  ------------------
  |  Branch (2415:9): [True: 353, False: 193]
  ------------------
 2416|    353|      return 1;
 2417|    353|    }
 2418|    546|  }
 2419|       |
 2420|       |  /* CONNECT requests can only contain "hostname:port" */
 2421|    291|  if (is_connect && u->field_set != ((1 << UF_HOST)|(1 << UF_PORT))) {
  ------------------
  |  Branch (2421:7): [True: 268, False: 23]
  |  Branch (2421:21): [True: 144, False: 124]
  ------------------
 2422|    144|    return 1;
 2423|    144|  }
 2424|       |
 2425|    147|  if (u->field_set & (1 << UF_PORT)) {
  ------------------
  |  Branch (2425:7): [True: 124, False: 23]
  ------------------
 2426|       |    /* Don't bother with endp; we've already validated the string */
 2427|    124|    unsigned long v = strtoul(buf + u->field_data[UF_PORT].off, NULL, 10);
 2428|       |
 2429|       |    /* Ports have a max value of 2^16 */
 2430|    124|    if (v > 0xffff) {
  ------------------
  |  Branch (2430:9): [True: 95, False: 29]
  ------------------
 2431|     95|      return 1;
 2432|     95|    }
 2433|       |
 2434|     29|    u->port = (uint16_t) v;
 2435|     29|  }
 2436|       |
 2437|     52|  return 0;
 2438|    147|}
http_parser.cpp:_ZN4brpcL14parse_url_charENS_5stateEc:
  552|  30.4k|{
  553|  30.4k|  if (ch == ' ' || ch == '\r' || ch == '\n') {
  ------------------
  |  Branch (553:7): [True: 3, False: 30.4k]
  |  Branch (553:20): [True: 1, False: 30.4k]
  |  Branch (553:34): [True: 1, False: 30.4k]
  ------------------
  554|      5|    return s_dead;
  555|      5|  }
  556|       |
  557|  30.4k|#if BRPC_HTTP_PARSER_STRICT
  558|  30.4k|  if (ch == '\t' || ch == '\f') {
  ------------------
  |  Branch (558:7): [True: 1, False: 30.4k]
  |  Branch (558:21): [True: 1, False: 30.4k]
  ------------------
  559|      2|    return s_dead;
  560|      2|  }
  561|  30.4k|#endif
  562|       |
  563|  30.4k|  switch (s) {
  564|  2.30k|    case s_req_spaces_before_url:
  ------------------
  |  Branch (564:5): [True: 2.30k, False: 28.1k]
  ------------------
  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.30k|      if (ch == '/' || ch == '*') {
  ------------------
  |  Branch (569:11): [True: 1.52k, False: 781]
  |  Branch (569:24): [True: 404, False: 377]
  ------------------
  570|  1.92k|        return s_req_path;
  571|  1.92k|      }
  572|       |
  573|    377|      if (IS_ALPHA(ch)) {
  ------------------
  |  |  477|    377|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|    377|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|    366|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |  |  Branch (477:30): [True: 366, False: 11]
  |  |  |  Branch (477:49): [True: 358, False: 8]
  |  |  ------------------
  ------------------
  574|    358|        return s_req_scheme;
  575|    358|      }
  576|       |
  577|     19|      break;
  578|       |
  579|    911|    case s_req_scheme:
  ------------------
  |  Branch (579:5): [True: 911, False: 29.4k]
  ------------------
  580|    911|      if (IS_ALPHA(ch)) {
  ------------------
  |  |  477|    911|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|    911|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|    588|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |  |  Branch (477:30): [True: 588, False: 323]
  |  |  |  Branch (477:49): [True: 579, False: 9]
  |  |  ------------------
  ------------------
  581|    579|        return s;
  582|    579|      }
  583|       |
  584|    332|      if (ch == ':') {
  ------------------
  |  Branch (584:11): [True: 315, False: 17]
  ------------------
  585|    315|        return s_req_scheme_slash;
  586|    315|      }
  587|       |
  588|     17|      break;
  589|       |
  590|    313|    case s_req_scheme_slash:
  ------------------
  |  Branch (590:5): [True: 313, False: 30.0k]
  ------------------
  591|    313|      if (ch == '/') {
  ------------------
  |  Branch (591:11): [True: 302, False: 11]
  ------------------
  592|    302|        return s_req_scheme_slash_slash;
  593|    302|      }
  594|       |
  595|     11|      break;
  596|       |
  597|    301|    case s_req_scheme_slash_slash:
  ------------------
  |  Branch (597:5): [True: 301, False: 30.1k]
  ------------------
  598|    301|      if (ch == '/') {
  ------------------
  |  Branch (598:11): [True: 290, False: 11]
  ------------------
  599|    290|        return s_req_server_start;
  600|    290|      }
  601|       |
  602|     11|      break;
  603|       |
  604|    465|    case s_req_server_with_at:
  ------------------
  |  Branch (604:5): [True: 465, False: 29.9k]
  ------------------
  605|    465|      if (ch == '@') {
  ------------------
  |  Branch (605:11): [True: 2, False: 463]
  ------------------
  606|      2|        return s_dead;
  607|      2|      }
  608|       |
  609|       |    /* FALLTHROUGH */
  610|  1.45k|    case s_req_server_start:
  ------------------
  |  Branch (610:5): [True: 989, False: 29.4k]
  ------------------
  611|  21.4k|    case s_req_server:
  ------------------
  |  Branch (611:5): [True: 20.0k, False: 10.3k]
  ------------------
  612|  21.4k|      if (ch == '/') {
  ------------------
  |  Branch (612:11): [True: 253, False: 21.2k]
  ------------------
  613|    253|        return s_req_path;
  614|    253|      }
  615|       |
  616|  21.2k|      if (ch == '?') {
  ------------------
  |  Branch (616:11): [True: 123, False: 21.1k]
  ------------------
  617|    123|        return s_req_query_string_start;
  618|    123|      }
  619|       |
  620|  21.1k|      if (ch == '@') {
  ------------------
  |  Branch (620:11): [True: 624, False: 20.4k]
  ------------------
  621|    624|        return s_req_server_with_at;
  622|    624|      }
  623|       |
  624|  20.4k|      if (IS_USERINFO_CHAR(ch) || ch == '[' || ch == ']') {
  ------------------
  |  |  484|  40.9k|#define IS_USERINFO_CHAR(c) (IS_ALPHANUM(c) || IS_MARK(c) || (c) == '%' || \
  |  |  ------------------
  |  |  |  |  479|  40.9k|#define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  477|  40.9k|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|  20.4k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|  5.94k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (477:30): [True: 5.94k, False: 14.5k]
  |  |  |  |  |  |  |  Branch (477:49): [True: 2.28k, False: 3.65k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  478|  18.1k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (478:30): [True: 8.12k, False: 10.0k]
  |  |  |  |  |  |  |  Branch (478:44): [True: 2.83k, False: 5.29k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_USERINFO_CHAR(c) (IS_ALPHANUM(c) || IS_MARK(c) || (c) == '%' || \
  |  |  ------------------
  |  |  |  |  481|  35.8k|#define IS_MARK(c)          ((c) == '-' || (c) == '_' || (c) == '.' || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (481:30): [True: 482, False: 14.8k]
  |  |  |  |  |  Branch (481:44): [True: 2.39k, False: 12.4k]
  |  |  |  |  |  Branch (481:58): [True: 770, False: 11.7k]
  |  |  |  |  ------------------
  |  |  |  |  482|  15.3k|  (c) == '!' || (c) == '~' || (c) == '*' || (c) == '\'' || (c) == '(' || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (482:3): [True: 4.20k, False: 7.51k]
  |  |  |  |  |  Branch (482:17): [True: 758, False: 6.75k]
  |  |  |  |  |  Branch (482:31): [True: 392, False: 6.36k]
  |  |  |  |  |  Branch (482:45): [True: 450, False: 5.91k]
  |  |  |  |  |  Branch (482:60): [True: 455, False: 5.45k]
  |  |  |  |  ------------------
  |  |  |  |  483|  35.8k|  (c) == ')')
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (483:3): [True: 549, False: 4.90k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (484:62): [True: 530, False: 4.37k]
  |  |  ------------------
  |  |  485|  20.4k|  (c) == ';' || (c) == ':' || (c) == '&' || (c) == '=' || (c) == '+' || \
  |  |  ------------------
  |  |  |  Branch (485:3): [True: 274, False: 4.10k]
  |  |  |  Branch (485:17): [True: 973, False: 3.13k]
  |  |  |  Branch (485:31): [True: 720, False: 2.41k]
  |  |  |  Branch (485:45): [True: 421, False: 1.99k]
  |  |  |  Branch (485:59): [True: 557, False: 1.43k]
  |  |  ------------------
  |  |  486|  20.4k|  (c) == '$' || (c) == ',')
  |  |  ------------------
  |  |  |  Branch (486:3): [True: 454, False: 980]
  |  |  |  Branch (486:17): [True: 450, False: 530]
  |  |  ------------------
  ------------------
  |  Branch (624:35): [True: 267, False: 263]
  |  Branch (624:48): [True: 203, False: 60]
  ------------------
  625|  20.4k|        return s_req_server;
  626|  20.4k|      }
  627|       |
  628|     60|      break;
  629|       |
  630|  1.86k|    case s_req_path:
  ------------------
  |  Branch (630:5): [True: 1.86k, False: 28.5k]
  ------------------
  631|  1.86k|      if (IS_URL_CHAR(ch)) {
  ------------------
  |  |  498|  1.86k|    (BIT_AT(normal_url_char, (unsigned char)c) || ((c) & 0x80))
  |  |  ------------------
  |  |  |  |   46|  3.72k|  (!!((unsigned int) (a)[(unsigned int) (i) >> 3] &                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:3): [True: 887, False: 976]
  |  |  |  |  ------------------
  |  |  |  |   47|  3.72k|   (1 << ((unsigned int) (i) & 7))))
  |  |  ------------------
  |  |  |  Branch (498:51): [True: 442, False: 534]
  |  |  ------------------
  ------------------
  632|  1.32k|        return s;
  633|  1.32k|      }
  634|       |
  635|    534|      switch (ch) {
  ------------------
  |  Branch (635:15): [True: 520, False: 14]
  ------------------
  636|    124|        case '?':
  ------------------
  |  Branch (636:9): [True: 124, False: 410]
  ------------------
  637|    124|          return s_req_query_string_start;
  638|       |
  639|    396|        case '#':
  ------------------
  |  Branch (639:9): [True: 396, False: 138]
  ------------------
  640|    396|          return s_req_fragment_start;
  641|    534|      }
  642|       |
  643|     14|      break;
  644|       |
  645|    149|    case s_req_query_string_start:
  ------------------
  |  Branch (645:5): [True: 149, False: 30.2k]
  ------------------
  646|  1.13k|    case s_req_query_string:
  ------------------
  |  Branch (646:5): [True: 983, False: 29.4k]
  ------------------
  647|  1.13k|        if (IS_URL_CHAR(ch)) {
  ------------------
  |  |  498|  1.13k|    (BIT_AT(normal_url_char, (unsigned char)c) || ((c) & 0x80))
  |  |  ------------------
  |  |  |  |   46|  2.26k|  (!!((unsigned int) (a)[(unsigned int) (i) >> 3] &                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:3): [True: 534, False: 598]
  |  |  |  |  ------------------
  |  |  |  |   47|  2.26k|   (1 << ((unsigned int) (i) & 7))))
  |  |  ------------------
  |  |  |  Branch (498:51): [True: 342, False: 256]
  |  |  ------------------
  ------------------
  648|    876|          return s_req_query_string;
  649|    876|        }
  650|    256|        switch (ch) {
  ------------------
  |  Branch (650:17): [True: 242, False: 14]
  ------------------
  651|    223|          case '?':
  ------------------
  |  Branch (651:11): [True: 223, False: 33]
  ------------------
  652|       |            /* allow extra '?' in query string */
  653|    223|            return s_req_query_string;
  654|     19|          case '#':
  ------------------
  |  Branch (654:11): [True: 19, False: 237]
  ------------------
  655|     19|            return s_req_fragment_start;
  656|    256|        }
  657|     14|        break;
  658|       |
  659|    958|    case s_req_fragment_start:
  ------------------
  |  Branch (659:5): [True: 958, False: 29.4k]
  ------------------
  660|    958|        if (IS_URL_CHAR(ch)) {
  ------------------
  |  |  498|    958|    (BIT_AT(normal_url_char, (unsigned char)c) || ((c) & 0x80))
  |  |  ------------------
  |  |  |  |   46|  1.91k|  (!!((unsigned int) (a)[(unsigned int) (i) >> 3] &                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:3): [True: 221, False: 737]
  |  |  |  |  ------------------
  |  |  |  |   47|  1.91k|   (1 << ((unsigned int) (i) & 7))))
  |  |  ------------------
  |  |  |  Branch (498:51): [True: 124, False: 613]
  |  |  ------------------
  ------------------
  661|    345|          return s_req_fragment;
  662|    345|        }
  663|    613|        switch (ch) {
  ------------------
  |  Branch (663:17): [True: 601, False: 12]
  ------------------
  664|      7|          case '?':
  ------------------
  |  Branch (664:11): [True: 7, False: 606]
  ------------------
  665|      7|            return s_req_fragment;
  666|    594|          case '#':
  ------------------
  |  Branch (666:11): [True: 594, False: 19]
  ------------------
  667|    594|            return s;
  668|    613|        }
  669|     12|        break;
  670|       |
  671|  1.13k|    case s_req_fragment:
  ------------------
  |  Branch (671:5): [True: 1.13k, False: 29.2k]
  ------------------
  672|  1.13k|        if (IS_URL_CHAR(ch)) {
  ------------------
  |  |  498|  1.13k|    (BIT_AT(normal_url_char, (unsigned char)c) || ((c) & 0x80))
  |  |  ------------------
  |  |  |  |   46|  2.27k|  (!!((unsigned int) (a)[(unsigned int) (i) >> 3] &                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:3): [True: 516, False: 622]
  |  |  |  |  ------------------
  |  |  |  |   47|  2.27k|   (1 << ((unsigned int) (i) & 7))))
  |  |  ------------------
  |  |  |  Branch (498:51): [True: 397, False: 225]
  |  |  ------------------
  ------------------
  673|    913|          return s;
  674|    913|        }
  675|    225|        switch (ch) {
  ------------------
  |  Branch (675:17): [True: 215, False: 10]
  ------------------
  676|    179|          case '?':
  ------------------
  |  Branch (676:11): [True: 179, False: 46]
  ------------------
  677|    215|          case '#':
  ------------------
  |  Branch (677:11): [True: 36, False: 189]
  ------------------
  678|    215|            return s;
  679|    225|        }
  680|     10|        break;
  681|       |
  682|     10|    default:
  ------------------
  |  Branch (682:5): [True: 0, False: 30.4k]
  ------------------
  683|      0|      break;
  684|  30.4k|  }
  685|       |
  686|       |  /* We should never fall out of the switch above unless there's an error */
  687|    168|  return s_dead;
  688|  30.4k|}
http_parser.cpp:_ZN4brpcL15http_parse_hostEPKcPNS_15http_parser_urlEi:
 2270|    546|http_parse_host(const char * buf, struct http_parser_url *u, int found_at) {
 2271|    546|  enum http_host_state s;
 2272|       |
 2273|    546|  const char *p;
 2274|    546|  size_t buflen = u->field_data[UF_HOST].off + u->field_data[UF_HOST].len;
 2275|       |
 2276|    546|  u->field_data[UF_HOST].len = 0;
 2277|       |
 2278|    546|  s = found_at ? s_http_userinfo_start : s_http_host_start;
  ------------------
  |  Branch (2278:7): [True: 173, False: 373]
  ------------------
 2279|       |
 2280|  15.6k|  for (p = buf + u->field_data[UF_HOST].off; p < buf + buflen; p++) {
  ------------------
  |  Branch (2280:46): [True: 15.2k, False: 376]
  ------------------
 2281|  15.2k|    enum http_host_state new_s = http_parse_host_char(s, *p);
 2282|       |
 2283|  15.2k|    if (new_s == s_http_host_dead) {
  ------------------
  |  Branch (2283:9): [True: 170, False: 15.1k]
  ------------------
 2284|    170|      return 1;
 2285|    170|    }
 2286|       |
 2287|  15.1k|    switch(new_s) {
 2288|  3.13k|      case s_http_host:
  ------------------
  |  Branch (2288:7): [True: 3.13k, False: 11.9k]
  ------------------
 2289|  3.13k|        if (s != s_http_host) {
  ------------------
  |  Branch (2289:13): [True: 234, False: 2.90k]
  ------------------
 2290|    234|          u->field_data[UF_HOST].off = p - buf;
 2291|    234|        }
 2292|  3.13k|        u->field_data[UF_HOST].len++;
 2293|  3.13k|        break;
 2294|       |
 2295|  1.00k|      case s_http_host_v6:
  ------------------
  |  Branch (2295:7): [True: 1.00k, False: 14.1k]
  ------------------
 2296|  1.00k|        if (s != s_http_host_v6) {
  ------------------
  |  Branch (2296:13): [True: 58, False: 945]
  ------------------
 2297|     58|          u->field_data[UF_HOST].off = p - buf;
 2298|     58|        }
 2299|  1.00k|        u->field_data[UF_HOST].len++;
 2300|  1.00k|        break;
 2301|       |
 2302|  1.89k|      case s_http_host_port:
  ------------------
  |  Branch (2302:7): [True: 1.89k, False: 13.2k]
  ------------------
 2303|  1.89k|        if (s != s_http_host_port) {
  ------------------
  |  Branch (2303:13): [True: 128, False: 1.76k]
  ------------------
 2304|    128|          u->field_data[UF_PORT].off = p - buf;
 2305|    128|          u->field_data[UF_PORT].len = 0;
 2306|    128|          u->field_set |= (1 << UF_PORT);
 2307|    128|        }
 2308|  1.89k|        u->field_data[UF_PORT].len++;
 2309|  1.89k|        break;
 2310|       |
 2311|  8.70k|      case s_http_userinfo:
  ------------------
  |  Branch (2311:7): [True: 8.70k, False: 6.41k]
  ------------------
 2312|  8.70k|        if (s != s_http_userinfo) {
  ------------------
  |  Branch (2312:13): [True: 163, False: 8.54k]
  ------------------
 2313|    163|          u->field_data[UF_USERINFO].off = p - buf ;
 2314|    163|          u->field_data[UF_USERINFO].len = 0;
 2315|    163|          u->field_set |= (1 << UF_USERINFO);
 2316|    163|        }
 2317|  8.70k|        u->field_data[UF_USERINFO].len++;
 2318|  8.70k|        break;
 2319|       |
 2320|    380|      default:
  ------------------
  |  Branch (2320:7): [True: 380, False: 14.7k]
  ------------------
 2321|    380|        break;
 2322|  15.1k|    }
 2323|  15.1k|    s = new_s;
 2324|  15.1k|  }
 2325|       |
 2326|       |  /* Make sure we don't end somewhere unexpected */
 2327|    376|  switch (s) {
 2328|    147|    case s_http_host_start:
  ------------------
  |  Branch (2328:5): [True: 147, False: 229]
  ------------------
 2329|    148|    case s_http_host_v6_start:
  ------------------
  |  Branch (2329:5): [True: 1, False: 375]
  ------------------
 2330|    182|    case s_http_host_v6:
  ------------------
  |  Branch (2330:5): [True: 34, False: 342]
  ------------------
 2331|    183|    case s_http_host_port_start:
  ------------------
  |  Branch (2331:5): [True: 1, False: 375]
  ------------------
 2332|    183|    case s_http_userinfo:
  ------------------
  |  Branch (2332:5): [True: 0, False: 376]
  ------------------
 2333|    183|    case s_http_userinfo_start:
  ------------------
  |  Branch (2333:5): [True: 0, False: 376]
  ------------------
 2334|    183|      return 1;
 2335|    193|    default:
  ------------------
  |  Branch (2335:5): [True: 193, False: 183]
  ------------------
 2336|    193|      break;
 2337|    376|  }
 2338|       |
 2339|    193|  return 0;
 2340|    376|}
http_parser.cpp:_ZN4brpcL20http_parse_host_charENS_15http_host_stateEc:
 2205|  15.2k|http_parse_host_char(enum http_host_state s, const char ch) {
 2206|  15.2k|  switch(s) {
 2207|  8.70k|    case s_http_userinfo:
  ------------------
  |  Branch (2207:5): [True: 8.70k, False: 6.58k]
  ------------------
 2208|  8.88k|    case s_http_userinfo_start:
  ------------------
  |  Branch (2208:5): [True: 173, False: 15.1k]
  ------------------
 2209|  8.88k|      if (ch == '@') {
  ------------------
  |  Branch (2209:11): [True: 171, False: 8.71k]
  ------------------
 2210|    171|        return s_http_host_start;
 2211|    171|      }
 2212|       |
 2213|  8.71k|      if (IS_USERINFO_CHAR(ch)) {
  ------------------
  |  |  484|  8.71k|#define IS_USERINFO_CHAR(c) (IS_ALPHANUM(c) || IS_MARK(c) || (c) == '%' || \
  |  |  ------------------
  |  |  |  |  479|  17.4k|#define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  477|  17.4k|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|  8.71k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|    762|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (477:30): [True: 762, False: 7.94k]
  |  |  |  |  |  |  |  Branch (477:49): [True: 363, False: 399]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  478|  8.34k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (478:30): [True: 1.35k, False: 6.99k]
  |  |  |  |  |  |  |  Branch (478:44): [True: 282, False: 1.07k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_USERINFO_CHAR(c) (IS_ALPHANUM(c) || IS_MARK(c) || (c) == '%' || \
  |  |  ------------------
  |  |  |  |  481|  16.7k|#define IS_MARK(c)          ((c) == '-' || (c) == '_' || (c) == '.' || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (481:30): [True: 195, False: 7.87k]
  |  |  |  |  |  Branch (481:44): [True: 201, False: 7.67k]
  |  |  |  |  |  Branch (481:58): [True: 238, False: 7.43k]
  |  |  |  |  ------------------
  |  |  |  |  482|  8.06k|  (c) == '!' || (c) == '~' || (c) == '*' || (c) == '\'' || (c) == '(' || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (482:3): [True: 3.97k, False: 3.45k]
  |  |  |  |  |  Branch (482:17): [True: 196, False: 3.26k]
  |  |  |  |  |  Branch (482:31): [True: 194, False: 3.06k]
  |  |  |  |  |  Branch (482:45): [True: 195, False: 2.87k]
  |  |  |  |  |  Branch (482:60): [True: 253, False: 2.62k]
  |  |  |  |  ------------------
  |  |  |  |  483|  16.7k|  (c) == ')')
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (483:3): [True: 325, False: 2.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (484:62): [True: 326, False: 1.97k]
  |  |  ------------------
  |  |  485|  8.71k|  (c) == ';' || (c) == ':' || (c) == '&' || (c) == '=' || (c) == '+' || \
  |  |  ------------------
  |  |  |  Branch (485:3): [True: 196, False: 1.77k]
  |  |  |  Branch (485:17): [True: 214, False: 1.56k]
  |  |  |  Branch (485:31): [True: 459, False: 1.10k]
  |  |  |  Branch (485:45): [True: 267, False: 834]
  |  |  |  Branch (485:59): [True: 349, False: 485]
  |  |  ------------------
  |  |  486|  8.71k|  (c) == '$' || (c) == ',')
  |  |  ------------------
  |  |  |  Branch (486:3): [True: 256, False: 229]
  |  |  |  Branch (486:17): [True: 227, False: 2]
  |  |  ------------------
  ------------------
 2214|  8.70k|        return s_http_userinfo;
 2215|  8.70k|      }
 2216|      2|      break;
 2217|       |
 2218|    397|    case s_http_host_start:
  ------------------
  |  Branch (2218:5): [True: 397, False: 14.8k]
  ------------------
 2219|    397|      if (ch == '[') {
  ------------------
  |  Branch (2219:11): [True: 69, False: 328]
  ------------------
 2220|     69|        return s_http_host_v6_start;
 2221|     69|      }
 2222|       |
 2223|    328|      if (IS_HOST_CHAR(ch)) {
  ------------------
  |  |  493|    328|  (IS_ALPHANUM(c) || (c) == '.' || (c) == '-' || (c) == '_')
  |  |  ------------------
  |  |  |  |  479|    656|#define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  477|    656|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|    328|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|    175|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (477:30): [True: 175, False: 153]
  |  |  |  |  |  |  |  Branch (477:49): [True: 147, False: 28]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  478|    181|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (478:30): [True: 94, False: 87]
  |  |  |  |  |  |  |  Branch (478:44): [True: 51, False: 43]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (493:22): [True: 7, False: 123]
  |  |  |  Branch (493:36): [True: 14, False: 109]
  |  |  |  Branch (493:50): [True: 15, False: 94]
  |  |  ------------------
  ------------------
 2224|    234|        return s_http_host;
 2225|    234|      }
 2226|       |
 2227|     94|      break;
 2228|       |
 2229|  3.07k|    case s_http_host:
  ------------------
  |  Branch (2229:5): [True: 3.07k, False: 12.2k]
  ------------------
 2230|  3.07k|      if (IS_HOST_CHAR(ch)) {
  ------------------
  |  |  493|  3.07k|  (IS_ALPHANUM(c) || (c) == '.' || (c) == '-' || (c) == '_')
  |  |  ------------------
  |  |  |  |  479|  6.14k|#define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  477|  6.14k|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|  3.07k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|  1.86k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (477:30): [True: 1.86k, False: 1.20k]
  |  |  |  |  |  |  |  Branch (477:49): [True: 918, False: 949]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  478|  2.15k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (478:30): [True: 1.61k, False: 538]
  |  |  |  |  |  |  |  Branch (478:44): [True: 523, False: 1.09k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (493:22): [True: 251, False: 1.37k]
  |  |  |  Branch (493:36): [True: 270, False: 1.10k]
  |  |  |  Branch (493:50): [True: 943, False: 165]
  |  |  ------------------
  ------------------
 2231|  2.90k|        return s_http_host;
 2232|  2.90k|      }
 2233|       |
 2234|       |    /* FALLTHROUGH */
 2235|    172|    case s_http_host_v6_end:
  ------------------
  |  Branch (2235:5): [True: 7, False: 15.2k]
  ------------------
 2236|    172|      if (ch == ':') {
  ------------------
  |  Branch (2236:11): [True: 133, False: 39]
  ------------------
 2237|    133|        return s_http_host_port_start;
 2238|    133|      }
 2239|       |
 2240|     39|      break;
 2241|       |
 2242|    969|    case s_http_host_v6:
  ------------------
  |  Branch (2242:5): [True: 969, False: 14.3k]
  ------------------
 2243|    969|      if (ch == ']') {
  ------------------
  |  Branch (2243:11): [True: 7, False: 962]
  ------------------
 2244|      7|        return s_http_host_v6_end;
 2245|      7|      }
 2246|       |
 2247|       |    /* FALLTHROUGH */
 2248|  1.03k|    case s_http_host_v6_start:
  ------------------
  |  Branch (2248:5): [True: 68, False: 15.2k]
  ------------------
 2249|  1.03k|      if (IS_HEX(ch) || ch == ':' || ch == '.') {
  ------------------
  |  |  480|  2.06k|#define IS_HEX(c)           (IS_NUM(c) || (LOWER(c) >= 'a' && LOWER(c) <= 'f'))
  |  |  ------------------
  |  |  |  |  478|  2.06k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (478:30): [True: 761, False: 269]
  |  |  |  |  |  Branch (478:44): [True: 208, False: 553]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_HEX(c)           (IS_NUM(c) || (LOWER(c) >= 'a' && LOWER(c) <= 'f'))
  |  |  ------------------
  |  |  |  |  476|    822|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |               #define IS_HEX(c)           (IS_NUM(c) || (LOWER(c) >= 'a' && LOWER(c) <= 'f'))
  |  |  ------------------
  |  |  |  |  476|    227|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |  |  Branch (480:44): [True: 227, False: 595]
  |  |  |  Branch (480:63): [True: 209, False: 18]
  |  |  ------------------
  ------------------
  |  Branch (2249:25): [True: 325, False: 288]
  |  Branch (2249:38): [True: 261, False: 27]
  ------------------
 2250|  1.00k|        return s_http_host_v6;
 2251|  1.00k|      }
 2252|       |
 2253|     27|      break;
 2254|       |
 2255|  1.77k|    case s_http_host_port:
  ------------------
  |  Branch (2255:5): [True: 1.77k, False: 13.5k]
  ------------------
 2256|  1.90k|    case s_http_host_port_start:
  ------------------
  |  Branch (2256:5): [True: 132, False: 15.1k]
  ------------------
 2257|  1.90k|      if (IS_NUM(ch)) {
  ------------------
  |  |  478|  1.90k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 1.89k, False: 5]
  |  |  |  Branch (478:44): [True: 1.89k, False: 3]
  |  |  ------------------
  ------------------
 2258|  1.89k|        return s_http_host_port;
 2259|  1.89k|      }
 2260|       |
 2261|      8|      break;
 2262|       |
 2263|      8|    default:
  ------------------
  |  Branch (2263:5): [True: 0, False: 15.2k]
  ------------------
 2264|      0|      break;
 2265|  15.2k|  }
 2266|    170|  return s_http_host_dead;
 2267|  15.2k|}

_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: 2, False: 0]
  ------------------
   68|      2|    family += (eax >> 20) & 0xff;
   69|      2|    model += ((eax >> 16) & 0xf) << 4;
   70|      2|  }
   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: 2, False: 0]
  ------------------
   78|      2|      family == 15 &&
  ------------------
  |  Branch (78:7): [True: 0, False: 2]
  ------------------
   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|}

_ZN5butil15cpuwide_time_nsEv:
  281|      4|inline int64_t cpuwide_time_ns() {
  282|      4|#if !defined(BAIDU_INTERNAL)
  283|       |    // nearly impossible to get the correct invariant cpu frequency on
  284|       |    // different CPU and machines. CPU-ID rarely works and frequencies
  285|       |    // in "model name" and "cpu Mhz" are both unreliable.
  286|       |    // Since clock_gettime() in newer glibc/kernel is much faster(~30ns)
  287|       |    // which is closer to the previous impl. of cpuwide_time(~10ns), we
  288|       |    // simply use the monotonic time to get rid of all related issues.
  289|      4|    timespec now;
  290|      4|    clock_gettime(CLOCK_MONOTONIC, &now);
  291|      4|    return now.tv_sec * 1000000000L + now.tv_nsec;
  292|       |#else
  293|       |    int64_t cpu_freq = detail::invariant_cpu_freq;
  294|       |    if (cpu_freq > 0) {
  295|       |        const uint64_t tsc = detail::clock_cycles();
  296|       |        //Try to avoid overflow
  297|       |        const uint64_t sec = tsc / cpu_freq;
  298|       |        const uint64_t remain = tsc % cpu_freq;
  299|       |        // TODO: should be OK until CPU's frequency exceeds 16GHz.
  300|       |        return remain * 1000000000L / cpu_freq + sec * 1000000000L;
  301|       |    } else if (!cpu_freq) {
  302|       |        // Lack of necessary features, return system-wide monotonic time instead.
  303|       |        return monotonic_time_ns();
  304|       |    } else {
  305|       |        // Use a thread-unsafe method(OK to us) to initialize the freq
  306|       |        // to save a "if" test comparing to using a local static variable
  307|       |        detail::invariant_cpu_freq = detail::read_invariant_cpu_frequency();
  308|       |        return cpuwide_time_ns();
  309|       |    }
  310|       |#endif // defined(BAIDU_INTERNAL)
  311|      4|}
_ZN5butil15cpuwide_time_usEv:
  321|      4|inline int64_t cpuwide_time_us() {
  322|      4|    return cpuwide_time_ns() / 1000L;
  323|      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|    }
_ZNK4bvar6detail13AgentCombinerIPNS0_7SamplerES3_NS0_14CombineSamplerEE2opEv:
  379|      8|    const BinaryOp& op() const { return _op; }
_ZN4bvar6detail13AgentCombinerIPNS0_7SamplerES3_NS0_14CombineSamplerEE16reset_all_agentsEv:
  292|      2|    ResultTp reset_all_agents() {
  293|      2|        ElementTp prev;
  294|      2|        butil::AutoLock guard(_lock);
  295|      2|        ResultTp tmp = _global_result;
  296|      2|        _global_result = _result_identity;
  297|      2|        for (butil::LinkNode<Agent>* node = _agents.head();
  298|      4|             node != _agents.end(); node = node->next()) {
  ------------------
  |  Branch (298:14): [True: 2, False: 2]
  ------------------
  299|      2|            node->value()->element.exchange(&prev, _element_identity);
  300|      2|            call_op_returning_void(_op, tmp, prev);
  301|      2|        }
  302|      2|        return tmp;
  303|      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:
  331|      8|    Agent* get_or_create_tls_agent() {
  332|      8|        Agent* agent = AgentGroup::get_tls_agent(_id);
  333|      8|        if (!agent) {
  ------------------
  |  Branch (333:13): [True: 2, False: 6]
  ------------------
  334|       |            // Create the agent
  335|      2|            agent = AgentGroup::get_or_create_tls_agent(_id);
  336|      2|            if (NULL == agent) {
  ------------------
  |  Branch (336:17): [True: 0, False: 2]
  ------------------
  337|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  338|      0|                return NULL;
  339|      0|            }
  340|      2|        }
  341|      8|        if (!agent->combiner.expired()) {
  ------------------
  |  Branch (341:13): [True: 6, False: 2]
  ------------------
  342|      6|            return agent;
  343|      6|        }
  344|      2|        agent->reset(_element_identity, this->shared_from_this());
  345|       |        // TODO: Is uniqueness-checking necessary here?
  346|      2|        {
  347|      2|            butil::AutoLock guard(_lock);
  348|      2|            _agents.Append(agent);
  349|      2|        }
  350|      2|        return agent;
  351|      8|    }
_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|    }
_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::cpuwide_time_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::cpuwide_time_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::cpuwide_time_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.23k|{
   36|  2.23k|    if (size < kMinInputLength || size > kMaxInputLength){
  ------------------
  |  |   22|  4.47k|#define kMinInputLength 5
  ------------------
                  if (size < kMinInputLength || size > kMaxInputLength){
  ------------------
  |  |   23|  2.23k|#define kMaxInputLength 4096
  ------------------
  |  Branch (36:9): [True: 4, False: 2.23k]
  |  Branch (36:35): [True: 16, False: 2.21k]
  ------------------
   37|     20|        return 1;
   38|     20|    }
   39|       |
   40|       |    // Use first byte to select mode
   41|  2.21k|    uint8_t mode = data[0] % 4;
   42|  2.21k|    const uint8_t *payload = data + 1;
   43|  2.21k|    size_t payload_size = size - 1;
   44|       |
   45|  2.21k|    switch (mode) {
  ------------------
  |  Branch (45:13): [True: 2.21k, False: 0]
  ------------------
   46|  1.03k|        case 0: {
  ------------------
  |  Branch (46:9): [True: 1.03k, False: 1.18k]
  ------------------
   47|       |            // Fuzz low-level HTTP request parsing
   48|  1.03k|            brpc::http_parser parser;
   49|  1.03k|            brpc::http_parser_init(&parser, brpc::HTTP_REQUEST);
   50|  1.03k|            brpc::http_parser_settings settings;
   51|  1.03k|            memset(&settings, 0, sizeof(settings));
   52|  1.03k|            settings.on_url = on_url_cb;
   53|  1.03k|            settings.on_header_field = on_header_field_cb;
   54|  1.03k|            settings.on_header_value = on_header_value_cb;
   55|  1.03k|            settings.on_body = on_body_cb;
   56|  1.03k|            settings.on_message_begin = on_message_begin_cb;
   57|  1.03k|            settings.on_headers_complete = on_headers_complete_cb;
   58|  1.03k|            settings.on_message_complete = on_message_complete_cb;
   59|  1.03k|            brpc::http_parser_execute(&parser, &settings,
   60|  1.03k|                               reinterpret_cast<const char*>(payload), payload_size);
   61|  1.03k|            break;
   62|      0|        }
   63|    384|        case 1: {
  ------------------
  |  Branch (63:9): [True: 384, False: 1.83k]
  ------------------
   64|       |            // Fuzz low-level HTTP response parsing
   65|    384|            brpc::http_parser parser;
   66|    384|            brpc::http_parser_init(&parser, brpc::HTTP_RESPONSE);
   67|    384|            brpc::http_parser_settings settings;
   68|    384|            memset(&settings, 0, sizeof(settings));
   69|    384|            settings.on_url = on_url_cb;
   70|    384|            settings.on_header_field = on_header_field_cb;
   71|    384|            settings.on_header_value = on_header_value_cb;
   72|    384|            settings.on_body = on_body_cb;
   73|    384|            settings.on_message_begin = on_message_begin_cb;
   74|    384|            settings.on_headers_complete = on_headers_complete_cb;
   75|    384|            settings.on_message_complete = on_message_complete_cb;
   76|    384|            brpc::http_parser_execute(&parser, &settings,
   77|    384|                               reinterpret_cast<const char*>(payload), payload_size);
   78|    384|            break;
   79|      0|        }
   80|    101|        case 2: {
  ------------------
  |  Branch (80:9): [True: 101, False: 2.11k]
  ------------------
   81|       |            // Fuzz URL parsing (not connect)
   82|    101|            brpc::http_parser_url u;
   83|    101|            brpc::http_parser_parse_url(reinterpret_cast<const char*>(payload),
   84|    101|                                       payload_size, 0, &u);
   85|    101|            break;
   86|      0|        }
   87|    698|        case 3: {
  ------------------
  |  Branch (87:9): [True: 698, False: 1.51k]
  ------------------
   88|       |            // Fuzz URL parsing (connect mode)
   89|    698|            brpc::http_parser_url u;
   90|    698|            brpc::http_parser_parse_url(reinterpret_cast<const char*>(payload),
   91|    698|                                       payload_size, 1, &u);
   92|    698|            break;
   93|      0|        }
   94|  2.21k|    }
   95|       |
   96|  2.21k|    return 0;
   97|  2.21k|}
fuzz_http_parser.cpp:_ZL9on_url_cbPN4brpc11http_parserEPKcm:
   25|  2.18k|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.74k|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|  6.03k|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|      3|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|  5.16k|static int on_message_begin_cb(brpc::http_parser* p) { return 0; }
fuzz_http_parser.cpp:_ZL22on_headers_complete_cbPN4brpc11http_parserE:
   30|  3.14k|static int on_headers_complete_cb(brpc::http_parser* p) { return 0; }
fuzz_http_parser.cpp:_ZL22on_message_complete_cbPN4brpc11http_parserE:
   31|  3.10k|static int on_message_complete_cb(brpc::http_parser* p) { return 0; }

