_ZN7httplib6detail16parse_query_textEPKcmRNSt3__18multimapINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESA_NS3_4lessISA_EENS8_INS3_4pairIKSA_SA_EEEEEE:
 7818|    582|                             Params &params) {
 7819|    582|  std::set<std::string> cache;
 7820|    582|  split(data, data + size, '&', [&](const char *b, const char *e) {
 7821|    582|    std::string kv(b, e);
 7822|    582|    if (cache.find(kv) != cache.end()) { return; }
 7823|    582|    cache.insert(std::move(kv));
 7824|       |
 7825|    582|    std::string key;
 7826|    582|    std::string val;
 7827|    582|    divide(b, static_cast<std::size_t>(e - b), '=',
 7828|    582|           [&](const char *lhs_data, std::size_t lhs_size, const char *rhs_data,
 7829|    582|               std::size_t rhs_size) {
 7830|    582|             key.assign(lhs_data, lhs_size);
 7831|    582|             val.assign(rhs_data, rhs_size);
 7832|    582|           });
 7833|       |
 7834|    582|    if (!key.empty()) {
 7835|    582|      params.emplace(decode_query_component(key), decode_query_component(val));
 7836|    582|    }
 7837|    582|  });
 7838|    582|}
_ZN7httplib6detail5splitEPKcS2_cNSt3__18functionIFvS2_S2_EEE:
 5334|    907|                  std::function<void(const char *, const char *)> fn) {
 5335|    907|  return split(b, e, d, (std::numeric_limits<size_t>::max)(), std::move(fn));
 5336|    907|}
_ZN7httplib6detail5splitEPKcS2_cmNSt3__18functionIFvS2_S2_EEE:
 5339|    907|                  std::function<void(const char *, const char *)> fn) {
 5340|    907|  size_t i = 0;
 5341|    907|  size_t beg = 0;
 5342|    907|  size_t count = 1;
 5343|       |
 5344|  41.4M|  while (e ? (b + i < e) : (b[i] != '\0')) {
  ------------------
  |  Branch (5344:10): [True: 41.4M, False: 0]
  |  Branch (5344:10): [True: 41.4M, False: 907]
  ------------------
 5345|  41.4M|    if (b[i] == d && count < m) {
  ------------------
  |  Branch (5345:9): [True: 5.82M, False: 35.6M]
  |  Branch (5345:22): [True: 5.82M, False: 0]
  ------------------
 5346|  5.82M|      auto r = trim(b, e, beg, i);
 5347|  5.82M|      if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5347:11): [True: 41.9k, False: 5.78M]
  ------------------
 5348|  5.82M|      beg = i + 1;
 5349|  5.82M|      count++;
 5350|  5.82M|    }
 5351|  41.4M|    i++;
 5352|  41.4M|  }
 5353|       |
 5354|    907|  if (i) {
  ------------------
  |  Branch (5354:7): [True: 907, False: 0]
  ------------------
 5355|    907|    auto r = trim(b, e, beg, i);
 5356|    907|    if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5356:9): [True: 806, False: 101]
  ------------------
 5357|    907|  }
 5358|    907|}
_ZN7httplib6detail4trimEPKcS2_mm:
 5290|  5.82M|                                      size_t right) {
 5291|  7.33M|  while (b + left < e && is_space_or_tab(b[left])) {
  ------------------
  |  Branch (5291:10): [True: 7.33M, False: 101]
  |  Branch (5291:26): [True: 1.51M, False: 5.82M]
  ------------------
 5292|  1.51M|    left++;
 5293|  1.51M|  }
 5294|  7.34M|  while (right > 0 && is_space_or_tab(b[right - 1])) {
  ------------------
  |  Branch (5294:10): [True: 7.34M, False: 66]
  |  Branch (5294:23): [True: 1.51M, False: 5.82M]
  ------------------
 5295|  1.51M|    right--;
 5296|  1.51M|  }
 5297|  5.82M|  return std::make_pair(left, right);
 5298|  5.82M|}
