_ZN7httplib6detail18parse_range_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorINS1_4pairIllEENS5_ISC_EEEE:
 8949|    479|inline bool parse_range_header(const std::string &s, Ranges &ranges) try {
 8950|    479|#endif
 8951|    479|  auto is_valid = [](const std::string &str) {
 8952|    479|    return std::all_of(str.cbegin(), str.cend(), is_ascii_digit);
 8953|    479|  };
 8954|       |
 8955|    479|  if (s.size() > 7 && s.compare(0, 6, "bytes=") == 0) {
  ------------------
  |  Branch (8955:7): [True: 474, False: 5]
  |  Branch (8955:23): [True: 451, False: 23]
  ------------------
 8956|    451|    const auto pos = static_cast<size_t>(6);
 8957|    451|    const auto len = static_cast<size_t>(s.size() - 6);
 8958|    451|    auto all_valid_ranges = true;
 8959|    451|    split(&s[pos], &s[pos + len], ',', [&](const char *b, const char *e) {
 8960|    451|      if (!all_valid_ranges) { return; }
 8961|       |
 8962|    451|      const auto it = std::find(b, e, '-');
 8963|    451|      if (it == e) {
 8964|    451|        all_valid_ranges = false;
 8965|    451|        return;
 8966|    451|      }
 8967|       |
 8968|    451|      const auto lhs = std::string(b, it);
 8969|    451|      const auto rhs = std::string(it + 1, e);
 8970|    451|      if (!is_valid(lhs) || !is_valid(rhs)) {
 8971|    451|        all_valid_ranges = false;
 8972|    451|        return;
 8973|    451|      }
 8974|       |
 8975|    451|      ssize_t first = -1;
 8976|    451|      if (!lhs.empty()) {
 8977|    451|        ssize_t v;
 8978|    451|        auto res = detail::from_chars(lhs.data(), lhs.data() + lhs.size(), v);
 8979|    451|        if (res.ec == std::errc{}) { first = v; }
 8980|    451|      }
 8981|       |
 8982|    451|      ssize_t last = -1;
 8983|    451|      if (!rhs.empty()) {
 8984|    451|        ssize_t v;
 8985|    451|        auto res = detail::from_chars(rhs.data(), rhs.data() + rhs.size(), v);
 8986|    451|        if (res.ec == std::errc{}) { last = v; }
 8987|    451|      }
 8988|       |
 8989|    451|      if ((first == -1 && last == -1) ||
 8990|    451|          (first != -1 && last != -1 && first > last)) {
 8991|    451|        all_valid_ranges = false;
 8992|    451|        return;
 8993|    451|      }
 8994|       |
 8995|    451|      ranges.emplace_back(first, last);
 8996|    451|    });
 8997|    451|    return all_valid_ranges && !ranges.empty();
  ------------------
  |  Branch (8997:12): [True: 253, False: 198]
  |  Branch (8997:32): [True: 253, False: 0]
  ------------------
 8998|    451|  }
 8999|     28|  return false;
 9000|       |#ifdef CPPHTTPLIB_NO_EXCEPTIONS
 9001|       |}
 9002|       |#else
 9003|    479|} catch (...) { return false; }
_ZN7httplib6detail5splitEPKcS2_cNSt3__18functionIFvS2_S2_EEE:
 5907|  1.86k|                  std::function<void(const char *, const char *)> fn) {
 5908|  1.86k|  return split(b, e, d, (std::numeric_limits<size_t>::max)(), std::move(fn));
 5909|  1.86k|}
_ZN7httplib6detail5splitEPKcS2_cmNSt3__18functionIFvS2_S2_EEE:
 5912|  1.86k|                  std::function<void(const char *, const char *)> fn) {
 5913|  1.86k|  size_t i = 0;
 5914|  1.86k|  size_t beg = 0;
 5915|  1.86k|  size_t count = 1;
 5916|       |
 5917|  50.7M|  while (e ? (b + i < e) : (b[i] != '\0')) {
  ------------------
  |  Branch (5917:10): [True: 50.7M, False: 0]
  |  Branch (5917:10): [True: 50.7M, False: 1.86k]
  ------------------
 5918|  50.7M|    if (b[i] == d && count < m) {
  ------------------
  |  Branch (5918:9): [True: 6.90M, False: 43.8M]
  |  Branch (5918:22): [True: 6.90M, False: 0]
  ------------------
 5919|  6.90M|      auto r = trim(b, e, beg, i);
 5920|  6.90M|      if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5920:11): [True: 6.90M, False: 8.16k]
  ------------------
 5921|  6.90M|      beg = i + 1;
 5922|  6.90M|      count++;
 5923|  6.90M|    }
 5924|  50.7M|    i++;
 5925|  50.7M|  }
 5926|       |
 5927|  1.86k|  if (i) {
  ------------------
  |  Branch (5927:7): [True: 1.86k, False: 0]
  ------------------
 5928|  1.86k|    auto r = trim(b, e, beg, i);
 5929|  1.86k|    if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5929:9): [True: 1.84k, False: 24]
  ------------------
 5930|  1.86k|  }
 5931|  1.86k|}
_ZN7httplib6detail4trimEPKcS2_mm:
 5863|  42.0M|                                      size_t right) {
 5864|  46.0M|  while (b + left < e && is_space_or_tab(b[left])) {
  ------------------
  |  Branch (5864:10): [True: 45.9M, False: 62.3k]
  |  Branch (5864:26): [True: 3.97M, False: 42.0M]
  ------------------
 5865|  3.97M|    left++;
 5866|  3.97M|  }
 5867|  46.2M|  while (right > 0 && is_space_or_tab(b[right - 1])) {
  ------------------
  |  Branch (5867:10): [True: 46.2M, False: 62.2k]
  |  Branch (5867:23): [True: 4.21M, False: 42.0M]
  ------------------
 5868|  4.21M|    right--;
 5869|  4.21M|  }
 5870|  42.0M|  return std::make_pair(left, right);
 5871|  42.0M|}
_ZN7httplib6detail15is_space_or_tabEc:
 5726|  92.2M|inline bool is_space_or_tab(char c) { return c == ' ' || c == '\t'; }
  ------------------
  |  Branch (5726:46): [True: 8.17M, False: 84.0M]
  |  Branch (5726:58): [True: 17.9k, False: 84.0M]
  ------------------
