_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|  2.77k|{
  695|  2.77k|  char c, ch;
  696|  2.77k|  int8_t unhex_val;
  697|  2.77k|  const char *p = data;
  698|  2.77k|  const char *header_field_mark = 0;
  699|  2.77k|  const char *header_value_mark = 0;
  700|  2.77k|  const char *url_mark = 0;
  701|  2.77k|  const char *body_mark = 0;
  702|  2.77k|  const char *status_mark = 0;
  703|  2.77k|  const unsigned int lenient = parser->lenient_http_headers;
  704|  2.77k|  const unsigned int allow_chunked_length = parser->allow_chunked_length;
  705|       |
  706|       |  /* We're in an error state. Don't bother doing anything. */
  707|  2.77k|  if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {
  ------------------
  |  |  204|  2.77k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  ------------------
  |  Branch (707:7): [True: 0, False: 2.77k]
  ------------------
  708|      0|    return 0;
  709|      0|  }
  710|       |
  711|  2.77k|  if (len == 0) {
  ------------------
  |  Branch (711:7): [True: 0, False: 2.77k]
  ------------------
  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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|  2.77k|  if (parser->state == s_header_field)
  ------------------
  |  Branch (733:7): [True: 0, False: 2.77k]
  ------------------
  734|      0|    header_field_mark = data;
  735|  2.77k|  if (parser->state == s_header_value)
  ------------------
  |  Branch (735:7): [True: 0, False: 2.77k]
  ------------------
  736|      0|    header_value_mark = data;
  737|  2.77k|  switch (parser->state) {
  ------------------
  |  Branch (737:11): [True: 0, False: 2.77k]
  ------------------
  738|      0|  case s_req_path:
  ------------------
  |  Branch (738:3): [True: 0, False: 2.77k]
  ------------------
  739|      0|  case s_req_scheme:
  ------------------
  |  Branch (739:3): [True: 0, False: 2.77k]
  ------------------
  740|      0|  case s_req_scheme_slash:
  ------------------
  |  Branch (740:3): [True: 0, False: 2.77k]
  ------------------
  741|      0|  case s_req_scheme_slash_slash:
  ------------------
  |  Branch (741:3): [True: 0, False: 2.77k]
  ------------------
  742|      0|  case s_req_server_start:
  ------------------
  |  Branch (742:3): [True: 0, False: 2.77k]
  ------------------
  743|      0|  case s_req_server:
  ------------------
  |  Branch (743:3): [True: 0, False: 2.77k]
  ------------------
  744|      0|  case s_req_server_with_at:
  ------------------
  |  Branch (744:3): [True: 0, False: 2.77k]
  ------------------
  745|      0|  case s_req_query_string_start:
  ------------------
  |  Branch (745:3): [True: 0, False: 2.77k]
  ------------------
  746|      0|  case s_req_query_string:
  ------------------
  |  Branch (746:3): [True: 0, False: 2.77k]
  ------------------
  747|      0|  case s_req_fragment_start:
  ------------------
  |  Branch (747:3): [True: 0, False: 2.77k]
  ------------------
  748|      0|  case s_req_fragment:
  ------------------
  |  Branch (748:3): [True: 0, False: 2.77k]
  ------------------
  749|      0|    url_mark = data;
  750|      0|    break;
  751|      0|  case s_res_status:
  ------------------
  |  Branch (751:3): [True: 0, False: 2.77k]
  ------------------
  752|      0|    status_mark = data;
  753|      0|    break;
  754|  2.77k|  }
  755|       |
  756|   265k|  for (p=data; p != data + len; p++) {
  ------------------
  |  Branch (756:16): [True: 263k, False: 2.26k]
  ------------------
  757|   263k|    ch = *p;
  758|       |
  759|   263k|    if (PARSING_HEADER(parser->state)) {
  ------------------
  |  |  393|   263k|#define PARSING_HEADER(state) (state <= s_headers_done)
  |  |  ------------------
  |  |  |  Branch (393:31): [True: 260k, False: 3.06k]
  |  |  ------------------
  ------------------
  760|   260k|      ++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|   260k|      if (parser->nread > (BRPC_HTTP_MAX_HEADER_SIZE)) {
  ------------------
  |  |   61|   260k|# define BRPC_HTTP_MAX_HEADER_SIZE (80*1024)
  ------------------
  |  Branch (772:11): [True: 0, False: 260k]
  ------------------
  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|   260k|    }
  777|       |
  778|   292k|    reexecute_byte:
  779|   292k|    switch (parser->state) {
  780|       |
  781|    391|      case s_dead:
  ------------------
  |  Branch (781:7): [True: 391, False: 291k]
  ------------------
  782|       |        /* this state is used after a 'Connection: close' message
  783|       |         * the parser will error out if it reads another message
  784|       |         */
  785|    391|        if (ch == CR || ch == LF)
  ------------------
  |  |  474|    782|#define CR                  '\r'
  ------------------
                      if (ch == CR || ch == LF)
  ------------------
  |  |  475|    197|#define LF                  '\n'
  ------------------
  |  Branch (785:13): [True: 194, False: 197]
  |  Branch (785:25): [True: 194, False: 3]
  ------------------
  786|    388|          break;
  787|       |
  788|      3|        SET_ERRNO(HPE_CLOSED_CONNECTION);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
  789|      3|        goto error;
  790|       |
  791|      0|      case s_start_req_or_res:
  ------------------
  |  Branch (791:7): [True: 0, False: 292k]
  ------------------
  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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: 292k]
  ------------------
  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|  3.88k|      case s_start_res:
  ------------------
  |  Branch (829:7): [True: 3.88k, False: 288k]
  ------------------
  830|  3.88k|      {
  831|  3.88k|        parser->flags = 0;
  832|  3.88k|        parser->uses_transfer_encoding = 0;
  833|  3.88k|        parser->content_length = ULLONG_MAX;
  834|       |
  835|  3.88k|        switch (ch) {
  836|  3.46k|          case 'H':
  ------------------
  |  Branch (836:11): [True: 3.46k, False: 419]
  ------------------
  837|  3.46k|            parser->state = s_res_H;
  838|  3.46k|            break;
  839|       |
  840|    196|          case CR:
  ------------------
  |  |  474|    196|#define CR                  '\r'
  ------------------
  |  Branch (840:11): [True: 196, False: 3.68k]
  ------------------
  841|    409|          case LF:
  ------------------
  |  |  475|    409|#define LF                  '\n'
  ------------------
  |  Branch (841:11): [True: 213, False: 3.67k]
  ------------------
  842|    409|            break;
  843|       |
  844|     10|          default:
  ------------------
  |  Branch (844:11): [True: 10, False: 3.87k]
  ------------------
  845|     10|            SET_ERRNO(HPE_INVALID_CONSTANT);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
  846|     10|            goto error;
  847|  3.88k|        }
  848|       |
  849|  3.87k|        CALLBACK_NOTIFY(message_begin);
  ------------------
  |  |   78|  3.87k|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|  3.87k|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|  3.87k|do {                                                                 \
  |  |  |  |   63|  3.87k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|  3.87k|                                                                     \
  |  |  |  |   65|  3.87k|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 3.87k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|  3.87k|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 3.87k]
  |  |  |  |  ------------------
  |  |  |  |   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.87k|                                                                     \
  |  |  |  |   70|  3.87k|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|  3.87k|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  3.87k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 3.87k]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|  3.87k|  }                                                                  \
  |  |  |  |   75|  3.87k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 3.87k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  850|  3.87k|        break;
  851|  3.87k|      }
  852|       |
  853|  3.87k|      case s_res_H:
  ------------------
  |  Branch (853:7): [True: 3.45k, False: 288k]
  ------------------
  854|  3.45k|        STRICT_CHECK(ch != 'T');
  ------------------
  |  |  513|  3.45k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  3.45k|do {                                                                 \
  |  |  515|  3.45k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 10, False: 3.44k]
  |  |  ------------------
  |  |  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|  3.45k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 3.44k]
  |  |  ------------------
  ------------------
  855|  3.44k|        parser->state = s_res_HT;
  856|  3.44k|        break;
  857|       |
  858|  3.44k|      case s_res_HT:
  ------------------
  |  Branch (858:7): [True: 3.44k, False: 288k]
  ------------------
  859|  3.44k|        STRICT_CHECK(ch != 'T');
  ------------------
  |  |  513|  3.44k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  3.44k|do {                                                                 \
  |  |  515|  3.44k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 12, False: 3.43k]
  |  |  ------------------
  |  |  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|  3.44k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  860|  3.43k|        parser->state = s_res_HTT;
  861|  3.43k|        break;
  862|       |
  863|  3.42k|      case s_res_HTT:
  ------------------
  |  Branch (863:7): [True: 3.42k, False: 288k]
  ------------------
  864|  3.42k|        STRICT_CHECK(ch != 'P');
  ------------------
  |  |  513|  3.42k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  3.42k|do {                                                                 \
  |  |  515|  3.42k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 13, False: 3.41k]
  |  |  ------------------
  |  |  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|  3.42k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 3.41k]
  |  |  ------------------
  ------------------
  865|  3.41k|        parser->state = s_res_HTTP;
  866|  3.41k|        break;
  867|       |
  868|  3.40k|      case s_res_HTTP:
  ------------------
  |  Branch (868:7): [True: 3.40k, False: 288k]
  ------------------
  869|  3.40k|        STRICT_CHECK(ch != '/');
  ------------------
  |  |  513|  3.40k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  3.40k|do {                                                                 \
  |  |  515|  3.40k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 11, False: 3.39k]
  |  |  ------------------
  |  |  516|     11|    SET_ERRNO(HPE_STRICT);                                           \
  |  |  ------------------
  |  |  |  |   54|     11|#define SET_ERRNO(e)                                                 \
  |  |  |  |   55|     11|do {                                                                 \
  |  |  |  |   56|     11|  parser->http_errno = (e);                                          \
  |  |  |  |   57|     11|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:9): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|     11|    goto error;                                                      \
  |  |  518|     11|  }                                                                  \
  |  |  519|  3.40k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
  870|  3.39k|        parser->state = s_res_first_http_major;
  871|  3.39k|        break;
  872|       |
  873|  3.39k|      case s_res_first_http_major:
  ------------------
  |  Branch (873:7): [True: 3.39k, False: 288k]
  ------------------
  874|  3.39k|        if (ch < '0' || ch > '9') {
  ------------------
  |  Branch (874:13): [True: 9, False: 3.38k]
  |  Branch (874:25): [True: 5, False: 3.38k]
  ------------------
  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|  3.38k|        parser->http_major = ch - '0';
  880|  3.38k|        parser->state = s_res_http_major;
  881|  3.38k|        break;
  882|       |
  883|       |      /* major HTTP version or dot */
  884|  3.60k|      case s_res_http_major:
  ------------------
  |  Branch (884:7): [True: 3.60k, False: 288k]
  ------------------
  885|  3.60k|      {
  886|  3.60k|        if (ch == '.') {
  ------------------
  |  Branch (886:13): [True: 3.33k, False: 277]
  ------------------
  887|  3.33k|          parser->state = s_res_first_http_minor;
  888|  3.33k|          break;
  889|  3.33k|        }
  890|       |
  891|    277|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|    277|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 268, False: 9]
  |  |  |  Branch (478:44): [True: 262, False: 6]
  |  |  ------------------
  ------------------
  892|     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]
  |  |  ------------------
  ------------------
  893|     15|          goto error;
  894|     15|        }
  895|       |
  896|    262|        parser->http_major *= 10;
  897|    262|        parser->http_major += ch - '0';
  898|       |
  899|    262|        if (parser->http_major > 999) {
  ------------------
  |  Branch (899:13): [True: 3, False: 259]
  ------------------
  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|    259|        break;
  905|    262|      }
  906|       |
  907|       |      /* first digit of minor HTTP version */
  908|  3.32k|      case s_res_first_http_minor:
  ------------------
  |  Branch (908:7): [True: 3.32k, False: 288k]
  ------------------
  909|  3.32k|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|  3.32k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 3.31k, False: 8]
  |  |  |  Branch (478:44): [True: 3.31k, False: 6]
  |  |  ------------------
  ------------------
  910|     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]
  |  |  ------------------
  ------------------
  911|     14|          goto error;
  912|     14|        }
  913|       |
  914|  3.31k|        parser->http_minor = ch - '0';
  915|  3.31k|        parser->state = s_res_http_minor;
  916|  3.31k|        break;
  917|       |
  918|       |      /* minor HTTP version or end of request line */
  919|  3.54k|      case s_res_http_minor:
  ------------------
  |  Branch (919:7): [True: 3.54k, False: 288k]
  ------------------
  920|  3.54k|      {
  921|  3.54k|        if (ch == ' ') {
  ------------------
  |  Branch (921:13): [True: 3.27k, False: 272]
  ------------------
  922|  3.27k|          parser->state = s_res_first_status_code;
  923|  3.27k|          break;
  924|  3.27k|        }
  925|       |
  926|    272|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|    272|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 271, False: 1]
  |  |  |  Branch (478:44): [True: 268, False: 3]
  |  |  ------------------
  ------------------
  927|      4|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|      4|#define SET_ERRNO(e)                                                 \
  |  |   55|      4|do {                                                                 \
  |  |   56|      4|  parser->http_errno = (e);                                          \
  |  |   57|      4|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 4]
  |  |  ------------------
  ------------------
  928|      4|          goto error;
  929|      4|        }
  930|       |
  931|    268|        parser->http_minor *= 10;
  932|    268|        parser->http_minor += ch - '0';
  933|       |
  934|    268|        if (parser->http_minor > 999) {
  ------------------
  |  Branch (934:13): [True: 3, False: 265]
  ------------------
  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|    265|        break;
  940|    268|      }
  941|       |
  942|  3.46k|      case s_res_first_status_code:
  ------------------
  |  Branch (942:7): [True: 3.46k, False: 288k]
  ------------------
  943|  3.46k|      {
  944|  3.46k|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|  3.46k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 3.25k, False: 210]
  |  |  |  Branch (478:44): [True: 3.24k, False: 6]
  |  |  ------------------
  ------------------
  945|    216|          if (ch == ' ') {
  ------------------
  |  Branch (945:15): [True: 203, False: 13]
  ------------------
  946|    203|            break;
  947|    203|          }
  948|       |
  949|     13|          SET_ERRNO(HPE_INVALID_STATUS);
  ------------------
  |  |   54|     13|#define SET_ERRNO(e)                                                 \
  |  |   55|     13|do {                                                                 \
  |  |   56|     13|  parser->http_errno = (e);                                          \
  |  |   57|     13|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 13]
  |  |  ------------------
  ------------------
  950|     13|          goto error;
  951|    216|        }
  952|  3.24k|        parser->status_code = ch - '0';
  953|  3.24k|        parser->state = s_res_status_code;
  954|  3.24k|        break;
  955|  3.46k|      }
  956|       |
  957|  8.71k|      case s_res_status_code:
  ------------------
  |  Branch (957:7): [True: 8.71k, False: 283k]
  ------------------
  958|  8.71k|      {
  959|  8.71k|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|  8.71k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 5.50k, False: 3.21k]
  |  |  |  Branch (478:44): [True: 5.49k, False: 6]
  |  |  ------------------
  ------------------
  960|  3.21k|          switch (ch) {
  961|    944|            case ' ':
  ------------------
  |  Branch (961:13): [True: 944, False: 2.27k]
  ------------------
  962|    944|              parser->state = s_res_status_start;
  963|    944|              break;
  964|    250|            case CR:
  ------------------
  |  |  474|    250|#define CR                  '\r'
  ------------------
  |  Branch (964:13): [True: 250, False: 2.96k]
  ------------------
  965|    250|              parser->state = s_res_line_almost_done;
  966|    250|              break;
  967|  2.01k|            case LF:
  ------------------
  |  |  475|  2.01k|#define LF                  '\n'
  ------------------
  |  Branch (967:13): [True: 2.01k, False: 1.20k]
  ------------------
  968|  2.01k|              parser->state = s_header_field_start;
  969|  2.01k|              break;
  970|     12|            default:
  ------------------
  |  Branch (970:13): [True: 12, False: 3.20k]
  ------------------
  971|     12|              SET_ERRNO(HPE_INVALID_STATUS);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
  972|     12|              goto error;
  973|  3.21k|          }
  974|  3.20k|          break;
  975|  3.21k|        }
  976|       |
  977|  5.49k|        parser->status_code *= 10;
  978|  5.49k|        parser->status_code += ch - '0';
  979|       |
  980|  5.49k|        if (parser->status_code > 999) {
  ------------------
  |  Branch (980:13): [True: 3, False: 5.49k]
  ------------------
  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|  5.49k|        break;
  986|  5.49k|      }
  987|       |
  988|  5.49k|      case s_res_status_start:
  ------------------
  |  Branch (988:7): [True: 939, False: 291k]
  ------------------
  989|    939|      {
  990|    939|        if (ch == CR) {
  ------------------
  |  |  474|    939|#define CR                  '\r'
  ------------------
  |  Branch (990:13): [True: 195, False: 744]
  ------------------
  991|    195|          parser->state = s_res_line_almost_done;
  992|    195|          break;
  993|    195|        }
  994|       |
  995|    744|        if (ch == LF) {
  ------------------
  |  |  475|    744|#define LF                  '\n'
  ------------------
  |  Branch (995:13): [True: 309, False: 435]
  ------------------
  996|    309|          parser->state = s_header_field_start;
  997|    309|          break;
  998|    309|        }
  999|       |
 1000|    435|        MARK(status);
  ------------------
  |  |  112|    435|#define MARK(FOR)                                                    \
  |  |  113|    435|do {                                                                 \
  |  |  114|    435|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 435, False: 0]
  |  |  ------------------
  |  |  115|    435|    FOR##_mark = p;                                                  \
  |  |  116|    435|  }                                                                  \
  |  |  117|    435|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 435]
  |  |  ------------------
  ------------------
 1001|    435|        parser->state = s_res_status;
 1002|    435|        parser->index = 0;
 1003|    435|        break;
 1004|    744|      }
 1005|       |
 1006|    642|      case s_res_status:
  ------------------
  |  Branch (1006:7): [True: 642, False: 291k]
  ------------------
 1007|    642|        if (ch == CR) {
  ------------------
  |  |  474|    642|#define CR                  '\r'
  ------------------
  |  Branch (1007:13): [True: 194, False: 448]
  ------------------
 1008|    194|          parser->state = s_res_line_almost_done;
 1009|    194|          CALLBACK_DATA(status);
  ------------------
  |  |  105|    194|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|    194|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    194|do {                                                                 \
  |  |  |  |   86|    194|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    194|                                                                     \
  |  |  |  |   88|    194|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 194, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|    194|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 0, False: 194]
  |  |  |  |  ------------------
  |  |  |  |   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|    194|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    194|  }                                                                  \
  |  |  |  |  101|    194|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 194]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1010|    194|          break;
 1011|    194|        }
 1012|       |
 1013|    448|        if (ch == LF) {
  ------------------
  |  |  475|    448|#define LF                  '\n'
  ------------------
  |  Branch (1013:13): [True: 229, False: 219]
  ------------------
 1014|    229|          parser->state = s_header_field_start;
 1015|    229|          CALLBACK_DATA(status);
  ------------------
  |  |  105|    229|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|    229|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    229|do {                                                                 \
  |  |  |  |   86|    229|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    229|                                                                     \
  |  |  |  |   88|    229|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 229, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|    229|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 0, False: 229]
  |  |  |  |  ------------------
  |  |  |  |   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|    229|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    229|  }                                                                  \
  |  |  |  |  101|    229|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 229]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1016|    229|          break;
 1017|    229|        }
 1018|       |
 1019|    219|        break;
 1020|       |
 1021|    617|      case s_res_line_almost_done:
  ------------------
  |  Branch (1021:7): [True: 617, False: 291k]
  ------------------
 1022|    617|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|    617|# define STRICT_CHECK(cond)                                          \
  |  |  514|    617|do {                                                                 \
  |  |  515|    617|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 1, False: 616]
  |  |  ------------------
  |  |  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|    617|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 616]
  |  |  ------------------
  ------------------
 1023|    616|        parser->state = s_header_field_start;
 1024|    616|        break;
 1025|       |
 1026|  5.46k|      case s_start_req:
  ------------------
  |  Branch (1026:7): [True: 5.46k, False: 286k]
  ------------------
 1027|  5.46k|      {
 1028|  5.46k|        if (ch == CR || ch == LF)
  ------------------
  |  |  474|  10.9k|#define CR                  '\r'
  ------------------
                      if (ch == CR || ch == LF)
  ------------------
  |  |  475|  5.22k|#define LF                  '\n'
  ------------------
  |  Branch (1028:13): [True: 235, False: 5.22k]
  |  Branch (1028:25): [True: 225, False: 5.00k]
  ------------------
 1029|    460|          break;
 1030|  5.00k|        parser->flags = 0;
 1031|  5.00k|        parser->uses_transfer_encoding = 0;
 1032|  5.00k|        parser->content_length = ULLONG_MAX;
 1033|       |
 1034|  5.00k|        if (!IS_ALPHA(ch)) {
  ------------------
  |  |  477|  5.00k|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|  5.00k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|  4.99k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |  |  Branch (477:30): [True: 4.99k, False: 4]
  |  |  |  Branch (477:49): [True: 4.99k, False: 7]
  |  |  ------------------
  ------------------
 1035|     11|          SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|     11|#define SET_ERRNO(e)                                                 \
  |  |   55|     11|do {                                                                 \
  |  |   56|     11|  parser->http_errno = (e);                                          \
  |  |   57|     11|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 11]
  |  |  ------------------
  ------------------
 1036|     11|          goto error;
 1037|     11|        }
 1038|       |
 1039|  4.99k|        parser->method = (enum http_method) 0;
 1040|  4.99k|        parser->index = 1;
 1041|  4.99k|        switch (ch) {
 1042|     23|          case 'C': parser->method = HTTP_CONNECT; /* or COPY, CHECKOUT */ break;
  ------------------
  |  Branch (1042:11): [True: 23, False: 4.96k]
  ------------------
 1043|      2|          case 'D': parser->method = HTTP_DELETE; break;
  ------------------
  |  Branch (1043:11): [True: 2, False: 4.98k]
  ------------------
 1044|  4.11k|          case 'G': parser->method = HTTP_GET; break;
  ------------------
  |  Branch (1044:11): [True: 4.11k, False: 877]
  ------------------
 1045|    268|          case 'H': parser->method = HTTP_HEAD; break;
  ------------------
  |  Branch (1045:11): [True: 268, False: 4.72k]
  ------------------
 1046|     77|          case 'L': parser->method = HTTP_LOCK; break;
  ------------------
  |  Branch (1046:11): [True: 77, False: 4.91k]
  ------------------
 1047|     55|          case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH, MKCALENDAR */ break;
  ------------------
  |  Branch (1047:11): [True: 55, False: 4.93k]
  ------------------
 1048|      1|          case 'N': parser->method = HTTP_NOTIFY; break;
  ------------------
  |  Branch (1048:11): [True: 1, False: 4.98k]
  ------------------
 1049|      1|          case 'O': parser->method = HTTP_OPTIONS; break;
  ------------------
  |  Branch (1049:11): [True: 1, False: 4.98k]
  ------------------
 1050|    421|          case 'P': parser->method = HTTP_POST;
  ------------------
  |  Branch (1050:11): [True: 421, False: 4.56k]
  ------------------
 1051|       |            /* or PROPFIND|PROPPATCH|PUT|PATCH|PURGE */
 1052|    421|            break;
 1053|      2|          case 'R': parser->method = HTTP_REPORT; break;
  ------------------
  |  Branch (1053:11): [True: 2, False: 4.98k]
  ------------------
 1054|     13|          case 'S': parser->method = HTTP_SUBSCRIBE; /* or SEARCH */ break;
  ------------------
  |  Branch (1054:11): [True: 13, False: 4.97k]
  ------------------
 1055|      1|          case 'T': parser->method = HTTP_TRACE; break;
  ------------------
  |  Branch (1055:11): [True: 1, False: 4.98k]
  ------------------
 1056|     11|          case 'U': parser->method = HTTP_UNLOCK; /* or UNSUBSCRIBE */ break;
  ------------------
  |  Branch (1056:11): [True: 11, False: 4.97k]
  ------------------
 1057|      2|          default:
  ------------------
  |  Branch (1057:11): [True: 2, False: 4.98k]
  ------------------
 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|  4.99k|        }
 1061|  4.98k|        parser->state = s_req_method;
 1062|       |
 1063|  4.98k|        CALLBACK_NOTIFY(message_begin);
  ------------------
  |  |   78|  4.98k|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|  4.98k|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|  4.98k|do {                                                                 \
  |  |  |  |   63|  4.98k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|  4.98k|                                                                     \
  |  |  |  |   65|  4.98k|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 4.98k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|  4.98k|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 4.98k]
  |  |  |  |  ------------------
  |  |  |  |   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|  4.98k|                                                                     \
  |  |  |  |   70|  4.98k|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|  4.98k|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  4.98k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 4.98k]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|  4.98k|  }                                                                  \
  |  |  |  |   75|  4.98k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 4.98k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1064|       |
 1065|  4.98k|        break;
 1066|  4.98k|      }
 1067|       |
 1068|  15.0k|      case s_req_method:
  ------------------
  |  Branch (1068:7): [True: 15.0k, False: 277k]
  ------------------
 1069|  15.0k|      {
 1070|  15.0k|        const char *matcher;
 1071|  15.0k|        if (ch == '\0') {
  ------------------
  |  Branch (1071:13): [True: 1, False: 15.0k]
  ------------------
 1072|      1|          SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1073|      1|          goto error;
 1074|      1|        }
 1075|       |
 1076|  15.0k|        matcher = method_strings[parser->method];
 1077|  15.0k|        if (ch == ' ' && matcher[parser->index] == '\0') {
  ------------------
  |  Branch (1077:13): [True: 4.80k, False: 10.2k]
  |  Branch (1077:26): [True: 4.79k, False: 5]
  ------------------
 1078|  4.79k|          parser->state = s_req_spaces_before_url;
 1079|  10.2k|        } else if (ch == matcher[parser->index]) {
  ------------------
  |  Branch (1079:20): [True: 9.72k, False: 572]
  ------------------
 1080|  9.72k|          ; /* nada */
 1081|  9.72k|        } else if (parser->method == HTTP_CONNECT) {
  ------------------
  |  Branch (1081:20): [True: 19, False: 553]
  ------------------
 1082|     19|          if (parser->index == 1 && ch == 'H') {
  ------------------
  |  Branch (1082:15): [True: 2, False: 17]
  |  Branch (1082:37): [True: 1, False: 1]
  ------------------
 1083|      1|            parser->method = HTTP_CHECKOUT;
 1084|     18|          } else if (parser->index == 2  && ch == 'P') {
  ------------------
  |  Branch (1084:22): [True: 15, False: 3]
  |  Branch (1084:45): [True: 4, False: 11]
  ------------------
 1085|      4|            parser->method = HTTP_COPY;
 1086|     14|          } else {
 1087|     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]
  |  |  ------------------
  ------------------
 1088|     14|            goto error;
 1089|     14|          }
 1090|    553|        } else if (parser->method == HTTP_MKCOL) {
  ------------------
  |  Branch (1090:20): [True: 53, False: 500]
  ------------------
 1091|     53|          if (parser->index == 1 && ch == 'O') {
  ------------------
  |  Branch (1091:15): [True: 25, False: 28]
  |  Branch (1091:37): [True: 2, False: 23]
  ------------------
 1092|      2|            parser->method = HTTP_MOVE;
 1093|     51|          } else if (parser->index == 1 && ch == 'E') {
  ------------------
  |  Branch (1093:22): [True: 23, False: 28]
  |  Branch (1093:44): [True: 2, False: 21]
  ------------------
 1094|      2|            parser->method = HTTP_MERGE;
 1095|     49|          } else if (parser->index == 1 && ch == '-') {
  ------------------
  |  Branch (1095:22): [True: 21, False: 28]
  |  Branch (1095:44): [True: 1, False: 20]
  ------------------
 1096|      1|            parser->method = HTTP_MSEARCH;
 1097|     48|          } else if (parser->index == 2 && ch == 'A') {
  ------------------
  |  Branch (1097:22): [True: 13, False: 35]
  |  Branch (1097:44): [True: 2, False: 11]
  ------------------
 1098|      2|            parser->method = HTTP_MKACTIVITY;
 1099|     46|          } else if (parser->index == 3 && ch == 'A') {
  ------------------
  |  Branch (1099:22): [True: 13, False: 33]
  |  Branch (1099:44): [True: 3, False: 10]
  ------------------
 1100|      3|            parser->method = HTTP_MKCALENDAR;
 1101|     43|          } else {
 1102|     43|            SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|     43|#define SET_ERRNO(e)                                                 \
  |  |   55|     43|do {                                                                 \
  |  |   56|     43|  parser->http_errno = (e);                                          \
  |  |   57|     43|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 43]
  |  |  ------------------
  ------------------
 1103|     43|            goto error;
 1104|     43|          }
 1105|    500|        } else if (parser->method == HTTP_SUBSCRIBE) {
  ------------------
  |  Branch (1105:20): [True: 13, False: 487]
  ------------------
 1106|     13|          if (parser->index == 1 && ch == 'E') {
  ------------------
  |  Branch (1106:15): [True: 11, False: 2]
  |  Branch (1106:37): [True: 1, False: 10]
  ------------------
 1107|      1|            parser->method = HTTP_SEARCH;
 1108|     12|          } else {
 1109|     12|            SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|     12|#define SET_ERRNO(e)                                                 \
  |  |   55|     12|do {                                                                 \
  |  |   56|     12|  parser->http_errno = (e);                                          \
  |  |   57|     12|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 12]
  |  |  ------------------
  ------------------
 1110|     12|            goto error;
 1111|     12|          }
 1112|    487|        } else if (parser->index == 1 && parser->method == HTTP_POST) {
  ------------------
  |  Branch (1112:20): [True: 424, False: 63]
  |  Branch (1112:42): [True: 415, False: 9]
  ------------------
 1113|    415|          if (ch == 'R') {
  ------------------
  |  Branch (1113:15): [True: 13, False: 402]
  ------------------
 1114|     13|            parser->method = HTTP_PROPFIND; /* or HTTP_PROPPATCH */
 1115|    402|          } else if (ch == 'U') {
  ------------------
  |  Branch (1115:22): [True: 379, False: 23]
  ------------------
 1116|    379|            parser->method = HTTP_PUT; /* or HTTP_PURGE */
 1117|    379|          } else if (ch == 'A') {
  ------------------
  |  Branch (1117:22): [True: 2, False: 21]
  ------------------
 1118|      2|            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|    415|        } else if (parser->index == 2) {
  ------------------
  |  Branch (1123:20): [True: 36, False: 36]
  ------------------
 1124|     36|          if (parser->method == HTTP_PUT) {
  ------------------
  |  Branch (1124:15): [True: 12, False: 24]
  ------------------
 1125|     12|            if (ch == 'R') {
  ------------------
  |  Branch (1125:17): [True: 1, False: 11]
  ------------------
 1126|      1|              parser->method = HTTP_PURGE;
 1127|     11|            } else {
 1128|     11|              SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|     11|#define SET_ERRNO(e)                                                 \
  |  |   55|     11|do {                                                                 \
  |  |   56|     11|  parser->http_errno = (e);                                          \
  |  |   57|     11|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 11]
  |  |  ------------------
  ------------------
 1129|     11|              goto error;
 1130|     11|            }
 1131|     24|          } else if (parser->method == HTTP_UNLOCK) {
  ------------------
  |  Branch (1131:22): [True: 10, False: 14]
  ------------------
 1132|     10|            if (ch == 'S') {
  ------------------
  |  Branch (1132:17): [True: 1, False: 9]
  ------------------
 1133|      1|              parser->method = HTTP_UNSUBSCRIBE;
 1134|      9|            } else {
 1135|      9|              SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|      9|#define SET_ERRNO(e)                                                 \
  |  |   55|      9|do {                                                                 \
  |  |   56|      9|  parser->http_errno = (e);                                          \
  |  |   57|      9|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 9]
  |  |  ------------------
  ------------------
 1136|      9|              goto error;
 1137|      9|            }
 1138|     14|          } else {
 1139|     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]
  |  |  ------------------
  ------------------
 1140|     14|            goto error;
 1141|     14|          }
 1142|     36|        } else if (parser->index == 4 && parser->method == HTTP_PROPFIND && ch == 'P') {
  ------------------
  |  Branch (1142:20): [True: 20, False: 16]
  |  Branch (1142:42): [True: 12, False: 8]
  |  Branch (1142:77): [True: 3, False: 9]
  ------------------
 1143|      3|          parser->method = HTTP_PROPPATCH;
 1144|     33|        } else {
 1145|     33|          SET_ERRNO(HPE_INVALID_METHOD);
  ------------------
  |  |   54|     33|#define SET_ERRNO(e)                                                 \
  |  |   55|     33|do {                                                                 \
  |  |   56|     33|  parser->http_errno = (e);                                          \
  |  |   57|     33|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 33]
  |  |  ------------------
  ------------------
 1146|     33|          goto error;
 1147|     33|        }
 1148|       |
 1149|  14.9k|        ++parser->index;
 1150|  14.9k|        break;
 1151|  15.0k|      }
 1152|       |
 1153|  4.99k|      case s_req_spaces_before_url:
  ------------------
  |  Branch (1153:7): [True: 4.99k, False: 287k]
  ------------------
 1154|  4.99k|      {
 1155|  4.99k|        if (ch == ' ') break;
  ------------------
  |  Branch (1155:13): [True: 214, False: 4.78k]
  ------------------
 1156|       |
 1157|  4.78k|        MARK(url);
  ------------------
  |  |  112|  4.78k|#define MARK(FOR)                                                    \
  |  |  113|  4.78k|do {                                                                 \
  |  |  114|  4.78k|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 4.78k, False: 0]
  |  |  ------------------
  |  |  115|  4.78k|    FOR##_mark = p;                                                  \
  |  |  116|  4.78k|  }                                                                  \
  |  |  117|  4.78k|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 4.78k]
  |  |  ------------------
  ------------------
 1158|  4.78k|        if (parser->method == HTTP_CONNECT) {
  ------------------
  |  Branch (1158:13): [True: 3, False: 4.78k]
  ------------------
 1159|      3|          parser->state = s_req_server_start;
 1160|      3|        }
 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|  4.78k|        enum state new_state = parse_url_char((enum state)parser->state, ch);
 1168|  4.78k|        if (new_state == s_dead) {
  ------------------
  |  Branch (1168:13): [True: 3, False: 4.78k]
  ------------------
 1169|      3|          SET_ERRNO(HPE_INVALID_URL);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1170|      3|          goto error;
 1171|      3|        }
 1172|  4.78k|        parser->state = new_state;
 1173|       |
 1174|  4.78k|        break;
 1175|  4.78k|      }
 1176|       |
 1177|    660|      case s_req_scheme:
  ------------------
  |  Branch (1177:7): [True: 660, False: 291k]
  ------------------
 1178|  1.11k|      case s_req_scheme_slash:
  ------------------
  |  Branch (1178:7): [True: 455, False: 291k]
  ------------------
 1179|  1.56k|      case s_req_scheme_slash_slash:
  ------------------
  |  Branch (1179:7): [True: 450, False: 291k]
  ------------------
 1180|  2.01k|      case s_req_server_start:
  ------------------
  |  Branch (1180:7): [True: 445, False: 291k]
  ------------------
 1181|  2.01k|      {
 1182|  2.01k|        enum state new_state;
 1183|  2.01k|        switch (ch) {
 1184|       |          /* No whitespace allowed here */
 1185|      2|          case ' ':
  ------------------
  |  Branch (1185:11): [True: 2, False: 2.00k]
  ------------------
 1186|      3|          case CR:
  ------------------
  |  |  474|      3|#define CR                  '\r'
  ------------------
  |  Branch (1186:11): [True: 1, False: 2.00k]
  ------------------
 1187|      4|          case LF:
  ------------------
  |  |  475|      4|#define LF                  '\n'
  ------------------
  |  Branch (1187:11): [True: 1, False: 2.00k]
  ------------------
 1188|      4|            SET_ERRNO(HPE_INVALID_URL);
  ------------------
  |  |   54|      4|#define SET_ERRNO(e)                                                 \
  |  |   55|      4|do {                                                                 \
  |  |   56|      4|  parser->http_errno = (e);                                          \
  |  |   57|      4|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 4]
  |  |  ------------------
  ------------------
 1189|      4|            goto error;
 1190|  2.00k|          default:
  ------------------
  |  Branch (1190:11): [True: 2.00k, False: 4]
  ------------------
 1191|  2.00k|            new_state = parse_url_char((enum state)parser->state, ch);
 1192|  2.00k|            if (new_state == s_dead) {
  ------------------
  |  Branch (1192:17): [True: 5, False: 2.00k]
  ------------------
 1193|      5|              SET_ERRNO(HPE_INVALID_URL);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1194|      5|              goto error;
 1195|      5|            }
 1196|  2.00k|            parser->state = new_state;
 1197|  2.01k|        }
 1198|       |
 1199|  2.00k|        break;
 1200|  2.01k|      }
 1201|       |
 1202|  2.00k|      case s_req_server:
  ------------------
  |  Branch (1202:7): [True: 418, False: 291k]
  ------------------
 1203|    612|      case s_req_server_with_at:
  ------------------
  |  Branch (1203:7): [True: 194, False: 291k]
  ------------------
 1204|  5.70k|      case s_req_path:
  ------------------
  |  Branch (1204:7): [True: 5.09k, False: 287k]
  ------------------
 1205|  6.37k|      case s_req_query_string_start:
  ------------------
  |  Branch (1205:7): [True: 675, False: 291k]
  ------------------
 1206|  6.78k|      case s_req_query_string:
  ------------------
  |  Branch (1206:7): [True: 410, False: 291k]
  ------------------
 1207|  7.43k|      case s_req_fragment_start:
  ------------------
  |  Branch (1207:7): [True: 642, False: 291k]
  ------------------
 1208|  8.47k|      case s_req_fragment:
  ------------------
  |  Branch (1208:7): [True: 1.04k, False: 291k]
  ------------------
 1209|  8.47k|      {
 1210|  8.47k|        enum state new_state;
 1211|  8.47k|        switch (ch) {
 1212|      8|          case CR:
  ------------------
  |  |  474|      8|#define CR                  '\r'
  ------------------
  |  Branch (1212:11): [True: 8, False: 8.46k]
  ------------------
 1213|  1.55k|          case LF:
  ------------------
  |  |  475|  1.55k|#define LF                  '\n'
  ------------------
  |  Branch (1213:11): [True: 1.54k, False: 6.92k]
  ------------------
 1214|  1.55k|            parser->http_major = 0;
 1215|  1.55k|            parser->http_minor = 9;
 1216|  1.55k|            parser->state = (ch == CR) ?
  ------------------
  |  |  474|  1.55k|#define CR                  '\r'
  ------------------
  |  Branch (1216:29): [True: 8, False: 1.54k]
  ------------------
 1217|      8|              s_req_line_almost_done :
 1218|  1.55k|              s_header_field_start;
 1219|  1.55k|            CALLBACK_DATA(url);
  ------------------
  |  |  105|  1.55k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|  1.55k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  1.55k|do {                                                                 \
  |  |  |  |   86|  1.55k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  1.55k|                                                                     \
  |  |  |  |   88|  1.55k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 1.55k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|  1.55k|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 1.55k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|  1.55k|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 1.55k]
  |  |  |  |  ------------------
  |  |  |  |   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.55k|                                                                     \
  |  |  |  |   94|  1.55k|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|  1.55k|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.55k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 1.55k]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|  1.55k|    }                                                                \
  |  |  |  |   99|  1.55k|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|  1.55k|  }                                                                  \
  |  |  |  |  101|  1.55k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 1.55k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1220|  1.55k|            break;
 1221|  3.08k|          case ' ':
  ------------------
  |  Branch (1221:11): [True: 3.08k, False: 5.38k]
  ------------------
 1222|  3.08k|            parser->state = s_req_http_start;
 1223|  3.08k|            CALLBACK_DATA(url);
  ------------------
  |  |  105|  3.08k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|  3.08k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  3.08k|do {                                                                 \
  |  |  |  |   86|  3.08k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  3.08k|                                                                     \
  |  |  |  |   88|  3.08k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 3.08k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|  3.08k|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 3.08k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|  3.08k|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 3.08k]
  |  |  |  |  ------------------
  |  |  |  |   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.08k|                                                                     \
  |  |  |  |   94|  3.08k|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|  3.08k|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  3.08k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 3.08k]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|  3.08k|    }                                                                \
  |  |  |  |   99|  3.08k|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|  3.08k|  }                                                                  \
  |  |  |  |  101|  3.08k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 3.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1224|  3.08k|            break;
 1225|  3.83k|          default:
  ------------------
  |  Branch (1225:11): [True: 3.83k, False: 4.63k]
  ------------------
 1226|  3.83k|            new_state = parse_url_char((enum state)parser->state, ch);
 1227|  3.83k|            if (new_state == s_dead) {
  ------------------
  |  Branch (1227:17): [True: 18, False: 3.81k]
  ------------------
 1228|     18|              SET_ERRNO(HPE_INVALID_URL);
  ------------------
  |  |   54|     18|#define SET_ERRNO(e)                                                 \
  |  |   55|     18|do {                                                                 \
  |  |   56|     18|  parser->http_errno = (e);                                          \
  |  |   57|     18|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 18]
  |  |  ------------------
  ------------------
 1229|     18|              goto error;
 1230|     18|            }
 1231|  3.81k|            parser->state = new_state;
 1232|  8.47k|        }
 1233|  8.45k|        break;
 1234|  8.47k|      }
 1235|       |
 1236|  8.45k|      case s_req_http_start:
  ------------------
  |  Branch (1236:7): [True: 3.26k, False: 288k]
  ------------------
 1237|  3.26k|        switch (ch) {
 1238|  3.06k|          case 'H':
  ------------------
  |  Branch (1238:11): [True: 3.06k, False: 200]
  ------------------
 1239|  3.06k|            parser->state = s_req_http_H;
 1240|  3.06k|            break;
 1241|    197|          case ' ':
  ------------------
  |  Branch (1241:11): [True: 197, False: 3.06k]
  ------------------
 1242|    197|            break;
 1243|      3|          default:
  ------------------
  |  Branch (1243:11): [True: 3, False: 3.25k]
  ------------------
 1244|      3|            SET_ERRNO(HPE_INVALID_CONSTANT);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1245|      3|            goto error;
 1246|  3.26k|        }
 1247|  3.25k|        break;
 1248|       |
 1249|  3.25k|      case s_req_http_H:
  ------------------
  |  Branch (1249:7): [True: 3.05k, False: 289k]
  ------------------
 1250|  3.05k|        STRICT_CHECK(ch != 'T');
  ------------------
  |  |  513|  3.05k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  3.05k|do {                                                                 \
  |  |  515|  3.05k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 10, False: 3.04k]
  |  |  ------------------
  |  |  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|  3.05k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
 1251|  3.04k|        parser->state = s_req_http_HT;
 1252|  3.04k|        break;
 1253|       |
 1254|  3.03k|      case s_req_http_HT:
  ------------------
  |  Branch (1254:7): [True: 3.03k, False: 289k]
  ------------------
 1255|  3.03k|        STRICT_CHECK(ch != 'T');
  ------------------
  |  |  513|  3.03k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  3.03k|do {                                                                 \
  |  |  515|  3.03k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 10, False: 3.02k]
  |  |  ------------------
  |  |  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|  3.03k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 3.02k]
  |  |  ------------------
  ------------------
 1256|  3.02k|        parser->state = s_req_http_HTT;
 1257|  3.02k|        break;
 1258|       |
 1259|  3.02k|      case s_req_http_HTT:
  ------------------
  |  Branch (1259:7): [True: 3.02k, False: 289k]
  ------------------
 1260|  3.02k|        STRICT_CHECK(ch != 'P');
  ------------------
  |  |  513|  3.02k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  3.02k|do {                                                                 \
  |  |  515|  3.02k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 10, False: 3.01k]
  |  |  ------------------
  |  |  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|  3.02k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 3.01k]
  |  |  ------------------
  ------------------
 1261|  3.01k|        parser->state = s_req_http_HTTP;
 1262|  3.01k|        break;
 1263|       |
 1264|  3.00k|      case s_req_http_HTTP:
  ------------------
  |  Branch (1264:7): [True: 3.00k, False: 289k]
  ------------------
 1265|  3.00k|        STRICT_CHECK(ch != '/');
  ------------------
  |  |  513|  3.00k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  3.00k|do {                                                                 \
  |  |  515|  3.00k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 10, False: 2.99k]
  |  |  ------------------
  |  |  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|  3.00k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1266|  2.99k|        parser->state = s_req_first_http_major;
 1267|  2.99k|        break;
 1268|       |
 1269|       |      /* first digit of major HTTP version */
 1270|  2.99k|      case s_req_first_http_major:
  ------------------
  |  Branch (1270:7): [True: 2.99k, False: 289k]
  ------------------
 1271|  2.99k|        if (ch < '1' || ch > '9') {
  ------------------
  |  Branch (1271:13): [True: 2, False: 2.98k]
  |  Branch (1271:25): [True: 1, False: 2.98k]
  ------------------
 1272|      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]
  |  |  ------------------
  ------------------
 1273|      3|          goto error;
 1274|      3|        }
 1275|       |
 1276|  2.98k|        parser->http_major = ch - '0';
 1277|  2.98k|        parser->state = s_req_http_major;
 1278|  2.98k|        break;
 1279|       |
 1280|       |      /* major HTTP version or dot */
 1281|  3.20k|      case s_req_http_major:
  ------------------
  |  Branch (1281:7): [True: 3.20k, False: 288k]
  ------------------
 1282|  3.20k|      {
 1283|  3.20k|        if (ch == '.') {
  ------------------
  |  Branch (1283:13): [True: 2.94k, False: 252]
  ------------------
 1284|  2.94k|          parser->state = s_req_first_http_minor;
 1285|  2.94k|          break;
 1286|  2.94k|        }
 1287|       |
 1288|    252|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|    252|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 242, False: 10]
  |  |  |  Branch (478:44): [True: 236, False: 6]
  |  |  ------------------
  ------------------
 1289|     16|          SET_ERRNO(HPE_INVALID_VERSION);
  ------------------
  |  |   54|     16|#define SET_ERRNO(e)                                                 \
  |  |   55|     16|do {                                                                 \
  |  |   56|     16|  parser->http_errno = (e);                                          \
  |  |   57|     16|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 16]
  |  |  ------------------
  ------------------
 1290|     16|          goto error;
 1291|     16|        }
 1292|       |
 1293|    236|        parser->http_major *= 10;
 1294|    236|        parser->http_major += ch - '0';
 1295|       |
 1296|    236|        if (parser->http_major > 999) {
  ------------------
  |  Branch (1296:13): [True: 3, False: 233]
  ------------------
 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|    233|        break;
 1302|    236|      }
 1303|       |
 1304|       |      /* first digit of minor HTTP version */
 1305|  2.94k|      case s_req_first_http_minor:
  ------------------
  |  Branch (1305:7): [True: 2.94k, False: 289k]
  ------------------
 1306|  2.94k|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|  2.94k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 2.93k, False: 8]
  |  |  |  Branch (478:44): [True: 2.93k, False: 5]
  |  |  ------------------
  ------------------
 1307|     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]
  |  |  ------------------
  ------------------
 1308|     13|          goto error;
 1309|     13|        }
 1310|       |
 1311|  2.93k|        parser->http_minor = ch - '0';
 1312|  2.93k|        parser->state = s_req_http_minor;
 1313|  2.93k|        break;
 1314|       |
 1315|       |      /* minor HTTP version or end of request line */
 1316|  3.14k|      case s_req_http_minor:
  ------------------
  |  Branch (1316:7): [True: 3.14k, False: 288k]
  ------------------
 1317|  3.14k|      {
 1318|  3.14k|        if (ch == CR) {
  ------------------
  |  |  474|  3.14k|#define CR                  '\r'
  ------------------
  |  Branch (1318:13): [True: 207, False: 2.93k]
  ------------------
 1319|    207|          parser->state = s_req_line_almost_done;
 1320|    207|          break;
 1321|    207|        }
 1322|       |
 1323|  2.93k|        if (ch == LF) {
  ------------------
  |  |  475|  2.93k|#define LF                  '\n'
  ------------------
  |  Branch (1323:13): [True: 2.67k, False: 258]
  ------------------
 1324|  2.67k|          parser->state = s_header_field_start;
 1325|  2.67k|          break;
 1326|  2.67k|        }
 1327|       |
 1328|       |        /* XXX allow spaces after digit? */
 1329|       |
 1330|    258|        if (!IS_NUM(ch)) {
  ------------------
  |  |  478|    258|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 250, False: 8]
  |  |  |  Branch (478:44): [True: 245, False: 5]
  |  |  ------------------
  ------------------
 1331|     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]
  |  |  ------------------
  ------------------
 1332|     13|          goto error;
 1333|     13|        }
 1334|       |
 1335|    245|        parser->http_minor *= 10;
 1336|    245|        parser->http_minor += ch - '0';
 1337|       |
 1338|    245|        if (parser->http_minor > 999) {
  ------------------
  |  Branch (1338:13): [True: 3, False: 242]
  ------------------
 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|    242|        break;
 1344|    245|      }
 1345|       |
 1346|       |      /* end of request line */
 1347|    242|      case s_req_line_almost_done:
  ------------------
  |  Branch (1347:7): [True: 209, False: 291k]
  ------------------
 1348|    209|      {
 1349|    209|        if (ch != LF) {
  ------------------
  |  |  475|    209|#define LF                  '\n'
  ------------------
  |  Branch (1349:13): [True: 1, False: 208]
  ------------------
 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|    208|        parser->state = s_header_field_start;
 1355|    208|        break;
 1356|    209|      }
 1357|       |
 1358|  16.4k|      case s_header_field_start:
  ------------------
  |  Branch (1358:7): [True: 16.4k, False: 275k]
  ------------------
 1359|  16.4k|      {
 1360|  16.4k|        if (ch == CR) {
  ------------------
  |  |  474|  16.4k|#define CR                  '\r'
  ------------------
  |  Branch (1360:13): [True: 234, False: 16.2k]
  ------------------
 1361|    234|          parser->state = s_headers_almost_done;
 1362|    234|          break;
 1363|    234|        }
 1364|       |
 1365|  16.2k|        if (ch == LF) {
  ------------------
  |  |  475|  16.2k|#define LF                  '\n'
  ------------------
  |  Branch (1365:13): [True: 6.84k, False: 9.37k]
  ------------------
 1366|       |          /* they might be just sending \n instead of \r\n so this would be
 1367|       |           * the second \n to denote the end of headers*/
 1368|  6.84k|          parser->state = s_headers_almost_done;
 1369|  6.84k|          goto reexecute_byte;
 1370|  6.84k|        }
 1371|       |
 1372|  9.37k|        c = TOKEN(ch);
  ------------------
  |  |  491|  9.37k|#define TOKEN(c)            ((c == ' ') ? ' ' : tokens[(unsigned char)c])
  |  |  ------------------
  |  |  |  Branch (491:30): [True: 201, False: 9.16k]
  |  |  ------------------
  ------------------
 1373|       |
 1374|  9.37k|        if (!c) {
  ------------------
  |  Branch (1374:13): [True: 6, False: 9.36k]
  ------------------
 1375|      6|          SET_ERRNO(HPE_INVALID_HEADER_TOKEN);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1376|      6|          goto error;
 1377|      6|        }
 1378|       |
 1379|  9.36k|        MARK(header_field);
  ------------------
  |  |  112|  9.36k|#define MARK(FOR)                                                    \
  |  |  113|  9.36k|do {                                                                 \
  |  |  114|  9.36k|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 9.36k, False: 0]
  |  |  ------------------
  |  |  115|  9.36k|    FOR##_mark = p;                                                  \
  |  |  116|  9.36k|  }                                                                  \
  |  |  117|  9.36k|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 9.36k]
  |  |  ------------------
  ------------------
 1380|       |
 1381|  9.36k|        parser->index = 0;
 1382|  9.36k|        parser->state = s_header_field;
 1383|       |
 1384|  9.36k|        switch (c) {
 1385|  4.74k|          case 'c':
  ------------------
  |  Branch (1385:11): [True: 4.74k, False: 4.61k]
  ------------------
 1386|  4.74k|            parser->header_state = h_C;
 1387|  4.74k|            break;
 1388|       |
 1389|    693|          case 'p':
  ------------------
  |  Branch (1389:11): [True: 693, False: 8.67k]
  ------------------
 1390|    693|            parser->header_state = h_matching_proxy_connection;
 1391|    693|            break;
 1392|       |
 1393|  2.03k|          case 't':
  ------------------
  |  Branch (1393:11): [True: 2.03k, False: 7.32k]
  ------------------
 1394|  2.03k|            parser->header_state = h_matching_transfer_encoding;
 1395|  2.03k|            break;
 1396|       |
 1397|    999|          case 'u':
  ------------------
  |  Branch (1397:11): [True: 999, False: 8.36k]
  ------------------
 1398|    999|            parser->header_state = h_matching_upgrade;
 1399|    999|            break;
 1400|       |
 1401|    886|          default:
  ------------------
  |  Branch (1401:11): [True: 886, False: 8.47k]
  ------------------
 1402|    886|            parser->header_state = h_general;
 1403|    886|            break;
 1404|  9.36k|        }
 1405|  9.36k|        break;
 1406|  9.36k|      }
 1407|       |
 1408|  79.8k|      case s_header_field:
  ------------------
  |  Branch (1408:7): [True: 79.8k, False: 212k]
  ------------------
 1409|  79.8k|      {
 1410|  79.8k|        c = TOKEN(ch);
  ------------------
  |  |  491|  79.8k|#define TOKEN(c)            ((c == ' ') ? ' ' : tokens[(unsigned char)c])
  |  |  ------------------
  |  |  |  Branch (491:30): [True: 1.06k, False: 78.7k]
  |  |  ------------------
  ------------------
 1411|       |
 1412|  79.8k|        if (c) {
  ------------------
  |  Branch (1412:13): [True: 70.8k, False: 9.02k]
  ------------------
 1413|  70.8k|          switch (parser->header_state) {
 1414|    676|            case h_general:
  ------------------
  |  Branch (1414:13): [True: 676, False: 70.1k]
  ------------------
 1415|    676|              break;
 1416|       |
 1417|  4.50k|            case h_C:
  ------------------
  |  Branch (1417:13): [True: 4.50k, False: 66.2k]
  ------------------
 1418|  4.50k|              parser->index++;
 1419|  4.50k|              parser->header_state = (c == 'o' ? h_CO : h_general);
  ------------------
  |  Branch (1419:39): [True: 4.31k, False: 193]
  ------------------
 1420|  4.50k|              break;
 1421|       |
 1422|  4.29k|            case h_CO:
  ------------------
  |  Branch (1422:13): [True: 4.29k, False: 66.5k]
  ------------------
 1423|  4.29k|              parser->index++;
 1424|  4.29k|              parser->header_state = (c == 'n' ? h_CON : h_general);
  ------------------
  |  Branch (1424:39): [True: 4.19k, False: 100]
  ------------------
 1425|  4.29k|              break;
 1426|       |
 1427|  4.09k|            case h_CON:
  ------------------
  |  Branch (1427:13): [True: 4.09k, False: 66.7k]
  ------------------
 1428|  4.09k|              parser->index++;
 1429|  4.09k|              switch (c) {
 1430|  2.26k|                case 'n':
  ------------------
  |  Branch (1430:17): [True: 2.26k, False: 1.83k]
  ------------------
 1431|  2.26k|                  parser->header_state = h_matching_connection;
 1432|  2.26k|                  break;
 1433|  1.63k|                case 't':
  ------------------
  |  Branch (1433:17): [True: 1.63k, False: 2.45k]
  ------------------
 1434|  1.63k|                  parser->header_state = h_matching_content_length;
 1435|  1.63k|                  break;
 1436|    194|                default:
  ------------------
  |  Branch (1436:17): [True: 194, False: 3.90k]
  ------------------
 1437|    194|                  parser->header_state = h_general;
 1438|    194|                  break;
 1439|  4.09k|              }
 1440|  4.09k|              break;
 1441|       |
 1442|       |            /* connection */
 1443|       |
 1444|  11.1k|            case h_matching_connection:
  ------------------
  |  Branch (1444:13): [True: 11.1k, False: 59.6k]
  ------------------
 1445|  11.1k|              parser->index++;
 1446|  11.1k|              if (parser->index > sizeof(CONNECTION)-1
  ------------------
  |  |  121|  11.1k|#define CONNECTION "connection"
  ------------------
  |  Branch (1446:19): [True: 0, False: 11.1k]
  ------------------
 1447|  11.1k|                  || c != CONNECTION[parser->index]) {
  ------------------
  |  |  121|  11.1k|#define CONNECTION "connection"
  ------------------
  |  Branch (1447:22): [True: 234, False: 10.9k]
  ------------------
 1448|    234|                parser->header_state = h_general;
 1449|  10.9k|              } else if (parser->index == sizeof(CONNECTION)-2) {
  ------------------
  |  |  121|  10.9k|#define CONNECTION "connection"
  ------------------
  |  Branch (1449:26): [True: 1.79k, False: 9.15k]
  ------------------
 1450|  1.79k|                parser->header_state = h_connection;
 1451|  1.79k|              }
 1452|  11.1k|              break;
 1453|       |
 1454|       |            /* proxy-connection */
 1455|       |
 1456|  3.34k|            case h_matching_proxy_connection:
  ------------------
  |  Branch (1456:13): [True: 3.34k, False: 67.4k]
  ------------------
 1457|  3.34k|              parser->index++;
 1458|  3.34k|              if (parser->index > sizeof(PROXY_CONNECTION)-1
  ------------------
  |  |  120|  3.34k|#define PROXY_CONNECTION "proxy-connection"
  ------------------
  |  Branch (1458:19): [True: 0, False: 3.34k]
  ------------------
 1459|  3.34k|                  || c != PROXY_CONNECTION[parser->index]) {
  ------------------
  |  |  120|  3.34k|#define PROXY_CONNECTION "proxy-connection"
  ------------------
  |  Branch (1459:22): [True: 205, False: 3.14k]
  ------------------
 1460|    205|                parser->header_state = h_general;
 1461|  3.14k|              } else if (parser->index == sizeof(PROXY_CONNECTION)-2) {
  ------------------
  |  |  120|  3.14k|#define PROXY_CONNECTION "proxy-connection"
  ------------------
  |  Branch (1461:26): [True: 194, False: 2.95k]
  ------------------
 1462|    194|                parser->header_state = h_connection;
 1463|    194|              }
 1464|  3.34k|              break;
 1465|       |
 1466|       |            /* content-length */
 1467|       |
 1468|  12.5k|            case h_matching_content_length:
  ------------------
  |  Branch (1468:13): [True: 12.5k, False: 58.2k]
  ------------------
 1469|  12.5k|              parser->index++;
 1470|  12.5k|              if (parser->index > sizeof(CONTENT_LENGTH)-1
  ------------------
  |  |  122|  12.5k|#define CONTENT_LENGTH "content-length"
  ------------------
  |  Branch (1470:19): [True: 0, False: 12.5k]
  ------------------
 1471|  12.5k|                  || c != CONTENT_LENGTH[parser->index]) {
  ------------------
  |  |  122|  12.5k|#define CONTENT_LENGTH "content-length"
  ------------------
  |  Branch (1471:22): [True: 206, False: 12.3k]
  ------------------
 1472|    206|                parser->header_state = h_general;
 1473|  12.3k|              } else if (parser->index == sizeof(CONTENT_LENGTH)-2) {
  ------------------
  |  |  122|  12.3k|#define CONTENT_LENGTH "content-length"
  ------------------
  |  Branch (1473:26): [True: 1.21k, False: 11.1k]
  ------------------
 1474|  1.21k|                parser->header_state = h_content_length;
 1475|  1.21k|              }
 1476|  12.5k|              break;
 1477|       |
 1478|       |            /* transfer-encoding */
 1479|       |
 1480|  25.9k|            case h_matching_transfer_encoding:
  ------------------
  |  Branch (1480:13): [True: 25.9k, False: 44.8k]
  ------------------
 1481|  25.9k|              parser->index++;
 1482|  25.9k|              if (parser->index > sizeof(TRANSFER_ENCODING)-1
  ------------------
  |  |  123|  25.9k|#define TRANSFER_ENCODING "transfer-encoding"
  ------------------
  |  Branch (1482:19): [True: 0, False: 25.9k]
  ------------------
 1483|  25.9k|                  || c != TRANSFER_ENCODING[parser->index]) {
  ------------------
  |  |  123|  25.9k|#define TRANSFER_ENCODING "transfer-encoding"
  ------------------
  |  Branch (1483:22): [True: 209, False: 25.7k]
  ------------------
 1484|    209|                parser->header_state = h_general;
 1485|  25.7k|              } else if (parser->index == sizeof(TRANSFER_ENCODING)-2) {
  ------------------
  |  |  123|  25.7k|#define TRANSFER_ENCODING "transfer-encoding"
  ------------------
  |  Branch (1485:26): [True: 1.59k, False: 24.1k]
  ------------------
 1486|  1.59k|                parser->header_state = h_transfer_encoding;
 1487|  1.59k|                parser->uses_transfer_encoding = 1;
 1488|  1.59k|              }
 1489|  25.9k|              break;
 1490|       |
 1491|       |            /* upgrade */
 1492|       |
 1493|  3.17k|            case h_matching_upgrade:
  ------------------
  |  Branch (1493:13): [True: 3.17k, False: 67.6k]
  ------------------
 1494|  3.17k|              parser->index++;
 1495|  3.17k|              if (parser->index > sizeof(UPGRADE)-1
  ------------------
  |  |  124|  3.17k|#define UPGRADE "upgrade"
  ------------------
  |  Branch (1495:19): [True: 0, False: 3.17k]
  ------------------
 1496|  3.17k|                  || c != UPGRADE[parser->index]) {
  ------------------
  |  |  124|  3.17k|#define UPGRADE "upgrade"
  ------------------
  |  Branch (1496:22): [True: 202, False: 2.97k]
  ------------------
 1497|    202|                parser->header_state = h_general;
 1498|  2.97k|              } else if (parser->index == sizeof(UPGRADE)-2) {
  ------------------
  |  |  124|  2.97k|#define UPGRADE "upgrade"
  ------------------
  |  Branch (1498:26): [True: 463, False: 2.51k]
  ------------------
 1499|    463|                parser->header_state = h_upgrade;
 1500|    463|              }
 1501|  3.17k|              break;
 1502|       |
 1503|    247|            case h_connection:
  ------------------
  |  Branch (1503:13): [True: 247, False: 70.5k]
  ------------------
 1504|    442|            case h_content_length:
  ------------------
  |  Branch (1504:13): [True: 195, False: 70.6k]
  ------------------
 1505|    636|            case h_transfer_encoding:
  ------------------
  |  Branch (1505:13): [True: 194, False: 70.6k]
  ------------------
 1506|  1.02k|            case h_upgrade:
  ------------------
  |  Branch (1506:13): [True: 390, False: 70.4k]
  ------------------
 1507|  1.02k|              if (ch != ' ') parser->header_state = h_general;
  ------------------
  |  Branch (1507:19): [True: 205, False: 821]
  ------------------
 1508|  1.02k|              break;
 1509|       |
 1510|      0|            default:
  ------------------
  |  Branch (1510:13): [True: 0, False: 70.8k]
  ------------------
 1511|      0|              assert(0 && "Unknown header_state");
 1512|      0|              break;
 1513|  70.8k|          }
 1514|  70.8k|          break;
 1515|  70.8k|        }
 1516|       |
 1517|  9.02k|        if (ch == ':') {
  ------------------
  |  Branch (1517:13): [True: 9.01k, False: 8]
  ------------------
 1518|  9.01k|          parser->state = s_header_value_discard_ws;
 1519|  9.01k|          CALLBACK_DATA(header_field);
  ------------------
  |  |  105|  9.01k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|  9.01k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  9.01k|do {                                                                 \
  |  |  |  |   86|  9.01k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  9.01k|                                                                     \
  |  |  |  |   88|  9.01k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 9.01k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|  9.01k|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 9.01k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|  9.01k|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 9.01k]
  |  |  |  |  ------------------
  |  |  |  |   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|  9.01k|                                                                     \
  |  |  |  |   94|  9.01k|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|  9.01k|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  9.01k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 9.01k]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|  9.01k|    }                                                                \
  |  |  |  |   99|  9.01k|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|  9.01k|  }                                                                  \
  |  |  |  |  101|  9.01k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 9.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1520|  9.01k|          break;
 1521|  9.01k|        }
 1522|       |
 1523|      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]
  |  |  ------------------
  ------------------
 1524|      8|        goto error;
 1525|  9.02k|      }
 1526|       |
 1527|  10.1k|      case s_header_value_discard_ws:
  ------------------
  |  Branch (1527:7): [True: 10.1k, False: 281k]
  ------------------
 1528|  10.1k|        if (ch == ' ' || ch == '\t') break;
  ------------------
  |  Branch (1528:13): [True: 286, False: 9.84k]
  |  Branch (1528:26): [True: 236, False: 9.60k]
  ------------------
 1529|       |
 1530|  9.60k|        if (ch == CR) {
  ------------------
  |  |  474|  9.60k|#define CR                  '\r'
  ------------------
  |  Branch (1530:13): [True: 213, False: 9.39k]
  ------------------
 1531|    213|          parser->state = s_header_value_discard_ws_almost_done;
 1532|    213|          break;
 1533|    213|        }
 1534|       |
 1535|  9.39k|        if (ch == LF) {
  ------------------
  |  |  475|  9.39k|#define LF                  '\n'
  ------------------
  |  Branch (1535:13): [True: 4.62k, False: 4.77k]
  ------------------
 1536|  4.62k|          parser->state = s_header_value_discard_lws;
 1537|  4.62k|          break;
 1538|  4.62k|        }
 1539|       |
 1540|       |        /* FALLTHROUGH */
 1541|       |
 1542|  5.79k|      case s_header_value_start:
  ------------------
  |  Branch (1542:7): [True: 1.01k, False: 291k]
  ------------------
 1543|  5.79k|      {
 1544|  5.79k|        MARK(header_value);
  ------------------
  |  |  112|  5.79k|#define MARK(FOR)                                                    \
  |  |  113|  5.79k|do {                                                                 \
  |  |  114|  5.79k|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 5.79k, False: 0]
  |  |  ------------------
  |  |  115|  5.79k|    FOR##_mark = p;                                                  \
  |  |  116|  5.79k|  }                                                                  \
  |  |  117|  5.79k|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 5.79k]
  |  |  ------------------
  ------------------
 1545|       |
 1546|  5.79k|        parser->state = s_header_value;
 1547|  5.79k|        parser->index = 0;
 1548|       |
 1549|  5.79k|        c = LOWER(ch);
  ------------------
  |  |  476|  5.79k|#define LOWER(c)            (unsigned char)(c | 0x20)
  ------------------
 1550|       |
 1551|  5.79k|        switch (parser->header_state) {
 1552|    195|          case h_upgrade:
  ------------------
  |  Branch (1552:11): [True: 195, False: 5.59k]
  ------------------
 1553|    195|            parser->flags |= F_UPGRADE;
 1554|    195|            parser->header_state = h_general;
 1555|    195|            break;
 1556|       |
 1557|  1.55k|          case h_transfer_encoding:
  ------------------
  |  Branch (1557:11): [True: 1.55k, False: 4.23k]
  ------------------
 1558|       |            /* looking for 'Transfer-Encoding: chunked' */
 1559|  1.55k|            if ('c' == c) {
  ------------------
  |  Branch (1559:17): [True: 1.08k, False: 474]
  ------------------
 1560|  1.08k|              parser->header_state = h_matching_transfer_encoding_chunked;
 1561|  1.08k|            } else {
 1562|    474|              parser->header_state = h_matching_transfer_encoding_token;
 1563|    474|            }
 1564|  1.55k|            break;
 1565|       |
 1566|       |          /* Multi-value `Transfer-Encoding` header */
 1567|    194|          case h_matching_transfer_encoding_token_start:
  ------------------
  |  Branch (1567:11): [True: 194, False: 5.59k]
  ------------------
 1568|    194|            break;
 1569|       |
 1570|  1.01k|          case h_content_length:
  ------------------
  |  Branch (1570:11): [True: 1.01k, False: 4.78k]
  ------------------
 1571|  1.01k|            if (!IS_NUM(ch)) {
  ------------------
  |  |  478|  1.01k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 1.00k, False: 10]
  |  |  |  Branch (478:44): [True: 999, False: 1]
  |  |  ------------------
  ------------------
 1572|     11|              SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1573|     11|              goto error;
 1574|     11|            }
 1575|       |
 1576|    999|            if (parser->flags & F_CONTENTLENGTH) {
  ------------------
  |  Branch (1576:17): [True: 1, False: 998]
  ------------------
 1577|      1|              SET_ERRNO(HPE_UNEXPECTED_CONTENT_LENGTH);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1578|      1|              goto error;
 1579|      1|            }
 1580|       |
 1581|    998|            parser->flags |= F_CONTENTLENGTH;
 1582|    998|            parser->content_length = ch - '0';
 1583|    998|            break;
 1584|       |
 1585|  1.59k|          case h_connection:
  ------------------
  |  Branch (1585:11): [True: 1.59k, False: 4.19k]
  ------------------
 1586|       |            /* looking for 'Connection: keep-alive' */
 1587|  1.59k|            if (c == 'k') {
  ------------------
  |  Branch (1587:17): [True: 454, False: 1.13k]
  ------------------
 1588|    454|              parser->header_state = h_matching_connection_keep_alive;
 1589|       |            /* looking for 'Connection: close' */
 1590|  1.13k|            } else if (c == 'c') {
  ------------------
  |  Branch (1590:24): [True: 933, False: 206]
  ------------------
 1591|    933|              parser->header_state = h_matching_connection_close;
 1592|    933|            } else {
 1593|    206|              parser->header_state = h_general;
 1594|    206|            }
 1595|  1.59k|            break;
 1596|       |
 1597|  1.24k|          default:
  ------------------
  |  Branch (1597:11): [True: 1.24k, False: 4.55k]
  ------------------
 1598|  1.24k|            parser->header_state = h_general;
 1599|  1.24k|            break;
 1600|  5.79k|        }
 1601|  5.77k|        break;
 1602|  5.79k|      }
 1603|       |
 1604|  32.8k|      case s_header_value:
  ------------------
  |  Branch (1604:7): [True: 32.8k, False: 259k]
  ------------------
 1605|  32.8k|      {
 1606|       |
 1607|  32.8k|        if (ch == CR) {
  ------------------
  |  |  474|  32.8k|#define CR                  '\r'
  ------------------
  |  Branch (1607:13): [True: 250, False: 32.6k]
  ------------------
 1608|    250|          parser->state = s_header_almost_done;
 1609|    250|          CALLBACK_DATA(header_value);
  ------------------
  |  |  105|    250|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|    250|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    250|do {                                                                 \
  |  |  |  |   86|    250|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    250|                                                                     \
  |  |  |  |   88|    250|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 250, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|    250|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 250, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|    250|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 250]
  |  |  |  |  ------------------
  |  |  |  |   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|    250|                                                                     \
  |  |  |  |   94|    250|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|    250|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    250|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 250]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|    250|    }                                                                \
  |  |  |  |   99|    250|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    250|  }                                                                  \
  |  |  |  |  101|    250|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 250]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1610|    250|          break;
 1611|    250|        }
 1612|       |
 1613|  32.6k|        if (ch == LF) {
  ------------------
  |  |  475|  32.6k|#define LF                  '\n'
  ------------------
  |  Branch (1613:13): [True: 5.08k, False: 27.5k]
  ------------------
 1614|  5.08k|          parser->state = s_header_almost_done;
 1615|  5.08k|          CALLBACK_DATA_NOADVANCE(header_value);
  ------------------
  |  |  109|  5.08k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|  5.08k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  5.08k|do {                                                                 \
  |  |  |  |   86|  5.08k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  5.08k|                                                                     \
  |  |  |  |   88|  5.08k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 5.08k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 5.08k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 5.08k]
  |  |  |  |  ------------------
  |  |  |  |   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.08k|                                                                     \
  |  |  |  |   94|  5.08k|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|  5.08k|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  5.08k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 5.08k]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|  5.08k|    }                                                                \
  |  |  |  |   99|  5.08k|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|  5.08k|  }                                                                  \
  |  |  |  |  101|  5.08k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 5.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1616|  5.08k|          goto reexecute_byte;
 1617|  5.08k|        }
 1618|       |
 1619|  27.5k|        if (!lenient && !IS_HEADER_CHAR(ch)) {
  ------------------
  |  |  510|  27.5k|  (ch == CR || ch == LF || ch == 9 || ((unsigned char)ch > 31 && ch != 127))
  |  |  ------------------
  |  |  |  |  474|  55.1k|#define CR                  '\r'
  |  |  ------------------
  |  |                 (ch == CR || ch == LF || ch == 9 || ((unsigned char)ch > 31 && ch != 127))
  |  |  ------------------
  |  |  |  |  475|  55.1k|#define LF                  '\n'
  |  |  ------------------
  |  |  |  Branch (510:4): [True: 0, False: 27.5k]
  |  |  |  Branch (510:16): [True: 0, False: 27.5k]
  |  |  |  Branch (510:28): [True: 954, False: 26.5k]
  |  |  |  Branch (510:40): [True: 26.5k, False: 6]
  |  |  |  Branch (510:66): [True: 26.5k, False: 1]
  |  |  ------------------
  ------------------
  |  Branch (1619:13): [True: 27.5k, False: 0]
  ------------------
 1620|      7|          SET_ERRNO(HPE_INVALID_HEADER_TOKEN);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1621|      7|          goto error;
 1622|      7|        }
 1623|       |
 1624|  27.5k|        c = LOWER(ch);
  ------------------
  |  |  476|  27.5k|#define LOWER(c)            (unsigned char)(c | 0x20)
  ------------------
 1625|       |
 1626|  27.5k|        switch (parser->header_state) {
 1627|  7.56k|          case h_general:
  ------------------
  |  Branch (1627:11): [True: 7.56k, False: 19.9k]
  ------------------
 1628|  7.56k|            break;
 1629|       |
 1630|      0|          case h_connection:
  ------------------
  |  Branch (1630:11): [True: 0, False: 27.5k]
  ------------------
 1631|      0|          case h_transfer_encoding:
  ------------------
  |  Branch (1631:11): [True: 0, False: 27.5k]
  ------------------
 1632|      0|            assert(0 && "Shouldn't get here.");
 1633|      0|            break;
 1634|       |
 1635|  5.01k|          case h_content_length:
  ------------------
  |  Branch (1635:11): [True: 5.01k, False: 22.5k]
  ------------------
 1636|  5.01k|          {
 1637|  5.01k|            uint64_t t;
 1638|       |
 1639|  5.01k|            if (ch == ' ') break;
  ------------------
  |  Branch (1639:17): [True: 194, False: 4.82k]
  ------------------
 1640|       |
 1641|  4.82k|            if (!IS_NUM(ch)) {
  ------------------
  |  |  478|  4.82k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 4.81k, False: 5]
  |  |  |  Branch (478:44): [True: 4.81k, False: 4]
  |  |  ------------------
  ------------------
 1642|      9|              SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1643|      9|              goto error;
 1644|      9|            }
 1645|       |
 1646|  4.81k|            t = parser->content_length;
 1647|  4.81k|            t *= 10;
 1648|  4.81k|            t += ch - '0';
 1649|       |
 1650|       |            /* Overflow? Test against a conservative limit for simplicity. */
 1651|  4.81k|            if ((ULLONG_MAX - 10) / 10 < parser->content_length) {
  ------------------
  |  Branch (1651:17): [True: 5, False: 4.81k]
  ------------------
 1652|      5|              SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1653|      5|              goto error;
 1654|      5|            }
 1655|       |
 1656|  4.81k|            parser->content_length = t;
 1657|  4.81k|            break;
 1658|  4.81k|          }
 1659|       |
 1660|       |          /* Transfer-Encoding: chunked */
 1661|  1.22k|          case h_matching_transfer_encoding_token_start:
  ------------------
  |  Branch (1661:11): [True: 1.22k, False: 26.3k]
  ------------------
 1662|       |            /* looking for 'Transfer-Encoding: chunked' */
 1663|  1.22k|            if ('c' == c) {
  ------------------
  |  Branch (1663:17): [True: 487, False: 741]
  ------------------
 1664|    487|              parser->header_state = h_matching_transfer_encoding_chunked;
 1665|    741|            } else if (TOKEN(c)) {
  ------------------
  |  |  491|    741|#define TOKEN(c)            ((c == ' ') ? ' ' : tokens[(unsigned char)c])
  |  |  ------------------
  |  |  |  Branch (491:29): [True: 514, False: 227]
  |  |  |  Branch (491:30): [True: 209, False: 532]
  |  |  ------------------
  ------------------
 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|    514|              parser->header_state = h_matching_transfer_encoding_token;
 1676|    514|            } else if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (1676:24): [True: 0, False: 227]
  |  Branch (1676:36): [True: 0, False: 227]
  ------------------
 1677|       |              /* Skip lws */
 1678|    227|            } else {
 1679|    227|              parser->header_state = h_general;
 1680|    227|            }
 1681|  1.22k|            break;
 1682|       |
 1683|       |          /* Transfer-Encoding: chunked */
 1684|  6.73k|          case h_matching_transfer_encoding_chunked:
  ------------------
  |  Branch (1684:11): [True: 6.73k, False: 20.8k]
  ------------------
 1685|  6.73k|            parser->index++;
 1686|  6.73k|            if (parser->index > sizeof(CHUNKED)-1
  ------------------
  |  |  125|  6.73k|#define CHUNKED "chunked"
  ------------------
  |  Branch (1686:17): [True: 0, False: 6.73k]
  ------------------
 1687|  6.73k|                || c != CHUNKED[parser->index]) {
  ------------------
  |  |  125|  6.73k|#define CHUNKED "chunked"
  ------------------
  |  Branch (1687:20): [True: 328, False: 6.40k]
  ------------------
 1688|    328|              parser->header_state = h_matching_transfer_encoding_token;
 1689|  6.40k|            } else if (parser->index == sizeof(CHUNKED)-2) {
  ------------------
  |  |  125|  6.40k|#define CHUNKED "chunked"
  ------------------
  |  Branch (1689:24): [True: 1.03k, False: 5.36k]
  ------------------
 1690|  1.03k|              parser->header_state = h_transfer_encoding_chunked;
 1691|  1.03k|            }
 1692|  6.73k|            break;
 1693|       |
 1694|  3.45k|          case h_matching_transfer_encoding_token:
  ------------------
  |  Branch (1694:11): [True: 3.45k, False: 24.0k]
  ------------------
 1695|  3.45k|            if (ch == ',') {
  ------------------
  |  Branch (1695:17): [True: 1.24k, False: 2.20k]
  ------------------
 1696|  1.24k|              parser->header_state = h_matching_transfer_encoding_token_start;
 1697|  1.24k|              parser->index = 0;
 1698|  1.24k|            }
 1699|  3.45k|            break;
 1700|       |
 1701|       |          /* looking for 'Connection: keep-alive' */
 1702|    473|          case h_matching_connection_keep_alive:
  ------------------
  |  Branch (1702:11): [True: 473, False: 27.0k]
  ------------------
 1703|    473|            parser->index++;
 1704|    473|            if (parser->index > sizeof(KEEP_ALIVE)-1
  ------------------
  |  |  126|    473|#define KEEP_ALIVE "keep-alive"
  ------------------
  |  Branch (1704:17): [True: 0, False: 473]
  ------------------
 1705|    473|                || c != KEEP_ALIVE[parser->index]) {
  ------------------
  |  |  126|    473|#define KEEP_ALIVE "keep-alive"
  ------------------
  |  Branch (1705:20): [True: 223, False: 250]
  ------------------
 1706|    223|              parser->header_state = h_general;
 1707|    250|            } else if (parser->index == sizeof(KEEP_ALIVE)-2) {
  ------------------
  |  |  126|    250|#define KEEP_ALIVE "keep-alive"
  ------------------
  |  Branch (1707:24): [True: 0, False: 250]
  ------------------
 1708|      0|              parser->header_state = h_connection_keep_alive;
 1709|      0|            }
 1710|    473|            break;
 1711|       |
 1712|       |          /* looking for 'Connection: close' */
 1713|  2.27k|          case h_matching_connection_close:
  ------------------
  |  Branch (1713:11): [True: 2.27k, False: 25.2k]
  ------------------
 1714|  2.27k|            parser->index++;
 1715|  2.27k|            if (parser->index > sizeof(CLOSE)-1 || c != CLOSE[parser->index]) {
  ------------------
  |  |  127|  2.27k|#define CLOSE "close"
  ------------------
                          if (parser->index > sizeof(CLOSE)-1 || c != CLOSE[parser->index]) {
  ------------------
  |  |  127|  2.27k|#define CLOSE "close"
  ------------------
  |  Branch (1715:17): [True: 0, False: 2.27k]
  |  Branch (1715:52): [True: 213, False: 2.05k]
  ------------------
 1716|    213|              parser->header_state = h_general;
 1717|  2.05k|            } else if (parser->index == sizeof(CLOSE)-2) {
  ------------------
  |  |  127|  2.05k|#define CLOSE "close"
  ------------------
  |  Branch (1717:24): [True: 464, False: 1.59k]
  ------------------
 1718|    464|              parser->header_state = h_connection_close;
 1719|    464|            }
 1720|  2.27k|            break;
 1721|       |
 1722|    412|          case h_transfer_encoding_chunked:
  ------------------
  |  Branch (1722:11): [True: 412, False: 27.1k]
  ------------------
 1723|    412|            if (ch != ' ') parser->header_state = h_matching_transfer_encoding_token;
  ------------------
  |  Branch (1723:17): [True: 195, False: 217]
  ------------------
 1724|    412|            break;
 1725|       |
 1726|      0|          case h_connection_keep_alive:
  ------------------
  |  Branch (1726:11): [True: 0, False: 27.5k]
  ------------------
 1727|    389|          case h_connection_close:
  ------------------
  |  Branch (1727:11): [True: 389, False: 27.1k]
  ------------------
 1728|    389|            if (ch != ' ') parser->header_state = h_general;
  ------------------
  |  Branch (1728:17): [True: 194, False: 195]
  ------------------
 1729|    389|            break;
 1730|       |
 1731|      0|          default:
  ------------------
  |  Branch (1731:11): [True: 0, False: 27.5k]
  ------------------
 1732|      0|            parser->state = s_header_value;
 1733|      0|            parser->header_state = h_general;
 1734|      0|            break;
 1735|  27.5k|        }
 1736|  27.5k|        break;
 1737|  27.5k|      }
 1738|       |
 1739|  27.5k|      case s_header_almost_done:
  ------------------
  |  Branch (1739:7): [True: 5.32k, False: 286k]
  ------------------
 1740|  5.32k|      {
 1741|  5.32k|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|  5.32k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  5.32k|do {                                                                 \
  |  |  515|  5.32k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 1, False: 5.32k]
  |  |  ------------------
  |  |  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|  5.32k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 5.32k]
  |  |  ------------------
  ------------------
 1742|       |
 1743|  5.32k|        parser->state = s_header_value_lws;
 1744|  5.32k|        break;
 1745|  5.32k|      }
 1746|       |
 1747|  5.31k|      case s_header_value_lws:
  ------------------
  |  Branch (1747:7): [True: 5.31k, False: 286k]
  ------------------
 1748|  5.31k|      {
 1749|  5.31k|        if (ch == ' ' || ch == '\t') {
  ------------------
  |  Branch (1749:13): [True: 489, False: 4.82k]
  |  Branch (1749:26): [True: 529, False: 4.29k]
  ------------------
 1750|  1.01k|          parser->state = s_header_value_start;
 1751|  1.01k|          goto reexecute_byte;
 1752|  1.01k|        }
 1753|       |
 1754|       |        /* finished the header */
 1755|  4.29k|        switch (parser->header_state) {
 1756|      0|          case h_connection_keep_alive:
  ------------------
  |  Branch (1756:11): [True: 0, False: 4.29k]
  ------------------
 1757|      0|            parser->flags |= F_CONNECTION_KEEP_ALIVE;
 1758|      0|            break;
 1759|    257|          case h_connection_close:
  ------------------
  |  Branch (1759:11): [True: 257, False: 4.03k]
  ------------------
 1760|    257|            parser->flags |= F_CONNECTION_CLOSE;
 1761|    257|            break;
 1762|    831|          case h_transfer_encoding_chunked:
  ------------------
  |  Branch (1762:11): [True: 831, False: 3.46k]
  ------------------
 1763|    831|            parser->flags |= F_CHUNKED;
 1764|    831|            break;
 1765|  3.20k|          default:
  ------------------
  |  Branch (1765:11): [True: 3.20k, False: 1.08k]
  ------------------
 1766|  3.20k|            break;
 1767|  4.29k|        }
 1768|       |
 1769|  4.29k|        parser->state = s_header_field_start;
 1770|  4.29k|        goto reexecute_byte;
 1771|  4.29k|      }
 1772|       |
 1773|    208|      case s_header_value_discard_ws_almost_done:
  ------------------
  |  Branch (1773:7): [True: 208, False: 291k]
  ------------------
 1774|    208|      {
 1775|    208|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|    208|# define STRICT_CHECK(cond)                                          \
  |  |  514|    208|do {                                                                 \
  |  |  515|    208|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 1, False: 207]
  |  |  ------------------
  |  |  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|    208|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 207]
  |  |  ------------------
  ------------------
 1776|    207|        parser->state = s_header_value_discard_lws;
 1777|    207|        break;
 1778|    208|      }
 1779|       |
 1780|  4.81k|      case s_header_value_discard_lws:
  ------------------
  |  Branch (1780:7): [True: 4.81k, False: 287k]
  ------------------
 1781|  4.81k|      {
 1782|  4.81k|        if (ch == ' ' || ch == '\t') {
  ------------------
  |  Branch (1782:13): [True: 364, False: 4.44k]
  |  Branch (1782:26): [True: 269, False: 4.18k]
  ------------------
 1783|    633|          parser->state = s_header_value_discard_ws;
 1784|    633|          break;
 1785|  4.18k|        } else {
 1786|       |          /* header value was empty */
 1787|  4.18k|          MARK(header_value);
  ------------------
  |  |  112|  4.18k|#define MARK(FOR)                                                    \
  |  |  113|  4.18k|do {                                                                 \
  |  |  114|  4.18k|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 4.18k, False: 0]
  |  |  ------------------
  |  |  115|  4.18k|    FOR##_mark = p;                                                  \
  |  |  116|  4.18k|  }                                                                  \
  |  |  117|  4.18k|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 4.18k]
  |  |  ------------------
  ------------------
 1788|  4.18k|          parser->state = s_header_field_start;
 1789|  4.18k|          CALLBACK_DATA_NOADVANCE(header_value);
  ------------------
  |  |  109|  4.18k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|  4.18k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  4.18k|do {                                                                 \
  |  |  |  |   86|  4.18k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  4.18k|                                                                     \
  |  |  |  |   88|  4.18k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 4.18k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|  4.18k|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 4.18k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|  4.18k|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 4.18k]
  |  |  |  |  ------------------
  |  |  |  |   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|  4.18k|                                                                     \
  |  |  |  |   94|  4.18k|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|  4.18k|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  4.18k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 4.18k]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|  4.18k|    }                                                                \
  |  |  |  |   99|  4.18k|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|  4.18k|  }                                                                  \
  |  |  |  |  101|  4.18k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 4.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1790|  4.18k|          goto reexecute_byte;
 1791|  4.18k|        }
 1792|  4.81k|      }
 1793|       |
 1794|  7.07k|      case s_headers_almost_done:
  ------------------
  |  Branch (1794:7): [True: 7.07k, False: 285k]
  ------------------
 1795|  7.07k|      {
 1796|  7.07k|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|  7.07k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  7.07k|do {                                                                 \
  |  |  515|  7.07k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 1, False: 7.07k]
  |  |  ------------------
  |  |  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|  7.07k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 7.07k]
  |  |  ------------------
  ------------------
 1797|       |
 1798|  7.07k|        if (parser->flags & F_TRAILING) {
  ------------------
  |  Branch (1798:13): [True: 417, False: 6.65k]
  ------------------
 1799|       |          /* End of a chunked request */
 1800|    417|          parser->state = NEW_MESSAGE();
  ------------------
  |  |  520|    417|# define NEW_MESSAGE() (http_should_keep_alive(parser) ? start_state : s_dead)
  |  |  ------------------
  |  |  |  |  503|    414|#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (503:22): [True: 66, False: 348]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (520:25): [True: 414, False: 3]
  |  |  ------------------
  ------------------
 1801|    417|          CALLBACK_NOTIFY(message_complete);
  ------------------
  |  |   78|    417|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|    417|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|    417|do {                                                                 \
  |  |  |  |   63|    417|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|    417|                                                                     \
  |  |  |  |   65|    417|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 417, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|    417|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 417]
  |  |  |  |  ------------------
  |  |  |  |   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|    417|                                                                     \
  |  |  |  |   70|    417|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|    417|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    417|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 417]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|    417|  }                                                                  \
  |  |  |  |   75|    417|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 417]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1802|    417|          break;
 1803|    417|        }
 1804|       |
 1805|       |        /* Cannot use transfer-encoding and a content-length header together
 1806|       |           per the HTTP specification. (RFC 7230 Section 3.3.3) */
 1807|  6.65k|        if ((parser->uses_transfer_encoding == 1) &&
  ------------------
  |  Branch (1807:13): [True: 839, False: 5.81k]
  ------------------
 1808|    839|             (parser->flags & F_CONTENTLENGTH)) {
  ------------------
  |  Branch (1808:14): [True: 2, False: 837]
  ------------------
 1809|       |          /* Allow it for lenient parsing as long as `Transfer-Encoding` is
 1810|       |           * not `chunked` or allow_length_with_encoding is set
 1811|       |           */
 1812|      2|          if (parser->flags & F_CHUNKED) {
  ------------------
  |  Branch (1812:15): [True: 1, False: 1]
  ------------------
 1813|      1|            if (!allow_chunked_length) {
  ------------------
  |  Branch (1813:17): [True: 1, False: 0]
  ------------------
 1814|      1|              SET_ERRNO(HPE_UNEXPECTED_CONTENT_LENGTH);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1815|      1|              goto error;
 1816|      1|            }
 1817|      1|          } else if (!lenient) {
  ------------------
  |  Branch (1817:22): [True: 1, False: 0]
  ------------------
 1818|      1|            SET_ERRNO(HPE_UNEXPECTED_CONTENT_LENGTH);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1819|      1|            goto error;
 1820|      1|          }
 1821|      2|        }
 1822|       |
 1823|  6.65k|        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|  6.65k|        if (settings->on_headers_complete) {
  ------------------
  |  Branch (1834:13): [True: 6.65k, False: 0]
  ------------------
 1835|  6.65k|          switch (settings->on_headers_complete(parser)) {
 1836|  6.65k|            case 0:
  ------------------
  |  Branch (1836:13): [True: 6.65k, False: 0]
  ------------------
 1837|  6.65k|              break;
 1838|       |
 1839|      0|            case 1:
  ------------------
  |  Branch (1839:13): [True: 0, False: 6.65k]
  ------------------
 1840|      0|              parser->flags |= F_SKIPBODY;
 1841|      0|              break;
 1842|       |
 1843|      0|            default:
  ------------------
  |  Branch (1843:13): [True: 0, False: 6.65k]
  ------------------
 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|  6.65k|          }
 1847|  6.65k|        }
 1848|       |
 1849|  6.65k|        if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {
  ------------------
  |  |  204|  6.65k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  ------------------
  |  Branch (1849:13): [True: 0, False: 6.65k]
  ------------------
 1850|      0|          return p - data;
 1851|      0|        }
 1852|       |
 1853|  6.65k|        goto reexecute_byte;
 1854|  6.65k|      }
 1855|       |
 1856|  6.65k|      case s_headers_done:
  ------------------
  |  Branch (1856:7): [True: 6.65k, False: 285k]
  ------------------
 1857|  6.65k|      {
 1858|  6.65k|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|  6.65k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  6.65k|do {                                                                 \
  |  |  515|  6.65k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 0, False: 6.65k]
  |  |  ------------------
  |  |  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|  6.65k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 6.65k]
  |  |  ------------------
  ------------------
 1859|       |
 1860|  6.65k|        parser->nread = 0;
 1861|       |
 1862|       |        /* Exit, the rest of the connect is in a different protocol. */
 1863|  6.65k|        if (parser->method == HTTP_CONNECT) {
  ------------------
  |  Branch (1863:13): [True: 2, False: 6.65k]
  ------------------
 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1866|      2|          return (p - data) + 1;
 1867|      2|        }
 1868|       |
 1869|  6.65k|        if (parser->flags & F_SKIPBODY) {
  ------------------
  |  Branch (1869:13): [True: 0, False: 6.65k]
  ------------------
 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1872|  6.65k|        } else if (parser->flags & F_CHUNKED) {
  ------------------
  |  Branch (1872:20): [True: 829, False: 5.82k]
  ------------------
 1873|       |          /* chunked encoding - ignore Content-Length header */
 1874|    829|          parser->state = s_chunk_size_start;
 1875|  5.82k|        } else if (parser->uses_transfer_encoding == 1) {
  ------------------
  |  Branch (1875:20): [True: 8, False: 5.81k]
  ------------------
 1876|      8|          if (parser->type == HTTP_REQUEST && !lenient) {
  ------------------
  |  Branch (1876:15): [True: 3, False: 5]
  |  Branch (1876:47): [True: 3, 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|      3|            SET_ERRNO(HPE_INVALID_TRANSFER_ENCODING);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1885|      3|            return (p - data); /* Error */
 1886|      5|          } 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|      5|              parser->state = s_body_identity_eof;
 1894|      5|          }
 1895|  5.81k|        } else {
 1896|  5.81k|          if (parser->content_length == 0) {
  ------------------
  |  Branch (1896:15): [True: 234, False: 5.57k]
  ------------------
 1897|       |            /* Content-Length header given but zero: Content-Length: 0\r\n */
 1898|    234|            parser->state = NEW_MESSAGE();
  ------------------
  |  |  520|    234|# define NEW_MESSAGE() (http_should_keep_alive(parser) ? start_state : s_dead)
  |  |  ------------------
  |  |  |  |  503|    233|#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (503:22): [True: 1, False: 232]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (520:25): [True: 233, False: 1]
  |  |  ------------------
  ------------------
 1899|    234|            CALLBACK_NOTIFY(message_complete);
  ------------------
  |  |   78|    234|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|    234|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|    234|do {                                                                 \
  |  |  |  |   63|    234|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|    234|                                                                     \
  |  |  |  |   65|    234|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 234, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|    234|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 234]
  |  |  |  |  ------------------
  |  |  |  |   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|    234|                                                                     \
  |  |  |  |   70|    234|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|    234|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    234|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 234]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|    234|  }                                                                  \
  |  |  |  |   75|    234|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 234]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1900|  5.57k|          } else if (parser->content_length != ULLONG_MAX) {
  ------------------
  |  Branch (1900:22): [True: 615, False: 4.96k]
  ------------------
 1901|       |            /* Content-Length header given and non-zero */
 1902|    615|            parser->state = s_body_identity;
 1903|  4.96k|          } else {
 1904|  4.96k|            if (parser->type == HTTP_REQUEST ||
  ------------------
  |  Branch (1904:17): [True: 2.76k, False: 2.19k]
  ------------------
 1905|  4.92k|                !http_message_needs_eof(parser)) {
  ------------------
  |  Branch (1905:17): [True: 2.16k, False: 36]
  ------------------
 1906|       |              /* Assume content-length 0 - read the next */
 1907|  4.92k|              parser->state = NEW_MESSAGE();
  ------------------
  |  |  520|  4.92k|# define NEW_MESSAGE() (http_should_keep_alive(parser) ? start_state : s_dead)
  |  |  ------------------
  |  |  |  |  503|  4.89k|#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (503:22): [True: 2.73k, False: 2.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (520:25): [True: 4.89k, False: 30]
  |  |  ------------------
  ------------------
 1908|  4.92k|              CALLBACK_NOTIFY(message_complete);
  ------------------
  |  |   78|  4.92k|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|  4.92k|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|  4.92k|do {                                                                 \
  |  |  |  |   63|  4.92k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|  4.92k|                                                                     \
  |  |  |  |   65|  4.92k|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 4.92k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|  4.92k|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 4.92k]
  |  |  |  |  ------------------
  |  |  |  |   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|  4.92k|                                                                     \
  |  |  |  |   70|  4.92k|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|  4.92k|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  4.92k|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 4.92k]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|  4.92k|  }                                                                  \
  |  |  |  |   75|  4.92k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 4.92k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1909|  4.92k|            } else {
 1910|       |              /* Read body until EOF */
 1911|     36|              parser->state = s_body_identity_eof;
 1912|     36|            }
 1913|  4.96k|          }
 1914|  5.81k|        }
 1915|       |
 1916|  6.64k|        break;
 1917|  6.65k|      }
 1918|       |
 1919|  6.64k|      case s_body_identity:
  ------------------
  |  Branch (1919:7): [True: 500, False: 291k]
  ------------------
 1920|    500|      {
 1921|    500|        uint64_t to_read = MIN(parser->content_length,
  ------------------
  |  |   37|    500|# define MIN(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (37:20): [True: 331, False: 169]
  |  |  ------------------
  ------------------
 1922|    500|                               (uint64_t) ((data + len) - p));
 1923|       |
 1924|    500|        assert(parser->content_length != 0
 1925|    500|            && 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|    500|        MARK(body);
  ------------------
  |  |  112|    500|#define MARK(FOR)                                                    \
  |  |  113|    500|do {                                                                 \
  |  |  114|    500|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 500, False: 0]
  |  |  ------------------
  |  |  115|    500|    FOR##_mark = p;                                                  \
  |  |  116|    500|  }                                                                  \
  |  |  117|    500|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 500]
  |  |  ------------------
  ------------------
 1933|    500|        parser->content_length -= to_read;
 1934|    500|        p += to_read - 1;
 1935|       |
 1936|    500|        if (parser->content_length == 0) {
  ------------------
  |  Branch (1936:13): [True: 396, False: 104]
  ------------------
 1937|    396|          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|    396|          CALLBACK_DATA_(body, p - body_mark + 1, p - data);
  ------------------
  |  |   84|    396|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |   85|    396|do {                                                                 \
  |  |   86|    396|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |   87|    396|                                                                     \
  |  |   88|    396|  if (FOR##_mark) {                                                  \
  |  |  ------------------
  |  |  |  Branch (88:7): [True: 396, False: 0]
  |  |  ------------------
  |  |   89|    396|    if (settings->on_##FOR) {                                        \
  |  |  ------------------
  |  |  |  Branch (89:9): [True: 396, False: 0]
  |  |  ------------------
  |  |   90|    396|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  ------------------
  |  |  |  Branch (90:11): [True: 0, False: 396]
  |  |  ------------------
  |  |   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|    396|                                                                     \
  |  |   94|    396|      /* We either errored above or got paused; get out */           \
  |  |   95|    396|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  ------------------
  |  |  |  |  204|    396|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  ------------------
  |  |  |  Branch (95:11): [True: 0, False: 396]
  |  |  ------------------
  |  |   96|      0|        return (ER);                                                 \
  |  |   97|      0|      }                                                              \
  |  |   98|    396|    }                                                                \
  |  |   99|    396|    FOR##_mark = NULL;                                               \
  |  |  100|    396|  }                                                                  \
  |  |  101|    396|} while (0)
  |  |  ------------------
  |  |  |  Branch (101:10): [Folded, False: 396]
  |  |  ------------------
  ------------------
 1949|    396|          goto reexecute_byte;
 1950|    396|        }
 1951|       |
 1952|    104|        break;
 1953|    500|      }
 1954|       |
 1955|       |      /* read until EOF */
 1956|    104|      case s_body_identity_eof:
  ------------------
  |  Branch (1956:7): [True: 1, False: 292k]
  ------------------
 1957|      1|        MARK(body);
  ------------------
  |  |  112|      1|#define MARK(FOR)                                                    \
  |  |  113|      1|do {                                                                 \
  |  |  114|      1|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 1, False: 0]
  |  |  ------------------
  |  |  115|      1|    FOR##_mark = p;                                                  \
  |  |  116|      1|  }                                                                  \
  |  |  117|      1|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1958|      1|        p = data + len - 1;
 1959|       |
 1960|      1|        break;
 1961|       |
 1962|    396|      case s_message_done:
  ------------------
  |  Branch (1962:7): [True: 396, False: 291k]
  ------------------
 1963|    396|        parser->state = NEW_MESSAGE();
  ------------------
  |  |  520|    396|# define NEW_MESSAGE() (http_should_keep_alive(parser) ? start_state : s_dead)
  |  |  ------------------
  |  |  |  |  503|    392|#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (503:22): [True: 66, False: 326]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (520:25): [True: 392, False: 4]
  |  |  ------------------
  ------------------
 1964|    396|        CALLBACK_NOTIFY(message_complete);
  ------------------
  |  |   78|    396|#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
  |  |  ------------------
  |  |  |  |   61|    396|#define CALLBACK_NOTIFY_(FOR, ER)                                    \
  |  |  |  |   62|    396|do {                                                                 \
  |  |  |  |   63|    396|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   64|    396|                                                                     \
  |  |  |  |   65|    396|  if (settings->on_##FOR) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:7): [True: 396, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   66|    396|    if (0 != settings->on_##FOR(parser)) {                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:9): [True: 0, False: 396]
  |  |  |  |  ------------------
  |  |  |  |   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|    396|                                                                     \
  |  |  |  |   70|    396|    /* We either errored above or got paused; get out */             \
  |  |  |  |   71|    396|    if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    396|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 396]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|      return (ER);                                                   \
  |  |  |  |   73|      0|    }                                                                \
  |  |  |  |   74|    396|  }                                                                  \
  |  |  |  |   75|    396|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:10): [Folded, False: 396]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1965|    396|        break;
 1966|       |
 1967|  1.62k|      case s_chunk_size_start:
  ------------------
  |  Branch (1967:7): [True: 1.62k, False: 290k]
  ------------------
 1968|  1.62k|      {
 1969|  1.62k|        assert(parser->nread == 1);
 1970|  1.62k|        assert(parser->flags & F_CHUNKED);
 1971|       |
 1972|  1.62k|        unhex_val = unhex[(unsigned char)ch];
 1973|  1.62k|        if (unhex_val == -1) {
  ------------------
  |  Branch (1973:13): [True: 1, False: 1.62k]
  ------------------
 1974|      1|          SET_ERRNO(HPE_INVALID_CHUNK_SIZE);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 1975|      1|          goto error;
 1976|      1|        }
 1977|       |
 1978|  1.62k|        parser->content_length = unhex_val;
 1979|  1.62k|        parser->state = s_chunk_size;
 1980|  1.62k|        break;
 1981|  1.62k|      }
 1982|       |
 1983|  5.02k|      case s_chunk_size:
  ------------------
  |  Branch (1983:7): [True: 5.02k, False: 287k]
  ------------------
 1984|  5.02k|      {
 1985|  5.02k|        uint64_t t;
 1986|       |
 1987|  5.02k|        assert(parser->flags & F_CHUNKED);
 1988|       |
 1989|  5.02k|        if (ch == CR) {
  ------------------
  |  |  474|  5.02k|#define CR                  '\r'
  ------------------
  |  Branch (1989:13): [True: 1.03k, False: 3.99k]
  ------------------
 1990|  1.03k|          parser->state = s_chunk_size_almost_done;
 1991|  1.03k|          break;
 1992|  1.03k|        }
 1993|       |
 1994|  3.99k|        unhex_val = unhex[(unsigned char)ch];
 1995|       |
 1996|  3.99k|        if (unhex_val == -1) {
  ------------------
  |  Branch (1996:13): [True: 474, False: 3.51k]
  ------------------
 1997|    474|          if (ch == ';' || ch == ' ') {
  ------------------
  |  Branch (1997:15): [True: 238, False: 236]
  |  Branch (1997:28): [True: 231, False: 5]
  ------------------
 1998|    469|            parser->state = s_chunk_parameters;
 1999|    469|            break;
 2000|    469|          }
 2001|       |
 2002|      5|          SET_ERRNO(HPE_INVALID_CHUNK_SIZE);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 2003|      5|          goto error;
 2004|    474|        }
 2005|       |
 2006|  3.51k|        t = parser->content_length;
 2007|  3.51k|        t *= 16;
 2008|  3.51k|        t += unhex_val;
 2009|       |
 2010|       |        /* Overflow? Test against a conservative limit for simplicity. */
 2011|  3.51k|        if ((ULLONG_MAX - 16) / 16 < parser->content_length) {
  ------------------
  |  Branch (2011:13): [True: 5, False: 3.51k]
  ------------------
 2012|      5|          SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 2013|      5|          goto error;
 2014|      5|        }
 2015|       |
 2016|  3.51k|        parser->content_length = t;
 2017|  3.51k|        break;
 2018|  3.51k|      }
 2019|       |
 2020|    691|      case s_chunk_parameters:
  ------------------
  |  Branch (2020:7): [True: 691, False: 291k]
  ------------------
 2021|    691|      {
 2022|    691|        assert(parser->flags & F_CHUNKED);
 2023|       |        /* just ignore this shit. TODO check for overflow */
 2024|    691|        if (ch == CR) {
  ------------------
  |  |  474|    691|#define CR                  '\r'
  ------------------
  |  Branch (2024:13): [True: 446, False: 245]
  ------------------
 2025|    446|          parser->state = s_chunk_size_almost_done;
 2026|    446|          break;
 2027|    446|        }
 2028|    245|        break;
 2029|    691|      }
 2030|       |
 2031|  1.46k|      case s_chunk_size_almost_done:
  ------------------
  |  Branch (2031:7): [True: 1.46k, False: 290k]
  ------------------
 2032|  1.46k|      {
 2033|  1.46k|        assert(parser->flags & F_CHUNKED);
 2034|  1.46k|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|  1.46k|# define STRICT_CHECK(cond)                                          \
  |  |  514|  1.46k|do {                                                                 \
  |  |  515|  1.46k|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 1, False: 1.46k]
  |  |  ------------------
  |  |  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.46k|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 1.46k]
  |  |  ------------------
  ------------------
 2035|       |
 2036|  1.46k|        parser->nread = 0;
 2037|       |
 2038|  1.46k|        if (parser->content_length == 0) {
  ------------------
  |  Branch (2038:13): [True: 418, False: 1.04k]
  ------------------
 2039|    418|          parser->flags |= F_TRAILING;
 2040|    418|          parser->state = s_header_field_start;
 2041|  1.04k|        } else {
 2042|  1.04k|          parser->state = s_chunk_data;
 2043|  1.04k|        }
 2044|  1.46k|        break;
 2045|  1.46k|      }
 2046|       |
 2047|    933|      case s_chunk_data:
  ------------------
  |  Branch (2047:7): [True: 933, False: 291k]
  ------------------
 2048|    933|      {
 2049|    933|        uint64_t to_read = MIN(parser->content_length,
  ------------------
  |  |   37|    933|# define MIN(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (37:20): [True: 821, False: 112]
  |  |  ------------------
  ------------------
 2050|    933|                               (uint64_t) ((data + len) - p));
 2051|       |
 2052|    933|        assert(parser->flags & F_CHUNKED);
 2053|    933|        assert(parser->content_length != 0
 2054|    933|            && 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|    933|        MARK(body);
  ------------------
  |  |  112|    933|#define MARK(FOR)                                                    \
  |  |  113|    933|do {                                                                 \
  |  |  114|    933|  if (!FOR##_mark) {                                                 \
  |  |  ------------------
  |  |  |  Branch (114:7): [True: 933, False: 0]
  |  |  ------------------
  |  |  115|    933|    FOR##_mark = p;                                                  \
  |  |  116|    933|  }                                                                  \
  |  |  117|    933|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 933]
  |  |  ------------------
  ------------------
 2060|    933|        parser->content_length -= to_read;
 2061|    933|        p += to_read - 1;
 2062|       |
 2063|    933|        if (parser->content_length == 0) {
  ------------------
  |  Branch (2063:13): [True: 826, False: 107]
  ------------------
 2064|    826|          parser->state = s_chunk_data_almost_done;
 2065|    826|        }
 2066|       |
 2067|    933|        break;
 2068|  1.46k|      }
 2069|       |
 2070|    821|      case s_chunk_data_almost_done:
  ------------------
  |  Branch (2070:7): [True: 821, False: 291k]
  ------------------
 2071|    821|        assert(parser->flags & F_CHUNKED);
 2072|    821|        assert(parser->content_length == 0);
 2073|    821|        STRICT_CHECK(ch != CR);
  ------------------
  |  |  513|    821|# define STRICT_CHECK(cond)                                          \
  |  |  514|    821|do {                                                                 \
  |  |  515|    821|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 2, False: 819]
  |  |  ------------------
  |  |  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|    821|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 819]
  |  |  ------------------
  ------------------
 2074|    819|        parser->state = s_chunk_data_done;
 2075|    819|        CALLBACK_DATA(body);
  ------------------
  |  |  105|    819|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
  |  |  ------------------
  |  |  |  |   84|    819|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|    819|do {                                                                 \
  |  |  |  |   86|    819|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|    819|                                                                     \
  |  |  |  |   88|    819|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 819, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   89|    819|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 819, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|    819|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 819]
  |  |  |  |  ------------------
  |  |  |  |   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|    819|                                                                     \
  |  |  |  |   94|    819|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|    819|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    819|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 819]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|    819|    }                                                                \
  |  |  |  |   99|    819|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    819|  }                                                                  \
  |  |  |  |  101|    819|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 819]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2076|    819|        break;
 2077|       |
 2078|    819|      case s_chunk_data_done:
  ------------------
  |  Branch (2078:7): [True: 812, False: 291k]
  ------------------
 2079|    812|        assert(parser->flags & F_CHUNKED);
 2080|    812|        STRICT_CHECK(ch != LF);
  ------------------
  |  |  513|    812|# define STRICT_CHECK(cond)                                          \
  |  |  514|    812|do {                                                                 \
  |  |  515|    812|  if (cond) {                                                        \
  |  |  ------------------
  |  |  |  Branch (515:7): [True: 1, False: 811]
  |  |  ------------------
  |  |  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|    812|} while (0)
  |  |  ------------------
  |  |  |  Branch (519:10): [Folded, False: 811]
  |  |  ------------------
  ------------------
 2081|    811|        parser->nread = 0;
 2082|    811|        parser->state = s_chunk_size_start;
 2083|    811|        break;
 2084|       |
 2085|      0|      default:
  ------------------
  |  Branch (2085:7): [True: 0, False: 292k]
  ------------------
 2086|      0|        assert(0 && "unhandled state");
 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|   292k|    }
 2090|   292k|  }
 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|  2.77k|  assert(((header_field_mark ? 1 : 0) +
 2103|  2.26k|          (header_value_mark ? 1 : 0) +
 2104|  2.26k|          (url_mark ? 1 : 0)  +
 2105|  2.26k|          (body_mark ? 1 : 0) +
 2106|  2.26k|          (status_mark ? 1 : 0)) <= 1);
 2107|       |
 2108|  2.26k|  CALLBACK_DATA_NOADVANCE(header_field);
  ------------------
  |  |  109|  2.26k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|  2.26k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  2.26k|do {                                                                 \
  |  |  |  |   86|  2.26k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  2.26k|                                                                     \
  |  |  |  |   88|  2.26k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 342, False: 1.92k]
  |  |  |  |  ------------------
  |  |  |  |   89|    342|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 342, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|    342|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 342]
  |  |  |  |  ------------------
  |  |  |  |   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|    342|                                                                     \
  |  |  |  |   94|    342|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|    342|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    342|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 342]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|    342|    }                                                                \
  |  |  |  |   99|    342|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    342|  }                                                                  \
  |  |  |  |  101|  2.26k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 2.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2109|  2.26k|  CALLBACK_DATA_NOADVANCE(header_value);
  ------------------
  |  |  109|  2.26k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|  2.26k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  2.26k|do {                                                                 \
  |  |  |  |   86|  2.26k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  2.26k|                                                                     \
  |  |  |  |   88|  2.26k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 428, False: 1.84k]
  |  |  |  |  ------------------
  |  |  |  |   89|    428|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 428, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|    428|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 428]
  |  |  |  |  ------------------
  |  |  |  |   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|    428|                                                                     \
  |  |  |  |   94|    428|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|    428|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    428|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 428]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|    428|    }                                                                \
  |  |  |  |   99|    428|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    428|  }                                                                  \
  |  |  |  |  101|  2.26k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 2.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2110|  2.26k|  CALLBACK_DATA_NOADVANCE(url);
  ------------------
  |  |  109|  2.26k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|  2.26k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  2.26k|do {                                                                 \
  |  |  |  |   86|  2.26k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  2.26k|                                                                     \
  |  |  |  |   88|  2.26k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 116, False: 2.15k]
  |  |  |  |  ------------------
  |  |  |  |   89|    116|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 116, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|    116|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 116]
  |  |  |  |  ------------------
  |  |  |  |   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|    116|                                                                     \
  |  |  |  |   94|    116|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|    116|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    116|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 116]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|    116|    }                                                                \
  |  |  |  |   99|    116|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    116|  }                                                                  \
  |  |  |  |  101|  2.26k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 2.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2111|  2.26k|  CALLBACK_DATA_NOADVANCE(body);
  ------------------
  |  |  109|  2.26k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|  2.26k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  2.26k|do {                                                                 \
  |  |  |  |   86|  2.26k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  2.26k|                                                                     \
  |  |  |  |   88|  2.26k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 217, False: 2.05k]
  |  |  |  |  ------------------
  |  |  |  |   89|    217|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 217, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   90|    217|      if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) {      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 0, False: 217]
  |  |  |  |  ------------------
  |  |  |  |   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|    217|                                                                     \
  |  |  |  |   94|    217|      /* We either errored above or got paused; get out */           \
  |  |  |  |   95|    217|      if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    217|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:11): [True: 0, False: 217]
  |  |  |  |  ------------------
  |  |  |  |   96|      0|        return (ER);                                                 \
  |  |  |  |   97|      0|      }                                                              \
  |  |  |  |   98|    217|    }                                                                \
  |  |  |  |   99|    217|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|    217|  }                                                                  \
  |  |  |  |  101|  2.26k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 2.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2112|  2.26k|  CALLBACK_DATA_NOADVANCE(status);
  ------------------
  |  |  109|  2.26k|    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
  |  |  ------------------
  |  |  |  |   84|  2.26k|#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
  |  |  |  |   85|  2.26k|do {                                                                 \
  |  |  |  |   86|  2.26k|  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
  |  |  |  |   87|  2.26k|                                                                     \
  |  |  |  |   88|  2.26k|  if (FOR##_mark) {                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (88:7): [True: 12, False: 2.25k]
  |  |  |  |  ------------------
  |  |  |  |   89|     12|    if (settings->on_##FOR) {                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:9): [True: 0, False: 12]
  |  |  |  |  ------------------
  |  |  |  |   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|     12|    FOR##_mark = NULL;                                               \
  |  |  |  |  100|     12|  }                                                                  \
  |  |  |  |  101|  2.26k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:10): [Folded, False: 2.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2113|       |
 2114|  2.26k|  return len;
 2115|       |
 2116|    504|error:
 2117|    504|  if (HTTP_PARSER_ERRNO(parser) == HPE_OK) {
  ------------------
  |  |  204|    504|#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
  ------------------
  |  Branch (2117:7): [True: 0, False: 504]
  ------------------
 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|    504|  return (p - data);
 2122|  2.26k|}
_ZN4brpc22http_message_needs_eofEPKNS_11http_parserE:
 2128|  8.13k|{
 2129|  8.13k|  if (parser->type == HTTP_REQUEST) {
  ------------------
  |  Branch (2129:7): [True: 2.87k, False: 5.26k]
  ------------------
 2130|  2.87k|    return 0;
 2131|  2.87k|  }
 2132|       |
 2133|       |  /* See RFC 2616 section 4.4 */
 2134|  5.26k|  if (parser->status_code / 100 == 1 || /* 1xx e.g. Continue */
  ------------------
  |  Branch (2134:7): [True: 3.52k, False: 1.73k]
  ------------------
 2135|  1.73k|      parser->status_code == 204 ||     /* No Content */
  ------------------
  |  Branch (2135:7): [True: 581, False: 1.15k]
  ------------------
 2136|  1.15k|      parser->status_code == 304 ||     /* Not Modified */
  ------------------
  |  Branch (2136:7): [True: 611, False: 541]
  ------------------
 2137|  4.72k|      parser->flags & F_SKIPBODY) {     /* response to a HEAD request */
  ------------------
  |  Branch (2137:7): [True: 0, False: 541]
  ------------------
 2138|  4.72k|    return 0;
 2139|  4.72k|  }
 2140|       |
 2141|       |  /* RFC 7230 3.3.3, see `s_headers_almost_done` */
 2142|    541|  if ((parser->uses_transfer_encoding == 1) &&
  ------------------
  |  Branch (2142:7): [True: 145, False: 396]
  ------------------
 2143|    145|      (parser->flags & F_CHUNKED) == 0) {
  ------------------
  |  Branch (2143:7): [True: 0, False: 145]
  ------------------
 2144|      0|    return 1;
 2145|      0|  }
 2146|       |
 2147|    541|  if ((parser->flags & F_CHUNKED) || parser->content_length != ULLONG_MAX) {
  ------------------
  |  Branch (2147:7): [True: 145, False: 396]
  |  Branch (2147:38): [True: 360, False: 36]
  ------------------
 2148|    505|    return 0;
 2149|    505|  }
 2150|       |
 2151|     36|  return 1;
 2152|    541|}
_ZN4brpc22http_should_keep_aliveEPKNS_11http_parserE:
 2157|  5.97k|{
 2158|  5.97k|  if (parser->http_major > 0 && parser->http_minor > 0) {
  ------------------
  |  Branch (2158:7): [True: 5.94k, False: 33]
  |  Branch (2158:33): [True: 5.94k, False: 3]
  ------------------
 2159|       |    /* HTTP/1.1 */
 2160|  5.94k|    if (parser->flags & F_CONNECTION_CLOSE) {
  ------------------
  |  Branch (2160:9): [True: 3, False: 5.93k]
  ------------------
 2161|      3|      return 0;
 2162|      3|    }
 2163|  5.94k|  } else {
 2164|       |    /* HTTP/1.0 or earlier */
 2165|     36|    if (!(parser->flags & F_CONNECTION_KEEP_ALIVE)) {
  ------------------
  |  Branch (2165:9): [True: 36, False: 0]
  ------------------
 2166|     36|      return 0;
 2167|     36|    }
 2168|     36|  }
 2169|       |
 2170|  5.93k|  return !http_message_needs_eof(parser);
 2171|  5.97k|}
_ZN4brpc16http_parser_initEPNS_11http_parserENS_16http_parser_typeE:
 2183|  2.77k|{
 2184|  2.77k|  void *data = parser->data; /* preserve application data */
 2185|  2.77k|  memset(parser, 0, sizeof(*parser));
 2186|  2.77k|  parser->data = data;
 2187|  2.77k|  parser->type = t;
 2188|  2.77k|  parser->state = (t == HTTP_REQUEST ? s_start_req : (t == HTTP_RESPONSE ? s_start_res : s_start_req_or_res));
  ------------------
  |  Branch (2188:20): [True: 2.16k, False: 616]
  |  Branch (2188:55): [True: 616, False: 0]
  ------------------
 2189|  2.77k|  parser->http_errno = HPE_OK;
 2190|  2.77k|}
_ZN4brpc21http_parser_parse_urlEPKcmiPNS_15http_parser_urlE:
 2345|    769|{
 2346|    769|  enum state s;
 2347|    769|  const char *p;
 2348|    769|  enum http_parser_url_fields uf, old_uf;
 2349|    769|  int found_at = 0;
 2350|       |
 2351|    769|  u->port = u->field_set = 0;
 2352|    769|  s = is_connect ? s_req_server_start : s_req_spaces_before_url;
  ------------------
  |  Branch (2352:7): [True: 665, False: 104]
  ------------------
 2353|    769|  old_uf = UF_MAX;
 2354|       |
 2355|  26.9k|  for (p = buf; p < buf + buflen; p++) {
  ------------------
  |  Branch (2355:17): [True: 26.3k, False: 634]
  ------------------
 2356|  26.3k|    s = parse_url_char(s, *p);
 2357|       |
 2358|       |    /* Figure out the next field that we're operating on */
 2359|  26.3k|    switch (s) {
 2360|    135|      case s_dead:
  ------------------
  |  Branch (2360:7): [True: 135, False: 26.2k]
  ------------------
 2361|    135|        return 1;
 2362|       |
 2363|       |      /* Skip delimeters */
 2364|     22|      case s_req_scheme_slash:
  ------------------
  |  Branch (2364:7): [True: 22, False: 26.3k]
  ------------------
 2365|     34|      case s_req_scheme_slash_slash:
  ------------------
  |  Branch (2365:7): [True: 12, False: 26.3k]
  ------------------
 2366|     36|      case s_req_server_start:
  ------------------
  |  Branch (2366:7): [True: 2, False: 26.3k]
  ------------------
 2367|    105|      case s_req_query_string_start:
  ------------------
  |  Branch (2367:7): [True: 69, False: 26.2k]
  ------------------
 2368|    549|      case s_req_fragment_start:
  ------------------
  |  Branch (2368:7): [True: 444, False: 25.9k]
  ------------------
 2369|    549|        continue;
 2370|       |
 2371|    442|      case s_req_scheme:
  ------------------
  |  Branch (2371:7): [True: 442, False: 25.9k]
  ------------------
 2372|    442|        uf = UF_SCHEME;
 2373|    442|        break;
 2374|       |
 2375|  1.59k|      case s_req_server_with_at:
  ------------------
  |  Branch (2375:7): [True: 1.59k, False: 24.7k]
  ------------------
 2376|  1.59k|        found_at = 1;
 2377|       |        // fall through
 2378|  22.9k|      case s_req_server:
  ------------------
  |  Branch (2378:7): [True: 21.3k, False: 5.00k]
  ------------------
 2379|  22.9k|        uf = UF_HOST;
 2380|  22.9k|        break;
 2381|       |
 2382|    659|      case s_req_path:
  ------------------
  |  Branch (2382:7): [True: 659, False: 25.7k]
  ------------------
 2383|    659|        uf = UF_PATH;
 2384|    659|        break;
 2385|       |
 2386|    808|      case s_req_query_string:
  ------------------
  |  Branch (2386:7): [True: 808, False: 25.5k]
  ------------------
 2387|    808|        uf = UF_QUERY;
 2388|    808|        break;
 2389|       |
 2390|    815|      case s_req_fragment:
  ------------------
  |  Branch (2390:7): [True: 815, False: 25.5k]
  ------------------
 2391|    815|        uf = UF_FRAGMENT;
 2392|    815|        break;
 2393|       |
 2394|      0|      default:
  ------------------
  |  Branch (2394:7): [True: 0, False: 26.3k]
  ------------------
 2395|      0|        assert(!"Unexpected state");
 2396|      0|        return 1;
 2397|  26.3k|    }
 2398|       |
 2399|       |    /* Nothing's changed; soldier on */
 2400|  25.6k|    if (uf == old_uf) {
  ------------------
  |  Branch (2400:9): [True: 24.9k, False: 773]
  ------------------
 2401|  24.9k|      u->field_data[uf].len++;
 2402|  24.9k|      continue;
 2403|  24.9k|    }
 2404|       |
 2405|    773|    u->field_data[uf].off = p - buf;
 2406|    773|    u->field_data[uf].len = 1;
 2407|       |
 2408|    773|    u->field_set |= (1 << uf);
 2409|    773|    old_uf = uf;
 2410|    773|  }
 2411|       |
 2412|       |  /* host must be present if there is a scheme */
 2413|       |  /* parsing http:///toto will fail */
 2414|    634|  if ((u->field_set & ((1 << UF_SCHEME) | (1 << UF_HOST))) != 0) {
  ------------------
  |  Branch (2414:7): [True: 541, False: 93]
  ------------------
 2415|    541|    if (http_parse_host(buf, u, found_at) != 0) {
  ------------------
  |  Branch (2415:9): [True: 349, False: 192]
  ------------------
 2416|    349|      return 1;
 2417|    349|    }
 2418|    541|  }
 2419|       |
 2420|       |  /* CONNECT requests can only contain "hostname:port" */
 2421|    285|  if (is_connect && u->field_set != ((1 << UF_HOST)|(1 << UF_PORT))) {
  ------------------
  |  Branch (2421:7): [True: 255, False: 30]
  |  Branch (2421:21): [True: 127, False: 128]
  ------------------
 2422|    127|    return 1;
 2423|    127|  }
 2424|       |
 2425|    158|  if (u->field_set & (1 << UF_PORT)) {
  ------------------
  |  Branch (2425:7): [True: 128, False: 30]
  ------------------
 2426|       |    /* Don't bother with endp; we've already validated the string */
 2427|    128|    unsigned long v = strtoul(buf + u->field_data[UF_PORT].off, NULL, 10);
 2428|       |
 2429|       |    /* Ports have a max value of 2^16 */
 2430|    128|    if (v > 0xffff) {
  ------------------
  |  Branch (2430:9): [True: 98, False: 30]
  ------------------
 2431|     98|      return 1;
 2432|     98|    }
 2433|       |
 2434|     30|    u->port = (uint16_t) v;
 2435|     30|  }
 2436|       |
 2437|     60|  return 0;
 2438|    158|}
http_parser.cpp:_ZN4brpcL14parse_url_charENS_5stateEc:
  552|  36.9k|{
  553|  36.9k|  if (ch == ' ' || ch == '\r' || ch == '\n') {
  ------------------
  |  Branch (553:7): [True: 1, False: 36.9k]
  |  Branch (553:20): [True: 1, False: 36.9k]
  |  Branch (553:34): [True: 1, False: 36.9k]
  ------------------
  554|      3|    return s_dead;
  555|      3|  }
  556|       |
  557|  36.9k|#if BRPC_HTTP_PARSER_STRICT
  558|  36.9k|  if (ch == '\t' || ch == '\f') {
  ------------------
  |  Branch (558:7): [True: 2, False: 36.9k]
  |  Branch (558:21): [True: 1, False: 36.9k]
  ------------------
  559|      3|    return s_dead;
  560|      3|  }
  561|  36.9k|#endif
  562|       |
  563|  36.9k|  switch (s) {
  564|  4.88k|    case s_req_spaces_before_url:
  ------------------
  |  Branch (564:5): [True: 4.88k, False: 32.0k]
  ------------------
  565|       |      /* Proxied requests are followed by scheme of an absolute URI (alpha).
  566|       |       * All methods except CONNECT are followed by '/' or '*'.
  567|       |       */
  568|       |
  569|  4.88k|      if (ch == '/' || ch == '*') {
  ------------------
  |  Branch (569:11): [True: 3.74k, False: 1.14k]
  |  Branch (569:24): [True: 596, False: 547]
  ------------------
  570|  4.33k|        return s_req_path;
  571|  4.33k|      }
  572|       |
  573|    547|      if (IS_ALPHA(ch)) {
  ------------------
  |  |  477|    547|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|    547|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|    534|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |  |  Branch (477:30): [True: 534, False: 13]
  |  |  |  Branch (477:49): [True: 525, False: 9]
  |  |  ------------------
  ------------------
  574|    525|        return s_req_scheme;
  575|    525|      }
  576|       |
  577|     22|      break;
  578|       |
  579|  1.08k|    case s_req_scheme:
  ------------------
  |  Branch (579:5): [True: 1.08k, False: 35.8k]
  ------------------
  580|  1.08k|      if (IS_ALPHA(ch)) {
  ------------------
  |  |  477|  1.08k|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|  1.08k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  ------------------
  |  |  |  |  476|    594|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |  |  Branch (477:30): [True: 594, False: 492]
  |  |  |  Branch (477:49): [True: 590, False: 4]
  |  |  ------------------
  ------------------
  581|    590|        return s;
  582|    590|      }
  583|       |
  584|    496|      if (ch == ':') {
  ------------------
  |  Branch (584:11): [True: 481, False: 15]
  ------------------
  585|    481|        return s_req_scheme_slash;
  586|    481|      }
  587|       |
  588|     15|      break;
  589|       |
  590|    476|    case s_req_scheme_slash:
  ------------------
  |  Branch (590:5): [True: 476, False: 36.5k]
  ------------------
  591|    476|      if (ch == '/') {
  ------------------
  |  Branch (591:11): [True: 466, False: 10]
  ------------------
  592|    466|        return s_req_scheme_slash_slash;
  593|    466|      }
  594|       |
  595|     10|      break;
  596|       |
  597|    462|    case s_req_scheme_slash_slash:
  ------------------
  |  Branch (597:5): [True: 462, False: 36.5k]
  ------------------
  598|    462|      if (ch == '/') {
  ------------------
  |  Branch (598:11): [True: 450, False: 12]
  ------------------
  599|    450|        return s_req_server_start;
  600|    450|      }
  601|       |
  602|     12|      break;
  603|       |
  604|  1.62k|    case s_req_server_with_at:
  ------------------
  |  Branch (604:5): [True: 1.62k, False: 35.3k]
  ------------------
  605|  1.62k|      if (ch == '@') {
  ------------------
  |  Branch (605:11): [True: 2, False: 1.62k]
  ------------------
  606|      2|        return s_dead;
  607|      2|      }
  608|       |
  609|       |    /* FALLTHROUGH */
  610|  2.73k|    case s_req_server_start:
  ------------------
  |  Branch (610:5): [True: 1.11k, False: 35.8k]
  ------------------
  611|  24.1k|    case s_req_server:
  ------------------
  |  Branch (611:5): [True: 21.3k, False: 15.5k]
  ------------------
  612|  24.1k|      if (ch == '/') {
  ------------------
  |  Branch (612:11): [True: 241, False: 23.8k]
  ------------------
  613|    241|        return s_req_path;
  614|    241|      }
  615|       |
  616|  23.8k|      if (ch == '?') {
  ------------------
  |  Branch (616:11): [True: 260, False: 23.6k]
  ------------------
  617|    260|        return s_req_query_string_start;
  618|    260|      }
  619|       |
  620|  23.6k|      if (ch == '@') {
  ------------------
  |  Branch (620:11): [True: 1.78k, False: 21.8k]
  ------------------
  621|  1.78k|        return s_req_server_with_at;
  622|  1.78k|      }
  623|       |
  624|  21.8k|      if (IS_USERINFO_CHAR(ch) || ch == '[' || ch == ']') {
  ------------------
  |  |  484|  43.6k|#define IS_USERINFO_CHAR(c) (IS_ALPHANUM(c) || IS_MARK(c) || (c) == '%' || \
  |  |  ------------------
  |  |  |  |  479|  43.6k|#define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  477|  43.6k|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|  21.8k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|  5.62k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (477:30): [True: 5.62k, False: 16.2k]
  |  |  |  |  |  |  |  Branch (477:49): [True: 3.47k, False: 2.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  478|  18.3k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (478:30): [True: 7.87k, False: 10.4k]
  |  |  |  |  |  |  |  Branch (478:44): [True: 4.05k, False: 3.81k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_USERINFO_CHAR(c) (IS_ALPHANUM(c) || IS_MARK(c) || (c) == '%' || \
  |  |  ------------------
  |  |  |  |  481|  36.1k|#define IS_MARK(c)          ((c) == '-' || (c) == '_' || (c) == '.' || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (481:30): [True: 598, False: 13.7k]
  |  |  |  |  |  Branch (481:44): [True: 1.17k, False: 12.5k]
  |  |  |  |  |  Branch (481:58): [True: 820, False: 11.7k]
  |  |  |  |  ------------------
  |  |  |  |  482|  14.2k|  (c) == '!' || (c) == '~' || (c) == '*' || (c) == '\'' || (c) == '(' || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (482:3): [True: 429, False: 11.2k]
  |  |  |  |  |  Branch (482:17): [True: 409, False: 10.8k]
  |  |  |  |  |  Branch (482:31): [True: 1.10k, False: 9.76k]
  |  |  |  |  |  Branch (482:45): [True: 430, False: 9.33k]
  |  |  |  |  |  Branch (482:60): [True: 388, False: 8.94k]
  |  |  |  |  ------------------
  |  |  |  |  483|  36.1k|  (c) == ')')
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (483:3): [True: 436, False: 8.51k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (484:62): [True: 418, False: 8.09k]
  |  |  ------------------
  |  |  485|  21.8k|  (c) == ';' || (c) == ':' || (c) == '&' || (c) == '=' || (c) == '+' || \
  |  |  ------------------
  |  |  |  Branch (485:3): [True: 412, False: 7.68k]
  |  |  |  Branch (485:17): [True: 860, False: 6.82k]
  |  |  |  Branch (485:31): [True: 557, False: 6.26k]
  |  |  |  Branch (485:45): [True: 412, False: 5.85k]
  |  |  |  Branch (485:59): [True: 1.56k, False: 4.28k]
  |  |  ------------------
  |  |  486|  21.8k|  (c) == '$' || (c) == ',')
  |  |  ------------------
  |  |  |  Branch (486:3): [True: 424, False: 3.86k]
  |  |  |  Branch (486:17): [True: 3.27k, False: 582]
  |  |  ------------------
  ------------------
  |  Branch (624:35): [True: 337, False: 245]
  |  Branch (624:48): [True: 205, False: 40]
  ------------------
  625|  21.7k|        return s_req_server;
  626|  21.7k|      }
  627|       |
  628|     40|      break;
  629|       |
  630|  2.18k|    case s_req_path:
  ------------------
  |  Branch (630:5): [True: 2.18k, False: 34.7k]
  ------------------
  631|  2.18k|      if (IS_URL_CHAR(ch)) {
  ------------------
  |  |  498|  2.18k|    (BIT_AT(normal_url_char, (unsigned char)c) || ((c) & 0x80))
  |  |  ------------------
  |  |  |  |   46|  4.37k|  (!!((unsigned int) (a)[(unsigned int) (i) >> 3] &                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:3): [True: 471, False: 1.71k]
  |  |  |  |  ------------------
  |  |  |  |   47|  4.37k|   (1 << ((unsigned int) (i) & 7))))
  |  |  ------------------
  |  |  |  Branch (498:51): [True: 727, False: 990]
  |  |  ------------------
  ------------------
  632|  1.19k|        return s;
  633|  1.19k|      }
  634|       |
  635|    990|      switch (ch) {
  ------------------
  |  Branch (635:15): [True: 977, False: 13]
  ------------------
  636|    491|        case '?':
  ------------------
  |  Branch (636:9): [True: 491, False: 499]
  ------------------
  637|    491|          return s_req_query_string_start;
  638|       |
  639|    486|        case '#':
  ------------------
  |  Branch (639:9): [True: 486, False: 504]
  ------------------
  640|    486|          return s_req_fragment_start;
  641|    990|      }
  642|       |
  643|     13|      break;
  644|       |
  645|    285|    case s_req_query_string_start:
  ------------------
  |  Branch (645:5): [True: 285, False: 36.6k]
  ------------------
  646|  1.27k|    case s_req_query_string:
  ------------------
  |  Branch (646:5): [True: 993, False: 35.9k]
  ------------------
  647|  1.27k|        if (IS_URL_CHAR(ch)) {
  ------------------
  |  |  498|  1.27k|    (BIT_AT(normal_url_char, (unsigned char)c) || ((c) & 0x80))
  |  |  ------------------
  |  |  |  |   46|  2.55k|  (!!((unsigned int) (a)[(unsigned int) (i) >> 3] &                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:3): [True: 508, False: 770]
  |  |  |  |  ------------------
  |  |  |  |   47|  2.55k|   (1 << ((unsigned int) (i) & 7))))
  |  |  ------------------
  |  |  |  Branch (498:51): [True: 484, False: 286]
  |  |  ------------------
  ------------------
  648|    992|          return s_req_query_string;
  649|    992|        }
  650|    286|        switch (ch) {
  ------------------
  |  Branch (650:17): [True: 269, False: 17]
  ------------------
  651|    241|          case '?':
  ------------------
  |  Branch (651:11): [True: 241, False: 45]
  ------------------
  652|       |            /* allow extra '?' in query string */
  653|    241|            return s_req_query_string;
  654|     28|          case '#':
  ------------------
  |  Branch (654:11): [True: 28, False: 258]
  ------------------
  655|     28|            return s_req_fragment_start;
  656|    286|        }
  657|     17|        break;
  658|       |
  659|  1.03k|    case s_req_fragment_start:
  ------------------
  |  Branch (659:5): [True: 1.03k, False: 35.9k]
  ------------------
  660|  1.03k|        if (IS_URL_CHAR(ch)) {
  ------------------
  |  |  498|  1.03k|    (BIT_AT(normal_url_char, (unsigned char)c) || ((c) & 0x80))
  |  |  ------------------
  |  |  |  |   46|  2.07k|  (!!((unsigned int) (a)[(unsigned int) (i) >> 3] &                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:3): [True: 218, False: 821]
  |  |  |  |  ------------------
  |  |  |  |   47|  2.07k|   (1 << ((unsigned int) (i) & 7))))
  |  |  ------------------
  |  |  |  Branch (498:51): [True: 231, False: 590]
  |  |  ------------------
  ------------------
  661|    449|          return s_req_fragment;
  662|    449|        }
  663|    590|        switch (ch) {
  ------------------
  |  Branch (663:17): [True: 579, False: 11]
  ------------------
  664|      2|          case '?':
  ------------------
  |  Branch (664:11): [True: 2, False: 588]
  ------------------
  665|      2|            return s_req_fragment;
  666|    577|          case '#':
  ------------------
  |  Branch (666:11): [True: 577, False: 13]
  ------------------
  667|    577|            return s;
  668|    590|        }
  669|     11|        break;
  670|       |
  671|  1.44k|    case s_req_fragment:
  ------------------
  |  Branch (671:5): [True: 1.44k, False: 35.5k]
  ------------------
  672|  1.44k|        if (IS_URL_CHAR(ch)) {
  ------------------
  |  |  498|  1.44k|    (BIT_AT(normal_url_char, (unsigned char)c) || ((c) & 0x80))
  |  |  ------------------
  |  |  |  |   46|  2.88k|  (!!((unsigned int) (a)[(unsigned int) (i) >> 3] &                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:3): [True: 592, False: 851]
  |  |  |  |  ------------------
  |  |  |  |   47|  2.88k|   (1 << ((unsigned int) (i) & 7))))
  |  |  ------------------
  |  |  |  Branch (498:51): [True: 383, False: 468]
  |  |  ------------------
  ------------------
  673|    975|          return s;
  674|    975|        }
  675|    468|        switch (ch) {
  ------------------
  |  Branch (675:17): [True: 455, False: 13]
  ------------------
  676|     69|          case '?':
  ------------------
  |  Branch (676:11): [True: 69, False: 399]
  ------------------
  677|    455|          case '#':
  ------------------
  |  Branch (677:11): [True: 386, False: 82]
  ------------------
  678|    455|            return s;
  679|    468|        }
  680|     13|        break;
  681|       |
  682|     13|    default:
  ------------------
  |  Branch (682:5): [True: 0, False: 36.9k]
  ------------------
  683|      0|      break;
  684|  36.9k|  }
  685|       |
  686|       |  /* We should never fall out of the switch above unless there's an error */
  687|    153|  return s_dead;
  688|  36.9k|}