_ZN7httplib6detail15is_space_or_tabEc:
 5145|  14.6M|inline bool is_space_or_tab(char c) { return c == ' ' || c == '\t'; }
  ------------------
  |  Branch (5145:46): [True: 2.99M, False: 11.6M]
  |  Branch (5145:58): [True: 30.7k, False: 11.6M]
  ------------------
_ZZN7httplib6detail16parse_query_textEPKcmRNSt3__18multimapINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESA_NS3_4lessISA_EENS8_INS3_4pairIKSA_SA_EEEEEEENKUlS2_S2_E_clES2_S2_:
 7820|  15.7k|  split(data, data + size, '&', [&](const char *b, const char *e) {
 7821|  15.7k|    std::string kv(b, e);
 7822|  15.7k|    if (cache.find(kv) != cache.end()) { return; }
  ------------------
  |  Branch (7822:9): [True: 3.85k, False: 11.9k]
  ------------------
 7823|  11.9k|    cache.insert(std::move(kv));
 7824|       |
 7825|  11.9k|    std::string key;
 7826|  11.9k|    std::string val;
 7827|  11.9k|    divide(b, static_cast<std::size_t>(e - b), '=',
 7828|  11.9k|           [&](const char *lhs_data, std::size_t lhs_size, const char *rhs_data,
 7829|  11.9k|               std::size_t rhs_size) {
 7830|  11.9k|             key.assign(lhs_data, lhs_size);
 7831|  11.9k|             val.assign(rhs_data, rhs_size);
 7832|  11.9k|           });
 7833|       |
 7834|  11.9k|    if (!key.empty()) {
  ------------------
  |  Branch (7834:9): [True: 11.3k, False: 557]
  ------------------
 7835|  11.3k|      params.emplace(decode_query_component(key), decode_query_component(val));
 7836|  11.3k|    }
 7837|  11.9k|  });
_ZN7httplib6detail6divideEPKcmcNSt3__18functionIFvS2_mS2_mEEE:
 5315|  38.9k|           fn) {
 5316|  38.9k|  const auto it = std::find(data, data + size, d);
 5317|  38.9k|  const auto found = static_cast<std::size_t>(it != data + size);
 5318|  38.9k|  const auto lhs_data = data;
 5319|  38.9k|  const auto lhs_size = static_cast<std::size_t>(it - data);
 5320|  38.9k|  const auto rhs_data = it + found;
 5321|  38.9k|  const auto rhs_size = size - lhs_size - found;
 5322|       |
 5323|  38.9k|  fn(lhs_data, lhs_size, rhs_data, rhs_size);
 5324|  38.9k|}
_ZZZN7httplib6detail16parse_query_textEPKcmRNSt3__18multimapINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESA_NS3_4lessISA_EENS8_INS3_4pairIKSA_SA_EEEEEEENKUlS2_S2_E_clES2_S2_ENKUlS2_mS2_mE_clES2_mS2_m:
 7829|  11.9k|               std::size_t rhs_size) {
 7830|  11.9k|             key.assign(lhs_data, lhs_size);
 7831|  11.9k|             val.assign(rhs_data, rhs_size);
 7832|  11.9k|           });
