_ZN7httplib6detail18parse_range_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorINS1_4pairIllEENS5_ISC_EEEE:
 7913|    485|inline bool parse_range_header(const std::string &s, Ranges &ranges) try {
 7914|    485|#endif
 7915|    485|  auto is_valid = [](const std::string &str) {
 7916|    485|    return std::all_of(str.cbegin(), str.cend(), is_ascii_digit);
 7917|    485|  };
 7918|       |
 7919|    485|  if (s.size() > 7 && s.compare(0, 6, "bytes=") == 0) {
  ------------------
  |  Branch (7919:7): [True: 480, False: 5]
  |  Branch (7919:23): [True: 457, False: 23]
  ------------------
 7920|    457|    const auto pos = static_cast<size_t>(6);
 7921|    457|    const auto len = static_cast<size_t>(s.size() - 6);
 7922|    457|    auto all_valid_ranges = true;
 7923|    457|    split(&s[pos], &s[pos + len], ',', [&](const char *b, const char *e) {
 7924|    457|      if (!all_valid_ranges) { return; }
 7925|       |
 7926|    457|      const auto it = std::find(b, e, '-');
 7927|    457|      if (it == e) {
 7928|    457|        all_valid_ranges = false;
 7929|    457|        return;
 7930|    457|      }
 7931|       |
 7932|    457|      const auto lhs = std::string(b, it);
 7933|    457|      const auto rhs = std::string(it + 1, e);
 7934|    457|      if (!is_valid(lhs) || !is_valid(rhs)) {
 7935|    457|        all_valid_ranges = false;
 7936|    457|        return;
 7937|    457|      }
 7938|       |
 7939|    457|      ssize_t first = -1;
 7940|    457|      if (!lhs.empty()) {
 7941|    457|        ssize_t v;
 7942|    457|        auto res = detail::from_chars(lhs.data(), lhs.data() + lhs.size(), v);
 7943|    457|        if (res.ec == std::errc{}) { first = v; }
 7944|    457|      }
 7945|       |
 7946|    457|      ssize_t last = -1;
 7947|    457|      if (!rhs.empty()) {
 7948|    457|        ssize_t v;
 7949|    457|        auto res = detail::from_chars(rhs.data(), rhs.data() + rhs.size(), v);
 7950|    457|        if (res.ec == std::errc{}) { last = v; }
 7951|    457|      }
 7952|       |
 7953|    457|      if ((first == -1 && last == -1) ||
 7954|    457|          (first != -1 && last != -1 && first > last)) {
 7955|    457|        all_valid_ranges = false;
 7956|    457|        return;
 7957|    457|      }
 7958|       |
 7959|    457|      ranges.emplace_back(first, last);
 7960|    457|    });
 7961|    457|    return all_valid_ranges && !ranges.empty();
  ------------------
  |  Branch (7961:12): [True: 271, False: 186]
  |  Branch (7961:32): [True: 271, False: 0]
  ------------------
 7962|    457|  }
 7963|     28|  return false;
 7964|       |#ifdef CPPHTTPLIB_NO_EXCEPTIONS
 7965|       |}
 7966|       |#else
 7967|    485|} catch (...) { return false; }
_ZN7httplib6detail5splitEPKcS2_cNSt3__18functionIFvS2_S2_EEE:
 5334|  26.6k|                  std::function<void(const char *, const char *)> fn) {
 5335|  26.6k|  return split(b, e, d, (std::numeric_limits<size_t>::max)(), std::move(fn));
 5336|  26.6k|}
_ZN7httplib6detail5splitEPKcS2_cmNSt3__18functionIFvS2_S2_EEE:
 5339|  26.6k|                  std::function<void(const char *, const char *)> fn) {
 5340|  26.6k|  size_t i = 0;
 5341|  26.6k|  size_t beg = 0;
 5342|  26.6k|  size_t count = 1;
 5343|       |
 5344|   107M|  while (e ? (b + i < e) : (b[i] != '\0')) {
  ------------------
  |  Branch (5344:10): [True: 107M, False: 0]
  |  Branch (5344:10): [True: 107M, False: 26.6k]
  ------------------
 5345|   107M|    if (b[i] == d && count < m) {
  ------------------
  |  Branch (5345:9): [True: 10.8M, False: 96.9M]
  |  Branch (5345:22): [True: 10.8M, False: 0]
  ------------------
 5346|  10.8M|      auto r = trim(b, e, beg, i);
 5347|  10.8M|      if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5347:11): [True: 5.62M, False: 5.18M]
  ------------------
 5348|  10.8M|      beg = i + 1;
 5349|  10.8M|      count++;
 5350|  10.8M|    }
 5351|   107M|    i++;
 5352|   107M|  }
 5353|       |
 5354|  26.6k|  if (i) {
  ------------------
  |  Branch (5354:7): [True: 26.6k, False: 6]
  ------------------
 5355|  26.6k|    auto r = trim(b, e, beg, i);
 5356|  26.6k|    if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5356:9): [True: 25.5k, False: 1.13k]
  ------------------
 5357|  26.6k|  }
 5358|  26.6k|}
_ZN7httplib6detail4trimEPKcS2_mm:
 5290|  37.9M|                                      size_t right) {
 5291|  41.1M|  while (b + left < e && is_space_or_tab(b[left])) {
  ------------------
  |  Branch (5291:10): [True: 41.1M, False: 3.09k]
  |  Branch (5291:26): [True: 3.21M, False: 37.9M]
  ------------------
 5292|  3.21M|    left++;
 5293|  3.21M|  }
 5294|  41.3M|  while (right > 0 && is_space_or_tab(b[right - 1])) {
  ------------------
  |  Branch (5294:10): [True: 41.3M, False: 2.51k]
  |  Branch (5294:23): [True: 3.34M, False: 37.9M]
  ------------------
 5295|  3.34M|    right--;
 5296|  3.34M|  }
 5297|  37.9M|  return std::make_pair(left, right);
 5298|  37.9M|}
_ZN7httplib6detail15is_space_or_tabEc:
 5145|  82.5M|inline bool is_space_or_tab(char c) { return c == ' ' || c == '\t'; }
  ------------------
  |  Branch (5145:46): [True: 6.56M, False: 75.9M]
  |  Branch (5145:58): [True: 1.20k, False: 75.9M]
  ------------------
