_ZN7httplib6detail18parse_range_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorINS1_4pairIllEENS5_ISC_EEEE:
 8608|    459|inline bool parse_range_header(const std::string &s, Ranges &ranges) try {
 8609|    459|#endif
 8610|    459|  auto is_valid = [](const std::string &str) {
 8611|    459|    return std::all_of(str.cbegin(), str.cend(), is_ascii_digit);
 8612|    459|  };
 8613|       |
 8614|    459|  if (s.size() > 7 && s.compare(0, 6, "bytes=") == 0) {
  ------------------
  |  Branch (8614:7): [True: 454, False: 5]
  |  Branch (8614:23): [True: 436, False: 18]
  ------------------
 8615|    436|    const auto pos = static_cast<size_t>(6);
 8616|    436|    const auto len = static_cast<size_t>(s.size() - 6);
 8617|    436|    auto all_valid_ranges = true;
 8618|    436|    split(&s[pos], &s[pos + len], ',', [&](const char *b, const char *e) {
 8619|    436|      if (!all_valid_ranges) { return; }
 8620|       |
 8621|    436|      const auto it = std::find(b, e, '-');
 8622|    436|      if (it == e) {
 8623|    436|        all_valid_ranges = false;
 8624|    436|        return;
 8625|    436|      }
 8626|       |
 8627|    436|      const auto lhs = std::string(b, it);
 8628|    436|      const auto rhs = std::string(it + 1, e);
 8629|    436|      if (!is_valid(lhs) || !is_valid(rhs)) {
 8630|    436|        all_valid_ranges = false;
 8631|    436|        return;
 8632|    436|      }
 8633|       |
 8634|    436|      ssize_t first = -1;
 8635|    436|      if (!lhs.empty()) {
 8636|    436|        ssize_t v;
 8637|    436|        auto res = detail::from_chars(lhs.data(), lhs.data() + lhs.size(), v);
 8638|    436|        if (res.ec == std::errc{}) { first = v; }
 8639|    436|      }
 8640|       |
 8641|    436|      ssize_t last = -1;
 8642|    436|      if (!rhs.empty()) {
 8643|    436|        ssize_t v;
 8644|    436|        auto res = detail::from_chars(rhs.data(), rhs.data() + rhs.size(), v);
 8645|    436|        if (res.ec == std::errc{}) { last = v; }
 8646|    436|      }
 8647|       |
 8648|    436|      if ((first == -1 && last == -1) ||
 8649|    436|          (first != -1 && last != -1 && first > last)) {
 8650|    436|        all_valid_ranges = false;
 8651|    436|        return;
 8652|    436|      }
 8653|       |
 8654|    436|      ranges.emplace_back(first, last);
 8655|    436|    });
 8656|    436|    return all_valid_ranges && !ranges.empty();
  ------------------
  |  Branch (8656:12): [True: 243, False: 193]
  |  Branch (8656:32): [True: 243, False: 0]
  ------------------
 8657|    436|  }
 8658|     23|  return false;
 8659|       |#ifdef CPPHTTPLIB_NO_EXCEPTIONS
 8660|       |}
 8661|       |#else
 8662|    459|} catch (...) { return false; }
_ZN7httplib6detail5splitEPKcS2_cNSt3__18functionIFvS2_S2_EEE:
 5762|   101k|                  std::function<void(const char *, const char *)> fn) {
 5763|   101k|  return split(b, e, d, (std::numeric_limits<size_t>::max)(), std::move(fn));
 5764|   101k|}
_ZN7httplib6detail5splitEPKcS2_cmNSt3__18functionIFvS2_S2_EEE:
 5767|   101k|                  std::function<void(const char *, const char *)> fn) {
 5768|   101k|  size_t i = 0;
 5769|   101k|  size_t beg = 0;
 5770|   101k|  size_t count = 1;
 5771|       |
 5772|   102M|  while (e ? (b + i < e) : (b[i] != '\0')) {
  ------------------
  |  Branch (5772:10): [True: 102M, False: 0]
  |  Branch (5772:10): [True: 101M, False: 101k]
  ------------------
 5773|   101M|    if (b[i] == d && count < m) {
  ------------------
  |  Branch (5773:9): [True: 10.4M, False: 91.5M]
  |  Branch (5773:22): [True: 10.4M, False: 0]
  ------------------
 5774|  10.4M|      auto r = trim(b, e, beg, i);
 5775|  10.4M|      if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5775:11): [True: 6.22M, False: 4.22M]
  ------------------
 5776|  10.4M|      beg = i + 1;
 5777|  10.4M|      count++;
 5778|  10.4M|    }
 5779|   101M|    i++;
 5780|   101M|  }
 5781|       |
 5782|   101k|  if (i) {
  ------------------
  |  Branch (5782:7): [True: 101k, False: 7]
  ------------------
 5783|   101k|    auto r = trim(b, e, beg, i);
 5784|   101k|    if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5784:9): [True: 100k, False: 1.45k]
  ------------------
 5785|   101k|  }
 5786|   101k|}
_ZN7httplib6detail4trimEPKcS2_mm:
 5718|  42.5M|                                      size_t right) {
 5719|  45.4M|  while (b + left < e && is_space_or_tab(b[left])) {
  ------------------
  |  Branch (5719:10): [True: 45.4M, False: 3.60k]
  |  Branch (5719:26): [True: 2.86M, False: 42.5M]
  ------------------
 5720|  2.86M|    left++;
 5721|  2.86M|  }
 5722|  45.7M|  while (right > 0 && is_space_or_tab(b[right - 1])) {
  ------------------
  |  Branch (5722:10): [True: 45.7M, False: 3.06k]
  |  Branch (5722:23): [True: 3.12M, False: 42.5M]
  ------------------
 5723|  3.12M|    right--;
 5724|  3.12M|  }
 5725|  42.5M|  return std::make_pair(left, right);
 5726|  42.5M|}
_ZN7httplib6detail15is_space_or_tabEc:
 5573|  91.1M|inline bool is_space_or_tab(char c) { return c == ' ' || c == '\t'; }
  ------------------
  |  Branch (5573:46): [True: 5.97M, False: 85.1M]
  |  Branch (5573:58): [True: 18.7k, False: 85.1M]
  ------------------