_ZN7httplib22decode_query_componentERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEb:
 9861|  74.8k|                                          bool plus_as_space) {
 9862|  74.8k|  std::string result;
 9863|  74.8k|  result.reserve(component.size());
 9864|       |
 9865|  36.0M|  for (size_t i = 0; i < component.size(); i++) {
  ------------------
  |  Branch (9865:22): [True: 35.9M, False: 74.8k]
  ------------------
 9866|  35.9M|    if (component[i] == '%' && i + 2 < component.size()) {
  ------------------
  |  Branch (9866:9): [True: 840k, False: 35.0M]
  |  Branch (9866:32): [True: 834k, False: 6.27k]
  ------------------
 9867|   834k|      auto val = 0;
 9868|   834k|      if (detail::from_hex_to_i(component, i + 1, 2, val)) {
  ------------------
  |  Branch (9868:11): [True: 276k, False: 557k]
  ------------------
 9869|   276k|        result += static_cast<char>(val);
 9870|   276k|        i += 2;
 9871|   557k|      } else {
 9872|   557k|        result += component[i];
 9873|   557k|      }
 9874|  35.0M|    } else if (component[i] == '+' && plus_as_space) {
  ------------------
  |  Branch (9874:16): [True: 9.44k, False: 35.0M]
  |  Branch (9874:39): [True: 8.98k, False: 457]
  ------------------
 9875|  8.98k|      result += ' '; // + becomes space in form-urlencoded
 9876|  35.0M|    } else {
 9877|  35.0M|      result += component[i];
 9878|  35.0M|    }
 9879|  35.9M|  }
 9880|  74.8k|  return result;
 9881|  74.8k|}
_ZN7httplib6detail13from_hex_to_iERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEmmRi:
 4511|  1.01M|                          int &val) {
 4512|  1.01M|  if (i >= s.size()) { return false; }
  ------------------
  |  Branch (4512:7): [True: 9, False: 1.01M]
  ------------------
 4513|       |
 4514|  1.01M|  val = 0;
 4515|  1.76M|  for (; cnt; i++, cnt--) {
  ------------------
  |  Branch (4515:10): [True: 1.42M, False: 340k]
  ------------------
 4516|  1.42M|    if (!s[i]) { return false; }
  ------------------
  |  Branch (4516:9): [True: 2.75k, False: 1.42M]
  ------------------
 4517|  1.42M|    auto v = 0;
 4518|  1.42M|    if (is_hex(s[i], v)) {
  ------------------
  |  Branch (4518:9): [True: 747k, False: 676k]
  ------------------
 4519|   747k|      val = val * 16 + v;
 4520|   747k|    } else {
 4521|   676k|      return false;
 4522|   676k|    }
 4523|  1.42M|  }
 4524|   340k|  return true;
 4525|  1.01M|}
_ZN7httplib6detail6is_hexEcRi:
 4496|  1.42M|inline bool is_hex(char c, int &v) {
 4497|  1.42M|  if (is_ascii_digit(c)) {
  ------------------
  |  Branch (4497:7): [True: 16.1k, False: 1.40M]
  ------------------
 4498|  16.1k|    v = c - '0';
 4499|  16.1k|    return true;
 4500|  1.40M|  } else if ('A' <= c && c <= 'F') {
  ------------------
  |  Branch (4500:14): [True: 1.01M, False: 397k]
  |  Branch (4500:26): [True: 82.8k, False: 927k]
  ------------------
 4501|  82.8k|    v = c - 'A' + 10;
 4502|  82.8k|    return true;
 4503|  1.32M|  } else if ('a' <= c && c <= 'f') {
  ------------------
  |  Branch (4503:14): [True: 926k, False: 397k]
  |  Branch (4503:26): [True: 648k, False: 278k]
  ------------------
 4504|   648k|    v = c - 'a' + 10;
 4505|   648k|    return true;
 4506|   648k|  }
 4507|   676k|  return false;
 4508|  1.42M|}
_ZN7httplib6detail14is_ascii_digitEc:
  547|  6.68M|inline bool is_ascii_digit(char c) { return '0' <= c && c <= '9'; }
  ------------------
  |  Branch (547:45): [True: 2.26M, False: 4.42M]
  |  Branch (547:57): [True: 1.09M, False: 1.16M]
  ------------------