_ZZN7httplib6detail18parse_range_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorINS1_4pairIllEENS5_ISC_EEEEENKUlPKcSH_E_clESH_SH_:
 7923|   109k|    split(&s[pos], &s[pos + len], ',', [&](const char *b, const char *e) {
 7924|   109k|      if (!all_valid_ranges) { return; }
  ------------------
  |  Branch (7924:11): [True: 47.2k, False: 62.5k]
  ------------------
 7925|       |
 7926|  62.5k|      const auto it = std::find(b, e, '-');
 7927|  62.5k|      if (it == e) {
  ------------------
  |  Branch (7927:11): [True: 19, False: 62.5k]
  ------------------
 7928|     19|        all_valid_ranges = false;
 7929|     19|        return;
 7930|     19|      }
 7931|       |
 7932|  62.5k|      const auto lhs = std::string(b, it);
 7933|  62.5k|      const auto rhs = std::string(it + 1, e);
 7934|  62.5k|      if (!is_valid(lhs) || !is_valid(rhs)) {
  ------------------
  |  Branch (7934:11): [True: 9, False: 62.5k]
  |  Branch (7934:29): [True: 8, False: 62.5k]
  ------------------
 7935|     17|        all_valid_ranges = false;
 7936|     17|        return;
 7937|     17|      }
 7938|       |
 7939|  62.5k|      ssize_t first = -1;
 7940|  62.5k|      if (!lhs.empty()) {
  ------------------
  |  Branch (7940:11): [True: 61.9k, False: 577]
  ------------------
 7941|  61.9k|        ssize_t v;
 7942|  61.9k|        auto res = detail::from_chars(lhs.data(), lhs.data() + lhs.size(), v);
 7943|  61.9k|        if (res.ec == std::errc{}) { first = v; }
  ------------------
  |  Branch (7943:13): [True: 61.6k, False: 257]
  ------------------
 7944|  61.9k|      }
 7945|       |
 7946|  62.5k|      ssize_t last = -1;
 7947|  62.5k|      if (!rhs.empty()) {
  ------------------
  |  Branch (7947:11): [True: 1.57k, False: 60.9k]
  ------------------
 7948|  1.57k|        ssize_t v;
 7949|  1.57k|        auto res = detail::from_chars(rhs.data(), rhs.data() + rhs.size(), v);
 7950|  1.57k|        if (res.ec == std::errc{}) { last = v; }
  ------------------
  |  Branch (7950:13): [True: 1.22k, False: 346]
  ------------------
 7951|  1.57k|      }
 7952|       |
 7953|  62.5k|      if ((first == -1 && last == -1) ||
  ------------------
  |  Branch (7953:12): [True: 834, False: 61.6k]
  |  Branch (7953:27): [True: 67, False: 767]
  ------------------
 7954|  62.4k|          (first != -1 && last != -1 && first > last)) {
  ------------------
  |  Branch (7954:12): [True: 61.6k, False: 767]
  |  Branch (7954:27): [True: 459, False: 61.2k]
  |  Branch (7954:41): [True: 83, False: 376]
  ------------------
 7955|    150|        all_valid_ranges = false;
 7956|    150|        return;
 7957|    150|      }
 7958|       |
 7959|  62.3k|      ranges.emplace_back(first, last);
 7960|  62.3k|    });
_ZZN7httplib6detail18parse_range_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorINS1_4pairIllEENS5_ISC_EEEEENKUlS9_E_clES9_:
 7915|   125k|  auto is_valid = [](const std::string &str) {
 7916|   125k|    return std::all_of(str.cbegin(), str.cend(), is_ascii_digit);
 7917|   125k|  };
_ZN7httplib6detail14is_ascii_digitEc:
  547|   243k|inline bool is_ascii_digit(char c) { return '0' <= c && c <= '9'; }
  ------------------
  |  Branch (547:45): [True: 232k, False: 10.8k]
  |  Branch (547:57): [True: 229k, False: 3.51k]
  ------------------
_ZN7httplib6detail10from_charsIlEENS0_17from_chars_resultIT_EEPKcS6_RS3_i:
  663|  63.5k|                                       T &value, int base = 10) {
  664|  63.5k|  value = 0;
  665|  63.5k|  const char *p = first;
  666|  63.5k|  bool negative = false;
  667|       |
  668|  63.5k|  if (p != last && *p == '-') {
  ------------------
  |  Branch (668:7): [True: 63.5k, False: 0]
  |  Branch (668:20): [True: 0, False: 63.5k]
  ------------------
  669|      0|    negative = true;
  670|      0|    ++p;
  671|      0|  }
  672|  63.5k|  if (p == last) { return {first, std::errc::invalid_argument}; }
  ------------------
  |  Branch (672:7): [True: 0, False: 63.5k]
  ------------------
  673|       |
  674|  63.5k|  T result = 0;
  675|   141k|  for (; p != last; ++p) {
  ------------------
  |  Branch (675:10): [True: 78.8k, False: 62.9k]
  ------------------
  676|  78.8k|    char c = *p;
  677|  78.8k|    int digit = -1;
  678|  78.8k|    if (is_ascii_digit(c)) {
  ------------------
  |  Branch (678:9): [True: 78.8k, False: 0]
  ------------------
  679|  78.8k|      digit = c - '0';
  680|  78.8k|    } else if ('a' <= c && c <= 'z') {
  ------------------
  |  Branch (680:16): [True: 0, False: 0]
  |  Branch (680:28): [True: 0, False: 0]
  ------------------
  681|      0|      digit = c - 'a' + 10;
  682|      0|    } else if ('A' <= c && c <= 'Z') {
  ------------------
  |  Branch (682:16): [True: 0, False: 0]
  |  Branch (682:28): [True: 0, False: 0]
  ------------------
  683|      0|      digit = c - 'A' + 10;
  684|      0|    } else {
  685|      0|      break;
  686|      0|    }
  687|       |
  688|  78.8k|    if (digit < 0 || digit >= base) { break; }
  ------------------
  |  Branch (688:9): [True: 0, False: 78.8k]
  |  Branch (688:22): [True: 0, False: 78.8k]
  ------------------
  689|  78.8k|    if (result > ((std::numeric_limits<T>::max)() - digit) / base) {
  ------------------
  |  Branch (689:9): [True: 603, False: 78.2k]
  ------------------
  690|    603|      return {p, std::errc::result_out_of_range};
  691|    603|    }
  692|  78.2k|    result = result * base + digit;
  693|  78.2k|  }
  694|       |
  695|  62.9k|  if (p == first || (negative && p == first + 1)) {
  ------------------
  |  Branch (695:7): [True: 0, False: 62.9k]
  |  Branch (695:22): [True: 0, False: 62.9k]
  |  Branch (695:34): [True: 0, False: 0]
  ------------------
  696|      0|    return {first, std::errc::invalid_argument};
  697|      0|  }
  698|       |
  699|  62.9k|  value = negative ? -result : result;
  ------------------
  |  Branch (699:11): [True: 0, False: 62.9k]
  ------------------
  700|  62.9k|  return {p, std::errc{}};
  701|  62.9k|}