_ZZN7httplib6detail18parse_range_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorINS1_4pairIllEENS5_ISC_EEEEENKUlPKcSH_E_clESH_SH_:
 8618|  99.4k|    split(&s[pos], &s[pos + len], ',', [&](const char *b, const char *e) {
 8619|  99.4k|      if (!all_valid_ranges) { return; }
  ------------------
  |  Branch (8619:11): [True: 35.7k, False: 63.7k]
  ------------------
 8620|       |
 8621|  63.7k|      const auto it = std::find(b, e, '-');
 8622|  63.7k|      if (it == e) {
  ------------------
  |  Branch (8622:11): [True: 18, False: 63.7k]
  ------------------
 8623|     18|        all_valid_ranges = false;
 8624|     18|        return;
 8625|     18|      }
 8626|       |
 8627|  63.7k|      const auto lhs = std::string(b, it);
 8628|  63.7k|      const auto rhs = std::string(it + 1, e);
 8629|  63.7k|      if (!is_valid(lhs) || !is_valid(rhs)) {
  ------------------
  |  Branch (8629:11): [True: 5, False: 63.7k]
  |  Branch (8629:29): [True: 9, False: 63.7k]
  ------------------
 8630|     14|        all_valid_ranges = false;
 8631|     14|        return;
 8632|     14|      }
 8633|       |
 8634|  63.7k|      ssize_t first = -1;
 8635|  63.7k|      if (!lhs.empty()) {
  ------------------
  |  Branch (8635:11): [True: 62.6k, False: 1.11k]
  ------------------
 8636|  62.6k|        ssize_t v;
 8637|  62.6k|        auto res = detail::from_chars(lhs.data(), lhs.data() + lhs.size(), v);
 8638|  62.6k|        if (res.ec == std::errc{}) { first = v; }
  ------------------
  |  Branch (8638:13): [True: 61.8k, False: 844]
  ------------------
 8639|  62.6k|      }
 8640|       |
 8641|  63.7k|      ssize_t last = -1;
 8642|  63.7k|      if (!rhs.empty()) {
  ------------------
  |  Branch (8642:11): [True: 2.35k, False: 61.4k]
  ------------------
 8643|  2.35k|        ssize_t v;
 8644|  2.35k|        auto res = detail::from_chars(rhs.data(), rhs.data() + rhs.size(), v);
 8645|  2.35k|        if (res.ec == std::errc{}) { last = v; }
  ------------------
  |  Branch (8645:13): [True: 2.16k, False: 198]
  ------------------
 8646|  2.35k|      }
 8647|       |
 8648|  63.7k|      if ((first == -1 && last == -1) ||
  ------------------
  |  Branch (8648:12): [True: 1.95k, False: 61.8k]
  |  Branch (8648:27): [True: 86, False: 1.87k]
  ------------------
 8649|  63.6k|          (first != -1 && last != -1 && first > last)) {
  ------------------
  |  Branch (8649:12): [True: 61.8k, False: 1.87k]
  |  Branch (8649:27): [True: 289, False: 61.5k]
  |  Branch (8649:41): [True: 75, False: 214]
  ------------------
 8650|    161|        all_valid_ranges = false;
 8651|    161|        return;
 8652|    161|      }
 8653|       |
 8654|  63.5k|      ranges.emplace_back(first, last);
 8655|  63.5k|    });
_ZZN7httplib6detail18parse_range_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorINS1_4pairIllEENS5_ISC_EEEEENKUlS9_E_clES9_:
 8610|   127k|  auto is_valid = [](const std::string &str) {
 8611|   127k|    return std::all_of(str.cbegin(), str.cend(), is_ascii_digit);
 8612|   127k|  };
_ZN7httplib6detail14is_ascii_digitEc:
  562|   307k|inline bool is_ascii_digit(char c) { return '0' <= c && c <= '9'; }
  ------------------
  |  Branch (562:45): [True: 295k, False: 11.9k]
  |  Branch (562:57): [True: 290k, False: 4.49k]
  ------------------
_ZN7httplib6detail10from_charsIlEENS0_17from_chars_resultIT_EEPKcS6_RS3_i:
  678|  65.0k|                                       T &value, int base = 10) {
  679|  65.0k|  value = 0;
  680|  65.0k|  const char *p = first;
  681|  65.0k|  bool negative = false;
  682|       |
  683|  65.0k|  if (p != last && *p == '-') {
  ------------------
  |  Branch (683:7): [True: 65.0k, False: 0]
  |  Branch (683:20): [True: 0, False: 65.0k]
  ------------------
  684|      0|    negative = true;
  685|      0|    ++p;
  686|      0|  }
  687|  65.0k|  if (p == last) { return {first, std::errc::invalid_argument}; }
  ------------------
  |  Branch (687:7): [True: 0, False: 65.0k]
  ------------------
  688|       |
  689|  65.0k|  T result = 0;
  690|   154k|  for (; p != last; ++p) {
  ------------------
  |  Branch (690:10): [True: 90.1k, False: 63.9k]
  ------------------
  691|  90.1k|    char c = *p;
  692|  90.1k|    int digit = -1;
  693|  90.1k|    if (is_ascii_digit(c)) {
  ------------------
  |  Branch (693:9): [True: 90.1k, False: 0]
  ------------------
  694|  90.1k|      digit = c - '0';
  695|  90.1k|    } else if ('a' <= c && c <= 'z') {
  ------------------
  |  Branch (695:16): [True: 0, False: 0]
  |  Branch (695:28): [True: 0, False: 0]
  ------------------
  696|      0|      digit = c - 'a' + 10;
  697|      0|    } else if ('A' <= c && c <= 'Z') {
  ------------------
  |  Branch (697:16): [True: 0, False: 0]
  |  Branch (697:28): [True: 0, False: 0]
  ------------------
  698|      0|      digit = c - 'A' + 10;
  699|      0|    } else {
  700|      0|      break;
  701|      0|    }
  702|       |
  703|  90.1k|    if (digit < 0 || digit >= base) { break; }
  ------------------
  |  Branch (703:9): [True: 0, False: 90.1k]
  |  Branch (703:22): [True: 0, False: 90.1k]
  ------------------
  704|  90.1k|    if (result > ((std::numeric_limits<T>::max)() - digit) / base) {
  ------------------
  |  Branch (704:9): [True: 1.04k, False: 89.0k]
  ------------------
  705|  1.04k|      return {p, std::errc::result_out_of_range};
  706|  1.04k|    }
  707|  89.0k|    result = result * base + digit;
  708|  89.0k|  }
  709|       |
  710|  63.9k|  if (p == first || (negative && p == first + 1)) {
  ------------------
  |  Branch (710:7): [True: 0, False: 63.9k]
  |  Branch (710:22): [True: 0, False: 63.9k]
  |  Branch (710:34): [True: 0, False: 0]
  ------------------
  711|      0|    return {first, std::errc::invalid_argument};
  712|      0|  }
  713|       |
  714|  63.9k|  value = negative ? T(0) - result : result;
  ------------------
  |  Branch (714:11): [True: 0, False: 63.9k]
  ------------------
  715|  63.9k|  return {p, std::errc{}};
  716|  63.9k|}
