_ZN7httplib6detail18parse_range_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorINS1_4pairIllEENS5_ISC_EEEE:
 8930|    479|inline bool parse_range_header(const std::string &s, Ranges &ranges) try {
 8931|    479|#endif
 8932|    479|  auto is_valid = [](const std::string &str) {
 8933|    479|    return std::all_of(str.cbegin(), str.cend(), is_ascii_digit);
 8934|    479|  };
 8935|       |
 8936|    479|  if (s.size() > 7 && s.compare(0, 6, "bytes=") == 0) {
  ------------------
  |  Branch (8936:7): [True: 474, False: 5]
  |  Branch (8936:23): [True: 451, False: 23]
  ------------------
 8937|    451|    const auto pos = static_cast<size_t>(6);
 8938|    451|    const auto len = static_cast<size_t>(s.size() - 6);
 8939|    451|    auto all_valid_ranges = true;
 8940|    451|    split(&s[pos], &s[pos + len], ',', [&](const char *b, const char *e) {
 8941|    451|      if (!all_valid_ranges) { return; }
 8942|       |
 8943|    451|      const auto it = std::find(b, e, '-');
 8944|    451|      if (it == e) {
 8945|    451|        all_valid_ranges = false;
 8946|    451|        return;
 8947|    451|      }
 8948|       |
 8949|    451|      const auto lhs = std::string(b, it);
 8950|    451|      const auto rhs = std::string(it + 1, e);
 8951|    451|      if (!is_valid(lhs) || !is_valid(rhs)) {
 8952|    451|        all_valid_ranges = false;
 8953|    451|        return;
 8954|    451|      }
 8955|       |
 8956|    451|      ssize_t first = -1;
 8957|    451|      if (!lhs.empty()) {
 8958|    451|        ssize_t v;
 8959|    451|        auto res = detail::from_chars(lhs.data(), lhs.data() + lhs.size(), v);
 8960|    451|        if (res.ec == std::errc{}) { first = v; }
 8961|    451|      }
 8962|       |
 8963|    451|      ssize_t last = -1;
 8964|    451|      if (!rhs.empty()) {
 8965|    451|        ssize_t v;
 8966|    451|        auto res = detail::from_chars(rhs.data(), rhs.data() + rhs.size(), v);
 8967|    451|        if (res.ec == std::errc{}) { last = v; }
 8968|    451|      }
 8969|       |
 8970|    451|      if ((first == -1 && last == -1) ||
 8971|    451|          (first != -1 && last != -1 && first > last)) {
 8972|    451|        all_valid_ranges = false;
 8973|    451|        return;
 8974|    451|      }
 8975|       |
 8976|    451|      ranges.emplace_back(first, last);
 8977|    451|    });
 8978|    451|    return all_valid_ranges && !ranges.empty();
  ------------------
  |  Branch (8978:12): [True: 253, False: 198]
  |  Branch (8978:32): [True: 253, False: 0]
  ------------------
 8979|    451|  }
 8980|     28|  return false;
 8981|       |#ifdef CPPHTTPLIB_NO_EXCEPTIONS
 8982|       |}
 8983|       |#else
 8984|    479|} catch (...) { return false; }
_ZN7httplib6detail5splitEPKcS2_cNSt3__18functionIFvS2_S2_EEE:
 5901|  1.86k|                  std::function<void(const char *, const char *)> fn) {
 5902|  1.86k|  return split(b, e, d, (std::numeric_limits<size_t>::max)(), std::move(fn));
 5903|  1.86k|}
_ZN7httplib6detail5splitEPKcS2_cmNSt3__18functionIFvS2_S2_EEE:
 5906|  1.86k|                  std::function<void(const char *, const char *)> fn) {
 5907|  1.86k|  size_t i = 0;
 5908|  1.86k|  size_t beg = 0;
 5909|  1.86k|  size_t count = 1;
 5910|       |
 5911|  50.7M|  while (e ? (b + i < e) : (b[i] != '\0')) {
  ------------------
  |  Branch (5911:10): [True: 50.7M, False: 0]
  |  Branch (5911:10): [True: 50.7M, False: 1.86k]
  ------------------
 5912|  50.7M|    if (b[i] == d && count < m) {
  ------------------
  |  Branch (5912:9): [True: 6.90M, False: 43.8M]
  |  Branch (5912:22): [True: 6.90M, False: 0]
  ------------------
 5913|  6.90M|      auto r = trim(b, e, beg, i);
 5914|  6.90M|      if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5914:11): [True: 6.90M, False: 8.16k]
  ------------------
 5915|  6.90M|      beg = i + 1;
 5916|  6.90M|      count++;
 5917|  6.90M|    }
 5918|  50.7M|    i++;
 5919|  50.7M|  }
 5920|       |
 5921|  1.86k|  if (i) {
  ------------------
  |  Branch (5921:7): [True: 1.86k, False: 0]
  ------------------
 5922|  1.86k|    auto r = trim(b, e, beg, i);
 5923|  1.86k|    if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5923:9): [True: 1.84k, False: 24]
  ------------------
 5924|  1.86k|  }
 5925|  1.86k|}