_ZZN7httplib6detail18parse_range_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorINS1_4pairIllEENS5_ISC_EEEEENKUlPKcSH_E_clESH_SH_:
 8959|  98.8k|    split(&s[pos], &s[pos + len], ',', [&](const char *b, const char *e) {
 8960|  98.8k|      if (!all_valid_ranges) { return; }
  ------------------
  |  Branch (8960:11): [True: 34.1k, False: 64.6k]
  ------------------
 8961|       |
 8962|  64.6k|      const auto it = std::find(b, e, '-');
 8963|  64.6k|      if (it == e) {
  ------------------
  |  Branch (8963:11): [True: 19, False: 64.6k]
  ------------------
 8964|     19|        all_valid_ranges = false;
 8965|     19|        return;
 8966|     19|      }
 8967|       |
 8968|  64.6k|      const auto lhs = std::string(b, it);
 8969|  64.6k|      const auto rhs = std::string(it + 1, e);
 8970|  64.6k|      if (!is_valid(lhs) || !is_valid(rhs)) {
  ------------------
  |  Branch (8970:11): [True: 7, False: 64.6k]
  |  Branch (8970:29): [True: 13, False: 64.6k]
  ------------------
 8971|     20|        all_valid_ranges = false;
 8972|     20|        return;
 8973|     20|      }
 8974|       |
 8975|  64.6k|      ssize_t first = -1;
 8976|  64.6k|      if (!lhs.empty()) {
  ------------------
  |  Branch (8976:11): [True: 64.1k, False: 510]
  ------------------
 8977|  64.1k|        ssize_t v;
 8978|  64.1k|        auto res = detail::from_chars(lhs.data(), lhs.data() + lhs.size(), v);
 8979|  64.1k|        if (res.ec == std::errc{}) { first = v; }
  ------------------
  |  Branch (8979:13): [True: 63.9k, False: 216]
  ------------------
 8980|  64.1k|      }
 8981|       |
 8982|  64.6k|      ssize_t last = -1;
 8983|  64.6k|      if (!rhs.empty()) {
  ------------------
  |  Branch (8983:11): [True: 1.34k, False: 63.2k]
  ------------------
 8984|  1.34k|        ssize_t v;
 8985|  1.34k|        auto res = detail::from_chars(rhs.data(), rhs.data() + rhs.size(), v);
 8986|  1.34k|        if (res.ec == std::errc{}) { last = v; }
  ------------------
  |  Branch (8986:13): [True: 1.11k, False: 233]
  ------------------
 8987|  1.34k|      }
 8988|       |
 8989|  64.6k|      if ((first == -1 && last == -1) ||
  ------------------
  |  Branch (8989:12): [True: 726, False: 63.9k]
  |  Branch (8989:27): [True: 66, False: 660]
  ------------------
 8990|  64.5k|          (first != -1 && last != -1 && first > last)) {
  ------------------
  |  Branch (8990:12): [True: 63.9k, False: 660]
  |  Branch (8990:27): [True: 453, False: 63.4k]
  |  Branch (8990:41): [True: 93, False: 360]
  ------------------
 8991|    159|        all_valid_ranges = false;
 8992|    159|        return;
 8993|    159|      }
 8994|       |
 8995|  64.4k|      ranges.emplace_back(first, last);
 8996|  64.4k|    });
_ZZN7httplib6detail18parse_range_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorINS1_4pairIllEENS5_ISC_EEEEENKUlS9_E_clES9_:
 8951|   129k|  auto is_valid = [](const std::string &str) {
 8952|   129k|    return std::all_of(str.cbegin(), str.cend(), is_ascii_digit);
 8953|   129k|  };
_ZN7httplib6detail14is_ascii_digitEc:
  584|   271k|inline bool is_ascii_digit(char c) { return '0' <= c && c <= '9'; }
  ------------------
  |  Branch (584:45): [True: 258k, False: 13.1k]
  |  Branch (584:57): [True: 255k, False: 2.59k]
  ------------------
_ZN7httplib6detail10from_charsIlEENS0_17from_chars_resultIT_EEPKcS6_RS3_i:
  700|  65.4k|                                       T &value, int base = 10) {
  701|  65.4k|  value = 0;
  702|  65.4k|  const char *p = first;
  703|  65.4k|  bool negative = false;
  704|       |
  705|  65.4k|  if (p != last && *p == '-') {
  ------------------
  |  Branch (705:7): [True: 65.4k, False: 0]
  |  Branch (705:20): [True: 0, False: 65.4k]
  ------------------
  706|      0|    negative = true;
  707|      0|    ++p;
  708|      0|  }
  709|  65.4k|  if (p == last) { return {first, std::errc::invalid_argument}; }
  ------------------
  |  Branch (709:7): [True: 0, False: 65.4k]
  ------------------
  710|       |
  711|  65.4k|  T result = 0;
  712|   142k|  for (; p != last; ++p) {
  ------------------
  |  Branch (712:10): [True: 77.6k, False: 65.0k]
  ------------------
  713|  77.6k|    char c = *p;
  714|  77.6k|    int digit = -1;
  715|  77.6k|    if (is_ascii_digit(c)) {
  ------------------
  |  Branch (715:9): [True: 77.6k, False: 0]
  ------------------
  716|  77.6k|      digit = c - '0';
  717|  77.6k|    } else if ('a' <= c && c <= 'z') {
  ------------------
  |  Branch (717:16): [True: 0, False: 0]
  |  Branch (717:28): [True: 0, False: 0]
  ------------------
  718|      0|      digit = c - 'a' + 10;
  719|      0|    } else if ('A' <= c && c <= 'Z') {
  ------------------
  |  Branch (719:16): [True: 0, False: 0]
  |  Branch (719:28): [True: 0, False: 0]
  ------------------
  720|      0|      digit = c - 'A' + 10;
  721|      0|    } else {
  722|      0|      break;
  723|      0|    }
  724|       |
  725|  77.6k|    if (digit < 0 || digit >= base) { break; }
  ------------------
  |  Branch (725:9): [True: 0, False: 77.6k]
  |  Branch (725:22): [True: 0, False: 77.6k]
  ------------------
  726|  77.6k|    if (result > ((std::numeric_limits<T>::max)() - digit) / base) {
  ------------------
  |  Branch (726:9): [True: 449, False: 77.1k]
  ------------------
  727|    449|      return {p, std::errc::result_out_of_range};
  728|    449|    }
  729|  77.1k|    result = result * base + digit;
  730|  77.1k|  }
  731|       |
  732|  65.0k|  if (p == first || (negative && p == first + 1)) {
  ------------------
  |  Branch (732:7): [True: 0, False: 65.0k]
  |  Branch (732:22): [True: 0, False: 65.0k]
  |  Branch (732:34): [True: 0, False: 0]
  ------------------
  733|      0|    return {first, std::errc::invalid_argument};
  734|      0|  }
  735|       |
  736|  65.0k|  value = negative ? T(0) - result : result;
  ------------------
  |  Branch (736:11): [True: 0, False: 65.0k]
  ------------------
  737|  65.0k|  return {p, std::errc{}};
  738|  65.0k|}
