_ZN3ada4idna13utf8_to_utf32EPKcmPDi:
  151|    745|size_t utf8_to_utf32(const char* buf, size_t len, char32_t* utf32_output) {
  152|    745|  const uint8_t* data = reinterpret_cast<const uint8_t*>(buf);
  153|    745|  size_t pos = 0;
  154|    745|  const char32_t* start{utf32_output};
  155|  13.0k|  while (pos < len) {
  ------------------
  |  Branch (155:10): [True: 12.4k, False: 608]
  ------------------
  156|       |    // try to convert the next block of 16 ASCII bytes
  157|  12.4k|    if (pos + 16 <= len) {  // if it is safe to read 16 more
  ------------------
  |  Branch (157:9): [True: 6.59k, False: 5.86k]
  ------------------
  158|       |                            // bytes, check that they are ascii
  159|  6.59k|      uint64_t v1;
  160|  6.59k|      std::memcpy(&v1, data + pos, sizeof(uint64_t));
  161|  6.59k|      uint64_t v2;
  162|  6.59k|      std::memcpy(&v2, data + pos + sizeof(uint64_t), sizeof(uint64_t));
  163|  6.59k|      uint64_t v{v1 | v2};
  164|  6.59k|      if ((v & 0x8080808080808080) == 0) {
  ------------------
  |  Branch (164:11): [True: 701, False: 5.89k]
  ------------------
  165|    701|        size_t final_pos = pos + 16;
  166|  11.9k|        while (pos < final_pos) {
  ------------------
  |  Branch (166:16): [True: 11.2k, False: 701]
  ------------------
  167|  11.2k|          *utf32_output++ = char32_t(buf[pos]);
  168|  11.2k|          pos++;
  169|  11.2k|        }
  170|    701|        continue;
  171|    701|      }
  172|  6.59k|    }
  173|  11.7k|    uint8_t leading_byte = data[pos];  // leading byte
  174|  11.7k|    if (leading_byte < 0b10000000) {
  ------------------
  |  Branch (174:9): [True: 10.3k, False: 1.45k]
  ------------------
  175|       |      // converting one ASCII byte !!!
  176|  10.3k|      *utf32_output++ = char32_t(leading_byte);
  177|  10.3k|      pos++;
  178|  10.3k|    } else if ((leading_byte & 0b11100000) == 0b11000000) {
  ------------------
  |  Branch (178:16): [True: 687, False: 765]
  ------------------
  179|       |      // We have a two-byte UTF-8
  180|    687|      if (pos + 1 >= len) {
  ------------------
  |  Branch (180:11): [True: 1, False: 686]
  ------------------
  181|      1|        return 0;
  182|      1|      }  // minimal bound checking
  183|    686|      if ((data[pos + 1] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (183:11): [True: 16, False: 670]
  ------------------
  184|     16|        return 0;
  185|     16|      }
  186|       |      // range check
  187|    670|      uint32_t code_point =
  188|    670|          (leading_byte & 0b00011111) << 6 | (data[pos + 1] & 0b00111111);
  189|    670|      if (code_point < 0x80 || 0x7ff < code_point) {
  ------------------
  |  Branch (189:11): [True: 7, False: 663]
  |  Branch (189:32): [True: 0, False: 663]
  ------------------
  190|      7|        return 0;
  191|      7|      }
  192|    663|      *utf32_output++ = char32_t(code_point);
  193|    663|      pos += 2;
  194|    765|    } else if ((leading_byte & 0b11110000) == 0b11100000) {
  ------------------
  |  Branch (194:16): [True: 523, False: 242]
  ------------------
  195|       |      // We have a three-byte UTF-8
  196|    523|      if (pos + 2 >= len) {
  ------------------
  |  Branch (196:11): [True: 4, False: 519]
  ------------------
  197|      4|        return 0;
  198|      4|      }  // minimal bound checking
  199|       |
  200|    519|      if ((data[pos + 1] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (200:11): [True: 5, False: 514]
  ------------------
  201|      5|        return 0;
  202|      5|      }
  203|    514|      if ((data[pos + 2] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (203:11): [True: 5, False: 509]
  ------------------
  204|      5|        return 0;
  205|      5|      }
  206|       |      // range check
  207|    509|      uint32_t code_point = (leading_byte & 0b00001111) << 12 |
  208|    509|                            (data[pos + 1] & 0b00111111) << 6 |
  209|    509|                            (data[pos + 2] & 0b00111111);
  210|    509|      if (code_point < 0x800 || 0xffff < code_point ||
  ------------------
  |  Branch (210:11): [True: 2, False: 507]
  |  Branch (210:33): [True: 0, False: 507]
  ------------------
  211|    507|          (0xd7ff < code_point && code_point < 0xe000)) {
  ------------------
  |  Branch (211:12): [True: 164, False: 343]
  |  Branch (211:35): [True: 1, False: 163]
  ------------------
  212|      3|        return 0;
  213|      3|      }
  214|    506|      *utf32_output++ = char32_t(code_point);
  215|    506|      pos += 3;
  216|    506|    } else if ((leading_byte & 0b11111000) == 0b11110000) {  // 0b11110000
  ------------------
  |  Branch (216:16): [True: 172, False: 70]
  ------------------
  217|       |      // we have a 4-byte UTF-8 word.
  218|    172|      if (pos + 3 >= len) {
  ------------------
  |  Branch (218:11): [True: 4, False: 168]
  ------------------
  219|      4|        return 0;
  220|      4|      }  // minimal bound checking
  221|    168|      if ((data[pos + 1] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (221:11): [True: 11, False: 157]
  ------------------
  222|     11|        return 0;
  223|     11|      }
  224|    157|      if ((data[pos + 2] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (224:11): [True: 4, False: 153]
  ------------------
  225|      4|        return 0;
  226|      4|      }
  227|    153|      if ((data[pos + 3] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (227:11): [True: 5, False: 148]
  ------------------
  228|      5|        return 0;
  229|      5|      }
  230|       |
  231|       |      // range check
  232|    148|      uint32_t code_point = (leading_byte & 0b00000111) << 18 |
  233|    148|                            (data[pos + 1] & 0b00111111) << 12 |
  234|    148|                            (data[pos + 2] & 0b00111111) << 6 |
  235|    148|                            (data[pos + 3] & 0b00111111);
  236|    148|      if (code_point <= 0xffff || 0x10ffff < code_point) {
  ------------------
  |  Branch (236:11): [True: 1, False: 147]
  |  Branch (236:35): [True: 1, False: 146]
  ------------------
  237|      2|        return 0;
  238|      2|      }
  239|    146|      *utf32_output++ = char32_t(code_point);
  240|    146|      pos += 4;
  241|    146|    } else {
  242|     70|      return 0;
  243|     70|    }
  244|  11.7k|  }
  245|    608|  return utf32_output - start;
  246|    745|}
_ZN3ada4idna22utf32_length_from_utf8EPKcm:
  261|    745|size_t utf32_length_from_utf8(const char* buf, size_t len) {
  262|    745|  const int8_t* p = reinterpret_cast<const int8_t*>(buf);
  263|    745|  return std::count_if(p, std::next(p, len), [](int8_t c) {
  264|       |    // -65 is 0b10111111, anything larger in two-complement's
  265|       |    // should start a new code point.
  266|    745|    return c > -65;
  267|    745|  });
  268|    745|}
_ZN3ada4idna9ascii_mapEPcm:
 2837|  1.22k|void ascii_map(char* input, size_t length) {
 2838|  1.22k|  auto broadcast = [](uint8_t v) -> uint64_t {
 2839|  1.22k|    return 0x101010101010101ull * v;
 2840|  1.22k|  };
 2841|  1.22k|  uint64_t broadcast_80 = broadcast(0x80);
 2842|  1.22k|  uint64_t broadcast_Ap = broadcast(128 - 'A');
 2843|  1.22k|  uint64_t broadcast_Zp = broadcast(128 - 'Z' - 1);
 2844|  1.22k|  size_t i = 0;
 2845|       |
 2846|  2.29k|  for (; i + 7 < length; i += 8) {
  ------------------
  |  Branch (2846:10): [True: 1.07k, False: 1.22k]
  ------------------
 2847|  1.07k|    uint64_t word{};
 2848|  1.07k|    std::memcpy(&word, input + i, sizeof(word));
 2849|  1.07k|    word ^=
 2850|  1.07k|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
 2851|  1.07k|    std::memcpy(input + i, &word, sizeof(word));
 2852|  1.07k|  }
 2853|  1.22k|  if (i < length) {
  ------------------
  |  Branch (2853:7): [True: 1.15k, False: 69]
  ------------------
 2854|  1.15k|    uint64_t word{};
 2855|  1.15k|    std::memcpy(&word, input + i, length - i);
 2856|  1.15k|    word ^=
 2857|  1.15k|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
 2858|  1.15k|    std::memcpy(input + i, &word, length - i);
 2859|  1.15k|  }
 2860|  1.22k|}
_ZN3ada4idna3mapENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEERNS1_12basic_stringIDiS4_NS1_9allocatorIDiEEEE:
 2866|    853|bool map(std::u32string_view input, std::u32string& out) {
 2867|       |  //  [Map](https://www.unicode.org/reports/tr46/#ProcessingStepMap).
 2868|       |  //  For each code point in the domain_name string, look up the status
 2869|       |  //  value in Section 5, [IDNA Mapping
 2870|       |  //  Table](https://www.unicode.org/reports/tr46/#IDNA_Mapping_Table),
 2871|       |  //  and take the following actions:
 2872|       |  //    * disallowed: Leave the code point unchanged in the string, and
 2873|       |  //    record that there was an error.
 2874|       |  //    * ignored: Remove the code point from the string.
 2875|       |  //    * mapped: Replace the code point in the string by the value for
 2876|       |  //    the mapping in Section 5, [IDNA Mapping
 2877|       |  //    Table](https://www.unicode.org/reports/tr46/#IDNA_Mapping_Table).
 2878|       |  //    * valid: Leave the code point unchanged in the string.
 2879|    853|  out.clear();
 2880|    853|  out.reserve(input.size());
 2881|  24.7k|  for (char32_t x : input) {
  ------------------
  |  Branch (2881:19): [True: 24.7k, False: 756]
  ------------------
 2882|  24.7k|    uint16_t status = idna_lookup(static_cast<uint32_t>(x));
 2883|  24.7k|    if (status == IDNA_DISALLOWED) {
  ------------------
  |  Branch (2883:9): [True: 97, False: 24.6k]
  ------------------
 2884|     97|      return false;
 2885|     97|    }
 2886|  24.6k|    if (status == IDNA_VALID) {
  ------------------
  |  Branch (2886:9): [True: 21.7k, False: 2.87k]
  ------------------
 2887|  21.7k|      out.push_back(x);
 2888|  21.7k|      continue;
 2889|  21.7k|    }
 2890|       |    // IDNA_IGNORED (status==0) falls through: idna_utf8_mappings[0] == 0x00
 2891|       |    // (null terminator), so the decode loop below produces nothing.
 2892|       |
 2893|       |    // Mapped (or ignored): decode null-terminated UTF-8 from the mapping table.
 2894|  2.87k|    const uint8_t* ptr = idna_utf8_mappings + status;
 2895|  6.37k|    while (*ptr != 0) {
  ------------------
  |  Branch (2895:12): [True: 3.50k, False: 2.87k]
  ------------------
 2896|  3.50k|      out.push_back(utf8_next(ptr));
 2897|  3.50k|    }
 2898|  2.87k|  }
 2899|    756|  return true;
 2900|    853|}
_ZN3ada4idna28compute_decomposition_lengthENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 7828|    733|    const std::u32string_view input) noexcept {
 7829|    733|  bool decomposition_needed{false};
 7830|    733|  size_t additional_elements{0};
 7831|  23.4k|  for (char32_t current_character : input) {
  ------------------
  |  Branch (7831:35): [True: 23.4k, False: 733]
  ------------------
 7832|  23.4k|    size_t decomposition_length{0};
 7833|       |
 7834|  23.4k|    if (current_character >= hangul_sbase &&
  ------------------
  |  Branch (7834:9): [True: 745, False: 22.7k]
  ------------------
 7835|    745|        current_character < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (7835:9): [True: 373, False: 372]
  ------------------
 7836|    373|      decomposition_length = 2;
 7837|    373|      if ((current_character - hangul_sbase) % hangul_tcount) {
  ------------------
  |  Branch (7837:11): [True: 343, False: 30]
  ------------------
 7838|    343|        decomposition_length = 3;
 7839|    343|      }
 7840|  23.1k|    } else if (current_character < 0x110000) {
  ------------------
  |  Branch (7840:16): [True: 23.1k, False: 0]
  ------------------
 7841|  23.1k|      const uint8_t di = decomposition_index[current_character >> 8];
 7842|  23.1k|      const uint16_t* const decomposition =
 7843|  23.1k|          decomposition_block[di] + (current_character % 256);
 7844|  23.1k|      decomposition_length = (decomposition[1] >> 2) - (decomposition[0] >> 2);
 7845|  23.1k|      if ((decomposition_length > 0) && (decomposition[0] & 1)) {
  ------------------
  |  Branch (7845:11): [True: 374, False: 22.7k]
  |  Branch (7845:41): [True: 0, False: 374]
  ------------------
 7846|      0|        decomposition_length = 0;
 7847|      0|      }
 7848|  23.1k|    }
 7849|  23.4k|    if (decomposition_length != 0) {
  ------------------
  |  Branch (7849:9): [True: 747, False: 22.7k]
  ------------------
 7850|    747|      decomposition_needed = true;
 7851|    747|      additional_elements += decomposition_length - 1;
 7852|    747|    }
 7853|  23.4k|  }
 7854|    733|  return {decomposition_needed, additional_elements};
 7855|    733|}
_ZN3ada4idna9decomposeERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEEm:
 7857|    228|void decompose(std::u32string& input, size_t additional_elements) {
 7858|    228|  input.resize(input.size() + additional_elements);
 7859|    228|  for (size_t descending_idx = input.size(),
 7860|    228|              input_count = descending_idx - additional_elements;
 7861|  7.80k|       input_count--;) {
  ------------------
  |  Branch (7861:8): [True: 7.57k, False: 228]
  ------------------
 7862|  7.57k|    if (input[input_count] >= hangul_sbase &&
  ------------------
  |  Branch (7862:9): [True: 511, False: 7.06k]
  ------------------
 7863|    511|        input[input_count] < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (7863:9): [True: 373, False: 138]
  ------------------
 7864|       |      // Hangul decomposition.
 7865|    373|      char32_t s_index = input[input_count] - hangul_sbase;
 7866|    373|      if (s_index % hangul_tcount != 0) {
  ------------------
  |  Branch (7866:11): [True: 343, False: 30]
  ------------------
 7867|    343|        input[--descending_idx] = hangul_tbase + s_index % hangul_tcount;
 7868|    343|      }
 7869|    373|      input[--descending_idx] =
 7870|    373|          hangul_vbase + (s_index % hangul_ncount) / hangul_tcount;
 7871|    373|      input[--descending_idx] = hangul_lbase + s_index / hangul_ncount;
 7872|  7.20k|    } else if (input[input_count] < 0x110000) {
  ------------------
  |  Branch (7872:16): [True: 7.20k, False: 0]
  ------------------
 7873|       |      // Check decomposition_data.
 7874|  7.20k|      const uint16_t* decomposition =
 7875|  7.20k|          decomposition_block[decomposition_index[input[input_count] >> 8]] +
 7876|  7.20k|          (input[input_count] % 256);
 7877|  7.20k|      uint16_t decomposition_length =
 7878|  7.20k|          (decomposition[1] >> 2) - (decomposition[0] >> 2);
 7879|  7.20k|      if (decomposition_length > 0 && (decomposition[0] & 1)) {
  ------------------
  |  Branch (7879:11): [True: 374, False: 6.83k]
  |  Branch (7879:39): [True: 0, False: 374]
  ------------------
 7880|      0|        decomposition_length = 0;
 7881|      0|      }
 7882|  7.20k|      if (decomposition_length > 0) {
  ------------------
  |  Branch (7882:11): [True: 374, False: 6.83k]
  ------------------
 7883|       |        // Non-recursive decomposition.
 7884|  1.31k|        while (decomposition_length-- > 0) {
  ------------------
  |  Branch (7884:16): [True: 942, False: 374]
  ------------------
 7885|    942|          input[--descending_idx] = decomposition_data[(decomposition[0] >> 2) +
 7886|    942|                                                       decomposition_length];
 7887|    942|        }
 7888|  6.83k|      } else {
 7889|       |        // No decomposition.
 7890|  6.83k|        input[--descending_idx] = input[input_count];
 7891|  6.83k|      }
 7892|  7.20k|    } else {
 7893|       |      // Non-Unicode character.
 7894|      0|      input[--descending_idx] = input[input_count];
 7895|      0|    }
 7896|  7.57k|  }
 7897|    228|}
_ZN3ada4idna7get_cccEDi:
 7899|  48.5k|uint8_t get_ccc(char32_t c) noexcept {
 7900|  48.5k|  return c < 0x110000 ? canonical_combining_class_block
  ------------------
  |  Branch (7900:10): [True: 48.5k, False: 0]
  ------------------
 7901|  48.5k|                            [canonical_combining_class_index[c >> 8]][c % 256]
 7902|  48.5k|                      : 0;
 7903|  48.5k|}
_ZN3ada4idna10sort_marksERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 7905|    733|void sort_marks(std::u32string& input) {
 7906|  24.7k|  for (size_t idx = 1; idx < input.size(); idx++) {
  ------------------
  |  Branch (7906:24): [True: 24.0k, False: 733]
  ------------------
 7907|  24.0k|    uint8_t ccc = get_ccc(input[idx]);
 7908|  24.0k|    if (ccc == 0) {
  ------------------
  |  Branch (7908:9): [True: 22.8k, False: 1.15k]
  ------------------
 7909|  22.8k|      continue;
 7910|  22.8k|    }  // Skip non-combining characters.
 7911|  1.15k|    auto current_character = input[idx];
 7912|  1.15k|    size_t back_idx = idx;
 7913|  1.54k|    while (back_idx != 0 && get_ccc(input[back_idx - 1]) > ccc) {
  ------------------
  |  Branch (7913:12): [True: 1.53k, False: 11]
  |  Branch (7913:29): [True: 388, False: 1.14k]
  ------------------
 7914|    388|      input[back_idx] = input[back_idx - 1];
 7915|    388|      back_idx--;
 7916|    388|    }
 7917|  1.15k|    input[back_idx] = current_character;
 7918|  1.15k|  }
 7919|    733|}
_ZN3ada4idna13decompose_nfcERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 7921|    733|void decompose_nfc(std::u32string& input) {
 7922|       |  /**
 7923|       |   * Decompose the domain_name string to Unicode Normalization Form C.
 7924|       |   * @see https://www.unicode.org/reports/tr46/#ProcessingStepDecompose
 7925|       |   */
 7926|    733|  auto [decomposition_needed, additional_elements] =
 7927|    733|      compute_decomposition_length(input);
 7928|    733|  if (decomposition_needed) {
  ------------------
  |  Branch (7928:7): [True: 228, False: 505]
  ------------------
 7929|    228|    decompose(input, additional_elements);
 7930|    228|  }
 7931|    733|  sort_marks(input);
 7932|    733|}
_ZN3ada4idna7composeERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 7934|    733|void compose(std::u32string& input) {
 7935|       |  /**
 7936|       |   * Compose the domain_name string to Unicode Normalization Form C.
 7937|       |   * @see https://www.unicode.org/reports/tr46/#ProcessingStepCompose
 7938|       |   */
 7939|    733|  size_t input_count{0};
 7940|    733|  size_t composition_count{0};
 7941|  23.6k|  for (; input_count < input.size(); input_count++, composition_count++) {
  ------------------
  |  Branch (7941:10): [True: 22.8k, False: 733]
  ------------------
 7942|  22.8k|    input[composition_count] = input[input_count];
 7943|  22.8k|    if (input[input_count] >= hangul_lbase &&
  ------------------
  |  Branch (7943:9): [True: 1.23k, False: 21.6k]
  ------------------
 7944|  1.23k|        input[input_count] < hangul_lbase + hangul_lcount) {
  ------------------
  |  Branch (7944:9): [True: 377, False: 857]
  ------------------
 7945|    377|      if (input_count + 1 < input.size() &&
  ------------------
  |  Branch (7945:11): [True: 377, False: 0]
  ------------------
 7946|    377|          input[input_count + 1] >= hangul_vbase &&
  ------------------
  |  Branch (7946:11): [True: 376, False: 1]
  ------------------
 7947|    376|          input[input_count + 1] < hangul_vbase + hangul_vcount) {
  ------------------
  |  Branch (7947:11): [True: 373, False: 3]
  ------------------
 7948|    373|        input[composition_count] =
 7949|    373|            hangul_sbase +
 7950|    373|            ((input[input_count] - hangul_lbase) * hangul_vcount +
 7951|    373|             input[input_count + 1] - hangul_vbase) *
 7952|    373|                hangul_tcount;
 7953|    373|        input_count++;
 7954|    373|        if (input_count + 1 < input.size() &&
  ------------------
  |  Branch (7954:13): [True: 370, False: 3]
  ------------------
 7955|    370|            input[input_count + 1] > hangul_tbase &&
  ------------------
  |  Branch (7955:13): [True: 346, False: 24]
  ------------------
 7956|    346|            input[input_count + 1] < hangul_tbase + hangul_tcount) {
  ------------------
  |  Branch (7956:13): [True: 343, False: 3]
  ------------------
 7957|    343|          input[composition_count] += input[++input_count] - hangul_tbase;
 7958|    343|        }
 7959|    373|      }
 7960|  22.5k|    } else if (input[input_count] >= hangul_sbase &&
  ------------------
  |  Branch (7960:16): [True: 268, False: 22.2k]
  ------------------
 7961|    268|               input[input_count] < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (7961:16): [True: 0, False: 268]
  ------------------
 7962|      0|      if ((input[input_count] - hangul_sbase) % hangul_tcount &&
  ------------------
  |  Branch (7962:11): [True: 0, False: 0]
  ------------------
 7963|      0|          input_count + 1 < input.size() &&
  ------------------
  |  Branch (7963:11): [True: 0, False: 0]
  ------------------
 7964|      0|          input[input_count + 1] > hangul_tbase &&
  ------------------
  |  Branch (7964:11): [True: 0, False: 0]
  ------------------
 7965|      0|          input[input_count + 1] < hangul_tbase + hangul_tcount) {
  ------------------
  |  Branch (7965:11): [True: 0, False: 0]
  ------------------
 7966|      0|        input[composition_count] += input[++input_count] - hangul_tbase;
 7967|      0|      }
 7968|  22.5k|    } else if (input[input_count] < 0x110000) {
  ------------------
  |  Branch (7968:16): [True: 22.5k, False: 0]
  ------------------
 7969|  22.5k|      const uint16_t* composition =
 7970|  22.5k|          &composition_block[composition_index[input[input_count] >> 8]]
 7971|  22.5k|                            [input[input_count] % 256];
 7972|  22.5k|      size_t initial_composition_count = composition_count;
 7973|  23.6k|      for (int32_t previous_ccc = -1; input_count + 1 < input.size();
  ------------------
  |  Branch (7973:39): [True: 22.9k, False: 713]
  ------------------
 7974|  22.9k|           input_count++) {
 7975|  22.9k|        uint8_t ccc = get_ccc(input[input_count + 1]);
 7976|       |
 7977|  22.9k|        if (composition[1] != composition[0] && previous_ccc < ccc) {
  ------------------
  |  Branch (7977:13): [True: 7.95k, False: 15.0k]
  |  Branch (7977:49): [True: 7.88k, False: 65]
  ------------------
 7978|       |          // Try finding a composition.
 7979|  7.88k|          int left = composition[0];
 7980|  7.88k|          int right = composition[1];
 7981|  25.1k|          while (left + 2 < right) {
  ------------------
  |  Branch (7981:18): [True: 17.2k, False: 7.88k]
  ------------------
 7982|       |            // mean without overflow
 7983|  17.2k|            int middle = left + (((right - left) >> 1) & ~1);
 7984|  17.2k|            if (composition_data[middle] <= input[input_count + 1]) {
  ------------------
  |  Branch (7984:17): [True: 1.60k, False: 15.6k]
  ------------------
 7985|  1.60k|              left = middle;
 7986|  1.60k|            }
 7987|  17.2k|            if (composition_data[middle] >= input[input_count + 1]) {
  ------------------
  |  Branch (7987:17): [True: 16.1k, False: 1.08k]
  ------------------
 7988|  16.1k|              right = middle;
 7989|  16.1k|            }
 7990|  17.2k|          }
 7991|  7.88k|          if (composition_data[left] == input[input_count + 1]) {
  ------------------
  |  Branch (7991:15): [True: 569, False: 7.31k]
  ------------------
 7992|    569|            input[initial_composition_count] = composition_data[left + 1];
 7993|    569|            composition =
 7994|    569|                &composition_block
 7995|    569|                    [composition_index[composition_data[left + 1] >> 8]]
 7996|    569|                    [composition_data[left + 1] % 256];
 7997|    569|            continue;
 7998|    569|          }
 7999|  7.88k|        }
 8000|       |
 8001|  22.3k|        if (ccc == 0) {
  ------------------
  |  Branch (8001:13): [True: 21.8k, False: 586]
  ------------------
 8002|  21.8k|          break;
 8003|  21.8k|        }  // Not a combining character.
 8004|    586|        previous_ccc = ccc;
 8005|    586|        input[++composition_count] = input[input_count + 1];
 8006|    586|      }
 8007|  22.5k|    }
 8008|  22.8k|  }
 8009|       |
 8010|    733|  if (composition_count < input_count) {
  ------------------
  |  Branch (8010:7): [True: 229, False: 504]
  ------------------
 8011|    229|    input.resize(composition_count);
 8012|    229|  }
 8013|    733|}
_ZN3ada4idna9normalizeERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 8015|    733|void normalize(std::u32string& input) {
 8016|       |  /**
 8017|       |   * Normalize the domain_name string to Unicode Normalization Form C.
 8018|       |   * @see https://www.unicode.org/reports/tr46/#ProcessingStepNormalize
 8019|       |   */
 8020|    733|  decompose_nfc(input);
 8021|    733|  compose(input);
 8022|    733|}
_ZN3ada4idna17punycode_to_utf32ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEERNS1_12basic_stringIDiNS3_IDiEENS1_9allocatorIDiEEEE:
 8065|    278|bool punycode_to_utf32(std::string_view input, std::u32string &out) {
 8066|    278|  int32_t written_out{0};
 8067|    278|  out.reserve(out.size() + input.size());
 8068|    278|  uint32_t n = initial_n;
 8069|    278|  int32_t i = 0;
 8070|    278|  int32_t bias = initial_bias;
 8071|       |  // grab ascii content
 8072|    278|  size_t end_of_ascii = input.find_last_of('-');
 8073|    278|  if (end_of_ascii != std::string_view::npos) {
  ------------------
  |  Branch (8073:7): [True: 109, False: 169]
  ------------------
 8074|  1.72k|    for (uint8_t c : input.substr(0, end_of_ascii)) {
  ------------------
  |  Branch (8074:20): [True: 1.72k, False: 109]
  ------------------
 8075|  1.72k|      if (c >= 0x80) {
  ------------------
  |  Branch (8075:11): [True: 0, False: 1.72k]
  ------------------
 8076|      0|        return false;
 8077|      0|      }
 8078|  1.72k|      out.push_back(c);
 8079|  1.72k|      written_out++;
 8080|  1.72k|    }
 8081|    109|    input.remove_prefix(end_of_ascii + 1);
 8082|    109|  }
 8083|  3.38k|  while (!input.empty()) {
  ------------------
  |  Branch (8083:10): [True: 3.13k, False: 254]
  ------------------
 8084|  3.13k|    int32_t oldi = i;
 8085|  3.13k|    int32_t w = 1;
 8086|  5.34k|    for (int32_t k = base;; k += base) {
 8087|  5.34k|      if (input.empty()) {
  ------------------
  |  Branch (8087:11): [True: 9, False: 5.33k]
  ------------------
 8088|      9|        return false;
 8089|      9|      }
 8090|  5.33k|      uint8_t code_point = input.front();
 8091|  5.33k|      input.remove_prefix(1);
 8092|  5.33k|      int32_t digit = char_to_digit_value(code_point);
 8093|  5.33k|      if (digit < 0) {
  ------------------
  |  Branch (8093:11): [True: 8, False: 5.32k]
  ------------------
 8094|      8|        return false;
 8095|      8|      }
 8096|  5.32k|      if (digit > (0x7fffffff - i) / w) {
  ------------------
  |  Branch (8096:11): [True: 7, False: 5.31k]
  ------------------
 8097|      7|        return false;
 8098|      7|      }
 8099|  5.31k|      i = i + digit * w;
 8100|  5.31k|      int32_t t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;
  ------------------
  |  Branch (8100:19): [True: 1.03k, False: 4.28k]
  |  Branch (8100:38): [True: 3.48k, False: 801]
  ------------------
 8101|  5.31k|      if (digit < t) {
  ------------------
  |  Branch (8101:11): [True: 3.11k, False: 2.20k]
  ------------------
 8102|  3.11k|        break;
 8103|  3.11k|      }
 8104|  2.20k|      if (w > 0x7fffffff / (base - t)) {
  ------------------
  |  Branch (8104:11): [True: 0, False: 2.20k]
  ------------------
 8105|      0|        return false;
 8106|      0|      }
 8107|  2.20k|      w = w * (base - t);
 8108|  2.20k|    }
 8109|  3.11k|    bias = adapt(i - oldi, written_out + 1, oldi == 0);
 8110|  3.11k|    if (i / (written_out + 1) > int32_t(0x7fffffff - n)) {
  ------------------
  |  Branch (8110:9): [True: 0, False: 3.11k]
  ------------------
 8111|      0|      return false;
 8112|      0|    }
 8113|  3.11k|    n = n + i / (written_out + 1);
 8114|  3.11k|    i = i % (written_out + 1);
 8115|  3.11k|    if (n < 0x80) {
  ------------------
  |  Branch (8115:9): [True: 0, False: 3.11k]
  ------------------
 8116|      0|      return false;
 8117|      0|    }
 8118|  3.11k|    out.insert(out.begin() + i, n);
 8119|  3.11k|    written_out++;
 8120|  3.11k|    ++i;
 8121|  3.11k|  }
 8122|       |  // See https://github.com/whatwg/url/issues/803
 8123|       |  // Reject labels whose decoded form begins with "xn--" (double-encoded ACE).
 8124|    254|  if (out.size() >= 4 && out[0] == U'x' && out[1] == U'n' && out[2] == U'-' &&
  ------------------
  |  Branch (8124:7): [True: 201, False: 53]
  |  Branch (8124:26): [True: 9, False: 192]
  |  Branch (8124:44): [True: 6, False: 3]
  |  Branch (8124:62): [True: 2, False: 4]
  ------------------
 8125|      2|      out[3] == U'-') {
  ------------------
  |  Branch (8125:7): [True: 1, False: 1]
  ------------------
 8126|      1|    return false;
 8127|      1|  }
 8128|    253|  return true;
 8129|    254|}
_ZN3ada4idna17utf32_to_punycodeENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEERNS1_12basic_stringIcNS3_IcEENS1_9allocatorIcEEEE:
 8209|    543|bool utf32_to_punycode(std::u32string_view input, std::string &out) {
 8210|    543|  out.reserve(input.size() + out.size());
 8211|    543|  uint32_t n = initial_n;
 8212|    543|  int32_t d = 0;
 8213|    543|  int32_t bias = initial_bias;
 8214|    543|  size_t h = 0;
 8215|       |  // first push the ascii content
 8216|  5.45k|  for (uint32_t c : input) {
  ------------------
  |  Branch (8216:19): [True: 5.45k, False: 543]
  ------------------
 8217|  5.45k|    if (c < 0x80) {
  ------------------
  |  Branch (8217:9): [True: 4.62k, False: 827]
  ------------------
 8218|  4.62k|      ++h;
 8219|  4.62k|      out.push_back(char(c));
 8220|  4.62k|    }
 8221|  5.45k|    if (c > 0x10ffff || (c >= 0xd800 && c < 0xe000)) {
  ------------------
  |  Branch (8221:9): [True: 0, False: 5.45k]
  |  Branch (8221:26): [True: 185, False: 5.27k]
  |  Branch (8221:41): [True: 0, False: 185]
  ------------------
 8222|      0|      return false;
 8223|      0|    }
 8224|  5.45k|  }
 8225|    543|  size_t b = h;
 8226|    543|  if (b > 0) {
  ------------------
  |  Branch (8226:7): [True: 457, False: 86]
  ------------------
 8227|    457|    out.push_back('-');
 8228|    457|  }
 8229|  1.28k|  while (h < input.size()) {
  ------------------
  |  Branch (8229:10): [True: 738, False: 543]
  ------------------
 8230|    738|    uint32_t m = 0x10FFFF;
 8231|  12.6k|    for (auto code_point : input) {
  ------------------
  |  Branch (8231:26): [True: 12.6k, False: 738]
  ------------------
 8232|  12.6k|      if (code_point >= n && code_point < m) m = code_point;
  ------------------
  |  Branch (8232:11): [True: 1.42k, False: 11.2k]
  |  Branch (8232:30): [True: 865, False: 559]
  ------------------
 8233|  12.6k|    }
 8234|       |
 8235|    738|    if ((m - n) > (0x7fffffff - d) / (h + 1)) {
  ------------------
  |  Branch (8235:9): [True: 0, False: 738]
  ------------------
 8236|      0|      return false;
 8237|      0|    }
 8238|    738|    d = d + int32_t((m - n) * (h + 1));
 8239|    738|    n = m;
 8240|  12.6k|    for (auto c : input) {
  ------------------
  |  Branch (8240:17): [True: 12.6k, False: 738]
  ------------------
 8241|  12.6k|      if (c < n) {
  ------------------
  |  Branch (8241:11): [True: 11.2k, False: 1.42k]
  ------------------
 8242|  11.2k|        if (d == 0x7fffffff) {
  ------------------
  |  Branch (8242:13): [True: 0, False: 11.2k]
  ------------------
 8243|      0|          return false;
 8244|      0|        }
 8245|  11.2k|        ++d;
 8246|  11.2k|      }
 8247|  12.6k|      if (c == n) {
  ------------------
  |  Branch (8247:11): [True: 827, False: 11.8k]
  ------------------
 8248|    827|        int32_t q = d;
 8249|  2.61k|        for (int32_t k = base;; k += base) {
 8250|  2.61k|          int32_t t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;
  ------------------
  |  Branch (8250:23): [True: 1.25k, False: 1.36k]
  |  Branch (8250:42): [True: 1.21k, False: 152]
  ------------------
 8251|       |
 8252|  2.61k|          if (q < t) {
  ------------------
  |  Branch (8252:15): [True: 827, False: 1.79k]
  ------------------
 8253|    827|            break;
 8254|    827|          }
 8255|  1.79k|          out.push_back(digit_to_char(t + ((q - t) % (base - t))));
 8256|  1.79k|          q = (q - t) / (base - t);
 8257|  1.79k|        }
 8258|    827|        out.push_back(digit_to_char(q));
 8259|    827|        bias = adapt(d, int32_t(h + 1), h == b);
 8260|    827|        d = 0;
 8261|    827|        ++h;
 8262|    827|      }
 8263|  12.6k|    }
 8264|    738|    ++d;
 8265|    738|    ++n;
 8266|    738|  }
 8267|    543|  return true;
 8268|    543|}
_ZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 9075|    844|bool is_label_valid(const std::u32string_view label) {
 9076|    844|  if (label.empty()) {
  ------------------
  |  Branch (9076:7): [True: 0, False: 844]
  ------------------
 9077|      0|    return true;
 9078|      0|  }
 9079|       |
 9080|       |  ///////////////
 9081|       |  // We have a normalization step which ensures that we are in NFC.
 9082|       |  // If we receive punycode, we normalize and check that the normalized
 9083|       |  // version matches the original.
 9084|       |  // --------------------------------------
 9085|       |  // The label must be in Unicode Normalization Form NFC.
 9086|       |
 9087|       |  // Current URL standard indicatest that CheckHyphens is set to false.
 9088|       |  // ---------------------------------------
 9089|       |  // If CheckHyphens, the label must not contain a U+002D HYPHEN-MINUS character
 9090|       |  // in both the third and fourth positions. If CheckHyphens, the label must
 9091|       |  // neither begin nor end with a U+002D HYPHEN-MINUS character.
 9092|       |
 9093|       |  // This is not necessary because we segment the
 9094|       |  // labels by '.'.
 9095|       |  // ---------------------------------------
 9096|       |  // The label must not contain a U+002E ( . ) FULL STOP.
 9097|       |  // if (label.find('.') != std::string_view::npos) return false;
 9098|       |
 9099|       |  // The label must not begin with a combining mark, that is:
 9100|       |  // General_Category=Mark.
 9101|    844|  constexpr static uint32_t combining[] = {
 9102|    844|      0x300,   0x301,   0x302,   0x303,   0x304,   0x305,   0x306,   0x307,
 9103|    844|      0x308,   0x309,   0x30a,   0x30b,   0x30c,   0x30d,   0x30e,   0x30f,
 9104|    844|      0x310,   0x311,   0x312,   0x313,   0x314,   0x315,   0x316,   0x317,
 9105|    844|      0x318,   0x319,   0x31a,   0x31b,   0x31c,   0x31d,   0x31e,   0x31f,
 9106|    844|      0x320,   0x321,   0x322,   0x323,   0x324,   0x325,   0x326,   0x327,
 9107|    844|      0x328,   0x329,   0x32a,   0x32b,   0x32c,   0x32d,   0x32e,   0x32f,
 9108|    844|      0x330,   0x331,   0x332,   0x333,   0x334,   0x335,   0x336,   0x337,
 9109|    844|      0x338,   0x339,   0x33a,   0x33b,   0x33c,   0x33d,   0x33e,   0x33f,
 9110|    844|      0x340,   0x341,   0x342,   0x343,   0x344,   0x345,   0x346,   0x347,
 9111|    844|      0x348,   0x349,   0x34a,   0x34b,   0x34c,   0x34d,   0x34e,   0x34f,
 9112|    844|      0x350,   0x351,   0x352,   0x353,   0x354,   0x355,   0x356,   0x357,
 9113|    844|      0x358,   0x359,   0x35a,   0x35b,   0x35c,   0x35d,   0x35e,   0x35f,
 9114|    844|      0x360,   0x361,   0x362,   0x363,   0x364,   0x365,   0x366,   0x367,
 9115|    844|      0x368,   0x369,   0x36a,   0x36b,   0x36c,   0x36d,   0x36e,   0x36f,
 9116|    844|      0x483,   0x484,   0x485,   0x486,   0x487,   0x488,   0x489,   0x591,
 9117|    844|      0x592,   0x593,   0x594,   0x595,   0x596,   0x597,   0x598,   0x599,
 9118|    844|      0x59a,   0x59b,   0x59c,   0x59d,   0x59e,   0x59f,   0x5a0,   0x5a1,
 9119|    844|      0x5a2,   0x5a3,   0x5a4,   0x5a5,   0x5a6,   0x5a7,   0x5a8,   0x5a9,
 9120|    844|      0x5aa,   0x5ab,   0x5ac,   0x5ad,   0x5ae,   0x5af,   0x5b0,   0x5b1,
 9121|    844|      0x5b2,   0x5b3,   0x5b4,   0x5b5,   0x5b6,   0x5b7,   0x5b8,   0x5b9,
 9122|    844|      0x5ba,   0x5bb,   0x5bc,   0x5bd,   0x5bf,   0x5c1,   0x5c2,   0x5c4,
 9123|    844|      0x5c5,   0x5c7,   0x610,   0x611,   0x612,   0x613,   0x614,   0x615,
 9124|    844|      0x616,   0x617,   0x618,   0x619,   0x61a,   0x64b,   0x64c,   0x64d,
 9125|    844|      0x64e,   0x64f,   0x650,   0x651,   0x652,   0x653,   0x654,   0x655,
 9126|    844|      0x656,   0x657,   0x658,   0x659,   0x65a,   0x65b,   0x65c,   0x65d,
 9127|    844|      0x65e,   0x65f,   0x670,   0x6d6,   0x6d7,   0x6d8,   0x6d9,   0x6da,
 9128|    844|      0x6db,   0x6dc,   0x6df,   0x6e0,   0x6e1,   0x6e2,   0x6e3,   0x6e4,
 9129|    844|      0x6e7,   0x6e8,   0x6ea,   0x6eb,   0x6ec,   0x6ed,   0x711,   0x730,
 9130|    844|      0x731,   0x732,   0x733,   0x734,   0x735,   0x736,   0x737,   0x738,
 9131|    844|      0x739,   0x73a,   0x73b,   0x73c,   0x73d,   0x73e,   0x73f,   0x740,
 9132|    844|      0x741,   0x742,   0x743,   0x744,   0x745,   0x746,   0x747,   0x748,
 9133|    844|      0x749,   0x74a,   0x7a6,   0x7a7,   0x7a8,   0x7a9,   0x7aa,   0x7ab,
 9134|    844|      0x7ac,   0x7ad,   0x7ae,   0x7af,   0x7b0,   0x7eb,   0x7ec,   0x7ed,
 9135|    844|      0x7ee,   0x7ef,   0x7f0,   0x7f1,   0x7f2,   0x7f3,   0x7fd,   0x816,
 9136|    844|      0x817,   0x818,   0x819,   0x81b,   0x81c,   0x81d,   0x81e,   0x81f,
 9137|    844|      0x820,   0x821,   0x822,   0x823,   0x825,   0x826,   0x827,   0x829,
 9138|    844|      0x82a,   0x82b,   0x82c,   0x82d,   0x859,   0x85a,   0x85b,   0x8d3,
 9139|    844|      0x8d4,   0x8d5,   0x8d6,   0x8d7,   0x8d8,   0x8d9,   0x8da,   0x8db,
 9140|    844|      0x8dc,   0x8dd,   0x8de,   0x8df,   0x8e0,   0x8e1,   0x8e3,   0x8e4,
 9141|    844|      0x8e5,   0x8e6,   0x8e7,   0x8e8,   0x8e9,   0x8ea,   0x8eb,   0x8ec,
 9142|    844|      0x8ed,   0x8ee,   0x8ef,   0x8f0,   0x8f1,   0x8f2,   0x8f3,   0x8f4,
 9143|    844|      0x8f5,   0x8f6,   0x8f7,   0x8f8,   0x8f9,   0x8fa,   0x8fb,   0x8fc,
 9144|    844|      0x8fd,   0x8fe,   0x8ff,   0x900,   0x901,   0x902,   0x903,   0x93a,
 9145|    844|      0x93b,   0x93c,   0x93e,   0x93f,   0x940,   0x941,   0x942,   0x943,
 9146|    844|      0x944,   0x945,   0x946,   0x947,   0x948,   0x949,   0x94a,   0x94b,
 9147|    844|      0x94c,   0x94d,   0x94e,   0x94f,   0x951,   0x952,   0x953,   0x954,
 9148|    844|      0x955,   0x956,   0x957,   0x962,   0x963,   0x981,   0x982,   0x983,
 9149|    844|      0x9bc,   0x9be,   0x9bf,   0x9c0,   0x9c1,   0x9c2,   0x9c3,   0x9c4,
 9150|    844|      0x9c7,   0x9c8,   0x9cb,   0x9cc,   0x9cd,   0x9d7,   0x9e2,   0x9e3,
 9151|    844|      0x9fe,   0xa01,   0xa02,   0xa03,   0xa3c,   0xa3e,   0xa3f,   0xa40,
 9152|    844|      0xa41,   0xa42,   0xa47,   0xa48,   0xa4b,   0xa4c,   0xa4d,   0xa51,
 9153|    844|      0xa70,   0xa71,   0xa75,   0xa81,   0xa82,   0xa83,   0xabc,   0xabe,
 9154|    844|      0xabf,   0xac0,   0xac1,   0xac2,   0xac3,   0xac4,   0xac5,   0xac7,
 9155|    844|      0xac8,   0xac9,   0xacb,   0xacc,   0xacd,   0xae2,   0xae3,   0xafa,
 9156|    844|      0xafb,   0xafc,   0xafd,   0xafe,   0xaff,   0xb01,   0xb02,   0xb03,
 9157|    844|      0xb3c,   0xb3e,   0xb3f,   0xb40,   0xb41,   0xb42,   0xb43,   0xb44,
 9158|    844|      0xb47,   0xb48,   0xb4b,   0xb4c,   0xb4d,   0xb55,   0xb56,   0xb57,
 9159|    844|      0xb62,   0xb63,   0xb82,   0xbbe,   0xbbf,   0xbc0,   0xbc1,   0xbc2,
 9160|    844|      0xbc6,   0xbc7,   0xbc8,   0xbca,   0xbcb,   0xbcc,   0xbcd,   0xbd7,
 9161|    844|      0xc00,   0xc01,   0xc02,   0xc03,   0xc04,   0xc3e,   0xc3f,   0xc40,
 9162|    844|      0xc41,   0xc42,   0xc43,   0xc44,   0xc46,   0xc47,   0xc48,   0xc4a,
 9163|    844|      0xc4b,   0xc4c,   0xc4d,   0xc55,   0xc56,   0xc62,   0xc63,   0xc81,
 9164|    844|      0xc82,   0xc83,   0xcbc,   0xcbe,   0xcbf,   0xcc0,   0xcc1,   0xcc2,
 9165|    844|      0xcc3,   0xcc4,   0xcc6,   0xcc7,   0xcc8,   0xcca,   0xccb,   0xccc,
 9166|    844|      0xccd,   0xcd5,   0xcd6,   0xce2,   0xce3,   0xd00,   0xd01,   0xd02,
 9167|    844|      0xd03,   0xd3b,   0xd3c,   0xd3e,   0xd3f,   0xd40,   0xd41,   0xd42,
 9168|    844|      0xd43,   0xd44,   0xd46,   0xd47,   0xd48,   0xd4a,   0xd4b,   0xd4c,
 9169|    844|      0xd4d,   0xd57,   0xd62,   0xd63,   0xd81,   0xd82,   0xd83,   0xdca,
 9170|    844|      0xdcf,   0xdd0,   0xdd1,   0xdd2,   0xdd3,   0xdd4,   0xdd6,   0xdd8,
 9171|    844|      0xdd9,   0xdda,   0xddb,   0xddc,   0xddd,   0xdde,   0xddf,   0xdf2,
 9172|    844|      0xdf3,   0xe31,   0xe34,   0xe35,   0xe36,   0xe37,   0xe38,   0xe39,
 9173|    844|      0xe3a,   0xe47,   0xe48,   0xe49,   0xe4a,   0xe4b,   0xe4c,   0xe4d,
 9174|    844|      0xe4e,   0xeb1,   0xeb4,   0xeb5,   0xeb6,   0xeb7,   0xeb8,   0xeb9,
 9175|    844|      0xeba,   0xebb,   0xebc,   0xec8,   0xec9,   0xeca,   0xecb,   0xecc,
 9176|    844|      0xecd,   0xf18,   0xf19,   0xf35,   0xf37,   0xf39,   0xf3e,   0xf3f,
 9177|    844|      0xf71,   0xf72,   0xf73,   0xf74,   0xf75,   0xf76,   0xf77,   0xf78,
 9178|    844|      0xf79,   0xf7a,   0xf7b,   0xf7c,   0xf7d,   0xf7e,   0xf7f,   0xf80,
 9179|    844|      0xf81,   0xf82,   0xf83,   0xf84,   0xf86,   0xf87,   0xf8d,   0xf8e,
 9180|    844|      0xf8f,   0xf90,   0xf91,   0xf92,   0xf93,   0xf94,   0xf95,   0xf96,
 9181|    844|      0xf97,   0xf99,   0xf9a,   0xf9b,   0xf9c,   0xf9d,   0xf9e,   0xf9f,
 9182|    844|      0xfa0,   0xfa1,   0xfa2,   0xfa3,   0xfa4,   0xfa5,   0xfa6,   0xfa7,
 9183|    844|      0xfa8,   0xfa9,   0xfaa,   0xfab,   0xfac,   0xfad,   0xfae,   0xfaf,
 9184|    844|      0xfb0,   0xfb1,   0xfb2,   0xfb3,   0xfb4,   0xfb5,   0xfb6,   0xfb7,
 9185|    844|      0xfb8,   0xfb9,   0xfba,   0xfbb,   0xfbc,   0xfc6,   0x102b,  0x102c,
 9186|    844|      0x102d,  0x102e,  0x102f,  0x1030,  0x1031,  0x1032,  0x1033,  0x1034,
 9187|    844|      0x1035,  0x1036,  0x1037,  0x1038,  0x1039,  0x103a,  0x103b,  0x103c,
 9188|    844|      0x103d,  0x103e,  0x1056,  0x1057,  0x1058,  0x1059,  0x105e,  0x105f,
 9189|    844|      0x1060,  0x1062,  0x1063,  0x1064,  0x1067,  0x1068,  0x1069,  0x106a,
 9190|    844|      0x106b,  0x106c,  0x106d,  0x1071,  0x1072,  0x1073,  0x1074,  0x1082,
 9191|    844|      0x1083,  0x1084,  0x1085,  0x1086,  0x1087,  0x1088,  0x1089,  0x108a,
 9192|    844|      0x108b,  0x108c,  0x108d,  0x108f,  0x109a,  0x109b,  0x109c,  0x109d,
 9193|    844|      0x135d,  0x135e,  0x135f,  0x1712,  0x1713,  0x1714,  0x1732,  0x1733,
 9194|    844|      0x1734,  0x1752,  0x1753,  0x1772,  0x1773,  0x17b4,  0x17b5,  0x17b6,
 9195|    844|      0x17b7,  0x17b8,  0x17b9,  0x17ba,  0x17bb,  0x17bc,  0x17bd,  0x17be,
 9196|    844|      0x17bf,  0x17c0,  0x17c1,  0x17c2,  0x17c3,  0x17c4,  0x17c5,  0x17c6,
 9197|    844|      0x17c7,  0x17c8,  0x17c9,  0x17ca,  0x17cb,  0x17cc,  0x17cd,  0x17ce,
 9198|    844|      0x17cf,  0x17d0,  0x17d1,  0x17d2,  0x17d3,  0x17dd,  0x180b,  0x180c,
 9199|    844|      0x180d,  0x1885,  0x1886,  0x18a9,  0x1920,  0x1921,  0x1922,  0x1923,
 9200|    844|      0x1924,  0x1925,  0x1926,  0x1927,  0x1928,  0x1929,  0x192a,  0x192b,
 9201|    844|      0x1930,  0x1931,  0x1932,  0x1933,  0x1934,  0x1935,  0x1936,  0x1937,
 9202|    844|      0x1938,  0x1939,  0x193a,  0x193b,  0x1a17,  0x1a18,  0x1a19,  0x1a1a,
 9203|    844|      0x1a1b,  0x1a55,  0x1a56,  0x1a57,  0x1a58,  0x1a59,  0x1a5a,  0x1a5b,
 9204|    844|      0x1a5c,  0x1a5d,  0x1a5e,  0x1a60,  0x1a61,  0x1a62,  0x1a63,  0x1a64,
 9205|    844|      0x1a65,  0x1a66,  0x1a67,  0x1a68,  0x1a69,  0x1a6a,  0x1a6b,  0x1a6c,
 9206|    844|      0x1a6d,  0x1a6e,  0x1a6f,  0x1a70,  0x1a71,  0x1a72,  0x1a73,  0x1a74,
 9207|    844|      0x1a75,  0x1a76,  0x1a77,  0x1a78,  0x1a79,  0x1a7a,  0x1a7b,  0x1a7c,
 9208|    844|      0x1a7f,  0x1ab0,  0x1ab1,  0x1ab2,  0x1ab3,  0x1ab4,  0x1ab5,  0x1ab6,
 9209|    844|      0x1ab7,  0x1ab8,  0x1ab9,  0x1aba,  0x1abb,  0x1abc,  0x1abd,  0x1abe,
 9210|    844|      0x1abf,  0x1ac0,  0x1b00,  0x1b01,  0x1b02,  0x1b03,  0x1b04,  0x1b34,
 9211|    844|      0x1b35,  0x1b36,  0x1b37,  0x1b38,  0x1b39,  0x1b3a,  0x1b3b,  0x1b3c,
 9212|    844|      0x1b3d,  0x1b3e,  0x1b3f,  0x1b40,  0x1b41,  0x1b42,  0x1b43,  0x1b44,
 9213|    844|      0x1b6b,  0x1b6c,  0x1b6d,  0x1b6e,  0x1b6f,  0x1b70,  0x1b71,  0x1b72,
 9214|    844|      0x1b73,  0x1b80,  0x1b81,  0x1b82,  0x1ba1,  0x1ba2,  0x1ba3,  0x1ba4,
 9215|    844|      0x1ba5,  0x1ba6,  0x1ba7,  0x1ba8,  0x1ba9,  0x1baa,  0x1bab,  0x1bac,
 9216|    844|      0x1bad,  0x1be6,  0x1be7,  0x1be8,  0x1be9,  0x1bea,  0x1beb,  0x1bec,
 9217|    844|      0x1bed,  0x1bee,  0x1bef,  0x1bf0,  0x1bf1,  0x1bf2,  0x1bf3,  0x1c24,
 9218|    844|      0x1c25,  0x1c26,  0x1c27,  0x1c28,  0x1c29,  0x1c2a,  0x1c2b,  0x1c2c,
 9219|    844|      0x1c2d,  0x1c2e,  0x1c2f,  0x1c30,  0x1c31,  0x1c32,  0x1c33,  0x1c34,
 9220|    844|      0x1c35,  0x1c36,  0x1c37,  0x1cd0,  0x1cd1,  0x1cd2,  0x1cd4,  0x1cd5,
 9221|    844|      0x1cd6,  0x1cd7,  0x1cd8,  0x1cd9,  0x1cda,  0x1cdb,  0x1cdc,  0x1cdd,
 9222|    844|      0x1cde,  0x1cdf,  0x1ce0,  0x1ce1,  0x1ce2,  0x1ce3,  0x1ce4,  0x1ce5,
 9223|    844|      0x1ce6,  0x1ce7,  0x1ce8,  0x1ced,  0x1cf4,  0x1cf7,  0x1cf8,  0x1cf9,
 9224|    844|      0x1dc0,  0x1dc1,  0x1dc2,  0x1dc3,  0x1dc4,  0x1dc5,  0x1dc6,  0x1dc7,
 9225|    844|      0x1dc8,  0x1dc9,  0x1dca,  0x1dcb,  0x1dcc,  0x1dcd,  0x1dce,  0x1dcf,
 9226|    844|      0x1dd0,  0x1dd1,  0x1dd2,  0x1dd3,  0x1dd4,  0x1dd5,  0x1dd6,  0x1dd7,
 9227|    844|      0x1dd8,  0x1dd9,  0x1dda,  0x1ddb,  0x1ddc,  0x1ddd,  0x1dde,  0x1ddf,
 9228|    844|      0x1de0,  0x1de1,  0x1de2,  0x1de3,  0x1de4,  0x1de5,  0x1de6,  0x1de7,
 9229|    844|      0x1de8,  0x1de9,  0x1dea,  0x1deb,  0x1dec,  0x1ded,  0x1dee,  0x1def,
 9230|    844|      0x1df0,  0x1df1,  0x1df2,  0x1df3,  0x1df4,  0x1df5,  0x1df6,  0x1df7,
 9231|    844|      0x1df8,  0x1df9,  0x1dfb,  0x1dfc,  0x1dfd,  0x1dfe,  0x1dff,  0x20d0,
 9232|    844|      0x20d1,  0x20d2,  0x20d3,  0x20d4,  0x20d5,  0x20d6,  0x20d7,  0x20d8,
 9233|    844|      0x20d9,  0x20da,  0x20db,  0x20dc,  0x20dd,  0x20de,  0x20df,  0x20e0,
 9234|    844|      0x20e1,  0x20e2,  0x20e3,  0x20e4,  0x20e5,  0x20e6,  0x20e7,  0x20e8,
 9235|    844|      0x20e9,  0x20ea,  0x20eb,  0x20ec,  0x20ed,  0x20ee,  0x20ef,  0x20f0,
 9236|    844|      0x2cef,  0x2cf0,  0x2cf1,  0x2d7f,  0x2de0,  0x2de1,  0x2de2,  0x2de3,
 9237|    844|      0x2de4,  0x2de5,  0x2de6,  0x2de7,  0x2de8,  0x2de9,  0x2dea,  0x2deb,
 9238|    844|      0x2dec,  0x2ded,  0x2dee,  0x2def,  0x2df0,  0x2df1,  0x2df2,  0x2df3,
 9239|    844|      0x2df4,  0x2df5,  0x2df6,  0x2df7,  0x2df8,  0x2df9,  0x2dfa,  0x2dfb,
 9240|    844|      0x2dfc,  0x2dfd,  0x2dfe,  0x2dff,  0x302a,  0x302b,  0x302c,  0x302d,
 9241|    844|      0x302e,  0x302f,  0x3099,  0x309a,  0xa66f,  0xa670,  0xa671,  0xa672,
 9242|    844|      0xa674,  0xa675,  0xa676,  0xa677,  0xa678,  0xa679,  0xa67a,  0xa67b,
 9243|    844|      0xa67c,  0xa67d,  0xa69e,  0xa69f,  0xa6f0,  0xa6f1,  0xa802,  0xa806,
 9244|    844|      0xa80b,  0xa823,  0xa824,  0xa825,  0xa826,  0xa827,  0xa82c,  0xa880,
 9245|    844|      0xa881,  0xa8b4,  0xa8b5,  0xa8b6,  0xa8b7,  0xa8b8,  0xa8b9,  0xa8ba,
 9246|    844|      0xa8bb,  0xa8bc,  0xa8bd,  0xa8be,  0xa8bf,  0xa8c0,  0xa8c1,  0xa8c2,
 9247|    844|      0xa8c3,  0xa8c4,  0xa8c5,  0xa8e0,  0xa8e1,  0xa8e2,  0xa8e3,  0xa8e4,
 9248|    844|      0xa8e5,  0xa8e6,  0xa8e7,  0xa8e8,  0xa8e9,  0xa8ea,  0xa8eb,  0xa8ec,
 9249|    844|      0xa8ed,  0xa8ee,  0xa8ef,  0xa8f0,  0xa8f1,  0xa8ff,  0xa926,  0xa927,
 9250|    844|      0xa928,  0xa929,  0xa92a,  0xa92b,  0xa92c,  0xa92d,  0xa947,  0xa948,
 9251|    844|      0xa949,  0xa94a,  0xa94b,  0xa94c,  0xa94d,  0xa94e,  0xa94f,  0xa950,
 9252|    844|      0xa951,  0xa952,  0xa953,  0xa980,  0xa981,  0xa982,  0xa983,  0xa9b3,
 9253|    844|      0xa9b4,  0xa9b5,  0xa9b6,  0xa9b7,  0xa9b8,  0xa9b9,  0xa9ba,  0xa9bb,
 9254|    844|      0xa9bc,  0xa9bd,  0xa9be,  0xa9bf,  0xa9c0,  0xa9e5,  0xaa29,  0xaa2a,
 9255|    844|      0xaa2b,  0xaa2c,  0xaa2d,  0xaa2e,  0xaa2f,  0xaa30,  0xaa31,  0xaa32,
 9256|    844|      0xaa33,  0xaa34,  0xaa35,  0xaa36,  0xaa43,  0xaa4c,  0xaa4d,  0xaa7b,
 9257|    844|      0xaa7c,  0xaa7d,  0xaab0,  0xaab2,  0xaab3,  0xaab4,  0xaab7,  0xaab8,
 9258|    844|      0xaabe,  0xaabf,  0xaac1,  0xaaeb,  0xaaec,  0xaaed,  0xaaee,  0xaaef,
 9259|    844|      0xaaf5,  0xaaf6,  0xabe3,  0xabe4,  0xabe5,  0xabe6,  0xabe7,  0xabe8,
 9260|    844|      0xabe9,  0xabea,  0xabec,  0xabed,  0xfb1e,  0xfe00,  0xfe01,  0xfe02,
 9261|    844|      0xfe03,  0xfe04,  0xfe05,  0xfe06,  0xfe07,  0xfe08,  0xfe09,  0xfe0a,
 9262|    844|      0xfe0b,  0xfe0c,  0xfe0d,  0xfe0e,  0xfe0f,  0xfe20,  0xfe21,  0xfe22,
 9263|    844|      0xfe23,  0xfe24,  0xfe25,  0xfe26,  0xfe27,  0xfe28,  0xfe29,  0xfe2a,
 9264|    844|      0xfe2b,  0xfe2c,  0xfe2d,  0xfe2e,  0xfe2f,  0x101fd, 0x102e0, 0x10376,
 9265|    844|      0x10377, 0x10378, 0x10379, 0x1037a, 0x10a01, 0x10a02, 0x10a03, 0x10a05,
 9266|    844|      0x10a06, 0x10a0c, 0x10a0d, 0x10a0e, 0x10a0f, 0x10a38, 0x10a39, 0x10a3a,
 9267|    844|      0x10a3f, 0x10ae5, 0x10ae6, 0x10d24, 0x10d25, 0x10d26, 0x10d27, 0x10eab,
 9268|    844|      0x10eac, 0x10f46, 0x10f47, 0x10f48, 0x10f49, 0x10f4a, 0x10f4b, 0x10f4c,
 9269|    844|      0x10f4d, 0x10f4e, 0x10f4f, 0x10f50, 0x11000, 0x11001, 0x11002, 0x11038,
 9270|    844|      0x11039, 0x1103a, 0x1103b, 0x1103c, 0x1103d, 0x1103e, 0x1103f, 0x11040,
 9271|    844|      0x11041, 0x11042, 0x11043, 0x11044, 0x11045, 0x11046, 0x1107f, 0x11080,
 9272|    844|      0x11081, 0x11082, 0x110b0, 0x110b1, 0x110b2, 0x110b3, 0x110b4, 0x110b5,
 9273|    844|      0x110b6, 0x110b7, 0x110b8, 0x110b9, 0x110ba, 0x11100, 0x11101, 0x11102,
 9274|    844|      0x11127, 0x11128, 0x11129, 0x1112a, 0x1112b, 0x1112c, 0x1112d, 0x1112e,
 9275|    844|      0x1112f, 0x11130, 0x11131, 0x11132, 0x11133, 0x11134, 0x11145, 0x11146,
 9276|    844|      0x11173, 0x11180, 0x11181, 0x11182, 0x111b3, 0x111b4, 0x111b5, 0x111b6,
 9277|    844|      0x111b7, 0x111b8, 0x111b9, 0x111ba, 0x111bb, 0x111bc, 0x111bd, 0x111be,
 9278|    844|      0x111bf, 0x111c0, 0x111c9, 0x111ca, 0x111cb, 0x111cc, 0x111ce, 0x111cf,
 9279|    844|      0x1122c, 0x1122d, 0x1122e, 0x1122f, 0x11230, 0x11231, 0x11232, 0x11233,
 9280|    844|      0x11234, 0x11235, 0x11236, 0x11237, 0x1123e, 0x112df, 0x112e0, 0x112e1,
 9281|    844|      0x112e2, 0x112e3, 0x112e4, 0x112e5, 0x112e6, 0x112e7, 0x112e8, 0x112e9,
 9282|    844|      0x112ea, 0x11300, 0x11301, 0x11302, 0x11303, 0x1133b, 0x1133c, 0x1133e,
 9283|    844|      0x1133f, 0x11340, 0x11341, 0x11342, 0x11343, 0x11344, 0x11347, 0x11348,
 9284|    844|      0x1134b, 0x1134c, 0x1134d, 0x11357, 0x11362, 0x11363, 0x11366, 0x11367,
 9285|    844|      0x11368, 0x11369, 0x1136a, 0x1136b, 0x1136c, 0x11370, 0x11371, 0x11372,
 9286|    844|      0x11373, 0x11374, 0x11435, 0x11436, 0x11437, 0x11438, 0x11439, 0x1143a,
 9287|    844|      0x1143b, 0x1143c, 0x1143d, 0x1143e, 0x1143f, 0x11440, 0x11441, 0x11442,
 9288|    844|      0x11443, 0x11444, 0x11445, 0x11446, 0x1145e, 0x114b0, 0x114b1, 0x114b2,
 9289|    844|      0x114b3, 0x114b4, 0x114b5, 0x114b6, 0x114b7, 0x114b8, 0x114b9, 0x114ba,
 9290|    844|      0x114bb, 0x114bc, 0x114bd, 0x114be, 0x114bf, 0x114c0, 0x114c1, 0x114c2,
 9291|    844|      0x114c3, 0x115af, 0x115b0, 0x115b1, 0x115b2, 0x115b3, 0x115b4, 0x115b5,
 9292|    844|      0x115b8, 0x115b9, 0x115ba, 0x115bb, 0x115bc, 0x115bd, 0x115be, 0x115bf,
 9293|    844|      0x115c0, 0x115dc, 0x115dd, 0x11630, 0x11631, 0x11632, 0x11633, 0x11634,
 9294|    844|      0x11635, 0x11636, 0x11637, 0x11638, 0x11639, 0x1163a, 0x1163b, 0x1163c,
 9295|    844|      0x1163d, 0x1163e, 0x1163f, 0x11640, 0x116ab, 0x116ac, 0x116ad, 0x116ae,
 9296|    844|      0x116af, 0x116b0, 0x116b1, 0x116b2, 0x116b3, 0x116b4, 0x116b5, 0x116b6,
 9297|    844|      0x116b7, 0x1171d, 0x1171e, 0x1171f, 0x11720, 0x11721, 0x11722, 0x11723,
 9298|    844|      0x11724, 0x11725, 0x11726, 0x11727, 0x11728, 0x11729, 0x1172a, 0x1172b,
 9299|    844|      0x1182c, 0x1182d, 0x1182e, 0x1182f, 0x11830, 0x11831, 0x11832, 0x11833,
 9300|    844|      0x11834, 0x11835, 0x11836, 0x11837, 0x11838, 0x11839, 0x1183a, 0x11930,
 9301|    844|      0x11931, 0x11932, 0x11933, 0x11934, 0x11935, 0x11937, 0x11938, 0x1193b,
 9302|    844|      0x1193c, 0x1193d, 0x1193e, 0x11940, 0x11942, 0x11943, 0x119d1, 0x119d2,
 9303|    844|      0x119d3, 0x119d4, 0x119d5, 0x119d6, 0x119d7, 0x119da, 0x119db, 0x119dc,
 9304|    844|      0x119dd, 0x119de, 0x119df, 0x119e0, 0x119e4, 0x11a01, 0x11a02, 0x11a03,
 9305|    844|      0x11a04, 0x11a05, 0x11a06, 0x11a07, 0x11a08, 0x11a09, 0x11a0a, 0x11a33,
 9306|    844|      0x11a34, 0x11a35, 0x11a36, 0x11a37, 0x11a38, 0x11a39, 0x11a3b, 0x11a3c,
 9307|    844|      0x11a3d, 0x11a3e, 0x11a47, 0x11a51, 0x11a52, 0x11a53, 0x11a54, 0x11a55,
 9308|    844|      0x11a56, 0x11a57, 0x11a58, 0x11a59, 0x11a5a, 0x11a5b, 0x11a8a, 0x11a8b,
 9309|    844|      0x11a8c, 0x11a8d, 0x11a8e, 0x11a8f, 0x11a90, 0x11a91, 0x11a92, 0x11a93,
 9310|    844|      0x11a94, 0x11a95, 0x11a96, 0x11a97, 0x11a98, 0x11a99, 0x11c2f, 0x11c30,
 9311|    844|      0x11c31, 0x11c32, 0x11c33, 0x11c34, 0x11c35, 0x11c36, 0x11c38, 0x11c39,
 9312|    844|      0x11c3a, 0x11c3b, 0x11c3c, 0x11c3d, 0x11c3e, 0x11c3f, 0x11c92, 0x11c93,
 9313|    844|      0x11c94, 0x11c95, 0x11c96, 0x11c97, 0x11c98, 0x11c99, 0x11c9a, 0x11c9b,
 9314|    844|      0x11c9c, 0x11c9d, 0x11c9e, 0x11c9f, 0x11ca0, 0x11ca1, 0x11ca2, 0x11ca3,
 9315|    844|      0x11ca4, 0x11ca5, 0x11ca6, 0x11ca7, 0x11ca9, 0x11caa, 0x11cab, 0x11cac,
 9316|    844|      0x11cad, 0x11cae, 0x11caf, 0x11cb0, 0x11cb1, 0x11cb2, 0x11cb3, 0x11cb4,
 9317|    844|      0x11cb5, 0x11cb6, 0x11d31, 0x11d32, 0x11d33, 0x11d34, 0x11d35, 0x11d36,
 9318|    844|      0x11d3a, 0x11d3c, 0x11d3d, 0x11d3f, 0x11d40, 0x11d41, 0x11d42, 0x11d43,
 9319|    844|      0x11d44, 0x11d45, 0x11d47, 0x11d8a, 0x11d8b, 0x11d8c, 0x11d8d, 0x11d8e,
 9320|    844|      0x11d90, 0x11d91, 0x11d93, 0x11d94, 0x11d95, 0x11d96, 0x11d97, 0x11ef3,
 9321|    844|      0x11ef4, 0x11ef5, 0x11ef6, 0x16af0, 0x16af1, 0x16af2, 0x16af3, 0x16af4,
 9322|    844|      0x16b30, 0x16b31, 0x16b32, 0x16b33, 0x16b34, 0x16b35, 0x16b36, 0x16f4f,
 9323|    844|      0x16f51, 0x16f52, 0x16f53, 0x16f54, 0x16f55, 0x16f56, 0x16f57, 0x16f58,
 9324|    844|      0x16f59, 0x16f5a, 0x16f5b, 0x16f5c, 0x16f5d, 0x16f5e, 0x16f5f, 0x16f60,
 9325|    844|      0x16f61, 0x16f62, 0x16f63, 0x16f64, 0x16f65, 0x16f66, 0x16f67, 0x16f68,
 9326|    844|      0x16f69, 0x16f6a, 0x16f6b, 0x16f6c, 0x16f6d, 0x16f6e, 0x16f6f, 0x16f70,
 9327|    844|      0x16f71, 0x16f72, 0x16f73, 0x16f74, 0x16f75, 0x16f76, 0x16f77, 0x16f78,
 9328|    844|      0x16f79, 0x16f7a, 0x16f7b, 0x16f7c, 0x16f7d, 0x16f7e, 0x16f7f, 0x16f80,
 9329|    844|      0x16f81, 0x16f82, 0x16f83, 0x16f84, 0x16f85, 0x16f86, 0x16f87, 0x16f8f,
 9330|    844|      0x16f90, 0x16f91, 0x16f92, 0x16fe4, 0x16ff0, 0x16ff1, 0x1bc9d, 0x1bc9e,
 9331|    844|      0x1d165, 0x1d166, 0x1d167, 0x1d168, 0x1d169, 0x1d16d, 0x1d16e, 0x1d16f,
 9332|    844|      0x1d170, 0x1d171, 0x1d172, 0x1d17b, 0x1d17c, 0x1d17d, 0x1d17e, 0x1d17f,
 9333|    844|      0x1d180, 0x1d181, 0x1d182, 0x1d185, 0x1d186, 0x1d187, 0x1d188, 0x1d189,
 9334|    844|      0x1d18a, 0x1d18b, 0x1d1aa, 0x1d1ab, 0x1d1ac, 0x1d1ad, 0x1d242, 0x1d243,
 9335|    844|      0x1d244, 0x1da00, 0x1da01, 0x1da02, 0x1da03, 0x1da04, 0x1da05, 0x1da06,
 9336|    844|      0x1da07, 0x1da08, 0x1da09, 0x1da0a, 0x1da0b, 0x1da0c, 0x1da0d, 0x1da0e,
 9337|    844|      0x1da0f, 0x1da10, 0x1da11, 0x1da12, 0x1da13, 0x1da14, 0x1da15, 0x1da16,
 9338|    844|      0x1da17, 0x1da18, 0x1da19, 0x1da1a, 0x1da1b, 0x1da1c, 0x1da1d, 0x1da1e,
 9339|    844|      0x1da1f, 0x1da20, 0x1da21, 0x1da22, 0x1da23, 0x1da24, 0x1da25, 0x1da26,
 9340|    844|      0x1da27, 0x1da28, 0x1da29, 0x1da2a, 0x1da2b, 0x1da2c, 0x1da2d, 0x1da2e,
 9341|    844|      0x1da2f, 0x1da30, 0x1da31, 0x1da32, 0x1da33, 0x1da34, 0x1da35, 0x1da36,
 9342|    844|      0x1da3b, 0x1da3c, 0x1da3d, 0x1da3e, 0x1da3f, 0x1da40, 0x1da41, 0x1da42,
 9343|    844|      0x1da43, 0x1da44, 0x1da45, 0x1da46, 0x1da47, 0x1da48, 0x1da49, 0x1da4a,
 9344|    844|      0x1da4b, 0x1da4c, 0x1da4d, 0x1da4e, 0x1da4f, 0x1da50, 0x1da51, 0x1da52,
 9345|    844|      0x1da53, 0x1da54, 0x1da55, 0x1da56, 0x1da57, 0x1da58, 0x1da59, 0x1da5a,
 9346|    844|      0x1da5b, 0x1da5c, 0x1da5d, 0x1da5e, 0x1da5f, 0x1da60, 0x1da61, 0x1da62,
 9347|    844|      0x1da63, 0x1da64, 0x1da65, 0x1da66, 0x1da67, 0x1da68, 0x1da69, 0x1da6a,
 9348|    844|      0x1da6b, 0x1da6c, 0x1da75, 0x1da84, 0x1da9b, 0x1da9c, 0x1da9d, 0x1da9e,
 9349|    844|      0x1da9f, 0x1daa1, 0x1daa2, 0x1daa3, 0x1daa4, 0x1daa5, 0x1daa6, 0x1daa7,
 9350|    844|      0x1daa8, 0x1daa9, 0x1daaa, 0x1daab, 0x1daac, 0x1daad, 0x1daae, 0x1daaf,
 9351|    844|      0x1e000, 0x1e001, 0x1e002, 0x1e003, 0x1e004, 0x1e005, 0x1e006, 0x1e008,
 9352|    844|      0x1e009, 0x1e00a, 0x1e00b, 0x1e00c, 0x1e00d, 0x1e00e, 0x1e00f, 0x1e010,
 9353|    844|      0x1e011, 0x1e012, 0x1e013, 0x1e014, 0x1e015, 0x1e016, 0x1e017, 0x1e018,
 9354|    844|      0x1e01b, 0x1e01c, 0x1e01d, 0x1e01e, 0x1e01f, 0x1e020, 0x1e021, 0x1e023,
 9355|    844|      0x1e024, 0x1e026, 0x1e027, 0x1e028, 0x1e029, 0x1e02a, 0x1e130, 0x1e131,
 9356|    844|      0x1e132, 0x1e133, 0x1e134, 0x1e135, 0x1e136, 0x1e2ec, 0x1e2ed, 0x1e2ee,
 9357|    844|      0x1e2ef, 0x1e8d0, 0x1e8d1, 0x1e8d2, 0x1e8d3, 0x1e8d4, 0x1e8d5, 0x1e8d6,
 9358|    844|      0x1e944, 0x1e945, 0x1e946, 0x1e947, 0x1e948, 0x1e949, 0x1e94a, 0xe0100,
 9359|    844|      0xe0101, 0xe0102, 0xe0103, 0xe0104, 0xe0105, 0xe0106, 0xe0107, 0xe0108,
 9360|    844|      0xe0109, 0xe010a, 0xe010b, 0xe010c, 0xe010d, 0xe010e, 0xe010f, 0xe0110,
 9361|    844|      0xe0111, 0xe0112, 0xe0113, 0xe0114, 0xe0115, 0xe0116, 0xe0117, 0xe0118,
 9362|    844|      0xe0119, 0xe011a, 0xe011b, 0xe011c, 0xe011d, 0xe011e, 0xe011f, 0xe0120,
 9363|    844|      0xe0121, 0xe0122, 0xe0123, 0xe0124, 0xe0125, 0xe0126, 0xe0127, 0xe0128,
 9364|    844|      0xe0129, 0xe012a, 0xe012b, 0xe012c, 0xe012d, 0xe012e, 0xe012f, 0xe0130,
 9365|    844|      0xe0131, 0xe0132, 0xe0133, 0xe0134, 0xe0135, 0xe0136, 0xe0137, 0xe0138,
 9366|    844|      0xe0139, 0xe013a, 0xe013b, 0xe013c, 0xe013d, 0xe013e, 0xe013f, 0xe0140,
 9367|    844|      0xe0141, 0xe0142, 0xe0143, 0xe0144, 0xe0145, 0xe0146, 0xe0147, 0xe0148,
 9368|    844|      0xe0149, 0xe014a, 0xe014b, 0xe014c, 0xe014d, 0xe014e, 0xe014f, 0xe0150,
 9369|    844|      0xe0151, 0xe0152, 0xe0153, 0xe0154, 0xe0155, 0xe0156, 0xe0157, 0xe0158,
 9370|    844|      0xe0159, 0xe015a, 0xe015b, 0xe015c, 0xe015d, 0xe015e, 0xe015f, 0xe0160,
 9371|    844|      0xe0161, 0xe0162, 0xe0163, 0xe0164, 0xe0165, 0xe0166, 0xe0167, 0xe0168,
 9372|    844|      0xe0169, 0xe016a, 0xe016b, 0xe016c, 0xe016d, 0xe016e, 0xe016f, 0xe0170,
 9373|    844|      0xe0171, 0xe0172, 0xe0173, 0xe0174, 0xe0175, 0xe0176, 0xe0177, 0xe0178,
 9374|    844|      0xe0179, 0xe017a, 0xe017b, 0xe017c, 0xe017d, 0xe017e, 0xe017f, 0xe0180,
 9375|    844|      0xe0181, 0xe0182, 0xe0183, 0xe0184, 0xe0185, 0xe0186, 0xe0187, 0xe0188,
 9376|    844|      0xe0189, 0xe018a, 0xe018b, 0xe018c, 0xe018d, 0xe018e, 0xe018f, 0xe0190,
 9377|    844|      0xe0191, 0xe0192, 0xe0193, 0xe0194, 0xe0195, 0xe0196, 0xe0197, 0xe0198,
 9378|    844|      0xe0199, 0xe019a, 0xe019b, 0xe019c, 0xe019d, 0xe019e, 0xe019f, 0xe01a0,
 9379|    844|      0xe01a1, 0xe01a2, 0xe01a3, 0xe01a4, 0xe01a5, 0xe01a6, 0xe01a7, 0xe01a8,
 9380|    844|      0xe01a9, 0xe01aa, 0xe01ab, 0xe01ac, 0xe01ad, 0xe01ae, 0xe01af, 0xe01b0,
 9381|    844|      0xe01b1, 0xe01b2, 0xe01b3, 0xe01b4, 0xe01b5, 0xe01b6, 0xe01b7, 0xe01b8,
 9382|    844|      0xe01b9, 0xe01ba, 0xe01bb, 0xe01bc, 0xe01bd, 0xe01be, 0xe01bf, 0xe01c0,
 9383|    844|      0xe01c1, 0xe01c2, 0xe01c3, 0xe01c4, 0xe01c5, 0xe01c6, 0xe01c7, 0xe01c8,
 9384|    844|      0xe01c9, 0xe01ca, 0xe01cb, 0xe01cc, 0xe01cd, 0xe01ce, 0xe01cf, 0xe01d0,
 9385|    844|      0xe01d1, 0xe01d2, 0xe01d3, 0xe01d4, 0xe01d5, 0xe01d6, 0xe01d7, 0xe01d8,
 9386|    844|      0xe01d9, 0xe01da, 0xe01db, 0xe01dc, 0xe01dd, 0xe01de, 0xe01df, 0xe01e0,
 9387|    844|      0xe01e1, 0xe01e2, 0xe01e3, 0xe01e4, 0xe01e5, 0xe01e6, 0xe01e7, 0xe01e8,
 9388|    844|      0xe01e9, 0xe01ea, 0xe01eb, 0xe01ec, 0xe01ed, 0xe01ee, 0xe01ef};
 9389|    844|  if (std::ranges::binary_search(combining, label.front())) {
  ------------------
  |  Branch (9389:7): [True: 6, False: 838]
  ------------------
 9390|      6|    return false;
 9391|      6|  }
 9392|       |  // We verify this next step as part of the mapping:
 9393|       |  // ---------------------------------------------
 9394|       |  // Each code point in the label must only have certain status values
 9395|       |  // according to Section 5, IDNA Mapping Table:
 9396|       |  // - For Transitional Processing, each value must be valid.
 9397|       |  // - For Nontransitional Processing, each value must be either valid or
 9398|       |  // deviation.
 9399|       |
 9400|       |  // If CheckJoiners, the label must satisfy the ContextJ rules from Appendix
 9401|       |  // A, in The Unicode Code Points and Internationalized Domain Names for
 9402|       |  // Applications (IDNA) [IDNA2008].
 9403|    838|  constexpr static uint32_t virama[] = {
 9404|    838|      0x094D,  0x09CD,  0x0A4D,  0x0ACD,  0x0B4D,  0x0BCD,  0x0C4D,  0x0CCD,
 9405|    838|      0x0D3B,  0x0D3C,  0x0D4D,  0x0DCA,  0x0E3A,  0x0EBA,  0x0F84,  0x1039,
 9406|    838|      0x103A,  0x1714,  0x1734,  0x17D2,  0x1A60,  0x1B44,  0x1BAA,  0x1BAB,
 9407|    838|      0x1BF2,  0x1BF3,  0x2D7F,  0xA806,  0xA82C,  0xA8C4,  0xA953,  0xA9C0,
 9408|    838|      0xAAF6,  0xABED,  0x10A3F, 0x11046, 0x1107F, 0x110B9, 0x11133, 0x11134,
 9409|    838|      0x111C0, 0x11235, 0x112EA, 0x1134D, 0x11442, 0x114C2, 0x115BF, 0x1163F,
 9410|    838|      0x116B6, 0x1172B, 0x11839, 0x1193D, 0x1193E, 0x119E0, 0x11A34, 0x11A47,
 9411|    838|      0x11A99, 0x11C3F, 0x11D44, 0x11D45, 0x11D97};
 9412|    838|  constexpr static uint32_t R[] = {
 9413|    838|      0x622, 0x623, 0x624, 0x625, 0x627, 0x629, 0x62f, 0x630, 0x631,
 9414|    838|      0x632, 0x648, 0x671, 0x672, 0x673, 0x675, 0x676, 0x677, 0x688,
 9415|    838|      0x689, 0x68a, 0x68b, 0x68c, 0x68d, 0x68e, 0x68f, 0x690, 0x691,
 9416|    838|      0x692, 0x693, 0x694, 0x695, 0x696, 0x697, 0x698, 0x699, 0x6c0,
 9417|    838|      0x6c3, 0x6c4, 0x6c5, 0x6c6, 0x6c7, 0x6c8, 0x6c9, 0x6ca, 0x6cb,
 9418|    838|      0x6cd, 0x6cf, 0x6d2, 0x6d3, 0x6d5, 0x6ee, 0x6ef, 0x710, 0x715,
 9419|    838|      0x716, 0x717, 0x718, 0x719, 0x71e, 0x728, 0x72a, 0x72c, 0x72f,
 9420|    838|      0x74d, 0x759, 0x75a, 0x75b, 0x854, 0x8aa, 0x8ab, 0x8ac};
 9421|    838|  constexpr static uint32_t L[] = {0xa872};
 9422|    838|  constexpr static uint32_t D[] = {
 9423|    838|      0x620,  0x626,  0x628,  0x62a,  0x62b,  0x62c,  0x62d,  0x62e,  0x633,
 9424|    838|      0x634,  0x635,  0x636,  0x637,  0x638,  0x639,  0x63a,  0x63b,  0x63c,
 9425|    838|      0x63d,  0x63e,  0x63f,  0x641,  0x642,  0x643,  0x644,  0x645,  0x646,
 9426|    838|      0x647,  0x649,  0x64a,  0x66e,  0x66f,  0x678,  0x679,  0x67a,  0x67b,
 9427|    838|      0x67c,  0x67d,  0x67e,  0x67f,  0x680,  0x681,  0x682,  0x683,  0x684,
 9428|    838|      0x685,  0x686,  0x687,  0x69a,  0x69b,  0x69c,  0x69d,  0x69e,  0x69f,
 9429|    838|      0x6a0,  0x6a1,  0x6a2,  0x6a3,  0x6a4,  0x6a5,  0x6a6,  0x6a7,  0x6a8,
 9430|    838|      0x6a9,  0x6aa,  0x6ab,  0x6ac,  0x6ad,  0x6ae,  0x6af,  0x6b0,  0x6b1,
 9431|    838|      0x6b2,  0x6b3,  0x6b4,  0x6b5,  0x6b6,  0x6b7,  0x6b8,  0x6b9,  0x6ba,
 9432|    838|      0x6bb,  0x6bc,  0x6bd,  0x6be,  0x6bf,  0x6c1,  0x6c2,  0x6cc,  0x6ce,
 9433|    838|      0x6d0,  0x6d1,  0x6fa,  0x6fb,  0x6fc,  0x6ff,  0x712,  0x713,  0x714,
 9434|    838|      0x71a,  0x71b,  0x71c,  0x71d,  0x71f,  0x720,  0x721,  0x722,  0x723,
 9435|    838|      0x724,  0x725,  0x726,  0x727,  0x729,  0x72b,  0x72d,  0x72e,  0x74e,
 9436|    838|      0x74f,  0x750,  0x751,  0x752,  0x753,  0x754,  0x755,  0x756,  0x757,
 9437|    838|      0x758,  0x75c,  0x75d,  0x75e,  0x75f,  0x760,  0x761,  0x762,  0x763,
 9438|    838|      0x764,  0x765,  0x766,  0x850,  0x851,  0x852,  0x853,  0x855,  0x8a0,
 9439|    838|      0x8a2,  0x8a3,  0x8a4,  0x8a5,  0x8a6,  0x8a7,  0x8a8,  0x8a9,  0x1807,
 9440|    838|      0x1820, 0x1821, 0x1822, 0x1823, 0x1824, 0x1825, 0x1826, 0x1827, 0x1828,
 9441|    838|      0x1829, 0x182a, 0x182b, 0x182c, 0x182d, 0x182e, 0x182f, 0x1830, 0x1831,
 9442|    838|      0x1832, 0x1833, 0x1834, 0x1835, 0x1836, 0x1837, 0x1838, 0x1839, 0x183a,
 9443|    838|      0x183b, 0x183c, 0x183d, 0x183e, 0x183f, 0x1840, 0x1841, 0x1842, 0x1843,
 9444|    838|      0x1844, 0x1845, 0x1846, 0x1847, 0x1848, 0x1849, 0x184a, 0x184b, 0x184c,
 9445|    838|      0x184d, 0x184e, 0x184f, 0x1850, 0x1851, 0x1852, 0x1853, 0x1854, 0x1855,
 9446|    838|      0x1856, 0x1857, 0x1858, 0x1859, 0x185a, 0x185b, 0x185c, 0x185d, 0x185e,
 9447|    838|      0x185f, 0x1860, 0x1861, 0x1862, 0x1863, 0x1864, 0x1865, 0x1866, 0x1867,
 9448|    838|      0x1868, 0x1869, 0x186a, 0x186b, 0x186c, 0x186d, 0x186e, 0x186f, 0x1870,
 9449|    838|      0x1871, 0x1872, 0x1873, 0x1874, 0x1875, 0x1876, 0x1877, 0x1887, 0x1888,
 9450|    838|      0x1889, 0x188a, 0x188b, 0x188c, 0x188d, 0x188e, 0x188f, 0x1890, 0x1891,
 9451|    838|      0x1892, 0x1893, 0x1894, 0x1895, 0x1896, 0x1897, 0x1898, 0x1899, 0x189a,
 9452|    838|      0x189b, 0x189c, 0x189d, 0x189e, 0x189f, 0x18a0, 0x18a1, 0x18a2, 0x18a3,
 9453|    838|      0x18a4, 0x18a5, 0x18a6, 0x18a7, 0x18a8, 0x18aa, 0xa840, 0xa841, 0xa842,
 9454|    838|      0xa843, 0xa844, 0xa845, 0xa846, 0xa847, 0xa848, 0xa849, 0xa84a, 0xa84b,
 9455|    838|      0xa84c, 0xa84d, 0xa84e, 0xa84f, 0xa850, 0xa851, 0xa852, 0xa853, 0xa854,
 9456|    838|      0xa855, 0xa856, 0xa857, 0xa858, 0xa859, 0xa85a, 0xa85b, 0xa85c, 0xa85d,
 9457|    838|      0xa85e, 0xa85f, 0xa860, 0xa861, 0xa862, 0xa863, 0xa864, 0xa865, 0xa866,
 9458|    838|      0xa867, 0xa868, 0xa869, 0xa86a, 0xa86b, 0xa86c, 0xa86d, 0xa86e, 0xa86f,
 9459|    838|      0xa870, 0xa871};
 9460|       |
 9461|  12.5k|  for (size_t i = 0; i < label.size(); i++) {
  ------------------
  |  Branch (9461:22): [True: 11.7k, False: 786]
  ------------------
 9462|  11.7k|    uint32_t c = label[i];
 9463|  11.7k|    if (c == 0x200c) {
  ------------------
  |  Branch (9463:9): [True: 47, False: 11.6k]
  ------------------
 9464|     47|      if (i > 0) {
  ------------------
  |  Branch (9464:11): [True: 46, False: 1]
  ------------------
 9465|     46|        if (std::ranges::binary_search(virama, label[i - 1])) {
  ------------------
  |  Branch (9465:13): [True: 2, False: 44]
  ------------------
 9466|      2|          return true;
 9467|      2|        }
 9468|     46|      }
 9469|     45|      if ((i == 0) || (i + 1 >= label.size())) {
  ------------------
  |  Branch (9469:11): [True: 1, False: 44]
  |  Branch (9469:23): [True: 1, False: 43]
  ------------------
 9470|      2|        return false;
 9471|      2|      }
 9472|       |      // we go backward looking for L or D
 9473|     43|      auto is_l_or_d = [](uint32_t code) {
 9474|     43|        return std::ranges::binary_search(L, code) ||
 9475|     43|               std::ranges::binary_search(D, code);
 9476|     43|      };
 9477|     43|      auto is_r_or_d = [](uint32_t code) {
 9478|     43|        return std::ranges::binary_search(R, code) ||
 9479|     43|               std::ranges::binary_search(D, code);
 9480|     43|      };
 9481|     43|      std::u32string_view before = label.substr(0, i);
 9482|     43|      std::u32string_view after = label.substr(i + 1);
 9483|     43|      return (std::find_if(before.begin(), before.end(), is_l_or_d) !=
  ------------------
  |  Branch (9483:14): [True: 20, False: 23]
  ------------------
 9484|     43|              before.end()) &&
 9485|     20|             (std::find_if(after.begin(), after.end(), is_r_or_d) !=
  ------------------
  |  Branch (9485:14): [True: 5, False: 15]
  ------------------
 9486|     20|              after.end());
 9487|  11.6k|    } else if (c == 0x200d) {
  ------------------
  |  Branch (9487:16): [True: 5, False: 11.6k]
  ------------------
 9488|      5|      if (i > 0) {
  ------------------
  |  Branch (9488:11): [True: 4, False: 1]
  ------------------
 9489|      4|        if (std::ranges::binary_search(virama, label[i - 1])) {
  ------------------
  |  Branch (9489:13): [True: 0, False: 4]
  ------------------
 9490|      0|          return true;
 9491|      0|        }
 9492|      4|      }
 9493|      5|      return false;
 9494|      5|    }
 9495|  11.7k|  }
 9496|       |
 9497|       |  // If CheckBidi, and if the domain name is a  Bidi domain name, then the label
 9498|       |  // must satisfy all six of the numbered conditions in [IDNA2008] RFC 5893,
 9499|       |  // Section 2.
 9500|       |
 9501|       |  // The following rule, consisting of six conditions, applies to labels
 9502|       |  // in Bidi domain names.  The requirements that this rule satisfies are
 9503|       |  // described in Section 3.  All of the conditions must be satisfied for
 9504|       |  // the rule to be satisfied.
 9505|       |  //
 9506|       |  //  1.  The first character must be a character with Bidi property L, R,
 9507|       |  //     or AL.  If it has the R or AL property, it is an RTL label; if it
 9508|       |  //     has the L property, it is an LTR label.
 9509|       |  //
 9510|       |  //  2.  In an RTL label, only characters with the Bidi properties R, AL,
 9511|       |  //      AN, EN, ES, CS, ET, ON, BN, or NSM are allowed.
 9512|       |  //
 9513|       |  //   3.  In an RTL label, the end of the label must be a character with
 9514|       |  //       Bidi property R, AL, EN, or AN, followed by zero or more
 9515|       |  //       characters with Bidi property NSM.
 9516|       |  //
 9517|       |  //   4.  In an RTL label, if an EN is present, no AN may be present, and
 9518|       |  //       vice versa.
 9519|       |  //
 9520|       |  //  5.  In an LTR label, only characters with the Bidi properties L, EN,
 9521|       |  //       ES, CS, ET, ON, BN, or NSM are allowed.
 9522|       |  //
 9523|       |  //   6.  In an LTR label, the end of the label must be a character with
 9524|       |  //       Bidi property L or EN, followed by zero or more characters with
 9525|       |  //       Bidi property NSM.
 9526|       |
 9527|    786|  size_t last_non_nsm_char = find_last_not_of_nsm(label);
 9528|    786|  if (last_non_nsm_char == std::u32string_view::npos) {
  ------------------
  |  Branch (9528:7): [True: 0, False: 786]
  ------------------
 9529|      0|    return false;
 9530|      0|  }
 9531|       |
 9532|       |  // A "Bidi domain name" is a domain name that contains at least one RTL label.
 9533|       |  // The following rule, consisting of six conditions, applies to labels in Bidi
 9534|       |  // domain names.
 9535|    786|  if (is_rtl_label(label)) {
  ------------------
  |  Branch (9535:7): [True: 167, False: 619]
  ------------------
 9536|       |    // The first character must be a character with Bidi property L, R,
 9537|       |    // or AL. If it has the R or AL property, it is an RTL label; if it
 9538|       |    // has the L property, it is an LTR label.
 9539|       |
 9540|    167|    if (find_direction(label[0]) == direction::L) {
  ------------------
  |  Branch (9540:9): [True: 70, False: 97]
  ------------------
 9541|       |      // Eval as LTR
 9542|       |
 9543|       |      // In an LTR label, only characters with the Bidi properties L, EN,
 9544|       |      // ES, CS, ET, ON, BN, or NSM are allowed.
 9545|  1.71k|      for (size_t i = 0; i <= last_non_nsm_char; i++) {
  ------------------
  |  Branch (9545:26): [True: 1.71k, False: 0]
  ------------------
 9546|  1.71k|        const direction d = find_direction(label[i]);
 9547|  1.71k|        if (!(d == direction::L || d == direction::EN || d == direction::ES ||
  ------------------
  |  Branch (9547:15): [True: 777, False: 936]
  |  Branch (9547:36): [True: 353, False: 583]
  |  Branch (9547:58): [True: 124, False: 459]
  ------------------
 9548|    459|              d == direction::CS || d == direction::ET || d == direction::ON ||
  ------------------
  |  Branch (9548:15): [True: 103, False: 356]
  |  Branch (9548:37): [True: 49, False: 307]
  |  Branch (9548:59): [True: 118, False: 189]
  ------------------
 9549|    189|              d == direction::BN || d == direction::NSM)) {
  ------------------
  |  Branch (9549:15): [True: 110, False: 79]
  |  Branch (9549:37): [True: 9, False: 70]
  ------------------
 9550|     70|          return false;
 9551|     70|        }
 9552|  1.71k|      }
 9553|       |
 9554|      0|      const direction last_dir = find_direction(label[last_non_nsm_char]);
 9555|      0|      if (!(last_dir == direction::L || last_dir == direction::EN)) {
  ------------------
  |  Branch (9555:13): [True: 0, False: 0]
  |  Branch (9555:41): [True: 0, False: 0]
  ------------------
 9556|      0|        return false;
 9557|      0|      }
 9558|       |
 9559|      0|      return true;
 9560|       |
 9561|     97|    } else {
 9562|       |      // Eval as RTL
 9563|       |
 9564|       |      // The first character must be R or AL; a leading AN (or any other
 9565|       |      // direction) does not start a valid RTL label.
 9566|     97|      const direction first_dir = find_direction(label[0]);
 9567|     97|      if (first_dir != direction::R && first_dir != direction::AL) {
  ------------------
  |  Branch (9567:11): [True: 76, False: 21]
  |  Branch (9567:40): [True: 32, False: 44]
  ------------------
 9568|     32|        return false;
 9569|     32|      }
 9570|       |
 9571|     65|      bool has_an = false;
 9572|     65|      bool has_en = false;
 9573|    895|      for (size_t i = 0; i <= last_non_nsm_char; i++) {
  ------------------
  |  Branch (9573:26): [True: 856, False: 39]
  ------------------
 9574|    856|        const direction d = find_direction(label[i]);
 9575|       |
 9576|       |        // In an RTL label, if an EN is present, no AN may be present, and vice
 9577|       |        // versa.
 9578|    856|        if ((d == direction::EN && ((has_en = true) && has_an)) ||
  ------------------
  |  Branch (9578:14): [True: 133, False: 723]
  |  Branch (9578:37): [True: 133, False: 0]
  |  Branch (9578:56): [True: 0, False: 133]
  ------------------
 9579|    856|            (d == direction::AN && ((has_an = true) && has_en))) {
  ------------------
  |  Branch (9579:14): [True: 9, False: 847]
  |  Branch (9579:37): [True: 9, False: 0]
  |  Branch (9579:56): [True: 0, False: 9]
  ------------------
 9580|      0|          return false;
 9581|      0|        }
 9582|       |
 9583|    856|        if (!(d == direction::R || d == direction::AL || d == direction::AN ||
  ------------------
  |  Branch (9583:15): [True: 71, False: 785]
  |  Branch (9583:36): [True: 187, False: 598]
  |  Branch (9583:58): [True: 9, False: 589]
  ------------------
 9584|    589|              d == direction::EN || d == direction::ES || d == direction::CS ||
  ------------------
  |  Branch (9584:15): [True: 133, False: 456]
  |  Branch (9584:37): [True: 31, False: 425]
  |  Branch (9584:59): [True: 37, False: 388]
  ------------------
 9585|    388|              d == direction::ET || d == direction::ON || d == direction::BN ||
  ------------------
  |  Branch (9585:15): [True: 106, False: 282]
  |  Branch (9585:37): [True: 140, False: 142]
  |  Branch (9585:59): [True: 13, False: 129]
  ------------------
 9586|    129|              d == direction::NSM)) {
  ------------------
  |  Branch (9586:15): [True: 113, False: 16]
  ------------------
 9587|     16|          return false;
 9588|     16|        }
 9589|       |
 9590|    840|        if (i == last_non_nsm_char &&
  ------------------
  |  Branch (9590:13): [True: 49, False: 791]
  ------------------
 9591|     49|            !(d == direction::R || d == direction::AL || d == direction::AN ||
  ------------------
  |  Branch (9591:15): [True: 5, False: 44]
  |  Branch (9591:36): [True: 18, False: 26]
  |  Branch (9591:58): [True: 0, False: 26]
  ------------------
 9592|     26|              d == direction::EN)) {
  ------------------
  |  Branch (9592:15): [True: 16, False: 10]
  ------------------
 9593|     10|          return false;
 9594|     10|        }
 9595|    840|      }
 9596|       |
 9597|     39|      return true;
 9598|     65|    }
 9599|    167|  }
 9600|       |
 9601|    619|  return true;
 9602|    786|}
_ZN3ada4idna8to_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 9728|  1.35k|std::string to_ascii(std::string_view ut8_string) {
 9729|  1.35k|  if (is_ascii(ut8_string)) {
  ------------------
  |  Branch (9729:7): [True: 609, False: 745]
  ------------------
 9730|    609|    return from_ascii_to_ascii(ut8_string);
 9731|    609|  }
 9732|    745|  static const std::string error = "";
 9733|       |  // We convert to UTF-32
 9734|       |
 9735|       |#ifdef ADA_USE_SIMDUTF
 9736|       |  size_t utf32_length =
 9737|       |      simdutf::utf32_length_from_utf8(ut8_string.data(), ut8_string.size());
 9738|       |  std::u32string utf32(utf32_length, '\0');
 9739|       |  size_t actual_utf32_length = simdutf::convert_utf8_to_utf32(
 9740|       |      ut8_string.data(), ut8_string.size(), utf32.data());
 9741|       |#else
 9742|    745|  size_t utf32_length =
 9743|    745|      ada::idna::utf32_length_from_utf8(ut8_string.data(), ut8_string.size());
 9744|    745|  std::u32string utf32(utf32_length, '\0');
 9745|    745|  size_t actual_utf32_length = ada::idna::utf8_to_utf32(
 9746|    745|      ut8_string.data(), ut8_string.size(), utf32.data());
 9747|    745|#endif
 9748|    745|  if (actual_utf32_length == 0) {
  ------------------
  |  Branch (9748:7): [True: 137, False: 608]
  ------------------
 9749|    137|    return error;
 9750|    137|  }
 9751|       |  // mapping: use the two-argument overload to avoid an extra heap allocation
 9752|       |  // that the single-argument overload (which returns by value) would incur.
 9753|    608|  std::u32string tmp_buffer;
 9754|    608|  std::u32string post_map;
 9755|    608|  if (!ada::idna::map(utf32, tmp_buffer)) {
  ------------------
  |  Branch (9755:7): [True: 43, False: 565]
  ------------------
 9756|     43|    return error;
 9757|     43|  }
 9758|    565|  utf32 = std::move(tmp_buffer);
 9759|    565|  normalize(utf32);
 9760|    565|  std::string out;
 9761|    565|  out.reserve(ut8_string.size());
 9762|    565|  size_t label_start = 0;
 9763|       |
 9764|  2.39k|  while (label_start != utf32.size()) {
  ------------------
  |  Branch (9764:10): [True: 2.02k, False: 372]
  ------------------
 9765|  2.02k|    size_t loc_dot = utf32.find('.', label_start);
 9766|  2.02k|    bool is_last_label = (loc_dot == std::string_view::npos);
 9767|  2.02k|    size_t label_size =
 9768|  2.02k|        is_last_label ? utf32.size() - label_start : loc_dot - label_start;
  ------------------
  |  Branch (9768:9): [True: 371, False: 1.65k]
  ------------------
 9769|  2.02k|    size_t label_size_with_dot = is_last_label ? label_size : label_size + 1;
  ------------------
  |  Branch (9769:34): [True: 371, False: 1.65k]
  ------------------
 9770|  2.02k|    std::u32string_view label_view(utf32.data() + label_start, label_size);
 9771|  2.02k|    label_start += label_size_with_dot;
 9772|  2.02k|    if (label_size == 0) {
  ------------------
  |  Branch (9772:9): [True: 165, False: 1.85k]
  ------------------
 9773|       |      // empty label? Nothing to do.
 9774|  1.85k|    } else if (label_view.starts_with(U"xn--")) {
  ------------------
  |  Branch (9774:16): [True: 68, False: 1.79k]
  ------------------
 9775|       |      // we do not need to check, e.g., Xn-- because mapping goes to lower case
 9776|       |      // Validate first, then bulk-copy with a single resize to avoid per-char
 9777|       |      // capacity checks in operator+=.
 9778|  2.07k|      for (char32_t c : label_view) {
  ------------------
  |  Branch (9778:23): [True: 2.07k, False: 65]
  ------------------
 9779|  2.07k|        if (c >= 0x80) {
  ------------------
  |  Branch (9779:13): [True: 3, False: 2.07k]
  ------------------
 9780|      3|          return error;
 9781|      3|        }
 9782|  2.07k|      }
 9783|     65|      size_t label_out_start = out.size();
 9784|     65|      out.resize(label_out_start + label_size);
 9785|     65|      char* dest = out.data() + label_out_start;
 9786|  1.98k|      for (char32_t c : label_view) {
  ------------------
  |  Branch (9786:23): [True: 1.98k, False: 65]
  ------------------
 9787|  1.98k|        *dest++ = static_cast<char>(c);
 9788|  1.98k|      }
 9789|     65|      std::string_view puny_segment_ascii(out.data() + label_out_start + 4,
 9790|     65|                                          label_size - 4);
 9791|     65|      tmp_buffer.clear();
 9792|     65|      bool is_ok = ada::idna::punycode_to_utf32(puny_segment_ascii, tmp_buffer);
 9793|     65|      if (!is_ok) {
  ------------------
  |  Branch (9793:11): [True: 6, False: 59]
  ------------------
 9794|      6|        return error;
 9795|      6|      }
 9796|       |      // If the input is just ASCII, it should not have been encoded
 9797|       |      // as punycode.
 9798|       |      // https://github.com/whatwg/url/issues/760
 9799|     59|      if (is_ascii(tmp_buffer)) {
  ------------------
  |  Branch (9799:11): [True: 4, False: 55]
  ------------------
 9800|      4|        return error;
 9801|      4|      }
 9802|     55|      if (!ada::idna::map(tmp_buffer, post_map)) {
  ------------------
  |  Branch (9802:11): [True: 11, False: 44]
  ------------------
 9803|     11|        return error;
 9804|     11|      }
 9805|     44|      if (tmp_buffer != post_map) {
  ------------------
  |  Branch (9805:11): [True: 7, False: 37]
  ------------------
 9806|      7|        return error;
 9807|      7|      }
 9808|     37|      normalize(post_map);
 9809|     37|      if (post_map != tmp_buffer) {
  ------------------
  |  Branch (9809:11): [True: 2, False: 35]
  ------------------
 9810|      2|        return error;
 9811|      2|      }
 9812|     35|      if (post_map.empty()) {
  ------------------
  |  Branch (9812:11): [True: 0, False: 35]
  ------------------
 9813|      0|        return error;
 9814|      0|      }
 9815|     35|      if (!is_label_valid(post_map)) {
  ------------------
  |  Branch (9815:11): [True: 3, False: 32]
  ------------------
 9816|      3|        return error;
 9817|      3|      }
 9818|  1.79k|    } else {
 9819|       |      // The fast path here is an ascii label.
 9820|  1.79k|      if (is_ascii(label_view)) {
  ------------------
  |  Branch (9820:11): [True: 1.09k, False: 700]
  ------------------
 9821|       |        // no validation needed; bulk-copy with single resize.
 9822|  1.09k|        size_t old_size = out.size();
 9823|  1.09k|        out.resize(old_size + label_size);
 9824|  1.09k|        char* dest = out.data() + old_size;
 9825|  5.15k|        for (char32_t c : label_view) {
  ------------------
  |  Branch (9825:25): [True: 5.15k, False: 1.09k]
  ------------------
 9826|  5.15k|          *dest++ = static_cast<char>(c);
 9827|  5.15k|        }
 9828|  1.09k|      } else {
 9829|       |        // slow path.
 9830|       |        // first check validity.
 9831|    700|        if (!is_label_valid(label_view)) {
  ------------------
  |  Branch (9831:13): [True: 157, False: 543]
  ------------------
 9832|    157|          return error;
 9833|    157|        }
 9834|       |        // It is valid! So now we must encode it as punycode...
 9835|    543|        out.append("xn--");
 9836|    543|        bool is_ok = ada::idna::utf32_to_punycode(label_view, out);
 9837|    543|        if (!is_ok) {
  ------------------
  |  Branch (9837:13): [True: 0, False: 543]
  ------------------
 9838|      0|          return error;
 9839|      0|        }
 9840|    543|      }
 9841|  1.79k|    }
 9842|  1.83k|    if (!is_last_label) {
  ------------------
  |  Branch (9842:9): [True: 1.50k, False: 322]
  ------------------
 9843|  1.50k|      out.push_back('.');
 9844|  1.50k|    }
 9845|  1.83k|  }
 9846|    372|  return out;
 9847|    565|}
_ZN3ada7unicode14percent_decodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEm:
11017|  1.53k|std::string percent_decode(const std::string_view input, size_t first_percent) {
11018|       |  // next line is for safety only, we expect users to avoid calling
11019|       |  // percent_decode when first_percent is outside the range.
11020|  1.53k|  if (first_percent == std::string_view::npos) {
  ------------------
  |  Branch (11020:7): [True: 0, False: 1.53k]
  ------------------
11021|      0|    return std::string(input);
11022|      0|  }
11023|  1.53k|  std::string dest;
11024|  1.53k|  dest.reserve(input.length());
11025|  1.53k|  dest.append(input.substr(0, first_percent));
11026|  1.53k|  const char* pointer = input.data() + first_percent;
11027|  1.53k|  const char* end = input.data() + input.size();
11028|       |  // Optimization opportunity: if the following code gets
11029|       |  // called often, it can be optimized quite a bit.
11030|  27.7k|  while (pointer < end) {
  ------------------
  |  Branch (11030:10): [True: 26.1k, False: 1.53k]
  ------------------
11031|  26.1k|    const char ch = pointer[0];
11032|  26.1k|    size_t remaining = end - pointer - 1;
11033|  26.1k|    if (ch != '%' || remaining < 2 ||
  ------------------
  |  Branch (11033:9): [True: 16.3k, False: 9.88k]
  |  Branch (11033:22): [True: 97, False: 9.78k]
  ------------------
11034|  9.78k|        (  // ch == '%' && // It is unnecessary to check that ch == '%'.
11035|  9.78k|            (!is_ascii_hex_digit(pointer[1]) ||
  ------------------
  |  Branch (11035:14): [True: 836, False: 8.94k]
  ------------------
11036|  17.6k|             !is_ascii_hex_digit(pointer[2])))) {
  ------------------
  |  Branch (11036:14): [True: 424, False: 8.52k]
  ------------------
11037|  17.6k|      dest += ch;
11038|  17.6k|      pointer++;
11039|  17.6k|    } else {
11040|  8.52k|      unsigned a = convert_hex_to_binary(pointer[1]);
11041|  8.52k|      unsigned b = convert_hex_to_binary(pointer[2]);
11042|  8.52k|      char c = static_cast<char>(a * 16 + b);
11043|  8.52k|      dest += c;
11044|  8.52k|      pointer += 3;
11045|  8.52k|    }
11046|  26.1k|  }
11047|  1.53k|  return dest;
11048|  1.53k|}
_ZN3ada7unicode14percent_encodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKh:
11051|  21.5k|                           const uint8_t character_set[]) {
11052|  21.5k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
11053|  21.5k|    return character_sets::bit_at(character_set, c);
11054|  21.5k|  });
11055|       |  // Optimization: Don't iterate if percent encode is not required
11056|  21.5k|  if (pointer == input.end()) {
  ------------------
  |  Branch (11056:7): [True: 13.3k, False: 8.17k]
  ------------------
11057|  13.3k|    return std::string(input);
11058|  13.3k|  }
11059|       |
11060|  8.17k|  std::string result;
11061|  8.17k|  result.reserve(input.length());  // in the worst case, percent encoding might
11062|       |                                   // produce 3 characters.
11063|  8.17k|  result.append(input.substr(0, std::distance(input.begin(), pointer)));
11064|       |
11065|   116k|  for (; pointer != input.end(); pointer++) {
  ------------------
  |  Branch (11065:10): [True: 108k, False: 8.17k]
  ------------------
11066|   108k|    if (character_sets::bit_at(character_set, *pointer)) {
  ------------------
  |  Branch (11066:9): [True: 60.6k, False: 47.9k]
  ------------------
11067|  60.6k|      result.append(character_sets::hex + uint8_t(*pointer) * 4, 3);
11068|  60.6k|    } else {
11069|  47.9k|      result += *pointer;
11070|  47.9k|    }
11071|   108k|  }
11072|       |
11073|  8.17k|  return result;
11074|  21.5k|}
_ZN3ada7unicode8to_asciiERNSt3__18optionalINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEENS1_17basic_string_viewIcS5_EEm:
11112|  1.35k|              size_t first_percent) {
11113|  1.35k|  std::string percent_decoded_buffer;
11114|  1.35k|  std::string_view input = plain;
11115|  1.35k|  if (first_percent != std::string_view::npos) {
  ------------------
  |  Branch (11115:7): [True: 281, False: 1.07k]
  ------------------
11116|    281|    percent_decoded_buffer = unicode::percent_decode(plain, first_percent);
11117|    281|    input = percent_decoded_buffer;
11118|    281|  }
11119|       |  // input is a non-empty UTF-8 string, must be percent decoded
11120|  1.35k|  std::string idna_ascii = ada::idna::to_ascii(input);
11121|  1.35k|  if (idna_ascii.empty() || contains_forbidden_domain_code_point(
  ------------------
  |  Branch (11121:7): [True: 497, False: 857]
  |  Branch (11121:29): [True: 235, False: 622]
  ------------------
11122|    857|                                idna_ascii.data(), idna_ascii.size())) {
11123|    732|    return false;
11124|    732|  }
11125|    622|  out = std::move(idna_ascii);
11126|    622|  return true;
11127|  1.35k|}
_ZN3ada7unicode14percent_encodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKhm:
11130|  17.5k|                           const uint8_t character_set[], size_t index) {
11131|  17.5k|  std::string out;
11132|       |  // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
11133|  17.5k|  out.append(input.data(), index);
11134|  17.5k|  auto pointer = input.begin() + index;
11135|   119k|  for (; pointer != input.end(); pointer++) {
  ------------------
  |  Branch (11135:10): [True: 102k, False: 17.5k]
  ------------------
11136|   102k|    if (character_sets::bit_at(character_set, *pointer)) {
  ------------------
  |  Branch (11136:9): [True: 37.0k, False: 65.0k]
  ------------------
11137|  37.0k|      out.append(character_sets::hex + uint8_t(*pointer) * 4, 3);
11138|  65.0k|    } else {
11139|  65.0k|      out += *pointer;
11140|  65.0k|    }
11141|   102k|  }
11142|  17.5k|  return out;
11143|  17.5k|}
_ZN3ada11serializers36find_longest_sequence_of_ipv6_piecesERKNSt3__15arrayItLm8EEERmS6_:
11156|  5.86k|    size_t& compress_length) noexcept {
11157|  49.2k|  for (size_t i = 0; i < 8; i++) {
  ------------------
  |  Branch (11157:22): [True: 43.7k, False: 5.42k]
  ------------------
11158|  43.7k|    if (address[i] == 0) {
  ------------------
  |  Branch (11158:9): [True: 1.11k, False: 42.6k]
  ------------------
11159|  1.11k|      size_t next = i + 1;
11160|  3.75k|      while (next != 8 && address[next] == 0) ++next;
  ------------------
  |  Branch (11160:14): [True: 3.26k, False: 495]
  |  Branch (11160:27): [True: 2.63k, False: 624]
  ------------------
11161|  1.11k|      const size_t count = next - i;
11162|  1.11k|      if (compress_length < count) {
  ------------------
  |  Branch (11162:11): [True: 1.02k, False: 99]
  ------------------
11163|  1.02k|        compress_length = count;
11164|  1.02k|        compress = i;
11165|  1.02k|        if (next == 8) break;
  ------------------
  |  Branch (11165:13): [True: 443, False: 577]
  ------------------
11166|    577|        i = next;
11167|    577|      }
11168|  1.11k|    }
11169|  43.7k|  }
11170|  5.86k|}
_ZN3ada11serializers4ipv6ERKNSt3__15arrayItLm8EEE:
11172|  2.93k|std::string ipv6(const std::array<uint16_t, 8>& address) {
11173|  2.93k|  size_t compress_length = 0;  // The length of a long sequence of zeros.
11174|  2.93k|  size_t compress = 0;         // The start of a long sequence of zeros.
11175|  2.93k|  find_longest_sequence_of_ipv6_pieces(address, compress, compress_length);
11176|       |
11177|  2.93k|  if (compress_length <= 1) {
  ------------------
  |  Branch (11177:7): [True: 2.66k, False: 273]
  ------------------
11178|       |    // Optimization opportunity: Find a faster way then snprintf for imploding
11179|       |    // and return here.
11180|  2.66k|    compress = compress_length = 8;
11181|  2.66k|  }
11182|       |
11183|  2.93k|  std::string output(4 * 8 + 7 + 2, '\0');
11184|  2.93k|  size_t piece_index = 0;
11185|  2.93k|  char* point = output.data();
11186|  2.93k|  char* point_end = output.data() + output.size();
11187|  2.93k|  *point++ = '[';
11188|  22.1k|  while (true) {
  ------------------
  |  Branch (11188:10): [True: 22.1k, Folded]
  ------------------
11189|  22.1k|    if (piece_index == compress) {
  ------------------
  |  Branch (11189:9): [True: 273, False: 21.8k]
  ------------------
11190|    273|      *point++ = ':';
11191|       |      // If we skip a value initially, we need to write '::', otherwise
11192|       |      // a single ':' will do since it follows a previous ':'.
11193|    273|      if (piece_index == 0) {
  ------------------
  |  Branch (11193:11): [True: 147, False: 126]
  ------------------
11194|    147|        *point++ = ':';
11195|    147|      }
11196|    273|      piece_index += compress_length;
11197|    273|      if (piece_index == 8) {
  ------------------
  |  Branch (11197:11): [True: 206, False: 67]
  ------------------
11198|    206|        break;
11199|    206|      }
11200|    273|    }
11201|  21.9k|    point = std::to_chars(point, point_end, address[piece_index], 16).ptr;
11202|  21.9k|    piece_index++;
11203|  21.9k|    if (piece_index == 8) {
  ------------------
  |  Branch (11203:9): [True: 2.73k, False: 19.1k]
  ------------------
11204|  2.73k|      break;
11205|  2.73k|    }
11206|  19.1k|    *point++ = ':';
11207|  19.1k|  }
11208|  2.93k|  *point++ = ']';
11209|  2.93k|  output.resize(point - output.data());
11210|  2.93k|  return output;
11211|  2.93k|}
_ZN3ada11serializers4ipv4Em:
11213|  3.25k|std::string ipv4(const uint64_t address) {
11214|  3.25k|  std::string output(15, '\0');
11215|  3.25k|  char* point = output.data();
11216|  3.25k|  char* point_end = output.data() + output.size();
11217|  3.25k|  point = std::to_chars(point, point_end, uint8_t(address >> 24)).ptr;
11218|  13.0k|  for (int i = 2; i >= 0; i--) {
  ------------------
  |  Branch (11218:19): [True: 9.77k, False: 3.25k]
  ------------------
11219|  9.77k|    *point++ = '.';
11220|  9.77k|    point = std::to_chars(point, point_end, uint8_t(address >> (i * 8))).ptr;
11221|  9.77k|  }
11222|  3.25k|  output.resize(point - output.data());
11223|  3.25k|  return output;
11224|  3.25k|}
_ZN3ada5parseINS_14url_aggregatorEEEN2tl8expectedIT_NS_6errorsEEENSt3__117basic_string_viewIcNS7_11char_traitsIcEEEEPKS4_:
11496|  5.20k|    std::string_view input, const result_type* base_url) {
11497|  5.20k|  result_type u = ada::parser::parse_url_impl<result_type>(input, base_url);
11498|  5.20k|  if (!u.is_valid) {
  ------------------
  |  Branch (11498:7): [True: 4.40k, False: 799]
  ------------------
11499|  4.40k|    return tl::unexpected(errors::type_error);
11500|  4.40k|  }
11501|    799|  return u;
11502|  5.20k|}
_ZN3ada20get_max_input_lengthEv:
11245|  5.20k|uint32_t get_max_input_length() {
11246|  5.20k|  return max_input_length_.load(std::memory_order_relaxed);
11247|  5.20k|}
_ZN3ada7helpers18trim_c0_whitespaceERNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
12404|  5.20k|void trim_c0_whitespace(std::string_view& input) noexcept {
12405|  5.20k|  while (!input.empty() &&
  ------------------
  |  Branch (12405:10): [True: 5.20k, False: 0]
  ------------------
12406|  5.20k|         ada::unicode::is_c0_control_or_space(input.front())) {
  ------------------
  |  Branch (12406:10): [True: 0, False: 5.20k]
  ------------------
12407|      0|    input.remove_prefix(1);
12408|      0|  }
12409|  5.20k|  while (!input.empty() && ada::unicode::is_c0_control_or_space(input.back())) {
  ------------------
  |  Branch (12409:10): [True: 5.20k, False: 0]
  |  Branch (12409:28): [True: 0, False: 5.20k]
  ------------------
12410|      0|    input.remove_suffix(1);
12411|      0|  }
12412|  5.20k|}
_ZN3ada6parser14parse_url_implINS_14url_aggregatorELb1EEET_NSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPKS3_:
13654|  5.20k|                           const result_type* base_url) {
13655|       |  // We can specialize the implementation per type.
13656|       |  // Important: result_type_is_ada_url is evaluated at *compile time*. This
13657|       |  // means that doing if constexpr(result_type_is_ada_url) { something } else {
13658|       |  // something else } is free (at runtime). This means that ada::url_aggregator
13659|       |  // and ada::url **do not have to support the exact same API**.
13660|  5.20k|  constexpr bool result_type_is_ada_url = std::is_same_v<url, result_type>;
13661|  5.20k|  constexpr bool result_type_is_ada_url_aggregator =
13662|  5.20k|      std::is_same_v<url_aggregator, result_type>;
13663|  5.20k|  static_assert(result_type_is_ada_url ||
13664|  5.20k|                result_type_is_ada_url_aggregator);  // We don't support
13665|       |                                                     // anything else for now.
13666|       |
13667|  5.20k|  ada_log("ada::parser::parse_url('", user_input, "' [", user_input.size(),
13668|  5.20k|          " bytes],", (base_url != nullptr ? base_url->to_string() : "null"),
13669|  5.20k|          ")");
13670|       |
13671|  5.20k|  state state = state::SCHEME_START;
13672|  5.20k|  result_type url{};
13673|       |
13674|  5.20k|  const uint32_t max_input_length = ada::get_max_input_length();
13675|       |
13676|       |  // We refuse to parse URL strings that exceed the maximum input length.
13677|       |  // By default, this is 4GB but can be configured via
13678|       |  // ada::set_max_input_length().
13679|  5.20k|  if (user_input.size() > max_input_length) [[unlikely]] {
  ------------------
  |  Branch (13679:7): [True: 0, False: 5.20k]
  ------------------
13680|      0|    url.is_valid = false;
13681|      0|  }
13682|       |  // Going forward, user_input.size() is in [0,
13683|       |  // std::numeric_limits<uint32_t>::max). If we are provided with an invalid
13684|       |  // base, or the optional_url was invalid, we must return.
13685|  5.20k|  if (base_url != nullptr) {
  ------------------
  |  Branch (13685:7): [True: 0, False: 5.20k]
  ------------------
13686|      0|    url.is_valid &= base_url->is_valid;
13687|      0|  }
13688|  5.20k|  if (!url.is_valid) {
  ------------------
  |  Branch (13688:7): [True: 0, False: 5.20k]
  ------------------
13689|      0|    return url;
13690|      0|  }
13691|  5.20k|  if constexpr (result_type_is_ada_url_aggregator && store_values) {
13692|       |    // Most of the time, we just need user_input.size().
13693|       |    // In some instances, we may need a bit more.
13694|       |    ///////////////////////////
13695|       |    // This is *very* important. This line should *not* be removed
13696|       |    // hastily. There are principled reasons why reserve is important
13697|       |    // for performance. If you have a benchmark with small inputs,
13698|       |    // it may not matter, but in other instances, it could.
13699|       |    ////
13700|       |    // This rounds up to the next power of two.
13701|       |    // We know that user_input.size() is in [0,
13702|       |    // std::numeric_limits<uint32_t>::max).
13703|  5.20k|    uint32_t reserve_capacity =
13704|  5.20k|        (0xFFFFFFFF >>
13705|  5.20k|         helpers::leading_zeroes(uint32_t(1 | user_input.size()))) +
13706|  5.20k|        1;
13707|  5.20k|    url.reserve(reserve_capacity);
13708|  5.20k|  }
13709|  5.20k|  std::string tmp_buffer;
13710|  5.20k|  std::string_view url_data;
13711|  5.20k|  if (unicode::has_tabs_or_newline(user_input)) [[unlikely]] {
  ------------------
  |  Branch (13711:7): [True: 144, False: 5.05k]
  ------------------
13712|    144|    tmp_buffer = user_input;
13713|       |    // Optimization opportunity: Instead of copying and then pruning, we could
13714|       |    // just directly build the string from user_input.
13715|    144|    helpers::remove_ascii_tab_or_newline(tmp_buffer);
13716|    144|    url_data = tmp_buffer;
13717|  5.05k|  } else [[likely]] {
13718|  5.05k|    url_data = user_input;
13719|  5.05k|  }
13720|       |
13721|       |  // Leading and trailing control characters are uncommon and easy to deal with
13722|       |  // (no performance concern).
13723|  5.20k|  helpers::trim_c0_whitespace(url_data);
13724|       |
13725|       |  // Optimization opportunity. Most websites do not have fragment.
13726|  5.20k|  std::optional<std::string_view> fragment = helpers::prune_hash(url_data);
13727|       |  // We add it last so that an implementation like ada::url_aggregator
13728|       |  // can append it last to its internal buffer, thus improving performance.
13729|       |
13730|       |  // Here url_data no longer has its fragment.
13731|       |  // We are going to access the data from url_data (it is immutable).
13732|       |  // At any given time, we are pointing at byte 'input_position' in url_data.
13733|       |  // The input_position variable should range from 0 to input_size.
13734|       |  // It is illegal to access url_data at input_size.
13735|  5.20k|  size_t input_position = 0;
13736|  5.20k|  const size_t input_size = url_data.size();
13737|       |  // Keep running the following state machine by switching on state.
13738|       |  // If after a run pointer points to the EOF code point, go to the next step.
13739|       |  // Otherwise, increase pointer by 1 and continue with the state machine.
13740|       |  // We never decrement input_position.
13741|  28.5k|  while (input_position <= input_size) {
  ------------------
  |  Branch (13741:10): [True: 28.0k, False: 494]
  ------------------
13742|  28.0k|    ada_log("In parsing at ", input_position, " out of ", input_size,
13743|  28.0k|            " in state ", ada::to_string(state));
13744|  28.0k|    switch (state) {
13745|  5.20k|      case state::SCHEME_START: {
  ------------------
  |  Branch (13745:7): [True: 5.20k, False: 22.8k]
  ------------------
13746|  5.20k|        ada_log("SCHEME_START ", helpers::substring(url_data, input_position));
13747|       |        // If c is an ASCII alpha, append c, lowercased, to buffer, and set
13748|       |        // state to scheme state.
13749|  5.20k|        if ((input_position != input_size) &&
  ------------------
  |  Branch (13749:13): [True: 5.20k, False: 0]
  ------------------
13750|  5.20k|            checkers::is_alpha(url_data[input_position])) {
  ------------------
  |  Branch (13750:13): [True: 5.20k, False: 0]
  ------------------
13751|  5.20k|          state = state::SCHEME;
13752|  5.20k|          input_position++;
13753|  5.20k|        } else {
13754|       |          // Otherwise, if state override is not given, set state to no scheme
13755|       |          // state and decrease pointer by 1.
13756|      0|          state = state::NO_SCHEME;
13757|      0|        }
13758|  5.20k|        break;
13759|      0|      }
13760|  5.20k|      case state::SCHEME: {
  ------------------
  |  Branch (13760:7): [True: 5.20k, False: 22.8k]
  ------------------
13761|  5.20k|        ada_log("SCHEME ", helpers::substring(url_data, input_position));
13762|       |        // If c is an ASCII alphanumeric, U+002B (+), U+002D (-), or U+002E (.),
13763|       |        // append c, lowercased, to buffer.
13764|  20.8k|        while ((input_position != input_size) &&
  ------------------
  |  Branch (13764:16): [True: 20.8k, False: 0]
  ------------------
13765|  20.8k|               (unicode::is_alnum_plus(url_data[input_position]))) {
  ------------------
  |  Branch (13765:16): [True: 15.6k, False: 5.20k]
  ------------------
13766|  15.6k|          input_position++;
13767|  15.6k|        }
13768|       |        // Otherwise, if c is U+003A (:), then:
13769|  5.20k|        if ((input_position != input_size) &&
  ------------------
  |  Branch (13769:13): [True: 5.20k, False: 0]
  ------------------
13770|  5.20k|            (url_data[input_position] == ':')) {
  ------------------
  |  Branch (13770:13): [True: 5.20k, False: 0]
  ------------------
13771|  5.20k|          ada_log("SCHEME the scheme should be ",
13772|  5.20k|                  url_data.substr(0, input_position));
13773|       |          if constexpr (result_type_is_ada_url) {
13774|       |            if (!url.parse_scheme(url_data.substr(0, input_position))) {
13775|       |              return url;
13776|       |            }
13777|  5.20k|          } else {
13778|       |            // we pass the colon along instead of painfully adding it back.
13779|  5.20k|            if (!url.parse_scheme_with_colon(
  ------------------
  |  Branch (13779:17): [True: 0, False: 5.20k]
  ------------------
13780|  5.20k|                    url_data.substr(0, input_position + 1))) {
13781|      0|              return url;
13782|      0|            }
13783|  5.20k|          }
13784|  5.20k|          ada_log("SCHEME the scheme is ", url.get_protocol());
13785|       |
13786|       |          // If url's scheme is "file", then:
13787|       |          // NOLINTNEXTLINE(bugprone-branch-clone)
13788|  5.20k|          if (url.type == scheme::type::FILE) {
  ------------------
  |  Branch (13788:15): [True: 0, False: 5.20k]
  ------------------
13789|       |            // Set state to file state.
13790|      0|            state = state::FILE;
13791|      0|          }
13792|       |          // Otherwise, if url is special, base is non-null, and base's scheme
13793|       |          // is url's scheme: Note: Doing base_url->scheme is unsafe if base_url
13794|       |          // != nullptr is false.
13795|  5.20k|          else if (url.is_special() && base_url != nullptr &&
  ------------------
  |  Branch (13795:20): [True: 5.20k, False: 0]
  |  Branch (13795:40): [True: 0, False: 5.20k]
  ------------------
13796|      0|                   base_url->type == url.type) {
  ------------------
  |  Branch (13796:20): [True: 0, False: 0]
  ------------------
13797|       |            // Set state to special relative or authority state.
13798|      0|            state = state::SPECIAL_RELATIVE_OR_AUTHORITY;
13799|      0|          }
13800|       |          // Otherwise, if url is special, set state to special authority
13801|       |          // slashes state.
13802|  5.20k|          else if (url.is_special()) {
  ------------------
  |  Branch (13802:20): [True: 5.20k, False: 0]
  ------------------
13803|  5.20k|            state = state::SPECIAL_AUTHORITY_SLASHES;
13804|  5.20k|          }
13805|       |          // Otherwise, if remaining starts with an U+002F (/), set state to
13806|       |          // path or authority state and increase pointer by 1.
13807|      0|          else if (input_position + 1 < input_size &&
  ------------------
  |  Branch (13807:20): [True: 0, False: 0]
  ------------------
13808|      0|                   url_data[input_position + 1] == '/') {
  ------------------
  |  Branch (13808:20): [True: 0, False: 0]
  ------------------
13809|      0|            state = state::PATH_OR_AUTHORITY;
13810|      0|            input_position++;
13811|      0|          }
13812|       |          // Otherwise, set url's path to the empty string and set state to
13813|       |          // opaque path state.
13814|      0|          else {
13815|      0|            state = state::OPAQUE_PATH;
13816|      0|          }
13817|  5.20k|        }
13818|       |        // Otherwise, if state override is not given, set buffer to the empty
13819|       |        // string, state to no scheme state, and start over (from the first code
13820|       |        // point in input).
13821|      0|        else {
13822|      0|          state = state::NO_SCHEME;
13823|      0|          input_position = 0;
13824|      0|          break;
13825|      0|        }
13826|  5.20k|        input_position++;
13827|  5.20k|        break;
13828|  5.20k|      }
13829|      0|      case state::NO_SCHEME: {
  ------------------
  |  Branch (13829:7): [True: 0, False: 28.0k]
  ------------------
13830|      0|        ada_log("NO_SCHEME ", helpers::substring(url_data, input_position));
13831|       |        // If base is null, or base has an opaque path and c is not U+0023 (#),
13832|       |        // validation error, return failure.
13833|      0|        if (base_url == nullptr ||
  ------------------
  |  Branch (13833:13): [True: 0, False: 0]
  ------------------
13834|      0|            (base_url->has_opaque_path && !fragment.has_value())) {
  ------------------
  |  Branch (13834:14): [True: 0, False: 0]
  |  Branch (13834:43): [True: 0, False: 0]
  ------------------
13835|      0|          ada_log("NO_SCHEME validation error");
13836|      0|          url.is_valid = false;
13837|      0|          return url;
13838|      0|        }
13839|       |        // Otherwise, if base has an opaque path and c is U+0023 (#),
13840|       |        // set url's scheme to base's scheme, url's path to base's path, url's
13841|       |        // query to base's query, and set state to fragment state.
13842|      0|        else if (base_url->has_opaque_path && fragment.has_value() &&
  ------------------
  |  Branch (13842:18): [True: 0, False: 0]
  |  Branch (13842:47): [True: 0, False: 0]
  ------------------
13843|      0|                 input_position == input_size) {
  ------------------
  |  Branch (13843:18): [True: 0, False: 0]
  ------------------
13844|      0|          ada_log("NO_SCHEME opaque base with fragment");
13845|      0|          url.copy_scheme(*base_url);
13846|      0|          url.has_opaque_path = base_url->has_opaque_path;
13847|       |
13848|       |          if constexpr (result_type_is_ada_url) {
13849|       |            url.path = base_url->path;
13850|       |            url.query = base_url->query;
13851|      0|          } else {
13852|      0|            url.update_base_pathname(base_url->get_pathname());
13853|      0|            if (base_url->has_search()) {
  ------------------
  |  Branch (13853:17): [True: 0, False: 0]
  ------------------
13854|       |              // get_search() returns "" for an empty query string (URL ends
13855|       |              // with '?'). update_base_search("") would incorrectly clear the
13856|       |              // query, so pass "?" to preserve the empty query distinction.
13857|      0|              auto s = base_url->get_search();
13858|      0|              url.update_base_search(s.empty() ? std::string_view("?") : s);
  ------------------
  |  Branch (13858:38): [True: 0, False: 0]
  ------------------
13859|      0|            }
13860|      0|          }
13861|      0|          url.update_unencoded_base_hash(*fragment);
13862|      0|          return url;
13863|      0|        }
13864|       |        // Otherwise, if base's scheme is not "file", set state to relative
13865|       |        // state and decrease pointer by 1.
13866|       |        // NOLINTNEXTLINE(bugprone-branch-clone)
13867|      0|        else if (base_url->type != scheme::type::FILE) {
  ------------------
  |  Branch (13867:18): [True: 0, False: 0]
  ------------------
13868|      0|          ada_log("NO_SCHEME non-file relative path");
13869|      0|          state = state::RELATIVE_SCHEME;
13870|      0|        }
13871|       |        // Otherwise, set state to file state and decrease pointer by 1.
13872|      0|        else {
13873|      0|          ada_log("NO_SCHEME file base type");
13874|      0|          state = state::FILE;
13875|      0|        }
13876|      0|        break;
13877|      0|      }
13878|  5.20k|      case state::AUTHORITY: {
  ------------------
  |  Branch (13878:7): [True: 5.20k, False: 22.8k]
  ------------------
13879|  5.20k|        ada_log("AUTHORITY ", helpers::substring(url_data, input_position));
13880|       |        // most URLs have no @. Having no @ tells us that we don't have to worry
13881|       |        // about AUTHORITY. Of course, we could have @ and still not have to
13882|       |        // worry about AUTHORITY.
13883|       |        // TODO: Instead of just collecting a bool, collect the location of the
13884|       |        // '@' and do something useful with it.
13885|       |        // TODO: We could do various processing early on, using a single pass
13886|       |        // over the string to collect information about it, e.g., telling us
13887|       |        // whether there is a @ and if so, where (or how many).
13888|       |
13889|       |        // Check if url data contains an @.
13890|  5.20k|        if (url_data.find('@', input_position) == std::string_view::npos) {
  ------------------
  |  Branch (13890:13): [True: 5.03k, False: 171]
  ------------------
13891|  5.03k|          state = state::HOST;
13892|  5.03k|          break;
13893|  5.03k|        }
13894|    171|        bool at_sign_seen{false};
13895|    171|        bool password_token_seen{false};
13896|       |        /**
13897|       |         * We expect something of the sort...
13898|       |         * https://user:pass@example.com:1234/foo/bar?baz#quux
13899|       |         * --------^
13900|       |         */
13901|  1.08k|        do {
13902|  1.08k|          std::string_view view = url_data.substr(input_position);
13903|       |          // The delimiters are @, /, ? \\.
13904|  1.08k|          size_t location =
13905|  1.08k|              url.is_special() ? helpers::find_authority_delimiter_special(view)
  ------------------
  |  Branch (13905:15): [True: 1.08k, False: 0]
  ------------------
13906|  1.08k|                               : helpers::find_authority_delimiter(view);
13907|  1.08k|          std::string_view authority_view = view.substr(0, location);
13908|  1.08k|          size_t end_of_authority = input_position + authority_view.size();
13909|       |          // If c is U+0040 (@), then:
13910|  1.08k|          if ((end_of_authority != input_size) &&
  ------------------
  |  Branch (13910:15): [True: 1.07k, False: 11]
  ------------------
13911|  1.07k|              (url_data[end_of_authority] == '@')) {
  ------------------
  |  Branch (13911:15): [True: 912, False: 160]
  ------------------
13912|       |            // If atSignSeen is true, then prepend "%40" to buffer.
13913|    912|            if (at_sign_seen) {
  ------------------
  |  Branch (13913:17): [True: 760, False: 152]
  ------------------
13914|    760|              if (password_token_seen) {
  ------------------
  |  Branch (13914:19): [True: 418, False: 342]
  ------------------
13915|       |                if constexpr (result_type_is_ada_url) {
13916|       |                  url.password += "%40";
13917|    418|                } else {
13918|    418|                  url.append_base_password("%40");
13919|    418|                }
13920|    418|              } else {
13921|       |                if constexpr (result_type_is_ada_url) {
13922|       |                  url.username += "%40";
13923|    342|                } else {
13924|    342|                  url.append_base_username("%40");
13925|    342|                }
13926|    342|              }
13927|    760|            }
13928|       |
13929|    912|            at_sign_seen = true;
13930|       |
13931|    912|            if (!password_token_seen) {
  ------------------
  |  Branch (13931:17): [True: 494, False: 418]
  ------------------
13932|    494|              size_t password_token_location = authority_view.find(':');
13933|    494|              password_token_seen =
13934|    494|                  password_token_location != std::string_view::npos;
13935|       |
13936|    494|              if constexpr (store_values) {
13937|    494|                if (!password_token_seen) {
  ------------------
  |  Branch (13937:21): [True: 415, False: 79]
  ------------------
13938|       |                  if constexpr (result_type_is_ada_url) {
13939|       |                    url.username += unicode::percent_encode(
13940|       |                        authority_view,
13941|       |                        character_sets::USERINFO_PERCENT_ENCODE);
13942|    415|                  } else {
13943|    415|                    url.append_base_username(unicode::percent_encode(
13944|    415|                        authority_view,
13945|    415|                        character_sets::USERINFO_PERCENT_ENCODE));
13946|    415|                  }
13947|    415|                } else {
13948|       |                  if constexpr (result_type_is_ada_url) {
13949|       |                    url.username += unicode::percent_encode(
13950|       |                        authority_view.substr(0, password_token_location),
13951|       |                        character_sets::USERINFO_PERCENT_ENCODE);
13952|       |                    url.password += unicode::percent_encode(
13953|       |                        authority_view.substr(password_token_location + 1),
13954|       |                        character_sets::USERINFO_PERCENT_ENCODE);
13955|     79|                  } else {
13956|     79|                    url.append_base_username(unicode::percent_encode(
13957|     79|                        authority_view.substr(0, password_token_location),
13958|     79|                        character_sets::USERINFO_PERCENT_ENCODE));
13959|     79|                    url.append_base_password(unicode::percent_encode(
13960|     79|                        authority_view.substr(password_token_location + 1),
13961|     79|                        character_sets::USERINFO_PERCENT_ENCODE));
13962|     79|                  }
13963|     79|                }
13964|    494|              }
13965|    494|            } else if constexpr (store_values) {
13966|       |              if constexpr (result_type_is_ada_url) {
13967|       |                url.password += unicode::percent_encode(
13968|       |                    authority_view, character_sets::USERINFO_PERCENT_ENCODE);
13969|    418|              } else {
13970|    418|                url.append_base_password(unicode::percent_encode(
13971|    418|                    authority_view, character_sets::USERINFO_PERCENT_ENCODE));
13972|    418|              }
13973|    418|            }
13974|    912|          }
13975|       |          // Otherwise, if one of the following is true:
13976|       |          // - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#)
13977|       |          // - url is special and c is U+005C (\)
13978|    171|          else if (end_of_authority == input_size ||
  ------------------
  |  Branch (13978:20): [True: 11, False: 160]
  ------------------
13979|    160|                   url_data[end_of_authority] == '/' ||
  ------------------
  |  Branch (13979:20): [True: 149, False: 11]
  ------------------
13980|     11|                   url_data[end_of_authority] == '?' ||
  ------------------
  |  Branch (13980:20): [True: 4, False: 7]
  ------------------
13981|    171|                   (url.is_special() && url_data[end_of_authority] == '\\')) {
  ------------------
  |  Branch (13981:21): [True: 7, False: 0]
  |  Branch (13981:41): [True: 7, False: 0]
  ------------------
13982|       |            // If atSignSeen is true and authority_view is the empty string,
13983|       |            // validation error, return failure.
13984|    171|            if (at_sign_seen && authority_view.empty()) {
  ------------------
  |  Branch (13984:17): [True: 152, False: 19]
  |  Branch (13984:33): [True: 3, False: 149]
  ------------------
13985|      3|              url.is_valid = false;
13986|      3|              return url;
13987|      3|            }
13988|    168|            state = state::HOST;
13989|    168|            break;
13990|    171|          }
13991|    912|          if (end_of_authority == input_size) {
  ------------------
  |  Branch (13991:15): [True: 0, False: 912]
  ------------------
13992|      0|            if constexpr (store_values) {
13993|      0|              if (fragment.has_value()) {
  ------------------
  |  Branch (13993:19): [True: 0, False: 0]
  ------------------
13994|      0|                url.update_unencoded_base_hash(*fragment);
13995|      0|              }
13996|      0|            }
13997|      0|            return url;
13998|      0|          }
13999|    912|          input_position = end_of_authority + 1;
14000|    912|        } while (true);
  ------------------
  |  Branch (14000:18): [True: 912, Folded]
  ------------------
14001|       |
14002|    168|        break;
14003|    171|      }
14004|    168|      case state::SPECIAL_RELATIVE_OR_AUTHORITY: {
  ------------------
  |  Branch (14004:7): [True: 0, False: 28.0k]
  ------------------
14005|      0|        ada_log("SPECIAL_RELATIVE_OR_AUTHORITY ",
14006|      0|                helpers::substring(url_data, input_position));
14007|       |
14008|       |        // If c is U+002F (/) and remaining starts with U+002F (/),
14009|       |        // then set state to special authority ignore slashes state and increase
14010|       |        // pointer by 1.
14011|      0|        if (url_data.substr(input_position, 2) == "//") {
  ------------------
  |  Branch (14011:13): [True: 0, False: 0]
  ------------------
14012|      0|          state = state::SPECIAL_AUTHORITY_IGNORE_SLASHES;
14013|      0|          input_position += 2;
14014|      0|        } else {
14015|       |          // Otherwise, validation error, set state to relative state and
14016|       |          // decrease pointer by 1.
14017|      0|          state = state::RELATIVE_SCHEME;
14018|      0|        }
14019|       |
14020|      0|        break;
14021|    171|      }
14022|      0|      case state::PATH_OR_AUTHORITY: {
  ------------------
  |  Branch (14022:7): [True: 0, False: 28.0k]
  ------------------
14023|      0|        ada_log("PATH_OR_AUTHORITY ",
14024|      0|                helpers::substring(url_data, input_position));
14025|       |
14026|       |        // If c is U+002F (/), then set state to authority state.
14027|      0|        if ((input_position != input_size) &&
  ------------------
  |  Branch (14027:13): [True: 0, False: 0]
  ------------------
14028|      0|            (url_data[input_position] == '/')) {
  ------------------
  |  Branch (14028:13): [True: 0, False: 0]
  ------------------
14029|      0|          state = state::AUTHORITY;
14030|      0|          input_position++;
14031|      0|        } else {
14032|       |          // Otherwise, set state to path state, and decrease pointer by 1.
14033|      0|          state = state::PATH;
14034|      0|        }
14035|       |
14036|      0|        break;
14037|    171|      }
14038|      0|      case state::RELATIVE_SCHEME: {
  ------------------
  |  Branch (14038:7): [True: 0, False: 28.0k]
  ------------------
14039|      0|        ada_log("RELATIVE_SCHEME ",
14040|      0|                helpers::substring(url_data, input_position));
14041|       |
14042|       |        // Set url's scheme to base's scheme.
14043|      0|        url.copy_scheme(*base_url);
14044|       |
14045|       |        // If c is U+002F (/), then set state to relative slash state.
14046|      0|        if ((input_position != input_size) &&
  ------------------
  |  Branch (14046:13): [True: 0, False: 0]
  ------------------
14047|       |            // NOLINTNEXTLINE(bugprone-branch-clone)
14048|      0|            (url_data[input_position] == '/')) {
  ------------------
  |  Branch (14048:13): [True: 0, False: 0]
  ------------------
14049|      0|          ada_log(
14050|      0|              "RELATIVE_SCHEME if c is U+002F (/), then set state to relative "
14051|      0|              "slash state");
14052|      0|          state = state::RELATIVE_SLASH;
14053|      0|        } else if (url.is_special() && (input_position != input_size) &&
  ------------------
  |  Branch (14053:20): [True: 0, False: 0]
  |  Branch (14053:40): [True: 0, False: 0]
  ------------------
14054|      0|                   (url_data[input_position] == '\\')) {
  ------------------
  |  Branch (14054:20): [True: 0, False: 0]
  ------------------
14055|       |          // Otherwise, if url is special and c is U+005C (\), validation error,
14056|       |          // set state to relative slash state.
14057|      0|          ada_log(
14058|      0|              "RELATIVE_SCHEME  if url is special and c is U+005C, validation "
14059|      0|              "error, set state to relative slash state");
14060|      0|          state = state::RELATIVE_SLASH;
14061|      0|        } else {
14062|      0|          ada_log("RELATIVE_SCHEME otherwise");
14063|       |          // Set url's username to base's username, url's password to base's
14064|       |          // password, url's host to base's host, url's port to base's port,
14065|       |          // url's path to a clone of base's path, and url's query to base's
14066|       |          // query.
14067|       |          if constexpr (result_type_is_ada_url) {
14068|       |            url.username = base_url->username;
14069|       |            url.password = base_url->password;
14070|       |            url.host = base_url->host;
14071|       |            url.port = base_url->port;
14072|       |            // cloning the base path includes cloning the has_opaque_path flag
14073|       |            url.has_opaque_path = base_url->has_opaque_path;
14074|       |            url.path = base_url->path;
14075|       |            url.query = base_url->query;
14076|      0|          } else {
14077|      0|            url.update_base_authority(base_url->get_href(),
14078|      0|                                      base_url->get_components());
14079|      0|            url.update_host_to_base_host(base_url->get_hostname());
14080|      0|            url.update_base_port(base_url->retrieve_base_port());
14081|       |            // cloning the base path includes cloning the has_opaque_path flag
14082|      0|            url.has_opaque_path = base_url->has_opaque_path;
14083|      0|            url.update_base_pathname(base_url->get_pathname());
14084|      0|            if (base_url->has_search()) {
  ------------------
  |  Branch (14084:17): [True: 0, False: 0]
  ------------------
14085|       |              // get_search() returns "" for an empty query string (URL ends
14086|       |              // with '?'). update_base_search("") would incorrectly clear the
14087|       |              // query, so pass "?" to preserve the empty query distinction.
14088|      0|              auto s = base_url->get_search();
14089|      0|              url.update_base_search(s.empty() ? std::string_view("?") : s);
  ------------------
  |  Branch (14089:38): [True: 0, False: 0]
  ------------------
14090|      0|            }
14091|      0|          }
14092|       |
14093|      0|          url.has_opaque_path = base_url->has_opaque_path;
14094|       |
14095|       |          // If c is U+003F (?), then set url's query to the empty string, and
14096|       |          // state to query state.
14097|      0|          if ((input_position != input_size) &&
  ------------------
  |  Branch (14097:15): [True: 0, False: 0]
  ------------------
14098|      0|              (url_data[input_position] == '?')) {
  ------------------
  |  Branch (14098:15): [True: 0, False: 0]
  ------------------
14099|      0|            state = state::QUERY;
14100|      0|          }
14101|       |          // Otherwise, if c is not the EOF code point:
14102|      0|          else if (input_position != input_size) {
  ------------------
  |  Branch (14102:20): [True: 0, False: 0]
  ------------------
14103|       |            // Set url's query to null.
14104|      0|            url.clear_search();
14105|       |            if constexpr (result_type_is_ada_url) {
14106|       |              // Shorten url's path.
14107|       |              helpers::shorten_path(url.path, url.type);
14108|      0|            } else {
14109|      0|              std::string_view path = url.get_pathname();
14110|      0|              if (helpers::shorten_path(path, url.type)) {
  ------------------
  |  Branch (14110:19): [True: 0, False: 0]
  ------------------
14111|      0|                url.update_base_pathname(std::move(std::string(path)));
14112|      0|              }
14113|      0|            }
14114|       |            // Set state to path state and decrease pointer by 1.
14115|      0|            state = state::PATH;
14116|      0|            break;
14117|      0|          }
14118|      0|        }
14119|      0|        input_position++;
14120|      0|        break;
14121|      0|      }
14122|      0|      case state::RELATIVE_SLASH: {
  ------------------
  |  Branch (14122:7): [True: 0, False: 28.0k]
  ------------------
14123|      0|        ada_log("RELATIVE_SLASH ",
14124|      0|                helpers::substring(url_data, input_position));
14125|       |
14126|       |        // If url is special and c is U+002F (/) or U+005C (\), then:
14127|       |        // NOLINTNEXTLINE(bugprone-branch-clone)
14128|      0|        if (url.is_special() && (input_position != input_size) &&
  ------------------
  |  Branch (14128:13): [True: 0, False: 0]
  |  Branch (14128:33): [True: 0, False: 0]
  ------------------
14129|      0|            (url_data[input_position] == '/' ||
  ------------------
  |  Branch (14129:14): [True: 0, False: 0]
  ------------------
14130|      0|             url_data[input_position] == '\\')) {
  ------------------
  |  Branch (14130:14): [True: 0, False: 0]
  ------------------
14131|       |          // Set state to special authority ignore slashes state.
14132|      0|          state = state::SPECIAL_AUTHORITY_IGNORE_SLASHES;
14133|      0|        }
14134|       |        // Otherwise, if c is U+002F (/), then set state to authority state.
14135|      0|        else if ((input_position != input_size) &&
  ------------------
  |  Branch (14135:18): [True: 0, False: 0]
  ------------------
14136|      0|                 (url_data[input_position] == '/')) {
  ------------------
  |  Branch (14136:18): [True: 0, False: 0]
  ------------------
14137|      0|          state = state::AUTHORITY;
14138|      0|        }
14139|       |        // Otherwise, set
14140|       |        // - url's username to base's username,
14141|       |        // - url's password to base's password,
14142|       |        // - url's host to base's host,
14143|       |        // - url's port to base's port,
14144|       |        // - state to path state, and then, decrease pointer by 1.
14145|      0|        else {
14146|       |          if constexpr (result_type_is_ada_url) {
14147|       |            url.username = base_url->username;
14148|       |            url.password = base_url->password;
14149|       |            url.host = base_url->host;
14150|       |            url.port = base_url->port;
14151|      0|          } else {
14152|      0|            url.update_base_authority(base_url->get_href(),
14153|      0|                                      base_url->get_components());
14154|      0|            url.update_host_to_base_host(base_url->get_hostname());
14155|      0|            url.update_base_port(base_url->retrieve_base_port());
14156|      0|          }
14157|      0|          state = state::PATH;
14158|      0|          break;
14159|      0|        }
14160|       |
14161|      0|        input_position++;
14162|      0|        break;
14163|      0|      }
14164|  5.20k|      case state::SPECIAL_AUTHORITY_SLASHES: {
  ------------------
  |  Branch (14164:7): [True: 5.20k, False: 22.8k]
  ------------------
14165|  5.20k|        ada_log("SPECIAL_AUTHORITY_SLASHES ",
14166|  5.20k|                helpers::substring(url_data, input_position));
14167|       |
14168|       |        // If c is U+002F (/) and remaining starts with U+002F (/),
14169|       |        // then set state to special authority ignore slashes state and increase
14170|       |        // pointer by 1.
14171|  5.20k|        if (url_data.substr(input_position, 2) == "//") {
  ------------------
  |  Branch (14171:13): [True: 5.20k, False: 0]
  ------------------
14172|  5.20k|          input_position += 2;
14173|  5.20k|        }
14174|       |
14175|  5.20k|        [[fallthrough]];
14176|  5.20k|      }
14177|  5.20k|      case state::SPECIAL_AUTHORITY_IGNORE_SLASHES: {
  ------------------
  |  Branch (14177:7): [True: 0, False: 28.0k]
  ------------------
14178|  5.20k|        ada_log("SPECIAL_AUTHORITY_IGNORE_SLASHES ",
14179|  5.20k|                helpers::substring(url_data, input_position));
14180|       |
14181|       |        // If c is neither U+002F (/) nor U+005C (\), then set state to
14182|       |        // authority state and decrease pointer by 1.
14183|  5.41k|        while ((input_position != input_size) &&
  ------------------
  |  Branch (14183:16): [True: 5.41k, False: 1]
  ------------------
14184|  5.41k|               ((url_data[input_position] == '/') ||
  ------------------
  |  Branch (14184:17): [True: 120, False: 5.29k]
  ------------------
14185|  5.29k|                (url_data[input_position] == '\\'))) {
  ------------------
  |  Branch (14185:17): [True: 92, False: 5.20k]
  ------------------
14186|    212|          input_position++;
14187|    212|        }
14188|  5.20k|        state = state::AUTHORITY;
14189|       |
14190|  5.20k|        break;
14191|  5.20k|      }
14192|    267|      case state::QUERY: {
  ------------------
  |  Branch (14192:7): [True: 267, False: 27.7k]
  ------------------
14193|    267|        ada_log("QUERY ", helpers::substring(url_data, input_position));
14194|    267|        if constexpr (store_values) {
14195|       |          // Let queryPercentEncodeSet be the special-query percent-encode set
14196|       |          // if url is special; otherwise the query percent-encode set.
14197|    267|          const uint8_t* query_percent_encode_set =
14198|    267|              url.is_special() ? character_sets::SPECIAL_QUERY_PERCENT_ENCODE
  ------------------
  |  Branch (14198:15): [True: 267, False: 0]
  ------------------
14199|    267|                               : character_sets::QUERY_PERCENT_ENCODE;
14200|       |
14201|       |          // Percent-encode after encoding, with encoding, buffer, and
14202|       |          // queryPercentEncodeSet, and append the result to url's query.
14203|    267|          url.update_base_search(url_data.substr(input_position),
14204|    267|                                 query_percent_encode_set);
14205|    267|          ada_log("QUERY update_base_search completed ");
14206|    267|          if (fragment.has_value()) {
  ------------------
  |  Branch (14206:15): [True: 9, False: 258]
  ------------------
14207|      9|            url.update_unencoded_base_hash(*fragment);
14208|      9|          }
14209|    267|        }
14210|    267|        return url;
14211|  5.20k|      }
14212|  5.19k|      case state::HOST: {
  ------------------
  |  Branch (14212:7): [True: 5.19k, False: 22.8k]
  ------------------
14213|  5.19k|        ada_log("HOST ", helpers::substring(url_data, input_position));
14214|       |
14215|  5.19k|        std::string_view host_view = url_data.substr(input_position);
14216|  5.19k|        auto [location, found_colon] =
14217|  5.19k|            helpers::get_host_delimiter_location(url.is_special(), host_view);
14218|  5.19k|        input_position = (location != std::string_view::npos)
  ------------------
  |  Branch (14218:26): [True: 5.19k, False: 0]
  ------------------
14219|  5.19k|                             ? input_position + location
14220|  5.19k|                             : input_size;
14221|       |        // Otherwise, if c is U+003A (:) and insideBrackets is false, then:
14222|       |        // Note: the 'found_colon' value is true if and only if a colon was
14223|       |        // encountered while not inside brackets.
14224|  5.19k|        if (found_colon) {
  ------------------
  |  Branch (14224:13): [True: 546, False: 4.65k]
  ------------------
14225|       |          // If buffer is the empty string, validation error, return failure.
14226|       |          // Let host be the result of host parsing buffer with url is not
14227|       |          // special.
14228|    546|          ada_log("HOST parsing ", host_view);
14229|    546|          if (!url.parse_host(host_view)) {
  ------------------
  |  Branch (14229:15): [True: 240, False: 306]
  ------------------
14230|    240|            return url;
14231|    240|          }
14232|    306|          ada_log("HOST parsing results in ", url.get_hostname());
14233|       |          // Set url's host to host, buffer to the empty string, and state to
14234|       |          // port state.
14235|    306|          state = state::PORT;
14236|    306|          input_position++;
14237|    306|        }
14238|       |        // Otherwise, if one of the following is true:
14239|       |        // - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#)
14240|       |        // - url is special and c is U+005C (\)
14241|       |        // The get_host_delimiter_location function either brings us to
14242|       |        // the colon outside of the bracket, or to one of those characters.
14243|  4.65k|        else {
14244|       |          // If url is special and host_view is the empty string, validation
14245|       |          // error, return failure.
14246|  4.65k|          if (host_view.empty() && url.is_special()) {
  ------------------
  |  Branch (14246:15): [True: 1, False: 4.65k]
  |  Branch (14246:36): [True: 1, False: 0]
  ------------------
14247|      1|            url.is_valid = false;
14248|      1|            return url;
14249|      1|          }
14250|  4.65k|          ada_log("HOST parsing ", host_view, " href=", url.get_href());
14251|       |          // Let host be the result of host parsing host_view with url is not
14252|       |          // special.
14253|  4.65k|          if (host_view.empty()) {
  ------------------
  |  Branch (14253:15): [True: 0, False: 4.65k]
  ------------------
14254|      0|            url.update_base_hostname("");
14255|  4.65k|          } else if (!url.parse_host(host_view)) {
  ------------------
  |  Branch (14255:22): [True: 3.92k, False: 730]
  ------------------
14256|  3.92k|            return url;
14257|  3.92k|          }
14258|    730|          ada_log("HOST parsing results in ", url.get_hostname(),
14259|    730|                  " href=", url.get_href());
14260|       |
14261|       |          // Set url's host to host, and state to path start state.
14262|    730|          state = state::PATH_START;
14263|    730|        }
14264|       |
14265|  1.03k|        break;
14266|  5.19k|      }
14267|  1.03k|      case state::OPAQUE_PATH: {
  ------------------
  |  Branch (14267:7): [True: 0, False: 28.0k]
  ------------------
14268|      0|        ada_log("OPAQUE_PATH ", helpers::substring(url_data, input_position));
14269|       |        // Opaque path, query, and fragment are structurally always valid:
14270|       |        // the parser would just percent-encode whatever is there. When we
14271|       |        // are not storing values (can_parse), we can return immediately.
14272|       |        // We must set has_opaque_path = true before returning so that when
14273|       |        // this URL is used as an internal base inside can_parse, NO_SCHEME
14274|       |        // correctly rejects relative inputs against an opaque-path base
14275|       |        // (e.g. can_parse("", &"W:") must return false).
14276|       |        if constexpr (!store_values) {
14277|       |          url.has_opaque_path = true;
14278|       |          return url;
14279|       |        }
14280|      0|        std::string_view view = url_data.substr(input_position);
14281|       |        // If c is U+003F (?), then set url's query to the empty string and
14282|       |        // state to query state.
14283|      0|        size_t location = view.find('?');
14284|      0|        if (location != std::string_view::npos) {
  ------------------
  |  Branch (14284:13): [True: 0, False: 0]
  ------------------
14285|      0|          view.remove_suffix(view.size() - location);
14286|      0|          state = state::QUERY;
14287|      0|          input_position += location + 1;
14288|      0|        } else {
14289|      0|          input_position = input_size + 1;
14290|      0|        }
14291|      0|        url.has_opaque_path = true;
14292|       |
14293|       |        // This is a really unlikely scenario in real world. We should not seek
14294|       |        // to optimize it.
14295|      0|        if (view.ends_with(' ')) {
  ------------------
  |  Branch (14295:13): [True: 0, False: 0]
  ------------------
14296|      0|          std::string modified_view =
14297|      0|              std::string(view.substr(0, view.size() - 1)) + "%20";
14298|      0|          url.update_base_pathname(unicode::percent_encode(
14299|      0|              modified_view, character_sets::C0_CONTROL_PERCENT_ENCODE));
14300|      0|        } else {
14301|      0|          url.update_base_pathname(unicode::percent_encode(
14302|      0|              view, character_sets::C0_CONTROL_PERCENT_ENCODE));
14303|      0|        }
14304|      0|        break;
14305|  5.19k|      }
14306|    306|      case state::PORT: {
  ------------------
  |  Branch (14306:7): [True: 306, False: 27.7k]
  ------------------
14307|    306|        ada_log("PORT ", helpers::substring(url_data, input_position));
14308|    306|        std::string_view port_view = url_data.substr(input_position);
14309|    306|        input_position += url.parse_port(port_view, true);
14310|    306|        if (!url.is_valid) {
  ------------------
  |  Branch (14310:13): [True: 237, False: 69]
  ------------------
14311|    237|          return url;
14312|    237|        }
14313|     69|        state = state::PATH_START;
14314|     69|        [[fallthrough]];
14315|     69|      }
14316|    799|      case state::PATH_START: {
  ------------------
  |  Branch (14316:7): [True: 730, False: 27.3k]
  ------------------
14317|    799|        ada_log("PATH_START ", helpers::substring(url_data, input_position));
14318|       |        // Path, query, and fragment are structurally always valid: the
14319|       |        // parser would just percent-encode whatever is there. When we are
14320|       |        // not storing values (can_parse), we can return immediately since
14321|       |        // no subsequent state can invalidate the URL.
14322|       |        if constexpr (!store_values) {
14323|       |          return url;
14324|       |        }
14325|       |
14326|       |        // If url is special, then:
14327|    799|        if (url.is_special()) {
  ------------------
  |  Branch (14327:13): [True: 799, False: 0]
  ------------------
14328|       |          // Set state to path state.
14329|    799|          state = state::PATH;
14330|       |
14331|       |          // Optimization: Avoiding going into PATH state improves the
14332|       |          // performance of urls ending with /.
14333|    799|          if (input_position == input_size) {
  ------------------
  |  Branch (14333:15): [True: 38, False: 761]
  ------------------
14334|     38|            if constexpr (store_values) {
14335|     38|              url.update_base_pathname("/");
14336|     38|              if (fragment.has_value()) {
  ------------------
  |  Branch (14336:19): [True: 38, False: 0]
  ------------------
14337|     38|                url.update_unencoded_base_hash(*fragment);
14338|     38|              }
14339|     38|            }
14340|     38|            return url;
14341|     38|          }
14342|       |          // If c is neither U+002F (/) nor U+005C (\), then decrease pointer
14343|       |          // by 1. We know that (input_position == input_size) is impossible
14344|       |          // here, because of the previous if-check.
14345|    761|          if ((url_data[input_position] != '/') &&
  ------------------
  |  Branch (14345:15): [True: 87, False: 674]
  ------------------
14346|     87|              (url_data[input_position] != '\\')) {
  ------------------
  |  Branch (14346:15): [True: 36, False: 51]
  ------------------
14347|     36|            break;
14348|     36|          }
14349|    761|        }
14350|       |        // Otherwise, if state override is not given and c is U+003F (?),
14351|       |        // set url's query to the empty string and state to query state.
14352|      0|        else if ((input_position != input_size) &&
  ------------------
  |  Branch (14352:18): [True: 0, False: 0]
  ------------------
14353|      0|                 (url_data[input_position] == '?')) {
  ------------------
  |  Branch (14353:18): [True: 0, False: 0]
  ------------------
14354|      0|          state = state::QUERY;
14355|      0|        }
14356|       |        // Otherwise, if c is not the EOF code point:
14357|      0|        else if (input_position != input_size) {
  ------------------
  |  Branch (14357:18): [True: 0, False: 0]
  ------------------
14358|       |          // Set state to path state.
14359|      0|          state = state::PATH;
14360|       |
14361|       |          // If c is not U+002F (/), then decrease pointer by 1.
14362|      0|          if (url_data[input_position] != '/') {
  ------------------
  |  Branch (14362:15): [True: 0, False: 0]
  ------------------
14363|      0|            break;
14364|      0|          }
14365|      0|        }
14366|       |
14367|    725|        input_position++;
14368|    725|        break;
14369|    799|      }
14370|    761|      case state::PATH: {
  ------------------
  |  Branch (14370:7): [True: 761, False: 27.3k]
  ------------------
14371|    761|        ada_log("PATH ", helpers::substring(url_data, input_position));
14372|       |        // Path, query, and fragment are structurally always valid: the
14373|       |        // parser would just percent-encode whatever is there. When we are
14374|       |        // not storing values (can_parse), we can return immediately since
14375|       |        // no subsequent state can invalidate the URL.
14376|       |        if constexpr (!store_values) {
14377|       |          return url;
14378|       |        }
14379|    761|        std::string_view view = url_data.substr(input_position);
14380|       |
14381|       |        // Most time, we do not need percent encoding.
14382|       |        // Furthermore, we can immediately locate the '?'.
14383|    761|        size_t locofquestionmark = view.find('?');
14384|    761|        if (locofquestionmark != std::string_view::npos) {
  ------------------
  |  Branch (14384:13): [True: 267, False: 494]
  ------------------
14385|    267|          state = state::QUERY;
14386|    267|          view.remove_suffix(view.size() - locofquestionmark);
14387|    267|          input_position += locofquestionmark + 1;
14388|    494|        } else {
14389|    494|          input_position = input_size + 1;
14390|    494|        }
14391|    761|        if constexpr (store_values) {
14392|       |          if constexpr (result_type_is_ada_url) {
14393|       |            helpers::parse_prepared_path(view, url.type, url.path);
14394|    761|          } else {
14395|    761|            url.consume_prepared_path(view);
14396|    761|            ADA_ASSERT_TRUE(url.validate());
14397|    761|          }
14398|    761|        }
14399|    761|        break;
14400|    799|      }
14401|      0|      case state::FILE_SLASH: {
  ------------------
  |  Branch (14401:7): [True: 0, False: 28.0k]
  ------------------
14402|      0|        ada_log("FILE_SLASH ", helpers::substring(url_data, input_position));
14403|       |
14404|       |        // If c is U+002F (/) or U+005C (\), then:
14405|      0|        if ((input_position != input_size) &&
  ------------------
  |  Branch (14405:13): [True: 0, False: 0]
  ------------------
14406|      0|            (url_data[input_position] == '/' ||
  ------------------
  |  Branch (14406:14): [True: 0, False: 0]
  ------------------
14407|      0|             url_data[input_position] == '\\')) {
  ------------------
  |  Branch (14407:14): [True: 0, False: 0]
  ------------------
14408|      0|          ada_log("FILE_SLASH c is U+002F or U+005C");
14409|       |          // Set state to file host state.
14410|      0|          state = state::FILE_HOST;
14411|      0|          input_position++;
14412|      0|        } else {
14413|      0|          ada_log("FILE_SLASH otherwise");
14414|       |          // If base is non-null and base's scheme is "file", then:
14415|       |          // Note: it is unsafe to do base_url->scheme unless you know that
14416|       |          // base_url_has_value() is true.
14417|      0|          if (base_url != nullptr && base_url->type == scheme::type::FILE) {
  ------------------
  |  Branch (14417:15): [True: 0, False: 0]
  |  Branch (14417:38): [True: 0, False: 0]
  ------------------
14418|       |            // Set url's host to base's host.
14419|       |            if constexpr (result_type_is_ada_url) {
14420|       |              url.host = base_url->host;
14421|      0|            } else {
14422|      0|              url.update_host_to_base_host(base_url->get_host());
14423|      0|            }
14424|       |            // If the code point substring from pointer to the end of input does
14425|       |            // not start with a Windows drive letter and base's path[0] is a
14426|       |            // normalized Windows drive letter, then append base's path[0] to
14427|       |            // url's path.
14428|      0|            if (!base_url->get_pathname().empty()) {
  ------------------
  |  Branch (14428:17): [True: 0, False: 0]
  ------------------
14429|      0|              if (!checkers::is_windows_drive_letter(
  ------------------
  |  Branch (14429:19): [True: 0, False: 0]
  ------------------
14430|      0|                      url_data.substr(input_position))) {
14431|      0|                std::string_view first_base_url_path =
14432|      0|                    base_url->get_pathname().substr(1);
14433|      0|                size_t loc = first_base_url_path.find('/');
14434|      0|                if (loc != std::string_view::npos) {
  ------------------
  |  Branch (14434:21): [True: 0, False: 0]
  ------------------
14435|      0|                  helpers::resize(first_base_url_path, loc);
14436|      0|                }
14437|      0|                if (checkers::is_normalized_windows_drive_letter(
  ------------------
  |  Branch (14437:21): [True: 0, False: 0]
  ------------------
14438|      0|                        first_base_url_path)) {
14439|       |                  if constexpr (result_type_is_ada_url) {
14440|       |                    url.path += '/';
14441|       |                    url.path += first_base_url_path;
14442|      0|                  } else {
14443|      0|                    url.append_base_pathname(
14444|      0|                        helpers::concat("/", first_base_url_path));
14445|      0|                  }
14446|      0|                }
14447|      0|              }
14448|      0|            }
14449|      0|          }
14450|       |
14451|       |          // Set state to path state, and decrease pointer by 1.
14452|      0|          state = state::PATH;
14453|      0|        }
14454|       |
14455|      0|        break;
14456|    799|      }
14457|      0|      case state::FILE_HOST: {
  ------------------
  |  Branch (14457:7): [True: 0, False: 28.0k]
  ------------------
14458|      0|        ada_log("FILE_HOST ", helpers::substring(url_data, input_position));
14459|      0|        std::string_view view = url_data.substr(input_position);
14460|       |
14461|      0|        size_t location = view.find_first_of("/\\?");
14462|      0|        std::string_view file_host_buffer = view.substr(
14463|      0|            0, (location != std::string_view::npos) ? location : view.size());
  ------------------
  |  Branch (14463:16): [True: 0, False: 0]
  ------------------
14464|       |
14465|      0|        if (checkers::is_windows_drive_letter(file_host_buffer)) {
  ------------------
  |  Branch (14465:13): [True: 0, False: 0]
  ------------------
14466|      0|          state = state::PATH;
14467|      0|        } else if (file_host_buffer.empty()) {
  ------------------
  |  Branch (14467:20): [True: 0, False: 0]
  ------------------
14468|       |          // Set url's host to the empty string.
14469|       |          if constexpr (result_type_is_ada_url) {
14470|       |            url.host = "";
14471|      0|          } else {
14472|      0|            url.update_base_hostname("");
14473|      0|          }
14474|       |          // Set state to path start state.
14475|      0|          state = state::PATH_START;
14476|      0|        } else {
14477|      0|          size_t consumed_bytes = file_host_buffer.size();
14478|      0|          input_position += consumed_bytes;
14479|       |          // Let host be the result of host parsing buffer with url is not
14480|       |          // special.
14481|      0|          if (!url.parse_host(file_host_buffer)) {
  ------------------
  |  Branch (14481:15): [True: 0, False: 0]
  ------------------
14482|      0|            return url;
14483|      0|          }
14484|       |
14485|       |          if constexpr (result_type_is_ada_url) {
14486|       |            // If host is "localhost", then set host to the empty string.
14487|       |            if (url.host.has_value() && url.host.value() == "localhost") {
14488|       |              url.host = "";
14489|       |            }
14490|      0|          } else {
14491|      0|            if (url.get_hostname() == "localhost") {
  ------------------
  |  Branch (14491:17): [True: 0, False: 0]
  ------------------
14492|      0|              url.update_base_hostname("");
14493|      0|            }
14494|      0|          }
14495|       |
14496|       |          // Set buffer to the empty string and state to path start state.
14497|      0|          state = state::PATH_START;
14498|      0|        }
14499|       |
14500|      0|        break;
14501|      0|      }
14502|      0|      case state::FILE: {
  ------------------
  |  Branch (14502:7): [True: 0, False: 28.0k]
  ------------------
14503|      0|        ada_log("FILE ", helpers::substring(url_data, input_position));
14504|      0|        std::string_view file_view = url_data.substr(input_position);
14505|       |
14506|      0|        url.set_protocol_as_file();
14507|       |        if constexpr (result_type_is_ada_url) {
14508|       |          // Set url's host to the empty string.
14509|       |          url.host = "";
14510|      0|        } else {
14511|      0|          url.update_base_hostname("");
14512|      0|        }
14513|       |        // If c is U+002F (/) or U+005C (\), then:
14514|      0|        if (input_position != input_size &&
  ------------------
  |  Branch (14514:13): [True: 0, False: 0]
  ------------------
14515|      0|            (url_data[input_position] == '/' ||
  ------------------
  |  Branch (14515:14): [True: 0, False: 0]
  ------------------
14516|      0|             url_data[input_position] == '\\')) {
  ------------------
  |  Branch (14516:14): [True: 0, False: 0]
  ------------------
14517|      0|          ada_log("FILE c is U+002F or U+005C");
14518|       |          // Set state to file slash state.
14519|      0|          state = state::FILE_SLASH;
14520|      0|        }
14521|       |        // Otherwise, if base is non-null and base's scheme is "file":
14522|      0|        else if (base_url != nullptr && base_url->type == scheme::type::FILE) {
  ------------------
  |  Branch (14522:18): [True: 0, False: 0]
  |  Branch (14522:41): [True: 0, False: 0]
  ------------------
14523|       |          // Set url's host to base's host, url's path to a clone of base's
14524|       |          // path, and url's query to base's query.
14525|      0|          ada_log("FILE base non-null");
14526|       |          if constexpr (result_type_is_ada_url) {
14527|       |            url.host = base_url->host;
14528|       |            url.path = base_url->path;
14529|       |            url.query = base_url->query;
14530|      0|          } else {
14531|      0|            url.update_host_to_base_host(base_url->get_hostname());
14532|      0|            url.update_base_pathname(base_url->get_pathname());
14533|      0|            if (base_url->has_search()) {
  ------------------
  |  Branch (14533:17): [True: 0, False: 0]
  ------------------
14534|       |              // get_search() returns "" for an empty query string (URL ends
14535|       |              // with '?'). update_base_search("") would incorrectly clear the
14536|       |              // query, so pass "?" to preserve the empty query distinction.
14537|      0|              auto s = base_url->get_search();
14538|      0|              url.update_base_search(s.empty() ? std::string_view("?") : s);
  ------------------
  |  Branch (14538:38): [True: 0, False: 0]
  ------------------
14539|      0|            }
14540|      0|          }
14541|      0|          url.has_opaque_path = base_url->has_opaque_path;
14542|       |
14543|       |          // If c is U+003F (?), then set url's query to the empty string and
14544|       |          // state to query state.
14545|      0|          if (input_position != input_size && url_data[input_position] == '?') {
  ------------------
  |  Branch (14545:15): [True: 0, False: 0]
  |  Branch (14545:47): [True: 0, False: 0]
  ------------------
14546|      0|            state = state::QUERY;
14547|      0|          }
14548|       |          // Otherwise, if c is not the EOF code point:
14549|      0|          else if (input_position != input_size) {
  ------------------
  |  Branch (14549:20): [True: 0, False: 0]
  ------------------
14550|       |            // Set url's query to null.
14551|      0|            url.clear_search();
14552|       |            // If the code point substring from pointer to the end of input does
14553|       |            // not start with a Windows drive letter, then shorten url's path.
14554|      0|            if (!checkers::is_windows_drive_letter(file_view)) {
  ------------------
  |  Branch (14554:17): [True: 0, False: 0]
  ------------------
14555|       |              if constexpr (result_type_is_ada_url) {
14556|       |                helpers::shorten_path(url.path, url.type);
14557|      0|              } else {
14558|      0|                std::string_view path = url.get_pathname();
14559|      0|                if (helpers::shorten_path(path, url.type)) {
  ------------------
  |  Branch (14559:21): [True: 0, False: 0]
  ------------------
14560|      0|                  url.update_base_pathname(std::move(std::string(path)));
14561|      0|                }
14562|      0|              }
14563|      0|            }
14564|       |            // Otherwise:
14565|      0|            else {
14566|       |              // Set url's path to an empty list.
14567|      0|              url.clear_pathname();
14568|      0|              url.has_opaque_path = true;
14569|      0|            }
14570|       |
14571|       |            // Set state to path state and decrease pointer by 1.
14572|      0|            state = state::PATH;
14573|      0|            break;
14574|      0|          }
14575|      0|        }
14576|       |        // Otherwise, set state to path state, and decrease pointer by 1.
14577|      0|        else {
14578|      0|          ada_log("FILE go to path");
14579|      0|          state = state::PATH;
14580|      0|          break;
14581|      0|        }
14582|       |
14583|      0|        input_position++;
14584|      0|        break;
14585|      0|      }
14586|      0|      default:
  ------------------
  |  Branch (14586:7): [True: 0, False: 28.0k]
  ------------------
14587|      0|        unreachable();
14588|  28.0k|    }
14589|  28.0k|  }
14590|    494|  if constexpr (store_values) {
14591|    494|    if (fragment.has_value()) {
  ------------------
  |  Branch (14591:9): [True: 17, False: 477]
  ------------------
14592|     17|      url.update_unencoded_base_hash(*fragment);
14593|     17|    }
14594|    494|  }
14595|       |  // Check the resulting (normalized) URL size against the maximum input length.
14596|       |  // Normalization (percent-encoding, IDNA, etc.) can expand the URL beyond the
14597|       |  // original input size.
14598|    494|  if constexpr (store_values) {
14599|    494|    if (url.is_valid) {
  ------------------
  |  Branch (14599:9): [True: 494, False: 0]
  ------------------
14600|    494|      if constexpr (result_type_is_ada_url_aggregator) {
14601|    494|        if (url.buffer.size() > max_input_length) {
  ------------------
  |  Branch (14601:13): [True: 0, False: 494]
  ------------------
14602|      0|          url.is_valid = false;
14603|      0|        }
14604|       |      } else {
14605|       |        if (url.get_href_size() > max_input_length) {
14606|       |          url.is_valid = false;
14607|       |        }
14608|       |      }
14609|    494|    }
14610|    494|  }
14611|    494|  return url;
14612|  5.20k|}
_ZNK3ada14url_aggregator12get_hostnameEv:
15498|  2.70k|    ada_lifetime_bound {
15499|  2.70k|  ada_log("url_aggregator::get_hostname");
15500|       |  // Technically, we should check if there is a hostname, but
15501|       |  // the code below works even if there isn't.
15502|       |  // if(!has_hostname()) { return ""; }
15503|  2.70k|  size_t start = components.host_start;
15504|       |  // So host_start is not where the host begins.
15505|  2.70k|  if (components.host_end > components.host_start &&
  ------------------
  |  Branch (15505:7): [True: 1.40k, False: 1.29k]
  ------------------
15506|  1.40k|      buffer[components.host_start] == '@') {
  ------------------
  |  Branch (15506:7): [True: 198, False: 1.20k]
  ------------------
15507|    198|    start++;
15508|    198|  }
15509|  2.70k|  return helpers::substring(buffer, start, components.host_end);
15510|  2.70k|}
_ZN3ada14url_aggregator10parse_ipv4ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEb:
15643|    720|bool url_aggregator::parse_ipv4(std::string_view input, bool in_place) {
15644|    720|  ada_log("parse_ipv4 ", input, " [", input.size(),
15645|    720|          " bytes], overlaps with buffer: ",
15646|    720|          helpers::overlaps(input, buffer) ? "yes" : "no");
15647|    720|  ADA_ASSERT_TRUE(validate());
15648|    720|  const bool trailing_dot = (input.back() == '.');
15649|    720|  if (trailing_dot) {
  ------------------
  |  Branch (15649:7): [True: 70, False: 650]
  ------------------
15650|     70|    input.remove_suffix(1);
15651|     70|  }
15652|    720|  size_t digit_count{0};
15653|    720|  int pure_decimal_count = 0;  // entries that are decimal
15654|    720|  uint64_t ipv4{0};
15655|       |  // we could unroll for better performance?
15656|    971|  for (; (digit_count < 4) && !(input.empty()); digit_count++) {
  ------------------
  |  Branch (15656:10): [True: 956, False: 15]
  |  Branch (15656:31): [True: 956, False: 0]
  ------------------
15657|    956|    uint32_t
15658|    956|        segment_result{};  // If any number exceeds 32 bits, we have an error.
15659|    956|    bool is_hex = checkers::has_hex_prefix(input);
15660|    956|    if (is_hex && ((input.length() == 2) ||
  ------------------
  |  Branch (15660:9): [True: 213, False: 743]
  |  Branch (15660:20): [True: 6, False: 207]
  ------------------
15661|    207|                   ((input.length() > 2) && (input[2] == '.')))) {
  ------------------
  |  Branch (15661:21): [True: 207, False: 0]
  |  Branch (15661:45): [True: 3, False: 204]
  ------------------
15662|       |      // special case
15663|      9|      segment_result = 0;
15664|      9|      input.remove_prefix(2);
15665|    947|    } else {
15666|    947|      std::from_chars_result r{};
15667|    947|      if (is_hex) {
  ------------------
  |  Branch (15667:11): [True: 204, False: 743]
  ------------------
15668|    204|        ada_log("parse_ipv4 trying to parse hex number");
15669|    204|        r = std::from_chars(input.data() + 2, input.data() + input.size(),
15670|    204|                            segment_result, 16);
15671|    743|      } else if ((input.length() >= 2) && input[0] == '0' &&
  ------------------
  |  Branch (15671:18): [True: 674, False: 69]
  |  Branch (15671:43): [True: 183, False: 491]
  ------------------
15672|    183|                 checkers::is_digit(input[1])) {
  ------------------
  |  Branch (15672:18): [True: 114, False: 69]
  ------------------
15673|    114|        ada_log("parse_ipv4 trying to parse octal number");
15674|    114|        r = std::from_chars(input.data() + 1, input.data() + input.size(),
15675|    114|                            segment_result, 8);
15676|    629|      } else {
15677|    629|        ada_log("parse_ipv4 trying to parse decimal number");
15678|    629|        pure_decimal_count++;
15679|    629|        r = std::from_chars(input.data(), input.data() + input.size(),
15680|    629|                            segment_result, 10);
15681|    629|      }
15682|    947|      if (r.ec != std::errc()) {
  ------------------
  |  Branch (15682:11): [True: 319, False: 628]
  ------------------
15683|    319|        ada_log("parse_ipv4 parsing failed");
15684|    319|        return is_valid = false;
15685|    319|      }
15686|    628|      ada_log("parse_ipv4 parsed ", segment_result);
15687|    628|      input.remove_prefix(r.ptr - input.data());
15688|    628|    }
15689|    637|    if (input.empty()) {
  ------------------
  |  Branch (15689:9): [True: 303, False: 334]
  ------------------
15690|       |      // We have the last value.
15691|       |      // At this stage, ipv4 contains digit_count*8 bits.
15692|       |      // So we have 32-digit_count*8 bits left.
15693|    303|      if (segment_result >= (uint64_t(1) << (32 - digit_count * 8))) {
  ------------------
  |  Branch (15693:11): [True: 14, False: 289]
  ------------------
15694|     14|        return is_valid = false;
15695|     14|      }
15696|    289|      ipv4 <<= (32 - digit_count * 8);
15697|    289|      ipv4 |= segment_result;
15698|    289|      goto final;
15699|    334|    } else {
15700|       |      // There is more, so that the value must no be larger than 255
15701|       |      // and we must have a '.'.
15702|    334|      if ((segment_result > 255) || (input[0] != '.')) {
  ------------------
  |  Branch (15702:11): [True: 41, False: 293]
  |  Branch (15702:37): [True: 42, False: 251]
  ------------------
15703|     83|        return is_valid = false;
15704|     83|      }
15705|    251|      ipv4 <<= 8;
15706|    251|      ipv4 |= segment_result;
15707|    251|      input.remove_prefix(1);  // remove '.'
15708|    251|    }
15709|    637|  }
15710|     15|  if ((digit_count != 4) || (!input.empty())) {
  ------------------
  |  Branch (15710:7): [True: 0, False: 15]
  |  Branch (15710:29): [True: 15, False: 0]
  ------------------
15711|     15|    ada_log("parse_ipv4 found invalid (more than 4 numbers or empty) ");
15712|     15|    return is_valid = false;
15713|     15|  }
15714|    289|final:
15715|    289|  ada_log("url_aggregator::parse_ipv4 completed ", get_href(),
15716|    289|          " host: ", get_host());
15717|       |
15718|       |  // We could also check r.ptr to see where the parsing ended.
15719|    289|  if (in_place && pure_decimal_count == 4 && !trailing_dot) {
  ------------------
  |  Branch (15719:7): [True: 282, False: 7]
  |  Branch (15719:19): [True: 0, False: 282]
  |  Branch (15719:46): [True: 0, False: 0]
  ------------------
15720|      0|    ada_log(
15721|      0|        "url_aggregator::parse_ipv4 completed and was already correct in the "
15722|      0|        "buffer");
15723|       |    // The original input was already all decimal and we validated it. So we
15724|       |    // don't need to do anything.
15725|    289|  } else {
15726|    289|    ada_log("url_aggregator::parse_ipv4 completed and we need to update it");
15727|       |    // Optimization opportunity: Get rid of unnecessary string return in ipv4
15728|       |    // serializer.
15729|       |    // TODO: This is likely a bug because it goes back update_base_hostname, not
15730|       |    // what we want to do.
15731|    289|    update_base_hostname(
15732|    289|        ada::serializers::ipv4(ipv4));  // We have to reserialize the address.
15733|    289|  }
15734|    289|  host_type = IPV4;
15735|    289|  ADA_ASSERT_TRUE(validate());
15736|    289|  return true;
15737|     15|}
_ZN3ada14url_aggregator10parse_ipv6ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
15739|  2.98k|bool url_aggregator::parse_ipv6(std::string_view input) {
15740|       |  // TODO: Implement in_place optimization: we know that input points
15741|       |  // in the buffer, so we can just check whether the buffer is already
15742|       |  // well formatted.
15743|       |  // TODO: Find a way to merge parse_ipv6 with url.cpp implementation.
15744|  2.98k|  ada_log("parse_ipv6 ", input, " [", input.size(), " bytes]");
15745|  2.98k|  ADA_ASSERT_TRUE(validate());
15746|  2.98k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
15747|  2.98k|  if (input.empty()) {
  ------------------
  |  Branch (15747:7): [True: 1, False: 2.98k]
  ------------------
15748|      1|    return is_valid = false;
15749|      1|  }
15750|       |  // Let address be a new IPv6 address whose IPv6 pieces are all 0.
15751|  2.98k|  std::array<uint16_t, 8> address{};
15752|       |
15753|       |  // Let pieceIndex be 0.
15754|  2.98k|  int piece_index = 0;
15755|       |
15756|       |  // Let compress be null.
15757|  2.98k|  std::optional<int> compress{};
15758|       |
15759|       |  // Let pointer be a pointer for input.
15760|  2.98k|  std::string_view::iterator pointer = input.begin();
15761|       |
15762|       |  // If c is U+003A (:), then:
15763|  2.98k|  if (input[0] == ':') {
  ------------------
  |  Branch (15763:7): [True: 3, False: 2.98k]
  ------------------
15764|       |    // If remaining does not start with U+003A (:), validation error, return
15765|       |    // failure.
15766|      3|    if (input.size() == 1 || input[1] != ':') {
  ------------------
  |  Branch (15766:9): [True: 1, False: 2]
  |  Branch (15766:30): [True: 1, False: 1]
  ------------------
15767|      2|      ada_log("parse_ipv6 starts with : but the rest does not start with :");
15768|      2|      return is_valid = false;
15769|      2|    }
15770|       |
15771|       |    // Increase pointer by 2.
15772|      1|    pointer += 2;
15773|       |
15774|       |    // Increase pieceIndex by 1 and then set compress to pieceIndex.
15775|      1|    compress = ++piece_index;
15776|      1|  }
15777|       |
15778|       |  // While c is not the EOF code point:
15779|  3.10k|  while (pointer != input.end()) {
  ------------------
  |  Branch (15779:10): [True: 3.09k, False: 5]
  ------------------
15780|       |    // If pieceIndex is 8, validation error, return failure.
15781|  3.09k|    if (piece_index == 8) {
  ------------------
  |  Branch (15781:9): [True: 1, False: 3.09k]
  ------------------
15782|      1|      ada_log("parse_ipv6 piece_index == 8");
15783|      1|      return is_valid = false;
15784|      1|    }
15785|       |
15786|       |    // If c is U+003A (:), then:
15787|  3.09k|    if (*pointer == ':') {
  ------------------
  |  Branch (15787:9): [True: 20, False: 3.07k]
  ------------------
15788|       |      // If compress is non-null, validation error, return failure.
15789|     20|      if (compress.has_value()) {
  ------------------
  |  Branch (15789:11): [True: 3, False: 17]
  ------------------
15790|      3|        ada_log("parse_ipv6 compress is non-null");
15791|      3|        return is_valid = false;
15792|      3|      }
15793|       |
15794|       |      // Increase pointer and pieceIndex by 1, set compress to pieceIndex, and
15795|       |      // then continue.
15796|     17|      pointer++;
15797|     17|      compress = ++piece_index;
15798|     17|      continue;
15799|     20|    }
15800|       |
15801|       |    // Let value and length be 0.
15802|  3.07k|    uint16_t value = 0, length = 0;
15803|       |
15804|       |    // While length is less than 4 and c is an ASCII hex digit,
15805|       |    // set value to value times 0x10 + c interpreted as hexadecimal number, and
15806|       |    // increase pointer and length by 1.
15807|  3.43k|    while (length < 4 && pointer != input.end() &&
  ------------------
  |  Branch (15807:12): [True: 3.38k, False: 42]
  |  Branch (15807:26): [True: 3.38k, False: 4]
  ------------------
15808|  3.38k|           unicode::is_ascii_hex_digit(*pointer)) {
  ------------------
  |  Branch (15808:12): [True: 355, False: 3.02k]
  ------------------
15809|       |      // https://stackoverflow.com/questions/39060852/why-does-the-addition-of-two-shorts-return-an-int
15810|    355|      value = uint16_t(value * 0x10 + unicode::convert_hex_to_binary(*pointer));
15811|    355|      pointer++;
15812|    355|      length++;
15813|    355|    }
15814|       |
15815|       |    // If c is U+002E (.), then:
15816|  3.07k|    if (pointer != input.end() && *pointer == '.') {
  ------------------
  |  Branch (15816:9): [True: 3.07k, False: 4]
  |  Branch (15816:35): [True: 26, False: 3.04k]
  ------------------
15817|       |      // If length is 0, validation error, return failure.
15818|     26|      if (length == 0) {
  ------------------
  |  Branch (15818:11): [True: 1, False: 25]
  ------------------
15819|      1|        ada_log("parse_ipv6 length is 0");
15820|      1|        return is_valid = false;
15821|      1|      }
15822|       |
15823|       |      // Decrease pointer by length.
15824|     25|      pointer -= length;
15825|       |
15826|       |      // If pieceIndex is greater than 6, validation error, return failure.
15827|     25|      if (piece_index > 6) {
  ------------------
  |  Branch (15827:11): [True: 1, False: 24]
  ------------------
15828|      1|        ada_log("parse_ipv6 piece_index > 6");
15829|      1|        return is_valid = false;
15830|      1|      }
15831|       |
15832|       |      // Let numbersSeen be 0.
15833|     24|      int numbers_seen = 0;
15834|       |
15835|       |      // While c is not the EOF code point:
15836|     70|      while (pointer != input.end()) {
  ------------------
  |  Branch (15836:14): [True: 62, False: 8]
  ------------------
15837|       |        // Let ipv4Piece be null.
15838|     62|        std::optional<uint16_t> ipv4_piece{};
15839|       |
15840|       |        // If numbersSeen is greater than 0, then:
15841|     62|        if (numbers_seen > 0) {
  ------------------
  |  Branch (15841:13): [True: 38, False: 24]
  ------------------
15842|       |          // If c is a U+002E (.) and numbersSeen is less than 4, then increase
15843|       |          // pointer by 1.
15844|     38|          if (*pointer == '.' && numbers_seen < 4) {
  ------------------
  |  Branch (15844:15): [True: 36, False: 2]
  |  Branch (15844:34): [True: 34, False: 2]
  ------------------
15845|     34|            pointer++;
15846|     34|          } else {
15847|       |            // Otherwise, validation error, return failure.
15848|      4|            ada_log("parse_ipv6 Otherwise, validation error, return failure");
15849|      4|            return is_valid = false;
15850|      4|          }
15851|     38|        }
15852|       |
15853|       |        // If c is not an ASCII digit, validation error, return failure.
15854|     58|        if (pointer == input.end() || !checkers::is_digit(*pointer)) {
  ------------------
  |  Branch (15854:13): [True: 0, False: 58]
  |  Branch (15854:39): [True: 7, False: 51]
  ------------------
15855|      7|          ada_log(
15856|      7|              "parse_ipv6 If c is not an ASCII digit, validation error, return "
15857|      7|              "failure");
15858|      7|          return is_valid = false;
15859|      7|        }
15860|       |
15861|       |        // While c is an ASCII digit:
15862|    139|        while (pointer != input.end() && checkers::is_digit(*pointer)) {
  ------------------
  |  Branch (15862:16): [True: 131, False: 8]
  |  Branch (15862:42): [True: 93, False: 38]
  ------------------
15863|       |          // Let number be c interpreted as decimal number.
15864|     93|          int number = *pointer - '0';
15865|       |
15866|       |          // If ipv4Piece is null, then set ipv4Piece to number.
15867|     93|          if (!ipv4_piece.has_value()) {
  ------------------
  |  Branch (15867:15): [True: 51, False: 42]
  ------------------
15868|     51|            ipv4_piece = number;
15869|     51|          }
15870|       |          // Otherwise, if ipv4Piece is 0, validation error, return failure.
15871|     42|          else if (ipv4_piece == 0) {
  ------------------
  |  Branch (15871:20): [True: 1, False: 41]
  ------------------
15872|      1|            ada_log("parse_ipv6 if ipv4Piece is 0, validation error");
15873|      1|            return is_valid = false;
15874|      1|          }
15875|       |          // Otherwise, set ipv4Piece to ipv4Piece times 10 + number.
15876|     41|          else {
15877|     41|            ipv4_piece = *ipv4_piece * 10 + number;
15878|     41|          }
15879|       |
15880|       |          // If ipv4Piece is greater than 255, validation error, return failure.
15881|     92|          if (ipv4_piece > 255) {
  ------------------
  |  Branch (15881:15): [True: 4, False: 88]
  ------------------
15882|      4|            ada_log("parse_ipv6 ipv4_piece > 255");
15883|      4|            return is_valid = false;
15884|      4|          }
15885|       |
15886|       |          // Increase pointer by 1.
15887|     88|          pointer++;
15888|     88|        }
15889|       |
15890|       |        // Set address[pieceIndex] to address[pieceIndex] times 0x100 +
15891|       |        // ipv4Piece.
15892|       |        // https://stackoverflow.com/questions/39060852/why-does-the-addition-of-two-shorts-return-an-int
15893|     46|        if (!ipv4_piece.has_value()) {
  ------------------
  |  Branch (15893:13): [True: 0, False: 46]
  ------------------
15894|      0|          return is_valid = false;
15895|      0|        }
15896|     46|        address[piece_index] =
15897|     46|            uint16_t(address[piece_index] * 0x100 + *ipv4_piece);
15898|       |
15899|       |        // Increase numbersSeen by 1.
15900|     46|        numbers_seen++;
15901|       |
15902|       |        // If numbersSeen is 2 or 4, then increase pieceIndex by 1.
15903|     46|        if (numbers_seen == 2 || numbers_seen == 4) {
  ------------------
  |  Branch (15903:13): [True: 13, False: 33]
  |  Branch (15903:34): [True: 4, False: 29]
  ------------------
15904|     17|          piece_index++;
15905|     17|        }
15906|     46|      }
15907|       |
15908|       |      // If numbersSeen is not 4, validation error, return failure.
15909|      8|      if (numbers_seen != 4) {
  ------------------
  |  Branch (15909:11): [True: 6, False: 2]
  ------------------
15910|      6|        return is_valid = false;
15911|      6|      }
15912|       |
15913|       |      // Break.
15914|      2|      break;
15915|      8|    }
15916|       |    // Otherwise, if c is U+003A (:):
15917|  3.04k|    else if ((pointer != input.end()) && (*pointer == ':')) {
  ------------------
  |  Branch (15917:14): [True: 3.04k, False: 4]
  |  Branch (15917:42): [True: 98, False: 2.94k]
  ------------------
15918|       |      // Increase pointer by 1.
15919|     98|      pointer++;
15920|       |
15921|       |      // If c is the EOF code point, validation error, return failure.
15922|     98|      if (pointer == input.end()) {
  ------------------
  |  Branch (15922:11): [True: 1, False: 97]
  ------------------
15923|      1|        ada_log(
15924|      1|            "parse_ipv6 If c is the EOF code point, validation error, return "
15925|      1|            "failure");
15926|      1|        return is_valid = false;
15927|      1|      }
15928|     98|    }
15929|       |    // Otherwise, if c is not the EOF code point, validation error, return
15930|       |    // failure.
15931|  2.95k|    else if (pointer != input.end()) {
  ------------------
  |  Branch (15931:14): [True: 2.94k, False: 4]
  ------------------
15932|  2.94k|      ada_log(
15933|  2.94k|          "parse_ipv6 Otherwise, if c is not the EOF code point, validation "
15934|  2.94k|          "error, return failure");
15935|  2.94k|      return is_valid = false;
15936|  2.94k|    }
15937|       |
15938|       |    // Set address[pieceIndex] to value.
15939|    101|    address[piece_index] = value;
15940|       |
15941|       |    // Increase pieceIndex by 1.
15942|    101|    piece_index++;
15943|    101|  }
15944|       |
15945|       |  // If compress is non-null, then:
15946|      7|  if (compress.has_value()) {
  ------------------
  |  Branch (15946:7): [True: 5, False: 2]
  ------------------
15947|       |    // Let swaps be pieceIndex - compress.
15948|      5|    int swaps = piece_index - *compress;
15949|       |
15950|       |    // Set pieceIndex to 7.
15951|      5|    piece_index = 7;
15952|       |
15953|       |    // While pieceIndex is not 0 and swaps is greater than 0,
15954|       |    // swap address[pieceIndex] with address[compress + swaps - 1], and then
15955|       |    // decrease both pieceIndex and swaps by 1.
15956|     15|    while (piece_index != 0 && swaps > 0) {
  ------------------
  |  Branch (15956:12): [True: 15, False: 0]
  |  Branch (15956:32): [True: 10, False: 5]
  ------------------
15957|     10|      std::swap(address[piece_index], address[*compress + swaps - 1]);
15958|     10|      piece_index--;
15959|     10|      swaps--;
15960|     10|    }
15961|      5|  }
15962|       |  // Otherwise, if compress is null and pieceIndex is not 8, validation error,
15963|       |  // return failure.
15964|      2|  else if (piece_index != 8) {
  ------------------
  |  Branch (15964:12): [True: 2, False: 0]
  ------------------
15965|      2|    ada_log(
15966|      2|        "parse_ipv6 if compress is null and pieceIndex is not 8, validation "
15967|      2|        "error, return failure");
15968|      2|    return is_valid = false;
15969|      2|  }
15970|       |  // TODO: Optimization opportunity: Get rid of unnecessary string creation.
15971|       |  // TODO: This is likely a bug because it goes back update_base_hostname, not
15972|       |  // what we want to do.
15973|      5|  update_base_hostname(ada::serializers::ipv6(address));
15974|      5|  ada_log("parse_ipv6 ", get_hostname());
15975|      5|  ADA_ASSERT_TRUE(validate());
15976|      5|  host_type = IPV6;
15977|      5|  return true;
15978|      7|}
serializers.cc:_ZZN3ada4idna22utf32_length_from_utf8EPKcmENK3$_0clEa:
  263|  28.0k|  return std::count_if(p, std::next(p, len), [](int8_t c) {
  264|       |    // -65 is 0b10111111, anything larger in two-complement's
  265|       |    // should start a new code point.
  266|  28.0k|    return c > -65;
  267|  28.0k|  });
serializers.cc:_ZZN3ada4idna9ascii_mapEPcmENK3$_0clEh:
 2838|  3.66k|  auto broadcast = [](uint8_t v) -> uint64_t {
 2839|  3.66k|    return 0x101010101010101ull * v;
 2840|  3.66k|  };
serializers.cc:_ZN3ada4idnaL11idna_lookupEj:
 2786|  24.7k|static uint16_t idna_lookup(uint32_t cp) noexcept {
 2787|       |  // -- Two-level table covers the full active code-point range ---------------
 2788|  24.7k|  if (cp < IDNA_LOW_RANGE_END) {
  ------------------
  |  Branch (2788:7): [True: 24.6k, False: 67]
  ------------------
 2789|  24.6k|    uint16_t ref = idna_stage1[cp >> IDNA_BLOCK_BITS];
 2790|  24.6k|    if (ref & IDNA_BOOL_FLAG) {
  ------------------
  |  Branch (2790:9): [True: 14.9k, False: 9.67k]
  ------------------
 2791|       |      // Boolean block: one bit per code point, 1 = VALID, 0 = DISALLOWED.
 2792|  14.9k|      uint32_t bit_idx =
 2793|  14.9k|          static_cast<uint32_t>(ref & ~IDNA_BOOL_FLAG) * IDNA_BLOCK_SIZE +
 2794|  14.9k|          (cp & IDNA_BLOCK_MASK);
 2795|  14.9k|      bool is_valid = (idna_bool_blocks[bit_idx >> 6] >> (bit_idx & 63u)) & 1u;
 2796|  14.9k|      return is_valid ? IDNA_VALID : IDNA_DISALLOWED;
  ------------------
  |  Branch (2796:14): [True: 14.9k, False: 8]
  ------------------
 2797|  14.9k|    }
 2798|  9.67k|    return idna_stage2[ref + (cp & IDNA_BLOCK_MASK)];
 2799|  24.6k|  }
 2800|       |
 2801|       |  // -- Variation selectors supplement (U+E0100-U+E01EF): all ignored ---------
 2802|       |  // Everything else above IDNA_LOW_RANGE_END is disallowed.
 2803|     67|  if (cp >= IDNA_HIGH_IGNORED_START && cp < IDNA_HIGH_IGNORED_END) {
  ------------------
  |  Branch (2803:7): [True: 32, False: 35]
  |  Branch (2803:40): [True: 3, False: 29]
  ------------------
 2804|      3|    return IDNA_IGNORED;
 2805|      3|  }
 2806|       |
 2807|     64|  return IDNA_DISALLOWED;
 2808|     67|}
serializers.cc:_ZN3ada4idnaL9utf8_nextERPKh:
 2813|  3.50k|static char32_t utf8_next(const uint8_t*& ptr) noexcept {
 2814|  3.50k|  uint8_t b0 = *ptr++;
 2815|  3.50k|  if (b0 < 0x80u) return static_cast<char32_t>(b0);
  ------------------
  |  Branch (2815:7): [True: 2.46k, False: 1.03k]
  ------------------
 2816|  1.03k|  if (b0 < 0xE0u) {
  ------------------
  |  Branch (2816:7): [True: 730, False: 305]
  ------------------
 2817|    730|    uint32_t cp = (b0 & 0x1Fu) << 6;
 2818|    730|    cp |= (*ptr++ & 0x3Fu);
 2819|    730|    return static_cast<char32_t>(cp);
 2820|    730|  }
 2821|    305|  if (b0 < 0xF0u) {
  ------------------
  |  Branch (2821:7): [True: 147, False: 158]
  ------------------
 2822|    147|    uint32_t cp = (b0 & 0x0Fu) << 12;
 2823|    147|    cp |= ((*ptr++ & 0x3Fu) << 6);
 2824|    147|    cp |= (*ptr++ & 0x3Fu);
 2825|    147|    return static_cast<char32_t>(cp);
 2826|    147|  }
 2827|       |  // 4-byte sequence
 2828|    158|  uint32_t cp = (b0 & 0x07u) << 18;
 2829|    158|  cp |= ((*ptr++ & 0x3Fu) << 12);
 2830|    158|  cp |= ((*ptr++ & 0x3Fu) << 6);
 2831|    158|  cp |= (*ptr++ & 0x3Fu);
 2832|    158|  return static_cast<char32_t>(cp);
 2833|    305|}
serializers.cc:_ZN3ada4idnaL19char_to_digit_valueEc:
 8040|  5.33k|static constexpr int32_t char_to_digit_value(char value) {
 8041|  5.33k|  if (value >= 'a' && value <= 'z') return value - 'a';
  ------------------
  |  Branch (8041:7): [True: 4.47k, False: 864]
  |  Branch (8041:23): [True: 4.46k, False: 1]
  ------------------
 8042|    865|  if (value >= '0' && value <= '9') return value - '0' + 26;
  ------------------
  |  Branch (8042:7): [True: 859, False: 6]
  |  Branch (8042:23): [True: 857, False: 2]
  ------------------
 8043|      8|  return -1;
 8044|    865|}
serializers.cc:_ZN3ada4idnaL5adaptEiib:
 8050|  3.93k|static constexpr int32_t adapt(int32_t d, int32_t n, bool firsttime) {
 8051|  3.93k|  if (firsttime) {
  ------------------
  |  Branch (8051:7): [True: 804, False: 3.13k]
  ------------------
 8052|    804|    d = d / damp;
 8053|  3.13k|  } else {
 8054|  3.13k|    d = d / 2;
 8055|  3.13k|  }
 8056|  3.93k|  d += d / n;
 8057|  3.93k|  int32_t k = 0;
 8058|  4.79k|  while (d > ((base - tmin) * tmax) / 2) {
  ------------------
  |  Branch (8058:10): [True: 858, False: 3.93k]
  ------------------
 8059|    858|    d /= base - tmin;
 8060|    858|    k += base;
 8061|    858|  }
 8062|  3.93k|  return k + (((base - tmin + 1) * d) / (d + skew));
 8063|  3.93k|}
serializers.cc:_ZN3ada4idnaL13digit_to_charEi:
 8046|  2.61k|static constexpr char digit_to_char(int32_t digit) {
 8047|  2.61k|  return digit < 26 ? char(digit + 97) : char(digit + 22);
  ------------------
  |  Branch (8047:10): [True: 1.76k, False: 851]
  ------------------
 8048|  2.61k|}
serializers.cc:_ZZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEEENK3$_0clEj:
 9473|    826|      auto is_l_or_d = [](uint32_t code) {
 9474|    826|        return std::ranges::binary_search(L, code) ||
  ------------------
  |  Branch (9474:16): [True: 0, False: 826]
  ------------------
 9475|    826|               std::ranges::binary_search(D, code);
  ------------------
  |  Branch (9475:16): [True: 20, False: 806]
  ------------------
 9476|    826|      };
serializers.cc:_ZZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEEENK3$_1clEj:
 9477|    573|      auto is_r_or_d = [](uint32_t code) {
 9478|    573|        return std::ranges::binary_search(R, code) ||
  ------------------
  |  Branch (9478:16): [True: 0, False: 573]
  ------------------
 9479|    573|               std::ranges::binary_search(D, code);
  ------------------
  |  Branch (9479:16): [True: 5, False: 568]
  ------------------
 9480|    573|      };
serializers.cc:_ZN3ada4idnaL20find_last_not_of_nsmENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 9055|    786|    const std::u32string_view label) noexcept {
 9056|    827|  for (int i = static_cast<int>(label.size() - 1); i >= 0; i--)
  ------------------
  |  Branch (9056:52): [True: 827, False: 0]
  ------------------
 9057|    827|    if (find_direction(label[i]) != direction::NSM) return i;
  ------------------
  |  Branch (9057:9): [True: 786, False: 41]
  ------------------
 9058|       |
 9059|      0|  return std::u32string_view::npos;
 9060|    786|}
serializers.cc:_ZN3ada4idnaL12is_rtl_labelENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 9064|    786|inline static bool is_rtl_label(const std::u32string_view label) noexcept {
 9065|    786|  const size_t mask =
 9066|    786|      (1u << direction::R) | (1u << direction::AL) | (1u << direction::AN);
 9067|       |
 9068|    786|  size_t directions = 0;
 9069|  11.4k|  for (size_t i = 0; i < label.size(); i++) {
  ------------------
  |  Branch (9069:22): [True: 10.6k, False: 786]
  ------------------
 9070|  10.6k|    directions |= 1u << find_direction(label[i]);
 9071|  10.6k|  }
 9072|    786|  return (directions & mask) != 0;
 9073|    786|}
serializers.cc:_ZN3ada4idnaL14find_directionEj:
 9040|  14.3k|inline static direction find_direction(uint32_t code_point) noexcept {
 9041|  14.3k|  const auto it = std::ranges::lower_bound(
 9042|  14.3k|      dir_table, code_point, {},
 9043|  14.3k|      &directions::final_code);  // project to the upper bound of each range
 9044|       |
 9045|       |  // Safety check - almost always false, but cheap.
 9046|  14.3k|  if (it == std::ranges::end(dir_table)) {
  ------------------
  |  Branch (9046:7): [True: 0, False: 14.3k]
  ------------------
 9047|      0|    return direction::NONE;
 9048|      0|  }
 9049|       |
 9050|       |  // Invariant: it->final_code >= code_point. Confirm it's also in range.
 9051|  14.3k|  return code_point >= it->start_code ? it->direct : direction::NONE;
  ------------------
  |  Branch (9051:10): [True: 14.2k, False: 106]
  ------------------
 9052|  14.3k|}
_ZN3ada4idna8is_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 9628|  1.35k|bool constexpr is_ascii(std::string_view view) {
 9629|  22.1k|  for (uint8_t c : view) {
  ------------------
  |  Branch (9629:18): [True: 22.1k, False: 609]
  ------------------
 9630|  22.1k|    if (c >= 0x80) {
  ------------------
  |  Branch (9630:9): [True: 745, False: 21.4k]
  ------------------
 9631|    745|      return false;
 9632|    745|    }
 9633|  22.1k|  }
 9634|    609|  return true;
 9635|  1.35k|}
serializers.cc:_ZN3ada4idnaL19from_ascii_to_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 9661|    609|static std::string from_ascii_to_ascii(std::string_view ut8_string) {
 9662|    609|  static const std::string error = "";
 9663|    609|  std::string out;
 9664|    609|  out.reserve(ut8_string.size());
 9665|    609|  std::u32string tmp_buffer;
 9666|    609|  std::u32string post_map;
 9667|    609|  size_t label_start = 0;
 9668|       |
 9669|  1.83k|  while (label_start != ut8_string.size()) {
  ------------------
  |  Branch (9669:10): [True: 1.34k, False: 486]
  ------------------
 9670|  1.34k|    size_t loc_dot = ut8_string.find('.', label_start);
 9671|  1.34k|    bool is_last_label = (loc_dot == std::string_view::npos);
 9672|  1.34k|    size_t label_size =
 9673|  1.34k|        is_last_label ? ut8_string.size() - label_start : loc_dot - label_start;
  ------------------
  |  Branch (9673:9): [True: 531, False: 816]
  ------------------
 9674|  1.34k|    size_t label_size_with_dot = is_last_label ? label_size : label_size + 1;
  ------------------
  |  Branch (9674:34): [True: 531, False: 816]
  ------------------
 9675|  1.34k|    std::string_view label_view(ut8_string.data() + label_start, label_size);
 9676|  1.34k|    label_start += label_size_with_dot;
 9677|  1.34k|    if (label_size == 0) {
  ------------------
  |  Branch (9677:9): [True: 127, False: 1.22k]
  ------------------
 9678|       |      // empty label? Nothing to do.
 9679|  1.22k|    } else {
 9680|       |      // Append the label to out and lowercase it in-place, avoiding a separate
 9681|       |      // copy of the entire input string.
 9682|  1.22k|      size_t label_out_start = out.size();
 9683|  1.22k|      out.append(label_view);
 9684|  1.22k|      ascii_map(out.data() + label_out_start, label_size);
 9685|  1.22k|      std::string_view mapped_label(out.data() + label_out_start, label_size);
 9686|  1.22k|      if (mapped_label.starts_with("xn--")) {
  ------------------
  |  Branch (9686:11): [True: 213, False: 1.00k]
  ------------------
 9687|       |        // The xn-- part is the expensive game.
 9688|    213|        std::string_view puny_segment_ascii(out.data() + label_out_start + 4,
 9689|    213|                                            label_size - 4);
 9690|    213|        tmp_buffer.clear();
 9691|    213|        bool is_ok =
 9692|    213|            ada::idna::punycode_to_utf32(puny_segment_ascii, tmp_buffer);
 9693|    213|        if (!is_ok) {
  ------------------
  |  Branch (9693:13): [True: 19, False: 194]
  ------------------
 9694|     19|          return error;
 9695|     19|        }
 9696|       |        // If the input is just ASCII, it should not have been encoded
 9697|       |        // as punycode.
 9698|       |        // https://github.com/whatwg/url/issues/760
 9699|    194|        if (is_ascii(tmp_buffer)) {
  ------------------
  |  Branch (9699:13): [True: 4, False: 190]
  ------------------
 9700|      4|          return error;
 9701|      4|        }
 9702|    190|        if (!ada::idna::map(tmp_buffer, post_map)) {
  ------------------
  |  Branch (9702:13): [True: 43, False: 147]
  ------------------
 9703|     43|          return error;
 9704|     43|        }
 9705|    147|        if (tmp_buffer != post_map) {
  ------------------
  |  Branch (9705:13): [True: 16, False: 131]
  ------------------
 9706|     16|          return error;
 9707|     16|        }
 9708|    131|        normalize(post_map);
 9709|    131|        if (post_map != tmp_buffer) {
  ------------------
  |  Branch (9709:13): [True: 22, False: 109]
  ------------------
 9710|     22|          return error;
 9711|     22|        }
 9712|    109|        if (post_map.empty()) {
  ------------------
  |  Branch (9712:13): [True: 0, False: 109]
  ------------------
 9713|      0|          return error;
 9714|      0|        }
 9715|    109|        if (!is_label_valid(post_map)) {
  ------------------
  |  Branch (9715:13): [True: 19, False: 90]
  ------------------
 9716|     19|          return error;
 9717|     19|        }
 9718|    109|      }
 9719|  1.22k|    }
 9720|  1.22k|    if (!is_last_label) {
  ------------------
  |  Branch (9720:9): [True: 774, False: 450]
  ------------------
 9721|    774|      out.push_back('.');
 9722|    774|    }
 9723|  1.22k|  }
 9724|    486|  return out;
 9725|    609|}
_ZN3ada4idna8is_asciiENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 9619|  2.04k|bool constexpr is_ascii(std::u32string_view view) {
 9620|  11.2k|  for (uint32_t c : view) {
  ------------------
  |  Branch (9620:19): [True: 11.2k, False: 1.09k]
  ------------------
 9621|  11.2k|    if (c >= 0x80) {
  ------------------
  |  Branch (9621:9): [True: 945, False: 10.2k]
  ------------------
 9622|    945|      return false;
 9623|    945|    }
 9624|  11.2k|  }
 9625|  1.09k|  return true;
 9626|  2.04k|}
_ZN3ada7unicode18is_ascii_hex_digitEc:
10923|  22.1k|ada_really_inline constexpr bool is_ascii_hex_digit(const char c) noexcept {
10924|  22.1k|  return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') ||
  ------------------
  |  Branch (10924:11): [True: 21.1k, False: 923]
  |  Branch (10924:23): [True: 9.81k, False: 11.3k]
  |  Branch (10924:37): [True: 11.2k, False: 1.08k]
  |  Branch (10924:49): [True: 7.23k, False: 3.98k]
  ------------------
10925|  5.06k|         (c >= 'a' && c <= 'f');
  ------------------
  |  Branch (10925:11): [True: 985, False: 4.08k]
  |  Branch (10925:23): [True: 780, False: 205]
  ------------------
10926|  22.1k|}
_ZN3ada7unicode21convert_hex_to_binaryEc:
11013|  17.4k|unsigned constexpr convert_hex_to_binary(const char c) noexcept {
11014|  17.4k|  return hex_to_binary_table[c - '0'];
11015|  17.4k|}
serializers.cc:_ZZN3ada7unicode14percent_encodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKhENK3$_0clEc:
11052|  82.5k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
11053|  82.5k|    return character_sets::bit_at(character_set, c);
11054|  82.5k|  });
_ZN3ada7unicode36contains_forbidden_domain_code_pointEPKcm:
10850|  3.78k|    const char* input, size_t length) noexcept {
10851|  3.78k|  size_t i = 0;
10852|  3.78k|  uint8_t accumulator{};
10853|  31.1k|  for (; i + 4 <= length; i += 4) {
  ------------------
  |  Branch (10853:10): [True: 27.3k, False: 3.78k]
  ------------------
10854|  27.3k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i])];
10855|  27.3k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i + 1])];
10856|  27.3k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i + 2])];
10857|  27.3k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i + 3])];
10858|  27.3k|  }
10859|  8.39k|  for (; i < length; i++) {
  ------------------
  |  Branch (10859:10): [True: 4.61k, False: 3.78k]
  ------------------
10860|  4.61k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i])];
10861|  4.61k|  }
10862|  3.78k|  return accumulator;
10863|  3.78k|}
_ZN3ada7unicode19has_tabs_or_newlineENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
10699|  8.13k|    std::string_view user_input) noexcept {
10700|       |  // first check for short strings in which case we do it naively.
10701|  8.13k|  if (user_input.size() < 16) {  // slow path
  ------------------
  |  Branch (10701:7): [True: 1.43k, False: 6.70k]
  ------------------
10702|  1.43k|    return std::ranges::any_of(user_input, is_tabs_or_newline);
10703|  1.43k|  }
10704|       |  // fast path for long strings (expected to be common)
10705|  6.70k|  size_t i = 0;
10706|  6.70k|  const __m128i mask1 = _mm_set1_epi8('\r');
10707|  6.70k|  const __m128i mask2 = _mm_set1_epi8('\n');
10708|  6.70k|  const __m128i mask3 = _mm_set1_epi8('\t');
10709|       |  // If we supported SSSE3, we could use the algorithm that we use for NEON.
10710|  6.70k|  __m128i running{0};
10711|  25.0k|  for (; i + 15 < user_input.size(); i += 16) {
  ------------------
  |  Branch (10711:10): [True: 18.3k, False: 6.70k]
  ------------------
10712|  18.3k|    __m128i word = _mm_loadu_si128((const __m128i*)(user_input.data() + i));
10713|  18.3k|    running = _mm_or_si128(
10714|  18.3k|        _mm_or_si128(running, _mm_or_si128(_mm_cmpeq_epi8(word, mask1),
10715|  18.3k|                                           _mm_cmpeq_epi8(word, mask2))),
10716|  18.3k|        _mm_cmpeq_epi8(word, mask3));
10717|  18.3k|  }
10718|  6.70k|  if (i < user_input.size()) {
  ------------------
  |  Branch (10718:7): [True: 6.34k, False: 358]
  ------------------
10719|  6.34k|    __m128i word = _mm_loadu_si128(
10720|  6.34k|        (const __m128i*)(user_input.data() + user_input.length() - 16));
10721|  6.34k|    running = _mm_or_si128(
10722|  6.34k|        _mm_or_si128(running, _mm_or_si128(_mm_cmpeq_epi8(word, mask1),
10723|  6.34k|                                           _mm_cmpeq_epi8(word, mask2))),
10724|  6.34k|        _mm_cmpeq_epi8(word, mask3));
10725|  6.34k|  }
10726|  6.70k|  return _mm_movemask_epi8(running) != 0;
10727|  8.13k|}
_ZN3ada7unicode18is_tabs_or_newlineEc:
10594|  7.59k|constexpr bool is_tabs_or_newline(char c) noexcept {
10595|  7.59k|  return c == '\r' || c == '\n' || c == '\t';
  ------------------
  |  Branch (10595:10): [True: 20, False: 7.57k]
  |  Branch (10595:23): [True: 6, False: 7.56k]
  |  Branch (10595:36): [True: 6, False: 7.56k]
  ------------------
10596|  7.59k|}
_ZN3ada7helpers27remove_ascii_tab_or_newlineERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
11734|    144|ada_really_inline void remove_ascii_tab_or_newline(std::string& input) {
11735|       |  // if this ever becomes a performance issue, we could use an approach similar
11736|       |  // to has_tabs_or_newline
11737|    144|  std::erase_if(input, ada::unicode::is_ascii_tab_or_newline);
11738|    144|}
_ZN3ada7unicode23is_ascii_tab_or_newlineEc:
10944|  8.54k|    const char c) noexcept {
10945|  8.54k|  return c == '\t' || c == '\n' || c == '\r';
  ------------------
  |  Branch (10945:10): [True: 167, False: 8.38k]
  |  Branch (10945:23): [True: 144, False: 8.23k]
  |  Branch (10945:36): [True: 227, False: 8.01k]
  ------------------
10946|  8.54k|}
_ZN3ada7unicode22is_c0_control_or_spaceEc:
10939|  10.4k|ada_really_inline constexpr bool is_c0_control_or_space(const char c) noexcept {
10940|  10.4k|  return (unsigned char)c <= ' ';
10941|  10.4k|}
_ZN3ada7unicode26is_double_dot_path_segmentENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
10952|  2.55k|    std::string_view input) noexcept {
10953|       |  // This will catch most cases:
10954|       |  // The length must be 2,4 or 6.
10955|       |  // We divide by two and require
10956|       |  // that the result be between 1 and 3 inclusively.
10957|  2.55k|  uint64_t half_length = uint64_t(input.size()) / 2;
10958|  2.55k|  if (half_length - 1 > 2) {
  ------------------
  |  Branch (10958:7): [True: 1.92k, False: 634]
  ------------------
10959|  1.92k|    return false;
10960|  1.92k|  }
10961|       |  // We have a string of length 2, 4 or 6.
10962|       |  // We now check the first character:
10963|    634|  if ((input[0] != '.') && (input[0] != '%')) {
  ------------------
  |  Branch (10963:7): [True: 398, False: 236]
  |  Branch (10963:28): [True: 280, False: 118]
  ------------------
10964|    280|    return false;
10965|    280|  }
10966|       |  // We are unlikely the get beyond this point.
10967|    354|  int hash_value = (input.size() + (unsigned)(input[0])) & 3;
10968|    354|  const std::string_view target = table_is_double_dot_path_segment[hash_value];
10969|    354|  if (target.size() != input.size()) {
  ------------------
  |  Branch (10969:7): [True: 136, False: 218]
  ------------------
10970|    136|    return false;
10971|    136|  }
10972|       |  // We almost never get here.
10973|       |  // Optimizing the rest is relatively unimportant.
10974|    218|  auto prefix_equal_unsafe = [](std::string_view a, std::string_view b) {
10975|    218|    uint16_t A, B;
10976|    218|    memcpy(&A, a.data(), sizeof(A));
10977|    218|    memcpy(&B, b.data(), sizeof(B));
10978|    218|    return A == B;
10979|    218|  };
10980|    218|  if (!prefix_equal_unsafe(input, target)) {
  ------------------
  |  Branch (10980:7): [True: 57, False: 161]
  ------------------
10981|     57|    return false;
10982|     57|  }
10983|    274|  for (size_t i = 2; i < input.size(); i++) {
  ------------------
  |  Branch (10983:22): [True: 135, False: 139]
  ------------------
10984|    135|    char c = input[i];
10985|    135|    if ((uint8_t((c | 0x20) - 0x61) <= 25 ? (c | 0x20) : c) != target[i]) {
  ------------------
  |  Branch (10985:9): [True: 22, False: 113]
  |  Branch (10985:10): [True: 58, False: 77]
  ------------------
10986|     22|      return false;
10987|     22|    }
10988|    135|  }
10989|    139|  return true;
10990|       |  // The above code might be a bit better than the code below. Compilers
10991|       |  // are not stupid and may use the fact that these strings have length 2,4 and
10992|       |  // 6 and other tricks.
10993|       |  // return input == ".." ||
10994|       |  //  input == ".%2e" || input == ".%2E" ||
10995|       |  //  input == "%2e." || input == "%2E." ||
10996|       |  //  input == "%2e%2e" || input == "%2E%2E" || input == "%2E%2e" || input ==
10997|       |  //  "%2e%2E";
10998|    161|}
_ZZN3ada7unicode26is_double_dot_path_segmentENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEENKUlS5_S5_E_clES5_S5_:
10974|    218|  auto prefix_equal_unsafe = [](std::string_view a, std::string_view b) {
10975|    218|    uint16_t A, B;
10976|    218|    memcpy(&A, a.data(), sizeof(A));
10977|    218|    memcpy(&B, b.data(), sizeof(B));
10978|    218|    return A == B;
10979|    218|  };
_ZN3ada7unicode26is_single_dot_path_segmentENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
11001|  4.83k|    std::string_view input) noexcept {
11002|  4.83k|  return input == "." || input == "%2e" || input == "%2E";
  ------------------
  |  Branch (11002:10): [True: 127, False: 4.71k]
  |  Branch (11002:26): [True: 8, False: 4.70k]
  |  Branch (11002:44): [True: 0, False: 4.70k]
  ------------------
11003|  4.83k|}
_ZN3ada8checkers17verify_dns_lengthENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  112|  2.93k|    std::string_view input) noexcept {
  113|  2.93k|  if (input.empty()) return false;
  ------------------
  |  Branch (113:7): [True: 616, False: 2.31k]
  ------------------
  114|  2.31k|  if (input.back() == '.') {
  ------------------
  |  Branch (114:7): [True: 294, False: 2.02k]
  ------------------
  115|    294|    if (input.size() > 254) return false;
  ------------------
  |  Branch (115:9): [True: 0, False: 294]
  ------------------
  116|  2.02k|  } else if (input.size() > 253)
  ------------------
  |  Branch (116:14): [True: 0, False: 2.02k]
  ------------------
  117|      0|    return false;
  118|       |
  119|  2.31k|  size_t start = 0;
  120|  9.57k|  while (start < input.size()) {
  ------------------
  |  Branch (120:10): [True: 7.61k, False: 1.95k]
  ------------------
  121|  7.61k|    auto dot_location = input.find('.', start);
  122|       |    // If not found, it's likely the end of the domain
  123|  7.61k|    if (dot_location == std::string_view::npos) dot_location = input.size();
  ------------------
  |  Branch (123:9): [True: 1.75k, False: 5.85k]
  ------------------
  124|       |
  125|  7.61k|    auto label_size = dot_location - start;
  126|  7.61k|    if (label_size > 63 || label_size == 0) return false;
  ------------------
  |  Branch (126:9): [True: 199, False: 7.41k]
  |  Branch (126:28): [True: 160, False: 7.25k]
  ------------------
  127|       |
  128|  7.25k|    start = dot_location + 1;
  129|  7.25k|  }
  130|       |
  131|  1.95k|  return true;
  132|  2.31k|}
_ZN3ada7unicode13is_alnum_plusEc:
10916|  20.8k|ada_really_inline constexpr bool is_alnum_plus(const char c) noexcept {
10917|  20.8k|  return is_alnum_plus_table[uint8_t(c)];
10918|       |  // A table is almost surely much faster than the
10919|       |  // following under most compilers: return
10920|       |  // return (std::isalnum(c) || c == '+' || c == '-' || c == '.');
10921|  20.8k|}
_ZN3ada7helpers10prune_hashERNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
11674|  5.20k|    std::string_view& input) noexcept {
11675|       |  // compiles down to 20--30 instructions including a class to memchr (C
11676|       |  // function). this function should be quite fast.
11677|  5.20k|  size_t location_of_first = input.find('#');
11678|  5.20k|  if (location_of_first == std::string_view::npos) {
  ------------------
  |  Branch (11678:7): [True: 5.09k, False: 103]
  ------------------
11679|  5.09k|    return std::nullopt;
11680|  5.09k|  }
11681|    103|  std::string_view hash = input;
11682|    103|  hash.remove_prefix(location_of_first + 1);
11683|    103|  input.remove_suffix(input.size() - location_of_first);
11684|    103|  return hash;
11685|  5.20k|}
_ZN3ada7helpers32find_authority_delimiter_specialENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
12612|  1.08k|find_authority_delimiter_special(std::string_view view) noexcept {
12613|       |  // performance note: we might be able to gain further performance
12614|       |  // with SIMD intrinsics.
12615|  7.66k|  for (auto pos = view.begin(); pos != view.end(); ++pos) {
  ------------------
  |  Branch (12615:33): [True: 7.65k, False: 11]
  ------------------
12616|  7.65k|    if (authority_delimiter_special[(uint8_t)*pos]) {
  ------------------
  |  Branch (12616:9): [True: 1.07k, False: 6.58k]
  ------------------
12617|  1.07k|      return pos - view.begin();
12618|  1.07k|    }
12619|  7.65k|  }
12620|     11|  return size_t(view.size());
12621|  1.08k|}
_ZN3ada7helpers12shorten_pathERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_6scheme4typeE:
11687|    139|ada_really_inline bool shorten_path(std::string& path, ada::scheme::type type) {
11688|       |  // Let path be url's path.
11689|       |  // If url's scheme is "file", path's size is 1, and path[0] is a normalized
11690|       |  // Windows drive letter, then return.
11691|    139|  if (type == ada::scheme::type::FILE &&
  ------------------
  |  Branch (11691:7): [True: 0, False: 139]
  ------------------
11692|      0|      path.find('/', 1) == std::string_view::npos && !path.empty()) {
  ------------------
  |  Branch (11692:7): [True: 0, False: 0]
  |  Branch (11692:54): [True: 0, False: 0]
  ------------------
11693|      0|    if (checkers::is_normalized_windows_drive_letter(
  ------------------
  |  Branch (11693:9): [True: 0, False: 0]
  ------------------
11694|      0|            helpers::substring(path, 1))) {
11695|      0|      return false;
11696|      0|    }
11697|      0|  }
11698|       |
11699|       |  // Remove path's last item, if any.
11700|    139|  size_t last_delimiter = path.rfind('/');
11701|    139|  if (last_delimiter != std::string::npos) {
  ------------------
  |  Branch (11701:7): [True: 95, False: 44]
  ------------------
11702|     95|    path.erase(last_delimiter);
11703|     95|    return true;
11704|     95|  }
11705|       |
11706|     44|  return false;
11707|    139|}
_ZN3ada7helpers27get_host_delimiter_locationEbRNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
12325|  5.19k|    const bool is_special, std::string_view& view) noexcept {
12326|       |  /**
12327|       |   * The spec at https://url.spec.whatwg.org/#hostname-state expects us to
12328|       |   * compute a variable called insideBrackets but this variable is only used
12329|       |   * once, to check whether a ':' character was found outside brackets. Exact
12330|       |   * text: "Otherwise, if c is U+003A (:) and insideBrackets is false, then:".
12331|       |   * It is conceptually simpler and arguably more efficient to just return a
12332|       |   * Boolean indicating whether ':' was found outside brackets.
12333|       |   */
12334|  5.19k|  const size_t view_size = view.size();
12335|  5.19k|  size_t location = 0;
12336|  5.19k|  bool found_colon = false;
12337|       |  /**
12338|       |   * Performance analysis:
12339|       |   *
12340|       |   * We are basically seeking the end of the hostname which can be indicated
12341|       |   * by the end of the view, or by one of the characters ':', '/', '?', '\\'
12342|       |   * (where '\\' is only applicable for special URLs). However, these must
12343|       |   * appear outside a bracket range. E.g., if you have [something?]fd: then the
12344|       |   * '?' does not count.
12345|       |   *
12346|       |   * So we can skip ahead to the next delimiter, as long as we include '[' in
12347|       |   * the set of delimiters, and that we handle it first.
12348|       |   *
12349|       |   * So the trick is to have a fast function that locates the next delimiter.
12350|       |   * Unless we find '[', then it only needs to be called once! Ideally, such a
12351|       |   * function would be provided by the C++ standard library, but it seems that
12352|       |   * find_first_of is not very fast, so we are forced to roll our own.
12353|       |   *
12354|       |   * We do not break into two loops for speed, but for clarity.
12355|       |   */
12356|  5.19k|  if (is_special) {
  ------------------
  |  Branch (12356:7): [True: 5.19k, False: 0]
  ------------------
12357|       |    // We move to the next delimiter.
12358|  5.19k|    location = find_next_host_delimiter_special(view, location);
12359|       |    // Unless we find '[' then we are going only going to have to call
12360|       |    // find_next_host_delimiter_special once.
12361|  8.31k|    for (; location < view_size;
  ------------------
  |  Branch (12361:12): [True: 8.26k, False: 49]
  ------------------
12362|  8.26k|         location = find_next_host_delimiter_special(view, location)) {
12363|  8.26k|      if (view[location] == '[') {
  ------------------
  |  Branch (12363:11): [True: 3.14k, False: 5.12k]
  ------------------
12364|  3.14k|        location = view.find(']', location);
12365|  3.14k|        if (location == std::string_view::npos) {
  ------------------
  |  Branch (12365:13): [True: 28, False: 3.11k]
  ------------------
12366|       |          // performance: view.find might get translated to a memchr, which
12367|       |          // has no notion of std::string_view::npos, so the code does not
12368|       |          // reflect the assembly.
12369|     28|          location = view_size;
12370|     28|          break;
12371|     28|        }
12372|  5.12k|      } else {
12373|  5.12k|        found_colon = view[location] == ':';
12374|  5.12k|        break;
12375|  5.12k|      }
12376|  8.26k|    }
12377|  5.19k|  } else {
12378|       |    // We move to the next delimiter.
12379|      0|    location = find_next_host_delimiter(view, location);
12380|       |    // Unless we find '[' then we are going only going to have to call
12381|       |    // find_next_host_delimiter_special once.
12382|      0|    for (; location < view_size;
  ------------------
  |  Branch (12382:12): [True: 0, False: 0]
  ------------------
12383|      0|         location = find_next_host_delimiter(view, location)) {
12384|      0|      if (view[location] == '[') {
  ------------------
  |  Branch (12384:11): [True: 0, False: 0]
  ------------------
12385|      0|        location = view.find(']', location);
12386|      0|        if (location == std::string_view::npos) {
  ------------------
  |  Branch (12386:13): [True: 0, False: 0]
  ------------------
12387|       |          // performance: view.find might get translated to a memchr, which
12388|       |          // has no notion of std::string_view::npos, so the code does not
12389|       |          // reflect the assembly.
12390|      0|          location = view_size;
12391|      0|          break;
12392|      0|        }
12393|      0|      } else {
12394|      0|        found_colon = view[location] == ':';
12395|      0|        break;
12396|      0|      }
12397|      0|    }
12398|      0|  }
12399|       |  // performance: remove_suffix may translate into a single instruction.
12400|  5.19k|  view.remove_suffix(view_size - location);
12401|  5.19k|  return {location, found_colon};
12402|  5.19k|}
_ZN3ada7helpers32find_next_host_delimiter_specialENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEm:
11902|  8.31k|    std::string_view view, size_t location) noexcept {
11903|       |  // first check for short strings in which case we do it naively.
11904|  8.31k|  if (view.size() - location < 16) {  // slow path
  ------------------
  |  Branch (11904:7): [True: 3.76k, False: 4.55k]
  ------------------
11905|  14.1k|    for (size_t i = location; i < view.size(); i++) {
  ------------------
  |  Branch (11905:31): [True: 14.0k, False: 34]
  ------------------
11906|  14.0k|      if (view[i] == ':' || view[i] == '/' || view[i] == '\\' ||
  ------------------
  |  Branch (11906:11): [True: 117, False: 13.9k]
  |  Branch (11906:29): [True: 3.41k, False: 10.5k]
  |  Branch (11906:47): [True: 18, False: 10.5k]
  ------------------
11907|  10.5k|          view[i] == '?' || view[i] == '[') {
  ------------------
  |  Branch (11907:11): [True: 7, False: 10.5k]
  |  Branch (11907:29): [True: 169, False: 10.3k]
  ------------------
11908|  3.72k|        return i;
11909|  3.72k|      }
11910|  14.0k|    }
11911|     34|    return size_t(view.size());
11912|  3.76k|  }
11913|       |  // fast path for long strings (expected to be common)
11914|  4.55k|  size_t i = location;
11915|  4.55k|  const __m128i mask1 = _mm_set1_epi8(':');
11916|  4.55k|  const __m128i mask2 = _mm_set1_epi8('/');
11917|  4.55k|  const __m128i mask3 = _mm_set1_epi8('\\');
11918|  4.55k|  const __m128i mask4 = _mm_set1_epi8('?');
11919|  4.55k|  const __m128i mask5 = _mm_set1_epi8('[');
11920|       |
11921|  6.70k|  for (; i + 15 < view.size(); i += 16) {
  ------------------
  |  Branch (11921:10): [True: 5.97k, False: 727]
  ------------------
11922|  5.97k|    __m128i word = _mm_loadu_si128((const __m128i*)(view.data() + i));
11923|  5.97k|    __m128i m1 = _mm_cmpeq_epi8(word, mask1);
11924|  5.97k|    __m128i m2 = _mm_cmpeq_epi8(word, mask2);
11925|  5.97k|    __m128i m3 = _mm_cmpeq_epi8(word, mask3);
11926|  5.97k|    __m128i m4 = _mm_cmpeq_epi8(word, mask4);
11927|  5.97k|    __m128i m5 = _mm_cmpeq_epi8(word, mask5);
11928|  5.97k|    __m128i m = _mm_or_si128(
11929|  5.97k|        _mm_or_si128(_mm_or_si128(m1, m2), _mm_or_si128(m3, m4)), m5);
11930|  5.97k|    int mask = _mm_movemask_epi8(m);
11931|  5.97k|    if (mask != 0) {
  ------------------
  |  Branch (11931:9): [True: 3.82k, False: 2.15k]
  ------------------
11932|  3.82k|      return i + trailing_zeroes(mask);
11933|  3.82k|    }
11934|  5.97k|  }
11935|    727|  if (i < view.size()) {
  ------------------
  |  Branch (11935:7): [True: 723, False: 4]
  ------------------
11936|    723|    __m128i word =
11937|    723|        _mm_loadu_si128((const __m128i*)(view.data() + view.length() - 16));
11938|    723|    __m128i m1 = _mm_cmpeq_epi8(word, mask1);
11939|    723|    __m128i m2 = _mm_cmpeq_epi8(word, mask2);
11940|    723|    __m128i m3 = _mm_cmpeq_epi8(word, mask3);
11941|    723|    __m128i m4 = _mm_cmpeq_epi8(word, mask4);
11942|    723|    __m128i m5 = _mm_cmpeq_epi8(word, mask5);
11943|    723|    __m128i m = _mm_or_si128(
11944|    723|        _mm_or_si128(_mm_or_si128(m1, m2), _mm_or_si128(m3, m4)), m5);
11945|    723|    int mask = _mm_movemask_epi8(m);
11946|    723|    if (mask != 0) {
  ------------------
  |  Branch (11946:9): [True: 712, False: 11]
  ------------------
11947|    712|      return view.length() - 16 + trailing_zeroes(mask);
11948|    712|    }
11949|    723|  }
11950|     15|  return size_t(view.length());
11951|    727|}
_ZN3ada7helpers15trailing_zeroesEj:
11755|  4.53k|ada_really_inline int trailing_zeroes(uint32_t input_num) noexcept {
11756|       |#ifdef ADA_REGULAR_VISUAL_STUDIO
11757|       |  unsigned long ret;
11758|       |  // Search the mask data from least significant bit (LSB)
11759|       |  // to the most significant bit (MSB) for a set bit (1).
11760|       |  _BitScanForward(&ret, input_num);
11761|       |  return (int)ret;
11762|       |#else   // ADA_REGULAR_VISUAL_STUDIO
11763|  4.53k|  return __builtin_ctzl(input_num);
11764|  4.53k|#endif  // ADA_REGULAR_VISUAL_STUDIO
11765|  4.53k|}
_ZN3ada7unicode30is_forbidden_domain_code_pointEc:
10845|  14.2k|    const char c) noexcept {
10846|  14.2k|  return is_forbidden_domain_code_point_table[uint8_t(c)];
10847|  14.2k|}
serializers.cc:_ZN12_GLOBAL__N_132apply_shifted_non_scheme_offsetsERN3ada14url_componentsEj:
14693|  5.20k|    ada::url_components& components, uint32_t new_difference) {
14694|  5.20k|  components.username_end += new_difference;
14695|  5.20k|  components.host_start += new_difference;
14696|  5.20k|  components.host_end += new_difference;
14697|  5.20k|  components.pathname_start += new_difference;
14698|  5.20k|  if (components.search_start != ada::url_components::omitted) {
  ------------------
  |  Branch (14698:7): [True: 0, False: 5.20k]
  ------------------
14699|      0|    components.search_start += new_difference;
14700|      0|  }
14701|  5.20k|  if (components.hash_start != ada::url_components::omitted) {
  ------------------
  |  Branch (14701:7): [True: 0, False: 5.20k]
  ------------------
14702|      0|    components.hash_start += new_difference;
14703|      0|  }
14704|  5.20k|}
_ZN3ada14url_aggregator10parse_hostENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
15149|  5.19k|ada_really_inline bool url_aggregator::parse_host(std::string_view input) {
15150|  5.19k|  ada_log("url_aggregator:parse_host \"", input, "\" [", input.size(),
15151|  5.19k|          " bytes]");
15152|  5.19k|  ADA_ASSERT_TRUE(validate());
15153|  5.19k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
15154|  5.19k|  if (input.empty()) {
  ------------------
  |  Branch (15154:7): [True: 5, False: 5.19k]
  ------------------
15155|      5|    return is_valid = false;
15156|      5|  }  // technically unnecessary.
15157|       |  // If input starts with U+005B ([), then:
15158|  5.19k|  if (input[0] == '[') {
  ------------------
  |  Branch (15158:7): [True: 2.99k, False: 2.19k]
  ------------------
15159|       |    // If input does not end with U+005D (]), validation error, return failure.
15160|  2.99k|    if (input.back() != ']') {
  ------------------
  |  Branch (15160:9): [True: 12, False: 2.98k]
  ------------------
15161|     12|      return is_valid = false;
15162|     12|    }
15163|  2.98k|    ada_log("parse_host ipv6");
15164|       |
15165|       |    // Return the result of IPv6 parsing input with its leading U+005B ([) and
15166|       |    // trailing U+005D (]) removed.
15167|  2.98k|    input.remove_prefix(1);
15168|  2.98k|    input.remove_suffix(1);
15169|  2.98k|    return parse_ipv6(input);
15170|  2.99k|  }
15171|       |
15172|       |  // If isNotSpecial is true, then return the result of opaque-host parsing
15173|       |  // input.
15174|  2.19k|  if (!is_special()) {
  ------------------
  |  Branch (15174:7): [True: 0, False: 2.19k]
  ------------------
15175|      0|    return parse_opaque_host(input);
15176|      0|  }
15177|       |  // Let domain be the result of running UTF-8 decode without BOM on the
15178|       |  // percent-decoding of input. Let asciiDomain be the result of running domain
15179|       |  // to ASCII with domain and false. The most common case is an ASCII input, in
15180|       |  // which case we do not need to call the expensive 'to_ascii' if a few
15181|       |  // conditions are met: no '%' and no 'xn-' subsequence.
15182|       |
15183|       |  // Often, the input does not contain any forbidden code points, and no upper
15184|       |  // case ASCII letter, then we can just copy it to the buffer. We want to
15185|       |  // optimize for such a common case.
15186|       |
15187|       |  // Fast path: try to parse as pure decimal IPv4(a.b.c.d) first.
15188|  2.19k|  const uint64_t fast_result = checkers::try_parse_ipv4_fast(input);
15189|  2.19k|  if (fast_result < checkers::ipv4_fast_fail) {
  ------------------
  |  Branch (15189:7): [True: 140, False: 2.05k]
  ------------------
15190|       |    // Fast path succeeded - input is pure decimal IPv4
15191|    140|    if (!input.empty() && input.back() == '.') {
  ------------------
  |  Branch (15191:9): [True: 140, False: 0]
  |  Branch (15191:27): [True: 2, False: 138]
  ------------------
15192|      2|      update_base_hostname(input.substr(0, input.size() - 1));
15193|    138|    } else {
15194|    138|      update_base_hostname(input);
15195|    138|    }
15196|    140|    host_type = IPV4;
15197|    140|    is_valid = true;
15198|    140|    ada_log("parse_host fast path decimal ipv4");
15199|    140|    ADA_ASSERT_TRUE(validate());
15200|    140|    return true;
15201|    140|  }
15202|  2.05k|  uint8_t is_forbidden_or_upper =
15203|  2.05k|      unicode::contains_forbidden_domain_code_point_or_upper(input.data(),
15204|  2.05k|                                                             input.size());
15205|       |  // Minor optimization opportunity:
15206|       |  // contains_forbidden_domain_code_point_or_upper could be extend to check for
15207|       |  // the presence of characters that cannot appear in the ipv4 address and we
15208|       |  // could also check whether x and n and - are present, and so we could skip
15209|       |  // some of the checks below. However, the gains are likely to be small, and
15210|       |  // the code would be more complex.
15211|  2.05k|  if (is_forbidden_or_upper == 0 &&
  ------------------
  |  Branch (15211:7): [True: 831, False: 1.22k]
  ------------------
15212|    831|      input.find("xn-") == std::string_view::npos) {
  ------------------
  |  Branch (15212:7): [True: 700, False: 131]
  ------------------
15213|       |    // fast path
15214|    700|    update_base_hostname(input);
15215|       |
15216|       |    // Check for other IPv4 formats (hex, octal, etc.)
15217|    700|    if (checkers::is_ipv4(get_hostname())) {
  ------------------
  |  Branch (15217:9): [True: 522, False: 178]
  ------------------
15218|    522|      ada_log("parse_host fast path ipv4");
15219|    522|      return parse_ipv4(get_hostname(), true);
15220|    522|    }
15221|    178|    ada_log("parse_host fast path ", get_hostname());
15222|    178|    is_valid = true;
15223|    178|    return true;
15224|    700|  }
15225|       |  // We have encountered at least one forbidden code point or the input contains
15226|       |  // 'xn-' (case insensitive), so we need to call 'to_ascii' to perform the full
15227|       |  // conversion.
15228|       |
15229|  1.35k|  ada_log("parse_host calling to_ascii");
15230|  1.35k|  std::optional<std::string> host = std::string(get_hostname());
15231|  1.35k|  is_valid = ada::unicode::to_ascii(host, input, input.find('%'));
15232|  1.35k|  if (!is_valid) {
  ------------------
  |  Branch (15232:7): [True: 732, False: 622]
  ------------------
15233|    732|    ada_log("parse_host to_ascii returns false");
15234|    732|    return is_valid = false;
15235|    732|  }
15236|    622|  ada_log("parse_host to_ascii succeeded ", *host, " [", host->size(),
15237|    622|          " bytes]");
15238|       |
15239|    622|  if (std::ranges::any_of(host.value(),
  ------------------
  |  Branch (15239:7): [True: 0, False: 622]
  ------------------
15240|    622|                          ada::unicode::is_forbidden_domain_code_point)) {
15241|      0|    return is_valid = false;
15242|      0|  }
15243|       |
15244|       |  // If asciiDomain ends in a number, then return the result of IPv4 parsing
15245|       |  // asciiDomain.
15246|    622|  if (checkers::is_ipv4(host.value())) {
  ------------------
  |  Branch (15246:7): [True: 198, False: 424]
  ------------------
15247|    198|    ada_log("parse_host got ipv4 ", *host);
15248|    198|    return parse_ipv4(host.value(), false);
15249|    198|  }
15250|       |
15251|    424|  update_base_hostname(host.value());
15252|    424|  ADA_ASSERT_TRUE(validate());
15253|    424|  return true;
15254|    622|}
_ZN3ada14url_aggregator21consume_prepared_pathENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
16176|    761|inline void url_aggregator::consume_prepared_path(std::string_view input) {
16177|    761|  ada_log("url_aggregator::consume_prepared_path ", input);
16178|       |  /***
16179|       |   * This is largely duplicated code from helpers::parse_prepared_path, which is
16180|       |   * unfortunate. This particular function is nearly identical, except that it
16181|       |   * is a method on url_aggregator. The idea is that the trivial path (which is
16182|       |   * very common) merely appends to the buffer. This is the same trivial path as
16183|       |   * with helpers::parse_prepared_path, except that we have the additional check
16184|       |   * for is_at_path(). Otherwise, we grab a copy of the current path and we
16185|       |   * modify it, and then insert it back into the buffer.
16186|       |   */
16187|    761|  uint8_t accumulator = checkers::path_signature(input);
16188|       |  // Let us first detect a trivial case.
16189|       |  // If it is special, we check that we have no dot, no %,  no \ and no
16190|       |  // character needing percent encoding. Otherwise, we check that we have no %,
16191|       |  // no dot, and no character needing percent encoding.
16192|    761|  constexpr uint8_t need_encoding = 1;
16193|    761|  constexpr uint8_t backslash_char = 2;
16194|    761|  constexpr uint8_t dot_char = 4;
16195|    761|  constexpr uint8_t percent_char = 8;
16196|    761|  bool special = type != ada::scheme::NOT_SPECIAL;
16197|    761|  bool may_need_slow_file_handling = (type == ada::scheme::type::FILE &&
  ------------------
  |  Branch (16197:39): [True: 0, False: 761]
  ------------------
16198|      0|                                      checkers::is_windows_drive_letter(input));
  ------------------
  |  Branch (16198:39): [True: 0, False: 0]
  ------------------
16199|    761|  bool trivial_path =
16200|    761|      (special ? (accumulator == 0)
  ------------------
  |  Branch (16200:7): [True: 357, False: 404]
  |  Branch (16200:8): [True: 761, False: 0]
  ------------------
16201|    761|               : ((accumulator & (need_encoding | dot_char | percent_char)) ==
16202|      0|                  0)) &&
16203|    357|      (!may_need_slow_file_handling);
  ------------------
  |  Branch (16203:7): [True: 357, False: 0]
  ------------------
16204|    761|  if (accumulator == dot_char && !may_need_slow_file_handling) {
  ------------------
  |  Branch (16204:7): [True: 169, False: 592]
  |  Branch (16204:34): [True: 169, False: 0]
  ------------------
16205|       |    // '4' means that we have at least one dot, but nothing that requires
16206|       |    // percent encoding or decoding. The only part that is not trivial is
16207|       |    // that we may have single dots and double dots path segments.
16208|       |    // If we have such segments, then we either have a path that begins
16209|       |    // with '.' (easy to check), or we have the sequence './'.
16210|       |    // Note: input cannot be empty, it must at least contain one character ('.')
16211|       |    // Note: we know that '\' is not present.
16212|    169|    if (input[0] != '.') {
  ------------------
  |  Branch (16212:9): [True: 119, False: 50]
  ------------------
16213|    119|      size_t slashdot = 0;
16214|    119|      bool dot_is_file = true;
16215|    355|      for (;;) {
16216|    355|        slashdot = input.find("/.", slashdot);
16217|    355|        if (slashdot == std::string_view::npos) {  // common case
  ------------------
  |  Branch (16217:13): [True: 119, False: 236]
  ------------------
16218|    119|          break;
16219|    236|        } else {  // uncommon
16220|       |          // only three cases matter: /./, /.. or a final /
16221|    236|          slashdot += 2;
16222|    236|          dot_is_file &= !(slashdot == input.size() || input[slashdot] == '.' ||
  ------------------
  |  Branch (16222:28): [True: 1, False: 235]
  |  Branch (16222:56): [True: 112, False: 123]
  ------------------
16223|    123|                           input[slashdot] == '/');
  ------------------
  |  Branch (16223:28): [True: 73, False: 50]
  ------------------
16224|    236|        }
16225|    355|      }
16226|    119|      trivial_path = dot_is_file;
16227|    119|    }
16228|    169|  }
16229|    761|  if (trivial_path && is_at_path()) {
  ------------------
  |  Branch (16229:7): [True: 405, False: 356]
  |  Branch (16229:23): [True: 405, False: 0]
  ------------------
16230|    405|    ada_log("parse_path trivial");
16231|    405|    buffer += '/';
16232|    405|    buffer += input;
16233|    405|    return;
16234|    405|  }
16235|    356|  std::string path = std::string(get_pathname());
16236|       |  // We are going to need to look a bit at the path, but let us see if we can
16237|       |  // ignore percent encoding *and* backslashes *and* percent characters.
16238|       |  // Except for the trivial case, this is likely to capture 99% of paths out
16239|       |  // there.
16240|    356|  bool fast_path =
16241|    356|      (special &&
  ------------------
  |  Branch (16241:8): [True: 356, False: 0]
  ------------------
16242|    356|       (accumulator & (need_encoding | backslash_char | percent_char)) == 0) &&
  ------------------
  |  Branch (16242:8): [True: 121, False: 235]
  ------------------
16243|    121|      (type != ada::scheme::type::FILE);
  ------------------
  |  Branch (16243:7): [True: 121, False: 0]
  ------------------
16244|    356|  if (fast_path) {
  ------------------
  |  Branch (16244:7): [True: 121, False: 235]
  ------------------
16245|    121|    ada_log("parse_prepared_path fast");
16246|       |    // Here we don't need to worry about \ or percent encoding.
16247|       |    // We also do not have a file protocol. We might have dots, however,
16248|       |    // but dots must as appear as '.', and they cannot be encoded because
16249|       |    // the symbol '%' is not present.
16250|    121|    size_t previous_location = 0;  // We start at 0.
16251|  1.37k|    do {
16252|  1.37k|      size_t new_location = input.find('/', previous_location);
16253|       |      // std::string_view path_view = input;
16254|       |      //  We process the last segment separately:
16255|  1.37k|      if (new_location == std::string_view::npos) {
  ------------------
  |  Branch (16255:11): [True: 121, False: 1.25k]
  ------------------
16256|    121|        std::string_view path_view = input.substr(previous_location);
16257|    121|        if (path_view == "..") {  // The path ends with ..
  ------------------
  |  Branch (16257:13): [True: 20, False: 101]
  ------------------
16258|       |          // e.g., if you receive ".." with an empty path, you go to "/".
16259|     20|          if (path.empty()) {
  ------------------
  |  Branch (16259:15): [True: 6, False: 14]
  ------------------
16260|      6|            path = '/';
16261|      6|            update_base_pathname(path);
16262|      6|            return;
16263|      6|          }
16264|       |          // Fast case where we have nothing to do:
16265|     14|          if (path.back() == '/') {
  ------------------
  |  Branch (16265:15): [True: 3, False: 11]
  ------------------
16266|      3|            update_base_pathname(path);
16267|      3|            return;
16268|      3|          }
16269|       |          // If you have the path "/joe/myfriend",
16270|       |          // then you delete 'myfriend'.
16271|     11|          path.resize(path.rfind('/') + 1);
16272|     11|          update_base_pathname(path);
16273|     11|          return;
16274|     14|        }
16275|    101|        path += '/';
16276|    101|        if (path_view != ".") {
  ------------------
  |  Branch (16276:13): [True: 98, False: 3]
  ------------------
16277|     98|          path.append(path_view);
16278|     98|        }
16279|    101|        update_base_pathname(path);
16280|    101|        return;
16281|  1.25k|      } else {
16282|       |        // This is a non-final segment.
16283|  1.25k|        std::string_view path_view =
16284|  1.25k|            input.substr(previous_location, new_location - previous_location);
16285|  1.25k|        previous_location = new_location + 1;
16286|  1.25k|        if (path_view == "..") {
  ------------------
  |  Branch (16286:13): [True: 91, False: 1.16k]
  ------------------
16287|     91|          size_t last_delimiter = path.rfind('/');
16288|     91|          if (last_delimiter != std::string::npos) {
  ------------------
  |  Branch (16288:15): [True: 78, False: 13]
  ------------------
16289|     78|            path.erase(last_delimiter);
16290|     78|          }
16291|  1.16k|        } else if (path_view != ".") {
  ------------------
  |  Branch (16291:20): [True: 1.08k, False: 74]
  ------------------
16292|  1.08k|          path += '/';
16293|  1.08k|          path.append(path_view);
16294|  1.08k|        }
16295|  1.25k|      }
16296|  1.37k|    } while (true);
  ------------------
  |  Branch (16296:14): [True: 1.25k, Folded]
  ------------------
16297|    235|  } else {
16298|    235|    ada_log("parse_path slow");
16299|       |    // we have reached the general case
16300|    235|    bool needs_percent_encoding = (accumulator & 1);
16301|    235|    std::string path_buffer_tmp;
16302|  2.55k|    do {
16303|  2.55k|      size_t location = (special && (accumulator & 2))
  ------------------
  |  Branch (16303:26): [True: 2.55k, False: 0]
  |  Branch (16303:37): [True: 607, False: 1.95k]
  ------------------
16304|  2.55k|                            ? input.find_first_of("/\\")
16305|  2.55k|                            : input.find('/');
16306|  2.55k|      std::string_view path_view = input;
16307|  2.55k|      if (location != std::string_view::npos) {
  ------------------
  |  Branch (16307:11): [True: 2.32k, False: 235]
  ------------------
16308|  2.32k|        path_view.remove_suffix(path_view.size() - location);
16309|  2.32k|        input.remove_prefix(location + 1);
16310|  2.32k|      }
16311|       |      // path_buffer is either path_view or it might point at a percent encoded
16312|       |      // temporary string.
16313|  2.55k|      std::string_view path_buffer =
16314|  2.55k|          (needs_percent_encoding &&
  ------------------
  |  Branch (16314:12): [True: 2.31k, False: 249]
  ------------------
16315|  2.31k|           ada::unicode::percent_encode<false>(
  ------------------
  |  Branch (16315:12): [True: 435, False: 1.87k]
  ------------------
16316|  2.31k|               path_view, character_sets::PATH_PERCENT_ENCODE, path_buffer_tmp))
16317|  2.55k|              ? path_buffer_tmp
16318|  2.55k|              : path_view;
16319|  2.55k|      if (unicode::is_double_dot_path_segment(path_buffer)) {
  ------------------
  |  Branch (16319:11): [True: 139, False: 2.42k]
  ------------------
16320|    139|        helpers::shorten_path(path, type);
16321|    139|        if (location == std::string_view::npos) {
  ------------------
  |  Branch (16321:13): [True: 6, False: 133]
  ------------------
16322|      6|          path += '/';
16323|      6|        }
16324|  2.42k|      } else if (unicode::is_single_dot_path_segment(path_buffer) &&
  ------------------
  |  Branch (16324:18): [True: 69, False: 2.35k]
  ------------------
16325|     69|                 (location == std::string_view::npos)) {
  ------------------
  |  Branch (16325:18): [True: 3, False: 66]
  ------------------
16326|      3|        path += '/';
16327|      3|      }
16328|       |      // Otherwise, if path_buffer is not a single-dot path segment, then:
16329|  2.41k|      else if (!unicode::is_single_dot_path_segment(path_buffer)) {
  ------------------
  |  Branch (16329:16): [True: 2.35k, False: 66]
  ------------------
16330|       |        // If url's scheme is "file", url's path is empty, and path_buffer is a
16331|       |        // Windows drive letter, then replace the second code point in
16332|       |        // path_buffer with U+003A (:).
16333|  2.35k|        if (type == ada::scheme::type::FILE && path.empty() &&
  ------------------
  |  Branch (16333:13): [True: 0, False: 2.35k]
  |  Branch (16333:48): [True: 0, False: 0]
  ------------------
16334|      0|            checkers::is_windows_drive_letter(path_buffer)) {
  ------------------
  |  Branch (16334:13): [True: 0, False: 0]
  ------------------
16335|      0|          path += '/';
16336|      0|          path += path_buffer[0];
16337|      0|          path += ':';
16338|      0|          path_buffer.remove_prefix(2);
16339|      0|          path.append(path_buffer);
16340|  2.35k|        } else {
16341|       |          // Append path_buffer to url's path.
16342|  2.35k|          path += '/';
16343|  2.35k|          path.append(path_buffer);
16344|  2.35k|        }
16345|  2.35k|      }
16346|  2.55k|      if (location == std::string_view::npos) {
  ------------------
  |  Branch (16346:11): [True: 235, False: 2.32k]
  ------------------
16347|    235|        update_base_pathname(path);
16348|    235|        return;
16349|    235|      }
16350|  2.55k|    } while (true);
  ------------------
  |  Branch (16350:14): [True: 2.32k, Folded]
  ------------------
16351|    235|  }
16352|    356|}
_ZN3ada7unicode14to_lower_asciiEPcm:
10602|  2.93k|constexpr bool to_lower_ascii(char* input, size_t length) noexcept {
10603|  2.93k|  uint64_t broadcast_80 = broadcast(0x80);
10604|  2.93k|  uint64_t broadcast_Ap = broadcast(128 - 'A');
10605|  2.93k|  uint64_t broadcast_Zp = broadcast(128 - 'Z' - 1);
10606|  2.93k|  uint64_t non_ascii = 0;
10607|  2.93k|  size_t i = 0;
10608|       |
10609|  13.0k|  for (; i + 7 < length; i += 8) {
  ------------------
  |  Branch (10609:10): [True: 10.1k, False: 2.93k]
  ------------------
10610|  10.1k|    uint64_t word{};
10611|  10.1k|    memcpy(&word, input + i, sizeof(word));
10612|  10.1k|    non_ascii |= (word & broadcast_80);
10613|  10.1k|    word ^=
10614|  10.1k|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
10615|  10.1k|    memcpy(input + i, &word, sizeof(word));
10616|  10.1k|  }
10617|  2.93k|  if (i < length) {
  ------------------
  |  Branch (10617:7): [True: 1.96k, False: 969]
  ------------------
10618|  1.96k|    uint64_t word{};
10619|  1.96k|    memcpy(&word, input + i, length - i);
10620|  1.96k|    non_ascii |= (word & broadcast_80);
10621|  1.96k|    word ^=
10622|  1.96k|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
10623|  1.96k|    memcpy(input + i, &word, length - i);
10624|  1.96k|  }
10625|  2.93k|  return non_ascii == 0;
10626|  2.93k|}
_ZN3ada7unicode9broadcastEh:
10598|  8.79k|constexpr uint64_t broadcast(uint8_t v) noexcept {
10599|  8.79k|  return 0x101010101010101ull * v;
10600|  8.79k|}
_ZN3ada8checkers7is_ipv4ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   12|  4.25k|ada_really_inline constexpr bool is_ipv4(std::string_view view) noexcept {
   13|       |  // The string is not empty and does not contain upper case ASCII characters.
   14|       |  //
   15|       |  // Optimization. To be considered as a possible ipv4, the string must end
   16|       |  // with 'x' or a lowercase hex character.
   17|       |  // Most of the time, this will be false so this simple check will save a lot
   18|       |  // of effort.
   19|       |  // If the address ends with a dot, we need to prune it (special case).
   20|  4.25k|  if (view.ends_with('.')) {
  ------------------
  |  Branch (20:7): [True: 391, False: 3.86k]
  ------------------
   21|    391|    view.remove_suffix(1);
   22|    391|    if (view.empty()) {
  ------------------
  |  Branch (22:9): [True: 11, False: 380]
  ------------------
   23|     11|      return false;
   24|     11|    }
   25|    391|  }
   26|  4.24k|  char last_char = view.back();
   27|  4.24k|  bool possible_ipv4 = (last_char >= '0' && last_char <= '9') ||
  ------------------
  |  Branch (27:25): [True: 3.52k, False: 723]
  |  Branch (27:45): [True: 2.80k, False: 717]
  ------------------
   28|  1.44k|                       (last_char >= 'a' && last_char <= 'f') ||
  ------------------
  |  Branch (28:25): [True: 672, False: 768]
  |  Branch (28:45): [True: 484, False: 188]
  ------------------
   29|    956|                       last_char == 'x';
  ------------------
  |  Branch (29:24): [True: 50, False: 906]
  ------------------
   30|  4.24k|  if (!possible_ipv4) {
  ------------------
  |  Branch (30:7): [True: 906, False: 3.33k]
  ------------------
   31|    906|    return false;
   32|    906|  }
   33|       |  // From the last character, find the last dot.
   34|  3.33k|  size_t last_dot = view.rfind('.');
   35|  3.33k|  if (last_dot != std::string_view::npos) {
  ------------------
  |  Branch (35:7): [True: 2.42k, False: 908]
  ------------------
   36|       |    // We have at least one dot.
   37|  2.42k|    view.remove_prefix(last_dot + 1);
   38|  2.42k|  }
   39|       |  /** Optimization opportunity: we have basically identified the last number of
   40|       |     the ipv4 if we return true here. We might as well parse it and have at
   41|       |     least one number parsed when we get to parse_ipv4. */
   42|  3.33k|  if (std::ranges::all_of(view, ada::checkers::is_digit)) {
  ------------------
  |  Branch (42:7): [True: 2.53k, False: 800]
  ------------------
   43|  2.53k|    return true;
   44|  2.53k|  }
   45|       |  // It could be hex (0x), but not if there is a single character.
   46|    800|  if (view.size() == 1) {
  ------------------
  |  Branch (46:7): [True: 178, False: 622]
  ------------------
   47|    178|    return false;
   48|    178|  }
   49|       |  // It must start with 0x.
   50|    622|  if (!view.starts_with("0x")) {
  ------------------
  |  Branch (50:7): [True: 269, False: 353]
  ------------------
   51|    269|    return false;
   52|    269|  }
   53|       |  // We must allow "0x".
   54|    353|  if (view.size() == 2) {
  ------------------
  |  Branch (54:7): [True: 37, False: 316]
  ------------------
   55|     37|    return true;
   56|     37|  }
   57|       |  // We have 0x followed by some characters, we need to check that they are
   58|       |  // hexadecimals.
   59|    316|  view.remove_prefix(2);
   60|    316|  return std::ranges::all_of(view, ada::unicode::is_lowercase_hex);
   61|    353|}
_ZN3ada7unicode16is_lowercase_hexEc:
11005|  3.58k|ada_really_inline constexpr bool is_lowercase_hex(const char c) noexcept {
11006|  3.58k|  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f');
  ------------------
  |  Branch (11006:11): [True: 3.57k, False: 11]
  |  Branch (11006:23): [True: 2.56k, False: 1.00k]
  |  Branch (11006:37): [True: 1.00k, False: 13]
  |  Branch (11006:49): [True: 989, False: 14]
  ------------------
11007|  3.58k|}
_ZN3ada8checkers14path_signatureENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   87|  3.69k|    std::string_view input) noexcept {
   88|       |  // The path percent-encode set is the query percent-encode set and U+003F (?),
   89|       |  // U+0060 (`), U+007B ({), and U+007D (}). The query percent-encode set is the
   90|       |  // C0 control percent-encode set and U+0020 SPACE, U+0022 ("), U+0023 (#),
   91|       |  // U+003C (<), and U+003E (>). The C0 control percent-encode set are the C0
   92|       |  // controls and all code points greater than U+007E (~).
   93|  3.69k|  size_t i = 0;
   94|  3.69k|  uint8_t accumulator{};
   95|  15.7k|  for (; i + 7 < input.size(); i += 8) {
  ------------------
  |  Branch (95:10): [True: 12.0k, False: 3.69k]
  ------------------
   96|  12.0k|    accumulator |= uint8_t(path_signature_table[uint8_t(input[i])] |
   97|  12.0k|                           path_signature_table[uint8_t(input[i + 1])] |
   98|  12.0k|                           path_signature_table[uint8_t(input[i + 2])] |
   99|  12.0k|                           path_signature_table[uint8_t(input[i + 3])] |
  100|  12.0k|                           path_signature_table[uint8_t(input[i + 4])] |
  101|  12.0k|                           path_signature_table[uint8_t(input[i + 5])] |
  102|  12.0k|                           path_signature_table[uint8_t(input[i + 6])] |
  103|  12.0k|                           path_signature_table[uint8_t(input[i + 7])]);
  104|  12.0k|  }
  105|  13.3k|  for (; i < input.size(); i++) {
  ------------------
  |  Branch (105:10): [True: 9.70k, False: 3.69k]
  ------------------
  106|  9.70k|    accumulator |= uint8_t(path_signature_table[uint8_t(input[i])]);
  107|  9.70k|  }
  108|  3.69k|  return accumulator;
  109|  3.69k|}
_ZN3ada7unicode45contains_forbidden_domain_code_point_or_upperEPKcm:
10886|  4.98k|                                              size_t length) noexcept {
10887|  4.98k|  size_t i = 0;
10888|  4.98k|  uint8_t accumulator{};
10889|  38.0k|  for (; i + 4 <= length; i += 4) {
  ------------------
  |  Branch (10889:10): [True: 33.0k, False: 4.98k]
  ------------------
10890|  33.0k|    accumulator |=
10891|  33.0k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i])];
10892|  33.0k|    accumulator |=
10893|  33.0k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i + 1])];
10894|  33.0k|    accumulator |=
10895|  33.0k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i + 2])];
10896|  33.0k|    accumulator |=
10897|  33.0k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i + 3])];
10898|  33.0k|  }
10899|  11.3k|  for (; i < length; i++) {
  ------------------
  |  Branch (10899:10): [True: 6.34k, False: 4.98k]
  ------------------
10900|  6.34k|    accumulator |=
10901|  6.34k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i])];
10902|  6.34k|  }
10903|  4.98k|  return accumulator;
10904|  4.98k|}
_ZN3ada7unicode14percent_encodeILb1EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKhRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEE:
11078|  17.9k|                    std::string& out) {
11079|  17.9k|  ada_log("percent_encode ", input, " to output string while ",
11080|  17.9k|          append ? "appending" : "overwriting");
11081|  17.9k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
11082|  17.9k|    return character_sets::bit_at(character_set, c);
11083|  17.9k|  });
11084|  17.9k|  ada_log("percent_encode done checking, moved to ",
11085|  17.9k|          std::distance(input.begin(), pointer));
11086|       |
11087|       |  // Optimization: Don't iterate if percent encode is not required
11088|  17.9k|  if (pointer == input.end()) {
  ------------------
  |  Branch (11088:7): [True: 11.0k, False: 6.90k]
  ------------------
11089|  11.0k|    ada_log("percent_encode encoding not needed.");
11090|  11.0k|    return false;
11091|  11.0k|  }
11092|       |  if constexpr (!append) {
11093|       |    out.clear();
11094|       |  }
11095|  6.90k|  ada_log("percent_encode appending ", std::distance(input.begin(), pointer),
11096|  6.90k|          " bytes");
11097|       |  // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
11098|  6.90k|  out.append(input.data(), std::distance(input.begin(), pointer));
11099|  6.90k|  ada_log("percent_encode processing ", std::distance(pointer, input.end()),
11100|  6.90k|          " bytes");
11101|  98.9k|  for (; pointer != input.end(); pointer++) {
  ------------------
  |  Branch (11101:10): [True: 92.0k, False: 6.90k]
  ------------------
11102|  92.0k|    if (character_sets::bit_at(character_set, *pointer)) {
  ------------------
  |  Branch (11102:9): [True: 51.0k, False: 41.0k]
  ------------------
11103|  51.0k|      out.append(character_sets::hex + uint8_t(*pointer) * 4, 3);
11104|  51.0k|    } else {
11105|  41.0k|      out += *pointer;
11106|  41.0k|    }
11107|  92.0k|  }
11108|  6.90k|  return true;
11109|  17.9k|}
_ZZN3ada7unicode14percent_encodeILb1EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKhRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEEENKUlcE_clEc:
11081|  71.3k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
11082|  71.3k|    return character_sets::bit_at(character_set, c);
11083|  71.3k|  });
_ZN3ada7unicode14percent_encodeILb0EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKhRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEE:
11078|  19.9k|                    std::string& out) {
11079|  19.9k|  ada_log("percent_encode ", input, " to output string while ",
11080|  19.9k|          append ? "appending" : "overwriting");
11081|  19.9k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
11082|  19.9k|    return character_sets::bit_at(character_set, c);
11083|  19.9k|  });
11084|  19.9k|  ada_log("percent_encode done checking, moved to ",
11085|  19.9k|          std::distance(input.begin(), pointer));
11086|       |
11087|       |  // Optimization: Don't iterate if percent encode is not required
11088|  19.9k|  if (pointer == input.end()) {
  ------------------
  |  Branch (11088:7): [True: 12.6k, False: 7.28k]
  ------------------
11089|  12.6k|    ada_log("percent_encode encoding not needed.");
11090|  12.6k|    return false;
11091|  12.6k|  }
11092|  7.28k|  if constexpr (!append) {
11093|  7.28k|    out.clear();
11094|  7.28k|  }
11095|  7.28k|  ada_log("percent_encode appending ", std::distance(input.begin(), pointer),
11096|  7.28k|          " bytes");
11097|       |  // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
11098|  7.28k|  out.append(input.data(), std::distance(input.begin(), pointer));
11099|  7.28k|  ada_log("percent_encode processing ", std::distance(pointer, input.end()),
11100|  7.28k|          " bytes");
11101|   102k|  for (; pointer != input.end(); pointer++) {
  ------------------
  |  Branch (11101:10): [True: 95.6k, False: 7.28k]
  ------------------
11102|  95.6k|    if (character_sets::bit_at(character_set, *pointer)) {
  ------------------
  |  Branch (11102:9): [True: 53.0k, False: 42.6k]
  ------------------
11103|  53.0k|      out.append(character_sets::hex + uint8_t(*pointer) * 4, 3);
11104|  53.0k|    } else {
11105|  42.6k|      out += *pointer;
11106|  42.6k|    }
11107|  95.6k|  }
11108|  7.28k|  return true;
11109|  19.9k|}
_ZZN3ada7unicode14percent_encodeILb0EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKhRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEEENKUlcE_clEc:
11081|  73.1k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
11082|  73.1k|    return character_sets::bit_at(character_set, c);
11083|  73.1k|  });
_ZN3ada14url_aggregator23parse_scheme_with_colonILb0EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
14711|  5.20k|    const std::string_view input_with_colon) {
14712|  5.20k|  ada_log("url_aggregator::parse_scheme_with_colon ", input_with_colon);
14713|  5.20k|  ADA_ASSERT_TRUE(validate());
14714|  5.20k|  ADA_ASSERT_TRUE(!helpers::overlaps(input_with_colon, buffer));
14715|  5.20k|  std::string_view input{input_with_colon};
14716|  5.20k|  input.remove_suffix(1);
14717|  5.20k|  auto parsed_type = ada::scheme::get_scheme_type(input);
14718|  5.20k|  const bool is_input_special = (parsed_type != ada::scheme::NOT_SPECIAL);
14719|       |  /**
14720|       |   * In the common case, we will immediately recognize a special scheme (e.g.,
14721|       |   *http, https), in which case, we can go really fast.
14722|       |   **/
14723|  5.20k|  if (is_input_special) {  // fast path!!!
  ------------------
  |  Branch (14723:7): [True: 5.20k, False: 0]
  ------------------
14724|       |    if constexpr (has_state_override) {
14725|       |      // If url's scheme is not a special scheme and buffer is a special scheme,
14726|       |      // then return.
14727|       |      if (is_special() != is_input_special) {
14728|       |        return false;
14729|       |      }
14730|       |
14731|       |      // If url includes credentials or has a non-null port, and buffer is
14732|       |      // "file", then return.
14733|       |      if ((has_credentials() || components.port != url_components::omitted) &&
14734|       |          parsed_type == ada::scheme::type::FILE) {
14735|       |        return false;
14736|       |      }
14737|       |
14738|       |      // If url's scheme is "file" and its host is an empty host, then return.
14739|       |      // An empty host is the empty string.
14740|       |      if (type == ada::scheme::type::FILE &&
14741|       |          components.host_start == components.host_end) {
14742|       |        return false;
14743|       |      }
14744|       |    }
14745|       |
14746|  5.20k|    type = parsed_type;
14747|  5.20k|    set_scheme_from_view_with_colon(input_with_colon);
14748|       |
14749|       |    if constexpr (has_state_override) {
14750|       |      // This is uncommon.
14751|       |      uint16_t urls_scheme_port = get_special_port();
14752|       |
14753|       |      // If url's port is url's scheme's default port, then set url's port to
14754|       |      // null.
14755|       |      if (components.port == urls_scheme_port) {
14756|       |        clear_port();
14757|       |      }
14758|       |    }
14759|  5.20k|  } else {  // slow path
14760|      0|    std::string _buffer(input);
14761|       |    // Next function is only valid if the input is ASCII and returns false
14762|       |    // otherwise, but it seems that we always have ascii content so we do not
14763|       |    // need to check the return value.
14764|      0|    unicode::to_lower_ascii(_buffer.data(), _buffer.size());
14765|       |
14766|       |    if constexpr (has_state_override) {
14767|       |      // The state-override validation errors below ("return" in the WHATWG URL
14768|       |      // parser) leave the URL unchanged. The setter contract is
14769|       |      // "true on success, false if the scheme is invalid" -- the fast path
14770|       |      // above already returns false here, so the slow path must agree.
14771|       |
14772|       |      // If url's scheme is a special scheme and buffer is not a special scheme,
14773|       |      // then return. If url's scheme is not a special scheme and buffer is a
14774|       |      // special scheme, then return.
14775|       |      if (is_special() != ada::scheme::is_special(_buffer)) {
14776|       |        return false;
14777|       |      }
14778|       |
14779|       |      // If url includes credentials or has a non-null port, and buffer is
14780|       |      // "file", then return.
14781|       |      if ((has_credentials() || components.port != url_components::omitted) &&
14782|       |          _buffer == "file") {
14783|       |        return false;
14784|       |      }
14785|       |
14786|       |      // If url's scheme is "file" and its host is an empty host, then return.
14787|       |      // An empty host is the empty string.
14788|       |      if (type == ada::scheme::type::FILE &&
14789|       |          components.host_start == components.host_end) {
14790|       |        return false;
14791|       |      }
14792|       |    }
14793|       |
14794|      0|    set_scheme(_buffer);
14795|       |
14796|       |    if constexpr (has_state_override) {
14797|       |      // This is uncommon.
14798|       |      uint16_t urls_scheme_port = get_special_port();
14799|       |
14800|       |      // If url's port is url's scheme's default port, then set url's port to
14801|       |      // null.
14802|       |      if (components.port == urls_scheme_port) {
14803|       |        clear_port();
14804|       |      }
14805|       |    }
14806|      0|  }
14807|  5.20k|  ADA_ASSERT_TRUE(validate());
14808|  5.20k|  return true;
14809|  5.20k|}
_ZN3ada14url_aggregator31set_scheme_from_view_with_colonENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
14833|  5.20k|    std::string_view new_scheme_with_colon) {
14834|  5.20k|  ada_log("url_aggregator::set_scheme_from_view_with_colon ",
14835|  5.20k|          new_scheme_with_colon);
14836|  5.20k|  ADA_ASSERT_TRUE(validate());
14837|  5.20k|  ADA_ASSERT_TRUE(!new_scheme_with_colon.empty() &&
14838|  5.20k|                  new_scheme_with_colon.back() == ':');
14839|       |  // next line could overflow but unsigned arithmetic has well-defined
14840|       |  // overflows.
14841|  5.20k|  uint32_t new_difference =
14842|  5.20k|      uint32_t(new_scheme_with_colon.size()) - components.protocol_end;
14843|       |
14844|  5.20k|  if (buffer.empty()) {
  ------------------
  |  Branch (14844:7): [True: 5.20k, False: 0]
  ------------------
14845|  5.20k|    buffer.append(new_scheme_with_colon);
14846|  5.20k|  } else {
14847|      0|    buffer.erase(0, components.protocol_end);
14848|      0|    buffer.insert(0, new_scheme_with_colon);
14849|      0|  }
14850|  5.20k|  components.protocol_end += new_difference;
14851|       |
14852|  5.20k|  apply_shifted_non_scheme_offsets(components, new_difference);
14853|  5.20k|  ADA_ASSERT_TRUE(validate());
14854|  5.20k|}

_ZN3ada37url_pattern_compile_component_optionsC2ENSt3__18optionalIcEES3_:
 5559|      6|      : delimiter(new_delimiter), prefix(new_prefix) {}
_ZN3ada14character_sets6bit_atEPKhh:
 1031|   637k|ada_really_inline constexpr bool bit_at(const uint8_t a[], const uint8_t i) {
 1032|   637k|  return !!(a[i >> 3] & (1 << (i & 7)));
 1033|   637k|}
_ZN2tl10unexpectedIN3ada6errorsEEC2EOS2_:
 2011|  8.80k|  constexpr explicit unexpected(E&& e) : m_val(std::move(e)) {}
_ZNR2tl10unexpectedIN3ada6errorsEE5valueEv:
 2025|  4.40k|  TL_EXPECTED_11_CONSTEXPR E& value() & { return m_val; }
_ZN3ada8url_baseD2Ev:
 1515|  6.00k|  virtual ~url_base() = default;
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEC2IS3_TnPNSt3__19enable_ifIXsr3std16is_constructibleIS3_OT_EE5valueEvE4typeELPv0ETnPNS7_IXsr3std14is_convertibleIS9_S3_EE5valueEvE4typeELSD_0EEEONS_10unexpectedIS8_EE:
 3497|  4.40k|      : impl_base(unexpect, std::move(e.value())),
 3498|  4.40k|        ctor_base(detail::default_constructor_tag{}) {}
_ZN2tl6detail21expected_storage_baseIN3ada14url_aggregatorENS2_6errorsELb0ELb1EEC2IJS4_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS4_DpOT_EE5valueEvE4typeELPv0EEENS_10unexpect_tESB_:
 2483|  4.40k|      : m_unexpect(std::forward<Args>(args)...), m_has_val(false) {}
_ZN2tl6detail26expected_default_ctor_baseIN3ada14url_aggregatorENS2_6errorsELb1EEC2ENS0_23default_constructor_tagE:
 3101|  5.20k|  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_:
 3583|    799|      : expected(in_place, std::forward<U>(v)) {}
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEC2IJS2_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS2_DpOT_EE5valueEvE4typeELPv0EEENS_10in_place_tESA_:
 3456|    799|      : impl_base(in_place, std::forward<Args>(args)...),
 3457|    799|        ctor_base(detail::default_constructor_tag{}) {}
_ZN2tl6detail21expected_storage_baseIN3ada14url_aggregatorENS2_6errorsELb0ELb1EEC2IJS3_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS3_DpOT_EE5valueEvE4typeELPv0EEENS_10in_place_tESB_:
 2471|    799|      : m_val(std::forward<Args>(args)...), m_has_val(true) {}
_ZN3ada14url_aggregatorC2EOS0_:
 7509|    799|  url_aggregator(url_aggregator&& u) noexcept = default;
_ZN3ada14url_aggregatorD2Ev:
 7512|  6.00k|  ~url_aggregator() override = default;
_ZN3ada6scheme15get_scheme_typeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6590|  5.20k|constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept {
 6591|  5.20k|  if (scheme.empty()) {
  ------------------
  |  Branch (6591:7): [True: 0, False: 5.20k]
  ------------------
 6592|      0|    return ada::scheme::NOT_SPECIAL;
 6593|      0|  }
 6594|  5.20k|  int hash_value = (2 * scheme.size() + (unsigned)(scheme[0])) & 7;
 6595|  5.20k|  const std::string_view target = details::is_special_list[hash_value];
 6596|  5.20k|  if (scheme.size() == target.size() &&
  ------------------
  |  Branch (6596:7): [True: 5.20k, False: 0]
  ------------------
 6597|  5.20k|      details::branchless_load5(scheme.data(), scheme.size()) ==
  ------------------
  |  Branch (6597:7): [True: 5.20k, False: 0]
  ------------------
 6598|  5.20k|          details::scheme_keys[hash_value]) {
 6599|  5.20k|    return ada::scheme::type(hash_value);
 6600|  5.20k|  } else {
 6601|      0|    return ada::scheme::NOT_SPECIAL;
 6602|      0|  }
 6603|  5.20k|}
_ZN3ada6scheme7details16branchless_load5EPKcm:
 6531|  5.20k|inline uint64_t branchless_load5(const char* p, size_t n) {
 6532|  5.20k|  uint64_t input = (uint8_t)p[0];
 6533|  5.20k|  input |= ((uint64_t)(uint8_t)p[n > 1] << 8) & (0 - (uint64_t)(n > 1));
 6534|  5.20k|  input |= ((uint64_t)(uint8_t)p[(n > 2) * 2] << 16) & (0 - (uint64_t)(n > 2));
 6535|  5.20k|  input |= ((uint64_t)(uint8_t)p[(n > 3) * 3] << 24) & (0 - (uint64_t)(n > 3));
 6536|  5.20k|  input |= ((uint64_t)(uint8_t)p[(n > 4) * 4] << 32) & (0 - (uint64_t)(n > 4));
 6537|  5.20k|  return input;
 6538|  5.20k|}
_ZN3ada14url_aggregatorC2Ev:
 7507|  5.20k|  url_aggregator() = default;
_ZN3ada14url_componentsC2Ev:
 4757|  5.20k|  url_components() = default;
_ZN3ada8checkers14has_hex_prefixENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1201|    956|constexpr bool has_hex_prefix(std::string_view input) {
 1202|    956|  return input.size() >= 2 && has_hex_prefix_unsafe(input);
  ------------------
  |  Branch (1202:10): [True: 887, False: 69]
  |  Branch (1202:31): [True: 213, False: 674]
  ------------------
 1203|    956|}
_ZN3ada8checkers21has_hex_prefix_unsafeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1186|    887|constexpr bool has_hex_prefix_unsafe(std::string_view input) {
 1187|       |  // This is actually efficient code, see has_hex_prefix for the assembly.
 1188|    887|  constexpr bool is_little_endian = std::endian::native == std::endian::little;
 1189|    887|  constexpr uint16_t word0x = 0x7830;
 1190|    887|  uint16_t two_first_bytes =
 1191|    887|      static_cast<uint16_t>(input[0]) |
 1192|    887|      static_cast<uint16_t>((static_cast<uint16_t>(input[1]) << 8));
 1193|    887|  if constexpr (is_little_endian) {
 1194|    887|    two_first_bytes |= 0x2000;
 1195|       |  } else {
 1196|       |    two_first_bytes |= 0x020;
 1197|       |  }
 1198|    887|  return two_first_bytes == word0x;
 1199|    887|}
_ZN3ada8checkers8is_digitEc:
 1205|  14.1k|constexpr bool is_digit(char x) noexcept { return (x >= '0') & (x <= '9'); }
_ZNK3ada8url_base10is_specialEv:
 7063|  20.1k|    const noexcept {
 7064|  20.1k|  return type != ada::scheme::NOT_SPECIAL;
 7065|  20.1k|}
_ZN3ada8checkers8is_alphaEc:
 1209|  9.77k|constexpr bool is_alpha(char x) noexcept {
 1210|  9.77k|  return (to_lower(x) >= 'a') && (to_lower(x) <= 'z');
  ------------------
  |  Branch (1210:10): [True: 6.89k, False: 2.88k]
  |  Branch (1210:34): [True: 6.70k, False: 186]
  ------------------
 1211|  9.77k|}
_ZN3ada8checkers8to_lowerEc:
 1207|  16.6k|constexpr char to_lower(char x) noexcept { return (x | 0x20); }
_ZNK3ada8url_base19scheme_default_portEv:
 7072|     69|url_base::scheme_default_port() const noexcept {
 7073|     69|  return scheme::get_special_port(type);
 7074|     69|}
_ZN3ada6scheme16get_special_portENS0_4typeE:
 6587|     69|constexpr uint16_t get_special_port(ada::scheme::type type) noexcept {
 6588|     69|  return details::special_ports[int(type)];
 6589|     69|}
_ZN3ada8checkers23is_windows_drive_letterENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1213|  2.93k|constexpr bool is_windows_drive_letter(std::string_view input) noexcept {
 1214|  2.93k|  return input.size() >= 2 &&
  ------------------
  |  Branch (1214:10): [True: 2.28k, False: 643]
  ------------------
 1215|  2.28k|         (is_alpha(input[0]) && ((input[1] == ':') || (input[1] == '|'))) &&
  ------------------
  |  Branch (1215:11): [True: 752, False: 1.53k]
  |  Branch (1215:34): [True: 5, False: 747]
  |  Branch (1215:55): [True: 8, False: 739]
  ------------------
 1216|     13|         ((input.size() == 2) || (input[2] == '/' || input[2] == '\\' ||
  ------------------
  |  Branch (1216:11): [True: 2, False: 11]
  |  Branch (1216:35): [True: 1, False: 10]
  |  Branch (1216:54): [True: 1, False: 9]
  ------------------
 1217|      9|                                  input[2] == '?' || input[2] == '#'));
  ------------------
  |  Branch (1217:35): [True: 2, False: 7]
  |  Branch (1217:54): [True: 0, False: 7]
  ------------------
 1218|  2.93k|}
_ZN3ada8checkers34is_normalized_windows_drive_letterENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1221|  2.93k|    std::string_view input) noexcept {
 1222|  2.93k|  return input.size() >= 2 && (is_alpha(input[0]) && (input[1] == ':'));
  ------------------
  |  Branch (1222:10): [True: 2.28k, False: 643]
  |  Branch (1222:32): [True: 752, False: 1.53k]
  |  Branch (1222:54): [True: 5, False: 747]
  ------------------
 1223|  2.93k|}
_ZN3ada7helpers14leading_zeroesEj:
 1800|  5.25k|inline int leading_zeroes(uint32_t input_num) noexcept {
 1801|       |#if ADA_REGULAR_VISUAL_STUDIO
 1802|       |  unsigned long leading_zero(0);
 1803|       |  unsigned long in(input_num);
 1804|       |  return _BitScanReverse(&leading_zero, in) ? int(31 - leading_zero) : 32;
 1805|       |#else
 1806|  5.25k|  return __builtin_clz(input_num);
 1807|  5.25k|#endif  // ADA_REGULAR_VISUAL_STUDIO
 1808|  5.25k|}
_ZN3ada14url_aggregator7reserveEj:
 8717|  5.20k|constexpr void ada::url_aggregator::reserve(uint32_t capacity) {
 8718|  5.20k|  buffer.reserve(capacity);
 8719|  5.20k|}
_ZN3ada14url_aggregator20update_base_pathnameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8207|    394|inline void url_aggregator::update_base_pathname(const std::string_view input) {
 8208|    394|  ada_log("url_aggregator::update_base_pathname '", input, "' [", input.size(),
 8209|    394|          " bytes] \n", to_diagram());
 8210|    394|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8211|    394|  ADA_ASSERT_TRUE(validate());
 8212|       |
 8213|    394|  const bool begins_with_dashdash = input.starts_with("//");
 8214|    394|  if (!begins_with_dashdash && has_dash_dot()) {
  ------------------
  |  Branch (8214:7): [True: 247, False: 147]
  |  Branch (8214:32): [True: 0, False: 247]
  ------------------
 8215|       |    // We must delete the ./
 8216|      0|    delete_dash_dot();
 8217|      0|  }
 8218|       |
 8219|    394|  if (begins_with_dashdash && !has_opaque_path && !has_authority() &&
  ------------------
  |  Branch (8219:7): [True: 147, False: 247]
  |  Branch (8219:31): [True: 147, False: 0]
  |  Branch (8219:51): [True: 0, False: 147]
  ------------------
 8220|      0|      !has_dash_dot()) {
  ------------------
  |  Branch (8220:7): [True: 0, False: 0]
  ------------------
 8221|       |    // If url's host is null, url does not have an opaque path, url's path's
 8222|       |    // size is greater than 1, then append U+002F (/) followed by U+002E (.) to
 8223|       |    // output.
 8224|      0|    buffer.insert(components.pathname_start, "/.");
 8225|      0|    components.pathname_start += 2;
 8226|      0|    if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8226:9): [True: 0, False: 0]
  ------------------
 8227|      0|      components.search_start += 2;
 8228|      0|    }
 8229|      0|    if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8229:9): [True: 0, False: 0]
  ------------------
 8230|      0|      components.hash_start += 2;
 8231|      0|    }
 8232|      0|  }
 8233|       |
 8234|    394|  uint32_t difference = replace_and_resize(
 8235|    394|      components.pathname_start,
 8236|    394|      components.pathname_start + get_pathname_length(), input);
 8237|    394|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8237:7): [True: 0, False: 394]
  ------------------
 8238|      0|    components.search_start += difference;
 8239|      0|  }
 8240|    394|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8240:7): [True: 0, False: 394]
  ------------------
 8241|      0|    components.hash_start += difference;
 8242|      0|  }
 8243|    394|  ADA_ASSERT_TRUE(validate());
 8244|    394|}
_ZN3ada14url_aggregator18replace_and_resizeEjjNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8050|  1.95k|    uint32_t start, uint32_t end, std::string_view input) {
 8051|  1.95k|  uint32_t current_length = end - start;
 8052|  1.95k|  uint32_t input_size = uint32_t(input.size());
 8053|  1.95k|  uint32_t new_difference = input_size - current_length;
 8054|       |
 8055|  1.95k|  if (current_length == 0) {
  ------------------
  |  Branch (8055:7): [True: 1.57k, False: 374]
  ------------------
 8056|  1.57k|    buffer.insert(start, input);
 8057|  1.57k|  } else if (input_size == current_length) {
  ------------------
  |  Branch (8057:14): [True: 12, False: 362]
  ------------------
 8058|     12|    buffer.replace(start, input_size, input);
 8059|    362|  } else if (input_size < current_length) {
  ------------------
  |  Branch (8059:14): [True: 27, False: 335]
  ------------------
 8060|     27|    buffer.erase(start, current_length - input_size);
 8061|     27|    buffer.replace(start, input_size, input);
 8062|    335|  } else {
 8063|    335|    buffer.replace(start, current_length, input.substr(0, current_length));
 8064|    335|    buffer.insert(start + current_length, input.substr(current_length));
 8065|    335|  }
 8066|       |
 8067|  1.95k|  return new_difference;
 8068|  1.95k|}
_ZNK3ada14url_aggregator19get_pathname_lengthEv:
 8099|    394|url_aggregator::get_pathname_length() const noexcept {
 8100|    394|  ada_log("url_aggregator::get_pathname_length");
 8101|    394|  uint32_t ending_index = uint32_t(buffer.size());
 8102|    394|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8102:7): [True: 0, False: 394]
  ------------------
 8103|      0|    ending_index = components.search_start;
 8104|    394|  } else if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8104:14): [True: 0, False: 394]
  ------------------
 8105|      0|    ending_index = components.hash_start;
 8106|      0|  }
 8107|    394|  return ending_index - components.pathname_start;
 8108|    394|}
_ZNK3ada14url_aggregator12get_pathnameEv:
 9044|    356|    ada_lifetime_bound {
 9045|    356|  ada_log("url_aggregator::get_pathname pathname_start = ",
 9046|    356|          components.pathname_start, " buffer.size() = ", buffer.size(),
 9047|    356|          " components.search_start = ", components.search_start,
 9048|    356|          " components.hash_start = ", components.hash_start);
 9049|    356|  auto ending_index = uint32_t(buffer.size());
 9050|    356|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (9050:7): [True: 0, False: 356]
  ------------------
 9051|      0|    ending_index = components.search_start;
 9052|    356|  } else if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (9052:14): [True: 0, False: 356]
  ------------------
 9053|      0|    ending_index = components.hash_start;
 9054|      0|  }
 9055|    356|  return helpers::substring(buffer, components.pathname_start, ending_index);
 9056|    356|}
_ZN3ada14url_aggregator26update_unencoded_base_hashENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8026|     64|inline void url_aggregator::update_unencoded_base_hash(std::string_view input) {
 8027|     64|  ada_log("url_aggregator::update_unencoded_base_hash ", input, " [",
 8028|     64|          input.size(), " bytes], buffer is '", buffer, "' [", buffer.size(),
 8029|     64|          " bytes] components.hash_start = ", components.hash_start);
 8030|     64|  ADA_ASSERT_TRUE(validate());
 8031|     64|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8032|     64|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8032:7): [True: 0, False: 64]
  ------------------
 8033|      0|    buffer.resize(components.hash_start);
 8034|      0|  }
 8035|     64|  components.hash_start = uint32_t(buffer.size());
 8036|     64|  buffer += "#";
 8037|     64|  bool encoding_required = unicode::percent_encode<true>(
 8038|     64|      input, ada::character_sets::FRAGMENT_PERCENT_ENCODE, buffer);
 8039|       |  // When encoding_required is false, then buffer is left unchanged, and percent
 8040|       |  // encoding was not deemed required.
 8041|     64|  if (!encoding_required) {
  ------------------
  |  Branch (8041:7): [True: 44, False: 20]
  ------------------
 8042|     44|    buffer.append(input);
 8043|     44|  }
 8044|     64|  ada_log("url_aggregator::update_unencoded_base_hash final buffer is '",
 8045|     64|          buffer, "' [", buffer.size(), " bytes]");
 8046|     64|  ADA_ASSERT_TRUE(validate());
 8047|     64|}
_ZN3ada14url_aggregator20append_base_passwordENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8435|    915|inline void url_aggregator::append_base_password(const std::string_view input) {
 8436|    915|  ada_log("url_aggregator::append_base_password ", input, " ", to_string(),
 8437|    915|          "\n", to_diagram());
 8438|    915|  ADA_ASSERT_TRUE(validate());
 8439|    915|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8440|       |#if ADA_DEVELOPMENT_CHECKS
 8441|       |  // computing the expected password.
 8442|       |  std::string password_expected = std::string(get_password());
 8443|       |  password_expected.append(input);
 8444|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8445|    915|  add_authority_slashes_if_needed();
 8446|       |
 8447|       |  // If input is empty, do nothing.
 8448|    915|  if (input.empty()) {
  ------------------
  |  Branch (8448:7): [True: 358, False: 557]
  ------------------
 8449|    358|    return;
 8450|    358|  }
 8451|       |
 8452|    557|  uint32_t difference = uint32_t(input.size());
 8453|    557|  if (has_password()) {
  ------------------
  |  Branch (8453:7): [True: 479, False: 78]
  ------------------
 8454|    479|    buffer.insert(components.host_start, input);
 8455|    479|  } else {
 8456|     78|    difference++;  // Increment for ":"
 8457|     78|    buffer.insert(components.username_end, ":");
 8458|     78|    buffer.insert(components.username_end + 1, input);
 8459|     78|  }
 8460|    557|  components.host_start += difference;
 8461|       |
 8462|       |  // The following line is required to add "@" to hostname. When updating
 8463|       |  // password if hostname does not start with "@", it is "append_base_password"s
 8464|       |  // responsibility to set it.
 8465|    557|  if (buffer[components.host_start] != '@') {
  ------------------
  |  Branch (8465:7): [True: 24, False: 533]
  ------------------
 8466|     24|    buffer.insert(components.host_start, "@");
 8467|     24|    difference++;
 8468|     24|  }
 8469|       |
 8470|    557|  components.host_end += difference;
 8471|    557|  components.pathname_start += difference;
 8472|    557|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8472:7): [True: 0, False: 557]
  ------------------
 8473|      0|    components.search_start += difference;
 8474|      0|  }
 8475|    557|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8475:7): [True: 0, False: 557]
  ------------------
 8476|      0|    components.hash_start += difference;
 8477|      0|  }
 8478|       |#if ADA_DEVELOPMENT_CHECKS
 8479|       |  std::string password_after(get_password());
 8480|       |  ADA_ASSERT_EQUAL(
 8481|       |      password_expected, password_after,
 8482|       |      "append_base_password problem after inserting " + std::string(input));
 8483|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8484|    557|  ADA_ASSERT_TRUE(validate());
 8485|    557|}
_ZN3ada14url_aggregator31add_authority_slashes_if_neededEv:
 8691|  3.30k|inline void ada::url_aggregator::add_authority_slashes_if_needed() {
 8692|  3.30k|  ada_log("url_aggregator::add_authority_slashes_if_needed");
 8693|  3.30k|  ADA_ASSERT_TRUE(validate());
 8694|       |  // Protocol setter will insert `http:` to the URL. It is up to hostname setter
 8695|       |  // to insert
 8696|       |  // `//` initially to the buffer, since it depends on the hostname existence.
 8697|  3.30k|  if (has_authority()) {
  ------------------
  |  Branch (8697:7): [True: 1.97k, False: 1.33k]
  ------------------
 8698|  1.97k|    return;
 8699|  1.97k|  }
 8700|       |  // Performance: the common case is components.protocol_end == buffer.size()
 8701|       |  // Optimization opportunity: in many cases, the "//" is part of the input and
 8702|       |  // the insert could be fused with another insert.
 8703|  1.33k|  buffer.insert(components.protocol_end, "//");
 8704|  1.33k|  components.username_end += 2;
 8705|  1.33k|  components.host_start += 2;
 8706|  1.33k|  components.host_end += 2;
 8707|  1.33k|  components.pathname_start += 2;
 8708|  1.33k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8708:7): [True: 0, False: 1.33k]
  ------------------
 8709|      0|    components.search_start += 2;
 8710|      0|  }
 8711|  1.33k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8711:7): [True: 0, False: 1.33k]
  ------------------
 8712|      0|    components.hash_start += 2;
 8713|      0|  }
 8714|  1.33k|  ADA_ASSERT_TRUE(validate());
 8715|  1.33k|}
_ZN3ada14url_aggregator20append_base_usernameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8317|    836|inline void url_aggregator::append_base_username(const std::string_view input) {
 8318|    836|  ada_log("url_aggregator::append_base_username ", input);
 8319|    836|  ADA_ASSERT_TRUE(validate());
 8320|    836|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8321|       |#if ADA_DEVELOPMENT_CHECKS
 8322|       |  // computing the expected password.
 8323|       |  std::string username_expected(get_username());
 8324|       |  username_expected.append(input);
 8325|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8326|    836|  add_authority_slashes_if_needed();
 8327|       |
 8328|       |  // If input is empty, do nothing.
 8329|    836|  if (input.empty()) {
  ------------------
  |  Branch (8329:7): [True: 329, False: 507]
  ------------------
 8330|    329|    return;
 8331|    329|  }
 8332|       |
 8333|    507|  uint32_t difference = uint32_t(input.size());
 8334|    507|  buffer.insert(components.username_end, input);
 8335|    507|  components.username_end += difference;
 8336|    507|  components.host_start += difference;
 8337|       |
 8338|    507|  if (buffer[components.host_start] != '@' &&
  ------------------
  |  Branch (8338:7): [True: 126, False: 381]
  ------------------
 8339|    126|      components.host_start != components.host_end) {
  ------------------
  |  Branch (8339:7): [True: 126, False: 0]
  ------------------
 8340|    126|    buffer.insert(components.host_start, "@");
 8341|    126|    difference++;
 8342|    126|  }
 8343|       |
 8344|    507|  components.host_end += difference;
 8345|    507|  components.pathname_start += difference;
 8346|    507|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8346:7): [True: 0, False: 507]
  ------------------
 8347|      0|    components.search_start += difference;
 8348|      0|  }
 8349|    507|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8349:7): [True: 0, False: 507]
  ------------------
 8350|      0|    components.hash_start += difference;
 8351|      0|  }
 8352|       |#if ADA_DEVELOPMENT_CHECKS
 8353|       |  std::string username_after(get_username());
 8354|       |  ADA_ASSERT_EQUAL(
 8355|       |      username_expected, username_after,
 8356|       |      "append_base_username problem after inserting " + std::string(input));
 8357|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8358|    507|  ADA_ASSERT_TRUE(validate());
 8359|    507|}
_ZN3ada14url_aggregator16update_base_portEj:
 8487|     53|inline void url_aggregator::update_base_port(uint32_t input) {
 8488|     53|  ada_log("url_aggregator::update_base_port");
 8489|     53|  ADA_ASSERT_TRUE(validate());
 8490|     53|  if (input == url_components::omitted) {
  ------------------
  |  Branch (8490:7): [True: 0, False: 53]
  ------------------
 8491|      0|    clear_port();
 8492|      0|    return;
 8493|      0|  }
 8494|       |  // calling std::to_string(input.value()) is unfortunate given that the port
 8495|       |  // value is probably already available as a string.
 8496|     53|  std::string value = helpers::concat(":", std::to_string(input));
 8497|     53|  uint32_t difference = uint32_t(value.size());
 8498|       |
 8499|     53|  if (components.port != url_components::omitted) {
  ------------------
  |  Branch (8499:7): [True: 0, False: 53]
  ------------------
 8500|      0|    difference -= components.pathname_start - components.host_end;
 8501|      0|    buffer.erase(components.host_end,
 8502|      0|                 components.pathname_start - components.host_end);
 8503|      0|  }
 8504|       |
 8505|     53|  buffer.insert(components.host_end, value);
 8506|     53|  components.pathname_start += difference;
 8507|     53|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8507:7): [True: 0, False: 53]
  ------------------
 8508|      0|    components.search_start += difference;
 8509|      0|  }
 8510|     53|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8510:7): [True: 0, False: 53]
  ------------------
 8511|      0|    components.hash_start += difference;
 8512|      0|  }
 8513|     53|  components.port = input;
 8514|     53|  ADA_ASSERT_TRUE(validate());
 8515|     53|}
_ZN3ada7helpers6concatIJPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEESA_DpT_:
 1790|     53|std::string concat(Args... args) {
 1791|     53|  std::string answer;
 1792|     53|  inner_concat(answer, args...);
 1793|     53|  return answer;
 1794|     53|}
_ZN3ada7helpers12inner_concatIPKcJNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEEvRSA_T_DpT0_:
 1779|     53|inline void inner_concat(std::string& buffer, T t, Args... args) {
 1780|     53|  buffer.append(t);
 1781|     53|  return inner_concat(buffer, args...);
 1782|     53|}
_ZN3ada7helpers12inner_concatINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEJEEEvRS8_T_:
 1771|     53|inline void inner_concat(std::string& buffer, T t) {
 1772|     53|  buffer.append(t);
 1773|     53|}
_ZN3ada14url_aggregator18update_base_searchENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKh:
 8155|    267|    std::string_view input, const uint8_t query_percent_encode_set[]) {
 8156|    267|  ada_log("url_aggregator::update_base_search ", input,
 8157|    267|          " with encoding parameter ", to_string(), "\n", to_diagram());
 8158|    267|  ADA_ASSERT_TRUE(validate());
 8159|    267|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8160|       |
 8161|    267|  if (components.hash_start == url_components::omitted) {
  ------------------
  |  Branch (8161:7): [True: 267, False: 0]
  ------------------
 8162|    267|    if (components.search_start == url_components::omitted) {
  ------------------
  |  Branch (8162:9): [True: 267, False: 0]
  ------------------
 8163|    267|      components.search_start = uint32_t(buffer.size());
 8164|    267|      buffer += "?";
 8165|    267|    } else {
 8166|      0|      buffer.resize(components.search_start + 1);
 8167|      0|    }
 8168|       |
 8169|    267|    bool encoding_required =
 8170|    267|        unicode::percent_encode<true>(input, query_percent_encode_set, buffer);
 8171|       |    // When encoding_required is false, then buffer is left unchanged, and
 8172|       |    // percent encoding was not deemed required.
 8173|    267|    if (!encoding_required) {
  ------------------
  |  Branch (8173:9): [True: 232, False: 35]
  ------------------
 8174|    232|      buffer.append(input);
 8175|    232|    }
 8176|    267|  } else {
 8177|      0|    if (components.search_start == url_components::omitted) {
  ------------------
  |  Branch (8177:9): [True: 0, False: 0]
  ------------------
 8178|      0|      components.search_start = components.hash_start;
 8179|      0|    } else {
 8180|      0|      buffer.erase(components.search_start,
 8181|      0|                   components.hash_start - components.search_start);
 8182|      0|      components.hash_start = components.search_start;
 8183|      0|    }
 8184|       |
 8185|      0|    buffer.insert(components.search_start, "?");
 8186|      0|    size_t idx =
 8187|      0|        ada::unicode::percent_encode_index(input, query_percent_encode_set);
 8188|      0|    if (idx == input.size()) {
  ------------------
  |  Branch (8188:9): [True: 0, False: 0]
  ------------------
 8189|      0|      buffer.insert(components.search_start + 1, input);
 8190|      0|      components.hash_start += uint32_t(input.size() + 1);  // Do not forget `?`
 8191|      0|    } else {
 8192|      0|      buffer.insert(components.search_start + 1, input, 0, idx);
 8193|      0|      input.remove_prefix(idx);
 8194|       |      // We only create a temporary string if we need percent encoding and
 8195|       |      // we attempt to create as small a temporary string as we can.
 8196|      0|      std::string encoded =
 8197|      0|          ada::unicode::percent_encode(input, query_percent_encode_set);
 8198|      0|      buffer.insert(components.search_start + idx + 1, encoded);
 8199|      0|      components.hash_start +=
 8200|      0|          uint32_t(encoded.size() + idx + 1);  // Do not forget `?`
 8201|      0|    }
 8202|      0|  }
 8203|       |
 8204|    267|  ADA_ASSERT_TRUE(validate());
 8205|    267|}
_ZN3ada14url_aggregator20update_base_hostnameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8070|  1.55k|inline void url_aggregator::update_base_hostname(const std::string_view input) {
 8071|  1.55k|  ada_log("url_aggregator::update_base_hostname ", input, " [", input.size(),
 8072|  1.55k|          " bytes], buffer is '", buffer, "' [", buffer.size(), " bytes]");
 8073|  1.55k|  ADA_ASSERT_TRUE(validate());
 8074|  1.55k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8075|       |
 8076|       |  // This next line is required for when parsing a URL like `foo://`
 8077|  1.55k|  add_authority_slashes_if_needed();
 8078|       |
 8079|  1.55k|  bool has_credentials = components.protocol_end + 2 < components.host_start;
 8080|  1.55k|  uint32_t new_difference =
 8081|  1.55k|      replace_and_resize(components.host_start, components.host_end, input);
 8082|       |
 8083|  1.55k|  if (has_credentials) {
  ------------------
  |  Branch (8083:7): [True: 109, False: 1.44k]
  ------------------
 8084|    109|    buffer.insert(components.host_start, "@");
 8085|    109|    new_difference++;
 8086|    109|  }
 8087|  1.55k|  components.host_end += new_difference;
 8088|  1.55k|  components.pathname_start += new_difference;
 8089|  1.55k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8089:7): [True: 0, False: 1.55k]
  ------------------
 8090|      0|    components.search_start += new_difference;
 8091|      0|  }
 8092|  1.55k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8092:7): [True: 0, False: 1.55k]
  ------------------
 8093|      0|    components.hash_start += new_difference;
 8094|      0|  }
 8095|  1.55k|  ADA_ASSERT_TRUE(validate());
 8096|  1.55k|}
_ZN3ada14url_aggregator10parse_portENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEb:
 8805|    306|url_aggregator::parse_port(std::string_view view, bool check_trailing_content) {
 8806|    306|  ada_log("url_aggregator::parse_port('", view, "') ", view.size());
 8807|    306|  if (!view.empty() && view[0] == '-') {
  ------------------
  |  Branch (8807:7): [True: 305, False: 1]
  |  Branch (8807:24): [True: 2, False: 303]
  ------------------
 8808|      2|    ada_log("parse_port: view[0] == '0' && view.size() > 1");
 8809|      2|    is_valid = false;
 8810|      2|    return 0;
 8811|      2|  }
 8812|    304|  uint16_t parsed_port{};
 8813|    304|  auto r = std::from_chars(view.data(), view.data() + view.size(), parsed_port);
 8814|    304|  if (r.ec == std::errc::result_out_of_range) {
  ------------------
  |  Branch (8814:7): [True: 19, False: 285]
  ------------------
 8815|     19|    ada_log("parse_port: r.ec == std::errc::result_out_of_range");
 8816|     19|    is_valid = false;
 8817|     19|    return 0;
 8818|     19|  }
 8819|    285|  ada_log("parse_port: ", parsed_port);
 8820|    285|  const size_t consumed = size_t(r.ptr - view.data());
 8821|    285|  ada_log("parse_port: consumed ", consumed);
 8822|    285|  if (check_trailing_content) {
  ------------------
  |  Branch (8822:7): [True: 285, False: 0]
  ------------------
 8823|    285|    is_valid &=
 8824|    285|        (consumed == view.size() || view[consumed] == '/' ||
  ------------------
  |  Branch (8824:10): [True: 17, False: 268]
  |  Branch (8824:37): [True: 35, False: 233]
  ------------------
 8825|    233|         view[consumed] == '?' || (is_special() && view[consumed] == '\\'));
  ------------------
  |  Branch (8825:10): [True: 5, False: 228]
  |  Branch (8825:36): [True: 228, False: 0]
  |  Branch (8825:52): [True: 12, False: 216]
  ------------------
 8826|    285|  }
 8827|    285|  ada_log("parse_port: is_valid = ", is_valid);
 8828|    285|  if (is_valid) {
  ------------------
  |  Branch (8828:7): [True: 69, False: 216]
  ------------------
 8829|     69|    ada_log("parse_port", r.ec == std::errc());
 8830|       |    // scheme_default_port can return 0, and we should allow 0 as a base port.
 8831|     69|    auto default_port = scheme_default_port();
 8832|     69|    bool is_port_valid = (default_port == 0 && parsed_port == 0) ||
  ------------------
  |  Branch (8832:27): [True: 0, False: 69]
  |  Branch (8832:48): [True: 0, False: 0]
  ------------------
 8833|     69|                         (default_port != parsed_port);
  ------------------
  |  Branch (8833:26): [True: 68, False: 1]
  ------------------
 8834|     69|    if (r.ec == std::errc() && is_port_valid) {
  ------------------
  |  Branch (8834:9): [True: 54, False: 15]
  |  Branch (8834:32): [True: 53, False: 1]
  ------------------
 8835|     53|      update_base_port(parsed_port);
 8836|     53|    } else {
 8837|     16|      clear_port();
 8838|     16|    }
 8839|     69|  }
 8840|    285|  return consumed;
 8841|    304|}
_ZN3ada7unicode20percent_encode_indexENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKh:
 7928|  2.93k|                                              const uint8_t character_set[]) {
 7929|  2.93k|  const char* data = input.data();
 7930|  2.93k|  const size_t size = input.size();
 7931|       |
 7932|       |  // Process 8 bytes at a time using unrolled loop
 7933|  2.93k|  size_t i = 0;
 7934|  3.78k|  for (; i + 8 <= size; i += 8) {
  ------------------
  |  Branch (7934:10): [True: 1.28k, False: 2.49k]
  ------------------
 7935|  1.28k|    unsigned char chunk[8];
 7936|  1.28k|    std::memcpy(&chunk, data + i,
 7937|  1.28k|                8);  // entices compiler to unconditionally process 8 characters
 7938|       |
 7939|       |    // Check 8 characters at once
 7940|  8.78k|    for (size_t j = 0; j < 8; j++) {
  ------------------
  |  Branch (7940:24): [True: 7.94k, False: 848]
  ------------------
 7941|  7.94k|      if (character_sets::bit_at(character_set, chunk[j])) {
  ------------------
  |  Branch (7941:11): [True: 435, False: 7.50k]
  ------------------
 7942|    435|        return i + j;
 7943|    435|      }
 7944|  7.94k|    }
 7945|  1.28k|  }
 7946|       |
 7947|       |  // Handle remaining bytes
 7948|  5.72k|  for (; i < size; i++) {
  ------------------
  |  Branch (7948:10): [True: 3.88k, False: 1.84k]
  ------------------
 7949|  3.88k|    if (character_sets::bit_at(character_set, data[i])) {
  ------------------
  |  Branch (7949:9): [True: 653, False: 3.23k]
  ------------------
 7950|    653|      return i;
 7951|    653|    }
 7952|  3.88k|  }
 7953|       |
 7954|  1.84k|  return size;
 7955|  2.49k|}
_ZN3ada14url_aggregator10clear_portEv:
 8517|     16|inline void url_aggregator::clear_port() {
 8518|     16|  ada_log("url_aggregator::clear_port");
 8519|     16|  ADA_ASSERT_TRUE(validate());
 8520|     16|  if (components.port == url_components::omitted) {
  ------------------
  |  Branch (8520:7): [True: 16, False: 0]
  ------------------
 8521|     16|    return;
 8522|     16|  }
 8523|      0|  uint32_t length = components.pathname_start - components.host_end;
 8524|      0|  buffer.erase(components.host_end, length);
 8525|      0|  components.pathname_start -= length;
 8526|      0|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8526:7): [True: 0, False: 0]
  ------------------
 8527|      0|    components.search_start -= length;
 8528|      0|  }
 8529|      0|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8529:7): [True: 0, False: 0]
  ------------------
 8530|      0|    components.hash_start -= length;
 8531|      0|  }
 8532|      0|  components.port = url_components::omitted;
 8533|      0|  ADA_ASSERT_TRUE(validate());
 8534|      0|}
_ZNK3ada14url_aggregator13has_authorityEv:
 8682|  3.45k|    const noexcept {
 8683|  3.45k|  ada_log("url_aggregator::has_authority");
 8684|       |  // Performance: instead of doing this potentially expensive check, we could
 8685|       |  // have a boolean in the struct.
 8686|  3.45k|  return components.protocol_end + 2 <= components.host_start &&
  ------------------
  |  Branch (8686:10): [True: 2.12k, False: 1.33k]
  ------------------
 8687|  2.12k|         buffer[components.protocol_end] == '/' &&
  ------------------
  |  Branch (8687:10): [True: 2.12k, False: 0]
  ------------------
 8688|  2.12k|         buffer[components.protocol_end + 1] == '/';
  ------------------
  |  Branch (8688:10): [True: 2.12k, False: 0]
  ------------------
 8689|  3.45k|}
_ZNK3ada14url_aggregator12has_dash_dotEv:
 8762|    247|[[nodiscard]] constexpr bool url_aggregator::has_dash_dot() const noexcept {
 8763|       |  // If url's host is null, url does not have an opaque path, url's path's size
 8764|       |  // is greater than 1, and url's path[0] is the empty string, then append
 8765|       |  // U+002F (/) followed by U+002E (.) to output.
 8766|    247|  ada_log("url_aggregator::has_dash_dot");
 8767|       |#if ADA_DEVELOPMENT_CHECKS
 8768|       |  // If pathname_start and host_end are exactly two characters apart, then we
 8769|       |  // either have a one-digit port such as http://test.com:5?param=1 or else we
 8770|       |  // have a /.: sequence such as "non-spec:/.//". We test that this is the case.
 8771|       |  if (components.pathname_start == components.host_end + 2) {
 8772|       |    ADA_ASSERT_TRUE((buffer[components.host_end] == '/' &&
 8773|       |                     buffer[components.host_end + 1] == '.') ||
 8774|       |                    (buffer[components.host_end] == ':' &&
 8775|       |                     checkers::is_digit(buffer[components.host_end + 1])));
 8776|       |  }
 8777|       |  if (components.pathname_start == components.host_end + 2 &&
 8778|       |      buffer[components.host_end] == '/' &&
 8779|       |      buffer[components.host_end + 1] == '.') {
 8780|       |    ADA_ASSERT_TRUE(components.pathname_start + 1 < buffer.size());
 8781|       |    ADA_ASSERT_TRUE(buffer[components.pathname_start] == '/');
 8782|       |    ADA_ASSERT_TRUE(buffer[components.pathname_start + 1] == '/');
 8783|       |  }
 8784|       |#endif
 8785|       |  // Performance: it should be uncommon for components.pathname_start ==
 8786|       |  // components.host_end + 2 to be true. So we put this check first in the
 8787|       |  // sequence. Most times, we do not have an opaque path. Checking for '/.' is
 8788|       |  // more expensive, but should be uncommon.
 8789|    247|  return components.pathname_start == components.host_end + 2 &&
  ------------------
  |  Branch (8789:10): [True: 4, False: 243]
  ------------------
 8790|      4|         !has_opaque_path && buffer[components.host_end] == '/' &&
  ------------------
  |  Branch (8790:10): [True: 4, False: 0]
  |  Branch (8790:30): [True: 0, False: 4]
  ------------------
 8791|      0|         buffer[components.host_end + 1] == '.';
  ------------------
  |  Branch (8791:10): [True: 0, False: 0]
  ------------------
 8792|    247|}
_ZNK2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEcvbEv:
 3896|  5.20k|  constexpr explicit operator bool() const noexcept { return this->m_has_val; }
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEptEv:
 3865|    925|  TL_EXPECTED_11_CONSTEXPR T* operator->() {
 3866|    925|    TL_ASSERT(has_value());
  ------------------
  |  | 1918|    925|#define TL_ASSERT(x) assert(x)
  ------------------
  |  Branch (3866:5): [True: 925, False: 0]
  ------------------
 3867|    925|    return valptr();
 3868|    925|  }
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEE6valptrEv:
 3161|    925|  T* valptr() { return std::addressof(this->m_val); }
_ZNK2tl8expectedIN3ada14url_aggregatorENS1_6errorsEE9has_valueEv:
 3895|    925|  constexpr bool has_value() const noexcept { return this->m_has_val; }
_ZN2tl6detail21expected_storage_baseIN3ada14url_aggregatorENS2_6errorsELb0ELb1EED2Ev:
 2493|  5.20k|  ~expected_storage_base() {
 2494|  5.20k|    if (m_has_val) {
  ------------------
  |  Branch (2494:9): [True: 799, False: 4.40k]
  ------------------
 2495|    799|      m_val.~T();
 2496|    799|    }
 2497|  5.20k|  }
_ZN3ada7helpers9substringENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEmm:
 1712|  3.05k|                                                       size_t pos2) {
 1713|       |#if ADA_DEVELOPMENT_CHECKS
 1714|       |  if (pos2 < pos1) {
 1715|       |    std::cerr << "Negative-length substring: [" << pos1 << " to " << pos2 << ")"
 1716|       |              << std::endl;
 1717|       |    abort();
 1718|       |  }
 1719|       |#endif
 1720|  3.05k|  return input.substr(pos1, pos2 - pos1);
 1721|  3.05k|}
_ZNK3ada14url_aggregator10is_at_pathEv:
 8111|    405|    const noexcept {
 8112|    405|  return buffer.size() == components.pathname_start;
 8113|    405|}
_ZNK3ada14url_aggregator12has_passwordEv:
 8731|    557|constexpr bool url_aggregator::has_password() const noexcept {
 8732|    557|  ada_log("url_aggregator::has_password");
 8733|       |  // This function does not care about the length of the password
 8734|    557|  return components.host_start > components.username_end &&
  ------------------
  |  Branch (8734:10): [True: 479, False: 78]
  ------------------
 8735|    479|         buffer[components.username_end] == ':';
  ------------------
  |  Branch (8735:10): [True: 479, False: 0]
  ------------------
 8736|    557|}
_ZN3ada8checkers19try_parse_ipv4_fastENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1226|  5.16k|    std::string_view input) noexcept {
 1227|  5.16k|  const char* p = input.data();
 1228|  5.16k|  const char* const pend = p + input.size();
 1229|       |
 1230|  5.16k|  uint32_t ipv4 = 0;
 1231|       |
 1232|  6.37k|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (1232:19): [True: 6.13k, False: 240]
  ------------------
 1233|  6.13k|    if (p == pend) {
  ------------------
  |  Branch (1233:9): [True: 752, False: 5.38k]
  ------------------
 1234|    752|      return ipv4_fast_fail;
 1235|    752|    }
 1236|       |
 1237|  5.38k|    uint32_t val;
 1238|  5.38k|    char c = *p;
 1239|  5.38k|    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (1239:9): [True: 3.61k, False: 1.76k]
  |  Branch (1239:21): [True: 2.22k, False: 1.39k]
  ------------------
 1240|  2.22k|      val = c - '0';
 1241|  2.22k|      p++;
 1242|  3.16k|    } else {
 1243|  3.16k|      return ipv4_fast_fail;
 1244|  3.16k|    }
 1245|       |
 1246|  2.22k|    if (p < pend) {
  ------------------
  |  Branch (1246:9): [True: 2.08k, False: 137]
  ------------------
 1247|  2.08k|      c = *p;
 1248|  2.08k|      if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (1248:11): [True: 1.49k, False: 593]
  |  Branch (1248:23): [True: 1.16k, False: 330]
  ------------------
 1249|  1.16k|        if (val == 0) return ipv4_fast_fail;
  ------------------
  |  Branch (1249:13): [True: 113, False: 1.04k]
  ------------------
 1250|  1.04k|        val = val * 10 + (c - '0');
 1251|  1.04k|        p++;
 1252|  1.04k|        if (p < pend) {
  ------------------
  |  Branch (1252:13): [True: 965, False: 83]
  ------------------
 1253|    965|          c = *p;
 1254|    965|          if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (1254:15): [True: 716, False: 249]
  |  Branch (1254:27): [True: 655, False: 61]
  ------------------
 1255|    655|            val = val * 10 + (c - '0');
 1256|    655|            p++;
 1257|    655|            if (val > 255) return ipv4_fast_fail;
  ------------------
  |  Branch (1257:17): [True: 200, False: 455]
  ------------------
 1258|    655|          }
 1259|    965|        }
 1260|  1.04k|      }
 1261|  2.08k|    }
 1262|       |
 1263|  1.90k|    ipv4 = (ipv4 << 8) | val;
 1264|       |
 1265|  1.90k|    if (i < 3) {
  ------------------
  |  Branch (1265:9): [True: 1.66k, False: 240]
  ------------------
 1266|  1.66k|      if (p == pend || *p != '.') {
  ------------------
  |  Branch (1266:11): [True: 92, False: 1.57k]
  |  Branch (1266:24): [True: 603, False: 973]
  ------------------
 1267|    695|        return ipv4_fast_fail;
 1268|    695|      }
 1269|    973|      p++;
 1270|    973|    }
 1271|  1.90k|  }
 1272|       |
 1273|    240|  if (p != pend) {
  ------------------
  |  Branch (1273:7): [True: 33, False: 207]
  ------------------
 1274|     33|    if (p == pend - 1 && *p == '.') {
  ------------------
  |  Branch (1274:9): [True: 13, False: 20]
  |  Branch (1274:26): [True: 7, False: 6]
  ------------------
 1275|      7|      return ipv4;
 1276|      7|    }
 1277|     26|    return ipv4_fast_fail;
 1278|     33|  }
 1279|       |
 1280|    207|  return ipv4;
 1281|    240|}
_ZNK3ada14url_aggregator8validateEv:
 8873|    799|[[nodiscard]] constexpr bool url_aggregator::validate() const noexcept {
 8874|    799|  if (!is_valid) {
  ------------------
  |  Branch (8874:7): [True: 0, False: 799]
  ------------------
 8875|      0|    return true;
 8876|      0|  }
 8877|    799|  if (!components.check_offset_consistency()) {
  ------------------
  |  Branch (8877:7): [True: 0, False: 799]
  ------------------
 8878|      0|    ada_log("url_aggregator::validate inconsistent components \n",
 8879|      0|            to_diagram());
 8880|      0|    return false;
 8881|      0|  }
 8882|       |  // We have a credible components struct, but let us investivate more
 8883|       |  // carefully:
 8884|       |  /**
 8885|       |   * https://user:pass@example.com:1234/foo/bar?baz#quux
 8886|       |   *       |     |    |          | ^^^^|       |   |
 8887|       |   *       |     |    |          | |   |       |   `----- hash_start
 8888|       |   *       |     |    |          | |   |       `--------- search_start
 8889|       |   *       |     |    |          | |   `----------------- pathname_start
 8890|       |   *       |     |    |          | `--------------------- port
 8891|       |   *       |     |    |          `----------------------- host_end
 8892|       |   *       |     |    `---------------------------------- host_start
 8893|       |   *       |     `--------------------------------------- username_end
 8894|       |   *       `--------------------------------------------- protocol_end
 8895|       |   */
 8896|    799|  if (components.protocol_end == url_components::omitted) {
  ------------------
  |  Branch (8896:7): [True: 0, False: 799]
  ------------------
 8897|      0|    ada_log("url_aggregator::validate omitted protocol_end \n", to_diagram());
 8898|      0|    return false;
 8899|      0|  }
 8900|    799|  if (components.username_end == url_components::omitted) {
  ------------------
  |  Branch (8900:7): [True: 0, False: 799]
  ------------------
 8901|      0|    ada_log("url_aggregator::validate omitted username_end \n", to_diagram());
 8902|      0|    return false;
 8903|      0|  }
 8904|    799|  if (components.host_start == url_components::omitted) {
  ------------------
  |  Branch (8904:7): [True: 0, False: 799]
  ------------------
 8905|      0|    ada_log("url_aggregator::validate omitted host_start \n", to_diagram());
 8906|      0|    return false;
 8907|      0|  }
 8908|    799|  if (components.host_end == url_components::omitted) {
  ------------------
  |  Branch (8908:7): [True: 0, False: 799]
  ------------------
 8909|      0|    ada_log("url_aggregator::validate omitted host_end \n", to_diagram());
 8910|      0|    return false;
 8911|      0|  }
 8912|    799|  if (components.pathname_start == url_components::omitted) {
  ------------------
  |  Branch (8912:7): [True: 0, False: 799]
  ------------------
 8913|      0|    ada_log("url_aggregator::validate omitted pathname_start \n", to_diagram());
 8914|      0|    return false;
 8915|      0|  }
 8916|       |
 8917|    799|  if (components.protocol_end > buffer.size()) {
  ------------------
  |  Branch (8917:7): [True: 0, False: 799]
  ------------------
 8918|      0|    ada_log("url_aggregator::validate protocol_end overflow \n", to_diagram());
 8919|      0|    return false;
 8920|      0|  }
 8921|    799|  if (components.username_end > buffer.size()) {
  ------------------
  |  Branch (8921:7): [True: 0, False: 799]
  ------------------
 8922|      0|    ada_log("url_aggregator::validate username_end overflow \n", to_diagram());
 8923|      0|    return false;
 8924|      0|  }
 8925|    799|  if (components.host_start > buffer.size()) {
  ------------------
  |  Branch (8925:7): [True: 0, False: 799]
  ------------------
 8926|      0|    ada_log("url_aggregator::validate host_start overflow \n", to_diagram());
 8927|      0|    return false;
 8928|      0|  }
 8929|    799|  if (components.host_end > buffer.size()) {
  ------------------
  |  Branch (8929:7): [True: 0, False: 799]
  ------------------
 8930|      0|    ada_log("url_aggregator::validate host_end overflow \n", to_diagram());
 8931|      0|    return false;
 8932|      0|  }
 8933|    799|  if (components.pathname_start > buffer.size()) {
  ------------------
  |  Branch (8933:7): [True: 0, False: 799]
  ------------------
 8934|      0|    ada_log("url_aggregator::validate pathname_start overflow \n",
 8935|      0|            to_diagram());
 8936|      0|    return false;
 8937|      0|  }
 8938|       |
 8939|    799|  if (components.protocol_end > 0) {
  ------------------
  |  Branch (8939:7): [True: 799, False: 0]
  ------------------
 8940|    799|    if (buffer[components.protocol_end - 1] != ':') {
  ------------------
  |  Branch (8940:9): [True: 0, False: 799]
  ------------------
 8941|      0|      ada_log(
 8942|      0|          "url_aggregator::validate missing : at the end of the protocol \n",
 8943|      0|          to_diagram());
 8944|      0|      return false;
 8945|      0|    }
 8946|    799|  }
 8947|       |
 8948|    799|  if (components.username_end != buffer.size() &&
  ------------------
  |  Branch (8948:7): [True: 799, False: 0]
  ------------------
 8949|    799|      components.username_end > components.protocol_end + 2) {
  ------------------
  |  Branch (8949:7): [True: 39, False: 760]
  ------------------
 8950|     39|    if (buffer[components.username_end] != ':' &&
  ------------------
  |  Branch (8950:9): [True: 17, False: 22]
  ------------------
 8951|     17|        buffer[components.username_end] != '@') {
  ------------------
  |  Branch (8951:9): [True: 0, False: 17]
  ------------------
 8952|      0|      ada_log(
 8953|      0|          "url_aggregator::validate missing : or @ at the end of the username "
 8954|      0|          "\n",
 8955|      0|          to_diagram());
 8956|      0|      return false;
 8957|      0|    }
 8958|     39|  }
 8959|       |
 8960|    799|  if (components.host_start != buffer.size()) {
  ------------------
  |  Branch (8960:7): [True: 799, False: 0]
  ------------------
 8961|    799|    if (components.host_start > components.username_end) {
  ------------------
  |  Branch (8961:9): [True: 31, False: 768]
  ------------------
 8962|     31|      if (buffer[components.host_start] != '@') {
  ------------------
  |  Branch (8962:11): [True: 0, False: 31]
  ------------------
 8963|      0|        ada_log(
 8964|      0|            "url_aggregator::validate missing @ at the end of the password \n",
 8965|      0|            to_diagram());
 8966|      0|        return false;
 8967|      0|      }
 8968|    768|    } else if (components.host_start == components.username_end &&
  ------------------
  |  Branch (8968:16): [True: 768, False: 0]
  ------------------
 8969|    768|               components.host_end > components.host_start) {
  ------------------
  |  Branch (8969:16): [True: 768, False: 0]
  ------------------
 8970|    768|      if (components.host_start == components.protocol_end + 2) {
  ------------------
  |  Branch (8970:11): [True: 751, False: 17]
  ------------------
 8971|    751|        if (buffer[components.protocol_end] != '/' ||
  ------------------
  |  Branch (8971:13): [True: 0, False: 751]
  ------------------
 8972|    751|            buffer[components.protocol_end + 1] != '/') {
  ------------------
  |  Branch (8972:13): [True: 0, False: 751]
  ------------------
 8973|      0|          ada_log(
 8974|      0|              "url_aggregator::validate missing // between protocol and host "
 8975|      0|              "\n",
 8976|      0|              to_diagram());
 8977|      0|          return false;
 8978|      0|        }
 8979|    751|      } else {
 8980|     17|        if (components.host_start > components.protocol_end &&
  ------------------
  |  Branch (8980:13): [True: 17, False: 0]
  ------------------
 8981|     17|            buffer[components.host_start] != '@') {
  ------------------
  |  Branch (8981:13): [True: 0, False: 17]
  ------------------
 8982|      0|          ada_log(
 8983|      0|              "url_aggregator::validate missing @ at the end of the username "
 8984|      0|              "\n",
 8985|      0|              to_diagram());
 8986|      0|          return false;
 8987|      0|        }
 8988|     17|      }
 8989|    768|    } else {
 8990|      0|      if (components.host_end != components.host_start) {
  ------------------
  |  Branch (8990:11): [True: 0, False: 0]
  ------------------
 8991|      0|        ada_log("url_aggregator::validate expected omitted host \n",
 8992|      0|                to_diagram());
 8993|      0|        return false;
 8994|      0|      }
 8995|      0|    }
 8996|    799|  }
 8997|    799|  if (components.host_end != buffer.size() &&
  ------------------
  |  Branch (8997:7): [True: 799, False: 0]
  ------------------
 8998|    799|      components.pathname_start > components.host_end) {
  ------------------
  |  Branch (8998:7): [True: 53, False: 746]
  ------------------
 8999|     53|    if (components.pathname_start == components.host_end + 2 &&
  ------------------
  |  Branch (8999:9): [True: 9, False: 44]
  ------------------
 9000|      9|        buffer[components.host_end] == '/' &&
  ------------------
  |  Branch (9000:9): [True: 0, False: 9]
  ------------------
 9001|      0|        buffer[components.host_end + 1] == '.') {
  ------------------
  |  Branch (9001:9): [True: 0, False: 0]
  ------------------
 9002|      0|      if (components.pathname_start + 1 >= buffer.size() ||
  ------------------
  |  Branch (9002:11): [True: 0, False: 0]
  ------------------
 9003|      0|          buffer[components.pathname_start] != '/' ||
  ------------------
  |  Branch (9003:11): [True: 0, False: 0]
  ------------------
 9004|      0|          buffer[components.pathname_start + 1] != '/') {
  ------------------
  |  Branch (9004:11): [True: 0, False: 0]
  ------------------
 9005|      0|        ada_log(
 9006|      0|            "url_aggregator::validate expected the path to begin with // \n",
 9007|      0|            to_diagram());
 9008|      0|        return false;
 9009|      0|      }
 9010|     53|    } else if (buffer[components.host_end] != ':') {
  ------------------
  |  Branch (9010:16): [True: 0, False: 53]
  ------------------
 9011|      0|      ada_log("url_aggregator::validate missing : at the port \n",
 9012|      0|              to_diagram());
 9013|      0|      return false;
 9014|      0|    }
 9015|     53|  }
 9016|    799|  if (components.pathname_start != buffer.size() &&
  ------------------
  |  Branch (9016:7): [True: 799, False: 0]
  ------------------
 9017|    799|      components.pathname_start < components.search_start &&
  ------------------
  |  Branch (9017:7): [True: 799, False: 0]
  ------------------
 9018|    799|      components.pathname_start < components.hash_start && !has_opaque_path) {
  ------------------
  |  Branch (9018:7): [True: 799, False: 0]
  |  Branch (9018:60): [True: 799, False: 0]
  ------------------
 9019|    799|    if (buffer[components.pathname_start] != '/') {
  ------------------
  |  Branch (9019:9): [True: 0, False: 799]
  ------------------
 9020|      0|      ada_log("url_aggregator::validate missing / at the path \n",
 9021|      0|              to_diagram());
 9022|      0|      return false;
 9023|      0|    }
 9024|    799|  }
 9025|    799|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (9025:7): [True: 267, False: 532]
  ------------------
 9026|    267|    if (buffer[components.search_start] != '?') {
  ------------------
  |  Branch (9026:9): [True: 0, False: 267]
  ------------------
 9027|      0|      ada_log("url_aggregator::validate missing ? at the search \n",
 9028|      0|              to_diagram());
 9029|      0|      return false;
 9030|      0|    }
 9031|    267|  }
 9032|    799|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (9032:7): [True: 64, False: 735]
  ------------------
 9033|     64|    if (buffer[components.hash_start] != '#') {
  ------------------
  |  Branch (9033:9): [True: 0, False: 64]
  ------------------
 9034|      0|      ada_log("url_aggregator::validate missing # at the hash \n",
 9035|      0|              to_diagram());
 9036|      0|      return false;
 9037|      0|    }
 9038|     64|  }
 9039|       |
 9040|    799|  return true;
 9041|    799|}
_ZNK3ada14url_components24check_offset_consistencyEv:
 7390|    799|    const noexcept {
 7391|       |  /**
 7392|       |   * https://user:pass@example.com:1234/foo/bar?baz#quux
 7393|       |   *       |     |    |          | ^^^^|       |   |
 7394|       |   *       |     |    |          | |   |       |   `----- hash_start
 7395|       |   *       |     |    |          | |   |       `--------- search_start
 7396|       |   *       |     |    |          | |   `----------------- pathname_start
 7397|       |   *       |     |    |          | `--------------------- port
 7398|       |   *       |     |    |          `----------------------- host_end
 7399|       |   *       |     |    `---------------------------------- host_start
 7400|       |   *       |     `--------------------------------------- username_end
 7401|       |   *       `--------------------------------------------- protocol_end
 7402|       |   */
 7403|       |  // These conditions can be made more strict.
 7404|    799|  if (protocol_end == url_components::omitted) {
  ------------------
  |  Branch (7404:7): [True: 0, False: 799]
  ------------------
 7405|      0|    return false;
 7406|      0|  }
 7407|    799|  uint32_t index = protocol_end;
 7408|       |
 7409|    799|  if (username_end == url_components::omitted) {
  ------------------
  |  Branch (7409:7): [True: 0, False: 799]
  ------------------
 7410|      0|    return false;
 7411|      0|  }
 7412|    799|  if (username_end < index) {
  ------------------
  |  Branch (7412:7): [True: 0, False: 799]
  ------------------
 7413|      0|    return false;
 7414|      0|  }
 7415|    799|  index = username_end;
 7416|       |
 7417|    799|  if (host_start == url_components::omitted) {
  ------------------
  |  Branch (7417:7): [True: 0, False: 799]
  ------------------
 7418|      0|    return false;
 7419|      0|  }
 7420|    799|  if (host_start < index) {
  ------------------
  |  Branch (7420:7): [True: 0, False: 799]
  ------------------
 7421|      0|    return false;
 7422|      0|  }
 7423|    799|  index = host_start;
 7424|       |
 7425|    799|  if (port != url_components::omitted) {
  ------------------
  |  Branch (7425:7): [True: 53, False: 746]
  ------------------
 7426|     53|    if (port > 0xffff) {
  ------------------
  |  Branch (7426:9): [True: 0, False: 53]
  ------------------
 7427|      0|      return false;
 7428|      0|    }
 7429|     53|    uint32_t port_length = helpers::fast_digit_count(port) + 1;
 7430|     53|    if (index + port_length < index) {
  ------------------
  |  Branch (7430:9): [True: 0, False: 53]
  ------------------
 7431|      0|      return false;
 7432|      0|    }
 7433|     53|    index += port_length;
 7434|     53|  }
 7435|       |
 7436|    799|  if (pathname_start == url_components::omitted) {
  ------------------
  |  Branch (7436:7): [True: 0, False: 799]
  ------------------
 7437|      0|    return false;
 7438|      0|  }
 7439|    799|  if (pathname_start < index) {
  ------------------
  |  Branch (7439:7): [True: 0, False: 799]
  ------------------
 7440|      0|    return false;
 7441|      0|  }
 7442|    799|  index = pathname_start;
 7443|       |
 7444|    799|  if (search_start != url_components::omitted) {
  ------------------
  |  Branch (7444:7): [True: 267, False: 532]
  ------------------
 7445|    267|    if (search_start < index) {
  ------------------
  |  Branch (7445:9): [True: 0, False: 267]
  ------------------
 7446|      0|      return false;
 7447|      0|    }
 7448|    267|    index = search_start;
 7449|    267|  }
 7450|       |
 7451|    799|  if (hash_start != url_components::omitted) {
  ------------------
  |  Branch (7451:7): [True: 64, False: 735]
  ------------------
 7452|     64|    if (hash_start < index) {
  ------------------
  |  Branch (7452:9): [True: 0, False: 64]
  ------------------
 7453|      0|      return false;
 7454|      0|    }
 7455|     64|  }
 7456|       |
 7457|    799|  return true;
 7458|    799|}
_ZN3ada7helpers16fast_digit_countEj:
 1816|     53|inline int fast_digit_count(uint32_t x) noexcept {
 1817|     53|  auto int_log2 = [](uint32_t z) -> int {
 1818|     53|    return 31 - ada::helpers::leading_zeroes(z | 1);
 1819|     53|  };
 1820|       |  // Compiles to very few instructions. Note that the
 1821|       |  // table is static and thus effectively a constant.
 1822|       |  // We leave it inside the function because it is meaningless
 1823|       |  // outside of it (this comes at no performance cost).
 1824|     53|  const static uint64_t table[] = {
 1825|     53|      4294967296,  8589934582,  8589934582,  8589934582,  12884901788,
 1826|     53|      12884901788, 12884901788, 17179868184, 17179868184, 17179868184,
 1827|     53|      21474826480, 21474826480, 21474826480, 21474826480, 25769703776,
 1828|     53|      25769703776, 25769703776, 30063771072, 30063771072, 30063771072,
 1829|     53|      34349738368, 34349738368, 34349738368, 34349738368, 38554705664,
 1830|     53|      38554705664, 38554705664, 41949672960, 41949672960, 41949672960,
 1831|     53|      42949672960, 42949672960};
 1832|     53|  return int((x + table[int_log2(x)]) >> 32);
 1833|     53|}
_ZZN3ada7helpers16fast_digit_countEjENKUljE_clEj:
 1817|     53|  auto int_log2 = [](uint32_t z) -> int {
 1818|     53|    return 31 - ada::helpers::leading_zeroes(z | 1);
 1819|     53|  };

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