_ZN7httplib6detail19parse_accept_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorIS7_NS5_IS7_EEEE:
 8666|  1.38k|                                std::vector<std::string> &content_types) {
 8667|  1.38k|  content_types.clear();
 8668|       |
 8669|       |  // Empty string is considered valid (no preference)
 8670|  1.38k|  if (s.empty()) { return true; }
  ------------------
  |  Branch (8670:7): [True: 0, False: 1.38k]
  ------------------
 8671|       |
 8672|       |  // Check for invalid patterns: leading/trailing commas or consecutive commas
 8673|  1.38k|  if (s.front() == ',' || s.back() == ',' ||
  ------------------
  |  Branch (8673:7): [True: 2, False: 1.38k]
  |  Branch (8673:27): [True: 3, False: 1.38k]
  ------------------
 8674|  1.38k|      s.find(",,") != std::string::npos) {
  ------------------
  |  Branch (8674:7): [True: 25, False: 1.35k]
  ------------------
 8675|     30|    return false;
 8676|     30|  }
 8677|       |
 8678|  1.35k|  struct AcceptEntry {
 8679|  1.35k|    std::string media_type;
 8680|  1.35k|    double quality;
 8681|  1.35k|    int order;
 8682|  1.35k|  };
 8683|       |
 8684|  1.35k|  std::vector<AcceptEntry> entries;
 8685|  1.35k|  int order = 0;
 8686|  1.35k|  bool has_invalid_entry = false;
 8687|       |
 8688|       |  // Split by comma and parse each entry
 8689|  1.35k|  split(s.data(), s.data() + s.size(), ',', [&](const char *b, const char *e) {
 8690|  1.35k|    std::string entry(b, e);
 8691|  1.35k|    entry = trim_copy(entry);
 8692|       |
 8693|  1.35k|    if (entry.empty()) {
 8694|  1.35k|      has_invalid_entry = true;
 8695|  1.35k|      return;
 8696|  1.35k|    }
 8697|       |
 8698|  1.35k|    AcceptEntry accept_entry;
 8699|  1.35k|    accept_entry.order = order++;
 8700|       |
 8701|  1.35k|    if (!parse_quality(entry.data(), entry.data() + entry.size(),
 8702|  1.35k|                       accept_entry.media_type, accept_entry.quality)) {
 8703|  1.35k|      has_invalid_entry = true;
 8704|  1.35k|      return;
 8705|  1.35k|    }
 8706|       |
 8707|       |    // Remove additional parameters from media type
 8708|  1.35k|    accept_entry.media_type = extract_media_type(accept_entry.media_type);
 8709|       |
 8710|       |    // Basic validation of media type format
 8711|  1.35k|    if (accept_entry.media_type.empty()) {
 8712|  1.35k|      has_invalid_entry = true;
 8713|  1.35k|      return;
 8714|  1.35k|    }
 8715|       |
 8716|       |    // Check for basic media type format (should contain '/' or be '*')
 8717|  1.35k|    if (accept_entry.media_type != "*" &&
 8718|  1.35k|        accept_entry.media_type.find('/') == std::string::npos) {
 8719|  1.35k|      has_invalid_entry = true;
 8720|  1.35k|      return;
 8721|  1.35k|    }
 8722|       |
 8723|  1.35k|    entries.push_back(std::move(accept_entry));
 8724|  1.35k|  });
 8725|       |
 8726|       |  // Return false if any invalid entry was found
 8727|  1.35k|  if (has_invalid_entry) { return false; }
  ------------------
  |  Branch (8727:7): [True: 615, False: 742]
  ------------------
 8728|       |
 8729|       |  // Sort by quality (descending), then by original order (ascending)
 8730|    742|  std::sort(entries.begin(), entries.end(),
 8731|    742|            [](const AcceptEntry &a, const AcceptEntry &b) {
 8732|    742|              if (a.quality != b.quality) {
 8733|    742|                return a.quality > b.quality; // Higher quality first
 8734|    742|              }
 8735|    742|              return a.order < b.order; // Earlier order first for same quality
 8736|    742|            });
 8737|       |
 8738|       |  // Extract sorted media types
 8739|    742|  content_types.reserve(entries.size());
 8740|  5.91M|  for (auto &entry : entries) {
  ------------------
  |  Branch (8740:20): [True: 5.91M, False: 742]
  ------------------
 8741|  5.91M|    content_types.push_back(std::move(entry.media_type));
 8742|  5.91M|  }
 8743|       |
 8744|    742|  return true;
 8745|  1.35k|}