_ZN7httplib6detail4trimEPKcS2_mm:
 5857|  42.0M|                                      size_t right) {
 5858|  46.0M|  while (b + left < e && is_space_or_tab(b[left])) {
  ------------------
  |  Branch (5858:10): [True: 45.9M, False: 62.3k]
  |  Branch (5858:26): [True: 3.97M, False: 42.0M]
  ------------------
 5859|  3.97M|    left++;
 5860|  3.97M|  }
 5861|  46.2M|  while (right > 0 && is_space_or_tab(b[right - 1])) {
  ------------------
  |  Branch (5861:10): [True: 46.2M, False: 62.2k]
  |  Branch (5861:23): [True: 4.21M, False: 42.0M]
  ------------------
 5862|  4.21M|    right--;
 5863|  4.21M|  }
 5864|  42.0M|  return std::make_pair(left, right);
 5865|  42.0M|}
_ZN7httplib6detail15is_space_or_tabEc:
 5720|  92.2M|inline bool is_space_or_tab(char c) { return c == ' ' || c == '\t'; }
  ------------------
  |  Branch (5720:46): [True: 8.17M, False: 84.0M]
  |  Branch (5720:58): [True: 17.9k, False: 84.0M]
  ------------------
_ZZN7httplib6detail18parse_range_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorINS1_4pairIllEENS5_ISC_EEEEENKUlPKcSH_E_clESH_SH_:
 8940|  98.8k|    split(&s[pos], &s[pos + len], ',', [&](const char *b, const char *e) {
 8941|  98.8k|      if (!all_valid_ranges) { return; }
  ------------------
  |  Branch (8941:11): [True: 34.1k, False: 64.6k]
  ------------------
 8942|       |
 8943|  64.6k|      const auto it = std::find(b, e, '-');
 8944|  64.6k|      if (it == e) {
  ------------------
  |  Branch (8944:11): [True: 19, False: 64.6k]
  ------------------
 8945|     19|        all_valid_ranges = false;
 8946|     19|        return;
 8947|     19|      }
 8948|       |
 8949|  64.6k|      const auto lhs = std::string(b, it);
 8950|  64.6k|      const auto rhs = std::string(it + 1, e);
 8951|  64.6k|      if (!is_valid(lhs) || !is_valid(rhs)) {
  ------------------
  |  Branch (8951:11): [True: 7, False: 64.6k]
  |  Branch (8951:29): [True: 13, False: 64.6k]
  ------------------
 8952|     20|        all_valid_ranges = false;
 8953|     20|        return;
 8954|     20|      }
 8955|       |
 8956|  64.6k|      ssize_t first = -1;
 8957|  64.6k|      if (!lhs.empty()) {
  ------------------
  |  Branch (8957:11): [True: 64.1k, False: 510]
  ------------------
 8958|  64.1k|        ssize_t v;
 8959|  64.1k|        auto res = detail::from_chars(lhs.data(), lhs.data() + lhs.size(), v);
 8960|  64.1k|        if (res.ec == std::errc{}) { first = v; }
  ------------------
  |  Branch (8960:13): [True: 63.9k, False: 216]
  ------------------
 8961|  64.1k|      }
 8962|       |
 8963|  64.6k|      ssize_t last = -1;
 8964|  64.6k|      if (!rhs.empty()) {
  ------------------
  |  Branch (8964:11): [True: 1.34k, False: 63.2k]
  ------------------
 8965|  1.34k|        ssize_t v;
 8966|  1.34k|        auto res = detail::from_chars(rhs.data(), rhs.data() + rhs.size(), v);
 8967|  1.34k|        if (res.ec == std::errc{}) { last = v; }
  ------------------
  |  Branch (8967:13): [True: 1.11k, False: 233]
  ------------------
 8968|  1.34k|      }
 8969|       |
 8970|  64.6k|      if ((first == -1 && last == -1) ||
  ------------------
  |  Branch (8970:12): [True: 726, False: 63.9k]
  |  Branch (8970:27): [True: 66, False: 660]
  ------------------
 8971|  64.5k|          (first != -1 && last != -1 && first > last)) {
  ------------------
  |  Branch (8971:12): [True: 63.9k, False: 660]
  |  Branch (8971:27): [True: 453, False: 63.4k]
  |  Branch (8971:41): [True: 93, False: 360]
  ------------------
 8972|    159|        all_valid_ranges = false;
 8973|    159|        return;
 8974|    159|      }
 8975|       |
 8976|  64.4k|      ranges.emplace_back(first, last);
 8977|  64.4k|    });
