_ZN7httplib6detail16parse_query_textEPKcmRNSt3__18multimapINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESA_NS3_4lessISA_EENS8_INS3_4pairIKSA_SA_EEEEEE:
 7690|    652|                             Params &params) {
 7691|    652|  std::set<std::string> cache;
 7692|    652|  split(data, data + size, '&', [&](const char *b, const char *e) {
 7693|    652|    std::string kv(b, e);
 7694|    652|    if (cache.find(kv) != cache.end()) { return; }
 7695|    652|    cache.insert(std::move(kv));
 7696|       |
 7697|    652|    std::string key;
 7698|    652|    std::string val;
 7699|    652|    divide(b, static_cast<std::size_t>(e - b), '=',
 7700|    652|           [&](const char *lhs_data, std::size_t lhs_size, const char *rhs_data,
 7701|    652|               std::size_t rhs_size) {
 7702|    652|             key.assign(lhs_data, lhs_size);
 7703|    652|             val.assign(rhs_data, rhs_size);
 7704|    652|           });
 7705|       |
 7706|    652|    if (!key.empty()) {
 7707|    652|      params.emplace(decode_query_component(key), decode_query_component(val));
 7708|    652|    }
 7709|    652|  });
 7710|    652|}
_ZN7httplib6detail5splitEPKcS2_cNSt3__18functionIFvS2_S2_EEE:
 5212|    914|                  std::function<void(const char *, const char *)> fn) {
 5213|    914|  return split(b, e, d, (std::numeric_limits<size_t>::max)(), std::move(fn));
 5214|    914|}
_ZN7httplib6detail5splitEPKcS2_cmNSt3__18functionIFvS2_S2_EEE:
 5217|    914|                  std::function<void(const char *, const char *)> fn) {
 5218|    914|  size_t i = 0;
 5219|    914|  size_t beg = 0;
 5220|    914|  size_t count = 1;
 5221|       |
 5222|  39.6M|  while (e ? (b + i < e) : (b[i] != '\0')) {
  ------------------
  |  Branch (5222:10): [True: 39.6M, False: 0]
  |  Branch (5222:10): [True: 39.6M, False: 914]
  ------------------
 5223|  39.6M|    if (b[i] == d && count < m) {
  ------------------
  |  Branch (5223:9): [True: 4.64M, False: 34.9M]
  |  Branch (5223:22): [True: 4.64M, False: 0]
  ------------------
 5224|  4.64M|      auto r = trim(b, e, beg, i);
 5225|  4.64M|      if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5225:11): [True: 74.2k, False: 4.56M]
  ------------------
 5226|  4.64M|      beg = i + 1;
 5227|  4.64M|      count++;
 5228|  4.64M|    }
 5229|  39.6M|    i++;
 5230|  39.6M|  }
 5231|       |
 5232|    914|  if (i) {
  ------------------
  |  Branch (5232:7): [True: 914, False: 0]
  ------------------
 5233|    914|    auto r = trim(b, e, beg, i);
 5234|    914|    if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5234:9): [True: 814, False: 100]
  ------------------
 5235|    914|  }
 5236|    914|}
_ZN7httplib6detail4trimEPKcS2_mm:
 5168|  4.64M|                                      size_t right) {
 5169|  6.74M|  while (b + left < e && is_space_or_tab(b[left])) {
  ------------------
  |  Branch (5169:10): [True: 6.74M, False: 100]
  |  Branch (5169:26): [True: 2.10M, False: 4.64M]
  ------------------
 5170|  2.10M|    left++;
 5171|  2.10M|  }
 5172|  6.76M|  while (right > 0 && is_space_or_tab(b[right - 1])) {
  ------------------
  |  Branch (5172:10): [True: 6.76M, False: 65]
  |  Branch (5172:23): [True: 2.11M, False: 4.64M]
  ------------------
 5173|  2.11M|    right--;
 5174|  2.11M|  }
 5175|  4.64M|  return std::make_pair(left, right);
 5176|  4.64M|}