_ZN7httplib6detail19parse_accept_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorIS7_NS5_IS7_EEEE:
 7971|  1.42k|                                std::vector<std::string> &content_types) {
 7972|  1.42k|  content_types.clear();
 7973|       |
 7974|       |  // Empty string is considered valid (no preference)
 7975|  1.42k|  if (s.empty()) { return true; }
  ------------------
  |  Branch (7975:7): [True: 0, False: 1.42k]
  ------------------
 7976|       |
 7977|       |  // Check for invalid patterns: leading/trailing commas or consecutive commas
 7978|  1.42k|  if (s.front() == ',' || s.back() == ',' ||
  ------------------
  |  Branch (7978:7): [True: 2, False: 1.41k]
  |  Branch (7978:27): [True: 1, False: 1.41k]
  ------------------
 7979|  1.41k|      s.find(",,") != std::string::npos) {
  ------------------
  |  Branch (7979:7): [True: 22, False: 1.39k]
  ------------------
 7980|     25|    return false;
 7981|     25|  }
 7982|       |
 7983|  1.39k|  struct AcceptEntry {
 7984|  1.39k|    std::string media_type;
 7985|  1.39k|    double quality;
 7986|  1.39k|    int order;
 7987|  1.39k|  };
 7988|       |
 7989|  1.39k|  std::vector<AcceptEntry> entries;
 7990|  1.39k|  int order = 0;
 7991|  1.39k|  bool has_invalid_entry = false;
 7992|       |
 7993|       |  // Split by comma and parse each entry
 7994|  1.39k|  split(s.data(), s.data() + s.size(), ',', [&](const char *b, const char *e) {
 7995|  1.39k|    std::string entry(b, e);
 7996|  1.39k|    entry = trim_copy(entry);
 7997|       |
 7998|  1.39k|    if (entry.empty()) {
 7999|  1.39k|      has_invalid_entry = true;
 8000|  1.39k|      return;
 8001|  1.39k|    }
 8002|       |
 8003|  1.39k|    AcceptEntry accept_entry;
 8004|  1.39k|    accept_entry.order = order++;
 8005|       |
 8006|  1.39k|    if (!parse_quality(entry.data(), entry.data() + entry.size(),
 8007|  1.39k|                       accept_entry.media_type, accept_entry.quality)) {
 8008|  1.39k|      has_invalid_entry = true;
 8009|  1.39k|      return;
 8010|  1.39k|    }
 8011|       |
 8012|       |    // Remove additional parameters from media type
 8013|  1.39k|    accept_entry.media_type = extract_media_type(accept_entry.media_type);
 8014|       |
 8015|       |    // Basic validation of media type format
 8016|  1.39k|    if (accept_entry.media_type.empty()) {
 8017|  1.39k|      has_invalid_entry = true;
 8018|  1.39k|      return;
 8019|  1.39k|    }
 8020|       |
 8021|       |    // Check for basic media type format (should contain '/' or be '*')
 8022|  1.39k|    if (accept_entry.media_type != "*" &&
 8023|  1.39k|        accept_entry.media_type.find('/') == std::string::npos) {
 8024|  1.39k|      has_invalid_entry = true;
 8025|  1.39k|      return;
 8026|  1.39k|    }
 8027|       |
 8028|  1.39k|    entries.push_back(std::move(accept_entry));
 8029|  1.39k|  });
 8030|       |
 8031|       |  // Return false if any invalid entry was found
 8032|  1.39k|  if (has_invalid_entry) { return false; }
  ------------------
  |  Branch (8032:7): [True: 625, False: 771]
  ------------------
 8033|       |
 8034|       |  // Sort by quality (descending), then by original order (ascending)
 8035|    771|  std::sort(entries.begin(), entries.end(),
 8036|    771|            [](const AcceptEntry &a, const AcceptEntry &b) {
 8037|    771|              if (a.quality != b.quality) {
 8038|    771|                return a.quality > b.quality; // Higher quality first
 8039|    771|              }
 8040|    771|              return a.order < b.order; // Earlier order first for same quality
 8041|    771|            });
 8042|       |
 8043|       |  // Extract sorted media types
 8044|    771|  content_types.reserve(entries.size());
 8045|  5.42M|  for (auto &entry : entries) {
  ------------------
  |  Branch (8045:20): [True: 5.42M, False: 771]
  ------------------
 8046|  5.42M|    content_types.push_back(std::move(entry.media_type));
 8047|  5.42M|  }
 8048|       |
 8049|    771|  return true;
 8050|  1.39k|}
_ZZN7httplib6detail19parse_accept_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorIS7_NS5_IS7_EEEEENKUlPKcSF_E_clESF_SF_:
 7994|  5.48M|  split(s.data(), s.data() + s.size(), ',', [&](const char *b, const char *e) {
 7995|  5.48M|    std::string entry(b, e);
 7996|  5.48M|    entry = trim_copy(entry);
 7997|       |
 7998|  5.48M|    if (entry.empty()) {
  ------------------
  |  Branch (7998:9): [True: 0, False: 5.48M]
  ------------------
 7999|      0|      has_invalid_entry = true;
 8000|      0|      return;
 8001|      0|    }
 8002|       |
 8003|  5.48M|    AcceptEntry accept_entry;
 8004|  5.48M|    accept_entry.order = order++;
 8005|       |
 8006|  5.48M|    if (!parse_quality(entry.data(), entry.data() + entry.size(),
  ------------------
  |  Branch (8006:9): [True: 4.02k, False: 5.47M]
  ------------------
 8007|  5.48M|                       accept_entry.media_type, accept_entry.quality)) {
 8008|  4.02k|      has_invalid_entry = true;
 8009|  4.02k|      return;
 8010|  4.02k|    }
 8011|       |
 8012|       |    // Remove additional parameters from media type
 8013|  5.47M|    accept_entry.media_type = extract_media_type(accept_entry.media_type);
 8014|       |
 8015|       |    // Basic validation of media type format
 8016|  5.47M|    if (accept_entry.media_type.empty()) {
  ------------------
  |  Branch (8016:9): [True: 0, False: 5.47M]
  ------------------
 8017|      0|      has_invalid_entry = true;
 8018|      0|      return;
 8019|      0|    }
 8020|       |
 8021|       |    // Check for basic media type format (should contain '/' or be '*')
 8022|  5.47M|    if (accept_entry.media_type != "*" &&
  ------------------
  |  Branch (8022:9): [True: 5.34M, False: 133k]
  ------------------
 8023|  5.34M|        accept_entry.media_type.find('/') == std::string::npos) {
  ------------------
  |  Branch (8023:9): [True: 6.96k, False: 5.33M]
  ------------------
 8024|  6.96k|      has_invalid_entry = true;
 8025|  6.96k|      return;
 8026|  6.96k|    }
 8027|       |
 8028|  5.47M|    entries.push_back(std::move(accept_entry));
 8029|  5.47M|  });