_ZZN7httplib6detail18parse_range_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorINS1_4pairIllEENS5_ISC_EEEEENKUlS9_E_clES9_:
 8932|   129k|  auto is_valid = [](const std::string &str) {
 8933|   129k|    return std::all_of(str.cbegin(), str.cend(), is_ascii_digit);
 8934|   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:
 8988|  1.41k|                                std::vector<std::string> &content_types) {
 8989|  1.41k|  content_types.clear();
 8990|       |
 8991|       |  // Empty string is considered valid (no preference)
 8992|  1.41k|  if (s.empty()) { return true; }
  ------------------
  |  Branch (8992:7): [True: 0, False: 1.41k]
  ------------------
 8993|       |
 8994|  1.41k|  struct AcceptEntry {
 8995|  1.41k|    std::string media_type;
 8996|  1.41k|    double quality;
 8997|  1.41k|    int order;
 8998|  1.41k|  };
 8999|       |
 9000|  1.41k|  std::vector<AcceptEntry> entries;
 9001|  1.41k|  int order = 0;
 9002|  1.41k|  bool has_invalid_entry = false;
 9003|       |
 9004|       |  // Split by comma and parse each entry. RFC 9110 Section 5.6.1.2: a recipient
 9005|       |  // has to parse and ignore empty list elements, so a leading, trailing or
 9006|       |  // doubled comma must not turn a legal Accept value into 400 Bad Request.
 9007|       |  // split() skips them, and the header length limit bounds how many a sender
 9008|       |  // can send, so ignoring all of them cannot be used as a denial-of-service
 9009|       |  // vector.
 9010|  1.41k|  split(s.data(), s.data() + s.size(), ',', [&](const char *b, const char *e) {
 9011|  1.41k|    std::string entry(b, e);
 9012|  1.41k|    entry = trim_copy(entry);
 9013|       |
 9014|  1.41k|    AcceptEntry accept_entry;
 9015|  1.41k|    accept_entry.order = order++;
 9016|       |
 9017|  1.41k|    if (!parse_quality(entry.data(), entry.data() + entry.size(),
 9018|  1.41k|                       accept_entry.media_type, accept_entry.quality)) {
 9019|  1.41k|      has_invalid_entry = true;
 9020|  1.41k|      return;
 9021|  1.41k|    }
 9022|       |
 9023|       |    // Remove additional parameters from media type
 9024|  1.41k|    accept_entry.media_type = extract_media_type(accept_entry.media_type);
 9025|       |
 9026|       |    // Basic validation of media type format
 9027|  1.41k|    if (accept_entry.media_type.empty()) {
 9028|  1.41k|      has_invalid_entry = true;
 9029|  1.41k|      return;
 9030|  1.41k|    }
 9031|       |
 9032|       |    // Check for basic media type format (should contain '/' or be '*')
 9033|  1.41k|    if (accept_entry.media_type != "*" &&
 9034|  1.41k|        accept_entry.media_type.find('/') == std::string::npos) {
 9035|  1.41k|      has_invalid_entry = true;
 9036|  1.41k|      return;
 9037|  1.41k|    }
 9038|       |
 9039|  1.41k|    entries.push_back(std::move(accept_entry));
 9040|  1.41k|  });
 9041|       |
 9042|       |  // Return false if any invalid entry was found
 9043|  1.41k|  if (has_invalid_entry) { return false; }
  ------------------
  |  Branch (9043:7): [True: 637, False: 781]
  ------------------
 9044|       |
 9045|       |  // Sort by quality (descending), then by original order (ascending)
 9046|    781|  std::sort(entries.begin(), entries.end(),
 9047|    781|            [](const AcceptEntry &a, const AcceptEntry &b) {
 9048|    781|              if (a.quality != b.quality) {
 9049|    781|                return a.quality > b.quality; // Higher quality first
 9050|    781|              }
 9051|    781|              return a.order < b.order; // Earlier order first for same quality
 9052|    781|            });
 9053|       |
 9054|       |  // Extract sorted media types
 9055|    781|  content_types.reserve(entries.size());
 9056|  6.55M|  for (auto &entry : entries) {
  ------------------
  |  Branch (9056:20): [True: 6.55M, False: 781]
  ------------------
 9057|  6.55M|    content_types.push_back(std::move(entry.media_type));
 9058|  6.55M|  }
 9059|       |
 9060|    781|  return true;
 9061|  1.41k|}
_ZZN7httplib6detail19parse_accept_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorIS7_NS5_IS7_EEEEENKUlPKcSF_E_clESF_SF_:
 9010|  6.80M|  split(s.data(), s.data() + s.size(), ',', [&](const char *b, const char *e) {
 9011|  6.80M|    std::string entry(b, e);
 9012|  6.80M|    entry = trim_copy(entry);
 9013|       |
 9014|  6.80M|    AcceptEntry accept_entry;
 9015|  6.80M|    accept_entry.order = order++;
 9016|       |
 9017|  6.80M|    if (!parse_quality(entry.data(), entry.data() + entry.size(),
  ------------------
  |  Branch (9017:9): [True: 2.14k, False: 6.80M]
  ------------------
 9018|  6.80M|                       accept_entry.media_type, accept_entry.quality)) {
 9019|  2.14k|      has_invalid_entry = true;
 9020|  2.14k|      return;
 9021|  2.14k|    }
 9022|       |
 9023|       |    // Remove additional parameters from media type
 9024|  6.80M|    accept_entry.media_type = extract_media_type(accept_entry.media_type);
 9025|       |
 9026|       |    // Basic validation of media type format
 9027|  6.80M|    if (accept_entry.media_type.empty()) {
  ------------------
  |  Branch (9027:9): [True: 0, False: 6.80M]
  ------------------
 9028|      0|      has_invalid_entry = true;
 9029|      0|      return;
 9030|      0|    }
 9031|       |
 9032|       |    // Check for basic media type format (should contain '/' or be '*')
 9033|  6.80M|    if (accept_entry.media_type != "*" &&
  ------------------
  |  Branch (9033:9): [True: 6.59M, False: 203k]
  ------------------
 9034|  6.59M|        accept_entry.media_type.find('/') == std::string::npos) {
  ------------------
  |  Branch (9034:9): [True: 5.20k, False: 6.59M]
  ------------------
 9035|  5.20k|      has_invalid_entry = true;
 9036|  5.20k|      return;
 9037|  5.20k|    }
 9038|       |
 9039|  6.79M|    entries.push_back(std::move(accept_entry));
 9040|  6.79M|  });
