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

_ZN3ada37url_pattern_compile_component_optionsC2ENSt3__18optionalIcEES3_:
 5559|      6|      : delimiter(new_delimiter), prefix(new_prefix) {}
_ZN3ada14character_sets6bit_atEPKhh:
 1031|   754k|ada_really_inline constexpr bool bit_at(const uint8_t a[], const uint8_t i) {
 1032|   754k|  return !!(a[i >> 3] & (1 << (i & 7)));
 1033|   754k|}
_ZN2tl10unexpectedIN3ada6errorsEEC2EOS2_:
 2011|  8.63k|  constexpr explicit unexpected(E&& e) : m_val(std::move(e)) {}
_ZNR2tl10unexpectedIN3ada6errorsEE5valueEv:
 2025|  4.31k|  TL_EXPECTED_11_CONSTEXPR E& value() & { return m_val; }
_ZN3ada8url_baseD2Ev:
 1515|  5.78k|  virtual ~url_base() = default;
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEC2IS3_TnPNSt3__19enable_ifIXsr3std16is_constructibleIS3_OT_EE5valueEvE4typeELPv0ETnPNS7_IXsr3std14is_convertibleIS9_S3_EE5valueEvE4typeELSD_0EEEONS_10unexpectedIS8_EE:
 3497|  4.31k|      : impl_base(unexpect, std::move(e.value())),
 3498|  4.31k|        ctor_base(detail::default_constructor_tag{}) {}
_ZN2tl6detail21expected_storage_baseIN3ada14url_aggregatorENS2_6errorsELb0ELb1EEC2IJS4_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS4_DpOT_EE5valueEvE4typeELPv0EEENS_10unexpect_tESB_:
 2483|  4.31k|      : m_unexpect(std::forward<Args>(args)...), m_has_val(false) {}
_ZN2tl6detail26expected_default_ctor_baseIN3ada14url_aggregatorENS2_6errorsELb1EEC2ENS0_23default_constructor_tagE:
 3101|  5.05k|  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|    735|      : expected(in_place, std::forward<U>(v)) {}
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEC2IJS2_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS2_DpOT_EE5valueEvE4typeELPv0EEENS_10in_place_tESA_:
 3456|    735|      : impl_base(in_place, std::forward<Args>(args)...),
 3457|    735|        ctor_base(detail::default_constructor_tag{}) {}
_ZN2tl6detail21expected_storage_baseIN3ada14url_aggregatorENS2_6errorsELb0ELb1EEC2IJS3_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS3_DpOT_EE5valueEvE4typeELPv0EEENS_10in_place_tESB_:
 2471|    735|      : m_val(std::forward<Args>(args)...), m_has_val(true) {}
_ZN3ada14url_aggregatorC2EOS0_:
 7504|    735|  url_aggregator(url_aggregator&& u) noexcept = default;
_ZN3ada14url_aggregatorD2Ev:
 7507|  5.78k|  ~url_aggregator() override = default;
_ZN3ada6scheme15get_scheme_typeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6585|  5.05k|constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept {
 6586|  5.05k|  if (scheme.empty()) {
  ------------------
  |  Branch (6586:7): [True: 0, False: 5.05k]
  ------------------
 6587|      0|    return ada::scheme::NOT_SPECIAL;
 6588|      0|  }
 6589|  5.05k|  int hash_value = (2 * scheme.size() + (unsigned)(scheme[0])) & 7;
 6590|  5.05k|  const std::string_view target = details::is_special_list[hash_value];
 6591|  5.05k|  if (scheme.size() == target.size() &&
  ------------------
  |  Branch (6591:7): [True: 5.05k, False: 0]
  ------------------
 6592|  5.05k|      details::branchless_load5(scheme.data(), scheme.size()) ==
  ------------------
  |  Branch (6592:7): [True: 5.05k, False: 0]
  ------------------
 6593|  5.05k|          details::scheme_keys[hash_value]) {
 6594|  5.05k|    return ada::scheme::type(hash_value);
 6595|  5.05k|  } else {
 6596|      0|    return ada::scheme::NOT_SPECIAL;
 6597|      0|  }
 6598|  5.05k|}
_ZN3ada6scheme7details16branchless_load5EPKcm:
 6526|  5.05k|inline uint64_t branchless_load5(const char* p, size_t n) {
 6527|  5.05k|  uint64_t input = (uint8_t)p[0];
 6528|  5.05k|  input |= ((uint64_t)(uint8_t)p[n > 1] << 8) & (0 - (uint64_t)(n > 1));
 6529|  5.05k|  input |= ((uint64_t)(uint8_t)p[(n > 2) * 2] << 16) & (0 - (uint64_t)(n > 2));
 6530|  5.05k|  input |= ((uint64_t)(uint8_t)p[(n > 3) * 3] << 24) & (0 - (uint64_t)(n > 3));
 6531|  5.05k|  input |= ((uint64_t)(uint8_t)p[(n > 4) * 4] << 32) & (0 - (uint64_t)(n > 4));
 6532|  5.05k|  return input;
 6533|  5.05k|}
_ZN3ada14url_aggregatorC2Ev:
 7502|  5.05k|  url_aggregator() = default;
_ZN3ada14url_componentsC2Ev:
 4757|  5.05k|  url_components() = default;
_ZN3ada8checkers14has_hex_prefixENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1201|    918|constexpr bool has_hex_prefix(std::string_view input) {
 1202|    918|  return input.size() >= 2 && has_hex_prefix_unsafe(input);
  ------------------
  |  Branch (1202:10): [True: 863, False: 55]
  |  Branch (1202:31): [True: 214, False: 649]
  ------------------
 1203|    918|}
_ZN3ada8checkers21has_hex_prefix_unsafeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1186|    863|constexpr bool has_hex_prefix_unsafe(std::string_view input) {
 1187|       |  // This is actually efficient code, see has_hex_prefix for the assembly.
 1188|    863|  constexpr bool is_little_endian = std::endian::native == std::endian::little;
 1189|    863|  constexpr uint16_t word0x = 0x7830;
 1190|    863|  uint16_t two_first_bytes =
 1191|    863|      static_cast<uint16_t>(input[0]) |
 1192|    863|      static_cast<uint16_t>((static_cast<uint16_t>(input[1]) << 8));
 1193|    863|  if constexpr (is_little_endian) {
 1194|    863|    two_first_bytes |= 0x2000;
 1195|       |  } else {
 1196|       |    two_first_bytes |= 0x020;
 1197|       |  }
 1198|    863|  return two_first_bytes == word0x;
 1199|    863|}
_ZN3ada8checkers8is_digitEc:
 1205|  13.9k|constexpr bool is_digit(char x) noexcept { return (x >= '0') & (x <= '9'); }
_ZNK3ada8url_base10is_specialEv:
 7058|  19.3k|    const noexcept {
 7059|  19.3k|  return type != ada::scheme::NOT_SPECIAL;
 7060|  19.3k|}
_ZN3ada8checkers8is_alphaEc:
 1209|  9.52k|constexpr bool is_alpha(char x) noexcept {
 1210|  9.52k|  return (to_lower(x) >= 'a') && (to_lower(x) <= 'z');
  ------------------
  |  Branch (1210:10): [True: 6.72k, False: 2.80k]
  |  Branch (1210:34): [True: 6.50k, False: 222]
  ------------------
 1211|  9.52k|}
_ZN3ada8checkers8to_lowerEc:
 1207|  16.2k|constexpr char to_lower(char x) noexcept { return (x | 0x20); }
_ZNK3ada8url_base19scheme_default_portEv:
 7067|     65|url_base::scheme_default_port() const noexcept {
 7068|     65|  return scheme::get_special_port(type);
 7069|     65|}
_ZN3ada6scheme16get_special_portENS0_4typeE:
 6582|     65|constexpr uint16_t get_special_port(ada::scheme::type type) noexcept {
 6583|     65|  return details::special_ports[int(type)];
 6584|     65|}
_ZN3ada8checkers23is_windows_drive_letterENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1213|  2.88k|constexpr bool is_windows_drive_letter(std::string_view input) noexcept {
 1214|  2.88k|  return input.size() >= 2 &&
  ------------------
  |  Branch (1214:10): [True: 2.23k, False: 642]
  ------------------
 1215|  2.23k|         (is_alpha(input[0]) && ((input[1] == ':') || (input[1] == '|'))) &&
  ------------------
  |  Branch (1215:11): [True: 726, False: 1.51k]
  |  Branch (1215:34): [True: 5, False: 721]
  |  Branch (1215:55): [True: 11, False: 710]
  ------------------
 1216|     16|         ((input.size() == 2) || (input[2] == '/' || input[2] == '\\' ||
  ------------------
  |  Branch (1216:11): [True: 1, False: 15]
  |  Branch (1216:35): [True: 1, False: 14]
  |  Branch (1216:54): [True: 1, False: 13]
  ------------------
 1217|     13|                                  input[2] == '?' || input[2] == '#'));
  ------------------
  |  Branch (1217:35): [True: 2, False: 11]
  |  Branch (1217:54): [True: 1, False: 10]
  ------------------
 1218|  2.88k|}
_ZN3ada8checkers34is_normalized_windows_drive_letterENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1221|  2.88k|    std::string_view input) noexcept {
 1222|  2.88k|  return input.size() >= 2 && (is_alpha(input[0]) && (input[1] == ':'));
  ------------------
  |  Branch (1222:10): [True: 2.23k, False: 642]
  |  Branch (1222:32): [True: 726, False: 1.51k]
  |  Branch (1222:54): [True: 5, False: 721]
  ------------------
 1223|  2.88k|}
_ZN3ada7helpers14leading_zeroesEj:
 1800|  5.09k|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.09k|  return __builtin_clz(input_num);
 1807|  5.09k|#endif  // ADA_REGULAR_VISUAL_STUDIO
 1808|  5.09k|}