_ZN7httplib6detail15is_space_or_tabEc:
 5023|  13.5M|inline bool is_space_or_tab(char c) { return c == ' ' || c == '\t'; }
  ------------------
  |  Branch (5023:46): [True: 2.96M, False: 10.5M]
  |  Branch (5023:58): [True: 1.25M, False: 9.28M]
  ------------------
_ZZN7httplib6detail16parse_query_textEPKcmRNSt3__18multimapINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESA_NS3_4lessISA_EENS8_INS3_4pairIKSA_SA_EEEEEEENKUlS2_S2_E_clES2_S2_:
 7692|  52.2k|  split(data, data + size, '&', [&](const char *b, const char *e) {
 7693|  52.2k|    std::string kv(b, e);
 7694|  52.2k|    if (cache.find(kv) != cache.end()) { return; }
  ------------------
  |  Branch (7694:9): [True: 34.8k, False: 17.4k]
  ------------------
 7695|  17.4k|    cache.insert(std::move(kv));
 7696|       |
 7697|  17.4k|    std::string key;
 7698|  17.4k|    std::string val;
 7699|  17.4k|    divide(b, static_cast<std::size_t>(e - b), '=',
 7700|  17.4k|           [&](const char *lhs_data, std::size_t lhs_size, const char *rhs_data,
 7701|  17.4k|               std::size_t rhs_size) {
 7702|  17.4k|             key.assign(lhs_data, lhs_size);
 7703|  17.4k|             val.assign(rhs_data, rhs_size);
 7704|  17.4k|           });
 7705|       |
 7706|  17.4k|    if (!key.empty()) {
  ------------------
  |  Branch (7706:9): [True: 16.8k, False: 543]
  ------------------
 7707|  16.8k|      params.emplace(decode_query_component(key), decode_query_component(val));
 7708|  16.8k|    }
 7709|  17.4k|  });
_ZN7httplib6detail6divideEPKcmcNSt3__18functionIFvS2_mS2_mEEE:
 5193|  40.2k|           fn) {
 5194|  40.2k|  const auto it = std::find(data, data + size, d);
 5195|  40.2k|  const auto found = static_cast<std::size_t>(it != data + size);
 5196|  40.2k|  const auto lhs_data = data;
 5197|  40.2k|  const auto lhs_size = static_cast<std::size_t>(it - data);
 5198|  40.2k|  const auto rhs_data = it + found;
 5199|  40.2k|  const auto rhs_size = size - lhs_size - found;
 5200|       |
 5201|  40.2k|  fn(lhs_data, lhs_size, rhs_data, rhs_size);
 5202|  40.2k|}
_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:
 7701|  17.4k|               std::size_t rhs_size) {
 7702|  17.4k|             key.assign(lhs_data, lhs_size);
 7703|  17.4k|             val.assign(rhs_data, rhs_size);
 7704|  17.4k|           });
_ZN7httplib22decode_query_componentERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEb:
 9660|  78.2k|                                          bool plus_as_space) {
 9661|  78.2k|  std::string result;
 9662|  78.2k|  result.reserve(component.size());
 9663|       |
 9664|  37.7M|  for (size_t i = 0; i < component.size(); i++) {
  ------------------
  |  Branch (9664:22): [True: 37.6M, False: 78.2k]
  ------------------
 9665|  37.6M|    if (component[i] == '%' && i + 2 < component.size()) {
  ------------------
  |  Branch (9665:9): [True: 573k, False: 37.0M]
  |  Branch (9665:32): [True: 550k, False: 22.4k]
  ------------------
 9666|   550k|      std::string hex = component.substr(i + 1, 2);
 9667|   550k|      char *end;
 9668|   550k|      unsigned long value = std::strtoul(hex.c_str(), &end, 16);
 9669|   550k|      if (end == hex.c_str() + 2) {
  ------------------
  |  Branch (9669:11): [True: 118k, False: 432k]
  ------------------
 9670|   118k|        result += static_cast<char>(value);
 9671|   118k|        i += 2;
 9672|   432k|      } else {
 9673|   432k|        result += component[i];
 9674|   432k|      }
 9675|  37.0M|    } else if (component[i] == '+' && plus_as_space) {
  ------------------
  |  Branch (9675:16): [True: 5.75k, False: 37.0M]
  |  Branch (9675:39): [True: 4.22k, False: 1.52k]
  ------------------
 9676|  4.22k|      result += ' '; // + becomes space in form-urlencoded
 9677|  37.0M|    } else {
 9678|  37.0M|      result += component[i];
 9679|  37.0M|    }
 9680|  37.6M|  }
 9681|  78.2k|  return result;
 9682|  78.2k|}