http_parser.cpp:_ZN4brpcL15http_parse_hostEPKcPNS_15http_parser_urlEi:
 2270|    541|http_parse_host(const char * buf, struct http_parser_url *u, int found_at) {
 2271|    541|  enum http_host_state s;
 2272|       |
 2273|    541|  const char *p;
 2274|    541|  size_t buflen = u->field_data[UF_HOST].off + u->field_data[UF_HOST].len;
 2275|       |
 2276|    541|  u->field_data[UF_HOST].len = 0;
 2277|       |
 2278|    541|  s = found_at ? s_http_userinfo_start : s_http_host_start;
  ------------------
  |  Branch (2278:7): [True: 176, False: 365]
  ------------------
 2279|       |
 2280|  14.8k|  for (p = buf + u->field_data[UF_HOST].off; p < buf + buflen; p++) {
  ------------------
  |  Branch (2280:46): [True: 14.4k, False: 371]
  ------------------
 2281|  14.4k|    enum http_host_state new_s = http_parse_host_char(s, *p);
 2282|       |
 2283|  14.4k|    if (new_s == s_http_host_dead) {
  ------------------
  |  Branch (2283:9): [True: 170, False: 14.3k]
  ------------------
 2284|    170|      return 1;
 2285|    170|    }
 2286|       |
 2287|  14.3k|    switch(new_s) {
 2288|  2.28k|      case s_http_host:
  ------------------
  |  Branch (2288:7): [True: 2.28k, False: 12.0k]
  ------------------
 2289|  2.28k|        if (s != s_http_host) {
  ------------------
  |  Branch (2289:13): [True: 233, False: 2.05k]
  ------------------
 2290|    233|          u->field_data[UF_HOST].off = p - buf;
 2291|    233|        }
 2292|  2.28k|        u->field_data[UF_HOST].len++;
 2293|  2.28k|        break;
 2294|       |
 2295|  1.00k|      case s_http_host_v6:
  ------------------
  |  Branch (2295:7): [True: 1.00k, False: 13.3k]
  ------------------
 2296|  1.00k|        if (s != s_http_host_v6) {
  ------------------
  |  Branch (2296:13): [True: 53, False: 948]
  ------------------
 2297|     53|          u->field_data[UF_HOST].off = p - buf;
 2298|     53|        }
 2299|  1.00k|        u->field_data[UF_HOST].len++;
 2300|  1.00k|        break;
 2301|       |
 2302|  1.90k|      case s_http_host_port:
  ------------------
  |  Branch (2302:7): [True: 1.90k, False: 12.4k]
  ------------------
 2303|  1.90k|        if (s != s_http_host_port) {
  ------------------
  |  Branch (2303:13): [True: 131, False: 1.77k]
  ------------------
 2304|    131|          u->field_data[UF_PORT].off = p - buf;
 2305|    131|          u->field_data[UF_PORT].len = 0;
 2306|    131|          u->field_set |= (1 << UF_PORT);
 2307|    131|        }
 2308|  1.90k|        u->field_data[UF_PORT].len++;
 2309|  1.90k|        break;
 2310|       |
 2311|  8.75k|      case s_http_userinfo:
  ------------------
  |  Branch (2311:7): [True: 8.75k, False: 5.57k]
  ------------------
 2312|  8.75k|        if (s != s_http_userinfo) {
  ------------------
  |  Branch (2312:13): [True: 162, False: 8.59k]
  ------------------
 2313|    162|          u->field_data[UF_USERINFO].off = p - buf ;
 2314|    162|          u->field_data[UF_USERINFO].len = 0;
 2315|    162|          u->field_set |= (1 << UF_USERINFO);
 2316|    162|        }
 2317|  8.75k|        u->field_data[UF_USERINFO].len++;
 2318|  8.75k|        break;
 2319|       |
 2320|    380|      default:
  ------------------
  |  Branch (2320:7): [True: 380, False: 13.9k]
  ------------------
 2321|    380|        break;
 2322|  14.3k|    }
 2323|  14.3k|    s = new_s;
 2324|  14.3k|  }
 2325|       |
 2326|       |  /* Make sure we don't end somewhere unexpected */
 2327|    371|  switch (s) {
 2328|    147|    case s_http_host_start:
  ------------------
  |  Branch (2328:5): [True: 147, False: 224]
  ------------------
 2329|    148|    case s_http_host_v6_start:
  ------------------
  |  Branch (2329:5): [True: 1, False: 370]
  ------------------
 2330|    178|    case s_http_host_v6:
  ------------------
  |  Branch (2330:5): [True: 30, False: 341]
  ------------------
 2331|    179|    case s_http_host_port_start:
  ------------------
  |  Branch (2331:5): [True: 1, False: 370]
  ------------------
 2332|    179|    case s_http_userinfo:
  ------------------
  |  Branch (2332:5): [True: 0, False: 371]
  ------------------
 2333|    179|    case s_http_userinfo_start:
  ------------------
  |  Branch (2333:5): [True: 0, False: 371]
  ------------------
 2334|    179|      return 1;
 2335|    192|    default:
  ------------------
  |  Branch (2335:5): [True: 192, False: 179]
  ------------------
 2336|    192|      break;
 2337|    371|  }
 2338|       |
 2339|    192|  return 0;
 2340|    371|}