_ZN3ada14url_aggregator7reserveEj:
 8712|  5.05k|constexpr void ada::url_aggregator::reserve(uint32_t capacity) {
 8713|  5.05k|  buffer.reserve(capacity);
 8714|  5.05k|}
_ZN3ada14url_aggregator20update_base_pathnameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8202|    365|inline void url_aggregator::update_base_pathname(const std::string_view input) {
 8203|    365|  ada_log("url_aggregator::update_base_pathname '", input, "' [", input.size(),
 8204|    365|          " bytes] \n", to_diagram());
 8205|    365|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8206|    365|  ADA_ASSERT_TRUE(validate());
 8207|       |
 8208|    365|  const bool begins_with_dashdash = input.starts_with("//");
 8209|    365|  if (!begins_with_dashdash && has_dash_dot()) {
  ------------------
  |  Branch (8209:7): [True: 210, False: 155]
  |  Branch (8209:32): [True: 0, False: 210]
  ------------------
 8210|       |    // We must delete the ./
 8211|      0|    delete_dash_dot();
 8212|      0|  }
 8213|       |
 8214|    365|  if (begins_with_dashdash && !has_opaque_path && !has_authority() &&
  ------------------
  |  Branch (8214:7): [True: 155, False: 210]
  |  Branch (8214:31): [True: 155, False: 0]
  |  Branch (8214:51): [True: 0, False: 155]
  ------------------
 8215|      0|      !has_dash_dot()) {
  ------------------
  |  Branch (8215:7): [True: 0, False: 0]
  ------------------
 8216|       |    // If url's host is null, url does not have an opaque path, url's path's
 8217|       |    // size is greater than 1, then append U+002F (/) followed by U+002E (.) to
 8218|       |    // output.
 8219|      0|    buffer.insert(components.pathname_start, "/.");
 8220|      0|    components.pathname_start += 2;
 8221|      0|    if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8221:9): [True: 0, False: 0]
  ------------------
 8222|      0|      components.search_start += 2;
 8223|      0|    }
 8224|      0|    if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8224:9): [True: 0, False: 0]
  ------------------
 8225|      0|      components.hash_start += 2;
 8226|      0|    }
 8227|      0|  }
 8228|       |
 8229|    365|  uint32_t difference = replace_and_resize(
 8230|    365|      components.pathname_start,
 8231|    365|      components.pathname_start + get_pathname_length(), input);
 8232|    365|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8232:7): [True: 0, False: 365]
  ------------------
 8233|      0|    components.search_start += difference;
 8234|      0|  }
 8235|    365|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8235:7): [True: 0, False: 365]
  ------------------
 8236|      0|    components.hash_start += difference;
 8237|      0|  }
 8238|    365|  ADA_ASSERT_TRUE(validate());
 8239|    365|}
_ZN3ada14url_aggregator18replace_and_resizeEjjNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8045|  1.79k|    uint32_t start, uint32_t end, std::string_view input) {
 8046|  1.79k|  uint32_t current_length = end - start;
 8047|  1.79k|  uint32_t input_size = uint32_t(input.size());
 8048|  1.79k|  uint32_t new_difference = input_size - current_length;
 8049|       |
 8050|  1.79k|  if (current_length == 0) {
  ------------------
  |  Branch (8050:7): [True: 1.48k, False: 312]
  ------------------
 8051|  1.48k|    buffer.insert(start, input);
 8052|  1.48k|  } else if (input_size == current_length) {
  ------------------
  |  Branch (8052:14): [True: 12, False: 300]
  ------------------
 8053|     12|    buffer.replace(start, input_size, input);
 8054|    300|  } else if (input_size < current_length) {
  ------------------
  |  Branch (8054:14): [True: 37, False: 263]
  ------------------
 8055|     37|    buffer.erase(start, current_length - input_size);
 8056|     37|    buffer.replace(start, input_size, input);
 8057|    263|  } else {
 8058|    263|    buffer.replace(start, current_length, input.substr(0, current_length));
 8059|    263|    buffer.insert(start + current_length, input.substr(current_length));
 8060|    263|  }
 8061|       |
 8062|  1.79k|  return new_difference;
 8063|  1.79k|}
_ZNK3ada14url_aggregator19get_pathname_lengthEv:
 8094|    365|url_aggregator::get_pathname_length() const noexcept {
 8095|    365|  ada_log("url_aggregator::get_pathname_length");
 8096|    365|  uint32_t ending_index = uint32_t(buffer.size());
 8097|    365|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8097:7): [True: 0, False: 365]
  ------------------
 8098|      0|    ending_index = components.search_start;
 8099|    365|  } else if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8099:14): [True: 0, False: 365]
  ------------------
 8100|      0|    ending_index = components.hash_start;
 8101|      0|  }
 8102|    365|  return ending_index - components.pathname_start;
 8103|    365|}
_ZNK3ada14url_aggregator12get_pathnameEv:
 9039|    330|    ada_lifetime_bound {
 9040|    330|  ada_log("url_aggregator::get_pathname pathname_start = ",
 9041|    330|          components.pathname_start, " buffer.size() = ", buffer.size(),
 9042|    330|          " components.search_start = ", components.search_start,
 9043|    330|          " components.hash_start = ", components.hash_start);
 9044|    330|  auto ending_index = uint32_t(buffer.size());
 9045|    330|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (9045:7): [True: 0, False: 330]
  ------------------
 9046|      0|    ending_index = components.search_start;
 9047|    330|  } else if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (9047:14): [True: 0, False: 330]
  ------------------
 9048|      0|    ending_index = components.hash_start;
 9049|      0|  }
 9050|    330|  return helpers::substring(buffer, components.pathname_start, ending_index);
 9051|    330|}
_ZN3ada14url_aggregator26update_unencoded_base_hashENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8021|     53|inline void url_aggregator::update_unencoded_base_hash(std::string_view input) {
 8022|     53|  ada_log("url_aggregator::update_unencoded_base_hash ", input, " [",
 8023|     53|          input.size(), " bytes], buffer is '", buffer, "' [", buffer.size(),
 8024|     53|          " bytes] components.hash_start = ", components.hash_start);
 8025|     53|  ADA_ASSERT_TRUE(validate());
 8026|     53|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8027|     53|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8027:7): [True: 0, False: 53]
  ------------------
 8028|      0|    buffer.resize(components.hash_start);
 8029|      0|  }
 8030|     53|  components.hash_start = uint32_t(buffer.size());
 8031|     53|  buffer += "#";
 8032|     53|  bool encoding_required = unicode::percent_encode<true>(
 8033|     53|      input, ada::character_sets::FRAGMENT_PERCENT_ENCODE, buffer);
 8034|       |  // When encoding_required is false, then buffer is left unchanged, and percent
 8035|       |  // encoding was not deemed required.
 8036|     53|  if (!encoding_required) {
  ------------------
  |  Branch (8036:7): [True: 39, False: 14]
  ------------------
 8037|     39|    buffer.append(input);
 8038|     39|  }
 8039|     53|  ada_log("url_aggregator::update_unencoded_base_hash final buffer is '",
 8040|     53|          buffer, "' [", buffer.size(), " bytes]");
 8041|     53|  ADA_ASSERT_TRUE(validate());
 8042|     53|}
_ZN3ada14url_aggregator20append_base_passwordENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8430|    658|inline void url_aggregator::append_base_password(const std::string_view input) {
 8431|    658|  ada_log("url_aggregator::append_base_password ", input, " ", to_string(),
 8432|    658|          "\n", to_diagram());
 8433|    658|  ADA_ASSERT_TRUE(validate());
 8434|    658|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8435|       |#if ADA_DEVELOPMENT_CHECKS
 8436|       |  // computing the expected password.
 8437|       |  std::string password_expected = std::string(get_password());
 8438|       |  password_expected.append(input);
 8439|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8440|    658|  add_authority_slashes_if_needed();
 8441|       |
 8442|       |  // If input is empty, do nothing.
 8443|    658|  if (input.empty()) {
  ------------------
  |  Branch (8443:7): [True: 256, False: 402]
  ------------------
 8444|    256|    return;
 8445|    256|  }
 8446|       |
 8447|    402|  uint32_t difference = uint32_t(input.size());
 8448|    402|  if (has_password()) {
  ------------------
  |  Branch (8448:7): [True: 338, False: 64]
  ------------------
 8449|    338|    buffer.insert(components.host_start, input);
 8450|    338|  } else {
 8451|     64|    difference++;  // Increment for ":"
 8452|     64|    buffer.insert(components.username_end, ":");
 8453|     64|    buffer.insert(components.username_end + 1, input);
 8454|     64|  }
 8455|    402|  components.host_start += difference;
 8456|       |
 8457|       |  // The following line is required to add "@" to hostname. When updating
 8458|       |  // password if hostname does not start with "@", it is "append_base_password"s
 8459|       |  // responsibility to set it.
 8460|    402|  if (buffer[components.host_start] != '@') {
  ------------------
  |  Branch (8460:7): [True: 15, False: 387]
  ------------------
 8461|     15|    buffer.insert(components.host_start, "@");
 8462|     15|    difference++;
 8463|     15|  }
 8464|       |
 8465|    402|  components.host_end += difference;
 8466|    402|  components.pathname_start += difference;
 8467|    402|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8467:7): [True: 0, False: 402]
  ------------------
 8468|      0|    components.search_start += difference;
 8469|      0|  }
 8470|    402|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8470:7): [True: 0, False: 402]
  ------------------
 8471|      0|    components.hash_start += difference;
 8472|      0|  }
 8473|       |#if ADA_DEVELOPMENT_CHECKS
 8474|       |  std::string password_after(get_password());
 8475|       |  ADA_ASSERT_EQUAL(
 8476|       |      password_expected, password_after,
 8477|       |      "append_base_password problem after inserting " + std::string(input));
 8478|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8479|    402|  ADA_ASSERT_TRUE(validate());
 8480|    402|}