_ZN7httplib6detail9trim_copyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5300|  10.9M|inline std::string trim_copy(const std::string &s) {
 5301|  10.9M|  auto r = trim(s.data(), s.data() + s.size(), 0, s.size());
 5302|  10.9M|  return s.substr(r.first, r.second - r.first);
 5303|  10.9M|}
_ZN7httplib6detail13parse_qualityEPKcS2_RNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERd:
 6692|  5.48M|                          double &quality) {
 6693|  5.48M|  quality = 1.0;
 6694|  5.48M|  token.clear();
 6695|       |
 6696|       |  // Split on first ';': left = token name, right = parameters
 6697|  5.48M|  const char *params_b = nullptr;
 6698|  5.48M|  std::size_t params_len = 0;
 6699|       |
 6700|  5.48M|  divide(
 6701|  5.48M|      b, static_cast<std::size_t>(e - b), ';',
 6702|  5.48M|      [&](const char *lb, std::size_t llen, const char *rb, std::size_t rlen) {
 6703|  5.48M|        auto r = trim(lb, lb + llen, 0, llen);
 6704|  5.48M|        if (r.first < r.second) { token.assign(lb + r.first, lb + r.second); }
 6705|  5.48M|        params_b = rb;
 6706|  5.48M|        params_len = rlen;
 6707|  5.48M|      });
 6708|       |
 6709|  5.48M|  if (token.empty()) { return false; }
  ------------------
  |  Branch (6709:7): [True: 313, False: 5.48M]
  ------------------
 6710|  5.48M|  if (params_len == 0) { return true; }
  ------------------
  |  Branch (6710:7): [True: 5.40M, False: 76.0k]
  ------------------
 6711|       |
 6712|       |  // Scan parameters for q= (stops on first match)
 6713|  76.0k|  bool invalid = false;
 6714|  76.0k|  split_find(params_b, params_b + params_len, ';',
 6715|  76.0k|             (std::numeric_limits<size_t>::max)(),
 6716|  76.0k|             [&](const char *pb, const char *pe) -> bool {
 6717|       |               // Match exactly "q=" or "Q=" (not "query=" etc.)
 6718|  76.0k|               auto len = static_cast<size_t>(pe - pb);
 6719|  76.0k|               if (len < 2) { return false; }
 6720|  76.0k|               if ((pb[0] != 'q' && pb[0] != 'Q') || pb[1] != '=') {
 6721|  76.0k|                 return false;
 6722|  76.0k|               }
 6723|       |
 6724|       |               // Trim the value portion
 6725|  76.0k|               auto r = trim(pb, pe, 2, len);
 6726|  76.0k|               if (r.first >= r.second) {
 6727|  76.0k|                 invalid = true;
 6728|  76.0k|                 return true;
 6729|  76.0k|               }
 6730|       |
 6731|  76.0k|               double v = 0.0;
 6732|  76.0k|               auto res = from_chars(pb + r.first, pb + r.second, v);
 6733|  76.0k|               if (res.ec != std::errc{} || v < 0.0 || v > 1.0) {
 6734|  76.0k|                 invalid = true;
 6735|  76.0k|                 return true;
 6736|  76.0k|               }
 6737|  76.0k|               quality = v;
 6738|  76.0k|               return true;
 6739|  76.0k|             });
 6740|       |
 6741|  76.0k|  return !invalid;
 6742|  5.48M|}
_ZN7httplib6detail6divideEPKcmcNSt3__18functionIFvS2_mS2_mEEE:
 5315|  5.48M|           fn) {
 5316|  5.48M|  const auto it = std::find(data, data + size, d);
 5317|  5.48M|  const auto found = static_cast<std::size_t>(it != data + size);
 5318|  5.48M|  const auto lhs_data = data;
 5319|  5.48M|  const auto lhs_size = static_cast<std::size_t>(it - data);
 5320|  5.48M|  const auto rhs_data = it + found;
 5321|  5.48M|  const auto rhs_size = size - lhs_size - found;
 5322|       |
 5323|  5.48M|  fn(lhs_data, lhs_size, rhs_data, rhs_size);
 5324|  5.48M|}
_ZZN7httplib6detail13parse_qualityEPKcS2_RNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERdENKUlS2_mS2_mE_clES2_mS2_m:
 6702|  5.48M|      [&](const char *lb, std::size_t llen, const char *rb, std::size_t rlen) {
 6703|  5.48M|        auto r = trim(lb, lb + llen, 0, llen);
 6704|  5.48M|        if (r.first < r.second) { token.assign(lb + r.first, lb + r.second); }
  ------------------
  |  Branch (6704:13): [True: 5.48M, False: 313]
  ------------------
 6705|  5.48M|        params_b = rb;
 6706|  5.48M|        params_len = rlen;
 6707|  5.48M|      });