_ZN7httplib6detail19parse_accept_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorIS7_NS5_IS7_EEEE:
 9007|  1.41k|                                std::vector<std::string> &content_types) {
 9008|  1.41k|  content_types.clear();
 9009|       |
 9010|       |  // Empty string is considered valid (no preference)
 9011|  1.41k|  if (s.empty()) { return true; }
  ------------------
  |  Branch (9011:7): [True: 0, False: 1.41k]
  ------------------
 9012|       |
 9013|  1.41k|  struct AcceptEntry {
 9014|  1.41k|    std::string media_type;
 9015|  1.41k|    double quality;
 9016|  1.41k|    int order;
 9017|  1.41k|  };
 9018|       |
 9019|  1.41k|  std::vector<AcceptEntry> entries;
 9020|  1.41k|  int order = 0;
 9021|  1.41k|  bool has_invalid_entry = false;
 9022|       |
 9023|       |  // Split by comma and parse each entry. RFC 9110 Section 5.6.1.2: a recipient
 9024|       |  // has to parse and ignore empty list elements, so a leading, trailing or
 9025|       |  // doubled comma must not turn a legal Accept value into 400 Bad Request.
 9026|       |  // split() skips them, and the header length limit bounds how many a sender
 9027|       |  // can send, so ignoring all of them cannot be used as a denial-of-service
 9028|       |  // vector.
 9029|  1.41k|  split(s.data(), s.data() + s.size(), ',', [&](const char *b, const char *e) {
 9030|  1.41k|    std::string entry(b, e);
 9031|  1.41k|    entry = trim_copy(entry);
 9032|       |
 9033|  1.41k|    AcceptEntry accept_entry;
 9034|  1.41k|    accept_entry.order = order++;
 9035|       |
 9036|  1.41k|    if (!parse_quality(entry.data(), entry.data() + entry.size(),
 9037|  1.41k|                       accept_entry.media_type, accept_entry.quality)) {
 9038|  1.41k|      has_invalid_entry = true;
 9039|  1.41k|      return;
 9040|  1.41k|    }
 9041|       |
 9042|       |    // Remove additional parameters from media type
 9043|  1.41k|    accept_entry.media_type = extract_media_type(accept_entry.media_type);
 9044|       |
 9045|       |    // Basic validation of media type format
 9046|  1.41k|    if (accept_entry.media_type.empty()) {
 9047|  1.41k|      has_invalid_entry = true;
 9048|  1.41k|      return;
 9049|  1.41k|    }
 9050|       |
 9051|       |    // Check for basic media type format (should contain '/' or be '*')
 9052|  1.41k|    if (accept_entry.media_type != "*" &&
 9053|  1.41k|        accept_entry.media_type.find('/') == std::string::npos) {
 9054|  1.41k|      has_invalid_entry = true;
 9055|  1.41k|      return;
 9056|  1.41k|    }
 9057|       |
 9058|  1.41k|    entries.push_back(std::move(accept_entry));
 9059|  1.41k|  });
 9060|       |
 9061|       |  // Return false if any invalid entry was found
 9062|  1.41k|  if (has_invalid_entry) { return false; }
  ------------------
  |  Branch (9062:7): [True: 637, False: 781]
  ------------------
 9063|       |
 9064|       |  // Sort by quality (descending), then by original order (ascending)
 9065|    781|  std::sort(entries.begin(), entries.end(),
 9066|    781|            [](const AcceptEntry &a, const AcceptEntry &b) {
 9067|    781|              if (a.quality != b.quality) {
 9068|    781|                return a.quality > b.quality; // Higher quality first
 9069|    781|              }
 9070|    781|              return a.order < b.order; // Earlier order first for same quality
 9071|    781|            });
 9072|       |
 9073|       |  // Extract sorted media types
 9074|    781|  content_types.reserve(entries.size());
 9075|  6.55M|  for (auto &entry : entries) {
  ------------------
  |  Branch (9075:20): [True: 6.55M, False: 781]
  ------------------
 9076|  6.55M|    content_types.push_back(std::move(entry.media_type));
 9077|  6.55M|  }
 9078|       |
 9079|    781|  return true;
 9080|  1.41k|}
_ZZN7httplib6detail19parse_accept_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorIS7_NS5_IS7_EEEEENKUlPKcSF_E_clESF_SF_:
 9029|  6.80M|  split(s.data(), s.data() + s.size(), ',', [&](const char *b, const char *e) {
 9030|  6.80M|    std::string entry(b, e);
 9031|  6.80M|    entry = trim_copy(entry);
 9032|       |
 9033|  6.80M|    AcceptEntry accept_entry;
 9034|  6.80M|    accept_entry.order = order++;
 9035|       |
 9036|  6.80M|    if (!parse_quality(entry.data(), entry.data() + entry.size(),
  ------------------
  |  Branch (9036:9): [True: 2.14k, False: 6.80M]
  ------------------
 9037|  6.80M|                       accept_entry.media_type, accept_entry.quality)) {
 9038|  2.14k|      has_invalid_entry = true;
 9039|  2.14k|      return;
 9040|  2.14k|    }
 9041|       |
 9042|       |    // Remove additional parameters from media type
 9043|  6.80M|    accept_entry.media_type = extract_media_type(accept_entry.media_type);
 9044|       |
 9045|       |    // Basic validation of media type format
 9046|  6.80M|    if (accept_entry.media_type.empty()) {
  ------------------
  |  Branch (9046:9): [True: 0, False: 6.80M]
  ------------------
 9047|      0|      has_invalid_entry = true;
 9048|      0|      return;
 9049|      0|    }
 9050|       |
 9051|       |    // Check for basic media type format (should contain '/' or be '*')
 9052|  6.80M|    if (accept_entry.media_type != "*" &&
  ------------------
  |  Branch (9052:9): [True: 6.59M, False: 203k]
  ------------------
 9053|  6.59M|        accept_entry.media_type.find('/') == std::string::npos) {
  ------------------
  |  Branch (9053:9): [True: 5.20k, False: 6.59M]
  ------------------
 9054|  5.20k|      has_invalid_entry = true;
 9055|  5.20k|      return;
 9056|  5.20k|    }
 9057|       |
 9058|  6.79M|    entries.push_back(std::move(accept_entry));
 9059|  6.79M|  });
_ZN7httplib6detail9trim_copyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5873|  13.6M|inline std::string trim_copy(const std::string &s) {
 5874|  13.6M|  auto r = trim(s.data(), s.data() + s.size(), 0, s.size());
 5875|  13.6M|  return s.substr(r.first, r.second - r.first);
 5876|  13.6M|}