_ZZN7httplib6detail19parse_accept_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorIS7_NS5_IS7_EEEEENKUlPKcSF_E_clESF_SF_:
 8689|  5.98M|  split(s.data(), s.data() + s.size(), ',', [&](const char *b, const char *e) {
 8690|  5.98M|    std::string entry(b, e);
 8691|  5.98M|    entry = trim_copy(entry);
 8692|       |
 8693|  5.98M|    if (entry.empty()) {
  ------------------
  |  Branch (8693:9): [True: 0, False: 5.98M]
  ------------------
 8694|      0|      has_invalid_entry = true;
 8695|      0|      return;
 8696|      0|    }
 8697|       |
 8698|  5.98M|    AcceptEntry accept_entry;
 8699|  5.98M|    accept_entry.order = order++;
 8700|       |
 8701|  5.98M|    if (!parse_quality(entry.data(), entry.data() + entry.size(),
  ------------------
  |  Branch (8701:9): [True: 4.22k, False: 5.98M]
  ------------------
 8702|  5.98M|                       accept_entry.media_type, accept_entry.quality)) {
 8703|  4.22k|      has_invalid_entry = true;
 8704|  4.22k|      return;
 8705|  4.22k|    }
 8706|       |
 8707|       |    // Remove additional parameters from media type
 8708|  5.98M|    accept_entry.media_type = extract_media_type(accept_entry.media_type);
 8709|       |
 8710|       |    // Basic validation of media type format
 8711|  5.98M|    if (accept_entry.media_type.empty()) {
  ------------------
  |  Branch (8711:9): [True: 0, False: 5.98M]
  ------------------
 8712|      0|      has_invalid_entry = true;
 8713|      0|      return;
 8714|      0|    }
 8715|       |
 8716|       |    // Check for basic media type format (should contain '/' or be '*')
 8717|  5.98M|    if (accept_entry.media_type != "*" &&
  ------------------
  |  Branch (8717:9): [True: 5.78M, False: 200k]
  ------------------
 8718|  5.78M|        accept_entry.media_type.find('/') == std::string::npos) {
  ------------------
  |  Branch (8718:9): [True: 8.15k, False: 5.77M]
  ------------------
 8719|  8.15k|      has_invalid_entry = true;
 8720|  8.15k|      return;
 8721|  8.15k|    }
 8722|       |
 8723|  5.97M|    entries.push_back(std::move(accept_entry));
 8724|  5.97M|  });
_ZN7httplib6detail9trim_copyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5728|  11.9M|inline std::string trim_copy(const std::string &s) {
 5729|  11.9M|  auto r = trim(s.data(), s.data() + s.size(), 0, s.size());
 5730|  11.9M|  return s.substr(r.first, r.second - r.first);
 5731|  11.9M|}
_ZN7httplib6detail13parse_qualityEPKcS2_RNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERd:
 7224|  5.98M|                          double &quality) {
 7225|  5.98M|  quality = 1.0;
 7226|  5.98M|  token.clear();
 7227|       |
 7228|       |  // Split on first ';': left = token name, right = parameters
 7229|  5.98M|  const char *params_b = nullptr;
 7230|  5.98M|  std::size_t params_len = 0;
 7231|       |
 7232|  5.98M|  divide(
 7233|  5.98M|      b, static_cast<std::size_t>(e - b), ';',
 7234|  5.98M|      [&](const char *lb, std::size_t llen, const char *rb, std::size_t rlen) {
 7235|  5.98M|        auto r = trim(lb, lb + llen, 0, llen);
 7236|  5.98M|        if (r.first < r.second) { token.assign(lb + r.first, lb + r.second); }
 7237|  5.98M|        params_b = rb;
 7238|  5.98M|        params_len = rlen;
 7239|  5.98M|      });
 7240|       |
 7241|  5.98M|  if (token.empty()) { return false; }
  ------------------
  |  Branch (7241:7): [True: 552, False: 5.98M]
  ------------------
 7242|  5.98M|  if (params_len == 0) { return true; }
  ------------------
  |  Branch (7242:7): [True: 5.87M, False: 115k]
  ------------------
 7243|       |
 7244|       |  // Scan parameters for q= (stops on first match)
 7245|   115k|  bool invalid = false;
 7246|   115k|  split_find(params_b, params_b + params_len, ';',
 7247|   115k|             (std::numeric_limits<size_t>::max)(),
 7248|   115k|             [&](const char *pb, const char *pe) -> bool {
 7249|       |               // Match exactly "q=" or "Q=" (not "query=" etc.)
 7250|   115k|               auto len = static_cast<size_t>(pe - pb);
 7251|   115k|               if (len < 2) { return false; }
 7252|   115k|               if ((pb[0] != 'q' && pb[0] != 'Q') || pb[1] != '=') {
 7253|   115k|                 return false;
 7254|   115k|               }
 7255|       |
 7256|       |               // Trim the value portion
 7257|   115k|               auto r = trim(pb, pe, 2, len);
 7258|   115k|               if (r.first >= r.second) {
 7259|   115k|                 invalid = true;
 7260|   115k|                 return true;
 7261|   115k|               }
 7262|       |
 7263|   115k|               double v = 0.0;
 7264|   115k|               auto res = from_chars(pb + r.first, pb + r.second, v);
 7265|   115k|               if (res.ec != std::errc{} || v < 0.0 || v > 1.0) {
 7266|   115k|                 invalid = true;
 7267|   115k|                 return true;
 7268|   115k|               }
 7269|   115k|               quality = v;
 7270|   115k|               return true;
 7271|   115k|             });
 7272|       |
 7273|   115k|  return !invalid;
 7274|  5.98M|}
_ZN7httplib6detail6divideEPKcmcNSt3__18functionIFvS2_mS2_mEEE:
 5743|  5.98M|           fn) {
 5744|  5.98M|  const auto it = std::find(data, data + size, d);
 5745|  5.98M|  const auto found = static_cast<std::size_t>(it != data + size);
 5746|  5.98M|  const auto lhs_data = data;
 5747|  5.98M|  const auto lhs_size = static_cast<std::size_t>(it - data);
 5748|  5.98M|  const auto rhs_data = it + found;
 5749|  5.98M|  const auto rhs_size = size - lhs_size - found;
 5750|       |
 5751|  5.98M|  fn(lhs_data, lhs_size, rhs_data, rhs_size);
 5752|  5.98M|}
_ZZN7httplib6detail13parse_qualityEPKcS2_RNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERdENKUlS2_mS2_mE_clES2_mS2_m:
 7234|  5.98M|      [&](const char *lb, std::size_t llen, const char *rb, std::size_t rlen) {
 7235|  5.98M|        auto r = trim(lb, lb + llen, 0, llen);
 7236|  5.98M|        if (r.first < r.second) { token.assign(lb + r.first, lb + r.second); }
  ------------------
  |  Branch (7236:13): [True: 5.98M, False: 552]
  ------------------
 7237|  5.98M|        params_b = rb;
 7238|  5.98M|        params_len = rlen;
 7239|  5.98M|      });