_ZN3ada14url_aggregator31add_authority_slashes_if_neededEv:
 8686|  2.90k|inline void ada::url_aggregator::add_authority_slashes_if_needed() {
 8687|  2.90k|  ada_log("url_aggregator::add_authority_slashes_if_needed");
 8688|  2.90k|  ADA_ASSERT_TRUE(validate());
 8689|       |  // Protocol setter will insert `http:` to the URL. It is up to hostname setter
 8690|       |  // to insert
 8691|       |  // `//` initially to the buffer, since it depends on the hostname existence.
 8692|  2.90k|  if (has_authority()) {
  ------------------
  |  Branch (8692:7): [True: 1.63k, False: 1.26k]
  ------------------
 8693|  1.63k|    return;
 8694|  1.63k|  }
 8695|       |  // Performance: the common case is components.protocol_end == buffer.size()
 8696|       |  // Optimization opportunity: in many cases, the "//" is part of the input and
 8697|       |  // the insert could be fused with another insert.
 8698|  1.26k|  buffer.insert(components.protocol_end, "//");
 8699|  1.26k|  components.username_end += 2;
 8700|  1.26k|  components.host_start += 2;
 8701|  1.26k|  components.host_end += 2;
 8702|  1.26k|  components.pathname_start += 2;
 8703|  1.26k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8703:7): [True: 0, False: 1.26k]
  ------------------
 8704|      0|    components.search_start += 2;
 8705|      0|  }
 8706|  1.26k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8706:7): [True: 0, False: 1.26k]
  ------------------
 8707|      0|    components.hash_start += 2;
 8708|      0|  }
 8709|  1.26k|  ADA_ASSERT_TRUE(validate());
 8710|  1.26k|}
_ZN3ada14url_aggregator20append_base_usernameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8312|    813|inline void url_aggregator::append_base_username(const std::string_view input) {
 8313|    813|  ada_log("url_aggregator::append_base_username ", input);
 8314|    813|  ADA_ASSERT_TRUE(validate());
 8315|    813|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8316|       |#if ADA_DEVELOPMENT_CHECKS
 8317|       |  // computing the expected password.
 8318|       |  std::string username_expected(get_username());
 8319|       |  username_expected.append(input);
 8320|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8321|    813|  add_authority_slashes_if_needed();
 8322|       |
 8323|       |  // If input is empty, do nothing.
 8324|    813|  if (input.empty()) {
  ------------------
  |  Branch (8324:7): [True: 310, False: 503]
  ------------------
 8325|    310|    return;
 8326|    310|  }
 8327|       |
 8328|    503|  uint32_t difference = uint32_t(input.size());
 8329|    503|  buffer.insert(components.username_end, input);
 8330|    503|  components.username_end += difference;
 8331|    503|  components.host_start += difference;
 8332|       |
 8333|    503|  if (buffer[components.host_start] != '@' &&
  ------------------
  |  Branch (8333:7): [True: 130, False: 373]
  ------------------
 8334|    130|      components.host_start != components.host_end) {
  ------------------
  |  Branch (8334:7): [True: 130, False: 0]
  ------------------
 8335|    130|    buffer.insert(components.host_start, "@");
 8336|    130|    difference++;
 8337|    130|  }
 8338|       |
 8339|    503|  components.host_end += difference;
 8340|    503|  components.pathname_start += difference;
 8341|    503|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8341:7): [True: 0, False: 503]
  ------------------
 8342|      0|    components.search_start += difference;
 8343|      0|  }
 8344|    503|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8344:7): [True: 0, False: 503]
  ------------------
 8345|      0|    components.hash_start += difference;
 8346|      0|  }
 8347|       |#if ADA_DEVELOPMENT_CHECKS
 8348|       |  std::string username_after(get_username());
 8349|       |  ADA_ASSERT_EQUAL(
 8350|       |      username_expected, username_after,
 8351|       |      "append_base_username problem after inserting " + std::string(input));
 8352|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8353|    503|  ADA_ASSERT_TRUE(validate());
 8354|    503|}
_ZN3ada14url_aggregator16update_base_portEj:
 8482|     44|inline void url_aggregator::update_base_port(uint32_t input) {
 8483|     44|  ada_log("url_aggregator::update_base_port");
 8484|     44|  ADA_ASSERT_TRUE(validate());
 8485|     44|  if (input == url_components::omitted) {
  ------------------
  |  Branch (8485:7): [True: 0, False: 44]
  ------------------
 8486|      0|    clear_port();
 8487|      0|    return;
 8488|      0|  }
 8489|       |  // calling std::to_string(input.value()) is unfortunate given that the port
 8490|       |  // value is probably already available as a string.
 8491|     44|  std::string value = helpers::concat(":", std::to_string(input));
 8492|     44|  uint32_t difference = uint32_t(value.size());
 8493|       |
 8494|     44|  if (components.port != url_components::omitted) {
  ------------------
  |  Branch (8494:7): [True: 0, False: 44]
  ------------------
 8495|      0|    difference -= components.pathname_start - components.host_end;
 8496|      0|    buffer.erase(components.host_end,
 8497|      0|                 components.pathname_start - components.host_end);
 8498|      0|  }
 8499|       |
 8500|     44|  buffer.insert(components.host_end, value);
 8501|     44|  components.pathname_start += difference;
 8502|     44|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8502:7): [True: 0, False: 44]
  ------------------
 8503|      0|    components.search_start += difference;
 8504|      0|  }
 8505|     44|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8505:7): [True: 0, False: 44]
  ------------------
 8506|      0|    components.hash_start += difference;
 8507|      0|  }
 8508|     44|  components.port = input;
 8509|     44|  ADA_ASSERT_TRUE(validate());
 8510|     44|}
_ZN3ada7helpers6concatIJPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEESA_DpT_:
 1790|     44|std::string concat(Args... args) {
 1791|     44|  std::string answer;
 1792|     44|  inner_concat(answer, args...);
 1793|     44|  return answer;
 1794|     44|}
_ZN3ada7helpers12inner_concatIPKcJNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEEvRSA_T_DpT0_:
 1779|     44|inline void inner_concat(std::string& buffer, T t, Args... args) {
 1780|     44|  buffer.append(t);
 1781|     44|  return inner_concat(buffer, args...);
 1782|     44|}
_ZN3ada7helpers12inner_concatINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEJEEEvRS8_T_:
 1771|     44|inline void inner_concat(std::string& buffer, T t) {
 1772|     44|  buffer.append(t);
 1773|     44|}
_ZN3ada14url_aggregator18update_base_searchENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKh:
 8150|    259|    std::string_view input, const uint8_t query_percent_encode_set[]) {
 8151|    259|  ada_log("url_aggregator::update_base_search ", input,
 8152|    259|          " with encoding parameter ", to_string(), "\n", to_diagram());
 8153|    259|  ADA_ASSERT_TRUE(validate());
 8154|    259|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8155|       |
 8156|    259|  if (components.hash_start == url_components::omitted) {
  ------------------
  |  Branch (8156:7): [True: 259, False: 0]
  ------------------
 8157|    259|    if (components.search_start == url_components::omitted) {
  ------------------
  |  Branch (8157:9): [True: 259, False: 0]
  ------------------
 8158|    259|      components.search_start = uint32_t(buffer.size());
 8159|    259|      buffer += "?";
 8160|    259|    } else {
 8161|      0|      buffer.resize(components.search_start + 1);
 8162|      0|    }
 8163|       |
 8164|    259|    bool encoding_required =
 8165|    259|        unicode::percent_encode<true>(input, query_percent_encode_set, buffer);
 8166|       |    // When encoding_required is false, then buffer is left unchanged, and
 8167|       |    // percent encoding was not deemed required.
 8168|    259|    if (!encoding_required) {
  ------------------
  |  Branch (8168:9): [True: 226, False: 33]
  ------------------
 8169|    226|      buffer.append(input);
 8170|    226|    }
 8171|    259|  } else {
 8172|      0|    if (components.search_start == url_components::omitted) {
  ------------------
  |  Branch (8172:9): [True: 0, False: 0]
  ------------------
 8173|      0|      components.search_start = components.hash_start;
 8174|      0|    } else {
 8175|      0|      buffer.erase(components.search_start,
 8176|      0|                   components.hash_start - components.search_start);
 8177|      0|      components.hash_start = components.search_start;
 8178|      0|    }
 8179|       |
 8180|      0|    buffer.insert(components.search_start, "?");
 8181|      0|    size_t idx =
 8182|      0|        ada::unicode::percent_encode_index(input, query_percent_encode_set);
 8183|      0|    if (idx == input.size()) {
  ------------------
  |  Branch (8183:9): [True: 0, False: 0]
  ------------------
 8184|      0|      buffer.insert(components.search_start + 1, input);
 8185|      0|      components.hash_start += uint32_t(input.size() + 1);  // Do not forget `?`
 8186|      0|    } else {
 8187|      0|      buffer.insert(components.search_start + 1, input, 0, idx);
 8188|      0|      input.remove_prefix(idx);
 8189|       |      // We only create a temporary string if we need percent encoding and
 8190|       |      // we attempt to create as small a temporary string as we can.
 8191|      0|      std::string encoded =
 8192|      0|          ada::unicode::percent_encode(input, query_percent_encode_set);
 8193|      0|      buffer.insert(components.search_start + idx + 1, encoded);
 8194|      0|      components.hash_start +=
 8195|      0|          uint32_t(encoded.size() + idx + 1);  // Do not forget `?`
 8196|      0|    }
 8197|      0|  }
 8198|       |
 8199|    259|  ADA_ASSERT_TRUE(validate());
 8200|    259|}