_ZN7httplib6detail13parse_qualityEPKcS2_RNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERd:
 7443|  6.80M|                          double &quality) {
 7444|  6.80M|  quality = 1.0;
 7445|  6.80M|  token.clear();
 7446|       |
 7447|       |  // Split on first ';': left = token name, right = parameters
 7448|  6.80M|  const char *params_b = nullptr;
 7449|  6.80M|  std::size_t params_len = 0;
 7450|       |
 7451|  6.80M|  divide(
 7452|  6.80M|      b, static_cast<std::size_t>(e - b), ';',
 7453|  6.80M|      [&](const char *lb, std::size_t llen, const char *rb, std::size_t rlen) {
 7454|  6.80M|        auto r = trim(lb, lb + llen, 0, llen);
 7455|  6.80M|        if (r.first < r.second) { token.assign(lb + r.first, lb + r.second); }
 7456|  6.80M|        params_b = rb;
 7457|  6.80M|        params_len = rlen;
 7458|  6.80M|      });
 7459|       |
 7460|  6.80M|  if (token.empty()) { return false; }
  ------------------
  |  Branch (7460:7): [True: 369, False: 6.80M]
  ------------------
 7461|  6.80M|  if (params_len == 0) { return true; }
  ------------------
  |  Branch (7461:7): [True: 6.69M, False: 105k]
  ------------------
 7462|       |
 7463|       |  // Scan parameters for q= (stops on first match)
 7464|   105k|  bool invalid = false;
 7465|   105k|  split_find(params_b, params_b + params_len, ';',
 7466|   105k|             (std::numeric_limits<size_t>::max)(),
 7467|   105k|             [&](const char *pb, const char *pe) -> bool {
 7468|       |               // Match exactly "q=" or "Q=" (not "query=" etc.)
 7469|   105k|               auto len = static_cast<size_t>(pe - pb);
 7470|   105k|               if (len < 2) { return false; }
 7471|   105k|               if ((pb[0] != 'q' && pb[0] != 'Q') || pb[1] != '=') {
 7472|   105k|                 return false;
 7473|   105k|               }
 7474|       |
 7475|       |               // Trim the value portion
 7476|   105k|               auto r = trim(pb, pe, 2, len);
 7477|   105k|               if (r.first >= r.second) {
 7478|   105k|                 invalid = true;
 7479|   105k|                 return true;
 7480|   105k|               }
 7481|       |
 7482|   105k|               double v = 0.0;
 7483|   105k|               auto res = from_chars(pb + r.first, pb + r.second, v);
 7484|   105k|               if (res.ec != std::errc{} || v < 0.0 || v > 1.0) {
 7485|   105k|                 invalid = true;
 7486|   105k|                 return true;
 7487|   105k|               }
 7488|   105k|               quality = v;
 7489|   105k|               return true;
 7490|   105k|             });
 7491|       |
 7492|   105k|  return !invalid;
 7493|  6.80M|}
_ZN7httplib6detail6divideEPKcmcNSt3__18functionIFvS2_mS2_mEEE:
 5888|  6.86M|           fn) {
 5889|  6.86M|  const auto it = std::find(data, data + size, d);
 5890|  6.86M|  const auto found = static_cast<std::size_t>(it != data + size);
 5891|  6.86M|  const auto lhs_data = data;
 5892|  6.86M|  const auto lhs_size = static_cast<std::size_t>(it - data);
 5893|  6.86M|  const auto rhs_data = it + found;
 5894|  6.86M|  const auto rhs_size = size - lhs_size - found;
 5895|       |
 5896|  6.86M|  fn(lhs_data, lhs_size, rhs_data, rhs_size);
 5897|  6.86M|}
_ZZN7httplib6detail13parse_qualityEPKcS2_RNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERdENKUlS2_mS2_mE_clES2_mS2_m:
 7453|  6.80M|      [&](const char *lb, std::size_t llen, const char *rb, std::size_t rlen) {
 7454|  6.80M|        auto r = trim(lb, lb + llen, 0, llen);
 7455|  6.80M|        if (r.first < r.second) { token.assign(lb + r.first, lb + r.second); }
  ------------------
  |  Branch (7455:13): [True: 6.80M, False: 369]
  ------------------
 7456|  6.80M|        params_b = rb;
 7457|  6.80M|        params_len = rlen;
 7458|  6.80M|      });
_ZN7httplib6detail10split_findEPKcS2_cmNSt3__18functionIFbS2_S2_EEE:
 5983|   105k|                       std::function<bool(const char *, const char *)> fn) {
 5984|   105k|  size_t i = 0;
 5985|   105k|  size_t beg = 0;
 5986|   105k|  size_t count = 1;
 5987|       |
 5988|  23.1M|  while (e ? (b + i < e) : (b[i] != '\0')) {
  ------------------
  |  Branch (5988:10): [True: 23.1M, False: 0]
  |  Branch (5988:10): [True: 23.0M, False: 102k]
  ------------------
 5989|  23.0M|    if (b[i] == d && count < m) {
  ------------------
  |  Branch (5989:9): [True: 11.0M, False: 11.9M]
  |  Branch (5989:22): [True: 11.0M, False: 0]
  ------------------
 5990|  11.0M|      auto r = trim(b, e, beg, i);
 5991|  11.0M|      if (r.first < r.second) {
  ------------------
  |  Branch (5991:11): [True: 861k, False: 10.2M]
  ------------------
 5992|   861k|        auto found = fn(&b[r.first], &b[r.second]);
 5993|   861k|        if (found) { return true; }
  ------------------
  |  Branch (5993:13): [True: 2.95k, False: 858k]
  ------------------
 5994|   861k|      }
 5995|  11.0M|      beg = i + 1;
 5996|  11.0M|      count++;
 5997|  11.0M|    }
 5998|  23.0M|    i++;
 5999|  23.0M|  }
 6000|       |
 6001|   102k|  if (i) {
  ------------------
  |  Branch (6001:7): [True: 102k, False: 0]
  ------------------
 6002|   102k|    auto r = trim(b, e, beg, i);
 6003|   102k|    if (r.first < r.second) {
  ------------------
  |  Branch (6003:9): [True: 102k, False: 433]
  ------------------
 6004|   102k|      auto found = fn(&b[r.first], &b[r.second]);
 6005|   102k|      if (found) { return true; }
  ------------------
  |  Branch (6005:11): [True: 90.1k, False: 12.1k]
  ------------------
 6006|   102k|    }
 6007|   102k|  }
 6008|       |
 6009|  12.5k|  return false;
 6010|   102k|}
