_ZN3ada4idna13utf8_to_utf32EPKcmPDi:
  162|  2.61k|size_t utf8_to_utf32(const char* buf, size_t len, char32_t* utf32_output) {
  163|  2.61k|  const uint8_t* data = reinterpret_cast<const uint8_t*>(buf);
  164|  2.61k|  size_t pos = 0;
  165|  2.61k|  const char32_t* start{utf32_output};
  166|  28.7k|  while (pos < len) {
  ------------------
  |  Branch (166:10): [True: 26.2k, False: 2.45k]
  ------------------
  167|       |    // try to convert the next block of 16 ASCII bytes
  168|  26.2k|    if (pos + 16 <= len) {  // if it is safe to read 16 more
  ------------------
  |  Branch (168:9): [True: 9.78k, False: 16.4k]
  ------------------
  169|       |                            // bytes, check that they are ascii
  170|  9.78k|      uint64_t v1;
  171|  9.78k|      std::memcpy(&v1, data + pos, sizeof(uint64_t));
  172|  9.78k|      uint64_t v2;
  173|  9.78k|      std::memcpy(&v2, data + pos + sizeof(uint64_t), sizeof(uint64_t));
  174|  9.78k|      uint64_t v{v1 | v2};
  175|  9.78k|      if ((v & 0x8080808080808080) == 0) {
  ------------------
  |  Branch (175:11): [True: 857, False: 8.92k]
  ------------------
  176|    857|        size_t final_pos = pos + 16;
  177|  14.5k|        while (pos < final_pos) {
  ------------------
  |  Branch (177:16): [True: 13.7k, False: 857]
  ------------------
  178|  13.7k|          *utf32_output++ = char32_t(buf[pos]);
  179|  13.7k|          pos++;
  180|  13.7k|        }
  181|    857|        continue;
  182|    857|      }
  183|  9.78k|    }
  184|  25.3k|    uint8_t leading_byte = data[pos];  // leading byte
  185|  25.3k|    if (leading_byte < 0b10000000) {
  ------------------
  |  Branch (185:9): [True: 16.1k, False: 9.19k]
  ------------------
  186|       |      // converting one ASCII byte !!!
  187|  16.1k|      *utf32_output++ = char32_t(leading_byte);
  188|  16.1k|      pos++;
  189|  16.1k|    } else if ((leading_byte & 0b11100000) == 0b11000000) {
  ------------------
  |  Branch (189:16): [True: 3.05k, False: 6.14k]
  ------------------
  190|       |      // We have a two-byte UTF-8
  191|  3.05k|      if (pos + 1 >= len) {
  ------------------
  |  Branch (191:11): [True: 3, False: 3.04k]
  ------------------
  192|      3|        return 0;
  193|      3|      }  // minimal bound checking
  194|  3.04k|      if ((data[pos + 1] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (194:11): [True: 26, False: 3.02k]
  ------------------
  195|     26|        return 0;
  196|     26|      }
  197|       |      // range check
  198|  3.02k|      uint32_t code_point =
  199|  3.02k|          (leading_byte & 0b00011111) << 6 | (data[pos + 1] & 0b00111111);
  200|  3.02k|      if (code_point < 0x80 || 0x7ff < code_point) {
  ------------------
  |  Branch (200:11): [True: 2, False: 3.01k]
  |  Branch (200:32): [True: 0, False: 3.01k]
  ------------------
  201|      2|        return 0;
  202|      2|      }
  203|  3.01k|      *utf32_output++ = char32_t(code_point);
  204|  3.01k|      pos += 2;
  205|  6.14k|    } else if ((leading_byte & 0b11110000) == 0b11100000) {
  ------------------
  |  Branch (205:16): [True: 5.69k, False: 442]
  ------------------
  206|       |      // We have a three-byte UTF-8
  207|  5.69k|      if (pos + 2 >= len) {
  ------------------
  |  Branch (207:11): [True: 2, False: 5.69k]
  ------------------
  208|      2|        return 0;
  209|      2|      }  // minimal bound checking
  210|       |
  211|  5.69k|      if ((data[pos + 1] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (211:11): [True: 14, False: 5.68k]
  ------------------
  212|     14|        return 0;
  213|     14|      }
  214|  5.68k|      if ((data[pos + 2] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (214:11): [True: 4, False: 5.67k]
  ------------------
  215|      4|        return 0;
  216|      4|      }
  217|       |      // range check
  218|  5.67k|      uint32_t code_point = (leading_byte & 0b00001111) << 12 |
  219|  5.67k|                            (data[pos + 1] & 0b00111111) << 6 |
  220|  5.67k|                            (data[pos + 2] & 0b00111111);
  221|  5.67k|      if (code_point < 0x800 || 0xffff < code_point ||
  ------------------
  |  Branch (221:11): [True: 6, False: 5.67k]
  |  Branch (221:33): [True: 0, False: 5.67k]
  ------------------
  222|  5.67k|          (0xd7ff < code_point && code_point < 0xe000)) {
  ------------------
  |  Branch (222:12): [True: 1.07k, False: 4.59k]
  |  Branch (222:35): [True: 1, False: 1.07k]
  ------------------
  223|      7|        return 0;
  224|      7|      }
  225|  5.67k|      *utf32_output++ = char32_t(code_point);
  226|  5.67k|      pos += 3;
  227|  5.67k|    } else if ((leading_byte & 0b11111000) == 0b11110000) {  // 0b11110000
  ------------------
  |  Branch (227:16): [True: 372, False: 70]
  ------------------
  228|       |      // we have a 4-byte UTF-8 word.
  229|    372|      if (pos + 3 >= len) {
  ------------------
  |  Branch (229:11): [True: 10, False: 362]
  ------------------
  230|     10|        return 0;
  231|     10|      }  // minimal bound checking
  232|    362|      if ((data[pos + 1] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (232:11): [True: 8, False: 354]
  ------------------
  233|      8|        return 0;
  234|      8|      }
  235|    354|      if ((data[pos + 2] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (235:11): [True: 4, False: 350]
  ------------------
  236|      4|        return 0;
  237|      4|      }
  238|    350|      if ((data[pos + 3] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (238:11): [True: 3, False: 347]
  ------------------
  239|      3|        return 0;
  240|      3|      }
  241|       |
  242|       |      // range check
  243|    347|      uint32_t code_point = (leading_byte & 0b00000111) << 18 |
  244|    347|                            (data[pos + 1] & 0b00111111) << 12 |
  245|    347|                            (data[pos + 2] & 0b00111111) << 6 |
  246|    347|                            (data[pos + 3] & 0b00111111);
  247|    347|      if (code_point <= 0xffff || 0x10ffff < code_point) {
  ------------------
  |  Branch (247:11): [True: 5, False: 342]
  |  Branch (247:35): [True: 1, False: 341]
  ------------------
  248|      6|        return 0;
  249|      6|      }
  250|    341|      *utf32_output++ = char32_t(code_point);
  251|    341|      pos += 4;
  252|    341|    } else {
  253|     70|      return 0;
  254|     70|    }
  255|  25.3k|  }
  256|  2.45k|  return utf32_output - start;
  257|  2.61k|}
_ZN3ada4idna22utf32_length_from_utf8EPKcm:
  272|  2.62k|size_t utf32_length_from_utf8(const char* buf, size_t len) {
  273|  2.62k|  const int8_t* p = reinterpret_cast<const int8_t*>(buf);
  274|  2.62k|  return std::count_if(p, std::next(p, len), [](int8_t c) {
  275|       |    // -65 is 0b10111111, anything larger in two-complement's
  276|       |    // should start a new code point.
  277|  2.62k|    return c > -65;
  278|  2.62k|  });
  279|  2.62k|}
_ZN3ada4idna9ascii_mapEPcm:
 5338|    145|void ascii_map(char* input, size_t length) {
 5339|    145|  auto broadcast = [](uint8_t v) -> uint64_t {
 5340|    145|    return 0x101010101010101ull * v;
 5341|    145|  };
 5342|    145|  uint64_t broadcast_80 = broadcast(0x80);
 5343|    145|  uint64_t broadcast_Ap = broadcast(128 - 'A');
 5344|    145|  uint64_t broadcast_Zp = broadcast(128 - 'Z' - 1);
 5345|    145|  size_t i = 0;
 5346|       |
 5347|    480|  for (; i + 7 < length; i += 8) {
  ------------------
  |  Branch (5347:10): [True: 335, False: 145]
  ------------------
 5348|    335|    uint64_t word{};
 5349|    335|    std::memcpy(&word, input + i, sizeof(word));
 5350|    335|    word ^=
 5351|    335|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
 5352|    335|    std::memcpy(input + i, &word, sizeof(word));
 5353|    335|  }
 5354|    145|  if (i < length) {
  ------------------
  |  Branch (5354:7): [True: 119, False: 26]
  ------------------
 5355|    119|    uint64_t word{};
 5356|    119|    std::memcpy(&word, input + i, length - i);
 5357|    119|    word ^=
 5358|    119|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
 5359|    119|    std::memcpy(input + i, &word, length - i);
 5360|    119|  }
 5361|    145|}
_ZN3ada4idna3mapENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEERNS1_12basic_stringIDiS4_NS1_9allocatorIDiEEEE:
 5365|  3.48k|bool map(std::u32string_view input, std::u32string& out) {
 5366|       |  //  [Map](https://www.unicode.org/reports/tr46/#ProcessingStepMap).
 5367|  3.48k|  out.clear();
 5368|  3.48k|  if (!ensure_tables()) {
  ------------------
  |  Branch (5368:7): [True: 0, False: 3.48k]
  ------------------
 5369|      0|    return false;
 5370|      0|  }
 5371|       |
 5372|       |  // Pass 1: validate and compute exact output length.
 5373|  3.48k|  size_t out_size = 0;
 5374|  48.6k|  for (char32_t x : input) {
  ------------------
  |  Branch (5374:19): [True: 48.6k, False: 3.31k]
  ------------------
 5375|  48.6k|    uint16_t status = idna_lookup(static_cast<uint32_t>(x));
 5376|  48.6k|    if (status == IDNA_DISALLOWED) {
  ------------------
  |  Branch (5376:9): [True: 178, False: 48.4k]
  ------------------
 5377|    178|      return false;
 5378|    178|    }
 5379|  48.4k|    if (status == IDNA_VALID) {
  ------------------
  |  Branch (5379:9): [True: 37.8k, False: 10.6k]
  ------------------
 5380|  37.8k|      ++out_size;
 5381|  37.8k|      continue;
 5382|  37.8k|    }
 5383|  10.6k|    if (static_cast<size_t>(status) >= idna_utf8_mappings_size) {
  ------------------
  |  Branch (5383:9): [True: 0, False: 10.6k]
  ------------------
 5384|      0|      return false;
 5385|      0|    }
 5386|  10.6k|    out_size += utf8_count_codepoints(idna_utf8_mappings + status);
 5387|  10.6k|  }
 5388|       |
 5389|       |  // Pass 2: write into a single allocation.
 5390|  3.31k|  out.resize(out_size);
 5391|  3.31k|  size_t w = 0;
 5392|  48.3k|  for (char32_t x : input) {
  ------------------
  |  Branch (5392:19): [True: 48.3k, False: 3.31k]
  ------------------
 5393|  48.3k|    uint16_t status = idna_lookup(static_cast<uint32_t>(x));
 5394|  48.3k|    if (status == IDNA_VALID) {
  ------------------
  |  Branch (5394:9): [True: 37.7k, False: 10.6k]
  ------------------
 5395|  37.7k|      out[w++] = x;
 5396|  37.7k|      continue;
 5397|  37.7k|    }
 5398|       |    // IGNORED or mapped (status already validated in pass 1).
 5399|  10.6k|    const uint8_t* ptr = idna_utf8_mappings + status;
 5400|  56.2k|    while (*ptr != 0) {
  ------------------
  |  Branch (5400:12): [True: 45.6k, False: 10.6k]
  ------------------
 5401|  45.6k|      out[w++] = utf8_next(ptr);
 5402|  45.6k|    }
 5403|  10.6k|  }
 5404|  3.31k|  return true;
 5405|  3.48k|}
_ZN3ada4idna28compute_decomposition_lengthENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5499|    878|    const std::u32string_view input) noexcept {
 5500|    878|  bool decomposition_needed{false};
 5501|    878|  size_t additional_elements{0};
 5502|  17.3k|  for (char32_t current_character : input) {
  ------------------
  |  Branch (5502:35): [True: 17.3k, False: 878]
  ------------------
 5503|  17.3k|    size_t decomposition_length{0};
 5504|       |
 5505|  17.3k|    if (current_character >= hangul_sbase &&
  ------------------
  |  Branch (5505:9): [True: 2.08k, False: 15.2k]
  ------------------
 5506|  2.08k|        current_character < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5506:9): [True: 998, False: 1.09k]
  ------------------
 5507|       |      // Full NFD-style Hangul decomp for the decompose() step.
 5508|    998|      decomposition_length = 2;
 5509|    998|      if ((current_character - hangul_sbase) % hangul_tcount) {
  ------------------
  |  Branch (5509:11): [True: 665, False: 333]
  ------------------
 5510|    665|        decomposition_length = 3;
 5511|    665|      }
 5512|  16.3k|    } else if (current_character < 0x110000) {
  ------------------
  |  Branch (5512:16): [True: 16.3k, False: 0]
  ------------------
 5513|  16.3k|      const uint8_t di = decomposition_index[current_character >> 8];
 5514|  16.3k|      const uint16_t* const decomposition =
 5515|  16.3k|          decomposition_block_row(di) + (current_character % 256);
 5516|  16.3k|      decomposition_length = (decomposition[1] >> 2) - (decomposition[0] >> 2);
 5517|  16.3k|      if ((decomposition_length > 0) && (decomposition[0] & 1)) {
  ------------------
  |  Branch (5517:11): [True: 2.17k, False: 14.1k]
  |  Branch (5517:41): [True: 0, False: 2.17k]
  ------------------
 5518|      0|        decomposition_length = 0;
 5519|      0|      }
 5520|  16.3k|    }
 5521|  17.3k|    if (decomposition_length != 0) {
  ------------------
  |  Branch (5521:9): [True: 3.17k, False: 14.1k]
  ------------------
 5522|  3.17k|      decomposition_needed = true;
 5523|  3.17k|      additional_elements += decomposition_length - 1;
 5524|  3.17k|    }
 5525|  17.3k|  }
 5526|    878|  return {decomposition_needed, additional_elements};
 5527|    878|}
_ZN3ada4idna9decomposeERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEEm:
 5529|    568|void decompose(std::u32string& input, size_t additional_elements) {
 5530|    568|  input.resize(input.size() + additional_elements);
 5531|    568|  for (size_t descending_idx = input.size(),
 5532|    568|              input_count = descending_idx - additional_elements;
 5533|  12.0k|       input_count--;) {
  ------------------
  |  Branch (5533:8): [True: 11.4k, False: 568]
  ------------------
 5534|  11.4k|    if (input[input_count] >= hangul_sbase &&
  ------------------
  |  Branch (5534:9): [True: 1.59k, False: 9.84k]
  ------------------
 5535|  1.59k|        input[input_count] < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5535:9): [True: 998, False: 594]
  ------------------
 5536|       |      // Hangul decomposition.
 5537|    998|      char32_t s_index = input[input_count] - hangul_sbase;
 5538|    998|      if (s_index % hangul_tcount != 0) {
  ------------------
  |  Branch (5538:11): [True: 665, False: 333]
  ------------------
 5539|    665|        input[--descending_idx] = hangul_tbase + s_index % hangul_tcount;
 5540|    665|      }
 5541|    998|      input[--descending_idx] =
 5542|    998|          hangul_vbase + (s_index % hangul_ncount) / hangul_tcount;
 5543|    998|      input[--descending_idx] = hangul_lbase + s_index / hangul_ncount;
 5544|  10.4k|    } else if (input[input_count] < 0x110000) {
  ------------------
  |  Branch (5544:16): [True: 10.4k, False: 0]
  ------------------
 5545|  10.4k|      const uint16_t* decomposition =
 5546|  10.4k|          decomposition_block_row(
 5547|  10.4k|              decomposition_index[input[input_count] >> 8]) +
 5548|  10.4k|          (input[input_count] % 256);
 5549|  10.4k|      uint16_t decomposition_length =
 5550|  10.4k|          (decomposition[1] >> 2) - (decomposition[0] >> 2);
 5551|  10.4k|      if (decomposition_length > 0 && (decomposition[0] & 1)) {
  ------------------
  |  Branch (5551:11): [True: 2.17k, False: 8.26k]
  |  Branch (5551:39): [True: 0, False: 2.17k]
  ------------------
 5552|      0|        decomposition_length = 0;
 5553|      0|      }
 5554|  10.4k|      if (decomposition_length > 0) {
  ------------------
  |  Branch (5554:11): [True: 2.17k, False: 8.26k]
  ------------------
 5555|  2.17k|        const size_t base = static_cast<size_t>(decomposition[0] >> 2);
 5556|  2.17k|        if (base + decomposition_length > decomposition_data_size) {
  ------------------
  |  Branch (5556:13): [True: 0, False: 2.17k]
  ------------------
 5557|      0|          input[--descending_idx] = input[input_count];
 5558|  2.17k|        } else {
 5559|  7.20k|          while (decomposition_length-- > 0) {
  ------------------
  |  Branch (5559:18): [True: 5.02k, False: 2.17k]
  ------------------
 5560|  5.02k|            input[--descending_idx] =
 5561|  5.02k|                decomposition_data[base + decomposition_length];
 5562|  5.02k|          }
 5563|  2.17k|        }
 5564|  8.26k|      } else {
 5565|  8.26k|        input[--descending_idx] = input[input_count];
 5566|  8.26k|      }
 5567|  10.4k|    } else {
 5568|      0|      input[--descending_idx] = input[input_count];
 5569|      0|    }
 5570|  11.4k|  }
 5571|    568|}
_ZN3ada4idna7get_cccEDi:
 5573|   262k|uint8_t get_ccc(char32_t c) noexcept {
 5574|   262k|  if (c >= 0x110000) {
  ------------------
  |  Branch (5574:7): [True: 0, False: 262k]
  ------------------
 5575|      0|    return 0;
 5576|      0|  }
 5577|   262k|  return ccc_block_row(ccc_index[c >> 8])[c % 256];
 5578|   262k|}
_ZN3ada4idna10sort_marksERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 5580|    878|void sort_marks(std::u32string& input) {
 5581|  21.8k|  for (size_t idx = 1; idx < input.size(); idx++) {
  ------------------
  |  Branch (5581:24): [True: 21.0k, False: 878]
  ------------------
 5582|  21.0k|    uint8_t ccc = get_ccc(input[idx]);
 5583|  21.0k|    if (ccc == 0) {
  ------------------
  |  Branch (5583:9): [True: 15.9k, False: 5.01k]
  ------------------
 5584|  15.9k|      continue;
 5585|  15.9k|    }
 5586|  5.01k|    auto current_character = input[idx];
 5587|  5.01k|    size_t back_idx = idx;
 5588|  16.5k|    while (back_idx != 0 && get_ccc(input[back_idx - 1]) > ccc) {
  ------------------
  |  Branch (5588:12): [True: 16.4k, False: 90]
  |  Branch (5588:29): [True: 11.5k, False: 4.92k]
  ------------------
 5589|  11.5k|      input[back_idx] = input[back_idx - 1];
 5590|  11.5k|      back_idx--;
 5591|  11.5k|    }
 5592|  5.01k|    input[back_idx] = current_character;
 5593|  5.01k|  }
 5594|    878|}
_ZN3ada4idna13decompose_nfcERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 5596|    878|void decompose_nfc(std::u32string& input) {
 5597|       |  /**
 5598|       |   * Decompose the domain_name string to Unicode Normalization Form C.
 5599|       |   * @see https://www.unicode.org/reports/tr46/#ProcessingStepDecompose
 5600|       |   */
 5601|    878|  auto [decomposition_needed, additional_elements] =
 5602|    878|      compute_decomposition_length(input);
 5603|    878|  if (decomposition_needed) {
  ------------------
  |  Branch (5603:7): [True: 568, False: 310]
  ------------------
 5604|    568|    decompose(input, additional_elements);
 5605|    568|  }
 5606|    878|  sort_marks(input);
 5607|    878|}
_ZN3ada4idna14is_already_nfcENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5742|  3.63k|bool is_already_nfc(std::u32string_view input) noexcept {
 5743|  3.63k|  if (input.empty()) {
  ------------------
  |  Branch (5743:7): [True: 0, False: 3.63k]
  ------------------
 5744|      0|    return true;
 5745|      0|  }
 5746|  3.63k|  if (!tables_are_ready() && !ensure_tables()) {
  ------------------
  |  Branch (5746:7): [True: 0, False: 3.63k]
  |  Branch (5746:30): [True: 0, False: 0]
  ------------------
 5747|      0|    return false;
 5748|      0|  }
 5749|       |  // 1) A character whose canonical decomposition does not compose back to it is
 5750|       |  //    not NFC: singletons (e.g. U+212B), composition exclusions (e.g. U+0958)
 5751|       |  //    and non-starter decompositions (e.g. U+0344), or one whose
 5752|       |  //    decomposition starts with a code point that composes with the previous
 5753|       |  //    character (e.g. U+1611E U+16121).
 5754|  3.63k|  char32_t previous = 0x110000;  // none
 5755|  78.8k|  for (char32_t c : input) {
  ------------------
  |  Branch (5755:19): [True: 78.8k, False: 3.62k]
  ------------------
 5756|  78.8k|    if (decomposition_is_not_nfc(previous, c)) {
  ------------------
  |  Branch (5756:9): [True: 8, False: 78.8k]
  ------------------
 5757|      8|      return false;
 5758|      8|    }
 5759|  78.8k|    previous = c;
 5760|  78.8k|  }
 5761|       |  // 2) Combining marks already in canonical order. prev_ccc carries the
 5762|       |  //    trailing class of the previous character's canonical decomposition so a
 5763|       |  //    composite starter followed by a lower-class mark is caught.
 5764|  3.62k|  uint8_t prev_ccc = 0;
 5765|  72.4k|  for (char32_t c : input) {
  ------------------
  |  Branch (5765:19): [True: 72.4k, False: 2.52k]
  ------------------
 5766|  72.4k|    uint8_t ccc = get_ccc(c);
 5767|  72.4k|    if (ccc != 0 && prev_ccc > ccc) {
  ------------------
  |  Branch (5767:9): [True: 3.93k, False: 68.5k]
  |  Branch (5767:21): [True: 1.10k, False: 2.83k]
  ------------------
 5768|  1.10k|      return false;
 5769|  1.10k|    }
 5770|  71.3k|    prev_ccc = trailing_ccc(c);
 5771|  71.3k|  }
 5772|       |  // 3) No pairwise composition would apply (including Hangul L+V / LV+T).
 5773|  2.52k|  return !would_compose(input);
 5774|  3.62k|}
_ZN3ada4idna7composeERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 5776|  5.86k|void compose(std::u32string& input) {
 5777|       |  /**
 5778|       |   * Compose the domain_name string to Unicode Normalization Form C.
 5779|       |   * @see https://www.unicode.org/reports/tr46/#ProcessingStepCompose
 5780|       |   */
 5781|  5.86k|  size_t input_count{0};
 5782|  5.86k|  size_t composition_count{0};
 5783|  25.7k|  for (; input_count < input.size(); input_count++, composition_count++) {
  ------------------
  |  Branch (5783:10): [True: 19.9k, False: 5.86k]
  ------------------
 5784|  19.9k|    input[composition_count] = input[input_count];
 5785|  19.9k|    if (input[input_count] >= hangul_lbase &&
  ------------------
  |  Branch (5785:9): [True: 4.24k, False: 15.6k]
  ------------------
 5786|  4.24k|        input[input_count] < hangul_lbase + hangul_lcount) {
  ------------------
  |  Branch (5786:9): [True: 1.33k, False: 2.91k]
  ------------------
 5787|  1.33k|      if (input_count + 1 < input.size() &&
  ------------------
  |  Branch (5787:11): [True: 1.31k, False: 20]
  ------------------
 5788|  1.31k|          input[input_count + 1] >= hangul_vbase &&
  ------------------
  |  Branch (5788:11): [True: 1.12k, False: 195]
  ------------------
 5789|  1.12k|          input[input_count + 1] < hangul_vbase + hangul_vcount) {
  ------------------
  |  Branch (5789:11): [True: 1.03k, False: 86]
  ------------------
 5790|  1.03k|        input[composition_count] =
 5791|  1.03k|            hangul_sbase +
 5792|  1.03k|            ((input[input_count] - hangul_lbase) * hangul_vcount +
 5793|  1.03k|             input[input_count + 1] - hangul_vbase) *
 5794|  1.03k|                hangul_tcount;
 5795|  1.03k|        input_count++;
 5796|  1.03k|        if (input_count + 1 < input.size() &&
  ------------------
  |  Branch (5796:13): [True: 1.01k, False: 18]
  ------------------
 5797|  1.01k|            input[input_count + 1] > hangul_tbase &&
  ------------------
  |  Branch (5797:13): [True: 762, False: 256]
  ------------------
 5798|    762|            input[input_count + 1] < hangul_tbase + hangul_tcount) {
  ------------------
  |  Branch (5798:13): [True: 687, False: 75]
  ------------------
 5799|    687|          input[composition_count] += input[++input_count] - hangul_tbase;
 5800|    687|        }
 5801|  1.03k|      }
 5802|  18.5k|    } else if (input[input_count] >= hangul_sbase &&
  ------------------
  |  Branch (5802:16): [True: 1.49k, False: 17.0k]
  ------------------
 5803|  1.49k|               input[input_count] < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5803:16): [True: 0, False: 1.49k]
  ------------------
 5804|      0|      if ((input[input_count] - hangul_sbase) % hangul_tcount == 0 &&
  ------------------
  |  Branch (5804:11): [True: 0, False: 0]
  ------------------
 5805|      0|          input_count + 1 < input.size() &&
  ------------------
  |  Branch (5805:11): [True: 0, False: 0]
  ------------------
 5806|      0|          input[input_count + 1] > hangul_tbase &&
  ------------------
  |  Branch (5806:11): [True: 0, False: 0]
  ------------------
 5807|      0|          input[input_count + 1] < hangul_tbase + hangul_tcount) {
  ------------------
  |  Branch (5807:11): [True: 0, False: 0]
  ------------------
 5808|      0|        input[composition_count] += input[++input_count] - hangul_tbase;
 5809|      0|      }
 5810|  18.5k|    } else if (input[input_count] < 0x110000) {
  ------------------
  |  Branch (5810:16): [True: 18.5k, False: 0]
  ------------------
 5811|  18.5k|      const uint16_t* composition =
 5812|  18.5k|          composition_block_row(composition_index[input[input_count] >> 8]) +
 5813|  18.5k|          (input[input_count] % 256);
 5814|  18.5k|      size_t initial_composition_count = composition_count;
 5815|  30.2k|      for (int32_t previous_ccc = -1; input_count + 1 < input.size();
  ------------------
  |  Branch (5815:39): [True: 24.4k, False: 5.80k]
  ------------------
 5816|  24.4k|           input_count++) {
 5817|  24.4k|        uint8_t ccc = get_ccc(input[input_count + 1]);
 5818|       |
 5819|  24.4k|        if (composition[1] != composition[0] && previous_ccc < ccc) {
  ------------------
  |  Branch (5819:13): [True: 14.0k, False: 10.3k]
  |  Branch (5819:49): [True: 13.6k, False: 425]
  ------------------
 5820|  13.6k|          int left = composition[0];
 5821|  13.6k|          int right = composition[1];
 5822|  13.6k|          if (left < 0 || right < left ||
  ------------------
  |  Branch (5822:15): [True: 0, False: 13.6k]
  |  Branch (5822:27): [True: 0, False: 13.6k]
  ------------------
 5823|  13.6k|              static_cast<size_t>(right) > composition_data_size) {
  ------------------
  |  Branch (5823:15): [True: 0, False: 13.6k]
  ------------------
 5824|      0|            break;
 5825|      0|          }
 5826|  32.7k|          while (left + 2 < right) {
  ------------------
  |  Branch (5826:18): [True: 19.1k, False: 13.6k]
  ------------------
 5827|  19.1k|            int middle = left + (((right - left) >> 1) & ~1);
 5828|  19.1k|            if (composition_data[static_cast<size_t>(middle)] <=
  ------------------
  |  Branch (5828:17): [True: 10.0k, False: 9.12k]
  ------------------
 5829|  19.1k|                input[input_count + 1]) {
 5830|  10.0k|              left = middle;
 5831|  10.0k|            }
 5832|  19.1k|            if (composition_data[static_cast<size_t>(middle)] >=
  ------------------
  |  Branch (5832:17): [True: 16.4k, False: 2.69k]
  ------------------
 5833|  19.1k|                input[input_count + 1]) {
 5834|  16.4k|              right = middle;
 5835|  16.4k|            }
 5836|  19.1k|          }
 5837|  13.6k|          if (static_cast<size_t>(left + 1) < composition_data_size &&
  ------------------
  |  Branch (5837:15): [True: 13.6k, False: 0]
  ------------------
 5838|  13.6k|              composition_data[static_cast<size_t>(left)] ==
  ------------------
  |  Branch (5838:15): [True: 9.54k, False: 4.07k]
  ------------------
 5839|  13.6k|                  input[input_count + 1]) {
 5840|  9.54k|            char32_t composed = composition_data[static_cast<size_t>(left + 1)];
 5841|  9.54k|            input[initial_composition_count] = composed;
 5842|  9.54k|            composition =
 5843|  9.54k|                composition_block_row(composition_index[composed >> 8]) +
 5844|  9.54k|                (composed % 256);
 5845|  9.54k|            continue;
 5846|  9.54k|          }
 5847|  13.6k|        }
 5848|       |
 5849|  14.8k|        if (ccc == 0) {
  ------------------
  |  Branch (5849:13): [True: 12.7k, False: 2.11k]
  ------------------
 5850|  12.7k|          break;
 5851|  12.7k|        }
 5852|  2.11k|        previous_ccc = ccc;
 5853|  2.11k|        input[++composition_count] = input[input_count + 1];
 5854|  2.11k|      }
 5855|  18.5k|    }
 5856|  19.9k|  }
 5857|       |
 5858|  5.86k|  if (composition_count < input_count) {
  ------------------
  |  Branch (5858:7): [True: 5.76k, False: 95]
  ------------------
 5859|  5.76k|    input.resize(composition_count);
 5860|  5.76k|  }
 5861|  5.86k|}
_ZN3ada4idna9normalizeERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 5863|    878|bool normalize(std::u32string& input) {
 5864|       |  /**
 5865|       |   * Normalize the characters according to IDNA (Unicode Normalization Form C).
 5866|       |   * @see https://www.unicode.org/reports/tr46/#ProcessingStepNormalize
 5867|       |   */
 5868|    878|  if (!ensure_tables() || decomposition_index == nullptr ||
  ------------------
  |  Branch (5868:7): [True: 0, False: 878]
  |  Branch (5868:27): [True: 0, False: 878]
  ------------------
 5869|    878|      composition_index == nullptr) {
  ------------------
  |  Branch (5869:7): [True: 0, False: 878]
  ------------------
 5870|      0|    return false;
 5871|      0|  }
 5872|    878|  if (is_already_nfc(input)) {
  ------------------
  |  Branch (5872:7): [True: 0, False: 878]
  ------------------
 5873|      0|    return true;
 5874|      0|  }
 5875|    878|  decompose_nfc(input);
 5876|    878|  compose(input);
 5877|    878|  return true;
 5878|    878|}
_ZN3ada4idna17punycode_to_utf32ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEERNS1_12basic_stringIDiNS3_IDiEENS1_9allocatorIDiEEEE:
 5938|  1.16k|bool punycode_to_utf32(std::string_view input, std::u32string &out) {
 5939|  1.16k|  int32_t written_out{0};
 5940|  1.16k|  out.reserve(out.size() + input.size());
 5941|  1.16k|  uint32_t n = initial_n;
 5942|  1.16k|  int32_t i = 0;
 5943|  1.16k|  int32_t bias = initial_bias;
 5944|       |  // grab ascii content
 5945|       |  // RFC 3492 section 6.2: copy the code points before the last delimiter,
 5946|       |  // then consume the delimiter only "if more than zero code points were
 5947|       |  // consumed". With a leading delimiter, b == 0, decoding starts at the
 5948|       |  // delimiter itself, which is not a digit, and fails. This matches the
 5949|       |  // reference implementation in appendix C (`in = b > 0 ? b + 1 : 0`).
 5950|  1.16k|  size_t end_of_ascii = input.find_last_of('-');
 5951|  1.16k|  if (end_of_ascii != std::string_view::npos && end_of_ascii > 0) {
  ------------------
  |  Branch (5951:7): [True: 195, False: 974]
  |  Branch (5951:49): [True: 193, False: 2]
  ------------------
 5952|  1.61k|    for (uint8_t c : input.substr(0, end_of_ascii)) {
  ------------------
  |  Branch (5952:20): [True: 1.61k, False: 193]
  ------------------
 5953|  1.61k|      if (c >= 0x80) {
  ------------------
  |  Branch (5953:11): [True: 0, False: 1.61k]
  ------------------
 5954|      0|        return false;
 5955|      0|      }
 5956|  1.61k|      out.push_back(c);
 5957|  1.61k|      written_out++;
 5958|  1.61k|    }
 5959|    193|    input.remove_prefix(end_of_ascii + 1);
 5960|    193|  }
 5961|  11.3k|  while (!input.empty()) {
  ------------------
  |  Branch (5961:10): [True: 10.2k, False: 1.07k]
  ------------------
 5962|  10.2k|    int32_t oldi = i;
 5963|  10.2k|    int32_t w = 1;
 5964|  14.6k|    for (int32_t k = base;; k += base) {
 5965|  14.6k|      if (input.empty()) {
  ------------------
  |  Branch (5965:11): [True: 41, False: 14.5k]
  ------------------
 5966|     41|        return false;
 5967|     41|      }
 5968|  14.5k|      uint8_t code_point = input.front();
 5969|  14.5k|      input.remove_prefix(1);
 5970|  14.5k|      int32_t digit = char_to_digit_value(code_point);
 5971|  14.5k|      if (digit < 0) {
  ------------------
  |  Branch (5971:11): [True: 17, False: 14.5k]
  ------------------
 5972|     17|        return false;
 5973|     17|      }
 5974|  14.5k|      if (digit > (0x7fffffff - i) / w) {
  ------------------
  |  Branch (5974:11): [True: 6, False: 14.5k]
  ------------------
 5975|      6|        return false;
 5976|      6|      }
 5977|  14.5k|      i = i + digit * w;
 5978|  14.5k|      int32_t t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;
  ------------------
  |  Branch (5978:19): [True: 2.75k, False: 11.7k]
  |  Branch (5978:38): [True: 11.1k, False: 621]
  ------------------
 5979|  14.5k|      if (digit < t) {
  ------------------
  |  Branch (5979:11): [True: 10.2k, False: 4.33k]
  ------------------
 5980|  10.2k|        break;
 5981|  10.2k|      }
 5982|  4.33k|      if (w > 0x7fffffff / (base - t)) {
  ------------------
  |  Branch (5982:11): [True: 0, False: 4.33k]
  ------------------
 5983|      0|        return false;
 5984|      0|      }
 5985|  4.33k|      w = w * (base - t);
 5986|  4.33k|    }
 5987|  10.2k|    bias = adapt(i - oldi, written_out + 1, oldi == 0);
 5988|  10.2k|    if (i / (written_out + 1) > int32_t(0x7fffffff - n)) {
  ------------------
  |  Branch (5988:9): [True: 27, False: 10.1k]
  ------------------
 5989|     27|      return false;
 5990|     27|    }
 5991|  10.1k|    n = n + i / (written_out + 1);
 5992|  10.1k|    i = i % (written_out + 1);
 5993|  10.1k|    if (n < 0x80) {
  ------------------
  |  Branch (5993:9): [True: 0, False: 10.1k]
  ------------------
 5994|      0|      return false;
 5995|      0|    }
 5996|  10.1k|    out.insert(out.begin() + i, n);
 5997|  10.1k|    written_out++;
 5998|  10.1k|    ++i;
 5999|  10.1k|  }
 6000|       |  // See https://github.com/whatwg/url/issues/803
 6001|       |  // Reject labels whose decoded form begins with "xn--" (double-encoded ACE).
 6002|  1.07k|  if (out.size() >= 4 && out[0] == U'x' && out[1] == U'n' && out[2] == U'-' &&
  ------------------
  |  Branch (6002:7): [True: 481, False: 597]
  |  Branch (6002:26): [True: 117, False: 364]
  |  Branch (6002:44): [True: 91, False: 26]
  |  Branch (6002:62): [True: 46, False: 45]
  ------------------
 6003|     46|      out[3] == U'-') {
  ------------------
  |  Branch (6003:7): [True: 2, False: 44]
  ------------------
 6004|      2|    return false;
 6005|      2|  }
 6006|  1.07k|  return true;
 6007|  1.07k|}
_ZN3ada4idna17utf32_to_punycodeENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEERNS1_12basic_stringIcNS3_IcEENS1_9allocatorIcEEEE:
 6087|  3.05k|bool utf32_to_punycode(std::u32string_view input, std::string &out) {
 6088|  3.05k|  out.reserve(input.size() + out.size());
 6089|  3.05k|  uint32_t n = initial_n;
 6090|  3.05k|  int32_t d = 0;
 6091|  3.05k|  int32_t bias = initial_bias;
 6092|  3.05k|  size_t h = 0;
 6093|       |  // first push the ascii content
 6094|  16.6k|  for (uint32_t c : input) {
  ------------------
  |  Branch (6094:19): [True: 16.6k, False: 3.05k]
  ------------------
 6095|  16.6k|    if (c < 0x80) {
  ------------------
  |  Branch (6095:9): [True: 2.37k, False: 14.3k]
  ------------------
 6096|  2.37k|      ++h;
 6097|  2.37k|      out.push_back(char(c));
 6098|  2.37k|    }
 6099|  16.6k|    if (c > 0x10ffff || (c >= 0xd800 && c < 0xe000)) {
  ------------------
  |  Branch (6099:9): [True: 0, False: 16.6k]
  |  Branch (6099:26): [True: 361, False: 16.3k]
  |  Branch (6099:41): [True: 0, False: 361]
  ------------------
 6100|      0|      return false;
 6101|      0|    }
 6102|  16.6k|  }
 6103|  3.05k|  size_t b = h;
 6104|  3.05k|  if (b > 0) {
  ------------------
  |  Branch (6104:7): [True: 482, False: 2.56k]
  ------------------
 6105|    482|    out.push_back('-');
 6106|    482|  }
 6107|  14.6k|  while (h < input.size()) {
  ------------------
  |  Branch (6107:10): [True: 11.5k, False: 3.05k]
  ------------------
 6108|  11.5k|    uint32_t m = 0x10FFFF;
 6109|  87.3k|    for (auto code_point : input) {
  ------------------
  |  Branch (6109:26): [True: 87.3k, False: 11.5k]
  ------------------
 6110|  87.3k|      if (code_point >= n && code_point < m) m = code_point;
  ------------------
  |  Branch (6110:11): [True: 48.6k, False: 38.6k]
  |  Branch (6110:30): [True: 18.6k, False: 29.9k]
  ------------------
 6111|  87.3k|    }
 6112|       |
 6113|  11.5k|    if ((m - n) > (0x7fffffff - d) / (h + 1)) {
  ------------------
  |  Branch (6113:9): [True: 0, False: 11.5k]
  ------------------
 6114|      0|      return false;
 6115|      0|    }
 6116|  11.5k|    d = d + int32_t((m - n) * (h + 1));
 6117|  11.5k|    n = m;
 6118|  87.3k|    for (auto c : input) {
  ------------------
  |  Branch (6118:17): [True: 87.3k, False: 11.5k]
  ------------------
 6119|  87.3k|      if (c < n) {
  ------------------
  |  Branch (6119:11): [True: 38.6k, False: 48.6k]
  ------------------
 6120|  38.6k|        if (d == 0x7fffffff) {
  ------------------
  |  Branch (6120:13): [True: 0, False: 38.6k]
  ------------------
 6121|      0|          return false;
 6122|      0|        }
 6123|  38.6k|        ++d;
 6124|  38.6k|      }
 6125|  87.3k|      if (c == n) {
  ------------------
  |  Branch (6125:11): [True: 14.3k, False: 72.9k]
  ------------------
 6126|  14.3k|        int32_t q = d;
 6127|  29.9k|        for (int32_t k = base;; k += base) {
 6128|  29.9k|          int32_t t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;
  ------------------
  |  Branch (6128:23): [True: 6.88k, False: 23.1k]
  |  Branch (6128:42): [True: 16.6k, False: 6.45k]
  ------------------
 6129|       |
 6130|  29.9k|          if (q < t) {
  ------------------
  |  Branch (6130:15): [True: 14.3k, False: 15.6k]
  ------------------
 6131|  14.3k|            break;
 6132|  14.3k|          }
 6133|  15.6k|          out.push_back(digit_to_char(t + ((q - t) % (base - t))));
 6134|  15.6k|          q = (q - t) / (base - t);
 6135|  15.6k|        }
 6136|  14.3k|        out.push_back(digit_to_char(q));
 6137|  14.3k|        bias = adapt(d, int32_t(h + 1), h == b);
 6138|  14.3k|        d = 0;
 6139|  14.3k|        ++h;
 6140|  14.3k|      }
 6141|  87.3k|    }
 6142|  11.5k|    ++d;
 6143|  11.5k|    ++n;
 6144|  11.5k|  }
 6145|  3.05k|  return true;
 6146|  3.05k|}
_ZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 6292|  4.26k|bool is_label_valid(const std::u32string_view label) {
 6293|  4.26k|  if (label.empty()) {
  ------------------
  |  Branch (6293:7): [True: 0, False: 4.26k]
  ------------------
 6294|      0|    return true;
 6295|      0|  }
 6296|  4.26k|  if (!ensure_tables() || combining_ranges == nullptr || dir_start == nullptr ||
  ------------------
  |  Branch (6296:7): [True: 0, False: 4.26k]
  |  Branch (6296:27): [True: 0, False: 4.26k]
  |  Branch (6296:58): [True: 0, False: 4.26k]
  ------------------
 6297|  4.26k|      dir_final == nullptr || dir_value == nullptr ||
  ------------------
  |  Branch (6297:7): [True: 0, False: 4.26k]
  |  Branch (6297:31): [True: 0, False: 4.26k]
  ------------------
 6298|  4.26k|      joining_start == nullptr || joining_final == nullptr ||
  ------------------
  |  Branch (6298:7): [True: 0, False: 4.26k]
  |  Branch (6298:35): [True: 0, False: 4.26k]
  ------------------
 6299|  4.26k|      joining_value == nullptr) {
  ------------------
  |  Branch (6299:7): [True: 0, False: 4.26k]
  ------------------
 6300|      0|    return false;
 6301|      0|  }
 6302|       |
 6303|       |  ///////////////
 6304|       |  // We have a normalization step which ensures that we are in NFC.
 6305|       |  // If we receive punycode, we normalize and check that the normalized
 6306|       |  // version matches the original.
 6307|       |  // --------------------------------------
 6308|       |  // The label must be in Unicode Normalization Form NFC.
 6309|       |
 6310|       |  // Current URL standard indicatest that CheckHyphens is set to false.
 6311|       |  // ---------------------------------------
 6312|       |  // If CheckHyphens, the label must not contain a U+002D HYPHEN-MINUS character
 6313|       |  // in both the third and fourth positions. If CheckHyphens, the label must
 6314|       |  // neither begin nor end with a U+002D HYPHEN-MINUS character.
 6315|       |
 6316|       |  // This is not necessary because we segment the
 6317|       |  // labels by '.'.
 6318|       |  // ---------------------------------------
 6319|       |  // The label must not contain a U+002E ( . ) FULL STOP.
 6320|       |  // if (label.find('.') != std::string_view::npos) return false;
 6321|       |
 6322|       |  // The label must not begin with a combining mark.
 6323|       |  // Range membership via lower_bound on range end.
 6324|  4.26k|  const std::span<const uint32_t[2]> comb_span{combining_ranges,
 6325|  4.26k|                                               combining_range_count};
 6326|  4.26k|  const auto comb_it = std::ranges::lower_bound(
 6327|  4.26k|      comb_span, label.front(), {}, [](const auto& range) { return range[1]; });
 6328|  4.26k|  if (comb_it != comb_span.end() && label.front() >= (*comb_it)[0]) {
  ------------------
  |  Branch (6328:7): [True: 4.26k, False: 0]
  |  Branch (6328:7): [True: 80, False: 4.18k]
  |  Branch (6328:37): [True: 80, False: 4.18k]
  ------------------
 6329|     80|    return false;
 6330|     80|  }
 6331|       |  // We verify this next step as part of the mapping:
 6332|       |  // ---------------------------------------------
 6333|       |  // Each code point in the label must only have certain status values
 6334|       |  // according to Section 5, IDNA Mapping Table:
 6335|       |  // - For Transitional Processing, each value must be valid.
 6336|       |  // - For Nontransitional Processing, each value must be either valid or
 6337|       |  // deviation.
 6338|       |
 6339|       |  // If CheckJoiners, the label must satisfy the ContextJ rules from Appendix
 6340|       |  // A, in The Unicode Code Points and Internationalized Domain Names for
 6341|       |  // Applications (IDNA) [IDNA2008].
 6342|  4.18k|  if (!is_contextj_valid(label)) {
  ------------------
  |  Branch (6342:7): [True: 146, False: 4.03k]
  ------------------
 6343|    146|    return false;
 6344|    146|  }
 6345|       |
 6346|       |  // If CheckBidi, and if the domain name is a  Bidi domain name, then the label
 6347|       |  // must satisfy all six of the numbered conditions in [IDNA2008] RFC 5893,
 6348|       |  // Section 2.
 6349|       |
 6350|       |  // The following rule, consisting of six conditions, applies to labels
 6351|       |  // in Bidi domain names.  The requirements that this rule satisfies are
 6352|       |  // described in Section 3.  All of the conditions must be satisfied for
 6353|       |  // the rule to be satisfied.
 6354|       |  //
 6355|       |  //  1.  The first character must be a character with Bidi property L, R,
 6356|       |  //     or AL.  If it has the R or AL property, it is an RTL label; if it
 6357|       |  //     has the L property, it is an LTR label.
 6358|       |  //
 6359|       |  //  2.  In an RTL label, only characters with the Bidi properties R, AL,
 6360|       |  //      AN, EN, ES, CS, ET, ON, BN, or NSM are allowed.
 6361|       |  //
 6362|       |  //   3.  In an RTL label, the end of the label must be a character with
 6363|       |  //       Bidi property R, AL, EN, or AN, followed by zero or more
 6364|       |  //       characters with Bidi property NSM.
 6365|       |  //
 6366|       |  //   4.  In an RTL label, if an EN is present, no AN may be present, and
 6367|       |  //       vice versa.
 6368|       |  //
 6369|       |  //  5.  In an LTR label, only characters with the Bidi properties L, EN,
 6370|       |  //       ES, CS, ET, ON, BN, or NSM are allowed.
 6371|       |  //
 6372|       |  //   6.  In an LTR label, the end of the label must be a character with
 6373|       |  //       Bidi property L or EN, followed by zero or more characters with
 6374|       |  //       Bidi property NSM.
 6375|       |
 6376|  4.03k|  size_t last_non_nsm_char = find_last_not_of_nsm(label);
 6377|  4.03k|  if (last_non_nsm_char == std::u32string_view::npos) {
  ------------------
  |  Branch (6377:7): [True: 0, False: 4.03k]
  ------------------
 6378|      0|    return false;
 6379|      0|  }
 6380|       |
 6381|       |  // A "Bidi domain name" is a domain name that contains at least one RTL label.
 6382|       |  // The following rule, consisting of six conditions, applies to labels in Bidi
 6383|       |  // domain names.
 6384|  4.03k|  if (is_rtl_label(label)) {
  ------------------
  |  Branch (6384:7): [True: 935, False: 3.09k]
  ------------------
 6385|       |    // The first character must be a character with Bidi property L, R,
 6386|       |    // or AL. If it has the R or AL property, it is an RTL label; if it
 6387|       |    // has the L property, it is an LTR label.
 6388|       |
 6389|    935|    if (find_direction(label[0]) == direction::L) {
  ------------------
  |  Branch (6389:9): [True: 115, False: 820]
  ------------------
 6390|       |      // Eval as LTR
 6391|       |
 6392|       |      // In an LTR label, only characters with the Bidi properties L, EN,
 6393|       |      // ES, CS, ET, ON, BN, or NSM are allowed.
 6394|  1.20k|      for (size_t i = 0; i <= last_non_nsm_char; i++) {
  ------------------
  |  Branch (6394:26): [True: 1.20k, False: 0]
  ------------------
 6395|  1.20k|        const direction d = find_direction(label[i]);
 6396|  1.20k|        if (!(d == direction::L || d == direction::EN || d == direction::ES ||
  ------------------
  |  Branch (6396:15): [True: 464, False: 739]
  |  Branch (6396:36): [True: 82, False: 657]
  |  Branch (6396:58): [True: 102, False: 555]
  ------------------
 6397|    555|              d == direction::CS || d == direction::ET || d == direction::ON ||
  ------------------
  |  Branch (6397:15): [True: 103, False: 452]
  |  Branch (6397:37): [True: 70, False: 382]
  |  Branch (6397:59): [True: 88, False: 294]
  ------------------
 6398|    294|              d == direction::BN || d == direction::NSM)) {
  ------------------
  |  Branch (6398:15): [True: 110, False: 184]
  |  Branch (6398:37): [True: 69, False: 115]
  ------------------
 6399|    115|          return false;
 6400|    115|        }
 6401|  1.20k|      }
 6402|       |
 6403|      0|      const direction last_dir = find_direction(label[last_non_nsm_char]);
 6404|      0|      if (!(last_dir == direction::L || last_dir == direction::EN)) {
  ------------------
  |  Branch (6404:13): [True: 0, False: 0]
  |  Branch (6404:41): [True: 0, False: 0]
  ------------------
 6405|      0|        return false;
 6406|      0|      }
 6407|       |
 6408|      0|      return true;
 6409|       |
 6410|    820|    } else {
 6411|       |      // Eval as RTL
 6412|       |
 6413|       |      // The first character must be R or AL; a leading AN (or any other
 6414|       |      // direction) does not start a valid RTL label.
 6415|    820|      const direction first_dir = find_direction(label[0]);
 6416|    820|      if (first_dir != direction::R && first_dir != direction::AL) {
  ------------------
  |  Branch (6416:11): [True: 551, False: 269]
  |  Branch (6416:40): [True: 29, False: 522]
  ------------------
 6417|     29|        return false;
 6418|     29|      }
 6419|       |
 6420|    791|      bool has_an = false;
 6421|    791|      bool has_en = false;
 6422|  3.55k|      for (size_t i = 0; i <= last_non_nsm_char; i++) {
  ------------------
  |  Branch (6422:26): [True: 2.88k, False: 672]
  ------------------
 6423|  2.88k|        const direction d = find_direction(label[i]);
 6424|       |
 6425|       |        // In an RTL label, if an EN is present, no AN may be present, and vice
 6426|       |        // versa.
 6427|  2.88k|        if ((d == direction::EN && ((has_en = true) && has_an)) ||
  ------------------
  |  Branch (6427:14): [True: 218, False: 2.66k]
  |  Branch (6427:37): [True: 218, False: 0]
  |  Branch (6427:56): [True: 1, False: 217]
  ------------------
 6428|  2.88k|            (d == direction::AN && ((has_an = true) && has_en))) {
  ------------------
  |  Branch (6428:14): [True: 109, False: 2.77k]
  |  Branch (6428:37): [True: 109, False: 0]
  |  Branch (6428:56): [True: 1, False: 108]
  ------------------
 6429|      2|          return false;
 6430|      2|        }
 6431|       |
 6432|  2.88k|        if (!(d == direction::R || d == direction::AL || d == direction::AN ||
  ------------------
  |  Branch (6432:15): [True: 461, False: 2.42k]
  |  Branch (6432:36): [True: 1.38k, False: 1.03k]
  |  Branch (6432:58): [True: 108, False: 929]
  ------------------
 6433|    929|              d == direction::EN || d == direction::ES || d == direction::CS ||
  ------------------
  |  Branch (6433:15): [True: 217, False: 712]
  |  Branch (6433:37): [True: 67, False: 645]
  |  Branch (6433:59): [True: 74, False: 571]
  ------------------
 6434|    571|              d == direction::ET || d == direction::ON || d == direction::BN ||
  ------------------
  |  Branch (6434:15): [True: 86, False: 485]
  |  Branch (6434:37): [True: 96, False: 389]
  |  Branch (6434:59): [True: 187, False: 202]
  ------------------
 6435|    202|              d == direction::NSM)) {
  ------------------
  |  Branch (6435:15): [True: 130, False: 72]
  ------------------
 6436|     72|          return false;
 6437|     72|        }
 6438|       |
 6439|  2.80k|        if (i == last_non_nsm_char &&
  ------------------
  |  Branch (6439:13): [True: 717, False: 2.09k]
  ------------------
 6440|    717|            !(d == direction::R || d == direction::AL || d == direction::AN ||
  ------------------
  |  Branch (6440:15): [True: 207, False: 510]
  |  Branch (6440:36): [True: 357, False: 153]
  |  Branch (6440:58): [True: 40, False: 113]
  ------------------
 6441|    113|              d == direction::EN)) {
  ------------------
  |  Branch (6441:15): [True: 68, False: 45]
  ------------------
 6442|     45|          return false;
 6443|     45|        }
 6444|  2.80k|      }
 6445|       |
 6446|    672|      return true;
 6447|    791|    }
 6448|    935|  }
 6449|       |
 6450|  3.09k|  return true;
 6451|  4.03k|}
_ZN3ada4idna8to_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEERNS1_12basic_stringIcS4_NS1_9allocatorIcEEEE:
 6610|  2.76k|[[nodiscard]] bool to_ascii(std::string_view ut8_string, std::string& out) {
 6611|  2.76k|  out.clear();
 6612|       |  // The ASCII path is a single same-size copy, so it needs no length bound.
 6613|       |  // Checking first would reject the (longer) ASCII output of a non-ASCII input
 6614|       |  // that was accepted, breaking to_ascii(to_ascii(x)) == to_ascii(x).
 6615|  2.76k|  if (is_ascii(ut8_string)) {
  ------------------
  |  Branch (6615:7): [True: 145, False: 2.62k]
  ------------------
 6616|    145|    from_ascii_to_ascii(ut8_string, out);
 6617|    145|    return true;
 6618|    145|  }
 6619|  2.62k|  if (ut8_string.size() > max_domain_input_bytes) {
  ------------------
  |  Branch (6619:7): [True: 0, False: 2.62k]
  ------------------
 6620|      0|    return false;
 6621|      0|  }
 6622|       |
 6623|       |#ifdef ADA_USE_SIMDUTF
 6624|       |  size_t utf32_length =
 6625|       |      simdutf::utf32_length_from_utf8(ut8_string.data(), ut8_string.size());
 6626|       |  if (utf32_length == 0 && !ut8_string.empty()) {
 6627|       |    return false;
 6628|       |  }
 6629|       |  std::u32string working(utf32_length, U'\0');
 6630|       |  size_t actual_utf32_length = simdutf::convert_utf8_to_utf32(
 6631|       |      ut8_string.data(), ut8_string.size(), working.data());
 6632|       |#else
 6633|  2.62k|  size_t utf32_length =
 6634|  2.62k|      ada::idna::utf32_length_from_utf8(ut8_string.data(), ut8_string.size());
 6635|  2.62k|  if (utf32_length == 0 && !ut8_string.empty()) {
  ------------------
  |  Branch (6635:7): [True: 4, False: 2.61k]
  |  Branch (6635:28): [True: 4, False: 0]
  ------------------
 6636|      4|    return false;
 6637|      4|  }
 6638|  2.61k|  std::u32string working(utf32_length, U'\0');
 6639|  2.61k|  size_t actual_utf32_length = ada::idna::utf8_to_utf32(
 6640|  2.61k|      ut8_string.data(), ut8_string.size(), working.data());
 6641|  2.61k|#endif
 6642|  2.61k|  if (actual_utf32_length == 0 || actual_utf32_length != utf32_length) {
  ------------------
  |  Branch (6642:7): [True: 159, False: 2.45k]
  |  Branch (6642:35): [True: 0, False: 2.45k]
  ------------------
 6643|    159|    return false;
 6644|    159|  }
 6645|  2.45k|  working.resize(actual_utf32_length);
 6646|       |
 6647|       |  // Map into a second buffer with exact sizing (no growth reallocs).
 6648|  2.45k|  std::u32string mapped;
 6649|  2.45k|  if (!ada::idna::map(working, mapped)) {
  ------------------
  |  Branch (6649:7): [True: 36, False: 2.42k]
  ------------------
 6650|     36|    return false;
 6651|     36|  }
 6652|       |  // Drop UTF-32 input; reuse `working` as scratch for ACE validation below.
 6653|  2.42k|  working.clear();
 6654|       |
 6655|       |  // Skip NFC when already normalized (ASCII is a fast subset of this check).
 6656|  2.42k|  if (!is_ascii(mapped) && !is_already_nfc(mapped)) {
  ------------------
  |  Branch (6656:7): [True: 1.91k, False: 505]
  |  Branch (6656:28): [True: 449, False: 1.46k]
  ------------------
 6657|    449|    if (!normalize(mapped)) {
  ------------------
  |  Branch (6657:9): [True: 0, False: 449]
  ------------------
 6658|      0|      return false;
 6659|      0|    }
 6660|    449|  }
 6661|       |
 6662|       |  // Estimate ASCII output size (punycode may expand non-ASCII labels).
 6663|  2.42k|  out.reserve(mapped.size() + 8);
 6664|       |
 6665|       |  // Walk labels with a single pointer scan (no repeated string::find).
 6666|  2.42k|  const char32_t* p = mapped.data();
 6667|  2.42k|  const char32_t* const end = p + mapped.size();
 6668|  2.42k|  std::u32string post_map;
 6669|       |
 6670|  8.05k|  while (p < end) {
  ------------------
  |  Branch (6670:10): [True: 6.56k, False: 1.49k]
  ------------------
 6671|  6.56k|    const char32_t* label_begin = p;
 6672|  65.3k|    while (p < end && *p != U'.') {
  ------------------
  |  Branch (6672:12): [True: 63.9k, False: 1.47k]
  |  Branch (6672:23): [True: 58.8k, False: 5.08k]
  ------------------
 6673|  58.8k|      ++p;
 6674|  58.8k|    }
 6675|  6.56k|    const size_t label_size = static_cast<size_t>(p - label_begin);
 6676|  6.56k|    std::u32string_view label_view(label_begin, label_size);
 6677|  6.56k|    const bool is_last_label = (p == end);
 6678|  6.56k|    if (p < end) {
  ------------------
  |  Branch (6678:9): [True: 5.08k, False: 1.47k]
  ------------------
 6679|  5.08k|      ++p;  // skip dot
 6680|  5.08k|    }
 6681|       |
 6682|  6.56k|    if (label_size == 0) {
  ------------------
  |  Branch (6682:9): [True: 257, False: 6.30k]
  ------------------
 6683|       |      // empty label
 6684|  6.30k|    } else if (is_ace_prefix(label_view)) {
  ------------------
  |  Branch (6684:16): [True: 1.18k, False: 5.12k]
  ------------------
 6685|  21.4k|      for (char32_t c : label_view) {
  ------------------
  |  Branch (6685:23): [True: 21.4k, False: 1.16k]
  ------------------
 6686|  21.4k|        if (c >= 0x80) {
  ------------------
  |  Branch (6686:13): [True: 12, False: 21.3k]
  ------------------
 6687|     12|          out.clear();
 6688|     12|          return false;
 6689|     12|        }
 6690|  21.4k|      }
 6691|  1.16k|      append_ascii_label(out, label_view);
 6692|  1.16k|      std::string_view puny_segment_ascii(
 6693|  1.16k|          out.data() + (out.size() - label_size) + 4, label_size - 4);
 6694|  1.16k|      working.clear();
 6695|  1.16k|      if (!ada::idna::punycode_to_utf32(puny_segment_ascii, working)) {
  ------------------
  |  Branch (6695:11): [True: 93, False: 1.07k]
  ------------------
 6696|     93|        out.clear();
 6697|     93|        return false;
 6698|     93|      }
 6699|  1.07k|      if (is_ascii(working)) {
  ------------------
  |  Branch (6699:11): [True: 46, False: 1.03k]
  ------------------
 6700|     46|        out.clear();
 6701|     46|        return false;
 6702|     46|      }
 6703|  1.03k|      if (!ada::idna::map(working, post_map) || working != post_map) {
  ------------------
  |  Branch (6703:11): [True: 142, False: 888]
  |  Branch (6703:49): [True: 52, False: 836]
  ------------------
 6704|    194|        out.clear();
 6705|    194|        return false;
 6706|    194|      }
 6707|       |      // Mapping must be stable; NFC must not change the mapped form either.
 6708|    836|      if (!is_ascii(post_map) && !is_already_nfc(post_map)) {
  ------------------
  |  Branch (6708:11): [True: 836, False: 0]
  |  Branch (6708:34): [True: 429, False: 407]
  ------------------
 6709|    429|        if (!normalize(post_map) || post_map != working) {
  ------------------
  |  Branch (6709:13): [True: 0, False: 429]
  |  Branch (6709:37): [True: 97, False: 332]
  ------------------
 6710|     97|          out.clear();
 6711|     97|          return false;
 6712|     97|        }
 6713|    429|      }
 6714|    739|      if (post_map.empty() || !is_label_valid(post_map)) {
  ------------------
  |  Branch (6714:11): [True: 0, False: 739]
  |  Branch (6714:31): [True: 18, False: 721]
  ------------------
 6715|     18|        out.clear();
 6716|     18|        return false;
 6717|     18|      }
 6718|  5.12k|    } else if (is_ascii(label_view)) {
  ------------------
  |  Branch (6718:16): [True: 1.60k, False: 3.52k]
  ------------------
 6719|  1.60k|      append_ascii_label(out, label_view);
 6720|  3.52k|    } else {
 6721|  3.52k|      if (!is_label_valid(label_view)) {
  ------------------
  |  Branch (6721:11): [True: 471, False: 3.05k]
  ------------------
 6722|    471|        out.clear();
 6723|    471|        return false;
 6724|    471|      }
 6725|  3.05k|      out.append("xn--");
 6726|  3.05k|      if (!ada::idna::utf32_to_punycode(label_view, out)) {
  ------------------
  |  Branch (6726:11): [True: 0, False: 3.05k]
  ------------------
 6727|      0|        out.clear();
 6728|      0|        return false;
 6729|      0|      }
 6730|  3.05k|    }
 6731|  5.63k|    if (!is_last_label) {
  ------------------
  |  Branch (6731:9): [True: 4.16k, False: 1.46k]
  ------------------
 6732|  4.16k|      out.push_back('.');
 6733|  4.16k|    }
 6734|  5.63k|  }
 6735|  1.49k|  return true;
 6736|  2.42k|}
_ZN3ada4idna8to_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6738|  2.76k|std::string to_ascii(std::string_view ut8_string) {
 6739|  2.76k|  std::string out;
 6740|  2.76k|  if (!to_ascii(ut8_string, out)) {
  ------------------
  |  Branch (6740:7): [True: 1.13k, False: 1.63k]
  ------------------
 6741|  1.13k|    return {};
 6742|  1.13k|  }
 6743|  1.63k|  return out;
 6744|  2.76k|}
_ZN3ada7unicode14percent_encodeILb1EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKhRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEE:
 7618|  43.5k|                    std::string& out) {
 7619|  43.5k|  ada_log("percent_encode ", input, " to output string while ",
 7620|  43.5k|          append ? "appending" : "overwriting");
 7621|  43.5k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7622|  43.5k|    return character_sets::bit_at(character_set, c);
 7623|  43.5k|  });
 7624|  43.5k|  ada_log("percent_encode done checking, moved to ",
 7625|  43.5k|          std::distance(input.begin(), pointer));
 7626|       |
 7627|       |  // Optimization: Don't iterate if percent encode is not required
 7628|  43.5k|  if (pointer == input.end()) {
  ------------------
  |  Branch (7628:7): [True: 41.3k, False: 2.25k]
  ------------------
 7629|  41.3k|    ada_log("percent_encode encoding not needed.");
 7630|  41.3k|    return false;
 7631|  41.3k|  }
 7632|       |  if constexpr (!append) {
 7633|       |    out.clear();
 7634|       |  }
 7635|  2.25k|  ada_log("percent_encode appending ", std::distance(input.begin(), pointer),
 7636|  2.25k|          " bytes");
 7637|       |  // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
 7638|  2.25k|  out.append(input.data(), std::distance(input.begin(), pointer));
 7639|  2.25k|  ada_log("percent_encode processing ", std::distance(pointer, input.end()),
 7640|  2.25k|          " bytes");
 7641|  52.5k|  for (; pointer != input.end(); pointer++) {
  ------------------
  |  Branch (7641:10): [True: 50.3k, False: 2.25k]
  ------------------
 7642|  50.3k|    if (character_sets::bit_at(character_set, *pointer)) {
  ------------------
  |  Branch (7642:9): [True: 26.4k, False: 23.8k]
  ------------------
 7643|  26.4k|      out.append(character_sets::hex + uint8_t(*pointer) * 4, 3);
 7644|  26.4k|    } else {
 7645|  23.8k|      out += *pointer;
 7646|  23.8k|    }
 7647|  50.3k|  }
 7648|  2.25k|  return true;
 7649|  43.5k|}
_ZN3ada7unicode14percent_encodeILb0EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKhRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEE:
 7618|  46.3k|                    std::string& out) {
 7619|  46.3k|  ada_log("percent_encode ", input, " to output string while ",
 7620|  46.3k|          append ? "appending" : "overwriting");
 7621|  46.3k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7622|  46.3k|    return character_sets::bit_at(character_set, c);
 7623|  46.3k|  });
 7624|  46.3k|  ada_log("percent_encode done checking, moved to ",
 7625|  46.3k|          std::distance(input.begin(), pointer));
 7626|       |
 7627|       |  // Optimization: Don't iterate if percent encode is not required
 7628|  46.3k|  if (pointer == input.end()) {
  ------------------
  |  Branch (7628:7): [True: 43.1k, False: 3.19k]
  ------------------
 7629|  43.1k|    ada_log("percent_encode encoding not needed.");
 7630|  43.1k|    return false;
 7631|  43.1k|  }
 7632|  3.19k|  if constexpr (!append) {
 7633|  3.19k|    out.clear();
 7634|  3.19k|  }
 7635|  3.19k|  ada_log("percent_encode appending ", std::distance(input.begin(), pointer),
 7636|  3.19k|          " bytes");
 7637|       |  // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
 7638|  3.19k|  out.append(input.data(), std::distance(input.begin(), pointer));
 7639|  3.19k|  ada_log("percent_encode processing ", std::distance(pointer, input.end()),
 7640|  3.19k|          " bytes");
 7641|  57.6k|  for (; pointer != input.end(); pointer++) {
  ------------------
  |  Branch (7641:10): [True: 54.4k, False: 3.19k]
  ------------------
 7642|  54.4k|    if (character_sets::bit_at(character_set, *pointer)) {
  ------------------
  |  Branch (7642:9): [True: 30.6k, False: 23.7k]
  ------------------
 7643|  30.6k|      out.append(character_sets::hex + uint8_t(*pointer) * 4, 3);
 7644|  30.6k|    } else {
 7645|  23.7k|      out += *pointer;
 7646|  23.7k|    }
 7647|  54.4k|  }
 7648|  3.19k|  return true;
 7649|  46.3k|}
_ZN3ada7unicode14percent_decodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEm:
 7449|  1.03k|std::string percent_decode(const std::string_view input, size_t first_percent) {
 7450|       |  // next line is for safety only, we expect users to avoid calling
 7451|       |  // percent_decode when first_percent is outside the range.
 7452|  1.03k|  if (first_percent == std::string_view::npos) {
  ------------------
  |  Branch (7452:7): [True: 0, False: 1.03k]
  ------------------
 7453|      0|    return std::string(input);
 7454|      0|  }
 7455|       |
 7456|       |  // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
 7457|  1.03k|  const char* const src = input.data();
 7458|  1.03k|  const char* const end = src + input.size();
 7459|       |
 7460|       |  // Decoding never grows the string, so a single pre-sized buffer written via
 7461|       |  // bulk memcpy of the plain runs (then shrunk to the final length) avoids the
 7462|       |  // byte-at-a-time appends of the naive version.
 7463|  1.03k|  std::string out(input.size(), '\0');
 7464|  1.03k|  char* d = out.data();
 7465|  1.03k|  char* const d0 = d;
 7466|       |
 7467|  1.03k|  std::memcpy(d, src, first_percent);
 7468|  1.03k|  d += first_percent;
 7469|       |
 7470|  1.03k|  const char* p = src + first_percent;
 7471|  5.66k|  while (p < end) {
  ------------------
  |  Branch (7471:10): [True: 4.63k, False: 1.03k]
  ------------------
 7472|  4.63k|    if (*p == '%') {
  ------------------
  |  Branch (7472:9): [True: 2.93k, False: 1.70k]
  ------------------
 7473|       |      // Decode runs of valid %XX tightly (common for nested/encoded URLs).
 7474|  7.80k|      while (p + 2 < end && *p == '%') {
  ------------------
  |  Branch (7474:14): [True: 7.22k, False: 575]
  |  Branch (7474:29): [True: 6.45k, False: 770]
  ------------------
 7475|  6.45k|        if (!is_ascii_hex_digit(p[1]) || !is_ascii_hex_digit(p[2])) {
  ------------------
  |  Branch (7475:13): [True: 1.06k, False: 5.39k]
  |  Branch (7475:42): [True: 528, False: 4.86k]
  ------------------
 7476|  1.59k|          break;
 7477|  1.59k|        }
 7478|  4.86k|        *d++ = static_cast<char>(convert_hex_to_binary(p[1]) * 16 +
 7479|  4.86k|                                 convert_hex_to_binary(p[2]));
 7480|  4.86k|        p += 3;
 7481|  4.86k|      }
 7482|  2.93k|      if (p < end && *p == '%') {
  ------------------
  |  Branch (7482:11): [True: 2.62k, False: 308]
  |  Branch (7482:22): [True: 1.73k, False: 893]
  ------------------
 7483|       |        // Not a valid escape (too few chars left or bad hex): copy '%'
 7484|       |        // literally and keep scanning after it.
 7485|  1.73k|        *d++ = *p++;
 7486|  1.73k|      }
 7487|  2.93k|    } else {
 7488|  1.70k|      const char* q = static_cast<const char*>(
 7489|  1.70k|          std::memchr(p, '%', static_cast<size_t>(end - p)));
 7490|  1.70k|      const char* run_end = q ? q : end;
  ------------------
  |  Branch (7490:29): [True: 1.06k, False: 637]
  ------------------
 7491|  1.70k|      const size_t n = static_cast<size_t>(run_end - p);
 7492|  1.70k|      std::memcpy(d, p, n);
 7493|  1.70k|      d += n;
 7494|  1.70k|      p = run_end;
 7495|  1.70k|    }
 7496|  4.63k|  }
 7497|       |
 7498|  1.03k|  out.resize(static_cast<size_t>(d - d0));
 7499|  1.03k|  return out;
 7500|  1.03k|}
_ZN3ada7unicode14percent_encodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKh:
 7588|  51.6k|                           const uint8_t character_set[]) {
 7589|  51.6k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7590|  51.6k|    return character_sets::bit_at(character_set, c);
 7591|  51.6k|  });
 7592|       |  // Optimization: Don't iterate if percent encode is not required
 7593|  51.6k|  if (pointer == input.end()) {
  ------------------
  |  Branch (7593:7): [True: 49.0k, False: 2.65k]
  ------------------
 7594|  49.0k|    return std::string(input);
 7595|  49.0k|  }
 7596|       |
 7597|  2.65k|  std::string result;
 7598|  2.65k|  result.reserve(input.length());  // in the worst case, percent encoding might
 7599|       |                                   // produce 3 characters.
 7600|  2.65k|  result.append(input.substr(0, std::distance(input.begin(), pointer)));
 7601|  2.65k|  if (static_cast<size_t>(input.end() - pointer) >= 48) {
  ------------------
  |  Branch (7601:7): [True: 491, False: 2.16k]
  ------------------
 7602|    491|    percent_encode_suffix(&*pointer, input.data() + input.size(), character_set,
 7603|    491|                          result);
 7604|  2.16k|  } else {
 7605|  25.6k|    for (; pointer != input.end(); pointer++) {
  ------------------
  |  Branch (7605:12): [True: 23.4k, False: 2.16k]
  ------------------
 7606|  23.4k|      if (character_sets::bit_at(character_set, *pointer)) {
  ------------------
  |  Branch (7606:11): [True: 14.0k, False: 9.39k]
  ------------------
 7607|  14.0k|        result.append(character_sets::hex + uint8_t(*pointer) * 4, 3);
 7608|  14.0k|      } else {
 7609|  9.39k|        result += *pointer;
 7610|  9.39k|      }
 7611|  23.4k|    }
 7612|  2.16k|  }
 7613|  2.65k|  return result;
 7614|  51.6k|}
_ZN3ada7unicode8to_asciiERNSt3__18optionalINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEENS1_17basic_string_viewIcS5_EEm:
 7659|  2.76k|              size_t first_percent) {
 7660|  2.76k|  std::string percent_decoded_buffer;
 7661|  2.76k|  std::string_view input = plain;
 7662|  2.76k|  if (first_percent != std::string_view::npos) {
  ------------------
  |  Branch (7662:7): [True: 126, False: 2.64k]
  ------------------
 7663|    126|    percent_decoded_buffer = unicode::percent_decode(plain, first_percent);
 7664|    126|    input = percent_decoded_buffer;
 7665|    126|  }
 7666|       |  // input is a non-empty UTF-8 string, must be percent decoded
 7667|  2.76k|  std::string idna_ascii = ada::idna::to_ascii(input);
 7668|  2.76k|  if (idna_ascii.empty() || contains_forbidden_domain_code_point(
  ------------------
  |  Branch (7668:7): [True: 1.13k, False: 1.63k]
  |  Branch (7668:29): [True: 204, False: 1.43k]
  ------------------
 7669|  1.63k|                                idna_ascii.data(), idna_ascii.size())) {
 7670|  1.33k|    return false;
 7671|  1.33k|  }
 7672|  1.43k|  out = std::move(idna_ascii);
 7673|  1.43k|  return true;
 7674|  2.76k|}
_ZN3ada7unicode14percent_encodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKhm:
 7677|  42.7k|                           const uint8_t character_set[], size_t index) {
 7678|  42.7k|  std::string out;
 7679|       |  // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
 7680|  42.7k|  out.append(input.data(), index);
 7681|  42.7k|  auto pointer = input.begin() + index;
 7682|  42.7k|  if (static_cast<size_t>(input.end() - pointer) >= 48) {
  ------------------
  |  Branch (7682:7): [True: 746, False: 41.9k]
  ------------------
 7683|    746|    percent_encode_suffix(&*pointer, input.data() + input.size(), character_set,
 7684|    746|                          out);
 7685|  41.9k|  } else {
 7686|  58.4k|    for (; pointer != input.end(); pointer++) {
  ------------------
  |  Branch (7686:12): [True: 16.4k, False: 41.9k]
  ------------------
 7687|  16.4k|      if (character_sets::bit_at(character_set, *pointer)) {
  ------------------
  |  Branch (7687:11): [True: 6.61k, False: 9.83k]
  ------------------
 7688|  6.61k|        out.append(character_sets::hex + uint8_t(*pointer) * 4, 3);
 7689|  9.83k|      } else {
 7690|  9.83k|        out += *pointer;
 7691|  9.83k|      }
 7692|  16.4k|    }
 7693|  41.9k|  }
 7694|  42.7k|  return out;
 7695|  42.7k|}
_ZN3ada7unicode21percent_encode_suffixEPKcS2_PKhRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE:
 7993|  1.23k|                           const uint8_t character_set[], std::string& out) {
 7994|  1.23k|#if ADA_UNICODE_SSSE3 || ADA_NEON || ADA_RVV
 7995|  1.23k|#ifdef ADA_UNICODE_NEED_SSSE3_TARGET
 7996|  1.23k|  static const bool ssse3_supported = __builtin_cpu_supports("ssse3") != 0;
 7997|  1.23k|  const bool use_wide = ssse3_supported;
 7998|       |#else
 7999|       |  const bool use_wide = true;
 8000|       |#endif
 8001|  1.23k|  if (use_wide && static_cast<size_t>(end - p) >= kPercentEncodeSimdMin) {
  ------------------
  |  Branch (8001:7): [True: 1.23k, False: 0]
  |  Branch (8001:19): [True: 1.23k, False: 0]
  ------------------
 8002|  1.23k|    percent_encode_to_wide(p, end, character_set, out);
 8003|  1.23k|    return;
 8004|  1.23k|  }
 8005|      0|#endif
 8006|      0|  percent_encode_to_scalar(p, end, character_set, out);
 8007|      0|}
_ZN3ada11serializers36find_longest_sequence_of_ipv6_piecesERKNSt3__15arrayItLm8EEERmS6_:
 8072|  14.2k|    size_t& compress_length) noexcept {
 8073|  14.2k|  compress = 0;
 8074|  14.2k|  compress_length = 0;
 8075|  14.2k|  size_t i = 0;
 8076|   121k|  while (i < 8) {
  ------------------
  |  Branch (8076:10): [True: 107k, False: 14.2k]
  ------------------
 8077|   107k|    if (address[i] != 0) {
  ------------------
  |  Branch (8077:9): [True: 102k, False: 4.97k]
  ------------------
 8078|   102k|      ++i;
 8079|   102k|      continue;
 8080|   102k|    }
 8081|  4.97k|    size_t next = i + 1;
 8082|  11.4k|    while (next < 8 && address[next] == 0) {
  ------------------
  |  Branch (8082:12): [True: 10.5k, False: 853]
  |  Branch (8082:24): [True: 6.47k, False: 4.12k]
  ------------------
 8083|  6.47k|      ++next;
 8084|  6.47k|    }
 8085|  4.97k|    const size_t count = next - i;
 8086|  4.97k|    if (count > compress_length) {
  ------------------
  |  Branch (8086:9): [True: 4.42k, False: 557]
  ------------------
 8087|  4.42k|      compress_length = count;
 8088|  4.42k|      compress = i;
 8089|  4.42k|    }
 8090|  4.97k|    i = next;
 8091|  4.97k|  }
 8092|  14.2k|}
_ZN3ada11serializers4ipv6ERKNSt3__15arrayItLm8EEE:
 8094|  7.13k|std::string ipv6(const std::array<uint16_t, 8>& address) {
 8095|  7.13k|  size_t compress = 0;
 8096|  7.13k|  size_t compress_length = 0;
 8097|  7.13k|  find_longest_sequence_of_ipv6_pieces(address, compress, compress_length);
 8098|       |
 8099|       |  // Skip compression when the longest zero run is a single piece.
 8100|  7.13k|  if (compress_length <= 1) {
  ------------------
  |  Branch (8100:7): [True: 6.04k, False: 1.09k]
  ------------------
 8101|  6.04k|    compress = compress_length = 8;
 8102|  6.04k|  }
 8103|       |
 8104|       |  // Max: '[' + 8*4 hex + 7 ':' + ']' = 41
 8105|  7.13k|  std::string output(4 * 8 + 7 + 2, '\0');
 8106|  7.13k|  char* point = output.data();
 8107|  7.13k|  *point++ = '[';
 8108|  7.13k|  size_t piece_index = 0;
 8109|  53.1k|  while (true) {
  ------------------
  |  Branch (8109:10): [True: 53.1k, Folded]
  ------------------
 8110|  53.1k|    if (piece_index == compress) {
  ------------------
  |  Branch (8110:9): [True: 1.09k, False: 52.0k]
  ------------------
 8111|  1.09k|      *point++ = ':';
 8112|       |      // If we skip a value initially, we need to write '::'.
 8113|  1.09k|      if (piece_index == 0) {
  ------------------
  |  Branch (8113:11): [True: 445, False: 648]
  ------------------
 8114|    445|        *point++ = ':';
 8115|    445|      }
 8116|  1.09k|      piece_index += compress_length;
 8117|  1.09k|      if (piece_index == 8) {
  ------------------
  |  Branch (8117:11): [True: 356, False: 737]
  ------------------
 8118|    356|        break;
 8119|    356|      }
 8120|  1.09k|    }
 8121|  52.7k|    point = write_hex_u16(point, address[piece_index]);
 8122|  52.7k|    ++piece_index;
 8123|  52.7k|    if (piece_index == 8) {
  ------------------
  |  Branch (8123:9): [True: 6.78k, False: 45.9k]
  ------------------
 8124|  6.78k|      break;
 8125|  6.78k|    }
 8126|  45.9k|    *point++ = ':';
 8127|  45.9k|  }
 8128|  7.13k|  *point++ = ']';
 8129|  7.13k|  output.resize(static_cast<size_t>(point - output.data()));
 8130|  7.13k|  return output;
 8131|  7.13k|}
_ZN3ada11serializers4ipv4Em:
 8133|  7.85k|std::string ipv4(const uint64_t address) {
 8134|  7.85k|  std::string output(15, '\0');
 8135|  7.85k|  char* point = output.data();
 8136|  7.85k|  point = write_u8(point, static_cast<uint8_t>(address >> 24));
 8137|  7.85k|  *point++ = '.';
 8138|  7.85k|  point = write_u8(point, static_cast<uint8_t>(address >> 16));
 8139|  7.85k|  *point++ = '.';
 8140|  7.85k|  point = write_u8(point, static_cast<uint8_t>(address >> 8));
 8141|  7.85k|  *point++ = '.';
 8142|  7.85k|  point = write_u8(point, static_cast<uint8_t>(address));
 8143|  7.85k|  output.resize(static_cast<size_t>(point - output.data()));
 8144|  7.85k|  return output;
 8145|  7.85k|}
_ZN3ada5parseINS_14url_aggregatorEEEN2tl8expectedIT_NS_6errorsEEENSt3__117basic_string_viewIcNS7_11char_traitsIcEEEEPKS4_:
 8549|  13.4k|    std::string_view input, const result_type* base_url) {
 8550|  13.4k|  result_type u = ada::parser::parse_url_impl<result_type>(input, base_url);
 8551|  13.4k|  if (!u.is_valid) {
  ------------------
  |  Branch (8551:7): [True: 10.8k, False: 2.52k]
  ------------------
 8552|  10.8k|    return tl::unexpected(errors::type_error);
 8553|  10.8k|  }
 8554|  2.52k|  return u;
 8555|  13.4k|}
_ZN3ada20get_max_input_lengthEv:
 8170|  13.4k|uint32_t get_max_input_length() {
 8171|  13.4k|  return max_input_length_.load(std::memory_order_relaxed);
 8172|  13.4k|}
_ZN3ada7helpers18trim_c0_whitespaceERNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 9539|  12.1k|void trim_c0_whitespace(std::string_view& input) noexcept {
 9540|  12.1k|  while (!input.empty() &&
  ------------------
  |  Branch (9540:10): [True: 12.1k, False: 0]
  ------------------
 9541|  12.1k|         ada::unicode::is_c0_control_or_space(input.front())) {
  ------------------
  |  Branch (9541:10): [True: 0, False: 12.1k]
  ------------------
 9542|      0|    input.remove_prefix(1);
 9543|      0|  }
 9544|  12.1k|  while (!input.empty() && ada::unicode::is_c0_control_or_space(input.back())) {
  ------------------
  |  Branch (9544:10): [True: 12.1k, False: 0]
  |  Branch (9544:28): [True: 0, False: 12.1k]
  ------------------
 9545|      0|    input.remove_suffix(1);
 9546|      0|  }
 9547|  12.1k|}
_ZN3ada7helpers8overlapsENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEERKNS1_12basic_stringIcS4_NS1_9allocatorIcEEEE:
 9714|      7|bool overlaps(std::string_view input1, const std::string& input2) noexcept {
 9715|      7|  ada_log("helpers::overlaps check if string_view '", input1, "' [",
 9716|      7|          input1.size(), " bytes] is part of string '", input2, "' [",
 9717|      7|          input2.size(), " bytes]");
 9718|      7|  return !input1.empty() && !input2.empty() && input1.data() >= input2.data() &&
  ------------------
  |  Branch (9718:10): [True: 7, False: 0]
  |  Branch (9718:29): [True: 7, False: 0]
  |  Branch (9718:48): [True: 6, False: 1]
  ------------------
 9719|      6|         input1.data() < input2.data() + input2.size();
  ------------------
  |  Branch (9719:10): [True: 0, False: 6]
  ------------------
 9720|      7|}
_ZN3ada6parser25try_parse_simple_absoluteINS_14url_aggregatorEEEbNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEERT_:
12269|  4.74k|                                                result_type& out) {
12270|  4.74k|  constexpr bool is_ada_url = std::is_same_v<result_type, ada::url>;
12271|  4.74k|  constexpr bool is_aggregator =
12272|  4.74k|      std::is_same_v<result_type, ada::url_aggregator>;
12273|  4.74k|  static_assert(is_ada_url || is_aggregator);
12274|       |
12275|  4.74k|  const size_t len = input.size();
12276|       |  // Shortest accepted form is "ws://x" (6).
12277|  4.74k|  if (len < 6) [[unlikely]] {
  ------------------
  |  Branch (12277:7): [True: 0, False: 4.74k]
  ------------------
12278|      0|    return false;
12279|      0|  }
12280|  4.74k|  const auto* b = reinterpret_cast<const uint8_t*>(input.data());
12281|       |
12282|  4.74k|  size_t pos = 0;
12283|  4.74k|  ada::scheme::type scheme_type = ada::scheme::type::NOT_SPECIAL;
12284|  4.74k|  uint32_t protocol_end = 0;
12285|  4.74k|#if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || \
12286|  4.74k|    defined(_M_X64) || defined(_M_IX86) || defined(_M_AMD64)
12287|       |  // One 8-byte load + integer compare is a single cmp/jcc on x86-64.
12288|       |  // Masked compares cover the shorter special schemes without extra loads.
12289|  4.74k|  if (len >= 8) {
  ------------------
  |  Branch (12289:7): [True: 4.74k, False: 0]
  ------------------
12290|  4.74k|    uint64_t first8 = 0;
12291|  4.74k|    std::memcpy(&first8, b, 8);
12292|  4.74k|    if (first8 == 0x2f2f3a7370747468ull) {  // "https://"
  ------------------
  |  Branch (12292:9): [True: 0, False: 4.74k]
  ------------------
12293|      0|      pos = 8;
12294|      0|      scheme_type = ada::scheme::type::HTTPS;
12295|      0|      protocol_end = 6;
12296|  4.74k|    } else if ((first8 & 0x00ffffffffffffffull) ==
  ------------------
  |  Branch (12296:16): [True: 4.74k, False: 0]
  ------------------
12297|  4.74k|               0x002f2f3a70747468ull) {  // "http://"
12298|  4.74k|      pos = 7;
12299|  4.74k|      scheme_type = ada::scheme::type::HTTP;
12300|  4.74k|      protocol_end = 5;
12301|  4.74k|    } else if ((first8 & 0x0000ffffffffffffull) ==
  ------------------
  |  Branch (12301:16): [True: 0, False: 0]
  ------------------
12302|      0|               0x00002f2f3a737377ull) {  // "wss://"
12303|      0|      pos = 6;
12304|      0|      scheme_type = ada::scheme::type::WSS;
12305|      0|      protocol_end = 4;
12306|      0|    } else if ((first8 & 0x0000ffffffffffffull) ==
  ------------------
  |  Branch (12306:16): [True: 0, False: 0]
  ------------------
12307|      0|               0x00002f2f3a707466ull) {  // "ftp://"
12308|      0|      pos = 6;
12309|      0|      scheme_type = ada::scheme::type::FTP;
12310|      0|      protocol_end = 4;
12311|      0|    } else if ((first8 & 0x000000ffffffffffull) ==
  ------------------
  |  Branch (12311:16): [True: 0, False: 0]
  ------------------
12312|      0|               0x0000002f2f3a7377ull) {  // "ws://"
12313|      0|      pos = 5;
12314|      0|      scheme_type = ada::scheme::type::WS;
12315|      0|      protocol_end = 3;
12316|      0|    } else {
12317|      0|      return false;
12318|      0|    }
12319|  4.74k|  } else if (b[0] == 'w' && b[1] == 's') {
  ------------------
  |  Branch (12319:14): [True: 0, False: 0]
  |  Branch (12319:29): [True: 0, False: 0]
  ------------------
12320|      0|    if (b[2] == ':' && b[3] == '/' && b[4] == '/') {
  ------------------
  |  Branch (12320:9): [True: 0, False: 0]
  |  Branch (12320:24): [True: 0, False: 0]
  |  Branch (12320:39): [True: 0, False: 0]
  ------------------
12321|      0|      pos = 5;
12322|      0|      scheme_type = ada::scheme::type::WS;
12323|      0|      protocol_end = 3;
12324|      0|    } else if (b[2] == 's' && b[3] == ':' && b[4] == '/' && b[5] == '/') {
  ------------------
  |  Branch (12324:16): [True: 0, False: 0]
  |  Branch (12324:31): [True: 0, False: 0]
  |  Branch (12324:46): [True: 0, False: 0]
  |  Branch (12324:61): [True: 0, False: 0]
  ------------------
12325|      0|      pos = 6;
12326|      0|      scheme_type = ada::scheme::type::WSS;
12327|      0|      protocol_end = 4;
12328|      0|    } else {
12329|      0|      return false;
12330|      0|    }
12331|      0|  } else if (b[0] == 'f' && b[1] == 't' && b[2] == 'p' && b[3] == ':' &&
  ------------------
  |  Branch (12331:14): [True: 0, False: 0]
  |  Branch (12331:29): [True: 0, False: 0]
  |  Branch (12331:44): [True: 0, False: 0]
  |  Branch (12331:59): [True: 0, False: 0]
  ------------------
12332|      0|             b[4] == '/' && b[5] == '/') {
  ------------------
  |  Branch (12332:14): [True: 0, False: 0]
  |  Branch (12332:29): [True: 0, False: 0]
  ------------------
12333|      0|    pos = 6;
12334|      0|    scheme_type = ada::scheme::type::FTP;
12335|      0|    protocol_end = 4;
12336|      0|  } else if (len >= 7 && b[0] == 'h' && b[1] == 't' && b[2] == 't' &&
  ------------------
  |  Branch (12336:14): [True: 0, False: 0]
  |  Branch (12336:26): [True: 0, False: 0]
  |  Branch (12336:41): [True: 0, False: 0]
  |  Branch (12336:56): [True: 0, False: 0]
  ------------------
12337|      0|             b[3] == 'p' && b[4] == ':' && b[5] == '/' && b[6] == '/') {
  ------------------
  |  Branch (12337:14): [True: 0, False: 0]
  |  Branch (12337:29): [True: 0, False: 0]
  |  Branch (12337:44): [True: 0, False: 0]
  |  Branch (12337:59): [True: 0, False: 0]
  ------------------
12338|      0|    pos = 7;
12339|      0|    scheme_type = ada::scheme::type::HTTP;
12340|      0|    protocol_end = 5;
12341|      0|  } else {
12342|      0|    return false;
12343|      0|  }
12344|       |#else
12345|       |  // Big-endian / uncommon arches: byte-wise special-scheme match.
12346|       |  if (len >= 8 && b[0] == 'h' && b[1] == 't' && b[2] == 't' && b[3] == 'p' &&
12347|       |      b[4] == 's' && b[5] == ':' && b[6] == '/' && b[7] == '/') {
12348|       |    pos = 8;
12349|       |    scheme_type = ada::scheme::type::HTTPS;
12350|       |    protocol_end = 6;
12351|       |  } else if (len >= 7 && b[0] == 'h' && b[1] == 't' && b[2] == 't' &&
12352|       |             b[3] == 'p' && b[4] == ':' && b[5] == '/' && b[6] == '/') {
12353|       |    pos = 7;
12354|       |    scheme_type = ada::scheme::type::HTTP;
12355|       |    protocol_end = 5;
12356|       |  } else if (b[0] == 'w' && b[1] == 's') {
12357|       |    if (b[2] == ':' && b[3] == '/' && b[4] == '/') {
12358|       |      pos = 5;
12359|       |      scheme_type = ada::scheme::type::WS;
12360|       |      protocol_end = 3;
12361|       |    } else if (len >= 6 && b[2] == 's' && b[3] == ':' && b[4] == '/' &&
12362|       |               b[5] == '/') {
12363|       |      pos = 6;
12364|       |      scheme_type = ada::scheme::type::WSS;
12365|       |      protocol_end = 4;
12366|       |    } else {
12367|       |      return false;
12368|       |    }
12369|       |  } else if (b[0] == 'f' && b[1] == 't' && b[2] == 'p' && b[3] == ':' &&
12370|       |             b[4] == '/' && b[5] == '/') {
12371|       |    pos = 6;
12372|       |    scheme_type = ada::scheme::type::FTP;
12373|       |    protocol_end = 4;
12374|       |  } else {
12375|       |    return false;
12376|       |  }
12377|       |#endif
12378|  4.74k|  if (pos < len && (b[pos] == '/' || b[pos] == '\\')) [[unlikely]] {
  ------------------
  |  Branch (12378:7): [True: 4.74k, False: 0]
  |  Branch (12378:21): [True: 21, False: 4.72k]
  |  Branch (12378:38): [True: 5, False: 4.71k]
  ------------------
12379|     26|    return false;
12380|     26|  }
12381|       |
12382|       |  // Digit-led hosts are IPv4/numeric; '[' is IPv6. Skip before scanning.
12383|  4.71k|  if (pos < len && ((b[pos] >= '0' && b[pos] <= '9') || b[pos] == '[')) {
  ------------------
  |  Branch (12383:7): [True: 4.71k, False: 0]
  |  Branch (12383:22): [True: 3.88k, False: 830]
  |  Branch (12383:39): [True: 0, False: 3.88k]
  |  Branch (12383:57): [True: 0, False: 4.71k]
  ------------------
12384|      0|    return false;
12385|      0|  }
12386|       |
12387|  4.71k|  const size_t host_start = pos;
12388|  4.71k|  bool has_upper = false;
12389|  4.71k|  bool has_x = false;
12390|  4.71k|  size_t host_end = pos;
12391|  4.71k|  if (!scan_plain_host(b, pos, len, host_end, has_upper, has_x)) {
  ------------------
  |  Branch (12391:7): [True: 2.82k, False: 1.89k]
  ------------------
12392|  2.82k|    return false;
12393|  2.82k|  }
12394|  1.89k|  if (host_start == host_end) [[unlikely]] {
  ------------------
  |  Branch (12394:7): [True: 11, False: 1.88k]
  ------------------
12395|     11|    return false;
12396|     11|  }
12397|  1.88k|  const size_t host_len = host_end - host_start;
12398|  1.88k|  if (host_len > 253) [[unlikely]] {
  ------------------
  |  Branch (12398:7): [True: 0, False: 1.88k]
  ------------------
12399|      0|    return false;
12400|      0|  }
12401|  1.88k|  {
12402|  1.88k|    std::string_view hv(input.data() + host_start, host_len);
12403|  1.88k|    char host_buf[256];
12404|  1.88k|    if (has_upper) [[unlikely]] {
  ------------------
  |  Branch (12404:9): [True: 441, False: 1.44k]
  ------------------
12405|    441|      std::memcpy(host_buf, input.data() + host_start, host_len);
12406|    441|      unicode::to_lower_ascii(host_buf, host_len);
12407|    441|      hv = std::string_view(host_buf, host_len);
12408|    441|    }
12409|  1.88k|    if (ada::checkers::last_label_may_be_a_number(hv)) [[unlikely]] {
  ------------------
  |  Branch (12409:9): [True: 244, False: 1.63k]
  ------------------
12410|    244|      return false;
12411|    244|    }
12412|       |    // Punycode is "xn--...". The host scan already notes a lowercase 'x';
12413|       |    // uppercase 'X' is covered by has_upper after the in-place lower.
12414|  1.63k|    static constexpr std::string_view xn{"xn-", 3};
12415|  1.63k|    if ((has_x || has_upper) && hv.find(xn) != std::string_view::npos)
  ------------------
  |  Branch (12415:10): [True: 225, False: 1.41k]
  |  Branch (12415:19): [True: 248, False: 1.16k]
  |  Branch (12415:33): [True: 28, False: 445]
  ------------------
12416|     28|        [[unlikely]] {
12417|     28|      return false;
12418|     28|    }
12419|  1.63k|  }
12420|       |
12421|  1.60k|  if (host_end < len && b[host_end] == ':') [[unlikely]] {
  ------------------
  |  Branch (12421:7): [True: 1.60k, False: 0]
  |  Branch (12421:25): [True: 670, False: 939]
  ------------------
12422|    670|    return finish_simple_absolute_with_port(input, out, scheme_type,
12423|    670|                                            protocol_end, host_start, host_end,
12424|    670|                                            host_len, has_upper);
12425|    670|  }
12426|       |
12427|    939|  size_t i = host_end;
12428|    939|  size_t path_start = host_end;
12429|    939|  size_t path_end = host_end;
12430|    939|  size_t query_start = std::string_view::npos;
12431|    939|  size_t hash_start = std::string_view::npos;
12432|    939|  bool has_path = false;
12433|    939|  bool maybe_dot_segment = false;
12434|    939|  bool rest_simple = true;
12435|       |
12436|    939|  if (i < len && b[i] == '/') {
  ------------------
  |  Branch (12436:7): [True: 939, False: 0]
  |  Branch (12436:18): [True: 763, False: 176]
  ------------------
12437|    763|    has_path = true;
12438|    763|    path_start = i;
12439|    763|    ++i;
12440|    763|    scan_path_run(b, i, len, maybe_dot_segment);
12441|    763|    if (i < len) {
  ------------------
  |  Branch (12441:9): [True: 554, False: 209]
  ------------------
12442|    554|      const uint8_t cls = k_path[b[i]];
12443|    554|      if (cls == 1) {
  ------------------
  |  Branch (12443:11): [True: 80, False: 474]
  ------------------
12444|     80|        path_end = i;
12445|     80|        if (b[i] == '?') {
  ------------------
  |  Branch (12445:13): [True: 52, False: 28]
  ------------------
12446|     52|          query_start = i;
12447|     52|          ++i;
12448|     52|          goto scan_query;
12449|     52|        }
12450|     28|        hash_start = i;
12451|     28|        ++i;
12452|     28|        goto scan_hash;
12453|     80|      }
12454|    474|      rest_simple = false;
12455|  10.2k|      for (; i < len; ++i) {
  ------------------
  |  Branch (12455:14): [True: 9.80k, False: 402]
  ------------------
12456|  9.80k|        if (b[i] == '?') {
  ------------------
  |  Branch (12456:13): [True: 55, False: 9.74k]
  ------------------
12457|     55|          path_end = i;
12458|     55|          query_start = i;
12459|     55|          ++i;
12460|     55|          goto scan_query_boundary;
12461|     55|        }
12462|  9.74k|        if (b[i] == '#') {
  ------------------
  |  Branch (12462:13): [True: 17, False: 9.73k]
  ------------------
12463|     17|          path_end = i;
12464|     17|          hash_start = i;
12465|     17|          ++i;
12466|     17|          goto after_rest;
12467|     17|        }
12468|  9.74k|      }
12469|    402|      path_end = i;
12470|    402|      goto after_rest;
12471|    474|    }
12472|    209|    path_end = i;
12473|    209|  } else if (i < len && b[i] == '?') {
  ------------------
  |  Branch (12473:14): [True: 176, False: 0]
  |  Branch (12473:25): [True: 124, False: 52]
  ------------------
12474|    124|    query_start = i;
12475|    124|    ++i;
12476|    124|    goto scan_query;
12477|    124|  } else if (i < len && b[i] == '#') {
  ------------------
  |  Branch (12477:14): [True: 52, False: 0]
  |  Branch (12477:25): [True: 52, False: 0]
  ------------------
12478|     52|    hash_start = i;
12479|     52|    ++i;
12480|     52|    goto scan_hash;
12481|     52|  }
12482|    209|  goto after_rest;
12483|       |
12484|    209|scan_query:
12485|    176|  scan_query_run(b, i, len);
12486|    176|  if (i < len) {
  ------------------
  |  Branch (12486:7): [True: 96, False: 80]
  ------------------
12487|     96|    if (b[i] == '#') {
  ------------------
  |  Branch (12487:9): [True: 15, False: 81]
  ------------------
12488|     15|      hash_start = i;
12489|     15|      ++i;
12490|     15|      goto scan_hash;
12491|     15|    }
12492|     81|    rest_simple = false;
12493|     81|    goto scan_query_boundary;
12494|     96|  }
12495|     80|  goto after_rest;
12496|       |
12497|    136|scan_query_boundary:
12498|  1.45k|  for (; i < len; ++i) {
  ------------------
  |  Branch (12498:10): [True: 1.34k, False: 113]
  ------------------
12499|  1.34k|    if (b[i] == '#') {
  ------------------
  |  Branch (12499:9): [True: 23, False: 1.31k]
  ------------------
12500|     23|      hash_start = i;
12501|     23|      ++i;
12502|     23|      goto after_rest;
12503|     23|    }
12504|  1.34k|  }
12505|    113|  goto after_rest;
12506|       |
12507|    113|scan_hash:
12508|     95|  scan_hash_run(b, i, len);
12509|     95|  if (i < len) {
  ------------------
  |  Branch (12509:7): [True: 33, False: 62]
  ------------------
12510|     33|    rest_simple = false;
12511|     33|  }
12512|       |
12513|    939|after_rest:
12514|    939|  if (rest_simple && maybe_dot_segment) {
  ------------------
  |  Branch (12514:7): [True: 351, False: 588]
  |  Branch (12514:22): [True: 220, False: 131]
  ------------------
12515|    220|    const std::string_view path_body(input.data() + path_start,
12516|    220|                                     path_end - path_start);
12517|    220|    if (path_has_dot_segment(path_body)) {
  ------------------
  |  Branch (12517:9): [True: 119, False: 101]
  ------------------
12518|    119|      rest_simple = false;
12519|    119|    }
12520|    220|  }
12521|       |
12522|       |  // The slow path removes ASCII tab/newline anywhere in the input and trims a
12523|       |  // trailing C0 control or space; this fast path does neither. A query or
12524|       |  // fragment reaching the helpers below would keep those bytes percent-encoded
12525|       |  // ("?a\nb" -> "?a%0Ab", "#f " -> "#f%20") instead of stripped, so hand such
12526|       |  // inputs back to the slow path.
12527|    939|  if (!rest_simple && (unicode::is_c0_control_or_space(input.back()) ||
  ------------------
  |  Branch (12527:7): [True: 707, False: 232]
  |  Branch (12527:24): [True: 0, False: 707]
  ------------------
12528|    707|                       unicode::has_tabs_or_newline(input))) {
  ------------------
  |  Branch (12528:24): [True: 63, False: 644]
  ------------------
12529|     63|    return false;
12530|     63|  }
12531|       |
12532|    876|  out.type = scheme_type;
12533|    876|  out.is_valid = true;
12534|    876|  out.has_opaque_path = false;
12535|    876|  out.host_type = DEFAULT;
12536|       |
12537|    876|  if (!rest_simple) {
  ------------------
  |  Branch (12537:7): [True: 644, False: 232]
  ------------------
12538|       |    // Host is a plain domain. Finish path/query/hash with
12539|       |    // the regular helpers
12540|       |    // so percent-encoding and dot segments do not re-parse the authority.
12541|    644|    const std::string_view path_view =
12542|    644|        has_path
  ------------------
  |  Branch (12542:9): [True: 569, False: 75]
  ------------------
12543|    644|            ? std::string_view(input.data() + path_start, path_end - path_start)
12544|    644|            : std::string_view{};
12545|    644|    auto apply_query_and_hash = [&]() {
12546|    644|      if (query_start != std::string_view::npos) {
12547|    644|        const size_t q_end =
12548|    644|            (hash_start != std::string_view::npos) ? hash_start : len;
12549|    644|        out.update_base_search(std::string_view(input.data() + query_start + 1,
12550|    644|                                                q_end - query_start - 1),
12551|    644|                               character_sets::SPECIAL_QUERY_PERCENT_ENCODE);
12552|    644|      }
12553|    644|      if (hash_start != std::string_view::npos) {
12554|    644|        out.update_unencoded_base_hash(std::string_view(
12555|    644|            input.data() + hash_start + 1, len - hash_start - 1));
12556|    644|      }
12557|    644|    };
12558|    644|    if constexpr (is_aggregator) {
12559|    644|      out.buffer.assign(input.substr(0, host_end));
12560|    644|      if (has_upper) {
  ------------------
  |  Branch (12560:11): [True: 71, False: 573]
  ------------------
12561|     71|        unicode::to_lower_ascii(out.buffer.data() + host_start, host_len);
12562|     71|      }
12563|    644|      out.components.protocol_end = protocol_end;
12564|    644|      out.components.username_end = protocol_end + 2;
12565|    644|      out.components.host_start = protocol_end + 2;
12566|    644|      out.components.host_end = static_cast<uint32_t>(host_end);
12567|    644|      out.components.port = url_components::omitted;
12568|    644|      out.components.pathname_start = static_cast<uint32_t>(host_end);
12569|    644|      out.components.search_start = url_components::omitted;
12570|    644|      out.components.hash_start = url_components::omitted;
12571|    644|      out.parse_path(path_view);
12572|    644|      apply_query_and_hash();
12573|       |    } else {
12574|       |      std::string host_str(input.substr(host_start, host_len));
12575|       |      if (has_upper) {
12576|       |        unicode::to_lower_ascii(host_str.data(), host_str.size());
12577|       |      }
12578|       |      out.host = std::move(host_str);
12579|       |      out.parse_path(path_view);
12580|       |      apply_query_and_hash();
12581|       |    }
12582|    644|    return true;
12583|    644|  }
12584|       |
12585|    232|  const bool need_slash = !has_path;
12586|    232|  if constexpr (is_aggregator) {
12587|    232|    if (!need_slash) {
  ------------------
  |  Branch (12587:9): [True: 159, False: 73]
  ------------------
12588|       |      // assign copies once. resize()+memcpy would value-init then overwrite.
12589|    159|      out.buffer.assign(input);
12590|    159|      if (has_upper) {
  ------------------
  |  Branch (12590:11): [True: 29, False: 130]
  ------------------
12591|     29|        unicode::to_lower_ascii(out.buffer.data() + host_start, host_len);
12592|     29|      }
12593|    159|      out.components.protocol_end = protocol_end;
12594|    159|      out.components.username_end = protocol_end + 2;
12595|    159|      out.components.host_start = protocol_end + 2;
12596|    159|      out.components.host_end = static_cast<uint32_t>(host_end);
12597|    159|      out.components.port = url_components::omitted;
12598|    159|      out.components.pathname_start = static_cast<uint32_t>(path_start);
12599|    159|      out.components.search_start = (query_start != std::string_view::npos)
  ------------------
  |  Branch (12599:37): [True: 20, False: 139]
  ------------------
12600|    159|                                        ? static_cast<uint32_t>(query_start)
12601|    159|                                        : url_components::omitted;
12602|    159|      out.components.hash_start = (hash_start != std::string_view::npos)
  ------------------
  |  Branch (12602:35): [True: 14, False: 145]
  ------------------
12603|    159|                                      ? static_cast<uint32_t>(hash_start)
12604|    159|                                      : url_components::omitted;
12605|    159|    } else {
12606|     73|      out.buffer.clear();
12607|     73|      out.buffer.reserve(len + 1);
12608|     73|      out.buffer.append(input.substr(0, host_end));
12609|     73|      out.buffer.push_back('/');
12610|     73|      if (host_end < len) {
  ------------------
  |  Branch (12610:11): [True: 73, False: 0]
  ------------------
12611|     73|        out.buffer.append(input.substr(host_end));
12612|     73|      }
12613|     73|      if (has_upper) {
  ------------------
  |  Branch (12613:11): [True: 26, False: 47]
  ------------------
12614|     26|        unicode::to_lower_ascii(out.buffer.data() + host_start, host_len);
12615|     26|      }
12616|     73|      out.components.protocol_end = protocol_end;
12617|     73|      out.components.username_end = protocol_end + 2;
12618|     73|      out.components.host_start = protocol_end + 2;
12619|     73|      out.components.host_end = static_cast<uint32_t>(host_end);
12620|     73|      out.components.port = url_components::omitted;
12621|     73|      out.components.pathname_start = static_cast<uint32_t>(host_end);
12622|     73|      out.components.search_start = (query_start != std::string_view::npos)
  ------------------
  |  Branch (12622:37): [True: 47, False: 26]
  ------------------
12623|     73|                                        ? static_cast<uint32_t>(query_start + 1)
12624|     73|                                        : url_components::omitted;
12625|     73|      out.components.hash_start = (hash_start != std::string_view::npos)
  ------------------
  |  Branch (12625:35): [True: 36, False: 37]
  ------------------
12626|     73|                                      ? static_cast<uint32_t>(hash_start + 1)
12627|     73|                                      : url_components::omitted;
12628|     73|    }
12629|       |  } else {
12630|       |    std::string host_str(input.substr(host_start, host_len));
12631|       |    if (has_upper) {
12632|       |      unicode::to_lower_ascii(host_str.data(), host_str.size());
12633|       |    }
12634|       |    out.host = std::move(host_str);
12635|       |    if (need_slash) {
12636|       |      out.path = "/";
12637|       |    } else {
12638|       |      out.path.assign(input.data() + path_start, path_end - path_start);
12639|       |    }
12640|       |    if (query_start != std::string_view::npos) {
12641|       |      const size_t q_end =
12642|       |          (hash_start != std::string_view::npos) ? hash_start : len;
12643|       |      out.query.emplace(input.data() + query_start + 1,
12644|       |                        q_end - query_start - 1);
12645|       |    }
12646|       |    if (hash_start != std::string_view::npos) {
12647|       |      out.hash.emplace(input.data() + hash_start + 1, len - hash_start - 1);
12648|       |    }
12649|       |  }
12650|    232|  return true;
12651|    876|}
_ZN3ada6parser32finish_simple_absolute_with_portINS_14url_aggregatorEEEbNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEERT_NS_6scheme4typeEjmmmb:
11997|    670|    bool has_upper) {
11998|    670|  constexpr bool is_ada_url = std::is_same_v<result_type, ada::url>;
11999|    670|  constexpr bool is_aggregator =
12000|    670|      std::is_same_v<result_type, ada::url_aggregator>;
12001|    670|  static_assert(is_ada_url || is_aggregator);
12002|       |
12003|    670|  const size_t len = input.size();
12004|    670|  const auto* b = reinterpret_cast<const uint8_t*>(input.data());
12005|    670|  size_t p = host_end + 1;
12006|    670|  uint32_t port_value = 0;
12007|    670|  bool any_digit = false;
12008|  1.31k|  while (p < len && b[p] >= '0' && b[p] <= '9') {
  ------------------
  |  Branch (12008:10): [True: 1.31k, False: 0]
  |  Branch (12008:21): [True: 765, False: 547]
  |  Branch (12008:36): [True: 651, False: 114]
  ------------------
12009|    651|    any_digit = true;
12010|    651|    port_value = port_value * 10 + static_cast<uint32_t>(b[p] - '0');
12011|    651|    if (port_value > 65535) [[unlikely]] {
  ------------------
  |  Branch (12011:9): [True: 9, False: 642]
  ------------------
12012|      9|      return false;
12013|      9|    }
12014|    642|    ++p;
12015|    642|  }
12016|    661|  if (p < len && b[p] != '/' && b[p] != '?' && b[p] != '#') [[unlikely]] {
  ------------------
  |  Branch (12016:7): [True: 661, False: 0]
  |  Branch (12016:18): [True: 359, False: 302]
  |  Branch (12016:33): [True: 268, False: 91]
  |  Branch (12016:48): [True: 180, False: 88]
  ------------------
12017|    180|    return false;
12018|    180|  }
12019|    481|  uint32_t parsed_port = url_components::omitted;
12020|    481|  const uint16_t default_port = ada::scheme::get_special_port(scheme_type);
12021|    481|  if (any_digit && port_value != default_port) {
  ------------------
  |  Branch (12021:7): [True: 130, False: 351]
  |  Branch (12021:20): [True: 128, False: 2]
  ------------------
12022|    128|    parsed_port = port_value;
12023|    128|  }
12024|    481|  const size_t authority_end = p;
12025|       |
12026|    481|  size_t i = authority_end;
12027|    481|  size_t path_start = host_end;
12028|    481|  size_t path_end = host_end;
12029|    481|  size_t query_start = std::string_view::npos;
12030|    481|  size_t hash_start = std::string_view::npos;
12031|    481|  bool has_path = false;
12032|    481|  bool maybe_dot_segment = false;
12033|    481|  bool rest_simple = true;
12034|       |
12035|    481|  if (i < len && b[i] == '/') {
  ------------------
  |  Branch (12035:7): [True: 481, False: 0]
  |  Branch (12035:18): [True: 302, False: 179]
  ------------------
12036|    302|    has_path = true;
12037|    302|    path_start = i;
12038|    302|    ++i;
12039|    302|    scan_path_run(b, i, len, maybe_dot_segment);
12040|    302|    if (i < len) {
  ------------------
  |  Branch (12040:9): [True: 204, False: 98]
  ------------------
12041|    204|      const uint8_t cls = k_path[b[i]];
12042|    204|      if (cls == 1) {
  ------------------
  |  Branch (12042:11): [True: 47, False: 157]
  ------------------
12043|     47|        path_end = i;
12044|     47|        if (b[i] == '?') {
  ------------------
  |  Branch (12044:13): [True: 29, False: 18]
  ------------------
12045|     29|          query_start = i;
12046|     29|          ++i;
12047|     29|          goto scan_query;
12048|     29|        }
12049|     18|        hash_start = i;
12050|     18|        ++i;
12051|     18|        goto scan_hash;
12052|     47|      }
12053|    157|      rest_simple = false;
12054|  1.84k|      for (; i < len; ++i) {
  ------------------
  |  Branch (12054:14): [True: 1.70k, False: 134]
  ------------------
12055|  1.70k|        if (b[i] == '?') {
  ------------------
  |  Branch (12055:13): [True: 12, False: 1.69k]
  ------------------
12056|     12|          path_end = i;
12057|     12|          query_start = i;
12058|     12|          ++i;
12059|     12|          goto scan_query_boundary;
12060|     12|        }
12061|  1.69k|        if (b[i] == '#') {
  ------------------
  |  Branch (12061:13): [True: 11, False: 1.68k]
  ------------------
12062|     11|          path_end = i;
12063|     11|          hash_start = i;
12064|     11|          ++i;
12065|     11|          goto after_rest;
12066|     11|        }
12067|  1.69k|      }
12068|    134|      path_end = i;
12069|    134|      goto after_rest;
12070|    157|    }
12071|     98|    path_end = i;
12072|    179|  } else if (i < len && b[i] == '?') {
  ------------------
  |  Branch (12072:14): [True: 179, False: 0]
  |  Branch (12072:25): [True: 91, False: 88]
  ------------------
12073|     91|    query_start = i;
12074|     91|    ++i;
12075|     91|    goto scan_query;
12076|     91|  } else if (i < len && b[i] == '#') {
  ------------------
  |  Branch (12076:14): [True: 88, False: 0]
  |  Branch (12076:25): [True: 88, False: 0]
  ------------------
12077|     88|    hash_start = i;
12078|     88|    ++i;
12079|     88|    goto scan_hash;
12080|     88|  }
12081|     98|  goto after_rest;
12082|       |
12083|    120|scan_query:
12084|    120|  scan_query_run(b, i, len);
12085|    120|  if (i < len) {
  ------------------
  |  Branch (12085:7): [True: 58, False: 62]
  ------------------
12086|     58|    if (b[i] == '#') {
  ------------------
  |  Branch (12086:9): [True: 10, False: 48]
  ------------------
12087|     10|      hash_start = i;
12088|     10|      ++i;
12089|     10|      goto scan_hash;
12090|     10|    }
12091|     48|    rest_simple = false;
12092|     48|    goto scan_query_boundary;
12093|     58|  }
12094|     62|  goto after_rest;
12095|       |
12096|     62|scan_query_boundary:
12097|    918|  for (; i < len; ++i) {
  ------------------
  |  Branch (12097:10): [True: 868, False: 50]
  ------------------
12098|    868|    if (b[i] == '#') {
  ------------------
  |  Branch (12098:9): [True: 10, False: 858]
  ------------------
12099|     10|      hash_start = i;
12100|     10|      ++i;
12101|     10|      goto after_rest;
12102|     10|    }
12103|    868|  }
12104|     50|  goto after_rest;
12105|       |
12106|    116|scan_hash:
12107|    116|  scan_hash_run(b, i, len);
12108|    116|  if (i < len) {
  ------------------
  |  Branch (12108:7): [True: 40, False: 76]
  ------------------
12109|     40|    rest_simple = false;
12110|     40|  }
12111|       |
12112|    481|after_rest:
12113|    481|  if (rest_simple && maybe_dot_segment) {
  ------------------
  |  Branch (12113:7): [True: 236, False: 245]
  |  Branch (12113:22): [True: 78, False: 158]
  ------------------
12114|     78|    const std::string_view path_body(input.data() + path_start,
12115|     78|                                     path_end - path_start);
12116|     78|    if (path_has_dot_segment(path_body)) {
  ------------------
  |  Branch (12116:9): [True: 38, False: 40]
  ------------------
12117|     38|      rest_simple = false;
12118|     38|    }
12119|     78|  }
12120|       |
12121|       |  // The slow path removes ASCII tab/newline anywhere in the input and trims a
12122|       |  // trailing C0 control or space; this fast path does neither. A query or
12123|       |  // fragment reaching the helpers below would keep those bytes percent-encoded
12124|       |  // ("?a\nb" -> "?a%0Ab", "#f " -> "#f%20") instead of stripped, so hand such
12125|       |  // inputs back to the slow path.
12126|    481|  if (!rest_simple && (unicode::is_c0_control_or_space(input.back()) ||
  ------------------
  |  Branch (12126:7): [True: 283, False: 198]
  |  Branch (12126:24): [True: 0, False: 283]
  ------------------
12127|    283|                       unicode::has_tabs_or_newline(input))) {
  ------------------
  |  Branch (12127:24): [True: 40, False: 243]
  ------------------
12128|     40|    return false;
12129|     40|  }
12130|       |
12131|    441|  out.type = scheme_type;
12132|    441|  out.is_valid = true;
12133|    441|  out.has_opaque_path = false;
12134|    441|  out.host_type = DEFAULT;
12135|       |
12136|    441|  const uint32_t port_bytes = (parsed_port != url_components::omitted)
  ------------------
  |  Branch (12136:31): [True: 127, False: 314]
  ------------------
12137|    441|                                  ? (1 + port_decimal_digit_count(parsed_port))
12138|    441|                                  : 0;
12139|       |
12140|    441|  if (!rest_simple) {
  ------------------
  |  Branch (12140:7): [True: 243, False: 198]
  ------------------
12141|    243|    const std::string_view path_view =
12142|    243|        has_path
  ------------------
  |  Branch (12142:9): [True: 184, False: 59]
  ------------------
12143|    243|            ? std::string_view(input.data() + path_start, path_end - path_start)
12144|    243|            : std::string_view{};
12145|    243|    auto apply_query_and_hash = [&]() {
12146|    243|      if (query_start != std::string_view::npos) {
12147|    243|        const size_t q_end =
12148|    243|            (hash_start != std::string_view::npos) ? hash_start : len;
12149|    243|        out.update_base_search(std::string_view(input.data() + query_start + 1,
12150|    243|                                                q_end - query_start - 1),
12151|    243|                               character_sets::SPECIAL_QUERY_PERCENT_ENCODE);
12152|    243|      }
12153|    243|      if (hash_start != std::string_view::npos) {
12154|    243|        out.update_unencoded_base_hash(std::string_view(
12155|    243|            input.data() + hash_start + 1, len - hash_start - 1));
12156|    243|      }
12157|    243|    };
12158|    243|    if constexpr (is_aggregator) {
12159|    243|      out.buffer.assign(input.substr(0, host_end));
12160|    243|      if (parsed_port != url_components::omitted) {
  ------------------
  |  Branch (12160:11): [True: 36, False: 207]
  ------------------
12161|     36|        append_canonical_port(out.buffer, parsed_port);
12162|     36|      }
12163|    243|      if (has_upper) {
  ------------------
  |  Branch (12163:11): [True: 32, False: 211]
  ------------------
12164|     32|        unicode::to_lower_ascii(out.buffer.data() + host_start, host_len);
12165|     32|      }
12166|    243|      out.components.protocol_end = protocol_end;
12167|    243|      out.components.username_end = protocol_end + 2;
12168|    243|      out.components.host_start = protocol_end + 2;
12169|    243|      out.components.host_end = static_cast<uint32_t>(host_end);
12170|    243|      out.components.port = parsed_port;
12171|    243|      out.components.pathname_start = static_cast<uint32_t>(out.buffer.size());
12172|    243|      out.components.search_start = url_components::omitted;
12173|    243|      out.components.hash_start = url_components::omitted;
12174|    243|      out.parse_path(path_view);
12175|    243|      apply_query_and_hash();
12176|       |    } else {
12177|       |      std::string host_str(input.substr(host_start, host_len));
12178|       |      if (has_upper) {
12179|       |        unicode::to_lower_ascii(host_str.data(), host_str.size());
12180|       |      }
12181|       |      out.host = std::move(host_str);
12182|       |      if (parsed_port != url_components::omitted) {
12183|       |        out.port = static_cast<uint16_t>(parsed_port);
12184|       |      }
12185|       |      out.parse_path(path_view);
12186|       |      apply_query_and_hash();
12187|       |    }
12188|    243|    return true;
12189|    243|  }
12190|       |
12191|    198|  const bool insert_slash = !has_path;
12192|    198|  if constexpr (is_aggregator) {
12193|    198|    const size_t out_len =
12194|    198|        host_end + port_bytes + (insert_slash ? 1 : 0) + (len - authority_end);
  ------------------
  |  Branch (12194:34): [True: 105, False: 93]
  ------------------
12195|    198|    const bool omit_port_bytes = parsed_port == url_components::omitted;
12196|    198|    if (out_len == len && !insert_slash && !omit_port_bytes) {
  ------------------
  |  Branch (12196:9): [True: 34, False: 164]
  |  Branch (12196:27): [True: 9, False: 25]
  |  Branch (12196:44): [True: 9, False: 0]
  ------------------
12197|      9|      out.buffer.assign(input);
12198|    189|    } else {
12199|    189|      out.buffer.clear();
12200|    189|      out.buffer.reserve(out_len);
12201|    189|      out.buffer.append(input.substr(0, host_end));
12202|    189|      if (parsed_port != url_components::omitted) {
  ------------------
  |  Branch (12202:11): [True: 82, False: 107]
  ------------------
12203|     82|        append_canonical_port(out.buffer, parsed_port);
12204|     82|      }
12205|    189|      if (insert_slash) {
  ------------------
  |  Branch (12205:11): [True: 105, False: 84]
  ------------------
12206|    105|        out.buffer.push_back('/');
12207|    105|      }
12208|    189|      if (authority_end < len) {
  ------------------
  |  Branch (12208:11): [True: 189, False: 0]
  ------------------
12209|    189|        out.buffer.append(input.substr(authority_end));
12210|    189|      }
12211|    189|    }
12212|    198|    if (has_upper) {
  ------------------
  |  Branch (12212:9): [True: 38, False: 160]
  ------------------
12213|     38|      unicode::to_lower_ascii(out.buffer.data() + host_start, host_len);
12214|     38|    }
12215|    198|    const uint32_t pathname_start =
12216|    198|        static_cast<uint32_t>(host_end) + port_bytes;
12217|    198|    const int32_t tail_delta = static_cast<int32_t>(pathname_start) +
12218|    198|                               (insert_slash ? 1 : 0) -
  ------------------
  |  Branch (12218:33): [True: 105, False: 93]
  ------------------
12219|    198|                               static_cast<int32_t>(authority_end);
12220|    198|    out.components.protocol_end = protocol_end;
12221|    198|    out.components.username_end = protocol_end + 2;
12222|    198|    out.components.host_start = protocol_end + 2;
12223|    198|    out.components.host_end = static_cast<uint32_t>(host_end);
12224|    198|    out.components.port = parsed_port;
12225|    198|    out.components.pathname_start = pathname_start;
12226|    198|    out.components.search_start =
12227|    198|        (query_start != std::string_view::npos)
  ------------------
  |  Branch (12227:9): [True: 60, False: 138]
  ------------------
12228|    198|            ? static_cast<uint32_t>(static_cast<int32_t>(query_start) +
12229|     60|                                    tail_delta)
12230|    198|            : url_components::omitted;
12231|    198|    out.components.hash_start =
12232|    198|        (hash_start != std::string_view::npos)
  ------------------
  |  Branch (12232:9): [True: 70, False: 128]
  ------------------
12233|    198|            ? static_cast<uint32_t>(static_cast<int32_t>(hash_start) +
12234|     70|                                    tail_delta)
12235|    198|            : url_components::omitted;
12236|       |  } else {
12237|       |    std::string host_str(input.substr(host_start, host_len));
12238|       |    if (has_upper) {
12239|       |      unicode::to_lower_ascii(host_str.data(), host_str.size());
12240|       |    }
12241|       |    out.host = std::move(host_str);
12242|       |    if (parsed_port != url_components::omitted) {
12243|       |      out.port = static_cast<uint16_t>(parsed_port);
12244|       |    }
12245|       |    if (insert_slash) {
12246|       |      out.path = "/";
12247|       |    } else {
12248|       |      out.path.assign(input.data() + path_start, path_end - path_start);
12249|       |    }
12250|       |    if (query_start != std::string_view::npos) {
12251|       |      const size_t q_end =
12252|       |          (hash_start != std::string_view::npos) ? hash_start : len;
12253|       |      out.query.emplace(input.data() + query_start + 1,
12254|       |                        q_end - query_start - 1);
12255|       |    }
12256|       |    if (hash_start != std::string_view::npos) {
12257|       |      out.hash.emplace(input.data() + hash_start + 1, len - hash_start - 1);
12258|       |    }
12259|       |  }
12260|    198|  return true;
12261|    441|}
_ZN3ada6parser14parse_url_implINS_14url_aggregatorELb1EEET_NSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPKS3_:
12840|  13.4k|                           const result_type* base_url) {
12841|       |  // We can specialize the implementation per type.
12842|       |  // Important: result_type_is_ada_url is evaluated at *compile time*. This
12843|       |  // means that doing if constexpr(result_type_is_ada_url) { something } else {
12844|       |  // something else } is free (at runtime). This means that ada::url_aggregator
12845|       |  // and ada::url **do not have to support the exact same API**.
12846|  13.4k|  constexpr bool result_type_is_ada_url = std::is_same_v<url, result_type>;
12847|  13.4k|  constexpr bool result_type_is_ada_url_aggregator =
12848|  13.4k|      std::is_same_v<url_aggregator, result_type>;
12849|  13.4k|  static_assert(result_type_is_ada_url ||
12850|  13.4k|                result_type_is_ada_url_aggregator);  // We don't support
12851|       |                                                     // anything else for now.
12852|       |
12853|  13.4k|  ada_log("ada::parser::parse_url('", user_input, "' [", user_input.size(),
12854|  13.4k|          " bytes],", (base_url != nullptr ? base_url->to_string() : "null"),
12855|  13.4k|          ")");
12856|       |
12857|  13.4k|  result_type url{};
12858|       |
12859|  13.4k|  const uint32_t max_input_length = ada::get_max_input_length();
12860|       |
12861|       |  // Normalization (percent-encoding, IDNA) can push the serialized URL past
12862|       |  // max_input_length even when the input fit under it. The check at the end of
12863|       |  // the state machine covers URLs that run to completion, but several states
12864|       |  // return early after appending a query or fragment, so run the same check on
12865|       |  // those exits too. Without this, a query- or fragment-terminated URL such as
12866|       |  // file://x/?<...> or https://user@x/?<...> is accepted while the equivalent
12867|       |  // https://x/?<...> that takes the absolute fast path is rejected.
12868|  13.4k|  const auto enforce_max_input_length = [&]() {
12869|  13.4k|    if constexpr (store_values) {
12870|  13.4k|      if (url.is_valid) {
12871|  13.4k|        if constexpr (result_type_is_ada_url_aggregator) {
12872|  13.4k|          if (url.buffer.size() > max_input_length) [[unlikely]] {
12873|  13.4k|            url.is_valid = false;
12874|  13.4k|          }
12875|  13.4k|        } else {
12876|  13.4k|          if (url.get_href_size() > max_input_length) [[unlikely]] {
12877|  13.4k|            url.is_valid = false;
12878|  13.4k|          }
12879|  13.4k|        }
12880|  13.4k|      }
12881|  13.4k|    }
12882|  13.4k|  };
12883|       |
12884|       |  // We refuse to parse URL strings that exceed the maximum input length.
12885|       |  // By default, this is 4GB but can be configured via
12886|       |  // ada::set_max_input_length().
12887|  13.4k|  if (user_input.size() > max_input_length) [[unlikely]] {
  ------------------
  |  Branch (12887:7): [True: 0, False: 13.4k]
  ------------------
12888|      0|    url.is_valid = false;
12889|      0|  }
12890|       |  // Going forward, user_input.size() is in [0,
12891|       |  // std::numeric_limits<uint32_t>::max). If we are provided with an invalid
12892|       |  // base, or the optional_url was invalid, we must return.
12893|  13.4k|  if (base_url != nullptr) {
  ------------------
  |  Branch (12893:7): [True: 0, False: 13.4k]
  ------------------
12894|      0|    url.is_valid &= base_url->is_valid;
12895|      0|  }
12896|  13.4k|  if (!url.is_valid) {
  ------------------
  |  Branch (12896:7): [True: 0, False: 13.4k]
  ------------------
12897|      0|    return url;
12898|      0|  }
12899|       |
12900|       |  // Simple absolute / relative fast paths (before tabs/newline scan).
12901|  13.4k|  if constexpr (store_values) {
12902|  13.4k|    bool hit_fast_path = false;
12903|  13.4k|    if (base_url == nullptr) {
  ------------------
  |  Branch (12903:9): [True: 13.4k, False: 0]
  ------------------
12904|       |      // IPv4/IPv6 and userinfo miss the fast path. Skip the never_inline
12905|       |      // call so those URLs (including SetHref) do not pay for a miss.
12906|  13.4k|      const auto* p = reinterpret_cast<const uint8_t*>(user_input.data());
12907|  13.4k|      const size_t n = user_input.size();
12908|  13.4k|      size_t host_start = 0;
12909|  13.4k|      if (n >= 8 && p[4] == ':' && p[5] == '/' && p[6] == '/') {
  ------------------
  |  Branch (12909:11): [True: 13.4k, False: 0]
  |  Branch (12909:21): [True: 13.4k, False: 0]
  |  Branch (12909:36): [True: 13.4k, False: 0]
  |  Branch (12909:51): [True: 13.4k, False: 0]
  ------------------
12910|  13.4k|        host_start = 7;
12911|  13.4k|      } else if (n >= 9 && p[5] == ':' && p[6] == '/' && p[7] == '/') {
  ------------------
  |  Branch (12911:18): [True: 0, False: 0]
  |  Branch (12911:28): [True: 0, False: 0]
  |  Branch (12911:43): [True: 0, False: 0]
  |  Branch (12911:58): [True: 0, False: 0]
  ------------------
12912|      0|        host_start = 8;
12913|      0|      }
12914|  13.4k|      const uint8_t host_first = host_start != 0 ? p[host_start] : 0;
  ------------------
  |  Branch (12914:34): [True: 13.4k, False: 0]
  ------------------
12915|  13.4k|      const bool skip_ip =
12916|  13.4k|          host_first == '[' || (host_first >= '0' && host_first <= '9');
  ------------------
  |  Branch (12916:11): [True: 7.30k, False: 6.12k]
  |  Branch (12916:33): [True: 5.25k, False: 867]
  |  Branch (12916:54): [True: 1.20k, False: 4.05k]
  ------------------
12917|  13.4k|      const bool skip_userinfo =
12918|  13.4k|          host_start != 0 && authority_has_at(p, host_start, n);
  ------------------
  |  Branch (12918:11): [True: 13.4k, False: 0]
  |  Branch (12918:30): [True: 188, False: 13.2k]
  ------------------
12919|  13.4k|      hit_fast_path = !skip_ip && !skip_userinfo &&
  ------------------
  |  Branch (12919:23): [True: 4.91k, False: 8.50k]
  |  Branch (12919:35): [True: 4.74k, False: 175]
  ------------------
12920|  4.74k|                      try_parse_simple_absolute(user_input, url);
  ------------------
  |  Branch (12920:23): [True: 1.31k, False: 3.42k]
  ------------------
12921|  13.4k|    } else {
12922|      0|      hit_fast_path = try_parse_simple_relative(user_input, *base_url, url);
12923|      0|    }
12924|  13.4k|    if (hit_fast_path) {
  ------------------
  |  Branch (12924:9): [True: 1.31k, False: 12.1k]
  ------------------
12925|  1.31k|      if constexpr (result_type_is_ada_url_aggregator) {
12926|  1.31k|        if (url.buffer.size() > max_input_length) [[unlikely]] {
  ------------------
  |  Branch (12926:13): [True: 0, False: 1.31k]
  ------------------
12927|      0|          url.is_valid = false;
12928|      0|        }
12929|       |      } else {
12930|       |        // For a small absolute input, even worst-case normalization cannot
12931|       |        // exceed the limit: percent encoding expands at most 3x and IDNA at
12932|       |        // most 4.5x. Avoid traversing every stored component on the common
12933|       |        // default-limit path.
12934|       |        if ((base_url != nullptr ||
12935|       |             user_input.size() > static_cast<size_t>(max_input_length) / 5) &&
12936|       |            url.get_href_size() > max_input_length) [[unlikely]] {
12937|       |          url.is_valid = false;
12938|       |        }
12939|       |      }
12940|  1.31k|      return url;
12941|  1.31k|    }
12942|  13.4k|  }
12943|       |
12944|  12.1k|  state state = state::SCHEME_START;
12945|       |
12946|  13.4k|  std::string tmp_buffer;
12947|  13.4k|  std::string_view url_data;
12948|  13.4k|  if (unicode::has_tabs_or_newline(user_input)) [[unlikely]] {
  ------------------
  |  Branch (12948:7): [True: 174, False: 13.2k]
  ------------------
12949|    174|    tmp_buffer = user_input;
12950|       |    // Optimization opportunity: Instead of copying and then pruning, we could
12951|       |    // just directly build the string from user_input.
12952|    174|    helpers::remove_ascii_tab_or_newline(tmp_buffer);
12953|    174|    url_data = tmp_buffer;
12954|  13.2k|  } else [[likely]] {
12955|  13.2k|    url_data = user_input;
12956|  13.2k|  }
12957|       |
12958|       |  // Leading and trailing control characters are uncommon and easy to deal with
12959|       |  // (no performance concern).
12960|  13.4k|  helpers::trim_c0_whitespace(url_data);
12961|       |
12962|  13.4k|  if constexpr (result_type_is_ada_url_aggregator && store_values) {
12963|       |    // Most of the time, we just need user_input.size().
12964|       |    // In some instances, we may need a bit more.
12965|       |    ///////////////////////////
12966|       |    // This is *very* important. This line should *not* be removed
12967|       |    // hastily. There are principled reasons why reserve is important
12968|       |    // for performance. If you have a benchmark with small inputs,
12969|       |    // it may not matter, but in other instances, it could.
12970|       |    ////
12971|       |    // This rounds up to the next power of two.
12972|       |    // We know that user_input.size() is in [0,
12973|       |    // std::numeric_limits<uint32_t>::max).
12974|  13.4k|    uint32_t reserve_capacity =
12975|  13.4k|        (0xFFFFFFFF >>
12976|  13.4k|         helpers::leading_zeroes(uint32_t(1 | user_input.size()))) +
12977|  13.4k|        1;
12978|  13.4k|    url.reserve(reserve_capacity);
12979|  13.4k|  }
12980|       |
12981|       |  // Optimization opportunity. Most websites do not have fragment.
12982|  13.4k|  std::optional<std::string_view> fragment = helpers::prune_hash(url_data);
12983|       |  // We add it last so that an implementation like ada::url_aggregator
12984|       |  // can append it last to its internal buffer, thus improving performance.
12985|       |
12986|       |  // Here url_data no longer has its fragment.
12987|       |  // We are going to access the data from url_data (it is immutable).
12988|       |  // At any given time, we are pointing at byte 'input_position' in url_data.
12989|       |  // The input_position variable should range from 0 to input_size.
12990|       |  // It is illegal to access url_data at input_size.
12991|  13.4k|  size_t input_position = 0;
12992|  13.4k|  const size_t input_size = url_data.size();
12993|       |  // Keep running the following state machine by switching on state.
12994|       |  // If after a run pointer points to the EOF code point, go to the next step.
12995|       |  // Otherwise, increase pointer by 1 and continue with the state machine.
12996|       |  // We never decrement input_position.
12997|  65.7k|  while (input_position <= input_size) {
  ------------------
  |  Branch (12997:10): [True: 63.7k, False: 1.99k]
  ------------------
12998|  63.7k|    ada_log("In parsing at ", input_position, " out of ", input_size,
12999|  63.7k|            " in state ", ada::to_string(state));
13000|  63.7k|    switch (state) {
13001|  12.1k|      case state::SCHEME_START: {
  ------------------
  |  Branch (13001:7): [True: 12.1k, False: 51.6k]
  ------------------
13002|  12.1k|        ada_log("SCHEME_START ", helpers::substring(url_data, input_position));
13003|       |        // If c is an ASCII alpha, append c, lowercased, to buffer, and set
13004|       |        // state to scheme state.
13005|  12.1k|        if ((input_position != input_size) &&
  ------------------
  |  Branch (13005:13): [True: 12.1k, False: 0]
  ------------------
13006|  12.1k|            checkers::is_alpha(url_data[input_position])) {
  ------------------
  |  Branch (13006:13): [True: 12.1k, False: 0]
  ------------------
13007|  12.1k|          state = state::SCHEME;
13008|  12.1k|          input_position++;
13009|  12.1k|        } else {
13010|       |          // Otherwise, if state override is not given, set state to no scheme
13011|       |          // state and decrease pointer by 1.
13012|      0|          state = state::NO_SCHEME;
13013|      0|        }
13014|  12.1k|        break;
13015|      0|      }
13016|  12.1k|      case state::SCHEME: {
  ------------------
  |  Branch (13016:7): [True: 12.1k, False: 51.6k]
  ------------------
13017|  12.1k|        ada_log("SCHEME ", helpers::substring(url_data, input_position));
13018|       |        // If c is an ASCII alphanumeric, U+002B (+), U+002D (-), or U+002E (.),
13019|       |        // append c, lowercased, to buffer.
13020|  48.4k|        while ((input_position != input_size) &&
  ------------------
  |  Branch (13020:16): [True: 48.4k, False: 0]
  ------------------
13021|  48.4k|               (unicode::is_alnum_plus(url_data[input_position]))) {
  ------------------
  |  Branch (13021:16): [True: 36.3k, False: 12.1k]
  ------------------
13022|  36.3k|          input_position++;
13023|  36.3k|        }
13024|       |        // Otherwise, if c is U+003A (:), then:
13025|  12.1k|        if ((input_position != input_size) &&
  ------------------
  |  Branch (13025:13): [True: 12.1k, False: 0]
  ------------------
13026|  12.1k|            (url_data[input_position] == ':')) {
  ------------------
  |  Branch (13026:13): [True: 12.1k, False: 0]
  ------------------
13027|  12.1k|          ada_log("SCHEME the scheme should be ",
13028|  12.1k|                  url_data.substr(0, input_position));
13029|       |          if constexpr (result_type_is_ada_url) {
13030|       |            if (!url.parse_scheme(url_data.substr(0, input_position))) {
13031|       |              return url;
13032|       |            }
13033|  12.1k|          } else {
13034|       |            // we pass the colon along instead of painfully adding it back.
13035|  12.1k|            if (!url.parse_scheme_with_colon(
  ------------------
  |  Branch (13035:17): [True: 0, False: 12.1k]
  ------------------
13036|  12.1k|                    url_data.substr(0, input_position + 1))) {
13037|      0|              return url;
13038|      0|            }
13039|  12.1k|          }
13040|  12.1k|          ada_log("SCHEME the scheme is ", url.get_protocol());
13041|       |
13042|       |          // If url's scheme is "file", then:
13043|       |          // NOLINTNEXTLINE(bugprone-branch-clone)
13044|  12.1k|          if (url.type == scheme::type::FILE) {
  ------------------
  |  Branch (13044:15): [True: 0, False: 12.1k]
  ------------------
13045|       |            // Set state to file state.
13046|      0|            state = state::FILE;
13047|      0|          }
13048|       |          // Otherwise, if url is special, base is non-null, and base's scheme
13049|       |          // is url's scheme: Note: Doing base_url->scheme is unsafe if base_url
13050|       |          // != nullptr is false.
13051|  12.1k|          else if (url.is_special() && base_url != nullptr &&
  ------------------
  |  Branch (13051:20): [True: 12.1k, False: 0]
  |  Branch (13051:40): [True: 0, False: 12.1k]
  ------------------
13052|      0|                   base_url->type == url.type) {
  ------------------
  |  Branch (13052:20): [True: 0, False: 0]
  ------------------
13053|       |            // Set state to special relative or authority state.
13054|      0|            state = state::SPECIAL_RELATIVE_OR_AUTHORITY;
13055|      0|          }
13056|       |          // Otherwise, if url is special, set state to special authority
13057|       |          // slashes state.
13058|  12.1k|          else if (url.is_special()) {
  ------------------
  |  Branch (13058:20): [True: 12.1k, False: 0]
  ------------------
13059|  12.1k|            state = state::SPECIAL_AUTHORITY_SLASHES;
13060|  12.1k|          }
13061|       |          // Otherwise, if remaining starts with an U+002F (/), set state to
13062|       |          // path or authority state and increase pointer by 1.
13063|      0|          else if (input_position + 1 < input_size &&
  ------------------
  |  Branch (13063:20): [True: 0, False: 0]
  ------------------
13064|      0|                   url_data[input_position + 1] == '/') {
  ------------------
  |  Branch (13064:20): [True: 0, False: 0]
  ------------------
13065|      0|            state = state::PATH_OR_AUTHORITY;
13066|      0|            input_position++;
13067|      0|          }
13068|       |          // Otherwise, set url's path to the empty string and set state to
13069|       |          // opaque path state.
13070|      0|          else {
13071|      0|            state = state::OPAQUE_PATH;
13072|      0|          }
13073|  12.1k|        }
13074|       |        // Otherwise, if state override is not given, set buffer to the empty
13075|       |        // string, state to no scheme state, and start over (from the first code
13076|       |        // point in input).
13077|      0|        else {
13078|      0|          state = state::NO_SCHEME;
13079|      0|          input_position = 0;
13080|      0|          break;
13081|      0|        }
13082|  12.1k|        input_position++;
13083|  12.1k|        break;
13084|  12.1k|      }
13085|      0|      case state::NO_SCHEME: {
  ------------------
  |  Branch (13085:7): [True: 0, False: 63.7k]
  ------------------
13086|      0|        ada_log("NO_SCHEME ", helpers::substring(url_data, input_position));
13087|       |        // The fragment was pruned from url_data before the state machine ran,
13088|       |        // so 'c is U+0023 (#)' holds exactly when a fragment was found and
13089|       |        // nothing else remains in front of it.
13090|      0|        const bool c_is_hash =
13091|      0|            fragment.has_value() && input_position == input_size;
  ------------------
  |  Branch (13091:13): [True: 0, False: 0]
  |  Branch (13091:37): [True: 0, False: 0]
  ------------------
13092|       |        // If base is null, or base has an opaque path and c is not U+0023 (#),
13093|       |        // validation error, return failure.
13094|      0|        if (base_url == nullptr || (base_url->has_opaque_path && !c_is_hash)) {
  ------------------
  |  Branch (13094:13): [True: 0, False: 0]
  |  Branch (13094:37): [True: 0, False: 0]
  |  Branch (13094:66): [True: 0, False: 0]
  ------------------
13095|      0|          ada_log("NO_SCHEME validation error");
13096|      0|          url.is_valid = false;
13097|      0|          return url;
13098|      0|        }
13099|       |        // Otherwise, if base has an opaque path and c is U+0023 (#),
13100|       |        // set url's scheme to base's scheme, url's path to base's path, url's
13101|       |        // query to base's query, and set state to fragment state.
13102|      0|        else if (base_url->has_opaque_path && c_is_hash) {
  ------------------
  |  Branch (13102:18): [True: 0, False: 0]
  |  Branch (13102:47): [True: 0, False: 0]
  ------------------
13103|      0|          ada_log("NO_SCHEME opaque base with fragment");
13104|      0|          url.copy_scheme(*base_url);
13105|      0|          url.has_opaque_path = base_url->has_opaque_path;
13106|       |
13107|       |          if constexpr (result_type_is_ada_url) {
13108|       |            url.path = base_url->path;
13109|       |            url.query = base_url->query;
13110|      0|          } else {
13111|      0|            url.update_base_pathname(base_url->get_pathname());
13112|      0|            if (base_url->has_search()) {
  ------------------
  |  Branch (13112:17): [True: 0, False: 0]
  ------------------
13113|       |              // get_search() returns "" for an empty query string (URL ends
13114|       |              // with '?'). update_base_search("") would incorrectly clear the
13115|       |              // query, so pass "?" to preserve the empty query distinction.
13116|      0|              auto s = base_url->get_search();
13117|      0|              url.update_base_search(s.empty() ? std::string_view("?") : s);
  ------------------
  |  Branch (13117:38): [True: 0, False: 0]
  ------------------
13118|      0|            }
13119|      0|          }
13120|      0|          url.update_unencoded_base_hash(*fragment);
13121|      0|          enforce_max_input_length();
13122|      0|          return url;
13123|      0|        }
13124|       |        // Otherwise, if base's scheme is not "file", set state to relative
13125|       |        // state and decrease pointer by 1.
13126|       |        // NOLINTNEXTLINE(bugprone-branch-clone)
13127|      0|        else if (base_url->type != scheme::type::FILE) {
  ------------------
  |  Branch (13127:18): [True: 0, False: 0]
  ------------------
13128|      0|          ada_log("NO_SCHEME non-file relative path");
13129|      0|          state = state::RELATIVE_SCHEME;
13130|      0|        }
13131|       |        // Otherwise, set state to file state and decrease pointer by 1.
13132|      0|        else {
13133|      0|          ada_log("NO_SCHEME file base type");
13134|      0|          state = state::FILE;
13135|      0|        }
13136|      0|        break;
13137|      0|      }
13138|  12.1k|      case state::AUTHORITY: {
  ------------------
  |  Branch (13138:7): [True: 12.1k, False: 51.6k]
  ------------------
13139|  12.1k|        ada_log("AUTHORITY ", helpers::substring(url_data, input_position));
13140|       |        // most URLs have no @. Having no @ tells us that we don't have to worry
13141|       |        // about AUTHORITY. Of course, we could have @ and still not have to
13142|       |        // worry about AUTHORITY.
13143|       |        // TODO: Instead of just collecting a bool, collect the location of the
13144|       |        // '@' and do something useful with it.
13145|       |        // TODO: We could do various processing early on, using a single pass
13146|       |        // over the string to collect information about it, e.g., telling us
13147|       |        // whether there is a @ and if so, where (or how many).
13148|       |
13149|       |        // Check if url data contains an @.
13150|  12.1k|        if (url_data.find('@', input_position) == std::string_view::npos) {
  ------------------
  |  Branch (13150:13): [True: 11.8k, False: 257]
  ------------------
13151|  11.8k|          state = state::HOST;
13152|  11.8k|          break;
13153|  11.8k|        }
13154|    257|        bool at_sign_seen{false};
13155|    257|        bool password_token_seen{false};
13156|       |        /**
13157|       |         * We expect something of the sort...
13158|       |         * https://user:pass@example.com:1234/foo/bar?baz#quux
13159|       |         * --------^
13160|       |         */
13161|  2.02k|        do {
13162|  2.02k|          std::string_view view = url_data.substr(input_position);
13163|       |          // The delimiters are @, /, ? \\.
13164|  2.02k|          size_t location =
13165|  2.02k|              url.is_special() ? helpers::find_authority_delimiter_special(view)
  ------------------
  |  Branch (13165:15): [True: 2.02k, False: 0]
  ------------------
13166|  2.02k|                               : helpers::find_authority_delimiter(view);
13167|  2.02k|          std::string_view authority_view = view.substr(0, location);
13168|  2.02k|          size_t end_of_authority = input_position + authority_view.size();
13169|       |          // If c is U+0040 (@), then:
13170|  2.02k|          if ((end_of_authority != input_size) &&
  ------------------
  |  Branch (13170:15): [True: 2.00k, False: 28]
  ------------------
13171|  2.00k|              (url_data[end_of_authority] == '@')) {
  ------------------
  |  Branch (13171:15): [True: 1.77k, False: 229]
  ------------------
13172|       |            // If atSignSeen is true, then prepend "%40" to buffer.
13173|  1.77k|            if (at_sign_seen) {
  ------------------
  |  Branch (13173:17): [True: 1.53k, False: 237]
  ------------------
13174|  1.53k|              if (password_token_seen) {
  ------------------
  |  Branch (13174:19): [True: 430, False: 1.10k]
  ------------------
13175|       |                if constexpr (result_type_is_ada_url) {
13176|       |                  url.password += "%40";
13177|    430|                } else {
13178|    430|                  url.append_base_password("%40");
13179|    430|                }
13180|  1.10k|              } else {
13181|       |                if constexpr (result_type_is_ada_url) {
13182|       |                  url.username += "%40";
13183|  1.10k|                } else {
13184|  1.10k|                  url.append_base_username("%40");
13185|  1.10k|                }
13186|  1.10k|              }
13187|  1.53k|            }
13188|       |
13189|  1.77k|            at_sign_seen = true;
13190|       |
13191|  1.77k|            if (!password_token_seen) {
  ------------------
  |  Branch (13191:17): [True: 1.34k, False: 430]
  ------------------
13192|  1.34k|              size_t password_token_location = authority_view.find(':');
13193|  1.34k|              password_token_seen =
13194|  1.34k|                  password_token_location != std::string_view::npos;
13195|       |
13196|  1.34k|              if constexpr (store_values) {
13197|  1.34k|                if (!password_token_seen) {
  ------------------
  |  Branch (13197:21): [True: 1.27k, False: 68]
  ------------------
13198|       |                  if constexpr (result_type_is_ada_url) {
13199|       |                    url.username += unicode::percent_encode(
13200|       |                        authority_view,
13201|       |                        character_sets::USERINFO_PERCENT_ENCODE);
13202|  1.27k|                  } else {
13203|  1.27k|                    url.append_base_username(unicode::percent_encode(
13204|  1.27k|                        authority_view,
13205|  1.27k|                        character_sets::USERINFO_PERCENT_ENCODE));
13206|  1.27k|                  }
13207|  1.27k|                } else {
13208|       |                  if constexpr (result_type_is_ada_url) {
13209|       |                    url.username += unicode::percent_encode(
13210|       |                        authority_view.substr(0, password_token_location),
13211|       |                        character_sets::USERINFO_PERCENT_ENCODE);
13212|       |                    url.password += unicode::percent_encode(
13213|       |                        authority_view.substr(password_token_location + 1),
13214|       |                        character_sets::USERINFO_PERCENT_ENCODE);
13215|     68|                  } else {
13216|     68|                    url.append_base_username(unicode::percent_encode(
13217|     68|                        authority_view.substr(0, password_token_location),
13218|     68|                        character_sets::USERINFO_PERCENT_ENCODE));
13219|     68|                    url.append_base_password(unicode::percent_encode(
13220|     68|                        authority_view.substr(password_token_location + 1),
13221|     68|                        character_sets::USERINFO_PERCENT_ENCODE));
13222|     68|                  }
13223|     68|                }
13224|  1.34k|              }
13225|  1.34k|            } else if constexpr (store_values) {
13226|       |              if constexpr (result_type_is_ada_url) {
13227|       |                url.password += unicode::percent_encode(
13228|       |                    authority_view, character_sets::USERINFO_PERCENT_ENCODE);
13229|    430|              } else {
13230|    430|                url.append_base_password(unicode::percent_encode(
13231|    430|                    authority_view, character_sets::USERINFO_PERCENT_ENCODE));
13232|    430|              }
13233|    430|            }
13234|  1.77k|          }
13235|       |          // Otherwise, if one of the following is true:
13236|       |          // - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#)
13237|       |          // - url is special and c is U+005C (\)
13238|    257|          else if (end_of_authority == input_size ||
  ------------------
  |  Branch (13238:20): [True: 28, False: 229]
  ------------------
13239|    229|                   url_data[end_of_authority] == '/' ||
  ------------------
  |  Branch (13239:20): [True: 207, False: 22]
  ------------------
13240|     22|                   url_data[end_of_authority] == '?' ||
  ------------------
  |  Branch (13240:20): [True: 21, False: 1]
  ------------------
13241|    257|                   (url.is_special() && url_data[end_of_authority] == '\\')) {
  ------------------
  |  Branch (13241:21): [True: 1, False: 0]
  |  Branch (13241:41): [True: 1, False: 0]
  ------------------
13242|       |            // If atSignSeen is true and authority_view is the empty string,
13243|       |            // validation error, return failure.
13244|    257|            if (at_sign_seen && authority_view.empty()) {
  ------------------
  |  Branch (13244:17): [True: 237, False: 20]
  |  Branch (13244:33): [True: 8, False: 229]
  ------------------
13245|      8|              url.is_valid = false;
13246|      8|              return url;
13247|      8|            }
13248|    249|            state = state::HOST;
13249|    249|            break;
13250|    257|          }
13251|  1.77k|          if (end_of_authority == input_size) {
  ------------------
  |  Branch (13251:15): [True: 0, False: 1.77k]
  ------------------
13252|      0|            if constexpr (store_values) {
13253|      0|              if (fragment.has_value()) {
  ------------------
  |  Branch (13253:19): [True: 0, False: 0]
  ------------------
13254|      0|                url.update_unencoded_base_hash(*fragment);
13255|      0|              }
13256|      0|            }
13257|      0|            enforce_max_input_length();
13258|      0|            return url;
13259|      0|          }
13260|  1.77k|          input_position = end_of_authority + 1;
13261|  1.77k|        } while (true);
  ------------------
  |  Branch (13261:18): [True: 1.77k, Folded]
  ------------------
13262|       |
13263|    249|        break;
13264|    257|      }
13265|    249|      case state::SPECIAL_RELATIVE_OR_AUTHORITY: {
  ------------------
  |  Branch (13265:7): [True: 0, False: 63.7k]
  ------------------
13266|      0|        ada_log("SPECIAL_RELATIVE_OR_AUTHORITY ",
13267|      0|                helpers::substring(url_data, input_position));
13268|       |
13269|       |        // If c is U+002F (/) and remaining starts with U+002F (/),
13270|       |        // then set state to special authority ignore slashes state and increase
13271|       |        // pointer by 1.
13272|      0|        if (url_data.substr(input_position, 2) == "//") {
  ------------------
  |  Branch (13272:13): [True: 0, False: 0]
  ------------------
13273|      0|          state = state::SPECIAL_AUTHORITY_IGNORE_SLASHES;
13274|      0|          input_position += 2;
13275|      0|        } else {
13276|       |          // Otherwise, validation error, set state to relative state and
13277|       |          // decrease pointer by 1.
13278|      0|          state = state::RELATIVE_SCHEME;
13279|      0|        }
13280|       |
13281|      0|        break;
13282|    257|      }
13283|      0|      case state::PATH_OR_AUTHORITY: {
  ------------------
  |  Branch (13283:7): [True: 0, False: 63.7k]
  ------------------
13284|      0|        ada_log("PATH_OR_AUTHORITY ",
13285|      0|                helpers::substring(url_data, input_position));
13286|       |
13287|       |        // If c is U+002F (/), then set state to authority state.
13288|      0|        if ((input_position != input_size) &&
  ------------------
  |  Branch (13288:13): [True: 0, False: 0]
  ------------------
13289|      0|            (url_data[input_position] == '/')) {
  ------------------
  |  Branch (13289:13): [True: 0, False: 0]
  ------------------
13290|      0|          state = state::AUTHORITY;
13291|      0|          input_position++;
13292|      0|        } else {
13293|       |          // Otherwise, set state to path state, and decrease pointer by 1.
13294|      0|          state = state::PATH;
13295|      0|        }
13296|       |
13297|      0|        break;
13298|    257|      }
13299|      0|      case state::RELATIVE_SCHEME: {
  ------------------
  |  Branch (13299:7): [True: 0, False: 63.7k]
  ------------------
13300|      0|        ada_log("RELATIVE_SCHEME ",
13301|      0|                helpers::substring(url_data, input_position));
13302|       |
13303|       |        // Set url's scheme to base's scheme.
13304|      0|        url.copy_scheme(*base_url);
13305|       |
13306|       |        // If c is U+002F (/), then set state to relative slash state.
13307|      0|        if ((input_position != input_size) &&
  ------------------
  |  Branch (13307:13): [True: 0, False: 0]
  ------------------
13308|       |            // NOLINTNEXTLINE(bugprone-branch-clone)
13309|      0|            (url_data[input_position] == '/')) {
  ------------------
  |  Branch (13309:13): [True: 0, False: 0]
  ------------------
13310|      0|          ada_log(
13311|      0|              "RELATIVE_SCHEME if c is U+002F (/), then set state to relative "
13312|      0|              "slash state");
13313|      0|          state = state::RELATIVE_SLASH;
13314|      0|        } else if (url.is_special() && (input_position != input_size) &&
  ------------------
  |  Branch (13314:20): [True: 0, False: 0]
  |  Branch (13314:40): [True: 0, False: 0]
  ------------------
13315|      0|                   (url_data[input_position] == '\\')) {
  ------------------
  |  Branch (13315:20): [True: 0, False: 0]
  ------------------
13316|       |          // Otherwise, if url is special and c is U+005C (\), validation error,
13317|       |          // set state to relative slash state.
13318|      0|          ada_log(
13319|      0|              "RELATIVE_SCHEME  if url is special and c is U+005C, validation "
13320|      0|              "error, set state to relative slash state");
13321|      0|          state = state::RELATIVE_SLASH;
13322|      0|        } else {
13323|      0|          ada_log("RELATIVE_SCHEME otherwise");
13324|       |          // Set url's username to base's username, url's password to base's
13325|       |          // password, url's host to base's host, url's port to base's port,
13326|       |          // url's path to a clone of base's path, and url's query to base's
13327|       |          // query.
13328|       |          if constexpr (result_type_is_ada_url) {
13329|       |            url.username = base_url->username;
13330|       |            url.password = base_url->password;
13331|       |            url.host = base_url->host;
13332|       |            url.port = base_url->port;
13333|       |            // cloning the base path includes cloning the has_opaque_path flag
13334|       |            url.has_opaque_path = base_url->has_opaque_path;
13335|       |            url.path = base_url->path;
13336|       |            url.query = base_url->query;
13337|      0|          } else {
13338|      0|            url.update_base_authority(base_url->get_href(),
13339|      0|                                      base_url->get_components());
13340|      0|            url.update_host_to_base_host(base_url->get_hostname());
13341|      0|            url.update_base_port(base_url->retrieve_base_port());
13342|       |            // cloning the base path includes cloning the has_opaque_path flag
13343|      0|            url.has_opaque_path = base_url->has_opaque_path;
13344|      0|            url.update_base_pathname(base_url->get_pathname());
13345|      0|            if (base_url->has_search()) {
  ------------------
  |  Branch (13345:17): [True: 0, False: 0]
  ------------------
13346|       |              // get_search() returns "" for an empty query string (URL ends
13347|       |              // with '?'). update_base_search("") would incorrectly clear the
13348|       |              // query, so pass "?" to preserve the empty query distinction.
13349|      0|              auto s = base_url->get_search();
13350|      0|              url.update_base_search(s.empty() ? std::string_view("?") : s);
  ------------------
  |  Branch (13350:38): [True: 0, False: 0]
  ------------------
13351|      0|            }
13352|      0|          }
13353|       |
13354|      0|          url.has_opaque_path = base_url->has_opaque_path;
13355|       |
13356|       |          // If c is U+003F (?), then set url's query to the empty string, and
13357|       |          // state to query state.
13358|      0|          if ((input_position != input_size) &&
  ------------------
  |  Branch (13358:15): [True: 0, False: 0]
  ------------------
13359|      0|              (url_data[input_position] == '?')) {
  ------------------
  |  Branch (13359:15): [True: 0, False: 0]
  ------------------
13360|      0|            state = state::QUERY;
13361|      0|          }
13362|       |          // Otherwise, if c is not the EOF code point:
13363|      0|          else if (input_position != input_size) {
  ------------------
  |  Branch (13363:20): [True: 0, False: 0]
  ------------------
13364|       |            // Set url's query to null.
13365|      0|            url.clear_search();
13366|       |            if constexpr (result_type_is_ada_url) {
13367|       |              // Shorten url's path.
13368|       |              helpers::shorten_path(url.path, url.type);
13369|      0|            } else {
13370|      0|              std::string_view path = url.get_pathname();
13371|      0|              if (helpers::shorten_path(path, url.type)) {
  ------------------
  |  Branch (13371:19): [True: 0, False: 0]
  ------------------
13372|      0|                url.update_base_pathname(std::move(std::string(path)));
13373|      0|              }
13374|      0|            }
13375|       |            // Set state to path state and decrease pointer by 1.
13376|      0|            state = state::PATH;
13377|      0|            break;
13378|      0|          }
13379|      0|        }
13380|      0|        input_position++;
13381|      0|        break;
13382|      0|      }
13383|      0|      case state::RELATIVE_SLASH: {
  ------------------
  |  Branch (13383:7): [True: 0, False: 63.7k]
  ------------------
13384|      0|        ada_log("RELATIVE_SLASH ",
13385|      0|                helpers::substring(url_data, input_position));
13386|       |
13387|       |        // If url is special and c is U+002F (/) or U+005C (\), then:
13388|       |        // NOLINTNEXTLINE(bugprone-branch-clone)
13389|      0|        if (url.is_special() && (input_position != input_size) &&
  ------------------
  |  Branch (13389:13): [True: 0, False: 0]
  |  Branch (13389:33): [True: 0, False: 0]
  ------------------
13390|      0|            (url_data[input_position] == '/' ||
  ------------------
  |  Branch (13390:14): [True: 0, False: 0]
  ------------------
13391|      0|             url_data[input_position] == '\\')) {
  ------------------
  |  Branch (13391:14): [True: 0, False: 0]
  ------------------
13392|       |          // Set state to special authority ignore slashes state.
13393|      0|          state = state::SPECIAL_AUTHORITY_IGNORE_SLASHES;
13394|      0|        }
13395|       |        // Otherwise, if c is U+002F (/), then set state to authority state.
13396|      0|        else if ((input_position != input_size) &&
  ------------------
  |  Branch (13396:18): [True: 0, False: 0]
  ------------------
13397|      0|                 (url_data[input_position] == '/')) {
  ------------------
  |  Branch (13397:18): [True: 0, False: 0]
  ------------------
13398|      0|          state = state::AUTHORITY;
13399|      0|        }
13400|       |        // Otherwise, set
13401|       |        // - url's username to base's username,
13402|       |        // - url's password to base's password,
13403|       |        // - url's host to base's host,
13404|       |        // - url's port to base's port,
13405|       |        // - state to path state, and then, decrease pointer by 1.
13406|      0|        else {
13407|       |          if constexpr (result_type_is_ada_url) {
13408|       |            url.username = base_url->username;
13409|       |            url.password = base_url->password;
13410|       |            url.host = base_url->host;
13411|       |            url.port = base_url->port;
13412|      0|          } else {
13413|      0|            url.update_base_authority(base_url->get_href(),
13414|      0|                                      base_url->get_components());
13415|      0|            url.update_host_to_base_host(base_url->get_hostname());
13416|      0|            url.update_base_port(base_url->retrieve_base_port());
13417|      0|          }
13418|      0|          state = state::PATH;
13419|      0|          break;
13420|      0|        }
13421|       |
13422|      0|        input_position++;
13423|      0|        break;
13424|      0|      }
13425|  12.1k|      case state::SPECIAL_AUTHORITY_SLASHES: {
  ------------------
  |  Branch (13425:7): [True: 12.1k, False: 51.6k]
  ------------------
13426|  12.1k|        ada_log("SPECIAL_AUTHORITY_SLASHES ",
13427|  12.1k|                helpers::substring(url_data, input_position));
13428|       |
13429|       |        // If c is U+002F (/) and remaining starts with U+002F (/),
13430|       |        // then set state to special authority ignore slashes state and increase
13431|       |        // pointer by 1.
13432|  12.1k|        if (url_data.substr(input_position, 2) == "//") {
  ------------------
  |  Branch (13432:13): [True: 12.1k, False: 0]
  ------------------
13433|  12.1k|          input_position += 2;
13434|  12.1k|        }
13435|       |
13436|  12.1k|        [[fallthrough]];
13437|  12.1k|      }
13438|  12.1k|      case state::SPECIAL_AUTHORITY_IGNORE_SLASHES: {
  ------------------
  |  Branch (13438:7): [True: 0, False: 63.7k]
  ------------------
13439|  12.1k|        ada_log("SPECIAL_AUTHORITY_IGNORE_SLASHES ",
13440|  12.1k|                helpers::substring(url_data, input_position));
13441|       |
13442|       |        // If c is neither U+002F (/) nor U+005C (\), then set state to
13443|       |        // authority state and decrease pointer by 1.
13444|  12.3k|        while ((input_position != input_size) &&
  ------------------
  |  Branch (13444:16): [True: 12.3k, False: 1]
  ------------------
13445|  12.3k|               ((url_data[input_position] == '/') ||
  ------------------
  |  Branch (13445:17): [True: 81, False: 12.2k]
  ------------------
13446|  12.2k|                (url_data[input_position] == '\\'))) {
  ------------------
  |  Branch (13446:17): [True: 173, False: 12.1k]
  ------------------
13447|    254|          input_position++;
13448|    254|        }
13449|  12.1k|        state = state::AUTHORITY;
13450|       |
13451|  12.1k|        break;
13452|  12.1k|      }
13453|    425|      case state::QUERY: {
  ------------------
  |  Branch (13453:7): [True: 425, False: 63.3k]
  ------------------
13454|    425|        ada_log("QUERY ", helpers::substring(url_data, input_position));
13455|    425|        if constexpr (store_values) {
13456|       |          // Let queryPercentEncodeSet be the special-query percent-encode set
13457|       |          // if url is special; otherwise the query percent-encode set.
13458|    425|          const uint8_t* query_percent_encode_set =
13459|    425|              url.is_special() ? character_sets::SPECIAL_QUERY_PERCENT_ENCODE
  ------------------
  |  Branch (13459:15): [True: 425, False: 0]
  ------------------
13460|    425|                               : character_sets::QUERY_PERCENT_ENCODE;
13461|       |
13462|       |          // Percent-encode after encoding, with encoding, buffer, and
13463|       |          // queryPercentEncodeSet, and append the result to url's query.
13464|    425|          url.update_base_search(url_data.substr(input_position),
13465|    425|                                 query_percent_encode_set);
13466|    425|          ada_log("QUERY update_base_search completed ");
13467|    425|          if (fragment.has_value()) {
  ------------------
  |  Branch (13467:15): [True: 10, False: 415]
  ------------------
13468|     10|            url.update_unencoded_base_hash(*fragment);
13469|     10|          }
13470|    425|        }
13471|    425|        enforce_max_input_length();
13472|    425|        return url;
13473|  12.1k|      }
13474|  12.0k|      case state::HOST: {
  ------------------
  |  Branch (13474:7): [True: 12.0k, False: 51.6k]
  ------------------
13475|  12.0k|        ada_log("HOST ", helpers::substring(url_data, input_position));
13476|       |
13477|  12.0k|        std::string_view host_view = url_data.substr(input_position);
13478|  12.0k|        auto [location, found_colon] =
13479|  12.0k|            helpers::get_host_delimiter_location(url.is_special(), host_view);
13480|  12.0k|        input_position = (location != std::string_view::npos)
  ------------------
  |  Branch (13480:26): [True: 12.0k, False: 0]
  ------------------
13481|  12.0k|                             ? input_position + location
13482|  12.0k|                             : input_size;
13483|       |        // Otherwise, if c is U+003A (:) and insideBrackets is false, then:
13484|       |        // Note: the 'found_colon' value is true if and only if a colon was
13485|       |        // encountered while not inside brackets.
13486|  12.0k|        if (found_colon) {
  ------------------
  |  Branch (13486:13): [True: 759, False: 11.3k]
  ------------------
13487|       |          // If buffer is the empty string, validation error, return failure.
13488|       |          // Let host be the result of host parsing buffer with url is not
13489|       |          // special.
13490|    759|          ada_log("HOST parsing ", host_view);
13491|    759|          if (!url.parse_host(host_view)) {
  ------------------
  |  Branch (13491:15): [True: 155, False: 604]
  ------------------
13492|    155|            return url;
13493|    155|          }
13494|    604|          ada_log("HOST parsing results in ", url.get_hostname());
13495|       |          // Set url's host to host, buffer to the empty string, and state to
13496|       |          // port state.
13497|    604|          state = state::PORT;
13498|    604|          input_position++;
13499|    604|        }
13500|       |        // Otherwise, if one of the following is true:
13501|       |        // - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#)
13502|       |        // - url is special and c is U+005C (\)
13503|       |        // The get_host_delimiter_location function either brings us to
13504|       |        // the colon outside of the bracket, or to one of those characters.
13505|  11.3k|        else {
13506|       |          // If url is special and host_view is the empty string, validation
13507|       |          // error, return failure.
13508|  11.3k|          if (host_view.empty() && url.is_special()) {
  ------------------
  |  Branch (13508:15): [True: 5, False: 11.3k]
  |  Branch (13508:36): [True: 5, False: 0]
  ------------------
13509|      5|            url.is_valid = false;
13510|      5|            return url;
13511|      5|          }
13512|  11.3k|          ada_log("HOST parsing ", host_view, " href=", url.get_href());
13513|       |          // Let host be the result of host parsing host_view with url is not
13514|       |          // special.
13515|  11.3k|          if (host_view.empty()) {
  ------------------
  |  Branch (13515:15): [True: 0, False: 11.3k]
  ------------------
13516|      0|            url.update_base_hostname("");
13517|  11.3k|          } else if (!url.parse_host(host_view)) {
  ------------------
  |  Branch (13517:22): [True: 10.2k, False: 1.11k]
  ------------------
13518|  10.2k|            return url;
13519|  10.2k|          }
13520|  1.11k|          ada_log("HOST parsing results in ", url.get_hostname(),
13521|  1.11k|                  " href=", url.get_href());
13522|       |
13523|       |          // Set url's host to host, and state to path start state.
13524|  1.11k|          state = state::PATH_START;
13525|  1.11k|        }
13526|       |
13527|  1.71k|        break;
13528|  12.0k|      }
13529|  1.71k|      case state::OPAQUE_PATH: {
  ------------------
  |  Branch (13529:7): [True: 0, False: 63.7k]
  ------------------
13530|      0|        ada_log("OPAQUE_PATH ", helpers::substring(url_data, input_position));
13531|       |        // Opaque path, query, and fragment are structurally always valid:
13532|       |        // the parser would just percent-encode whatever is there. When we
13533|       |        // are not storing values (can_parse), we can return immediately.
13534|       |        // We must set has_opaque_path = true before returning so that when
13535|       |        // this URL is used as an internal base inside can_parse, NO_SCHEME
13536|       |        // correctly rejects relative inputs against an opaque-path base
13537|       |        // (e.g. can_parse("", &"W:") must return false).
13538|       |        if constexpr (!store_values) {
13539|       |          url.has_opaque_path = true;
13540|       |          return url;
13541|       |        }
13542|      0|        std::string_view view = url_data.substr(input_position);
13543|       |        // If c is U+003F (?), then set url's query to the empty string and
13544|       |        // state to query state.
13545|      0|        size_t location = view.find('?');
13546|      0|        if (location != std::string_view::npos) {
  ------------------
  |  Branch (13546:13): [True: 0, False: 0]
  ------------------
13547|      0|          view.remove_suffix(view.size() - location);
13548|      0|          state = state::QUERY;
13549|      0|          input_position += location + 1;
13550|      0|        } else {
13551|      0|          input_position = input_size + 1;
13552|      0|        }
13553|      0|        url.has_opaque_path = true;
13554|       |
13555|       |        // This is a really unlikely scenario in real world. We should not seek
13556|       |        // to optimize it.
13557|      0|        if (view.ends_with(' ')) {
  ------------------
  |  Branch (13557:13): [True: 0, False: 0]
  ------------------
13558|      0|          std::string modified_view =
13559|      0|              std::string(view.substr(0, view.size() - 1)) + "%20";
13560|      0|          url.update_base_pathname(unicode::percent_encode(
13561|      0|              modified_view, character_sets::C0_CONTROL_PERCENT_ENCODE));
13562|      0|        } else {
13563|      0|          url.update_base_pathname(unicode::percent_encode(
13564|      0|              view, character_sets::C0_CONTROL_PERCENT_ENCODE));
13565|      0|        }
13566|      0|        break;
13567|  12.0k|      }
13568|    604|      case state::PORT: {
  ------------------
  |  Branch (13568:7): [True: 604, False: 63.1k]
  ------------------
13569|    604|        ada_log("PORT ", helpers::substring(url_data, input_position));
13570|    604|        std::string_view port_view = url_data.substr(input_position);
13571|    604|        input_position += url.parse_port(port_view, true);
13572|    604|        if (!url.is_valid) {
  ------------------
  |  Branch (13572:13): [True: 511, False: 93]
  ------------------
13573|    511|          return url;
13574|    511|        }
13575|     93|        state = state::PATH_START;
13576|     93|        [[fallthrough]];
13577|     93|      }
13578|  1.20k|      case state::PATH_START: {
  ------------------
  |  Branch (13578:7): [True: 1.11k, False: 62.6k]
  ------------------
13579|  1.20k|        ada_log("PATH_START ", helpers::substring(url_data, input_position));
13580|       |        // Path, query, and fragment are structurally always valid: the
13581|       |        // parser would just percent-encode whatever is there. When we are
13582|       |        // not storing values (can_parse), we can return immediately since
13583|       |        // no subsequent state can invalidate the URL.
13584|       |        if constexpr (!store_values) {
13585|       |          return url;
13586|       |        }
13587|       |
13588|       |        // If url is special, then:
13589|  1.20k|        if (url.is_special()) {
  ------------------
  |  Branch (13589:13): [True: 1.20k, False: 0]
  ------------------
13590|       |          // Set state to path state.
13591|  1.20k|          state = state::PATH;
13592|       |
13593|       |          // Optimization: Avoiding going into PATH state improves the
13594|       |          // performance of urls ending with /.
13595|  1.20k|          if (input_position == input_size) {
  ------------------
  |  Branch (13595:15): [True: 105, False: 1.10k]
  ------------------
13596|    105|            if constexpr (store_values) {
13597|    105|              url.update_base_pathname("/");
13598|    105|              if (fragment.has_value()) {
  ------------------
  |  Branch (13598:19): [True: 105, False: 0]
  ------------------
13599|    105|                url.update_unencoded_base_hash(*fragment);
13600|    105|              }
13601|    105|            }
13602|    105|            enforce_max_input_length();
13603|    105|            return url;
13604|    105|          }
13605|       |          // If c is neither U+002F (/) nor U+005C (\), then decrease pointer
13606|       |          // by 1. We know that (input_position == input_size) is impossible
13607|       |          // here, because of the previous if-check.
13608|  1.10k|          if ((url_data[input_position] != '/') &&
  ------------------
  |  Branch (13608:15): [True: 108, False: 994]
  ------------------
13609|    108|              (url_data[input_position] != '\\')) {
  ------------------
  |  Branch (13609:15): [True: 105, False: 3]
  ------------------
13610|    105|            break;
13611|    105|          }
13612|  1.10k|        }
13613|       |        // Otherwise, if state override is not given and c is U+003F (?),
13614|       |        // set url's query to the empty string and state to query state.
13615|      0|        else if ((input_position != input_size) &&
  ------------------
  |  Branch (13615:18): [True: 0, False: 0]
  ------------------
13616|      0|                 (url_data[input_position] == '?')) {
  ------------------
  |  Branch (13616:18): [True: 0, False: 0]
  ------------------
13617|      0|          state = state::QUERY;
13618|      0|        }
13619|       |        // Otherwise, if c is not the EOF code point:
13620|      0|        else if (input_position != input_size) {
  ------------------
  |  Branch (13620:18): [True: 0, False: 0]
  ------------------
13621|       |          // Set state to path state.
13622|      0|          state = state::PATH;
13623|       |
13624|       |          // If c is not U+002F (/), then decrease pointer by 1.
13625|      0|          if (url_data[input_position] != '/') {
  ------------------
  |  Branch (13625:15): [True: 0, False: 0]
  ------------------
13626|      0|            break;
13627|      0|          }
13628|      0|        }
13629|       |
13630|    997|        input_position++;
13631|    997|        break;
13632|  1.20k|      }
13633|  1.10k|      case state::PATH: {
  ------------------
  |  Branch (13633:7): [True: 1.10k, False: 62.6k]
  ------------------
13634|  1.10k|        ada_log("PATH ", helpers::substring(url_data, input_position));
13635|       |        // Path, query, and fragment are structurally always valid: the
13636|       |        // parser would just percent-encode whatever is there. When we are
13637|       |        // not storing values (can_parse), we can return immediately since
13638|       |        // no subsequent state can invalidate the URL.
13639|       |        if constexpr (!store_values) {
13640|       |          return url;
13641|       |        }
13642|  1.10k|        std::string_view view = url_data.substr(input_position);
13643|       |
13644|       |        // Most time, we do not need percent encoding.
13645|       |        // Furthermore, we can immediately locate the '?'.
13646|  1.10k|        size_t locofquestionmark = view.find('?');
13647|  1.10k|        if (locofquestionmark != std::string_view::npos) {
  ------------------
  |  Branch (13647:13): [True: 425, False: 677]
  ------------------
13648|    425|          state = state::QUERY;
13649|    425|          view.remove_suffix(view.size() - locofquestionmark);
13650|    425|          input_position += locofquestionmark + 1;
13651|    677|        } else {
13652|    677|          input_position = input_size + 1;
13653|    677|        }
13654|  1.10k|        if constexpr (store_values) {
13655|       |          if constexpr (result_type_is_ada_url) {
13656|       |            helpers::parse_prepared_path(view, url.type, url.path);
13657|  1.10k|          } else {
13658|  1.10k|            url.consume_prepared_path(view);
13659|  1.10k|            ADA_ASSERT_TRUE(url.validate());
13660|  1.10k|          }
13661|  1.10k|        }
13662|  1.10k|        break;
13663|  1.20k|      }
13664|      0|      case state::FILE_SLASH: {
  ------------------
  |  Branch (13664:7): [True: 0, False: 63.7k]
  ------------------
13665|      0|        ada_log("FILE_SLASH ", helpers::substring(url_data, input_position));
13666|       |
13667|       |        // If c is U+002F (/) or U+005C (\), then:
13668|      0|        if ((input_position != input_size) &&
  ------------------
  |  Branch (13668:13): [True: 0, False: 0]
  ------------------
13669|      0|            (url_data[input_position] == '/' ||
  ------------------
  |  Branch (13669:14): [True: 0, False: 0]
  ------------------
13670|      0|             url_data[input_position] == '\\')) {
  ------------------
  |  Branch (13670:14): [True: 0, False: 0]
  ------------------
13671|      0|          ada_log("FILE_SLASH c is U+002F or U+005C");
13672|       |          // Set state to file host state.
13673|      0|          state = state::FILE_HOST;
13674|      0|          input_position++;
13675|      0|        } else {
13676|      0|          ada_log("FILE_SLASH otherwise");
13677|       |          // If base is non-null and base's scheme is "file", then:
13678|       |          // Note: it is unsafe to do base_url->scheme unless you know that
13679|       |          // base_url_has_value() is true.
13680|      0|          if (base_url != nullptr && base_url->type == scheme::type::FILE) {
  ------------------
  |  Branch (13680:15): [True: 0, False: 0]
  |  Branch (13680:38): [True: 0, False: 0]
  ------------------
13681|       |            // Set url's host to base's host.
13682|       |            if constexpr (result_type_is_ada_url) {
13683|       |              url.host = base_url->host;
13684|      0|            } else {
13685|      0|              url.update_host_to_base_host(base_url->get_host());
13686|      0|            }
13687|       |            // If the code point substring from pointer to the end of input does
13688|       |            // not start with a Windows drive letter and base's path[0] is a
13689|       |            // normalized Windows drive letter, then append base's path[0] to
13690|       |            // url's path.
13691|      0|            if (!base_url->get_pathname().empty()) {
  ------------------
  |  Branch (13691:17): [True: 0, False: 0]
  ------------------
13692|      0|              if (!checkers::is_windows_drive_letter(
  ------------------
  |  Branch (13692:19): [True: 0, False: 0]
  ------------------
13693|      0|                      url_data.substr(input_position))) {
13694|      0|                std::string_view first_base_url_path =
13695|      0|                    base_url->get_pathname().substr(1);
13696|      0|                size_t loc = first_base_url_path.find('/');
13697|      0|                if (loc != std::string_view::npos) {
  ------------------
  |  Branch (13697:21): [True: 0, False: 0]
  ------------------
13698|      0|                  helpers::resize(first_base_url_path, loc);
13699|      0|                }
13700|      0|                if (checkers::is_normalized_windows_drive_letter(
  ------------------
  |  Branch (13700:21): [True: 0, False: 0]
  ------------------
13701|      0|                        first_base_url_path)) {
13702|       |                  if constexpr (result_type_is_ada_url) {
13703|       |                    url.path += '/';
13704|       |                    url.path += first_base_url_path;
13705|      0|                  } else {
13706|      0|                    url.append_base_pathname(
13707|      0|                        helpers::concat("/", first_base_url_path));
13708|      0|                  }
13709|      0|                }
13710|      0|              }
13711|      0|            }
13712|      0|          }
13713|       |
13714|       |          // Set state to path state, and decrease pointer by 1.
13715|      0|          state = state::PATH;
13716|      0|        }
13717|       |
13718|      0|        break;
13719|  1.20k|      }
13720|      0|      case state::FILE_HOST: {
  ------------------
  |  Branch (13720:7): [True: 0, False: 63.7k]
  ------------------
13721|      0|        ada_log("FILE_HOST ", helpers::substring(url_data, input_position));
13722|      0|        std::string_view view = url_data.substr(input_position);
13723|       |
13724|      0|        size_t location = view.find_first_of("/\\?");
13725|      0|        std::string_view file_host_buffer = view.substr(
13726|      0|            0, (location != std::string_view::npos) ? location : view.size());
  ------------------
  |  Branch (13726:16): [True: 0, False: 0]
  ------------------
13727|       |
13728|      0|        if (checkers::is_windows_drive_letter(file_host_buffer)) {
  ------------------
  |  Branch (13728:13): [True: 0, False: 0]
  ------------------
13729|      0|          state = state::PATH;
13730|      0|        } else if (file_host_buffer.empty()) {
  ------------------
  |  Branch (13730:20): [True: 0, False: 0]
  ------------------
13731|       |          // Set url's host to the empty string.
13732|       |          if constexpr (result_type_is_ada_url) {
13733|       |            url.host = "";
13734|      0|          } else {
13735|      0|            url.update_base_hostname("");
13736|      0|          }
13737|       |          // Set state to path start state.
13738|      0|          state = state::PATH_START;
13739|      0|        } else {
13740|      0|          size_t consumed_bytes = file_host_buffer.size();
13741|      0|          input_position += consumed_bytes;
13742|       |          // Let host be the result of host parsing buffer with url is not
13743|       |          // special.
13744|      0|          if (!url.parse_host(file_host_buffer)) {
  ------------------
  |  Branch (13744:15): [True: 0, False: 0]
  ------------------
13745|      0|            return url;
13746|      0|          }
13747|       |
13748|       |          if constexpr (result_type_is_ada_url) {
13749|       |            // If host is "localhost", then set host to the empty string.
13750|       |            if (url.host.has_value() && url.host.value() == "localhost") {
13751|       |              url.host = "";
13752|       |            }
13753|      0|          } else {
13754|      0|            if (url.get_hostname() == "localhost") {
  ------------------
  |  Branch (13754:17): [True: 0, False: 0]
  ------------------
13755|      0|              url.update_base_hostname("");
13756|      0|            }
13757|      0|          }
13758|       |
13759|       |          // Set buffer to the empty string and state to path start state.
13760|      0|          state = state::PATH_START;
13761|      0|        }
13762|       |
13763|      0|        break;
13764|      0|      }
13765|      0|      case state::FILE: {
  ------------------
  |  Branch (13765:7): [True: 0, False: 63.7k]
  ------------------
13766|      0|        ada_log("FILE ", helpers::substring(url_data, input_position));
13767|      0|        std::string_view file_view = url_data.substr(input_position);
13768|       |
13769|      0|        url.set_protocol_as_file();
13770|       |        if constexpr (result_type_is_ada_url) {
13771|       |          // Set url's host to the empty string.
13772|       |          url.host = "";
13773|      0|        } else {
13774|      0|          url.update_base_hostname("");
13775|      0|        }
13776|       |        // If c is U+002F (/) or U+005C (\), then:
13777|      0|        if (input_position != input_size &&
  ------------------
  |  Branch (13777:13): [True: 0, False: 0]
  ------------------
13778|      0|            (url_data[input_position] == '/' ||
  ------------------
  |  Branch (13778:14): [True: 0, False: 0]
  ------------------
13779|      0|             url_data[input_position] == '\\')) {
  ------------------
  |  Branch (13779:14): [True: 0, False: 0]
  ------------------
13780|      0|          ada_log("FILE c is U+002F or U+005C");
13781|       |          // Set state to file slash state.
13782|      0|          state = state::FILE_SLASH;
13783|      0|        }
13784|       |        // Otherwise, if base is non-null and base's scheme is "file":
13785|      0|        else if (base_url != nullptr && base_url->type == scheme::type::FILE) {
  ------------------
  |  Branch (13785:18): [True: 0, False: 0]
  |  Branch (13785:41): [True: 0, False: 0]
  ------------------
13786|       |          // Set url's host to base's host, url's path to a clone of base's
13787|       |          // path, and url's query to base's query.
13788|      0|          ada_log("FILE base non-null");
13789|       |          if constexpr (result_type_is_ada_url) {
13790|       |            url.host = base_url->host;
13791|       |            url.path = base_url->path;
13792|       |            url.query = base_url->query;
13793|      0|          } else {
13794|      0|            url.update_host_to_base_host(base_url->get_hostname());
13795|      0|            url.update_base_pathname(base_url->get_pathname());
13796|      0|            if (base_url->has_search()) {
  ------------------
  |  Branch (13796:17): [True: 0, False: 0]
  ------------------
13797|       |              // get_search() returns "" for an empty query string (URL ends
13798|       |              // with '?'). update_base_search("") would incorrectly clear the
13799|       |              // query, so pass "?" to preserve the empty query distinction.
13800|      0|              auto s = base_url->get_search();
13801|      0|              url.update_base_search(s.empty() ? std::string_view("?") : s);
  ------------------
  |  Branch (13801:38): [True: 0, False: 0]
  ------------------
13802|      0|            }
13803|      0|          }
13804|      0|          url.has_opaque_path = base_url->has_opaque_path;
13805|       |
13806|       |          // If c is U+003F (?), then set url's query to the empty string and
13807|       |          // state to query state.
13808|      0|          if (input_position != input_size && url_data[input_position] == '?') {
  ------------------
  |  Branch (13808:15): [True: 0, False: 0]
  |  Branch (13808:47): [True: 0, False: 0]
  ------------------
13809|      0|            state = state::QUERY;
13810|      0|          }
13811|       |          // Otherwise, if c is not the EOF code point:
13812|      0|          else if (input_position != input_size) {
  ------------------
  |  Branch (13812:20): [True: 0, False: 0]
  ------------------
13813|       |            // Set url's query to null.
13814|      0|            url.clear_search();
13815|       |            // If the code point substring from pointer to the end of input does
13816|       |            // not start with a Windows drive letter, then shorten url's path.
13817|      0|            if (!checkers::is_windows_drive_letter(file_view)) {
  ------------------
  |  Branch (13817:17): [True: 0, False: 0]
  ------------------
13818|       |              if constexpr (result_type_is_ada_url) {
13819|       |                helpers::shorten_path(url.path, url.type);
13820|      0|              } else {
13821|      0|                std::string_view path = url.get_pathname();
13822|      0|                if (helpers::shorten_path(path, url.type)) {
  ------------------
  |  Branch (13822:21): [True: 0, False: 0]
  ------------------
13823|      0|                  url.update_base_pathname(std::move(std::string(path)));
13824|      0|                }
13825|      0|              }
13826|      0|            }
13827|       |            // Otherwise:
13828|      0|            else {
13829|       |              // Set url's path to an empty list.
13830|      0|              url.clear_pathname();
13831|      0|              url.has_opaque_path = true;
13832|      0|            }
13833|       |
13834|       |            // Set state to path state and decrease pointer by 1.
13835|      0|            state = state::PATH;
13836|      0|            break;
13837|      0|          }
13838|      0|        }
13839|       |        // Otherwise, set state to path state, and decrease pointer by 1.
13840|      0|        else {
13841|      0|          ada_log("FILE go to path");
13842|      0|          state = state::PATH;
13843|      0|          break;
13844|      0|        }
13845|       |
13846|      0|        input_position++;
13847|      0|        break;
13848|      0|      }
13849|      0|      default:
  ------------------
  |  Branch (13849:7): [True: 0, False: 63.7k]
  ------------------
13850|      0|        unreachable();
13851|  63.7k|    }
13852|  63.7k|  }
13853|  1.99k|  if constexpr (store_values) {
13854|  1.99k|    if (fragment.has_value()) {
  ------------------
  |  Branch (13854:9): [True: 26, False: 1.96k]
  ------------------
13855|     26|      url.update_unencoded_base_hash(*fragment);
13856|     26|    }
13857|  1.99k|  }
13858|  1.99k|  enforce_max_input_length();
13859|  1.99k|  return url;
13860|  13.4k|}
_ZNK3ada14url_aggregator12get_hostnameEv:
14876|  3.06k|    ada_lifetime_bound {
14877|  3.06k|  ada_log("url_aggregator::get_hostname");
14878|       |  // Technically, we should check if there is a hostname, but
14879|       |  // the code below works even if there isn't.
14880|       |  // if(!has_hostname()) { return ""; }
14881|  3.06k|  size_t start = components.host_start;
14882|       |  // So host_start is not where the host begins.
14883|  3.06k|  if (components.host_end > components.host_start &&
  ------------------
  |  Branch (14883:7): [True: 303, False: 2.76k]
  ------------------
14884|    303|      buffer[components.host_start] == '@') {
  ------------------
  |  Branch (14884:7): [True: 23, False: 280]
  ------------------
14885|     23|    start++;
14886|     23|  }
14887|  3.06k|  return helpers::substring(buffer, start, components.host_end);
14888|  3.06k|}
_ZN3ada14url_aggregator10parse_ipv4ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEb:
15021|  2.42k|bool url_aggregator::parse_ipv4(std::string_view input, bool in_place) {
15022|  2.42k|  ada_log("parse_ipv4 ", input, " [", input.size(),
15023|  2.42k|          " bytes], overlaps with buffer: ",
15024|  2.42k|          helpers::overlaps(input, buffer) ? "yes" : "no");
15025|  2.42k|  ADA_ASSERT_TRUE(validate());
15026|  2.42k|  if (input.empty()) {
  ------------------
  |  Branch (15026:7): [True: 0, False: 2.42k]
  ------------------
15027|      0|    return is_valid = false;
15028|      0|  }
15029|  2.42k|  const bool trailing_dot = (input.back() == '.');
15030|  2.42k|  if (trailing_dot) {
  ------------------
  |  Branch (15030:7): [True: 30, False: 2.39k]
  ------------------
15031|     30|    input.remove_suffix(1);
15032|     30|    if (input.empty()) {
  ------------------
  |  Branch (15032:9): [True: 0, False: 30]
  ------------------
15033|      0|      return is_valid = false;
15034|      0|    }
15035|     30|  }
15036|       |
15037|  2.42k|  const uint64_t fast = checkers::try_parse_ipv4_fast(input);
15038|  2.42k|  if (fast < checkers::ipv4_fast_fail) [[likely]] {
  ------------------
  |  Branch (15038:7): [True: 7, False: 2.42k]
  ------------------
15039|       |    // Pure decimal: keep the buffer when it already holds the address.
15040|       |    // Otherwise write the (trailing-dot-stripped) input.
15041|      7|    if (!(in_place && !trailing_dot)) {
  ------------------
  |  Branch (15041:11): [True: 0, False: 7]
  |  Branch (15041:23): [True: 0, False: 0]
  ------------------
15042|      7|      if (helpers::overlaps(input, buffer)) {
  ------------------
  |  Branch (15042:11): [True: 0, False: 7]
  ------------------
15043|      0|        update_base_hostname(std::string(input));
15044|      7|      } else {
15045|      7|        update_base_hostname(input);
15046|      7|      }
15047|      7|    }
15048|      7|    host_type = IPV4;
15049|      7|    ADA_ASSERT_TRUE(validate());
15050|      7|    return true;
15051|      7|  }
15052|       |
15053|  2.42k|  const char* p = input.data();
15054|  2.42k|  const char* end = p + input.size();
15055|  2.42k|  uint64_t ipv4 = 0;
15056|  2.42k|  int digit_count = 0;
15057|  2.42k|  int pure_decimal_count = 0;
15058|       |
15059|  2.66k|  for (; digit_count < 4 && p < end; ++digit_count) {
  ------------------
  |  Branch (15059:10): [True: 2.65k, False: 6]
  |  Branch (15059:29): [True: 2.65k, False: 0]
  ------------------
15060|  2.65k|    uint64_t segment = 0;
15061|  2.65k|    bool pure = false;
15062|  2.65k|    if (!detail::parse_ipv4_number(p, end, segment, pure)) {
  ------------------
  |  Branch (15062:9): [True: 1.69k, False: 961]
  ------------------
15063|  1.69k|      return is_valid = false;
15064|  1.69k|    }
15065|    961|    if (pure) {
  ------------------
  |  Branch (15065:9): [True: 730, False: 231]
  ------------------
15066|    730|      ++pure_decimal_count;
15067|    730|    }
15068|    961|    if (p >= end) {
  ------------------
  |  Branch (15068:9): [True: 686, False: 275]
  ------------------
15069|    686|      const unsigned shift = static_cast<unsigned>(32 - digit_count * 8);
15070|    686|      if (segment >= (uint64_t{1} << shift)) {
  ------------------
  |  Branch (15070:11): [True: 21, False: 665]
  ------------------
15071|     21|        return is_valid = false;
15072|     21|      }
15073|    665|      ipv4 = (ipv4 << shift) | segment;
15074|    665|      goto ipv4_done;
15075|    686|    }
15076|    275|    if (segment > 255 || *p != '.') {
  ------------------
  |  Branch (15076:9): [True: 32, False: 243]
  |  Branch (15076:26): [True: 0, False: 243]
  ------------------
15077|     32|      return is_valid = false;
15078|     32|    }
15079|    243|    ipv4 = (ipv4 << 8) | segment;
15080|    243|    ++p;
15081|    243|  }
15082|      6|  if (digit_count != 4 || p != end) {
  ------------------
  |  Branch (15082:7): [True: 0, False: 6]
  |  Branch (15082:27): [True: 6, False: 0]
  ------------------
15083|      6|    return is_valid = false;
15084|      6|  }
15085|    665|ipv4_done:
15086|    665|  ada_log("url_aggregator::parse_ipv4 completed ", get_href(),
15087|    665|          " host: ", get_host());
15088|    665|  if (in_place && pure_decimal_count == 4 && !trailing_dot) {
  ------------------
  |  Branch (15088:7): [True: 0, False: 665]
  |  Branch (15088:19): [True: 0, False: 0]
  |  Branch (15088:46): [True: 0, False: 0]
  ------------------
15089|      0|    ada_log(
15090|      0|        "url_aggregator::parse_ipv4 completed and was already correct in the "
15091|      0|        "buffer");
15092|    665|  } else {
15093|    665|    update_base_hostname(ada::serializers::ipv4(ipv4));
15094|    665|  }
15095|    665|  host_type = IPV4;
15096|    665|  ADA_ASSERT_TRUE(validate());
15097|    665|  return true;
15098|      6|}
_ZN3ada14url_aggregator10parse_ipv6ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
15100|  7.23k|bool url_aggregator::parse_ipv6(std::string_view input) {
15101|  7.23k|  ada_log("parse_ipv6 ", input, " [", input.size(), " bytes]");
15102|  7.23k|  ADA_ASSERT_TRUE(validate());
15103|  7.23k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
15104|  7.23k|  if (input.empty() || input.size() > 45) [[unlikely]] {
  ------------------
  |  Branch (15104:7): [True: 5, False: 7.23k]
  |  Branch (15104:24): [True: 1, False: 7.23k]
  ------------------
15105|      6|    return is_valid = false;
15106|      6|  }
15107|  7.23k|  std::array<uint16_t, 8> address{};
15108|       |#if defined(ADA_AVX512_IPV6)
15109|       |  if (bool simd_valid; detail::try_parse_ipv6_avx512(input.data(), input.size(),
15110|       |                                                     address, simd_valid)) {
15111|       |    if (!simd_valid) [[unlikely]] {
15112|       |      return is_valid = false;
15113|       |    }
15114|       |    const std::string serialized = ada::serializers::ipv6(address);
15115|       |    if (get_hostname() != serialized) {
15116|       |      update_base_hostname(serialized);
15117|       |    }
15118|       |    host_type = IPV6;
15119|       |    return true;
15120|       |  }
15121|       |  address = {};
15122|       |#endif
15123|  7.23k|  const char* pointer = input.data();
15124|  7.23k|  const char* const end = pointer + input.size();
15125|  7.23k|  int piece_index = 0;
15126|  7.23k|  int compress = -1;
15127|       |
15128|  7.23k|  if (*pointer == ':') {
  ------------------
  |  Branch (15128:7): [True: 19, False: 7.21k]
  ------------------
15129|     19|    if (input.size() == 1 || pointer[1] != ':') [[unlikely]] {
  ------------------
  |  Branch (15129:9): [True: 2, False: 17]
  |  Branch (15129:30): [True: 5, False: 12]
  ------------------
15130|      7|      return is_valid = false;
15131|      7|    }
15132|     12|    pointer += 2;
15133|     12|    compress = ++piece_index;
15134|     12|  }
15135|       |
15136|  7.41k|  while (pointer != end) {
  ------------------
  |  Branch (15136:10): [True: 7.37k, False: 39]
  ------------------
15137|  7.37k|    if (piece_index == 8) [[unlikely]] {
  ------------------
  |  Branch (15137:9): [True: 2, False: 7.37k]
  ------------------
15138|      2|      return is_valid = false;
15139|      2|    }
15140|  7.37k|    if (*pointer == ':') {
  ------------------
  |  Branch (15140:9): [True: 13, False: 7.36k]
  ------------------
15141|     13|      if (compress != -1) [[unlikely]] {
  ------------------
  |  Branch (15141:11): [True: 1, False: 12]
  ------------------
15142|      1|        return is_valid = false;
15143|      1|      }
15144|     12|      ++pointer;
15145|     12|      compress = ++piece_index;
15146|     12|      continue;
15147|     13|    }
15148|       |
15149|  7.36k|    uint16_t value = 0;
15150|  7.36k|    const int length = detail::parse_hex_piece(pointer, end, value);
15151|       |
15152|  7.36k|    if (pointer != end && *pointer == '.') {
  ------------------
  |  Branch (15152:9): [True: 7.33k, False: 30]
  |  Branch (15152:27): [True: 40, False: 7.29k]
  ------------------
15153|     40|      if (length == 0) [[unlikely]] {
  ------------------
  |  Branch (15153:11): [True: 1, False: 39]
  ------------------
15154|      1|        return is_valid = false;
15155|      1|      }
15156|     39|      pointer -= length;
15157|     39|      if (piece_index > 6) [[unlikely]] {
  ------------------
  |  Branch (15157:11): [True: 1, False: 38]
  ------------------
15158|      1|        return is_valid = false;
15159|      1|      }
15160|       |
15161|     38|      int numbers_seen = 0;
15162|    105|      while (pointer != end) {
  ------------------
  |  Branch (15162:14): [True: 98, False: 7]
  ------------------
15163|     98|        int ipv4_piece = -1;
15164|     98|        if (numbers_seen > 0) {
  ------------------
  |  Branch (15164:13): [True: 60, False: 38]
  ------------------
15165|     60|          if (*pointer == '.' && numbers_seen < 4) {
  ------------------
  |  Branch (15165:15): [True: 45, False: 15]
  |  Branch (15165:34): [True: 43, False: 2]
  ------------------
15166|     43|            ++pointer;
15167|     43|          } else {
15168|     17|            return is_valid = false;
15169|     17|          }
15170|     60|        }
15171|     81|        if (pointer == end || *pointer < '0' || *pointer > '9') [[unlikely]] {
  ------------------
  |  Branch (15171:13): [True: 8, False: 73]
  |  Branch (15171:31): [True: 1, False: 72]
  |  Branch (15171:49): [True: 3, False: 69]
  ------------------
15172|     12|          return is_valid = false;
15173|     12|        }
15174|     69|        ipv4_piece = *pointer - '0';
15175|     69|        ++pointer;
15176|     69|        if (pointer != end && *pointer >= '0' && *pointer <= '9') {
  ------------------
  |  Branch (15176:13): [True: 66, False: 3]
  |  Branch (15176:31): [True: 30, False: 36]
  |  Branch (15176:50): [True: 26, False: 4]
  ------------------
15177|     26|          if (ipv4_piece == 0) [[unlikely]] {
  ------------------
  |  Branch (15177:15): [True: 1, False: 25]
  ------------------
15178|      1|            return is_valid = false;
15179|      1|          }
15180|     25|          ipv4_piece = ipv4_piece * 10 + (*pointer - '0');
15181|     25|          ++pointer;
15182|     25|          if (pointer != end && *pointer >= '0' && *pointer <= '9') {
  ------------------
  |  Branch (15182:15): [True: 24, False: 1]
  |  Branch (15182:33): [True: 13, False: 11]
  |  Branch (15182:52): [True: 11, False: 2]
  ------------------
15183|     11|            ipv4_piece = ipv4_piece * 10 + (*pointer - '0');
15184|     11|            ++pointer;
15185|     11|            if (ipv4_piece > 255) [[unlikely]] {
  ------------------
  |  Branch (15185:17): [True: 1, False: 10]
  ------------------
15186|      1|              return is_valid = false;
15187|      1|            }
15188|     11|          }
15189|     25|        }
15190|     67|        address[static_cast<size_t>(piece_index)] = static_cast<uint16_t>(
15191|     67|            address[static_cast<size_t>(piece_index)] * 0x100 +
15192|     67|            static_cast<uint16_t>(ipv4_piece));
15193|     67|        ++numbers_seen;
15194|     67|        if (numbers_seen == 2 || numbers_seen == 4) {
  ------------------
  |  Branch (15194:13): [True: 21, False: 46]
  |  Branch (15194:34): [True: 4, False: 42]
  ------------------
15195|     25|          ++piece_index;
15196|     25|        }
15197|     67|      }
15198|      7|      if (numbers_seen != 4) [[unlikely]] {
  ------------------
  |  Branch (15198:11): [True: 5, False: 2]
  ------------------
15199|      5|        return is_valid = false;
15200|      5|      }
15201|      2|      break;
15202|      7|    }
15203|       |
15204|  7.32k|    if (length == 0) [[unlikely]] {
  ------------------
  |  Branch (15204:9): [True: 7.13k, False: 192]
  ------------------
15205|  7.13k|      return is_valid = false;
15206|  7.13k|    }
15207|       |
15208|    192|    if (pointer != end && *pointer == ':') {
  ------------------
  |  Branch (15208:9): [True: 162, False: 30]
  |  Branch (15208:27): [True: 154, False: 8]
  ------------------
15209|    154|      ++pointer;
15210|    154|      if (pointer == end) [[unlikely]] {
  ------------------
  |  Branch (15210:11): [True: 5, False: 149]
  ------------------
15211|      5|        return is_valid = false;
15212|      5|      }
15213|    154|    } else if (pointer != end) [[unlikely]] {
  ------------------
  |  Branch (15213:16): [True: 8, False: 30]
  ------------------
15214|      8|      return is_valid = false;
15215|      8|    }
15216|       |
15217|    179|    address[static_cast<size_t>(piece_index)] = value;
15218|    179|    ++piece_index;
15219|    179|  }
15220|       |
15221|     41|  if (compress != -1) {
  ------------------
  |  Branch (15221:7): [True: 20, False: 21]
  ------------------
15222|     20|    const int right = piece_index - compress;
15223|     20|    if (right > 0) {
  ------------------
  |  Branch (15223:9): [True: 11, False: 9]
  ------------------
15224|     11|      const size_t dest = static_cast<size_t>(8 - right);
15225|     11|      const size_t src = static_cast<size_t>(compress);
15226|     11|      if (dest != src) {
  ------------------
  |  Branch (15226:11): [True: 9, False: 2]
  ------------------
15227|     33|        for (size_t i = static_cast<size_t>(right); i-- > 0;) {
  ------------------
  |  Branch (15227:53): [True: 24, False: 9]
  ------------------
15228|     24|          address[dest + i] = address[src + i];
15229|     24|          address[src + i] = 0;
15230|     24|        }
15231|      9|      }
15232|     11|    }
15233|     21|  } else if (piece_index != 8) [[unlikely]] {
  ------------------
  |  Branch (15233:14): [True: 19, False: 2]
  ------------------
15234|     19|    return is_valid = false;
15235|     19|  }
15236|       |
15237|       |  // Serialize once; skip rewrite when hostname is already canonical.
15238|     22|  const std::string serialized = ada::serializers::ipv6(address);
15239|     22|  const std::string_view current = get_hostname();
15240|     22|  if (current.size() == serialized.size() &&
  ------------------
  |  Branch (15240:7): [True: 0, False: 22]
  ------------------
15241|      0|      std::memcmp(current.data(), serialized.data(), serialized.size()) == 0) {
  ------------------
  |  Branch (15241:7): [True: 0, False: 0]
  ------------------
15242|      0|    ada_log("parse_ipv6 in-place canonical match");
15243|     22|  } else {
15244|     22|    update_base_hostname(serialized);
15245|     22|  }
15246|     22|  ada_log("parse_ipv6 ", get_hostname());
15247|     22|  ADA_ASSERT_TRUE(validate());
15248|     22|  host_type = IPV6;
15249|     22|  return true;
15250|     41|}
serializers.cc:_ZZN3ada4idna22utf32_length_from_utf8EPKcmENK3$_0clEa:
  274|  56.2k|  return std::count_if(p, std::next(p, len), [](int8_t c) {
  275|       |    // -65 is 0b10111111, anything larger in two-complement's
  276|       |    // should start a new code point.
  277|  56.2k|    return c > -65;
  278|  56.2k|  });
_ZN3ada4idna7deflate22make_fixed_litlen_huffEv:
  480|      2|inline Huff make_fixed_litlen_huff() {
  481|      2|  Huff h;
  482|      2|  uint8_t lens[288];
  483|       |  // Fixed Huffman: 0-143:8, 144-255:9, 256-279:7, 280-287:8
  484|    290|  for (int i = 0; i <= 143; i++) lens[i] = 8;
  ------------------
  |  Branch (484:19): [True: 288, False: 2]
  ------------------
  485|    226|  for (int i = 144; i <= 255; i++) lens[i] = 9;
  ------------------
  |  Branch (485:21): [True: 224, False: 2]
  ------------------
  486|     50|  for (int i = 256; i <= 279; i++) lens[i] = 7;
  ------------------
  |  Branch (486:21): [True: 48, False: 2]
  ------------------
  487|     18|  for (int i = 280; i <= 287; i++) lens[i] = 8;
  ------------------
  |  Branch (487:21): [True: 16, False: 2]
  ------------------
  488|      2|  h.build(lens, 288);
  489|      2|  return h;
  490|      2|}
_ZN3ada4idna7deflate4Huff5buildEPKhi:
  429|     16|  bool build(const uint8_t* lens, int n) {
  430|     16|    std::memset(counts, 0, sizeof(counts));
  431|     16|    std::memset(first_code, 0, sizeof(first_code));
  432|     16|    std::memset(base_idx, 0, sizeof(base_idx));
  433|     16|    nsymbols = n;
  434|     16|    max_bits = 0;
  435|  1.99k|    for (int i = 0; i < n; i++) {
  ------------------
  |  Branch (435:21): [True: 1.97k, False: 16]
  ------------------
  436|  1.97k|      lengths[i] = lens[i];
  437|  1.97k|      if (lens[i]) {
  ------------------
  |  Branch (437:11): [True: 1.93k, False: 42]
  ------------------
  438|  1.93k|        counts[lens[i]]++;
  439|  1.93k|        if (lens[i] > max_bits) max_bits = lens[i];
  ------------------
  |  Branch (439:13): [True: 45, False: 1.88k]
  ------------------
  440|  1.93k|      }
  441|  1.97k|    }
  442|       |    // Canonical first code for each bit length (RFC 1951).
  443|     16|    int code = 0;
  444|    256|    for (int bits = 1; bits <= MAXBITS; bits++) {
  ------------------
  |  Branch (444:24): [True: 240, False: 16]
  ------------------
  445|    240|      code = (code + counts[bits - 1]) << 1;
  446|    240|      first_code[bits] = code;
  447|    240|    }
  448|     16|    int idx = 0;
  449|    159|    for (int bits = 1; bits <= max_bits; bits++) {
  ------------------
  |  Branch (449:24): [True: 143, False: 16]
  ------------------
  450|    143|      base_idx[bits] = idx;
  451|       |      // assign symbols in symbol order for codes of this length
  452|  21.8k|      for (int sym = 0; sym < n; sym++) {
  ------------------
  |  Branch (452:25): [True: 21.6k, False: 143]
  ------------------
  453|  21.6k|        if (lengths[sym] == bits) {
  ------------------
  |  Branch (453:13): [True: 1.93k, False: 19.7k]
  ------------------
  454|  1.93k|          symbols[idx++] = static_cast<int16_t>(sym);
  455|  1.93k|        }
  456|  21.6k|      }
  457|    143|    }
  458|     16|    return true;
  459|     16|  }
_ZN3ada4idna7deflate20make_fixed_dist_huffEv:
  492|      2|inline Huff make_fixed_dist_huff() {
  493|      2|  Huff h;
  494|      2|  uint8_t lens[32];
  495|     66|  for (int i = 0; i < 32; i++) lens[i] = 5;
  ------------------
  |  Branch (495:19): [True: 64, False: 2]
  ------------------
  496|      2|  h.build(lens, 32);
  497|      2|  return h;
  498|      2|}
serializers.cc:_ZZN3ada4idna9ascii_mapEPcmENK3$_0clEh:
 5339|    435|  auto broadcast = [](uint8_t v) -> uint64_t {
 5340|    435|    return 0x101010101010101ull * v;
 5341|    435|  };
_ZN3ada4idna13ensure_tablesEv:
 5085|  8.62k|[[nodiscard]] inline bool ensure_tables() noexcept {
 5086|  8.62k|  uint8_t state = tables_init_state.load(std::memory_order_acquire);
 5087|  8.62k|  if (state == kTablesReady) {
  ------------------
  |  Branch (5087:7): [True: 8.62k, False: 1]
  ------------------
 5088|  8.62k|    return true;
 5089|  8.62k|  }
 5090|      1|  if (state == kTablesFailed) {
  ------------------
  |  Branch (5090:7): [True: 0, False: 1]
  ------------------
 5091|      0|    return false;
 5092|      0|  }
 5093|       |
 5094|      1|  uint8_t expected = kTablesUninit;
 5095|      1|  if (tables_init_state.compare_exchange_strong(expected, kTablesInProgress,
  ------------------
  |  Branch (5095:7): [True: 1, False: 0]
  ------------------
 5096|      1|                                                std::memory_order_acq_rel,
 5097|      1|                                                std::memory_order_acquire)) {
 5098|      1|    uint8_t* buffer = new (std::nothrow) uint8_t[table_blob::uncompressed_size];
 5099|      1|    if (buffer == nullptr) {
  ------------------
  |  Branch (5099:9): [True: 0, False: 1]
  ------------------
 5100|      0|      tables_init_state.store(kTablesFailed, std::memory_order_release);
 5101|      0|      return false;
 5102|      0|    }
 5103|       |
 5104|      1|    const size_t n = deflate::inflate_raw(table_blob::compressed,
 5105|      1|                                          table_blob::compressed_size, buffer,
 5106|      1|                                          table_blob::uncompressed_size);
 5107|      1|    if (n != table_blob::uncompressed_size ||
  ------------------
  |  Branch (5107:9): [True: 0, False: 1]
  ------------------
 5108|      1|        crc32_ieee(buffer, n) != table_blob::uncompressed_crc32) {
  ------------------
  |  Branch (5108:9): [True: 0, False: 1]
  ------------------
 5109|      0|      delete[] buffer;
 5110|      0|      tables_init_state.store(kTablesFailed, std::memory_order_release);
 5111|      0|      return false;
 5112|      0|    }
 5113|       |
 5114|       |    // LE payload verified; convert multi-byte fields for big-endian hosts.
 5115|      1|    detail::convert_table_blob_to_host_endian(buffer);
 5116|       |
 5117|      1|    auto at = [&](size_t off) noexcept -> const uint8_t* {
 5118|      1|      return buffer + off;
 5119|      1|    };
 5120|       |
 5121|       |    // Publish all non-atomic pointers before READY. Waiters synchronize via
 5122|       |    // acquire on tables_init_state and then observe these writes.
 5123|      1|    idna_stage1 =
 5124|      1|        reinterpret_cast<const uint16_t*>(at(table_blob::off_idna_stage1));
 5125|      1|    idna_stage2 =
 5126|      1|        reinterpret_cast<const uint16_t*>(at(table_blob::off_idna_stage2));
 5127|      1|    idna_bool_blocks =
 5128|      1|        reinterpret_cast<const uint64_t*>(at(table_blob::off_idna_bool_blocks));
 5129|      1|    idna_utf8_mappings = at(table_blob::off_idna_utf8_mappings);
 5130|       |
 5131|      1|    decomposition_index = at(table_blob::off_decomposition_index);
 5132|      1|    decomposition_block_flat = reinterpret_cast<const uint16_t*>(
 5133|      1|        at(table_blob::off_decomposition_block));
 5134|      1|    decomposition_data = reinterpret_cast<const char32_t*>(
 5135|      1|        at(table_blob::off_decomposition_data));
 5136|      1|    ccc_index = at(table_blob::off_ccc_index);
 5137|      1|    ccc_block_flat = at(table_blob::off_ccc_block);
 5138|      1|    composition_index = at(table_blob::off_composition_index);
 5139|      1|    composition_block_flat = reinterpret_cast<const uint16_t*>(
 5140|      1|        at(table_blob::off_composition_block));
 5141|      1|    composition_data =
 5142|      1|        reinterpret_cast<const char32_t*>(at(table_blob::off_composition_data));
 5143|       |
 5144|      1|    id_continue =
 5145|      1|        reinterpret_cast<range_pair_ptr>(at(table_blob::off_id_continue_flat));
 5146|      1|    id_start =
 5147|      1|        reinterpret_cast<range_pair_ptr>(at(table_blob::off_id_start_flat));
 5148|       |
 5149|      1|    dir_start =
 5150|      1|        reinterpret_cast<const uint32_t*>(at(table_blob::off_dir_start));
 5151|      1|    dir_final =
 5152|      1|        reinterpret_cast<const uint32_t*>(at(table_blob::off_dir_final));
 5153|      1|    dir_value = at(table_blob::off_dir_value);
 5154|      1|    combining_ranges =
 5155|      1|        reinterpret_cast<range_pair_ptr>(at(table_blob::off_combining_flat));
 5156|      1|    joining_start =
 5157|      1|        reinterpret_cast<const uint32_t*>(at(table_blob::off_joining_start));
 5158|      1|    joining_final =
 5159|      1|        reinterpret_cast<const uint32_t*>(at(table_blob::off_joining_final));
 5160|      1|    joining_value = at(table_blob::off_joining_value);
 5161|       |
 5162|      1|    tables_buffer = buffer;
 5163|      1|    tables_init_state.store(kTablesReady, std::memory_order_release);
 5164|      1|    return true;
 5165|      1|  }
 5166|       |
 5167|       |  // Another thread owns init (or finished between our loads).
 5168|      0|  for (uint64_t spins = 0; spins < kTablesSpinLimit; ++spins) {
  ------------------
  |  Branch (5168:28): [True: 0, False: 0]
  ------------------
 5169|      0|    state = tables_init_state.load(std::memory_order_acquire);
 5170|      0|    if (state == kTablesReady) {
  ------------------
  |  Branch (5170:9): [True: 0, False: 0]
  ------------------
 5171|      0|      return true;
 5172|      0|    }
 5173|      0|    if (state == kTablesFailed) {
  ------------------
  |  Branch (5173:9): [True: 0, False: 0]
  ------------------
 5174|      0|      return false;
 5175|      0|    }
 5176|      0|#if defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || \
 5177|      0|    defined(_M_IX86)
 5178|      0|#if defined(__GNUC__) || defined(__clang__)
 5179|      0|    __builtin_ia32_pause();
 5180|      0|#endif
 5181|       |#elif defined(__aarch64__) || defined(_M_ARM64)
 5182|       |#if defined(__GNUC__) || defined(__clang__)
 5183|       |    asm volatile("yield" ::: "memory");
 5184|       |#endif
 5185|       |#endif
 5186|      0|  }
 5187|       |  // Timed out waiting for a peer - treat as failure rather than hang.
 5188|      0|  return false;
 5189|      0|}
_ZN3ada4idna7deflate11inflate_rawEPKhmPhm:
  525|      1|                          size_t dst_cap) {
  526|      1|  BitReader br(src, src_len);
  527|      1|  size_t out = 0;
  528|      4|  for (;;) {
  529|      4|    uint32_t bfinal = br.get(1);
  530|      4|    uint32_t btype = br.get(2);
  531|      4|    if (bfinal == UINT32_MAX || btype == UINT32_MAX) return 0;
  ------------------
  |  Branch (531:9): [True: 0, False: 4]
  |  Branch (531:33): [True: 0, False: 4]
  ------------------
  532|      4|    if (btype == 0) {
  ------------------
  |  Branch (532:9): [True: 0, False: 4]
  ------------------
  533|       |      // stored
  534|      0|      br.align_byte();
  535|      0|      if (!br.ensure(16)) return 0;
  ------------------
  |  Branch (535:11): [True: 0, False: 0]
  ------------------
  536|       |      // read 16+16 from bit buffer awkwardly - use byte path
  537|       |      // Align: bits is multiple of 8
  538|       |      // Get len from remaining bits then bytes
  539|      0|      uint32_t len = br.get(16);
  540|      0|      uint32_t nlen = br.get(16);
  541|      0|      if (len == UINT32_MAX || nlen == UINT32_MAX) return 0;
  ------------------
  |  Branch (541:11): [True: 0, False: 0]
  |  Branch (541:32): [True: 0, False: 0]
  ------------------
  542|      0|      if ((len ^ 0xFFFF) != nlen) return 0;
  ------------------
  |  Branch (542:11): [True: 0, False: 0]
  ------------------
  543|       |      // After get, may have bits in acc from previous - for stored, should be
  544|       |      // byte aligned Copy len bytes from p
  545|      0|      if (br.bits != 0) {
  ------------------
  |  Branch (545:11): [True: 0, False: 0]
  ------------------
  546|       |        // leftover bits should be 0 if aligned
  547|      0|      }
  548|      0|      if (size_t(br.end - br.p) < len) return 0;
  ------------------
  |  Branch (548:11): [True: 0, False: 0]
  ------------------
  549|      0|      if (out + len > dst_cap) return 0;
  ------------------
  |  Branch (549:11): [True: 0, False: 0]
  ------------------
  550|      0|      std::memcpy(dst + out, br.p, len);
  551|      0|      br.p += len;
  552|      0|      out += len;
  553|      4|    } else if (btype == 1 || btype == 2) {
  ------------------
  |  Branch (553:16): [True: 0, False: 4]
  |  Branch (553:30): [True: 4, False: 0]
  ------------------
  554|      4|      Huff lit, dist;
  555|      4|      if (btype == 1) {
  ------------------
  |  Branch (555:11): [True: 0, False: 4]
  ------------------
  556|       |        // use fixed via functions
  557|      4|      } else {
  558|       |        // dynamic
  559|      4|        uint32_t hlit = br.get(5);
  560|      4|        if (hlit == UINT32_MAX) return 0;
  ------------------
  |  Branch (560:13): [True: 0, False: 4]
  ------------------
  561|      4|        hlit += 257;
  562|      4|        uint32_t hdist = br.get(5);
  563|      4|        if (hdist == UINT32_MAX) return 0;
  ------------------
  |  Branch (563:13): [True: 0, False: 4]
  ------------------
  564|      4|        hdist += 1;
  565|      4|        uint32_t hclen = br.get(4);
  566|      4|        if (hclen == UINT32_MAX) return 0;
  ------------------
  |  Branch (566:13): [True: 0, False: 4]
  ------------------
  567|      4|        hclen += 4;
  568|      4|        static const int order[19] = {16, 17, 18, 0, 8,  7, 9,  6, 10, 5,
  569|      4|                                      11, 4,  12, 3, 13, 2, 14, 1, 15};
  570|      4|        uint8_t clen[19]{};
  571|     69|        for (uint32_t i = 0; i < hclen; i++) {
  ------------------
  |  Branch (571:30): [True: 65, False: 4]
  ------------------
  572|     65|          uint32_t v = br.get(3);
  573|     65|          if (v == UINT32_MAX) return 0;
  ------------------
  |  Branch (573:15): [True: 0, False: 65]
  ------------------
  574|     65|          clen[order[i]] = uint8_t(v);
  575|     65|        }
  576|      4|        Huff cl;
  577|      4|        if (!cl.build(clen, 19)) return 0;
  ------------------
  |  Branch (577:13): [True: 0, False: 4]
  ------------------
  578|      4|        uint8_t lens[288 + 32]{};
  579|      4|        uint32_t n = hlit + hdist;
  580|  1.04k|        for (uint32_t i = 0; i < n;) {
  ------------------
  |  Branch (580:30): [True: 1.03k, False: 4]
  ------------------
  581|  1.03k|          int sym = cl.decode(br);
  582|  1.03k|          if (sym < 0) return 0;
  ------------------
  |  Branch (582:15): [True: 0, False: 1.03k]
  ------------------
  583|  1.03k|          if (sym < 16) {
  ------------------
  |  Branch (583:15): [True: 973, False: 63]
  ------------------
  584|    973|            lens[i++] = uint8_t(sym);
  585|    973|          } else if (sym == 16) {
  ------------------
  |  Branch (585:22): [True: 63, False: 0]
  ------------------
  586|     63|            uint32_t rep = br.get(2);
  587|     63|            if (rep == UINT32_MAX) return 0;
  ------------------
  |  Branch (587:17): [True: 0, False: 63]
  ------------------
  588|     63|            rep += 3;
  589|     63|            if (i == 0) return 0;
  ------------------
  |  Branch (589:17): [True: 0, False: 63]
  ------------------
  590|     63|            uint8_t v = lens[i - 1];
  591|    350|            while (rep--) lens[i++] = v;
  ------------------
  |  Branch (591:20): [True: 287, False: 63]
  ------------------
  592|     63|          } else if (sym == 17) {
  ------------------
  |  Branch (592:22): [True: 0, False: 0]
  ------------------
  593|      0|            uint32_t rep = br.get(3);
  594|      0|            if (rep == UINT32_MAX) return 0;
  ------------------
  |  Branch (594:17): [True: 0, False: 0]
  ------------------
  595|      0|            rep += 3;
  596|      0|            while (rep--) lens[i++] = 0;
  ------------------
  |  Branch (596:20): [True: 0, False: 0]
  ------------------
  597|      0|          } else if (sym == 18) {
  ------------------
  |  Branch (597:22): [True: 0, False: 0]
  ------------------
  598|      0|            uint32_t rep = br.get(7);
  599|      0|            if (rep == UINT32_MAX) return 0;
  ------------------
  |  Branch (599:17): [True: 0, False: 0]
  ------------------
  600|      0|            rep += 11;
  601|      0|            while (rep--) lens[i++] = 0;
  ------------------
  |  Branch (601:20): [True: 0, False: 0]
  ------------------
  602|      0|          } else
  603|      0|            return 0;
  604|  1.03k|        }
  605|      4|        if (!lit.build(lens, int(hlit))) return 0;
  ------------------
  |  Branch (605:13): [True: 0, False: 4]
  ------------------
  606|      4|        if (!dist.build(lens + hlit, int(hdist))) return 0;
  ------------------
  |  Branch (606:13): [True: 0, False: 4]
  ------------------
  607|      4|      }
  608|  54.4k|      for (;;) {
  609|  54.4k|        int sym;
  610|  54.4k|        if (btype == 1)
  ------------------
  |  Branch (610:13): [True: 0, False: 54.4k]
  ------------------
  611|      0|          sym = fixed_litlen(br);
  612|  54.4k|        else
  613|  54.4k|          sym = lit.decode(br);
  614|  54.4k|        if (sym < 0) return 0;
  ------------------
  |  Branch (614:13): [True: 0, False: 54.4k]
  ------------------
  615|  54.4k|        if (sym < 256) {
  ------------------
  |  Branch (615:13): [True: 38.5k, False: 15.9k]
  ------------------
  616|  38.5k|          if (out >= dst_cap) return 0;
  ------------------
  |  Branch (616:15): [True: 0, False: 38.5k]
  ------------------
  617|  38.5k|          dst[out++] = uint8_t(sym);
  618|  38.5k|        } else if (sym == 256) {
  ------------------
  |  Branch (618:20): [True: 4, False: 15.9k]
  ------------------
  619|      4|          break;
  620|  15.9k|        } else {
  621|  15.9k|          int len_code = sym - 257;
  622|  15.9k|          if (len_code < 0 || len_code > 28) return 0;
  ------------------
  |  Branch (622:15): [True: 0, False: 15.9k]
  |  Branch (622:31): [True: 0, False: 15.9k]
  ------------------
  623|  15.9k|          uint32_t extra = br.get(len_extra[len_code]);
  624|  15.9k|          if (len_extra[len_code] && extra == UINT32_MAX) return 0;
  ------------------
  |  Branch (624:15): [True: 2.24k, False: 13.6k]
  |  Branch (624:38): [True: 0, False: 2.24k]
  ------------------
  625|  15.9k|          uint32_t length =
  626|  15.9k|              len_base[len_code] + (len_extra[len_code] ? extra : 0);
  ------------------
  |  Branch (626:37): [True: 2.24k, False: 13.6k]
  ------------------
  627|  15.9k|          int dsym;
  628|  15.9k|          if (btype == 1)
  ------------------
  |  Branch (628:15): [True: 0, False: 15.9k]
  ------------------
  629|      0|            dsym = fixed_dist(br);
  630|  15.9k|          else
  631|  15.9k|            dsym = dist.decode(br);
  632|  15.9k|          if (dsym < 0 || dsym > 29) return 0;
  ------------------
  |  Branch (632:15): [True: 0, False: 15.9k]
  |  Branch (632:27): [True: 0, False: 15.9k]
  ------------------
  633|  15.9k|          uint32_t dextra = br.get(dist_extra[dsym]);
  634|  15.9k|          if (dist_extra[dsym] && dextra == UINT32_MAX) return 0;
  ------------------
  |  Branch (634:15): [True: 10.7k, False: 5.16k]
  |  Branch (634:35): [True: 0, False: 10.7k]
  ------------------
  635|  15.9k|          uint32_t distance = dist_base[dsym] + (dist_extra[dsym] ? dextra : 0);
  ------------------
  |  Branch (635:50): [True: 10.7k, False: 5.16k]
  ------------------
  636|  15.9k|          if (distance > out || out + length > dst_cap) return 0;
  ------------------
  |  Branch (636:15): [True: 0, False: 15.9k]
  |  Branch (636:33): [True: 0, False: 15.9k]
  ------------------
  637|   193k|          for (uint32_t k = 0; k < length; k++) {
  ------------------
  |  Branch (637:32): [True: 177k, False: 15.9k]
  ------------------
  638|   177k|            dst[out] = dst[out - distance];
  639|   177k|            out++;
  640|   177k|          }
  641|  15.9k|        }
  642|  54.4k|      }
  643|      4|    } else {
  644|      0|      return 0;  // reserved
  645|      0|    }
  646|      4|    if (bfinal) break;
  ------------------
  |  Branch (646:9): [True: 1, False: 3]
  ------------------
  647|      4|  }
  648|      1|  return out;
  649|      1|}
_ZN3ada4idna7deflate9BitReaderC2EPKhm:
  392|      1|      : p(data), end(data + len) {}
_ZN3ada4idna7deflate9BitReader3getEi:
  402|   475k|  uint32_t get(int n) {
  403|   475k|    if (!ensure(n)) return UINT32_MAX;
  ------------------
  |  Branch (403:9): [True: 0, False: 475k]
  ------------------
  404|   475k|    uint32_t v = acc & ((1u << n) - 1);
  405|   475k|    acc >>= n;
  406|   475k|    bits -= n;
  407|   475k|    return v;
  408|   475k|  }
_ZN3ada4idna7deflate9BitReader6ensureEi:
  394|   475k|  bool ensure(int n) {
  395|   540k|    while (bits < n) {
  ------------------
  |  Branch (395:12): [True: 65.3k, False: 475k]
  ------------------
  396|  65.3k|      if (p >= end) return false;
  ------------------
  |  Branch (396:11): [True: 0, False: 65.3k]
  ------------------
  397|  65.3k|      acc |= uint32_t(*p++) << bits;
  398|  65.3k|      bits += 8;
  399|  65.3k|    }
  400|   475k|    return true;
  401|   475k|  }
_ZNK3ada4idna7deflate4Huff6decodeERNS1_9BitReaderE:
  461|  71.4k|  int decode(BitReader& br) const {
  462|  71.4k|    if (max_bits == 0) return -1;
  ------------------
  |  Branch (462:9): [True: 0, False: 71.4k]
  ------------------
  463|  71.4k|    int code = 0;
  464|   442k|    for (int len = 1; len <= max_bits; len++) {
  ------------------
  |  Branch (464:23): [True: 442k, False: 0]
  ------------------
  465|   442k|      uint32_t b = br.get(1);
  466|   442k|      if (b == UINT32_MAX) return -1;
  ------------------
  |  Branch (466:11): [True: 0, False: 442k]
  ------------------
  467|   442k|      code = (code << 1) | int(b);
  468|   442k|      int first = first_code[len];
  469|   442k|      int cnt = counts[len];
  470|   442k|      if (cnt && code - first < cnt) {
  ------------------
  |  Branch (470:11): [True: 276k, False: 166k]
  |  Branch (470:18): [True: 71.4k, False: 205k]
  ------------------
  471|  71.4k|        return symbols[base_idx[len] + (code - first)];
  472|  71.4k|      }
  473|   442k|    }
  474|      0|    return -1;
  475|  71.4k|  }
_ZN3ada4idna10crc32_ieeeEPKhm:
 5068|      1|                                         size_t len) noexcept {
 5069|      1|  uint32_t c = 0xFFFFFFFFu;
 5070|   216k|  for (size_t i = 0; i < len; ++i) {
  ------------------
  |  Branch (5070:22): [True: 216k, False: 1]
  ------------------
 5071|   216k|    c ^= data[i];
 5072|  1.94M|    for (int k = 0; k < 8; ++k) {
  ------------------
  |  Branch (5072:21): [True: 1.72M, False: 216k]
  ------------------
 5073|  1.72M|      const uint32_t mask = 0u - (c & 1u);
 5074|  1.72M|      c = (c >> 1) ^ (0xEDB88320u & mask);
 5075|  1.72M|    }
 5076|   216k|  }
 5077|      1|  return ~c;
 5078|      1|}
_ZN3ada4idna6detail33convert_table_blob_to_host_endianEPh:
 4873|      1|inline void convert_table_blob_to_host_endian(uint8_t* buffer) noexcept {
 4874|      1|  if constexpr (std::endian::native == std::endian::little) {
 4875|      1|    (void)buffer;
 4876|      1|    return;
 4877|      1|  }
 4878|      0|  auto u16 = [&](size_t off, size_t count) {
 4879|      1|    bswap_inplace(reinterpret_cast<uint16_t*>(buffer + off), count);
 4880|      1|  };
 4881|      1|  auto u32 = [&](size_t off, size_t count) {
 4882|      1|    bswap_inplace(reinterpret_cast<uint32_t*>(buffer + off), count);
 4883|      1|  };
 4884|      1|  auto u64 = [&](size_t off, size_t count) {
 4885|      1|    bswap_inplace(reinterpret_cast<uint64_t*>(buffer + off), count);
 4886|      1|  };
 4887|       |
 4888|      1|  u16(table_blob::off_idna_stage1, table_blob::count_idna_stage1);
 4889|      1|  u16(table_blob::off_idna_stage2, table_blob::count_idna_stage2);
 4890|      1|  u64(table_blob::off_idna_bool_blocks, table_blob::count_idna_bool_blocks);
 4891|      1|  u16(table_blob::off_decomposition_block,
 4892|      1|      table_blob::count_decomposition_block);
 4893|      1|  u32(table_blob::off_decomposition_data, table_blob::count_decomposition_data);
 4894|      1|  u16(table_blob::off_composition_block, table_blob::count_composition_block);
 4895|      1|  u32(table_blob::off_composition_data, table_blob::count_composition_data);
 4896|      1|  u32(table_blob::off_id_continue_flat, table_blob::count_id_continue_flat);
 4897|      1|  u32(table_blob::off_id_start_flat, table_blob::count_id_start_flat);
 4898|      1|  u32(table_blob::off_dir_start, table_blob::count_dir_start);
 4899|      1|  u32(table_blob::off_dir_final, table_blob::count_dir_final);
 4900|      1|  u32(table_blob::off_combining_flat, table_blob::count_combining_flat);
 4901|      1|  u32(table_blob::off_joining_start, table_blob::count_joining_start);
 4902|      1|  u32(table_blob::off_joining_final, table_blob::count_joining_final);
 4903|      1|}
_ZZN3ada4idna13ensure_tablesEvENKUlmE_clEm:
 5117|     21|    auto at = [&](size_t off) noexcept -> const uint8_t* {
 5118|     21|      return buffer + off;
 5119|     21|    };
serializers.cc:_ZN3ada4idnaL11idna_lookupEj:
 5277|  97.0k|static uint16_t idna_lookup(uint32_t cp) noexcept {
 5278|  97.0k|  if (cp < IDNA_LOW_RANGE_END) {
  ------------------
  |  Branch (5278:7): [True: 96.4k, False: 564]
  ------------------
 5279|  96.4k|    uint16_t ref = idna_stage1[cp >> IDNA_BLOCK_BITS];
 5280|  96.4k|    if (ref & IDNA_BOOL_FLAG) {
  ------------------
  |  Branch (5280:9): [True: 47.6k, False: 48.8k]
  ------------------
 5281|  47.6k|      uint32_t bit_idx =
 5282|  47.6k|          static_cast<uint32_t>(ref & ~IDNA_BOOL_FLAG) * IDNA_BLOCK_SIZE +
 5283|  47.6k|          (cp & IDNA_BLOCK_MASK);
 5284|  47.6k|      bool is_valid = (idna_bool_blocks[bit_idx >> 6] >> (bit_idx & 63u)) & 1u;
 5285|  47.6k|      return is_valid ? IDNA_VALID : IDNA_DISALLOWED;
  ------------------
  |  Branch (5285:14): [True: 47.6k, False: 8]
  ------------------
 5286|  47.6k|    }
 5287|  48.8k|    return idna_stage2[ref + (cp & IDNA_BLOCK_MASK)];
 5288|  96.4k|  }
 5289|       |
 5290|    564|  if (cp >= IDNA_HIGH_IGNORED_START && cp < IDNA_HIGH_IGNORED_END) {
  ------------------
  |  Branch (5290:7): [True: 542, False: 22]
  |  Branch (5290:40): [True: 420, False: 122]
  ------------------
 5291|    420|    return IDNA_IGNORED;
 5292|    420|  }
 5293|       |
 5294|    144|  return IDNA_DISALLOWED;
 5295|    564|}
serializers.cc:_ZN3ada4idnaL21utf8_count_codepointsEPKh:
 5320|  10.6k|static size_t utf8_count_codepoints(const uint8_t* ptr) noexcept {
 5321|  10.6k|  size_t n = 0;
 5322|  56.3k|  while (*ptr != 0) {
  ------------------
  |  Branch (5322:10): [True: 45.6k, False: 10.6k]
  ------------------
 5323|  45.6k|    ++n;
 5324|  45.6k|    if (*ptr < 0x80u) {
  ------------------
  |  Branch (5324:9): [True: 14.1k, False: 31.5k]
  ------------------
 5325|  14.1k|      ++ptr;
 5326|  31.5k|    } else if (*ptr < 0xE0u) {
  ------------------
  |  Branch (5326:16): [True: 19.5k, False: 12.0k]
  ------------------
 5327|  19.5k|      ptr += 2;
 5328|  19.5k|    } else if (*ptr < 0xF0u) {
  ------------------
  |  Branch (5328:16): [True: 11.6k, False: 371]
  ------------------
 5329|  11.6k|      ptr += 3;
 5330|  11.6k|    } else {
 5331|    371|      ptr += 4;
 5332|    371|    }
 5333|  45.6k|  }
 5334|  10.6k|  return n;
 5335|  10.6k|}
serializers.cc:_ZN3ada4idnaL9utf8_nextERPKh:
 5298|  45.6k|static char32_t utf8_next(const uint8_t*& ptr) noexcept {
 5299|  45.6k|  uint8_t b0 = *ptr++;
 5300|  45.6k|  if (b0 < 0x80u) return static_cast<char32_t>(b0);
  ------------------
  |  Branch (5300:7): [True: 14.1k, False: 31.4k]
  ------------------
 5301|  31.4k|  if (b0 < 0xE0u) {
  ------------------
  |  Branch (5301:7): [True: 19.5k, False: 11.9k]
  ------------------
 5302|  19.5k|    uint32_t cp = (b0 & 0x1Fu) << 6;
 5303|  19.5k|    cp |= (*ptr++ & 0x3Fu);
 5304|  19.5k|    return static_cast<char32_t>(cp);
 5305|  19.5k|  }
 5306|  11.9k|  if (b0 < 0xF0u) {
  ------------------
  |  Branch (5306:7): [True: 11.6k, False: 326]
  ------------------
 5307|  11.6k|    uint32_t cp = (b0 & 0x0Fu) << 12;
 5308|  11.6k|    cp |= ((*ptr++ & 0x3Fu) << 6);
 5309|  11.6k|    cp |= (*ptr++ & 0x3Fu);
 5310|  11.6k|    return static_cast<char32_t>(cp);
 5311|  11.6k|  }
 5312|    326|  uint32_t cp = (b0 & 0x07u) << 18;
 5313|    326|  cp |= ((*ptr++ & 0x3Fu) << 12);
 5314|    326|  cp |= ((*ptr++ & 0x3Fu) << 6);
 5315|    326|  cp |= (*ptr++ & 0x3Fu);
 5316|    326|  return static_cast<char32_t>(cp);
 5317|  11.9k|}
_ZN3ada4idna23decomposition_block_rowEh:
 5194|   177k|inline const uint16_t* decomposition_block_row(uint8_t bi) noexcept {
 5195|   177k|  if (bi >= kDecompBlockRows) {
  ------------------
  |  Branch (5195:7): [True: 0, False: 177k]
  ------------------
 5196|      0|    bi = 0;
 5197|      0|  }
 5198|   177k|  return decomposition_block_flat + static_cast<size_t>(bi) * kDecompBlockCols;
 5199|   177k|}
_ZN3ada4idna13ccc_block_rowEh:
 5201|   262k|inline const uint8_t* ccc_block_row(uint8_t bi) noexcept {
 5202|   262k|  if (bi >= kCccBlockRows) {
  ------------------
  |  Branch (5202:7): [True: 0, False: 262k]
  ------------------
 5203|      0|    bi = 0;
 5204|      0|  }
 5205|   262k|  return ccc_block_flat + static_cast<size_t>(bi) * kCccBlockCols;
 5206|   262k|}
_ZN3ada4idna16tables_are_readyEv:
 5080|  3.63k|[[nodiscard]] inline bool tables_are_ready() noexcept {
 5081|  3.63k|  return tables_init_state.load(std::memory_order_acquire) == kTablesReady;
 5082|  3.63k|}
serializers.cc:_ZN3ada4idnaL24decomposition_is_not_nfcEDiDi:
 5707|  78.8k|static bool decomposition_is_not_nfc(char32_t previous, char32_t c) noexcept {
 5708|  78.8k|  if (c >= hangul_sbase && c < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5708:7): [True: 5.09k, False: 73.7k]
  |  Branch (5708:28): [True: 2.25k, False: 2.83k]
  ------------------
 5709|  2.25k|    return false;
 5710|  2.25k|  }
 5711|  76.5k|  if (c >= 0x110000) {
  ------------------
  |  Branch (5711:7): [True: 0, False: 76.5k]
  ------------------
 5712|      0|    return false;
 5713|      0|  }
 5714|  76.5k|  const uint16_t* const decomposition =
 5715|  76.5k|      decomposition_block_row(decomposition_index[c >> 8]) + (c % 256);
 5716|  76.5k|  const size_t length = (decomposition[1] >> 2) - (decomposition[0] >> 2);
 5717|  76.5k|  if (length == 0 || (decomposition[0] & 1)) {
  ------------------
  |  Branch (5717:7): [True: 71.5k, False: 4.98k]
  |  Branch (5717:22): [True: 0, False: 4.98k]
  ------------------
 5718|  71.5k|    return false;  // no canonical decomposition (or compatibility-only)
 5719|  71.5k|  }
 5720|  4.98k|  if (length == 1) {
  ------------------
  |  Branch (5720:7): [True: 0, False: 4.98k]
  ------------------
 5721|      0|    return true;  // singleton
 5722|      0|  }
 5723|  4.98k|  const size_t base = decomposition[0] >> 2;
 5724|  4.98k|  if (base + length > decomposition_data_size) {
  ------------------
  |  Branch (5724:7): [True: 0, False: 4.98k]
  ------------------
 5725|      0|    return false;
 5726|      0|  }
 5727|       |  // Recompose the canonical decomposition; if it does not collapse back to c,
 5728|       |  // then c is an exclusion / non-starter decomposition and is not NFC.
 5729|  4.98k|  std::u32string decomposed(decomposition_data + base,
 5730|  4.98k|                            decomposition_data + base + length);
 5731|  4.98k|  compose(decomposed);
 5732|  4.98k|  if (!(decomposed.size() == 1 && decomposed[0] == c)) {
  ------------------
  |  Branch (5732:9): [True: 4.98k, False: 0]
  |  Branch (5732:35): [True: 4.98k, False: 0]
  ------------------
 5733|      0|    return true;
 5734|      0|  }
 5735|  4.98k|  return previous < 0x110000 &&
  ------------------
  |  Branch (5735:10): [True: 4.18k, False: 801]
  ------------------
 5736|  4.18k|         has_composition(
  ------------------
  |  Branch (5736:10): [True: 8, False: 4.17k]
  ------------------
 5737|  4.18k|             composition_block_row(composition_index[previous >> 8]) +
 5738|  4.18k|                 (previous % 256),
 5739|  4.18k|             decomposition_data[base]);
 5740|  4.98k|}
serializers.cc:_ZN3ada4idnaL15has_compositionEPKtDi:
 5611|  19.8k|                            char32_t second) noexcept {
 5612|  19.8k|  int left = composition[0];
 5613|  19.8k|  int right = composition[1];
 5614|  19.8k|  if (left < 0 || right <= left ||
  ------------------
  |  Branch (5614:7): [True: 0, False: 19.8k]
  |  Branch (5614:19): [True: 2.80k, False: 17.0k]
  ------------------
 5615|  17.0k|      static_cast<size_t>(right) > composition_data_size) {
  ------------------
  |  Branch (5615:7): [True: 0, False: 17.0k]
  ------------------
 5616|  2.80k|    return false;
 5617|  2.80k|  }
 5618|  41.0k|  while (left + 2 < right) {
  ------------------
  |  Branch (5618:10): [True: 24.0k, False: 17.0k]
  ------------------
 5619|  24.0k|    int middle = left + (((right - left) >> 1) & ~1);
 5620|  24.0k|    if (composition_data[static_cast<size_t>(middle)] <= second) {
  ------------------
  |  Branch (5620:9): [True: 2.70k, False: 21.3k]
  ------------------
 5621|  2.70k|      left = middle;
 5622|  2.70k|    }
 5623|  24.0k|    if (composition_data[static_cast<size_t>(middle)] >= second) {
  ------------------
  |  Branch (5623:9): [True: 21.7k, False: 2.26k]
  ------------------
 5624|  21.7k|      right = middle;
 5625|  21.7k|    }
 5626|  24.0k|  }
 5627|  17.0k|  return static_cast<size_t>(left + 1) < composition_data_size &&
  ------------------
  |  Branch (5627:10): [True: 17.0k, False: 0]
  ------------------
 5628|  17.0k|         composition_data[static_cast<size_t>(left)] == second;
  ------------------
  |  Branch (5628:10): [True: 536, False: 16.4k]
  ------------------
 5629|  19.8k|}
serializers.cc:_ZN3ada4idnaL12trailing_cccEDi:
 5684|  71.3k|static uint8_t trailing_ccc(char32_t c) noexcept {
 5685|  71.3k|  const size_t length = canonical_decomp_length(c);
 5686|  71.3k|  if (length == 0) {
  ------------------
  |  Branch (5686:7): [True: 66.7k, False: 4.62k]
  ------------------
 5687|  66.7k|    return get_ccc(c);
 5688|  66.7k|  }
 5689|  4.62k|  const uint16_t* const decomposition =
 5690|  4.62k|      decomposition_block_row(decomposition_index[c >> 8]) + (c % 256);
 5691|  4.62k|  const size_t base = decomposition[0] >> 2;
 5692|  4.62k|  return get_ccc(decomposition_data[base + length - 1]);
 5693|  71.3k|}
serializers.cc:_ZN3ada4idnaL23canonical_decomp_lengthEDi:
 5478|  71.3k|static size_t canonical_decomp_length(char32_t current_character) noexcept {
 5479|  71.3k|  if (current_character >= hangul_sbase &&
  ------------------
  |  Branch (5479:7): [True: 4.26k, False: 67.1k]
  ------------------
 5480|  4.26k|      current_character < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5480:7): [True: 2.07k, False: 2.19k]
  ------------------
 5481|       |    // Hangul precomposed syllables are NFC.
 5482|  2.07k|    return 0;
 5483|  2.07k|  }
 5484|  69.3k|  if (current_character >= 0x110000) {
  ------------------
  |  Branch (5484:7): [True: 0, False: 69.3k]
  ------------------
 5485|      0|    return 0;
 5486|      0|  }
 5487|  69.3k|  const uint8_t di = decomposition_index[current_character >> 8];
 5488|  69.3k|  const uint16_t* const decomposition =
 5489|  69.3k|      decomposition_block_row(di) + (current_character % 256);
 5490|  69.3k|  size_t decomposition_length =
 5491|  69.3k|      (decomposition[1] >> 2) - (decomposition[0] >> 2);
 5492|  69.3k|  if ((decomposition_length > 0) && (decomposition[0] & 1)) {
  ------------------
  |  Branch (5492:7): [True: 4.62k, False: 64.6k]
  |  Branch (5492:37): [True: 0, False: 4.62k]
  ------------------
 5493|      0|    decomposition_length = 0;  // compatibility-only: ignored for NFC
 5494|      0|  }
 5495|  69.3k|  return decomposition_length;
 5496|  69.3k|}
serializers.cc:_ZN3ada4idnaL13would_composeENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5632|  2.52k|static bool would_compose(std::u32string_view input) noexcept {
 5633|  60.5k|  for (size_t input_count = 0; input_count < input.size();) {
  ------------------
  |  Branch (5633:32): [True: 58.7k, False: 1.87k]
  ------------------
 5634|  58.7k|    const char32_t current = input[input_count];
 5635|  58.7k|    if (current >= hangul_lbase && current < hangul_lbase + hangul_lcount) {
  ------------------
  |  Branch (5635:9): [True: 16.7k, False: 41.9k]
  |  Branch (5635:36): [True: 538, False: 16.1k]
  ------------------
 5636|    538|      if (input_count + 1 < input.size() &&
  ------------------
  |  Branch (5636:11): [True: 514, False: 24]
  ------------------
 5637|    514|          input[input_count + 1] >= hangul_vbase &&
  ------------------
  |  Branch (5637:11): [True: 224, False: 290]
  ------------------
 5638|    224|          input[input_count + 1] < hangul_vbase + hangul_vcount) {
  ------------------
  |  Branch (5638:11): [True: 74, False: 150]
  ------------------
 5639|     74|        return true;
 5640|     74|      }
 5641|    464|      ++input_count;
 5642|    464|      continue;
 5643|    538|    }
 5644|  58.1k|    if (current >= hangul_sbase && current < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5644:9): [True: 2.67k, False: 55.4k]
  |  Branch (5644:36): [True: 1.44k, False: 1.23k]
  ------------------
 5645|  1.44k|      if ((current - hangul_sbase) % hangul_tcount == 0 &&
  ------------------
  |  Branch (5645:11): [True: 571, False: 871]
  ------------------
 5646|    571|          input_count + 1 < input.size() &&
  ------------------
  |  Branch (5646:11): [True: 552, False: 19]
  ------------------
 5647|    552|          input[input_count + 1] > hangul_tbase &&
  ------------------
  |  Branch (5647:11): [True: 412, False: 140]
  ------------------
 5648|    412|          input[input_count + 1] < hangul_tbase + hangul_tcount) {
  ------------------
  |  Branch (5648:11): [True: 44, False: 368]
  ------------------
 5649|     44|        return true;
 5650|     44|      }
 5651|  1.39k|      ++input_count;
 5652|  1.39k|      continue;
 5653|  1.44k|    }
 5654|  56.7k|    if (current < 0x110000) {
  ------------------
  |  Branch (5654:9): [True: 56.7k, False: 0]
  ------------------
 5655|  56.7k|      const uint16_t* composition =
 5656|  56.7k|          composition_block_row(composition_index[current >> 8]) +
 5657|  56.7k|          (current % 256);
 5658|  56.7k|      int32_t previous_ccc = -1;
 5659|  56.7k|      size_t j = input_count;
 5660|  58.0k|      for (; j + 1 < input.size(); ++j) {
  ------------------
  |  Branch (5660:14): [True: 56.2k, False: 1.82k]
  ------------------
 5661|  56.2k|        uint8_t ccc = get_ccc(input[j + 1]);
 5662|  56.2k|        if (composition[1] != composition[0] && previous_ccc < ccc &&
  ------------------
  |  Branch (5662:13): [True: 16.1k, False: 40.0k]
  |  Branch (5662:49): [True: 15.6k, False: 544]
  ------------------
 5663|  15.6k|            has_composition(composition, input[j + 1])) {
  ------------------
  |  Branch (5663:13): [True: 528, False: 15.0k]
  ------------------
 5664|    528|          return true;
 5665|    528|        }
 5666|  55.7k|        if (ccc == 0) {
  ------------------
  |  Branch (5666:13): [True: 54.3k, False: 1.33k]
  ------------------
 5667|  54.3k|          break;
 5668|  54.3k|        }
 5669|  1.33k|        previous_ccc = ccc;
 5670|  1.33k|      }
 5671|  56.2k|      input_count = j + 1;
 5672|  56.2k|      continue;
 5673|  56.7k|    }
 5674|      0|    ++input_count;
 5675|      0|  }
 5676|  1.87k|  return false;
 5677|  2.52k|}
_ZN3ada4idna21composition_block_rowEh:
 5208|  89.0k|inline const uint16_t* composition_block_row(uint8_t bi) noexcept {
 5209|  89.0k|  if (bi >= kCompBlockRows) {
  ------------------
  |  Branch (5209:7): [True: 0, False: 89.0k]
  ------------------
 5210|      0|    bi = 0;
 5211|      0|  }
 5212|  89.0k|  return composition_block_flat + static_cast<size_t>(bi) * kCompBlockCols;
 5213|  89.0k|}
serializers.cc:_ZN3ada4idnaL19char_to_digit_valueEc:
 5913|  14.5k|static constexpr int32_t char_to_digit_value(char value) {
 5914|  14.5k|  if (value >= 'a' && value <= 'z') return value - 'a';
  ------------------
  |  Branch (5914:7): [True: 12.1k, False: 2.39k]
  |  Branch (5914:23): [True: 12.1k, False: 3]
  ------------------
 5915|  2.39k|  if (value >= '0' && value <= '9') return value - '0' + 26;
  ------------------
  |  Branch (5915:7): [True: 2.38k, False: 10]
  |  Branch (5915:23): [True: 2.37k, False: 7]
  ------------------
 5916|     17|  return -1;
 5917|  2.39k|}
serializers.cc:_ZN3ada4idnaL5adaptEiib:
 5923|  24.5k|static constexpr int32_t adapt(int32_t d, int32_t n, bool firsttime) {
 5924|  24.5k|  if (firsttime) {
  ------------------
  |  Branch (5924:7): [True: 4.14k, False: 20.3k]
  ------------------
 5925|  4.14k|    d = d / damp;
 5926|  20.3k|  } else {
 5927|  20.3k|    d = d / 2;
 5928|  20.3k|  }
 5929|  24.5k|  d += d / n;
 5930|  24.5k|  int32_t k = 0;
 5931|  27.1k|  while (d > ((base - tmin) * tmax) / 2) {
  ------------------
  |  Branch (5931:10): [True: 2.65k, False: 24.5k]
  ------------------
 5932|  2.65k|    d /= base - tmin;
 5933|  2.65k|    k += base;
 5934|  2.65k|  }
 5935|  24.5k|  return k + (((base - tmin + 1) * d) / (d + skew));
 5936|  24.5k|}
serializers.cc:_ZN3ada4idnaL13digit_to_charEi:
 5919|  29.9k|static constexpr char digit_to_char(int32_t digit) {
 5920|  29.9k|  return digit < 26 ? char(digit + 97) : char(digit + 22);
  ------------------
  |  Branch (5920:10): [True: 24.3k, False: 5.66k]
  ------------------
 5921|  29.9k|}
serializers.cc:_ZZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEEENK3$_0clIA2_jEEDaRKT_:
 6327|  35.5k|      comb_span, label.front(), {}, [](const auto& range) { return range[1]; });
serializers.cc:_ZN3ada4idnaL17is_contextj_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 6232|  4.18k|inline static bool is_contextj_valid(std::u32string_view label) noexcept {
 6233|  4.18k|  constexpr uint8_t virama_ccc = 9;
 6234|  43.0k|  for (size_t i = 0; i < label.size(); i++) {
  ------------------
  |  Branch (6234:22): [True: 39.0k, False: 4.03k]
  ------------------
 6235|  39.0k|    if (label[i] != 0x200C && label[i] != 0x200D) {
  ------------------
  |  Branch (6235:9): [True: 38.6k, False: 309]
  |  Branch (6235:31): [True: 38.6k, False: 60]
  ------------------
 6236|  38.6k|      continue;
 6237|  38.6k|    }
 6238|       |    // If Canonical_Combining_Class(Before(cp)) .eq. Virama Then True;
 6239|    369|    if (i > 0 && get_ccc(label[i - 1]) == virama_ccc) {
  ------------------
  |  Branch (6239:9): [True: 367, False: 2]
  |  Branch (6239:18): [True: 70, False: 297]
  ------------------
 6240|     70|      continue;
 6241|     70|    }
 6242|    299|    if (label[i] == 0x200D) {
  ------------------
  |  Branch (6242:9): [True: 9, False: 290]
  ------------------
 6243|      9|      return false;
 6244|      9|    }
 6245|       |    // If RegExpMatch((Joining_Type:{L,D})(Joining_Type:T)*\u200C
 6246|       |    //    (Joining_Type:T)*(Joining_Type:{R,D})) Then True;
 6247|    290|    joining_type before = joining_type::U;
 6248|    535|    for (size_t j = i; j > 0;) {
  ------------------
  |  Branch (6248:24): [True: 533, False: 2]
  ------------------
 6249|    533|      before = find_joining_type(label[--j]);
 6250|    533|      if (before != joining_type::T) {
  ------------------
  |  Branch (6250:11): [True: 288, False: 245]
  ------------------
 6251|    288|        break;
 6252|    288|      }
 6253|    533|    }
 6254|    290|    if (before != joining_type::L && before != joining_type::D) {
  ------------------
  |  Branch (6254:9): [True: 266, False: 24]
  |  Branch (6254:38): [True: 54, False: 212]
  ------------------
 6255|     54|      return false;
 6256|     54|    }
 6257|    236|    joining_type after = joining_type::U;
 6258|    541|    for (size_t j = i + 1; j < label.size(); j++) {
  ------------------
  |  Branch (6258:28): [True: 498, False: 43]
  ------------------
 6259|    498|      after = find_joining_type(label[j]);
 6260|    498|      if (after != joining_type::T) {
  ------------------
  |  Branch (6260:11): [True: 193, False: 305]
  ------------------
 6261|    193|        break;
 6262|    193|      }
 6263|    498|    }
 6264|    236|    if (after != joining_type::R && after != joining_type::D) {
  ------------------
  |  Branch (6264:9): [True: 191, False: 45]
  |  Branch (6264:37): [True: 83, False: 108]
  ------------------
 6265|     83|      return false;
 6266|     83|    }
 6267|    236|  }
 6268|  4.03k|  return true;
 6269|  4.18k|}
serializers.cc:_ZN3ada4idnaL17find_joining_typeEj:
 6224|  1.03k|inline static joining_type find_joining_type(uint32_t code_point) noexcept {
 6225|  1.03k|  size_t i =
 6226|  1.03k|      find_range(joining_start, joining_final, joining_table_count, code_point);
 6227|  1.03k|  return i == joining_table_count ? joining_type::U
  ------------------
  |  Branch (6227:10): [True: 88, False: 943]
  ------------------
 6228|  1.03k|                                  : static_cast<joining_type>(joining_value[i]);
 6229|  1.03k|}
serializers.cc:_ZN3ada4idnaL10find_rangeEPKjS2_mj:
 6203|  48.2k|                                size_t count, uint32_t code_point) noexcept {
 6204|  48.2k|  size_t lo = 0, hi = count;
 6205|   556k|  while (lo < hi) {
  ------------------
  |  Branch (6205:10): [True: 508k, False: 48.2k]
  ------------------
 6206|   508k|    size_t mid = lo + (hi - lo) / 2;
 6207|   508k|    if (last[mid] < code_point) {
  ------------------
  |  Branch (6207:9): [True: 153k, False: 354k]
  ------------------
 6208|   153k|      lo = mid + 1;
 6209|   354k|    } else {
 6210|   354k|      hi = mid;
 6211|   354k|    }
 6212|   508k|  }
 6213|  48.2k|  return lo < count && code_point >= start[lo] ? lo : count;
  ------------------
  |  Branch (6213:10): [True: 48.2k, False: 0]
  |  Branch (6213:24): [True: 48.1k, False: 88]
  ------------------
 6214|  48.2k|}
serializers.cc:_ZN3ada4idnaL20find_last_not_of_nsmENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 6272|  4.03k|    const std::u32string_view label) noexcept {
 6273|  4.98k|  for (int i = static_cast<int>(label.size() - 1); i >= 0; i--)
  ------------------
  |  Branch (6273:52): [True: 4.98k, False: 0]
  ------------------
 6274|  4.98k|    if (find_direction(label[i]) != direction::NSM) return i;
  ------------------
  |  Branch (6274:9): [True: 4.03k, False: 954]
  ------------------
 6275|       |
 6276|      0|  return std::u32string_view::npos;
 6277|  4.03k|}
serializers.cc:_ZN3ada4idnaL12is_rtl_labelENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 6281|  4.03k|inline static bool is_rtl_label(const std::u32string_view label) noexcept {
 6282|  4.03k|  const size_t mask =
 6283|  4.03k|      (1u << direction::R) | (1u << direction::AL) | (1u << direction::AN);
 6284|       |
 6285|  4.03k|  size_t directions = 0;
 6286|  40.4k|  for (size_t i = 0; i < label.size(); i++) {
  ------------------
  |  Branch (6286:22): [True: 36.3k, False: 4.03k]
  ------------------
 6287|  36.3k|    directions |= 1u << find_direction(label[i]);
 6288|  36.3k|  }
 6289|  4.03k|  return (directions & mask) != 0;
 6290|  4.03k|}
serializers.cc:_ZN3ada4idnaL14find_directionEj:
 6217|  47.2k|inline static direction find_direction(uint32_t code_point) noexcept {
 6218|  47.2k|  size_t i = find_range(dir_start, dir_final, dir_table_count, code_point);
 6219|  47.2k|  return i == dir_table_count ? direction::NONE
  ------------------
  |  Branch (6219:10): [True: 0, False: 47.2k]
  ------------------
 6220|  47.2k|                              : static_cast<direction>(dir_value[i]);
 6221|  47.2k|}
_ZN3ada4idna8is_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6552|  2.76k|bool constexpr is_ascii(std::string_view view) {
 6553|  19.9k|  for (uint8_t c : view) {
  ------------------
  |  Branch (6553:18): [True: 19.9k, False: 145]
  ------------------
 6554|  19.9k|    if (c >= 0x80) {
  ------------------
  |  Branch (6554:9): [True: 2.62k, False: 17.3k]
  ------------------
 6555|  2.62k|      return false;
 6556|  2.62k|    }
 6557|  19.9k|  }
 6558|    145|  return true;
 6559|  2.76k|}
serializers.cc:_ZN3ada4idnaL19from_ascii_to_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEERNS1_12basic_stringIcS4_NS1_9allocatorIcEEEE:
 6589|    145|static void from_ascii_to_ascii(std::string_view ut8_string, std::string& out) {
 6590|    145|  out.assign(ut8_string);
 6591|    145|  ascii_map(out.data(), out.size());
 6592|    145|}
_ZN3ada4idna8is_asciiENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 6543|  9.46k|bool constexpr is_ascii(std::u32string_view view) {
 6544|  37.7k|  for (uint32_t c : view) {
  ------------------
  |  Branch (6544:19): [True: 37.7k, False: 2.15k]
  ------------------
 6545|  37.7k|    if (c >= 0x80) {
  ------------------
  |  Branch (6545:9): [True: 7.30k, False: 30.4k]
  ------------------
 6546|  7.30k|      return false;
 6547|  7.30k|    }
 6548|  37.7k|  }
 6549|  2.15k|  return true;
 6550|  9.46k|}
serializers.cc:_ZN3ada4idnaL13is_ace_prefixENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 6605|  6.30k|static bool is_ace_prefix(std::u32string_view label) noexcept {
 6606|  6.30k|  return label.size() >= 4 && label[0] == U'x' && label[1] == U'n' &&
  ------------------
  |  Branch (6606:10): [True: 3.44k, False: 2.86k]
  |  Branch (6606:31): [True: 1.34k, False: 2.09k]
  |  Branch (6606:51): [True: 1.27k, False: 69]
  ------------------
 6607|  1.27k|         label[2] == U'-' && label[3] == U'-';
  ------------------
  |  Branch (6607:10): [True: 1.23k, False: 47]
  |  Branch (6607:30): [True: 1.18k, False: 49]
  ------------------
 6608|  6.30k|}
serializers.cc:_ZN3ada4idnaL18append_ascii_labelERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIDiNS3_IDiEEEE:
 6595|  2.77k|static void append_ascii_label(std::string& out, std::u32string_view label) {
 6596|  2.77k|  const size_t old = out.size();
 6597|  2.77k|  out.resize(old + label.size());
 6598|  2.77k|  char* dest = out.data() + old;
 6599|  24.9k|  for (char32_t c : label) {
  ------------------
  |  Branch (6599:19): [True: 24.9k, False: 2.77k]
  ------------------
 6600|  24.9k|    *dest++ = static_cast<char>(c);
 6601|  24.9k|  }
 6602|  2.77k|}
_ZZN3ada7unicode14percent_encodeILb1EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKhRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEEENKUlcE_clEc:
 7621|  28.8k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7622|  28.8k|    return character_sets::bit_at(character_set, c);
 7623|  28.8k|  });
_ZZN3ada7unicode14percent_encodeILb0EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKhRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEEENKUlcE_clEc:
 7621|  31.2k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7622|  31.2k|    return character_sets::bit_at(character_set, c);
 7623|  31.2k|  });
_ZN3ada7unicode18is_ascii_hex_digitEc:
 7355|  11.8k|ada_really_inline constexpr bool is_ascii_hex_digit(const char c) noexcept {
 7356|  11.8k|  return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') ||
  ------------------
  |  Branch (7356:11): [True: 10.3k, False: 1.45k]
  |  Branch (7356:23): [True: 5.45k, False: 4.94k]
  |  Branch (7356:37): [True: 4.91k, False: 1.47k]
  |  Branch (7356:49): [True: 3.64k, False: 1.27k]
  ------------------
 7357|  2.74k|         (c >= 'a' && c <= 'f');
  ------------------
  |  Branch (7357:11): [True: 1.23k, False: 1.51k]
  |  Branch (7357:23): [True: 1.15k, False: 72]
  ------------------
 7358|  11.8k|}
_ZN3ada7unicode21convert_hex_to_binaryEc:
 7445|  9.73k|unsigned constexpr convert_hex_to_binary(const char c) noexcept {
 7446|  9.73k|  return hex_to_binary_table[c - '0'];
 7447|  9.73k|}
serializers.cc:_ZZN3ada7unicode14percent_encodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKhENK3$_0clEc:
 7589|  29.8k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7590|  29.8k|    return character_sets::bit_at(character_set, c);
 7591|  29.8k|  });
_ZN3ada7unicode36contains_forbidden_domain_code_pointEPKcm:
 7282|  8.75k|    const char* input, size_t length) noexcept {
 7283|  8.75k|  size_t i = 0;
 7284|  8.75k|  uint8_t accumulator{};
 7285|  55.6k|  for (; i + 4 <= length; i += 4) {
  ------------------
  |  Branch (7285:10): [True: 46.8k, False: 8.75k]
  ------------------
 7286|  46.8k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i])];
 7287|  46.8k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i + 1])];
 7288|  46.8k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i + 2])];
 7289|  46.8k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i + 3])];
 7290|  46.8k|  }
 7291|  20.5k|  for (; i < length; i++) {
  ------------------
  |  Branch (7291:10): [True: 11.8k, False: 8.75k]
  ------------------
 7292|  11.8k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i])];
 7293|  11.8k|  }
 7294|  8.75k|  return accumulator;
 7295|  8.75k|}
serializers.cc:_ZN3ada7unicode12_GLOBAL__N_122percent_encode_to_wideEPKcS3_PKhRNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEE:
 7975|  1.23k|                            const uint8_t character_set[], std::string& out) {
 7976|       |  // Worst case every byte becomes %XX. Avoids realloc while walking windows.
 7977|  1.23k|  out.reserve(out.size() + static_cast<size_t>(end - p) * 3);
 7978|  1.23k|#if ADA_UNICODE_SSSE3
 7979|  1.23k|  const ssse3_percent_tables tables = load_ssse3_percent_tables(character_set);
 7980|  1.23k|  percent_encode_to_ssse3(p, end, character_set, tables, out);
 7981|       |#elif ADA_NEON
 7982|       |  percent_encode_to_neon(p, end, character_set,
 7983|       |                         load_neon_percent_table(character_set), out);
 7984|       |#elif ADA_RVV
 7985|       |  percent_encode_to_rvv(p, end, character_set, out);
 7986|       |#endif
 7987|  1.23k|}
serializers.cc:_ZN3ada7unicode12_GLOBAL__N_125load_ssse3_percent_tablesEPKh:
 7802|  1.23k|load_ssse3_percent_tables(const uint8_t character_set[]) noexcept {
 7803|  1.23k|  ssse3_percent_tables t{};
 7804|  1.23k|  t.cs_lo = _mm_loadu_si128(reinterpret_cast<const __m128i*>(character_set));
 7805|  1.23k|  t.cs_hi =
 7806|  1.23k|      _mm_loadu_si128(reinterpret_cast<const __m128i*>(character_set + 16));
 7807|       |  // 1 << (0..7), duplicated so pshufb(index & 7) works for every lane.
 7808|  1.23k|  t.pow2 =
 7809|  1.23k|      _mm_setr_epi8(1, 2, 4, 8, 16, 32, 64, -128, 1, 2, 4, 8, 16, 32, 64, -128);
 7810|  1.23k|  t.mask_0f = _mm_set1_epi8(0x0F);
 7811|  1.23k|  t.mask_07 = _mm_set1_epi8(0x07);
 7812|  1.23k|  t.zero = _mm_setzero_si128();
 7813|  1.23k|  return t;
 7814|  1.23k|}
serializers.cc:_ZN3ada7unicode12_GLOBAL__N_123percent_encode_to_ssse3EPKcS3_PKhRKNS1_20ssse3_percent_tablesERNSt3__112basic_stringIcNS9_11char_traitsIcEENS9_9allocatorIcEEEE:
 7833|  1.23k|    const ssse3_percent_tables& tables, std::string& out) {
 7834|       |  // Pair 16-byte windows so a fully clean 32-byte run is one append.
 7835|  3.33k|  while (p + 32 <= end) {
  ------------------
  |  Branch (7835:10): [True: 2.09k, False: 1.23k]
  ------------------
 7836|  2.09k|    const __m128i word0 = _mm_loadu_si128(reinterpret_cast<const __m128i*>(p));
 7837|  2.09k|    const __m128i word1 =
 7838|  2.09k|        _mm_loadu_si128(reinterpret_cast<const __m128i*>(p + 16));
 7839|  2.09k|    const int mask0 = ssse3_percent_mask(word0, tables);
 7840|  2.09k|    const int mask1 = ssse3_percent_mask(word1, tables);
 7841|  2.09k|    if ((mask0 | mask1) == 0) {
  ------------------
  |  Branch (7841:9): [True: 349, False: 1.74k]
  ------------------
 7842|    349|      out.append(p, 32);
 7843|  1.74k|    } else {
 7844|  1.74k|      if (mask0 == 0) {
  ------------------
  |  Branch (7844:11): [True: 183, False: 1.56k]
  ------------------
 7845|    183|        out.append(p, 16);
 7846|  1.56k|      } else {
 7847|  1.56k|        encode_mask_window(p, static_cast<uint32_t>(mask0), 16, out);
 7848|  1.56k|      }
 7849|  1.74k|      if (mask1 == 0) {
  ------------------
  |  Branch (7849:11): [True: 242, False: 1.50k]
  ------------------
 7850|    242|        out.append(p + 16, 16);
 7851|  1.50k|      } else {
 7852|  1.50k|        encode_mask_window(p + 16, static_cast<uint32_t>(mask1), 16, out);
 7853|  1.50k|      }
 7854|  1.74k|    }
 7855|  2.09k|    p += 32;
 7856|  2.09k|  }
 7857|  1.23k|  if (p + 16 <= end) {
  ------------------
  |  Branch (7857:7): [True: 874, False: 363]
  ------------------
 7858|    874|    const __m128i word = _mm_loadu_si128(reinterpret_cast<const __m128i*>(p));
 7859|    874|    const int mask = ssse3_percent_mask(word, tables);
 7860|    874|    if (mask == 0) {
  ------------------
  |  Branch (7860:9): [True: 198, False: 676]
  ------------------
 7861|    198|      out.append(p, 16);
 7862|    676|    } else {
 7863|    676|      encode_mask_window(p, static_cast<uint32_t>(mask), 16, out);
 7864|    676|    }
 7865|    874|    p += 16;
 7866|    874|  }
 7867|  1.23k|  percent_encode_to_scalar(p, end, character_set, out);
 7868|  1.23k|}
serializers.cc:_ZN3ada7unicode12_GLOBAL__N_118ssse3_percent_maskEDv2_xRKNS1_20ssse3_percent_tablesE:
 7817|  5.06k|    __m128i word, const ssse3_percent_tables& tables) noexcept {
 7818|  5.06k|  const __m128i idx = _mm_and_si128(_mm_srli_epi16(word, 3), tables.mask_0f);
 7819|  5.06k|  const __m128i lo = _mm_shuffle_epi8(tables.cs_lo, idx);
 7820|  5.06k|  const __m128i hi = _mm_shuffle_epi8(tables.cs_hi, idx);
 7821|       |  // Bytes 0x80-0xFF are signed-negative; select the high half of the bitmap.
 7822|  5.06k|  const __m128i high_byte = _mm_cmpgt_epi8(tables.zero, word);
 7823|  5.06k|  const __m128i cs_byte = _mm_or_si128(_mm_and_si128(hi, high_byte),
 7824|  5.06k|                                       _mm_andnot_si128(high_byte, lo));
 7825|  5.06k|  const __m128i bits =
 7826|  5.06k|      _mm_shuffle_epi8(tables.pow2, _mm_and_si128(word, tables.mask_07));
 7827|  5.06k|  const __m128i hits = _mm_and_si128(cs_byte, bits);
 7828|  5.06k|  return _mm_movemask_epi8(_mm_cmpeq_epi8(hits, tables.zero)) ^ 0xFFFF;
 7829|  5.06k|}
serializers.cc:_ZN3ada7unicode12_GLOBAL__N_118encode_mask_windowEPKcjmRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
 7757|  3.74k|                                          size_t width, std::string& out) {
 7758|  3.74k|  uint64_t bits = mask;
 7759|  3.74k|  size_t off = 0;
 7760|  37.0k|  while (bits != 0) {
  ------------------
  |  Branch (7760:10): [True: 33.3k, False: 3.74k]
  ------------------
 7761|  33.3k|    const int zero_run = trailing_zeroes32(static_cast<uint32_t>(bits));
 7762|  33.3k|    if (zero_run != 0) {
  ------------------
  |  Branch (7762:9): [True: 4.33k, False: 28.9k]
  ------------------
 7763|  4.33k|      out.append(p + off, static_cast<size_t>(zero_run));
 7764|  4.33k|    }
 7765|  33.3k|    off += static_cast<size_t>(zero_run);
 7766|  33.3k|    out.append(character_sets::hex + uint8_t(p[off]) * 4, 3);
 7767|  33.3k|    ++off;
 7768|  33.3k|    bits >>= static_cast<unsigned>(zero_run + 1);
 7769|  33.3k|  }
 7770|  3.74k|  if (off < width) {
  ------------------
  |  Branch (7770:7): [True: 1.69k, False: 2.04k]
  ------------------
 7771|  1.69k|    out.append(p + off, width - off);
 7772|  1.69k|  }
 7773|  3.74k|}
serializers.cc:_ZN3ada7unicode12_GLOBAL__N_117trailing_zeroes32Ej:
 7745|  33.3k|ada_really_inline int trailing_zeroes32(uint32_t input_num) noexcept {
 7746|       |#ifdef ADA_REGULAR_VISUAL_STUDIO
 7747|       |  unsigned long ret;
 7748|       |  _BitScanForward(&ret, input_num);
 7749|       |  return static_cast<int>(ret);
 7750|       |#else
 7751|  33.3k|  return __builtin_ctz(input_num);
 7752|  33.3k|#endif
 7753|  33.3k|}
serializers.cc:_ZN3ada7unicode12_GLOBAL__N_124percent_encode_to_scalarEPKcS3_PKhRNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEE:
 7778|  1.23k|                                                std::string& out) {
 7779|  4.42k|  for (; p != end; ++p) {
  ------------------
  |  Branch (7779:10): [True: 3.18k, False: 1.23k]
  ------------------
 7780|  3.18k|    if (character_sets::bit_at(character_set, *p)) {
  ------------------
  |  Branch (7780:9): [True: 971, False: 2.21k]
  ------------------
 7781|    971|      out.append(character_sets::hex + uint8_t(*p) * 4, 3);
 7782|  2.21k|    } else {
 7783|  2.21k|      out += *p;
 7784|  2.21k|    }
 7785|  3.18k|  }
 7786|  1.23k|}
serializers.cc:_ZN3ada11serializers12_GLOBAL__N_113write_hex_u16EPct:
 8048|  52.7k|ada_really_inline char* write_hex_u16(char* p, uint16_t v) noexcept {
 8049|  52.7k|  static constexpr char kHex[] = "0123456789abcdef";
 8050|  52.7k|  if (v >= 0x1000) {
  ------------------
  |  Branch (8050:7): [True: 47.3k, False: 5.43k]
  ------------------
 8051|  47.3k|    *p++ = kHex[(v >> 12) & 0xf];
 8052|  47.3k|    *p++ = kHex[(v >> 8) & 0xf];
 8053|  47.3k|    *p++ = kHex[(v >> 4) & 0xf];
 8054|  47.3k|    *p++ = kHex[v & 0xf];
 8055|  47.3k|  } else if (v >= 0x100) {
  ------------------
  |  Branch (8055:14): [True: 1.39k, False: 4.03k]
  ------------------
 8056|  1.39k|    *p++ = kHex[(v >> 8) & 0xf];
 8057|  1.39k|    *p++ = kHex[(v >> 4) & 0xf];
 8058|  1.39k|    *p++ = kHex[v & 0xf];
 8059|  4.03k|  } else if (v >= 0x10) {
  ------------------
  |  Branch (8059:14): [True: 2.04k, False: 1.99k]
  ------------------
 8060|  2.04k|    *p++ = kHex[(v >> 4) & 0xf];
 8061|  2.04k|    *p++ = kHex[v & 0xf];
 8062|  2.04k|  } else {
 8063|  1.99k|    *p++ = kHex[v & 0xf];
 8064|  1.99k|  }
 8065|  52.7k|  return p;
 8066|  52.7k|}
serializers.cc:_ZN3ada11serializers12_GLOBAL__N_18write_u8EPch:
 8034|  31.4k|ada_really_inline char* write_u8(char* p, uint8_t v) noexcept {
 8035|  31.4k|  if (v < 10) {
  ------------------
  |  Branch (8035:7): [True: 7.02k, False: 24.3k]
  ------------------
 8036|  7.02k|    *p++ = static_cast<char>('0' + v);
 8037|  24.3k|  } else if (v < 100) {
  ------------------
  |  Branch (8037:14): [True: 14.0k, False: 10.3k]
  ------------------
 8038|  14.0k|    std::memcpy(p, &digit_pairs[static_cast<size_t>(v) * 2], 2);
 8039|  14.0k|    p += 2;
 8040|  14.0k|  } else {
 8041|  10.3k|    *p++ = static_cast<char>('0' + v / 100);
 8042|  10.3k|    std::memcpy(p, &digit_pairs[static_cast<size_t>(v % 100) * 2], 2);
 8043|  10.3k|    p += 2;
 8044|  10.3k|  }
 8045|  31.4k|  return p;
 8046|  31.4k|}
_ZN3ada7unicode19has_tabs_or_newlineENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 7131|  21.2k|    std::string_view user_input) noexcept {
 7132|       |  // first check for short strings in which case we do it naively.
 7133|  21.2k|  if (user_input.size() < 16) {  // slow path
  ------------------
  |  Branch (7133:7): [True: 6.89k, False: 14.3k]
  ------------------
 7134|  6.89k|    return std::ranges::any_of(user_input, is_tabs_or_newline);
 7135|  6.89k|  }
 7136|       |  // fast path for long strings (expected to be common)
 7137|  14.3k|  size_t i = 0;
 7138|  14.3k|  const __m128i mask1 = _mm_set1_epi8('\r');
 7139|  14.3k|  const __m128i mask2 = _mm_set1_epi8('\n');
 7140|  14.3k|  const __m128i mask3 = _mm_set1_epi8('\t');
 7141|       |  // If we supported SSSE3, we could use the algorithm that we use for NEON.
 7142|  14.3k|  __m128i running{0};
 7143|  49.1k|  for (; i + 15 < user_input.size(); i += 16) {
  ------------------
  |  Branch (7143:10): [True: 34.8k, False: 14.3k]
  ------------------
 7144|  34.8k|    __m128i word = _mm_loadu_si128((const __m128i*)(user_input.data() + i));
 7145|  34.8k|    running = _mm_or_si128(
 7146|  34.8k|        _mm_or_si128(running, _mm_or_si128(_mm_cmpeq_epi8(word, mask1),
 7147|  34.8k|                                           _mm_cmpeq_epi8(word, mask2))),
 7148|  34.8k|        _mm_cmpeq_epi8(word, mask3));
 7149|  34.8k|  }
 7150|  14.3k|  if (i < user_input.size()) {
  ------------------
  |  Branch (7150:7): [True: 13.4k, False: 930]
  ------------------
 7151|  13.4k|    __m128i word = _mm_loadu_si128(
 7152|  13.4k|        (const __m128i*)(user_input.data() + user_input.length() - 16));
 7153|  13.4k|    running = _mm_or_si128(
 7154|  13.4k|        _mm_or_si128(running, _mm_or_si128(_mm_cmpeq_epi8(word, mask1),
 7155|  13.4k|                                           _mm_cmpeq_epi8(word, mask2))),
 7156|  13.4k|        _mm_cmpeq_epi8(word, mask3));
 7157|  13.4k|  }
 7158|  14.3k|  return _mm_movemask_epi8(running) != 0;
 7159|  21.2k|}
_ZN3ada7unicode18is_tabs_or_newlineEc:
 7016|  54.1k|constexpr bool is_tabs_or_newline(char c) noexcept {
 7017|  54.1k|  return c == '\r' || c == '\n' || c == '\t';
  ------------------
  |  Branch (7017:10): [True: 79, False: 54.0k]
  |  Branch (7017:23): [True: 78, False: 53.9k]
  |  Branch (7017:36): [True: 77, False: 53.8k]
  ------------------
 7018|  54.1k|}
_ZN3ada7helpers27remove_ascii_tab_or_newlineERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 8844|    174|ada_really_inline void remove_ascii_tab_or_newline(std::string& input) {
 8845|       |  // Fast path: inputs with no tab/newline (the common case) avoid the
 8846|       |  // per-character erase_if scan. has_tabs_or_newline uses SIMD for inputs
 8847|       |  // >= 16 bytes, making this check much cheaper than erase_if's scalar
 8848|       |  // predicate walk when there is nothing to remove.
 8849|    174|  if (!ada::unicode::has_tabs_or_newline(input)) {
  ------------------
  |  Branch (8849:7): [True: 0, False: 174]
  ------------------
 8850|      0|    return;
 8851|      0|  }
 8852|    174|  std::erase_if(input, ada::unicode::is_ascii_tab_or_newline);
 8853|    174|}
_ZN3ada7unicode23is_ascii_tab_or_newlineEc:
 7376|  5.29k|    const char c) noexcept {
 7377|  5.29k|  return c == '\t' || c == '\n' || c == '\r';
  ------------------
  |  Branch (7377:10): [True: 274, False: 5.02k]
  |  Branch (7377:23): [True: 275, False: 4.74k]
  |  Branch (7377:36): [True: 299, False: 4.44k]
  ------------------
 7378|  5.29k|}
_ZN3ada7unicode22is_c0_control_or_spaceEc:
 7371|  25.1k|ada_really_inline constexpr bool is_c0_control_or_space(const char c) noexcept {
 7372|  25.1k|  return (unsigned char)c <= ' ';
 7373|  25.1k|}
_ZN3ada7unicode26is_double_dot_path_segmentENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 7384|  4.17k|    std::string_view input) noexcept {
 7385|       |  // This will catch most cases:
 7386|       |  // The length must be 2,4 or 6.
 7387|       |  // We divide by two and require
 7388|       |  // that the result be between 1 and 3 inclusively.
 7389|  4.17k|  uint64_t half_length = uint64_t(input.size()) / 2;
 7390|  4.17k|  if (half_length - 1 > 2) {
  ------------------
  |  Branch (7390:7): [True: 2.45k, False: 1.71k]
  ------------------
 7391|  2.45k|    return false;
 7392|  2.45k|  }
 7393|       |  // We have a string of length 2, 4 or 6.
 7394|       |  // We now check the first character:
 7395|  1.71k|  if ((input[0] != '.') && (input[0] != '%')) {
  ------------------
  |  Branch (7395:7): [True: 884, False: 834]
  |  Branch (7395:28): [True: 222, False: 662]
  ------------------
 7396|    222|    return false;
 7397|    222|  }
 7398|       |  // We are unlikely the get beyond this point.
 7399|  1.49k|  int hash_value = (input.size() + (unsigned)(input[0])) & 3;
 7400|  1.49k|  const std::string_view target = table_is_double_dot_path_segment[hash_value];
 7401|  1.49k|  if (target.size() != input.size()) {
  ------------------
  |  Branch (7401:7): [True: 624, False: 872]
  ------------------
 7402|    624|    return false;
 7403|    624|  }
 7404|       |  // We almost never get here.
 7405|       |  // Optimizing the rest is relatively unimportant.
 7406|    872|  auto prefix_equal_unsafe = [](std::string_view a, std::string_view b) {
 7407|    872|    uint16_t A, B;
 7408|    872|    memcpy(&A, a.data(), sizeof(A));
 7409|    872|    memcpy(&B, b.data(), sizeof(B));
 7410|    872|    return A == B;
 7411|    872|  };
 7412|    872|  if (!prefix_equal_unsafe(input, target)) {
  ------------------
  |  Branch (7412:7): [True: 253, False: 619]
  ------------------
 7413|    253|    return false;
 7414|    253|  }
 7415|    928|  for (size_t i = 2; i < input.size(); i++) {
  ------------------
  |  Branch (7415:22): [True: 567, False: 361]
  ------------------
 7416|    567|    char c = input[i];
 7417|    567|    if ((uint8_t((c | 0x20) - 0x61) <= 25 ? (c | 0x20) : c) != target[i]) {
  ------------------
  |  Branch (7417:9): [True: 258, False: 309]
  |  Branch (7417:10): [True: 142, False: 425]
  ------------------
 7418|    258|      return false;
 7419|    258|    }
 7420|    567|  }
 7421|    361|  return true;
 7422|       |  // The above code might be a bit better than the code below. Compilers
 7423|       |  // are not stupid and may use the fact that these strings have length 2,4 and
 7424|       |  // 6 and other tricks.
 7425|       |  // return input == ".." ||
 7426|       |  //  input == ".%2e" || input == ".%2E" ||
 7427|       |  //  input == "%2e." || input == "%2E." ||
 7428|       |  //  input == "%2e%2e" || input == "%2E%2E" || input == "%2E%2e" || input ==
 7429|       |  //  "%2e%2E";
 7430|    619|}
_ZZN3ada7unicode26is_double_dot_path_segmentENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEENKUlS5_S5_E_clES5_S5_:
 7406|    872|  auto prefix_equal_unsafe = [](std::string_view a, std::string_view b) {
 7407|    872|    uint16_t A, B;
 7408|    872|    memcpy(&A, a.data(), sizeof(A));
 7409|    872|    memcpy(&B, b.data(), sizeof(B));
 7410|    872|    return A == B;
 7411|    872|  };
_ZN3ada7unicode26is_single_dot_path_segmentENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 7433|  7.61k|    std::string_view input) noexcept {
 7434|  7.61k|  return input == "." || input == "%2e" || input == "%2E";
  ------------------
  |  Branch (7434:10): [True: 397, False: 7.22k]
  |  Branch (7434:26): [True: 68, False: 7.15k]
  |  Branch (7434:44): [True: 26, False: 7.12k]
  ------------------
 7435|  7.61k|}
_ZN3ada6detail17parse_ipv4_numberERPKcS2_RmRb:
 9836|  2.65k|                              bool& is_pure_decimal) noexcept {
 9837|  2.65k|  is_pure_decimal = false;
 9838|  2.65k|  if (p >= end) [[unlikely]] {
  ------------------
  |  Branch (9838:7): [True: 0, False: 2.65k]
  ------------------
 9839|      0|    return false;
 9840|      0|  }
 9841|  2.65k|  if (end - p >= 2 && p[0] == '0' && ((p[1] | 0x20) == 'x')) {
  ------------------
  |  Branch (9841:7): [True: 2.27k, False: 379]
  |  Branch (9841:23): [True: 378, False: 1.90k]
  |  Branch (9841:38): [True: 210, False: 168]
  ------------------
 9842|    210|    p += 2;
 9843|    210|    if (p == end || *p == '.') {
  ------------------
  |  Branch (9843:9): [True: 6, False: 204]
  |  Branch (9843:21): [True: 10, False: 194]
  ------------------
 9844|     16|      value = 0;
 9845|     16|      return true;
 9846|     16|    }
 9847|    194|    uint64_t v = 0;
 9848|    194|    int digits = 0;
 9849|  1.34k|    while (p < end && *p != '.') {
  ------------------
  |  Branch (9849:12): [True: 1.22k, False: 123]
  |  Branch (9849:23): [True: 1.20k, False: 22]
  ------------------
 9850|  1.20k|      const uint8_t nib = hex_nibble[static_cast<unsigned char>(*p)];
 9851|  1.20k|      if (nib == 0xff) [[unlikely]] {
  ------------------
  |  Branch (9851:11): [True: 4, False: 1.19k]
  ------------------
 9852|      4|        return false;
 9853|      4|      }
 9854|  1.19k|      if (v > (0xFFFFFFFFULL >> 4)) [[unlikely]] {
  ------------------
  |  Branch (9854:11): [True: 45, False: 1.15k]
  ------------------
 9855|     45|        return false;
 9856|     45|      }
 9857|  1.15k|      v = (v << 4) | nib;
 9858|  1.15k|      ++p;
 9859|  1.15k|      ++digits;
 9860|  1.15k|    }
 9861|    145|    if (digits == 0) [[unlikely]] {
  ------------------
  |  Branch (9861:9): [True: 0, False: 145]
  ------------------
 9862|      0|      return false;
 9863|      0|    }
 9864|    145|    value = v;
 9865|    145|    return true;
 9866|    145|  }
 9867|  2.44k|  if (end - p >= 2 && p[0] == '0' && p[1] >= '0' && p[1] <= '9') {
  ------------------
  |  Branch (9867:7): [True: 2.06k, False: 379]
  |  Branch (9867:23): [True: 168, False: 1.90k]
  |  Branch (9867:38): [True: 96, False: 72]
  |  Branch (9867:53): [True: 88, False: 8]
  ------------------
 9868|     88|    ++p;
 9869|     88|    uint64_t v = 0;
 9870|    647|    while (p < end && *p != '.') {
  ------------------
  |  Branch (9870:12): [True: 586, False: 61]
  |  Branch (9870:23): [True: 577, False: 9]
  ------------------
 9871|    577|      const char c = *p;
 9872|    577|      if (c < '0' || c > '7') [[unlikely]] {
  ------------------
  |  Branch (9872:11): [True: 3, False: 574]
  |  Branch (9872:22): [True: 11, False: 563]
  ------------------
 9873|     14|        return false;
 9874|     14|      }
 9875|    563|      if (v > (0xFFFFFFFFULL >> 3)) [[unlikely]] {
  ------------------
  |  Branch (9875:11): [True: 4, False: 559]
  ------------------
 9876|      4|        return false;
 9877|      4|      }
 9878|    559|      v = (v << 3) | static_cast<uint64_t>(c - '0');
 9879|    559|      ++p;
 9880|    559|    }
 9881|     70|    value = v;
 9882|     70|    return true;
 9883|     88|  }
 9884|  2.36k|  if (*p < '0' || *p > '9') [[unlikely]] {
  ------------------
  |  Branch (9884:7): [True: 276, False: 2.08k]
  |  Branch (9884:19): [True: 1.30k, False: 782]
  ------------------
 9885|  1.57k|    return false;
 9886|  1.57k|  }
 9887|    782|  is_pure_decimal = true;
 9888|    782|  uint64_t v = static_cast<uint64_t>(*p - '0');
 9889|    782|  ++p;
 9890|  1.67k|  while (p < end && *p != '.') {
  ------------------
  |  Branch (9890:10): [True: 1.18k, False: 496]
  |  Branch (9890:21): [True: 946, False: 234]
  ------------------
 9891|    946|    const char c = *p;
 9892|    946|    if (c < '0' || c > '9') [[unlikely]] {
  ------------------
  |  Branch (9892:9): [True: 12, False: 934]
  |  Branch (9892:20): [True: 21, False: 913]
  ------------------
 9893|     33|      return false;
 9894|     33|    }
 9895|    913|    if (v > 429496729ULL) [[unlikely]] {
  ------------------
  |  Branch (9895:9): [True: 17, False: 896]
  ------------------
 9896|     17|      return false;
 9897|     17|    }
 9898|    896|    v = v * 10u + static_cast<uint64_t>(c - '0');
 9899|    896|    if (v > 0xFFFFFFFFULL) [[unlikely]] {
  ------------------
  |  Branch (9899:9): [True: 2, False: 894]
  ------------------
 9900|      2|      return false;
 9901|      2|    }
 9902|    894|    ++p;
 9903|    894|  }
 9904|    730|  value = v;
 9905|    730|  return true;
 9906|    782|}
_ZN3ada6detail15parse_hex_pieceERPKcS2_Rt:
 9910|  7.36k|                           uint16_t& value) noexcept {
 9911|  7.36k|  if (pointer == end) {
  ------------------
  |  Branch (9911:7): [True: 0, False: 7.36k]
  ------------------
 9912|      0|    return 0;
 9913|      0|  }
 9914|  7.36k|  const uint8_t n0 = hex_nibble[static_cast<unsigned char>(*pointer)];
 9915|  7.36k|  if (n0 == 0xff) {
  ------------------
  |  Branch (9915:7): [True: 7.13k, False: 231]
  ------------------
 9916|  7.13k|    return 0;
 9917|  7.13k|  }
 9918|    231|  uint32_t v = n0;
 9919|    231|  ++pointer;
 9920|    231|  int length = 1;
 9921|    231|  if (pointer != end) {
  ------------------
  |  Branch (9921:7): [True: 212, False: 19]
  ------------------
 9922|    212|    const uint8_t n1 = hex_nibble[static_cast<unsigned char>(*pointer)];
 9923|    212|    if (n1 != 0xff) {
  ------------------
  |  Branch (9923:9): [True: 74, False: 138]
  ------------------
 9924|     74|      v = (v << 4) | n1;
 9925|     74|      ++pointer;
 9926|     74|      ++length;
 9927|     74|      if (pointer != end) {
  ------------------
  |  Branch (9927:11): [True: 69, False: 5]
  ------------------
 9928|     69|        const uint8_t n2 = hex_nibble[static_cast<unsigned char>(*pointer)];
 9929|     69|        if (n2 != 0xff) {
  ------------------
  |  Branch (9929:13): [True: 43, False: 26]
  ------------------
 9930|     43|          v = (v << 4) | n2;
 9931|     43|          ++pointer;
 9932|     43|          ++length;
 9933|     43|          if (pointer != end) {
  ------------------
  |  Branch (9933:15): [True: 42, False: 1]
  ------------------
 9934|     42|            const uint8_t n3 = hex_nibble[static_cast<unsigned char>(*pointer)];
 9935|     42|            if (n3 != 0xff) {
  ------------------
  |  Branch (9935:17): [True: 18, False: 24]
  ------------------
 9936|     18|              v = (v << 4) | n3;
 9937|     18|              ++pointer;
 9938|     18|              ++length;
 9939|     18|            }
 9940|     42|          }
 9941|     43|        }
 9942|     69|      }
 9943|     74|    }
 9944|    212|  }
 9945|    231|  value = static_cast<uint16_t>(v);
 9946|    231|  return length;
 9947|  7.36k|}
_ZN3ada8checkers17verify_dns_lengthENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  102|  7.11k|    std::string_view input) noexcept {
  103|  7.11k|  if (input.empty()) return false;
  ------------------
  |  Branch (103:7): [True: 873, False: 6.24k]
  ------------------
  104|  6.24k|  if (input.back() == '.') {
  ------------------
  |  Branch (104:7): [True: 110, False: 6.13k]
  ------------------
  105|    110|    if (input.size() > 254) return false;
  ------------------
  |  Branch (105:9): [True: 0, False: 110]
  ------------------
  106|  6.13k|  } else if (input.size() > 253)
  ------------------
  |  Branch (106:14): [True: 0, False: 6.13k]
  ------------------
  107|      0|    return false;
  108|       |
  109|  6.24k|  size_t start = 0;
  110|  21.2k|  while (start < input.size()) {
  ------------------
  |  Branch (110:10): [True: 15.9k, False: 5.27k]
  ------------------
  111|  15.9k|    auto dot_location = input.find('.', start);
  112|       |    // If not found, it's likely the end of the domain
  113|  15.9k|    if (dot_location == std::string_view::npos) dot_location = input.size();
  ------------------
  |  Branch (113:9): [True: 5.22k, False: 10.7k]
  ------------------
  114|       |
  115|  15.9k|    auto label_size = dot_location - start;
  116|  15.9k|    if (label_size > 63 || label_size == 0) return false;
  ------------------
  |  Branch (116:9): [True: 243, False: 15.6k]
  |  Branch (116:28): [True: 727, False: 14.9k]
  ------------------
  117|       |
  118|  14.9k|    start = dot_location + 1;
  119|  14.9k|  }
  120|       |
  121|  5.27k|  return true;
  122|  6.24k|}
_ZN3ada7unicode13is_alnum_plusEc:
 7348|  48.4k|ada_really_inline constexpr bool is_alnum_plus(const char c) noexcept {
 7349|  48.4k|  return is_alnum_plus_table[uint8_t(c)];
 7350|       |  // A table is almost surely much faster than the
 7351|       |  // following under most compilers: return
 7352|       |  // return (std::isalnum(c) || c == '+' || c == '-' || c == '.');
 7353|  48.4k|}
_ZN3ada7unicode14to_lower_asciiEPcm:
 7024|  8.17k|constexpr bool to_lower_ascii(char* input, size_t length) noexcept {
 7025|  8.17k|  uint64_t broadcast_80 = broadcast(0x80);
 7026|  8.17k|  uint64_t broadcast_Ap = broadcast(128 - 'A');
 7027|  8.17k|  uint64_t broadcast_Zp = broadcast(128 - 'Z' - 1);
 7028|  8.17k|  uint64_t non_ascii = 0;
 7029|  8.17k|  size_t i = 0;
 7030|       |
 7031|  24.0k|  for (; i + 7 < length; i += 8) {
  ------------------
  |  Branch (7031:10): [True: 15.9k, False: 8.17k]
  ------------------
 7032|  15.9k|    uint64_t word{};
 7033|  15.9k|    memcpy(&word, input + i, sizeof(word));
 7034|  15.9k|    non_ascii |= (word & broadcast_80);
 7035|  15.9k|    word ^=
 7036|  15.9k|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
 7037|  15.9k|    memcpy(input + i, &word, sizeof(word));
 7038|  15.9k|  }
 7039|  8.17k|  if (i < length) {
  ------------------
  |  Branch (7039:7): [True: 6.31k, False: 1.86k]
  ------------------
 7040|  6.31k|    uint64_t word{};
 7041|  6.31k|    memcpy(&word, input + i, length - i);
 7042|  6.31k|    non_ascii |= (word & broadcast_80);
 7043|  6.31k|    word ^=
 7044|  6.31k|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
 7045|  6.31k|    memcpy(input + i, &word, length - i);
 7046|  6.31k|  }
 7047|  8.17k|  return non_ascii == 0;
 7048|  8.17k|}
_ZN3ada7unicode9broadcastEh:
 7020|  24.5k|constexpr uint64_t broadcast(uint8_t v) noexcept {
 7021|  24.5k|  return 0x101010101010101ull * v;
 7022|  24.5k|}
_ZZN3ada6parser25try_parse_simple_absoluteINS_14url_aggregatorEEEbNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEERT_ENKUlvE_clEv:
12545|    644|    auto apply_query_and_hash = [&]() {
12546|    644|      if (query_start != std::string_view::npos) {
  ------------------
  |  Branch (12546:11): [True: 140, False: 504]
  ------------------
12547|    140|        const size_t q_end =
12548|    140|            (hash_start != std::string_view::npos) ? hash_start : len;
  ------------------
  |  Branch (12548:13): [True: 24, False: 116]
  ------------------
12549|    140|        out.update_base_search(std::string_view(input.data() + query_start + 1,
12550|    140|                                                q_end - query_start - 1),
12551|    140|                               character_sets::SPECIAL_QUERY_PERCENT_ENCODE);
12552|    140|      }
12553|    644|      if (hash_start != std::string_view::npos) {
  ------------------
  |  Branch (12553:11): [True: 70, False: 574]
  ------------------
12554|     70|        out.update_unencoded_base_hash(std::string_view(
12555|     70|            input.data() + hash_start + 1, len - hash_start - 1));
12556|     70|      }
12557|    644|    };
_ZZN3ada6parser32finish_simple_absolute_with_portINS_14url_aggregatorEEEbNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEERT_NS_6scheme4typeEjmmmbENKUlvE_clEv:
12145|    243|    auto apply_query_and_hash = [&]() {
12146|    243|      if (query_start != std::string_view::npos) {
  ------------------
  |  Branch (12146:11): [True: 64, False: 179]
  ------------------
12147|     64|        const size_t q_end =
12148|     64|            (hash_start != std::string_view::npos) ? hash_start : len;
  ------------------
  |  Branch (12148:13): [True: 15, False: 49]
  ------------------
12149|     64|        out.update_base_search(std::string_view(input.data() + query_start + 1,
12150|     64|                                                q_end - query_start - 1),
12151|     64|                               character_sets::SPECIAL_QUERY_PERCENT_ENCODE);
12152|     64|      }
12153|    243|      if (hash_start != std::string_view::npos) {
  ------------------
  |  Branch (12153:11): [True: 51, False: 192]
  ------------------
12154|     51|        out.update_unencoded_base_hash(std::string_view(
12155|     51|            input.data() + hash_start + 1, len - hash_start - 1));
12156|     51|      }
12157|    243|    };
_ZN3ada7helpers10prune_hashERNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8784|  12.1k|    std::string_view& input) noexcept {
 8785|       |  // compiles down to 20--30 instructions including a class to memchr (C
 8786|       |  // function). this function should be quite fast.
 8787|  12.1k|  size_t location_of_first = input.find('#');
 8788|  12.1k|  if (location_of_first == std::string_view::npos) {
  ------------------
  |  Branch (8788:7): [True: 11.9k, False: 175]
  ------------------
 8789|  11.9k|    return std::nullopt;
 8790|  11.9k|  }
 8791|    175|  std::string_view hash = input;
 8792|    175|  hash.remove_prefix(location_of_first + 1);
 8793|    175|  input.remove_suffix(input.size() - location_of_first);
 8794|    175|  return hash;
 8795|  12.1k|}
_ZN3ada7helpers32find_authority_delimiter_specialENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 9747|  2.02k|find_authority_delimiter_special(std::string_view view) noexcept {
 9748|       |  // performance note: we might be able to gain further performance
 9749|       |  // with SIMD intrinsics.
 9750|  7.49k|  for (auto pos = view.begin(); pos != view.end(); ++pos) {
  ------------------
  |  Branch (9750:33): [True: 7.47k, False: 28]
  ------------------
 9751|  7.47k|    if (authority_delimiter_special[(uint8_t)*pos]) {
  ------------------
  |  Branch (9751:9): [True: 2.00k, False: 5.47k]
  ------------------
 9752|  2.00k|      return pos - view.begin();
 9753|  2.00k|    }
 9754|  7.47k|  }
 9755|     28|  return size_t(view.size());
 9756|  2.02k|}
_ZN3ada7helpers12shorten_pathERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_6scheme4typeE:
 8797|    361|ada_really_inline bool shorten_path(std::string& path, ada::scheme::type type) {
 8798|       |  // Let path be url's path.
 8799|       |  // If url's scheme is "file", path's size is 1, and path[0] is a normalized
 8800|       |  // Windows drive letter, then return.
 8801|    361|  if (type == ada::scheme::type::FILE &&
  ------------------
  |  Branch (8801:7): [True: 0, False: 361]
  ------------------
 8802|      0|      path.find('/', 1) == std::string_view::npos && !path.empty()) {
  ------------------
  |  Branch (8802:7): [True: 0, False: 0]
  |  Branch (8802:54): [True: 0, False: 0]
  ------------------
 8803|      0|    if (checkers::is_normalized_windows_drive_letter(
  ------------------
  |  Branch (8803:9): [True: 0, False: 0]
  ------------------
 8804|      0|            helpers::substring(path, 1))) {
 8805|      0|      return false;
 8806|      0|    }
 8807|      0|  }
 8808|       |
 8809|       |  // Remove path's last item, if any.
 8810|    361|  size_t last_delimiter = path.rfind('/');
 8811|    361|  if (last_delimiter != std::string::npos) {
  ------------------
  |  Branch (8811:7): [True: 166, False: 195]
  ------------------
 8812|    166|    path.erase(last_delimiter);
 8813|    166|    return true;
 8814|    166|  }
 8815|       |
 8816|    195|  return false;
 8817|    361|}
_ZN3ada7helpers27get_host_delimiter_locationEbRNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 9460|  12.0k|    const bool is_special, std::string_view& view) noexcept {
 9461|       |  /**
 9462|       |   * The spec at https://url.spec.whatwg.org/#hostname-state expects us to
 9463|       |   * compute a variable called insideBrackets but this variable is only used
 9464|       |   * once, to check whether a ':' character was found outside brackets. Exact
 9465|       |   * text: "Otherwise, if c is U+003A (:) and insideBrackets is false, then:".
 9466|       |   * It is conceptually simpler and arguably more efficient to just return a
 9467|       |   * Boolean indicating whether ':' was found outside brackets.
 9468|       |   */
 9469|  12.0k|  const size_t view_size = view.size();
 9470|  12.0k|  size_t location = 0;
 9471|  12.0k|  bool found_colon = false;
 9472|       |  /**
 9473|       |   * Performance analysis:
 9474|       |   *
 9475|       |   * We are basically seeking the end of the hostname which can be indicated
 9476|       |   * by the end of the view, or by one of the characters ':', '/', '?', '\\'
 9477|       |   * (where '\\' is only applicable for special URLs). However, these must
 9478|       |   * appear outside a bracket range. E.g., if you have [something?]fd: then the
 9479|       |   * '?' does not count.
 9480|       |   *
 9481|       |   * So we can skip ahead to the next delimiter, as long as we include '[' in
 9482|       |   * the set of delimiters, and that we handle it first.
 9483|       |   *
 9484|       |   * So the trick is to have a fast function that locates the next delimiter.
 9485|       |   * Unless we find '[', then it only needs to be called once! Ideally, such a
 9486|       |   * function would be provided by the C++ standard library, but it seems that
 9487|       |   * find_first_of is not very fast, so we are forced to roll our own.
 9488|       |   *
 9489|       |   * We do not break into two loops for speed, but for clarity.
 9490|       |   */
 9491|  12.0k|  if (is_special) {
  ------------------
  |  Branch (9491:7): [True: 12.0k, False: 0]
  ------------------
 9492|       |    // We move to the next delimiter.
 9493|  12.0k|    location = find_next_host_delimiter_special(view, location);
 9494|       |    // Unless we find '[' then we are going only going to have to call
 9495|       |    // find_next_host_delimiter_special once.
 9496|  19.5k|    for (; location < view_size;
  ------------------
  |  Branch (9496:12): [True: 19.4k, False: 92]
  ------------------
 9497|  19.4k|         location = find_next_host_delimiter_special(view, location)) {
 9498|  19.4k|      if (view[location] == '[') {
  ------------------
  |  Branch (9498:11): [True: 7.58k, False: 11.8k]
  ------------------
 9499|  7.58k|        location = view.find(']', location);
 9500|  7.58k|        if (location == std::string_view::npos) {
  ------------------
  |  Branch (9500:13): [True: 139, False: 7.44k]
  ------------------
 9501|       |          // performance: view.find might get translated to a memchr, which
 9502|       |          // has no notion of std::string_view::npos, so the code does not
 9503|       |          // reflect the assembly.
 9504|    139|          location = view_size;
 9505|    139|          break;
 9506|    139|        }
 9507|  11.8k|      } else {
 9508|  11.8k|        found_colon = view[location] == ':';
 9509|  11.8k|        break;
 9510|  11.8k|      }
 9511|  19.4k|    }
 9512|  12.0k|  } else {
 9513|       |    // We move to the next delimiter.
 9514|      0|    location = find_next_host_delimiter(view, location);
 9515|       |    // Unless we find '[' then we are going only going to have to call
 9516|       |    // find_next_host_delimiter_special once.
 9517|      0|    for (; location < view_size;
  ------------------
  |  Branch (9517:12): [True: 0, False: 0]
  ------------------
 9518|      0|         location = find_next_host_delimiter(view, location)) {
 9519|      0|      if (view[location] == '[') {
  ------------------
  |  Branch (9519:11): [True: 0, False: 0]
  ------------------
 9520|      0|        location = view.find(']', location);
 9521|      0|        if (location == std::string_view::npos) {
  ------------------
  |  Branch (9521:13): [True: 0, False: 0]
  ------------------
 9522|       |          // performance: view.find might get translated to a memchr, which
 9523|       |          // has no notion of std::string_view::npos, so the code does not
 9524|       |          // reflect the assembly.
 9525|      0|          location = view_size;
 9526|      0|          break;
 9527|      0|        }
 9528|      0|      } else {
 9529|      0|        found_colon = view[location] == ':';
 9530|      0|        break;
 9531|      0|      }
 9532|      0|    }
 9533|      0|  }
 9534|       |  // performance: remove_suffix may translate into a single instruction.
 9535|  12.0k|  view.remove_suffix(view_size - location);
 9536|  12.0k|  return {location, found_colon};
 9537|  12.0k|}
_ZN3ada7helpers32find_next_host_delimiter_specialENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEm:
 9050|  19.5k|    std::string_view view, size_t location) noexcept {
 9051|       |  // first check for short strings in which case we do it naively.
 9052|  19.5k|  if (view.size() - location < 16) {  // slow path
  ------------------
  |  Branch (9052:7): [True: 10.6k, False: 8.88k]
  ------------------
 9053|  42.2k|    for (size_t i = location; i < view.size(); i++) {
  ------------------
  |  Branch (9053:31): [True: 42.2k, False: 72]
  ------------------
 9054|  42.2k|      if (view[i] == ':' || view[i] == '/' || view[i] == '\\' ||
  ------------------
  |  Branch (9054:11): [True: 559, False: 41.6k]
  |  Branch (9054:29): [True: 9.49k, False: 32.1k]
  |  Branch (9054:47): [True: 2, False: 32.1k]
  ------------------
 9055|  32.1k|          view[i] == '?' || view[i] == '[') {
  ------------------
  |  Branch (9055:11): [True: 66, False: 32.0k]
  |  Branch (9055:29): [True: 471, False: 31.6k]
  ------------------
 9056|  10.5k|        return i;
 9057|  10.5k|      }
 9058|  42.2k|    }
 9059|     72|    return size_t(view.size());
 9060|  10.6k|  }
 9061|       |  // fast path for long strings (expected to be common)
 9062|  8.88k|  size_t i = location;
 9063|  8.88k|  const __m128i mask1 = _mm_set1_epi8(':');
 9064|  8.88k|  const __m128i mask2 = _mm_set1_epi8('/');
 9065|  8.88k|  const __m128i mask3 = _mm_set1_epi8('\\');
 9066|  8.88k|  const __m128i mask4 = _mm_set1_epi8('?');
 9067|  8.88k|  const __m128i mask5 = _mm_set1_epi8('[');
 9068|       |
 9069|  11.7k|  for (; i + 15 < view.size(); i += 16) {
  ------------------
  |  Branch (9069:10): [True: 10.5k, False: 1.14k]
  ------------------
 9070|  10.5k|    __m128i word = _mm_loadu_si128((const __m128i*)(view.data() + i));
 9071|  10.5k|    __m128i m1 = _mm_cmpeq_epi8(word, mask1);
 9072|  10.5k|    __m128i m2 = _mm_cmpeq_epi8(word, mask2);
 9073|  10.5k|    __m128i m3 = _mm_cmpeq_epi8(word, mask3);
 9074|  10.5k|    __m128i m4 = _mm_cmpeq_epi8(word, mask4);
 9075|  10.5k|    __m128i m5 = _mm_cmpeq_epi8(word, mask5);
 9076|  10.5k|    __m128i m = _mm_or_si128(
 9077|  10.5k|        _mm_or_si128(_mm_or_si128(m1, m2), _mm_or_si128(m3, m4)), m5);
 9078|  10.5k|    int mask = _mm_movemask_epi8(m);
 9079|  10.5k|    if (mask != 0) {
  ------------------
  |  Branch (9079:9): [True: 7.73k, False: 2.82k]
  ------------------
 9080|  7.73k|      return i + trailing_zeroes(mask);
 9081|  7.73k|    }
 9082|  10.5k|  }
 9083|  1.14k|  if (i < view.size()) {
  ------------------
  |  Branch (9083:7): [True: 1.14k, False: 5]
  ------------------
 9084|  1.14k|    __m128i word =
 9085|  1.14k|        _mm_loadu_si128((const __m128i*)(view.data() + view.length() - 16));
 9086|  1.14k|    __m128i m1 = _mm_cmpeq_epi8(word, mask1);
 9087|  1.14k|    __m128i m2 = _mm_cmpeq_epi8(word, mask2);
 9088|  1.14k|    __m128i m3 = _mm_cmpeq_epi8(word, mask3);
 9089|  1.14k|    __m128i m4 = _mm_cmpeq_epi8(word, mask4);
 9090|  1.14k|    __m128i m5 = _mm_cmpeq_epi8(word, mask5);
 9091|  1.14k|    __m128i m = _mm_or_si128(
 9092|  1.14k|        _mm_or_si128(_mm_or_si128(m1, m2), _mm_or_si128(m3, m4)), m5);
 9093|  1.14k|    int mask = _mm_movemask_epi8(m);
 9094|  1.14k|    if (mask != 0) {
  ------------------
  |  Branch (9094:9): [True: 1.12k, False: 15]
  ------------------
 9095|  1.12k|      return view.length() - 16 + trailing_zeroes(mask);
 9096|  1.12k|    }
 9097|  1.14k|  }
 9098|     20|  return size_t(view.length());
 9099|  1.14k|}
_ZN3ada7helpers15trailing_zeroesEj:
 8870|  8.86k|ada_really_inline int trailing_zeroes(uint32_t input_num) noexcept {
 8871|       |#ifdef ADA_REGULAR_VISUAL_STUDIO
 8872|       |  unsigned long ret;
 8873|       |  // Search the mask data from least significant bit (LSB)
 8874|       |  // to the most significant bit (MSB) for a set bit (1).
 8875|       |  _BitScanForward(&ret, input_num);
 8876|       |  return (int)ret;
 8877|       |#else   // ADA_REGULAR_VISUAL_STUDIO
 8878|  8.86k|  return __builtin_ctzl(input_num);
 8879|  8.86k|#endif  // ADA_REGULAR_VISUAL_STUDIO
 8880|  8.86k|}
_ZN3ada7unicode30is_forbidden_domain_code_pointEc:
 7277|  57.1k|    const char c) noexcept {
 7278|  57.1k|  return is_forbidden_domain_code_point_table[uint8_t(c)];
 7279|  57.1k|}
_ZZN3ada6parser14parse_url_implINS_14url_aggregatorELb1EEET_NSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPKS3_ENKUlvE_clEv:
12868|  1.20k|  const auto enforce_max_input_length = [&]() {
12869|  1.20k|    if constexpr (store_values) {
12870|  1.20k|      if (url.is_valid) {
  ------------------
  |  Branch (12870:11): [True: 1.20k, False: 0]
  ------------------
12871|  1.20k|        if constexpr (result_type_is_ada_url_aggregator) {
12872|  1.20k|          if (url.buffer.size() > max_input_length) [[unlikely]] {
  ------------------
  |  Branch (12872:15): [True: 0, False: 1.20k]
  ------------------
12873|      0|            url.is_valid = false;
12874|      0|          }
12875|       |        } else {
12876|       |          if (url.get_href_size() > max_input_length) [[unlikely]] {
12877|       |            url.is_valid = false;
12878|       |          }
12879|       |        }
12880|  1.20k|      }
12881|  1.20k|    }
12882|  1.20k|  };
serializers.cc:_ZN3ada6parser12_GLOBAL__N_124port_decimal_digit_countEj:
11184|    127|ada_really_inline uint32_t port_decimal_digit_count(uint32_t port) noexcept {
11185|    127|  uint32_t digits = 1;
11186|    396|  while (port >= 10) {
  ------------------
  |  Branch (11186:10): [True: 269, False: 127]
  ------------------
11187|    269|    port /= 10;
11188|    269|    ++digits;
11189|    269|  }
11190|    127|  return digits;
11191|    127|}
serializers.cc:_ZN3ada6parser12_GLOBAL__N_121append_canonical_portERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEj:
11194|    118|                                             uint32_t port) {
11195|    118|  buffer += ':';
11196|    118|  char port_buf[5];
11197|    118|  auto [ptr, ec] = std::to_chars(port_buf, port_buf + 5, port);
11198|    118|  (void)ec;
11199|    118|  buffer.append(port_buf, static_cast<size_t>(ptr - port_buf));
11200|    118|}
serializers.cc:_ZN3ada6parser12_GLOBAL__N_116authority_has_atEPKhmm:
11342|  13.4k|                                        size_t n) noexcept {
11343|  13.4k|  const size_t rem = n - host_start;
11344|  13.4k|  if (rem == 0) {
  ------------------
  |  Branch (11344:7): [True: 0, False: 13.4k]
  ------------------
11345|      0|    return false;
11346|      0|  }
11347|       |#if ADA_NEON
11348|       |  if (rem >= 16) {
11349|       |    const uint8x16_t w = vld1q_u8(p + host_start);
11350|       |    const uint64_t at = neon_nibble_bits(vceqq_u8(w, vdupq_n_u8('@')));
11351|       |    if (at == 0) {
11352|       |      return false;
11353|       |    }
11354|       |    const uint64_t delim = neon_nibble_bits(vceqq_u8(w, vdupq_n_u8('/'))) |
11355|       |                           neon_nibble_bits(vceqq_u8(w, vdupq_n_u8('?'))) |
11356|       |                           neon_nibble_bits(vceqq_u8(w, vdupq_n_u8('#')));
11357|       |    return delim == 0 || std::countr_zero(at) < std::countr_zero(delim);
11358|       |  }
11359|       |#elif ADA_SSE2
11360|  13.4k|  if (rem >= 16) {
  ------------------
  |  Branch (11360:7): [True: 9.71k, False: 3.70k]
  ------------------
11361|  9.71k|    const __m128i w =
11362|  9.71k|        _mm_loadu_si128(reinterpret_cast<const __m128i*>(p + host_start));
11363|  9.71k|    const uint16_t at = static_cast<uint16_t>(
11364|  9.71k|        _mm_movemask_epi8(_mm_cmpeq_epi8(w, _mm_set1_epi8('@'))));
11365|  9.71k|    if (at == 0) {
  ------------------
  |  Branch (11365:9): [True: 9.59k, False: 120]
  ------------------
11366|  9.59k|      return false;
11367|  9.59k|    }
11368|    120|    const uint16_t delim = static_cast<uint16_t>(
11369|    120|        _mm_movemask_epi8(_mm_cmpeq_epi8(w, _mm_set1_epi8('/'))) |
11370|    120|        _mm_movemask_epi8(_mm_cmpeq_epi8(w, _mm_set1_epi8('?'))) |
11371|    120|        _mm_movemask_epi8(_mm_cmpeq_epi8(w, _mm_set1_epi8('#'))));
11372|    120|    return delim == 0 || std::countr_zero(at) < std::countr_zero(delim);
  ------------------
  |  Branch (11372:12): [True: 79, False: 41]
  |  Branch (11372:26): [True: 16, False: 25]
  ------------------
11373|  9.71k|  }
11374|  3.70k|#endif
11375|  3.70k|  const size_t lim = host_start + rem;
11376|  25.9k|  for (size_t i = host_start; i < lim; ++i) {
  ------------------
  |  Branch (11376:31): [True: 25.9k, False: 0]
  ------------------
11377|  25.9k|    const uint8_t c = p[i];
11378|  25.9k|    if (c == '@') {
  ------------------
  |  Branch (11378:9): [True: 93, False: 25.8k]
  ------------------
11379|     93|      return true;
11380|     93|    }
11381|  25.8k|    if (c == '/' || c == '?' || c == '#') {
  ------------------
  |  Branch (11381:9): [True: 3.31k, False: 22.5k]
  |  Branch (11381:21): [True: 155, False: 22.3k]
  |  Branch (11381:33): [True: 139, False: 22.2k]
  ------------------
11382|  3.61k|      return false;
11383|  3.61k|    }
11384|  25.8k|  }
11385|      0|  return false;
11386|  3.70k|}
serializers.cc:_ZN3ada6parser12_GLOBAL__N_115scan_plain_hostEPKhmmRmRbS5_:
11407|  4.71k|                                     bool& has_x) noexcept {
11408|  4.71k|  has_upper = false;
11409|  4.71k|  has_x = false;
11410|  4.71k|  size_t i = start;
11411|  4.71k|#if ADA_PARSER_SSSE3
11412|  4.71k|  if (parser_use_ssse3() && (len - start >= 16)) {
  ------------------
  |  Branch (11412:7): [True: 4.71k, False: 0]
  |  Branch (11412:29): [True: 2.17k, False: 2.53k]
  ------------------
11413|  2.17k|    const __m128i lo_tbl = nibble_load(k_host_nibbles.low);
11414|  2.17k|    const __m128i hi_tbl = nibble_load(k_host_nibbles.high);
11415|  2.17k|    const __m128i x_splat = _mm_set1_epi8('x');
11416|  2.17k|    auto visit = [&](size_t at) noexcept -> bool {
11417|  2.17k|      const __m128i w =
11418|  2.17k|          _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + at));
11419|  2.17k|      const int up = sse2_uppercase(w);
11420|  2.17k|      const int xs = _mm_movemask_epi8(_mm_cmpeq_epi8(w, x_splat));
11421|  2.17k|      const int mask = ssse3_nibble_mask(w, lo_tbl, hi_tbl);
11422|  2.17k|      if (mask == 0) {
11423|  2.17k|        if (up != 0) {
11424|  2.17k|          has_upper = true;
11425|  2.17k|        }
11426|  2.17k|        if (xs != 0) {
11427|  2.17k|          has_x = true;
11428|  2.17k|        }
11429|  2.17k|        return false;
11430|  2.17k|      }
11431|  2.17k|      const int hit = trailing_zeroes32(static_cast<uint32_t>(mask));
11432|  2.17k|      const int valid = (1 << hit) - 1;
11433|  2.17k|      if ((up & valid) != 0) {
11434|  2.17k|        has_upper = true;
11435|  2.17k|      }
11436|  2.17k|      if ((xs & valid) != 0) {
11437|  2.17k|        has_x = true;
11438|  2.17k|      }
11439|  2.17k|      end = at + static_cast<size_t>(hit);
11440|  2.17k|      return true;
11441|  2.17k|    };
11442|  2.48k|    for (; i + 32 <= len; i += 32) {
  ------------------
  |  Branch (11442:12): [True: 1.33k, False: 1.14k]
  ------------------
11443|  1.33k|      if (visit(i) || visit(i + 16)) {
  ------------------
  |  Branch (11443:11): [True: 919, False: 416]
  |  Branch (11443:23): [True: 110, False: 306]
  ------------------
11444|  1.02k|        return k_host_class[b[end]] == 1;
11445|  1.02k|      }
11446|  1.33k|    }
11447|  1.34k|    for (; i + 16 <= len; i += 16) {
  ------------------
  |  Branch (11447:12): [True: 1.04k, False: 304]
  ------------------
11448|  1.04k|      if (visit(i)) {
  ------------------
  |  Branch (11448:11): [True: 845, False: 198]
  ------------------
11449|    845|        return k_host_class[b[end]] == 1;
11450|    845|      }
11451|  1.04k|    }
11452|       |    // Overlapping tail only after a full 16-byte step so the window cannot
11453|       |    // start before `start` (a prior '/' would otherwise look like a host stop).
11454|    304|    if (i > start && i < len) {
  ------------------
  |  Branch (11454:9): [True: 304, False: 0]
  |  Branch (11454:22): [True: 304, False: 0]
  ------------------
11455|    304|      if (visit(len - 16) && end >= i) {
  ------------------
  |  Branch (11455:11): [True: 304, False: 0]
  |  Branch (11455:30): [True: 304, False: 0]
  ------------------
11456|    304|        return k_host_class[b[end]] == 1;
11457|    304|      }
11458|      0|      end = len;
11459|      0|      return true;
11460|    304|    }
11461|    304|  }
11462|       |#elif ADA_SSE2
11463|       |  const __m128i x_splat = _mm_set1_epi8('x');
11464|       |  for (; i + 32 <= len; i += 32) {
11465|       |    for (size_t off = 0; off < 32; off += 16) {
11466|       |      const __m128i w =
11467|       |          _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + i + off));
11468|       |      const int up = sse2_uppercase(w);
11469|       |      const int xs = _mm_movemask_epi8(_mm_cmpeq_epi8(w, x_splat));
11470|       |      const int mask = sse2_host_stop(w);
11471|       |      if (mask != 0) {
11472|       |        const int hit = trailing_zeroes32(static_cast<uint32_t>(mask));
11473|       |        const int valid = (1 << hit) - 1;
11474|       |        if ((up & valid) != 0) {
11475|       |          has_upper = true;
11476|       |        }
11477|       |        if ((xs & valid) != 0) {
11478|       |          has_x = true;
11479|       |        }
11480|       |        end = i + off + static_cast<size_t>(hit);
11481|       |        return k_host_class[b[end]] == 1;
11482|       |      }
11483|       |      if (up != 0) {
11484|       |        has_upper = true;
11485|       |      }
11486|       |      if (xs != 0) {
11487|       |        has_x = true;
11488|       |      }
11489|       |    }
11490|       |  }
11491|       |  for (; i + 16 <= len; i += 16) {
11492|       |    const __m128i w = _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + i));
11493|       |    const int up = sse2_uppercase(w);
11494|       |    const int xs = _mm_movemask_epi8(_mm_cmpeq_epi8(w, x_splat));
11495|       |    const int mask = sse2_host_stop(w);
11496|       |    if (mask != 0) {
11497|       |      const int hit = trailing_zeroes32(static_cast<uint32_t>(mask));
11498|       |      const int valid = (1 << hit) - 1;
11499|       |      if ((up & valid) != 0) {
11500|       |        has_upper = true;
11501|       |      }
11502|       |      if ((xs & valid) != 0) {
11503|       |        has_x = true;
11504|       |      }
11505|       |      end = i + static_cast<size_t>(hit);
11506|       |      return k_host_class[b[end]] == 1;
11507|       |    }
11508|       |    if (up != 0) {
11509|       |      has_upper = true;
11510|       |    }
11511|       |    if (xs != 0) {
11512|       |      has_x = true;
11513|       |    }
11514|       |  }
11515|       |#elif ADA_NEON
11516|       |  if (len - start >= 16) {
11517|       |    const uint8x16_t lo_tbl = vld1q_u8(k_host_nibbles.low);
11518|       |    const uint8x16_t hi_tbl = vld1q_u8(k_host_nibbles.high);
11519|       |    const uint8x16_t x_splat = vdupq_n_u8('x');
11520|       |    auto visit = [&](size_t at) noexcept -> bool {
11521|       |      const uint8x16_t w = vld1q_u8(b + at);
11522|       |      const uint64_t up = neon_uppercase(w);
11523|       |      const uint64_t xs = neon_nibble_bits(vceqq_u8(w, x_splat));
11524|       |      const uint64_t bits = neon_table_stop(w, lo_tbl, hi_tbl);
11525|       |      if (bits == 0) {
11526|       |        if (up != 0) {
11527|       |          has_upper = true;
11528|       |        }
11529|       |        if (xs != 0) {
11530|       |          has_x = true;
11531|       |        }
11532|       |        return false;
11533|       |      }
11534|       |      const size_t hit = static_cast<size_t>(trailing_zeroes64(bits)) >> 2;
11535|       |      const uint64_t valid = (hit == 0) ? 0 : (uint64_t{1} << (hit * 4)) - 1;
11536|       |      if ((up & valid) != 0) {
11537|       |        has_upper = true;
11538|       |      }
11539|       |      if ((xs & valid) != 0) {
11540|       |        has_x = true;
11541|       |      }
11542|       |      end = at + hit;
11543|       |      return true;
11544|       |    };
11545|       |    for (; i + 32 <= len; i += 32) {
11546|       |      if (visit(i) || visit(i + 16)) {
11547|       |        return k_host_class[b[end]] == 1;
11548|       |      }
11549|       |    }
11550|       |    for (; i + 16 <= len; i += 16) {
11551|       |      if (visit(i)) {
11552|       |        return k_host_class[b[end]] == 1;
11553|       |      }
11554|       |    }
11555|       |    if (i > start && i < len) {
11556|       |      if (visit(len - 16) && end >= i) {
11557|       |        return k_host_class[b[end]] == 1;
11558|       |      }
11559|       |      end = len;
11560|       |      return true;
11561|       |    }
11562|       |  }
11563|       |#endif
11564|  5.78k|  for (; i < len; ++i) {
  ------------------
  |  Branch (11564:10): [True: 5.78k, False: 0]
  ------------------
11565|  5.78k|    const uint8_t c = b[i];
11566|  5.78k|    const uint8_t cls = k_host_class[c];
11567|  5.78k|    if (cls == 1) {
  ------------------
  |  Branch (11567:9): [True: 889, False: 4.89k]
  ------------------
11568|    889|      end = i;
11569|    889|      return true;
11570|    889|    }
11571|  4.89k|    if (cls == 2) {
  ------------------
  |  Branch (11571:9): [True: 1.65k, False: 3.24k]
  ------------------
11572|  1.65k|      return false;
11573|  1.65k|    }
11574|  3.24k|    if (c >= 'A' && c <= 'Z') {
  ------------------
  |  Branch (11574:9): [True: 1.94k, False: 1.30k]
  |  Branch (11574:21): [True: 444, False: 1.49k]
  ------------------
11575|    444|      has_upper = true;
11576|  2.80k|    } else if (c == 'x') {
  ------------------
  |  Branch (11576:16): [True: 511, False: 2.29k]
  ------------------
11577|    511|      has_x = true;
11578|    511|    }
11579|  3.24k|  }
11580|      0|  end = len;
11581|      0|  return true;
11582|  2.53k|}
serializers.cc:_ZN3ada6parser12_GLOBAL__N_116parser_use_ssse3Ev:
11392|  6.28k|ada_really_inline bool parser_use_ssse3() noexcept {
11393|  6.28k|#ifdef ADA_PARSER_NEED_SSSE3_TARGET
11394|  6.28k|  static const bool supported = __builtin_cpu_supports("ssse3") != 0;
11395|  6.28k|  return supported;
11396|       |#else
11397|       |  return true;
11398|       |#endif
11399|  6.28k|}
serializers.cc:_ZN3ada6parser12_GLOBAL__N_111nibble_loadEPKh:
11223|  5.96k|ADA_PARSER_SIMD __m128i nibble_load(const uint8_t* t) noexcept {
11224|  5.96k|  return _mm_load_si128(reinterpret_cast<const __m128i*>(t));
11225|  5.96k|}
serializers.cc:_ZZN3ada6parser12_GLOBAL__N_115scan_plain_hostEPKhmmRmRbS5_ENKUlmE_clEm:
11416|  3.09k|    auto visit = [&](size_t at) noexcept -> bool {
11417|  3.09k|      const __m128i w =
11418|  3.09k|          _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + at));
11419|  3.09k|      const int up = sse2_uppercase(w);
11420|  3.09k|      const int xs = _mm_movemask_epi8(_mm_cmpeq_epi8(w, x_splat));
11421|  3.09k|      const int mask = ssse3_nibble_mask(w, lo_tbl, hi_tbl);
11422|  3.09k|      if (mask == 0) {
  ------------------
  |  Branch (11422:11): [True: 920, False: 2.17k]
  ------------------
11423|    920|        if (up != 0) {
  ------------------
  |  Branch (11423:13): [True: 536, False: 384]
  ------------------
11424|    536|          has_upper = true;
11425|    536|        }
11426|    920|        if (xs != 0) {
  ------------------
  |  Branch (11426:13): [True: 496, False: 424]
  ------------------
11427|    496|          has_x = true;
11428|    496|        }
11429|    920|        return false;
11430|    920|      }
11431|  2.17k|      const int hit = trailing_zeroes32(static_cast<uint32_t>(mask));
11432|  2.17k|      const int valid = (1 << hit) - 1;
11433|  2.17k|      if ((up & valid) != 0) {
  ------------------
  |  Branch (11433:11): [True: 491, False: 1.68k]
  ------------------
11434|    491|        has_upper = true;
11435|    491|      }
11436|  2.17k|      if ((xs & valid) != 0) {
  ------------------
  |  Branch (11436:11): [True: 508, False: 1.67k]
  ------------------
11437|    508|        has_x = true;
11438|    508|      }
11439|  2.17k|      end = at + static_cast<size_t>(hit);
11440|  2.17k|      return true;
11441|  3.09k|    };
serializers.cc:_ZN3ada6parser12_GLOBAL__N_114sse2_uppercaseEDv2_x:
11310|  3.09k|ada_really_inline int sse2_uppercase(__m128i w) noexcept {
11311|  3.09k|  return _mm_movemask_epi8(_mm_and_si128(
11312|  3.09k|      _mm_cmpgt_epi8(w, _mm_set1_epi8(static_cast<char>('A' - 1))),
11313|  3.09k|      _mm_cmplt_epi8(w, _mm_set1_epi8(static_cast<char>('Z' + 1)))));
11314|  3.09k|}
serializers.cc:_ZN3ada6parser12_GLOBAL__N_117ssse3_nibble_maskEDv2_xS2_S2_:
11230|  4.78k|                                          __m128i hi_tbl) noexcept {
11231|  4.78k|  const __m128i nibble = _mm_set1_epi8(0x0F);
11232|  4.78k|  const __m128i lo = _mm_and_si128(w, nibble);
11233|  4.78k|  const __m128i hi = _mm_and_si128(_mm_srli_epi16(w, 4), nibble);
11234|  4.78k|  const __m128i hit =
11235|  4.78k|      _mm_and_si128(_mm_shuffle_epi8(lo_tbl, lo), _mm_shuffle_epi8(hi_tbl, hi));
11236|  4.78k|  return _mm_movemask_epi8(_mm_cmpeq_epi8(hit, _mm_setzero_si128())) ^ 0xFFFF;
11237|  4.78k|}
serializers.cc:_ZN3ada6parser12_GLOBAL__N_117trailing_zeroes32Ej:
11202|  2.75k|ada_really_inline int trailing_zeroes32(uint32_t input_num) noexcept {
11203|       |#ifdef ADA_REGULAR_VISUAL_STUDIO
11204|       |  unsigned long ret;
11205|       |  _BitScanForward(&ret, input_num);
11206|       |  return static_cast<int>(ret);
11207|       |#else
11208|  2.75k|  return __builtin_ctz(input_num);
11209|  2.75k|#endif
11210|  2.75k|}
serializers.cc:_ZN3ada6parser12_GLOBAL__N_113scan_path_runEPKhRmmRb:
11642|  1.06k|                                   bool& maybe_dot_segment) noexcept {
11643|  1.06k|  const size_t run_start = i;
11644|  1.06k|#if ADA_PARSER_SSSE3
11645|  1.06k|  if (parser_use_ssse3() && (i + 16 <= len)) {
  ------------------
  |  Branch (11645:7): [True: 1.06k, False: 0]
  |  Branch (11645:29): [True: 612, False: 453]
  ------------------
11646|    612|    const __m128i lo_tbl = nibble_load(k_path_nibbles.low);
11647|    612|    const __m128i hi_tbl = nibble_load(k_path_nibbles.high);
11648|    879|    for (; i + 32 <= len; i += 32) {
  ------------------
  |  Branch (11648:12): [True: 488, False: 391]
  ------------------
11649|    488|      const __m128i w0 =
11650|    488|          _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + i));
11651|    488|      const int m0 = ssse3_nibble_mask(w0, lo_tbl, hi_tbl);
11652|    488|      if (m0 != 0) {
  ------------------
  |  Branch (11652:11): [True: 149, False: 339]
  ------------------
11653|    149|        const int hit_bit = trailing_zeroes32(static_cast<uint32_t>(m0));
11654|    149|        note_dots_in_window(b, i, run_start, w0, (1 << hit_bit) - 1,
11655|    149|                            maybe_dot_segment);
11656|    149|        i += static_cast<size_t>(hit_bit);
11657|    149|        return;
11658|    149|      }
11659|    339|      note_dots_in_window(b, i, run_start, w0, 0xFFFF, maybe_dot_segment);
11660|    339|      const __m128i w1 =
11661|    339|          _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + i + 16));
11662|    339|      const int m1 = ssse3_nibble_mask(w1, lo_tbl, hi_tbl);
11663|    339|      if (m1 != 0) {
  ------------------
  |  Branch (11663:11): [True: 72, False: 267]
  ------------------
11664|     72|        const int hit_bit = trailing_zeroes32(static_cast<uint32_t>(m1));
11665|     72|        note_dots_in_window(b, i + 16, run_start, w1, (1 << hit_bit) - 1,
11666|     72|                            maybe_dot_segment);
11667|     72|        i += 16 + static_cast<size_t>(hit_bit);
11668|     72|        return;
11669|     72|      }
11670|    267|      note_dots_in_window(b, i + 16, run_start, w1, 0xFFFF, maybe_dot_segment);
11671|    267|    }
11672|    561|    for (; i + 16 <= len; i += 16) {
  ------------------
  |  Branch (11672:12): [True: 298, False: 263]
  ------------------
11673|    298|      const __m128i w =
11674|    298|          _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + i));
11675|    298|      const int mask = ssse3_nibble_mask(w, lo_tbl, hi_tbl);
11676|    298|      if (mask != 0) {
  ------------------
  |  Branch (11676:11): [True: 128, False: 170]
  ------------------
11677|    128|        const int hit_bit = trailing_zeroes32(static_cast<uint32_t>(mask));
11678|    128|        note_dots_in_window(b, i, run_start, w, (1 << hit_bit) - 1,
11679|    128|                            maybe_dot_segment);
11680|    128|        i += static_cast<size_t>(hit_bit);
11681|    128|        return;
11682|    128|      }
11683|    170|      note_dots_in_window(b, i, run_start, w, 0xFFFF, maybe_dot_segment);
11684|    170|    }
11685|    263|    if (i > run_start && i < len) {
  ------------------
  |  Branch (11685:9): [True: 263, False: 0]
  |  Branch (11685:26): [True: 189, False: 74]
  ------------------
11686|    189|      const __m128i w =
11687|    189|          _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + len - 16));
11688|    189|      const int mask = ssse3_nibble_mask(w, lo_tbl, hi_tbl);
11689|    189|      if (mask != 0) {
  ------------------
  |  Branch (11689:11): [True: 89, False: 100]
  ------------------
11690|     89|        const size_t hit =
11691|     89|            len - 16 +
11692|     89|            static_cast<size_t>(trailing_zeroes32(static_cast<uint32_t>(mask)));
11693|     89|        if (hit >= i) {
  ------------------
  |  Branch (11693:13): [True: 89, False: 0]
  ------------------
11694|    403|          for (size_t j = i; j < hit; ++j) {
  ------------------
  |  Branch (11694:30): [True: 314, False: 89]
  ------------------
11695|    314|            if (b[j] == '.') {
  ------------------
  |  Branch (11695:17): [True: 126, False: 188]
  ------------------
11696|    126|              note_possible_dot_segment(b, j, run_start, maybe_dot_segment);
11697|    126|            }
11698|    314|          }
11699|     89|          i = hit;
11700|     89|          return;
11701|     89|        }
11702|     89|      }
11703|    556|      for (size_t j = i; j < len; ++j) {
  ------------------
  |  Branch (11703:26): [True: 456, False: 100]
  ------------------
11704|    456|        if (b[j] == '.') {
  ------------------
  |  Branch (11704:13): [True: 157, False: 299]
  ------------------
11705|    157|          note_possible_dot_segment(b, j, run_start, maybe_dot_segment);
11706|    157|        }
11707|    456|      }
11708|    100|      i = len;
11709|    100|      return;
11710|    189|    }
11711|    263|  }
11712|       |#elif ADA_SSE2
11713|       |  for (; i + 16 <= len; i += 16) {
11714|       |    const __m128i w = _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + i));
11715|       |    const int mask = sse2_path_stop(w);
11716|       |    if (mask != 0) {
11717|       |      const int hit_bit = trailing_zeroes32(static_cast<uint32_t>(mask));
11718|       |      note_dots_in_window(b, i, run_start, w, (1 << hit_bit) - 1,
11719|       |                          maybe_dot_segment);
11720|       |      i += static_cast<size_t>(hit_bit);
11721|       |      return;
11722|       |    }
11723|       |    note_dots_in_window(b, i, run_start, w, 0xFFFF, maybe_dot_segment);
11724|       |  }
11725|       |#elif ADA_NEON
11726|       |  if (i + 16 <= len) {
11727|       |    const uint8x16_t lo_tbl = vld1q_u8(k_path_nibbles.low);
11728|       |    const uint8x16_t hi_tbl = vld1q_u8(k_path_nibbles.high);
11729|       |    for (; i + 32 <= len; i += 32) {
11730|       |      const uint8x16_t w0 = vld1q_u8(b + i);
11731|       |      const uint64_t bits0 = neon_table_stop(w0, lo_tbl, hi_tbl);
11732|       |      if (bits0 != 0) {
11733|       |        const size_t hit_off =
11734|       |            static_cast<size_t>(trailing_zeroes64(bits0)) >> 2;
11735|       |        const uint64_t valid =
11736|       |            (hit_off == 0) ? 0 : (uint64_t{1} << (hit_off * 4)) - 1;
11737|       |        note_dots_in_window_neon(b, i, run_start, w0, valid, maybe_dot_segment);
11738|       |        i += hit_off;
11739|       |        return;
11740|       |      }
11741|       |      note_dots_in_window_neon(b, i, run_start, w0, ~uint64_t{0},
11742|       |                               maybe_dot_segment);
11743|       |      const uint8x16_t w1 = vld1q_u8(b + i + 16);
11744|       |      const uint64_t bits1 = neon_table_stop(w1, lo_tbl, hi_tbl);
11745|       |      if (bits1 != 0) {
11746|       |        const size_t hit_off =
11747|       |            static_cast<size_t>(trailing_zeroes64(bits1)) >> 2;
11748|       |        const uint64_t valid =
11749|       |            (hit_off == 0) ? 0 : (uint64_t{1} << (hit_off * 4)) - 1;
11750|       |        note_dots_in_window_neon(b, i + 16, run_start, w1, valid,
11751|       |                                 maybe_dot_segment);
11752|       |        i += 16 + hit_off;
11753|       |        return;
11754|       |      }
11755|       |      note_dots_in_window_neon(b, i + 16, run_start, w1, ~uint64_t{0},
11756|       |                               maybe_dot_segment);
11757|       |    }
11758|       |    for (; i + 16 <= len; i += 16) {
11759|       |      const uint8x16_t w = vld1q_u8(b + i);
11760|       |      const uint64_t bits = neon_table_stop(w, lo_tbl, hi_tbl);
11761|       |      if (bits != 0) {
11762|       |        const size_t hit_off =
11763|       |            static_cast<size_t>(trailing_zeroes64(bits)) >> 2;
11764|       |        const uint64_t valid =
11765|       |            (hit_off == 0) ? 0 : (uint64_t{1} << (hit_off * 4)) - 1;
11766|       |        note_dots_in_window_neon(b, i, run_start, w, valid, maybe_dot_segment);
11767|       |        i += hit_off;
11768|       |        return;
11769|       |      }
11770|       |      note_dots_in_window_neon(b, i, run_start, w, ~uint64_t{0},
11771|       |                               maybe_dot_segment);
11772|       |    }
11773|       |    if (i > run_start && i < len) {
11774|       |      const uint8x16_t w = vld1q_u8(b + len - 16);
11775|       |      const uint64_t bits = neon_table_stop(w, lo_tbl, hi_tbl);
11776|       |      if (bits != 0) {
11777|       |        const size_t hit =
11778|       |            len - 16 + (static_cast<size_t>(trailing_zeroes64(bits)) >> 2);
11779|       |        if (hit >= i) {
11780|       |          for (size_t j = i; j < hit; ++j) {
11781|       |            if (b[j] == '.') {
11782|       |              note_possible_dot_segment(b, j, run_start, maybe_dot_segment);
11783|       |            }
11784|       |          }
11785|       |          i = hit;
11786|       |          return;
11787|       |        }
11788|       |      }
11789|       |      for (size_t j = i; j < len; ++j) {
11790|       |        if (b[j] == '.') {
11791|       |          note_possible_dot_segment(b, j, run_start, maybe_dot_segment);
11792|       |        }
11793|       |      }
11794|       |      i = len;
11795|       |      return;
11796|       |    }
11797|       |  }
11798|       |#endif
11799|  1.68k|  for (; i < len; ++i) {
  ------------------
  |  Branch (11799:10): [True: 1.47k, False: 207]
  ------------------
11800|  1.47k|    const uint8_t c = b[i];
11801|  1.47k|    const uint8_t cls = k_path[c];
11802|  1.47k|    if (cls != 0) {
  ------------------
  |  Branch (11802:9): [True: 320, False: 1.15k]
  ------------------
11803|    320|      return;
11804|    320|    }
11805|  1.15k|    if (c == '.') {
  ------------------
  |  Branch (11805:9): [True: 394, False: 762]
  ------------------
11806|    394|      note_possible_dot_segment(b, i, run_start, maybe_dot_segment);
11807|    394|    }
11808|  1.15k|  }
11809|    527|}
serializers.cc:_ZN3ada6parser12_GLOBAL__N_119note_dots_in_windowEPKhmmDv2_xiRb:
11599|  1.12k|                                           bool& maybe_dot_segment) noexcept {
11600|  1.12k|  if (maybe_dot_segment || valid_mask == 0) {
  ------------------
  |  Branch (11600:7): [True: 194, False: 931]
  |  Branch (11600:28): [True: 140, False: 791]
  ------------------
11601|    334|    return;
11602|    334|  }
11603|    791|  const int dots =
11604|    791|      _mm_movemask_epi8(_mm_cmpeq_epi8(w, _mm_set1_epi8('.'))) & valid_mask;
11605|    791|  if (dots == 0) {
  ------------------
  |  Branch (11605:7): [True: 221, False: 570]
  ------------------
11606|    221|    return;
11607|    221|  }
11608|    570|  const int slashes =
11609|    570|      _mm_movemask_epi8(_mm_cmpeq_epi8(w, _mm_set1_epi8('/'))) & valid_mask;
11610|    570|  if (((dots & 1) != 0 && (i == run_start || b[i - 1] == '/')) ||
  ------------------
  |  Branch (11610:8): [True: 215, False: 355]
  |  Branch (11610:28): [True: 114, False: 101]
  |  Branch (11610:46): [True: 18, False: 83]
  ------------------
11611|    438|      (dots & (slashes << 1)) != 0) {
  ------------------
  |  Branch (11611:7): [True: 131, False: 307]
  ------------------
11612|    263|    maybe_dot_segment = true;
11613|    263|  }
11614|    570|}
serializers.cc:_ZN3ada6parser12_GLOBAL__N_125note_possible_dot_segmentEPKhmmRb:
11586|    677|    bool& maybe_dot_segment) noexcept {
11587|    677|  if (pos == run_start || b[pos - 1] == '/') {
  ------------------
  |  Branch (11587:7): [True: 100, False: 577]
  |  Branch (11587:27): [True: 247, False: 330]
  ------------------
11588|    347|    maybe_dot_segment = true;
11589|    347|  }
11590|    677|}
serializers.cc:_ZN3ada6parser12_GLOBAL__N_114scan_query_runEPKhRmm:
11952|    296|                                    size_t len) noexcept {
11953|    296|  ADA_SCAN_STOP_RUN(k_query_nibbles, k_query, sse2_query_stop);
  ------------------
  |  |11815|    296|  do {                                                                       \
  |  |11816|    296|    const size_t scan_start = i;                                             \
  |  |11817|    296|    if (parser_use_ssse3() && (i + 16 <= len)) {                             \
  |  |  ------------------
  |  |  |  Branch (11817:9): [True: 296, False: 0]
  |  |  |  Branch (11817:31): [True: 117, False: 179]
  |  |  ------------------
  |  |11818|    117|      const __m128i lo_tbl = nibble_load((nibbles).low);                     \
  |  |11819|    117|      const __m128i hi_tbl = nibble_load((nibbles).high);                    \
  |  |11820|    145|      for (; i + 32 <= len; i += 32) {                                       \
  |  |  ------------------
  |  |  |  Branch (11820:14): [True: 82, False: 63]
  |  |  ------------------
  |  |11821|     82|        const __m128i w0 =                                                   \
  |  |11822|     82|            _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + i));        \
  |  |11823|     82|        const int m0 = ssse3_nibble_mask(w0, lo_tbl, hi_tbl);                \
  |  |11824|     82|        if (m0 != 0) {                                                       \
  |  |  ------------------
  |  |  |  Branch (11824:13): [True: 32, False: 50]
  |  |  ------------------
  |  |11825|     32|          i += static_cast<size_t>(                                          \
  |  |11826|     32|              trailing_zeroes32(static_cast<uint32_t>(m0)));                 \
  |  |11827|     32|          return;                                                            \
  |  |11828|     32|        }                                                                    \
  |  |11829|     82|        const __m128i w1 =                                                   \
  |  |11830|     50|            _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + i + 16));   \
  |  |11831|     50|        const int m1 = ssse3_nibble_mask(w1, lo_tbl, hi_tbl);                \
  |  |11832|     50|        if (m1 != 0) {                                                       \
  |  |  ------------------
  |  |  |  Branch (11832:13): [True: 22, False: 28]
  |  |  ------------------
  |  |11833|     22|          i += 16 + static_cast<size_t>(                                     \
  |  |11834|     22|                        trailing_zeroes32(static_cast<uint32_t>(m1)));       \
  |  |11835|     22|          return;                                                            \
  |  |11836|     22|        }                                                                    \
  |  |11837|     50|      }                                                                      \
  |  |11838|    117|      for (; i + 16 <= len; i += 16) {                                       \
  |  |  ------------------
  |  |  |  Branch (11838:14): [True: 55, False: 31]
  |  |  ------------------
  |  |11839|     55|        const __m128i w =                                                    \
  |  |11840|     55|            _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + i));        \
  |  |11841|     55|        const int mask = ssse3_nibble_mask(w, lo_tbl, hi_tbl);               \
  |  |11842|     55|        if (mask != 0) {                                                     \
  |  |  ------------------
  |  |  |  Branch (11842:13): [True: 32, False: 23]
  |  |  ------------------
  |  |11843|     32|          i += static_cast<size_t>(                                          \
  |  |11844|     32|              trailing_zeroes32(static_cast<uint32_t>(mask)));               \
  |  |11845|     32|          return;                                                            \
  |  |11846|     32|        }                                                                    \
  |  |11847|     55|      }                                                                      \
  |  |11848|     63|      if (i > scan_start && i < len) {                                       \
  |  |  ------------------
  |  |  |  Branch (11848:11): [True: 31, False: 0]
  |  |  |  Branch (11848:29): [True: 22, False: 9]
  |  |  ------------------
  |  |11849|     22|        const __m128i w =                                                    \
  |  |11850|     22|            _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + len - 16)); \
  |  |11851|     22|        const int mask = ssse3_nibble_mask(w, lo_tbl, hi_tbl);               \
  |  |11852|     22|        if (mask != 0) {                                                     \
  |  |  ------------------
  |  |  |  Branch (11852:13): [True: 8, False: 14]
  |  |  ------------------
  |  |11853|      8|          const size_t hit = len - 16 +                                      \
  |  |11854|      8|                             static_cast<size_t>(trailing_zeroes32(          \
  |  |11855|      8|                                 static_cast<uint32_t>(mask)));              \
  |  |11856|      8|          if (hit >= i) {                                                    \
  |  |  ------------------
  |  |  |  Branch (11856:15): [True: 8, False: 0]
  |  |  ------------------
  |  |11857|      8|            i = hit;                                                         \
  |  |11858|      8|            return;                                                          \
  |  |11859|      8|          }                                                                  \
  |  |11860|      8|        }                                                                    \
  |  |11861|     22|        i = len;                                                             \
  |  |11862|     14|        return;                                                              \
  |  |11863|     22|      }                                                                      \
  |  |11864|     31|    }                                                                        \
  |  |11865|    649|    for (; i < len; ++i) {                                                   \
  |  |  ------------------
  |  |  |  Branch (11865:12): [True: 521, False: 128]
  |  |  ------------------
  |  |11866|    521|      if ((cls)[b[i]] != 0) {                                                \
  |  |  ------------------
  |  |  |  Branch (11866:11): [True: 60, False: 461]
  |  |  ------------------
  |  |11867|     60|        return;                                                              \
  |  |11868|     60|      }                                                                      \
  |  |11869|    521|    }                                                                        \
  |  |11870|    188|  } while (0)
  |  |  ------------------
  |  |  |  Branch (11870:12): [Folded, False: 128]
  |  |  ------------------
  ------------------
11954|    296|}
serializers.cc:_ZN3ada6parser12_GLOBAL__N_113scan_hash_runEPKhRmm:
11957|    211|                                   size_t len) noexcept {
11958|    211|  ADA_SCAN_STOP_RUN(k_hash_nibbles, k_hash, sse2_hash_stop);
  ------------------
  |  |11815|    211|  do {                                                                       \
  |  |11816|    211|    const size_t scan_start = i;                                             \
  |  |11817|    211|    if (parser_use_ssse3() && (i + 16 <= len)) {                             \
  |  |  ------------------
  |  |  |  Branch (11817:9): [True: 211, False: 0]
  |  |  |  Branch (11817:31): [True: 73, False: 138]
  |  |  ------------------
  |  |11818|     73|      const __m128i lo_tbl = nibble_load((nibbles).low);                     \
  |  |11819|     73|      const __m128i hi_tbl = nibble_load((nibbles).high);                    \
  |  |11820|    104|      for (; i + 32 <= len; i += 32) {                                       \
  |  |  ------------------
  |  |  |  Branch (11820:14): [True: 52, False: 52]
  |  |  ------------------
  |  |11821|     52|        const __m128i w0 =                                                   \
  |  |11822|     52|            _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + i));        \
  |  |11823|     52|        const int m0 = ssse3_nibble_mask(w0, lo_tbl, hi_tbl);                \
  |  |11824|     52|        if (m0 != 0) {                                                       \
  |  |  ------------------
  |  |  |  Branch (11824:13): [True: 10, False: 42]
  |  |  ------------------
  |  |11825|     10|          i += static_cast<size_t>(                                          \
  |  |11826|     10|              trailing_zeroes32(static_cast<uint32_t>(m0)));                 \
  |  |11827|     10|          return;                                                            \
  |  |11828|     10|        }                                                                    \
  |  |11829|     52|        const __m128i w1 =                                                   \
  |  |11830|     42|            _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + i + 16));   \
  |  |11831|     42|        const int m1 = ssse3_nibble_mask(w1, lo_tbl, hi_tbl);                \
  |  |11832|     42|        if (m1 != 0) {                                                       \
  |  |  ------------------
  |  |  |  Branch (11832:13): [True: 11, False: 31]
  |  |  ------------------
  |  |11833|     11|          i += 16 + static_cast<size_t>(                                     \
  |  |11834|     11|                        trailing_zeroes32(static_cast<uint32_t>(m1)));       \
  |  |11835|     11|          return;                                                            \
  |  |11836|     11|        }                                                                    \
  |  |11837|     42|      }                                                                      \
  |  |11838|     78|      for (; i + 16 <= len; i += 16) {                                       \
  |  |  ------------------
  |  |  |  Branch (11838:14): [True: 43, False: 35]
  |  |  ------------------
  |  |11839|     43|        const __m128i w =                                                    \
  |  |11840|     43|            _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + i));        \
  |  |11841|     43|        const int mask = ssse3_nibble_mask(w, lo_tbl, hi_tbl);               \
  |  |11842|     43|        if (mask != 0) {                                                     \
  |  |  ------------------
  |  |  |  Branch (11842:13): [True: 17, False: 26]
  |  |  ------------------
  |  |11843|     17|          i += static_cast<size_t>(                                          \
  |  |11844|     17|              trailing_zeroes32(static_cast<uint32_t>(mask)));               \
  |  |11845|     17|          return;                                                            \
  |  |11846|     17|        }                                                                    \
  |  |11847|     43|      }                                                                      \
  |  |11848|     52|      if (i > scan_start && i < len) {                                       \
  |  |  ------------------
  |  |  |  Branch (11848:11): [True: 35, False: 0]
  |  |  |  Branch (11848:29): [True: 23, False: 12]
  |  |  ------------------
  |  |11849|     23|        const __m128i w =                                                    \
  |  |11850|     23|            _mm_loadu_si128(reinterpret_cast<const __m128i*>(b + len - 16)); \
  |  |11851|     23|        const int mask = ssse3_nibble_mask(w, lo_tbl, hi_tbl);               \
  |  |11852|     23|        if (mask != 0) {                                                     \
  |  |  ------------------
  |  |  |  Branch (11852:13): [True: 8, False: 15]
  |  |  ------------------
  |  |11853|      8|          const size_t hit = len - 16 +                                      \
  |  |11854|      8|                             static_cast<size_t>(trailing_zeroes32(          \
  |  |11855|      8|                                 static_cast<uint32_t>(mask)));              \
  |  |11856|      8|          if (hit >= i) {                                                    \
  |  |  ------------------
  |  |  |  Branch (11856:15): [True: 8, False: 0]
  |  |  ------------------
  |  |11857|      8|            i = hit;                                                         \
  |  |11858|      8|            return;                                                          \
  |  |11859|      8|          }                                                                  \
  |  |11860|      8|        }                                                                    \
  |  |11861|     23|        i = len;                                                             \
  |  |11862|     15|        return;                                                              \
  |  |11863|     23|      }                                                                      \
  |  |11864|     35|    }                                                                        \
  |  |11865|    602|    for (; i < len; ++i) {                                                   \
  |  |  ------------------
  |  |  |  Branch (11865:12): [True: 479, False: 123]
  |  |  ------------------
  |  |11866|    479|      if ((cls)[b[i]] != 0) {                                                \
  |  |  ------------------
  |  |  |  Branch (11866:11): [True: 27, False: 452]
  |  |  ------------------
  |  |11867|     27|        return;                                                              \
  |  |11868|     27|      }                                                                      \
  |  |11869|    479|    }                                                                        \
  |  |11870|    150|  } while (0)
  |  |  ------------------
  |  |  |  Branch (11870:12): [Folded, False: 123]
  |  |  ------------------
  ------------------
11959|    211|}
serializers.cc:_ZN3ada6parser12_GLOBAL__N_120path_has_dot_segmentENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
11963|    298|bool path_has_dot_segment(std::string_view path) noexcept {
11964|    298|  if (path.empty()) {
  ------------------
  |  Branch (11964:7): [True: 0, False: 298]
  ------------------
11965|      0|    return false;
11966|      0|  }
11967|       |  // "." / ".." at the start, with or without a leading '/'.
11968|    298|  const size_t i = (path[0] == '/') ? 1 : 0;
  ------------------
  |  Branch (11968:20): [True: 298, False: 0]
  ------------------
11969|    298|  if (i < path.size() && path[i] == '.') {
  ------------------
  |  Branch (11969:7): [True: 298, False: 0]
  |  Branch (11969:26): [True: 126, False: 172]
  ------------------
11970|    126|    const size_t after = i + 1;
11971|    126|    if (after == path.size() || path[after] == '/' ||
  ------------------
  |  Branch (11971:9): [True: 3, False: 123]
  |  Branch (11971:33): [True: 27, False: 96]
  ------------------
11972|     96|        (after < path.size() && path[after] == '.' &&
  ------------------
  |  Branch (11972:10): [True: 96, False: 0]
  |  Branch (11972:33): [True: 47, False: 49]
  ------------------
11973|     47|         (after + 1 == path.size() || path[after + 1] == '/'))) {
  ------------------
  |  Branch (11973:11): [True: 1, False: 46]
  |  Branch (11973:39): [True: 15, False: 31]
  ------------------
11974|     46|      return true;
11975|     46|    }
11976|    126|  }
11977|    252|  static constexpr std::string_view slash_dot{"/.", 2};
11978|    252|  size_t p = i;
11979|    450|  while ((p = path.find(slash_dot, p)) != std::string_view::npos) {
  ------------------
  |  Branch (11979:10): [True: 309, False: 141]
  ------------------
11980|    309|    const size_t after = p + 2;
11981|    309|    if (after == path.size() || path[after] == '/' ||
  ------------------
  |  Branch (11981:9): [True: 4, False: 305]
  |  Branch (11981:33): [True: 45, False: 260]
  ------------------
11982|    260|        (after < path.size() && path[after] == '.' &&
  ------------------
  |  Branch (11982:10): [True: 260, False: 0]
  |  Branch (11982:33): [True: 118, False: 142]
  ------------------
11983|    118|         (after + 1 == path.size() || path[after + 1] == '/'))) {
  ------------------
  |  Branch (11983:11): [True: 15, False: 103]
  |  Branch (11983:39): [True: 47, False: 56]
  ------------------
11984|    111|      return true;
11985|    111|    }
11986|    198|    p = after;
11987|    198|  }
11988|    141|  return false;
11989|    252|}
serializers.cc:_ZN12_GLOBAL__N_132apply_shifted_non_scheme_offsetsERN3ada14url_componentsEj:
13963|  12.1k|    ada::url_components& components, uint32_t new_difference) {
13964|  12.1k|  components.username_end += new_difference;
13965|  12.1k|  components.host_start += new_difference;
13966|  12.1k|  components.host_end += new_difference;
13967|  12.1k|  components.pathname_start += new_difference;
13968|  12.1k|  if (components.search_start != ada::url_components::omitted) {
  ------------------
  |  Branch (13968:7): [True: 0, False: 12.1k]
  ------------------
13969|      0|    components.search_start += new_difference;
13970|      0|  }
13971|  12.1k|  if (components.hash_start != ada::url_components::omitted) {
  ------------------
  |  Branch (13971:7): [True: 0, False: 12.1k]
  ------------------
13972|      0|    components.hash_start += new_difference;
13973|      0|  }
13974|  12.1k|}
_ZN3ada14url_aggregator10parse_pathENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
14333|    887|ada_really_inline void url_aggregator::parse_path(std::string_view input) {
14334|    887|  ada_log("url_aggregator::parse_path ", input);
14335|    887|  ADA_ASSERT_TRUE(validate());
14336|    887|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
14337|    887|  std::string tmp_buffer;
14338|    887|  std::string_view internal_input;
14339|    887|  if (unicode::has_tabs_or_newline(input)) {
  ------------------
  |  Branch (14339:7): [True: 0, False: 887]
  ------------------
14340|      0|    tmp_buffer = input;
14341|       |    // Optimization opportunity: Instead of copying and then pruning, we could
14342|       |    // just directly build the string from user_input.
14343|      0|    helpers::remove_ascii_tab_or_newline(tmp_buffer);
14344|      0|    internal_input = tmp_buffer;
14345|    887|  } else {
14346|    887|    internal_input = input;
14347|    887|  }
14348|       |
14349|       |  // If url is special, then:
14350|    887|  if (is_special()) {
  ------------------
  |  Branch (14350:7): [True: 887, False: 0]
  ------------------
14351|    887|    if (internal_input.empty()) {
  ------------------
  |  Branch (14351:9): [True: 134, False: 753]
  ------------------
14352|    134|      update_base_pathname("/");
14353|    753|    } else if ((internal_input[0] == '/') || (internal_input[0] == '\\')) {
  ------------------
  |  Branch (14353:16): [True: 753, False: 0]
  |  Branch (14353:46): [True: 0, False: 0]
  ------------------
14354|    753|      consume_prepared_path(internal_input.substr(1));
14355|    753|    } else {
14356|      0|      consume_prepared_path(internal_input);
14357|      0|    }
14358|    887|  } else if (!internal_input.empty()) {
  ------------------
  |  Branch (14358:14): [True: 0, False: 0]
  ------------------
14359|      0|    if (internal_input[0] == '/') {
  ------------------
  |  Branch (14359:9): [True: 0, False: 0]
  ------------------
14360|      0|      consume_prepared_path(internal_input.substr(1));
14361|      0|    } else {
14362|      0|      consume_prepared_path(internal_input);
14363|      0|    }
14364|      0|  } else {
14365|       |    // Non-special URLs with an empty host can have their paths erased
14366|       |    // Path-only URLs cannot have their paths erased
14367|      0|    if (components.host_start == components.host_end && !has_authority()) {
  ------------------
  |  Branch (14367:9): [True: 0, False: 0]
  |  Branch (14367:57): [True: 0, False: 0]
  ------------------
14368|      0|      update_base_pathname("/");
14369|      0|    }
14370|      0|  }
14371|    887|  ADA_ASSERT_TRUE(validate());
14372|    887|}
_ZN3ada14url_aggregator10parse_hostENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
14466|  12.0k|ada_really_inline bool url_aggregator::parse_host(std::string_view input) {
14467|  12.0k|  ada_log("url_aggregator:parse_host \"", input, "\" [", input.size(),
14468|  12.0k|          " bytes]");
14469|  12.0k|  ADA_ASSERT_TRUE(validate());
14470|  12.0k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
14471|  12.0k|  if (input.empty()) {
  ------------------
  |  Branch (14471:7): [True: 1, False: 12.0k]
  ------------------
14472|      1|    return is_valid = false;
14473|      1|  }  // technically unnecessary.
14474|       |  // If input starts with U+005B ([), then:
14475|  12.0k|  if (input[0] == '[') {
  ------------------
  |  Branch (14475:7): [True: 7.30k, False: 4.78k]
  ------------------
14476|       |    // If input does not end with U+005D (]), validation error, return failure.
14477|  7.30k|    if (input.back() != ']') {
  ------------------
  |  Branch (14477:9): [True: 64, False: 7.23k]
  ------------------
14478|     64|      return is_valid = false;
14479|     64|    }
14480|  7.23k|    ada_log("parse_host ipv6");
14481|       |
14482|       |    // Return the result of IPv6 parsing input with its leading U+005B ([) and
14483|       |    // trailing U+005D (]) removed.
14484|  7.23k|    input.remove_prefix(1);
14485|  7.23k|    input.remove_suffix(1);
14486|  7.23k|    return parse_ipv6(input);
14487|  7.30k|  }
14488|       |
14489|       |  // If isNotSpecial is true, then return the result of opaque-host parsing
14490|       |  // input.
14491|  4.78k|  if (!is_special()) {
  ------------------
  |  Branch (14491:7): [True: 0, False: 4.78k]
  ------------------
14492|      0|    return parse_opaque_host(input);
14493|      0|  }
14494|       |  // Let domain be the result of running UTF-8 decode without BOM on the
14495|       |  // percent-decoding of input. Let asciiDomain be the result of running domain
14496|       |  // to ASCII with domain and false. The most common case is an ASCII input, in
14497|       |  // which case we do not need to call the expensive 'to_ascii' if a few
14498|       |  // conditions are met: no '%' and no 'xn-' subsequence.
14499|       |
14500|       |  // Often, the input does not contain any forbidden code points, and no upper
14501|       |  // case ASCII letter, then we can just copy it to the buffer. We want to
14502|       |  // optimize for such a common case.
14503|       |
14504|       |  // Fast path: try to parse as pure decimal IPv4 first.
14505|  4.78k|  const uint64_t fast_result = checkers::try_parse_ipv4_fast(input);
14506|  4.78k|  if (fast_result < checkers::ipv4_fast_fail) {
  ------------------
  |  Branch (14506:7): [True: 287, False: 4.50k]
  ------------------
14507|    287|    if (!input.empty() && input.back() == '.') {
  ------------------
  |  Branch (14507:9): [True: 287, False: 0]
  |  Branch (14507:27): [True: 2, False: 285]
  ------------------
14508|      2|      update_base_hostname(input.substr(0, input.size() - 1));
14509|    285|    } else {
14510|    285|      update_base_hostname(input);
14511|    285|    }
14512|    287|    host_type = IPV4;
14513|    287|    is_valid = true;
14514|    287|    ada_log("parse_host fast path decimal ipv4");
14515|    287|    ADA_ASSERT_TRUE(validate());
14516|    287|    return true;
14517|    287|  }
14518|  4.50k|  uint8_t is_forbidden_or_upper =
14519|  4.50k|      unicode::contains_forbidden_domain_code_point_or_upper(input.data(),
14520|  4.50k|                                                             input.size());
14521|  4.50k|  static constexpr std::string_view xn_dash{"xn-", 3};
14522|  4.50k|  if ((is_forbidden_or_upper & 1) == 0) {
  ------------------
  |  Branch (14522:7): [True: 1.59k, False: 2.90k]
  ------------------
14523|  1.59k|    if ((is_forbidden_or_upper & 2) != 0) {
  ------------------
  |  Branch (14523:9): [True: 350, False: 1.24k]
  ------------------
14524|    350|      std::string lowered(input);
14525|    350|      unicode::to_lower_ascii(lowered.data(), lowered.size());
14526|    350|      if (lowered.find('-') == std::string_view::npos ||
  ------------------
  |  Branch (14526:11): [True: 273, False: 77]
  ------------------
14527|    324|          lowered.find(xn_dash) == std::string_view::npos) {
  ------------------
  |  Branch (14527:11): [True: 51, False: 26]
  ------------------
14528|       |        // Check IPv4 before mutating so failures leave the buffer untouched.
14529|       |        // This also avoids a double buffer rewrite for hex/octal IPv4.
14530|    324|        if (checkers::is_ipv4(lowered)) {
  ------------------
  |  Branch (14530:13): [True: 170, False: 154]
  ------------------
14531|    170|          ada_log("parse_host fast path ipv4");
14532|    170|          return parse_ipv4(lowered, false);
14533|    170|        }
14534|    154|        update_base_hostname(lowered);
14535|    154|        ada_log("parse_host fast path ", get_hostname());
14536|    154|        is_valid = true;
14537|    154|        return true;
14538|    324|      }
14539|  1.24k|    } else if (input.find('-') == std::string_view::npos ||
  ------------------
  |  Branch (14539:16): [True: 1.15k, False: 88]
  ------------------
14540|  1.21k|               input.find(xn_dash) == std::string_view::npos) {
  ------------------
  |  Branch (14540:16): [True: 64, False: 24]
  ------------------
14541|       |      // Check IPv4 before mutating so failures leave the buffer untouched.
14542|  1.21k|      if (checkers::is_ipv4(input)) {
  ------------------
  |  Branch (14542:11): [True: 954, False: 263]
  ------------------
14543|    954|        ada_log("parse_host fast path ipv4");
14544|    954|        return parse_ipv4(input, false);
14545|    954|      }
14546|    263|      update_base_hostname(input);
14547|    263|      ada_log("parse_host fast path ", get_hostname());
14548|    263|      is_valid = true;
14549|    263|      return true;
14550|  1.21k|    }
14551|  2.90k|  } else if (const size_t first_percent = input.find('%');
14552|  2.90k|             first_percent != std::string_view::npos) {
  ------------------
  |  Branch (14552:14): [True: 319, False: 2.59k]
  ------------------
14553|    319|    std::string decoded = unicode::percent_decode(input, first_percent);
14554|    319|    const uint8_t decoded_flags =
14555|    319|        unicode::contains_forbidden_domain_code_point_or_upper(decoded.data(),
14556|    319|                                                               decoded.size());
14557|    319|    if ((decoded_flags & 1) == 0) {
  ------------------
  |  Branch (14557:9): [True: 204, False: 115]
  ------------------
14558|    204|      if ((decoded_flags & 2) != 0) {
  ------------------
  |  Branch (14558:11): [True: 75, False: 129]
  ------------------
14559|     75|        unicode::to_lower_ascii(decoded.data(), decoded.size());
14560|     75|      }
14561|    204|      if (decoded.find('-') == std::string_view::npos ||
  ------------------
  |  Branch (14561:11): [True: 178, False: 26]
  ------------------
14562|    193|          decoded.find(xn_dash) == std::string_view::npos) {
  ------------------
  |  Branch (14562:11): [True: 15, False: 11]
  ------------------
14563|       |        // Check IPv4 before mutating so failures leave the buffer untouched.
14564|    193|        if (checkers::is_ipv4(decoded)) {
  ------------------
  |  Branch (14564:13): [True: 102, False: 91]
  ------------------
14565|    102|          return parse_ipv4(decoded, false);
14566|    102|        }
14567|     91|        update_base_hostname(decoded);
14568|     91|        is_valid = true;
14569|     91|        return true;
14570|    193|      }
14571|    204|    }
14572|    319|  }
14573|       |  // We have encountered at least one forbidden code point or the input contains
14574|       |  // 'xn-' (case insensitive), so we need to call 'to_ascii' to perform the full
14575|       |  // conversion.
14576|       |
14577|  2.76k|  ada_log("parse_host calling to_ascii");
14578|  2.76k|  std::optional<std::string> host = std::string(get_hostname());
14579|  2.76k|  is_valid = ada::unicode::to_ascii(host, input, input.find('%'));
14580|  2.76k|  if (!is_valid) {
  ------------------
  |  Branch (14580:7): [True: 1.33k, False: 1.43k]
  ------------------
14581|  1.33k|    ada_log("parse_host to_ascii returns false");
14582|  1.33k|    return is_valid = false;
14583|  1.33k|  }
14584|  1.43k|  ada_log("parse_host to_ascii succeeded ", *host, " [", host->size(),
14585|  1.43k|          " bytes]");
14586|       |
14587|  1.43k|  if (std::ranges::any_of(host.value(),
  ------------------
  |  Branch (14587:7): [True: 0, False: 1.43k]
  ------------------
14588|  1.43k|                          ada::unicode::is_forbidden_domain_code_point)) {
14589|      0|    return is_valid = false;
14590|      0|  }
14591|       |
14592|       |  // If asciiDomain ends in a number, then return the result of IPv4 parsing
14593|       |  // asciiDomain.
14594|  1.43k|  if (checkers::is_ipv4(host.value())) {
  ------------------
  |  Branch (14594:7): [True: 1.20k, False: 229]
  ------------------
14595|  1.20k|    ada_log("parse_host got ipv4 ", *host);
14596|  1.20k|    return parse_ipv4(host.value(), false);
14597|  1.20k|  }
14598|       |
14599|    229|  update_base_hostname(host.value());
14600|    229|  ADA_ASSERT_TRUE(validate());
14601|    229|  return true;
14602|  1.43k|}
_ZN3ada14url_aggregator21consume_prepared_pathENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
15448|  1.85k|inline void url_aggregator::consume_prepared_path(std::string_view input) {
15449|  1.85k|  ada_log("url_aggregator::consume_prepared_path ", input);
15450|       |  /***
15451|       |   * This is largely duplicated code from helpers::parse_prepared_path, which is
15452|       |   * unfortunate. This particular function is nearly identical, except that it
15453|       |   * is a method on url_aggregator. The idea is that the trivial path (which is
15454|       |   * very common) merely appends to the buffer. This is the same trivial path as
15455|       |   * with helpers::parse_prepared_path, except that we have the additional check
15456|       |   * for is_at_path(). Otherwise, we grab a copy of the current path and we
15457|       |   * modify it, and then insert it back into the buffer.
15458|       |   */
15459|  1.85k|  uint8_t accumulator = checkers::path_signature(input);
15460|       |  // Let us first detect a trivial case.
15461|       |  // If it is special, we check that we have no dot, no %,  no \ and no
15462|       |  // character needing percent encoding. Otherwise, we check that we have no %,
15463|       |  // no dot, and no character needing percent encoding.
15464|  1.85k|  constexpr uint8_t need_encoding = 1;
15465|  1.85k|  constexpr uint8_t backslash_char = 2;
15466|  1.85k|  constexpr uint8_t dot_char = 4;
15467|  1.85k|  constexpr uint8_t percent_char = 8;
15468|  1.85k|  bool special = type != ada::scheme::NOT_SPECIAL;
15469|  1.85k|  bool may_need_slow_file_handling = (type == ada::scheme::type::FILE &&
  ------------------
  |  Branch (15469:39): [True: 0, False: 1.85k]
  ------------------
15470|      0|                                      checkers::is_windows_drive_letter(input));
  ------------------
  |  Branch (15470:39): [True: 0, False: 0]
  ------------------
15471|  1.85k|  bool trivial_path =
15472|  1.85k|      (special ? (accumulator == 0)
  ------------------
  |  Branch (15472:7): [True: 688, False: 1.16k]
  |  Branch (15472:8): [True: 1.85k, False: 0]
  ------------------
15473|  1.85k|               : ((accumulator & (need_encoding | dot_char | percent_char)) ==
15474|      0|                  0)) &&
15475|    688|      (!may_need_slow_file_handling);
  ------------------
  |  Branch (15475:7): [True: 688, False: 0]
  ------------------
15476|  1.85k|  if (accumulator == dot_char && !may_need_slow_file_handling) {
  ------------------
  |  Branch (15476:7): [True: 506, False: 1.34k]
  |  Branch (15476:34): [True: 506, False: 0]
  ------------------
15477|       |    // '4' means that we have at least one dot, but nothing that requires
15478|       |    // percent encoding or decoding. The only part that is not trivial is
15479|       |    // that we may have single dots and double dots path segments.
15480|       |    // If we have such segments, then we either have a path that begins
15481|       |    // with '.' (easy to check), or we have the sequence './'.
15482|       |    // Note: input cannot be empty, it must at least contain one character ('.')
15483|       |    // Note: we know that '\' is not present.
15484|    506|    if (input[0] != '.') {
  ------------------
  |  Branch (15484:9): [True: 207, False: 299]
  ------------------
15485|    207|      size_t slashdot = 0;
15486|    207|      bool dot_is_file = true;
15487|    875|      for (;;) {
15488|    875|        slashdot = input.find("/.", slashdot);
15489|    875|        if (slashdot == std::string_view::npos) {  // common case
  ------------------
  |  Branch (15489:13): [True: 207, False: 668]
  ------------------
15490|    207|          break;
15491|    668|        } else {  // uncommon
15492|       |          // only three cases matter: /./, /.. or a final /
15493|    668|          slashdot += 2;
15494|    668|          dot_is_file &= !(slashdot == input.size() || input[slashdot] == '.' ||
  ------------------
  |  Branch (15494:28): [True: 5, False: 663]
  |  Branch (15494:56): [True: 340, False: 323]
  ------------------
15495|    323|                           input[slashdot] == '/');
  ------------------
  |  Branch (15495:28): [True: 208, False: 115]
  ------------------
15496|    668|        }
15497|    875|      }
15498|    207|      trivial_path = dot_is_file;
15499|    207|    }
15500|    506|  }
15501|  1.85k|  if (trivial_path && is_at_path()) {
  ------------------
  |  Branch (15501:7): [True: 724, False: 1.13k]
  |  Branch (15501:23): [True: 724, False: 0]
  ------------------
15502|    724|    ada_log("parse_path trivial");
15503|    724|    buffer += '/';
15504|    724|    buffer += input;
15505|    724|    return;
15506|    724|  }
15507|  1.13k|  std::string path = std::string(get_pathname());
15508|       |  // We are going to need to look a bit at the path, but let us see if we can
15509|       |  // ignore percent encoding *and* backslashes *and* percent characters.
15510|       |  // Except for the trivial case, this is likely to capture 99% of paths out
15511|       |  // there.
15512|  1.13k|  bool fast_path =
15513|  1.13k|      (special &&
  ------------------
  |  Branch (15513:8): [True: 1.13k, False: 0]
  ------------------
15514|  1.13k|       (accumulator & (need_encoding | backslash_char | percent_char)) == 0) &&
  ------------------
  |  Branch (15514:8): [True: 470, False: 661]
  ------------------
15515|    470|      (type != ada::scheme::type::FILE);
  ------------------
  |  Branch (15515:7): [True: 470, False: 0]
  ------------------
15516|  1.13k|  if (fast_path) {
  ------------------
  |  Branch (15516:7): [True: 470, False: 661]
  ------------------
15517|    470|    ada_log("parse_prepared_path fast");
15518|       |    // Here we don't need to worry about \ or percent encoding.
15519|       |    // We also do not have a file protocol. We might have dots, however,
15520|       |    // but dots must as appear as '.', and they cannot be encoded because
15521|       |    // the symbol '%' is not present.
15522|    470|    size_t previous_location = 0;  // We start at 0.
15523|  2.72k|    do {
15524|  2.72k|      size_t new_location = input.find('/', previous_location);
15525|       |      // std::string_view path_view = input;
15526|       |      //  We process the last segment separately:
15527|  2.72k|      if (new_location == std::string_view::npos) {
  ------------------
  |  Branch (15527:11): [True: 470, False: 2.25k]
  ------------------
15528|    470|        std::string_view path_view = input.substr(previous_location);
15529|    470|        if (path_view == "..") {  // The path ends with ..
  ------------------
  |  Branch (15529:13): [True: 18, False: 452]
  ------------------
15530|       |          // e.g., if you receive ".." with an empty path, you go to "/".
15531|     18|          if (path.empty()) {
  ------------------
  |  Branch (15531:15): [True: 2, False: 16]
  ------------------
15532|      2|            path = '/';
15533|      2|            update_base_pathname(path);
15534|      2|            return;
15535|      2|          }
15536|       |          // Fast case where we have nothing to do:
15537|     16|          if (path.back() == '/') {
  ------------------
  |  Branch (15537:15): [True: 4, False: 12]
  ------------------
15538|      4|            update_base_pathname(path);
15539|      4|            return;
15540|      4|          }
15541|       |          // If you have the path "/joe/myfriend",
15542|       |          // then you delete 'myfriend'.
15543|     12|          path.resize(path.rfind('/') + 1);
15544|     12|          update_base_pathname(path);
15545|     12|          return;
15546|     16|        }
15547|    452|        path += '/';
15548|    452|        if (path_view != ".") {
  ------------------
  |  Branch (15548:13): [True: 443, False: 9]
  ------------------
15549|    443|          path.append(path_view);
15550|    443|        }
15551|    452|        update_base_pathname(path);
15552|    452|        return;
15553|  2.25k|      } else {
15554|       |        // This is a non-final segment.
15555|  2.25k|        std::string_view path_view =
15556|  2.25k|            input.substr(previous_location, new_location - previous_location);
15557|  2.25k|        previous_location = new_location + 1;
15558|  2.25k|        if (path_view == "..") {
  ------------------
  |  Branch (15558:13): [True: 381, False: 1.87k]
  ------------------
15559|    381|          size_t last_delimiter = path.rfind('/');
15560|    381|          if (last_delimiter != std::string::npos) {
  ------------------
  |  Branch (15560:15): [True: 172, False: 209]
  ------------------
15561|    172|            path.erase(last_delimiter);
15562|    172|          }
15563|  1.87k|        } else if (path_view != ".") {
  ------------------
  |  Branch (15563:20): [True: 1.56k, False: 311]
  ------------------
15564|  1.56k|          path += '/';
15565|  1.56k|          path.append(path_view);
15566|  1.56k|        }
15567|  2.25k|      }
15568|  2.72k|    } while (true);
  ------------------
  |  Branch (15568:14): [True: 2.25k, Folded]
  ------------------
15569|    661|  } else {
15570|    661|    ada_log("parse_path slow");
15571|       |    // we have reached the general case
15572|    661|    bool needs_percent_encoding = (accumulator & 1);
15573|    661|    std::string path_buffer_tmp;
15574|  4.17k|    do {
15575|  4.17k|      size_t location = (special && (accumulator & 2))
  ------------------
  |  Branch (15575:26): [True: 4.17k, False: 0]
  |  Branch (15575:37): [True: 151, False: 4.02k]
  ------------------
15576|  4.17k|                            ? input.find_first_of("/\\")
15577|  4.17k|                            : input.find('/');
15578|  4.17k|      std::string_view path_view = input;
15579|  4.17k|      if (location != std::string_view::npos) {
  ------------------
  |  Branch (15579:11): [True: 3.51k, False: 661]
  ------------------
15580|  3.51k|        path_view.remove_suffix(path_view.size() - location);
15581|  3.51k|        input.remove_prefix(location + 1);
15582|  3.51k|      }
15583|       |      // path_buffer is either path_view or it might point at a percent encoded
15584|       |      // temporary string.
15585|  4.17k|      std::string_view path_buffer =
15586|  4.17k|          (needs_percent_encoding &&
  ------------------
  |  Branch (15586:12): [True: 3.63k, False: 539]
  ------------------
15587|  3.63k|           ada::unicode::percent_encode<false>(
  ------------------
  |  Branch (15587:12): [True: 1.17k, False: 2.46k]
  ------------------
15588|  3.63k|               path_view, character_sets::PATH_PERCENT_ENCODE, path_buffer_tmp))
15589|  4.17k|              ? path_buffer_tmp
15590|  4.17k|              : path_view;
15591|  4.17k|      if (unicode::is_double_dot_path_segment(path_buffer)) {
  ------------------
  |  Branch (15591:11): [True: 361, False: 3.81k]
  ------------------
15592|    361|        helpers::shorten_path(path, type);
15593|    361|        if (location == std::string_view::npos) {
  ------------------
  |  Branch (15593:13): [True: 20, False: 341]
  ------------------
15594|     20|          path += '/';
15595|     20|        }
15596|  3.81k|      } else if (unicode::is_single_dot_path_segment(path_buffer) &&
  ------------------
  |  Branch (15596:18): [True: 252, False: 3.56k]
  ------------------
15597|    252|                 (location == std::string_view::npos)) {
  ------------------
  |  Branch (15597:18): [True: 13, False: 239]
  ------------------
15598|     13|        path += '/';
15599|     13|      }
15600|       |      // Otherwise, if path_buffer is not a single-dot path segment, then:
15601|  3.80k|      else if (!unicode::is_single_dot_path_segment(path_buffer)) {
  ------------------
  |  Branch (15601:16): [True: 3.56k, False: 239]
  ------------------
15602|       |        // If url's scheme is "file", url's path is empty, and path_buffer is a
15603|       |        // Windows drive letter, then replace the second code point in
15604|       |        // path_buffer with U+003A (:).
15605|  3.56k|        if (type == ada::scheme::type::FILE && path.empty() &&
  ------------------
  |  Branch (15605:13): [True: 0, False: 3.56k]
  |  Branch (15605:48): [True: 0, False: 0]
  ------------------
15606|      0|            checkers::is_windows_drive_letter(path_buffer)) {
  ------------------
  |  Branch (15606:13): [True: 0, False: 0]
  ------------------
15607|      0|          path += '/';
15608|      0|          path += path_buffer[0];
15609|      0|          path += ':';
15610|      0|          path_buffer.remove_prefix(2);
15611|      0|          path.append(path_buffer);
15612|  3.56k|        } else {
15613|       |          // Append path_buffer to url's path.
15614|  3.56k|          path += '/';
15615|  3.56k|          path.append(path_buffer);
15616|  3.56k|        }
15617|  3.56k|      }
15618|  4.17k|      if (location == std::string_view::npos) {
  ------------------
  |  Branch (15618:11): [True: 661, False: 3.51k]
  ------------------
15619|    661|        update_base_pathname(path);
15620|    661|        return;
15621|    661|      }
15622|  4.17k|    } while (true);
  ------------------
  |  Branch (15622:14): [True: 3.51k, Folded]
  ------------------
15623|    661|  }
15624|  1.13k|}
_ZN3ada8checkers7is_ipv4ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   14|  9.40k|ada_really_inline constexpr bool is_ipv4(std::string_view view) noexcept {
   15|       |  // The string is not empty and does not contain upper case ASCII characters.
   16|  9.40k|  if (!last_label_may_be_a_number(view)) {
  ------------------
  |  Branch (16:7): [True: 858, False: 8.55k]
  ------------------
   17|    858|    return false;
   18|    858|  }
   19|       |  // If the address ends with a dot, we need to prune it (special case).
   20|  8.55k|  if (view.ends_with('.')) {
  ------------------
  |  Branch (20:7): [True: 135, False: 8.41k]
  ------------------
   21|    135|    view.remove_suffix(1);
   22|    135|  }
   23|       |  // From the last character, find the last dot.
   24|  8.55k|  size_t last_dot = view.rfind('.');
   25|  8.55k|  if (last_dot != std::string_view::npos) {
  ------------------
  |  Branch (25:7): [True: 7.61k, False: 934]
  ------------------
   26|       |    // We have at least one dot.
   27|  7.61k|    view.remove_prefix(last_dot + 1);
   28|  7.61k|  }
   29|       |  /** Optimization opportunity: we have basically identified the last number of
   30|       |     the ipv4 if we return true here. We might as well parse it and have at
   31|       |     least one number parsed when we get to parse_ipv4. */
   32|  8.55k|  if (std::ranges::all_of(view, ada::checkers::is_digit)) {
  ------------------
  |  Branch (32:7): [True: 7.95k, False: 596]
  ------------------
   33|  7.95k|    return true;
   34|  7.95k|  }
   35|       |  // It could be hex (0x), but not if there is a single character.
   36|    596|  if (view.size() == 1) {
  ------------------
  |  Branch (36:7): [True: 0, False: 596]
  ------------------
   37|      0|    return false;
   38|      0|  }
   39|       |  // It must start with 0x.
   40|    596|  if (!view.starts_with("0x")) {
  ------------------
  |  Branch (40:7): [True: 78, False: 518]
  ------------------
   41|     78|    return false;
   42|     78|  }
   43|       |  // We must allow "0x".
   44|    518|  if (view.size() == 2) {
  ------------------
  |  Branch (44:7): [True: 32, False: 486]
  ------------------
   45|     32|    return true;
   46|     32|  }
   47|       |  // We have 0x followed by some characters, we need to check that they are
   48|       |  // hexadecimals.
   49|    486|  view.remove_prefix(2);
   50|    486|  return std::ranges::all_of(view, ada::unicode::is_lowercase_hex);
   51|    518|}
_ZN3ada7unicode16is_lowercase_hexEc:
 7437|  4.74k|ada_really_inline constexpr bool is_lowercase_hex(const char c) noexcept {
 7438|  4.74k|  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f');
  ------------------
  |  Branch (7438:11): [True: 4.74k, False: 0]
  |  Branch (7438:23): [True: 2.22k, False: 2.52k]
  |  Branch (7438:37): [True: 2.52k, False: 3]
  |  Branch (7438:49): [True: 2.50k, False: 18]
  ------------------
 7439|  4.74k|}
_ZN3ada8checkers14path_signatureENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   77|  8.97k|    std::string_view input) noexcept {
   78|       |  // The path percent-encode set is the query percent-encode set and U+003F (?),
   79|       |  // U+0060 (`), U+007B ({), and U+007D (}). The query percent-encode set is the
   80|       |  // C0 control percent-encode set and U+0020 SPACE, U+0022 ("), U+0023 (#),
   81|       |  // U+003C (<), and U+003E (>). The C0 control percent-encode set are the C0
   82|       |  // controls and all code points greater than U+007E (~).
   83|  8.97k|  size_t i = 0;
   84|  8.97k|  uint8_t accumulator{};
   85|  26.1k|  for (; i + 7 < input.size(); i += 8) {
  ------------------
  |  Branch (85:10): [True: 17.1k, False: 8.97k]
  ------------------
   86|  17.1k|    accumulator |= uint8_t(path_signature_table[uint8_t(input[i])] |
   87|  17.1k|                           path_signature_table[uint8_t(input[i + 1])] |
   88|  17.1k|                           path_signature_table[uint8_t(input[i + 2])] |
   89|  17.1k|                           path_signature_table[uint8_t(input[i + 3])] |
   90|  17.1k|                           path_signature_table[uint8_t(input[i + 4])] |
   91|  17.1k|                           path_signature_table[uint8_t(input[i + 5])] |
   92|  17.1k|                           path_signature_table[uint8_t(input[i + 6])] |
   93|  17.1k|                           path_signature_table[uint8_t(input[i + 7])]);
   94|  17.1k|  }
   95|  36.1k|  for (; i < input.size(); i++) {
  ------------------
  |  Branch (95:10): [True: 27.1k, False: 8.97k]
  ------------------
   96|  27.1k|    accumulator |= uint8_t(path_signature_table[uint8_t(input[i])]);
   97|  27.1k|  }
   98|  8.97k|  return accumulator;
   99|  8.97k|}
_ZN3ada7unicode45contains_forbidden_domain_code_point_or_upperEPKcm:
 7318|  11.9k|                                              size_t length) noexcept {
 7319|  11.9k|  size_t i = 0;
 7320|  11.9k|  uint8_t accumulator{};
 7321|  61.6k|  for (; i + 4 <= length; i += 4) {
  ------------------
  |  Branch (7321:10): [True: 49.6k, False: 11.9k]
  ------------------
 7322|  49.6k|    accumulator |=
 7323|  49.6k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i])];
 7324|  49.6k|    accumulator |=
 7325|  49.6k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i + 1])];
 7326|  49.6k|    accumulator |=
 7327|  49.6k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i + 2])];
 7328|  49.6k|    accumulator |=
 7329|  49.6k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i + 3])];
 7330|  49.6k|  }
 7331|  28.1k|  for (; i < length; i++) {
  ------------------
  |  Branch (7331:10): [True: 16.2k, False: 11.9k]
  ------------------
 7332|  16.2k|    accumulator |=
 7333|  16.2k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i])];
 7334|  16.2k|  }
 7335|  11.9k|  return accumulator;
 7336|  11.9k|}
_ZN3ada14url_aggregator23parse_scheme_with_colonILb0EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
13981|  12.1k|    const std::string_view input_with_colon) {
13982|  12.1k|  ada_log("url_aggregator::parse_scheme_with_colon ", input_with_colon);
13983|  12.1k|  ADA_ASSERT_TRUE(validate());
13984|  12.1k|  ADA_ASSERT_TRUE(!helpers::overlaps(input_with_colon, buffer));
13985|  12.1k|  std::string_view input{input_with_colon};
13986|  12.1k|  input.remove_suffix(1);
13987|  12.1k|  auto parsed_type = ada::scheme::get_scheme_type(input);
13988|  12.1k|  const bool is_input_special = (parsed_type != ada::scheme::NOT_SPECIAL);
13989|       |  /**
13990|       |   * In the common case, we will immediately recognize a special scheme (e.g.,
13991|       |   *http, https), in which case, we can go really fast.
13992|       |   **/
13993|  12.1k|  if (is_input_special) {  // fast path!!!
  ------------------
  |  Branch (13993:7): [True: 12.1k, False: 0]
  ------------------
13994|       |    if constexpr (has_state_override) {
13995|       |      // If url's scheme is not a special scheme and buffer is a special scheme,
13996|       |      // then return.
13997|       |      if (is_special() != is_input_special) {
13998|       |        return false;
13999|       |      }
14000|       |
14001|       |      // If url includes credentials or has a non-null port, and buffer is
14002|       |      // "file", then return.
14003|       |      if ((has_credentials() || components.port != url_components::omitted) &&
14004|       |          parsed_type == ada::scheme::type::FILE) {
14005|       |        return false;
14006|       |      }
14007|       |
14008|       |      // If url's scheme is "file" and its host is an empty host, then return.
14009|       |      // An empty host is the empty string.
14010|       |      if (type == ada::scheme::type::FILE &&
14011|       |          components.host_start == components.host_end) {
14012|       |        return false;
14013|       |      }
14014|       |    }
14015|       |
14016|  12.1k|    type = parsed_type;
14017|  12.1k|    set_scheme_from_view_with_colon(input_with_colon);
14018|       |
14019|       |    if constexpr (has_state_override) {
14020|       |      // This is uncommon.
14021|       |      uint16_t urls_scheme_port = get_special_port();
14022|       |
14023|       |      if (urls_scheme_port) {
14024|       |        // If url's port is url's scheme's default port, then set url's port to
14025|       |        // null.
14026|       |        if (components.port == urls_scheme_port) {
14027|       |          clear_port();
14028|       |        }
14029|       |      }
14030|       |    }
14031|  12.1k|  } else {  // slow path
14032|      0|    std::string _buffer(input);
14033|       |    // Next function is only valid if the input is ASCII and returns false
14034|       |    // otherwise, but it seems that we always have ascii content so we do not
14035|       |    // need to check the return value.
14036|      0|    unicode::to_lower_ascii(_buffer.data(), _buffer.size());
14037|       |
14038|       |    if constexpr (has_state_override) {
14039|       |      // The state-override validation errors below ("return" in the WHATWG URL
14040|       |      // parser) leave the URL unchanged. The setter contract is
14041|       |      // "true on success, false if the scheme is invalid" -- the fast path
14042|       |      // above already returns false here, so the slow path must agree.
14043|       |
14044|       |      // If url's scheme is a special scheme and buffer is not a special scheme,
14045|       |      // then return. If url's scheme is not a special scheme and buffer is a
14046|       |      // special scheme, then return.
14047|       |      if (is_special() != ada::scheme::is_special(_buffer)) {
14048|       |        return false;
14049|       |      }
14050|       |
14051|       |      // If url includes credentials or has a non-null port, and buffer is
14052|       |      // "file", then return.
14053|       |      if ((has_credentials() || components.port != url_components::omitted) &&
14054|       |          _buffer == "file") {
14055|       |        return false;
14056|       |      }
14057|       |
14058|       |      // If url's scheme is "file" and its host is an empty host, then return.
14059|       |      // An empty host is the empty string.
14060|       |      if (type == ada::scheme::type::FILE &&
14061|       |          components.host_start == components.host_end) {
14062|       |        return false;
14063|       |      }
14064|       |    }
14065|       |
14066|      0|    set_scheme(_buffer);
14067|       |
14068|       |    if constexpr (has_state_override) {
14069|       |      // This is uncommon.
14070|       |      uint16_t urls_scheme_port = get_special_port();
14071|       |
14072|       |      if (urls_scheme_port) {
14073|       |        // If url's port is url's scheme's default port, then set url's port to
14074|       |        // null.
14075|       |        if (components.port == urls_scheme_port) {
14076|       |          clear_port();
14077|       |        }
14078|       |      }
14079|       |    }
14080|      0|  }
14081|  12.1k|  ADA_ASSERT_TRUE(validate());
14082|  12.1k|  return true;
14083|  12.1k|}
_ZN3ada14url_aggregator31set_scheme_from_view_with_colonENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
14107|  12.1k|    std::string_view new_scheme_with_colon) {
14108|  12.1k|  ada_log("url_aggregator::set_scheme_from_view_with_colon ",
14109|  12.1k|          new_scheme_with_colon);
14110|  12.1k|  ADA_ASSERT_TRUE(validate());
14111|  12.1k|  ADA_ASSERT_TRUE(!new_scheme_with_colon.empty() &&
14112|  12.1k|                  new_scheme_with_colon.back() == ':');
14113|       |  // next line could overflow but unsigned arithmetic has well-defined
14114|       |  // overflows.
14115|  12.1k|  uint32_t new_difference =
14116|  12.1k|      uint32_t(new_scheme_with_colon.size()) - components.protocol_end;
14117|       |
14118|  12.1k|  if (buffer.empty()) {
  ------------------
  |  Branch (14118:7): [True: 12.1k, False: 0]
  ------------------
14119|  12.1k|    buffer.append(new_scheme_with_colon);
14120|  12.1k|  } else {
14121|      0|    buffer.erase(0, components.protocol_end);
14122|      0|    buffer.insert(0, new_scheme_with_colon);
14123|      0|  }
14124|  12.1k|  components.protocol_end += new_difference;
14125|       |
14126|  12.1k|  apply_shifted_non_scheme_offsets(components, new_difference);
14127|  12.1k|  ADA_ASSERT_TRUE(validate());
14128|  12.1k|}

_ZN3ada37url_pattern_compile_component_optionsC2ENSt3__18optionalIcEES3_:
 5868|      6|      : delimiter(new_delimiter), prefix(new_prefix) {}
_ZN3ada14character_sets6bit_atEPKhh:
 1085|   241k|ada_really_inline constexpr bool bit_at(const uint8_t a[], const uint8_t i) {
 1086|   241k|  return !!(a[i >> 3] & (1 << (i & 7)));
 1087|   241k|}
_ZN2tl10unexpectedIN3ada6errorsEEC2EOS2_:
 2215|  21.7k|  constexpr explicit unexpected(E&& e) : m_val(std::move(e)) {}
_ZNR2tl10unexpectedIN3ada6errorsEE5valueEv:
 2229|  10.8k|  TL_EXPECTED_11_CONSTEXPR E& value() & { return m_val; }
_ZN3ada8url_baseD2Ev:
 1711|  15.9k|  virtual ~url_base() = default;
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEC2IS3_TnPNSt3__19enable_ifIXsr3std16is_constructibleIS3_OT_EE5valueEvE4typeELPv0ETnPNS7_IXsr3std14is_convertibleIS9_S3_EE5valueEvE4typeELSD_0EEEONS_10unexpectedIS8_EE:
 3701|  10.8k|      : impl_base(unexpect, std::move(e.value())),
 3702|  10.8k|        ctor_base(detail::default_constructor_tag{}) {}
_ZN2tl6detail21expected_storage_baseIN3ada14url_aggregatorENS2_6errorsELb0ELb1EEC2IJS4_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS4_DpOT_EE5valueEvE4typeELPv0EEENS_10unexpect_tESB_:
 2687|  10.8k|      : m_unexpect(std::forward<Args>(args)...), m_has_val(false) {}
_ZN2tl6detail26expected_default_ctor_baseIN3ada14url_aggregatorENS2_6errorsELb1EEC2ENS0_23default_constructor_tagE:
 3305|  13.4k|  constexpr explicit expected_default_ctor_base(default_constructor_tag) {}
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEC2IS2_TnPNSt3__19enable_ifIXsr3std14is_convertibleIOT_S2_EE5valueEvE4typeELPv0ETnPNS7_IXaaaaaasr3std16is_constructibleIS2_S9_EE5valuentsr3std7is_sameINS6_5decayIS8_E4typeENS_10in_place_tEEE5valuentsr3std7is_sameIS4_SG_EE5valuentsr3std7is_sameINS_10unexpectedIS3_EESG_EE5valueEvE4typeELSD_0EEES9_:
 3787|  2.52k|      : expected(in_place, std::forward<U>(v)) {}
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEC2IJS2_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS2_DpOT_EE5valueEvE4typeELPv0EEENS_10in_place_tESA_:
 3660|  2.52k|      : impl_base(in_place, std::forward<Args>(args)...),
 3661|  2.52k|        ctor_base(detail::default_constructor_tag{}) {}
_ZN2tl6detail21expected_storage_baseIN3ada14url_aggregatorENS2_6errorsELb0ELb1EEC2IJS3_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS3_DpOT_EE5valueEvE4typeELPv0EEENS_10in_place_tESB_:
 2675|  2.52k|      : m_val(std::forward<Args>(args)...), m_has_val(true) {}
_ZN3ada14url_aggregatorC2EOS0_:
 7921|  2.52k|  url_aggregator(url_aggregator&& u) noexcept = default;
_ZN3ada14url_aggregatorD2Ev:
 7924|  15.9k|  ~url_aggregator() override = default;
_ZN3ada6scheme15get_scheme_typeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6922|  12.1k|constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept {
 6923|  12.1k|  if (scheme.empty()) {
  ------------------
  |  Branch (6923:7): [True: 0, False: 12.1k]
  ------------------
 6924|      0|    return ada::scheme::NOT_SPECIAL;
 6925|      0|  }
 6926|  12.1k|  int hash_value = (2 * scheme.size() + (unsigned)(scheme[0])) & 7;
 6927|  12.1k|  const std::string_view target = details::is_special_list[hash_value];
 6928|  12.1k|  if (scheme.size() == target.size() &&
  ------------------
  |  Branch (6928:7): [True: 12.1k, False: 0]
  ------------------
 6929|  12.1k|      details::branchless_load5(scheme.data(), scheme.size()) ==
  ------------------
  |  Branch (6929:7): [True: 12.1k, False: 0]
  ------------------
 6930|  12.1k|          details::scheme_keys[hash_value]) {
 6931|  12.1k|    return ada::scheme::type(hash_value);
 6932|  12.1k|  } else {
 6933|      0|    return ada::scheme::NOT_SPECIAL;
 6934|      0|  }
 6935|  12.1k|}
_ZN3ada6scheme7details16branchless_load5EPKcm:
 6863|  12.1k|inline uint64_t branchless_load5(const char* p, size_t n) {
 6864|  12.1k|  uint64_t input = (uint8_t)p[0];
 6865|  12.1k|  input |= ((uint64_t)(uint8_t)p[n > 1] << 8) & (0 - (uint64_t)(n > 1));
 6866|  12.1k|  input |= ((uint64_t)(uint8_t)p[(n > 2) * 2] << 16) & (0 - (uint64_t)(n > 2));
 6867|  12.1k|  input |= ((uint64_t)(uint8_t)p[(n > 3) * 3] << 24) & (0 - (uint64_t)(n > 3));
 6868|  12.1k|  input |= ((uint64_t)(uint8_t)p[(n > 4) * 4] << 32) & (0 - (uint64_t)(n > 4));
 6869|  12.1k|  return input;
 6870|  12.1k|}
_ZN3ada14url_aggregatorC2Ev:
 7919|  13.4k|  url_aggregator() = default;
_ZN3ada14url_componentsC2Ev:
 5016|  13.4k|  url_components() = default;
_ZN3ada8checkers19try_parse_ipv4_fastENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1459|  14.4k|try_parse_ipv4_fast(std::string_view input) noexcept {
 1460|  14.4k|  const size_t len = input.size();
 1461|       |  // Shortest pure decimal: "0.0.0.0" (7). Longest + trailing dot: 16.
 1462|  14.4k|  if (len < 7 || len > 16) [[unlikely]] {
  ------------------
  |  Branch (1462:7): [True: 9.73k, False: 4.67k]
  |  Branch (1462:18): [True: 1.90k, False: 2.76k]
  ------------------
 1463|  11.6k|    return ipv4_fast_fail;
 1464|  11.6k|  }
 1465|  2.76k|  const char* data = input.data();
 1466|       |
 1467|       |#if defined(ADA_AVX512) && defined(__AVX512VBMI2__)
 1468|       |  return detail::try_parse_ipv4_avx512(data, len);
 1469|       |#else
 1470|  2.76k|  return detail::parse_ipv4_decimal_scalar(data, data + len);
 1471|  14.4k|#endif
 1472|  14.4k|}
_ZN3ada8checkers6detail25parse_ipv4_decimal_scalarEPKcS3_:
 1300|  2.76k|parse_ipv4_decimal_scalar(const char* p, const char* pend) noexcept {
 1301|  2.76k|  uint32_t ipv4 = 0;
 1302|  4.91k|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (1302:19): [True: 4.42k, False: 483]
  ------------------
 1303|  4.42k|    if (p == pend) [[unlikely]] {
  ------------------
  |  Branch (1303:9): [True: 3, False: 4.42k]
  ------------------
 1304|      3|      return ipv4_fast_fail;
 1305|      3|    }
 1306|  4.42k|    uint32_t val;
 1307|  4.42k|    char c = *p;
 1308|  4.42k|    if (c >= '0' && c <= '9') [[likely]] {
  ------------------
  |  Branch (1308:9): [True: 3.78k, False: 641]
  |  Branch (1308:21): [True: 2.67k, False: 1.11k]
  ------------------
 1309|  2.67k|      val = static_cast<uint32_t>(c - '0');
 1310|  2.67k|      ++p;
 1311|  2.67k|    } else {
 1312|  1.75k|      return ipv4_fast_fail;
 1313|  1.75k|    }
 1314|  2.67k|    if (p < pend) {
  ------------------
  |  Branch (1314:9): [True: 2.46k, False: 210]
  ------------------
 1315|  2.46k|      c = *p;
 1316|  2.46k|      if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (1316:11): [True: 1.51k, False: 953]
  |  Branch (1316:23): [True: 1.31k, False: 193]
  ------------------
 1317|  1.31k|        if (val == 0) [[unlikely]] {
  ------------------
  |  Branch (1317:13): [True: 75, False: 1.24k]
  ------------------
 1318|     75|          return ipv4_fast_fail;
 1319|     75|        }
 1320|  1.24k|        val = val * 10u + static_cast<uint32_t>(c - '0');
 1321|  1.24k|        ++p;
 1322|  1.24k|        if (p < pend) {
  ------------------
  |  Branch (1322:13): [True: 1.10k, False: 134]
  ------------------
 1323|  1.10k|          c = *p;
 1324|  1.10k|          if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (1324:15): [True: 782, False: 327]
  |  Branch (1324:27): [True: 767, False: 15]
  ------------------
 1325|    767|            val = val * 10u + static_cast<uint32_t>(c - '0');
 1326|    767|            ++p;
 1327|    767|            if (val > 255u) [[unlikely]] {
  ------------------
  |  Branch (1327:17): [True: 134, False: 633]
  ------------------
 1328|    134|              return ipv4_fast_fail;
 1329|    134|            }
 1330|    767|          }
 1331|  1.10k|        }
 1332|  1.24k|      }
 1333|  2.46k|    }
 1334|  2.46k|    ipv4 = (ipv4 << 8) | val;
 1335|  2.46k|    if (i < 3) {
  ------------------
  |  Branch (1335:9): [True: 1.98k, False: 483]
  ------------------
 1336|  1.98k|      if (p == pend || *p != '.') [[unlikely]] {
  ------------------
  |  Branch (1336:11): [True: 44, False: 1.93k]
  |  Branch (1336:24): [True: 270, False: 1.66k]
  ------------------
 1337|    314|        return ipv4_fast_fail;
 1338|    314|      }
 1339|  1.66k|      ++p;
 1340|  1.66k|    }
 1341|  2.46k|  }
 1342|    483|  if (p != pend) {
  ------------------
  |  Branch (1342:7): [True: 45, False: 438]
  ------------------
 1343|     45|    if (p == pend - 1 && *p == '.') {
  ------------------
  |  Branch (1343:9): [True: 20, False: 25]
  |  Branch (1343:26): [True: 4, False: 16]
  ------------------
 1344|      4|      return ipv4;
 1345|      4|    }
 1346|     41|    return ipv4_fast_fail;
 1347|     45|  }
 1348|    438|  return ipv4;
 1349|    483|}
_ZNK3ada8url_base10is_specialEv:
 7410|  46.1k|    const noexcept {
 7411|  46.1k|  return type != ada::scheme::NOT_SPECIAL;
 7412|  46.1k|}
_ZN3ada8checkers8is_alphaEc:
 1280|  18.3k|constexpr bool is_alpha(char x) noexcept {
 1281|  18.3k|  return (to_lower(x) >= 'a') && (to_lower(x) <= 'z');
  ------------------
  |  Branch (1281:10): [True: 14.8k, False: 3.57k]
  |  Branch (1281:34): [True: 14.5k, False: 252]
  ------------------
 1282|  18.3k|}
_ZN3ada8checkers8to_lowerEc:
 1278|  33.1k|constexpr char to_lower(char x) noexcept { return (x | 0x20); }
_ZN3ada8checkers26last_label_may_be_a_numberENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1253|  11.2k|constexpr bool last_label_may_be_a_number(std::string_view view) noexcept {
 1254|  11.2k|  if (view.empty()) {
  ------------------
  |  Branch (1254:7): [True: 0, False: 11.2k]
  ------------------
 1255|      0|    return false;
 1256|      0|  }
 1257|  11.2k|  const char* start = view.data();
 1258|  11.2k|  const char* end = start + view.size();
 1259|  11.2k|  if (end[-1] == '.') {
  ------------------
  |  Branch (1259:7): [True: 443, False: 10.8k]
  ------------------
 1260|    443|    --end;
 1261|    443|    if (end == start) {
  ------------------
  |  Branch (1261:9): [True: 258, False: 185]
  ------------------
 1262|    258|      return false;
 1263|    258|    }
 1264|    443|  }
 1265|  11.0k|  if (!is_ipv4_number_char(end[-1])) {
  ------------------
  |  Branch (1265:7): [True: 1.38k, False: 9.64k]
  ------------------
 1266|  1.38k|    return false;
 1267|  1.38k|  }
 1268|  9.64k|  const char* label = end;
 1269|  34.4k|  while (label != start && is_ipv4_number_char(label[-1])) {
  ------------------
  |  Branch (1269:10): [True: 32.9k, False: 1.46k]
  |  Branch (1269:28): [True: 24.7k, False: 8.17k]
  ------------------
 1270|  24.7k|    --label;
 1271|  24.7k|  }
 1272|  9.64k|  if (label != start && label[-1] != '.') {
  ------------------
  |  Branch (1272:7): [True: 8.17k, False: 1.46k]
  |  Branch (1272:25): [True: 303, False: 7.87k]
  ------------------
 1273|    303|    return false;
 1274|    303|  }
 1275|  9.34k|  return label != end && is_digit(*label);
  ------------------
  |  Branch (1275:10): [True: 9.34k, False: 0]
  |  Branch (1275:26): [True: 8.79k, False: 546]
  ------------------
 1276|  9.64k|}
_ZN3ada8checkers19is_ipv4_number_charEc:
 1247|  44.0k|constexpr bool is_ipv4_number_char(char x) noexcept {
 1248|  44.0k|  const unsigned char c = static_cast<unsigned char>(x);
 1249|  44.0k|  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') ||
  ------------------
  |  Branch (1249:11): [True: 35.7k, False: 8.28k]
  |  Branch (1249:23): [True: 25.9k, False: 9.74k]
  |  Branch (1249:37): [True: 9.11k, False: 8.90k]
  |  Branch (1249:49): [True: 5.49k, False: 3.61k]
  ------------------
 1250|  12.5k|         (c >= 'A' && c <= 'F') || c == 'x' || c == 'X';
  ------------------
  |  Branch (1250:11): [True: 4.15k, False: 8.37k]
  |  Branch (1250:23): [True: 244, False: 3.90k]
  |  Branch (1250:36): [True: 2.49k, False: 9.78k]
  |  Branch (1250:48): [True: 217, False: 9.56k]
  ------------------
 1251|  44.0k|}
_ZN3ada8checkers8is_digitEc:
 1245|  23.8k|constexpr bool is_digit(char x) noexcept { return (x >= '0') & (x <= '9'); }
_ZN3ada6scheme16get_special_portENS0_4typeE:
 6919|    574|constexpr uint16_t get_special_port(ada::scheme::type type) noexcept {
 6920|    574|  return details::special_ports[int(type)];
 6921|    574|}
_ZN3ada14url_aggregator20update_base_pathnameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8652|  1.37k|inline void url_aggregator::update_base_pathname(const std::string_view input) {
 8653|  1.37k|  ada_log("url_aggregator::update_base_pathname '", input, "' [", input.size(),
 8654|  1.37k|          " bytes] \n", to_diagram());
 8655|  1.37k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8656|  1.37k|  ADA_ASSERT_TRUE(validate());
 8657|       |
 8658|  1.37k|  const bool begins_with_dashdash = input.starts_with("//");
 8659|  1.37k|  if (!begins_with_dashdash && has_dash_dot()) {
  ------------------
  |  Branch (8659:7): [True: 1.18k, False: 184]
  |  Branch (8659:32): [True: 0, False: 1.18k]
  ------------------
 8660|       |    // We must delete the ./
 8661|      0|    delete_dash_dot();
 8662|      0|  }
 8663|       |
 8664|  1.37k|  if (begins_with_dashdash && !has_opaque_path && !has_authority() &&
  ------------------
  |  Branch (8664:7): [True: 184, False: 1.18k]
  |  Branch (8664:31): [True: 184, False: 0]
  |  Branch (8664:51): [True: 0, False: 184]
  ------------------
 8665|      0|      !has_dash_dot()) {
  ------------------
  |  Branch (8665:7): [True: 0, False: 0]
  ------------------
 8666|       |    // If url's host is null, url does not have an opaque path, url's path's
 8667|       |    // size is greater than 1, then append U+002F (/) followed by U+002E (.) to
 8668|       |    // output.
 8669|      0|    buffer.insert(components.pathname_start, "/.");
 8670|      0|    components.pathname_start += 2;
 8671|      0|    if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8671:9): [True: 0, False: 0]
  ------------------
 8672|      0|      components.search_start += 2;
 8673|      0|    }
 8674|      0|    if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8674:9): [True: 0, False: 0]
  ------------------
 8675|      0|      components.hash_start += 2;
 8676|      0|    }
 8677|      0|  }
 8678|       |
 8679|  1.37k|  uint32_t difference = replace_and_resize(
 8680|  1.37k|      components.pathname_start,
 8681|  1.37k|      components.pathname_start + get_pathname_length(), input);
 8682|  1.37k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8682:7): [True: 0, False: 1.37k]
  ------------------
 8683|      0|    components.search_start += difference;
 8684|      0|  }
 8685|  1.37k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8685:7): [True: 0, False: 1.37k]
  ------------------
 8686|      0|    components.hash_start += difference;
 8687|      0|  }
 8688|  1.37k|  ADA_ASSERT_TRUE(validate());
 8689|  1.37k|}
_ZN3ada14url_aggregator18replace_and_resizeEjjNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8494|  3.08k|    uint32_t start, uint32_t end, std::string_view input) {
 8495|  3.08k|  uint32_t current_length = end - start;
 8496|  3.08k|  uint32_t input_size = uint32_t(input.size());
 8497|  3.08k|  uint32_t new_difference = input_size - current_length;
 8498|       |
 8499|  3.08k|  if (current_length == 0) {
  ------------------
  |  Branch (8499:7): [True: 2.99k, False: 89]
  ------------------
 8500|  2.99k|    buffer.insert(start, input);
 8501|  2.99k|  } else if (input_size == current_length) {
  ------------------
  |  Branch (8501:14): [True: 8, False: 81]
  ------------------
 8502|      8|    if (input_size != 0) {
  ------------------
  |  Branch (8502:9): [True: 8, False: 0]
  ------------------
 8503|      8|      std::memmove(buffer.data() + start, input.data(), input_size);
 8504|      8|    }
 8505|     81|  } else if (input_size < current_length) {
  ------------------
  |  Branch (8505:14): [True: 0, False: 81]
  ------------------
 8506|      0|    buffer.erase(start, current_length - input_size);
 8507|      0|    buffer.replace(start, input_size, input);
 8508|     81|  } else {
 8509|     81|    buffer.replace(start, current_length, input.substr(0, current_length));
 8510|     81|    buffer.insert(start + current_length, input.substr(current_length));
 8511|     81|  }
 8512|       |
 8513|  3.08k|  return new_difference;
 8514|  3.08k|}
_ZNK3ada14url_aggregator19get_pathname_lengthEv:
 8545|  1.37k|url_aggregator::get_pathname_length() const noexcept {
 8546|  1.37k|  ada_log("url_aggregator::get_pathname_length");
 8547|  1.37k|  uint32_t ending_index = uint32_t(buffer.size());
 8548|  1.37k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8548:7): [True: 0, False: 1.37k]
  ------------------
 8549|      0|    ending_index = components.search_start;
 8550|  1.37k|  } else if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8550:14): [True: 0, False: 1.37k]
  ------------------
 8551|      0|    ending_index = components.hash_start;
 8552|      0|  }
 8553|  1.37k|  return ending_index - components.pathname_start;
 8554|  1.37k|}
_ZNK3ada14url_aggregator12get_pathnameEv:
 9487|  1.13k|    ada_lifetime_bound {
 9488|  1.13k|  ada_log("url_aggregator::get_pathname pathname_start = ",
 9489|  1.13k|          components.pathname_start, " buffer.size() = ", buffer.size(),
 9490|  1.13k|          " components.search_start = ", components.search_start,
 9491|  1.13k|          " components.hash_start = ", components.hash_start);
 9492|  1.13k|  auto ending_index = uint32_t(buffer.size());
 9493|  1.13k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (9493:7): [True: 0, False: 1.13k]
  ------------------
 9494|      0|    ending_index = components.search_start;
 9495|  1.13k|  } else if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (9495:14): [True: 0, False: 1.13k]
  ------------------
 9496|      0|    ending_index = components.hash_start;
 9497|      0|  }
 9498|  1.13k|  return helpers::substring(buffer, components.pathname_start, ending_index);
 9499|  1.13k|}
_ZN3ada14url_aggregator26update_unencoded_base_hashENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8470|    262|inline void url_aggregator::update_unencoded_base_hash(std::string_view input) {
 8471|    262|  ada_log("url_aggregator::update_unencoded_base_hash ", input, " [",
 8472|    262|          input.size(), " bytes], buffer is '", buffer, "' [", buffer.size(),
 8473|    262|          " bytes] components.hash_start = ", components.hash_start);
 8474|    262|  ADA_ASSERT_TRUE(validate());
 8475|    262|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8476|    262|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8476:7): [True: 0, False: 262]
  ------------------
 8477|      0|    buffer.resize(components.hash_start);
 8478|      0|  }
 8479|    262|  components.hash_start = uint32_t(buffer.size());
 8480|    262|  buffer += "#";
 8481|    262|  bool encoding_required = unicode::percent_encode<true>(
 8482|    262|      input, ada::character_sets::FRAGMENT_PERCENT_ENCODE, buffer);
 8483|       |  // When encoding_required is false, then buffer is left unchanged, and percent
 8484|       |  // encoding was not deemed required.
 8485|    262|  if (!encoding_required) {
  ------------------
  |  Branch (8485:7): [True: 172, False: 90]
  ------------------
 8486|    172|    buffer.append(input);
 8487|    172|  }
 8488|    262|  ada_log("url_aggregator::update_unencoded_base_hash final buffer is '",
 8489|    262|          buffer, "' [", buffer.size(), " bytes]");
 8490|    262|  ADA_ASSERT_TRUE(validate());
 8491|    262|}
_ZNK3ada8url_base19scheme_default_portEv:
 7419|     93|url_base::scheme_default_port() const noexcept {
 7420|     93|  return scheme::get_special_port(type);
 7421|     93|}
_ZN3ada8checkers23is_windows_drive_letterENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1284|  7.11k|constexpr bool is_windows_drive_letter(std::string_view input) noexcept {
 1285|  7.11k|  return input.size() >= 2 &&
  ------------------
  |  Branch (1285:10): [True: 6.17k, False: 939]
  ------------------
 1286|  6.17k|         (is_alpha(input[0]) && ((input[1] == ':') || (input[1] == '|'))) &&
  ------------------
  |  Branch (1286:11): [True: 2.42k, False: 3.74k]
  |  Branch (1286:34): [True: 453, False: 1.97k]
  |  Branch (1286:55): [True: 2, False: 1.97k]
  ------------------
 1287|    455|         ((input.size() == 2) || (input[2] == '/' || input[2] == '\\' ||
  ------------------
  |  Branch (1287:11): [True: 2, False: 453]
  |  Branch (1287:35): [True: 206, False: 247]
  |  Branch (1287:54): [True: 1, False: 246]
  ------------------
 1288|    246|                                  input[2] == '?' || input[2] == '#'));
  ------------------
  |  Branch (1288:35): [True: 39, False: 207]
  |  Branch (1288:54): [True: 30, False: 177]
  ------------------
 1289|  7.11k|}
_ZN3ada8checkers34is_normalized_windows_drive_letterENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1292|  7.11k|    std::string_view input) noexcept {
 1293|  7.11k|  return input.size() == 2 && (is_alpha(input[0]) && (input[1] == ':'));
  ------------------
  |  Branch (1293:10): [True: 101, False: 7.01k]
  |  Branch (1293:32): [True: 27, False: 74]
  |  Branch (1293:54): [True: 1, False: 26]
  ------------------
 1294|  7.11k|}
_ZN3ada7helpers14leading_zeroesEj:
 2000|  12.2k|inline int leading_zeroes(uint32_t input_num) noexcept {
 2001|       |#if ADA_REGULAR_VISUAL_STUDIO
 2002|       |  unsigned long leading_zero(0);
 2003|       |  unsigned long in(input_num);
 2004|       |  return _BitScanReverse(&leading_zero, in) ? int(31 - leading_zero) : 32;
 2005|       |#else
 2006|  12.2k|  return __builtin_clz(input_num);
 2007|  12.2k|#endif  // ADA_REGULAR_VISUAL_STUDIO
 2008|  12.2k|}
_ZN3ada14url_aggregator7reserveEj:
 9160|  12.1k|constexpr void ada::url_aggregator::reserve(uint32_t capacity) {
 9161|  12.1k|  buffer.reserve(capacity);
 9162|  12.1k|}
_ZN3ada14url_aggregator20append_base_passwordENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8878|    928|inline void url_aggregator::append_base_password(const std::string_view input) {
 8879|    928|  ada_log("url_aggregator::append_base_password ", input, " ", to_string(),
 8880|    928|          "\n", to_diagram());
 8881|    928|  ADA_ASSERT_TRUE(validate());
 8882|    928|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8883|       |#if ADA_DEVELOPMENT_CHECKS
 8884|       |  // computing the expected password.
 8885|       |  std::string password_expected = std::string(get_password());
 8886|       |  password_expected.append(input);
 8887|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8888|    928|  add_authority_slashes_if_needed();
 8889|       |
 8890|       |  // If input is empty, do nothing.
 8891|    928|  if (input.empty()) {
  ------------------
  |  Branch (8891:7): [True: 390, False: 538]
  ------------------
 8892|    390|    return;
 8893|    390|  }
 8894|       |
 8895|    538|  uint32_t difference = uint32_t(input.size());
 8896|    538|  if (has_password()) {
  ------------------
  |  Branch (8896:7): [True: 480, False: 58]
  ------------------
 8897|    480|    buffer.insert(components.host_start, input);
 8898|    480|  } else {
 8899|     58|    difference++;  // Increment for ":"
 8900|     58|    buffer.insert(components.username_end, ":");
 8901|     58|    buffer.insert(components.username_end + 1, input);
 8902|     58|  }
 8903|    538|  components.host_start += difference;
 8904|       |
 8905|       |  // The following line is required to add "@" to hostname. When updating
 8906|       |  // password if hostname does not start with "@", it is "append_base_password"s
 8907|       |  // responsibility to set it.
 8908|    538|  if (buffer[components.host_start] != '@') {
  ------------------
  |  Branch (8908:7): [True: 40, False: 498]
  ------------------
 8909|     40|    buffer.insert(components.host_start, "@");
 8910|     40|    difference++;
 8911|     40|  }
 8912|       |
 8913|    538|  components.host_end += difference;
 8914|    538|  components.pathname_start += difference;
 8915|    538|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8915:7): [True: 0, False: 538]
  ------------------
 8916|      0|    components.search_start += difference;
 8917|      0|  }
 8918|    538|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8918:7): [True: 0, False: 538]
  ------------------
 8919|      0|    components.hash_start += difference;
 8920|      0|  }
 8921|       |#if ADA_DEVELOPMENT_CHECKS
 8922|       |  std::string password_after(get_password());
 8923|       |  ADA_ASSERT_EQUAL(
 8924|       |      password_expected, password_after,
 8925|       |      "append_base_password problem after inserting " + std::string(input));
 8926|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8927|    538|  ADA_ASSERT_TRUE(validate());
 8928|    538|}
_ZN3ada14url_aggregator31add_authority_slashes_if_neededEv:
 9134|  5.09k|inline void ada::url_aggregator::add_authority_slashes_if_needed() {
 9135|  5.09k|  ada_log("url_aggregator::add_authority_slashes_if_needed");
 9136|  5.09k|  ADA_ASSERT_TRUE(validate());
 9137|       |  // Protocol setter will insert `http:` to the URL. It is up to hostname setter
 9138|       |  // to insert
 9139|       |  // `//` initially to the buffer, since it depends on the hostname existence.
 9140|  5.09k|  if (has_authority()) {
  ------------------
  |  Branch (9140:7): [True: 3.24k, False: 1.84k]
  ------------------
 9141|  3.24k|    return;
 9142|  3.24k|  }
 9143|       |  // Performance: the common case is components.protocol_end == buffer.size()
 9144|       |  // Optimization opportunity: in many cases, the "//" is part of the input and
 9145|       |  // the insert could be fused with another insert.
 9146|  1.84k|  buffer.insert(components.protocol_end, "//");
 9147|  1.84k|  components.username_end += 2;
 9148|  1.84k|  components.host_start += 2;
 9149|  1.84k|  components.host_end += 2;
 9150|  1.84k|  components.pathname_start += 2;
 9151|  1.84k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (9151:7): [True: 0, False: 1.84k]
  ------------------
 9152|      0|    components.search_start += 2;
 9153|      0|  }
 9154|  1.84k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (9154:7): [True: 0, False: 1.84k]
  ------------------
 9155|      0|    components.hash_start += 2;
 9156|      0|  }
 9157|  1.84k|  ADA_ASSERT_TRUE(validate());
 9158|  1.84k|}
_ZN3ada14url_aggregator20append_base_usernameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8762|  2.44k|inline void url_aggregator::append_base_username(const std::string_view input) {
 8763|  2.44k|  ada_log("url_aggregator::append_base_username ", input);
 8764|  2.44k|  ADA_ASSERT_TRUE(validate());
 8765|  2.44k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8766|       |#if ADA_DEVELOPMENT_CHECKS
 8767|       |  // computing the expected password.
 8768|       |  std::string username_expected(get_username());
 8769|       |  username_expected.append(input);
 8770|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8771|  2.44k|  add_authority_slashes_if_needed();
 8772|       |
 8773|       |  // If input is empty, do nothing.
 8774|  2.44k|  if (input.empty()) {
  ------------------
  |  Branch (8774:7): [True: 1.07k, False: 1.36k]
  ------------------
 8775|  1.07k|    return;
 8776|  1.07k|  }
 8777|       |
 8778|  1.36k|  uint32_t difference = uint32_t(input.size());
 8779|  1.36k|  buffer.insert(components.username_end, input);
 8780|  1.36k|  components.username_end += difference;
 8781|  1.36k|  components.host_start += difference;
 8782|       |
 8783|  1.36k|  if (buffer[components.host_start] != '@' &&
  ------------------
  |  Branch (8783:7): [True: 168, False: 1.19k]
  ------------------
 8784|    168|      components.host_start != components.host_end) {
  ------------------
  |  Branch (8784:7): [True: 168, False: 0]
  ------------------
 8785|    168|    buffer.insert(components.host_start, "@");
 8786|    168|    difference++;
 8787|    168|  }
 8788|       |
 8789|  1.36k|  components.host_end += difference;
 8790|  1.36k|  components.pathname_start += difference;
 8791|  1.36k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8791:7): [True: 0, False: 1.36k]
  ------------------
 8792|      0|    components.search_start += difference;
 8793|      0|  }
 8794|  1.36k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8794:7): [True: 0, False: 1.36k]
  ------------------
 8795|      0|    components.hash_start += difference;
 8796|      0|  }
 8797|       |#if ADA_DEVELOPMENT_CHECKS
 8798|       |  std::string username_after(get_username());
 8799|       |  ADA_ASSERT_EQUAL(
 8800|       |      username_expected, username_after,
 8801|       |      "append_base_username problem after inserting " + std::string(input));
 8802|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8803|  1.36k|  ADA_ASSERT_TRUE(validate());
 8804|  1.36k|}
_ZN3ada14url_aggregator16update_base_portEj:
 8930|     48|inline void url_aggregator::update_base_port(uint32_t input) {
 8931|     48|  ada_log("url_aggregator::update_base_port");
 8932|     48|  ADA_ASSERT_TRUE(validate());
 8933|     48|  if (input == url_components::omitted) {
  ------------------
  |  Branch (8933:7): [True: 0, False: 48]
  ------------------
 8934|      0|    clear_port();
 8935|      0|    return;
 8936|      0|  }
 8937|       |  // calling std::to_string(input.value()) is unfortunate given that the port
 8938|       |  // value is probably already available as a string.
 8939|     48|  std::string value = helpers::concat(":", std::to_string(input));
 8940|     48|  uint32_t difference = uint32_t(value.size());
 8941|       |
 8942|     48|  if (components.port != url_components::omitted) {
  ------------------
  |  Branch (8942:7): [True: 0, False: 48]
  ------------------
 8943|      0|    difference -= components.pathname_start - components.host_end;
 8944|      0|    buffer.erase(components.host_end,
 8945|      0|                 components.pathname_start - components.host_end);
 8946|      0|  }
 8947|       |
 8948|     48|  buffer.insert(components.host_end, value);
 8949|     48|  components.pathname_start += difference;
 8950|     48|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8950:7): [True: 0, False: 48]
  ------------------
 8951|      0|    components.search_start += difference;
 8952|      0|  }
 8953|     48|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8953:7): [True: 0, False: 48]
  ------------------
 8954|      0|    components.hash_start += difference;
 8955|      0|  }
 8956|     48|  components.port = input;
 8957|     48|  ADA_ASSERT_TRUE(validate());
 8958|     48|}
_ZN3ada7helpers6concatIJPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEESA_DpT_:
 1990|     48|std::string concat(Args... args) {
 1991|     48|  std::string answer;
 1992|     48|  inner_concat(answer, args...);
 1993|     48|  return answer;
 1994|     48|}
_ZN3ada7helpers12inner_concatIPKcJNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEEvRSA_T_DpT0_:
 1979|     48|inline void inner_concat(std::string& buffer, T t, Args... args) {
 1980|     48|  buffer.append(t);
 1981|     48|  return inner_concat(buffer, args...);
 1982|     48|}
_ZN3ada7helpers12inner_concatINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEJEEEvRS8_T_:
 1971|     48|inline void inner_concat(std::string& buffer, T t) {
 1972|     48|  buffer.append(t);
 1973|     48|}
_ZN3ada14url_aggregator18update_base_searchENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKh:
 8601|    629|    std::string_view input, const uint8_t query_percent_encode_set[]) {
 8602|    629|  ada_log("url_aggregator::update_base_search ", input,
 8603|    629|          " with encoding parameter ", to_string(), "\n", to_diagram());
 8604|    629|  ADA_ASSERT_TRUE(validate());
 8605|    629|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8606|       |
 8607|    629|  if (components.hash_start == url_components::omitted) {
  ------------------
  |  Branch (8607:7): [True: 629, False: 0]
  ------------------
 8608|    629|    if (components.search_start == url_components::omitted) {
  ------------------
  |  Branch (8608:9): [True: 629, False: 0]
  ------------------
 8609|    629|      components.search_start = uint32_t(buffer.size());
 8610|    629|      buffer += "?";
 8611|    629|    } else {
 8612|      0|      buffer.resize(components.search_start + 1);
 8613|      0|    }
 8614|       |
 8615|    629|    bool encoding_required =
 8616|    629|        unicode::percent_encode<true>(input, query_percent_encode_set, buffer);
 8617|       |    // When encoding_required is false, then buffer is left unchanged, and
 8618|       |    // percent encoding was not deemed required.
 8619|    629|    if (!encoding_required) {
  ------------------
  |  Branch (8619:9): [True: 485, False: 144]
  ------------------
 8620|    485|      buffer.append(input);
 8621|    485|    }
 8622|    629|  } else {
 8623|      0|    const size_t idx =
 8624|      0|        ada::unicode::percent_encode_index(input, query_percent_encode_set);
 8625|      0|    std::string encoded;
 8626|      0|    std::string_view replacement = input;
 8627|      0|    if (idx != input.size()) {
  ------------------
  |  Branch (8627:9): [True: 0, False: 0]
  ------------------
 8628|      0|      encoded =
 8629|      0|          ada::unicode::percent_encode(input, query_percent_encode_set, idx);
 8630|      0|      replacement = encoded;
 8631|      0|    }
 8632|       |
 8633|      0|    if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8633:9): [True: 0, False: 0]
  ------------------
 8634|      0|      const uint32_t difference = replace_and_resize(
 8635|      0|          components.search_start + 1, components.hash_start, replacement);
 8636|      0|      components.hash_start += difference;
 8637|      0|    } else {
 8638|      0|      components.search_start = components.hash_start;
 8639|      0|      buffer.insert(components.search_start, replacement.size() + 1, '?');
 8640|      0|      if (!replacement.empty()) {
  ------------------
  |  Branch (8640:11): [True: 0, False: 0]
  ------------------
 8641|      0|        std::memmove(buffer.data() + components.search_start + 1,
 8642|      0|                     replacement.data(), replacement.size());
 8643|      0|      }
 8644|      0|      components.hash_start +=
 8645|      0|          uint32_t(replacement.size() + 1);  // Do not forget `?`
 8646|      0|    }
 8647|      0|  }
 8648|       |
 8649|    629|  ADA_ASSERT_TRUE(validate());
 8650|    629|}
_ZN3ada14url_aggregator20update_base_hostnameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8516|  1.71k|inline void url_aggregator::update_base_hostname(const std::string_view input) {
 8517|  1.71k|  ada_log("url_aggregator::update_base_hostname ", input, " [", input.size(),
 8518|  1.71k|          " bytes], buffer is '", buffer, "' [", buffer.size(), " bytes]");
 8519|  1.71k|  ADA_ASSERT_TRUE(validate());
 8520|  1.71k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8521|       |
 8522|       |  // This next line is required for when parsing a URL like `foo://`
 8523|  1.71k|  add_authority_slashes_if_needed();
 8524|       |
 8525|  1.71k|  bool has_credentials = components.protocol_end + 2 < components.host_start;
 8526|  1.71k|  uint32_t new_difference =
 8527|  1.71k|      replace_and_resize(components.host_start, components.host_end, input);
 8528|       |
 8529|  1.71k|  if (has_credentials) {
  ------------------
  |  Branch (8529:7): [True: 89, False: 1.62k]
  ------------------
 8530|     89|    buffer.insert(components.host_start, "@");
 8531|     89|    new_difference++;
 8532|     89|  }
 8533|  1.71k|  components.host_end += new_difference;
 8534|  1.71k|  components.pathname_start += new_difference;
 8535|  1.71k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8535:7): [True: 0, False: 1.71k]
  ------------------
 8536|      0|    components.search_start += new_difference;
 8537|      0|  }
 8538|  1.71k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8538:7): [True: 0, False: 1.71k]
  ------------------
 8539|      0|    components.hash_start += new_difference;
 8540|      0|  }
 8541|  1.71k|  ADA_ASSERT_TRUE(validate());
 8542|  1.71k|}
_ZN3ada14url_aggregator10parse_portENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEb:
 9248|    604|url_aggregator::parse_port(std::string_view view, bool check_trailing_content) {
 9249|    604|  ada_log("url_aggregator::parse_port('", view, "') ", view.size());
 9250|    604|  if (!view.empty() && view[0] == '-') {
  ------------------
  |  Branch (9250:7): [True: 594, False: 10]
  |  Branch (9250:24): [True: 1, False: 593]
  ------------------
 9251|      1|    ada_log("parse_port: view[0] == '0' && view.size() > 1");
 9252|      1|    is_valid = false;
 9253|      1|    return 0;
 9254|      1|  }
 9255|    603|  uint16_t parsed_port{};
 9256|    603|  auto r = std::from_chars(view.data(), view.data() + view.size(), parsed_port);
 9257|    603|  if (r.ec == std::errc::result_out_of_range) {
  ------------------
  |  Branch (9257:7): [True: 17, False: 586]
  ------------------
 9258|     17|    ada_log("parse_port: r.ec == std::errc::result_out_of_range");
 9259|     17|    is_valid = false;
 9260|     17|    return 0;
 9261|     17|  }
 9262|    586|  ada_log("parse_port: ", parsed_port);
 9263|    586|  const size_t consumed = size_t(r.ptr - view.data());
 9264|    586|  ada_log("parse_port: consumed ", consumed);
 9265|    586|  if (check_trailing_content) {
  ------------------
  |  Branch (9265:7): [True: 586, False: 0]
  ------------------
 9266|    586|    is_valid &=
 9267|    586|        (consumed == view.size() || view[consumed] == '/' ||
  ------------------
  |  Branch (9267:10): [True: 32, False: 554]
  |  Branch (9267:37): [True: 49, False: 505]
  ------------------
 9268|    505|         view[consumed] == '?' || (is_special() && view[consumed] == '\\'));
  ------------------
  |  Branch (9268:10): [True: 12, False: 493]
  |  Branch (9268:36): [True: 493, False: 0]
  |  Branch (9268:52): [True: 0, False: 493]
  ------------------
 9269|    586|  }
 9270|    586|  ada_log("parse_port: is_valid = ", is_valid);
 9271|    586|  if (is_valid) {
  ------------------
  |  Branch (9271:7): [True: 93, False: 493]
  ------------------
 9272|     93|    ada_log("parse_port", r.ec == std::errc());
 9273|       |    // scheme_default_port can return 0, and we should allow 0 as a base port.
 9274|     93|    auto default_port = scheme_default_port();
 9275|     93|    bool is_port_valid = (default_port == 0 && parsed_port == 0) ||
  ------------------
  |  Branch (9275:27): [True: 0, False: 93]
  |  Branch (9275:48): [True: 0, False: 0]
  ------------------
 9276|     93|                         (default_port != parsed_port);
  ------------------
  |  Branch (9276:26): [True: 92, False: 1]
  ------------------
 9277|     93|    if (r.ec == std::errc() && is_port_valid) {
  ------------------
  |  Branch (9277:9): [True: 49, False: 44]
  |  Branch (9277:32): [True: 48, False: 1]
  ------------------
 9278|     48|      update_base_port(parsed_port);
 9279|     48|    } else {
 9280|     45|      clear_port();
 9281|     45|    }
 9282|     93|  }
 9283|    586|  return consumed;
 9284|    603|}
_ZN3ada7unicode20percent_encode_indexENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKh:
 8368|  7.11k|                                              const uint8_t character_set[]) {
 8369|  7.11k|  const char* data = input.data();
 8370|  7.11k|  const size_t size = input.size();
 8371|       |
 8372|       |  // Process 8 bytes at a time using unrolled loop
 8373|  7.11k|  size_t i = 0;
 8374|  7.50k|  for (; i + 8 <= size; i += 8) {
  ------------------
  |  Branch (8374:10): [True: 589, False: 6.91k]
  ------------------
 8375|    589|    unsigned char chunk[8];
 8376|    589|    std::memcpy(&chunk, data + i,
 8377|    589|                8);  // entices compiler to unconditionally process 8 characters
 8378|       |
 8379|       |    // Check 8 characters at once
 8380|  4.05k|    for (size_t j = 0; j < 8; j++) {
  ------------------
  |  Branch (8380:24): [True: 3.66k, False: 387]
  ------------------
 8381|  3.66k|      if (character_sets::bit_at(character_set, chunk[j])) {
  ------------------
  |  Branch (8381:11): [True: 202, False: 3.46k]
  ------------------
 8382|    202|        return i + j;
 8383|    202|      }
 8384|  3.66k|    }
 8385|    589|  }
 8386|       |
 8387|       |  // Handle remaining bytes
 8388|  7.28k|  for (; i < size; i++) {
  ------------------
  |  Branch (8388:10): [True: 518, False: 6.76k]
  ------------------
 8389|    518|    if (character_sets::bit_at(character_set, data[i])) {
  ------------------
  |  Branch (8389:9): [True: 152, False: 366]
  ------------------
 8390|    152|      return i;
 8391|    152|    }
 8392|    518|  }
 8393|       |
 8394|  6.76k|  return size;
 8395|  6.91k|}
_ZN3ada14url_aggregator10clear_portEv:
 8960|     45|inline void url_aggregator::clear_port() {
 8961|     45|  ada_log("url_aggregator::clear_port");
 8962|     45|  ADA_ASSERT_TRUE(validate());
 8963|     45|  if (components.port == url_components::omitted) {
  ------------------
  |  Branch (8963:7): [True: 45, False: 0]
  ------------------
 8964|     45|    return;
 8965|     45|  }
 8966|      0|  uint32_t length = components.pathname_start - components.host_end;
 8967|      0|  buffer.erase(components.host_end, length);
 8968|      0|  components.pathname_start -= length;
 8969|      0|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8969:7): [True: 0, False: 0]
  ------------------
 8970|      0|    components.search_start -= length;
 8971|      0|  }
 8972|      0|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8972:7): [True: 0, False: 0]
  ------------------
 8973|      0|    components.hash_start -= length;
 8974|      0|  }
 8975|      0|  components.port = url_components::omitted;
 8976|      0|  ADA_ASSERT_TRUE(validate());
 8977|      0|}
_ZNK3ada14url_aggregator13has_authorityEv:
 9125|  5.27k|    const noexcept {
 9126|  5.27k|  ada_log("url_aggregator::has_authority");
 9127|       |  // Performance: instead of doing this potentially expensive check, we could
 9128|       |  // have a boolean in the struct.
 9129|  5.27k|  return components.protocol_end + 2 <= components.host_start &&
  ------------------
  |  Branch (9129:10): [True: 3.42k, False: 1.84k]
  ------------------
 9130|  3.42k|         buffer[components.protocol_end] == '/' &&
  ------------------
  |  Branch (9130:10): [True: 3.42k, False: 0]
  ------------------
 9131|  3.42k|         buffer[components.protocol_end + 1] == '/';
  ------------------
  |  Branch (9131:10): [True: 3.42k, False: 0]
  ------------------
 9132|  5.27k|}
_ZNK3ada14url_aggregator12has_dash_dotEv:
 9205|  1.18k|[[nodiscard]] constexpr bool url_aggregator::has_dash_dot() const noexcept {
 9206|       |  // If url's host is null, url does not have an opaque path, url's path's size
 9207|       |  // is greater than 1, and url's path[0] is the empty string, then append
 9208|       |  // U+002F (/) followed by U+002E (.) to output.
 9209|  1.18k|  ada_log("url_aggregator::has_dash_dot");
 9210|       |#if ADA_DEVELOPMENT_CHECKS
 9211|       |  // If pathname_start and host_end are exactly two characters apart, then we
 9212|       |  // either have a one-digit port such as http://test.com:5?param=1 or else we
 9213|       |  // have a /.: sequence such as "non-spec:/.//". We test that this is the case.
 9214|       |  if (components.pathname_start == components.host_end + 2) {
 9215|       |    ADA_ASSERT_TRUE((buffer[components.host_end] == '/' &&
 9216|       |                     buffer[components.host_end + 1] == '.') ||
 9217|       |                    (buffer[components.host_end] == ':' &&
 9218|       |                     checkers::is_digit(buffer[components.host_end + 1])));
 9219|       |  }
 9220|       |  if (components.pathname_start == components.host_end + 2 &&
 9221|       |      buffer[components.host_end] == '/' &&
 9222|       |      buffer[components.host_end + 1] == '.') {
 9223|       |    ADA_ASSERT_TRUE(components.pathname_start + 1 < buffer.size());
 9224|       |    ADA_ASSERT_TRUE(buffer[components.pathname_start] == '/');
 9225|       |    ADA_ASSERT_TRUE(buffer[components.pathname_start + 1] == '/');
 9226|       |  }
 9227|       |#endif
 9228|       |  // Performance: it should be uncommon for components.pathname_start ==
 9229|       |  // components.host_end + 2 to be true. So we put this check first in the
 9230|       |  // sequence. Most times, we do not have an opaque path. Checking for '/.' is
 9231|       |  // more expensive, but should be uncommon.
 9232|  1.18k|  return components.pathname_start == components.host_end + 2 &&
  ------------------
  |  Branch (9232:10): [True: 19, False: 1.16k]
  ------------------
 9233|     19|         !has_opaque_path && buffer[components.host_end] == '/' &&
  ------------------
  |  Branch (9233:10): [True: 19, False: 0]
  |  Branch (9233:30): [True: 0, False: 19]
  ------------------
 9234|      0|         buffer[components.host_end + 1] == '.';
  ------------------
  |  Branch (9234:10): [True: 0, False: 0]
  ------------------
 9235|  1.18k|}
_ZNK2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEcvbEv:
 4100|  13.4k|  constexpr explicit operator bool() const noexcept { return this->m_has_val; }
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEptEv:
 4069|  2.80k|  TL_EXPECTED_11_CONSTEXPR T* operator->() {
 4070|  2.80k|    TL_ASSERT(has_value());
  ------------------
  |  | 2122|  2.80k|#define TL_ASSERT(x) assert(x)
  ------------------
  |  Branch (4070:5): [True: 2.80k, False: 0]
  ------------------
 4071|  2.80k|    return valptr();
 4072|  2.80k|  }
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEE6valptrEv:
 3365|  2.80k|  T* valptr() { return std::addressof(this->m_val); }
_ZNK2tl8expectedIN3ada14url_aggregatorENS1_6errorsEE9has_valueEv:
 4099|  2.80k|  constexpr bool has_value() const noexcept { return this->m_has_val; }
_ZN2tl6detail21expected_storage_baseIN3ada14url_aggregatorENS2_6errorsELb0ELb1EED2Ev:
 2697|  13.4k|  ~expected_storage_base() {
 2698|  13.4k|    if (m_has_val) {
  ------------------
  |  Branch (2698:9): [True: 2.52k, False: 10.8k]
  ------------------
 2699|  2.52k|      m_val.~T();
 2700|  2.52k|    }
 2701|  13.4k|  }
_ZN3ada7helpers9substringENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEmm:
 1912|  4.19k|                                                       size_t pos2) {
 1913|       |#if ADA_DEVELOPMENT_CHECKS
 1914|       |  if (pos2 < pos1) {
 1915|       |    std::cerr << "Negative-length substring: [" << pos1 << " to " << pos2 << ")"
 1916|       |              << std::endl;
 1917|       |    abort();
 1918|       |  }
 1919|       |#endif
 1920|  4.19k|  return input.substr(pos1, pos2 - pos1);
 1921|  4.19k|}
_ZNK3ada14url_aggregator10is_at_pathEv:
 8557|    724|    const noexcept {
 8558|    724|  return buffer.size() == components.pathname_start;
 8559|    724|}
_ZNK3ada14url_aggregator12has_passwordEv:
 9174|    538|constexpr bool url_aggregator::has_password() const noexcept {
 9175|    538|  ada_log("url_aggregator::has_password");
 9176|       |  // This function does not care about the length of the password
 9177|    538|  return components.host_start > components.username_end &&
  ------------------
  |  Branch (9177:10): [True: 480, False: 58]
  ------------------
 9178|    480|         buffer[components.username_end] == ':';
  ------------------
  |  Branch (9178:10): [True: 480, False: 0]
  ------------------
 9179|    538|}
_ZNK3ada14url_aggregator8validateEv:
 9316|  2.52k|[[nodiscard]] constexpr bool url_aggregator::validate() const noexcept {
 9317|  2.52k|  if (!is_valid) {
  ------------------
  |  Branch (9317:7): [True: 0, False: 2.52k]
  ------------------
 9318|      0|    return true;
 9319|      0|  }
 9320|  2.52k|  if (!components.check_offset_consistency()) {
  ------------------
  |  Branch (9320:7): [True: 0, False: 2.52k]
  ------------------
 9321|      0|    ada_log("url_aggregator::validate inconsistent components \n",
 9322|      0|            to_diagram());
 9323|      0|    return false;
 9324|      0|  }
 9325|       |  // We have a credible components struct, but let us investivate more
 9326|       |  // carefully:
 9327|       |  /**
 9328|       |   * https://user:pass@example.com:1234/foo/bar?baz#quux
 9329|       |   *       |     |    |          | ^^^^|       |   |
 9330|       |   *       |     |    |          | |   |       |   `----- hash_start
 9331|       |   *       |     |    |          | |   |       `--------- search_start
 9332|       |   *       |     |    |          | |   `----------------- pathname_start
 9333|       |   *       |     |    |          | `--------------------- port
 9334|       |   *       |     |    |          `----------------------- host_end
 9335|       |   *       |     |    `---------------------------------- host_start
 9336|       |   *       |     `--------------------------------------- username_end
 9337|       |   *       `--------------------------------------------- protocol_end
 9338|       |   */
 9339|  2.52k|  if (components.protocol_end == url_components::omitted) {
  ------------------
  |  Branch (9339:7): [True: 0, False: 2.52k]
  ------------------
 9340|      0|    ada_log("url_aggregator::validate omitted protocol_end \n", to_diagram());
 9341|      0|    return false;
 9342|      0|  }
 9343|  2.52k|  if (components.username_end == url_components::omitted) {
  ------------------
  |  Branch (9343:7): [True: 0, False: 2.52k]
  ------------------
 9344|      0|    ada_log("url_aggregator::validate omitted username_end \n", to_diagram());
 9345|      0|    return false;
 9346|      0|  }
 9347|  2.52k|  if (components.host_start == url_components::omitted) {
  ------------------
  |  Branch (9347:7): [True: 0, False: 2.52k]
  ------------------
 9348|      0|    ada_log("url_aggregator::validate omitted host_start \n", to_diagram());
 9349|      0|    return false;
 9350|      0|  }
 9351|  2.52k|  if (components.host_end == url_components::omitted) {
  ------------------
  |  Branch (9351:7): [True: 0, False: 2.52k]
  ------------------
 9352|      0|    ada_log("url_aggregator::validate omitted host_end \n", to_diagram());
 9353|      0|    return false;
 9354|      0|  }
 9355|  2.52k|  if (components.pathname_start == url_components::omitted) {
  ------------------
  |  Branch (9355:7): [True: 0, False: 2.52k]
  ------------------
 9356|      0|    ada_log("url_aggregator::validate omitted pathname_start \n", to_diagram());
 9357|      0|    return false;
 9358|      0|  }
 9359|       |
 9360|  2.52k|  if (components.protocol_end > buffer.size()) {
  ------------------
  |  Branch (9360:7): [True: 0, False: 2.52k]
  ------------------
 9361|      0|    ada_log("url_aggregator::validate protocol_end overflow \n", to_diagram());
 9362|      0|    return false;
 9363|      0|  }
 9364|  2.52k|  if (components.username_end > buffer.size()) {
  ------------------
  |  Branch (9364:7): [True: 0, False: 2.52k]
  ------------------
 9365|      0|    ada_log("url_aggregator::validate username_end overflow \n", to_diagram());
 9366|      0|    return false;
 9367|      0|  }
 9368|  2.52k|  if (components.host_start > buffer.size()) {
  ------------------
  |  Branch (9368:7): [True: 0, False: 2.52k]
  ------------------
 9369|      0|    ada_log("url_aggregator::validate host_start overflow \n", to_diagram());
 9370|      0|    return false;
 9371|      0|  }
 9372|  2.52k|  if (components.host_end > buffer.size()) {
  ------------------
  |  Branch (9372:7): [True: 0, False: 2.52k]
  ------------------
 9373|      0|    ada_log("url_aggregator::validate host_end overflow \n", to_diagram());
 9374|      0|    return false;
 9375|      0|  }
 9376|  2.52k|  if (components.pathname_start > buffer.size()) {
  ------------------
  |  Branch (9376:7): [True: 0, False: 2.52k]
  ------------------
 9377|      0|    ada_log("url_aggregator::validate pathname_start overflow \n",
 9378|      0|            to_diagram());
 9379|      0|    return false;
 9380|      0|  }
 9381|       |
 9382|  2.52k|  if (components.protocol_end > 0) {
  ------------------
  |  Branch (9382:7): [True: 2.52k, False: 0]
  ------------------
 9383|  2.52k|    if (buffer[components.protocol_end - 1] != ':') {
  ------------------
  |  Branch (9383:9): [True: 0, False: 2.52k]
  ------------------
 9384|      0|      ada_log(
 9385|      0|          "url_aggregator::validate missing : at the end of the protocol \n",
 9386|      0|          to_diagram());
 9387|      0|      return false;
 9388|      0|    }
 9389|  2.52k|  }
 9390|       |
 9391|  2.52k|  if (components.username_end != buffer.size() &&
  ------------------
  |  Branch (9391:7): [True: 2.52k, False: 0]
  ------------------
 9392|  2.52k|      components.username_end > components.protocol_end + 2) {
  ------------------
  |  Branch (9392:7): [True: 76, False: 2.44k]
  ------------------
 9393|     76|    if (buffer[components.username_end] != ':' &&
  ------------------
  |  Branch (9393:9): [True: 68, False: 8]
  ------------------
 9394|     68|        buffer[components.username_end] != '@') {
  ------------------
  |  Branch (9394:9): [True: 0, False: 68]
  ------------------
 9395|      0|      ada_log(
 9396|      0|          "url_aggregator::validate missing : or @ at the end of the username "
 9397|      0|          "\n",
 9398|      0|          to_diagram());
 9399|      0|      return false;
 9400|      0|    }
 9401|     76|  }
 9402|       |
 9403|  2.52k|  if (components.host_start != buffer.size()) {
  ------------------
  |  Branch (9403:7): [True: 2.52k, False: 0]
  ------------------
 9404|  2.52k|    if (components.host_start > components.username_end) {
  ------------------
  |  Branch (9404:9): [True: 18, False: 2.50k]
  ------------------
 9405|     18|      if (buffer[components.host_start] != '@') {
  ------------------
  |  Branch (9405:11): [True: 0, False: 18]
  ------------------
 9406|      0|        ada_log(
 9407|      0|            "url_aggregator::validate missing @ at the end of the password \n",
 9408|      0|            to_diagram());
 9409|      0|        return false;
 9410|      0|      }
 9411|  2.50k|    } else if (components.host_start == components.username_end &&
  ------------------
  |  Branch (9411:16): [True: 2.50k, False: 0]
  ------------------
 9412|  2.50k|               components.host_end > components.host_start) {
  ------------------
  |  Branch (9412:16): [True: 2.50k, False: 0]
  ------------------
 9413|  2.50k|      if (components.host_start == components.protocol_end + 2) {
  ------------------
  |  Branch (9413:11): [True: 2.43k, False: 68]
  ------------------
 9414|  2.43k|        if (buffer[components.protocol_end] != '/' ||
  ------------------
  |  Branch (9414:13): [True: 0, False: 2.43k]
  ------------------
 9415|  2.43k|            buffer[components.protocol_end + 1] != '/') {
  ------------------
  |  Branch (9415:13): [True: 0, False: 2.43k]
  ------------------
 9416|      0|          ada_log(
 9417|      0|              "url_aggregator::validate missing // between protocol and host "
 9418|      0|              "\n",
 9419|      0|              to_diagram());
 9420|      0|          return false;
 9421|      0|        }
 9422|  2.43k|      } else {
 9423|     68|        if (components.host_start > components.protocol_end &&
  ------------------
  |  Branch (9423:13): [True: 68, False: 0]
  ------------------
 9424|     68|            buffer[components.host_start] != '@') {
  ------------------
  |  Branch (9424:13): [True: 0, False: 68]
  ------------------
 9425|      0|          ada_log(
 9426|      0|              "url_aggregator::validate missing @ at the end of the username "
 9427|      0|              "\n",
 9428|      0|              to_diagram());
 9429|      0|          return false;
 9430|      0|        }
 9431|     68|      }
 9432|  2.50k|    } else {
 9433|      0|      if (components.host_end != components.host_start) {
  ------------------
  |  Branch (9433:11): [True: 0, False: 0]
  ------------------
 9434|      0|        ada_log("url_aggregator::validate expected omitted host \n",
 9435|      0|                to_diagram());
 9436|      0|        return false;
 9437|      0|      }
 9438|      0|    }
 9439|  2.52k|  }
 9440|  2.52k|  if (components.host_end != buffer.size() &&
  ------------------
  |  Branch (9440:7): [True: 2.52k, False: 0]
  ------------------
 9441|  2.52k|      components.pathname_start > components.host_end) {
  ------------------
  |  Branch (9441:7): [True: 175, False: 2.34k]
  ------------------
 9442|    175|    if (components.pathname_start == components.host_end + 2 &&
  ------------------
  |  Branch (9442:9): [True: 34, False: 141]
  ------------------
 9443|     34|        buffer[components.host_end] == '/' &&
  ------------------
  |  Branch (9443:9): [True: 0, False: 34]
  ------------------
 9444|      0|        buffer[components.host_end + 1] == '.') {
  ------------------
  |  Branch (9444:9): [True: 0, False: 0]
  ------------------
 9445|      0|      if (components.pathname_start + 1 >= buffer.size() ||
  ------------------
  |  Branch (9445:11): [True: 0, False: 0]
  ------------------
 9446|      0|          buffer[components.pathname_start] != '/' ||
  ------------------
  |  Branch (9446:11): [True: 0, False: 0]
  ------------------
 9447|      0|          buffer[components.pathname_start + 1] != '/') {
  ------------------
  |  Branch (9447:11): [True: 0, False: 0]
  ------------------
 9448|      0|        ada_log(
 9449|      0|            "url_aggregator::validate expected the path to begin with // \n",
 9450|      0|            to_diagram());
 9451|      0|        return false;
 9452|      0|      }
 9453|    175|    } else if (buffer[components.host_end] != ':') {
  ------------------
  |  Branch (9453:16): [True: 0, False: 175]
  ------------------
 9454|      0|      ada_log("url_aggregator::validate missing : at the port \n",
 9455|      0|              to_diagram());
 9456|      0|      return false;
 9457|      0|    }
 9458|    175|  }
 9459|  2.52k|  if (components.pathname_start != buffer.size() &&
  ------------------
  |  Branch (9459:7): [True: 2.52k, False: 0]
  ------------------
 9460|  2.52k|      components.pathname_start < components.search_start &&
  ------------------
  |  Branch (9460:7): [True: 2.52k, False: 0]
  ------------------
 9461|  2.52k|      components.pathname_start < components.hash_start && !has_opaque_path) {
  ------------------
  |  Branch (9461:7): [True: 2.52k, False: 0]
  |  Branch (9461:60): [True: 2.52k, False: 0]
  ------------------
 9462|  2.52k|    if (buffer[components.pathname_start] != '/') {
  ------------------
  |  Branch (9462:9): [True: 0, False: 2.52k]
  ------------------
 9463|      0|      ada_log("url_aggregator::validate missing / at the path \n",
 9464|      0|              to_diagram());
 9465|      0|      return false;
 9466|      0|    }
 9467|  2.52k|  }
 9468|  2.52k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (9468:7): [True: 756, False: 1.76k]
  ------------------
 9469|    756|    if (buffer[components.search_start] != '?') {
  ------------------
  |  Branch (9469:9): [True: 0, False: 756]
  ------------------
 9470|      0|      ada_log("url_aggregator::validate missing ? at the search \n",
 9471|      0|              to_diagram());
 9472|      0|      return false;
 9473|      0|    }
 9474|    756|  }
 9475|  2.52k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (9475:7): [True: 382, False: 2.14k]
  ------------------
 9476|    382|    if (buffer[components.hash_start] != '#') {
  ------------------
  |  Branch (9476:9): [True: 0, False: 382]
  ------------------
 9477|      0|      ada_log("url_aggregator::validate missing # at the hash \n",
 9478|      0|              to_diagram());
 9479|      0|      return false;
 9480|      0|    }
 9481|    382|  }
 9482|       |
 9483|  2.52k|  return true;
 9484|  2.52k|}
_ZNK3ada14url_components24check_offset_consistencyEv:
 7800|  2.52k|    const noexcept {
 7801|       |  /**
 7802|       |   * https://user:pass@example.com:1234/foo/bar?baz#quux
 7803|       |   *       |     |    |          | ^^^^|       |   |
 7804|       |   *       |     |    |          | |   |       |   `----- hash_start
 7805|       |   *       |     |    |          | |   |       `--------- search_start
 7806|       |   *       |     |    |          | |   `----------------- pathname_start
 7807|       |   *       |     |    |          | `--------------------- port
 7808|       |   *       |     |    |          `----------------------- host_end
 7809|       |   *       |     |    `---------------------------------- host_start
 7810|       |   *       |     `--------------------------------------- username_end
 7811|       |   *       `--------------------------------------------- protocol_end
 7812|       |   */
 7813|       |  // These conditions can be made more strict.
 7814|  2.52k|  if (protocol_end == url_components::omitted) {
  ------------------
  |  Branch (7814:7): [True: 0, False: 2.52k]
  ------------------
 7815|      0|    return false;
 7816|      0|  }
 7817|  2.52k|  uint32_t index = protocol_end;
 7818|       |
 7819|  2.52k|  if (username_end == url_components::omitted) {
  ------------------
  |  Branch (7819:7): [True: 0, False: 2.52k]
  ------------------
 7820|      0|    return false;
 7821|      0|  }
 7822|  2.52k|  if (username_end < index) {
  ------------------
  |  Branch (7822:7): [True: 0, False: 2.52k]
  ------------------
 7823|      0|    return false;
 7824|      0|  }
 7825|  2.52k|  index = username_end;
 7826|       |
 7827|  2.52k|  if (host_start == url_components::omitted) {
  ------------------
  |  Branch (7827:7): [True: 0, False: 2.52k]
  ------------------
 7828|      0|    return false;
 7829|      0|  }
 7830|  2.52k|  if (host_start < index) {
  ------------------
  |  Branch (7830:7): [True: 0, False: 2.52k]
  ------------------
 7831|      0|    return false;
 7832|      0|  }
 7833|  2.52k|  index = host_start;
 7834|       |
 7835|  2.52k|  if (port != url_components::omitted) {
  ------------------
  |  Branch (7835:7): [True: 175, False: 2.34k]
  ------------------
 7836|    175|    if (port > 0xffff) {
  ------------------
  |  Branch (7836:9): [True: 0, False: 175]
  ------------------
 7837|      0|      return false;
 7838|      0|    }
 7839|    175|    uint32_t port_length = helpers::fast_digit_count(port) + 1;
 7840|    175|    if (index + port_length < index) {
  ------------------
  |  Branch (7840:9): [True: 0, False: 175]
  ------------------
 7841|      0|      return false;
 7842|      0|    }
 7843|    175|    index += port_length;
 7844|    175|  }
 7845|       |
 7846|  2.52k|  if (pathname_start == url_components::omitted) {
  ------------------
  |  Branch (7846:7): [True: 0, False: 2.52k]
  ------------------
 7847|      0|    return false;
 7848|      0|  }
 7849|  2.52k|  if (pathname_start < index) {
  ------------------
  |  Branch (7849:7): [True: 0, False: 2.52k]
  ------------------
 7850|      0|    return false;
 7851|      0|  }
 7852|  2.52k|  index = pathname_start;
 7853|       |
 7854|  2.52k|  if (search_start != url_components::omitted) {
  ------------------
  |  Branch (7854:7): [True: 756, False: 1.76k]
  ------------------
 7855|    756|    if (search_start < index) {
  ------------------
  |  Branch (7855:9): [True: 0, False: 756]
  ------------------
 7856|      0|      return false;
 7857|      0|    }
 7858|    756|    index = search_start;
 7859|    756|  }
 7860|       |
 7861|  2.52k|  if (hash_start != url_components::omitted) {
  ------------------
  |  Branch (7861:7): [True: 382, False: 2.14k]
  ------------------
 7862|    382|    if (hash_start < index) {
  ------------------
  |  Branch (7862:9): [True: 0, False: 382]
  ------------------
 7863|      0|      return false;
 7864|      0|    }
 7865|    382|  }
 7866|       |
 7867|  2.52k|  return true;
 7868|  2.52k|}
_ZN3ada7helpers16fast_digit_countEj:
 2016|    175|inline int fast_digit_count(uint32_t x) noexcept {
 2017|    175|  auto int_log2 = [](uint32_t z) -> int {
 2018|    175|    return 31 - ada::helpers::leading_zeroes(z | 1);
 2019|    175|  };
 2020|       |  // Compiles to very few instructions. Note that the
 2021|       |  // table is static and thus effectively a constant.
 2022|       |  // We leave it inside the function because it is meaningless
 2023|       |  // outside of it (this comes at no performance cost).
 2024|    175|  const static uint64_t table[] = {
 2025|    175|      4294967296,  8589934582,  8589934582,  8589934582,  12884901788,
 2026|    175|      12884901788, 12884901788, 17179868184, 17179868184, 17179868184,
 2027|    175|      21474826480, 21474826480, 21474826480, 21474826480, 25769703776,
 2028|    175|      25769703776, 25769703776, 30063771072, 30063771072, 30063771072,
 2029|    175|      34349738368, 34349738368, 34349738368, 34349738368, 38554705664,
 2030|    175|      38554705664, 38554705664, 41949672960, 41949672960, 41949672960,
 2031|    175|      42949672960, 42949672960};
 2032|    175|  return int((x + table[int_log2(x)]) >> 32);
 2033|    175|}
_ZZN3ada7helpers16fast_digit_countEjENKUljE_clEj:
 2017|    175|  auto int_log2 = [](uint32_t z) -> int {
 2018|    175|    return 31 - ada::helpers::leading_zeroes(z | 1);
 2019|    175|  };

LLVMFuzzerTestOneInput:
   21|  7.11k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   22|  7.11k|  FuzzedDataProvider fdp(data, size);
   23|       |
   24|       |  // ===== IPv4 Serialization =====
   25|       |  // ipv4() takes a uint64_t (valid addresses are 0..0xFFFFFFFF, but the
   26|       |  // function accepts any value – out-of-range inputs should still be safe).
   27|  7.11k|  uint64_t ipv4_addr = fdp.ConsumeIntegral<uint64_t>();
   28|  7.11k|  std::string ipv4_str = ada::serializers::ipv4(ipv4_addr);
   29|  7.11k|  volatile size_t ipv4_len = ipv4_str.size();
   30|  7.11k|  (void)ipv4_len;
   31|       |
   32|       |  // ===== IPv6 Serialization =====
   33|  7.11k|  std::array<uint16_t, 8> ipv6_addr{};
   34|  56.9k|  for (auto& piece : ipv6_addr) {
  ------------------
  |  Branch (34:20): [True: 56.9k, False: 7.11k]
  ------------------
   35|  56.9k|    piece = fdp.ConsumeIntegral<uint16_t>();
   36|  56.9k|  }
   37|       |
   38|       |  // find_longest_sequence_of_ipv6_pieces: basic invariants must hold.
   39|  7.11k|  size_t compress = 0, compress_length = 0;
   40|  7.11k|  ada::serializers::find_longest_sequence_of_ipv6_pieces(ipv6_addr, compress,
   41|  7.11k|                                                         compress_length);
   42|       |  // The longest run cannot exceed 8 pieces.
   43|  7.11k|  assert(compress_length <= 8);
  ------------------
  |  Branch (43:3): [True: 7.11k, False: 0]
  ------------------
   44|       |  // If a run was found (length > 0) its start index must be in-bounds.
   45|  7.11k|  if (compress_length > 0) {
  ------------------
  |  Branch (45:7): [True: 2.10k, False: 5.01k]
  ------------------
   46|  2.10k|    assert(compress < 8);
  ------------------
  |  Branch (46:5): [True: 2.10k, False: 0]
  ------------------
   47|  2.10k|    assert(compress + compress_length <= 8);
  ------------------
  |  Branch (47:5): [True: 2.10k, False: 0]
  ------------------
   48|  2.10k|  }
   49|       |
   50|  7.11k|  std::string ipv6_str = ada::serializers::ipv6(ipv6_addr);
   51|  7.11k|  volatile size_t ipv6_len = ipv6_str.size();
   52|  7.11k|  (void)ipv6_len;
   53|       |
   54|       |  // Serialized IPv6 must always be a non-empty string.
   55|  7.11k|  assert(!ipv6_str.empty());
  ------------------
  |  Branch (55:3): [True: 7.11k, False: 0]
  ------------------
   56|       |
   57|       |  // ===== Fast IPv4 Parser =====
   58|       |  // try_parse_ipv4_fast() should agree with the full parsing pipeline on its
   59|       |  // output: if it succeeds (result <= 0xFFFFFFFF), re-serializing with
   60|       |  // ipv4() and parsing again must yield the same address value.
   61|  7.11k|  {
   62|  7.11k|    std::string ip_candidate = fdp.ConsumeRandomLengthString(32);
   63|  7.11k|    uint64_t fast_result = ada::checkers::try_parse_ipv4_fast(ip_candidate);
   64|  7.11k|    if (fast_result <= 0xFFFFFFFF) {
  ------------------
  |  Branch (64:9): [True: 74, False: 7.04k]
  ------------------
   65|       |      // Serialize the parsed address and re-parse.
   66|     74|      std::string canonical = ada::serializers::ipv4(fast_result);
   67|     74|      uint64_t recheck = ada::checkers::try_parse_ipv4_fast(canonical);
   68|     74|      if (recheck != fast_result) {
  ------------------
  |  Branch (68:11): [True: 0, False: 74]
  ------------------
   69|      0|        printf(
   70|      0|            "try_parse_ipv4_fast round-trip failure:\n"
   71|      0|            "  input='%s' result=%llu canonical='%s' recheck=%llu\n",
   72|      0|            ip_candidate.c_str(), (unsigned long long)fast_result,
   73|      0|            canonical.c_str(), (unsigned long long)recheck);
   74|      0|        abort();
   75|      0|      }
   76|     74|    }
   77|  7.11k|  }
   78|       |
   79|       |  // ===== Percent Encode / Decode =====
   80|  7.11k|  {
   81|  7.11k|    std::string source = fdp.ConsumeRandomLengthString(128);
   82|       |
   83|       |    // Exercise all six standard character sets used by the URL parser.
   84|  7.11k|    const uint8_t* sets[] = {
   85|  7.11k|        ada::character_sets::C0_CONTROL_PERCENT_ENCODE,
   86|  7.11k|        ada::character_sets::PATH_PERCENT_ENCODE,
   87|  7.11k|        ada::character_sets::QUERY_PERCENT_ENCODE,
   88|  7.11k|        ada::character_sets::FRAGMENT_PERCENT_ENCODE,
   89|  7.11k|        ada::character_sets::USERINFO_PERCENT_ENCODE,
   90|  7.11k|        ada::character_sets::SPECIAL_QUERY_PERCENT_ENCODE,
   91|  7.11k|    };
   92|       |
   93|  42.7k|    for (const uint8_t* charset : sets) {
  ------------------
  |  Branch (93:33): [True: 42.7k, False: 7.11k]
  ------------------
   94|       |      // Two-argument percent_encode: returns the encoded string.
   95|  42.7k|      std::string encoded = ada::unicode::percent_encode(source, charset);
   96|  42.7k|      volatile size_t enc_len = encoded.size();
   97|  42.7k|      (void)enc_len;
   98|       |
   99|       |      // Encoded output must be at least as long as the input (each byte
  100|       |      // either stays the same or expands to %XX – three bytes).
  101|  42.7k|      assert(encoded.size() >= source.size());
  ------------------
  |  Branch (101:7): [True: 42.7k, False: 0]
  ------------------
  102|       |
  103|       |      // Three-argument percent_encode: starts encoding from a given index.
  104|  42.7k|      size_t start_idx = fdp.ConsumeIntegralInRange<size_t>(0, source.size());
  105|  42.7k|      std::string encoded_from =
  106|  42.7k|          ada::unicode::percent_encode(source, charset, start_idx);
  107|  42.7k|      volatile size_t enf_len = encoded_from.size();
  108|  42.7k|      (void)enf_len;
  109|       |
  110|       |      // Template form: percent_encode<false> (replace).
  111|  42.7k|      {
  112|  42.7k|        std::string out;
  113|  42.7k|        bool changed =
  114|  42.7k|            ada::unicode::percent_encode<false>(source, charset, out);
  115|  42.7k|        volatile bool c = changed;
  116|  42.7k|        (void)c;
  117|       |        // When encoding was needed 'out' holds the encoded string; when not,
  118|       |        // 'out' is unchanged (empty). If changed, 'out' must not be shorter.
  119|  42.7k|        if (changed) {
  ------------------
  |  Branch (119:13): [True: 2.02k, False: 40.6k]
  ------------------
  120|  2.02k|          assert(out.size() >= source.size());
  ------------------
  |  Branch (120:11): [True: 2.02k, False: 0]
  ------------------
  121|  2.02k|        }
  122|  42.7k|      }
  123|       |
  124|       |      // Template form: percent_encode<true> (append).
  125|  42.7k|      {
  126|  42.7k|        std::string out = "prefix_";
  127|  42.7k|        size_t prefix_len = out.size();
  128|  42.7k|        ada::unicode::percent_encode<true>(source, charset, out);
  129|       |        // Append mode: 'out' must grow by at least source.size() bytes if
  130|       |        // encoding was needed, or stay unchanged if it wasn't.
  131|  42.7k|        assert(out.size() >= prefix_len);
  ------------------
  |  Branch (131:9): [True: 42.7k, False: 0]
  ------------------
  132|  42.7k|      }
  133|  42.7k|    }
  134|       |
  135|       |    // Percent decode: feed raw fuzz input (may contain invalid sequences).
  136|  7.11k|    {
  137|  7.11k|      size_t pct_pos = source.find('%');
  138|  7.11k|      if (pct_pos != std::string::npos) {
  ------------------
  |  Branch (138:11): [True: 177, False: 6.94k]
  ------------------
  139|    177|        std::string decoded = ada::unicode::percent_decode(source, pct_pos);
  140|       |        // Decoded output can't be longer than the input.
  141|    177|        assert(decoded.size() <= source.size());
  ------------------
  |  Branch (141:9): [True: 177, False: 0]
  ------------------
  142|    177|        volatile size_t dec_len = decoded.size();
  143|    177|        (void)dec_len;
  144|    177|      }
  145|  7.11k|    }
  146|       |
  147|       |    // Round-trip: encode with PATH set, then decode the result; the decoded
  148|       |    // form must equal the original (encoding then decoding is an identity).
  149|  7.11k|    {
  150|  7.11k|      std::string encoded = ada::unicode::percent_encode(
  151|  7.11k|          source, ada::character_sets::PATH_PERCENT_ENCODE);
  152|  7.11k|      size_t pct_pos = encoded.find('%');
  153|  7.11k|      if (pct_pos != std::string::npos) {
  ------------------
  |  Branch (153:11): [True: 411, False: 6.70k]
  ------------------
  154|    411|        std::string decoded = ada::unicode::percent_decode(encoded, pct_pos);
  155|       |        // PATH percent-encode does not encode '%', so a source that already
  156|       |        // contains %HH is decoded and the round-trip is not an identity.
  157|    411|        if (source.find('%') == std::string::npos && decoded != source) {
  ------------------
  |  Branch (157:13): [True: 234, False: 177]
  |  Branch (157:54): [True: 0, False: 234]
  ------------------
  158|      0|          printf(
  159|      0|              "percent_encode/decode round-trip failure!\n"
  160|      0|              "  source='%s'\n  encoded='%s'\n  decoded='%s'\n",
  161|      0|              source.c_str(), encoded.c_str(), decoded.c_str());
  162|      0|          abort();
  163|      0|        }
  164|  6.70k|      } else {
  165|       |        // No encoding was needed; the output should equal the input.
  166|  6.70k|        assert(encoded == source);
  ------------------
  |  Branch (166:9): [True: 6.70k, False: 0]
  ------------------
  167|  6.70k|      }
  168|  7.11k|    }
  169|       |
  170|       |    // percent_encode_index: the returned index must be within [0, size].
  171|  7.11k|    {
  172|  7.11k|      size_t idx = ada::unicode::percent_encode_index(
  173|  7.11k|          source, ada::character_sets::PATH_PERCENT_ENCODE);
  174|  7.11k|      assert(idx <= source.size());
  ------------------
  |  Branch (174:7): [True: 7.11k, False: 0]
  ------------------
  175|  7.11k|    }
  176|  7.11k|  }
  177|       |
  178|       |  // ===== Checker and Unicode Utility Functions =====
  179|       |  // These are internal helpers used throughout the parser. Fuzzing them
  180|       |  // directly (rather than only through the URL parsing pipeline) ensures
  181|       |  // every edge case is reachable without a valid URL structure.
  182|  7.11k|  {
  183|  7.11k|    std::string util_input = fdp.ConsumeRandomLengthString(128);
  184|       |
  185|       |    // has_tabs_or_newline: any string is valid input.
  186|  7.11k|    volatile bool has_tn = ada::unicode::has_tabs_or_newline(util_input);
  187|  7.11k|    (void)has_tn;
  188|       |
  189|       |    // is_ipv4 assumes a non-empty, lower-cased input, so honor that
  190|       |    // precondition here. Cross-check against URL parsing: if is_ipv4 reports
  191|       |    // true, embedding the string as a hostname in an http:// URL must succeed
  192|       |    // (it must be a parseable IPv4 address).
  193|  7.11k|    if (!util_input.empty()) {
  ------------------
  |  Branch (193:9): [True: 6.24k, False: 873]
  ------------------
  194|  6.24k|      volatile bool is_v4 = ada::checkers::is_ipv4(util_input);
  195|  6.24k|      (void)is_v4;
  196|  6.24k|      if (is_v4) {
  ------------------
  |  Branch (196:11): [True: 6.02k, False: 220]
  ------------------
  197|  6.02k|        std::string ipv4_url = "http://" + util_input + "/";
  198|  6.02k|        auto parsed = ada::parse<ada::url_aggregator>(ipv4_url);
  199|       |        // is_ipv4 reports true only for strings that look like IPv4 addresses;
  200|       |        // the full parser may still reject them (e.g. out-of-range octets), but
  201|       |        // if it accepts them the host type must be IPv4.
  202|  6.02k|        if (parsed) {
  ------------------
  |  Branch (202:13): [True: 2.24k, False: 3.78k]
  ------------------
  203|  2.24k|          volatile bool v = parsed->validate();
  204|  2.24k|          (void)v;
  205|  2.24k|        }
  206|  6.02k|      }
  207|  6.24k|    }
  208|       |
  209|       |    // path_signature: returns a bitmask; must not crash.
  210|  7.11k|    volatile uint8_t sig = ada::checkers::path_signature(util_input);
  211|  7.11k|    (void)sig;
  212|       |
  213|       |    // is_windows_drive_letter: must not crash on short or long inputs.
  214|  7.11k|    volatile bool is_wdl = ada::checkers::is_windows_drive_letter(util_input);
  215|  7.11k|    (void)is_wdl;
  216|       |
  217|       |    // is_normalized_windows_drive_letter
  218|  7.11k|    volatile bool is_nwdl =
  219|  7.11k|        ada::checkers::is_normalized_windows_drive_letter(util_input);
  220|  7.11k|    (void)is_nwdl;
  221|       |
  222|       |    // Consistency: a normalised Windows drive letter is a subset of
  223|       |    // Windows drive letters.
  224|  7.11k|    if (is_nwdl && !is_wdl) {
  ------------------
  |  Branch (224:9): [True: 1, False: 7.11k]
  |  Branch (224:20): [True: 0, False: 1]
  ------------------
  225|      0|      printf(
  226|      0|          "is_normalized_windows_drive_letter implies is_windows_drive_letter"
  227|      0|          " but got inconsistent results for '%s'\n",
  228|      0|          util_input.c_str());
  229|      0|      abort();
  230|      0|    }
  231|       |
  232|       |    // to_lower_ascii: works in-place; must not crash.
  233|  7.11k|    {
  234|  7.11k|      std::string lower_copy = util_input;
  235|  7.11k|      volatile bool all_ascii =
  236|  7.11k|          ada::unicode::to_lower_ascii(lower_copy.data(), lower_copy.size());
  237|  7.11k|      (void)all_ascii;
  238|       |      // The result should be at most as long as the input.
  239|  7.11k|      assert(lower_copy.size() == util_input.size());
  ------------------
  |  Branch (239:7): [True: 7.11k, False: 0]
  ------------------
  240|  7.11k|    }
  241|       |
  242|       |    // contains_forbidden_domain_code_point: must not crash.
  243|  7.11k|    volatile bool has_forbidden =
  244|  7.11k|        ada::unicode::contains_forbidden_domain_code_point(util_input.data(),
  245|  7.11k|                                                           util_input.size());
  246|  7.11k|    (void)has_forbidden;
  247|       |
  248|       |    // contains_forbidden_domain_code_point_or_upper: must not crash.
  249|  7.11k|    volatile uint8_t forbidden_or_upper =
  250|  7.11k|        ada::unicode::contains_forbidden_domain_code_point_or_upper(
  251|  7.11k|            util_input.data(), util_input.size());
  252|  7.11k|    (void)forbidden_or_upper;
  253|       |
  254|       |    // verify_dns_length: must not crash; also check consistency with
  255|       |    // to_ascii output.
  256|  7.11k|    volatile bool dns_ok = ada::checkers::verify_dns_length(util_input);
  257|  7.11k|    (void)dns_ok;
  258|  7.11k|  }
  259|       |
  260|       |  // ===== Integration: embed serialized addresses into real URLs =====
  261|       |  // This exercises the full parsing pipeline with our synthetic addresses
  262|       |  // and verifies that serialization output is always round-trip safe.
  263|      0|  {
  264|       |    // Only valid IPv4 address range (0..0xFFFFFFFF) should embed cleanly.
  265|  7.11k|    if (ipv4_addr <= 0xFFFFFFFF) {
  ------------------
  |  Branch (265:9): [True: 280, False: 6.83k]
  ------------------
  266|    280|      std::string url_str = "http://" + ipv4_str + "/path?q=1";
  267|    280|      auto parsed = ada::parse<ada::url_aggregator>(url_str);
  268|    280|      if (parsed) {
  ------------------
  |  Branch (268:11): [True: 280, False: 0]
  ------------------
  269|    280|        volatile bool v = parsed->validate();
  270|    280|        (void)v;
  271|       |        // The URL's hostname must be the canonical dotted-decimal address.
  272|    280|        std::string host = std::string(parsed->get_hostname());
  273|       |        // host == ipv4_str  (not asserted here because the URL parser may
  274|       |        // normalise the address differently for non-standard values, but it
  275|       |        // must always successfully parse our serialized form).
  276|    280|        (void)host;
  277|    280|      }
  278|    280|    }
  279|       |
  280|       |    // IPv6: wrap in brackets.
  281|  7.11k|    std::string ipv6_url_str = "http://[" + ipv6_str + "]/path";
  282|  7.11k|    auto parsed_ipv6 = ada::parse<ada::url_aggregator>(ipv6_url_str);
  283|  7.11k|    if (parsed_ipv6) {
  ------------------
  |  Branch (283:9): [True: 0, False: 7.11k]
  ------------------
  284|      0|      volatile bool v = parsed_ipv6->validate();
  285|      0|      (void)v;
  286|       |      // Re-parse the href – must be idempotent.
  287|      0|      std::string href = std::string(parsed_ipv6->get_href());
  288|      0|      auto reparsed = ada::parse<ada::url_aggregator>(href);
  289|      0|      if (!reparsed) {
  ------------------
  |  Branch (289:11): [True: 0, False: 0]
  ------------------
  290|      0|        printf("IPv6 URL re-parse failure: '%s'\n", href.c_str());
  291|      0|        abort();
  292|      0|      }
  293|      0|      if (std::string(reparsed->get_href()) != href) {
  ------------------
  |  Branch (293:11): [True: 0, False: 0]
  ------------------
  294|      0|        printf("IPv6 URL re-parse href mismatch: '%s' vs '%s'\n", href.c_str(),
  295|      0|               std::string(reparsed->get_href()).c_str());
  296|      0|        abort();
  297|      0|      }
  298|      0|    }
  299|  7.11k|  }
  300|       |
  301|  7.11k|  return 0;
  302|  7.11k|}