http_parser.cpp:_ZN4brpcL20http_parse_host_charENS_15http_host_stateEc:
 2205|  14.4k|http_parse_host_char(enum http_host_state s, const char ch) {
 2206|  14.4k|  switch(s) {
 2207|  8.75k|    case s_http_userinfo:
  ------------------
  |  Branch (2207:5): [True: 8.75k, False: 5.74k]
  ------------------
 2208|  8.92k|    case s_http_userinfo_start:
  ------------------
  |  Branch (2208:5): [True: 176, False: 14.3k]
  ------------------
 2209|  8.92k|      if (ch == '@') {
  ------------------
  |  Branch (2209:11): [True: 173, False: 8.75k]
  ------------------
 2210|    173|        return s_http_host_start;
 2211|    173|      }
 2212|       |
 2213|  8.75k|      if (IS_USERINFO_CHAR(ch)) {
  ------------------
  |  |  484|  8.75k|#define IS_USERINFO_CHAR(c) (IS_ALPHANUM(c) || IS_MARK(c) || (c) == '%' || \
  |  |  ------------------
  |  |  |  |  479|  17.5k|#define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  477|  17.5k|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|  8.75k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|  2.29k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (477:30): [True: 2.29k, False: 6.46k]
  |  |  |  |  |  |  |  Branch (477:49): [True: 1.82k, False: 468]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  478|  6.92k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (478:30): [True: 2.03k, False: 4.89k]
  |  |  |  |  |  |  |  Branch (478:44): [True: 958, False: 1.07k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_USERINFO_CHAR(c) (IS_ALPHANUM(c) || IS_MARK(c) || (c) == '%' || \
  |  |  ------------------
  |  |  |  |  481|  14.7k|#define IS_MARK(c)          ((c) == '-' || (c) == '_' || (c) == '.' || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (481:30): [True: 194, False: 5.77k]
  |  |  |  |  |  Branch (481:44): [True: 268, False: 5.50k]
  |  |  |  |  |  Branch (481:58): [True: 197, False: 5.31k]
  |  |  |  |  ------------------
  |  |  |  |  482|  5.97k|  (c) == '!' || (c) == '~' || (c) == '*' || (c) == '\'' || (c) == '(' || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (482:3): [True: 227, False: 5.08k]
  |  |  |  |  |  Branch (482:17): [True: 197, False: 4.88k]
  |  |  |  |  |  Branch (482:31): [True: 198, False: 4.69k]
  |  |  |  |  |  Branch (482:45): [True: 209, False: 4.48k]
  |  |  |  |  |  Branch (482:60): [True: 194, False: 4.28k]
  |  |  |  |  ------------------
  |  |  |  |  483|  14.7k|  (c) == ')')
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (483:3): [True: 201, False: 4.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (484:62): [True: 208, False: 3.87k]
  |  |  ------------------
  |  |  485|  8.75k|  (c) == ';' || (c) == ':' || (c) == '&' || (c) == '=' || (c) == '+' || \
  |  |  ------------------
  |  |  |  Branch (485:3): [True: 195, False: 3.68k]
  |  |  |  Branch (485:17): [True: 196, False: 3.48k]
  |  |  |  Branch (485:31): [True: 288, False: 3.19k]
  |  |  |  Branch (485:45): [True: 213, False: 2.98k]
  |  |  |  Branch (485:59): [True: 331, False: 2.65k]
  |  |  ------------------
  |  |  486|  8.75k|  (c) == '$' || (c) == ',')
  |  |  ------------------
  |  |  |  Branch (486:3): [True: 227, False: 2.42k]
  |  |  |  Branch (486:17): [True: 2.42k, False: 3]
  |  |  ------------------
  ------------------
 2214|  8.75k|        return s_http_userinfo;
 2215|  8.75k|      }
 2216|      3|      break;
 2217|       |
 2218|    391|    case s_http_host_start:
  ------------------
  |  Branch (2218:5): [True: 391, False: 14.1k]
  ------------------
 2219|    391|      if (ch == '[') {
  ------------------
  |  Branch (2219:11): [True: 62, False: 329]
  ------------------
 2220|     62|        return s_http_host_v6_start;
 2221|     62|      }
 2222|       |
 2223|    329|      if (IS_HOST_CHAR(ch)) {
  ------------------
  |  |  493|    329|  (IS_ALPHANUM(c) || (c) == '.' || (c) == '-' || (c) == '_')
  |  |  ------------------
  |  |  |  |  479|    658|#define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  477|    658|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|    329|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|    164|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (477:30): [True: 164, False: 165]
  |  |  |  |  |  |  |  Branch (477:49): [True: 128, False: 36]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  478|    201|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (478:30): [True: 111, False: 90]
  |  |  |  |  |  |  |  Branch (478:44): [True: 59, False: 52]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (493:22): [True: 13, False: 129]
  |  |  |  Branch (493:36): [True: 10, False: 119]
  |  |  |  Branch (493:50): [True: 23, False: 96]
  |  |  ------------------
  ------------------
 2224|    233|        return s_http_host;
 2225|    233|      }
 2226|       |
 2227|     96|      break;
 2228|       |
 2229|  2.22k|    case s_http_host:
  ------------------
  |  Branch (2229:5): [True: 2.22k, False: 12.2k]
  ------------------
 2230|  2.22k|      if (IS_HOST_CHAR(ch)) {
  ------------------
  |  |  493|  2.22k|  (IS_ALPHANUM(c) || (c) == '.' || (c) == '-' || (c) == '_')
  |  |  ------------------
  |  |  |  |  479|  4.44k|#define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  477|  4.44k|#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|  2.22k|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  476|    856|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (477:30): [True: 856, False: 1.36k]
  |  |  |  |  |  |  |  Branch (477:49): [True: 470, False: 386]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  478|  1.75k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (478:30): [True: 976, False: 776]
  |  |  |  |  |  |  |  Branch (478:44): [True: 450, False: 526]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (493:22): [True: 376, False: 926]
  |  |  |  Branch (493:36): [True: 375, False: 551]
  |  |  |  Branch (493:50): [True: 381, False: 170]
  |  |  ------------------
  ------------------
 2231|  2.05k|        return s_http_host;
 2232|  2.05k|      }
 2233|       |
 2234|       |    /* FALLTHROUGH */
 2235|    177|    case s_http_host_v6_end:
  ------------------
  |  Branch (2235:5): [True: 7, False: 14.4k]
  ------------------
 2236|    177|      if (ch == ':') {
  ------------------
  |  Branch (2236:11): [True: 137, False: 40]
  ------------------
 2237|    137|        return s_http_host_port_start;
 2238|    137|      }
 2239|       |
 2240|     40|      break;
 2241|       |
 2242|    971|    case s_http_host_v6:
  ------------------
  |  Branch (2242:5): [True: 971, False: 13.5k]
  ------------------
 2243|    971|      if (ch == ']') {
  ------------------
  |  Branch (2243:11): [True: 8, False: 963]
  ------------------
 2244|      8|        return s_http_host_v6_end;
 2245|      8|      }
 2246|       |
 2247|       |    /* FALLTHROUGH */
 2248|  1.02k|    case s_http_host_v6_start:
  ------------------
  |  Branch (2248:5): [True: 61, False: 14.4k]
  ------------------
 2249|  1.02k|      if (IS_HEX(ch) || ch == ':' || ch == '.') {
  ------------------
  |  |  480|  2.04k|#define IS_HEX(c)           (IS_NUM(c) || (LOWER(c) >= 'a' && LOWER(c) <= 'f'))
  |  |  ------------------
  |  |  |  |  478|  2.04k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (478:30): [True: 814, False: 210]
  |  |  |  |  |  Branch (478:44): [True: 213, False: 601]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_HEX(c)           (IS_NUM(c) || (LOWER(c) >= 'a' && LOWER(c) <= 'f'))
  |  |  ------------------
  |  |  |  |  476|    811|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |               #define IS_HEX(c)           (IS_NUM(c) || (LOWER(c) >= 'a' && LOWER(c) <= 'f'))
  |  |  ------------------
  |  |  |  |  476|    274|#define LOWER(c)            (unsigned char)(c | 0x20)
  |  |  ------------------
  |  |  |  Branch (480:44): [True: 274, False: 537]
  |  |  |  Branch (480:63): [True: 261, False: 13]
  |  |  ------------------
  ------------------
  |  Branch (2249:25): [True: 324, False: 226]
  |  Branch (2249:38): [True: 203, False: 23]
  ------------------
 2250|  1.00k|        return s_http_host_v6;
 2251|  1.00k|      }
 2252|       |
 2253|     23|      break;
 2254|       |
 2255|  1.78k|    case s_http_host_port:
  ------------------
  |  Branch (2255:5): [True: 1.78k, False: 12.7k]
  ------------------
 2256|  1.91k|    case s_http_host_port_start:
  ------------------
  |  Branch (2256:5): [True: 136, False: 14.3k]
  ------------------
 2257|  1.91k|      if (IS_NUM(ch)) {
  ------------------
  |  |  478|  1.91k|#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
  |  |  ------------------
  |  |  |  Branch (478:30): [True: 1.91k, False: 4]
  |  |  |  Branch (478:44): [True: 1.90k, False: 4]
  |  |  ------------------
  ------------------
 2258|  1.90k|        return s_http_host_port;
 2259|  1.90k|      }
 2260|       |
 2261|      8|      break;
 2262|       |
 2263|      8|    default:
  ------------------
  |  Branch (2263:5): [True: 0, False: 14.4k]
  ------------------
 2264|      0|      break;
 2265|  14.4k|  }
 2266|    170|  return s_http_host_dead;
 2267|  14.4k|}

_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:
  435|      2|static int get_key_count(void*) {
  436|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  437|      2|    return (int)nkey - (int)nfreekey;
  438|      2|}
key.cpp:_ZN7bthreadL18get_keytable_countEPv:
  439|      2|static size_t get_keytable_count(void*) {
  440|      2|    return nkeytable.load(butil::memory_order_relaxed);
  441|      2|}
key.cpp:_ZN7bthreadL19get_keytable_memoryEPv:
  442|      2|static size_t get_keytable_memory(void*) {
  443|      2|    const size_t n = nkeytable.load(butil::memory_order_relaxed);
  444|      2|    const size_t nsub = nsubkeytable.load(butil::memory_order_relaxed);
  445|      2|    return n * sizeof(KeyTable) + nsub * sizeof(SubKeyTable);
  446|      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:
 1309|    190|                       const pthread_mutexattr_t* __restrict mutexattr) {
 1310|    190|    INIT_MUTEX_OWNER_MAP_ENTRY(mutex, mutexattr);
  ------------------
  |  |  795|    190|#define INIT_MUTEX_OWNER_MAP_ENTRY(mutex, mutexattr) ((void)0)
  ------------------
 1311|    190|    return bthread::sys_pthread_mutex_init(mutex, mutexattr);
 1312|    190|}
pthread_mutex_lock:
 1319|    189|int pthread_mutex_lock(pthread_mutex_t* mutex) {
 1320|    189|    return bthread::pthread_mutex_lock_impl(mutex);
 1321|    189|}
pthread_mutex_unlock:
 1334|    190|int pthread_mutex_unlock(pthread_mutex_t* mutex) {
 1335|    190|    return bthread::pthread_mutex_unlock_impl(mutex);
 1336|    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|}
_ZN7bthread22AddTlsPthreadLockCountEv:
  560|    190|inline void AddTlsPthreadLockCount() {}
_ZN7bthread22SubTlsPthreadLockCountEv:
  561|    190|inline void SubTlsPthreadLockCount() {}
_ZN7bthread23pthread_mutex_lock_implEP15pthread_mutex_t:
  983|    189|BUTIL_FORCE_INLINE int pthread_mutex_lock_impl(pthread_mutex_t* mutex) {
  984|       |    return internal::pthread_mutex_lock_impl(mutex, NULL);
  985|    189|}
_ZN7bthread8internal23pthread_mutex_lock_implI15pthread_mutex_tEEiPT_PK8timespec:
  878|    189|BUTIL_FORCE_INLINE int pthread_mutex_lock_impl(Mutex* mutex, const struct timespec* abstime) {
  879|       |    // Don't change behavior of lock when profiler is off.
  880|    189|    if (!g_cp ||
  ------------------
  |  Branch (880:9): [True: 189, False: 0]
  ------------------
  881|       |        // collecting code including backtrace() and submit() may call
  882|       |        // pthread_mutex_lock and cause deadlock. Don't sample.
  883|    189|        BAIDU_GET_VOLATILE_THREAD_LOCAL(tls_inside_lock)) {
  ------------------
  |  |   69|      0|#define BAIDU_GET_VOLATILE_THREAD_LOCAL(var_name) get_##var_name()
  |  |  ------------------
  |  |  |  Branch (69:51): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  884|    189|        return pthread_mutex_lock_internal(mutex, abstime);
  885|    189|    }
  886|       |    // Don't slow down non-contended locks.
  887|      0|    int rc = pthread_mutex_trylock_internal(mutex);
  888|      0|    if (rc != EBUSY) {
  ------------------
  |  Branch (888:9): [True: 0, False: 0]
  ------------------
  889|      0|        return rc;
  890|      0|    }
  891|       |    // Ask bvar::Collector if this (contended) locking should be sampled
  892|      0|    const size_t sampling_range = bvar::is_collectable(&g_cp_sl);
  893|       |
  894|      0|    bthread_contention_site_t* csite = NULL;
  895|      0|#ifndef DONT_SPEEDUP_PTHREAD_CONTENTION_PROFILER_WITH_TLS
  896|      0|    TLSPthreadContentionSites& fast_alt =
  897|      0|        *BAIDU_GET_PTR_VOLATILE_THREAD_LOCAL(tls_csites);
  ------------------
  |  |   70|      0|#define BAIDU_GET_PTR_VOLATILE_THREAD_LOCAL(var_name) get_ptr_##var_name()
  ------------------
  898|      0|    if (fast_alt.cp_version != g_cp_version) {
  ------------------
  |  Branch (898:9): [True: 0, False: 0]
  ------------------
  899|      0|        fast_alt.cp_version = g_cp_version;
  900|      0|        fast_alt.count = 0;
  901|      0|    }
  902|      0|    if (fast_alt.count < TLS_MAX_COUNT) {
  ------------------
  |  Branch (902:9): [True: 0, False: 0]
  ------------------
  903|      0|        MutexAndContentionSite& entry = fast_alt.list[fast_alt.count++];
  904|      0|        entry.mutex = mutex;
  905|      0|        csite = &entry.csite;
  906|      0|        if (!bvar::is_sampling_range_valid(sampling_range)) {
  ------------------
  |  Branch (906:13): [True: 0, False: 0]
  ------------------
  907|      0|            make_contention_site_invalid(&entry.csite);
  908|      0|            return pthread_mutex_lock_internal(mutex, abstime);
  909|      0|        }
  910|      0|    }
  911|      0|#endif
  912|      0|    if (!bvar::is_sampling_range_valid(sampling_range)) {  // don't sample
  ------------------
  |  Branch (912:9): [True: 0, False: 0]
  ------------------
  913|      0|        return pthread_mutex_lock_internal(mutex, abstime);
  914|      0|    }
  915|       |    // Lock and monitor the waiting time.
  916|      0|    const int64_t start_ns = butil::cpuwide_time_ns();
  917|      0|    rc = pthread_mutex_lock_internal(mutex, abstime);
  918|      0|    if (!rc) { // Inside lock
  ------------------
  |  Branch (918:9): [True: 0, False: 0]
  ------------------
  919|      0|        if (!csite) {
  ------------------
  |  Branch (919:13): [True: 0, False: 0]
  ------------------
  920|      0|            csite = add_pthread_contention_site(mutex);
  921|      0|            if (csite == NULL) {
  ------------------
  |  Branch (921:17): [True: 0, False: 0]
  ------------------
  922|      0|                return rc;
  923|      0|            }
  924|      0|        }
  925|      0|        csite->duration_ns = butil::cpuwide_time_ns() - start_ns;
  926|      0|        csite->sampling_range = sampling_range;
  927|      0|    } // else rare
  928|      0|    return rc;
  929|      0|}
_ZN7bthread8internal27pthread_mutex_lock_internalEP15pthread_mutex_tPK8timespec:
  806|    189|                                                   const struct timespec* abstime) {
  807|    189|    int rc = 0;
  808|    189|    if (NULL == abstime) {
  ------------------
  |  Branch (808:9): [True: 189, False: 0]
  ------------------
  809|    189|        FIND_SYS_PTHREAD_MUTEX_OWNER_MAP_ENTRY(mutex);
  ------------------
  |  |  797|    189|#define FIND_SYS_PTHREAD_MUTEX_OWNER_MAP_ENTRY(mutex) ((void)0)
  ------------------
  810|    189|        SYS_PTHREAD_MUTEX_CHECK_OWNER;
  ------------------
  |  |  798|    189|#define SYS_PTHREAD_MUTEX_CHECK_OWNER ((void)0)
  ------------------
  811|    189|        rc = sys_pthread_mutex_lock(mutex);
  812|    190|        if (0 == rc) {
  ------------------
  |  Branch (812:13): [True: 190, False: 18.4E]
  ------------------
  813|    190|            SYS_PTHREAD_MUTEX_SET_OWNER;
  ------------------
  |  |  799|    190|#define SYS_PTHREAD_MUTEX_SET_OWNER ((void)0)
  ------------------
  814|    190|        }
  815|    189|    } else {
  816|      0|        rc = sys_pthread_mutex_timedlock(mutex, abstime);
  817|      0|        if (0 == rc) {
  ------------------
  |  Branch (817:13): [True: 0, False: 0]
  ------------------
  818|      0|            FIND_SYS_PTHREAD_MUTEX_OWNER_MAP_ENTRY(mutex);
  ------------------
  |  |  797|      0|#define FIND_SYS_PTHREAD_MUTEX_OWNER_MAP_ENTRY(mutex) ((void)0)
  ------------------
  819|      0|            SYS_PTHREAD_MUTEX_SET_OWNER;
  ------------------
  |  |  799|      0|#define SYS_PTHREAD_MUTEX_SET_OWNER ((void)0)
  ------------------
  820|      0|        }
  821|      0|    }
  822|    190|    if (0 == rc) {
  ------------------
  |  Branch (822:9): [True: 190, False: 18.4E]
  ------------------
  823|    190|        AddTlsPthreadLockCount();
  824|    190|    }
  825|    189|    return rc;
  826|    189|}