_ZN7httplib6detail10split_findEPKcS2_cmNSt3__18functionIFbS2_S2_EEE:
 5789|   115k|                       std::function<bool(const char *, const char *)> fn) {
 5790|   115k|  size_t i = 0;
 5791|   115k|  size_t beg = 0;
 5792|   115k|  size_t count = 1;
 5793|       |
 5794|  24.6M|  while (e ? (b + i < e) : (b[i] != '\0')) {
  ------------------
  |  Branch (5794:10): [True: 24.6M, False: 0]
  |  Branch (5794:10): [True: 24.5M, False: 111k]
  ------------------
 5795|  24.5M|    if (b[i] == d && count < m) {
  ------------------
  |  Branch (5795:9): [True: 13.8M, False: 10.6M]
  |  Branch (5795:22): [True: 13.8M, False: 0]
  ------------------
 5796|  13.8M|      auto r = trim(b, e, beg, i);
 5797|  13.8M|      if (r.first < r.second) {
  ------------------
  |  Branch (5797:11): [True: 897k, False: 12.9M]
  ------------------
 5798|   897k|        auto found = fn(&b[r.first], &b[r.second]);
 5799|   897k|        if (found) { return true; }
  ------------------
  |  Branch (5799:13): [True: 3.62k, False: 894k]
  ------------------
 5800|   897k|      }
 5801|  13.8M|      beg = i + 1;
 5802|  13.8M|      count++;
 5803|  13.8M|    }
 5804|  24.5M|    i++;
 5805|  24.5M|  }
 5806|       |
 5807|   111k|  if (i) {
  ------------------
  |  Branch (5807:7): [True: 111k, False: 0]
  ------------------
 5808|   111k|    auto r = trim(b, e, beg, i);
 5809|   111k|    if (r.first < r.second) {
  ------------------
  |  Branch (5809:9): [True: 111k, False: 807]
  ------------------
 5810|   111k|      auto found = fn(&b[r.first], &b[r.second]);
 5811|   111k|      if (found) { return true; }
  ------------------
  |  Branch (5811:11): [True: 88.2k, False: 22.9k]
  ------------------
 5812|   111k|    }
 5813|   111k|  }
 5814|       |
 5815|  23.7k|  return false;
 5816|   111k|}
_ZZN7httplib6detail13parse_qualityEPKcS2_RNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERdENKUlS2_S2_E_clES2_S2_:
 7248|  1.00M|             [&](const char *pb, const char *pe) -> bool {
 7249|       |               // Match exactly "q=" or "Q=" (not "query=" etc.)
 7250|  1.00M|               auto len = static_cast<size_t>(pe - pb);
 7251|  1.00M|               if (len < 2) { return false; }
  ------------------
  |  Branch (7251:20): [True: 891k, False: 117k]
  ------------------
 7252|   117k|               if ((pb[0] != 'q' && pb[0] != 'Q') || pb[1] != '=') {
  ------------------
  |  Branch (7252:21): [True: 24.4k, False: 92.9k]
  |  Branch (7252:37): [True: 17.6k, False: 6.82k]
  |  Branch (7252:54): [True: 7.97k, False: 91.8k]
  ------------------
 7253|  25.6k|                 return false;
 7254|  25.6k|               }
 7255|       |
 7256|       |               // Trim the value portion
 7257|  91.8k|               auto r = trim(pb, pe, 2, len);
 7258|  91.8k|               if (r.first >= r.second) {
  ------------------
  |  Branch (7258:20): [True: 608, False: 91.2k]
  ------------------
 7259|    608|                 invalid = true;
 7260|    608|                 return true;
 7261|    608|               }
 7262|       |
 7263|  91.2k|               double v = 0.0;
 7264|  91.2k|               auto res = from_chars(pb + r.first, pb + r.second, v);
 7265|  91.2k|               if (res.ec != std::errc{} || v < 0.0 || v > 1.0) {
  ------------------
  |  Branch (7265:20): [True: 2.49k, False: 88.7k]
  |  Branch (7265:45): [True: 0, False: 88.7k]
  |  Branch (7265:56): [True: 568, False: 88.1k]
  ------------------
 7266|  3.06k|                 invalid = true;
 7267|  3.06k|                 return true;
 7268|  3.06k|               }
 7269|  88.1k|               quality = v;
 7270|  88.1k|               return true;
 7271|  91.2k|             });