_ZN7httplib21decode_path_componentERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 9768|    241|inline std::string decode_path_component(const std::string &component) {
 9769|    241|  std::string result;
 9770|    241|  result.reserve(component.size());
 9771|       |
 9772|  5.38M|  for (size_t i = 0; i < component.size(); i++) {
  ------------------
  |  Branch (9772:22): [True: 5.38M, False: 241]
  ------------------
 9773|  5.38M|    if (component[i] == '%' && i + 1 < component.size()) {
  ------------------
  |  Branch (9773:9): [True: 184k, False: 5.19M]
  |  Branch (9773:32): [True: 184k, False: 12]
  ------------------
 9774|   184k|      if (component[i + 1] == 'u') {
  ------------------
  |  Branch (9774:11): [True: 6.35k, False: 178k]
  ------------------
 9775|       |        // Unicode %uXXXX encoding
 9776|  6.35k|        auto val = 0;
 9777|  6.35k|        if (detail::from_hex_to_i(component, i + 2, 4, val)) {
  ------------------
  |  Branch (9777:13): [True: 4.95k, False: 1.40k]
  ------------------
 9778|       |          // 4 digits Unicode codes: val is 0x0000-0xFFFF (from 4 hex digits),
 9779|       |          // so to_utf8 writes at most 3 bytes. buff[4] is safe.
 9780|  4.95k|          char buff[4];
 9781|  4.95k|          size_t len = detail::to_utf8(val, buff);
 9782|  4.95k|          if (len > 0) { result.append(buff, len); }
  ------------------
  |  Branch (9782:15): [True: 3.18k, False: 1.76k]
  ------------------
 9783|  4.95k|          i += 5; // 'u0000'
 9784|  4.95k|        } else {
 9785|  1.40k|          result += component[i];
 9786|  1.40k|        }
 9787|   178k|      } else {
 9788|       |        // Standard %XX encoding
 9789|   178k|        auto val = 0;
 9790|   178k|        if (detail::from_hex_to_i(component, i + 1, 2, val)) {
  ------------------
  |  Branch (9790:13): [True: 58.8k, False: 119k]
  ------------------
 9791|       |          // 2 digits hex codes
 9792|  58.8k|          result += static_cast<char>(val);
 9793|  58.8k|          i += 2; // 'XX'
 9794|   119k|        } else {
 9795|   119k|          result += component[i];
 9796|   119k|        }
 9797|   178k|      }
 9798|  5.19M|    } else {
 9799|  5.19M|      result += component[i];
 9800|  5.19M|    }
 9801|  5.38M|  }
 9802|    241|  return result;
 9803|    241|}
_ZN7httplib6detail7to_utf8EiPc:
 4623|  4.95k|inline size_t to_utf8(int code, char *buff) {
 4624|  4.95k|  if (code < 0x0080) {
  ------------------
  |  Branch (4624:7): [True: 1.52k, False: 3.42k]
  ------------------
 4625|  1.52k|    buff[0] = static_cast<char>(code & 0x7F);
 4626|  1.52k|    return 1;
 4627|  3.42k|  } else if (code < 0x0800) {
  ------------------
  |  Branch (4627:14): [True: 476, False: 2.94k]
  ------------------
 4628|    476|    buff[0] = static_cast<char>(0xC0 | ((code >> 6) & 0x1F));
 4629|    476|    buff[1] = static_cast<char>(0x80 | (code & 0x3F));
 4630|    476|    return 2;
 4631|  2.94k|  } else if (code < 0xD800) {
  ------------------
  |  Branch (4631:14): [True: 798, False: 2.14k]
  ------------------
 4632|    798|    buff[0] = static_cast<char>(0xE0 | ((code >> 12) & 0xF));
 4633|    798|    buff[1] = static_cast<char>(0x80 | ((code >> 6) & 0x3F));
 4634|    798|    buff[2] = static_cast<char>(0x80 | (code & 0x3F));
 4635|    798|    return 3;
 4636|  2.14k|  } else if (code < 0xE000) { // D800 - DFFF is invalid...
  ------------------
  |  Branch (4636:14): [True: 1.76k, False: 382]
  ------------------
 4637|  1.76k|    return 0;
 4638|  1.76k|  } else if (code < 0x10000) {
  ------------------
  |  Branch (4638:14): [True: 382, False: 0]
  ------------------
 4639|    382|    buff[0] = static_cast<char>(0xE0 | ((code >> 12) & 0xF));
 4640|    382|    buff[1] = static_cast<char>(0x80 | ((code >> 6) & 0x3F));
 4641|    382|    buff[2] = static_cast<char>(0x80 | (code & 0x3F));
 4642|    382|    return 3;
 4643|    382|  } else if (code < 0x110000) {
  ------------------
  |  Branch (4643:14): [True: 0, False: 0]
  ------------------
 4644|      0|    buff[0] = static_cast<char>(0xF0 | ((code >> 18) & 0x7));
 4645|      0|    buff[1] = static_cast<char>(0x80 | ((code >> 12) & 0x3F));
 4646|      0|    buff[2] = static_cast<char>(0x80 | ((code >> 6) & 0x3F));
 4647|      0|    buff[3] = static_cast<char>(0x80 | (code & 0x3F));
 4648|      0|    return 4;
 4649|      0|  }
 4650|       |
 4651|       |  // NOTREACHED
 4652|      0|  return 0;
 4653|  4.95k|}