_ZN7httplib21decode_path_componentERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 9568|    257|inline std::string decode_path_component(const std::string &component) {
 9569|    257|  std::string result;
 9570|    257|  result.reserve(component.size());
 9571|       |
 9572|  4.32M|  for (size_t i = 0; i < component.size(); i++) {
  ------------------
  |  Branch (9572:22): [True: 4.32M, False: 257]
  ------------------
 9573|  4.32M|    if (component[i] == '%' && i + 1 < component.size()) {
  ------------------
  |  Branch (9573:9): [True: 338k, False: 3.98M]
  |  Branch (9573:32): [True: 338k, False: 7]
  ------------------
 9574|   338k|      if (component[i + 1] == 'u') {
  ------------------
  |  Branch (9574:11): [True: 6.55k, False: 332k]
  ------------------
 9575|       |        // Unicode %uXXXX encoding
 9576|  6.55k|        auto val = 0;
 9577|  6.55k|        if (detail::from_hex_to_i(component, i + 2, 4, val)) {
  ------------------
  |  Branch (9577:13): [True: 2.80k, False: 3.74k]
  ------------------
 9578|       |          // 4 digits Unicode codes: val is 0x0000-0xFFFF (from 4 hex digits),
 9579|       |          // so to_utf8 writes at most 3 bytes. buff[4] is safe.
 9580|  2.80k|          char buff[4];
 9581|  2.80k|          size_t len = detail::to_utf8(val, buff);
 9582|  2.80k|          if (len > 0) { result.append(buff, len); }
  ------------------
  |  Branch (9582:15): [True: 2.41k, False: 395]
  ------------------
 9583|  2.80k|          i += 5; // 'u0000'
 9584|  3.74k|        } else {
 9585|  3.74k|          result += component[i];
 9586|  3.74k|        }
 9587|   332k|      } else {
 9588|       |        // Standard %XX encoding
 9589|   332k|        auto val = 0;
 9590|   332k|        if (detail::from_hex_to_i(component, i + 1, 2, val)) {
  ------------------
  |  Branch (9590:13): [True: 116k, False: 215k]
  ------------------
 9591|       |          // 2 digits hex codes
 9592|   116k|          result += static_cast<char>(val);
 9593|   116k|          i += 2; // 'XX'
 9594|   215k|        } else {
 9595|   215k|          result += component[i];
 9596|   215k|        }
 9597|   332k|      }
 9598|  3.98M|    } else {
 9599|  3.98M|      result += component[i];
 9600|  3.98M|    }
 9601|  4.32M|  }
 9602|    257|  return result;
 9603|    257|}