_ZZN7httplib6detail13parse_qualityEPKcS2_RNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERdENKUlS2_S2_E_clES2_S2_:
 7467|   963k|             [&](const char *pb, const char *pe) -> bool {
 7468|       |               // Match exactly "q=" or "Q=" (not "query=" etc.)
 7469|   963k|               auto len = static_cast<size_t>(pe - pb);
 7470|   963k|               if (len < 2) { return false; }
  ------------------
  |  Branch (7470:20): [True: 849k, False: 113k]
  ------------------
 7471|   113k|               if ((pb[0] != 'q' && pb[0] != 'Q') || pb[1] != '=') {
  ------------------
  |  Branch (7471:21): [True: 22.3k, False: 91.2k]
  |  Branch (7471:37): [True: 12.6k, False: 9.76k]
  |  Branch (7471:54): [True: 7.93k, False: 93.0k]
  ------------------
 7472|  20.5k|                 return false;
 7473|  20.5k|               }
 7474|       |
 7475|       |               // Trim the value portion
 7476|  93.0k|               auto r = trim(pb, pe, 2, len);
 7477|  93.0k|               if (r.first >= r.second) {
  ------------------
  |  Branch (7477:20): [True: 611, False: 92.4k]
  ------------------
 7478|    611|                 invalid = true;
 7479|    611|                 return true;
 7480|    611|               }
 7481|       |
 7482|  92.4k|               double v = 0.0;
 7483|  92.4k|               auto res = from_chars(pb + r.first, pb + r.second, v);
 7484|  92.4k|               if (res.ec != std::errc{} || v < 0.0 || v > 1.0) {
  ------------------
  |  Branch (7484:20): [True: 691, False: 91.7k]
  |  Branch (7484:45): [True: 0, False: 91.7k]
  |  Branch (7484:56): [True: 477, False: 91.2k]
  ------------------
 7485|  1.16k|                 invalid = true;
 7486|  1.16k|                 return true;
 7487|  1.16k|               }
 7488|  91.2k|               quality = v;
 7489|  91.2k|               return true;
 7490|  92.4k|             });
_ZN7httplib6detail10from_charsEPKcS2_Rd:
  754|  92.4k|                                            double &value) {
  755|  92.4k|  value = 0.0;
  756|  92.4k|  const char *p = first;
  757|       |
  758|       |  // Each 1eN is exactly representable, so a single final division by the
  759|       |  // matching entry yields a correctly-rounded result.
  760|  92.4k|  static const double powers_of_ten[] = {
  761|  92.4k|      1e0,  1e1,  1e2,  1e3,  1e4,  1e5,  1e6,  1e7,  1e8, 1e9,
  762|  92.4k|      1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18};
  763|  92.4k|  const int max_frac_digits =
  764|  92.4k|      static_cast<int>(sizeof(powers_of_ten) / sizeof(powers_of_ten[0])) - 1;
  765|       |
  766|       |  // Accumulate digits into a 64-bit integer and remember how many were
  767|       |  // fractional. Two independent caps keep this bounded and safe:
  768|       |  //   * accumulation saturates before mantissa could overflow uint64_t, and
  769|       |  //   * frac_digits is capped at max_frac_digits so it is always a valid index
  770|       |  //     into powers_of_ten (without this an input like "0.000...0" would never
  771|       |  //     grow mantissa, so the saturation cap alone would not bound it).
  772|       |  // Both caps only drop digits far beyond the precision a q-value needs; any
  773|       |  // value they would change is well outside [0, 1] and rejected by the caller.
  774|  92.4k|  uint64_t mantissa = 0;
  775|  92.4k|  int frac_digits = 0;
  776|  92.4k|  bool seen_digit = false;
  777|       |
  778|  92.4k|  const uint64_t limit = ((std::numeric_limits<uint64_t>::max)() - 9) / 10;
  779|  92.4k|  auto accumulate = [&](char c) {
  780|  92.4k|    if (mantissa <= limit) {
  781|  92.4k|      mantissa = mantissa * 10 + static_cast<uint64_t>(c - '0');
  782|  92.4k|      return true;
  783|  92.4k|    }
  784|  92.4k|    return false;
  785|  92.4k|  };
  786|       |
  787|   188k|  for (; p != last && is_ascii_digit(*p); ++p) {
  ------------------
  |  Branch (787:10): [True: 110k, False: 78.6k]
  |  Branch (787:23): [True: 96.4k, False: 13.7k]
  ------------------
  788|  96.4k|    seen_digit = true;
  789|  96.4k|    accumulate(*p);
  790|  96.4k|  }
  791|       |
  792|  92.4k|  if (p != last && *p == '.') {
  ------------------
  |  Branch (792:7): [True: 13.7k, False: 78.6k]
  |  Branch (792:20): [True: 2.98k, False: 10.8k]
  ------------------
  793|  2.98k|    ++p;
  794|  6.77k|    for (; p != last && is_ascii_digit(*p); ++p) {
  ------------------
  |  Branch (794:12): [True: 5.71k, False: 1.05k]
  |  Branch (794:25): [True: 3.79k, False: 1.92k]
  ------------------
  795|  3.79k|      seen_digit = true;
  796|  3.79k|      if (frac_digits < max_frac_digits && accumulate(*p)) { ++frac_digits; }
  ------------------
  |  Branch (796:11): [True: 3.54k, False: 246]
  |  Branch (796:44): [True: 3.23k, False: 312]
  ------------------
  797|  3.79k|    }
  798|  2.98k|  }
  799|       |
  800|  92.4k|  if (!seen_digit) { return {first, std::errc::invalid_argument}; }
  ------------------
  |  Branch (800:7): [True: 691, False: 91.7k]
  ------------------
  801|       |
  802|  91.7k|  value = static_cast<double>(mantissa) / powers_of_ten[frac_digits];
  803|  91.7k|  return {p, std::errc{}};
  804|  92.4k|}
_ZZN7httplib6detail10from_charsEPKcS2_RdENKUlcE_clEc:
  779|   100k|  auto accumulate = [&](char c) {
  780|   100k|    if (mantissa <= limit) {
  ------------------
  |  Branch (780:9): [True: 99.2k, False: 753]
  ------------------
  781|  99.2k|      mantissa = mantissa * 10 + static_cast<uint64_t>(c - '0');
  782|  99.2k|      return true;
  783|  99.2k|    }
  784|    753|    return false;
  785|   100k|  };
_ZZN7httplib6detail19parse_accept_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorIS7_NS5_IS7_EEEEENKUlRKZNS0_19parse_accept_headerES9_SD_E11AcceptEntrySG_E_clESG_SG_:
 9066|   173M|            [](const AcceptEntry &a, const AcceptEntry &b) {
 9067|   173M|              if (a.quality != b.quality) {
  ------------------
  |  Branch (9067:19): [True: 170k, False: 173M]
  ------------------
 9068|   170k|                return a.quality > b.quality; // Higher quality first
 9069|   170k|              }
 9070|   173M|              return a.order < b.order; // Earlier order first for same quality
 9071|   173M|            });