_ZN7httplib6detail10from_charsEPKcS2_Rd:
  732|  91.2k|                                            double &value) {
  733|  91.2k|  value = 0.0;
  734|  91.2k|  const char *p = first;
  735|       |
  736|       |  // Each 1eN is exactly representable, so a single final division by the
  737|       |  // matching entry yields a correctly-rounded result.
  738|  91.2k|  static const double powers_of_ten[] = {
  739|  91.2k|      1e0,  1e1,  1e2,  1e3,  1e4,  1e5,  1e6,  1e7,  1e8, 1e9,
  740|  91.2k|      1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18};
  741|  91.2k|  const int max_frac_digits =
  742|  91.2k|      static_cast<int>(sizeof(powers_of_ten) / sizeof(powers_of_ten[0])) - 1;
  743|       |
  744|       |  // Accumulate digits into a 64-bit integer and remember how many were
  745|       |  // fractional. Two independent caps keep this bounded and safe:
  746|       |  //   * accumulation saturates before mantissa could overflow uint64_t, and
  747|       |  //   * frac_digits is capped at max_frac_digits so it is always a valid index
  748|       |  //     into powers_of_ten (without this an input like "0.000...0" would never
  749|       |  //     grow mantissa, so the saturation cap alone would not bound it).
  750|       |  // Both caps only drop digits far beyond the precision a q-value needs; any
  751|       |  // value they would change is well outside [0, 1] and rejected by the caller.
  752|  91.2k|  uint64_t mantissa = 0;
  753|  91.2k|  int frac_digits = 0;
  754|  91.2k|  bool seen_digit = false;
  755|       |
  756|  91.2k|  const uint64_t limit = ((std::numeric_limits<uint64_t>::max)() - 9) / 10;
  757|  91.2k|  auto accumulate = [&](char c) {
  758|  91.2k|    if (mantissa <= limit) {
  759|  91.2k|      mantissa = mantissa * 10 + static_cast<uint64_t>(c - '0');
  760|  91.2k|      return true;
  761|  91.2k|    }
  762|  91.2k|    return false;
  763|  91.2k|  };
  764|       |
  765|   184k|  for (; p != last && is_ascii_digit(*p); ++p) {
  ------------------
  |  Branch (765:10): [True: 106k, False: 77.1k]
  |  Branch (765:23): [True: 92.8k, False: 14.0k]
  ------------------
  766|  92.8k|    seen_digit = true;
  767|  92.8k|    accumulate(*p);
  768|  92.8k|  }
  769|       |
  770|  91.2k|  if (p != last && *p == '.') {
  ------------------
  |  Branch (770:7): [True: 14.0k, False: 77.1k]
  |  Branch (770:20): [True: 3.45k, False: 10.6k]
  ------------------
  771|  3.45k|    ++p;
  772|  7.94k|    for (; p != last && is_ascii_digit(*p); ++p) {
  ------------------
  |  Branch (772:12): [True: 6.83k, False: 1.10k]
  |  Branch (772:25): [True: 4.48k, False: 2.34k]
  ------------------
  773|  4.48k|      seen_digit = true;
  774|  4.48k|      if (frac_digits < max_frac_digits && accumulate(*p)) { ++frac_digits; }
  ------------------
  |  Branch (774:11): [True: 4.13k, False: 356]
  |  Branch (774:44): [True: 3.76k, False: 370]
  ------------------
  775|  4.48k|    }
  776|  3.45k|  }
  777|       |
  778|  91.2k|  if (!seen_digit) { return {first, std::errc::invalid_argument}; }
  ------------------
  |  Branch (778:7): [True: 2.49k, False: 88.7k]
  ------------------
  779|       |
  780|  88.7k|  value = static_cast<double>(mantissa) / powers_of_ten[frac_digits];
  781|  88.7k|  return {p, std::errc{}};
  782|  91.2k|}
_ZZN7httplib6detail10from_charsEPKcS2_RdENKUlcE_clEc:
  757|  97.0k|  auto accumulate = [&](char c) {
  758|  97.0k|    if (mantissa <= limit) {
  ------------------
  |  Branch (758:9): [True: 96.2k, False: 736]
  ------------------
  759|  96.2k|      mantissa = mantissa * 10 + static_cast<uint64_t>(c - '0');
  760|  96.2k|      return true;
  761|  96.2k|    }
  762|    736|    return false;
  763|  97.0k|  };
_ZZN7httplib6detail19parse_accept_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorIS7_NS5_IS7_EEEEENKUlRKZNS0_19parse_accept_headerES9_SD_E11AcceptEntrySG_E_clESG_SG_:
 8731|   153M|            [](const AcceptEntry &a, const AcceptEntry &b) {
 8732|   153M|              if (a.quality != b.quality) {
  ------------------
  |  Branch (8732:19): [True: 163k, False: 153M]
  ------------------
 8733|   163k|                return a.quality > b.quality; // Higher quality first
 8734|   163k|              }
 8735|   153M|              return a.order < b.order; // Earlier order first for same quality
 8736|   153M|            });
_ZN7httplib6detail18extract_media_typeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEE:
 7165|  5.98M|                   std::map<std::string, std::string> *params = nullptr) {
 7166|       |  // Extract type/subtype from Content-Type value (RFC 2045)
 7167|       |  // e.g. "application/json; charset=utf-8" -> "application/json"
 7168|  5.98M|  auto media_type = content_type;
 7169|  5.98M|  auto semicolon_pos = media_type.find(';');
 7170|  5.98M|  if (semicolon_pos != std::string::npos) {
  ------------------
  |  Branch (7170:7): [True: 237, False: 5.98M]
  ------------------
 7171|    237|    auto param_str = media_type.substr(semicolon_pos + 1);
 7172|    237|    media_type = media_type.substr(0, semicolon_pos);
 7173|       |
 7174|    237|    if (params) {
  ------------------
  |  Branch (7174:9): [True: 223, False: 14]
  ------------------
 7175|       |      // Parse parameters: key=value pairs separated by ';'
 7176|    223|      split(param_str.data(), param_str.data() + param_str.size(), ';',
 7177|    223|            [&](const char *b, const char *e) {
 7178|    223|              std::string key;
 7179|    223|              std::string val;
 7180|    223|              split(b, e, '=', [&](const char *b2, const char *e2) {
 7181|    223|                if (key.empty()) {
 7182|    223|                  key.assign(b2, e2);
 7183|    223|                } else {
 7184|    223|                  val.assign(b2, e2);
 7185|    223|                }
 7186|    223|              });
 7187|    223|              if (!key.empty()) {
 7188|    223|                params->emplace(trim_copy(key), trim_double_quotes_copy(val));
 7189|    223|              }
 7190|    223|            });
 7191|    223|    }
 7192|    237|  }
 7193|       |
 7194|       |  // Trim whitespace from media type
 7195|  5.98M|  return trim_copy(media_type);
 7196|  5.98M|}
_ZZN7httplib6detail18extract_media_typeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEEENKUlPKcSJ_E_clESJ_SJ_:
 7177|  23.8k|            [&](const char *b, const char *e) {
 7178|  23.8k|              std::string key;
 7179|  23.8k|              std::string val;
 7180|  23.8k|              split(b, e, '=', [&](const char *b2, const char *e2) {
 7181|  23.8k|                if (key.empty()) {
 7182|  23.8k|                  key.assign(b2, e2);
 7183|  23.8k|                } else {
 7184|  23.8k|                  val.assign(b2, e2);
 7185|  23.8k|                }
 7186|  23.8k|              });
 7187|  23.8k|              if (!key.empty()) {
  ------------------
  |  Branch (7187:19): [True: 23.2k, False: 679]
  ------------------
 7188|  23.2k|                params->emplace(trim_copy(key), trim_double_quotes_copy(val));
 7189|  23.2k|              }
 7190|  23.8k|            });