_ZN7httplib6detail13from_hex_to_iERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEmmRi:
 4393|   338k|                          int &val) {
 4394|   338k|  if (i >= s.size()) { return false; }
  ------------------
  |  Branch (4394:7): [True: 8, False: 338k]
  ------------------
 4395|       |
 4396|   338k|  val = 0;
 4397|   602k|  for (; cnt; i++, cnt--) {
  ------------------
  |  Branch (4397:10): [True: 483k, False: 119k]
  ------------------
 4398|   483k|    if (!s[i]) { return false; }
  ------------------
  |  Branch (4398:9): [True: 1.25k, False: 482k]
  ------------------
 4399|   482k|    auto v = 0;
 4400|   482k|    if (is_hex(s[i], v)) {
  ------------------
  |  Branch (4400:9): [True: 264k, False: 218k]
  ------------------
 4401|   264k|      val = val * 16 + v;
 4402|   264k|    } else {
 4403|   218k|      return false;
 4404|   218k|    }
 4405|   482k|  }
 4406|   119k|  return true;
 4407|   338k|}
_ZN7httplib6detail6is_hexEcRi:
 4378|   482k|inline bool is_hex(char c, int &v) {
 4379|   482k|  if (isdigit(c)) {
  ------------------
  |  Branch (4379:7): [True: 11.9k, False: 470k]
  ------------------
 4380|  11.9k|    v = c - '0';
 4381|  11.9k|    return true;
 4382|   470k|  } else if ('A' <= c && c <= 'F') {
  ------------------
  |  Branch (4382:14): [True: 342k, False: 128k]
  |  Branch (4382:26): [True: 28.5k, False: 313k]
  ------------------
 4383|  28.5k|    v = c - 'A' + 10;
 4384|  28.5k|    return true;
 4385|   441k|  } else if ('a' <= c && c <= 'f') {
  ------------------
  |  Branch (4385:14): [True: 312k, False: 128k]
  |  Branch (4385:26): [True: 223k, False: 89.3k]
  ------------------
 4386|   223k|    v = c - 'a' + 10;
 4387|   223k|    return true;
 4388|   223k|  }
 4389|   218k|  return false;
 4390|   482k|}
_ZN7httplib6detail7to_utf8EiPc:
 4505|  2.80k|inline size_t to_utf8(int code, char *buff) {
 4506|  2.80k|  if (code < 0x0080) {
  ------------------
  |  Branch (4506:7): [True: 1.52k, False: 1.28k]
  ------------------
 4507|  1.52k|    buff[0] = static_cast<char>(code & 0x7F);
 4508|  1.52k|    return 1;
 4509|  1.52k|  } else if (code < 0x0800) {
  ------------------
  |  Branch (4509:14): [True: 214, False: 1.07k]
  ------------------
 4510|    214|    buff[0] = static_cast<char>(0xC0 | ((code >> 6) & 0x1F));
 4511|    214|    buff[1] = static_cast<char>(0x80 | (code & 0x3F));
 4512|    214|    return 2;
 4513|  1.07k|  } else if (code < 0xD800) {
  ------------------
  |  Branch (4513:14): [True: 445, False: 628]
  ------------------
 4514|    445|    buff[0] = static_cast<char>(0xE0 | ((code >> 12) & 0xF));
 4515|    445|    buff[1] = static_cast<char>(0x80 | ((code >> 6) & 0x3F));
 4516|    445|    buff[2] = static_cast<char>(0x80 | (code & 0x3F));
 4517|    445|    return 3;
 4518|    628|  } else if (code < 0xE000) { // D800 - DFFF is invalid...
  ------------------
  |  Branch (4518:14): [True: 395, False: 233]
  ------------------
 4519|    395|    return 0;
 4520|    395|  } else if (code < 0x10000) {
  ------------------
  |  Branch (4520:14): [True: 233, False: 0]
  ------------------
 4521|    233|    buff[0] = static_cast<char>(0xE0 | ((code >> 12) & 0xF));
 4522|    233|    buff[1] = static_cast<char>(0x80 | ((code >> 6) & 0x3F));
 4523|    233|    buff[2] = static_cast<char>(0x80 | (code & 0x3F));
 4524|    233|    return 3;
 4525|    233|  } else if (code < 0x110000) {
  ------------------
  |  Branch (4525:14): [True: 0, False: 0]
  ------------------
 4526|      0|    buff[0] = static_cast<char>(0xF0 | ((code >> 18) & 0x7));
 4527|      0|    buff[1] = static_cast<char>(0x80 | ((code >> 12) & 0x3F));
 4528|      0|    buff[2] = static_cast<char>(0x80 | ((code >> 6) & 0x3F));
 4529|      0|    buff[3] = static_cast<char>(0x80 | (code & 0x3F));
 4530|      0|    return 4;
 4531|      0|  }
 4532|       |
 4533|       |  // NOTREACHED
 4534|      0|  return 0;
 4535|  2.80k|}