_ZN7httplib6detail18extract_media_typeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEE:
 7389|  6.80M|                   std::map<std::string, std::string> *params = nullptr) {
 7390|       |  // Extract type/subtype from Content-Type value (RFC 2045)
 7391|       |  // e.g. "application/json; charset=utf-8" -> "application/json"
 7392|  6.80M|  auto media_type = content_type;
 7393|  6.80M|  auto semicolon_pos = media_type.find(';');
 7394|  6.80M|  if (semicolon_pos != std::string::npos) {
  ------------------
  |  Branch (7394:7): [True: 252, False: 6.80M]
  ------------------
 7395|    252|    auto param_str = media_type.substr(semicolon_pos + 1);
 7396|    252|    media_type = media_type.substr(0, semicolon_pos);
 7397|       |
 7398|    252|    if (params) {
  ------------------
  |  Branch (7398:9): [True: 237, False: 15]
  ------------------
 7399|       |      // Parse parameters: key=value pairs separated by ';'
 7400|    237|      split_unquoted(param_str.data(), param_str.data() + param_str.size(), ';',
 7401|    237|                     [&](const char *b, const char *e) {
 7402|    237|                       std::string key;
 7403|    237|                       std::string val;
 7404|    237|                       divide_param_pair(b, e, key, val);
 7405|    237|                       if (!key.empty()) {
 7406|    237|                         params->emplace(trim_copy(key),
 7407|    237|                                         trim_double_quotes_copy(val));
 7408|    237|                       }
 7409|    237|                     });
 7410|    237|    }
 7411|    252|  }
 7412|       |
 7413|       |  // Trim whitespace from media type
 7414|  6.80M|  return trim_copy(media_type);
 7415|  6.80M|}
_ZN7httplib6detail14split_unquotedEPKcS2_cNSt3__18functionIFvS2_S2_EEE:
 5962|    785|                           std::function<void(const char *, const char *)> fn) {
 5963|    785|  return split_unquoted(b, e, d, (std::numeric_limits<size_t>::max)(),
 5964|    785|                        std::move(fn));
 5965|    785|}
_ZN7httplib6detail14split_unquotedEPKcS2_cmNSt3__18functionIFvS2_S2_EEE:
 5937|    785|                           std::function<void(const char *, const char *)> fn) {
 5938|    785|  size_t i = 0;
 5939|    785|  size_t beg = 0;
 5940|    785|  size_t count = 1;
 5941|    785|  auto in_quotes = false;
 5942|       |
 5943|  35.0M|  while (e ? (b + i < e) : (b[i] != '\0')) {
  ------------------
  |  Branch (5943:10): [True: 35.0M, False: 0]
  |  Branch (5943:10): [True: 35.0M, False: 785]
  ------------------
 5944|  35.0M|    if (b[i] == '"') {
  ------------------
  |  Branch (5944:9): [True: 16.9k, False: 35.0M]
  ------------------
 5945|  16.9k|      in_quotes = !in_quotes;
 5946|  35.0M|    } else if (b[i] == d && !in_quotes && count < m) {
  ------------------
  |  Branch (5946:16): [True: 4.86M, False: 30.2M]
  |  Branch (5946:29): [True: 3.35M, False: 1.51M]
  |  Branch (5946:43): [True: 3.35M, False: 0]
  ------------------
 5947|  3.35M|      auto r = trim(b, e, beg, i);
 5948|  3.35M|      if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5948:11): [True: 78.5k, False: 3.27M]
  ------------------
 5949|  3.35M|      beg = i + 1;
 5950|  3.35M|      count++;
 5951|  3.35M|    }
 5952|  35.0M|    i++;
 5953|  35.0M|  }
 5954|       |
 5955|    785|  if (i) {
  ------------------
  |  Branch (5955:7): [True: 777, False: 8]
  ------------------
 5956|    777|    auto r = trim(b, e, beg, i);
 5957|    777|    if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5957:9): [True: 687, False: 90]
  ------------------
 5958|    777|  }
 5959|    785|}
_ZZN7httplib6detail18extract_media_typeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEEENKUlPKcSJ_E_clESJ_SJ_:
 7401|  18.8k|                     [&](const char *b, const char *e) {
 7402|  18.8k|                       std::string key;
 7403|  18.8k|                       std::string val;
 7404|  18.8k|                       divide_param_pair(b, e, key, val);
 7405|  18.8k|                       if (!key.empty()) {
  ------------------
  |  Branch (7405:28): [True: 18.1k, False: 699]
  ------------------
 7406|  18.1k|                         params->emplace(trim_copy(key),
 7407|  18.1k|                                         trim_double_quotes_copy(val));
 7408|  18.1k|                       }
 7409|  18.8k|                     });
_ZN7httplib6detail17divide_param_pairEPKcS2_RNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESA_:
 5971|  61.4k|                              std::string &val) {
 5972|  61.4k|  divide(
 5973|  61.4k|      b, static_cast<std::size_t>(e - b), '=',
 5974|  61.4k|      [&](const char *kb, std::size_t klen, const char *vb, std::size_t vlen) {
 5975|  61.4k|        const auto kr = trim(kb, kb + klen, 0, klen);
 5976|  61.4k|        key.assign(kb + kr.first, kb + kr.second);
 5977|  61.4k|        const auto vr = trim(vb, vb + vlen, 0, vlen);
 5978|  61.4k|        val.assign(vb + vr.first, vb + vr.second);
 5979|  61.4k|      });
 5980|  61.4k|}
_ZZN7httplib6detail17divide_param_pairEPKcS2_RNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESA_ENKUlS2_mS2_mE_clES2_mS2_m:
 5974|  61.4k|      [&](const char *kb, std::size_t klen, const char *vb, std::size_t vlen) {
 5975|  61.4k|        const auto kr = trim(kb, kb + klen, 0, klen);
 5976|  61.4k|        key.assign(kb + kr.first, kb + kr.second);
 5977|  61.4k|        const auto vr = trim(vb, vb + vlen, 0, vlen);
 5978|  61.4k|        val.assign(vb + vr.first, vb + vr.second);
 5979|  61.4k|      });
_ZN7httplib6detail23trim_double_quotes_copyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5878|   102k|inline std::string trim_double_quotes_copy(const std::string &s) {
 5879|   102k|  if (s.length() >= 2 && s.front() == '"' && s.back() == '"') {
  ------------------
  |  Branch (5879:7): [True: 35.0k, False: 67.5k]
  |  Branch (5879:26): [True: 486, False: 34.6k]
  |  Branch (5879:46): [True: 116, False: 370]
  ------------------
 5880|    116|    return s.substr(1, s.size() - 2);
 5881|    116|  }
 5882|   102k|  return s;
 5883|   102k|}