_ZN3ada14url_aggregator20update_base_hostnameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8065|  1.43k|inline void url_aggregator::update_base_hostname(const std::string_view input) {
 8066|  1.43k|  ada_log("url_aggregator::update_base_hostname ", input, " [", input.size(),
 8067|  1.43k|          " bytes], buffer is '", buffer, "' [", buffer.size(), " bytes]");
 8068|  1.43k|  ADA_ASSERT_TRUE(validate());
 8069|  1.43k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8070|       |
 8071|       |  // This next line is required for when parsing a URL like `foo://`
 8072|  1.43k|  add_authority_slashes_if_needed();
 8073|       |
 8074|  1.43k|  bool has_credentials = components.protocol_end + 2 < components.host_start;
 8075|  1.43k|  uint32_t new_difference =
 8076|  1.43k|      replace_and_resize(components.host_start, components.host_end, input);
 8077|       |
 8078|  1.43k|  if (has_credentials) {
  ------------------
  |  Branch (8078:7): [True: 97, False: 1.33k]
  ------------------
 8079|     97|    buffer.insert(components.host_start, "@");
 8080|     97|    new_difference++;
 8081|     97|  }
 8082|  1.43k|  components.host_end += new_difference;
 8083|  1.43k|  components.pathname_start += new_difference;
 8084|  1.43k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8084:7): [True: 0, False: 1.43k]
  ------------------
 8085|      0|    components.search_start += new_difference;
 8086|      0|  }
 8087|  1.43k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8087:7): [True: 0, False: 1.43k]
  ------------------
 8088|      0|    components.hash_start += new_difference;
 8089|      0|  }
 8090|  1.43k|  ADA_ASSERT_TRUE(validate());
 8091|  1.43k|}
_ZN3ada14url_aggregator10parse_portENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEb:
 8800|    301|url_aggregator::parse_port(std::string_view view, bool check_trailing_content) {
 8801|    301|  ada_log("url_aggregator::parse_port('", view, "') ", view.size());
 8802|    301|  if (!view.empty() && view[0] == '-') {
  ------------------
  |  Branch (8802:7): [True: 300, False: 1]
  |  Branch (8802:24): [True: 4, False: 296]
  ------------------
 8803|      4|    ada_log("parse_port: view[0] == '0' && view.size() > 1");
 8804|      4|    is_valid = false;
 8805|      4|    return 0;
 8806|      4|  }
 8807|    297|  uint16_t parsed_port{};
 8808|    297|  auto r = std::from_chars(view.data(), view.data() + view.size(), parsed_port);
 8809|    297|  if (r.ec == std::errc::result_out_of_range) {
  ------------------
  |  Branch (8809:7): [True: 19, False: 278]
  ------------------
 8810|     19|    ada_log("parse_port: r.ec == std::errc::result_out_of_range");
 8811|     19|    is_valid = false;
 8812|     19|    return 0;
 8813|     19|  }
 8814|    278|  ada_log("parse_port: ", parsed_port);
 8815|    278|  const size_t consumed = size_t(r.ptr - view.data());
 8816|    278|  ada_log("parse_port: consumed ", consumed);
 8817|    278|  if (check_trailing_content) {
  ------------------
  |  Branch (8817:7): [True: 278, False: 0]
  ------------------
 8818|    278|    is_valid &=
 8819|    278|        (consumed == view.size() || view[consumed] == '/' ||
  ------------------
  |  Branch (8819:10): [True: 10, False: 268]
  |  Branch (8819:37): [True: 38, False: 230]
  ------------------
 8820|    230|         view[consumed] == '?' || (is_special() && view[consumed] == '\\'));
  ------------------
  |  Branch (8820:10): [True: 4, False: 226]
  |  Branch (8820:36): [True: 226, False: 0]
  |  Branch (8820:52): [True: 13, False: 213]
  ------------------
 8821|    278|  }
 8822|    278|  ada_log("parse_port: is_valid = ", is_valid);
 8823|    278|  if (is_valid) {
  ------------------
  |  Branch (8823:7): [True: 65, False: 213]
  ------------------
 8824|     65|    ada_log("parse_port", r.ec == std::errc());
 8825|       |    // scheme_default_port can return 0, and we should allow 0 as a base port.
 8826|     65|    auto default_port = scheme_default_port();
 8827|     65|    bool is_port_valid = (default_port == 0 && parsed_port == 0) ||
  ------------------
  |  Branch (8827:27): [True: 0, False: 65]
  |  Branch (8827:48): [True: 0, False: 0]
  ------------------
 8828|     65|                         (default_port != parsed_port);
  ------------------
  |  Branch (8828:26): [True: 63, False: 2]
  ------------------
 8829|     65|    if (r.ec == std::errc() && is_port_valid) {
  ------------------
  |  Branch (8829:9): [True: 46, False: 19]
  |  Branch (8829:32): [True: 44, False: 2]
  ------------------
 8830|     44|      update_base_port(parsed_port);
 8831|     44|    } else {
 8832|     21|      clear_port();
 8833|     21|    }
 8834|     65|  }
 8835|    278|  return consumed;
 8836|    297|}
_ZN3ada7unicode20percent_encode_indexENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKh:
 7923|  2.88k|                                              const uint8_t character_set[]) {
 7924|  2.88k|  const char* data = input.data();
 7925|  2.88k|  const size_t size = input.size();
 7926|       |
 7927|       |  // Process 8 bytes at a time using unrolled loop
 7928|  2.88k|  size_t i = 0;
 7929|  3.94k|  for (; i + 8 <= size; i += 8) {
  ------------------
  |  Branch (7929:10): [True: 1.56k, False: 2.38k]
  ------------------
 7930|  1.56k|    unsigned char chunk[8];
 7931|  1.56k|    std::memcpy(&chunk, data + i,
 7932|  1.56k|                8);  // entices compiler to unconditionally process 8 characters
 7933|       |
 7934|       |    // Check 8 characters at once
 7935|  10.8k|    for (size_t j = 0; j < 8; j++) {
  ------------------
  |  Branch (7935:24): [True: 9.81k, False: 1.06k]
  ------------------
 7936|  9.81k|      if (character_sets::bit_at(character_set, chunk[j])) {
  ------------------
  |  Branch (7936:11): [True: 492, False: 9.32k]
  ------------------
 7937|    492|        return i + j;
 7938|    492|      }
 7939|  9.81k|    }
 7940|  1.56k|  }
 7941|       |
 7942|       |  // Handle remaining bytes
 7943|  5.84k|  for (; i < size; i++) {
  ------------------
  |  Branch (7943:10): [True: 4.11k, False: 1.72k]
  ------------------
 7944|  4.11k|    if (character_sets::bit_at(character_set, data[i])) {
  ------------------
  |  Branch (7944:9): [True: 665, False: 3.45k]
  ------------------
 7945|    665|      return i;
 7946|    665|    }
 7947|  4.11k|  }
 7948|       |
 7949|  1.72k|  return size;
 7950|  2.38k|}
_ZN3ada14url_aggregator10clear_portEv:
 8512|     21|inline void url_aggregator::clear_port() {
 8513|     21|  ada_log("url_aggregator::clear_port");
 8514|     21|  ADA_ASSERT_TRUE(validate());
 8515|     21|  if (components.port == url_components::omitted) {
  ------------------
  |  Branch (8515:7): [True: 21, False: 0]
  ------------------
 8516|     21|    return;
 8517|     21|  }
 8518|      0|  uint32_t length = components.pathname_start - components.host_end;
 8519|      0|  buffer.erase(components.host_end, length);
 8520|      0|  components.pathname_start -= length;
 8521|      0|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8521:7): [True: 0, False: 0]
  ------------------
 8522|      0|    components.search_start -= length;
 8523|      0|  }
 8524|      0|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8524:7): [True: 0, False: 0]
  ------------------
 8525|      0|    components.hash_start -= length;
 8526|      0|  }
 8527|      0|  components.port = url_components::omitted;
 8528|      0|  ADA_ASSERT_TRUE(validate());
 8529|      0|}
_ZNK3ada14url_aggregator13has_authorityEv:
 8677|  3.06k|    const noexcept {
 8678|  3.06k|  ada_log("url_aggregator::has_authority");
 8679|       |  // Performance: instead of doing this potentially expensive check, we could
 8680|       |  // have a boolean in the struct.
 8681|  3.06k|  return components.protocol_end + 2 <= components.host_start &&
  ------------------
  |  Branch (8681:10): [True: 1.79k, False: 1.26k]
  ------------------
 8682|  1.79k|         buffer[components.protocol_end] == '/' &&
  ------------------
  |  Branch (8682:10): [True: 1.79k, False: 0]
  ------------------
 8683|  1.79k|         buffer[components.protocol_end + 1] == '/';
  ------------------
  |  Branch (8683:10): [True: 1.79k, False: 0]
  ------------------
 8684|  3.06k|}