_ZN7httplib6detail9trim_copyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5867|  13.6M|inline std::string trim_copy(const std::string &s) {
 5868|  13.6M|  auto r = trim(s.data(), s.data() + s.size(), 0, s.size());
 5869|  13.6M|  return s.substr(r.first, r.second - r.first);
 5870|  13.6M|}
_ZN7httplib6detail13parse_qualityEPKcS2_RNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERd:
 7437|  6.80M|                          double &quality) {
 7438|  6.80M|  quality = 1.0;
 7439|  6.80M|  token.clear();
 7440|       |
 7441|       |  // Split on first ';': left = token name, right = parameters
 7442|  6.80M|  const char *params_b = nullptr;
 7443|  6.80M|  std::size_t params_len = 0;
 7444|       |
 7445|  6.80M|  divide(
 7446|  6.80M|      b, static_cast<std::size_t>(e - b), ';',
 7447|  6.80M|      [&](const char *lb, std::size_t llen, const char *rb, std::size_t rlen) {
 7448|  6.80M|        auto r = trim(lb, lb + llen, 0, llen);
 7449|  6.80M|        if (r.first < r.second) { token.assign(lb + r.first, lb + r.second); }
 7450|  6.80M|        params_b = rb;
 7451|  6.80M|        params_len = rlen;
 7452|  6.80M|      });
 7453|       |
 7454|  6.80M|  if (token.empty()) { return false; }
  ------------------
  |  Branch (7454:7): [True: 369, False: 6.80M]
  ------------------
 7455|  6.80M|  if (params_len == 0) { return true; }
  ------------------
  |  Branch (7455:7): [True: 6.69M, False: 105k]
  ------------------
 7456|       |
 7457|       |  // Scan parameters for q= (stops on first match)
 7458|   105k|  bool invalid = false;
 7459|   105k|  split_find(params_b, params_b + params_len, ';',
 7460|   105k|             (std::numeric_limits<size_t>::max)(),
 7461|   105k|             [&](const char *pb, const char *pe) -> bool {
 7462|       |               // Match exactly "q=" or "Q=" (not "query=" etc.)
 7463|   105k|               auto len = static_cast<size_t>(pe - pb);
 7464|   105k|               if (len < 2) { return false; }
 7465|   105k|               if ((pb[0] != 'q' && pb[0] != 'Q') || pb[1] != '=') {
 7466|   105k|                 return false;
 7467|   105k|               }
 7468|       |
 7469|       |               // Trim the value portion
 7470|   105k|               auto r = trim(pb, pe, 2, len);
 7471|   105k|               if (r.first >= r.second) {
 7472|   105k|                 invalid = true;
 7473|   105k|                 return true;
 7474|   105k|               }
 7475|       |
 7476|   105k|               double v = 0.0;
 7477|   105k|               auto res = from_chars(pb + r.first, pb + r.second, v);
 7478|   105k|               if (res.ec != std::errc{} || v < 0.0 || v > 1.0) {
 7479|   105k|                 invalid = true;
 7480|   105k|                 return true;
 7481|   105k|               }
 7482|   105k|               quality = v;
 7483|   105k|               return true;
 7484|   105k|             });
 7485|       |
 7486|   105k|  return !invalid;
 7487|  6.80M|}
_ZN7httplib6detail6divideEPKcmcNSt3__18functionIFvS2_mS2_mEEE:
 5882|  6.86M|           fn) {
 5883|  6.86M|  const auto it = std::find(data, data + size, d);
 5884|  6.86M|  const auto found = static_cast<std::size_t>(it != data + size);
 5885|  6.86M|  const auto lhs_data = data;
 5886|  6.86M|  const auto lhs_size = static_cast<std::size_t>(it - data);
 5887|  6.86M|  const auto rhs_data = it + found;
 5888|  6.86M|  const auto rhs_size = size - lhs_size - found;
 5889|       |
 5890|  6.86M|  fn(lhs_data, lhs_size, rhs_data, rhs_size);
 5891|  6.86M|}
_ZZN7httplib6detail13parse_qualityEPKcS2_RNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERdENKUlS2_mS2_mE_clES2_mS2_m:
 7447|  6.80M|      [&](const char *lb, std::size_t llen, const char *rb, std::size_t rlen) {
 7448|  6.80M|        auto r = trim(lb, lb + llen, 0, llen);
 7449|  6.80M|        if (r.first < r.second) { token.assign(lb + r.first, lb + r.second); }
  ------------------
  |  Branch (7449:13): [True: 6.80M, False: 369]
  ------------------
 7450|  6.80M|        params_b = rb;
 7451|  6.80M|        params_len = rlen;
 7452|  6.80M|      });