_ZN7httplib22encode_query_componentERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEb:
 9606|  23.5k|                                          bool space_as_plus) {
 9607|  23.5k|  std::string result;
 9608|  23.5k|  result.reserve(component.size() * 3);
 9609|       |
 9610|  5.27M|  for (size_t i = 0; i < component.size(); i++) {
  ------------------
  |  Branch (9610:22): [True: 5.25M, False: 23.5k]
  ------------------
 9611|  5.25M|    auto c = static_cast<unsigned char>(component[i]);
 9612|       |
 9613|       |    // Unreserved characters per RFC 3986
 9614|  5.25M|    if (std::isalnum(c) || c == '-' || c == '.' || c == '_' || c == '~') {
  ------------------
  |  Branch (9614:9): [True: 410k, False: 4.84M]
  |  Branch (9614:28): [True: 5.63k, False: 4.83M]
  |  Branch (9614:40): [True: 5.05k, False: 4.83M]
  |  Branch (9614:52): [True: 7.71k, False: 4.82M]
  |  Branch (9614:64): [True: 2.84k, False: 4.82M]
  ------------------
 9615|   432k|      result += static_cast<char>(c);
 9616|   432k|    }
 9617|       |    // Space handling
 9618|  4.82M|    else if (c == ' ') {
  ------------------
  |  Branch (9618:14): [True: 18.0k, False: 4.80M]
  ------------------
 9619|  18.0k|      if (space_as_plus) {
  ------------------
  |  Branch (9619:11): [True: 18.0k, False: 0]
  ------------------
 9620|  18.0k|        result += '+';
 9621|  18.0k|      } else {
 9622|      0|        result += "%20";
 9623|      0|      }
 9624|  18.0k|    }
 9625|       |    // Plus sign handling
 9626|  4.80M|    else if (c == '+') {
  ------------------
  |  Branch (9626:14): [True: 2.64k, False: 4.80M]
  ------------------
 9627|  2.64k|      if (space_as_plus) {
  ------------------
  |  Branch (9627:11): [True: 2.64k, False: 0]
  ------------------
 9628|  2.64k|        result += "%2B";
 9629|  2.64k|      } else {
 9630|      0|        result += static_cast<char>(c);
 9631|      0|      }
 9632|  2.64k|    }
 9633|       |    // Query-safe sub-delimiters (excluding & and = which are query delimiters)
 9634|  4.80M|    else if (c == '!' || c == '$' || c == '\'' || c == '(' || c == ')' ||
  ------------------
  |  Branch (9634:14): [True: 2.67k, False: 4.79M]
  |  Branch (9634:26): [True: 3.65k, False: 4.79M]
  |  Branch (9634:38): [True: 2.44k, False: 4.79M]
  |  Branch (9634:51): [True: 6.99k, False: 4.78M]
  |  Branch (9634:63): [True: 3.15k, False: 4.78M]
  ------------------
 9635|  4.78M|             c == '*' || c == ',' || c == ';') {
  ------------------
  |  Branch (9635:14): [True: 3.36k, False: 4.77M]
  |  Branch (9635:26): [True: 4.99k, False: 4.77M]
  |  Branch (9635:38): [True: 8.06k, False: 4.76M]
  ------------------
 9636|  35.3k|      result += static_cast<char>(c);
 9637|  35.3k|    }
 9638|       |    // Colon and @ are allowed in query
 9639|  4.76M|    else if (c == ':' || c == '@') {
  ------------------
  |  Branch (9639:14): [True: 8.13k, False: 4.75M]
  |  Branch (9639:26): [True: 133k, False: 4.62M]
  ------------------
 9640|   141k|      result += static_cast<char>(c);
 9641|   141k|    }
 9642|       |    // Forward slash is allowed in query values
 9643|  4.62M|    else if (c == '/') {
  ------------------
  |  Branch (9643:14): [True: 6.92k, False: 4.61M]
  ------------------
 9644|  6.92k|      result += static_cast<char>(c);
 9645|  6.92k|    }
 9646|       |    // Question mark is allowed in query values (after first ?)
 9647|  4.61M|    else if (c == '?') {
  ------------------
  |  Branch (9647:14): [True: 2.68k, False: 4.61M]
  ------------------
 9648|  2.68k|      result += static_cast<char>(c);
 9649|  4.61M|    } else {
 9650|  4.61M|      result += '%';
 9651|  4.61M|      char hex[3];
 9652|  4.61M|      snprintf(hex, sizeof(hex), "%02X", c);
 9653|  4.61M|      result.append(hex, 2);
 9654|  4.61M|    }
 9655|  5.25M|  }
 9656|  23.5k|  return result;
 9657|  23.5k|}