_ZNK3ada14url_aggregator12has_dash_dotEv:
 8757|    210|[[nodiscard]] constexpr bool url_aggregator::has_dash_dot() const noexcept {
 8758|       |  // If url's host is null, url does not have an opaque path, url's path's size
 8759|       |  // is greater than 1, and url's path[0] is the empty string, then append
 8760|       |  // U+002F (/) followed by U+002E (.) to output.
 8761|    210|  ada_log("url_aggregator::has_dash_dot");
 8762|       |#if ADA_DEVELOPMENT_CHECKS
 8763|       |  // If pathname_start and host_end are exactly two characters apart, then we
 8764|       |  // either have a one-digit port such as http://test.com:5?param=1 or else we
 8765|       |  // have a /.: sequence such as "non-spec:/.//". We test that this is the case.
 8766|       |  if (components.pathname_start == components.host_end + 2) {
 8767|       |    ADA_ASSERT_TRUE((buffer[components.host_end] == '/' &&
 8768|       |                     buffer[components.host_end + 1] == '.') ||
 8769|       |                    (buffer[components.host_end] == ':' &&
 8770|       |                     checkers::is_digit(buffer[components.host_end + 1])));
 8771|       |  }
 8772|       |  if (components.pathname_start == components.host_end + 2 &&
 8773|       |      buffer[components.host_end] == '/' &&
 8774|       |      buffer[components.host_end + 1] == '.') {
 8775|       |    ADA_ASSERT_TRUE(components.pathname_start + 1 < buffer.size());
 8776|       |    ADA_ASSERT_TRUE(buffer[components.pathname_start] == '/');
 8777|       |    ADA_ASSERT_TRUE(buffer[components.pathname_start + 1] == '/');
 8778|       |  }
 8779|       |#endif
 8780|       |  // Performance: it should be uncommon for components.pathname_start ==
 8781|       |  // components.host_end + 2 to be true. So we put this check first in the
 8782|       |  // sequence. Most times, we do not have an opaque path. Checking for '/.' is
 8783|       |  // more expensive, but should be uncommon.
 8784|    210|  return components.pathname_start == components.host_end + 2 &&
  ------------------
  |  Branch (8784:10): [True: 4, False: 206]
  ------------------
 8785|      4|         !has_opaque_path && buffer[components.host_end] == '/' &&
  ------------------
  |  Branch (8785:10): [True: 4, False: 0]
  |  Branch (8785:30): [True: 0, False: 4]
  ------------------
 8786|      0|         buffer[components.host_end + 1] == '.';
  ------------------
  |  Branch (8786:10): [True: 0, False: 0]
  ------------------
 8787|    210|}
_ZNK2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEcvbEv:
 3896|  5.05k|  constexpr explicit operator bool() const noexcept { return this->m_has_val; }
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEptEv:
 3865|    866|  TL_EXPECTED_11_CONSTEXPR T* operator->() {
 3866|    866|    TL_ASSERT(has_value());
  ------------------
  |  | 1918|    866|#define TL_ASSERT(x) assert(x)
  ------------------
  |  Branch (3866:5): [True: 866, False: 0]
  ------------------
 3867|    866|    return valptr();
 3868|    866|  }
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEE6valptrEv:
 3161|    866|  T* valptr() { return std::addressof(this->m_val); }
_ZNK2tl8expectedIN3ada14url_aggregatorENS1_6errorsEE9has_valueEv:
 3895|    866|  constexpr bool has_value() const noexcept { return this->m_has_val; }
_ZN2tl6detail21expected_storage_baseIN3ada14url_aggregatorENS2_6errorsELb0ELb1EED2Ev:
 2493|  5.05k|  ~expected_storage_base() {
 2494|  5.05k|    if (m_has_val) {
  ------------------
  |  Branch (2494:9): [True: 735, False: 4.31k]
  ------------------
 2495|    735|      m_val.~T();
 2496|    735|    }
 2497|  5.05k|  }
_ZN3ada7helpers9substringENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEmm:
 1712|  2.86k|                                                       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|  2.86k|  return input.substr(pos1, pos2 - pos1);
 1721|  2.86k|}
_ZNK3ada14url_aggregator10is_at_pathEv:
 8106|    370|    const noexcept {
 8107|    370|  return buffer.size() == components.pathname_start;
 8108|    370|}
_ZNK3ada14url_aggregator12has_passwordEv:
 8726|    402|constexpr bool url_aggregator::has_password() const noexcept {
 8727|    402|  ada_log("url_aggregator::has_password");
 8728|       |  // This function does not care about the length of the password
 8729|    402|  return components.host_start > components.username_end &&
  ------------------
  |  Branch (8729:10): [True: 338, False: 64]
  ------------------
 8730|    338|         buffer[components.username_end] == ':';
  ------------------
  |  Branch (8730:10): [True: 338, False: 0]
  ------------------
 8731|    402|}
_ZN3ada8checkers19try_parse_ipv4_fastENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1226|  4.99k|    std::string_view input) noexcept {
 1227|  4.99k|  const char* p = input.data();
 1228|  4.99k|  const char* const pend = p + input.size();
 1229|       |
 1230|  4.99k|  uint32_t ipv4 = 0;
 1231|       |
 1232|  6.14k|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (1232:19): [True: 5.91k, False: 227]
  ------------------
 1233|  5.91k|    if (p == pend) {
  ------------------
  |  Branch (1233:9): [True: 583, False: 5.33k]
  ------------------
 1234|    583|      return ipv4_fast_fail;
 1235|    583|    }
 1236|       |
 1237|  5.33k|    uint32_t val;
 1238|  5.33k|    char c = *p;
 1239|  5.33k|    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (1239:9): [True: 3.47k, False: 1.85k]
  |  Branch (1239:21): [True: 2.14k, False: 1.33k]
  ------------------
 1240|  2.14k|      val = c - '0';
 1241|  2.14k|      p++;
 1242|  3.18k|    } else {
 1243|  3.18k|      return ipv4_fast_fail;
 1244|  3.18k|    }
 1245|       |
 1246|  2.14k|    if (p < pend) {
  ------------------
  |  Branch (1246:9): [True: 2.03k, False: 111]
  ------------------
 1247|  2.03k|      c = *p;
 1248|  2.03k|      if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (1248:11): [True: 1.52k, False: 509]
  |  Branch (1248:23): [True: 1.16k, False: 368]
  ------------------
 1249|  1.16k|        if (val == 0) return ipv4_fast_fail;
  ------------------
  |  Branch (1249:13): [True: 125, False: 1.03k]
  ------------------
 1250|  1.03k|        val = val * 10 + (c - '0');
 1251|  1.03k|        p++;
 1252|  1.03k|        if (p < pend) {
  ------------------
  |  Branch (1252:13): [True: 954, False: 81]
  ------------------
 1253|    954|          c = *p;
 1254|    954|          if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (1254:15): [True: 710, False: 244]
  |  Branch (1254:27): [True: 639, False: 71]
  ------------------
 1255|    639|            val = val * 10 + (c - '0');
 1256|    639|            p++;
 1257|    639|            if (val > 255) return ipv4_fast_fail;
  ------------------
  |  Branch (1257:17): [True: 182, False: 457]
  ------------------
 1258|    639|          }
 1259|    954|        }
 1260|  1.03k|      }
 1261|  2.03k|    }
 1262|       |
 1263|  1.84k|    ipv4 = (ipv4 << 8) | val;
 1264|       |
 1265|  1.84k|    if (i < 3) {
  ------------------
  |  Branch (1265:9): [True: 1.61k, False: 227]
  ------------------
 1266|  1.61k|      if (p == pend || *p != '.') {
  ------------------
  |  Branch (1266:11): [True: 72, False: 1.54k]
  |  Branch (1266:24): [True: 622, False: 920]
  ------------------
 1267|    694|        return ipv4_fast_fail;
 1268|    694|      }
 1269|    920|      p++;
 1270|    920|    }
 1271|  1.84k|  }
 1272|       |
 1273|    227|  if (p != pend) {
  ------------------
  |  Branch (1273:7): [True: 31, False: 196]
  ------------------
 1274|     31|    if (p == pend - 1 && *p == '.') {
  ------------------
  |  Branch (1274:9): [True: 13, False: 18]
  |  Branch (1274:26): [True: 6, False: 7]
  ------------------
 1275|      6|      return ipv4;
 1276|      6|    }
 1277|     25|    return ipv4_fast_fail;
 1278|     31|  }
 1279|       |
 1280|    196|  return ipv4;
 1281|    227|}