_ZN7httplib22encode_query_componentERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEb:
 9806|  28.1k|                                          bool space_as_plus) {
 9807|  28.1k|  std::string result;
 9808|  28.1k|  result.reserve(component.size() * 3);
 9809|       |
 9810|  5.28M|  for (size_t i = 0; i < component.size(); i++) {
  ------------------
  |  Branch (9810:22): [True: 5.26M, False: 28.1k]
  ------------------
 9811|  5.26M|    auto c = static_cast<unsigned char>(component[i]);
 9812|       |
 9813|       |    // Unreserved characters per RFC 3986
 9814|  5.26M|    if (detail::is_ascii_alnum(static_cast<char>(c)) || c == '-' || c == '.' ||
  ------------------
  |  Branch (9814:9): [True: 1.19M, False: 4.06M]
  |  Branch (9814:57): [True: 5.79k, False: 4.05M]
  |  Branch (9814:69): [True: 13.5k, False: 4.04M]
  ------------------
 9815|  4.04M|        c == '_' || c == '~') {
  ------------------
  |  Branch (9815:9): [True: 1.07k, False: 4.04M]
  |  Branch (9815:21): [True: 1.54k, False: 4.04M]
  ------------------
 9816|  1.22M|      result += static_cast<char>(c);
 9817|  1.22M|    }
 9818|       |    // Space handling
 9819|  4.04M|    else if (c == ' ') {
  ------------------
  |  Branch (9819:14): [True: 34.8k, False: 4.00M]
  ------------------
 9820|  34.8k|      if (space_as_plus) {
  ------------------
  |  Branch (9820:11): [True: 34.8k, False: 0]
  ------------------
 9821|  34.8k|        result += '+';
 9822|  34.8k|      } else {
 9823|      0|        result += "%20";
 9824|      0|      }
 9825|  34.8k|    }
 9826|       |    // Plus sign handling
 9827|  4.00M|    else if (c == '+') {
  ------------------
  |  Branch (9827:14): [True: 357, False: 4.00M]
  ------------------
 9828|    357|      if (space_as_plus) {
  ------------------
  |  Branch (9828:11): [True: 357, False: 0]
  ------------------
 9829|    357|        result += "%2B";
 9830|    357|      } else {
 9831|      0|        result += static_cast<char>(c);
 9832|      0|      }
 9833|    357|    }
 9834|       |    // Query-safe sub-delimiters (excluding & and = which are query delimiters)
 9835|  4.00M|    else if (c == '!' || c == '$' || c == '\'' || c == '(' || c == ')' ||
  ------------------
  |  Branch (9835:14): [True: 1.14k, False: 4.00M]
  |  Branch (9835:26): [True: 960, False: 4.00M]
  |  Branch (9835:38): [True: 1.16k, False: 4.00M]
  |  Branch (9835:51): [True: 1.31k, False: 4.00M]
  |  Branch (9835:63): [True: 1.44k, False: 3.99M]
  ------------------
 9836|  3.99M|             c == '*' || c == ',' || c == ';') {
  ------------------
  |  Branch (9836:14): [True: 1.79k, False: 3.99M]
  |  Branch (9836:26): [True: 1.90k, False: 3.99M]
  |  Branch (9836:38): [True: 1.30k, False: 3.99M]
  ------------------
 9837|  11.0k|      result += static_cast<char>(c);
 9838|  11.0k|    }
 9839|       |    // Colon and @ are allowed in query
 9840|  3.99M|    else if (c == ':' || c == '@') {
  ------------------
  |  Branch (9840:14): [True: 1.28k, False: 3.99M]
  |  Branch (9840:26): [True: 2.00k, False: 3.99M]
  ------------------
 9841|  3.29k|      result += static_cast<char>(c);
 9842|  3.29k|    }
 9843|       |    // Forward slash is allowed in query values
 9844|  3.99M|    else if (c == '/') {
  ------------------
  |  Branch (9844:14): [True: 31.8k, False: 3.95M]
  ------------------
 9845|  31.8k|      result += static_cast<char>(c);
 9846|  31.8k|    }
 9847|       |    // Question mark is allowed in query values (after first ?)
 9848|  3.95M|    else if (c == '?') {
  ------------------
  |  Branch (9848:14): [True: 1.06k, False: 3.95M]
  ------------------
 9849|  1.06k|      result += static_cast<char>(c);
 9850|  3.95M|    } else {
 9851|  3.95M|      result += '%';
 9852|  3.95M|      char hex[3];
 9853|  3.95M|      snprintf(hex, sizeof(hex), "%02X", c);
 9854|  3.95M|      result.append(hex, 2);
 9855|  3.95M|    }
 9856|  5.26M|  }
 9857|  28.1k|  return result;
 9858|  28.1k|}