_ZN7httplib6detail24parse_multipart_boundaryERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERS7_:
 8914|    195|                                     std::string &boundary) {
 8915|    195|  std::map<std::string, std::string> params;
 8916|    195|  extract_media_type(content_type, &params);
 8917|    195|  auto it = params.find("boundary");
 8918|    195|  if (it == params.end()) { return false; }
  ------------------
  |  Branch (8918:7): [True: 194, False: 1]
  ------------------
 8919|      1|  boundary = it->second;
 8920|       |  // RFC 2046 5.1.1 caps a boundary at 70 characters. The parser scans the body
 8921|       |  // for "--" + boundary, so a body crafted to repeat that delimiter's leading
 8922|       |  // bytes costs a nearly full comparison at nearly every position: the
 8923|       |  // boundary's length multiplies the worst-case cost of scanning a body.
 8924|      1|  return !boundary.empty() && boundary.size() <= 70;
  ------------------
  |  Branch (8924:10): [True: 0, False: 1]
  |  Branch (8924:31): [True: 0, False: 0]
  ------------------
 8925|    195|}
_ZN7httplib6detail26insertion_ordered_multimapINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_8equal_toIS8_EEEC2Ev:
 1132|    548|  insertion_ordered_multimap() = default;
_ZN7httplib6detail24parse_disposition_paramsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS0_26insertion_ordered_multimapIS7_NS1_8equal_toIS7_EEEE:
 8927|    548|inline void parse_disposition_params(const std::string &s, Params &params) {
 8928|    548|  std::set<std::string> cache;
 8929|    548|  split_unquoted(s.data(), s.data() + s.size(), ';',
 8930|    548|                 [&](const char *b, const char *e) {
 8931|    548|                   std::string kv(b, e);
 8932|    548|                   if (cache.find(kv) != cache.end()) { return; }
 8933|    548|                   cache.insert(kv);
 8934|       |
 8935|    548|                   std::string key;
 8936|    548|                   std::string val;
 8937|    548|                   divide_param_pair(b, e, key, val);
 8938|       |
 8939|    548|                   if (!key.empty()) {
 8940|    548|                     params.emplace(trim_double_quotes_copy(key),
 8941|    548|                                    trim_double_quotes_copy(val));
 8942|    548|                   }
 8943|    548|                 });
 8944|    548|}
_ZZN7httplib6detail24parse_disposition_paramsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS0_26insertion_ordered_multimapIS7_NS1_8equal_toIS7_EEEEENKUlPKcSG_E_clESG_SG_:
 8930|  60.3k|                 [&](const char *b, const char *e) {
 8931|  60.3k|                   std::string kv(b, e);
 8932|  60.3k|                   if (cache.find(kv) != cache.end()) { return; }
  ------------------
  |  Branch (8932:24): [True: 17.8k, False: 42.5k]
  ------------------
 8933|  42.5k|                   cache.insert(kv);
 8934|       |
 8935|  42.5k|                   std::string key;
 8936|  42.5k|                   std::string val;
 8937|  42.5k|                   divide_param_pair(b, e, key, val);
 8938|       |
 8939|  42.5k|                   if (!key.empty()) {
  ------------------
  |  Branch (8939:24): [True: 42.2k, False: 309]
  ------------------
 8940|  42.2k|                     params.emplace(trim_double_quotes_copy(key),
 8941|  42.2k|                                    trim_double_quotes_copy(val));
 8942|  42.2k|                   }
 8943|  42.5k|                 });
_ZN7httplib6detail26insertion_ordered_multimapINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_8equal_toIS8_EEE7emplaceIJS8_S8_EEENSB_10iterator_tINS2_4pairIS8_S8_EEEEDpOT_:
 1161|  42.2k|  template <typename... Args> iterator emplace(Args &&...args) {
 1162|  42.2k|    entries_.emplace_back(std::forward<Args>(args)...);
 1163|  42.2k|    return make_iter(entries_.size() - 1, npos());
 1164|  42.2k|  }
_ZN7httplib6detail26insertion_ordered_multimapINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_8equal_toIS8_EEE9make_iterEmm:
 1270|  42.2k|  iterator make_iter(size_type idx, size_type key_idx) {
 1271|  42.2k|    return iterator(entries_.data(), idx, entries_.size(), key_idx);
 1272|  42.2k|  }
_ZN7httplib6detail26insertion_ordered_multimapINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_8equal_toIS8_EEE10iterator_tINS2_4pairIS8_S8_EEEC2EPSE_mmm:
 1116|  42.2k|        : data_(data), idx_(idx), size_(size), key_idx_(key_idx) {}
_ZN7httplib6detail26insertion_ordered_multimapINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_8equal_toIS8_EEE4nposEv:
 1035|  42.2k|  static size_type npos() { return static_cast<size_type>(-1); }
_ZN7httplib6detail15parse_http_dateERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5159|      3|inline time_t parse_http_date(const std::string &date_str) {
 5160|      3|  struct tm tm_buf;
 5161|       |
 5162|       |  // Create a classic locale object once for all parsing attempts
 5163|      3|  const std::locale classic_locale = std::locale::classic();
 5164|       |
 5165|       |  // Try to parse using std::get_time (C++11, cross-platform)
 5166|      3|  auto try_parse = [&](const char *fmt) -> bool {
 5167|      3|    std::istringstream ss(date_str);
 5168|      3|    ss.imbue(classic_locale);
 5169|       |
 5170|      3|    memset(&tm_buf, 0, sizeof(tm_buf));
 5171|      3|    ss >> std::get_time(&tm_buf, fmt);
 5172|       |
 5173|      3|    return !ss.fail();
 5174|      3|  };
 5175|       |
 5176|       |  // RFC 9110 preferred format (HTTP-date): "Sun, 06 Nov 1994 08:49:37 GMT"
 5177|      3|  if (!try_parse("%a, %d %b %Y %H:%M:%S")) {
  ------------------
  |  Branch (5177:7): [True: 2, False: 1]
  ------------------
 5178|       |    // RFC 850 format: "Sunday, 06-Nov-94 08:49:37 GMT"
 5179|      2|    if (!try_parse("%A, %d-%b-%y %H:%M:%S")) {
  ------------------
  |  Branch (5179:9): [True: 2, False: 0]
  ------------------
 5180|       |      // asctime format: "Sun Nov  6 08:49:37 1994"
 5181|      2|      if (!try_parse("%a %b %d %H:%M:%S %Y")) {
  ------------------
  |  Branch (5181:11): [True: 2, False: 0]
  ------------------
 5182|      2|        return static_cast<time_t>(-1);
 5183|      2|      }
 5184|      2|    }
 5185|      2|  }
 5186|       |
 5187|       |#ifdef _WIN32
 5188|       |  return _mkgmtime(&tm_buf);
 5189|       |#elif defined _AIX
 5190|       |  return mktime(&tm_buf);
 5191|       |#else
 5192|      1|  return timegm(&tm_buf);
 5193|      3|#endif
 5194|      3|}