_ZNK3ada14url_aggregator8validateEv:
 8868|    735|[[nodiscard]] constexpr bool url_aggregator::validate() const noexcept {
 8869|    735|  if (!is_valid) {
  ------------------
  |  Branch (8869:7): [True: 0, False: 735]
  ------------------
 8870|      0|    return true;
 8871|      0|  }
 8872|    735|  if (!components.check_offset_consistency()) {
  ------------------
  |  Branch (8872:7): [True: 0, False: 735]
  ------------------
 8873|      0|    ada_log("url_aggregator::validate inconsistent components \n",
 8874|      0|            to_diagram());
 8875|      0|    return false;
 8876|      0|  }
 8877|       |  // We have a credible components struct, but let us investivate more
 8878|       |  // carefully:
 8879|       |  /**
 8880|       |   * https://user:pass@example.com:1234/foo/bar?baz#quux
 8881|       |   *       |     |    |          | ^^^^|       |   |
 8882|       |   *       |     |    |          | |   |       |   `----- hash_start
 8883|       |   *       |     |    |          | |   |       `--------- search_start
 8884|       |   *       |     |    |          | |   `----------------- pathname_start
 8885|       |   *       |     |    |          | `--------------------- port
 8886|       |   *       |     |    |          `----------------------- host_end
 8887|       |   *       |     |    `---------------------------------- host_start
 8888|       |   *       |     `--------------------------------------- username_end
 8889|       |   *       `--------------------------------------------- protocol_end
 8890|       |   */
 8891|    735|  if (components.protocol_end == url_components::omitted) {
  ------------------
  |  Branch (8891:7): [True: 0, False: 735]
  ------------------
 8892|      0|    ada_log("url_aggregator::validate omitted protocol_end \n", to_diagram());
 8893|      0|    return false;
 8894|      0|  }
 8895|    735|  if (components.username_end == url_components::omitted) {
  ------------------
  |  Branch (8895:7): [True: 0, False: 735]
  ------------------
 8896|      0|    ada_log("url_aggregator::validate omitted username_end \n", to_diagram());
 8897|      0|    return false;
 8898|      0|  }
 8899|    735|  if (components.host_start == url_components::omitted) {
  ------------------
  |  Branch (8899:7): [True: 0, False: 735]
  ------------------
 8900|      0|    ada_log("url_aggregator::validate omitted host_start \n", to_diagram());
 8901|      0|    return false;
 8902|      0|  }
 8903|    735|  if (components.host_end == url_components::omitted) {
  ------------------
  |  Branch (8903:7): [True: 0, False: 735]
  ------------------
 8904|      0|    ada_log("url_aggregator::validate omitted host_end \n", to_diagram());
 8905|      0|    return false;
 8906|      0|  }
 8907|    735|  if (components.pathname_start == url_components::omitted) {
  ------------------
  |  Branch (8907:7): [True: 0, False: 735]
  ------------------
 8908|      0|    ada_log("url_aggregator::validate omitted pathname_start \n", to_diagram());
 8909|      0|    return false;
 8910|      0|  }
 8911|       |
 8912|    735|  if (components.protocol_end > buffer.size()) {
  ------------------
  |  Branch (8912:7): [True: 0, False: 735]
  ------------------
 8913|      0|    ada_log("url_aggregator::validate protocol_end overflow \n", to_diagram());
 8914|      0|    return false;
 8915|      0|  }
 8916|    735|  if (components.username_end > buffer.size()) {
  ------------------
  |  Branch (8916:7): [True: 0, False: 735]
  ------------------
 8917|      0|    ada_log("url_aggregator::validate username_end overflow \n", to_diagram());
 8918|      0|    return false;
 8919|      0|  }
 8920|    735|  if (components.host_start > buffer.size()) {
  ------------------
  |  Branch (8920:7): [True: 0, False: 735]
  ------------------
 8921|      0|    ada_log("url_aggregator::validate host_start overflow \n", to_diagram());
 8922|      0|    return false;
 8923|      0|  }
 8924|    735|  if (components.host_end > buffer.size()) {
  ------------------
  |  Branch (8924:7): [True: 0, False: 735]
  ------------------
 8925|      0|    ada_log("url_aggregator::validate host_end overflow \n", to_diagram());
 8926|      0|    return false;
 8927|      0|  }
 8928|    735|  if (components.pathname_start > buffer.size()) {
  ------------------
  |  Branch (8928:7): [True: 0, False: 735]
  ------------------
 8929|      0|    ada_log("url_aggregator::validate pathname_start overflow \n",
 8930|      0|            to_diagram());
 8931|      0|    return false;
 8932|      0|  }
 8933|       |
 8934|    735|  if (components.protocol_end > 0) {
  ------------------
  |  Branch (8934:7): [True: 735, False: 0]
  ------------------
 8935|    735|    if (buffer[components.protocol_end - 1] != ':') {
  ------------------
  |  Branch (8935:9): [True: 0, False: 735]
  ------------------
 8936|      0|      ada_log(
 8937|      0|          "url_aggregator::validate missing : at the end of the protocol \n",
 8938|      0|          to_diagram());
 8939|      0|      return false;
 8940|      0|    }
 8941|    735|  }
 8942|       |
 8943|    735|  if (components.username_end != buffer.size() &&
  ------------------
  |  Branch (8943:7): [True: 735, False: 0]
  ------------------
 8944|    735|      components.username_end > components.protocol_end + 2) {
  ------------------
  |  Branch (8944:7): [True: 41, False: 694]
  ------------------
 8945|     41|    if (buffer[components.username_end] != ':' &&
  ------------------
  |  Branch (8945:9): [True: 20, False: 21]
  ------------------
 8946|     20|        buffer[components.username_end] != '@') {
  ------------------
  |  Branch (8946:9): [True: 0, False: 20]
  ------------------
 8947|      0|      ada_log(
 8948|      0|          "url_aggregator::validate missing : or @ at the end of the username "
 8949|      0|          "\n",
 8950|      0|          to_diagram());
 8951|      0|      return false;
 8952|      0|    }
 8953|     41|  }
 8954|       |
 8955|    735|  if (components.host_start != buffer.size()) {
  ------------------
  |  Branch (8955:7): [True: 735, False: 0]
  ------------------
 8956|    735|    if (components.host_start > components.username_end) {
  ------------------
  |  Branch (8956:9): [True: 23, False: 712]
  ------------------
 8957|     23|      if (buffer[components.host_start] != '@') {
  ------------------
  |  Branch (8957:11): [True: 0, False: 23]
  ------------------
 8958|      0|        ada_log(
 8959|      0|            "url_aggregator::validate missing @ at the end of the password \n",
 8960|      0|            to_diagram());
 8961|      0|        return false;
 8962|      0|      }
 8963|    712|    } else if (components.host_start == components.username_end &&
  ------------------
  |  Branch (8963:16): [True: 712, False: 0]
  ------------------
 8964|    712|               components.host_end > components.host_start) {
  ------------------
  |  Branch (8964:16): [True: 712, False: 0]
  ------------------
 8965|    712|      if (components.host_start == components.protocol_end + 2) {
  ------------------
  |  Branch (8965:11): [True: 692, False: 20]
  ------------------
 8966|    692|        if (buffer[components.protocol_end] != '/' ||
  ------------------
  |  Branch (8966:13): [True: 0, False: 692]
  ------------------
 8967|    692|            buffer[components.protocol_end + 1] != '/') {
  ------------------
  |  Branch (8967:13): [True: 0, False: 692]
  ------------------
 8968|      0|          ada_log(
 8969|      0|              "url_aggregator::validate missing // between protocol and host "
 8970|      0|              "\n",
 8971|      0|              to_diagram());
 8972|      0|          return false;
 8973|      0|        }
 8974|    692|      } else {
 8975|     20|        if (components.host_start > components.protocol_end &&
  ------------------
  |  Branch (8975:13): [True: 20, False: 0]
  ------------------
 8976|     20|            buffer[components.host_start] != '@') {
  ------------------
  |  Branch (8976:13): [True: 0, False: 20]
  ------------------
 8977|      0|          ada_log(
 8978|      0|              "url_aggregator::validate missing @ at the end of the username "
 8979|      0|              "\n",
 8980|      0|              to_diagram());
 8981|      0|          return false;
 8982|      0|        }
 8983|     20|      }
 8984|    712|    } else {
 8985|      0|      if (components.host_end != components.host_start) {
  ------------------
  |  Branch (8985:11): [True: 0, False: 0]
  ------------------
 8986|      0|        ada_log("url_aggregator::validate expected omitted host \n",
 8987|      0|                to_diagram());
 8988|      0|        return false;
 8989|      0|      }
 8990|      0|    }
 8991|    735|  }
 8992|    735|  if (components.host_end != buffer.size() &&
  ------------------
  |  Branch (8992:7): [True: 735, False: 0]
  ------------------
 8993|    735|      components.pathname_start > components.host_end) {
  ------------------
  |  Branch (8993:7): [True: 44, False: 691]
  ------------------
 8994|     44|    if (components.pathname_start == components.host_end + 2 &&
  ------------------
  |  Branch (8994:9): [True: 10, False: 34]
  ------------------
 8995|     10|        buffer[components.host_end] == '/' &&
  ------------------
  |  Branch (8995:9): [True: 0, False: 10]
  ------------------
 8996|      0|        buffer[components.host_end + 1] == '.') {
  ------------------
  |  Branch (8996:9): [True: 0, False: 0]
  ------------------
 8997|      0|      if (components.pathname_start + 1 >= buffer.size() ||
  ------------------
  |  Branch (8997:11): [True: 0, False: 0]
  ------------------
 8998|      0|          buffer[components.pathname_start] != '/' ||
  ------------------
  |  Branch (8998:11): [True: 0, False: 0]
  ------------------
 8999|      0|          buffer[components.pathname_start + 1] != '/') {
  ------------------
  |  Branch (8999:11): [True: 0, False: 0]
  ------------------
 9000|      0|        ada_log(
 9001|      0|            "url_aggregator::validate expected the path to begin with // \n",
 9002|      0|            to_diagram());
 9003|      0|        return false;
 9004|      0|      }
 9005|     44|    } else if (buffer[components.host_end] != ':') {
  ------------------
  |  Branch (9005:16): [True: 0, False: 44]
  ------------------
 9006|      0|      ada_log("url_aggregator::validate missing : at the port \n",
 9007|      0|              to_diagram());
 9008|      0|      return false;
 9009|      0|    }
 9010|     44|  }
 9011|    735|  if (components.pathname_start != buffer.size() &&
  ------------------
  |  Branch (9011:7): [True: 735, False: 0]
  ------------------
 9012|    735|      components.pathname_start < components.search_start &&
  ------------------
  |  Branch (9012:7): [True: 735, False: 0]
  ------------------
 9013|    735|      components.pathname_start < components.hash_start && !has_opaque_path) {
  ------------------
  |  Branch (9013:7): [True: 735, False: 0]
  |  Branch (9013:60): [True: 735, False: 0]
  ------------------
 9014|    735|    if (buffer[components.pathname_start] != '/') {
  ------------------
  |  Branch (9014:9): [True: 0, False: 735]
  ------------------
 9015|      0|      ada_log("url_aggregator::validate missing / at the path \n",
 9016|      0|              to_diagram());
 9017|      0|      return false;
 9018|      0|    }
 9019|    735|  }
 9020|    735|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (9020:7): [True: 259, False: 476]
  ------------------
 9021|    259|    if (buffer[components.search_start] != '?') {
  ------------------
  |  Branch (9021:9): [True: 0, False: 259]
  ------------------
 9022|      0|      ada_log("url_aggregator::validate missing ? at the search \n",
 9023|      0|              to_diagram());
 9024|      0|      return false;
 9025|      0|    }
 9026|    259|  }
 9027|    735|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (9027:7): [True: 53, False: 682]
  ------------------
 9028|     53|    if (buffer[components.hash_start] != '#') {
  ------------------
  |  Branch (9028:9): [True: 0, False: 53]
  ------------------
 9029|      0|      ada_log("url_aggregator::validate missing # at the hash \n",
 9030|      0|              to_diagram());
 9031|      0|      return false;
 9032|      0|    }
 9033|     53|  }
 9034|       |
 9035|    735|  return true;
 9036|    735|}