_ZZZN7httplib6detail18extract_media_typeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEEENKUlPKcSJ_E_clESJ_SJ_ENKUlSJ_SJ_E_clESJ_SJ_:
 7180|  23.9k|              split(b, e, '=', [&](const char *b2, const char *e2) {
 7181|  23.9k|                if (key.empty()) {
  ------------------
  |  Branch (7181:21): [True: 23.2k, False: 769]
  ------------------
 7182|  23.2k|                  key.assign(b2, e2);
 7183|  23.2k|                } else {
 7184|    769|                  val.assign(b2, e2);
 7185|    769|                }
 7186|  23.9k|              });
_ZN7httplib6detail23trim_double_quotes_copyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5733|   173k|inline std::string trim_double_quotes_copy(const std::string &s) {
 5734|   173k|  if (s.length() >= 2 && s.front() == '"' && s.back() == '"') {
  ------------------
  |  Branch (5734:7): [True: 67.6k, False: 105k]
  |  Branch (5734:26): [True: 949, False: 66.6k]
  |  Branch (5734:46): [True: 256, False: 693]
  ------------------
 5735|    256|    return s.substr(1, s.size() - 2);
 5736|    256|  }
 5737|   173k|  return s;
 5738|   173k|}
_ZN7httplib6detail24parse_multipart_boundaryERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERS7_:
 8572|    186|                                     std::string &boundary) {
 8573|    186|  std::map<std::string, std::string> params;
 8574|    186|  extract_media_type(content_type, &params);
 8575|    186|  auto it = params.find("boundary");
 8576|    186|  if (it == params.end()) { return false; }
  ------------------
  |  Branch (8576:7): [True: 185, False: 1]
  ------------------
 8577|      1|  boundary = it->second;
 8578|      1|  return !boundary.empty();
 8579|    186|}
_ZN7httplib6detail26insertion_ordered_multimapINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_8equal_toIS8_EEEC2Ev:
 1101|    546|  insertion_ordered_multimap() = default;
_ZN7httplib6detail24parse_disposition_paramsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS0_26insertion_ordered_multimapIS7_NS1_8equal_toIS7_EEEE:
 8581|    546|inline void parse_disposition_params(const std::string &s, Params &params) {
 8582|    546|  std::set<std::string> cache;
 8583|    546|  split(s.data(), s.data() + s.size(), ';', [&](const char *b, const char *e) {
 8584|    546|    std::string kv(b, e);
 8585|    546|    if (cache.find(kv) != cache.end()) { return; }
 8586|    546|    cache.insert(kv);
 8587|       |
 8588|    546|    std::string key;
 8589|    546|    std::string val;
 8590|    546|    split(b, e, '=', [&](const char *b2, const char *e2) {
 8591|    546|      if (key.empty()) {
 8592|    546|        key.assign(b2, e2);
 8593|    546|      } else {
 8594|    546|        val.assign(b2, e2);
 8595|    546|      }
 8596|    546|    });
 8597|       |
 8598|    546|    if (!key.empty()) {
 8599|    546|      params.emplace(trim_double_quotes_copy((key)),
 8600|    546|                     trim_double_quotes_copy((val)));
 8601|    546|    }
 8602|    546|  });
 8603|    546|}
_ZZN7httplib6detail24parse_disposition_paramsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS0_26insertion_ordered_multimapIS7_NS1_8equal_toIS7_EEEEENKUlPKcSG_E_clESG_SG_:
 8583|   114k|  split(s.data(), s.data() + s.size(), ';', [&](const char *b, const char *e) {
 8584|   114k|    std::string kv(b, e);
 8585|   114k|    if (cache.find(kv) != cache.end()) { return; }
  ------------------
  |  Branch (8585:9): [True: 39.6k, False: 75.2k]
  ------------------
 8586|  75.2k|    cache.insert(kv);
 8587|       |
 8588|  75.2k|    std::string key;
 8589|  75.2k|    std::string val;
 8590|  75.2k|    split(b, e, '=', [&](const char *b2, const char *e2) {
 8591|  75.2k|      if (key.empty()) {
 8592|  75.2k|        key.assign(b2, e2);
 8593|  75.2k|      } else {
 8594|  75.2k|        val.assign(b2, e2);
 8595|  75.2k|      }
 8596|  75.2k|    });
 8597|       |
 8598|  75.2k|    if (!key.empty()) {
  ------------------
  |  Branch (8598:9): [True: 75.0k, False: 171]
  ------------------
 8599|  75.0k|      params.emplace(trim_double_quotes_copy((key)),
 8600|  75.0k|                     trim_double_quotes_copy((val)));
 8601|  75.0k|    }
 8602|  75.2k|  });
_ZZZN7httplib6detail24parse_disposition_paramsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS0_26insertion_ordered_multimapIS7_NS1_8equal_toIS7_EEEEENKUlPKcSG_E_clESG_SG_ENKUlSG_SG_E_clESG_SG_:
 8590|  78.8k|    split(b, e, '=', [&](const char *b2, const char *e2) {
 8591|  78.8k|      if (key.empty()) {
  ------------------
  |  Branch (8591:11): [True: 75.0k, False: 3.81k]
  ------------------
 8592|  75.0k|        key.assign(b2, e2);
 8593|  75.0k|      } else {
 8594|  3.81k|        val.assign(b2, e2);
 8595|  3.81k|      }
 8596|  78.8k|    });
_ZN7httplib6detail26insertion_ordered_multimapINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_8equal_toIS8_EEE7emplaceIJS8_S8_EEENSB_10iterator_tINS2_4pairIS8_S8_EEEEDpOT_:
 1130|  75.0k|  template <typename... Args> iterator emplace(Args &&...args) {
 1131|  75.0k|    entries_.emplace_back(std::forward<Args>(args)...);
 1132|  75.0k|    return make_iter(entries_.size() - 1, npos());
 1133|  75.0k|  }
_ZN7httplib6detail26insertion_ordered_multimapINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_8equal_toIS8_EEE9make_iterEmm:
 1239|  75.0k|  iterator make_iter(size_type idx, size_type key_idx) {
 1240|  75.0k|    return iterator(entries_.data(), idx, entries_.size(), key_idx);
 1241|  75.0k|  }
_ZN7httplib6detail26insertion_ordered_multimapINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_8equal_toIS8_EEE10iterator_tINS2_4pairIS8_S8_EEEC2EPSE_mmm:
 1085|  75.0k|        : data_(data), idx_(idx), size_(size), key_idx_(key_idx) {}