_ZZN7httplib6detail15parse_http_dateERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENKUlPKcE_clESB_:
 5166|      7|  auto try_parse = [&](const char *fmt) -> bool {
 5167|      7|    std::istringstream ss(date_str);
 5168|      7|    ss.imbue(classic_locale);
 5169|       |
 5170|      7|    memset(&tm_buf, 0, sizeof(tm_buf));
 5171|      7|    ss >> std::get_time(&tm_buf, fmt);
 5172|       |
 5173|      7|    return !ss.fail();
 5174|      7|  };
_ZN7httplib6detail25can_compress_content_typeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 7417|    660|inline bool can_compress_content_type(const std::string &content_type) {
 7418|    660|  using udl::operator""_t;
 7419|       |
 7420|    660|  auto mime_type = extract_media_type(content_type);
 7421|    660|  auto tag = str2tag(mime_type);
 7422|       |
 7423|    660|  switch (tag) {
 7424|      1|  case "image/svg+xml"_t:
  ------------------
  |  Branch (7424:3): [True: 1, False: 659]
  ------------------
 7425|      2|  case "application/javascript"_t:
  ------------------
  |  Branch (7425:3): [True: 1, False: 659]
  ------------------
 7426|      3|  case "application/x-javascript"_t:
  ------------------
  |  Branch (7426:3): [True: 1, False: 659]
  ------------------
 7427|      4|  case "application/json"_t:
  ------------------
  |  Branch (7427:3): [True: 1, False: 659]
  ------------------
 7428|      5|  case "application/ld+json"_t:
  ------------------
  |  Branch (7428:3): [True: 1, False: 659]
  ------------------
 7429|      6|  case "application/xml"_t:
  ------------------
  |  Branch (7429:3): [True: 1, False: 659]
  ------------------
 7430|      7|  case "application/xhtml+xml"_t:
  ------------------
  |  Branch (7430:3): [True: 1, False: 659]
  ------------------
 7431|      9|  case "application/rss+xml"_t:
  ------------------
  |  Branch (7431:3): [True: 2, False: 658]
  ------------------
 7432|     10|  case "application/atom+xml"_t:
  ------------------
  |  Branch (7432:3): [True: 1, False: 659]
  ------------------
 7433|     11|  case "application/xslt+xml"_t:
  ------------------
  |  Branch (7433:3): [True: 1, False: 659]
  ------------------
 7434|     12|  case "application/protobuf"_t: return true;
  ------------------
  |  Branch (7434:3): [True: 1, False: 659]
  ------------------
 7435|       |
 7436|      1|  case "text/event-stream"_t: return false;
  ------------------
  |  Branch (7436:3): [True: 1, False: 659]
  ------------------
 7437|       |
 7438|    647|  default: return !mime_type.rfind("text/", 0);
  ------------------
  |  Branch (7438:3): [True: 647, False: 13]
  ------------------
 7439|    660|  }
 7440|    660|}
_ZN7httplib6detail7str2tagERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 7300|    660|inline unsigned int str2tag(const std::string &s) {
 7301|       |  // Iterative form of str2tag_core: the recursive constexpr version is kept
 7302|       |  // for compile-time UDL evaluation of short string literals, but at runtime
 7303|       |  // we may receive arbitrarily long inputs (e.g. fuzzed Content-Type) that
 7304|       |  // would blow the stack with one frame per character.
 7305|    660|  unsigned int h = 0;
 7306|  4.57M|  for (auto c : s) {
  ------------------
  |  Branch (7306:15): [True: 4.57M, False: 660]
  ------------------
 7307|  4.57M|    h = (((std::numeric_limits<unsigned int>::max)() >> 6) & h * 33) ^
 7308|  4.57M|        static_cast<unsigned char>(c);
 7309|  4.57M|  }
 7310|    660|  return h;
 7311|    660|}

LLVMFuzzerTestOneInput:
    7|  3.36k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    8|  3.36k|  if (size < 2) return 0;
  ------------------
  |  Branch (8:7): [True: 1, False: 3.35k]
  ------------------
    9|       |
   10|  3.35k|  uint8_t selector = data[0];
   11|  3.35k|  const char *payload = reinterpret_cast<const char *>(data + 1);
   12|  3.35k|  size_t payload_size = size - 1;
   13|  3.35k|  std::string input(payload, payload_size);
   14|       |
   15|  3.35k|  switch (selector % 7) {
  ------------------
  |  Branch (15:11): [True: 3.35k, False: 0]
  ------------------
   16|    479|  case 0: {
  ------------------
  |  Branch (16:3): [True: 479, False: 2.88k]
  ------------------
   17|       |    // parse_range_header
   18|    479|    httplib::Ranges ranges;
   19|    479|    httplib::detail::parse_range_header(input, ranges);
   20|    479|    break;
   21|      0|  }
   22|  1.41k|  case 1: {
  ------------------
  |  Branch (22:3): [True: 1.41k, False: 1.94k]
  ------------------
   23|       |    // parse_accept_header
   24|  1.41k|    std::vector<std::string> content_types;
   25|  1.41k|    httplib::detail::parse_accept_header(input, content_types);
   26|  1.41k|    break;
   27|      0|  }
   28|     56|  case 2: {
  ------------------
  |  Branch (28:3): [True: 56, False: 3.30k]
  ------------------
   29|       |    // extract_media_type with params
   30|     56|    std::map<std::string, std::string> params;
   31|     56|    httplib::detail::extract_media_type(input, &params);
   32|     56|    break;
   33|      0|  }
   34|    195|  case 3: {
  ------------------
  |  Branch (34:3): [True: 195, False: 3.16k]
  ------------------
   35|       |    // parse_multipart_boundary
   36|    195|    std::string boundary;
   37|    195|    httplib::detail::parse_multipart_boundary(input, boundary);
   38|    195|    break;
   39|      0|  }
   40|    548|  case 4: {
  ------------------
  |  Branch (40:3): [True: 548, False: 2.81k]
  ------------------
   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.35k]
  ------------------
   47|       |    // parse_http_date
   48|      3|    httplib::detail::parse_http_date(input);
   49|      3|    break;
   50|      0|  }
   51|    660|  case 6: {
  ------------------
  |  Branch (51:3): [True: 660, False: 2.69k]
  ------------------
   52|       |    // can_compress_content_type
   53|    660|    httplib::detail::can_compress_content_type(input);
   54|    660|    break;
   55|      0|  }
   56|  3.35k|  }
   57|       |
   58|  3.35k|  return 0;
   59|  3.35k|}