_ZN7httplib6detail10split_findEPKcS2_cmNSt3__18functionIFbS2_S2_EEE:
 5977|   105k|                       std::function<bool(const char *, const char *)> fn) {
 5978|   105k|  size_t i = 0;
 5979|   105k|  size_t beg = 0;
 5980|   105k|  size_t count = 1;
 5981|       |
 5982|  23.1M|  while (e ? (b + i < e) : (b[i] != '\0')) {
  ------------------
  |  Branch (5982:10): [True: 23.1M, False: 0]
  |  Branch (5982:10): [True: 23.0M, False: 102k]
  ------------------
 5983|  23.0M|    if (b[i] == d && count < m) {
  ------------------
  |  Branch (5983:9): [True: 11.0M, False: 11.9M]
  |  Branch (5983:22): [True: 11.0M, False: 0]
  ------------------
 5984|  11.0M|      auto r = trim(b, e, beg, i);
 5985|  11.0M|      if (r.first < r.second) {
  ------------------
  |  Branch (5985:11): [True: 861k, False: 10.2M]
  ------------------
 5986|   861k|        auto found = fn(&b[r.first], &b[r.second]);
 5987|   861k|        if (found) { return true; }
  ------------------
  |  Branch (5987:13): [True: 2.95k, False: 858k]
  ------------------
 5988|   861k|      }
 5989|  11.0M|      beg = i + 1;
 5990|  11.0M|      count++;
 5991|  11.0M|    }
 5992|  23.0M|    i++;
 5993|  23.0M|  }
 5994|       |
 5995|   102k|  if (i) {
  ------------------
  |  Branch (5995:7): [True: 102k, False: 0]
  ------------------
 5996|   102k|    auto r = trim(b, e, beg, i);
 5997|   102k|    if (r.first < r.second) {
  ------------------
  |  Branch (5997:9): [True: 102k, False: 433]
  ------------------
 5998|   102k|      auto found = fn(&b[r.first], &b[r.second]);
 5999|   102k|      if (found) { return true; }
  ------------------
  |  Branch (5999:11): [True: 90.1k, False: 12.1k]
  ------------------
 6000|   102k|    }
 6001|   102k|  }
 6002|       |
 6003|  12.5k|  return false;
 6004|   102k|}
_ZZN7httplib6detail13parse_qualityEPKcS2_RNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERdENKUlS2_S2_E_clES2_S2_:
 7461|   963k|             [&](const char *pb, const char *pe) -> bool {
 7462|       |               // Match exactly "q=" or "Q=" (not "query=" etc.)
 7463|   963k|               auto len = static_cast<size_t>(pe - pb);
 7464|   963k|               if (len < 2) { return false; }
  ------------------
  |  Branch (7464:20): [True: 849k, False: 113k]
  ------------------
 7465|   113k|               if ((pb[0] != 'q' && pb[0] != 'Q') || pb[1] != '=') {
  ------------------
  |  Branch (7465:21): [True: 22.3k, False: 91.2k]
  |  Branch (7465:37): [True: 12.6k, False: 9.76k]
  |  Branch (7465:54): [True: 7.93k, False: 93.0k]
  ------------------
 7466|  20.5k|                 return false;
 7467|  20.5k|               }
 7468|       |
 7469|       |               // Trim the value portion
 7470|  93.0k|               auto r = trim(pb, pe, 2, len);
 7471|  93.0k|               if (r.first >= r.second) {
  ------------------
  |  Branch (7471:20): [True: 611, False: 92.4k]
  ------------------
 7472|    611|                 invalid = true;
 7473|    611|                 return true;
 7474|    611|               }
 7475|       |
 7476|  92.4k|               double v = 0.0;
 7477|  92.4k|               auto res = from_chars(pb + r.first, pb + r.second, v);
 7478|  92.4k|               if (res.ec != std::errc{} || v < 0.0 || v > 1.0) {
  ------------------
  |  Branch (7478:20): [True: 691, False: 91.7k]
  |  Branch (7478:45): [True: 0, False: 91.7k]
  |  Branch (7478:56): [True: 477, False: 91.2k]
  ------------------
 7479|  1.16k|                 invalid = true;
 7480|  1.16k|                 return true;
 7481|  1.16k|               }
 7482|  91.2k|               quality = v;
 7483|  91.2k|               return true;
 7484|  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_:
 9047|   173M|            [](const AcceptEntry &a, const AcceptEntry &b) {
 9048|   173M|              if (a.quality != b.quality) {
  ------------------
  |  Branch (9048:19): [True: 170k, False: 173M]
  ------------------
 9049|   170k|                return a.quality > b.quality; // Higher quality first
 9050|   170k|              }
 9051|   173M|              return a.order < b.order; // Earlier order first for same quality
 9052|   173M|            });