_ZN7httplib6detail10split_findEPKcS2_cmNSt3__18functionIFbS2_S2_EEE:
 5361|  76.0k|                       std::function<bool(const char *, const char *)> fn) {
 5362|  76.0k|  size_t i = 0;
 5363|  76.0k|  size_t beg = 0;
 5364|  76.0k|  size_t count = 1;
 5365|       |
 5366|  25.6M|  while (e ? (b + i < e) : (b[i] != '\0')) {
  ------------------
  |  Branch (5366:10): [True: 25.6M, False: 0]
  |  Branch (5366:10): [True: 25.5M, False: 73.1k]
  ------------------
 5367|  25.5M|    if (b[i] == d && count < m) {
  ------------------
  |  Branch (5367:9): [True: 10.5M, False: 14.9M]
  |  Branch (5367:22): [True: 10.5M, False: 0]
  ------------------
 5368|  10.5M|      auto r = trim(b, e, beg, i);
 5369|  10.5M|      if (r.first < r.second) {
  ------------------
  |  Branch (5369:11): [True: 1.05M, False: 9.48M]
  ------------------
 5370|  1.05M|        auto found = fn(&b[r.first], &b[r.second]);
 5371|  1.05M|        if (found) { return true; }
  ------------------
  |  Branch (5371:13): [True: 2.85k, False: 1.05M]
  ------------------
 5372|  1.05M|      }
 5373|  10.5M|      beg = i + 1;
 5374|  10.5M|      count++;
 5375|  10.5M|    }
 5376|  25.5M|    i++;
 5377|  25.5M|  }
 5378|       |
 5379|  73.1k|  if (i) {
  ------------------
  |  Branch (5379:7): [True: 73.1k, False: 0]
  ------------------
 5380|  73.1k|    auto r = trim(b, e, beg, i);
 5381|  73.1k|    if (r.first < r.second) {
  ------------------
  |  Branch (5381:9): [True: 72.4k, False: 750]
  ------------------
 5382|  72.4k|      auto found = fn(&b[r.first], &b[r.second]);
 5383|  72.4k|      if (found) { return true; }
  ------------------
  |  Branch (5383:11): [True: 62.2k, False: 10.1k]
  ------------------
 5384|  72.4k|    }
 5385|  73.1k|  }
 5386|       |
 5387|  10.9k|  return false;
 5388|  73.1k|}
_ZZN7httplib6detail13parse_qualityEPKcS2_RNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERdENKUlS2_S2_E_clES2_S2_:
 6716|  1.12M|             [&](const char *pb, const char *pe) -> bool {
 6717|       |               // Match exactly "q=" or "Q=" (not "query=" etc.)
 6718|  1.12M|               auto len = static_cast<size_t>(pe - pb);
 6719|  1.12M|               if (len < 2) { return false; }
  ------------------
  |  Branch (6719:20): [True: 1.04M, False: 83.4k]
  ------------------
 6720|  83.4k|               if ((pb[0] != 'q' && pb[0] != 'Q') || pb[1] != '=') {
  ------------------
  |  Branch (6720:21): [True: 20.8k, False: 62.6k]
  |  Branch (6720:37): [True: 11.8k, False: 9.07k]
  |  Branch (6720:54): [True: 6.55k, False: 65.1k]
  ------------------
 6721|  18.3k|                 return false;
 6722|  18.3k|               }
 6723|       |
 6724|       |               // Trim the value portion
 6725|  65.1k|               auto r = trim(pb, pe, 2, len);
 6726|  65.1k|               if (r.first >= r.second) {
  ------------------
  |  Branch (6726:20): [True: 717, False: 64.4k]
  ------------------
 6727|    717|                 invalid = true;
 6728|    717|                 return true;
 6729|    717|               }
 6730|       |
 6731|  64.4k|               double v = 0.0;
 6732|  64.4k|               auto res = from_chars(pb + r.first, pb + r.second, v);
 6733|  64.4k|               if (res.ec != std::errc{} || v < 0.0 || v > 1.0) {
  ------------------
  |  Branch (6733:20): [True: 2.53k, False: 61.8k]
  |  Branch (6733:45): [True: 0, False: 61.8k]
  |  Branch (6733:56): [True: 463, False: 61.4k]
  ------------------
 6734|  2.99k|                 invalid = true;
 6735|  2.99k|                 return true;
 6736|  2.99k|               }
 6737|  61.4k|               quality = v;
 6738|  61.4k|               return true;
 6739|  64.4k|             });
_ZN7httplib6detail10from_charsEPKcS2_Rd:
  717|  64.4k|                                            double &value) {
  718|  64.4k|  value = 0.0;
  719|  64.4k|  const char *p = first;
  720|       |
  721|       |  // Each 1eN is exactly representable, so a single final division by the
  722|       |  // matching entry yields a correctly-rounded result.
  723|  64.4k|  static const double powers_of_ten[] = {
  724|  64.4k|      1e0,  1e1,  1e2,  1e3,  1e4,  1e5,  1e6,  1e7,  1e8, 1e9,
  725|  64.4k|      1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18};
  726|  64.4k|  const int max_frac_digits =
  727|  64.4k|      static_cast<int>(sizeof(powers_of_ten) / sizeof(powers_of_ten[0])) - 1;
  728|       |
  729|       |  // Accumulate digits into a 64-bit integer and remember how many were
  730|       |  // fractional. Two independent caps keep this bounded and safe:
  731|       |  //   * accumulation saturates before mantissa could overflow uint64_t, and
  732|       |  //   * frac_digits is capped at max_frac_digits so it is always a valid index
  733|       |  //     into powers_of_ten (without this an input like "0.000...0" would never
  734|       |  //     grow mantissa, so the saturation cap alone would not bound it).
  735|       |  // Both caps only drop digits far beyond the precision a q-value needs; any
  736|       |  // value they would change is well outside [0, 1] and rejected by the caller.
  737|  64.4k|  uint64_t mantissa = 0;
  738|  64.4k|  int frac_digits = 0;
  739|  64.4k|  bool seen_digit = false;
  740|       |
  741|  64.4k|  const uint64_t limit = ((std::numeric_limits<uint64_t>::max)() - 9) / 10;
  742|  64.4k|  auto accumulate = [&](char c) {
  743|  64.4k|    if (mantissa <= limit) {
  744|  64.4k|      mantissa = mantissa * 10 + static_cast<uint64_t>(c - '0');
  745|  64.4k|      return true;
  746|  64.4k|    }
  747|  64.4k|    return false;
  748|  64.4k|  };
  749|       |
  750|   130k|  for (; p != last && is_ascii_digit(*p); ++p) {
  ------------------
  |  Branch (750:10): [True: 79.1k, False: 51.6k]
  |  Branch (750:23): [True: 66.4k, False: 12.7k]
  ------------------
  751|  66.4k|    seen_digit = true;
  752|  66.4k|    accumulate(*p);
  753|  66.4k|  }
  754|       |
  755|  64.4k|  if (p != last && *p == '.') {
  ------------------
  |  Branch (755:7): [True: 12.7k, False: 51.6k]
  |  Branch (755:20): [True: 2.53k, False: 10.2k]
  ------------------
  756|  2.53k|    ++p;
  757|  5.82k|    for (; p != last && is_ascii_digit(*p); ++p) {
  ------------------
  |  Branch (757:12): [True: 4.90k, False: 912]
  |  Branch (757:25): [True: 3.28k, False: 1.62k]
  ------------------
  758|  3.28k|      seen_digit = true;
  759|  3.28k|      if (frac_digits < max_frac_digits && accumulate(*p)) { ++frac_digits; }
  ------------------
  |  Branch (759:11): [True: 2.91k, False: 374]
  |  Branch (759:44): [True: 2.71k, False: 202]
  ------------------
  760|  3.28k|    }
  761|  2.53k|  }
  762|       |
  763|  64.4k|  if (!seen_digit) { return {first, std::errc::invalid_argument}; }
  ------------------
  |  Branch (763:7): [True: 2.53k, False: 61.8k]
  ------------------
  764|       |
  765|  61.8k|  value = static_cast<double>(mantissa) / powers_of_ten[frac_digits];
  766|  61.8k|  return {p, std::errc{}};
  767|  64.4k|}