_ZN7httplib6detail22normalize_query_stringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 7720|    262|inline std::string normalize_query_string(const std::string &query) {
 7721|    262|  std::string result;
 7722|    262|  split(query.data(), query.data() + query.size(), '&',
 7723|    262|        [&](const char *b, const char *e) {
 7724|    262|          std::string key;
 7725|    262|          std::string val;
 7726|    262|          divide(b, static_cast<std::size_t>(e - b), '=',
 7727|    262|                 [&](const char *lhs_data, std::size_t lhs_size,
 7728|    262|                     const char *rhs_data, std::size_t rhs_size) {
 7729|    262|                   key.assign(lhs_data, lhs_size);
 7730|    262|                   val.assign(rhs_data, rhs_size);
 7731|    262|                 });
 7732|       |
 7733|    262|          if (!key.empty()) {
 7734|    262|            auto dec_key = decode_query_component(key);
 7735|    262|            auto dec_val = decode_query_component(val);
 7736|       |
 7737|    262|            if (!result.empty()) { result += '&'; }
 7738|    262|            result += encode_query_component(dec_key);
 7739|    262|            if (!val.empty() || std::find(b, e, '=') != e) {
 7740|    262|              result += '=';
 7741|    262|              result += encode_query_component(dec_val);
 7742|    262|            }
 7743|    262|          }
 7744|    262|        });
 7745|    262|  return result;
 7746|    262|}
_ZZN7httplib6detail22normalize_query_stringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENKUlPKcSB_E_clESB_SB_:
 7723|  22.8k|        [&](const char *b, const char *e) {
 7724|  22.8k|          std::string key;
 7725|  22.8k|          std::string val;
 7726|  22.8k|          divide(b, static_cast<std::size_t>(e - b), '=',
 7727|  22.8k|                 [&](const char *lhs_data, std::size_t lhs_size,
 7728|  22.8k|                     const char *rhs_data, std::size_t rhs_size) {
 7729|  22.8k|                   key.assign(lhs_data, lhs_size);
 7730|  22.8k|                   val.assign(rhs_data, rhs_size);
 7731|  22.8k|                 });
 7732|       |
 7733|  22.8k|          if (!key.empty()) {
  ------------------
  |  Branch (7733:15): [True: 22.2k, False: 601]
  ------------------
 7734|  22.2k|            auto dec_key = decode_query_component(key);
 7735|  22.2k|            auto dec_val = decode_query_component(val);
 7736|       |
 7737|  22.2k|            if (!result.empty()) { result += '&'; }
  ------------------
  |  Branch (7737:17): [True: 21.9k, False: 227]
  ------------------
 7738|  22.2k|            result += encode_query_component(dec_key);
 7739|  22.2k|            if (!val.empty() || std::find(b, e, '=') != e) {
  ------------------
  |  Branch (7739:17): [True: 578, False: 21.6k]
  |  Branch (7739:17): [True: 1.21k, False: 21.0k]
  |  Branch (7739:33): [True: 639, False: 21.0k]
  ------------------
 7740|  1.21k|              result += '=';
 7741|  1.21k|              result += encode_query_component(dec_val);
 7742|  1.21k|            }
 7743|  22.2k|          }
 7744|  22.8k|        });