_ZN7httplib6detail18extract_media_typeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEE:
 7383|  6.80M|                   std::map<std::string, std::string> *params = nullptr) {
 7384|       |  // Extract type/subtype from Content-Type value (RFC 2045)
 7385|       |  // e.g. "application/json; charset=utf-8" -> "application/json"
 7386|  6.80M|  auto media_type = content_type;
 7387|  6.80M|  auto semicolon_pos = media_type.find(';');
 7388|  6.80M|  if (semicolon_pos != std::string::npos) {
  ------------------
  |  Branch (7388:7): [True: 252, False: 6.80M]
  ------------------
 7389|    252|    auto param_str = media_type.substr(semicolon_pos + 1);
 7390|    252|    media_type = media_type.substr(0, semicolon_pos);
 7391|       |
 7392|    252|    if (params) {
  ------------------
  |  Branch (7392:9): [True: 237, False: 15]
  ------------------
 7393|       |      // Parse parameters: key=value pairs separated by ';'
 7394|    237|      split_unquoted(param_str.data(), param_str.data() + param_str.size(), ';',
 7395|    237|                     [&](const char *b, const char *e) {
 7396|    237|                       std::string key;
 7397|    237|                       std::string val;
 7398|    237|                       divide_param_pair(b, e, key, val);
 7399|    237|                       if (!key.empty()) {
 7400|    237|                         params->emplace(trim_copy(key),
 7401|    237|                                         trim_double_quotes_copy(val));
 7402|    237|                       }
 7403|    237|                     });
 7404|    237|    }
 7405|    252|  }
 7406|       |
 7407|       |  // Trim whitespace from media type
 7408|  6.80M|  return trim_copy(media_type);
 7409|  6.80M|}
_ZN7httplib6detail14split_unquotedEPKcS2_cNSt3__18functionIFvS2_S2_EEE:
 5956|    785|                           std::function<void(const char *, const char *)> fn) {
 5957|    785|  return split_unquoted(b, e, d, (std::numeric_limits<size_t>::max)(),
 5958|    785|                        std::move(fn));
 5959|    785|}
_ZN7httplib6detail14split_unquotedEPKcS2_cmNSt3__18functionIFvS2_S2_EEE:
 5931|    785|                           std::function<void(const char *, const char *)> fn) {
 5932|    785|  size_t i = 0;
 5933|    785|  size_t beg = 0;
 5934|    785|  size_t count = 1;
 5935|    785|  auto in_quotes = false;
 5936|       |
 5937|  35.0M|  while (e ? (b + i < e) : (b[i] != '\0')) {
  ------------------
  |  Branch (5937:10): [True: 35.0M, False: 0]
  |  Branch (5937:10): [True: 35.0M, False: 785]
  ------------------
 5938|  35.0M|    if (b[i] == '"') {
  ------------------
  |  Branch (5938:9): [True: 16.9k, False: 35.0M]
  ------------------
 5939|  16.9k|      in_quotes = !in_quotes;
 5940|  35.0M|    } else if (b[i] == d && !in_quotes && count < m) {
  ------------------
  |  Branch (5940:16): [True: 4.86M, False: 30.2M]
  |  Branch (5940:29): [True: 3.35M, False: 1.51M]
  |  Branch (5940:43): [True: 3.35M, False: 0]
  ------------------
 5941|  3.35M|      auto r = trim(b, e, beg, i);
 5942|  3.35M|      if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5942:11): [True: 78.5k, False: 3.27M]
  ------------------
 5943|  3.35M|      beg = i + 1;
 5944|  3.35M|      count++;
 5945|  3.35M|    }
 5946|  35.0M|    i++;
 5947|  35.0M|  }
 5948|       |
 5949|    785|  if (i) {
  ------------------
  |  Branch (5949:7): [True: 777, False: 8]
  ------------------
 5950|    777|    auto r = trim(b, e, beg, i);
 5951|    777|    if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5951:9): [True: 687, False: 90]
  ------------------
 5952|    777|  }
 5953|    785|}
_ZZN7httplib6detail18extract_media_typeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEEENKUlPKcSJ_E_clESJ_SJ_:
 7395|  18.8k|                     [&](const char *b, const char *e) {
 7396|  18.8k|                       std::string key;
 7397|  18.8k|                       std::string val;
 7398|  18.8k|                       divide_param_pair(b, e, key, val);
 7399|  18.8k|                       if (!key.empty()) {
  ------------------
  |  Branch (7399:28): [True: 18.1k, False: 699]
  ------------------
 7400|  18.1k|                         params->emplace(trim_copy(key),
 7401|  18.1k|                                         trim_double_quotes_copy(val));
 7402|  18.1k|                       }
 7403|  18.8k|                     });
_ZN7httplib6detail17divide_param_pairEPKcS2_RNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESA_:
 5965|  61.4k|                              std::string &val) {
 5966|  61.4k|  divide(
 5967|  61.4k|      b, static_cast<std::size_t>(e - b), '=',
 5968|  61.4k|      [&](const char *kb, std::size_t klen, const char *vb, std::size_t vlen) {
 5969|  61.4k|        const auto kr = trim(kb, kb + klen, 0, klen);
 5970|  61.4k|        key.assign(kb + kr.first, kb + kr.second);
 5971|  61.4k|        const auto vr = trim(vb, vb + vlen, 0, vlen);
 5972|  61.4k|        val.assign(vb + vr.first, vb + vr.second);
 5973|  61.4k|      });
 5974|  61.4k|}