_ZZN7httplib6detail10from_charsEPKcS2_RdENKUlcE_clEc:
  742|  69.3k|  auto accumulate = [&](char c) {
  743|  69.3k|    if (mantissa <= limit) {
  ------------------
  |  Branch (743:9): [True: 68.1k, False: 1.16k]
  ------------------
  744|  68.1k|      mantissa = mantissa * 10 + static_cast<uint64_t>(c - '0');
  745|  68.1k|      return true;
  746|  68.1k|    }
  747|  1.16k|    return false;
  748|  69.3k|  };
_ZZN7httplib6detail19parse_accept_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorIS7_NS5_IS7_EEEEENKUlRKZNS0_19parse_accept_headerES9_SD_E11AcceptEntrySG_E_clESG_SG_:
 8036|   141M|            [](const AcceptEntry &a, const AcceptEntry &b) {
 8037|   141M|              if (a.quality != b.quality) {
  ------------------
  |  Branch (8037:19): [True: 113k, False: 141M]
  ------------------
 8038|   113k|                return a.quality > b.quality; // Higher quality first
 8039|   113k|              }
 8040|   141M|              return a.order < b.order; // Earlier order first for same quality
 8041|   141M|            });
_ZN7httplib6detail18extract_media_typeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEE:
 6633|  5.47M|                   std::map<std::string, std::string> *params = nullptr) {
 6634|       |  // Extract type/subtype from Content-Type value (RFC 2045)
 6635|       |  // e.g. "application/json; charset=utf-8" -> "application/json"
 6636|  5.47M|  auto media_type = content_type;
 6637|  5.47M|  auto semicolon_pos = media_type.find(';');
 6638|  5.47M|  if (semicolon_pos != std::string::npos) {
  ------------------
  |  Branch (6638:7): [True: 212, False: 5.47M]
  ------------------
 6639|    212|    auto param_str = media_type.substr(semicolon_pos + 1);
 6640|    212|    media_type = media_type.substr(0, semicolon_pos);
 6641|       |
 6642|    212|    if (params) {
  ------------------
  |  Branch (6642:9): [True: 194, False: 18]
  ------------------
 6643|       |      // Parse parameters: key=value pairs separated by ';'
 6644|    194|      split(param_str.data(), param_str.data() + param_str.size(), ';',
 6645|    194|            [&](const char *b, const char *e) {
 6646|    194|              std::string key;
 6647|    194|              std::string val;
 6648|    194|              split(b, e, '=', [&](const char *b2, const char *e2) {
 6649|    194|                if (key.empty()) {
 6650|    194|                  key.assign(b2, e2);
 6651|    194|                } else {
 6652|    194|                  val.assign(b2, e2);
 6653|    194|                }
 6654|    194|              });
 6655|    194|              if (!key.empty()) {
 6656|    194|                params->emplace(trim_copy(key), trim_double_quotes_copy(val));
 6657|    194|              }
 6658|    194|            });
 6659|    194|    }
 6660|    212|  }
 6661|       |
 6662|       |  // Trim whitespace from media type
 6663|  5.47M|  return trim_copy(media_type);
 6664|  5.47M|}
_ZZN7httplib6detail18extract_media_typeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEEENKUlPKcSJ_E_clESJ_SJ_:
 6645|  14.0k|            [&](const char *b, const char *e) {
 6646|  14.0k|              std::string key;
 6647|  14.0k|              std::string val;
 6648|  14.0k|              split(b, e, '=', [&](const char *b2, const char *e2) {
 6649|  14.0k|                if (key.empty()) {
 6650|  14.0k|                  key.assign(b2, e2);
 6651|  14.0k|                } else {
 6652|  14.0k|                  val.assign(b2, e2);
 6653|  14.0k|                }
 6654|  14.0k|              });
 6655|  14.0k|              if (!key.empty()) {
  ------------------
  |  Branch (6655:19): [True: 13.4k, False: 592]
  ------------------
 6656|  13.4k|                params->emplace(trim_copy(key), trim_double_quotes_copy(val));
 6657|  13.4k|              }
 6658|  14.0k|            });
_ZZZN7httplib6detail18extract_media_typeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEEENKUlPKcSJ_E_clESJ_SJ_ENKUlSJ_SJ_E_clESJ_SJ_:
 6648|  14.1k|              split(b, e, '=', [&](const char *b2, const char *e2) {
 6649|  14.1k|                if (key.empty()) {
  ------------------
  |  Branch (6649:21): [True: 13.4k, False: 781]
  ------------------
 6650|  13.4k|                  key.assign(b2, e2);
 6651|  13.4k|                } else {
 6652|    781|                  val.assign(b2, e2);
 6653|    781|                }
 6654|  14.1k|              });
_ZN7httplib6detail23trim_double_quotes_copyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5305|  33.1k|inline std::string trim_double_quotes_copy(const std::string &s) {
 5306|  33.1k|  if (s.length() >= 2 && s.front() == '"' && s.back() == '"') {
  ------------------
  |  Branch (5306:7): [True: 6.86k, False: 26.2k]
  |  Branch (5306:26): [True: 591, False: 6.27k]
  |  Branch (5306:46): [True: 224, False: 367]
  ------------------
 5307|    224|    return s.substr(1, s.size() - 2);
 5308|    224|  }
 5309|  32.8k|  return s;
 5310|  33.1k|}