_ZN7httplib6detail26insertion_ordered_multimapINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_8equal_toIS8_EEE4nposEv:
 1004|  75.0k|  static size_type npos() { return static_cast<size_type>(-1); }
_ZN7httplib6detail15parse_http_dateERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5003|      3|inline time_t parse_http_date(const std::string &date_str) {
 5004|      3|  struct tm tm_buf;
 5005|       |
 5006|       |  // Create a classic locale object once for all parsing attempts
 5007|      3|  const std::locale classic_locale = std::locale::classic();
 5008|       |
 5009|       |  // Try to parse using std::get_time (C++11, cross-platform)
 5010|      3|  auto try_parse = [&](const char *fmt) -> bool {
 5011|      3|    std::istringstream ss(date_str);
 5012|      3|    ss.imbue(classic_locale);
 5013|       |
 5014|      3|    memset(&tm_buf, 0, sizeof(tm_buf));
 5015|      3|    ss >> std::get_time(&tm_buf, fmt);
 5016|       |
 5017|      3|    return !ss.fail();
 5018|      3|  };
 5019|       |
 5020|       |  // RFC 9110 preferred format (HTTP-date): "Sun, 06 Nov 1994 08:49:37 GMT"
 5021|      3|  if (!try_parse("%a, %d %b %Y %H:%M:%S")) {
  ------------------
  |  Branch (5021:7): [True: 2, False: 1]
  ------------------
 5022|       |    // RFC 850 format: "Sunday, 06-Nov-94 08:49:37 GMT"
 5023|      2|    if (!try_parse("%A, %d-%b-%y %H:%M:%S")) {
  ------------------
  |  Branch (5023:9): [True: 2, False: 0]
  ------------------
 5024|       |      // asctime format: "Sun Nov  6 08:49:37 1994"
 5025|      2|      if (!try_parse("%a %b %d %H:%M:%S %Y")) {
  ------------------
  |  Branch (5025:11): [True: 2, False: 0]
  ------------------
 5026|      2|        return static_cast<time_t>(-1);
 5027|      2|      }
 5028|      2|    }
 5029|      2|  }
 5030|       |
 5031|       |#ifdef _WIN32
 5032|       |  return _mkgmtime(&tm_buf);
 5033|       |#elif defined _AIX
 5034|       |  return mktime(&tm_buf);
 5035|       |#else
 5036|      1|  return timegm(&tm_buf);
 5037|      3|#endif
 5038|      3|}
_ZZN7httplib6detail15parse_http_dateERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENKUlPKcE_clESB_:
 5010|      7|  auto try_parse = [&](const char *fmt) -> bool {
 5011|      7|    std::istringstream ss(date_str);
 5012|      7|    ss.imbue(classic_locale);
 5013|       |
 5014|      7|    memset(&tm_buf, 0, sizeof(tm_buf));
 5015|      7|    ss >> std::get_time(&tm_buf, fmt);
 5016|       |
 5017|      7|    return !ss.fail();
 5018|      7|  };
_ZN7httplib6detail25can_compress_content_typeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 7198|    663|inline bool can_compress_content_type(const std::string &content_type) {
 7199|    663|  using udl::operator""_t;
 7200|       |
 7201|    663|  auto mime_type = extract_media_type(content_type);
 7202|    663|  auto tag = str2tag(mime_type);
 7203|       |
 7204|    663|  switch (tag) {
 7205|      1|  case "image/svg+xml"_t:
  ------------------
  |  Branch (7205:3): [True: 1, False: 662]
  ------------------
 7206|      2|  case "application/javascript"_t:
  ------------------
  |  Branch (7206:3): [True: 1, False: 662]
  ------------------
 7207|      3|  case "application/x-javascript"_t:
  ------------------
  |  Branch (7207:3): [True: 1, False: 662]
  ------------------
 7208|      4|  case "application/json"_t:
  ------------------
  |  Branch (7208:3): [True: 1, False: 662]
  ------------------
 7209|      5|  case "application/ld+json"_t:
  ------------------
  |  Branch (7209:3): [True: 1, False: 662]
  ------------------
 7210|      6|  case "application/xml"_t:
  ------------------
  |  Branch (7210:3): [True: 1, False: 662]
  ------------------
 7211|      7|  case "application/xhtml+xml"_t:
  ------------------
  |  Branch (7211:3): [True: 1, False: 662]
  ------------------
 7212|      8|  case "application/rss+xml"_t:
  ------------------
  |  Branch (7212:3): [True: 1, False: 662]
  ------------------
 7213|      9|  case "application/atom+xml"_t:
  ------------------
  |  Branch (7213:3): [True: 1, False: 662]
  ------------------
 7214|     10|  case "application/xslt+xml"_t:
  ------------------
  |  Branch (7214:3): [True: 1, False: 662]
  ------------------
 7215|     11|  case "application/protobuf"_t: return true;
  ------------------
  |  Branch (7215:3): [True: 1, False: 662]
  ------------------
 7216|       |
 7217|      1|  case "text/event-stream"_t: return false;
  ------------------
  |  Branch (7217:3): [True: 1, False: 662]
  ------------------
 7218|       |
 7219|    651|  default: return !mime_type.rfind("text/", 0);
  ------------------
  |  Branch (7219:3): [True: 651, False: 12]
  ------------------
 7220|    663|  }
 7221|    663|}
_ZN7httplib6detail7str2tagERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 7076|    663|inline unsigned int str2tag(const std::string &s) {
 7077|       |  // Iterative form of str2tag_core: the recursive constexpr version is kept
 7078|       |  // for compile-time UDL evaluation of short string literals, but at runtime
 7079|       |  // we may receive arbitrarily long inputs (e.g. fuzzed Content-Type) that
 7080|       |  // would blow the stack with one frame per character.
 7081|    663|  unsigned int h = 0;
 7082|  5.65M|  for (auto c : s) {
  ------------------
  |  Branch (7082:15): [True: 5.65M, False: 663]
  ------------------
 7083|  5.65M|    h = (((std::numeric_limits<unsigned int>::max)() >> 6) & h * 33) ^
 7084|  5.65M|        static_cast<unsigned char>(c);
 7085|  5.65M|  }
 7086|    663|  return h;
 7087|    663|}

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