_ZZN7httplib6detail17divide_param_pairEPKcS2_RNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESA_ENKUlS2_mS2_mE_clES2_mS2_m:
 5968|  61.4k|      [&](const char *kb, std::size_t klen, const char *vb, std::size_t vlen) {
 5969|  61.4k|        const auto kr = trim(kb, kb + klen, 0, klen);
 5970|  61.4k|        key.assign(kb + kr.first, kb + kr.second);
 5971|  61.4k|        const auto vr = trim(vb, vb + vlen, 0, vlen);
 5972|  61.4k|        val.assign(vb + vr.first, vb + vr.second);
 5973|  61.4k|      });
_ZN7httplib6detail23trim_double_quotes_copyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5872|   102k|inline std::string trim_double_quotes_copy(const std::string &s) {
 5873|   102k|  if (s.length() >= 2 && s.front() == '"' && s.back() == '"') {
  ------------------
  |  Branch (5873:7): [True: 35.0k, False: 67.5k]
  |  Branch (5873:26): [True: 486, False: 34.6k]
  |  Branch (5873:46): [True: 116, False: 370]
  ------------------
 5874|    116|    return s.substr(1, s.size() - 2);
 5875|    116|  }
 5876|   102k|  return s;
 5877|   102k|}
_ZN7httplib6detail24parse_multipart_boundaryERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERS7_:
 8895|    195|                                     std::string &boundary) {
 8896|    195|  std::map<std::string, std::string> params;
 8897|    195|  extract_media_type(content_type, &params);
 8898|    195|  auto it = params.find("boundary");
 8899|    195|  if (it == params.end()) { return false; }
  ------------------
  |  Branch (8899:7): [True: 194, False: 1]
  ------------------
 8900|      1|  boundary = it->second;
 8901|       |  // RFC 2046 5.1.1 caps a boundary at 70 characters. The parser scans the body
 8902|       |  // for "--" + boundary, so a body crafted to repeat that delimiter's leading
 8903|       |  // bytes costs a nearly full comparison at nearly every position: the
 8904|       |  // boundary's length multiplies the worst-case cost of scanning a body.
 8905|      1|  return !boundary.empty() && boundary.size() <= 70;
  ------------------
  |  Branch (8905:10): [True: 0, False: 1]
  |  Branch (8905:31): [True: 0, False: 0]
  ------------------
 8906|    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:
 8908|    548|inline void parse_disposition_params(const std::string &s, Params &params) {
 8909|    548|  std::set<std::string> cache;
 8910|    548|  split_unquoted(s.data(), s.data() + s.size(), ';',
 8911|    548|                 [&](const char *b, const char *e) {
 8912|    548|                   std::string kv(b, e);
 8913|    548|                   if (cache.find(kv) != cache.end()) { return; }
 8914|    548|                   cache.insert(kv);
 8915|       |
 8916|    548|                   std::string key;
 8917|    548|                   std::string val;
 8918|    548|                   divide_param_pair(b, e, key, val);
 8919|       |
 8920|    548|                   if (!key.empty()) {
 8921|    548|                     params.emplace(trim_double_quotes_copy(key),
 8922|    548|                                    trim_double_quotes_copy(val));
 8923|    548|                   }
 8924|    548|                 });
 8925|    548|}
_ZZN7httplib6detail24parse_disposition_paramsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS0_26insertion_ordered_multimapIS7_NS1_8equal_toIS7_EEEEENKUlPKcSG_E_clESG_SG_:
 8911|  60.3k|                 [&](const char *b, const char *e) {
 8912|  60.3k|                   std::string kv(b, e);
 8913|  60.3k|                   if (cache.find(kv) != cache.end()) { return; }
  ------------------
  |  Branch (8913:24): [True: 17.8k, False: 42.5k]
  ------------------
 8914|  42.5k|                   cache.insert(kv);
 8915|       |
 8916|  42.5k|                   std::string key;
 8917|  42.5k|                   std::string val;
 8918|  42.5k|                   divide_param_pair(b, e, key, val);
 8919|       |
 8920|  42.5k|                   if (!key.empty()) {
  ------------------
  |  Branch (8920:24): [True: 42.2k, False: 309]
  ------------------
 8921|  42.2k|                     params.emplace(trim_double_quotes_copy(key),
 8922|  42.2k|                                    trim_double_quotes_copy(val));
 8923|  42.2k|                   }
 8924|  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:
 5153|      3|inline time_t parse_http_date(const std::string &date_str) {
 5154|      3|  struct tm tm_buf;
 5155|       |
 5156|       |  // Create a classic locale object once for all parsing attempts
 5157|      3|  const std::locale classic_locale = std::locale::classic();
 5158|       |
 5159|       |  // Try to parse using std::get_time (C++11, cross-platform)
 5160|      3|  auto try_parse = [&](const char *fmt) -> bool {
 5161|      3|    std::istringstream ss(date_str);
 5162|      3|    ss.imbue(classic_locale);
 5163|       |
 5164|      3|    memset(&tm_buf, 0, sizeof(tm_buf));
 5165|      3|    ss >> std::get_time(&tm_buf, fmt);
 5166|       |
 5167|      3|    return !ss.fail();
 5168|      3|  };
 5169|       |
 5170|       |  // RFC 9110 preferred format (HTTP-date): "Sun, 06 Nov 1994 08:49:37 GMT"
 5171|      3|  if (!try_parse("%a, %d %b %Y %H:%M:%S")) {
  ------------------
  |  Branch (5171:7): [True: 2, False: 1]
  ------------------
 5172|       |    // RFC 850 format: "Sunday, 06-Nov-94 08:49:37 GMT"
 5173|      2|    if (!try_parse("%A, %d-%b-%y %H:%M:%S")) {
  ------------------
  |  Branch (5173:9): [True: 2, False: 0]
  ------------------
 5174|       |      // asctime format: "Sun Nov  6 08:49:37 1994"
 5175|      2|      if (!try_parse("%a %b %d %H:%M:%S %Y")) {
  ------------------
  |  Branch (5175:11): [True: 2, False: 0]
  ------------------
 5176|      2|        return static_cast<time_t>(-1);
 5177|      2|      }
 5178|      2|    }
 5179|      2|  }
 5180|       |
 5181|       |#ifdef _WIN32
 5182|       |  return _mkgmtime(&tm_buf);
 5183|       |#elif defined _AIX
 5184|       |  return mktime(&tm_buf);
 5185|       |#else
 5186|      1|  return timegm(&tm_buf);
 5187|      3|#endif
 5188|      3|}
_ZZN7httplib6detail15parse_http_dateERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENKUlPKcE_clESB_:
 5160|      7|  auto try_parse = [&](const char *fmt) -> bool {
 5161|      7|    std::istringstream ss(date_str);
 5162|      7|    ss.imbue(classic_locale);
 5163|       |
 5164|      7|    memset(&tm_buf, 0, sizeof(tm_buf));
 5165|      7|    ss >> std::get_time(&tm_buf, fmt);
 5166|       |
 5167|      7|    return !ss.fail();
 5168|      7|  };
_ZN7httplib6detail25can_compress_content_typeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 7411|    660|inline bool can_compress_content_type(const std::string &content_type) {
 7412|    660|  using udl::operator""_t;
 7413|       |
 7414|    660|  auto mime_type = extract_media_type(content_type);
 7415|    660|  auto tag = str2tag(mime_type);
 7416|       |
 7417|    660|  switch (tag) {
 7418|      1|  case "image/svg+xml"_t:
  ------------------
  |  Branch (7418:3): [True: 1, False: 659]
  ------------------
 7419|      2|  case "application/javascript"_t:
  ------------------
  |  Branch (7419:3): [True: 1, False: 659]
  ------------------
 7420|      3|  case "application/x-javascript"_t:
  ------------------
  |  Branch (7420:3): [True: 1, False: 659]
  ------------------
 7421|      4|  case "application/json"_t:
  ------------------
  |  Branch (7421:3): [True: 1, False: 659]
  ------------------
 7422|      5|  case "application/ld+json"_t:
  ------------------
  |  Branch (7422:3): [True: 1, False: 659]
  ------------------
 7423|      6|  case "application/xml"_t:
  ------------------
  |  Branch (7423:3): [True: 1, False: 659]
  ------------------
 7424|      7|  case "application/xhtml+xml"_t:
  ------------------
  |  Branch (7424:3): [True: 1, False: 659]
  ------------------
 7425|      9|  case "application/rss+xml"_t:
  ------------------
  |  Branch (7425:3): [True: 2, False: 658]
  ------------------
 7426|     10|  case "application/atom+xml"_t:
  ------------------
  |  Branch (7426:3): [True: 1, False: 659]
  ------------------
 7427|     11|  case "application/xslt+xml"_t:
  ------------------
  |  Branch (7427:3): [True: 1, False: 659]
  ------------------
 7428|     12|  case "application/protobuf"_t: return true;
  ------------------
  |  Branch (7428:3): [True: 1, False: 659]
  ------------------
 7429|       |
 7430|      1|  case "text/event-stream"_t: return false;
  ------------------
  |  Branch (7430:3): [True: 1, False: 659]
  ------------------
 7431|       |
 7432|    647|  default: return !mime_type.rfind("text/", 0);
  ------------------
  |  Branch (7432:3): [True: 647, False: 13]
  ------------------
 7433|    660|  }
 7434|    660|}
_ZN7httplib6detail7str2tagERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 7294|    660|inline unsigned int str2tag(const std::string &s) {
 7295|       |  // Iterative form of str2tag_core: the recursive constexpr version is kept
 7296|       |  // for compile-time UDL evaluation of short string literals, but at runtime
 7297|       |  // we may receive arbitrarily long inputs (e.g. fuzzed Content-Type) that
 7298|       |  // would blow the stack with one frame per character.
 7299|    660|  unsigned int h = 0;
 7300|  4.57M|  for (auto c : s) {
  ------------------
  |  Branch (7300:15): [True: 4.57M, False: 660]
  ------------------
 7301|  4.57M|    h = (((std::numeric_limits<unsigned int>::max)() >> 6) & h * 33) ^
 7302|  4.57M|        static_cast<unsigned char>(c);
 7303|  4.57M|  }
 7304|    660|  return h;
 7305|    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|}