_ZN7httplib6detail24parse_multipart_boundaryERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERS7_:
 7877|    163|                                     std::string &boundary) {
 7878|    163|  std::map<std::string, std::string> params;
 7879|    163|  extract_media_type(content_type, &params);
 7880|    163|  auto it = params.find("boundary");
 7881|    163|  if (it == params.end()) { return false; }
  ------------------
  |  Branch (7881:7): [True: 161, False: 2]
  ------------------
 7882|      2|  boundary = it->second;
 7883|      2|  return !boundary.empty();
 7884|    163|}
_ZN7httplib6detail24parse_disposition_paramsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_8multimapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEE:
 7886|    548|inline void parse_disposition_params(const std::string &s, Params &params) {
 7887|    548|  std::set<std::string> cache;
 7888|    548|  split(s.data(), s.data() + s.size(), ';', [&](const char *b, const char *e) {
 7889|    548|    std::string kv(b, e);
 7890|    548|    if (cache.find(kv) != cache.end()) { return; }
 7891|    548|    cache.insert(kv);
 7892|       |
 7893|    548|    std::string key;
 7894|    548|    std::string val;
 7895|    548|    split(b, e, '=', [&](const char *b2, const char *e2) {
 7896|    548|      if (key.empty()) {
 7897|    548|        key.assign(b2, e2);
 7898|    548|      } else {
 7899|    548|        val.assign(b2, e2);
 7900|    548|      }
 7901|    548|    });
 7902|       |
 7903|    548|    if (!key.empty()) {
 7904|    548|      params.emplace(trim_double_quotes_copy((key)),
 7905|    548|                     trim_double_quotes_copy((val)));
 7906|    548|    }
 7907|    548|  });
 7908|    548|}
_ZZN7httplib6detail24parse_disposition_paramsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_8multimapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEEENKUlPKcSJ_E_clESJ_SJ_:
 7888|  12.8k|  split(s.data(), s.data() + s.size(), ';', [&](const char *b, const char *e) {
 7889|  12.8k|    std::string kv(b, e);
 7890|  12.8k|    if (cache.find(kv) != cache.end()) { return; }
  ------------------
  |  Branch (7890:9): [True: 2.83k, False: 10.0k]
  ------------------
 7891|  10.0k|    cache.insert(kv);
 7892|       |
 7893|  10.0k|    std::string key;
 7894|  10.0k|    std::string val;
 7895|  10.0k|    split(b, e, '=', [&](const char *b2, const char *e2) {
 7896|  10.0k|      if (key.empty()) {
 7897|  10.0k|        key.assign(b2, e2);
 7898|  10.0k|      } else {
 7899|  10.0k|        val.assign(b2, e2);
 7900|  10.0k|      }
 7901|  10.0k|    });
 7902|       |
 7903|  10.0k|    if (!key.empty()) {
  ------------------
  |  Branch (7903:9): [True: 9.85k, False: 203]
  ------------------
 7904|  9.85k|      params.emplace(trim_double_quotes_copy((key)),
 7905|  9.85k|                     trim_double_quotes_copy((val)));
 7906|  9.85k|    }
 7907|  10.0k|  });
_ZZZN7httplib6detail24parse_disposition_paramsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_8multimapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEEENKUlPKcSJ_E_clESJ_SJ_ENKUlSJ_SJ_E_clESJ_SJ_:
 7895|  14.4k|    split(b, e, '=', [&](const char *b2, const char *e2) {
 7896|  14.4k|      if (key.empty()) {
  ------------------
  |  Branch (7896:11): [True: 9.85k, False: 4.56k]
  ------------------
 7897|  9.85k|        key.assign(b2, e2);
 7898|  9.85k|      } else {
 7899|  4.56k|        val.assign(b2, e2);
 7900|  4.56k|      }
 7901|  14.4k|    });
_ZN7httplib6detail15parse_http_dateERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 4575|      3|inline time_t parse_http_date(const std::string &date_str) {
 4576|      3|  struct tm tm_buf;
 4577|       |
 4578|       |  // Create a classic locale object once for all parsing attempts
 4579|      3|  const std::locale classic_locale = std::locale::classic();
 4580|       |
 4581|       |  // Try to parse using std::get_time (C++11, cross-platform)
 4582|      3|  auto try_parse = [&](const char *fmt) -> bool {
 4583|      3|    std::istringstream ss(date_str);
 4584|      3|    ss.imbue(classic_locale);
 4585|       |
 4586|      3|    memset(&tm_buf, 0, sizeof(tm_buf));
 4587|      3|    ss >> std::get_time(&tm_buf, fmt);
 4588|       |
 4589|      3|    return !ss.fail();
 4590|      3|  };
 4591|       |
 4592|       |  // RFC 9110 preferred format (HTTP-date): "Sun, 06 Nov 1994 08:49:37 GMT"
 4593|      3|  if (!try_parse("%a, %d %b %Y %H:%M:%S")) {
  ------------------
  |  Branch (4593:7): [True: 2, False: 1]
  ------------------
 4594|       |    // RFC 850 format: "Sunday, 06-Nov-94 08:49:37 GMT"
 4595|      2|    if (!try_parse("%A, %d-%b-%y %H:%M:%S")) {
  ------------------
  |  Branch (4595:9): [True: 2, False: 0]
  ------------------
 4596|       |      // asctime format: "Sun Nov  6 08:49:37 1994"
 4597|      2|      if (!try_parse("%a %b %d %H:%M:%S %Y")) {
  ------------------
  |  Branch (4597:11): [True: 2, False: 0]
  ------------------
 4598|      2|        return static_cast<time_t>(-1);
 4599|      2|      }
 4600|      2|    }
 4601|      2|  }
 4602|       |
 4603|       |#ifdef _WIN32
 4604|       |  return _mkgmtime(&tm_buf);
 4605|       |#elif defined _AIX
 4606|       |  return mktime(&tm_buf);
 4607|       |#else
 4608|      1|  return timegm(&tm_buf);
 4609|      3|#endif
 4610|      3|}
_ZZN7httplib6detail15parse_http_dateERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENKUlPKcE_clESB_:
 4582|      7|  auto try_parse = [&](const char *fmt) -> bool {
 4583|      7|    std::istringstream ss(date_str);
 4584|      7|    ss.imbue(classic_locale);
 4585|       |
 4586|      7|    memset(&tm_buf, 0, sizeof(tm_buf));
 4587|      7|    ss >> std::get_time(&tm_buf, fmt);
 4588|       |
 4589|      7|    return !ss.fail();
 4590|      7|  };