_ZNK3ada14url_components24check_offset_consistencyEv:
 7385|    735|    const noexcept {
 7386|       |  /**
 7387|       |   * https://user:pass@example.com:1234/foo/bar?baz#quux
 7388|       |   *       |     |    |          | ^^^^|       |   |
 7389|       |   *       |     |    |          | |   |       |   `----- hash_start
 7390|       |   *       |     |    |          | |   |       `--------- search_start
 7391|       |   *       |     |    |          | |   `----------------- pathname_start
 7392|       |   *       |     |    |          | `--------------------- port
 7393|       |   *       |     |    |          `----------------------- host_end
 7394|       |   *       |     |    `---------------------------------- host_start
 7395|       |   *       |     `--------------------------------------- username_end
 7396|       |   *       `--------------------------------------------- protocol_end
 7397|       |   */
 7398|       |  // These conditions can be made more strict.
 7399|    735|  if (protocol_end == url_components::omitted) {
  ------------------
  |  Branch (7399:7): [True: 0, False: 735]
  ------------------
 7400|      0|    return false;
 7401|      0|  }
 7402|    735|  uint32_t index = protocol_end;
 7403|       |
 7404|    735|  if (username_end == url_components::omitted) {
  ------------------
  |  Branch (7404:7): [True: 0, False: 735]
  ------------------
 7405|      0|    return false;
 7406|      0|  }
 7407|    735|  if (username_end < index) {
  ------------------
  |  Branch (7407:7): [True: 0, False: 735]
  ------------------
 7408|      0|    return false;
 7409|      0|  }
 7410|    735|  index = username_end;
 7411|       |
 7412|    735|  if (host_start == url_components::omitted) {
  ------------------
  |  Branch (7412:7): [True: 0, False: 735]
  ------------------
 7413|      0|    return false;
 7414|      0|  }
 7415|    735|  if (host_start < index) {
  ------------------
  |  Branch (7415:7): [True: 0, False: 735]
  ------------------
 7416|      0|    return false;
 7417|      0|  }
 7418|    735|  index = host_start;
 7419|       |
 7420|    735|  if (port != url_components::omitted) {
  ------------------
  |  Branch (7420:7): [True: 44, False: 691]
  ------------------
 7421|     44|    if (port > 0xffff) {
  ------------------
  |  Branch (7421:9): [True: 0, False: 44]
  ------------------
 7422|      0|      return false;
 7423|      0|    }
 7424|     44|    uint32_t port_length = helpers::fast_digit_count(port) + 1;
 7425|     44|    if (index + port_length < index) {
  ------------------
  |  Branch (7425:9): [True: 0, False: 44]
  ------------------
 7426|      0|      return false;
 7427|      0|    }
 7428|     44|    index += port_length;
 7429|     44|  }
 7430|       |
 7431|    735|  if (pathname_start == url_components::omitted) {
  ------------------
  |  Branch (7431:7): [True: 0, False: 735]
  ------------------
 7432|      0|    return false;
 7433|      0|  }
 7434|    735|  if (pathname_start < index) {
  ------------------
  |  Branch (7434:7): [True: 0, False: 735]
  ------------------
 7435|      0|    return false;
 7436|      0|  }
 7437|    735|  index = pathname_start;
 7438|       |
 7439|    735|  if (search_start != url_components::omitted) {
  ------------------
  |  Branch (7439:7): [True: 259, False: 476]
  ------------------
 7440|    259|    if (search_start < index) {
  ------------------
  |  Branch (7440:9): [True: 0, False: 259]
  ------------------
 7441|      0|      return false;
 7442|      0|    }
 7443|    259|    index = search_start;
 7444|    259|  }
 7445|       |
 7446|    735|  if (hash_start != url_components::omitted) {
  ------------------
  |  Branch (7446:7): [True: 53, False: 682]
  ------------------
 7447|     53|    if (hash_start < index) {
  ------------------
  |  Branch (7447:9): [True: 0, False: 53]
  ------------------
 7448|      0|      return false;
 7449|      0|    }
 7450|     53|  }
 7451|       |
 7452|    735|  return true;
 7453|    735|}
_ZN3ada7helpers16fast_digit_countEj:
 1816|     44|inline int fast_digit_count(uint32_t x) noexcept {
 1817|     44|  auto int_log2 = [](uint32_t z) -> int {
 1818|     44|    return 31 - ada::helpers::leading_zeroes(z | 1);
 1819|     44|  };
 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|     44|  const static uint64_t table[] = {
 1825|     44|      4294967296,  8589934582,  8589934582,  8589934582,  12884901788,
 1826|     44|      12884901788, 12884901788, 17179868184, 17179868184, 17179868184,
 1827|     44|      21474826480, 21474826480, 21474826480, 21474826480, 25769703776,
 1828|     44|      25769703776, 25769703776, 30063771072, 30063771072, 30063771072,
 1829|     44|      34349738368, 34349738368, 34349738368, 34349738368, 38554705664,
 1830|     44|      38554705664, 38554705664, 41949672960, 41949672960, 41949672960,
 1831|     44|      42949672960, 42949672960};
 1832|     44|  return int((x + table[int_log2(x)]) >> 32);
 1833|     44|}
_ZZN3ada7helpers16fast_digit_countEjENKUljE_clEj:
 1817|     44|  auto int_log2 = [](uint32_t z) -> int {
 1818|     44|    return 31 - ada::helpers::leading_zeroes(z | 1);
 1819|     44|  };