_ZN7httplib6detail14is_ascii_alnumEc:
  553|  5.26M|inline bool is_ascii_alnum(char c) {
  554|  5.26M|  return is_ascii_digit(c) || is_ascii_alpha(c);
  ------------------
  |  Branch (554:10): [True: 1.07M, False: 4.18M]
  |  Branch (554:31): [True: 120k, False: 4.06M]
  ------------------
  555|  5.26M|}
_ZN7httplib6detail14is_ascii_alphaEc:
  549|  4.18M|inline bool is_ascii_alpha(char c) {
  550|  4.18M|  return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
  ------------------
  |  Branch (550:11): [True: 107k, False: 4.07M]
  |  Branch (550:23): [True: 99.2k, False: 8.62k]
  |  Branch (550:37): [True: 35.5k, False: 4.04M]
  |  Branch (550:49): [True: 21.1k, False: 14.4k]
  ------------------
  551|  4.18M|}
_ZN7httplib6detail22normalize_query_stringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 7848|    325|inline std::string normalize_query_string(const std::string &query) {
 7849|    325|  std::string result;
 7850|    325|  split(query.data(), query.data() + query.size(), '&',
 7851|    325|        [&](const char *b, const char *e) {
 7852|    325|          std::string key;
 7853|    325|          std::string val;
 7854|    325|          divide(b, static_cast<std::size_t>(e - b), '=',
 7855|    325|                 [&](const char *lhs_data, std::size_t lhs_size,
 7856|    325|                     const char *rhs_data, std::size_t rhs_size) {
 7857|    325|                   key.assign(lhs_data, lhs_size);
 7858|    325|                   val.assign(rhs_data, rhs_size);
 7859|    325|                 });
 7860|       |
 7861|    325|          if (!key.empty()) {
 7862|    325|            auto dec_key = decode_query_component(key);
 7863|    325|            auto dec_val = decode_query_component(val);
 7864|       |
 7865|    325|            if (!result.empty()) { result += '&'; }
 7866|    325|            result += encode_query_component(dec_key);
 7867|    325|            if (!val.empty() || std::find(b, e, '=') != e) {
 7868|    325|              result += '=';
 7869|    325|              result += encode_query_component(dec_val);
 7870|    325|            }
 7871|    325|          }
 7872|    325|        });
 7873|    325|  return result;
 7874|    325|}