_ZN7bthread25pthread_mutex_unlock_implEP15pthread_mutex_t:
  998|    190|BUTIL_FORCE_INLINE int pthread_mutex_unlock_impl(pthread_mutex_t* mutex) {
  999|    190|    return internal::pthread_mutex_unlock_impl(mutex);
 1000|    190|}
_ZN7bthread8internal25pthread_mutex_unlock_implI15pthread_mutex_tEEiPT_:
  937|    190|BUTIL_FORCE_INLINE int pthread_mutex_unlock_impl(Mutex* mutex) {
  938|       |    // Don't change behavior of unlock when profiler is off.
  939|    190|    if (!g_cp || BAIDU_GET_VOLATILE_THREAD_LOCAL(tls_inside_lock)) {
  ------------------
  |  |   69|      0|#define BAIDU_GET_VOLATILE_THREAD_LOCAL(var_name) get_##var_name()
  |  |  ------------------
  |  |  |  Branch (69:51): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (939:9): [True: 190, False: 0]
  ------------------
  940|       |        // This branch brings an issue that an entry created by
  941|       |        // add_pthread_contention_site may not be cleared. Thus we add a
  942|       |        // 16-bit rolling version in the entry to find out such entry.
  943|    190|        return pthread_mutex_unlock_internal(mutex);
  944|    190|    }
  945|      0|    int64_t unlock_start_ns = 0;
  946|      0|    bool miss_in_tls = true;
  947|      0|    bthread_contention_site_t saved_csite = {0,0};
  948|      0|#ifndef DONT_SPEEDUP_PTHREAD_CONTENTION_PROFILER_WITH_TLS
  949|      0|    TLSPthreadContentionSites& fast_alt =
  950|      0|        *BAIDU_GET_PTR_VOLATILE_THREAD_LOCAL(tls_csites);
  ------------------
  |  |   70|      0|#define BAIDU_GET_PTR_VOLATILE_THREAD_LOCAL(var_name) get_ptr_##var_name()
  ------------------
  951|      0|    for (int i = fast_alt.count - 1; i >= 0; --i) {
  ------------------
  |  Branch (951:38): [True: 0, False: 0]
  ------------------
  952|      0|        if (fast_alt.list[i].mutex == mutex) {
  ------------------
  |  Branch (952:13): [True: 0, False: 0]
  ------------------
  953|      0|            if (is_contention_site_valid(fast_alt.list[i].csite)) {
  ------------------
  |  Branch (953:17): [True: 0, False: 0]
  ------------------
  954|      0|                saved_csite = fast_alt.list[i].csite;
  955|      0|                unlock_start_ns = butil::cpuwide_time_ns();
  956|      0|            }
  957|      0|            fast_alt.list[i] = fast_alt.list[--fast_alt.count];
  958|      0|            miss_in_tls = false;
  959|      0|            break;
  960|      0|        }
  961|      0|    }
  962|      0|#endif
  963|       |    // Check the map to see if the lock is sampled. Notice that we're still
  964|       |    // inside critical section.
  965|      0|    if (miss_in_tls) {
  ------------------
  |  Branch (965:9): [True: 0, False: 0]
  ------------------
  966|      0|        if (remove_pthread_contention_site(mutex, &saved_csite)) {
  ------------------
  |  Branch (966:13): [True: 0, False: 0]
  ------------------
  967|      0|            unlock_start_ns = butil::cpuwide_time_ns();
  968|      0|        }
  969|      0|    }
  970|      0|    const int rc = pthread_mutex_unlock_internal(mutex);
  971|       |    // [Outside lock]
  972|      0|    if (unlock_start_ns) {
  ------------------
  |  Branch (972:9): [True: 0, False: 0]
  ------------------
  973|      0|        const int64_t unlock_end_ns = butil::cpuwide_time_ns();
  974|      0|        saved_csite.duration_ns += unlock_end_ns - unlock_start_ns;
  975|      0|        submit_contention(saved_csite, unlock_end_ns);
  976|      0|    }
  977|      0|    return rc;
  978|    190|}