LLVMFuzzerTestOneInput:
   21|  2.88k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   22|  2.88k|  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.88k|  uint64_t ipv4_addr = fdp.ConsumeIntegral<uint64_t>();
   28|  2.88k|  std::string ipv4_str = ada::serializers::ipv4(ipv4_addr);
   29|  2.88k|  volatile size_t ipv4_len = ipv4_str.size();
   30|  2.88k|  (void)ipv4_len;
   31|       |
   32|       |  // ===== IPv6 Serialization =====
   33|  2.88k|  std::array<uint16_t, 8> ipv6_addr{};
   34|  23.0k|  for (auto& piece : ipv6_addr) {
  ------------------
  |  Branch (34:20): [True: 23.0k, False: 2.88k]
  ------------------
   35|  23.0k|    piece = fdp.ConsumeIntegral<uint16_t>();
   36|  23.0k|  }
   37|       |
   38|       |  // find_longest_sequence_of_ipv6_pieces: basic invariants must hold.
   39|  2.88k|  size_t compress = 0, compress_length = 0;
   40|  2.88k|  ada::serializers::find_longest_sequence_of_ipv6_pieces(ipv6_addr, compress,
   41|  2.88k|                                                         compress_length);
   42|       |  // The longest run cannot exceed 8 pieces.
   43|  2.88k|  assert(compress_length <= 8);
  ------------------
  |  Branch (43:3): [True: 2.88k, False: 0]
  ------------------
   44|       |  // If a run was found (length > 0) its start index must be in-bounds.
   45|  2.88k|  if (compress_length > 0) {
  ------------------
  |  Branch (45:7): [True: 471, False: 2.40k]
  ------------------
   46|    471|    assert(compress < 8);
  ------------------
  |  Branch (46:5): [True: 471, False: 0]
  ------------------
   47|    471|    assert(compress + compress_length <= 8);
  ------------------
  |  Branch (47:5): [True: 471, False: 0]
  ------------------
   48|    471|  }
   49|       |
   50|  2.88k|  std::string ipv6_str = ada::serializers::ipv6(ipv6_addr);
   51|  2.88k|  volatile size_t ipv6_len = ipv6_str.size();
   52|  2.88k|  (void)ipv6_len;
   53|       |
   54|       |  // Serialized IPv6 must always be a non-empty string.
   55|  2.88k|  assert(!ipv6_str.empty());
  ------------------
  |  Branch (55:3): [True: 2.88k, 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.88k|  {
   62|  2.88k|    std::string ip_candidate = fdp.ConsumeRandomLengthString(32);
   63|  2.88k|    uint64_t fast_result = ada::checkers::try_parse_ipv4_fast(ip_candidate);
   64|  2.88k|    if (fast_result <= 0xFFFFFFFF) {
  ------------------
  |  Branch (64:9): [True: 33, False: 2.84k]
  ------------------
   65|       |      // Serialize the parsed address and re-parse.
   66|     33|      std::string canonical = ada::serializers::ipv4(fast_result);
   67|     33|      uint64_t recheck = ada::checkers::try_parse_ipv4_fast(canonical);
   68|     33|      if (recheck != fast_result) {
  ------------------
  |  Branch (68:11): [True: 0, False: 33]
  ------------------
   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|     33|    }
   77|  2.88k|  }
   78|       |
   79|       |  // ===== Percent Encode / Decode =====
   80|  2.88k|  {
   81|  2.88k|    std::string source = fdp.ConsumeRandomLengthString(128);
   82|       |
   83|       |    // Exercise all six standard character sets used by the URL parser.
   84|  2.88k|    const uint8_t* sets[] = {
   85|  2.88k|        ada::character_sets::C0_CONTROL_PERCENT_ENCODE,
   86|  2.88k|        ada::character_sets::PATH_PERCENT_ENCODE,
   87|  2.88k|        ada::character_sets::QUERY_PERCENT_ENCODE,
   88|  2.88k|        ada::character_sets::FRAGMENT_PERCENT_ENCODE,
   89|  2.88k|        ada::character_sets::USERINFO_PERCENT_ENCODE,
   90|  2.88k|        ada::character_sets::SPECIAL_QUERY_PERCENT_ENCODE,
   91|  2.88k|    };
   92|       |
   93|  17.2k|    for (const uint8_t* charset : sets) {
  ------------------
  |  Branch (93:33): [True: 17.2k, False: 2.88k]
  ------------------
   94|       |      // Two-argument percent_encode: returns the encoded string.
   95|  17.2k|      std::string encoded = ada::unicode::percent_encode(source, charset);
   96|  17.2k|      volatile size_t enc_len = encoded.size();
   97|  17.2k|      (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.2k|      assert(encoded.size() >= source.size());
  ------------------
  |  Branch (101:7): [True: 17.2k, False: 0]
  ------------------
  102|       |
  103|       |      // Three-argument percent_encode: starts encoding from a given index.
  104|  17.2k|      size_t start_idx = fdp.ConsumeIntegralInRange<size_t>(0, source.size());
  105|  17.2k|      std::string encoded_from =
  106|  17.2k|          ada::unicode::percent_encode(source, charset, start_idx);
  107|  17.2k|      volatile size_t enf_len = encoded_from.size();
  108|  17.2k|      (void)enf_len;
  109|       |
  110|       |      // Template form: percent_encode<false> (replace).
  111|  17.2k|      {
  112|  17.2k|        std::string out;
  113|  17.2k|        bool changed =
  114|  17.2k|            ada::unicode::percent_encode<false>(source, charset, out);
  115|  17.2k|        volatile bool c = changed;
  116|  17.2k|        (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.2k|        if (changed) {
  ------------------
  |  Branch (119:13): [True: 7.27k, False: 10.0k]
  ------------------
  120|  7.27k|          assert(out.size() >= source.size());
  ------------------
  |  Branch (120:11): [True: 7.27k, False: 0]
  ------------------
  121|  7.27k|        }
  122|  17.2k|      }
  123|       |
  124|       |      // Template form: percent_encode<true> (append).
  125|  17.2k|      {
  126|  17.2k|        std::string out = "prefix_";
  127|  17.2k|        size_t prefix_len = out.size();
  128|  17.2k|        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.2k|        assert(out.size() >= prefix_len);
  ------------------
  |  Branch (131:9): [True: 17.2k, False: 0]
  ------------------
  132|  17.2k|      }
  133|  17.2k|    }
  134|       |
  135|       |    // Percent decode: feed raw fuzz input (may contain invalid sequences).
  136|  2.88k|    {
  137|  2.88k|      size_t pct_pos = source.find('%');
  138|  2.88k|      if (pct_pos != std::string::npos) {
  ------------------
  |  Branch (138:11): [True: 119, False: 2.76k]
  ------------------
  139|    119|        std::string decoded = ada::unicode::percent_decode(source, pct_pos);
  140|       |        // Decoded output can't be longer than the input.
  141|    119|        assert(decoded.size() <= source.size());
  ------------------
  |  Branch (141:9): [True: 119, False: 0]
  ------------------
  142|    119|        volatile size_t dec_len = decoded.size();
  143|    119|        (void)dec_len;
  144|    119|      }
  145|  2.88k|    }
  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.88k|    {
  150|  2.88k|      std::string encoded = ada::unicode::percent_encode(
  151|  2.88k|          source, ada::character_sets::PATH_PERCENT_ENCODE);
  152|  2.88k|      size_t pct_pos = encoded.find('%');
  153|  2.88k|      if (pct_pos != std::string::npos) {
  ------------------
  |  Branch (153:11): [True: 1.18k, False: 1.69k]
  ------------------
  154|  1.18k|        std::string decoded = ada::unicode::percent_decode(encoded, pct_pos);
  155|  1.18k|        if (decoded != source) {
  ------------------
  |  Branch (155:13): [True: 0, False: 1.18k]
  ------------------
  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.69k|      } else {
  163|       |        // No encoding was needed; the output should equal the input.
  164|  1.69k|        assert(encoded == source);
  ------------------
  |  Branch (164:9): [True: 1.69k, False: 0]
  ------------------
  165|  1.69k|      }
  166|  2.88k|    }
  167|       |
  168|       |    // percent_encode_index: the returned index must be within [0, size].
  169|  2.88k|    {
  170|  2.88k|      size_t idx = ada::unicode::percent_encode_index(
  171|  2.88k|          source, ada::character_sets::PATH_PERCENT_ENCODE);
  172|  2.88k|      assert(idx <= source.size());
  ------------------
  |  Branch (172:7): [True: 2.88k, False: 0]
  ------------------
  173|  2.88k|    }
  174|  2.88k|  }
  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.88k|  {
  181|  2.88k|    std::string util_input = fdp.ConsumeRandomLengthString(128);
  182|       |
  183|       |    // has_tabs_or_newline: any string is valid input.
  184|  2.88k|    volatile bool has_tn = ada::unicode::has_tabs_or_newline(util_input);
  185|  2.88k|    (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.88k|    volatile bool is_v4 = ada::checkers::is_ipv4(util_input);
  191|  2.88k|    (void)is_v4;
  192|  2.88k|    if (is_v4) {
  ------------------
  |  Branch (192:9): [True: 2.03k, False: 841]
  ------------------
  193|  2.03k|      std::string ipv4_url = "http://" + util_input + "/";
  194|  2.03k|      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.03k|      if (parsed) {
  ------------------
  |  Branch (198:11): [True: 604, False: 1.43k]
  ------------------
  199|    604|        volatile bool v = parsed->validate();
  200|    604|        (void)v;
  201|    604|      }
  202|  2.03k|    }
  203|       |
  204|       |    // path_signature: returns a bitmask; must not crash.
  205|  2.88k|    volatile uint8_t sig = ada::checkers::path_signature(util_input);
  206|  2.88k|    (void)sig;
  207|       |
  208|       |    // is_windows_drive_letter: must not crash on short or long inputs.
  209|  2.88k|    volatile bool is_wdl = ada::checkers::is_windows_drive_letter(util_input);
  210|  2.88k|    (void)is_wdl;
  211|       |
  212|       |    // is_normalized_windows_drive_letter
  213|  2.88k|    volatile bool is_nwdl =
  214|  2.88k|        ada::checkers::is_normalized_windows_drive_letter(util_input);
  215|  2.88k|    (void)is_nwdl;
  216|       |
  217|       |    // Consistency: a normalised Windows drive letter is a subset of
  218|       |    // Windows drive letters.
  219|  2.88k|    if (is_nwdl && !is_wdl) {
  ------------------
  |  Branch (219:9): [True: 5, False: 2.87k]
  |  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.88k|    {
  229|  2.88k|      std::string lower_copy = util_input;
  230|  2.88k|      volatile bool all_ascii =
  231|  2.88k|          ada::unicode::to_lower_ascii(lower_copy.data(), lower_copy.size());
  232|  2.88k|      (void)all_ascii;
  233|       |      // The result should be at most as long as the input.
  234|  2.88k|      assert(lower_copy.size() == util_input.size());
  ------------------
  |  Branch (234:7): [True: 2.88k, False: 0]
  ------------------
  235|  2.88k|    }
  236|       |
  237|       |    // contains_forbidden_domain_code_point: must not crash.
  238|  2.88k|    volatile bool has_forbidden =
  239|  2.88k|        ada::unicode::contains_forbidden_domain_code_point(util_input.data(),
  240|  2.88k|                                                           util_input.size());
  241|  2.88k|    (void)has_forbidden;
  242|       |
  243|       |    // contains_forbidden_domain_code_point_or_upper: must not crash.
  244|  2.88k|    volatile uint8_t forbidden_or_upper =
  245|  2.88k|        ada::unicode::contains_forbidden_domain_code_point_or_upper(
  246|  2.88k|            util_input.data(), util_input.size());
  247|  2.88k|    (void)forbidden_or_upper;
  248|       |
  249|       |    // verify_dns_length: must not crash; also check consistency with
  250|       |    // to_ascii output.
  251|  2.88k|    volatile bool dns_ok = ada::checkers::verify_dns_length(util_input);
  252|  2.88k|    (void)dns_ok;
  253|  2.88k|  }
  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.88k|    if (ipv4_addr <= 0xFFFFFFFF) {
  ------------------
  |  Branch (260:9): [True: 131, False: 2.74k]
  ------------------
  261|    131|      std::string url_str = "http://" + ipv4_str + "/path?q=1";
  262|    131|      auto parsed = ada::parse<ada::url_aggregator>(url_str);
  263|    131|      if (parsed) {
  ------------------
  |  Branch (263:11): [True: 131, False: 0]
  ------------------
  264|    131|        volatile bool v = parsed->validate();
  265|    131|        (void)v;
  266|       |        // The URL's hostname must be the canonical dotted-decimal address.
  267|    131|        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|    131|        (void)host;
  272|    131|      }
  273|    131|    }
  274|       |
  275|       |    // IPv6: wrap in brackets.
  276|  2.88k|    std::string ipv6_url_str = "http://[" + ipv6_str + "]/path";
  277|  2.88k|    auto parsed_ipv6 = ada::parse<ada::url_aggregator>(ipv6_url_str);
  278|  2.88k|    if (parsed_ipv6) {
  ------------------
  |  Branch (278:9): [True: 0, False: 2.88k]
  ------------------
  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.88k|  }
  295|       |
  296|  2.88k|  return 0;
  297|  2.88k|}