_ZZN7httplib6detail22normalize_query_stringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENKUlPKcSB_E_clESB_SB_:
 7851|  27.0k|        [&](const char *b, const char *e) {
 7852|  27.0k|          std::string key;
 7853|  27.0k|          std::string val;
 7854|  27.0k|          divide(b, static_cast<std::size_t>(e - b), '=',
 7855|  27.0k|                 [&](const char *lhs_data, std::size_t lhs_size,
 7856|  27.0k|                     const char *rhs_data, std::size_t rhs_size) {
 7857|  27.0k|                   key.assign(lhs_data, lhs_size);
 7858|  27.0k|                   val.assign(rhs_data, rhs_size);
 7859|  27.0k|                 });
 7860|       |
 7861|  27.0k|          if (!key.empty()) {
  ------------------
  |  Branch (7861:15): [True: 25.9k, False: 1.04k]
  ------------------
 7862|  25.9k|            auto dec_key = decode_query_component(key);
 7863|  25.9k|            auto dec_val = decode_query_component(val);
 7864|       |
 7865|  25.9k|            if (!result.empty()) { result += '&'; }
  ------------------
  |  Branch (7865:17): [True: 25.6k, False: 276]
  ------------------
 7866|  25.9k|            result += encode_query_component(dec_key);
 7867|  25.9k|            if (!val.empty() || std::find(b, e, '=') != e) {
  ------------------
  |  Branch (7867:17): [True: 1.02k, False: 24.9k]
  |  Branch (7867:17): [True: 2.04k, False: 23.9k]
  |  Branch (7867:33): [True: 1.02k, False: 23.9k]
  ------------------
 7868|  2.04k|              result += '=';
 7869|  2.04k|              result += encode_query_component(dec_val);
 7870|  2.04k|            }
 7871|  25.9k|          }
 7872|  27.0k|        });
_ZZZN7httplib6detail22normalize_query_stringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENKUlPKcSB_E_clESB_SB_ENKUlSB_mSB_mE_clESB_mSB_m:
 7856|  27.0k|                     const char *rhs_data, std::size_t rhs_size) {
 7857|  27.0k|                   key.assign(lhs_data, lhs_size);
 7858|  27.0k|                   val.assign(rhs_data, rhs_size);
 7859|  27.0k|                 });
_ZN7httplib6detail13is_valid_pathERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5011|    221|inline bool is_valid_path(const std::string &path) {
 5012|    221|  size_t level = 0;
 5013|    221|  size_t i = 0;
 5014|       |
 5015|       |  // Skip slash
 5016|  1.08M|  while (i < path.size() && path[i] == '/') {
  ------------------
  |  Branch (5016:10): [True: 1.08M, False: 13]
  |  Branch (5016:29): [True: 1.08M, False: 208]
  ------------------
 5017|  1.08M|    i++;
 5018|  1.08M|  }
 5019|       |
 5020|   271k|  while (i < path.size()) {
  ------------------
  |  Branch (5020:10): [True: 270k, False: 207]
  ------------------
 5021|       |    // Read component
 5022|   270k|    auto beg = i;
 5023|  2.80M|    while (i < path.size() && path[i] != '/') {
  ------------------
  |  Branch (5023:12): [True: 2.80M, False: 172]
  |  Branch (5023:31): [True: 2.53M, False: 270k]
  ------------------
 5024|  2.53M|      if (path[i] == '\0') {
  ------------------
  |  Branch (5024:11): [True: 11, False: 2.53M]
  ------------------
 5025|     11|        return false;
 5026|  2.53M|      } else if (path[i] == '\\') {
  ------------------
  |  Branch (5026:18): [True: 2, False: 2.53M]
  ------------------
 5027|      2|        return false;
 5028|      2|      }
 5029|  2.53M|      i++;
 5030|  2.53M|    }
 5031|       |
 5032|   270k|    auto len = i - beg;
 5033|   270k|    assert(len > 0);
  ------------------
  |  Branch (5033:5): [True: 270k, False: 0]
  ------------------
 5034|       |
 5035|   270k|    if (!path.compare(beg, len, ".")) {
  ------------------
  |  Branch (5035:9): [True: 14.3k, False: 256k]
  ------------------
 5036|  14.3k|      ;
 5037|   256k|    } else if (!path.compare(beg, len, "..")) {
  ------------------
  |  Branch (5037:16): [True: 42.8k, False: 213k]
  ------------------
 5038|  42.8k|      if (level == 0) { return false; }
  ------------------
  |  Branch (5038:11): [True: 1, False: 42.8k]
  ------------------
 5039|  42.8k|      level--;
 5040|   213k|    } else {
 5041|   213k|      level++;
 5042|   213k|    }
 5043|       |
 5044|       |    // Skip slash
 5045|   947k|    while (i < path.size() && path[i] == '/') {
  ------------------
  |  Branch (5045:12): [True: 947k, False: 194]
  |  Branch (5045:31): [True: 676k, False: 270k]
  ------------------
 5046|   676k|      i++;
 5047|   676k|    }
 5048|   270k|  }
 5049|       |
 5050|    207|  return true;
 5051|    221|}