_ZN7bthread8internal29pthread_mutex_unlock_internalEP15pthread_mutex_t:
  851|    190|BUTIL_FORCE_INLINE int pthread_mutex_unlock_internal(pthread_mutex_t* mutex) {
  852|    190|    SYS_PTHREAD_MUTEX_RESET_OWNER(mutex);
  ------------------
  |  |  800|    190|#define SYS_PTHREAD_MUTEX_RESET_OWNER(mutex) ((void)0)
  ------------------
  853|    190|    SubTlsPthreadLockCount();
  854|    190|    return sys_pthread_mutex_unlock(mutex);
  855|    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|  }

_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|}

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

_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|    }

_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): [Folded, False: 0]
  |  |  |  |  |  |  |  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|      2|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (472:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (472:7): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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|       |#if !defined(NDEBUG)
  157|       |        const int rc = pthread_mutex_lock(_pmutex);
  158|       |        if (rc) {
  159|       |            LOG(FATAL) << "Fail to lock pthread_mutex_t=" << _pmutex << ", " << berror(rc);
  160|       |            _pmutex = NULL;
  161|       |        }
  162|       |#else
  163|     22|        pthread_mutex_lock(_pmutex);
  164|     22|#endif  // NDEBUG
  165|     22|    }
_ZNSt10lock_guardI15pthread_mutex_tED2Ev:
  167|     22|    ~lock_guard() {
  168|       |#ifndef NDEBUG
  169|       |        if (_pmutex) {
  170|       |            pthread_mutex_unlock(_pmutex);
  171|       |        }
  172|       |#else
  173|     22|        pthread_mutex_unlock(_pmutex);
  174|     22|#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:
  192|      8|      : ptr_(str),
  193|      8|        length_((str == NULL) ? 0 : STRING_TYPE::traits_type::length(str)) {}
  ------------------
  |  Branch (193:17): [True: 0, False: 8]
  ------------------
_ZN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Ev:
  190|      8|  BasicStringPiece() : ptr_(NULL), length_(0) {}
_ZN5butil9back_charERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  479|     16|inline char back_char(const std::string& s) { return s[s.size() - 1]; }
_ZNK5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE4dataEv:
  214|    178|  const value_type* data() const { return ptr_; }
_ZNK5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE4sizeEv:
  215|    194|  size_type size() const { return length_; }
_ZNK5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5emptyEv:
  217|     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, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   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:
  283|      4|inline int64_t cpuwide_time_ns() {
  284|      4|#if !defined(BAIDU_INTERNAL) && !BUTIL_USE_CPU_FREQUENCY
  285|       |    // nearly impossible to get the correct invariant cpu frequency on
  286|       |    // different CPU and machines. CPU-ID rarely works and frequencies
  287|       |    // in "model name" and "cpu Mhz" are both unreliable.
  288|       |    // Since clock_gettime() in newer glibc/kernel is much faster(~30ns)
  289|       |    // which is closer to the previous impl. of cpuwide_time(~10ns), we
  290|       |    // simply use the monotonic time to get rid of all related issues.
  291|      4|    timespec now;
  292|      4|    clock_gettime(CLOCK_MONOTONIC, &now);
  293|      4|    return now.tv_sec * 1000000000L + now.tv_nsec;
  294|       |#else
  295|       |    int64_t cpu_freq = detail::invariant_cpu_freq;
  296|       |    if (cpu_freq > 0) {
  297|       |        const uint64_t tsc = detail::clock_cycles();
  298|       |        //Try to avoid overflow
  299|       |        const uint64_t sec = tsc / cpu_freq;
  300|       |        const uint64_t remain = tsc % cpu_freq;
  301|       |        // TODO: should be OK until CPU's frequency exceeds 16GHz.
  302|       |        return remain * 1000000000L / cpu_freq + sec * 1000000000L;
  303|       |    } else {
  304|       |        // Lack of necessary features, return system-wide monotonic time instead.
  305|       |        return monotonic_time_ns();
  306|       |    }
  307|       |#endif // defined(BAIDU_INTERNAL) || BUTIL_USE_CPU_FREQUENCY
  308|      4|}
_ZN5butil15cpuwide_time_usEv:
  318|      4|inline int64_t cpuwide_time_us() {
  319|      4|    return cpuwide_time_ns() / 1000L;
  320|      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 nullptr;
  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 nullptr;
  134|      0|        }
  135|      2|        if (_s_tls_blocks == nullptr) {
  ------------------
  |  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 == nullptr, 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 nullptr;
  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 == nullptr) {
  ------------------
  |  Branch (149:13): [True: 2, False: 0]
  ------------------
  150|      2|            ThreadBlock *new_block = new (std::nothrow) ThreadBlock;
  151|      2|            if (__builtin_expect(new_block == nullptr, 0)) {
  ------------------
  |  Branch (151:17): [True: 0, False: 2]
  ------------------
  152|      0|                return nullptr;
  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 (nullptr == 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 nullptr;
  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 == nullptr) {
  145|       |        s_cumulated_time_bvar =
  146|       |            new PassiveStatus<double>(get_cumulated_time, this);
  147|       |    }
  148|       |    if (s_sampling_thread_usage_bvar == nullptr) {
  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, nullptr, 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(nullptr, nullptr, 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|      2|        return nullptr;
  115|      2|    }
_ZNK4bvar6detail14CombineSamplerclERPNS0_7SamplerES3_:
   36|     10|    void operator()(Sampler* & s1, Sampler* s2) const {
   37|     10|        if (s2 == nullptr) {
  ------------------
  |  Branch (37:13): [True: 0, False: 10]
  ------------------
   38|      0|            return;
   39|      0|        }
   40|     10|        if (s1 == nullptr) {
  ------------------
  |  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|      2|        pthread_mutex_init(&_mutex, nullptr);
  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|      4|        pthread_mutex_init(&_mutex, nullptr);
  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|      2|        pthread_mutex_init(&_mutex, nullptr);
  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 == nullptr &&
  ------------------
  |  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(nullptr), _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(nullptr)
   84|      2|        , _series_sampler(nullptr) {
   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 == nullptr &&
  ------------------
  |  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(nullptr), _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(nullptr)
   84|      2|        , _series_sampler(nullptr) {
   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 == nullptr &&
  ------------------
  |  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(nullptr), _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(nullptr)
   84|      4|        , _series_sampler(nullptr) {
   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(nullptr) , _series_sampler(nullptr) , _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 == nullptr) {
  ------------------
  |  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(nullptr), 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|  3.56k|{
   36|  3.56k|    if (size < kMinInputLength || size > kMaxInputLength){
  ------------------
  |  |   22|  7.13k|#define kMinInputLength 5
  ------------------
                  if (size < kMinInputLength || size > kMaxInputLength){
  ------------------
  |  |   23|  3.56k|#define kMaxInputLength 4096
  ------------------
  |  Branch (36:9): [True: 4, False: 3.56k]
  |  Branch (36:35): [True: 18, False: 3.54k]
  ------------------
   37|     22|        return 1;
   38|     22|    }
   39|       |
   40|       |    // Use first byte to select mode
   41|  3.54k|    uint8_t mode = data[0] % 4;
   42|  3.54k|    const uint8_t *payload = data + 1;
   43|  3.54k|    size_t payload_size = size - 1;
   44|       |
   45|  3.54k|    switch (mode) {
  ------------------
  |  Branch (45:13): [True: 3.54k, False: 0]
  ------------------
   46|  2.16k|        case 0: {
  ------------------
  |  Branch (46:9): [True: 2.16k, False: 1.38k]
  ------------------
   47|       |            // Fuzz low-level HTTP request parsing
   48|  2.16k|            brpc::http_parser parser;
   49|  2.16k|            brpc::http_parser_init(&parser, brpc::HTTP_REQUEST);
   50|  2.16k|            brpc::http_parser_settings settings;
   51|  2.16k|            memset(&settings, 0, sizeof(settings));
   52|  2.16k|            settings.on_url = on_url_cb;
   53|  2.16k|            settings.on_header_field = on_header_field_cb;
   54|  2.16k|            settings.on_header_value = on_header_value_cb;
   55|  2.16k|            settings.on_body = on_body_cb;
   56|  2.16k|            settings.on_message_begin = on_message_begin_cb;
   57|  2.16k|            settings.on_headers_complete = on_headers_complete_cb;
   58|  2.16k|            settings.on_message_complete = on_message_complete_cb;
   59|  2.16k|            brpc::http_parser_execute(&parser, &settings,
   60|  2.16k|                               reinterpret_cast<const char*>(payload), payload_size);
   61|  2.16k|            break;
   62|      0|        }
   63|    616|        case 1: {
  ------------------
  |  Branch (63:9): [True: 616, False: 2.93k]
  ------------------
   64|       |            // Fuzz low-level HTTP response parsing
   65|    616|            brpc::http_parser parser;
   66|    616|            brpc::http_parser_init(&parser, brpc::HTTP_RESPONSE);
   67|    616|            brpc::http_parser_settings settings;
   68|    616|            memset(&settings, 0, sizeof(settings));
   69|    616|            settings.on_url = on_url_cb;
   70|    616|            settings.on_header_field = on_header_field_cb;
   71|    616|            settings.on_header_value = on_header_value_cb;
   72|    616|            settings.on_body = on_body_cb;
   73|    616|            settings.on_message_begin = on_message_begin_cb;
   74|    616|            settings.on_headers_complete = on_headers_complete_cb;
   75|    616|            settings.on_message_complete = on_message_complete_cb;
   76|    616|            brpc::http_parser_execute(&parser, &settings,
   77|    616|                               reinterpret_cast<const char*>(payload), payload_size);
   78|    616|            break;
   79|      0|        }
   80|    104|        case 2: {
  ------------------
  |  Branch (80:9): [True: 104, False: 3.44k]
  ------------------
   81|       |            // Fuzz URL parsing (not connect)
   82|    104|            brpc::http_parser_url u;
   83|    104|            brpc::http_parser_parse_url(reinterpret_cast<const char*>(payload),
   84|    104|                                       payload_size, 0, &u);
   85|    104|            break;
   86|      0|        }
   87|    665|        case 3: {
  ------------------
  |  Branch (87:9): [True: 665, False: 2.88k]
  ------------------
   88|       |            // Fuzz URL parsing (connect mode)
   89|    665|            brpc::http_parser_url u;
   90|    665|            brpc::http_parser_parse_url(reinterpret_cast<const char*>(payload),
   91|    665|                                       payload_size, 1, &u);
   92|    665|            break;
   93|      0|        }
   94|  3.54k|    }
   95|       |
   96|  3.54k|    return 0;
   97|  3.54k|}
fuzz_http_parser.cpp:_ZL9on_url_cbPN4brpc11http_parserEPKcm:
   25|  4.75k|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|  9.35k|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|  9.93k|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|  1.43k|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|  8.86k|static int on_message_begin_cb(brpc::http_parser* p) { return 0; }
fuzz_http_parser.cpp:_ZL22on_headers_complete_cbPN4brpc11http_parserE:
   30|  6.65k|static int on_headers_complete_cb(brpc::http_parser* p) { return 0; }
fuzz_http_parser.cpp:_ZL22on_message_complete_cbPN4brpc11http_parserE:
   31|  5.97k|static int on_message_complete_cb(brpc::http_parser* p) { return 0; }