_ZN7httplib6detail25can_compress_content_typeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 6666|    676|inline bool can_compress_content_type(const std::string &content_type) {
 6667|    676|  using udl::operator""_t;
 6668|       |
 6669|    676|  auto mime_type = extract_media_type(content_type);
 6670|    676|  auto tag = str2tag(mime_type);
 6671|       |
 6672|    676|  switch (tag) {
 6673|      1|  case "image/svg+xml"_t:
  ------------------
  |  Branch (6673:3): [True: 1, False: 675]
  ------------------
 6674|      2|  case "application/javascript"_t:
  ------------------
  |  Branch (6674:3): [True: 1, False: 675]
  ------------------
 6675|      3|  case "application/x-javascript"_t:
  ------------------
  |  Branch (6675:3): [True: 1, False: 675]
  ------------------
 6676|      4|  case "application/json"_t:
  ------------------
  |  Branch (6676:3): [True: 1, False: 675]
  ------------------
 6677|      5|  case "application/ld+json"_t:
  ------------------
  |  Branch (6677:3): [True: 1, False: 675]
  ------------------
 6678|      6|  case "application/xml"_t:
  ------------------
  |  Branch (6678:3): [True: 1, False: 675]
  ------------------
 6679|      7|  case "application/xhtml+xml"_t:
  ------------------
  |  Branch (6679:3): [True: 1, False: 675]
  ------------------
 6680|      8|  case "application/rss+xml"_t:
  ------------------
  |  Branch (6680:3): [True: 1, False: 675]
  ------------------
 6681|      9|  case "application/atom+xml"_t:
  ------------------
  |  Branch (6681:3): [True: 1, False: 675]
  ------------------
 6682|     10|  case "application/xslt+xml"_t:
  ------------------
  |  Branch (6682:3): [True: 1, False: 675]
  ------------------
 6683|     11|  case "application/protobuf"_t: return true;
  ------------------
  |  Branch (6683:3): [True: 1, False: 675]
  ------------------
 6684|       |
 6685|      1|  case "text/event-stream"_t: return false;
  ------------------
  |  Branch (6685:3): [True: 1, False: 675]
  ------------------
 6686|       |
 6687|    664|  default: return !mime_type.rfind("text/", 0);
  ------------------
  |  Branch (6687:3): [True: 664, False: 12]
  ------------------
 6688|    676|  }
 6689|    676|}
_ZN7httplib6detail7str2tagERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 6544|    676|inline unsigned int str2tag(const std::string &s) {
 6545|       |  // Iterative form of str2tag_core: the recursive constexpr version is kept
 6546|       |  // for compile-time UDL evaluation of short string literals, but at runtime
 6547|       |  // we may receive arbitrarily long inputs (e.g. fuzzed Content-Type) that
 6548|       |  // would blow the stack with one frame per character.
 6549|    676|  unsigned int h = 0;
 6550|  5.56M|  for (auto c : s) {
  ------------------
  |  Branch (6550:15): [True: 5.56M, False: 676]
  ------------------
 6551|  5.56M|    h = (((std::numeric_limits<unsigned int>::max)() >> 6) & h * 33) ^
 6552|  5.56M|        static_cast<unsigned char>(c);
 6553|  5.56M|  }
 6554|    676|  return h;
 6555|    676|}

LLVMFuzzerTestOneInput:
    7|  3.33k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    8|  3.33k|  if (size < 2) return 0;
  ------------------
  |  Branch (8:7): [True: 1, False: 3.33k]
  ------------------
    9|       |
   10|  3.33k|  uint8_t selector = data[0];
   11|  3.33k|  const char *payload = reinterpret_cast<const char *>(data + 1);
   12|  3.33k|  size_t payload_size = size - 1;
   13|  3.33k|  std::string input(payload, payload_size);
   14|       |
   15|  3.33k|  switch (selector % 7) {
  ------------------
  |  Branch (15:11): [True: 3.33k, False: 0]
  ------------------
   16|    485|  case 0: {
  ------------------
  |  Branch (16:3): [True: 485, False: 2.85k]
  ------------------
   17|       |    // parse_range_header
   18|    485|    httplib::Ranges ranges;
   19|    485|    httplib::detail::parse_range_header(input, ranges);
   20|    485|    break;
   21|      0|  }
   22|  1.42k|  case 1: {
  ------------------
  |  Branch (22:3): [True: 1.42k, False: 1.91k]
  ------------------
   23|       |    // parse_accept_header
   24|  1.42k|    std::vector<std::string> content_types;
   25|  1.42k|    httplib::detail::parse_accept_header(input, content_types);
   26|  1.42k|    break;
   27|      0|  }
   28|     40|  case 2: {
  ------------------
  |  Branch (28:3): [True: 40, False: 3.29k]
  ------------------
   29|       |    // extract_media_type with params
   30|     40|    std::map<std::string, std::string> params;
   31|     40|    httplib::detail::extract_media_type(input, &params);
   32|     40|    break;
   33|      0|  }
   34|    163|  case 3: {
  ------------------
  |  Branch (34:3): [True: 163, False: 3.17k]
  ------------------
   35|       |    // parse_multipart_boundary
   36|    163|    std::string boundary;
   37|    163|    httplib::detail::parse_multipart_boundary(input, boundary);
   38|    163|    break;
   39|      0|  }
   40|    548|  case 4: {
  ------------------
  |  Branch (40:3): [True: 548, False: 2.78k]
  ------------------
   41|       |    // parse_disposition_params
   42|    548|    httplib::Params params;
   43|    548|    httplib::detail::parse_disposition_params(input, params);
   44|    548|    break;
   45|      0|  }
   46|      3|  case 5: {
  ------------------
  |  Branch (46:3): [True: 3, False: 3.33k]
  ------------------
   47|       |    // parse_http_date
   48|      3|    httplib::detail::parse_http_date(input);
   49|      3|    break;
   50|      0|  }
   51|    676|  case 6: {
  ------------------
  |  Branch (51:3): [True: 676, False: 2.66k]
  ------------------
   52|       |    // can_compress_content_type
   53|    676|    httplib::detail::can_compress_content_type(input);
   54|    676|    break;
   55|      0|  }
   56|  3.33k|  }
   57|       |
   58|  3.33k|  return 0;
   59|  3.33k|}