_ZZZN7httplib6detail22normalize_query_stringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENKUlPKcSB_E_clESB_SB_ENKUlSB_mSB_mE_clESB_mSB_m:
 7728|  22.8k|                     const char *rhs_data, std::size_t rhs_size) {
 7729|  22.8k|                   key.assign(lhs_data, lhs_size);
 7730|  22.8k|                   val.assign(rhs_data, rhs_size);
 7731|  22.8k|                 });
_ZN7httplib6detail13is_valid_pathERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 4889|    217|inline bool is_valid_path(const std::string &path) {
 4890|    217|  size_t level = 0;
 4891|    217|  size_t i = 0;
 4892|       |
 4893|       |  // Skip slash
 4894|  1.04M|  while (i < path.size() && path[i] == '/') {
  ------------------
  |  Branch (4894:10): [True: 1.04M, False: 14]
  |  Branch (4894:29): [True: 1.04M, False: 203]
  ------------------
 4895|  1.04M|    i++;
 4896|  1.04M|  }
 4897|       |
 4898|   789k|  while (i < path.size()) {
  ------------------
  |  Branch (4898:10): [True: 789k, False: 208]
  ------------------
 4899|       |    // Read component
 4900|   789k|    auto beg = i;
 4901|  4.04M|    while (i < path.size() && path[i] != '/') {
  ------------------
  |  Branch (4901:12): [True: 4.04M, False: 168]
  |  Branch (4901:31): [True: 3.25M, False: 789k]
  ------------------
 4902|  3.25M|      if (path[i] == '\0') {
  ------------------
  |  Branch (4902:11): [True: 6, False: 3.25M]
  ------------------
 4903|      6|        return false;
 4904|  3.25M|      } else if (path[i] == '\\') {
  ------------------
  |  Branch (4904:18): [True: 2, False: 3.25M]
  ------------------
 4905|      2|        return false;
 4906|      2|      }
 4907|  3.25M|      i++;
 4908|  3.25M|    }
 4909|       |
 4910|   789k|    auto len = i - beg;
 4911|   789k|    assert(len > 0);
  ------------------
  |  Branch (4911:5): [True: 789k, False: 0]
  ------------------
 4912|       |
 4913|   789k|    if (!path.compare(beg, len, ".")) {
  ------------------
  |  Branch (4913:9): [True: 36.7k, False: 752k]
  ------------------
 4914|  36.7k|      ;
 4915|   752k|    } else if (!path.compare(beg, len, "..")) {
  ------------------
  |  Branch (4915:16): [True: 42.5k, False: 710k]
  ------------------
 4916|  42.5k|      if (level == 0) { return false; }
  ------------------
  |  Branch (4916:11): [True: 1, False: 42.5k]
  ------------------
 4917|  42.5k|      level--;
 4918|   710k|    } else {
 4919|   710k|      level++;
 4920|   710k|    }
 4921|       |
 4922|       |    // Skip slash
 4923|  1.65M|    while (i < path.size() && path[i] == '/') {
  ------------------
  |  Branch (4923:12): [True: 1.65M, False: 194]
  |  Branch (4923:31): [True: 867k, False: 789k]
  ------------------
 4924|   867k|      i++;
 4925|   867k|    }
 4926|   789k|  }
 4927|       |
 4928|    208|  return true;
 4929|    217|}

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