LLVMFuzzerTestOneInput:
    7|  1.55k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    8|  1.55k|  if (size < 2) return 0;
  ------------------
  |  Branch (8:7): [True: 1, False: 1.55k]
  ------------------
    9|       |
   10|       |  // Use first byte to select which parsing function to exercise
   11|  1.55k|  uint8_t selector = data[0];
   12|  1.55k|  const char *payload = reinterpret_cast<const char *>(data + 1);
   13|  1.55k|  size_t payload_size = size - 1;
   14|  1.55k|  std::string input(payload, payload_size);
   15|       |
   16|  1.55k|  switch (selector % 6) {
  ------------------
  |  Branch (16:11): [True: 1.55k, False: 0]
  ------------------
   17|    582|  case 0: {
  ------------------
  |  Branch (17:3): [True: 582, False: 971]
  ------------------
   18|       |    // parse_query_text
   19|    582|    httplib::Params params;
   20|    582|    httplib::detail::parse_query_text(payload, payload_size, params);
   21|    582|    break;
   22|      0|  }
   23|     72|  case 1: {
  ------------------
  |  Branch (23:3): [True: 72, False: 1.48k]
  ------------------
   24|       |    // decode_query_component
   25|     72|    httplib::decode_query_component(input, true);
   26|     72|    httplib::decode_query_component(input, false);
   27|     72|    break;
   28|      0|  }
   29|    241|  case 2: {
  ------------------
  |  Branch (29:3): [True: 241, False: 1.31k]
  ------------------
   30|       |    // decode_path_component
   31|    241|    httplib::decode_path_component(input);
   32|    241|    break;
   33|      0|  }
   34|    112|  case 3: {
  ------------------
  |  Branch (34:3): [True: 112, False: 1.44k]
  ------------------
   35|       |    // encode_query_component
   36|    112|    httplib::encode_query_component(input);
   37|    112|    break;
   38|      0|  }
   39|    325|  case 4: {
  ------------------
  |  Branch (39:3): [True: 325, False: 1.22k]
  ------------------
   40|       |    // normalize_query_string
   41|    325|    httplib::detail::normalize_query_string(input);
   42|    325|    break;
   43|      0|  }
   44|    221|  case 5: {
  ------------------
  |  Branch (44:3): [True: 221, False: 1.33k]
  ------------------
   45|       |    // is_valid_path
   46|    221|    httplib::detail::is_valid_path(input);
   47|    221|    break;
   48|      0|  }
   49|  1.55k|  }
   50|       |
   51|  1.55k|  return 0;
   52|  1.55k|}

