_ZN3ada4idna13utf8_to_utf32EPKcmPDi:
  172|  5.31k|size_t utf8_to_utf32(const char* buf, size_t len, char32_t* utf32_output) {
  173|  5.31k|  const uint8_t* data = reinterpret_cast<const uint8_t*>(buf);
  174|  5.31k|  size_t pos = 0;
  175|  5.31k|  const char32_t* start{utf32_output};
  176|   109k|  while (pos < len) {
  ------------------
  |  Branch (176:10): [True: 104k, False: 4.88k]
  ------------------
  177|       |    // try to convert the next block of 16 ASCII bytes
  178|   104k|    if (pos + 16 <= len) {  // if it is safe to read 16 more
  ------------------
  |  Branch (178:9): [True: 74.3k, False: 29.8k]
  ------------------
  179|       |                            // bytes, check that they are ascii
  180|  74.3k|      uint64_t v1;
  181|  74.3k|      std::memcpy(&v1, data + pos, sizeof(uint64_t));
  182|  74.3k|      uint64_t v2;
  183|  74.3k|      std::memcpy(&v2, data + pos + sizeof(uint64_t), sizeof(uint64_t));
  184|  74.3k|      uint64_t v{v1 | v2};
  185|  74.3k|      if ((v & 0x8080808080808080) == 0) {
  ------------------
  |  Branch (185:11): [True: 4.49k, False: 69.8k]
  ------------------
  186|  4.49k|        size_t final_pos = pos + 16;
  187|  76.4k|        while (pos < final_pos) {
  ------------------
  |  Branch (187:16): [True: 71.9k, False: 4.49k]
  ------------------
  188|  71.9k|          *utf32_output++ = char32_t(buf[pos]);
  189|  71.9k|          pos++;
  190|  71.9k|        }
  191|  4.49k|        continue;
  192|  4.49k|      }
  193|  74.3k|    }
  194|  99.7k|    uint8_t leading_byte = data[pos];  // leading byte
  195|  99.7k|    if (leading_byte < 0b10000000) {
  ------------------
  |  Branch (195:9): [True: 55.1k, False: 44.5k]
  ------------------
  196|       |      // converting one ASCII byte !!!
  197|  55.1k|      *utf32_output++ = char32_t(leading_byte);
  198|  55.1k|      pos++;
  199|  55.1k|    } else if ((leading_byte & 0b11100000) == 0b11000000) {
  ------------------
  |  Branch (199:16): [True: 7.66k, False: 36.8k]
  ------------------
  200|       |      // We have a two-byte UTF-8
  201|  7.66k|      if (pos + 1 >= len) {
  ------------------
  |  Branch (201:11): [True: 50, False: 7.61k]
  ------------------
  202|     50|        return 0;
  203|     50|      }  // minimal bound checking
  204|  7.61k|      if ((data[pos + 1] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (204:11): [True: 84, False: 7.52k]
  ------------------
  205|     84|        return 0;
  206|     84|      }
  207|       |      // range check
  208|  7.52k|      uint32_t code_point =
  209|  7.52k|          (leading_byte & 0b00011111) << 6 | (data[pos + 1] & 0b00111111);
  210|  7.52k|      if (code_point < 0x80 || 0x7ff < code_point) {
  ------------------
  |  Branch (210:11): [True: 8, False: 7.51k]
  |  Branch (210:32): [True: 0, False: 7.51k]
  ------------------
  211|      8|        return 0;
  212|      8|      }
  213|  7.51k|      *utf32_output++ = char32_t(code_point);
  214|  7.51k|      pos += 2;
  215|  36.8k|    } else if ((leading_byte & 0b11110000) == 0b11100000) {
  ------------------
  |  Branch (215:16): [True: 35.6k, False: 1.22k]
  ------------------
  216|       |      // We have a three-byte UTF-8
  217|  35.6k|      if (pos + 2 >= len) {
  ------------------
  |  Branch (217:11): [True: 16, False: 35.6k]
  ------------------
  218|     16|        return 0;
  219|     16|      }  // minimal bound checking
  220|       |
  221|  35.6k|      if ((data[pos + 1] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (221:11): [True: 28, False: 35.6k]
  ------------------
  222|     28|        return 0;
  223|     28|      }
  224|  35.6k|      if ((data[pos + 2] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (224:11): [True: 16, False: 35.6k]
  ------------------
  225|     16|        return 0;
  226|     16|      }
  227|       |      // range check
  228|  35.6k|      uint32_t code_point = (leading_byte & 0b00001111) << 12 |
  229|  35.6k|                            (data[pos + 1] & 0b00111111) << 6 |
  230|  35.6k|                            (data[pos + 2] & 0b00111111);
  231|  35.6k|      if (code_point < 0x800 || 0xffff < code_point ||
  ------------------
  |  Branch (231:11): [True: 16, False: 35.6k]
  |  Branch (231:33): [True: 0, False: 35.6k]
  ------------------
  232|  35.6k|          (0xd7ff < code_point && code_point < 0xe000)) {
  ------------------
  |  Branch (232:12): [True: 10.7k, False: 24.8k]
  |  Branch (232:35): [True: 6, False: 10.7k]
  ------------------
  233|     22|        return 0;
  234|     22|      }
  235|  35.5k|      *utf32_output++ = char32_t(code_point);
  236|  35.5k|      pos += 3;
  237|  35.5k|    } else if ((leading_byte & 0b11111000) == 0b11110000) {  // 0b11110000
  ------------------
  |  Branch (237:16): [True: 1.08k, False: 138]
  ------------------
  238|       |      // we have a 4-byte UTF-8 word.
  239|  1.08k|      if (pos + 3 >= len) {
  ------------------
  |  Branch (239:11): [True: 10, False: 1.07k]
  ------------------
  240|     10|        return 0;
  241|     10|      }  // minimal bound checking
  242|  1.07k|      if ((data[pos + 1] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (242:11): [True: 16, False: 1.05k]
  ------------------
  243|     16|        return 0;
  244|     16|      }
  245|  1.05k|      if ((data[pos + 2] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (245:11): [True: 10, False: 1.04k]
  ------------------
  246|     10|        return 0;
  247|     10|      }
  248|  1.04k|      if ((data[pos + 3] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (248:11): [True: 12, False: 1.03k]
  ------------------
  249|     12|        return 0;
  250|     12|      }
  251|       |
  252|       |      // range check
  253|  1.03k|      uint32_t code_point = (leading_byte & 0b00000111) << 18 |
  254|  1.03k|                            (data[pos + 1] & 0b00111111) << 12 |
  255|  1.03k|                            (data[pos + 2] & 0b00111111) << 6 |
  256|  1.03k|                            (data[pos + 3] & 0b00111111);
  257|  1.03k|      if (code_point <= 0xffff || 0x10ffff < code_point) {
  ------------------
  |  Branch (257:11): [True: 14, False: 1.02k]
  |  Branch (257:35): [True: 10, False: 1.01k]
  ------------------
  258|     24|        return 0;
  259|     24|      }
  260|  1.01k|      *utf32_output++ = char32_t(code_point);
  261|  1.01k|      pos += 4;
  262|  1.01k|    } else {
  263|    138|      return 0;
  264|    138|    }
  265|  99.7k|  }
  266|  4.88k|  return utf32_output - start;
  267|  5.31k|}
_ZN3ada4idna22utf32_length_from_utf8EPKcm:
  282|  5.35k|size_t utf32_length_from_utf8(const char* buf, size_t len) {
  283|  5.35k|  const int8_t* p = reinterpret_cast<const int8_t*>(buf);
  284|  5.35k|  return std::count_if(p, std::next(p, len), [](int8_t c) {
  285|       |    // -65 is 0b10111111, anything larger in two-complement's
  286|       |    // should start a new code point.
  287|  5.35k|    return c > -65;
  288|  5.35k|  });
  289|  5.35k|}
_ZN3ada4idna9ascii_mapEPcm:
 5133|  89.5k|void ascii_map(char* input, size_t length) {
 5134|  89.5k|  auto broadcast = [](uint8_t v) -> uint64_t {
 5135|  89.5k|    return 0x101010101010101ull * v;
 5136|  89.5k|  };
 5137|  89.5k|  uint64_t broadcast_80 = broadcast(0x80);
 5138|  89.5k|  uint64_t broadcast_Ap = broadcast(128 - 'A');
 5139|  89.5k|  uint64_t broadcast_Zp = broadcast(128 - 'Z' - 1);
 5140|  89.5k|  size_t i = 0;
 5141|       |
 5142|   262k|  for (; i + 7 < length; i += 8) {
  ------------------
  |  Branch (5142:10): [True: 172k, False: 89.5k]
  ------------------
 5143|   172k|    uint64_t word{};
 5144|   172k|    std::memcpy(&word, input + i, sizeof(word));
 5145|   172k|    word ^=
 5146|   172k|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
 5147|   172k|    std::memcpy(input + i, &word, sizeof(word));
 5148|   172k|  }
 5149|  89.5k|  if (i < length) {
  ------------------
  |  Branch (5149:7): [True: 47.3k, False: 42.2k]
  ------------------
 5150|  47.3k|    uint64_t word{};
 5151|  47.3k|    std::memcpy(&word, input + i, length - i);
 5152|  47.3k|    word ^=
 5153|  47.3k|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
 5154|  47.3k|    std::memcpy(input + i, &word, length - i);
 5155|  47.3k|  }
 5156|  89.5k|}
_ZN3ada4idna3mapENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEERNS1_12basic_stringIDiS4_NS1_9allocatorIDiEEEE:
 5160|  7.48k|bool map(std::u32string_view input, std::u32string& out) {
 5161|       |  //  [Map](https://www.unicode.org/reports/tr46/#ProcessingStepMap).
 5162|  7.48k|  out.clear();
 5163|  7.48k|  if (!ensure_tables()) {
  ------------------
  |  Branch (5163:7): [True: 0, False: 7.48k]
  ------------------
 5164|      0|    return false;
 5165|      0|  }
 5166|       |
 5167|       |  // Pass 1: validate and compute exact output length.
 5168|  7.48k|  size_t out_size = 0;
 5169|   195k|  for (char32_t x : input) {
  ------------------
  |  Branch (5169:19): [True: 195k, False: 7.10k]
  ------------------
 5170|   195k|    uint16_t status = idna_lookup(static_cast<uint32_t>(x));
 5171|   195k|    if (status == IDNA_DISALLOWED) {
  ------------------
  |  Branch (5171:9): [True: 374, False: 195k]
  ------------------
 5172|    374|      return false;
 5173|    374|    }
 5174|   195k|    if (status == IDNA_VALID) {
  ------------------
  |  Branch (5174:9): [True: 131k, False: 64.0k]
  ------------------
 5175|   131k|      ++out_size;
 5176|   131k|      continue;
 5177|   131k|    }
 5178|  64.0k|    if (static_cast<size_t>(status) >= idna_utf8_mappings_size) {
  ------------------
  |  Branch (5178:9): [True: 0, False: 64.0k]
  ------------------
 5179|      0|      return false;
 5180|      0|    }
 5181|  64.0k|    out_size += utf8_count_codepoints(idna_utf8_mappings + status);
 5182|  64.0k|  }
 5183|       |
 5184|       |  // Pass 2: write into a single allocation.
 5185|  7.10k|  out.resize(out_size);
 5186|  7.10k|  size_t w = 0;
 5187|   194k|  for (char32_t x : input) {
  ------------------
  |  Branch (5187:19): [True: 194k, False: 7.10k]
  ------------------
 5188|   194k|    uint16_t status = idna_lookup(static_cast<uint32_t>(x));
 5189|   194k|    if (status == IDNA_VALID) {
  ------------------
  |  Branch (5189:9): [True: 130k, False: 64.0k]
  ------------------
 5190|   130k|      out[w++] = x;
 5191|   130k|      continue;
 5192|   130k|    }
 5193|       |    // IGNORED or mapped (status already validated in pass 1).
 5194|  64.0k|    const uint8_t* ptr = idna_utf8_mappings + status;
 5195|   424k|    while (*ptr != 0) {
  ------------------
  |  Branch (5195:12): [True: 360k, False: 64.0k]
  ------------------
 5196|   360k|      out[w++] = utf8_next(ptr);
 5197|   360k|    }
 5198|  64.0k|  }
 5199|  7.10k|  return true;
 5200|  7.48k|}
_ZN3ada4idna28compute_decomposition_lengthENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5293|  1.40k|    const std::u32string_view input) noexcept {
 5294|  1.40k|  bool decomposition_needed{false};
 5295|  1.40k|  size_t additional_elements{0};
 5296|  90.1k|  for (char32_t current_character : input) {
  ------------------
  |  Branch (5296:35): [True: 90.1k, False: 1.40k]
  ------------------
 5297|  90.1k|    size_t decomposition_length{0};
 5298|       |
 5299|  90.1k|    if (current_character >= hangul_sbase &&
  ------------------
  |  Branch (5299:9): [True: 4.91k, False: 85.2k]
  ------------------
 5300|  4.91k|        current_character < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5300:9): [True: 3.72k, False: 1.19k]
  ------------------
 5301|       |      // Full NFD-style Hangul decomp for the decompose() step.
 5302|  3.72k|      decomposition_length = 2;
 5303|  3.72k|      if ((current_character - hangul_sbase) % hangul_tcount) {
  ------------------
  |  Branch (5303:11): [True: 2.76k, False: 954]
  ------------------
 5304|  2.76k|        decomposition_length = 3;
 5305|  2.76k|      }
 5306|  86.4k|    } else if (current_character < 0x110000) {
  ------------------
  |  Branch (5306:16): [True: 86.4k, False: 0]
  ------------------
 5307|  86.4k|      const uint8_t di = decomposition_index[current_character >> 8];
 5308|  86.4k|      const uint16_t* const decomposition =
 5309|  86.4k|          decomposition_block_row(di) + (current_character % 256);
 5310|  86.4k|      decomposition_length = (decomposition[1] >> 2) - (decomposition[0] >> 2);
 5311|  86.4k|      if ((decomposition_length > 0) && (decomposition[0] & 1)) {
  ------------------
  |  Branch (5311:11): [True: 896, False: 85.5k]
  |  Branch (5311:41): [True: 0, False: 896]
  ------------------
 5312|      0|        decomposition_length = 0;
 5313|      0|      }
 5314|  86.4k|    }
 5315|  90.1k|    if (decomposition_length != 0) {
  ------------------
  |  Branch (5315:9): [True: 4.61k, False: 85.5k]
  ------------------
 5316|  4.61k|      decomposition_needed = true;
 5317|  4.61k|      additional_elements += decomposition_length - 1;
 5318|  4.61k|    }
 5319|  90.1k|  }
 5320|  1.40k|  return {decomposition_needed, additional_elements};
 5321|  1.40k|}
_ZN3ada4idna9decomposeERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEEm:
 5323|    772|void decompose(std::u32string& input, size_t additional_elements) {
 5324|    772|  input.resize(input.size() + additional_elements);
 5325|    772|  for (size_t descending_idx = input.size(),
 5326|    772|              input_count = descending_idx - additional_elements;
 5327|  72.0k|       input_count--;) {
  ------------------
  |  Branch (5327:8): [True: 71.3k, False: 772]
  ------------------
 5328|  71.3k|    if (input[input_count] >= hangul_sbase &&
  ------------------
  |  Branch (5328:9): [True: 4.22k, False: 67.0k]
  ------------------
 5329|  4.22k|        input[input_count] < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5329:9): [True: 3.72k, False: 500]
  ------------------
 5330|       |      // Hangul decomposition.
 5331|  3.72k|      char32_t s_index = input[input_count] - hangul_sbase;
 5332|  3.72k|      if (s_index % hangul_tcount != 0) {
  ------------------
  |  Branch (5332:11): [True: 2.76k, False: 954]
  ------------------
 5333|  2.76k|        input[--descending_idx] = hangul_tbase + s_index % hangul_tcount;
 5334|  2.76k|      }
 5335|  3.72k|      input[--descending_idx] =
 5336|  3.72k|          hangul_vbase + (s_index % hangul_ncount) / hangul_tcount;
 5337|  3.72k|      input[--descending_idx] = hangul_lbase + s_index / hangul_ncount;
 5338|  67.5k|    } else if (input[input_count] < 0x110000) {
  ------------------
  |  Branch (5338:16): [True: 67.5k, False: 0]
  ------------------
 5339|  67.5k|      const uint16_t* decomposition =
 5340|  67.5k|          decomposition_block_row(
 5341|  67.5k|              decomposition_index[input[input_count] >> 8]) +
 5342|  67.5k|          (input[input_count] % 256);
 5343|  67.5k|      uint16_t decomposition_length =
 5344|  67.5k|          (decomposition[1] >> 2) - (decomposition[0] >> 2);
 5345|  67.5k|      if (decomposition_length > 0 && (decomposition[0] & 1)) {
  ------------------
  |  Branch (5345:11): [True: 896, False: 66.6k]
  |  Branch (5345:39): [True: 0, False: 896]
  ------------------
 5346|      0|        decomposition_length = 0;
 5347|      0|      }
 5348|  67.5k|      if (decomposition_length > 0) {
  ------------------
  |  Branch (5348:11): [True: 896, False: 66.6k]
  ------------------
 5349|    896|        const size_t base = static_cast<size_t>(decomposition[0] >> 2);
 5350|    896|        if (base + decomposition_length > decomposition_data_size) {
  ------------------
  |  Branch (5350:13): [True: 0, False: 896]
  ------------------
 5351|      0|          input[--descending_idx] = input[input_count];
 5352|    896|        } else {
 5353|  3.01k|          while (decomposition_length-- > 0) {
  ------------------
  |  Branch (5353:18): [True: 2.12k, False: 896]
  ------------------
 5354|  2.12k|            input[--descending_idx] =
 5355|  2.12k|                decomposition_data[base + decomposition_length];
 5356|  2.12k|          }
 5357|    896|        }
 5358|  66.6k|      } else {
 5359|  66.6k|        input[--descending_idx] = input[input_count];
 5360|  66.6k|      }
 5361|  67.5k|    } else {
 5362|      0|      input[--descending_idx] = input[input_count];
 5363|      0|    }
 5364|  71.3k|  }
 5365|    772|}
_ZN3ada4idna7get_cccEDi:
 5367|  1.09M|uint8_t get_ccc(char32_t c) noexcept {
 5368|  1.09M|  if (c >= 0x110000) {
  ------------------
  |  Branch (5368:7): [True: 0, False: 1.09M]
  ------------------
 5369|      0|    return 0;
 5370|      0|  }
 5371|  1.09M|  return ccc_block_row(ccc_index[c >> 8])[c % 256];
 5372|  1.09M|}
_ZN3ada4idna10sort_marksERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 5374|  1.40k|void sort_marks(std::u32string& input) {
 5375|  97.8k|  for (size_t idx = 1; idx < input.size(); idx++) {
  ------------------
  |  Branch (5375:24): [True: 96.4k, False: 1.40k]
  ------------------
 5376|  96.4k|    uint8_t ccc = get_ccc(input[idx]);
 5377|  96.4k|    if (ccc == 0) {
  ------------------
  |  Branch (5377:9): [True: 92.1k, False: 4.28k]
  ------------------
 5378|  92.1k|      continue;
 5379|  92.1k|    }
 5380|  4.28k|    auto current_character = input[idx];
 5381|  4.28k|    size_t back_idx = idx;
 5382|  6.16k|    while (back_idx != 0 && get_ccc(input[back_idx - 1]) > ccc) {
  ------------------
  |  Branch (5382:12): [True: 6.00k, False: 162]
  |  Branch (5382:29): [True: 1.87k, False: 4.12k]
  ------------------
 5383|  1.87k|      input[back_idx] = input[back_idx - 1];
 5384|  1.87k|      back_idx--;
 5385|  1.87k|    }
 5386|  4.28k|    input[back_idx] = current_character;
 5387|  4.28k|  }
 5388|  1.40k|}
_ZN3ada4idna13decompose_nfcERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 5390|  1.40k|void decompose_nfc(std::u32string& input) {
 5391|       |  /**
 5392|       |   * Decompose the domain_name string to Unicode Normalization Form C.
 5393|       |   * @see https://www.unicode.org/reports/tr46/#ProcessingStepDecompose
 5394|       |   */
 5395|  1.40k|  auto [decomposition_needed, additional_elements] =
 5396|  1.40k|      compute_decomposition_length(input);
 5397|  1.40k|  if (decomposition_needed) {
  ------------------
  |  Branch (5397:7): [True: 772, False: 630]
  ------------------
 5398|    772|    decompose(input, additional_elements);
 5399|    772|  }
 5400|  1.40k|  sort_marks(input);
 5401|  1.40k|}
_ZN3ada4idna14is_already_nfcENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5468|  7.99k|bool is_already_nfc(std::u32string_view input) noexcept {
 5469|  7.99k|  if (input.empty()) {
  ------------------
  |  Branch (5469:7): [True: 0, False: 7.99k]
  ------------------
 5470|      0|    return true;
 5471|      0|  }
 5472|  7.99k|  if (!tables_are_ready() && !ensure_tables()) {
  ------------------
  |  Branch (5472:7): [True: 0, False: 7.99k]
  |  Branch (5472:30): [True: 0, False: 0]
  ------------------
 5473|      0|    return false;
 5474|      0|  }
 5475|       |  // 1) Singleton decompositions are never NFC (e.g. U+212B ANGSTROM SIGN).
 5476|       |  //    Multi-code-point decomps are primary composites that are NFC as-is.
 5477|   498k|  for (char32_t c : input) {
  ------------------
  |  Branch (5477:19): [True: 498k, False: 7.99k]
  ------------------
 5478|   498k|    if (canonical_decomp_length(c) == 1) {
  ------------------
  |  Branch (5478:9): [True: 0, False: 498k]
  ------------------
 5479|      0|      return false;
 5480|      0|    }
 5481|   498k|  }
 5482|       |  // 2) Combining marks already in canonical order.
 5483|  7.99k|  uint8_t prev_ccc = 0;
 5484|   493k|  for (char32_t c : input) {
  ------------------
  |  Branch (5484:19): [True: 493k, False: 7.58k]
  ------------------
 5485|   493k|    uint8_t ccc = get_ccc(c);
 5486|   493k|    if (ccc != 0 && prev_ccc > ccc) {
  ------------------
  |  Branch (5486:9): [True: 6.24k, False: 486k]
  |  Branch (5486:21): [True: 412, False: 5.83k]
  ------------------
 5487|    412|      return false;
 5488|    412|    }
 5489|   492k|    prev_ccc = ccc;
 5490|   492k|  }
 5491|       |  // 3) No pairwise composition would apply (including Hangul L+V / LV+T).
 5492|  7.58k|  return !would_compose(input);
 5493|  7.99k|}
_ZN3ada4idna7composeERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 5495|  1.40k|void compose(std::u32string& input) {
 5496|       |  /**
 5497|       |   * Compose the domain_name string to Unicode Normalization Form C.
 5498|       |   * @see https://www.unicode.org/reports/tr46/#ProcessingStepCompose
 5499|       |   */
 5500|  1.40k|  size_t input_count{0};
 5501|  1.40k|  size_t composition_count{0};
 5502|  88.5k|  for (; input_count < input.size(); input_count++, composition_count++) {
  ------------------
  |  Branch (5502:10): [True: 87.1k, False: 1.40k]
  ------------------
 5503|  87.1k|    input[composition_count] = input[input_count];
 5504|  87.1k|    if (input[input_count] >= hangul_lbase &&
  ------------------
  |  Branch (5504:9): [True: 8.73k, False: 78.4k]
  ------------------
 5505|  8.73k|        input[input_count] < hangul_lbase + hangul_lcount) {
  ------------------
  |  Branch (5505:9): [True: 4.96k, False: 3.76k]
  ------------------
 5506|  4.96k|      if (input_count + 1 < input.size() &&
  ------------------
  |  Branch (5506:11): [True: 4.88k, False: 84]
  ------------------
 5507|  4.88k|          input[input_count + 1] >= hangul_vbase &&
  ------------------
  |  Branch (5507:11): [True: 4.33k, False: 550]
  ------------------
 5508|  4.33k|          input[input_count + 1] < hangul_vbase + hangul_vcount) {
  ------------------
  |  Branch (5508:11): [True: 3.82k, False: 508]
  ------------------
 5509|  3.82k|        input[composition_count] =
 5510|  3.82k|            hangul_sbase +
 5511|  3.82k|            ((input[input_count] - hangul_lbase) * hangul_vcount +
 5512|  3.82k|             input[input_count + 1] - hangul_vbase) *
 5513|  3.82k|                hangul_tcount;
 5514|  3.82k|        input_count++;
 5515|  3.82k|        if (input_count + 1 < input.size() &&
  ------------------
  |  Branch (5515:13): [True: 3.73k, False: 96]
  ------------------
 5516|  3.73k|            input[input_count + 1] > hangul_tbase &&
  ------------------
  |  Branch (5516:13): [True: 2.99k, False: 736]
  ------------------
 5517|  2.99k|            input[input_count + 1] < hangul_tbase + hangul_tcount) {
  ------------------
  |  Branch (5517:13): [True: 2.77k, False: 220]
  ------------------
 5518|  2.77k|          input[composition_count] += input[++input_count] - hangul_tbase;
 5519|  2.77k|        }
 5520|  3.82k|      }
 5521|  82.2k|    } else if (input[input_count] >= hangul_sbase &&
  ------------------
  |  Branch (5521:16): [True: 910, False: 81.3k]
  ------------------
 5522|    910|               input[input_count] < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5522:16): [True: 0, False: 910]
  ------------------
 5523|      0|      if ((input[input_count] - hangul_sbase) % hangul_tcount &&
  ------------------
  |  Branch (5523:11): [True: 0, False: 0]
  ------------------
 5524|      0|          input_count + 1 < input.size() &&
  ------------------
  |  Branch (5524:11): [True: 0, False: 0]
  ------------------
 5525|      0|          input[input_count + 1] > hangul_tbase &&
  ------------------
  |  Branch (5525:11): [True: 0, False: 0]
  ------------------
 5526|      0|          input[input_count + 1] < hangul_tbase + hangul_tcount) {
  ------------------
  |  Branch (5526:11): [True: 0, False: 0]
  ------------------
 5527|      0|        input[composition_count] += input[++input_count] - hangul_tbase;
 5528|      0|      }
 5529|  82.2k|    } else if (input[input_count] < 0x110000) {
  ------------------
  |  Branch (5529:16): [True: 82.2k, False: 0]
  ------------------
 5530|  82.2k|      const uint16_t* composition =
 5531|  82.2k|          composition_block_row(composition_index[input[input_count] >> 8]) +
 5532|  82.2k|          (input[input_count] % 256);
 5533|  82.2k|      size_t initial_composition_count = composition_count;
 5534|  86.3k|      for (int32_t previous_ccc = -1; input_count + 1 < input.size();
  ------------------
  |  Branch (5534:39): [True: 85.1k, False: 1.17k]
  ------------------
 5535|  85.1k|           input_count++) {
 5536|  85.1k|        uint8_t ccc = get_ccc(input[input_count + 1]);
 5537|       |
 5538|  85.1k|        if (composition[1] != composition[0] && previous_ccc < ccc) {
  ------------------
  |  Branch (5538:13): [True: 18.6k, False: 66.5k]
  |  Branch (5538:49): [True: 17.9k, False: 656]
  ------------------
 5539|  17.9k|          int left = composition[0];
 5540|  17.9k|          int right = composition[1];
 5541|  17.9k|          if (left < 0 || right < left ||
  ------------------
  |  Branch (5541:15): [True: 0, False: 17.9k]
  |  Branch (5541:27): [True: 0, False: 17.9k]
  ------------------
 5542|  17.9k|              static_cast<size_t>(right) > composition_data_size) {
  ------------------
  |  Branch (5542:15): [True: 0, False: 17.9k]
  ------------------
 5543|      0|            break;
 5544|      0|          }
 5545|  35.2k|          while (left + 2 < right) {
  ------------------
  |  Branch (5545:18): [True: 17.3k, False: 17.9k]
  ------------------
 5546|  17.3k|            int middle = left + (((right - left) >> 1) & ~1);
 5547|  17.3k|            if (composition_data[static_cast<size_t>(middle)] <=
  ------------------
  |  Branch (5547:17): [True: 3.51k, False: 13.8k]
  ------------------
 5548|  17.3k|                input[input_count + 1]) {
 5549|  3.51k|              left = middle;
 5550|  3.51k|            }
 5551|  17.3k|            if (composition_data[static_cast<size_t>(middle)] >=
  ------------------
  |  Branch (5551:17): [True: 15.0k, False: 2.27k]
  ------------------
 5552|  17.3k|                input[input_count + 1]) {
 5553|  15.0k|              right = middle;
 5554|  15.0k|            }
 5555|  17.3k|          }
 5556|  17.9k|          if (static_cast<size_t>(left + 1) < composition_data_size &&
  ------------------
  |  Branch (5556:15): [True: 17.9k, False: 0]
  ------------------
 5557|  17.9k|              composition_data[static_cast<size_t>(left)] ==
  ------------------
  |  Branch (5557:15): [True: 1.92k, False: 16.0k]
  ------------------
 5558|  17.9k|                  input[input_count + 1]) {
 5559|  1.92k|            char32_t composed = composition_data[static_cast<size_t>(left + 1)];
 5560|  1.92k|            input[initial_composition_count] = composed;
 5561|  1.92k|            composition =
 5562|  1.92k|                composition_block_row(composition_index[composed >> 8]) +
 5563|  1.92k|                (composed % 256);
 5564|  1.92k|            continue;
 5565|  1.92k|          }
 5566|  17.9k|        }
 5567|       |
 5568|  83.2k|        if (ccc == 0) {
  ------------------
  |  Branch (5568:13): [True: 81.0k, False: 2.16k]
  ------------------
 5569|  81.0k|          break;
 5570|  81.0k|        }
 5571|  2.16k|        previous_ccc = ccc;
 5572|  2.16k|        input[++composition_count] = input[input_count + 1];
 5573|  2.16k|      }
 5574|  82.2k|    }
 5575|  87.1k|  }
 5576|       |
 5577|  1.40k|  if (composition_count < input_count) {
  ------------------
  |  Branch (5577:7): [True: 1.24k, False: 156]
  ------------------
 5578|  1.24k|    input.resize(composition_count);
 5579|  1.24k|  }
 5580|  1.40k|}
_ZN3ada4idna9normalizeERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 5582|  1.40k|bool normalize(std::u32string& input) {
 5583|       |  /**
 5584|       |   * Normalize the characters according to IDNA (Unicode Normalization Form C).
 5585|       |   * @see https://www.unicode.org/reports/tr46/#ProcessingStepNormalize
 5586|       |   */
 5587|  1.40k|  if (!ensure_tables() || decomposition_index == nullptr ||
  ------------------
  |  Branch (5587:7): [True: 0, False: 1.40k]
  |  Branch (5587:27): [True: 0, False: 1.40k]
  ------------------
 5588|  1.40k|      composition_index == nullptr) {
  ------------------
  |  Branch (5588:7): [True: 0, False: 1.40k]
  ------------------
 5589|      0|    return false;
 5590|      0|  }
 5591|  1.40k|  if (is_already_nfc(input)) {
  ------------------
  |  Branch (5591:7): [True: 0, False: 1.40k]
  ------------------
 5592|      0|    return true;
 5593|      0|  }
 5594|  1.40k|  decompose_nfc(input);
 5595|  1.40k|  compose(input);
 5596|  1.40k|  return true;
 5597|  1.40k|}
_ZN3ada4idna17punycode_to_utf32ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEERNS1_12basic_stringIDiNS3_IDiEENS1_9allocatorIDiEEEE:
 5657|  2.84k|bool punycode_to_utf32(std::string_view input, std::u32string &out) {
 5658|  2.84k|  int32_t written_out{0};
 5659|  2.84k|  out.reserve(out.size() + input.size());
 5660|  2.84k|  uint32_t n = initial_n;
 5661|  2.84k|  int32_t i = 0;
 5662|  2.84k|  int32_t bias = initial_bias;
 5663|       |  // grab ascii content
 5664|  2.84k|  size_t end_of_ascii = input.find_last_of('-');
 5665|  2.84k|  if (end_of_ascii != std::string_view::npos) {
  ------------------
  |  Branch (5665:7): [True: 912, False: 1.93k]
  ------------------
 5666|  9.29k|    for (uint8_t c : input.substr(0, end_of_ascii)) {
  ------------------
  |  Branch (5666:20): [True: 9.29k, False: 912]
  ------------------
 5667|  9.29k|      if (c >= 0x80) {
  ------------------
  |  Branch (5667:11): [True: 0, False: 9.29k]
  ------------------
 5668|      0|        return false;
 5669|      0|      }
 5670|  9.29k|      out.push_back(c);
 5671|  9.29k|      written_out++;
 5672|  9.29k|    }
 5673|    912|    input.remove_prefix(end_of_ascii + 1);
 5674|    912|  }
 5675|  29.6k|  while (!input.empty()) {
  ------------------
  |  Branch (5675:10): [True: 26.9k, False: 2.69k]
  ------------------
 5676|  26.9k|    int32_t oldi = i;
 5677|  26.9k|    int32_t w = 1;
 5678|  41.2k|    for (int32_t k = base;; k += base) {
 5679|  41.2k|      if (input.empty()) {
  ------------------
  |  Branch (5679:11): [True: 44, False: 41.2k]
  ------------------
 5680|     44|        return false;
 5681|     44|      }
 5682|  41.2k|      uint8_t code_point = input.front();
 5683|  41.2k|      input.remove_prefix(1);
 5684|  41.2k|      int32_t digit = char_to_digit_value(code_point);
 5685|  41.2k|      if (digit < 0) {
  ------------------
  |  Branch (5685:11): [True: 42, False: 41.2k]
  ------------------
 5686|     42|        return false;
 5687|     42|      }
 5688|  41.2k|      if (digit > (0x7fffffff - i) / w) {
  ------------------
  |  Branch (5688:11): [True: 8, False: 41.1k]
  ------------------
 5689|      8|        return false;
 5690|      8|      }
 5691|  41.1k|      i = i + digit * w;
 5692|  41.1k|      int32_t t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;
  ------------------
  |  Branch (5692:19): [True: 8.35k, False: 32.8k]
  |  Branch (5692:38): [True: 29.9k, False: 2.90k]
  ------------------
 5693|  41.1k|      if (digit < t) {
  ------------------
  |  Branch (5693:11): [True: 26.8k, False: 14.3k]
  ------------------
 5694|  26.8k|        break;
 5695|  26.8k|      }
 5696|  14.3k|      if (w > 0x7fffffff / (base - t)) {
  ------------------
  |  Branch (5696:11): [True: 0, False: 14.3k]
  ------------------
 5697|      0|        return false;
 5698|      0|      }
 5699|  14.3k|      w = w * (base - t);
 5700|  14.3k|    }
 5701|  26.8k|    bias = adapt(i - oldi, written_out + 1, oldi == 0);
 5702|  26.8k|    if (i / (written_out + 1) > int32_t(0x7fffffff - n)) {
  ------------------
  |  Branch (5702:9): [True: 54, False: 26.8k]
  ------------------
 5703|     54|      return false;
 5704|     54|    }
 5705|  26.8k|    n = n + i / (written_out + 1);
 5706|  26.8k|    i = i % (written_out + 1);
 5707|  26.8k|    if (n < 0x80) {
  ------------------
  |  Branch (5707:9): [True: 0, False: 26.8k]
  ------------------
 5708|      0|      return false;
 5709|      0|    }
 5710|  26.8k|    out.insert(out.begin() + i, n);
 5711|  26.8k|    written_out++;
 5712|  26.8k|    ++i;
 5713|  26.8k|  }
 5714|       |  // See https://github.com/whatwg/url/issues/803
 5715|       |  // Reject labels whose decoded form begins with "xn--" (double-encoded ACE).
 5716|  2.69k|  if (out.size() >= 4 && out[0] == U'x' && out[1] == U'n' && out[2] == U'-' &&
  ------------------
  |  Branch (5716:7): [True: 1.35k, False: 1.33k]
  |  Branch (5716:26): [True: 332, False: 1.02k]
  |  Branch (5716:44): [True: 230, False: 102]
  |  Branch (5716:62): [True: 126, False: 104]
  ------------------
 5717|    126|      out[3] == U'-') {
  ------------------
  |  Branch (5717:7): [True: 8, False: 118]
  ------------------
 5718|      8|    return false;
 5719|      8|  }
 5720|  2.68k|  return true;
 5721|  2.69k|}
_ZN3ada4idna17utf32_to_punycodeENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEERNS1_12basic_stringIcNS3_IcEENS1_9allocatorIcEEEE:
 5801|  24.7k|bool utf32_to_punycode(std::u32string_view input, std::string &out) {
 5802|  24.7k|  out.reserve(input.size() + out.size());
 5803|  24.7k|  uint32_t n = initial_n;
 5804|  24.7k|  int32_t d = 0;
 5805|  24.7k|  int32_t bias = initial_bias;
 5806|  24.7k|  size_t h = 0;
 5807|       |  // first push the ascii content
 5808|   243k|  for (uint32_t c : input) {
  ------------------
  |  Branch (5808:19): [True: 243k, False: 24.7k]
  ------------------
 5809|   243k|    if (c < 0x80) {
  ------------------
  |  Branch (5809:9): [True: 77.7k, False: 165k]
  ------------------
 5810|  77.7k|      ++h;
 5811|  77.7k|      out.push_back(char(c));
 5812|  77.7k|    }
 5813|   243k|    if (c > 0x10ffff || (c >= 0xd800 && c < 0xe000)) {
  ------------------
  |  Branch (5813:9): [True: 0, False: 243k]
  |  Branch (5813:26): [True: 894, False: 242k]
  |  Branch (5813:41): [True: 0, False: 894]
  ------------------
 5814|      0|      return false;
 5815|      0|    }
 5816|   243k|  }
 5817|  24.7k|  size_t b = h;
 5818|  24.7k|  if (b > 0) {
  ------------------
  |  Branch (5818:7): [True: 20.9k, False: 3.81k]
  ------------------
 5819|  20.9k|    out.push_back('-');
 5820|  20.9k|  }
 5821|  74.2k|  while (h < input.size()) {
  ------------------
  |  Branch (5821:10): [True: 49.5k, False: 24.7k]
  ------------------
 5822|  49.5k|    uint32_t m = 0x10FFFF;
 5823|  2.07M|    for (auto code_point : input) {
  ------------------
  |  Branch (5823:26): [True: 2.07M, False: 49.5k]
  ------------------
 5824|  2.07M|      if (code_point >= n && code_point < m) m = code_point;
  ------------------
  |  Branch (5824:11): [True: 778k, False: 1.30M]
  |  Branch (5824:30): [True: 54.7k, False: 724k]
  ------------------
 5825|  2.07M|    }
 5826|       |
 5827|  49.5k|    if ((m - n) > (0x7fffffff - d) / (h + 1)) {
  ------------------
  |  Branch (5827:9): [True: 0, False: 49.5k]
  ------------------
 5828|      0|      return false;
 5829|      0|    }
 5830|  49.5k|    d = d + int32_t((m - n) * (h + 1));
 5831|  49.5k|    n = m;
 5832|  2.07M|    for (auto c : input) {
  ------------------
  |  Branch (5832:17): [True: 2.07M, False: 49.5k]
  ------------------
 5833|  2.07M|      if (c < n) {
  ------------------
  |  Branch (5833:11): [True: 1.30M, False: 778k]
  ------------------
 5834|  1.30M|        if (d == 0x7fffffff) {
  ------------------
  |  Branch (5834:13): [True: 0, False: 1.30M]
  ------------------
 5835|      0|          return false;
 5836|      0|        }
 5837|  1.30M|        ++d;
 5838|  1.30M|      }
 5839|  2.07M|      if (c == n) {
  ------------------
  |  Branch (5839:11): [True: 165k, False: 1.91M]
  ------------------
 5840|   165k|        int32_t q = d;
 5841|   306k|        for (int32_t k = base;; k += base) {
 5842|   306k|          int32_t t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;
  ------------------
  |  Branch (5842:23): [True: 52.6k, False: 253k]
  |  Branch (5842:42): [True: 231k, False: 21.9k]
  ------------------
 5843|       |
 5844|   306k|          if (q < t) {
  ------------------
  |  Branch (5844:15): [True: 165k, False: 140k]
  ------------------
 5845|   165k|            break;
 5846|   165k|          }
 5847|   140k|          out.push_back(digit_to_char(t + ((q - t) % (base - t))));
 5848|   140k|          q = (q - t) / (base - t);
 5849|   140k|        }
 5850|   165k|        out.push_back(digit_to_char(q));
 5851|   165k|        bias = adapt(d, int32_t(h + 1), h == b);
 5852|   165k|        d = 0;
 5853|   165k|        ++h;
 5854|   165k|      }
 5855|  2.07M|    }
 5856|  49.5k|    ++d;
 5857|  49.5k|    ++n;
 5858|  49.5k|  }
 5859|  24.7k|  return true;
 5860|  24.7k|}
_ZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5944|  27.6k|bool is_label_valid(const std::u32string_view label) {
 5945|  27.6k|  if (label.empty()) {
  ------------------
  |  Branch (5945:7): [True: 0, False: 27.6k]
  ------------------
 5946|      0|    return true;
 5947|      0|  }
 5948|  27.6k|  if (!ensure_tables() || combining_ranges == nullptr || dir_start == nullptr ||
  ------------------
  |  Branch (5948:7): [True: 0, False: 27.6k]
  |  Branch (5948:27): [True: 0, False: 27.6k]
  |  Branch (5948:58): [True: 0, False: 27.6k]
  ------------------
 5949|  27.6k|      dir_final == nullptr || dir_value == nullptr) {
  ------------------
  |  Branch (5949:7): [True: 0, False: 27.6k]
  |  Branch (5949:31): [True: 0, False: 27.6k]
  ------------------
 5950|      0|    return false;
 5951|      0|  }
 5952|       |
 5953|       |  ///////////////
 5954|       |  // We have a normalization step which ensures that we are in NFC.
 5955|       |  // If we receive punycode, we normalize and check that the normalized
 5956|       |  // version matches the original.
 5957|       |  // --------------------------------------
 5958|       |  // The label must be in Unicode Normalization Form NFC.
 5959|       |
 5960|       |  // Current URL standard indicatest that CheckHyphens is set to false.
 5961|       |  // ---------------------------------------
 5962|       |  // If CheckHyphens, the label must not contain a U+002D HYPHEN-MINUS character
 5963|       |  // in both the third and fourth positions. If CheckHyphens, the label must
 5964|       |  // neither begin nor end with a U+002D HYPHEN-MINUS character.
 5965|       |
 5966|       |  // This is not necessary because we segment the
 5967|       |  // labels by '.'.
 5968|       |  // ---------------------------------------
 5969|       |  // The label must not contain a U+002E ( . ) FULL STOP.
 5970|       |  // if (label.find('.') != std::string_view::npos) return false;
 5971|       |
 5972|       |  // The label must not begin with a combining mark.
 5973|       |  // Range membership via lower_bound on range end.
 5974|  27.6k|  const std::span<const uint32_t[2]> comb_span{combining_ranges,
 5975|  27.6k|                                               combining_range_count};
 5976|  27.6k|  const auto comb_it = std::ranges::lower_bound(
 5977|  27.6k|      comb_span, label.front(), {}, [](const auto& range) { return range[1]; });
 5978|  27.6k|  if (comb_it != comb_span.end() && label.front() >= (*comb_it)[0]) {
  ------------------
  |  Branch (5978:7): [True: 27.6k, False: 0]
  |  Branch (5978:7): [True: 112, False: 27.5k]
  |  Branch (5978:37): [True: 112, False: 27.5k]
  ------------------
 5979|    112|    return false;
 5980|    112|  }
 5981|       |  // We verify this next step as part of the mapping:
 5982|       |  // ---------------------------------------------
 5983|       |  // Each code point in the label must only have certain status values
 5984|       |  // according to Section 5, IDNA Mapping Table:
 5985|       |  // - For Transitional Processing, each value must be valid.
 5986|       |  // - For Nontransitional Processing, each value must be either valid or
 5987|       |  // deviation.
 5988|       |
 5989|       |  // If CheckJoiners, the label must satisfy the ContextJ rules from Appendix
 5990|       |  // A, in The Unicode Code Points and Internationalized Domain Names for
 5991|       |  // Applications (IDNA) [IDNA2008].
 5992|  27.5k|  constexpr static uint32_t virama[] = {
 5993|  27.5k|      0x094D,  0x09CD,  0x0A4D,  0x0ACD,  0x0B4D,  0x0BCD,  0x0C4D,  0x0CCD,
 5994|  27.5k|      0x0D3B,  0x0D3C,  0x0D4D,  0x0DCA,  0x0E3A,  0x0EBA,  0x0F84,  0x1039,
 5995|  27.5k|      0x103A,  0x1714,  0x1734,  0x17D2,  0x1A60,  0x1B44,  0x1BAA,  0x1BAB,
 5996|  27.5k|      0x1BF2,  0x1BF3,  0x2D7F,  0xA806,  0xA82C,  0xA8C4,  0xA953,  0xA9C0,
 5997|  27.5k|      0xAAF6,  0xABED,  0x10A3F, 0x11046, 0x1107F, 0x110B9, 0x11133, 0x11134,
 5998|  27.5k|      0x111C0, 0x11235, 0x112EA, 0x1134D, 0x11442, 0x114C2, 0x115BF, 0x1163F,
 5999|  27.5k|      0x116B6, 0x1172B, 0x11839, 0x1193D, 0x1193E, 0x119E0, 0x11A34, 0x11A47,
 6000|  27.5k|      0x11A99, 0x11C3F, 0x11D44, 0x11D45, 0x11D97};
 6001|  27.5k|  constexpr static uint32_t R[] = {
 6002|  27.5k|      0x622, 0x623, 0x624, 0x625, 0x627, 0x629, 0x62f, 0x630, 0x631,
 6003|  27.5k|      0x632, 0x648, 0x671, 0x672, 0x673, 0x675, 0x676, 0x677, 0x688,
 6004|  27.5k|      0x689, 0x68a, 0x68b, 0x68c, 0x68d, 0x68e, 0x68f, 0x690, 0x691,
 6005|  27.5k|      0x692, 0x693, 0x694, 0x695, 0x696, 0x697, 0x698, 0x699, 0x6c0,
 6006|  27.5k|      0x6c3, 0x6c4, 0x6c5, 0x6c6, 0x6c7, 0x6c8, 0x6c9, 0x6ca, 0x6cb,
 6007|  27.5k|      0x6cd, 0x6cf, 0x6d2, 0x6d3, 0x6d5, 0x6ee, 0x6ef, 0x710, 0x715,
 6008|  27.5k|      0x716, 0x717, 0x718, 0x719, 0x71e, 0x728, 0x72a, 0x72c, 0x72f,
 6009|  27.5k|      0x74d, 0x759, 0x75a, 0x75b, 0x854, 0x8aa, 0x8ab, 0x8ac};
 6010|  27.5k|  constexpr static uint32_t L[] = {0xa872};
 6011|  27.5k|  constexpr static uint32_t D[] = {
 6012|  27.5k|      0x620,  0x626,  0x628,  0x62a,  0x62b,  0x62c,  0x62d,  0x62e,  0x633,
 6013|  27.5k|      0x634,  0x635,  0x636,  0x637,  0x638,  0x639,  0x63a,  0x63b,  0x63c,
 6014|  27.5k|      0x63d,  0x63e,  0x63f,  0x641,  0x642,  0x643,  0x644,  0x645,  0x646,
 6015|  27.5k|      0x647,  0x649,  0x64a,  0x66e,  0x66f,  0x678,  0x679,  0x67a,  0x67b,
 6016|  27.5k|      0x67c,  0x67d,  0x67e,  0x67f,  0x680,  0x681,  0x682,  0x683,  0x684,
 6017|  27.5k|      0x685,  0x686,  0x687,  0x69a,  0x69b,  0x69c,  0x69d,  0x69e,  0x69f,
 6018|  27.5k|      0x6a0,  0x6a1,  0x6a2,  0x6a3,  0x6a4,  0x6a5,  0x6a6,  0x6a7,  0x6a8,
 6019|  27.5k|      0x6a9,  0x6aa,  0x6ab,  0x6ac,  0x6ad,  0x6ae,  0x6af,  0x6b0,  0x6b1,
 6020|  27.5k|      0x6b2,  0x6b3,  0x6b4,  0x6b5,  0x6b6,  0x6b7,  0x6b8,  0x6b9,  0x6ba,
 6021|  27.5k|      0x6bb,  0x6bc,  0x6bd,  0x6be,  0x6bf,  0x6c1,  0x6c2,  0x6cc,  0x6ce,
 6022|  27.5k|      0x6d0,  0x6d1,  0x6fa,  0x6fb,  0x6fc,  0x6ff,  0x712,  0x713,  0x714,
 6023|  27.5k|      0x71a,  0x71b,  0x71c,  0x71d,  0x71f,  0x720,  0x721,  0x722,  0x723,
 6024|  27.5k|      0x724,  0x725,  0x726,  0x727,  0x729,  0x72b,  0x72d,  0x72e,  0x74e,
 6025|  27.5k|      0x74f,  0x750,  0x751,  0x752,  0x753,  0x754,  0x755,  0x756,  0x757,
 6026|  27.5k|      0x758,  0x75c,  0x75d,  0x75e,  0x75f,  0x760,  0x761,  0x762,  0x763,
 6027|  27.5k|      0x764,  0x765,  0x766,  0x850,  0x851,  0x852,  0x853,  0x855,  0x8a0,
 6028|  27.5k|      0x8a2,  0x8a3,  0x8a4,  0x8a5,  0x8a6,  0x8a7,  0x8a8,  0x8a9,  0x1807,
 6029|  27.5k|      0x1820, 0x1821, 0x1822, 0x1823, 0x1824, 0x1825, 0x1826, 0x1827, 0x1828,
 6030|  27.5k|      0x1829, 0x182a, 0x182b, 0x182c, 0x182d, 0x182e, 0x182f, 0x1830, 0x1831,
 6031|  27.5k|      0x1832, 0x1833, 0x1834, 0x1835, 0x1836, 0x1837, 0x1838, 0x1839, 0x183a,
 6032|  27.5k|      0x183b, 0x183c, 0x183d, 0x183e, 0x183f, 0x1840, 0x1841, 0x1842, 0x1843,
 6033|  27.5k|      0x1844, 0x1845, 0x1846, 0x1847, 0x1848, 0x1849, 0x184a, 0x184b, 0x184c,
 6034|  27.5k|      0x184d, 0x184e, 0x184f, 0x1850, 0x1851, 0x1852, 0x1853, 0x1854, 0x1855,
 6035|  27.5k|      0x1856, 0x1857, 0x1858, 0x1859, 0x185a, 0x185b, 0x185c, 0x185d, 0x185e,
 6036|  27.5k|      0x185f, 0x1860, 0x1861, 0x1862, 0x1863, 0x1864, 0x1865, 0x1866, 0x1867,
 6037|  27.5k|      0x1868, 0x1869, 0x186a, 0x186b, 0x186c, 0x186d, 0x186e, 0x186f, 0x1870,
 6038|  27.5k|      0x1871, 0x1872, 0x1873, 0x1874, 0x1875, 0x1876, 0x1877, 0x1887, 0x1888,
 6039|  27.5k|      0x1889, 0x188a, 0x188b, 0x188c, 0x188d, 0x188e, 0x188f, 0x1890, 0x1891,
 6040|  27.5k|      0x1892, 0x1893, 0x1894, 0x1895, 0x1896, 0x1897, 0x1898, 0x1899, 0x189a,
 6041|  27.5k|      0x189b, 0x189c, 0x189d, 0x189e, 0x189f, 0x18a0, 0x18a1, 0x18a2, 0x18a3,
 6042|  27.5k|      0x18a4, 0x18a5, 0x18a6, 0x18a7, 0x18a8, 0x18aa, 0xa840, 0xa841, 0xa842,
 6043|  27.5k|      0xa843, 0xa844, 0xa845, 0xa846, 0xa847, 0xa848, 0xa849, 0xa84a, 0xa84b,
 6044|  27.5k|      0xa84c, 0xa84d, 0xa84e, 0xa84f, 0xa850, 0xa851, 0xa852, 0xa853, 0xa854,
 6045|  27.5k|      0xa855, 0xa856, 0xa857, 0xa858, 0xa859, 0xa85a, 0xa85b, 0xa85c, 0xa85d,
 6046|  27.5k|      0xa85e, 0xa85f, 0xa860, 0xa861, 0xa862, 0xa863, 0xa864, 0xa865, 0xa866,
 6047|  27.5k|      0xa867, 0xa868, 0xa869, 0xa86a, 0xa86b, 0xa86c, 0xa86d, 0xa86e, 0xa86f,
 6048|  27.5k|      0xa870, 0xa871};
 6049|       |
 6050|   233k|  for (size_t i = 0; i < label.size(); i++) {
  ------------------
  |  Branch (6050:22): [True: 207k, False: 25.7k]
  ------------------
 6051|   207k|    uint32_t c = label[i];
 6052|   207k|    if (c == 0x200c) {
  ------------------
  |  Branch (6052:9): [True: 1.35k, False: 206k]
  ------------------
 6053|  1.35k|      if (i > 0) {
  ------------------
  |  Branch (6053:11): [True: 1.34k, False: 6]
  ------------------
 6054|  1.34k|        if (std::ranges::binary_search(virama, label[i - 1])) {
  ------------------
  |  Branch (6054:13): [True: 310, False: 1.03k]
  ------------------
 6055|    310|          return true;
 6056|    310|        }
 6057|  1.34k|      }
 6058|  1.04k|      if ((i == 0) || (i + 1 >= label.size())) {
  ------------------
  |  Branch (6058:11): [True: 6, False: 1.03k]
  |  Branch (6058:23): [True: 82, False: 956]
  ------------------
 6059|     88|        return false;
 6060|     88|      }
 6061|       |      // we go backward looking for L or D
 6062|    956|      auto is_l_or_d = [](uint32_t code) {
 6063|    956|        return std::ranges::binary_search(L, code) ||
 6064|    956|               std::ranges::binary_search(D, code);
 6065|    956|      };
 6066|    956|      auto is_r_or_d = [](uint32_t code) {
 6067|    956|        return std::ranges::binary_search(R, code) ||
 6068|    956|               std::ranges::binary_search(D, code);
 6069|    956|      };
 6070|    956|      std::u32string_view before = label.substr(0, i);
 6071|    956|      std::u32string_view after = label.substr(i + 1);
 6072|    956|      return (std::find_if(before.begin(), before.end(), is_l_or_d) !=
  ------------------
  |  Branch (6072:14): [True: 878, False: 78]
  ------------------
 6073|    956|              before.end()) &&
 6074|    878|             (std::find_if(after.begin(), after.end(), is_r_or_d) !=
  ------------------
  |  Branch (6074:14): [True: 766, False: 112]
  ------------------
 6075|    878|              after.end());
 6076|   206k|    } else if (c == 0x200d) {
  ------------------
  |  Branch (6076:16): [True: 386, False: 205k]
  ------------------
 6077|    386|      if (i > 0) {
  ------------------
  |  Branch (6077:11): [True: 380, False: 6]
  ------------------
 6078|    380|        if (std::ranges::binary_search(virama, label[i - 1])) {
  ------------------
  |  Branch (6078:13): [True: 326, False: 54]
  ------------------
 6079|    326|          return true;
 6080|    326|        }
 6081|    380|      }
 6082|     60|      return false;
 6083|    386|    }
 6084|   207k|  }
 6085|       |
 6086|       |  // If CheckBidi, and if the domain name is a  Bidi domain name, then the label
 6087|       |  // must satisfy all six of the numbered conditions in [IDNA2008] RFC 5893,
 6088|       |  // Section 2.
 6089|       |
 6090|       |  // The following rule, consisting of six conditions, applies to labels
 6091|       |  // in Bidi domain names.  The requirements that this rule satisfies are
 6092|       |  // described in Section 3.  All of the conditions must be satisfied for
 6093|       |  // the rule to be satisfied.
 6094|       |  //
 6095|       |  //  1.  The first character must be a character with Bidi property L, R,
 6096|       |  //     or AL.  If it has the R or AL property, it is an RTL label; if it
 6097|       |  //     has the L property, it is an LTR label.
 6098|       |  //
 6099|       |  //  2.  In an RTL label, only characters with the Bidi properties R, AL,
 6100|       |  //      AN, EN, ES, CS, ET, ON, BN, or NSM are allowed.
 6101|       |  //
 6102|       |  //   3.  In an RTL label, the end of the label must be a character with
 6103|       |  //       Bidi property R, AL, EN, or AN, followed by zero or more
 6104|       |  //       characters with Bidi property NSM.
 6105|       |  //
 6106|       |  //   4.  In an RTL label, if an EN is present, no AN may be present, and
 6107|       |  //       vice versa.
 6108|       |  //
 6109|       |  //  5.  In an LTR label, only characters with the Bidi properties L, EN,
 6110|       |  //       ES, CS, ET, ON, BN, or NSM are allowed.
 6111|       |  //
 6112|       |  //   6.  In an LTR label, the end of the label must be a character with
 6113|       |  //       Bidi property L or EN, followed by zero or more characters with
 6114|       |  //       Bidi property NSM.
 6115|       |
 6116|  25.7k|  size_t last_non_nsm_char = find_last_not_of_nsm(label);
 6117|  25.7k|  if (last_non_nsm_char == std::u32string_view::npos) {
  ------------------
  |  Branch (6117:7): [True: 0, False: 25.7k]
  ------------------
 6118|      0|    return false;
 6119|      0|  }
 6120|       |
 6121|       |  // A "Bidi domain name" is a domain name that contains at least one RTL label.
 6122|       |  // The following rule, consisting of six conditions, applies to labels in Bidi
 6123|       |  // domain names.
 6124|  25.7k|  if (is_rtl_label(label)) {
  ------------------
  |  Branch (6124:7): [True: 1.74k, False: 24.0k]
  ------------------
 6125|       |    // The first character must be a character with Bidi property L, R,
 6126|       |    // or AL. If it has the R or AL property, it is an RTL label; if it
 6127|       |    // has the L property, it is an LTR label.
 6128|       |
 6129|  1.74k|    if (find_direction(label[0]) == direction::L) {
  ------------------
  |  Branch (6129:9): [True: 252, False: 1.48k]
  ------------------
 6130|       |      // Eval as LTR
 6131|       |
 6132|       |      // In an LTR label, only characters with the Bidi properties L, EN,
 6133|       |      // ES, CS, ET, ON, BN, or NSM are allowed.
 6134|  3.27k|      for (size_t i = 0; i <= last_non_nsm_char; i++) {
  ------------------
  |  Branch (6134:26): [True: 3.27k, False: 0]
  ------------------
 6135|  3.27k|        const direction d = find_direction(label[i]);
 6136|  3.27k|        if (!(d == direction::L || d == direction::EN || d == direction::ES ||
  ------------------
  |  Branch (6136:15): [True: 952, False: 2.32k]
  |  Branch (6136:36): [True: 486, False: 1.84k]
  |  Branch (6136:58): [True: 202, False: 1.63k]
  ------------------
 6137|  1.63k|              d == direction::CS || d == direction::ET || d == direction::ON ||
  ------------------
  |  Branch (6137:15): [True: 232, False: 1.40k]
  |  Branch (6137:37): [True: 200, False: 1.20k]
  |  Branch (6137:59): [True: 214, False: 992]
  ------------------
 6138|    992|              d == direction::BN || d == direction::NSM)) {
  ------------------
  |  Branch (6138:15): [True: 512, False: 480]
  |  Branch (6138:37): [True: 228, False: 252]
  ------------------
 6139|    252|          return false;
 6140|    252|        }
 6141|  3.27k|      }
 6142|       |
 6143|      0|      const direction last_dir = find_direction(label[last_non_nsm_char]);
 6144|      0|      if (!(last_dir == direction::L || last_dir == direction::EN)) {
  ------------------
  |  Branch (6144:13): [True: 0, False: 0]
  |  Branch (6144:41): [True: 0, False: 0]
  ------------------
 6145|      0|        return false;
 6146|      0|      }
 6147|       |
 6148|      0|      return true;
 6149|       |
 6150|  1.48k|    } else {
 6151|       |      // Eval as RTL
 6152|       |
 6153|       |      // The first character must be R or AL; a leading AN (or any other
 6154|       |      // direction) does not start a valid RTL label.
 6155|  1.48k|      const direction first_dir = find_direction(label[0]);
 6156|  1.48k|      if (first_dir != direction::R && first_dir != direction::AL) {
  ------------------
  |  Branch (6156:11): [True: 622, False: 866]
  |  Branch (6156:40): [True: 46, False: 576]
  ------------------
 6157|     46|        return false;
 6158|     46|      }
 6159|       |
 6160|  1.44k|      bool has_an = false;
 6161|  1.44k|      bool has_en = false;
 6162|  6.58k|      for (size_t i = 0; i <= last_non_nsm_char; i++) {
  ------------------
  |  Branch (6162:26): [True: 5.28k, False: 1.29k]
  ------------------
 6163|  5.28k|        const direction d = find_direction(label[i]);
 6164|       |
 6165|       |        // In an RTL label, if an EN is present, no AN may be present, and vice
 6166|       |        // versa.
 6167|  5.28k|        if ((d == direction::EN && ((has_en = true) && has_an)) ||
  ------------------
  |  Branch (6167:14): [True: 1.22k, False: 4.06k]
  |  Branch (6167:37): [True: 1.22k, False: 0]
  |  Branch (6167:56): [True: 6, False: 1.22k]
  ------------------
 6168|  5.28k|            (d == direction::AN && ((has_an = true) && has_en))) {
  ------------------
  |  Branch (6168:14): [True: 400, False: 4.88k]
  |  Branch (6168:37): [True: 400, False: 0]
  |  Branch (6168:56): [True: 6, False: 394]
  ------------------
 6169|     12|          return false;
 6170|     12|        }
 6171|       |
 6172|  5.27k|        if (!(d == direction::R || d == direction::AL || d == direction::AN ||
  ------------------
  |  Branch (6172:15): [True: 1.12k, False: 4.15k]
  |  Branch (6172:36): [True: 924, False: 3.22k]
  |  Branch (6172:58): [True: 394, False: 2.83k]
  ------------------
 6173|  2.83k|              d == direction::EN || d == direction::ES || d == direction::CS ||
  ------------------
  |  Branch (6173:15): [True: 1.22k, False: 1.61k]
  |  Branch (6173:37): [True: 192, False: 1.41k]
  |  Branch (6173:59): [True: 202, False: 1.21k]
  ------------------
 6174|  1.21k|              d == direction::ET || d == direction::ON || d == direction::BN ||
  ------------------
  |  Branch (6174:15): [True: 194, False: 1.02k]
  |  Branch (6174:37): [True: 210, False: 812]
  |  Branch (6174:59): [True: 558, False: 254]
  ------------------
 6175|    254|              d == direction::NSM)) {
  ------------------
  |  Branch (6175:15): [True: 192, False: 62]
  ------------------
 6176|     62|          return false;
 6177|     62|        }
 6178|       |
 6179|  5.21k|        if (i == last_non_nsm_char &&
  ------------------
  |  Branch (6179:13): [True: 1.36k, False: 3.84k]
  ------------------
 6180|  1.36k|            !(d == direction::R || d == direction::AL || d == direction::AN ||
  ------------------
  |  Branch (6180:15): [True: 402, False: 966]
  |  Branch (6180:36): [True: 428, False: 538]
  |  Branch (6180:58): [True: 200, False: 338]
  ------------------
 6181|    338|              d == direction::EN)) {
  ------------------
  |  Branch (6181:15): [True: 266, False: 72]
  ------------------
 6182|     72|          return false;
 6183|     72|        }
 6184|  5.21k|      }
 6185|       |
 6186|  1.29k|      return true;
 6187|  1.44k|    }
 6188|  1.74k|  }
 6189|       |
 6190|  24.0k|  return true;
 6191|  25.7k|}
_ZN3ada4idna8to_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEERNS1_12basic_stringIcS4_NS1_9allocatorIcEEEE:
 6348|  94.9k|[[nodiscard]] bool to_ascii(std::string_view ut8_string, std::string& out) {
 6349|  94.9k|  out.clear();
 6350|  94.9k|  if (ut8_string.size() > max_domain_input_bytes) {
  ------------------
  |  Branch (6350:7): [True: 0, False: 94.9k]
  ------------------
 6351|      0|    return false;
 6352|      0|  }
 6353|  94.9k|  if (is_ascii(ut8_string)) {
  ------------------
  |  Branch (6353:7): [True: 89.5k, False: 5.35k]
  ------------------
 6354|  89.5k|    from_ascii_to_ascii(ut8_string, out);
 6355|  89.5k|    return true;
 6356|  89.5k|  }
 6357|       |
 6358|       |#ifdef ADA_USE_SIMDUTF
 6359|       |  size_t utf32_length =
 6360|       |      simdutf::utf32_length_from_utf8(ut8_string.data(), ut8_string.size());
 6361|       |  if (utf32_length == 0 && !ut8_string.empty()) {
 6362|       |    return false;
 6363|       |  }
 6364|       |  std::u32string working(utf32_length, U'\0');
 6365|       |  size_t actual_utf32_length = simdutf::convert_utf8_to_utf32(
 6366|       |      ut8_string.data(), ut8_string.size(), working.data());
 6367|       |#else
 6368|  5.35k|  size_t utf32_length =
 6369|  5.35k|      ada::idna::utf32_length_from_utf8(ut8_string.data(), ut8_string.size());
 6370|  5.35k|  if (utf32_length == 0 && !ut8_string.empty()) {
  ------------------
  |  Branch (6370:7): [True: 32, False: 5.31k]
  |  Branch (6370:28): [True: 32, False: 0]
  ------------------
 6371|     32|    return false;
 6372|     32|  }
 6373|  5.31k|  std::u32string working(utf32_length, U'\0');
 6374|  5.31k|  size_t actual_utf32_length = ada::idna::utf8_to_utf32(
 6375|  5.31k|      ut8_string.data(), ut8_string.size(), working.data());
 6376|  5.31k|#endif
 6377|  5.31k|  if (actual_utf32_length == 0 || actual_utf32_length != utf32_length) {
  ------------------
  |  Branch (6377:7): [True: 434, False: 4.88k]
  |  Branch (6377:35): [True: 0, False: 4.88k]
  ------------------
 6378|    434|    return false;
 6379|    434|  }
 6380|  4.88k|  working.resize(actual_utf32_length);
 6381|       |
 6382|       |  // Map into a second buffer with exact sizing (no growth reallocs).
 6383|  4.88k|  std::u32string mapped;
 6384|  4.88k|  if (!ada::idna::map(working, mapped)) {
  ------------------
  |  Branch (6384:7): [True: 76, False: 4.80k]
  ------------------
 6385|     76|    return false;
 6386|     76|  }
 6387|       |  // Drop UTF-32 input; reuse `working` as scratch for ACE validation below.
 6388|  4.80k|  working.clear();
 6389|       |
 6390|       |  // Skip NFC when already normalized (ASCII is a fast subset of this check).
 6391|  4.80k|  if (!is_ascii(mapped) && !is_already_nfc(mapped)) {
  ------------------
  |  Branch (6391:7): [True: 4.41k, False: 398]
  |  Branch (6391:28): [True: 828, False: 3.58k]
  ------------------
 6392|    828|    if (!normalize(mapped)) {
  ------------------
  |  Branch (6392:9): [True: 0, False: 828]
  ------------------
 6393|      0|      return false;
 6394|      0|    }
 6395|    828|  }
 6396|       |
 6397|       |  // Estimate ASCII output size (punycode may expand non-ASCII labels).
 6398|  4.80k|  out.reserve(mapped.size() + 8);
 6399|       |
 6400|       |  // Walk labels with a single pointer scan (no repeated string::find).
 6401|  4.80k|  const char32_t* p = mapped.data();
 6402|  4.80k|  const char32_t* const end = p + mapped.size();
 6403|  4.80k|  std::u32string post_map;
 6404|       |
 6405|  34.0k|  while (p < end) {
  ------------------
  |  Branch (6405:10): [True: 31.0k, False: 3.05k]
  ------------------
 6406|  31.0k|    const char32_t* label_begin = p;
 6407|   401k|    while (p < end && *p != U'.') {
  ------------------
  |  Branch (6407:12): [True: 397k, False: 4.16k]
  |  Branch (6407:23): [True: 370k, False: 26.8k]
  ------------------
 6408|   370k|      ++p;
 6409|   370k|    }
 6410|  31.0k|    const size_t label_size = static_cast<size_t>(p - label_begin);
 6411|  31.0k|    std::u32string_view label_view(label_begin, label_size);
 6412|  31.0k|    const bool is_last_label = (p == end);
 6413|  31.0k|    if (p < end) {
  ------------------
  |  Branch (6413:9): [True: 26.8k, False: 4.16k]
  ------------------
 6414|  26.8k|      ++p;  // skip dot
 6415|  26.8k|    }
 6416|       |
 6417|  31.0k|    if (label_size == 0) {
  ------------------
  |  Branch (6417:9): [True: 692, False: 30.3k]
  ------------------
 6418|       |      // empty label
 6419|  30.3k|    } else if (is_ace_prefix(label_view)) {
  ------------------
  |  Branch (6419:16): [True: 2.88k, False: 27.4k]
  ------------------
 6420|  66.6k|      for (char32_t c : label_view) {
  ------------------
  |  Branch (6420:23): [True: 66.6k, False: 2.84k]
  ------------------
 6421|  66.6k|        if (c >= 0x80) {
  ------------------
  |  Branch (6421:13): [True: 38, False: 66.5k]
  ------------------
 6422|     38|          out.clear();
 6423|     38|          return false;
 6424|     38|        }
 6425|  66.6k|      }
 6426|  2.84k|      append_ascii_label(out, label_view);
 6427|  2.84k|      std::string_view puny_segment_ascii(
 6428|  2.84k|          out.data() + (out.size() - label_size) + 4, label_size - 4);
 6429|  2.84k|      working.clear();
 6430|  2.84k|      if (!ada::idna::punycode_to_utf32(puny_segment_ascii, working)) {
  ------------------
  |  Branch (6430:11): [True: 156, False: 2.68k]
  ------------------
 6431|    156|        out.clear();
 6432|    156|        return false;
 6433|    156|      }
 6434|  2.68k|      if (is_ascii(working)) {
  ------------------
  |  Branch (6434:11): [True: 90, False: 2.59k]
  ------------------
 6435|     90|        out.clear();
 6436|     90|        return false;
 6437|     90|      }
 6438|  2.59k|      if (!ada::idna::map(working, post_map) || working != post_map) {
  ------------------
  |  Branch (6438:11): [True: 298, False: 2.29k]
  |  Branch (6438:49): [True: 112, False: 2.18k]
  ------------------
 6439|    410|        out.clear();
 6440|    410|        return false;
 6441|    410|      }
 6442|       |      // Mapping must be stable; NFC must not change the mapped form either.
 6443|  2.18k|      if (!is_ascii(post_map) && !is_already_nfc(post_map)) {
  ------------------
  |  Branch (6443:11): [True: 2.18k, False: 0]
  |  Branch (6443:34): [True: 574, False: 1.61k]
  ------------------
 6444|    574|        if (!normalize(post_map) || post_map != working) {
  ------------------
  |  Branch (6444:13): [True: 0, False: 574]
  |  Branch (6444:37): [True: 170, False: 404]
  ------------------
 6445|    170|          out.clear();
 6446|    170|          return false;
 6447|    170|        }
 6448|    574|      }
 6449|  2.01k|      if (post_map.empty() || !is_label_valid(post_map)) {
  ------------------
  |  Branch (6449:11): [True: 0, False: 2.01k]
  |  Branch (6449:31): [True: 36, False: 1.98k]
  ------------------
 6450|     36|        out.clear();
 6451|     36|        return false;
 6452|     36|      }
 6453|  27.4k|    } else if (is_ascii(label_view)) {
  ------------------
  |  Branch (6453:16): [True: 1.80k, False: 25.6k]
  ------------------
 6454|  1.80k|      append_ascii_label(out, label_view);
 6455|  25.6k|    } else {
 6456|  25.6k|      if (!is_label_valid(label_view)) {
  ------------------
  |  Branch (6456:11): [True: 858, False: 24.7k]
  ------------------
 6457|    858|        out.clear();
 6458|    858|        return false;
 6459|    858|      }
 6460|  24.7k|      out.append("xn--");
 6461|  24.7k|      if (!ada::idna::utf32_to_punycode(label_view, out)) {
  ------------------
  |  Branch (6461:11): [True: 0, False: 24.7k]
  ------------------
 6462|      0|        out.clear();
 6463|      0|        return false;
 6464|      0|      }
 6465|  24.7k|    }
 6466|  29.2k|    if (!is_last_label) {
  ------------------
  |  Branch (6466:9): [True: 26.3k, False: 2.85k]
  ------------------
 6467|  26.3k|      out.push_back('.');
 6468|  26.3k|    }
 6469|  29.2k|  }
 6470|  3.05k|  return true;
 6471|  4.80k|}
_ZN3ada4idna8to_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6473|  94.9k|std::string to_ascii(std::string_view ut8_string) {
 6474|  94.9k|  std::string out;
 6475|  94.9k|  if (!to_ascii(ut8_string, out)) {
  ------------------
  |  Branch (6475:7): [True: 2.30k, False: 92.6k]
  ------------------
 6476|  2.30k|    return {};
 6477|  2.30k|  }
 6478|  92.6k|  return out;
 6479|  94.9k|}
_ZN3ada7unicode14percent_decodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEm:
 7169|    766|std::string percent_decode(const std::string_view input, size_t first_percent) {
 7170|       |  // next line is for safety only, we expect users to avoid calling
 7171|       |  // percent_decode when first_percent is outside the range.
 7172|    766|  if (first_percent == std::string_view::npos) {
  ------------------
  |  Branch (7172:7): [True: 0, False: 766]
  ------------------
 7173|      0|    return std::string(input);
 7174|      0|  }
 7175|       |
 7176|       |  // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
 7177|    766|  const char* const src = input.data();
 7178|    766|  const char* const end = src + input.size();
 7179|       |
 7180|       |  // Decoding never grows the string, so a single pre-sized buffer written via
 7181|       |  // bulk memcpy of the plain runs (then shrunk to the final length) avoids the
 7182|       |  // byte-at-a-time appends of the naive version.
 7183|    766|  std::string out(input.size(), '\0');
 7184|    766|  char* d = out.data();
 7185|    766|  char* const d0 = d;
 7186|       |
 7187|    766|  std::memcpy(d, src, first_percent);
 7188|    766|  d += first_percent;
 7189|       |
 7190|    766|  const char* p = src + first_percent;
 7191|  5.53k|  while (p < end) {
  ------------------
  |  Branch (7191:10): [True: 4.77k, False: 766]
  ------------------
 7192|  4.77k|    if (*p == '%') {
  ------------------
  |  Branch (7192:9): [True: 2.96k, False: 1.80k]
  ------------------
 7193|       |      // Decode runs of valid %XX tightly (common for nested/encoded URLs).
 7194|  5.19k|      while (p + 2 < end && *p == '%') {
  ------------------
  |  Branch (7194:14): [True: 4.68k, False: 516]
  |  Branch (7194:29): [True: 4.01k, False: 668]
  ------------------
 7195|  4.01k|        if (!is_ascii_hex_digit(p[1]) || !is_ascii_hex_digit(p[2])) {
  ------------------
  |  Branch (7195:13): [True: 972, False: 3.04k]
  |  Branch (7195:42): [True: 808, False: 2.23k]
  ------------------
 7196|  1.78k|          break;
 7197|  1.78k|        }
 7198|  2.23k|        *d++ = static_cast<char>(convert_hex_to_binary(p[1]) * 16 +
 7199|  2.23k|                                 convert_hex_to_binary(p[2]));
 7200|  2.23k|        p += 3;
 7201|  2.23k|      }
 7202|  2.96k|      if (p < end && *p == '%') {
  ------------------
  |  Branch (7202:11): [True: 2.63k, False: 328]
  |  Branch (7202:22): [True: 1.91k, False: 726]
  ------------------
 7203|       |        // Not a valid escape (too few chars left or bad hex): copy '%'
 7204|       |        // literally and keep scanning after it.
 7205|  1.91k|        *d++ = *p++;
 7206|  1.91k|      }
 7207|  2.96k|    } else {
 7208|  1.80k|      const char* q = static_cast<const char*>(
 7209|  1.80k|          std::memchr(p, '%', static_cast<size_t>(end - p)));
 7210|  1.80k|      const char* run_end = q ? q : end;
  ------------------
  |  Branch (7210:29): [True: 1.45k, False: 356]
  ------------------
 7211|  1.80k|      const size_t n = static_cast<size_t>(run_end - p);
 7212|  1.80k|      std::memcpy(d, p, n);
 7213|  1.80k|      d += n;
 7214|  1.80k|      p = run_end;
 7215|  1.80k|    }
 7216|  4.77k|  }
 7217|       |
 7218|    766|  out.resize(static_cast<size_t>(d - d0));
 7219|    766|  return out;
 7220|    766|}
_ZN3ada7unicode14percent_encodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKh:
 7305|   132k|                           const uint8_t character_set[]) {
 7306|   132k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7307|   132k|    return character_sets::bit_at(character_set, c);
 7308|   132k|  });
 7309|       |  // Optimization: Don't iterate if percent encode is not required
 7310|   132k|  if (pointer == input.end()) {
  ------------------
  |  Branch (7310:7): [True: 129k, False: 2.96k]
  ------------------
 7311|   129k|    return std::string(input);
 7312|   129k|  }
 7313|       |
 7314|  2.96k|  std::string result;
 7315|  2.96k|  result.reserve(input.length());  // in the worst case, percent encoding might
 7316|       |                                   // produce 3 characters.
 7317|  2.96k|  result.append(input.substr(0, std::distance(input.begin(), pointer)));
 7318|       |
 7319|  58.3k|  for (; pointer != input.end(); pointer++) {
  ------------------
  |  Branch (7319:10): [True: 55.4k, False: 2.96k]
  ------------------
 7320|  55.4k|    if (character_sets::bit_at(character_set, *pointer)) {
  ------------------
  |  Branch (7320:9): [True: 46.6k, False: 8.79k]
  ------------------
 7321|  46.6k|      result.append(character_sets::hex + uint8_t(*pointer) * 4, 3);
 7322|  46.6k|    } else {
 7323|  8.79k|      result += *pointer;
 7324|  8.79k|    }
 7325|  55.4k|  }
 7326|       |
 7327|  2.96k|  return result;
 7328|   132k|}
_ZN3ada7unicode8to_asciiERNSt3__18optionalINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEENS1_17basic_string_viewIcS5_EEm:
 7366|  94.9k|              size_t first_percent) {
 7367|  94.9k|  std::string percent_decoded_buffer;
 7368|  94.9k|  std::string_view input = plain;
 7369|  94.9k|  if (first_percent != std::string_view::npos) {
  ------------------
  |  Branch (7369:7): [True: 766, False: 94.1k]
  ------------------
 7370|    766|    percent_decoded_buffer = unicode::percent_decode(plain, first_percent);
 7371|    766|    input = percent_decoded_buffer;
 7372|    766|  }
 7373|       |  // input is a non-empty UTF-8 string, must be percent decoded
 7374|  94.9k|  std::string idna_ascii = ada::idna::to_ascii(input);
 7375|  94.9k|  if (idna_ascii.empty() || contains_forbidden_domain_code_point(
  ------------------
  |  Branch (7375:7): [True: 2.33k, False: 92.5k]
  |  Branch (7375:29): [True: 950, False: 91.6k]
  ------------------
 7376|  92.5k|                                idna_ascii.data(), idna_ascii.size())) {
 7377|  3.28k|    return false;
 7378|  3.28k|  }
 7379|  91.6k|  out = std::move(idna_ascii);
 7380|  91.6k|  return true;
 7381|  94.9k|}
_ZN3ada7unicode14percent_encodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKhm:
 7384|     42|                           const uint8_t character_set[], size_t index) {
 7385|     42|  std::string out;
 7386|       |  // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
 7387|     42|  out.append(input.data(), index);
 7388|     42|  auto pointer = input.begin() + index;
 7389|    569|  for (; pointer != input.end(); pointer++) {
  ------------------
  |  Branch (7389:10): [True: 527, False: 42]
  ------------------
 7390|    527|    if (character_sets::bit_at(character_set, *pointer)) {
  ------------------
  |  Branch (7390:9): [True: 209, False: 318]
  ------------------
 7391|    209|      out.append(character_sets::hex + uint8_t(*pointer) * 4, 3);
 7392|    318|    } else {
 7393|    318|      out += *pointer;
 7394|    318|    }
 7395|    527|  }
 7396|     42|  return out;
 7397|     42|}
_ZN3ada11serializers36find_longest_sequence_of_ipv6_piecesERKNSt3__15arrayItLm8EEERmS6_:
 7461|    838|    size_t& compress_length) noexcept {
 7462|    838|  compress = 0;
 7463|    838|  compress_length = 0;
 7464|    838|  size_t i = 0;
 7465|  3.17k|  while (i < 8) {
  ------------------
  |  Branch (7465:10): [True: 2.34k, False: 838]
  ------------------
 7466|  2.34k|    if (address[i] != 0) {
  ------------------
  |  Branch (7466:9): [True: 1.28k, False: 1.05k]
  ------------------
 7467|  1.28k|      ++i;
 7468|  1.28k|      continue;
 7469|  1.28k|    }
 7470|  1.05k|    size_t next = i + 1;
 7471|  5.41k|    while (next < 8 && address[next] == 0) {
  ------------------
  |  Branch (7471:12): [True: 4.89k, False: 524]
  |  Branch (7471:24): [True: 4.36k, False: 528]
  ------------------
 7472|  4.36k|      ++next;
 7473|  4.36k|    }
 7474|  1.05k|    const size_t count = next - i;
 7475|  1.05k|    if (count > compress_length) {
  ------------------
  |  Branch (7475:9): [True: 882, False: 170]
  ------------------
 7476|    882|      compress_length = count;
 7477|    882|      compress = i;
 7478|    882|    }
 7479|  1.05k|    i = next;
 7480|  1.05k|  }
 7481|    838|}
_ZN3ada11serializers4ipv6ERKNSt3__15arrayItLm8EEE:
 7483|    838|std::string ipv6(const std::array<uint16_t, 8>& address) {
 7484|    838|  size_t compress = 0;
 7485|    838|  size_t compress_length = 0;
 7486|    838|  find_longest_sequence_of_ipv6_pieces(address, compress, compress_length);
 7487|       |
 7488|       |  // Skip compression when the longest zero run is a single piece.
 7489|    838|  if (compress_length <= 1) {
  ------------------
  |  Branch (7489:7): [True: 44, False: 794]
  ------------------
 7490|     44|    compress = compress_length = 8;
 7491|     44|  }
 7492|       |
 7493|       |  // Max: '[' + 8*4 hex + 7 ':' + ']' = 41
 7494|    838|  std::string output(4 * 8 + 7 + 2, '\0');
 7495|    838|  char* point = output.data();
 7496|    838|  *point++ = '[';
 7497|    838|  size_t piece_index = 0;
 7498|  2.01k|  while (true) {
  ------------------
  |  Branch (7498:10): [True: 2.01k, Folded]
  ------------------
 7499|  2.01k|    if (piece_index == compress) {
  ------------------
  |  Branch (7499:9): [True: 794, False: 1.22k]
  ------------------
 7500|    794|      *point++ = ':';
 7501|       |      // If we skip a value initially, we need to write '::'.
 7502|    794|      if (piece_index == 0) {
  ------------------
  |  Branch (7502:11): [True: 524, False: 270]
  ------------------
 7503|    524|        *point++ = ':';
 7504|    524|      }
 7505|    794|      piece_index += compress_length;
 7506|    794|      if (piece_index == 8) {
  ------------------
  |  Branch (7506:11): [True: 452, False: 342]
  ------------------
 7507|    452|        break;
 7508|    452|      }
 7509|    794|    }
 7510|  1.56k|    point = write_hex_u16(point, address[piece_index]);
 7511|  1.56k|    ++piece_index;
 7512|  1.56k|    if (piece_index == 8) {
  ------------------
  |  Branch (7512:9): [True: 386, False: 1.17k]
  ------------------
 7513|    386|      break;
 7514|    386|    }
 7515|  1.17k|    *point++ = ':';
 7516|  1.17k|  }
 7517|    838|  *point++ = ']';
 7518|    838|  output.resize(static_cast<size_t>(point - output.data()));
 7519|    838|  return output;
 7520|    838|}
_ZN3ada11serializers4ipv4Em:
 7522|  16.0k|std::string ipv4(const uint64_t address) {
 7523|  16.0k|  std::string output(15, '\0');
 7524|  16.0k|  char* point = output.data();
 7525|  16.0k|  point = write_u8(point, static_cast<uint8_t>(address >> 24));
 7526|  16.0k|  *point++ = '.';
 7527|  16.0k|  point = write_u8(point, static_cast<uint8_t>(address >> 16));
 7528|  16.0k|  *point++ = '.';
 7529|  16.0k|  point = write_u8(point, static_cast<uint8_t>(address >> 8));
 7530|  16.0k|  *point++ = '.';
 7531|  16.0k|  point = write_u8(point, static_cast<uint8_t>(address));
 7532|  16.0k|  output.resize(static_cast<size_t>(point - output.data()));
 7533|  16.0k|  return output;
 7534|  16.0k|}
_ZN3ada5parseINS_3urlEEEN2tl8expectedIT_NS_6errorsEEENSt3__117basic_string_viewIcNS7_11char_traitsIcEEEEPKS4_:
 7884|   347k|    std::string_view input, const result_type* base_url) {
 7885|   347k|  result_type u = ada::parser::parse_url_impl<result_type>(input, base_url);
 7886|   347k|  if (!u.is_valid) {
  ------------------
  |  Branch (7886:7): [True: 2.70k, False: 345k]
  ------------------
 7887|  2.70k|    return tl::unexpected(errors::type_error);
 7888|  2.70k|  }
 7889|   345k|  return u;
 7890|   347k|}
_ZN3ada5parseINS_14url_aggregatorEEEN2tl8expectedIT_NS_6errorsEEENSt3__117basic_string_viewIcNS7_11char_traitsIcEEEEPKS4_:
 7884|   347k|    std::string_view input, const result_type* base_url) {
 7885|   347k|  result_type u = ada::parser::parse_url_impl<result_type>(input, base_url);
 7886|   347k|  if (!u.is_valid) {
  ------------------
  |  Branch (7886:7): [True: 2.70k, False: 345k]
  ------------------
 7887|  2.70k|    return tl::unexpected(errors::type_error);
 7888|  2.70k|  }
 7889|   345k|  return u;
 7890|   347k|}
_ZN3ada20get_max_input_lengthEv:
 7556|   925k|uint32_t get_max_input_length() {
 7557|   925k|  return max_input_length_.load(std::memory_order_relaxed);
 7558|   925k|}
_ZN3ada7helpers18trim_c0_whitespaceERNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8859|   312k|void trim_c0_whitespace(std::string_view& input) noexcept {
 8860|   312k|  while (!input.empty() &&
  ------------------
  |  Branch (8860:10): [True: 312k, False: 0]
  ------------------
 8861|   312k|         ada::unicode::is_c0_control_or_space(input.front())) {
  ------------------
  |  Branch (8861:10): [True: 442, False: 312k]
  ------------------
 8862|    442|    input.remove_prefix(1);
 8863|    442|  }
 8864|   315k|  while (!input.empty() && ada::unicode::is_c0_control_or_space(input.back())) {
  ------------------
  |  Branch (8864:10): [True: 315k, False: 0]
  |  Branch (8864:28): [True: 3.20k, False: 312k]
  ------------------
 8865|  3.20k|    input.remove_suffix(1);
 8866|  3.20k|  }
 8867|   312k|}
_ZN3ada3url17parse_opaque_hostENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 9314|    500|bool url::parse_opaque_host(std::string_view input) {
 9315|    500|  ada_log("parse_opaque_host ", input, " [", input.size(), " bytes]");
 9316|    500|  if (std::ranges::any_of(input, ada::unicode::is_forbidden_host_code_point)) {
  ------------------
  |  Branch (9316:7): [True: 33, False: 467]
  ------------------
 9317|     33|    return is_valid = false;
 9318|     33|  }
 9319|       |
 9320|       |  // Return the result of running UTF-8 percent-encode on input using the C0
 9321|       |  // control percent-encode set.
 9322|    467|  host = ada::unicode::percent_encode(
 9323|    467|      input, ada::character_sets::C0_CONTROL_PERCENT_ENCODE);
 9324|    467|  return true;
 9325|    500|}
_ZN3ada3url10parse_ipv4ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 9327|  8.32k|bool url::parse_ipv4(std::string_view input) {
 9328|  8.32k|  ada_log("parse_ipv4 ", input, " [", input.size(), " bytes]");
 9329|  8.32k|  if (input.empty()) {
  ------------------
  |  Branch (9329:7): [True: 0, False: 8.32k]
  ------------------
 9330|      0|    return is_valid = false;
 9331|      0|  }
 9332|  8.32k|  std::string_view original_input = input;
 9333|  8.32k|  if (original_input.back() == '.') {
  ------------------
  |  Branch (9333:7): [True: 21, False: 8.30k]
  ------------------
 9334|     21|    original_input.remove_suffix(1);
 9335|     21|  }
 9336|  8.32k|  if (input.back() == '.') {
  ------------------
  |  Branch (9336:7): [True: 21, False: 8.30k]
  ------------------
 9337|     21|    input.remove_suffix(1);
 9338|     21|    if (input.empty()) {
  ------------------
  |  Branch (9338:9): [True: 0, False: 21]
  ------------------
 9339|      0|      return is_valid = false;
 9340|      0|    }
 9341|     21|  }
 9342|       |
 9343|  8.32k|  const uint64_t fast = checkers::try_parse_ipv4_fast(input);
 9344|  8.32k|  if (fast < checkers::ipv4_fast_fail) [[likely]] {
  ------------------
  |  Branch (9344:7): [True: 7, False: 8.32k]
  ------------------
 9345|      7|    host = original_input;
 9346|      7|    host_type = IPV4;
 9347|      7|    return true;
 9348|      7|  }
 9349|       |
 9350|  8.32k|  const char* p = input.data();
 9351|  8.32k|  const char* end = p + input.size();
 9352|  8.32k|  uint64_t ipv4 = 0;
 9353|  8.32k|  int digit_count = 0;
 9354|  8.32k|  int pure_decimal_count = 0;
 9355|       |
 9356|  15.7k|  for (; digit_count < 4 && p < end; ++digit_count) {
  ------------------
  |  Branch (9356:10): [True: 15.7k, False: 21]
  |  Branch (9356:29): [True: 15.7k, False: 0]
  ------------------
 9357|  15.7k|    uint64_t segment = 0;
 9358|  15.7k|    bool pure = false;
 9359|  15.7k|    if (!detail::parse_ipv4_number(p, end, segment, pure)) {
  ------------------
  |  Branch (9359:9): [True: 199, False: 15.5k]
  ------------------
 9360|    199|      return is_valid = false;
 9361|    199|    }
 9362|  15.5k|    if (pure) {
  ------------------
  |  Branch (9362:9): [True: 8.39k, False: 7.15k]
  ------------------
 9363|  8.39k|      ++pure_decimal_count;
 9364|  8.39k|    }
 9365|  15.5k|    if (p >= end) {
  ------------------
  |  Branch (9365:9): [True: 8.06k, False: 7.48k]
  ------------------
 9366|  8.06k|      const unsigned shift = static_cast<unsigned>(32 - digit_count * 8);
 9367|  8.06k|      if (segment >= (uint64_t{1} << shift)) {
  ------------------
  |  Branch (9367:11): [True: 26, False: 8.03k]
  ------------------
 9368|     26|        return is_valid = false;
 9369|     26|      }
 9370|  8.03k|      ipv4 = (ipv4 << shift) | segment;
 9371|  8.03k|      host = (pure_decimal_count == 4) ? std::string(original_input)
  ------------------
  |  Branch (9371:14): [True: 0, False: 8.03k]
  ------------------
 9372|  8.03k|                                       : ada::serializers::ipv4(ipv4);
 9373|  8.03k|      host_type = IPV4;
 9374|  8.03k|      return true;
 9375|  8.06k|    }
 9376|  7.48k|    if (segment > 255 || *p != '.') {
  ------------------
  |  Branch (9376:9): [True: 39, False: 7.44k]
  |  Branch (9376:26): [True: 0, False: 7.44k]
  ------------------
 9377|     39|      return is_valid = false;
 9378|     39|    }
 9379|  7.44k|    ipv4 = (ipv4 << 8) | segment;
 9380|  7.44k|    ++p;
 9381|  7.44k|  }
 9382|     21|  if (digit_count != 4 || p != end) {
  ------------------
  |  Branch (9382:7): [True: 0, False: 21]
  |  Branch (9382:27): [True: 21, False: 0]
  ------------------
 9383|     21|    return is_valid = false;
 9384|     21|  }
 9385|      0|  host = (pure_decimal_count == 4) ? std::string(original_input)
  ------------------
  |  Branch (9385:10): [True: 0, False: 0]
  ------------------
 9386|      0|                                   : ada::serializers::ipv4(ipv4);
 9387|      0|  host_type = IPV4;
 9388|      0|  return true;
 9389|     21|}
_ZN3ada3url10parse_ipv6ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 9391|    605|bool url::parse_ipv6(std::string_view input) {
 9392|    605|  ada_log("parse_ipv6 ", input, " [", input.size(), " bytes]");
 9393|    605|  if (input.empty() || input.size() > 45) [[unlikely]] {
  ------------------
  |  Branch (9393:7): [True: 24, False: 581]
  |  Branch (9393:24): [True: 11, False: 570]
  ------------------
 9394|     35|    return is_valid = false;
 9395|     35|  }
 9396|       |#if defined(ADA_AVX512)
 9397|       |  // One masked load classifies colon/dot shape; rejects impossible inputs
 9398|       |  // before the piece parser (free on AVX-512BW+VL builds).
 9399|       |  if (!detail::ipv6_structure_plausible(input.data(), input.size()))
 9400|       |      [[unlikely]] {
 9401|       |    return is_valid = false;
 9402|       |  }
 9403|       |#endif
 9404|       |
 9405|    570|  std::array<uint16_t, 8> address{};
 9406|    570|  const char* pointer = input.data();
 9407|    570|  const char* const end = pointer + input.size();
 9408|    570|  int piece_index = 0;
 9409|    570|  int compress = -1;
 9410|       |
 9411|    570|  if (*pointer == ':') {
  ------------------
  |  Branch (9411:7): [True: 277, False: 293]
  ------------------
 9412|    277|    if (input.size() == 1 || pointer[1] != ':') [[unlikely]] {
  ------------------
  |  Branch (9412:9): [True: 3, False: 274]
  |  Branch (9412:30): [True: 10, False: 264]
  ------------------
 9413|     13|      return is_valid = false;
 9414|     13|    }
 9415|    264|    pointer += 2;
 9416|    264|    compress = ++piece_index;
 9417|    264|  }
 9418|       |
 9419|  1.58k|  while (pointer != end) {
  ------------------
  |  Branch (9419:10): [True: 1.13k, False: 444]
  ------------------
 9420|  1.13k|    if (piece_index == 8) [[unlikely]] {
  ------------------
  |  Branch (9420:9): [True: 3, False: 1.13k]
  ------------------
 9421|      3|      return is_valid = false;
 9422|      3|    }
 9423|  1.13k|    if (*pointer == ':') {
  ------------------
  |  Branch (9423:9): [True: 152, False: 983]
  ------------------
 9424|    152|      if (compress != -1) [[unlikely]] {
  ------------------
  |  Branch (9424:11): [True: 3, False: 149]
  ------------------
 9425|      3|        return is_valid = false;
 9426|      3|      }
 9427|    149|      ++pointer;
 9428|    149|      compress = ++piece_index;
 9429|    149|      continue;
 9430|    152|    }
 9431|       |
 9432|    983|    uint16_t value = 0;
 9433|    983|    const int length = detail::parse_hex_piece(pointer, end, value);
 9434|       |
 9435|    983|    if (pointer != end && *pointer == '.') {
  ------------------
  |  Branch (9435:9): [True: 757, False: 226]
  |  Branch (9435:27): [True: 79, False: 678]
  ------------------
 9436|     79|      if (length == 0) [[unlikely]] {
  ------------------
  |  Branch (9436:11): [True: 3, False: 76]
  ------------------
 9437|      3|        return is_valid = false;
 9438|      3|      }
 9439|     76|      pointer -= length;
 9440|     76|      if (piece_index > 6) [[unlikely]] {
  ------------------
  |  Branch (9440:11): [True: 3, False: 73]
  ------------------
 9441|      3|        return is_valid = false;
 9442|      3|      }
 9443|       |
 9444|     73|      int numbers_seen = 0;
 9445|    211|      while (pointer != end) {
  ------------------
  |  Branch (9445:14): [True: 193, False: 18]
  ------------------
 9446|    193|        int ipv4_piece = -1;
 9447|    193|        if (numbers_seen > 0) {
  ------------------
  |  Branch (9447:13): [True: 120, False: 73]
  ------------------
 9448|    120|          if (*pointer == '.' && numbers_seen < 4) {
  ------------------
  |  Branch (9448:15): [True: 101, False: 19]
  |  Branch (9448:34): [True: 95, False: 6]
  ------------------
 9449|     95|            ++pointer;
 9450|     95|          } else {
 9451|     25|            return is_valid = false;
 9452|     25|          }
 9453|    120|        }
 9454|    168|        if (pointer == end || *pointer < '0' || *pointer > '9') [[unlikely]] {
  ------------------
  |  Branch (9454:13): [True: 12, False: 156]
  |  Branch (9454:31): [True: 5, False: 151]
  |  Branch (9454:49): [True: 3, False: 148]
  ------------------
 9455|     20|          return is_valid = false;
 9456|     20|        }
 9457|    148|        ipv4_piece = *pointer - '0';
 9458|    148|        ++pointer;
 9459|    148|        if (pointer != end && *pointer >= '0' && *pointer <= '9') {
  ------------------
  |  Branch (9459:13): [True: 138, False: 10]
  |  Branch (9459:31): [True: 62, False: 76]
  |  Branch (9459:50): [True: 59, False: 3]
  ------------------
 9460|     59|          if (ipv4_piece == 0) [[unlikely]] {
  ------------------
  |  Branch (9460:15): [True: 3, False: 56]
  ------------------
 9461|      3|            return is_valid = false;
 9462|      3|          }
 9463|     56|          ipv4_piece = ipv4_piece * 10 + (*pointer - '0');
 9464|     56|          ++pointer;
 9465|     56|          if (pointer != end && *pointer >= '0' && *pointer <= '9') {
  ------------------
  |  Branch (9465:15): [True: 53, False: 3]
  |  Branch (9465:33): [True: 31, False: 22]
  |  Branch (9465:52): [True: 27, False: 4]
  ------------------
 9466|     27|            ipv4_piece = ipv4_piece * 10 + (*pointer - '0');
 9467|     27|            ++pointer;
 9468|     27|            if (ipv4_piece > 255) [[unlikely]] {
  ------------------
  |  Branch (9468:17): [True: 7, False: 20]
  ------------------
 9469|      7|              return is_valid = false;
 9470|      7|            }
 9471|     27|          }
 9472|     56|        }
 9473|    138|        address[static_cast<size_t>(piece_index)] = static_cast<uint16_t>(
 9474|    138|            address[static_cast<size_t>(piece_index)] * 0x100 +
 9475|    138|            static_cast<uint16_t>(ipv4_piece));
 9476|    138|        ++numbers_seen;
 9477|    138|        if (numbers_seen == 2 || numbers_seen == 4) {
  ------------------
  |  Branch (9477:13): [True: 43, False: 95]
  |  Branch (9477:34): [True: 13, False: 82]
  ------------------
 9478|     56|          ++piece_index;
 9479|     56|        }
 9480|    138|      }
 9481|     18|      if (numbers_seen != 4) [[unlikely]] {
  ------------------
  |  Branch (9481:11): [True: 12, False: 6]
  ------------------
 9482|     12|        return is_valid = false;
 9483|     12|      }
 9484|      6|      break;
 9485|     18|    }
 9486|       |
 9487|    904|    if (length == 0) [[unlikely]] {
  ------------------
  |  Branch (9487:9): [True: 19, False: 885]
  ------------------
 9488|     19|      return is_valid = false;
 9489|     19|    }
 9490|       |
 9491|    885|    if (pointer != end && *pointer == ':') {
  ------------------
  |  Branch (9491:9): [True: 659, False: 226]
  |  Branch (9491:27): [True: 653, False: 6]
  ------------------
 9492|    653|      ++pointer;
 9493|    653|      if (pointer == end) [[unlikely]] {
  ------------------
  |  Branch (9493:11): [True: 3, False: 650]
  ------------------
 9494|      3|        return is_valid = false;
 9495|      3|      }
 9496|    653|    } else if (pointer != end) [[unlikely]] {
  ------------------
  |  Branch (9496:16): [True: 6, False: 226]
  ------------------
 9497|      6|      return is_valid = false;
 9498|      6|    }
 9499|       |
 9500|    876|    address[static_cast<size_t>(piece_index)] = value;
 9501|    876|    ++piece_index;
 9502|    876|  }
 9503|       |
 9504|    450|  if (compress != -1) {
  ------------------
  |  Branch (9504:7): [True: 403, False: 47]
  ------------------
 9505|    403|    const int right = piece_index - compress;
 9506|    403|    if (right > 0) {
  ------------------
  |  Branch (9506:9): [True: 185, False: 218]
  ------------------
 9507|    185|      const size_t dest = static_cast<size_t>(8 - right);
 9508|    185|      const size_t src = static_cast<size_t>(compress);
 9509|    185|      if (dest != src) {
  ------------------
  |  Branch (9509:11): [True: 175, False: 10]
  ------------------
 9510|    486|        for (size_t i = static_cast<size_t>(right); i-- > 0;) {
  ------------------
  |  Branch (9510:53): [True: 311, False: 175]
  ------------------
 9511|    311|          address[dest + i] = address[src + i];
 9512|    311|          address[src + i] = 0;
 9513|    311|        }
 9514|    175|      }
 9515|    185|    }
 9516|    403|  } else if (piece_index != 8) [[unlikely]] {
  ------------------
  |  Branch (9516:14): [True: 31, False: 16]
  ------------------
 9517|     31|    return is_valid = false;
 9518|     31|  }
 9519|       |
 9520|    419|  host = ada::serializers::ipv6(address);
 9521|    419|  ada_log("parse_ipv6 ", *host);
 9522|    419|  host_type = IPV6;
 9523|    419|  return true;
 9524|    450|}
_ZNK3ada3url12get_protocolEv:
 9835|   115k|[[nodiscard]] std::string url::get_protocol() const {
 9836|   115k|  if (is_special()) {
  ------------------
  |  Branch (9836:7): [True: 114k, False: 436]
  ------------------
 9837|   114k|    return helpers::concat(ada::scheme::details::is_special_list[type], ":");
 9838|   114k|  }
 9839|       |  // We only move the 'scheme' if it is non-special.
 9840|    436|  return helpers::concat(non_special_scheme, ":");
 9841|   115k|}
_ZNK3ada3url8get_hostEv:
 9843|   115k|[[nodiscard]] std::string url::get_host() const {
 9844|       |  // If url's host is null, then return the empty string.
 9845|       |  // If url's port is null, return url's host, serialized.
 9846|       |  // Return url's host, serialized, followed by U+003A (:) and url's port,
 9847|       |  // serialized.
 9848|   115k|  if (!host.has_value()) {
  ------------------
  |  Branch (9848:7): [True: 265, False: 114k]
  ------------------
 9849|    265|    return "";
 9850|    265|  }
 9851|   114k|  if (port.has_value()) {
  ------------------
  |  Branch (9851:7): [True: 7.60k, False: 107k]
  ------------------
 9852|  7.60k|    return host.value() + ":" + get_port();
 9853|  7.60k|  }
 9854|   107k|  return host.value();
 9855|   114k|}
_ZNK3ada3url12get_hostnameEv:
 9857|   115k|[[nodiscard]] std::string url::get_hostname() const {
 9858|   115k|  return host.value_or("");
 9859|   115k|}
_ZNK3ada3url10get_searchEv:
 9861|   115k|[[nodiscard]] std::string url::get_search() const {
 9862|       |  // If this's URL's query is either null or the empty string, then return the
 9863|       |  // empty string. Return U+003F (?), followed by this's URL's query.
 9864|   115k|  return (!query.has_value() || (query->empty())) ? "" : "?" + query.value();
  ------------------
  |  Branch (9864:11): [True: 91.0k, False: 23.9k]
  |  Branch (9864:33): [True: 794, False: 23.1k]
  ------------------
 9865|   115k|}
_ZNK3ada3url12get_usernameEv:
 9867|   115k|[[nodiscard]] const std::string& url::get_username() const noexcept {
 9868|   115k|  return username;
 9869|   115k|}
_ZNK3ada3url12get_passwordEv:
 9871|   115k|[[nodiscard]] const std::string& url::get_password() const noexcept {
 9872|   115k|  return password;
 9873|   115k|}
_ZNK3ada3url8get_portEv:
 9875|   122k|[[nodiscard]] std::string url::get_port() const {
 9876|   122k|  return port.has_value() ? std::to_string(port.value()) : "";
  ------------------
  |  Branch (9876:10): [True: 15.2k, False: 107k]
  ------------------
 9877|   122k|}
_ZNK3ada3url8get_hashEv:
 9879|   115k|[[nodiscard]] std::string url::get_hash() const {
 9880|       |  // If this's URL's fragment is either null or the empty string, then return
 9881|       |  // the empty string. Return U+0023 (#), followed by this's URL's fragment.
 9882|   115k|  return (!hash.has_value() || (hash->empty())) ? "" : "#" + hash.value();
  ------------------
  |  Branch (9882:11): [True: 97.7k, False: 17.2k]
  |  Branch (9882:32): [True: 1.13k, False: 16.1k]
  ------------------
 9883|   115k|}
_ZN3ada3url8set_hrefENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
10173|   115k|bool url::set_href(const std::string_view input) {
10174|   115k|  ada::result<ada::url> out = ada::parse<ada::url>(input);
10175|       |
10176|   115k|  if (out) {
  ------------------
  |  Branch (10176:7): [True: 115k, False: 0]
  ------------------
10177|       |    // The parser enforces get_max_input_length() on both the input and the
10178|       |    // normalized result. This is a defense-in-depth check.
10179|   115k|    if (out->get_href_size() > ada::get_max_input_length()) {
  ------------------
  |  Branch (10179:9): [True: 0, False: 115k]
  ------------------
10180|      0|      return false;
10181|      0|    }
10182|   115k|    *this = *out;
10183|   115k|  }
10184|       |
10185|   115k|  return out.has_value();
10186|   115k|}
_ZN3ada6parser14parse_url_implINS_3urlELb1EEET_NSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPKS3_:
10503|   347k|                           const result_type* base_url) {
10504|       |  // We can specialize the implementation per type.
10505|       |  // Important: result_type_is_ada_url is evaluated at *compile time*. This
10506|       |  // means that doing if constexpr(result_type_is_ada_url) { something } else {
10507|       |  // something else } is free (at runtime). This means that ada::url_aggregator
10508|       |  // and ada::url **do not have to support the exact same API**.
10509|   347k|  constexpr bool result_type_is_ada_url = std::is_same_v<url, result_type>;
10510|   347k|  constexpr bool result_type_is_ada_url_aggregator =
10511|   347k|      std::is_same_v<url_aggregator, result_type>;
10512|   347k|  static_assert(result_type_is_ada_url ||
10513|   347k|                result_type_is_ada_url_aggregator);  // We don't support
10514|       |                                                     // anything else for now.
10515|       |
10516|   347k|  ada_log("ada::parser::parse_url('", user_input, "' [", user_input.size(),
10517|   347k|          " bytes],", (base_url != nullptr ? base_url->to_string() : "null"),
10518|   347k|          ")");
10519|       |
10520|   347k|  state state = state::SCHEME_START;
10521|   347k|  result_type url{};
10522|       |
10523|   347k|  const uint32_t max_input_length = ada::get_max_input_length();
10524|       |
10525|       |  // We refuse to parse URL strings that exceed the maximum input length.
10526|       |  // By default, this is 4GB but can be configured via
10527|       |  // ada::set_max_input_length().
10528|   347k|  if (user_input.size() > max_input_length) [[unlikely]] {
  ------------------
  |  Branch (10528:7): [True: 0, False: 347k]
  ------------------
10529|      0|    url.is_valid = false;
10530|      0|  }
10531|       |  // Going forward, user_input.size() is in [0,
10532|       |  // std::numeric_limits<uint32_t>::max). If we are provided with an invalid
10533|       |  // base, or the optional_url was invalid, we must return.
10534|   347k|  if (base_url != nullptr) {
  ------------------
  |  Branch (10534:7): [True: 0, False: 347k]
  ------------------
10535|      0|    url.is_valid &= base_url->is_valid;
10536|      0|  }
10537|   347k|  if (!url.is_valid) {
  ------------------
  |  Branch (10537:7): [True: 0, False: 347k]
  ------------------
10538|      0|    return url;
10539|      0|  }
10540|       |
10541|       |  // Simple absolute http(s) fast path (before tabs/newline scan).
10542|       |  // Skip digit-led hosts (IPv4) with a cheap peek.
10543|   347k|  if constexpr (store_values) {
10544|   347k|    if (base_url == nullptr) {
  ------------------
  |  Branch (10544:9): [True: 347k, False: 0]
  ------------------
10545|   347k|      const auto* p = reinterpret_cast<const uint8_t*>(user_input.data());
10546|   347k|      const size_t n = user_input.size();
10547|   347k|      const bool digit_led_host = (n >= 8 && p[4] == ':' && p[5] == '/' &&
  ------------------
  |  Branch (10547:36): [True: 347k, False: 34]
  |  Branch (10547:46): [True: 95.3k, False: 252k]
  |  Branch (10547:61): [True: 94.6k, False: 765]
  ------------------
10548|  94.6k|                                   p[6] == '/' && p[7] >= '0' && p[7] <= '9') ||
  ------------------
  |  Branch (10548:36): [True: 94.4k, False: 134]
  |  Branch (10548:51): [True: 92.7k, False: 1.69k]
  |  Branch (10548:66): [True: 43.7k, False: 49.0k]
  ------------------
10549|   304k|                                  (n >= 9 && p[5] == ':' && p[6] == '/' &&
  ------------------
  |  Branch (10549:36): [True: 304k, False: 99]
  |  Branch (10549:46): [True: 251k, False: 52.6k]
  |  Branch (10549:61): [True: 250k, False: 757]
  ------------------
10550|   250k|                                   p[7] == '/' && p[8] >= '0' && p[8] <= '9');
  ------------------
  |  Branch (10550:36): [True: 250k, False: 87]
  |  Branch (10550:51): [True: 250k, False: 511]
  |  Branch (10550:66): [True: 1.92k, False: 248k]
  ------------------
10551|   347k|      if (!digit_led_host && try_parse_simple_absolute(user_input, url)) {
  ------------------
  |  Branch (10551:11): [True: 302k, False: 45.6k]
  |  Branch (10551:30): [True: 191k, False: 110k]
  ------------------
10552|       |        if constexpr (result_type_is_ada_url_aggregator) {
10553|       |          if (url.buffer.size() > max_input_length) [[unlikely]] {
10554|       |            url.is_valid = false;
10555|       |          }
10556|   191k|        } else {
10557|   191k|          if (url.get_href_size() > max_input_length) [[unlikely]] {
  ------------------
  |  Branch (10557:15): [True: 0, False: 191k]
  ------------------
10558|      0|            url.is_valid = false;
10559|      0|          }
10560|   191k|        }
10561|   191k|        return url;
10562|   191k|      }
10563|   347k|    }
10564|   347k|  }
10565|       |
10566|   156k|  std::string tmp_buffer;
10567|   347k|  std::string_view url_data;
10568|   347k|  if (unicode::has_tabs_or_newline(user_input)) [[unlikely]] {
  ------------------
  |  Branch (10568:7): [True: 389, False: 347k]
  ------------------
10569|    389|    tmp_buffer = user_input;
10570|       |    // Optimization opportunity: Instead of copying and then pruning, we could
10571|       |    // just directly build the string from user_input.
10572|    389|    helpers::remove_ascii_tab_or_newline(tmp_buffer);
10573|    389|    url_data = tmp_buffer;
10574|   347k|  } else [[likely]] {
10575|   347k|    url_data = user_input;
10576|   347k|  }
10577|       |
10578|       |  // Leading and trailing control characters are uncommon and easy to deal with
10579|       |  // (no performance concern).
10580|   347k|  helpers::trim_c0_whitespace(url_data);
10581|       |
10582|       |  if constexpr (result_type_is_ada_url_aggregator && store_values) {
10583|       |    // Most of the time, we just need user_input.size().
10584|       |    // In some instances, we may need a bit more.
10585|       |    ///////////////////////////
10586|       |    // This is *very* important. This line should *not* be removed
10587|       |    // hastily. There are principled reasons why reserve is important
10588|       |    // for performance. If you have a benchmark with small inputs,
10589|       |    // it may not matter, but in other instances, it could.
10590|       |    ////
10591|       |    // This rounds up to the next power of two.
10592|       |    // We know that user_input.size() is in [0,
10593|       |    // std::numeric_limits<uint32_t>::max).
10594|       |    uint32_t reserve_capacity =
10595|       |        (0xFFFFFFFF >>
10596|       |         helpers::leading_zeroes(uint32_t(1 | user_input.size()))) +
10597|       |        1;
10598|       |    url.reserve(reserve_capacity);
10599|       |  }
10600|       |
10601|       |  // Optimization opportunity. Most websites do not have fragment.
10602|   347k|  std::optional<std::string_view> fragment = helpers::prune_hash(url_data);
10603|       |  // We add it last so that an implementation like ada::url_aggregator
10604|       |  // can append it last to its internal buffer, thus improving performance.
10605|       |
10606|       |  // Here url_data no longer has its fragment.
10607|       |  // We are going to access the data from url_data (it is immutable).
10608|       |  // At any given time, we are pointing at byte 'input_position' in url_data.
10609|       |  // The input_position variable should range from 0 to input_size.
10610|       |  // It is illegal to access url_data at input_size.
10611|   347k|  size_t input_position = 0;
10612|   347k|  const size_t input_size = url_data.size();
10613|       |  // Keep running the following state machine by switching on state.
10614|       |  // If after a run pointer points to the EOF code point, go to the next step.
10615|       |  // Otherwise, increase pointer by 1 and continue with the state machine.
10616|       |  // We never decrement input_position.
10617|  1.42M|  while (input_position <= input_size) {
  ------------------
  |  Branch (10617:10): [True: 1.09M, False: 333k]
  ------------------
10618|  1.09M|    ada_log("In parsing at ", input_position, " out of ", input_size,
10619|  1.09M|            " in state ", ada::to_string(state));
10620|  1.09M|    switch (state) {
10621|   156k|      case state::SCHEME_START: {
  ------------------
  |  Branch (10621:7): [True: 156k, False: 935k]
  ------------------
10622|   156k|        ada_log("SCHEME_START ", helpers::substring(url_data, input_position));
10623|       |        // If c is an ASCII alpha, append c, lowercased, to buffer, and set
10624|       |        // state to scheme state.
10625|   156k|        if ((input_position != input_size) &&
  ------------------
  |  Branch (10625:13): [True: 156k, False: 1]
  ------------------
10626|   156k|            checkers::is_alpha(url_data[input_position])) {
  ------------------
  |  Branch (10626:13): [True: 156k, False: 29]
  ------------------
10627|   156k|          state = state::SCHEME;
10628|   156k|          input_position++;
10629|   156k|        } else {
10630|       |          // Otherwise, if state override is not given, set state to no scheme
10631|       |          // state and decrease pointer by 1.
10632|     30|          state = state::NO_SCHEME;
10633|     30|        }
10634|   156k|        break;
10635|      0|      }
10636|   156k|      case state::SCHEME: {
  ------------------
  |  Branch (10636:7): [True: 156k, False: 935k]
  ------------------
10637|   156k|        ada_log("SCHEME ", helpers::substring(url_data, input_position));
10638|       |        // If c is an ASCII alphanumeric, U+002B (+), U+002D (-), or U+002E (.),
10639|       |        // append c, lowercased, to buffer.
10640|   725k|        while ((input_position != input_size) &&
  ------------------
  |  Branch (10640:16): [True: 725k, False: 1]
  ------------------
10641|   725k|               (unicode::is_alnum_plus(url_data[input_position]))) {
  ------------------
  |  Branch (10641:16): [True: 569k, False: 156k]
  ------------------
10642|   569k|          input_position++;
10643|   569k|        }
10644|       |        // Otherwise, if c is U+003A (:), then:
10645|   156k|        if ((input_position != input_size) &&
  ------------------
  |  Branch (10645:13): [True: 156k, False: 1]
  ------------------
10646|   156k|            (url_data[input_position] == ':')) {
  ------------------
  |  Branch (10646:13): [True: 156k, False: 35]
  ------------------
10647|   156k|          ada_log("SCHEME the scheme should be ",
10648|   156k|                  url_data.substr(0, input_position));
10649|   156k|          if constexpr (result_type_is_ada_url) {
10650|   156k|            if (!url.parse_scheme(url_data.substr(0, input_position))) {
  ------------------
  |  Branch (10650:17): [True: 0, False: 156k]
  ------------------
10651|      0|              return url;
10652|      0|            }
10653|       |          } else {
10654|       |            // we pass the colon along instead of painfully adding it back.
10655|       |            if (!url.parse_scheme_with_colon(
10656|       |                    url_data.substr(0, input_position + 1))) {
10657|       |              return url;
10658|       |            }
10659|       |          }
10660|   156k|          ada_log("SCHEME the scheme is ", url.get_protocol());
10661|       |
10662|       |          // If url's scheme is "file", then:
10663|       |          // NOLINTNEXTLINE(bugprone-branch-clone)
10664|   156k|          if (url.type == scheme::type::FILE) {
  ------------------
  |  Branch (10664:15): [True: 1.26k, False: 154k]
  ------------------
10665|       |            // Set state to file state.
10666|  1.26k|            state = state::FILE;
10667|  1.26k|          }
10668|       |          // Otherwise, if url is special, base is non-null, and base's scheme
10669|       |          // is url's scheme: Note: Doing base_url->scheme is unsafe if base_url
10670|       |          // != nullptr is false.
10671|   154k|          else if (url.is_special() && base_url != nullptr &&
  ------------------
  |  Branch (10671:20): [True: 153k, False: 1.37k]
  |  Branch (10671:40): [True: 0, False: 153k]
  ------------------
10672|      0|                   base_url->type == url.type) {
  ------------------
  |  Branch (10672:20): [True: 0, False: 0]
  ------------------
10673|       |            // Set state to special relative or authority state.
10674|      0|            state = state::SPECIAL_RELATIVE_OR_AUTHORITY;
10675|      0|          }
10676|       |          // Otherwise, if url is special, set state to special authority
10677|       |          // slashes state.
10678|   154k|          else if (url.is_special()) {
  ------------------
  |  Branch (10678:20): [True: 153k, False: 1.37k]
  ------------------
10679|   153k|            state = state::SPECIAL_AUTHORITY_SLASHES;
10680|   153k|          }
10681|       |          // Otherwise, if remaining starts with an U+002F (/), set state to
10682|       |          // path or authority state and increase pointer by 1.
10683|  1.37k|          else if (input_position + 1 < input_size &&
  ------------------
  |  Branch (10683:20): [True: 1.31k, False: 60]
  ------------------
10684|  1.31k|                   url_data[input_position + 1] == '/') {
  ------------------
  |  Branch (10684:20): [True: 883, False: 435]
  ------------------
10685|    883|            state = state::PATH_OR_AUTHORITY;
10686|    883|            input_position++;
10687|    883|          }
10688|       |          // Otherwise, set url's path to the empty string and set state to
10689|       |          // opaque path state.
10690|    495|          else {
10691|    495|            state = state::OPAQUE_PATH;
10692|    495|          }
10693|   156k|        }
10694|       |        // Otherwise, if state override is not given, set buffer to the empty
10695|       |        // string, state to no scheme state, and start over (from the first code
10696|       |        // point in input).
10697|     36|        else {
10698|     36|          state = state::NO_SCHEME;
10699|     36|          input_position = 0;
10700|     36|          break;
10701|     36|        }
10702|   156k|        input_position++;
10703|   156k|        break;
10704|   156k|      }
10705|     66|      case state::NO_SCHEME: {
  ------------------
  |  Branch (10705:7): [True: 66, False: 1.09M]
  ------------------
10706|     66|        ada_log("NO_SCHEME ", helpers::substring(url_data, input_position));
10707|       |        // The fragment was pruned from url_data before the state machine ran,
10708|       |        // so 'c is U+0023 (#)' holds exactly when a fragment was found and
10709|       |        // nothing else remains in front of it.
10710|     66|        const bool c_is_hash =
10711|     66|            fragment.has_value() && input_position == input_size;
  ------------------
  |  Branch (10711:13): [True: 43, False: 23]
  |  Branch (10711:37): [True: 1, False: 42]
  ------------------
10712|       |        // If base is null, or base has an opaque path and c is not U+0023 (#),
10713|       |        // validation error, return failure.
10714|     66|        if (base_url == nullptr || (base_url->has_opaque_path && !c_is_hash)) {
  ------------------
  |  Branch (10714:13): [True: 66, False: 0]
  |  Branch (10714:37): [True: 0, False: 0]
  |  Branch (10714:66): [True: 0, False: 0]
  ------------------
10715|     66|          ada_log("NO_SCHEME validation error");
10716|     66|          url.is_valid = false;
10717|     66|          return url;
10718|     66|        }
10719|       |        // Otherwise, if base has an opaque path and c is U+0023 (#),
10720|       |        // set url's scheme to base's scheme, url's path to base's path, url's
10721|       |        // query to base's query, and set state to fragment state.
10722|      0|        else if (base_url->has_opaque_path && c_is_hash) {
  ------------------
  |  Branch (10722:18): [True: 0, False: 0]
  |  Branch (10722:47): [True: 0, False: 0]
  ------------------
10723|      0|          ada_log("NO_SCHEME opaque base with fragment");
10724|      0|          url.copy_scheme(*base_url);
10725|      0|          url.has_opaque_path = base_url->has_opaque_path;
10726|       |
10727|      0|          if constexpr (result_type_is_ada_url) {
10728|      0|            url.path = base_url->path;
10729|      0|            url.query = base_url->query;
10730|       |          } else {
10731|       |            url.update_base_pathname(base_url->get_pathname());
10732|       |            if (base_url->has_search()) {
10733|       |              // get_search() returns "" for an empty query string (URL ends
10734|       |              // with '?'). update_base_search("") would incorrectly clear the
10735|       |              // query, so pass "?" to preserve the empty query distinction.
10736|       |              auto s = base_url->get_search();
10737|       |              url.update_base_search(s.empty() ? std::string_view("?") : s);
10738|       |            }
10739|       |          }
10740|      0|          url.update_unencoded_base_hash(*fragment);
10741|      0|          return url;
10742|      0|        }
10743|       |        // Otherwise, if base's scheme is not "file", set state to relative
10744|       |        // state and decrease pointer by 1.
10745|       |        // NOLINTNEXTLINE(bugprone-branch-clone)
10746|      0|        else if (base_url->type != scheme::type::FILE) {
  ------------------
  |  Branch (10746:18): [True: 0, False: 0]
  ------------------
10747|      0|          ada_log("NO_SCHEME non-file relative path");
10748|      0|          state = state::RELATIVE_SCHEME;
10749|      0|        }
10750|       |        // Otherwise, set state to file state and decrease pointer by 1.
10751|      0|        else {
10752|      0|          ada_log("NO_SCHEME file base type");
10753|      0|          state = state::FILE;
10754|      0|        }
10755|      0|        break;
10756|     66|      }
10757|   154k|      case state::AUTHORITY: {
  ------------------
  |  Branch (10757:7): [True: 154k, False: 937k]
  ------------------
10758|   154k|        ada_log("AUTHORITY ", helpers::substring(url_data, input_position));
10759|       |        // most URLs have no @. Having no @ tells us that we don't have to worry
10760|       |        // about AUTHORITY. Of course, we could have @ and still not have to
10761|       |        // worry about AUTHORITY.
10762|       |        // TODO: Instead of just collecting a bool, collect the location of the
10763|       |        // '@' and do something useful with it.
10764|       |        // TODO: We could do various processing early on, using a single pass
10765|       |        // over the string to collect information about it, e.g., telling us
10766|       |        // whether there is a @ and if so, where (or how many).
10767|       |
10768|       |        // Check if url data contains an @.
10769|   154k|        if (url_data.find('@', input_position) == std::string_view::npos) {
  ------------------
  |  Branch (10769:13): [True: 131k, False: 22.7k]
  ------------------
10770|   131k|          state = state::HOST;
10771|   131k|          break;
10772|   131k|        }
10773|  22.7k|        bool at_sign_seen{false};
10774|  22.7k|        bool password_token_seen{false};
10775|       |        /**
10776|       |         * We expect something of the sort...
10777|       |         * https://user:pass@example.com:1234/foo/bar?baz#quux
10778|       |         * --------^
10779|       |         */
10780|  57.3k|        do {
10781|  57.3k|          std::string_view view = url_data.substr(input_position);
10782|       |          // The delimiters are @, /, ? \\.
10783|  57.3k|          size_t location =
10784|  57.3k|              url.is_special() ? helpers::find_authority_delimiter_special(view)
  ------------------
  |  Branch (10784:15): [True: 57.1k, False: 256]
  ------------------
10785|  57.3k|                               : helpers::find_authority_delimiter(view);
10786|  57.3k|          std::string_view authority_view = view.substr(0, location);
10787|  57.3k|          size_t end_of_authority = input_position + authority_view.size();
10788|       |          // If c is U+0040 (@), then:
10789|  57.3k|          if ((end_of_authority != input_size) &&
  ------------------
  |  Branch (10789:15): [True: 56.9k, False: 415]
  ------------------
10790|  56.9k|              (url_data[end_of_authority] == '@')) {
  ------------------
  |  Branch (10790:15): [True: 34.6k, False: 22.3k]
  ------------------
10791|       |            // If atSignSeen is true, then prepend "%40" to buffer.
10792|  34.6k|            if (at_sign_seen) {
  ------------------
  |  Branch (10792:17): [True: 12.1k, False: 22.4k]
  ------------------
10793|  12.1k|              if (password_token_seen) {
  ------------------
  |  Branch (10793:19): [True: 3.40k, False: 8.73k]
  ------------------
10794|  3.40k|                if constexpr (result_type_is_ada_url) {
10795|  3.40k|                  url.password += "%40";
10796|       |                } else {
10797|       |                  url.append_base_password("%40");
10798|       |                }
10799|  8.73k|              } else {
10800|  8.73k|                if constexpr (result_type_is_ada_url) {
10801|  8.73k|                  url.username += "%40";
10802|       |                } else {
10803|       |                  url.append_base_username("%40");
10804|       |                }
10805|  8.73k|              }
10806|  12.1k|            }
10807|       |
10808|  34.6k|            at_sign_seen = true;
10809|       |
10810|  34.6k|            if (!password_token_seen) {
  ------------------
  |  Branch (10810:17): [True: 31.2k, False: 3.40k]
  ------------------
10811|  31.2k|              size_t password_token_location = authority_view.find(':');
10812|  31.2k|              password_token_seen =
10813|  31.2k|                  password_token_location != std::string_view::npos;
10814|       |
10815|  31.2k|              if constexpr (store_values) {
10816|  31.2k|                if (!password_token_seen) {
  ------------------
  |  Branch (10816:21): [True: 9.78k, False: 21.4k]
  ------------------
10817|  9.78k|                  if constexpr (result_type_is_ada_url) {
10818|  9.78k|                    url.username += unicode::percent_encode(
10819|  9.78k|                        authority_view,
10820|  9.78k|                        character_sets::USERINFO_PERCENT_ENCODE);
10821|       |                  } else {
10822|       |                    url.append_base_username(unicode::percent_encode(
10823|       |                        authority_view,
10824|       |                        character_sets::USERINFO_PERCENT_ENCODE));
10825|       |                  }
10826|  21.4k|                } else {
10827|  21.4k|                  if constexpr (result_type_is_ada_url) {
10828|  21.4k|                    url.username += unicode::percent_encode(
10829|  21.4k|                        authority_view.substr(0, password_token_location),
10830|  21.4k|                        character_sets::USERINFO_PERCENT_ENCODE);
10831|  21.4k|                    url.password += unicode::percent_encode(
10832|  21.4k|                        authority_view.substr(password_token_location + 1),
10833|  21.4k|                        character_sets::USERINFO_PERCENT_ENCODE);
10834|       |                  } else {
10835|       |                    url.append_base_username(unicode::percent_encode(
10836|       |                        authority_view.substr(0, password_token_location),
10837|       |                        character_sets::USERINFO_PERCENT_ENCODE));
10838|       |                    url.append_base_password(unicode::percent_encode(
10839|       |                        authority_view.substr(password_token_location + 1),
10840|       |                        character_sets::USERINFO_PERCENT_ENCODE));
10841|       |                  }
10842|  21.4k|                }
10843|  31.2k|              }
10844|  31.2k|            } else if constexpr (store_values) {
10845|  3.40k|              if constexpr (result_type_is_ada_url) {
10846|  3.40k|                url.password += unicode::percent_encode(
10847|  3.40k|                    authority_view, character_sets::USERINFO_PERCENT_ENCODE);
10848|       |              } else {
10849|       |                url.append_base_password(unicode::percent_encode(
10850|       |                    authority_view, character_sets::USERINFO_PERCENT_ENCODE));
10851|       |              }
10852|  3.40k|            }
10853|  34.6k|          }
10854|       |          // Otherwise, if one of the following is true:
10855|       |          // - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#)
10856|       |          // - url is special and c is U+005C (\)
10857|  22.7k|          else if (end_of_authority == input_size ||
  ------------------
  |  Branch (10857:20): [True: 415, False: 22.3k]
  ------------------
10858|  22.3k|                   url_data[end_of_authority] == '/' ||
  ------------------
  |  Branch (10858:20): [True: 22.1k, False: 150]
  ------------------
10859|    150|                   url_data[end_of_authority] == '?' ||
  ------------------
  |  Branch (10859:20): [True: 110, False: 40]
  ------------------
10860|  22.7k|                   (url.is_special() && url_data[end_of_authority] == '\\')) {
  ------------------
  |  Branch (10860:21): [True: 40, False: 0]
  |  Branch (10860:41): [True: 40, False: 0]
  ------------------
10861|       |            // If atSignSeen is true and authority_view is the empty string,
10862|       |            // validation error, return failure.
10863|  22.7k|            if (at_sign_seen && authority_view.empty()) {
  ------------------
  |  Branch (10863:17): [True: 22.4k, False: 264]
  |  Branch (10863:33): [True: 172, False: 22.3k]
  ------------------
10864|    172|              url.is_valid = false;
10865|    172|              return url;
10866|    172|            }
10867|  22.5k|            state = state::HOST;
10868|  22.5k|            break;
10869|  22.7k|          }
10870|  34.6k|          if (end_of_authority == input_size) {
  ------------------
  |  Branch (10870:15): [True: 0, False: 34.6k]
  ------------------
10871|      0|            if constexpr (store_values) {
10872|      0|              if (fragment.has_value()) {
  ------------------
  |  Branch (10872:19): [True: 0, False: 0]
  ------------------
10873|      0|                url.update_unencoded_base_hash(*fragment);
10874|      0|              }
10875|      0|            }
10876|      0|            return url;
10877|      0|          }
10878|  34.6k|          input_position = end_of_authority + 1;
10879|  34.6k|        } while (true);
  ------------------
  |  Branch (10879:18): [True: 34.6k, Folded]
  ------------------
10880|       |
10881|  22.5k|        break;
10882|  22.7k|      }
10883|  22.5k|      case state::SPECIAL_RELATIVE_OR_AUTHORITY: {
  ------------------
  |  Branch (10883:7): [True: 0, False: 1.09M]
  ------------------
10884|      0|        ada_log("SPECIAL_RELATIVE_OR_AUTHORITY ",
10885|      0|                helpers::substring(url_data, input_position));
10886|       |
10887|       |        // If c is U+002F (/) and remaining starts with U+002F (/),
10888|       |        // then set state to special authority ignore slashes state and increase
10889|       |        // pointer by 1.
10890|      0|        if (url_data.substr(input_position, 2) == "//") {
  ------------------
  |  Branch (10890:13): [True: 0, False: 0]
  ------------------
10891|      0|          state = state::SPECIAL_AUTHORITY_IGNORE_SLASHES;
10892|      0|          input_position += 2;
10893|      0|        } else {
10894|       |          // Otherwise, validation error, set state to relative state and
10895|       |          // decrease pointer by 1.
10896|      0|          state = state::RELATIVE_SCHEME;
10897|      0|        }
10898|       |
10899|      0|        break;
10900|  22.7k|      }
10901|    883|      case state::PATH_OR_AUTHORITY: {
  ------------------
  |  Branch (10901:7): [True: 883, False: 1.09M]
  ------------------
10902|    883|        ada_log("PATH_OR_AUTHORITY ",
10903|    883|                helpers::substring(url_data, input_position));
10904|       |
10905|       |        // If c is U+002F (/), then set state to authority state.
10906|    883|        if ((input_position != input_size) &&
  ------------------
  |  Branch (10906:13): [True: 869, False: 14]
  ------------------
10907|    869|            (url_data[input_position] == '/')) {
  ------------------
  |  Branch (10907:13): [True: 583, False: 286]
  ------------------
10908|    583|          state = state::AUTHORITY;
10909|    583|          input_position++;
10910|    583|        } else {
10911|       |          // Otherwise, set state to path state, and decrease pointer by 1.
10912|    300|          state = state::PATH;
10913|    300|        }
10914|       |
10915|    883|        break;
10916|  22.7k|      }
10917|      0|      case state::RELATIVE_SCHEME: {
  ------------------
  |  Branch (10917:7): [True: 0, False: 1.09M]
  ------------------
10918|      0|        ada_log("RELATIVE_SCHEME ",
10919|      0|                helpers::substring(url_data, input_position));
10920|       |
10921|       |        // Set url's scheme to base's scheme.
10922|      0|        url.copy_scheme(*base_url);
10923|       |
10924|       |        // If c is U+002F (/), then set state to relative slash state.
10925|      0|        if ((input_position != input_size) &&
  ------------------
  |  Branch (10925:13): [True: 0, False: 0]
  ------------------
10926|       |            // NOLINTNEXTLINE(bugprone-branch-clone)
10927|      0|            (url_data[input_position] == '/')) {
  ------------------
  |  Branch (10927:13): [True: 0, False: 0]
  ------------------
10928|      0|          ada_log(
10929|      0|              "RELATIVE_SCHEME if c is U+002F (/), then set state to relative "
10930|      0|              "slash state");
10931|      0|          state = state::RELATIVE_SLASH;
10932|      0|        } else if (url.is_special() && (input_position != input_size) &&
  ------------------
  |  Branch (10932:20): [True: 0, False: 0]
  |  Branch (10932:40): [True: 0, False: 0]
  ------------------
10933|      0|                   (url_data[input_position] == '\\')) {
  ------------------
  |  Branch (10933:20): [True: 0, False: 0]
  ------------------
10934|       |          // Otherwise, if url is special and c is U+005C (\), validation error,
10935|       |          // set state to relative slash state.
10936|      0|          ada_log(
10937|      0|              "RELATIVE_SCHEME  if url is special and c is U+005C, validation "
10938|      0|              "error, set state to relative slash state");
10939|      0|          state = state::RELATIVE_SLASH;
10940|      0|        } else {
10941|      0|          ada_log("RELATIVE_SCHEME otherwise");
10942|       |          // Set url's username to base's username, url's password to base's
10943|       |          // password, url's host to base's host, url's port to base's port,
10944|       |          // url's path to a clone of base's path, and url's query to base's
10945|       |          // query.
10946|      0|          if constexpr (result_type_is_ada_url) {
10947|      0|            url.username = base_url->username;
10948|      0|            url.password = base_url->password;
10949|      0|            url.host = base_url->host;
10950|      0|            url.port = base_url->port;
10951|       |            // cloning the base path includes cloning the has_opaque_path flag
10952|      0|            url.has_opaque_path = base_url->has_opaque_path;
10953|      0|            url.path = base_url->path;
10954|      0|            url.query = base_url->query;
10955|       |          } else {
10956|       |            url.update_base_authority(base_url->get_href(),
10957|       |                                      base_url->get_components());
10958|       |            url.update_host_to_base_host(base_url->get_hostname());
10959|       |            url.update_base_port(base_url->retrieve_base_port());
10960|       |            // cloning the base path includes cloning the has_opaque_path flag
10961|       |            url.has_opaque_path = base_url->has_opaque_path;
10962|       |            url.update_base_pathname(base_url->get_pathname());
10963|       |            if (base_url->has_search()) {
10964|       |              // get_search() returns "" for an empty query string (URL ends
10965|       |              // with '?'). update_base_search("") would incorrectly clear the
10966|       |              // query, so pass "?" to preserve the empty query distinction.
10967|       |              auto s = base_url->get_search();
10968|       |              url.update_base_search(s.empty() ? std::string_view("?") : s);
10969|       |            }
10970|       |          }
10971|       |
10972|      0|          url.has_opaque_path = base_url->has_opaque_path;
10973|       |
10974|       |          // If c is U+003F (?), then set url's query to the empty string, and
10975|       |          // state to query state.
10976|      0|          if ((input_position != input_size) &&
  ------------------
  |  Branch (10976:15): [True: 0, False: 0]
  ------------------
10977|      0|              (url_data[input_position] == '?')) {
  ------------------
  |  Branch (10977:15): [True: 0, False: 0]
  ------------------
10978|      0|            state = state::QUERY;
10979|      0|          }
10980|       |          // Otherwise, if c is not the EOF code point:
10981|      0|          else if (input_position != input_size) {
  ------------------
  |  Branch (10981:20): [True: 0, False: 0]
  ------------------
10982|       |            // Set url's query to null.
10983|      0|            url.clear_search();
10984|      0|            if constexpr (result_type_is_ada_url) {
10985|       |              // Shorten url's path.
10986|      0|              helpers::shorten_path(url.path, url.type);
10987|       |            } else {
10988|       |              std::string_view path = url.get_pathname();
10989|       |              if (helpers::shorten_path(path, url.type)) {
10990|       |                url.update_base_pathname(std::move(std::string(path)));
10991|       |              }
10992|       |            }
10993|       |            // Set state to path state and decrease pointer by 1.
10994|      0|            state = state::PATH;
10995|      0|            break;
10996|      0|          }
10997|      0|        }
10998|      0|        input_position++;
10999|      0|        break;
11000|      0|      }
11001|      0|      case state::RELATIVE_SLASH: {
  ------------------
  |  Branch (11001:7): [True: 0, False: 1.09M]
  ------------------
11002|      0|        ada_log("RELATIVE_SLASH ",
11003|      0|                helpers::substring(url_data, input_position));
11004|       |
11005|       |        // If url is special and c is U+002F (/) or U+005C (\), then:
11006|       |        // NOLINTNEXTLINE(bugprone-branch-clone)
11007|      0|        if (url.is_special() && (input_position != input_size) &&
  ------------------
  |  Branch (11007:13): [True: 0, False: 0]
  |  Branch (11007:33): [True: 0, False: 0]
  ------------------
11008|      0|            (url_data[input_position] == '/' ||
  ------------------
  |  Branch (11008:14): [True: 0, False: 0]
  ------------------
11009|      0|             url_data[input_position] == '\\')) {
  ------------------
  |  Branch (11009:14): [True: 0, False: 0]
  ------------------
11010|       |          // Set state to special authority ignore slashes state.
11011|      0|          state = state::SPECIAL_AUTHORITY_IGNORE_SLASHES;
11012|      0|        }
11013|       |        // Otherwise, if c is U+002F (/), then set state to authority state.
11014|      0|        else if ((input_position != input_size) &&
  ------------------
  |  Branch (11014:18): [True: 0, False: 0]
  ------------------
11015|      0|                 (url_data[input_position] == '/')) {
  ------------------
  |  Branch (11015:18): [True: 0, False: 0]
  ------------------
11016|      0|          state = state::AUTHORITY;
11017|      0|        }
11018|       |        // Otherwise, set
11019|       |        // - url's username to base's username,
11020|       |        // - url's password to base's password,
11021|       |        // - url's host to base's host,
11022|       |        // - url's port to base's port,
11023|       |        // - state to path state, and then, decrease pointer by 1.
11024|      0|        else {
11025|      0|          if constexpr (result_type_is_ada_url) {
11026|      0|            url.username = base_url->username;
11027|      0|            url.password = base_url->password;
11028|      0|            url.host = base_url->host;
11029|      0|            url.port = base_url->port;
11030|       |          } else {
11031|       |            url.update_base_authority(base_url->get_href(),
11032|       |                                      base_url->get_components());
11033|       |            url.update_host_to_base_host(base_url->get_hostname());
11034|       |            url.update_base_port(base_url->retrieve_base_port());
11035|       |          }
11036|      0|          state = state::PATH;
11037|      0|          break;
11038|      0|        }
11039|       |
11040|      0|        input_position++;
11041|      0|        break;
11042|      0|      }
11043|   153k|      case state::SPECIAL_AUTHORITY_SLASHES: {
  ------------------
  |  Branch (11043:7): [True: 153k, False: 938k]
  ------------------
11044|   153k|        ada_log("SPECIAL_AUTHORITY_SLASHES ",
11045|   153k|                helpers::substring(url_data, input_position));
11046|       |
11047|       |        // If c is U+002F (/) and remaining starts with U+002F (/),
11048|       |        // then set state to special authority ignore slashes state and increase
11049|       |        // pointer by 1.
11050|   153k|        if (url_data.substr(input_position, 2) == "//") {
  ------------------
  |  Branch (11050:13): [True: 152k, False: 1.42k]
  ------------------
11051|   152k|          input_position += 2;
11052|   152k|        }
11053|       |
11054|   153k|        [[fallthrough]];
11055|   153k|      }
11056|   153k|      case state::SPECIAL_AUTHORITY_IGNORE_SLASHES: {
  ------------------
  |  Branch (11056:7): [True: 0, False: 1.09M]
  ------------------
11057|   153k|        ada_log("SPECIAL_AUTHORITY_IGNORE_SLASHES ",
11058|   153k|                helpers::substring(url_data, input_position));
11059|       |
11060|       |        // If c is neither U+002F (/) nor U+005C (\), then set state to
11061|       |        // authority state and decrease pointer by 1.
11062|   155k|        while ((input_position != input_size) &&
  ------------------
  |  Branch (11062:16): [True: 155k, False: 59]
  ------------------
11063|   155k|               ((url_data[input_position] == '/') ||
  ------------------
  |  Branch (11063:17): [True: 563, False: 154k]
  ------------------
11064|   154k|                (url_data[input_position] == '\\'))) {
  ------------------
  |  Branch (11064:17): [True: 1.29k, False: 153k]
  ------------------
11065|  1.85k|          input_position++;
11066|  1.85k|        }
11067|   153k|        state = state::AUTHORITY;
11068|       |
11069|   153k|        break;
11070|   153k|      }
11071|  9.53k|      case state::QUERY: {
  ------------------
  |  Branch (11071:7): [True: 9.53k, False: 1.08M]
  ------------------
11072|  9.53k|        ada_log("QUERY ", helpers::substring(url_data, input_position));
11073|  9.53k|        if constexpr (store_values) {
11074|       |          // Let queryPercentEncodeSet be the special-query percent-encode set
11075|       |          // if url is special; otherwise the query percent-encode set.
11076|  9.53k|          const uint8_t* query_percent_encode_set =
11077|  9.53k|              url.is_special() ? character_sets::SPECIAL_QUERY_PERCENT_ENCODE
  ------------------
  |  Branch (11077:15): [True: 8.67k, False: 861]
  ------------------
11078|  9.53k|                               : character_sets::QUERY_PERCENT_ENCODE;
11079|       |
11080|       |          // Percent-encode after encoding, with encoding, buffer, and
11081|       |          // queryPercentEncodeSet, and append the result to url's query.
11082|  9.53k|          url.update_base_search(url_data.substr(input_position),
11083|  9.53k|                                 query_percent_encode_set);
11084|  9.53k|          ada_log("QUERY update_base_search completed ");
11085|  9.53k|          if (fragment.has_value()) {
  ------------------
  |  Branch (11085:15): [True: 6.99k, False: 2.54k]
  ------------------
11086|  6.99k|            url.update_unencoded_base_hash(*fragment);
11087|  6.99k|          }
11088|  9.53k|        }
11089|  9.53k|        return url;
11090|   153k|      }
11091|   153k|      case state::HOST: {
  ------------------
  |  Branch (11091:7): [True: 153k, False: 937k]
  ------------------
11092|   153k|        ada_log("HOST ", helpers::substring(url_data, input_position));
11093|       |
11094|   153k|        std::string_view host_view = url_data.substr(input_position);
11095|   153k|        auto [location, found_colon] =
11096|   153k|            helpers::get_host_delimiter_location(url.is_special(), host_view);
11097|   153k|        input_position = (location != std::string_view::npos)
  ------------------
  |  Branch (11097:26): [True: 153k, False: 0]
  ------------------
11098|   153k|                             ? input_position + location
11099|   153k|                             : input_size;
11100|       |        // Otherwise, if c is U+003A (:) and insideBrackets is false, then:
11101|       |        // Note: the 'found_colon' value is true if and only if a colon was
11102|       |        // encountered while not inside brackets.
11103|   153k|        if (found_colon) {
  ------------------
  |  Branch (11103:13): [True: 23.2k, False: 130k]
  ------------------
11104|       |          // If buffer is the empty string, validation error, return failure.
11105|       |          // Let host be the result of host parsing buffer with url is not
11106|       |          // special.
11107|  23.2k|          ada_log("HOST parsing ", host_view);
11108|  23.2k|          if (!url.parse_host(host_view)) {
  ------------------
  |  Branch (11108:15): [True: 130, False: 23.1k]
  ------------------
11109|    130|            return url;
11110|    130|          }
11111|  23.1k|          ada_log("HOST parsing results in ", url.get_hostname());
11112|       |          // Set url's host to host, buffer to the empty string, and state to
11113|       |          // port state.
11114|  23.1k|          state = state::PORT;
11115|  23.1k|          input_position++;
11116|  23.1k|        }
11117|       |        // Otherwise, if one of the following is true:
11118|       |        // - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#)
11119|       |        // - url is special and c is U+005C (\)
11120|       |        // The get_host_delimiter_location function either brings us to
11121|       |        // the colon outside of the bracket, or to one of those characters.
11122|   130k|        else {
11123|       |          // If url is special and host_view is the empty string, validation
11124|       |          // error, return failure.
11125|   130k|          if (host_view.empty() && url.is_special()) {
  ------------------
  |  Branch (11125:15): [True: 125, False: 130k]
  |  Branch (11125:36): [True: 83, False: 42]
  ------------------
11126|     83|            url.is_valid = false;
11127|     83|            return url;
11128|     83|          }
11129|   130k|          ada_log("HOST parsing ", host_view, " href=", url.get_href());
11130|       |          // Let host be the result of host parsing host_view with url is not
11131|       |          // special.
11132|   130k|          if (host_view.empty()) {
  ------------------
  |  Branch (11132:15): [True: 42, False: 130k]
  ------------------
11133|     42|            url.update_base_hostname("");
11134|   130k|          } else if (!url.parse_host(host_view)) {
  ------------------
  |  Branch (11134:22): [True: 2.01k, False: 128k]
  ------------------
11135|  2.01k|            return url;
11136|  2.01k|          }
11137|   128k|          ada_log("HOST parsing results in ", url.get_hostname(),
11138|   128k|                  " href=", url.get_href());
11139|       |
11140|       |          // Set url's host to host, and state to path start state.
11141|   128k|          state = state::PATH_START;
11142|   128k|        }
11143|       |
11144|   151k|        break;
11145|   153k|      }
11146|   151k|      case state::OPAQUE_PATH: {
  ------------------
  |  Branch (11146:7): [True: 495, False: 1.09M]
  ------------------
11147|    495|        ada_log("OPAQUE_PATH ", helpers::substring(url_data, input_position));
11148|       |        // Opaque path, query, and fragment are structurally always valid:
11149|       |        // the parser would just percent-encode whatever is there. When we
11150|       |        // are not storing values (can_parse), we can return immediately.
11151|       |        // We must set has_opaque_path = true before returning so that when
11152|       |        // this URL is used as an internal base inside can_parse, NO_SCHEME
11153|       |        // correctly rejects relative inputs against an opaque-path base
11154|       |        // (e.g. can_parse("", &"W:") must return false).
11155|       |        if constexpr (!store_values) {
11156|       |          url.has_opaque_path = true;
11157|       |          return url;
11158|       |        }
11159|    495|        std::string_view view = url_data.substr(input_position);
11160|       |        // If c is U+003F (?), then set url's query to the empty string and
11161|       |        // state to query state.
11162|    495|        size_t location = view.find('?');
11163|    495|        if (location != std::string_view::npos) {
  ------------------
  |  Branch (11163:13): [True: 321, False: 174]
  ------------------
11164|    321|          view.remove_suffix(view.size() - location);
11165|    321|          state = state::QUERY;
11166|    321|          input_position += location + 1;
11167|    321|        } else {
11168|    174|          input_position = input_size + 1;
11169|    174|        }
11170|    495|        url.has_opaque_path = true;
11171|       |
11172|       |        // This is a really unlikely scenario in real world. We should not seek
11173|       |        // to optimize it.
11174|    495|        if (view.ends_with(' ')) {
  ------------------
  |  Branch (11174:13): [True: 14, False: 481]
  ------------------
11175|     14|          std::string modified_view =
11176|     14|              std::string(view.substr(0, view.size() - 1)) + "%20";
11177|     14|          url.update_base_pathname(unicode::percent_encode(
11178|     14|              modified_view, character_sets::C0_CONTROL_PERCENT_ENCODE));
11179|    481|        } else {
11180|    481|          url.update_base_pathname(unicode::percent_encode(
11181|    481|              view, character_sets::C0_CONTROL_PERCENT_ENCODE));
11182|    481|        }
11183|    495|        break;
11184|   153k|      }
11185|  23.1k|      case state::PORT: {
  ------------------
  |  Branch (11185:7): [True: 23.1k, False: 1.06M]
  ------------------
11186|  23.1k|        ada_log("PORT ", helpers::substring(url_data, input_position));
11187|  23.1k|        std::string_view port_view = url_data.substr(input_position);
11188|  23.1k|        input_position += url.parse_port(port_view, true);
11189|  23.1k|        if (!url.is_valid) {
  ------------------
  |  Branch (11189:13): [True: 143, False: 23.0k]
  ------------------
11190|    143|          return url;
11191|    143|        }
11192|  23.0k|        state = state::PATH_START;
11193|  23.0k|        [[fallthrough]];
11194|  23.0k|      }
11195|   152k|      case state::PATH_START: {
  ------------------
  |  Branch (11195:7): [True: 129k, False: 962k]
  ------------------
11196|   152k|        ada_log("PATH_START ", helpers::substring(url_data, input_position));
11197|       |        // Path, query, and fragment are structurally always valid: the
11198|       |        // parser would just percent-encode whatever is there. When we are
11199|       |        // not storing values (can_parse), we can return immediately since
11200|       |        // no subsequent state can invalidate the URL.
11201|       |        if constexpr (!store_values) {
11202|       |          return url;
11203|       |        }
11204|       |
11205|       |        // If url is special, then:
11206|   152k|        if (url.is_special()) {
  ------------------
  |  Branch (11206:13): [True: 152k, False: 513]
  ------------------
11207|       |          // Set state to path state.
11208|   152k|          state = state::PATH;
11209|       |
11210|       |          // Optimization: Avoiding going into PATH state improves the
11211|       |          // performance of urls ending with /.
11212|   152k|          if (input_position == input_size) {
  ------------------
  |  Branch (11212:15): [True: 2.10k, False: 149k]
  ------------------
11213|  2.10k|            if constexpr (store_values) {
11214|  2.10k|              url.update_base_pathname("/");
11215|  2.10k|              if (fragment.has_value()) {
  ------------------
  |  Branch (11215:19): [True: 287, False: 1.81k]
  ------------------
11216|    287|                url.update_unencoded_base_hash(*fragment);
11217|    287|              }
11218|  2.10k|            }
11219|  2.10k|            return url;
11220|  2.10k|          }
11221|       |          // If c is neither U+002F (/) nor U+005C (\), then decrease pointer
11222|       |          // by 1. We know that (input_position == input_size) is impossible
11223|       |          // here, because of the previous if-check.
11224|   149k|          if ((url_data[input_position] != '/') &&
  ------------------
  |  Branch (11224:15): [True: 942, False: 148k]
  ------------------
11225|    942|              (url_data[input_position] != '\\')) {
  ------------------
  |  Branch (11225:15): [True: 578, False: 364]
  ------------------
11226|    578|            break;
11227|    578|          }
11228|   149k|        }
11229|       |        // Otherwise, if state override is not given and c is U+003F (?),
11230|       |        // set url's query to the empty string and state to query state.
11231|    513|        else if ((input_position != input_size) &&
  ------------------
  |  Branch (11231:18): [True: 396, False: 117]
  ------------------
11232|    396|                 (url_data[input_position] == '?')) {
  ------------------
  |  Branch (11232:18): [True: 72, False: 324]
  ------------------
11233|     72|          state = state::QUERY;
11234|     72|        }
11235|       |        // Otherwise, if c is not the EOF code point:
11236|    441|        else if (input_position != input_size) {
  ------------------
  |  Branch (11236:18): [True: 324, False: 117]
  ------------------
11237|       |          // Set state to path state.
11238|    324|          state = state::PATH;
11239|       |
11240|       |          // If c is not U+002F (/), then decrease pointer by 1.
11241|    324|          if (url_data[input_position] != '/') {
  ------------------
  |  Branch (11241:15): [True: 0, False: 324]
  ------------------
11242|      0|            break;
11243|      0|          }
11244|    324|        }
11245|       |
11246|   149k|        input_position++;
11247|   149k|        break;
11248|   152k|      }
11249|   150k|      case state::PATH: {
  ------------------
  |  Branch (11249:7): [True: 150k, False: 940k]
  ------------------
11250|   150k|        ada_log("PATH ", helpers::substring(url_data, input_position));
11251|       |        // Path, query, and fragment are structurally always valid: the
11252|       |        // parser would just percent-encode whatever is there. When we are
11253|       |        // not storing values (can_parse), we can return immediately since
11254|       |        // no subsequent state can invalidate the URL.
11255|       |        if constexpr (!store_values) {
11256|       |          return url;
11257|       |        }
11258|   150k|        std::string_view view = url_data.substr(input_position);
11259|       |
11260|       |        // Most time, we do not need percent encoding.
11261|       |        // Furthermore, we can immediately locate the '?'.
11262|   150k|        size_t locofquestionmark = view.find('?');
11263|   150k|        if (locofquestionmark != std::string_view::npos) {
  ------------------
  |  Branch (11263:13): [True: 9.14k, False: 141k]
  ------------------
11264|  9.14k|          state = state::QUERY;
11265|  9.14k|          view.remove_suffix(view.size() - locofquestionmark);
11266|  9.14k|          input_position += locofquestionmark + 1;
11267|   141k|        } else {
11268|   141k|          input_position = input_size + 1;
11269|   141k|        }
11270|   150k|        if constexpr (store_values) {
11271|   150k|          if constexpr (result_type_is_ada_url) {
11272|   150k|            helpers::parse_prepared_path(view, url.type, url.path);
11273|       |          } else {
11274|       |            url.consume_prepared_path(view);
11275|       |            ADA_ASSERT_TRUE(url.validate());
11276|       |          }
11277|   150k|        }
11278|   150k|        break;
11279|   152k|      }
11280|  1.11k|      case state::FILE_SLASH: {
  ------------------
  |  Branch (11280:7): [True: 1.11k, False: 1.09M]
  ------------------
11281|  1.11k|        ada_log("FILE_SLASH ", helpers::substring(url_data, input_position));
11282|       |
11283|       |        // If c is U+002F (/) or U+005C (\), then:
11284|  1.11k|        if ((input_position != input_size) &&
  ------------------
  |  Branch (11284:13): [True: 1.11k, False: 1]
  ------------------
11285|  1.11k|            (url_data[input_position] == '/' ||
  ------------------
  |  Branch (11285:14): [True: 1.09k, False: 12]
  ------------------
11286|  1.10k|             url_data[input_position] == '\\')) {
  ------------------
  |  Branch (11286:14): [True: 2, False: 10]
  ------------------
11287|  1.10k|          ada_log("FILE_SLASH c is U+002F or U+005C");
11288|       |          // Set state to file host state.
11289|  1.10k|          state = state::FILE_HOST;
11290|  1.10k|          input_position++;
11291|  1.10k|        } else {
11292|     11|          ada_log("FILE_SLASH otherwise");
11293|       |          // If base is non-null and base's scheme is "file", then:
11294|       |          // Note: it is unsafe to do base_url->scheme unless you know that
11295|       |          // base_url_has_value() is true.
11296|     11|          if (base_url != nullptr && base_url->type == scheme::type::FILE) {
  ------------------
  |  Branch (11296:15): [True: 0, False: 11]
  |  Branch (11296:38): [True: 0, False: 0]
  ------------------
11297|       |            // Set url's host to base's host.
11298|      0|            if constexpr (result_type_is_ada_url) {
11299|      0|              url.host = base_url->host;
11300|       |            } else {
11301|       |              url.update_host_to_base_host(base_url->get_host());
11302|       |            }
11303|       |            // If the code point substring from pointer to the end of input does
11304|       |            // not start with a Windows drive letter and base's path[0] is a
11305|       |            // normalized Windows drive letter, then append base's path[0] to
11306|       |            // url's path.
11307|      0|            if (!base_url->get_pathname().empty()) {
  ------------------
  |  Branch (11307:17): [True: 0, False: 0]
  ------------------
11308|      0|              if (!checkers::is_windows_drive_letter(
  ------------------
  |  Branch (11308:19): [True: 0, False: 0]
  ------------------
11309|      0|                      url_data.substr(input_position))) {
11310|      0|                std::string_view first_base_url_path =
11311|      0|                    base_url->get_pathname().substr(1);
11312|      0|                size_t loc = first_base_url_path.find('/');
11313|      0|                if (loc != std::string_view::npos) {
  ------------------
  |  Branch (11313:21): [True: 0, False: 0]
  ------------------
11314|      0|                  helpers::resize(first_base_url_path, loc);
11315|      0|                }
11316|      0|                if (checkers::is_normalized_windows_drive_letter(
  ------------------
  |  Branch (11316:21): [True: 0, False: 0]
  ------------------
11317|      0|                        first_base_url_path)) {
11318|      0|                  if constexpr (result_type_is_ada_url) {
11319|      0|                    url.path += '/';
11320|      0|                    url.path += first_base_url_path;
11321|       |                  } else {
11322|       |                    url.append_base_pathname(
11323|       |                        helpers::concat("/", first_base_url_path));
11324|       |                  }
11325|      0|                }
11326|      0|              }
11327|      0|            }
11328|      0|          }
11329|       |
11330|       |          // Set state to path state, and decrease pointer by 1.
11331|     11|          state = state::PATH;
11332|     11|        }
11333|       |
11334|  1.11k|        break;
11335|   152k|      }
11336|  1.10k|      case state::FILE_HOST: {
  ------------------
  |  Branch (11336:7): [True: 1.10k, False: 1.09M]
  ------------------
11337|  1.10k|        ada_log("FILE_HOST ", helpers::substring(url_data, input_position));
11338|  1.10k|        std::string_view view = url_data.substr(input_position);
11339|       |
11340|  1.10k|        size_t location = view.find_first_of("/\\?");
11341|  1.10k|        std::string_view file_host_buffer = view.substr(
11342|  1.10k|            0, (location != std::string_view::npos) ? location : view.size());
  ------------------
  |  Branch (11342:16): [True: 1.06k, False: 34]
  ------------------
11343|       |
11344|  1.10k|        if (checkers::is_windows_drive_letter(file_host_buffer)) {
  ------------------
  |  Branch (11344:13): [True: 1, False: 1.10k]
  ------------------
11345|      1|          state = state::PATH;
11346|  1.10k|        } else if (file_host_buffer.empty()) {
  ------------------
  |  Branch (11346:20): [True: 340, False: 760]
  ------------------
11347|       |          // Set url's host to the empty string.
11348|    340|          if constexpr (result_type_is_ada_url) {
11349|    340|            url.host = "";
11350|       |          } else {
11351|       |            url.update_base_hostname("");
11352|       |          }
11353|       |          // Set state to path start state.
11354|    340|          state = state::PATH_START;
11355|    760|        } else {
11356|    760|          size_t consumed_bytes = file_host_buffer.size();
11357|    760|          input_position += consumed_bytes;
11358|       |          // Let host be the result of host parsing buffer with url is not
11359|       |          // special.
11360|    760|          if (!url.parse_host(file_host_buffer)) {
  ------------------
  |  Branch (11360:15): [True: 92, False: 668]
  ------------------
11361|     92|            return url;
11362|     92|          }
11363|       |
11364|    668|          if constexpr (result_type_is_ada_url) {
11365|       |            // If host is "localhost", then set host to the empty string.
11366|    668|            if (url.host.has_value() && url.host.value() == "localhost") {
  ------------------
  |  Branch (11366:17): [True: 668, False: 0]
  |  Branch (11366:41): [True: 2, False: 666]
  ------------------
11367|      2|              url.host = "";
11368|      2|            }
11369|       |          } else {
11370|       |            if (url.get_hostname() == "localhost") {
11371|       |              url.update_base_hostname("");
11372|       |            }
11373|       |          }
11374|       |
11375|       |          // Set buffer to the empty string and state to path start state.
11376|    668|          state = state::PATH_START;
11377|    668|        }
11378|       |
11379|  1.00k|        break;
11380|  1.10k|      }
11381|  1.26k|      case state::FILE: {
  ------------------
  |  Branch (11381:7): [True: 1.26k, False: 1.09M]
  ------------------
11382|  1.26k|        ada_log("FILE ", helpers::substring(url_data, input_position));
11383|  1.26k|        std::string_view file_view = url_data.substr(input_position);
11384|       |
11385|  1.26k|        url.set_protocol_as_file();
11386|  1.26k|        if constexpr (result_type_is_ada_url) {
11387|       |          // Set url's host to the empty string.
11388|  1.26k|          url.host = "";
11389|       |        } else {
11390|       |          url.update_base_hostname("");
11391|       |        }
11392|       |        // If c is U+002F (/) or U+005C (\), then:
11393|  1.26k|        if (input_position != input_size &&
  ------------------
  |  Branch (11393:13): [True: 1.26k, False: 1]
  ------------------
11394|  1.26k|            (url_data[input_position] == '/' ||
  ------------------
  |  Branch (11394:14): [True: 1.11k, False: 151]
  ------------------
11395|  1.11k|             url_data[input_position] == '\\')) {
  ------------------
  |  Branch (11395:14): [True: 2, False: 149]
  ------------------
11396|  1.11k|          ada_log("FILE c is U+002F or U+005C");
11397|       |          // Set state to file slash state.
11398|  1.11k|          state = state::FILE_SLASH;
11399|  1.11k|        }
11400|       |        // Otherwise, if base is non-null and base's scheme is "file":
11401|    150|        else if (base_url != nullptr && base_url->type == scheme::type::FILE) {
  ------------------
  |  Branch (11401:18): [True: 0, False: 150]
  |  Branch (11401:41): [True: 0, False: 0]
  ------------------
11402|       |          // Set url's host to base's host, url's path to a clone of base's
11403|       |          // path, and url's query to base's query.
11404|      0|          ada_log("FILE base non-null");
11405|      0|          if constexpr (result_type_is_ada_url) {
11406|      0|            url.host = base_url->host;
11407|      0|            url.path = base_url->path;
11408|      0|            url.query = base_url->query;
11409|       |          } else {
11410|       |            url.update_host_to_base_host(base_url->get_hostname());
11411|       |            url.update_base_pathname(base_url->get_pathname());
11412|       |            if (base_url->has_search()) {
11413|       |              // get_search() returns "" for an empty query string (URL ends
11414|       |              // with '?'). update_base_search("") would incorrectly clear the
11415|       |              // query, so pass "?" to preserve the empty query distinction.
11416|       |              auto s = base_url->get_search();
11417|       |              url.update_base_search(s.empty() ? std::string_view("?") : s);
11418|       |            }
11419|       |          }
11420|      0|          url.has_opaque_path = base_url->has_opaque_path;
11421|       |
11422|       |          // If c is U+003F (?), then set url's query to the empty string and
11423|       |          // state to query state.
11424|      0|          if (input_position != input_size && url_data[input_position] == '?') {
  ------------------
  |  Branch (11424:15): [True: 0, False: 0]
  |  Branch (11424:47): [True: 0, False: 0]
  ------------------
11425|      0|            state = state::QUERY;
11426|      0|          }
11427|       |          // Otherwise, if c is not the EOF code point:
11428|      0|          else if (input_position != input_size) {
  ------------------
  |  Branch (11428:20): [True: 0, False: 0]
  ------------------
11429|       |            // Set url's query to null.
11430|      0|            url.clear_search();
11431|       |            // If the code point substring from pointer to the end of input does
11432|       |            // not start with a Windows drive letter, then shorten url's path.
11433|      0|            if (!checkers::is_windows_drive_letter(file_view)) {
  ------------------
  |  Branch (11433:17): [True: 0, False: 0]
  ------------------
11434|      0|              if constexpr (result_type_is_ada_url) {
11435|      0|                helpers::shorten_path(url.path, url.type);
11436|       |              } else {
11437|       |                std::string_view path = url.get_pathname();
11438|       |                if (helpers::shorten_path(path, url.type)) {
11439|       |                  url.update_base_pathname(std::move(std::string(path)));
11440|       |                }
11441|       |              }
11442|      0|            }
11443|       |            // Otherwise:
11444|      0|            else {
11445|       |              // Set url's path to an empty list.
11446|      0|              url.clear_pathname();
11447|      0|              url.has_opaque_path = true;
11448|      0|            }
11449|       |
11450|       |            // Set state to path state and decrease pointer by 1.
11451|      0|            state = state::PATH;
11452|      0|            break;
11453|      0|          }
11454|      0|        }
11455|       |        // Otherwise, set state to path state, and decrease pointer by 1.
11456|    150|        else {
11457|    150|          ada_log("FILE go to path");
11458|    150|          state = state::PATH;
11459|    150|          break;
11460|    150|        }
11461|       |
11462|  1.11k|        input_position++;
11463|  1.11k|        break;
11464|  1.26k|      }
11465|      0|      default:
  ------------------
  |  Branch (11465:7): [True: 0, False: 1.09M]
  ------------------
11466|      0|        unreachable();
11467|  1.09M|    }
11468|  1.09M|  }
11469|   333k|  if constexpr (store_values) {
11470|   333k|    if (fragment.has_value()) {
  ------------------
  |  Branch (11470:9): [True: 2.24k, False: 331k]
  ------------------
11471|  2.24k|      url.update_unencoded_base_hash(*fragment);
11472|  2.24k|    }
11473|   333k|  }
11474|       |  // Check the resulting (normalized) URL size against the maximum input length.
11475|       |  // Normalization (percent-encoding, IDNA, etc.) can expand the URL beyond the
11476|       |  // original input size.
11477|   333k|  if constexpr (store_values) {
11478|   333k|    if (url.is_valid) {
  ------------------
  |  Branch (11478:9): [True: 141k, False: 191k]
  ------------------
11479|       |      if constexpr (result_type_is_ada_url_aggregator) {
11480|       |        if (url.buffer.size() > max_input_length) {
11481|       |          url.is_valid = false;
11482|       |        }
11483|   141k|      } else {
11484|   141k|        if (url.get_href_size() > max_input_length) {
  ------------------
  |  Branch (11484:13): [True: 0, False: 141k]
  ------------------
11485|      0|          url.is_valid = false;
11486|      0|        }
11487|   141k|      }
11488|   141k|    }
11489|   333k|  }
11490|   333k|  return url;
11491|   347k|}
_ZN3ada6parser14parse_url_implINS_14url_aggregatorELb1EEET_NSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPKS3_:
10503|   347k|                           const result_type* base_url) {
10504|       |  // We can specialize the implementation per type.
10505|       |  // Important: result_type_is_ada_url is evaluated at *compile time*. This
10506|       |  // means that doing if constexpr(result_type_is_ada_url) { something } else {
10507|       |  // something else } is free (at runtime). This means that ada::url_aggregator
10508|       |  // and ada::url **do not have to support the exact same API**.
10509|   347k|  constexpr bool result_type_is_ada_url = std::is_same_v<url, result_type>;
10510|   347k|  constexpr bool result_type_is_ada_url_aggregator =
10511|   347k|      std::is_same_v<url_aggregator, result_type>;
10512|   347k|  static_assert(result_type_is_ada_url ||
10513|   347k|                result_type_is_ada_url_aggregator);  // We don't support
10514|       |                                                     // anything else for now.
10515|       |
10516|   347k|  ada_log("ada::parser::parse_url('", user_input, "' [", user_input.size(),
10517|   347k|          " bytes],", (base_url != nullptr ? base_url->to_string() : "null"),
10518|   347k|          ")");
10519|       |
10520|   347k|  state state = state::SCHEME_START;
10521|   347k|  result_type url{};
10522|       |
10523|   347k|  const uint32_t max_input_length = ada::get_max_input_length();
10524|       |
10525|       |  // We refuse to parse URL strings that exceed the maximum input length.
10526|       |  // By default, this is 4GB but can be configured via
10527|       |  // ada::set_max_input_length().
10528|   347k|  if (user_input.size() > max_input_length) [[unlikely]] {
  ------------------
  |  Branch (10528:7): [True: 0, False: 347k]
  ------------------
10529|      0|    url.is_valid = false;
10530|      0|  }
10531|       |  // Going forward, user_input.size() is in [0,
10532|       |  // std::numeric_limits<uint32_t>::max). If we are provided with an invalid
10533|       |  // base, or the optional_url was invalid, we must return.
10534|   347k|  if (base_url != nullptr) {
  ------------------
  |  Branch (10534:7): [True: 0, False: 347k]
  ------------------
10535|      0|    url.is_valid &= base_url->is_valid;
10536|      0|  }
10537|   347k|  if (!url.is_valid) {
  ------------------
  |  Branch (10537:7): [True: 0, False: 347k]
  ------------------
10538|      0|    return url;
10539|      0|  }
10540|       |
10541|       |  // Simple absolute http(s) fast path (before tabs/newline scan).
10542|       |  // Skip digit-led hosts (IPv4) with a cheap peek.
10543|   347k|  if constexpr (store_values) {
10544|   347k|    if (base_url == nullptr) {
  ------------------
  |  Branch (10544:9): [True: 347k, False: 0]
  ------------------
10545|   347k|      const auto* p = reinterpret_cast<const uint8_t*>(user_input.data());
10546|   347k|      const size_t n = user_input.size();
10547|   347k|      const bool digit_led_host = (n >= 8 && p[4] == ':' && p[5] == '/' &&
  ------------------
  |  Branch (10547:36): [True: 347k, False: 34]
  |  Branch (10547:46): [True: 95.3k, False: 252k]
  |  Branch (10547:61): [True: 94.6k, False: 765]
  ------------------
10548|  94.6k|                                   p[6] == '/' && p[7] >= '0' && p[7] <= '9') ||
  ------------------
  |  Branch (10548:36): [True: 94.4k, False: 134]
  |  Branch (10548:51): [True: 92.7k, False: 1.69k]
  |  Branch (10548:66): [True: 43.7k, False: 49.0k]
  ------------------
10549|   304k|                                  (n >= 9 && p[5] == ':' && p[6] == '/' &&
  ------------------
  |  Branch (10549:36): [True: 304k, False: 99]
  |  Branch (10549:46): [True: 251k, False: 52.6k]
  |  Branch (10549:61): [True: 250k, False: 757]
  ------------------
10550|   250k|                                   p[7] == '/' && p[8] >= '0' && p[8] <= '9');
  ------------------
  |  Branch (10550:36): [True: 250k, False: 87]
  |  Branch (10550:51): [True: 250k, False: 511]
  |  Branch (10550:66): [True: 1.92k, False: 248k]
  ------------------
10551|   347k|      if (!digit_led_host && try_parse_simple_absolute(user_input, url)) {
  ------------------
  |  Branch (10551:11): [True: 302k, False: 45.6k]
  |  Branch (10551:30): [True: 191k, False: 110k]
  ------------------
10552|   191k|        if constexpr (result_type_is_ada_url_aggregator) {
10553|   191k|          if (url.buffer.size() > max_input_length) [[unlikely]] {
  ------------------
  |  Branch (10553:15): [True: 0, False: 191k]
  ------------------
10554|      0|            url.is_valid = false;
10555|      0|          }
10556|       |        } else {
10557|       |          if (url.get_href_size() > max_input_length) [[unlikely]] {
10558|       |            url.is_valid = false;
10559|       |          }
10560|       |        }
10561|   191k|        return url;
10562|   191k|      }
10563|   347k|    }
10564|   347k|  }
10565|       |
10566|   156k|  std::string tmp_buffer;
10567|   347k|  std::string_view url_data;
10568|   347k|  if (unicode::has_tabs_or_newline(user_input)) [[unlikely]] {
  ------------------
  |  Branch (10568:7): [True: 389, False: 347k]
  ------------------
10569|    389|    tmp_buffer = user_input;
10570|       |    // Optimization opportunity: Instead of copying and then pruning, we could
10571|       |    // just directly build the string from user_input.
10572|    389|    helpers::remove_ascii_tab_or_newline(tmp_buffer);
10573|    389|    url_data = tmp_buffer;
10574|   347k|  } else [[likely]] {
10575|   347k|    url_data = user_input;
10576|   347k|  }
10577|       |
10578|       |  // Leading and trailing control characters are uncommon and easy to deal with
10579|       |  // (no performance concern).
10580|   347k|  helpers::trim_c0_whitespace(url_data);
10581|       |
10582|   347k|  if constexpr (result_type_is_ada_url_aggregator && store_values) {
10583|       |    // Most of the time, we just need user_input.size().
10584|       |    // In some instances, we may need a bit more.
10585|       |    ///////////////////////////
10586|       |    // This is *very* important. This line should *not* be removed
10587|       |    // hastily. There are principled reasons why reserve is important
10588|       |    // for performance. If you have a benchmark with small inputs,
10589|       |    // it may not matter, but in other instances, it could.
10590|       |    ////
10591|       |    // This rounds up to the next power of two.
10592|       |    // We know that user_input.size() is in [0,
10593|       |    // std::numeric_limits<uint32_t>::max).
10594|   347k|    uint32_t reserve_capacity =
10595|   347k|        (0xFFFFFFFF >>
10596|   347k|         helpers::leading_zeroes(uint32_t(1 | user_input.size()))) +
10597|   347k|        1;
10598|   347k|    url.reserve(reserve_capacity);
10599|   347k|  }
10600|       |
10601|       |  // Optimization opportunity. Most websites do not have fragment.
10602|   347k|  std::optional<std::string_view> fragment = helpers::prune_hash(url_data);
10603|       |  // We add it last so that an implementation like ada::url_aggregator
10604|       |  // can append it last to its internal buffer, thus improving performance.
10605|       |
10606|       |  // Here url_data no longer has its fragment.
10607|       |  // We are going to access the data from url_data (it is immutable).
10608|       |  // At any given time, we are pointing at byte 'input_position' in url_data.
10609|       |  // The input_position variable should range from 0 to input_size.
10610|       |  // It is illegal to access url_data at input_size.
10611|   347k|  size_t input_position = 0;
10612|   347k|  const size_t input_size = url_data.size();
10613|       |  // Keep running the following state machine by switching on state.
10614|       |  // If after a run pointer points to the EOF code point, go to the next step.
10615|       |  // Otherwise, increase pointer by 1 and continue with the state machine.
10616|       |  // We never decrement input_position.
10617|  1.42M|  while (input_position <= input_size) {
  ------------------
  |  Branch (10617:10): [True: 1.09M, False: 333k]
  ------------------
10618|  1.09M|    ada_log("In parsing at ", input_position, " out of ", input_size,
10619|  1.09M|            " in state ", ada::to_string(state));
10620|  1.09M|    switch (state) {
10621|   156k|      case state::SCHEME_START: {
  ------------------
  |  Branch (10621:7): [True: 156k, False: 935k]
  ------------------
10622|   156k|        ada_log("SCHEME_START ", helpers::substring(url_data, input_position));
10623|       |        // If c is an ASCII alpha, append c, lowercased, to buffer, and set
10624|       |        // state to scheme state.
10625|   156k|        if ((input_position != input_size) &&
  ------------------
  |  Branch (10625:13): [True: 156k, False: 1]
  ------------------
10626|   156k|            checkers::is_alpha(url_data[input_position])) {
  ------------------
  |  Branch (10626:13): [True: 156k, False: 29]
  ------------------
10627|   156k|          state = state::SCHEME;
10628|   156k|          input_position++;
10629|   156k|        } else {
10630|       |          // Otherwise, if state override is not given, set state to no scheme
10631|       |          // state and decrease pointer by 1.
10632|     30|          state = state::NO_SCHEME;
10633|     30|        }
10634|   156k|        break;
10635|      0|      }
10636|   156k|      case state::SCHEME: {
  ------------------
  |  Branch (10636:7): [True: 156k, False: 935k]
  ------------------
10637|   156k|        ada_log("SCHEME ", helpers::substring(url_data, input_position));
10638|       |        // If c is an ASCII alphanumeric, U+002B (+), U+002D (-), or U+002E (.),
10639|       |        // append c, lowercased, to buffer.
10640|   725k|        while ((input_position != input_size) &&
  ------------------
  |  Branch (10640:16): [True: 725k, False: 1]
  ------------------
10641|   725k|               (unicode::is_alnum_plus(url_data[input_position]))) {
  ------------------
  |  Branch (10641:16): [True: 569k, False: 156k]
  ------------------
10642|   569k|          input_position++;
10643|   569k|        }
10644|       |        // Otherwise, if c is U+003A (:), then:
10645|   156k|        if ((input_position != input_size) &&
  ------------------
  |  Branch (10645:13): [True: 156k, False: 1]
  ------------------
10646|   156k|            (url_data[input_position] == ':')) {
  ------------------
  |  Branch (10646:13): [True: 156k, False: 35]
  ------------------
10647|   156k|          ada_log("SCHEME the scheme should be ",
10648|   156k|                  url_data.substr(0, input_position));
10649|       |          if constexpr (result_type_is_ada_url) {
10650|       |            if (!url.parse_scheme(url_data.substr(0, input_position))) {
10651|       |              return url;
10652|       |            }
10653|   156k|          } else {
10654|       |            // we pass the colon along instead of painfully adding it back.
10655|   156k|            if (!url.parse_scheme_with_colon(
  ------------------
  |  Branch (10655:17): [True: 0, False: 156k]
  ------------------
10656|   156k|                    url_data.substr(0, input_position + 1))) {
10657|      0|              return url;
10658|      0|            }
10659|   156k|          }
10660|   156k|          ada_log("SCHEME the scheme is ", url.get_protocol());
10661|       |
10662|       |          // If url's scheme is "file", then:
10663|       |          // NOLINTNEXTLINE(bugprone-branch-clone)
10664|   156k|          if (url.type == scheme::type::FILE) {
  ------------------
  |  Branch (10664:15): [True: 1.26k, False: 154k]
  ------------------
10665|       |            // Set state to file state.
10666|  1.26k|            state = state::FILE;
10667|  1.26k|          }
10668|       |          // Otherwise, if url is special, base is non-null, and base's scheme
10669|       |          // is url's scheme: Note: Doing base_url->scheme is unsafe if base_url
10670|       |          // != nullptr is false.
10671|   154k|          else if (url.is_special() && base_url != nullptr &&
  ------------------
  |  Branch (10671:20): [True: 153k, False: 1.37k]
  |  Branch (10671:40): [True: 0, False: 153k]
  ------------------
10672|      0|                   base_url->type == url.type) {
  ------------------
  |  Branch (10672:20): [True: 0, False: 0]
  ------------------
10673|       |            // Set state to special relative or authority state.
10674|      0|            state = state::SPECIAL_RELATIVE_OR_AUTHORITY;
10675|      0|          }
10676|       |          // Otherwise, if url is special, set state to special authority
10677|       |          // slashes state.
10678|   154k|          else if (url.is_special()) {
  ------------------
  |  Branch (10678:20): [True: 153k, False: 1.37k]
  ------------------
10679|   153k|            state = state::SPECIAL_AUTHORITY_SLASHES;
10680|   153k|          }
10681|       |          // Otherwise, if remaining starts with an U+002F (/), set state to
10682|       |          // path or authority state and increase pointer by 1.
10683|  1.37k|          else if (input_position + 1 < input_size &&
  ------------------
  |  Branch (10683:20): [True: 1.31k, False: 60]
  ------------------
10684|  1.31k|                   url_data[input_position + 1] == '/') {
  ------------------
  |  Branch (10684:20): [True: 883, False: 435]
  ------------------
10685|    883|            state = state::PATH_OR_AUTHORITY;
10686|    883|            input_position++;
10687|    883|          }
10688|       |          // Otherwise, set url's path to the empty string and set state to
10689|       |          // opaque path state.
10690|    495|          else {
10691|    495|            state = state::OPAQUE_PATH;
10692|    495|          }
10693|   156k|        }
10694|       |        // Otherwise, if state override is not given, set buffer to the empty
10695|       |        // string, state to no scheme state, and start over (from the first code
10696|       |        // point in input).
10697|     36|        else {
10698|     36|          state = state::NO_SCHEME;
10699|     36|          input_position = 0;
10700|     36|          break;
10701|     36|        }
10702|   156k|        input_position++;
10703|   156k|        break;
10704|   156k|      }
10705|     66|      case state::NO_SCHEME: {
  ------------------
  |  Branch (10705:7): [True: 66, False: 1.09M]
  ------------------
10706|     66|        ada_log("NO_SCHEME ", helpers::substring(url_data, input_position));
10707|       |        // The fragment was pruned from url_data before the state machine ran,
10708|       |        // so 'c is U+0023 (#)' holds exactly when a fragment was found and
10709|       |        // nothing else remains in front of it.
10710|     66|        const bool c_is_hash =
10711|     66|            fragment.has_value() && input_position == input_size;
  ------------------
  |  Branch (10711:13): [True: 43, False: 23]
  |  Branch (10711:37): [True: 1, False: 42]
  ------------------
10712|       |        // If base is null, or base has an opaque path and c is not U+0023 (#),
10713|       |        // validation error, return failure.
10714|     66|        if (base_url == nullptr || (base_url->has_opaque_path && !c_is_hash)) {
  ------------------
  |  Branch (10714:13): [True: 66, False: 0]
  |  Branch (10714:37): [True: 0, False: 0]
  |  Branch (10714:66): [True: 0, False: 0]
  ------------------
10715|     66|          ada_log("NO_SCHEME validation error");
10716|     66|          url.is_valid = false;
10717|     66|          return url;
10718|     66|        }
10719|       |        // Otherwise, if base has an opaque path and c is U+0023 (#),
10720|       |        // set url's scheme to base's scheme, url's path to base's path, url's
10721|       |        // query to base's query, and set state to fragment state.
10722|      0|        else if (base_url->has_opaque_path && c_is_hash) {
  ------------------
  |  Branch (10722:18): [True: 0, False: 0]
  |  Branch (10722:47): [True: 0, False: 0]
  ------------------
10723|      0|          ada_log("NO_SCHEME opaque base with fragment");
10724|      0|          url.copy_scheme(*base_url);
10725|      0|          url.has_opaque_path = base_url->has_opaque_path;
10726|       |
10727|       |          if constexpr (result_type_is_ada_url) {
10728|       |            url.path = base_url->path;
10729|       |            url.query = base_url->query;
10730|      0|          } else {
10731|      0|            url.update_base_pathname(base_url->get_pathname());
10732|      0|            if (base_url->has_search()) {
  ------------------
  |  Branch (10732:17): [True: 0, False: 0]
  ------------------
10733|       |              // get_search() returns "" for an empty query string (URL ends
10734|       |              // with '?'). update_base_search("") would incorrectly clear the
10735|       |              // query, so pass "?" to preserve the empty query distinction.
10736|      0|              auto s = base_url->get_search();
10737|      0|              url.update_base_search(s.empty() ? std::string_view("?") : s);
  ------------------
  |  Branch (10737:38): [True: 0, False: 0]
  ------------------
10738|      0|            }
10739|      0|          }
10740|      0|          url.update_unencoded_base_hash(*fragment);
10741|      0|          return url;
10742|      0|        }
10743|       |        // Otherwise, if base's scheme is not "file", set state to relative
10744|       |        // state and decrease pointer by 1.
10745|       |        // NOLINTNEXTLINE(bugprone-branch-clone)
10746|      0|        else if (base_url->type != scheme::type::FILE) {
  ------------------
  |  Branch (10746:18): [True: 0, False: 0]
  ------------------
10747|      0|          ada_log("NO_SCHEME non-file relative path");
10748|      0|          state = state::RELATIVE_SCHEME;
10749|      0|        }
10750|       |        // Otherwise, set state to file state and decrease pointer by 1.
10751|      0|        else {
10752|      0|          ada_log("NO_SCHEME file base type");
10753|      0|          state = state::FILE;
10754|      0|        }
10755|      0|        break;
10756|     66|      }
10757|   154k|      case state::AUTHORITY: {
  ------------------
  |  Branch (10757:7): [True: 154k, False: 937k]
  ------------------
10758|   154k|        ada_log("AUTHORITY ", helpers::substring(url_data, input_position));
10759|       |        // most URLs have no @. Having no @ tells us that we don't have to worry
10760|       |        // about AUTHORITY. Of course, we could have @ and still not have to
10761|       |        // worry about AUTHORITY.
10762|       |        // TODO: Instead of just collecting a bool, collect the location of the
10763|       |        // '@' and do something useful with it.
10764|       |        // TODO: We could do various processing early on, using a single pass
10765|       |        // over the string to collect information about it, e.g., telling us
10766|       |        // whether there is a @ and if so, where (or how many).
10767|       |
10768|       |        // Check if url data contains an @.
10769|   154k|        if (url_data.find('@', input_position) == std::string_view::npos) {
  ------------------
  |  Branch (10769:13): [True: 131k, False: 22.7k]
  ------------------
10770|   131k|          state = state::HOST;
10771|   131k|          break;
10772|   131k|        }
10773|  22.7k|        bool at_sign_seen{false};
10774|  22.7k|        bool password_token_seen{false};
10775|       |        /**
10776|       |         * We expect something of the sort...
10777|       |         * https://user:pass@example.com:1234/foo/bar?baz#quux
10778|       |         * --------^
10779|       |         */
10780|  57.3k|        do {
10781|  57.3k|          std::string_view view = url_data.substr(input_position);
10782|       |          // The delimiters are @, /, ? \\.
10783|  57.3k|          size_t location =
10784|  57.3k|              url.is_special() ? helpers::find_authority_delimiter_special(view)
  ------------------
  |  Branch (10784:15): [True: 57.1k, False: 256]
  ------------------
10785|  57.3k|                               : helpers::find_authority_delimiter(view);
10786|  57.3k|          std::string_view authority_view = view.substr(0, location);
10787|  57.3k|          size_t end_of_authority = input_position + authority_view.size();
10788|       |          // If c is U+0040 (@), then:
10789|  57.3k|          if ((end_of_authority != input_size) &&
  ------------------
  |  Branch (10789:15): [True: 56.9k, False: 415]
  ------------------
10790|  56.9k|              (url_data[end_of_authority] == '@')) {
  ------------------
  |  Branch (10790:15): [True: 34.6k, False: 22.3k]
  ------------------
10791|       |            // If atSignSeen is true, then prepend "%40" to buffer.
10792|  34.6k|            if (at_sign_seen) {
  ------------------
  |  Branch (10792:17): [True: 12.1k, False: 22.4k]
  ------------------
10793|  12.1k|              if (password_token_seen) {
  ------------------
  |  Branch (10793:19): [True: 3.40k, False: 8.73k]
  ------------------
10794|       |                if constexpr (result_type_is_ada_url) {
10795|       |                  url.password += "%40";
10796|  3.40k|                } else {
10797|  3.40k|                  url.append_base_password("%40");
10798|  3.40k|                }
10799|  8.73k|              } else {
10800|       |                if constexpr (result_type_is_ada_url) {
10801|       |                  url.username += "%40";
10802|  8.73k|                } else {
10803|  8.73k|                  url.append_base_username("%40");
10804|  8.73k|                }
10805|  8.73k|              }
10806|  12.1k|            }
10807|       |
10808|  34.6k|            at_sign_seen = true;
10809|       |
10810|  34.6k|            if (!password_token_seen) {
  ------------------
  |  Branch (10810:17): [True: 31.2k, False: 3.40k]
  ------------------
10811|  31.2k|              size_t password_token_location = authority_view.find(':');
10812|  31.2k|              password_token_seen =
10813|  31.2k|                  password_token_location != std::string_view::npos;
10814|       |
10815|  31.2k|              if constexpr (store_values) {
10816|  31.2k|                if (!password_token_seen) {
  ------------------
  |  Branch (10816:21): [True: 9.78k, False: 21.4k]
  ------------------
10817|       |                  if constexpr (result_type_is_ada_url) {
10818|       |                    url.username += unicode::percent_encode(
10819|       |                        authority_view,
10820|       |                        character_sets::USERINFO_PERCENT_ENCODE);
10821|  9.78k|                  } else {
10822|  9.78k|                    url.append_base_username(unicode::percent_encode(
10823|  9.78k|                        authority_view,
10824|  9.78k|                        character_sets::USERINFO_PERCENT_ENCODE));
10825|  9.78k|                  }
10826|  21.4k|                } else {
10827|       |                  if constexpr (result_type_is_ada_url) {
10828|       |                    url.username += unicode::percent_encode(
10829|       |                        authority_view.substr(0, password_token_location),
10830|       |                        character_sets::USERINFO_PERCENT_ENCODE);
10831|       |                    url.password += unicode::percent_encode(
10832|       |                        authority_view.substr(password_token_location + 1),
10833|       |                        character_sets::USERINFO_PERCENT_ENCODE);
10834|  21.4k|                  } else {
10835|  21.4k|                    url.append_base_username(unicode::percent_encode(
10836|  21.4k|                        authority_view.substr(0, password_token_location),
10837|  21.4k|                        character_sets::USERINFO_PERCENT_ENCODE));
10838|  21.4k|                    url.append_base_password(unicode::percent_encode(
10839|  21.4k|                        authority_view.substr(password_token_location + 1),
10840|  21.4k|                        character_sets::USERINFO_PERCENT_ENCODE));
10841|  21.4k|                  }
10842|  21.4k|                }
10843|  31.2k|              }
10844|  31.2k|            } else if constexpr (store_values) {
10845|       |              if constexpr (result_type_is_ada_url) {
10846|       |                url.password += unicode::percent_encode(
10847|       |                    authority_view, character_sets::USERINFO_PERCENT_ENCODE);
10848|  3.40k|              } else {
10849|  3.40k|                url.append_base_password(unicode::percent_encode(
10850|  3.40k|                    authority_view, character_sets::USERINFO_PERCENT_ENCODE));
10851|  3.40k|              }
10852|  3.40k|            }
10853|  34.6k|          }
10854|       |          // Otherwise, if one of the following is true:
10855|       |          // - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#)
10856|       |          // - url is special and c is U+005C (\)
10857|  22.7k|          else if (end_of_authority == input_size ||
  ------------------
  |  Branch (10857:20): [True: 415, False: 22.3k]
  ------------------
10858|  22.3k|                   url_data[end_of_authority] == '/' ||
  ------------------
  |  Branch (10858:20): [True: 22.1k, False: 150]
  ------------------
10859|    150|                   url_data[end_of_authority] == '?' ||
  ------------------
  |  Branch (10859:20): [True: 110, False: 40]
  ------------------
10860|  22.7k|                   (url.is_special() && url_data[end_of_authority] == '\\')) {
  ------------------
  |  Branch (10860:21): [True: 40, False: 0]
  |  Branch (10860:41): [True: 40, False: 0]
  ------------------
10861|       |            // If atSignSeen is true and authority_view is the empty string,
10862|       |            // validation error, return failure.
10863|  22.7k|            if (at_sign_seen && authority_view.empty()) {
  ------------------
  |  Branch (10863:17): [True: 22.4k, False: 264]
  |  Branch (10863:33): [True: 172, False: 22.3k]
  ------------------
10864|    172|              url.is_valid = false;
10865|    172|              return url;
10866|    172|            }
10867|  22.5k|            state = state::HOST;
10868|  22.5k|            break;
10869|  22.7k|          }
10870|  34.6k|          if (end_of_authority == input_size) {
  ------------------
  |  Branch (10870:15): [True: 0, False: 34.6k]
  ------------------
10871|      0|            if constexpr (store_values) {
10872|      0|              if (fragment.has_value()) {
  ------------------
  |  Branch (10872:19): [True: 0, False: 0]
  ------------------
10873|      0|                url.update_unencoded_base_hash(*fragment);
10874|      0|              }
10875|      0|            }
10876|      0|            return url;
10877|      0|          }
10878|  34.6k|          input_position = end_of_authority + 1;
10879|  34.6k|        } while (true);
  ------------------
  |  Branch (10879:18): [True: 34.6k, Folded]
  ------------------
10880|       |
10881|  22.5k|        break;
10882|  22.7k|      }
10883|  22.5k|      case state::SPECIAL_RELATIVE_OR_AUTHORITY: {
  ------------------
  |  Branch (10883:7): [True: 0, False: 1.09M]
  ------------------
10884|      0|        ada_log("SPECIAL_RELATIVE_OR_AUTHORITY ",
10885|      0|                helpers::substring(url_data, input_position));
10886|       |
10887|       |        // If c is U+002F (/) and remaining starts with U+002F (/),
10888|       |        // then set state to special authority ignore slashes state and increase
10889|       |        // pointer by 1.
10890|      0|        if (url_data.substr(input_position, 2) == "//") {
  ------------------
  |  Branch (10890:13): [True: 0, False: 0]
  ------------------
10891|      0|          state = state::SPECIAL_AUTHORITY_IGNORE_SLASHES;
10892|      0|          input_position += 2;
10893|      0|        } else {
10894|       |          // Otherwise, validation error, set state to relative state and
10895|       |          // decrease pointer by 1.
10896|      0|          state = state::RELATIVE_SCHEME;
10897|      0|        }
10898|       |
10899|      0|        break;
10900|  22.7k|      }
10901|    883|      case state::PATH_OR_AUTHORITY: {
  ------------------
  |  Branch (10901:7): [True: 883, False: 1.09M]
  ------------------
10902|    883|        ada_log("PATH_OR_AUTHORITY ",
10903|    883|                helpers::substring(url_data, input_position));
10904|       |
10905|       |        // If c is U+002F (/), then set state to authority state.
10906|    883|        if ((input_position != input_size) &&
  ------------------
  |  Branch (10906:13): [True: 869, False: 14]
  ------------------
10907|    869|            (url_data[input_position] == '/')) {
  ------------------
  |  Branch (10907:13): [True: 583, False: 286]
  ------------------
10908|    583|          state = state::AUTHORITY;
10909|    583|          input_position++;
10910|    583|        } else {
10911|       |          // Otherwise, set state to path state, and decrease pointer by 1.
10912|    300|          state = state::PATH;
10913|    300|        }
10914|       |
10915|    883|        break;
10916|  22.7k|      }
10917|      0|      case state::RELATIVE_SCHEME: {
  ------------------
  |  Branch (10917:7): [True: 0, False: 1.09M]
  ------------------
10918|      0|        ada_log("RELATIVE_SCHEME ",
10919|      0|                helpers::substring(url_data, input_position));
10920|       |
10921|       |        // Set url's scheme to base's scheme.
10922|      0|        url.copy_scheme(*base_url);
10923|       |
10924|       |        // If c is U+002F (/), then set state to relative slash state.
10925|      0|        if ((input_position != input_size) &&
  ------------------
  |  Branch (10925:13): [True: 0, False: 0]
  ------------------
10926|       |            // NOLINTNEXTLINE(bugprone-branch-clone)
10927|      0|            (url_data[input_position] == '/')) {
  ------------------
  |  Branch (10927:13): [True: 0, False: 0]
  ------------------
10928|      0|          ada_log(
10929|      0|              "RELATIVE_SCHEME if c is U+002F (/), then set state to relative "
10930|      0|              "slash state");
10931|      0|          state = state::RELATIVE_SLASH;
10932|      0|        } else if (url.is_special() && (input_position != input_size) &&
  ------------------
  |  Branch (10932:20): [True: 0, False: 0]
  |  Branch (10932:40): [True: 0, False: 0]
  ------------------
10933|      0|                   (url_data[input_position] == '\\')) {
  ------------------
  |  Branch (10933:20): [True: 0, False: 0]
  ------------------
10934|       |          // Otherwise, if url is special and c is U+005C (\), validation error,
10935|       |          // set state to relative slash state.
10936|      0|          ada_log(
10937|      0|              "RELATIVE_SCHEME  if url is special and c is U+005C, validation "
10938|      0|              "error, set state to relative slash state");
10939|      0|          state = state::RELATIVE_SLASH;
10940|      0|        } else {
10941|      0|          ada_log("RELATIVE_SCHEME otherwise");
10942|       |          // Set url's username to base's username, url's password to base's
10943|       |          // password, url's host to base's host, url's port to base's port,
10944|       |          // url's path to a clone of base's path, and url's query to base's
10945|       |          // query.
10946|       |          if constexpr (result_type_is_ada_url) {
10947|       |            url.username = base_url->username;
10948|       |            url.password = base_url->password;
10949|       |            url.host = base_url->host;
10950|       |            url.port = base_url->port;
10951|       |            // cloning the base path includes cloning the has_opaque_path flag
10952|       |            url.has_opaque_path = base_url->has_opaque_path;
10953|       |            url.path = base_url->path;
10954|       |            url.query = base_url->query;
10955|      0|          } else {
10956|      0|            url.update_base_authority(base_url->get_href(),
10957|      0|                                      base_url->get_components());
10958|      0|            url.update_host_to_base_host(base_url->get_hostname());
10959|      0|            url.update_base_port(base_url->retrieve_base_port());
10960|       |            // cloning the base path includes cloning the has_opaque_path flag
10961|      0|            url.has_opaque_path = base_url->has_opaque_path;
10962|      0|            url.update_base_pathname(base_url->get_pathname());
10963|      0|            if (base_url->has_search()) {
  ------------------
  |  Branch (10963:17): [True: 0, False: 0]
  ------------------
10964|       |              // get_search() returns "" for an empty query string (URL ends
10965|       |              // with '?'). update_base_search("") would incorrectly clear the
10966|       |              // query, so pass "?" to preserve the empty query distinction.
10967|      0|              auto s = base_url->get_search();
10968|      0|              url.update_base_search(s.empty() ? std::string_view("?") : s);
  ------------------
  |  Branch (10968:38): [True: 0, False: 0]
  ------------------
10969|      0|            }
10970|      0|          }
10971|       |
10972|      0|          url.has_opaque_path = base_url->has_opaque_path;
10973|       |
10974|       |          // If c is U+003F (?), then set url's query to the empty string, and
10975|       |          // state to query state.
10976|      0|          if ((input_position != input_size) &&
  ------------------
  |  Branch (10976:15): [True: 0, False: 0]
  ------------------
10977|      0|              (url_data[input_position] == '?')) {
  ------------------
  |  Branch (10977:15): [True: 0, False: 0]
  ------------------
10978|      0|            state = state::QUERY;
10979|      0|          }
10980|       |          // Otherwise, if c is not the EOF code point:
10981|      0|          else if (input_position != input_size) {
  ------------------
  |  Branch (10981:20): [True: 0, False: 0]
  ------------------
10982|       |            // Set url's query to null.
10983|      0|            url.clear_search();
10984|       |            if constexpr (result_type_is_ada_url) {
10985|       |              // Shorten url's path.
10986|       |              helpers::shorten_path(url.path, url.type);
10987|      0|            } else {
10988|      0|              std::string_view path = url.get_pathname();
10989|      0|              if (helpers::shorten_path(path, url.type)) {
  ------------------
  |  Branch (10989:19): [True: 0, False: 0]
  ------------------
10990|      0|                url.update_base_pathname(std::move(std::string(path)));
10991|      0|              }
10992|      0|            }
10993|       |            // Set state to path state and decrease pointer by 1.
10994|      0|            state = state::PATH;
10995|      0|            break;
10996|      0|          }
10997|      0|        }
10998|      0|        input_position++;
10999|      0|        break;
11000|      0|      }
11001|      0|      case state::RELATIVE_SLASH: {
  ------------------
  |  Branch (11001:7): [True: 0, False: 1.09M]
  ------------------
11002|      0|        ada_log("RELATIVE_SLASH ",
11003|      0|                helpers::substring(url_data, input_position));
11004|       |
11005|       |        // If url is special and c is U+002F (/) or U+005C (\), then:
11006|       |        // NOLINTNEXTLINE(bugprone-branch-clone)
11007|      0|        if (url.is_special() && (input_position != input_size) &&
  ------------------
  |  Branch (11007:13): [True: 0, False: 0]
  |  Branch (11007:33): [True: 0, False: 0]
  ------------------
11008|      0|            (url_data[input_position] == '/' ||
  ------------------
  |  Branch (11008:14): [True: 0, False: 0]
  ------------------
11009|      0|             url_data[input_position] == '\\')) {
  ------------------
  |  Branch (11009:14): [True: 0, False: 0]
  ------------------
11010|       |          // Set state to special authority ignore slashes state.
11011|      0|          state = state::SPECIAL_AUTHORITY_IGNORE_SLASHES;
11012|      0|        }
11013|       |        // Otherwise, if c is U+002F (/), then set state to authority state.
11014|      0|        else if ((input_position != input_size) &&
  ------------------
  |  Branch (11014:18): [True: 0, False: 0]
  ------------------
11015|      0|                 (url_data[input_position] == '/')) {
  ------------------
  |  Branch (11015:18): [True: 0, False: 0]
  ------------------
11016|      0|          state = state::AUTHORITY;
11017|      0|        }
11018|       |        // Otherwise, set
11019|       |        // - url's username to base's username,
11020|       |        // - url's password to base's password,
11021|       |        // - url's host to base's host,
11022|       |        // - url's port to base's port,
11023|       |        // - state to path state, and then, decrease pointer by 1.
11024|      0|        else {
11025|       |          if constexpr (result_type_is_ada_url) {
11026|       |            url.username = base_url->username;
11027|       |            url.password = base_url->password;
11028|       |            url.host = base_url->host;
11029|       |            url.port = base_url->port;
11030|      0|          } else {
11031|      0|            url.update_base_authority(base_url->get_href(),
11032|      0|                                      base_url->get_components());
11033|      0|            url.update_host_to_base_host(base_url->get_hostname());
11034|      0|            url.update_base_port(base_url->retrieve_base_port());
11035|      0|          }
11036|      0|          state = state::PATH;
11037|      0|          break;
11038|      0|        }
11039|       |
11040|      0|        input_position++;
11041|      0|        break;
11042|      0|      }
11043|   153k|      case state::SPECIAL_AUTHORITY_SLASHES: {
  ------------------
  |  Branch (11043:7): [True: 153k, False: 938k]
  ------------------
11044|   153k|        ada_log("SPECIAL_AUTHORITY_SLASHES ",
11045|   153k|                helpers::substring(url_data, input_position));
11046|       |
11047|       |        // If c is U+002F (/) and remaining starts with U+002F (/),
11048|       |        // then set state to special authority ignore slashes state and increase
11049|       |        // pointer by 1.
11050|   153k|        if (url_data.substr(input_position, 2) == "//") {
  ------------------
  |  Branch (11050:13): [True: 152k, False: 1.42k]
  ------------------
11051|   152k|          input_position += 2;
11052|   152k|        }
11053|       |
11054|   153k|        [[fallthrough]];
11055|   153k|      }
11056|   153k|      case state::SPECIAL_AUTHORITY_IGNORE_SLASHES: {
  ------------------
  |  Branch (11056:7): [True: 0, False: 1.09M]
  ------------------
11057|   153k|        ada_log("SPECIAL_AUTHORITY_IGNORE_SLASHES ",
11058|   153k|                helpers::substring(url_data, input_position));
11059|       |
11060|       |        // If c is neither U+002F (/) nor U+005C (\), then set state to
11061|       |        // authority state and decrease pointer by 1.
11062|   155k|        while ((input_position != input_size) &&
  ------------------
  |  Branch (11062:16): [True: 155k, False: 59]
  ------------------
11063|   155k|               ((url_data[input_position] == '/') ||
  ------------------
  |  Branch (11063:17): [True: 563, False: 154k]
  ------------------
11064|   154k|                (url_data[input_position] == '\\'))) {
  ------------------
  |  Branch (11064:17): [True: 1.29k, False: 153k]
  ------------------
11065|  1.85k|          input_position++;
11066|  1.85k|        }
11067|   153k|        state = state::AUTHORITY;
11068|       |
11069|   153k|        break;
11070|   153k|      }
11071|  9.53k|      case state::QUERY: {
  ------------------
  |  Branch (11071:7): [True: 9.53k, False: 1.08M]
  ------------------
11072|  9.53k|        ada_log("QUERY ", helpers::substring(url_data, input_position));
11073|  9.53k|        if constexpr (store_values) {
11074|       |          // Let queryPercentEncodeSet be the special-query percent-encode set
11075|       |          // if url is special; otherwise the query percent-encode set.
11076|  9.53k|          const uint8_t* query_percent_encode_set =
11077|  9.53k|              url.is_special() ? character_sets::SPECIAL_QUERY_PERCENT_ENCODE
  ------------------
  |  Branch (11077:15): [True: 8.67k, False: 861]
  ------------------
11078|  9.53k|                               : character_sets::QUERY_PERCENT_ENCODE;
11079|       |
11080|       |          // Percent-encode after encoding, with encoding, buffer, and
11081|       |          // queryPercentEncodeSet, and append the result to url's query.
11082|  9.53k|          url.update_base_search(url_data.substr(input_position),
11083|  9.53k|                                 query_percent_encode_set);
11084|  9.53k|          ada_log("QUERY update_base_search completed ");
11085|  9.53k|          if (fragment.has_value()) {
  ------------------
  |  Branch (11085:15): [True: 6.99k, False: 2.54k]
  ------------------
11086|  6.99k|            url.update_unencoded_base_hash(*fragment);
11087|  6.99k|          }
11088|  9.53k|        }
11089|  9.53k|        return url;
11090|   153k|      }
11091|   153k|      case state::HOST: {
  ------------------
  |  Branch (11091:7): [True: 153k, False: 937k]
  ------------------
11092|   153k|        ada_log("HOST ", helpers::substring(url_data, input_position));
11093|       |
11094|   153k|        std::string_view host_view = url_data.substr(input_position);
11095|   153k|        auto [location, found_colon] =
11096|   153k|            helpers::get_host_delimiter_location(url.is_special(), host_view);
11097|   153k|        input_position = (location != std::string_view::npos)
  ------------------
  |  Branch (11097:26): [True: 153k, False: 0]
  ------------------
11098|   153k|                             ? input_position + location
11099|   153k|                             : input_size;
11100|       |        // Otherwise, if c is U+003A (:) and insideBrackets is false, then:
11101|       |        // Note: the 'found_colon' value is true if and only if a colon was
11102|       |        // encountered while not inside brackets.
11103|   153k|        if (found_colon) {
  ------------------
  |  Branch (11103:13): [True: 23.2k, False: 130k]
  ------------------
11104|       |          // If buffer is the empty string, validation error, return failure.
11105|       |          // Let host be the result of host parsing buffer with url is not
11106|       |          // special.
11107|  23.2k|          ada_log("HOST parsing ", host_view);
11108|  23.2k|          if (!url.parse_host(host_view)) {
  ------------------
  |  Branch (11108:15): [True: 130, False: 23.1k]
  ------------------
11109|    130|            return url;
11110|    130|          }
11111|  23.1k|          ada_log("HOST parsing results in ", url.get_hostname());
11112|       |          // Set url's host to host, buffer to the empty string, and state to
11113|       |          // port state.
11114|  23.1k|          state = state::PORT;
11115|  23.1k|          input_position++;
11116|  23.1k|        }
11117|       |        // Otherwise, if one of the following is true:
11118|       |        // - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#)
11119|       |        // - url is special and c is U+005C (\)
11120|       |        // The get_host_delimiter_location function either brings us to
11121|       |        // the colon outside of the bracket, or to one of those characters.
11122|   130k|        else {
11123|       |          // If url is special and host_view is the empty string, validation
11124|       |          // error, return failure.
11125|   130k|          if (host_view.empty() && url.is_special()) {
  ------------------
  |  Branch (11125:15): [True: 125, False: 130k]
  |  Branch (11125:36): [True: 83, False: 42]
  ------------------
11126|     83|            url.is_valid = false;
11127|     83|            return url;
11128|     83|          }
11129|   130k|          ada_log("HOST parsing ", host_view, " href=", url.get_href());
11130|       |          // Let host be the result of host parsing host_view with url is not
11131|       |          // special.
11132|   130k|          if (host_view.empty()) {
  ------------------
  |  Branch (11132:15): [True: 42, False: 130k]
  ------------------
11133|     42|            url.update_base_hostname("");
11134|   130k|          } else if (!url.parse_host(host_view)) {
  ------------------
  |  Branch (11134:22): [True: 2.01k, False: 128k]
  ------------------
11135|  2.01k|            return url;
11136|  2.01k|          }
11137|   128k|          ada_log("HOST parsing results in ", url.get_hostname(),
11138|   128k|                  " href=", url.get_href());
11139|       |
11140|       |          // Set url's host to host, and state to path start state.
11141|   128k|          state = state::PATH_START;
11142|   128k|        }
11143|       |
11144|   151k|        break;
11145|   153k|      }
11146|   151k|      case state::OPAQUE_PATH: {
  ------------------
  |  Branch (11146:7): [True: 495, False: 1.09M]
  ------------------
11147|    495|        ada_log("OPAQUE_PATH ", helpers::substring(url_data, input_position));
11148|       |        // Opaque path, query, and fragment are structurally always valid:
11149|       |        // the parser would just percent-encode whatever is there. When we
11150|       |        // are not storing values (can_parse), we can return immediately.
11151|       |        // We must set has_opaque_path = true before returning so that when
11152|       |        // this URL is used as an internal base inside can_parse, NO_SCHEME
11153|       |        // correctly rejects relative inputs against an opaque-path base
11154|       |        // (e.g. can_parse("", &"W:") must return false).
11155|       |        if constexpr (!store_values) {
11156|       |          url.has_opaque_path = true;
11157|       |          return url;
11158|       |        }
11159|    495|        std::string_view view = url_data.substr(input_position);
11160|       |        // If c is U+003F (?), then set url's query to the empty string and
11161|       |        // state to query state.
11162|    495|        size_t location = view.find('?');
11163|    495|        if (location != std::string_view::npos) {
  ------------------
  |  Branch (11163:13): [True: 321, False: 174]
  ------------------
11164|    321|          view.remove_suffix(view.size() - location);
11165|    321|          state = state::QUERY;
11166|    321|          input_position += location + 1;
11167|    321|        } else {
11168|    174|          input_position = input_size + 1;
11169|    174|        }
11170|    495|        url.has_opaque_path = true;
11171|       |
11172|       |        // This is a really unlikely scenario in real world. We should not seek
11173|       |        // to optimize it.
11174|    495|        if (view.ends_with(' ')) {
  ------------------
  |  Branch (11174:13): [True: 14, False: 481]
  ------------------
11175|     14|          std::string modified_view =
11176|     14|              std::string(view.substr(0, view.size() - 1)) + "%20";
11177|     14|          url.update_base_pathname(unicode::percent_encode(
11178|     14|              modified_view, character_sets::C0_CONTROL_PERCENT_ENCODE));
11179|    481|        } else {
11180|    481|          url.update_base_pathname(unicode::percent_encode(
11181|    481|              view, character_sets::C0_CONTROL_PERCENT_ENCODE));
11182|    481|        }
11183|    495|        break;
11184|   153k|      }
11185|  23.1k|      case state::PORT: {
  ------------------
  |  Branch (11185:7): [True: 23.1k, False: 1.06M]
  ------------------
11186|  23.1k|        ada_log("PORT ", helpers::substring(url_data, input_position));
11187|  23.1k|        std::string_view port_view = url_data.substr(input_position);
11188|  23.1k|        input_position += url.parse_port(port_view, true);
11189|  23.1k|        if (!url.is_valid) {
  ------------------
  |  Branch (11189:13): [True: 143, False: 23.0k]
  ------------------
11190|    143|          return url;
11191|    143|        }
11192|  23.0k|        state = state::PATH_START;
11193|  23.0k|        [[fallthrough]];
11194|  23.0k|      }
11195|   152k|      case state::PATH_START: {
  ------------------
  |  Branch (11195:7): [True: 129k, False: 962k]
  ------------------
11196|   152k|        ada_log("PATH_START ", helpers::substring(url_data, input_position));
11197|       |        // Path, query, and fragment are structurally always valid: the
11198|       |        // parser would just percent-encode whatever is there. When we are
11199|       |        // not storing values (can_parse), we can return immediately since
11200|       |        // no subsequent state can invalidate the URL.
11201|       |        if constexpr (!store_values) {
11202|       |          return url;
11203|       |        }
11204|       |
11205|       |        // If url is special, then:
11206|   152k|        if (url.is_special()) {
  ------------------
  |  Branch (11206:13): [True: 152k, False: 513]
  ------------------
11207|       |          // Set state to path state.
11208|   152k|          state = state::PATH;
11209|       |
11210|       |          // Optimization: Avoiding going into PATH state improves the
11211|       |          // performance of urls ending with /.
11212|   152k|          if (input_position == input_size) {
  ------------------
  |  Branch (11212:15): [True: 2.10k, False: 149k]
  ------------------
11213|  2.10k|            if constexpr (store_values) {
11214|  2.10k|              url.update_base_pathname("/");
11215|  2.10k|              if (fragment.has_value()) {
  ------------------
  |  Branch (11215:19): [True: 287, False: 1.81k]
  ------------------
11216|    287|                url.update_unencoded_base_hash(*fragment);
11217|    287|              }
11218|  2.10k|            }
11219|  2.10k|            return url;
11220|  2.10k|          }
11221|       |          // If c is neither U+002F (/) nor U+005C (\), then decrease pointer
11222|       |          // by 1. We know that (input_position == input_size) is impossible
11223|       |          // here, because of the previous if-check.
11224|   149k|          if ((url_data[input_position] != '/') &&
  ------------------
  |  Branch (11224:15): [True: 942, False: 148k]
  ------------------
11225|    942|              (url_data[input_position] != '\\')) {
  ------------------
  |  Branch (11225:15): [True: 578, False: 364]
  ------------------
11226|    578|            break;
11227|    578|          }
11228|   149k|        }
11229|       |        // Otherwise, if state override is not given and c is U+003F (?),
11230|       |        // set url's query to the empty string and state to query state.
11231|    513|        else if ((input_position != input_size) &&
  ------------------
  |  Branch (11231:18): [True: 396, False: 117]
  ------------------
11232|    396|                 (url_data[input_position] == '?')) {
  ------------------
  |  Branch (11232:18): [True: 72, False: 324]
  ------------------
11233|     72|          state = state::QUERY;
11234|     72|        }
11235|       |        // Otherwise, if c is not the EOF code point:
11236|    441|        else if (input_position != input_size) {
  ------------------
  |  Branch (11236:18): [True: 324, False: 117]
  ------------------
11237|       |          // Set state to path state.
11238|    324|          state = state::PATH;
11239|       |
11240|       |          // If c is not U+002F (/), then decrease pointer by 1.
11241|    324|          if (url_data[input_position] != '/') {
  ------------------
  |  Branch (11241:15): [True: 0, False: 324]
  ------------------
11242|      0|            break;
11243|      0|          }
11244|    324|        }
11245|       |
11246|   149k|        input_position++;
11247|   149k|        break;
11248|   152k|      }
11249|   150k|      case state::PATH: {
  ------------------
  |  Branch (11249:7): [True: 150k, False: 940k]
  ------------------
11250|   150k|        ada_log("PATH ", helpers::substring(url_data, input_position));
11251|       |        // Path, query, and fragment are structurally always valid: the
11252|       |        // parser would just percent-encode whatever is there. When we are
11253|       |        // not storing values (can_parse), we can return immediately since
11254|       |        // no subsequent state can invalidate the URL.
11255|       |        if constexpr (!store_values) {
11256|       |          return url;
11257|       |        }
11258|   150k|        std::string_view view = url_data.substr(input_position);
11259|       |
11260|       |        // Most time, we do not need percent encoding.
11261|       |        // Furthermore, we can immediately locate the '?'.
11262|   150k|        size_t locofquestionmark = view.find('?');
11263|   150k|        if (locofquestionmark != std::string_view::npos) {
  ------------------
  |  Branch (11263:13): [True: 9.14k, False: 141k]
  ------------------
11264|  9.14k|          state = state::QUERY;
11265|  9.14k|          view.remove_suffix(view.size() - locofquestionmark);
11266|  9.14k|          input_position += locofquestionmark + 1;
11267|   141k|        } else {
11268|   141k|          input_position = input_size + 1;
11269|   141k|        }
11270|   150k|        if constexpr (store_values) {
11271|       |          if constexpr (result_type_is_ada_url) {
11272|       |            helpers::parse_prepared_path(view, url.type, url.path);
11273|   150k|          } else {
11274|   150k|            url.consume_prepared_path(view);
11275|   150k|            ADA_ASSERT_TRUE(url.validate());
11276|   150k|          }
11277|   150k|        }
11278|   150k|        break;
11279|   152k|      }
11280|  1.11k|      case state::FILE_SLASH: {
  ------------------
  |  Branch (11280:7): [True: 1.11k, False: 1.09M]
  ------------------
11281|  1.11k|        ada_log("FILE_SLASH ", helpers::substring(url_data, input_position));
11282|       |
11283|       |        // If c is U+002F (/) or U+005C (\), then:
11284|  1.11k|        if ((input_position != input_size) &&
  ------------------
  |  Branch (11284:13): [True: 1.11k, False: 1]
  ------------------
11285|  1.11k|            (url_data[input_position] == '/' ||
  ------------------
  |  Branch (11285:14): [True: 1.09k, False: 12]
  ------------------
11286|  1.10k|             url_data[input_position] == '\\')) {
  ------------------
  |  Branch (11286:14): [True: 2, False: 10]
  ------------------
11287|  1.10k|          ada_log("FILE_SLASH c is U+002F or U+005C");
11288|       |          // Set state to file host state.
11289|  1.10k|          state = state::FILE_HOST;
11290|  1.10k|          input_position++;
11291|  1.10k|        } else {
11292|     11|          ada_log("FILE_SLASH otherwise");
11293|       |          // If base is non-null and base's scheme is "file", then:
11294|       |          // Note: it is unsafe to do base_url->scheme unless you know that
11295|       |          // base_url_has_value() is true.
11296|     11|          if (base_url != nullptr && base_url->type == scheme::type::FILE) {
  ------------------
  |  Branch (11296:15): [True: 0, False: 11]
  |  Branch (11296:38): [True: 0, False: 0]
  ------------------
11297|       |            // Set url's host to base's host.
11298|       |            if constexpr (result_type_is_ada_url) {
11299|       |              url.host = base_url->host;
11300|      0|            } else {
11301|      0|              url.update_host_to_base_host(base_url->get_host());
11302|      0|            }
11303|       |            // If the code point substring from pointer to the end of input does
11304|       |            // not start with a Windows drive letter and base's path[0] is a
11305|       |            // normalized Windows drive letter, then append base's path[0] to
11306|       |            // url's path.
11307|      0|            if (!base_url->get_pathname().empty()) {
  ------------------
  |  Branch (11307:17): [True: 0, False: 0]
  ------------------
11308|      0|              if (!checkers::is_windows_drive_letter(
  ------------------
  |  Branch (11308:19): [True: 0, False: 0]
  ------------------
11309|      0|                      url_data.substr(input_position))) {
11310|      0|                std::string_view first_base_url_path =
11311|      0|                    base_url->get_pathname().substr(1);
11312|      0|                size_t loc = first_base_url_path.find('/');
11313|      0|                if (loc != std::string_view::npos) {
  ------------------
  |  Branch (11313:21): [True: 0, False: 0]
  ------------------
11314|      0|                  helpers::resize(first_base_url_path, loc);
11315|      0|                }
11316|      0|                if (checkers::is_normalized_windows_drive_letter(
  ------------------
  |  Branch (11316:21): [True: 0, False: 0]
  ------------------
11317|      0|                        first_base_url_path)) {
11318|       |                  if constexpr (result_type_is_ada_url) {
11319|       |                    url.path += '/';
11320|       |                    url.path += first_base_url_path;
11321|      0|                  } else {
11322|      0|                    url.append_base_pathname(
11323|      0|                        helpers::concat("/", first_base_url_path));
11324|      0|                  }
11325|      0|                }
11326|      0|              }
11327|      0|            }
11328|      0|          }
11329|       |
11330|       |          // Set state to path state, and decrease pointer by 1.
11331|     11|          state = state::PATH;
11332|     11|        }
11333|       |
11334|  1.11k|        break;
11335|   152k|      }
11336|  1.10k|      case state::FILE_HOST: {
  ------------------
  |  Branch (11336:7): [True: 1.10k, False: 1.09M]
  ------------------
11337|  1.10k|        ada_log("FILE_HOST ", helpers::substring(url_data, input_position));
11338|  1.10k|        std::string_view view = url_data.substr(input_position);
11339|       |
11340|  1.10k|        size_t location = view.find_first_of("/\\?");
11341|  1.10k|        std::string_view file_host_buffer = view.substr(
11342|  1.10k|            0, (location != std::string_view::npos) ? location : view.size());
  ------------------
  |  Branch (11342:16): [True: 1.06k, False: 34]
  ------------------
11343|       |
11344|  1.10k|        if (checkers::is_windows_drive_letter(file_host_buffer)) {
  ------------------
  |  Branch (11344:13): [True: 1, False: 1.10k]
  ------------------
11345|      1|          state = state::PATH;
11346|  1.10k|        } else if (file_host_buffer.empty()) {
  ------------------
  |  Branch (11346:20): [True: 340, False: 760]
  ------------------
11347|       |          // Set url's host to the empty string.
11348|       |          if constexpr (result_type_is_ada_url) {
11349|       |            url.host = "";
11350|    340|          } else {
11351|    340|            url.update_base_hostname("");
11352|    340|          }
11353|       |          // Set state to path start state.
11354|    340|          state = state::PATH_START;
11355|    760|        } else {
11356|    760|          size_t consumed_bytes = file_host_buffer.size();
11357|    760|          input_position += consumed_bytes;
11358|       |          // Let host be the result of host parsing buffer with url is not
11359|       |          // special.
11360|    760|          if (!url.parse_host(file_host_buffer)) {
  ------------------
  |  Branch (11360:15): [True: 92, False: 668]
  ------------------
11361|     92|            return url;
11362|     92|          }
11363|       |
11364|       |          if constexpr (result_type_is_ada_url) {
11365|       |            // If host is "localhost", then set host to the empty string.
11366|       |            if (url.host.has_value() && url.host.value() == "localhost") {
11367|       |              url.host = "";
11368|       |            }
11369|    668|          } else {
11370|    668|            if (url.get_hostname() == "localhost") {
  ------------------
  |  Branch (11370:17): [True: 2, False: 666]
  ------------------
11371|      2|              url.update_base_hostname("");
11372|      2|            }
11373|    668|          }
11374|       |
11375|       |          // Set buffer to the empty string and state to path start state.
11376|    668|          state = state::PATH_START;
11377|    668|        }
11378|       |
11379|  1.00k|        break;
11380|  1.10k|      }
11381|  1.26k|      case state::FILE: {
  ------------------
  |  Branch (11381:7): [True: 1.26k, False: 1.09M]
  ------------------
11382|  1.26k|        ada_log("FILE ", helpers::substring(url_data, input_position));
11383|  1.26k|        std::string_view file_view = url_data.substr(input_position);
11384|       |
11385|  1.26k|        url.set_protocol_as_file();
11386|       |        if constexpr (result_type_is_ada_url) {
11387|       |          // Set url's host to the empty string.
11388|       |          url.host = "";
11389|  1.26k|        } else {
11390|  1.26k|          url.update_base_hostname("");
11391|  1.26k|        }
11392|       |        // If c is U+002F (/) or U+005C (\), then:
11393|  1.26k|        if (input_position != input_size &&
  ------------------
  |  Branch (11393:13): [True: 1.26k, False: 1]
  ------------------
11394|  1.26k|            (url_data[input_position] == '/' ||
  ------------------
  |  Branch (11394:14): [True: 1.11k, False: 151]
  ------------------
11395|  1.11k|             url_data[input_position] == '\\')) {
  ------------------
  |  Branch (11395:14): [True: 2, False: 149]
  ------------------
11396|  1.11k|          ada_log("FILE c is U+002F or U+005C");
11397|       |          // Set state to file slash state.
11398|  1.11k|          state = state::FILE_SLASH;
11399|  1.11k|        }
11400|       |        // Otherwise, if base is non-null and base's scheme is "file":
11401|    150|        else if (base_url != nullptr && base_url->type == scheme::type::FILE) {
  ------------------
  |  Branch (11401:18): [True: 0, False: 150]
  |  Branch (11401:41): [True: 0, False: 0]
  ------------------
11402|       |          // Set url's host to base's host, url's path to a clone of base's
11403|       |          // path, and url's query to base's query.
11404|      0|          ada_log("FILE base non-null");
11405|       |          if constexpr (result_type_is_ada_url) {
11406|       |            url.host = base_url->host;
11407|       |            url.path = base_url->path;
11408|       |            url.query = base_url->query;
11409|      0|          } else {
11410|      0|            url.update_host_to_base_host(base_url->get_hostname());
11411|      0|            url.update_base_pathname(base_url->get_pathname());
11412|      0|            if (base_url->has_search()) {
  ------------------
  |  Branch (11412:17): [True: 0, False: 0]
  ------------------
11413|       |              // get_search() returns "" for an empty query string (URL ends
11414|       |              // with '?'). update_base_search("") would incorrectly clear the
11415|       |              // query, so pass "?" to preserve the empty query distinction.
11416|      0|              auto s = base_url->get_search();
11417|      0|              url.update_base_search(s.empty() ? std::string_view("?") : s);
  ------------------
  |  Branch (11417:38): [True: 0, False: 0]
  ------------------
11418|      0|            }
11419|      0|          }
11420|      0|          url.has_opaque_path = base_url->has_opaque_path;
11421|       |
11422|       |          // If c is U+003F (?), then set url's query to the empty string and
11423|       |          // state to query state.
11424|      0|          if (input_position != input_size && url_data[input_position] == '?') {
  ------------------
  |  Branch (11424:15): [True: 0, False: 0]
  |  Branch (11424:47): [True: 0, False: 0]
  ------------------
11425|      0|            state = state::QUERY;
11426|      0|          }
11427|       |          // Otherwise, if c is not the EOF code point:
11428|      0|          else if (input_position != input_size) {
  ------------------
  |  Branch (11428:20): [True: 0, False: 0]
  ------------------
11429|       |            // Set url's query to null.
11430|      0|            url.clear_search();
11431|       |            // If the code point substring from pointer to the end of input does
11432|       |            // not start with a Windows drive letter, then shorten url's path.
11433|      0|            if (!checkers::is_windows_drive_letter(file_view)) {
  ------------------
  |  Branch (11433:17): [True: 0, False: 0]
  ------------------
11434|       |              if constexpr (result_type_is_ada_url) {
11435|       |                helpers::shorten_path(url.path, url.type);
11436|      0|              } else {
11437|      0|                std::string_view path = url.get_pathname();
11438|      0|                if (helpers::shorten_path(path, url.type)) {
  ------------------
  |  Branch (11438:21): [True: 0, False: 0]
  ------------------
11439|      0|                  url.update_base_pathname(std::move(std::string(path)));
11440|      0|                }
11441|      0|              }
11442|      0|            }
11443|       |            // Otherwise:
11444|      0|            else {
11445|       |              // Set url's path to an empty list.
11446|      0|              url.clear_pathname();
11447|      0|              url.has_opaque_path = true;
11448|      0|            }
11449|       |
11450|       |            // Set state to path state and decrease pointer by 1.
11451|      0|            state = state::PATH;
11452|      0|            break;
11453|      0|          }
11454|      0|        }
11455|       |        // Otherwise, set state to path state, and decrease pointer by 1.
11456|    150|        else {
11457|    150|          ada_log("FILE go to path");
11458|    150|          state = state::PATH;
11459|    150|          break;
11460|    150|        }
11461|       |
11462|  1.11k|        input_position++;
11463|  1.11k|        break;
11464|  1.26k|      }
11465|      0|      default:
  ------------------
  |  Branch (11465:7): [True: 0, False: 1.09M]
  ------------------
11466|      0|        unreachable();
11467|  1.09M|    }
11468|  1.09M|  }
11469|   333k|  if constexpr (store_values) {
11470|   333k|    if (fragment.has_value()) {
  ------------------
  |  Branch (11470:9): [True: 2.24k, False: 331k]
  ------------------
11471|  2.24k|      url.update_unencoded_base_hash(*fragment);
11472|  2.24k|    }
11473|   333k|  }
11474|       |  // Check the resulting (normalized) URL size against the maximum input length.
11475|       |  // Normalization (percent-encoding, IDNA, etc.) can expand the URL beyond the
11476|       |  // original input size.
11477|   333k|  if constexpr (store_values) {
11478|   333k|    if (url.is_valid) {
  ------------------
  |  Branch (11478:9): [True: 141k, False: 191k]
  ------------------
11479|   141k|      if constexpr (result_type_is_ada_url_aggregator) {
11480|   141k|        if (url.buffer.size() > max_input_length) {
  ------------------
  |  Branch (11480:13): [True: 0, False: 141k]
  ------------------
11481|      0|          url.is_valid = false;
11482|      0|        }
11483|       |      } else {
11484|       |        if (url.get_href_size() > max_input_length) {
11485|       |          url.is_valid = false;
11486|       |        }
11487|       |      }
11488|   141k|    }
11489|   333k|  }
11490|   333k|  return url;
11491|   347k|}
_ZN3ada14url_aggregator8set_hrefENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
12044|   115k|bool url_aggregator::set_href(const std::string_view input) {
12045|   115k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
12046|   115k|  ada_log("url_aggregator::set_href ", input, " [", input.size(), " bytes]");
12047|   115k|  ada::result<url_aggregator> out = ada::parse<url_aggregator>(input);
12048|   115k|  ada_log("url_aggregator::set_href, success :", out.has_value());
12049|       |
12050|   115k|  if (out) {
  ------------------
  |  Branch (12050:7): [True: 115k, False: 0]
  ------------------
12051|       |    // The parser enforces get_max_input_length() on both the input and the
12052|       |    // normalized result. This is a defense-in-depth check.
12053|   115k|    if (out->buffer.size() > ada::get_max_input_length()) {
  ------------------
  |  Branch (12053:9): [True: 0, False: 115k]
  ------------------
12054|      0|      return false;
12055|      0|    }
12056|   115k|    ada_log("url_aggregator::set_href, parsed ", out->to_string());
12057|       |    // TODO: Figure out why the following line puts test to never finish.
12058|   115k|    *this = *out;
12059|   115k|  }
12060|       |
12061|   115k|  return out.has_value();
12062|   115k|}
_ZNK3ada14url_aggregator12get_usernameEv:
12354|   115k|    ada_lifetime_bound {
12355|   115k|  ada_log("url_aggregator::get_username");
12356|   115k|  if (has_non_empty_username()) {
  ------------------
  |  Branch (12356:7): [True: 7.38k, False: 107k]
  ------------------
12357|  7.38k|    return helpers::substring(buffer, components.protocol_end + 2,
12358|  7.38k|                              components.username_end);
12359|  7.38k|  }
12360|   107k|  return "";
12361|   115k|}
_ZNK3ada14url_aggregator12get_passwordEv:
12364|   115k|    ada_lifetime_bound {
12365|   115k|  ada_log("url_aggregator::get_password");
12366|   115k|  if (has_non_empty_password()) {
  ------------------
  |  Branch (12366:7): [True: 7.11k, False: 107k]
  ------------------
12367|  7.11k|    return helpers::substring(buffer, components.username_end + 1,
12368|  7.11k|                              components.host_start);
12369|  7.11k|  }
12370|   107k|  return "";
12371|   115k|}
_ZNK3ada14url_aggregator8get_portEv:
12374|   115k|    ada_lifetime_bound {
12375|   115k|  ada_log("url_aggregator::get_port");
12376|   115k|  if (components.port == url_components::omitted) {
  ------------------
  |  Branch (12376:7): [True: 107k, False: 7.60k]
  ------------------
12377|   107k|    return "";
12378|   107k|  }
12379|  7.60k|  return helpers::substring(buffer, components.host_end + 1,
12380|  7.60k|                            components.pathname_start);
12381|   115k|}
_ZNK3ada14url_aggregator8get_hashEv:
12384|   115k|    ada_lifetime_bound {
12385|   115k|  ada_log("url_aggregator::get_hash");
12386|       |  // If this's URL's fragment is either null or the empty string, then return
12387|       |  // the empty string. Return U+0023 (#), followed by this's URL's fragment.
12388|   115k|  if (components.hash_start == url_components::omitted) {
  ------------------
  |  Branch (12388:7): [True: 97.7k, False: 17.2k]
  ------------------
12389|  97.7k|    return "";
12390|  97.7k|  }
12391|  17.2k|  if (buffer.size() - components.hash_start <= 1) {
  ------------------
  |  Branch (12391:7): [True: 1.13k, False: 16.1k]
  ------------------
12392|  1.13k|    return "";
12393|  1.13k|  }
12394|  16.1k|  return helpers::substring(buffer, components.hash_start);
12395|  17.2k|}
_ZNK3ada14url_aggregator8get_hostEv:
12398|   115k|    ada_lifetime_bound {
12399|   115k|  ada_log("url_aggregator::get_host");
12400|       |  // Technically, we should check if there is a hostname, but
12401|       |  // the code below works even if there isn't.
12402|       |  // if(!has_hostname()) { return ""; }
12403|   115k|  size_t start = components.host_start;
12404|   115k|  if (components.host_end > components.host_start &&
  ------------------
  |  Branch (12404:7): [True: 114k, False: 447]
  ------------------
12405|   114k|      buffer[components.host_start] == '@') {
  ------------------
  |  Branch (12405:7): [True: 7.42k, False: 107k]
  ------------------
12406|  7.42k|    start++;
12407|  7.42k|  }
12408|       |  // if we have an empty host, then the space between components.host_end and
12409|       |  // components.pathname_start may be occupied by /.
12410|   115k|  if (start == components.host_end) {
  ------------------
  |  Branch (12410:7): [True: 447, False: 114k]
  ------------------
12411|    447|    return {};
12412|    447|  }
12413|   114k|  return helpers::substring(buffer, start, components.pathname_start);
12414|   115k|}
_ZNK3ada14url_aggregator12get_hostnameEv:
12417|   240k|    ada_lifetime_bound {
12418|   240k|  ada_log("url_aggregator::get_hostname");
12419|       |  // Technically, we should check if there is a hostname, but
12420|       |  // the code below works even if there isn't.
12421|       |  // if(!has_hostname()) { return ""; }
12422|   240k|  size_t start = components.host_start;
12423|       |  // So host_start is not where the host begins.
12424|   240k|  if (components.host_end > components.host_start &&
  ------------------
  |  Branch (12424:7): [True: 192k, False: 48.3k]
  ------------------
12425|   192k|      buffer[components.host_start] == '@') {
  ------------------
  |  Branch (12425:7): [True: 29.6k, False: 162k]
  ------------------
12426|  29.6k|    start++;
12427|  29.6k|  }
12428|   240k|  return helpers::substring(buffer, start, components.host_end);
12429|   240k|}
_ZNK3ada14url_aggregator10get_searchEv:
12432|   115k|    ada_lifetime_bound {
12433|   115k|  ada_log("url_aggregator::get_search");
12434|       |  // If this's URL's query is either null or the empty string, then return the
12435|       |  // empty string. Return U+003F (?), followed by this's URL's query.
12436|   115k|  if (components.search_start == url_components::omitted) {
  ------------------
  |  Branch (12436:7): [True: 91.0k, False: 23.9k]
  ------------------
12437|  91.0k|    return "";
12438|  91.0k|  }
12439|  23.9k|  auto ending_index = uint32_t(buffer.size());
12440|  23.9k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (12440:7): [True: 9.52k, False: 14.4k]
  ------------------
12441|  9.52k|    ending_index = components.hash_start;
12442|  9.52k|  }
12443|  23.9k|  if (ending_index - components.search_start <= 1) {
  ------------------
  |  Branch (12443:7): [True: 794, False: 23.1k]
  ------------------
12444|    794|    return "";
12445|    794|  }
12446|  23.1k|  return helpers::substring(buffer, components.search_start, ending_index);
12447|  23.9k|}
_ZNK3ada14url_aggregator12get_protocolEv:
12450|   115k|    ada_lifetime_bound {
12451|   115k|  ada_log("url_aggregator::get_protocol");
12452|   115k|  return helpers::substring(buffer, 0, components.protocol_end);
12453|   115k|}
_ZN3ada14url_aggregator10parse_ipv4ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEb:
12562|  8.32k|bool url_aggregator::parse_ipv4(std::string_view input, bool in_place) {
12563|  8.32k|  ada_log("parse_ipv4 ", input, " [", input.size(),
12564|  8.32k|          " bytes], overlaps with buffer: ",
12565|  8.32k|          helpers::overlaps(input, buffer) ? "yes" : "no");
12566|  8.32k|  ADA_ASSERT_TRUE(validate());
12567|  8.32k|  if (input.empty()) {
  ------------------
  |  Branch (12567:7): [True: 0, False: 8.32k]
  ------------------
12568|      0|    return is_valid = false;
12569|      0|  }
12570|  8.32k|  const bool trailing_dot = (input.back() == '.');
12571|  8.32k|  if (trailing_dot) {
  ------------------
  |  Branch (12571:7): [True: 21, False: 8.30k]
  ------------------
12572|     21|    input.remove_suffix(1);
12573|     21|    if (input.empty()) {
  ------------------
  |  Branch (12573:9): [True: 0, False: 21]
  ------------------
12574|      0|      return is_valid = false;
12575|      0|    }
12576|     21|  }
12577|       |
12578|  8.32k|  const uint64_t fast = checkers::try_parse_ipv4_fast(input);
12579|  8.32k|  if (fast < checkers::ipv4_fast_fail) [[likely]] {
  ------------------
  |  Branch (12579:7): [True: 7, False: 8.32k]
  ------------------
12580|       |    // Pure decimal: keep the buffer when it already holds the address.
12581|       |    // Otherwise write the (trailing-dot-stripped) input.
12582|      7|    if (!(in_place && !trailing_dot)) {
  ------------------
  |  Branch (12582:11): [True: 0, False: 7]
  |  Branch (12582:23): [True: 0, False: 0]
  ------------------
12583|      7|      update_base_hostname(input);
12584|      7|    }
12585|      7|    host_type = IPV4;
12586|      7|    ADA_ASSERT_TRUE(validate());
12587|      7|    return true;
12588|      7|  }
12589|       |
12590|  8.32k|  const char* p = input.data();
12591|  8.32k|  const char* end = p + input.size();
12592|  8.32k|  uint64_t ipv4 = 0;
12593|  8.32k|  int digit_count = 0;
12594|  8.32k|  int pure_decimal_count = 0;
12595|       |
12596|  15.7k|  for (; digit_count < 4 && p < end; ++digit_count) {
  ------------------
  |  Branch (12596:10): [True: 15.7k, False: 21]
  |  Branch (12596:29): [True: 15.7k, False: 0]
  ------------------
12597|  15.7k|    uint64_t segment = 0;
12598|  15.7k|    bool pure = false;
12599|  15.7k|    if (!detail::parse_ipv4_number(p, end, segment, pure)) {
  ------------------
  |  Branch (12599:9): [True: 199, False: 15.5k]
  ------------------
12600|    199|      return is_valid = false;
12601|    199|    }
12602|  15.5k|    if (pure) {
  ------------------
  |  Branch (12602:9): [True: 8.39k, False: 7.15k]
  ------------------
12603|  8.39k|      ++pure_decimal_count;
12604|  8.39k|    }
12605|  15.5k|    if (p >= end) {
  ------------------
  |  Branch (12605:9): [True: 8.06k, False: 7.48k]
  ------------------
12606|  8.06k|      const unsigned shift = static_cast<unsigned>(32 - digit_count * 8);
12607|  8.06k|      if (segment >= (uint64_t{1} << shift)) {
  ------------------
  |  Branch (12607:11): [True: 26, False: 8.03k]
  ------------------
12608|     26|        return is_valid = false;
12609|     26|      }
12610|  8.03k|      ipv4 = (ipv4 << shift) | segment;
12611|  8.03k|      goto ipv4_done;
12612|  8.06k|    }
12613|  7.48k|    if (segment > 255 || *p != '.') {
  ------------------
  |  Branch (12613:9): [True: 39, False: 7.44k]
  |  Branch (12613:26): [True: 0, False: 7.44k]
  ------------------
12614|     39|      return is_valid = false;
12615|     39|    }
12616|  7.44k|    ipv4 = (ipv4 << 8) | segment;
12617|  7.44k|    ++p;
12618|  7.44k|  }
12619|     21|  if (digit_count != 4 || p != end) {
  ------------------
  |  Branch (12619:7): [True: 0, False: 21]
  |  Branch (12619:27): [True: 21, False: 0]
  ------------------
12620|     21|    return is_valid = false;
12621|     21|  }
12622|  8.03k|ipv4_done:
12623|  8.03k|  ada_log("url_aggregator::parse_ipv4 completed ", get_href(),
12624|  8.03k|          " host: ", get_host());
12625|  8.03k|  if (in_place && pure_decimal_count == 4 && !trailing_dot) {
  ------------------
  |  Branch (12625:7): [True: 7.94k, False: 89]
  |  Branch (12625:19): [True: 0, False: 7.94k]
  |  Branch (12625:46): [True: 0, False: 0]
  ------------------
12626|      0|    ada_log(
12627|      0|        "url_aggregator::parse_ipv4 completed and was already correct in the "
12628|      0|        "buffer");
12629|  8.03k|  } else {
12630|  8.03k|    update_base_hostname(ada::serializers::ipv4(ipv4));
12631|  8.03k|  }
12632|  8.03k|  host_type = IPV4;
12633|  8.03k|  ADA_ASSERT_TRUE(validate());
12634|  8.03k|  return true;
12635|     21|}
_ZN3ada14url_aggregator10parse_ipv6ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
12637|    605|bool url_aggregator::parse_ipv6(std::string_view input) {
12638|    605|  ada_log("parse_ipv6 ", input, " [", input.size(), " bytes]");
12639|    605|  ADA_ASSERT_TRUE(validate());
12640|    605|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
12641|    605|  if (input.empty() || input.size() > 45) [[unlikely]] {
  ------------------
  |  Branch (12641:7): [True: 24, False: 581]
  |  Branch (12641:24): [True: 11, False: 570]
  ------------------
12642|     35|    return is_valid = false;
12643|     35|  }
12644|       |#if defined(ADA_AVX512)
12645|       |  if (!detail::ipv6_structure_plausible(input.data(), input.size()))
12646|       |      [[unlikely]] {
12647|       |    return is_valid = false;
12648|       |  }
12649|       |#endif
12650|       |
12651|    570|  std::array<uint16_t, 8> address{};
12652|    570|  const char* pointer = input.data();
12653|    570|  const char* const end = pointer + input.size();
12654|    570|  int piece_index = 0;
12655|    570|  int compress = -1;
12656|       |
12657|    570|  if (*pointer == ':') {
  ------------------
  |  Branch (12657:7): [True: 277, False: 293]
  ------------------
12658|    277|    if (input.size() == 1 || pointer[1] != ':') [[unlikely]] {
  ------------------
  |  Branch (12658:9): [True: 3, False: 274]
  |  Branch (12658:30): [True: 10, False: 264]
  ------------------
12659|     13|      return is_valid = false;
12660|     13|    }
12661|    264|    pointer += 2;
12662|    264|    compress = ++piece_index;
12663|    264|  }
12664|       |
12665|  1.58k|  while (pointer != end) {
  ------------------
  |  Branch (12665:10): [True: 1.13k, False: 444]
  ------------------
12666|  1.13k|    if (piece_index == 8) [[unlikely]] {
  ------------------
  |  Branch (12666:9): [True: 3, False: 1.13k]
  ------------------
12667|      3|      return is_valid = false;
12668|      3|    }
12669|  1.13k|    if (*pointer == ':') {
  ------------------
  |  Branch (12669:9): [True: 152, False: 983]
  ------------------
12670|    152|      if (compress != -1) [[unlikely]] {
  ------------------
  |  Branch (12670:11): [True: 3, False: 149]
  ------------------
12671|      3|        return is_valid = false;
12672|      3|      }
12673|    149|      ++pointer;
12674|    149|      compress = ++piece_index;
12675|    149|      continue;
12676|    152|    }
12677|       |
12678|    983|    uint16_t value = 0;
12679|    983|    const int length = detail::parse_hex_piece(pointer, end, value);
12680|       |
12681|    983|    if (pointer != end && *pointer == '.') {
  ------------------
  |  Branch (12681:9): [True: 757, False: 226]
  |  Branch (12681:27): [True: 79, False: 678]
  ------------------
12682|     79|      if (length == 0) [[unlikely]] {
  ------------------
  |  Branch (12682:11): [True: 3, False: 76]
  ------------------
12683|      3|        return is_valid = false;
12684|      3|      }
12685|     76|      pointer -= length;
12686|     76|      if (piece_index > 6) [[unlikely]] {
  ------------------
  |  Branch (12686:11): [True: 3, False: 73]
  ------------------
12687|      3|        return is_valid = false;
12688|      3|      }
12689|       |
12690|     73|      int numbers_seen = 0;
12691|    211|      while (pointer != end) {
  ------------------
  |  Branch (12691:14): [True: 193, False: 18]
  ------------------
12692|    193|        int ipv4_piece = -1;
12693|    193|        if (numbers_seen > 0) {
  ------------------
  |  Branch (12693:13): [True: 120, False: 73]
  ------------------
12694|    120|          if (*pointer == '.' && numbers_seen < 4) {
  ------------------
  |  Branch (12694:15): [True: 101, False: 19]
  |  Branch (12694:34): [True: 95, False: 6]
  ------------------
12695|     95|            ++pointer;
12696|     95|          } else {
12697|     25|            return is_valid = false;
12698|     25|          }
12699|    120|        }
12700|    168|        if (pointer == end || *pointer < '0' || *pointer > '9') [[unlikely]] {
  ------------------
  |  Branch (12700:13): [True: 12, False: 156]
  |  Branch (12700:31): [True: 5, False: 151]
  |  Branch (12700:49): [True: 3, False: 148]
  ------------------
12701|     20|          return is_valid = false;
12702|     20|        }
12703|    148|        ipv4_piece = *pointer - '0';
12704|    148|        ++pointer;
12705|    148|        if (pointer != end && *pointer >= '0' && *pointer <= '9') {
  ------------------
  |  Branch (12705:13): [True: 138, False: 10]
  |  Branch (12705:31): [True: 62, False: 76]
  |  Branch (12705:50): [True: 59, False: 3]
  ------------------
12706|     59|          if (ipv4_piece == 0) [[unlikely]] {
  ------------------
  |  Branch (12706:15): [True: 3, False: 56]
  ------------------
12707|      3|            return is_valid = false;
12708|      3|          }
12709|     56|          ipv4_piece = ipv4_piece * 10 + (*pointer - '0');
12710|     56|          ++pointer;
12711|     56|          if (pointer != end && *pointer >= '0' && *pointer <= '9') {
  ------------------
  |  Branch (12711:15): [True: 53, False: 3]
  |  Branch (12711:33): [True: 31, False: 22]
  |  Branch (12711:52): [True: 27, False: 4]
  ------------------
12712|     27|            ipv4_piece = ipv4_piece * 10 + (*pointer - '0');
12713|     27|            ++pointer;
12714|     27|            if (ipv4_piece > 255) [[unlikely]] {
  ------------------
  |  Branch (12714:17): [True: 7, False: 20]
  ------------------
12715|      7|              return is_valid = false;
12716|      7|            }
12717|     27|          }
12718|     56|        }
12719|    138|        address[static_cast<size_t>(piece_index)] = static_cast<uint16_t>(
12720|    138|            address[static_cast<size_t>(piece_index)] * 0x100 +
12721|    138|            static_cast<uint16_t>(ipv4_piece));
12722|    138|        ++numbers_seen;
12723|    138|        if (numbers_seen == 2 || numbers_seen == 4) {
  ------------------
  |  Branch (12723:13): [True: 43, False: 95]
  |  Branch (12723:34): [True: 13, False: 82]
  ------------------
12724|     56|          ++piece_index;
12725|     56|        }
12726|    138|      }
12727|     18|      if (numbers_seen != 4) [[unlikely]] {
  ------------------
  |  Branch (12727:11): [True: 12, False: 6]
  ------------------
12728|     12|        return is_valid = false;
12729|     12|      }
12730|      6|      break;
12731|     18|    }
12732|       |
12733|    904|    if (length == 0) [[unlikely]] {
  ------------------
  |  Branch (12733:9): [True: 19, False: 885]
  ------------------
12734|     19|      return is_valid = false;
12735|     19|    }
12736|       |
12737|    885|    if (pointer != end && *pointer == ':') {
  ------------------
  |  Branch (12737:9): [True: 659, False: 226]
  |  Branch (12737:27): [True: 653, False: 6]
  ------------------
12738|    653|      ++pointer;
12739|    653|      if (pointer == end) [[unlikely]] {
  ------------------
  |  Branch (12739:11): [True: 3, False: 650]
  ------------------
12740|      3|        return is_valid = false;
12741|      3|      }
12742|    653|    } else if (pointer != end) [[unlikely]] {
  ------------------
  |  Branch (12742:16): [True: 6, False: 226]
  ------------------
12743|      6|      return is_valid = false;
12744|      6|    }
12745|       |
12746|    876|    address[static_cast<size_t>(piece_index)] = value;
12747|    876|    ++piece_index;
12748|    876|  }
12749|       |
12750|    450|  if (compress != -1) {
  ------------------
  |  Branch (12750:7): [True: 403, False: 47]
  ------------------
12751|    403|    const int right = piece_index - compress;
12752|    403|    if (right > 0) {
  ------------------
  |  Branch (12752:9): [True: 185, False: 218]
  ------------------
12753|    185|      const size_t dest = static_cast<size_t>(8 - right);
12754|    185|      const size_t src = static_cast<size_t>(compress);
12755|    185|      if (dest != src) {
  ------------------
  |  Branch (12755:11): [True: 175, False: 10]
  ------------------
12756|    486|        for (size_t i = static_cast<size_t>(right); i-- > 0;) {
  ------------------
  |  Branch (12756:53): [True: 311, False: 175]
  ------------------
12757|    311|          address[dest + i] = address[src + i];
12758|    311|          address[src + i] = 0;
12759|    311|        }
12760|    175|      }
12761|    185|    }
12762|    403|  } else if (piece_index != 8) [[unlikely]] {
  ------------------
  |  Branch (12762:14): [True: 31, False: 16]
  ------------------
12763|     31|    return is_valid = false;
12764|     31|  }
12765|       |
12766|       |  // Serialize once; skip rewrite when hostname is already canonical.
12767|    419|  const std::string serialized = ada::serializers::ipv6(address);
12768|    419|  const std::string_view current = get_hostname();
12769|    419|  if (current.size() == serialized.size() &&
  ------------------
  |  Branch (12769:7): [True: 0, False: 419]
  ------------------
12770|      0|      std::memcmp(current.data(), serialized.data(), serialized.size()) == 0) {
  ------------------
  |  Branch (12770:7): [True: 0, False: 0]
  ------------------
12771|      0|    ada_log("parse_ipv6 in-place canonical match");
12772|    419|  } else {
12773|    419|    update_base_hostname(serialized);
12774|    419|  }
12775|    419|  ada_log("parse_ipv6 ", get_hostname());
12776|    419|  ADA_ASSERT_TRUE(validate());
12777|    419|  host_type = IPV6;
12778|    419|  return true;
12779|    450|}
_ZN3ada14url_aggregator17parse_opaque_hostENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
12781|    500|bool url_aggregator::parse_opaque_host(std::string_view input) {
12782|    500|  ada_log("parse_opaque_host ", input, " [", input.size(), " bytes]");
12783|    500|  ADA_ASSERT_TRUE(validate());
12784|    500|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
12785|    500|  if (std::ranges::any_of(input, ada::unicode::is_forbidden_host_code_point)) {
  ------------------
  |  Branch (12785:7): [True: 33, False: 467]
  ------------------
12786|     33|    return is_valid = false;
12787|     33|  }
12788|       |
12789|       |  // Return the result of running UTF-8 percent-encode on input using the C0
12790|       |  // control percent-encode set.
12791|    467|  size_t idx = ada::unicode::percent_encode_index(
12792|    467|      input, character_sets::C0_CONTROL_PERCENT_ENCODE);
12793|    467|  if (idx == input.size()) {
  ------------------
  |  Branch (12793:7): [True: 425, False: 42]
  ------------------
12794|    425|    update_base_hostname(input);
12795|    425|  } else {
12796|       |    // We only create a temporary string if we need to.
12797|     42|    update_base_hostname(ada::unicode::percent_encode(
12798|     42|        input, character_sets::C0_CONTROL_PERCENT_ENCODE, idx));
12799|     42|  }
12800|    467|  ADA_ASSERT_TRUE(validate());
12801|    467|  return true;
12802|    500|}
simple_absolute.cc:_ZZN3ada4idna22utf32_length_from_utf8EPKcmENK3$_0clEa:
  284|   267k|  return std::count_if(p, std::next(p, len), [](int8_t c) {
  285|       |    // -65 is 0b10111111, anything larger in two-complement's
  286|       |    // should start a new code point.
  287|   267k|    return c > -65;
  288|   267k|  });
_ZN3ada4idna7deflate22make_fixed_litlen_huffEv:
  490|      2|inline Huff make_fixed_litlen_huff() {
  491|      2|  Huff h;
  492|      2|  uint8_t lens[288];
  493|       |  // Fixed Huffman: 0-143:8, 144-255:9, 256-279:7, 280-287:8
  494|    290|  for (int i = 0; i <= 143; i++) lens[i] = 8;
  ------------------
  |  Branch (494:19): [True: 288, False: 2]
  ------------------
  495|    226|  for (int i = 144; i <= 255; i++) lens[i] = 9;
  ------------------
  |  Branch (495:21): [True: 224, False: 2]
  ------------------
  496|     50|  for (int i = 256; i <= 279; i++) lens[i] = 7;
  ------------------
  |  Branch (496:21): [True: 48, False: 2]
  ------------------
  497|     18|  for (int i = 280; i <= 287; i++) lens[i] = 8;
  ------------------
  |  Branch (497:21): [True: 16, False: 2]
  ------------------
  498|      2|  h.build(lens, 288);
  499|      2|  return h;
  500|      2|}
_ZN3ada4idna7deflate4Huff5buildEPKhi:
  439|     16|  bool build(const uint8_t* lens, int n) {
  440|     16|    std::memset(counts, 0, sizeof(counts));
  441|     16|    std::memset(first_code, 0, sizeof(first_code));
  442|     16|    std::memset(base_idx, 0, sizeof(base_idx));
  443|     16|    nsymbols = n;
  444|     16|    max_bits = 0;
  445|  1.98k|    for (int i = 0; i < n; i++) {
  ------------------
  |  Branch (445:21): [True: 1.96k, False: 16]
  ------------------
  446|  1.96k|      lengths[i] = lens[i];
  447|  1.96k|      if (lens[i]) {
  ------------------
  |  Branch (447:11): [True: 1.91k, False: 49]
  ------------------
  448|  1.91k|        counts[lens[i]]++;
  449|  1.91k|        if (lens[i] > max_bits) max_bits = lens[i];
  ------------------
  |  Branch (449:13): [True: 46, False: 1.87k]
  ------------------
  450|  1.91k|      }
  451|  1.96k|    }
  452|       |    // Canonical first code for each bit length (RFC 1951).
  453|     16|    int code = 0;
  454|    256|    for (int bits = 1; bits <= MAXBITS; bits++) {
  ------------------
  |  Branch (454:24): [True: 240, False: 16]
  ------------------
  455|    240|      code = (code + counts[bits - 1]) << 1;
  456|    240|      first_code[bits] = code;
  457|    240|    }
  458|     16|    int idx = 0;
  459|    158|    for (int bits = 1; bits <= max_bits; bits++) {
  ------------------
  |  Branch (459:24): [True: 142, False: 16]
  ------------------
  460|    142|      base_idx[bits] = idx;
  461|       |      // assign symbols in symbol order for codes of this length
  462|  21.6k|      for (int sym = 0; sym < n; sym++) {
  ------------------
  |  Branch (462:25): [True: 21.5k, False: 142]
  ------------------
  463|  21.5k|        if (lengths[sym] == bits) {
  ------------------
  |  Branch (463:13): [True: 1.91k, False: 19.6k]
  ------------------
  464|  1.91k|          symbols[idx++] = static_cast<int16_t>(sym);
  465|  1.91k|        }
  466|  21.5k|      }
  467|    142|    }
  468|     16|    return true;
  469|     16|  }
_ZN3ada4idna7deflate20make_fixed_dist_huffEv:
  502|      2|inline Huff make_fixed_dist_huff() {
  503|      2|  Huff h;
  504|      2|  uint8_t lens[32];
  505|     66|  for (int i = 0; i < 32; i++) lens[i] = 5;
  ------------------
  |  Branch (505:19): [True: 64, False: 2]
  ------------------
  506|      2|  h.build(lens, 32);
  507|      2|  return h;
  508|      2|}
simple_absolute.cc:_ZZN3ada4idna9ascii_mapEPcmENK3$_0clEh:
 5134|   268k|  auto broadcast = [](uint8_t v) -> uint64_t {
 5135|   268k|    return 0x101010101010101ull * v;
 5136|   268k|  };
_ZN3ada4idna13ensure_tablesEv:
 4885|  36.5k|[[nodiscard]] inline bool ensure_tables() noexcept {
 4886|  36.5k|  uint8_t state = tables_init_state.load(std::memory_order_acquire);
 4887|  36.5k|  if (state == kTablesReady) {
  ------------------
  |  Branch (4887:7): [True: 36.5k, False: 1]
  ------------------
 4888|  36.5k|    return true;
 4889|  36.5k|  }
 4890|      1|  if (state == kTablesFailed) {
  ------------------
  |  Branch (4890:7): [True: 0, False: 1]
  ------------------
 4891|      0|    return false;
 4892|      0|  }
 4893|       |
 4894|      1|  uint8_t expected = kTablesUninit;
 4895|      1|  if (tables_init_state.compare_exchange_strong(expected, kTablesInProgress,
  ------------------
  |  Branch (4895:7): [True: 1, False: 0]
  ------------------
 4896|      1|                                                std::memory_order_acq_rel,
 4897|      1|                                                std::memory_order_acquire)) {
 4898|      1|    uint8_t* buffer = new (std::nothrow) uint8_t[table_blob::uncompressed_size];
 4899|      1|    if (buffer == nullptr) {
  ------------------
  |  Branch (4899:9): [True: 0, False: 1]
  ------------------
 4900|      0|      tables_init_state.store(kTablesFailed, std::memory_order_release);
 4901|      0|      return false;
 4902|      0|    }
 4903|       |
 4904|      1|    const size_t n = deflate::inflate_raw(table_blob::compressed,
 4905|      1|                                          table_blob::compressed_size, buffer,
 4906|      1|                                          table_blob::uncompressed_size);
 4907|      1|    if (n != table_blob::uncompressed_size ||
  ------------------
  |  Branch (4907:9): [True: 0, False: 1]
  ------------------
 4908|      1|        crc32_ieee(buffer, n) != table_blob::uncompressed_crc32) {
  ------------------
  |  Branch (4908:9): [True: 0, False: 1]
  ------------------
 4909|      0|      delete[] buffer;
 4910|      0|      tables_init_state.store(kTablesFailed, std::memory_order_release);
 4911|      0|      return false;
 4912|      0|    }
 4913|       |
 4914|       |    // LE payload verified; convert multi-byte fields for big-endian hosts.
 4915|      1|    detail::convert_table_blob_to_host_endian(buffer);
 4916|       |
 4917|      1|    auto at = [&](size_t off) noexcept -> const uint8_t* {
 4918|      1|      return buffer + off;
 4919|      1|    };
 4920|       |
 4921|       |    // Publish all non-atomic pointers before READY. Waiters synchronize via
 4922|       |    // acquire on tables_init_state and then observe these writes.
 4923|      1|    idna_stage1 =
 4924|      1|        reinterpret_cast<const uint16_t*>(at(table_blob::off_idna_stage1));
 4925|      1|    idna_stage2 =
 4926|      1|        reinterpret_cast<const uint16_t*>(at(table_blob::off_idna_stage2));
 4927|      1|    idna_bool_blocks =
 4928|      1|        reinterpret_cast<const uint64_t*>(at(table_blob::off_idna_bool_blocks));
 4929|      1|    idna_utf8_mappings = at(table_blob::off_idna_utf8_mappings);
 4930|       |
 4931|      1|    decomposition_index = at(table_blob::off_decomposition_index);
 4932|      1|    decomposition_block_flat = reinterpret_cast<const uint16_t*>(
 4933|      1|        at(table_blob::off_decomposition_block));
 4934|      1|    decomposition_data = reinterpret_cast<const char32_t*>(
 4935|      1|        at(table_blob::off_decomposition_data));
 4936|      1|    ccc_index = at(table_blob::off_ccc_index);
 4937|      1|    ccc_block_flat = at(table_blob::off_ccc_block);
 4938|      1|    composition_index = at(table_blob::off_composition_index);
 4939|      1|    composition_block_flat = reinterpret_cast<const uint16_t*>(
 4940|      1|        at(table_blob::off_composition_block));
 4941|      1|    composition_data =
 4942|      1|        reinterpret_cast<const char32_t*>(at(table_blob::off_composition_data));
 4943|       |
 4944|      1|    id_continue =
 4945|      1|        reinterpret_cast<range_pair_ptr>(at(table_blob::off_id_continue_flat));
 4946|      1|    id_start =
 4947|      1|        reinterpret_cast<range_pair_ptr>(at(table_blob::off_id_start_flat));
 4948|       |
 4949|      1|    dir_start =
 4950|      1|        reinterpret_cast<const uint32_t*>(at(table_blob::off_dir_start));
 4951|      1|    dir_final =
 4952|      1|        reinterpret_cast<const uint32_t*>(at(table_blob::off_dir_final));
 4953|      1|    dir_value = at(table_blob::off_dir_value);
 4954|      1|    combining_ranges =
 4955|      1|        reinterpret_cast<range_pair_ptr>(at(table_blob::off_combining_flat));
 4956|       |
 4957|      1|    tables_buffer = buffer;
 4958|      1|    tables_init_state.store(kTablesReady, std::memory_order_release);
 4959|      1|    return true;
 4960|      1|  }
 4961|       |
 4962|       |  // Another thread owns init (or finished between our loads).
 4963|      0|  for (uint64_t spins = 0; spins < kTablesSpinLimit; ++spins) {
  ------------------
  |  Branch (4963:28): [True: 0, False: 0]
  ------------------
 4964|      0|    state = tables_init_state.load(std::memory_order_acquire);
 4965|      0|    if (state == kTablesReady) {
  ------------------
  |  Branch (4965:9): [True: 0, False: 0]
  ------------------
 4966|      0|      return true;
 4967|      0|    }
 4968|      0|    if (state == kTablesFailed) {
  ------------------
  |  Branch (4968:9): [True: 0, False: 0]
  ------------------
 4969|      0|      return false;
 4970|      0|    }
 4971|      0|#if defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || \
 4972|      0|    defined(_M_IX86)
 4973|      0|#if defined(__GNUC__) || defined(__clang__)
 4974|      0|    __builtin_ia32_pause();
 4975|      0|#endif
 4976|       |#elif defined(__aarch64__) || defined(_M_ARM64)
 4977|       |#if defined(__GNUC__) || defined(__clang__)
 4978|       |    asm volatile("yield" ::: "memory");
 4979|       |#endif
 4980|       |#endif
 4981|      0|  }
 4982|       |  // Timed out waiting for a peer - treat as failure rather than hang.
 4983|      0|  return false;
 4984|      0|}
_ZN3ada4idna7deflate11inflate_rawEPKhmPhm:
  535|      1|                          size_t dst_cap) {
  536|      1|  BitReader br(src, src_len);
  537|      1|  size_t out = 0;
  538|      4|  for (;;) {
  539|      4|    uint32_t bfinal = br.get(1);
  540|      4|    uint32_t btype = br.get(2);
  541|      4|    if (bfinal == UINT32_MAX || btype == UINT32_MAX) return 0;
  ------------------
  |  Branch (541:9): [True: 0, False: 4]
  |  Branch (541:33): [True: 0, False: 4]
  ------------------
  542|      4|    if (btype == 0) {
  ------------------
  |  Branch (542:9): [True: 0, False: 4]
  ------------------
  543|       |      // stored
  544|      0|      br.align_byte();
  545|      0|      if (!br.ensure(16)) return 0;
  ------------------
  |  Branch (545:11): [True: 0, False: 0]
  ------------------
  546|       |      // read 16+16 from bit buffer awkwardly - use byte path
  547|       |      // Align: bits is multiple of 8
  548|       |      // Get len from remaining bits then bytes
  549|      0|      uint32_t len = br.get(16);
  550|      0|      uint32_t nlen = br.get(16);
  551|      0|      if (len == UINT32_MAX || nlen == UINT32_MAX) return 0;
  ------------------
  |  Branch (551:11): [True: 0, False: 0]
  |  Branch (551:32): [True: 0, False: 0]
  ------------------
  552|      0|      if ((len ^ 0xFFFF) != nlen) return 0;
  ------------------
  |  Branch (552:11): [True: 0, False: 0]
  ------------------
  553|       |      // After get, may have bits in acc from previous - for stored, should be
  554|       |      // byte aligned Copy len bytes from p
  555|      0|      if (br.bits != 0) {
  ------------------
  |  Branch (555:11): [True: 0, False: 0]
  ------------------
  556|       |        // leftover bits should be 0 if aligned
  557|      0|      }
  558|      0|      if (size_t(br.end - br.p) < len) return 0;
  ------------------
  |  Branch (558:11): [True: 0, False: 0]
  ------------------
  559|      0|      if (out + len > dst_cap) return 0;
  ------------------
  |  Branch (559:11): [True: 0, False: 0]
  ------------------
  560|      0|      std::memcpy(dst + out, br.p, len);
  561|      0|      br.p += len;
  562|      0|      out += len;
  563|      4|    } else if (btype == 1 || btype == 2) {
  ------------------
  |  Branch (563:16): [True: 0, False: 4]
  |  Branch (563:30): [True: 4, False: 0]
  ------------------
  564|      4|      Huff lit, dist;
  565|      4|      if (btype == 1) {
  ------------------
  |  Branch (565:11): [True: 0, False: 4]
  ------------------
  566|       |        // use fixed via functions
  567|      4|      } else {
  568|       |        // dynamic
  569|      4|        uint32_t hlit = br.get(5);
  570|      4|        if (hlit == UINT32_MAX) return 0;
  ------------------
  |  Branch (570:13): [True: 0, False: 4]
  ------------------
  571|      4|        hlit += 257;
  572|      4|        uint32_t hdist = br.get(5);
  573|      4|        if (hdist == UINT32_MAX) return 0;
  ------------------
  |  Branch (573:13): [True: 0, False: 4]
  ------------------
  574|      4|        hdist += 1;
  575|      4|        uint32_t hclen = br.get(4);
  576|      4|        if (hclen == UINT32_MAX) return 0;
  ------------------
  |  Branch (576:13): [True: 0, False: 4]
  ------------------
  577|      4|        hclen += 4;
  578|      4|        static const int order[19] = {16, 17, 18, 0, 8,  7, 9,  6, 10, 5,
  579|      4|                                      11, 4,  12, 3, 13, 2, 14, 1, 15};
  580|      4|        uint8_t clen[19]{};
  581|     69|        for (uint32_t i = 0; i < hclen; i++) {
  ------------------
  |  Branch (581:30): [True: 65, False: 4]
  ------------------
  582|     65|          uint32_t v = br.get(3);
  583|     65|          if (v == UINT32_MAX) return 0;
  ------------------
  |  Branch (583:15): [True: 0, False: 65]
  ------------------
  584|     65|          clen[order[i]] = uint8_t(v);
  585|     65|        }
  586|      4|        Huff cl;
  587|      4|        if (!cl.build(clen, 19)) return 0;
  ------------------
  |  Branch (587:13): [True: 0, False: 4]
  ------------------
  588|      4|        uint8_t lens[288 + 32]{};
  589|      4|        uint32_t n = hlit + hdist;
  590|  1.09k|        for (uint32_t i = 0; i < n;) {
  ------------------
  |  Branch (590:30): [True: 1.08k, False: 4]
  ------------------
  591|  1.08k|          int sym = cl.decode(br);
  592|  1.08k|          if (sym < 0) return 0;
  ------------------
  |  Branch (592:15): [True: 0, False: 1.08k]
  ------------------
  593|  1.08k|          if (sym < 16) {
  ------------------
  |  Branch (593:15): [True: 1.03k, False: 49]
  ------------------
  594|  1.03k|            lens[i++] = uint8_t(sym);
  595|  1.03k|          } else if (sym == 16) {
  ------------------
  |  Branch (595:22): [True: 49, False: 0]
  ------------------
  596|     49|            uint32_t rep = br.get(2);
  597|     49|            if (rep == UINT32_MAX) return 0;
  ------------------
  |  Branch (597:17): [True: 0, False: 49]
  ------------------
  598|     49|            rep += 3;
  599|     49|            if (i == 0) return 0;
  ------------------
  |  Branch (599:17): [True: 0, False: 49]
  ------------------
  600|     49|            uint8_t v = lens[i - 1];
  601|    263|            while (rep--) lens[i++] = v;
  ------------------
  |  Branch (601:20): [True: 214, False: 49]
  ------------------
  602|     49|          } else if (sym == 17) {
  ------------------
  |  Branch (602:22): [True: 0, False: 0]
  ------------------
  603|      0|            uint32_t rep = br.get(3);
  604|      0|            if (rep == UINT32_MAX) return 0;
  ------------------
  |  Branch (604:17): [True: 0, False: 0]
  ------------------
  605|      0|            rep += 3;
  606|      0|            while (rep--) lens[i++] = 0;
  ------------------
  |  Branch (606:20): [True: 0, False: 0]
  ------------------
  607|      0|          } else if (sym == 18) {
  ------------------
  |  Branch (607:22): [True: 0, False: 0]
  ------------------
  608|      0|            uint32_t rep = br.get(7);
  609|      0|            if (rep == UINT32_MAX) return 0;
  ------------------
  |  Branch (609:17): [True: 0, False: 0]
  ------------------
  610|      0|            rep += 11;
  611|      0|            while (rep--) lens[i++] = 0;
  ------------------
  |  Branch (611:20): [True: 0, False: 0]
  ------------------
  612|      0|          } else
  613|      0|            return 0;
  614|  1.08k|        }
  615|      4|        if (!lit.build(lens, int(hlit))) return 0;
  ------------------
  |  Branch (615:13): [True: 0, False: 4]
  ------------------
  616|      4|        if (!dist.build(lens + hlit, int(hdist))) return 0;
  ------------------
  |  Branch (616:13): [True: 0, False: 4]
  ------------------
  617|      4|      }
  618|  52.2k|      for (;;) {
  619|  52.2k|        int sym;
  620|  52.2k|        if (btype == 1)
  ------------------
  |  Branch (620:13): [True: 0, False: 52.2k]
  ------------------
  621|      0|          sym = fixed_litlen(br);
  622|  52.2k|        else
  623|  52.2k|          sym = lit.decode(br);
  624|  52.2k|        if (sym < 0) return 0;
  ------------------
  |  Branch (624:13): [True: 0, False: 52.2k]
  ------------------
  625|  52.2k|        if (sym < 256) {
  ------------------
  |  Branch (625:13): [True: 37.2k, False: 14.9k]
  ------------------
  626|  37.2k|          if (out >= dst_cap) return 0;
  ------------------
  |  Branch (626:15): [True: 0, False: 37.2k]
  ------------------
  627|  37.2k|          dst[out++] = uint8_t(sym);
  628|  37.2k|        } else if (sym == 256) {
  ------------------
  |  Branch (628:20): [True: 4, False: 14.9k]
  ------------------
  629|      4|          break;
  630|  14.9k|        } else {
  631|  14.9k|          int len_code = sym - 257;
  632|  14.9k|          if (len_code < 0 || len_code > 28) return 0;
  ------------------
  |  Branch (632:15): [True: 0, False: 14.9k]
  |  Branch (632:31): [True: 0, False: 14.9k]
  ------------------
  633|  14.9k|          uint32_t extra = br.get(len_extra[len_code]);
  634|  14.9k|          if (len_extra[len_code] && extra == UINT32_MAX) return 0;
  ------------------
  |  Branch (634:15): [True: 2.03k, False: 12.9k]
  |  Branch (634:38): [True: 0, False: 2.03k]
  ------------------
  635|  14.9k|          uint32_t length =
  636|  14.9k|              len_base[len_code] + (len_extra[len_code] ? extra : 0);
  ------------------
  |  Branch (636:37): [True: 2.03k, False: 12.9k]
  ------------------
  637|  14.9k|          int dsym;
  638|  14.9k|          if (btype == 1)
  ------------------
  |  Branch (638:15): [True: 0, False: 14.9k]
  ------------------
  639|      0|            dsym = fixed_dist(br);
  640|  14.9k|          else
  641|  14.9k|            dsym = dist.decode(br);
  642|  14.9k|          if (dsym < 0 || dsym > 29) return 0;
  ------------------
  |  Branch (642:15): [True: 0, False: 14.9k]
  |  Branch (642:27): [True: 0, False: 14.9k]
  ------------------
  643|  14.9k|          uint32_t dextra = br.get(dist_extra[dsym]);
  644|  14.9k|          if (dist_extra[dsym] && dextra == UINT32_MAX) return 0;
  ------------------
  |  Branch (644:15): [True: 9.97k, False: 5.01k]
  |  Branch (644:35): [True: 0, False: 9.97k]
  ------------------
  645|  14.9k|          uint32_t distance = dist_base[dsym] + (dist_extra[dsym] ? dextra : 0);
  ------------------
  |  Branch (645:50): [True: 9.97k, False: 5.01k]
  ------------------
  646|  14.9k|          if (distance > out || out + length > dst_cap) return 0;
  ------------------
  |  Branch (646:15): [True: 0, False: 14.9k]
  |  Branch (646:33): [True: 0, False: 14.9k]
  ------------------
  647|   202k|          for (uint32_t k = 0; k < length; k++) {
  ------------------
  |  Branch (647:32): [True: 187k, False: 14.9k]
  ------------------
  648|   187k|            dst[out] = dst[out - distance];
  649|   187k|            out++;
  650|   187k|          }
  651|  14.9k|        }
  652|  52.2k|      }
  653|      4|    } else {
  654|      0|      return 0;  // reserved
  655|      0|    }
  656|      4|    if (bfinal) break;
  ------------------
  |  Branch (656:9): [True: 1, False: 3]
  ------------------
  657|      4|  }
  658|      1|  return out;
  659|      1|}
_ZN3ada4idna7deflate9BitReaderC2EPKhm:
  402|      1|      : p(data), end(data + len) {}
_ZN3ada4idna7deflate9BitReader3getEi:
  412|   457k|  uint32_t get(int n) {
  413|   457k|    if (!ensure(n)) return UINT32_MAX;
  ------------------
  |  Branch (413:9): [True: 0, False: 457k]
  ------------------
  414|   457k|    uint32_t v = acc & ((1u << n) - 1);
  415|   457k|    acc >>= n;
  416|   457k|    bits -= n;
  417|   457k|    return v;
  418|   457k|  }
_ZN3ada4idna7deflate9BitReader6ensureEi:
  404|   457k|  bool ensure(int n) {
  405|   520k|    while (bits < n) {
  ------------------
  |  Branch (405:12): [True: 62.3k, False: 457k]
  ------------------
  406|  62.3k|      if (p >= end) return false;
  ------------------
  |  Branch (406:11): [True: 0, False: 62.3k]
  ------------------
  407|  62.3k|      acc |= uint32_t(*p++) << bits;
  408|  62.3k|      bits += 8;
  409|  62.3k|    }
  410|   457k|    return true;
  411|   457k|  }
_ZNK3ada4idna7deflate4Huff6decodeERNS1_9BitReaderE:
  471|  68.3k|  int decode(BitReader& br) const {
  472|  68.3k|    if (max_bits == 0) return -1;
  ------------------
  |  Branch (472:9): [True: 0, False: 68.3k]
  ------------------
  473|  68.3k|    int code = 0;
  474|   427k|    for (int len = 1; len <= max_bits; len++) {
  ------------------
  |  Branch (474:23): [True: 427k, False: 0]
  ------------------
  475|   427k|      uint32_t b = br.get(1);
  476|   427k|      if (b == UINT32_MAX) return -1;
  ------------------
  |  Branch (476:11): [True: 0, False: 427k]
  ------------------
  477|   427k|      code = (code << 1) | int(b);
  478|   427k|      int first = first_code[len];
  479|   427k|      int cnt = counts[len];
  480|   427k|      if (cnt && code - first < cnt) {
  ------------------
  |  Branch (480:11): [True: 263k, False: 164k]
  |  Branch (480:18): [True: 68.3k, False: 195k]
  ------------------
  481|  68.3k|        return symbols[base_idx[len] + (code - first)];
  482|  68.3k|      }
  483|   427k|    }
  484|      0|    return -1;
  485|  68.3k|  }
_ZN3ada4idna10crc32_ieeeEPKhm:
 4868|      1|                                         size_t len) noexcept {
 4869|      1|  uint32_t c = 0xFFFFFFFFu;
 4870|   224k|  for (size_t i = 0; i < len; ++i) {
  ------------------
  |  Branch (4870:22): [True: 224k, False: 1]
  ------------------
 4871|   224k|    c ^= data[i];
 4872|  2.02M|    for (int k = 0; k < 8; ++k) {
  ------------------
  |  Branch (4872:21): [True: 1.79M, False: 224k]
  ------------------
 4873|  1.79M|      const uint32_t mask = 0u - (c & 1u);
 4874|  1.79M|      c = (c >> 1) ^ (0xEDB88320u & mask);
 4875|  1.79M|    }
 4876|   224k|  }
 4877|      1|  return ~c;
 4878|      1|}
_ZN3ada4idna6detail33convert_table_blob_to_host_endianEPh:
 4691|      1|inline void convert_table_blob_to_host_endian(uint8_t* buffer) noexcept {
 4692|      1|  if constexpr (std::endian::native == std::endian::little) {
 4693|      1|    (void)buffer;
 4694|      1|    return;
 4695|      1|  }
 4696|      0|  auto u16 = [&](size_t off, size_t count) {
 4697|      1|    bswap_inplace(reinterpret_cast<uint16_t*>(buffer + off), count);
 4698|      1|  };
 4699|      1|  auto u32 = [&](size_t off, size_t count) {
 4700|      1|    bswap_inplace(reinterpret_cast<uint32_t*>(buffer + off), count);
 4701|      1|  };
 4702|      1|  auto u64 = [&](size_t off, size_t count) {
 4703|      1|    bswap_inplace(reinterpret_cast<uint64_t*>(buffer + off), count);
 4704|      1|  };
 4705|       |
 4706|      1|  u16(table_blob::off_idna_stage1, table_blob::count_idna_stage1);
 4707|      1|  u16(table_blob::off_idna_stage2, table_blob::count_idna_stage2);
 4708|      1|  u64(table_blob::off_idna_bool_blocks, table_blob::count_idna_bool_blocks);
 4709|      1|  u16(table_blob::off_decomposition_block,
 4710|      1|      table_blob::count_decomposition_block);
 4711|      1|  u32(table_blob::off_decomposition_data, table_blob::count_decomposition_data);
 4712|      1|  u16(table_blob::off_composition_block, table_blob::count_composition_block);
 4713|      1|  u32(table_blob::off_composition_data, table_blob::count_composition_data);
 4714|      1|  u32(table_blob::off_id_continue_flat, table_blob::count_id_continue_flat);
 4715|      1|  u32(table_blob::off_id_start_flat, table_blob::count_id_start_flat);
 4716|      1|  u32(table_blob::off_dir_start, table_blob::count_dir_start);
 4717|      1|  u32(table_blob::off_dir_final, table_blob::count_dir_final);
 4718|      1|  u32(table_blob::off_combining_flat, table_blob::count_combining_flat);
 4719|      1|}
_ZZN3ada4idna13ensure_tablesEvENKUlmE_clEm:
 4917|     18|    auto at = [&](size_t off) noexcept -> const uint8_t* {
 4918|     18|      return buffer + off;
 4919|     18|    };
simple_absolute.cc:_ZN3ada4idnaL11idna_lookupEj:
 5072|   390k|static uint16_t idna_lookup(uint32_t cp) noexcept {
 5073|   390k|  if (cp < IDNA_LOW_RANGE_END) {
  ------------------
  |  Branch (5073:7): [True: 388k, False: 2.26k]
  ------------------
 5074|   388k|    uint16_t ref = idna_stage1[cp >> IDNA_BLOCK_BITS];
 5075|   388k|    if (ref & IDNA_BOOL_FLAG) {
  ------------------
  |  Branch (5075:9): [True: 154k, False: 233k]
  ------------------
 5076|   154k|      uint32_t bit_idx =
 5077|   154k|          static_cast<uint32_t>(ref & ~IDNA_BOOL_FLAG) * IDNA_BLOCK_SIZE +
 5078|   154k|          (cp & IDNA_BLOCK_MASK);
 5079|   154k|      bool is_valid = (idna_bool_blocks[bit_idx >> 6] >> (bit_idx & 63u)) & 1u;
 5080|   154k|      return is_valid ? IDNA_VALID : IDNA_DISALLOWED;
  ------------------
  |  Branch (5080:14): [True: 154k, False: 22]
  ------------------
 5081|   154k|    }
 5082|   233k|    return idna_stage2[ref + (cp & IDNA_BLOCK_MASK)];
 5083|   388k|  }
 5084|       |
 5085|  2.26k|  if (cp >= IDNA_HIGH_IGNORED_START && cp < IDNA_HIGH_IGNORED_END) {
  ------------------
  |  Branch (5085:7): [True: 2.21k, False: 54]
  |  Branch (5085:40): [True: 1.96k, False: 244]
  ------------------
 5086|  1.96k|    return IDNA_IGNORED;
 5087|  1.96k|  }
 5088|       |
 5089|    298|  return IDNA_DISALLOWED;
 5090|  2.26k|}
simple_absolute.cc:_ZN3ada4idnaL21utf8_count_codepointsEPKh:
 5115|  64.0k|static size_t utf8_count_codepoints(const uint8_t* ptr) noexcept {
 5116|  64.0k|  size_t n = 0;
 5117|   424k|  while (*ptr != 0) {
  ------------------
  |  Branch (5117:10): [True: 360k, False: 64.0k]
  ------------------
 5118|   360k|    ++n;
 5119|   360k|    if (*ptr < 0x80u) {
  ------------------
  |  Branch (5119:9): [True: 105k, False: 254k]
  ------------------
 5120|   105k|      ++ptr;
 5121|   254k|    } else if (*ptr < 0xE0u) {
  ------------------
  |  Branch (5121:16): [True: 211k, False: 43.7k]
  ------------------
 5122|   211k|      ptr += 2;
 5123|   211k|    } else if (*ptr < 0xF0u) {
  ------------------
  |  Branch (5123:16): [True: 42.8k, False: 930]
  ------------------
 5124|  42.8k|      ptr += 3;
 5125|  42.8k|    } else {
 5126|    930|      ptr += 4;
 5127|    930|    }
 5128|   360k|  }
 5129|  64.0k|  return n;
 5130|  64.0k|}
simple_absolute.cc:_ZN3ada4idnaL9utf8_nextERPKh:
 5093|   360k|static char32_t utf8_next(const uint8_t*& ptr) noexcept {
 5094|   360k|  uint8_t b0 = *ptr++;
 5095|   360k|  if (b0 < 0x80u) return static_cast<char32_t>(b0);
  ------------------
  |  Branch (5095:7): [True: 105k, False: 254k]
  ------------------
 5096|   254k|  if (b0 < 0xE0u) {
  ------------------
  |  Branch (5096:7): [True: 211k, False: 43.7k]
  ------------------
 5097|   211k|    uint32_t cp = (b0 & 0x1Fu) << 6;
 5098|   211k|    cp |= (*ptr++ & 0x3Fu);
 5099|   211k|    return static_cast<char32_t>(cp);
 5100|   211k|  }
 5101|  43.7k|  if (b0 < 0xF0u) {
  ------------------
  |  Branch (5101:7): [True: 42.8k, False: 930]
  ------------------
 5102|  42.8k|    uint32_t cp = (b0 & 0x0Fu) << 12;
 5103|  42.8k|    cp |= ((*ptr++ & 0x3Fu) << 6);
 5104|  42.8k|    cp |= (*ptr++ & 0x3Fu);
 5105|  42.8k|    return static_cast<char32_t>(cp);
 5106|  42.8k|  }
 5107|    930|  uint32_t cp = (b0 & 0x07u) << 18;
 5108|    930|  cp |= ((*ptr++ & 0x3Fu) << 12);
 5109|    930|  cp |= ((*ptr++ & 0x3Fu) << 6);
 5110|    930|  cp |= (*ptr++ & 0x3Fu);
 5111|    930|  return static_cast<char32_t>(cp);
 5112|  43.7k|}
_ZN3ada4idna23decomposition_block_rowEh:
 4989|   606k|inline const uint16_t* decomposition_block_row(uint8_t bi) noexcept {
 4990|   606k|  if (bi >= kDecompBlockRows) {
  ------------------
  |  Branch (4990:7): [True: 0, False: 606k]
  ------------------
 4991|      0|    bi = 0;
 4992|      0|  }
 4993|   606k|  return decomposition_block_flat + static_cast<size_t>(bi) * kDecompBlockCols;
 4994|   606k|}
_ZN3ada4idna13ccc_block_rowEh:
 4996|  1.09M|inline const uint8_t* ccc_block_row(uint8_t bi) noexcept {
 4997|  1.09M|  if (bi >= kCccBlockRows) {
  ------------------
  |  Branch (4997:7): [True: 0, False: 1.09M]
  ------------------
 4998|      0|    bi = 0;
 4999|      0|  }
 5000|  1.09M|  return ccc_block_flat + static_cast<size_t>(bi) * kCccBlockCols;
 5001|  1.09M|}
_ZN3ada4idna16tables_are_readyEv:
 4880|  7.99k|[[nodiscard]] inline bool tables_are_ready() noexcept {
 4881|  7.99k|  return tables_init_state.load(std::memory_order_acquire) == kTablesReady;
 4882|  7.99k|}
simple_absolute.cc:_ZN3ada4idnaL23canonical_decomp_lengthEDi:
 5272|   498k|static size_t canonical_decomp_length(char32_t current_character) noexcept {
 5273|   498k|  if (current_character >= hangul_sbase &&
  ------------------
  |  Branch (5273:7): [True: 49.6k, False: 448k]
  ------------------
 5274|  49.6k|      current_character < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5274:7): [True: 45.6k, False: 4.01k]
  ------------------
 5275|       |    // Hangul precomposed syllables are NFC.
 5276|  45.6k|    return 0;
 5277|  45.6k|  }
 5278|   452k|  if (current_character >= 0x110000) {
  ------------------
  |  Branch (5278:7): [True: 0, False: 452k]
  ------------------
 5279|      0|    return 0;
 5280|      0|  }
 5281|   452k|  const uint8_t di = decomposition_index[current_character >> 8];
 5282|   452k|  const uint16_t* const decomposition =
 5283|   452k|      decomposition_block_row(di) + (current_character % 256);
 5284|   452k|  size_t decomposition_length =
 5285|   452k|      (decomposition[1] >> 2) - (decomposition[0] >> 2);
 5286|   452k|  if ((decomposition_length > 0) && (decomposition[0] & 1)) {
  ------------------
  |  Branch (5286:7): [True: 3.08k, False: 449k]
  |  Branch (5286:37): [True: 0, False: 3.08k]
  ------------------
 5287|      0|    decomposition_length = 0;  // compatibility-only: ignored for NFC
 5288|      0|  }
 5289|   452k|  return decomposition_length;
 5290|   452k|}
simple_absolute.cc:_ZN3ada4idnaL13would_composeENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5404|  7.58k|static bool would_compose(std::u32string_view input) noexcept {
 5405|   468k|  for (size_t input_count = 0; input_count < input.size();) {
  ------------------
  |  Branch (5405:32): [True: 462k, False: 5.19k]
  ------------------
 5406|   462k|    const char32_t current = input[input_count];
 5407|   462k|    if (current >= hangul_lbase && current < hangul_lbase + hangul_lcount) {
  ------------------
  |  Branch (5407:9): [True: 54.5k, False: 408k]
  |  Branch (5407:36): [True: 1.96k, False: 52.6k]
  ------------------
 5408|  1.96k|      if (input_count + 1 < input.size() &&
  ------------------
  |  Branch (5408:11): [True: 1.84k, False: 116]
  ------------------
 5409|  1.84k|          input[input_count + 1] >= hangul_vbase &&
  ------------------
  |  Branch (5409:11): [True: 916, False: 932]
  ------------------
 5410|    916|          input[input_count + 1] < hangul_vbase + hangul_vcount) {
  ------------------
  |  Branch (5410:11): [True: 180, False: 736]
  ------------------
 5411|    180|        return true;
 5412|    180|      }
 5413|  1.78k|      ++input_count;
 5414|  1.78k|      continue;
 5415|  1.96k|    }
 5416|   460k|    if (current >= hangul_sbase && current < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5416:9): [True: 44.0k, False: 416k]
  |  Branch (5416:36): [True: 42.4k, False: 1.65k]
  ------------------
 5417|  42.4k|      if ((current - hangul_sbase) % hangul_tcount &&
  ------------------
  |  Branch (5417:11): [True: 4.00k, False: 38.4k]
  ------------------
 5418|  4.00k|          input_count + 1 < input.size() &&
  ------------------
  |  Branch (5418:11): [True: 3.86k, False: 132]
  ------------------
 5419|  3.86k|          input[input_count + 1] > hangul_tbase &&
  ------------------
  |  Branch (5419:11): [True: 3.31k, False: 556]
  ------------------
 5420|  3.31k|          input[input_count + 1] < hangul_tbase + hangul_tcount) {
  ------------------
  |  Branch (5420:11): [True: 868, False: 2.44k]
  ------------------
 5421|    868|        return true;
 5422|    868|      }
 5423|  41.5k|      ++input_count;
 5424|  41.5k|      continue;
 5425|  42.4k|    }
 5426|   418k|    if (current < 0x110000) {
  ------------------
  |  Branch (5426:9): [True: 418k, False: 0]
  ------------------
 5427|   418k|      const uint16_t* composition =
 5428|   418k|          composition_block_row(composition_index[current >> 8]) +
 5429|   418k|          (current % 256);
 5430|   418k|      int32_t previous_ccc = -1;
 5431|   418k|      size_t j = input_count;
 5432|   421k|      for (; j + 1 < input.size(); ++j) {
  ------------------
  |  Branch (5432:14): [True: 416k, False: 4.93k]
  ------------------
 5433|   416k|        uint8_t ccc = get_ccc(input[j + 1]);
 5434|   416k|        if (composition[1] != composition[0] && previous_ccc < ccc) {
  ------------------
  |  Branch (5434:13): [True: 101k, False: 314k]
  |  Branch (5434:49): [True: 100k, False: 800]
  ------------------
 5435|   100k|          int left = composition[0];
 5436|   100k|          int right = composition[1];
 5437|   100k|          if (left < 0 || right < left ||
  ------------------
  |  Branch (5437:15): [True: 0, False: 100k]
  |  Branch (5437:27): [True: 0, False: 100k]
  ------------------
 5438|   100k|              static_cast<size_t>(right) > composition_data_size) {
  ------------------
  |  Branch (5438:15): [True: 0, False: 100k]
  ------------------
 5439|      0|            break;
 5440|      0|          }
 5441|   254k|          while (left + 2 < right) {
  ------------------
  |  Branch (5441:18): [True: 154k, False: 100k]
  ------------------
 5442|   154k|            int middle = left + (((right - left) >> 1) & ~1);
 5443|   154k|            if (composition_data[static_cast<size_t>(middle)] <= input[j + 1]) {
  ------------------
  |  Branch (5443:17): [True: 5.01k, False: 149k]
  ------------------
 5444|  5.01k|              left = middle;
 5445|  5.01k|            }
 5446|   154k|            if (composition_data[static_cast<size_t>(middle)] >= input[j + 1]) {
  ------------------
  |  Branch (5446:17): [True: 149k, False: 4.25k]
  ------------------
 5447|   149k|              right = middle;
 5448|   149k|            }
 5449|   154k|          }
 5450|   100k|          if (static_cast<size_t>(left + 1) < composition_data_size &&
  ------------------
  |  Branch (5450:15): [True: 100k, False: 0]
  ------------------
 5451|   100k|              composition_data[static_cast<size_t>(left)] == input[j + 1]) {
  ------------------
  |  Branch (5451:15): [True: 1.34k, False: 99.2k]
  ------------------
 5452|  1.34k|            return true;
 5453|  1.34k|          }
 5454|   100k|        }
 5455|   414k|        if (ccc == 0) {
  ------------------
  |  Branch (5455:13): [True: 412k, False: 2.65k]
  ------------------
 5456|   412k|          break;
 5457|   412k|        }
 5458|  2.65k|        previous_ccc = ccc;
 5459|  2.65k|      }
 5460|   417k|      input_count = j + 1;
 5461|   417k|      continue;
 5462|   418k|    }
 5463|      0|    ++input_count;
 5464|      0|  }
 5465|  5.19k|  return false;
 5466|  7.58k|}
_ZN3ada4idna21composition_block_rowEh:
 5003|   502k|inline const uint16_t* composition_block_row(uint8_t bi) noexcept {
 5004|   502k|  if (bi >= kCompBlockRows) {
  ------------------
  |  Branch (5004:7): [True: 0, False: 502k]
  ------------------
 5005|      0|    bi = 0;
 5006|      0|  }
 5007|   502k|  return composition_block_flat + static_cast<size_t>(bi) * kCompBlockCols;
 5008|   502k|}
simple_absolute.cc:_ZN3ada4idnaL19char_to_digit_valueEc:
 5632|  41.2k|static constexpr int32_t char_to_digit_value(char value) {
 5633|  41.2k|  if (value >= 'a' && value <= 'z') return value - 'a';
  ------------------
  |  Branch (5633:7): [True: 35.3k, False: 5.86k]
  |  Branch (5633:23): [True: 35.3k, False: 14]
  ------------------
 5634|  5.88k|  if (value >= '0' && value <= '9') return value - '0' + 26;
  ------------------
  |  Branch (5634:7): [True: 5.85k, False: 24]
  |  Branch (5634:23): [True: 5.84k, False: 18]
  ------------------
 5635|     42|  return -1;
 5636|  5.88k|}
simple_absolute.cc:_ZN3ada4idnaL5adaptEiib:
 5642|   192k|static constexpr int32_t adapt(int32_t d, int32_t n, bool firsttime) {
 5643|   192k|  if (firsttime) {
  ------------------
  |  Branch (5643:7): [True: 27.4k, False: 165k]
  ------------------
 5644|  27.4k|    d = d / damp;
 5645|   165k|  } else {
 5646|   165k|    d = d / 2;
 5647|   165k|  }
 5648|   192k|  d += d / n;
 5649|   192k|  int32_t k = 0;
 5650|   222k|  while (d > ((base - tmin) * tmax) / 2) {
  ------------------
  |  Branch (5650:10): [True: 29.6k, False: 192k]
  ------------------
 5651|  29.6k|    d /= base - tmin;
 5652|  29.6k|    k += base;
 5653|  29.6k|  }
 5654|   192k|  return k + (((base - tmin + 1) * d) / (d + skew));
 5655|   192k|}
simple_absolute.cc:_ZN3ada4idnaL13digit_to_charEi:
 5638|   306k|static constexpr char digit_to_char(int32_t digit) {
 5639|   306k|  return digit < 26 ? char(digit + 97) : char(digit + 22);
  ------------------
  |  Branch (5639:10): [True: 197k, False: 108k]
  ------------------
 5640|   306k|}
simple_absolute.cc:_ZZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEEENK3$_0clIA2_jEEDaRKT_:
 5977|   244k|      comb_span, label.front(), {}, [](const auto& range) { return range[1]; });
simple_absolute.cc:_ZZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEEENK3$_1clEj:
 6062|  2.52k|      auto is_l_or_d = [](uint32_t code) {
 6063|  2.52k|        return std::ranges::binary_search(L, code) ||
  ------------------
  |  Branch (6063:16): [True: 112, False: 2.41k]
  ------------------
 6064|  2.41k|               std::ranges::binary_search(D, code);
  ------------------
  |  Branch (6064:16): [True: 766, False: 1.64k]
  ------------------
 6065|  2.52k|      };
simple_absolute.cc:_ZZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEEENK3$_2clEj:
 6066|  2.33k|      auto is_r_or_d = [](uint32_t code) {
 6067|  2.33k|        return std::ranges::binary_search(R, code) ||
  ------------------
  |  Branch (6067:16): [True: 436, False: 1.90k]
  ------------------
 6068|  1.90k|               std::ranges::binary_search(D, code);
  ------------------
  |  Branch (6068:16): [True: 330, False: 1.57k]
  ------------------
 6069|  2.33k|      };
simple_absolute.cc:_ZN3ada4idnaL20find_last_not_of_nsmENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5924|  25.7k|    const std::u32string_view label) noexcept {
 5925|  26.5k|  for (int i = static_cast<int>(label.size() - 1); i >= 0; i--)
  ------------------
  |  Branch (5925:52): [True: 26.5k, False: 0]
  ------------------
 5926|  26.5k|    if (find_direction(label[i]) != direction::NSM) return i;
  ------------------
  |  Branch (5926:9): [True: 25.7k, False: 810]
  ------------------
 5927|       |
 5928|      0|  return std::u32string_view::npos;
 5929|  25.7k|}
simple_absolute.cc:_ZN3ada4idnaL12is_rtl_labelENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5933|  25.7k|inline static bool is_rtl_label(const std::u32string_view label) noexcept {
 5934|  25.7k|  const size_t mask =
 5935|  25.7k|      (1u << direction::R) | (1u << direction::AL) | (1u << direction::AN);
 5936|       |
 5937|  25.7k|  size_t directions = 0;
 5938|   166k|  for (size_t i = 0; i < label.size(); i++) {
  ------------------
  |  Branch (5938:22): [True: 141k, False: 25.7k]
  ------------------
 5939|   141k|    directions |= 1u << find_direction(label[i]);
 5940|   141k|  }
 5941|  25.7k|  return (directions & mask) != 0;
 5942|  25.7k|}
simple_absolute.cc:_ZN3ada4idnaL14find_directionEj:
 5905|   179k|inline static direction find_direction(uint32_t code_point) noexcept {
 5906|       |  // Binary search on dir_final (sorted upper bounds).
 5907|   179k|  size_t lo = 0, hi = dir_table_count;
 5908|  2.07M|  while (lo < hi) {
  ------------------
  |  Branch (5908:10): [True: 1.89M, False: 179k]
  ------------------
 5909|  1.89M|    size_t mid = lo + (hi - lo) / 2;
 5910|  1.89M|    if (dir_final[mid] < code_point) {
  ------------------
  |  Branch (5910:9): [True: 602k, False: 1.29M]
  ------------------
 5911|   602k|      lo = mid + 1;
 5912|  1.29M|    } else {
 5913|  1.29M|      hi = mid;
 5914|  1.29M|    }
 5915|  1.89M|  }
 5916|   179k|  if (lo == dir_table_count) {
  ------------------
  |  Branch (5916:7): [True: 0, False: 179k]
  ------------------
 5917|      0|    return direction::NONE;
 5918|      0|  }
 5919|   179k|  return code_point >= dir_start[lo] ? static_cast<direction>(dir_value[lo])
  ------------------
  |  Branch (5919:10): [True: 177k, False: 1.70k]
  ------------------
 5920|   179k|                                     : direction::NONE;
 5921|   179k|}
_ZN3ada4idna8is_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6290|  94.9k|bool constexpr is_ascii(std::string_view view) {
 6291|  1.64M|  for (uint8_t c : view) {
  ------------------
  |  Branch (6291:18): [True: 1.64M, False: 89.5k]
  ------------------
 6292|  1.64M|    if (c >= 0x80) {
  ------------------
  |  Branch (6292:9): [True: 5.35k, False: 1.63M]
  ------------------
 6293|  5.35k|      return false;
 6294|  5.35k|    }
 6295|  1.64M|  }
 6296|  89.5k|  return true;
 6297|  94.9k|}
simple_absolute.cc:_ZN3ada4idnaL19from_ascii_to_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEERNS1_12basic_stringIcS4_NS1_9allocatorIcEEEE:
 6327|  89.5k|static void from_ascii_to_ascii(std::string_view ut8_string, std::string& out) {
 6328|  89.5k|  out.assign(ut8_string);
 6329|  89.5k|  ascii_map(out.data(), out.size());
 6330|  89.5k|}
_ZN3ada4idna8is_asciiENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 6281|  37.1k|bool constexpr is_ascii(std::u32string_view view) {
 6282|   102k|  for (uint32_t c : view) {
  ------------------
  |  Branch (6282:19): [True: 102k, False: 2.29k]
  ------------------
 6283|   102k|    if (c >= 0x80) {
  ------------------
  |  Branch (6283:9): [True: 34.8k, False: 67.5k]
  ------------------
 6284|  34.8k|      return false;
 6285|  34.8k|    }
 6286|   102k|  }
 6287|  2.29k|  return true;
 6288|  37.1k|}
simple_absolute.cc:_ZN3ada4idnaL13is_ace_prefixENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 6343|  30.3k|static bool is_ace_prefix(std::u32string_view label) noexcept {
 6344|  30.3k|  return label.size() >= 4 && label[0] == U'x' && label[1] == U'n' &&
  ------------------
  |  Branch (6344:10): [True: 23.8k, False: 6.45k]
  |  Branch (6344:31): [True: 3.55k, False: 20.2k]
  |  Branch (6344:51): [True: 3.31k, False: 248]
  ------------------
 6345|  3.31k|         label[2] == U'-' && label[3] == U'-';
  ------------------
  |  Branch (6345:10): [True: 3.09k, False: 220]
  |  Branch (6345:30): [True: 2.88k, False: 210]
  ------------------
 6346|  30.3k|}
simple_absolute.cc:_ZN3ada4idnaL18append_ascii_labelERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIDiNS3_IDiEEEE:
 6333|  4.64k|static void append_ascii_label(std::string& out, std::u32string_view label) {
 6334|  4.64k|  const size_t old = out.size();
 6335|  4.64k|  out.resize(old + label.size());
 6336|  4.64k|  char* dest = out.data() + old;
 6337|  76.3k|  for (char32_t c : label) {
  ------------------
  |  Branch (6337:19): [True: 76.3k, False: 4.64k]
  ------------------
 6338|  76.3k|    *dest++ = static_cast<char>(c);
 6339|  76.3k|  }
 6340|  4.64k|}
_ZN3ada7unicode18is_ascii_hex_digitEc:
 7075|  7.05k|ada_really_inline constexpr bool is_ascii_hex_digit(const char c) noexcept {
 7076|  7.05k|  return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') ||
  ------------------
  |  Branch (7076:11): [True: 5.36k, False: 1.69k]
  |  Branch (7076:23): [True: 2.68k, False: 2.67k]
  |  Branch (7076:37): [True: 2.67k, False: 1.69k]
  |  Branch (7076:49): [True: 1.54k, False: 1.12k]
  ------------------
 7077|  2.82k|         (c >= 'a' && c <= 'f');
  ------------------
  |  Branch (7077:11): [True: 1.09k, False: 1.73k]
  |  Branch (7077:23): [True: 1.04k, False: 46]
  ------------------
 7078|  7.05k|}
_ZN3ada7unicode21convert_hex_to_binaryEc:
 7165|  4.46k|unsigned constexpr convert_hex_to_binary(const char c) noexcept {
 7166|  4.46k|  return hex_to_binary_table[c - '0'];
 7167|  4.46k|}
simple_absolute.cc:_ZZN3ada7unicode14percent_encodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKhENK3$_0clEc:
 7306|   807k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7307|   807k|    return character_sets::bit_at(character_set, c);
 7308|   807k|  });
_ZN3ada7unicode36contains_forbidden_domain_code_pointEPKcm:
 7002|   209k|    const char* input, size_t length) noexcept {
 7003|   209k|  size_t i = 0;
 7004|   209k|  uint8_t accumulator{};
 7005|  1.09M|  for (; i + 4 <= length; i += 4) {
  ------------------
  |  Branch (7005:10): [True: 883k, False: 209k]
  ------------------
 7006|   883k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i])];
 7007|   883k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i + 1])];
 7008|   883k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i + 2])];
 7009|   883k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i + 3])];
 7010|   883k|  }
 7011|   488k|  for (; i < length; i++) {
  ------------------
  |  Branch (7011:10): [True: 279k, False: 209k]
  ------------------
 7012|   279k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i])];
 7013|   279k|  }
 7014|   209k|  return accumulator;
 7015|   209k|}
simple_absolute.cc:_ZN3ada11serializers12_GLOBAL__N_113write_hex_u16EPct:
 7437|  1.56k|ada_really_inline char* write_hex_u16(char* p, uint16_t v) noexcept {
 7438|  1.56k|  static constexpr char kHex[] = "0123456789abcdef";
 7439|  1.56k|  if (v >= 0x1000) {
  ------------------
  |  Branch (7439:7): [True: 110, False: 1.45k]
  ------------------
 7440|    110|    *p++ = kHex[(v >> 12) & 0xf];
 7441|    110|    *p++ = kHex[(v >> 8) & 0xf];
 7442|    110|    *p++ = kHex[(v >> 4) & 0xf];
 7443|    110|    *p++ = kHex[v & 0xf];
 7444|  1.45k|  } else if (v >= 0x100) {
  ------------------
  |  Branch (7444:14): [True: 230, False: 1.22k]
  ------------------
 7445|    230|    *p++ = kHex[(v >> 8) & 0xf];
 7446|    230|    *p++ = kHex[(v >> 4) & 0xf];
 7447|    230|    *p++ = kHex[v & 0xf];
 7448|  1.22k|  } else if (v >= 0x10) {
  ------------------
  |  Branch (7448:14): [True: 194, False: 1.03k]
  ------------------
 7449|    194|    *p++ = kHex[(v >> 4) & 0xf];
 7450|    194|    *p++ = kHex[v & 0xf];
 7451|  1.03k|  } else {
 7452|  1.03k|    *p++ = kHex[v & 0xf];
 7453|  1.03k|  }
 7454|  1.56k|  return p;
 7455|  1.56k|}
simple_absolute.cc:_ZN3ada11serializers12_GLOBAL__N_18write_u8EPch:
 7423|  64.2k|ada_really_inline char* write_u8(char* p, uint8_t v) noexcept {
 7424|  64.2k|  if (v < 10) {
  ------------------
  |  Branch (7424:7): [True: 48.2k, False: 16.0k]
  ------------------
 7425|  48.2k|    *p++ = static_cast<char>('0' + v);
 7426|  48.2k|  } else if (v < 100) {
  ------------------
  |  Branch (7426:14): [True: 342, False: 15.7k]
  ------------------
 7427|    342|    std::memcpy(p, &digit_pairs[static_cast<size_t>(v) * 2], 2);
 7428|    342|    p += 2;
 7429|  15.7k|  } else {
 7430|  15.7k|    *p++ = static_cast<char>('0' + v / 100);
 7431|  15.7k|    std::memcpy(p, &digit_pairs[static_cast<size_t>(v % 100) * 2], 2);
 7432|  15.7k|    p += 2;
 7433|  15.7k|  }
 7434|  64.2k|  return p;
 7435|  64.2k|}
_ZN3ada7unicode19has_tabs_or_newlineENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6851|   312k|    std::string_view user_input) noexcept {
 6852|       |  // first check for short strings in which case we do it naively.
 6853|   312k|  if (user_input.size() < 16) {  // slow path
  ------------------
  |  Branch (6853:7): [True: 59.1k, False: 253k]
  ------------------
 6854|  59.1k|    return std::ranges::any_of(user_input, is_tabs_or_newline);
 6855|  59.1k|  }
 6856|       |  // fast path for long strings (expected to be common)
 6857|   253k|  size_t i = 0;
 6858|   253k|  const __m128i mask1 = _mm_set1_epi8('\r');
 6859|   253k|  const __m128i mask2 = _mm_set1_epi8('\n');
 6860|   253k|  const __m128i mask3 = _mm_set1_epi8('\t');
 6861|       |  // If we supported SSSE3, we could use the algorithm that we use for NEON.
 6862|   253k|  __m128i running{0};
 6863|   645k|  for (; i + 15 < user_input.size(); i += 16) {
  ------------------
  |  Branch (6863:10): [True: 391k, False: 253k]
  ------------------
 6864|   391k|    __m128i word = _mm_loadu_si128((const __m128i*)(user_input.data() + i));
 6865|   391k|    running = _mm_or_si128(
 6866|   391k|        _mm_or_si128(running, _mm_or_si128(_mm_cmpeq_epi8(word, mask1),
 6867|   391k|                                           _mm_cmpeq_epi8(word, mask2))),
 6868|   391k|        _mm_cmpeq_epi8(word, mask3));
 6869|   391k|  }
 6870|   253k|  if (i < user_input.size()) {
  ------------------
  |  Branch (6870:7): [True: 250k, False: 3.16k]
  ------------------
 6871|   250k|    __m128i word = _mm_loadu_si128(
 6872|   250k|        (const __m128i*)(user_input.data() + user_input.length() - 16));
 6873|   250k|    running = _mm_or_si128(
 6874|   250k|        _mm_or_si128(running, _mm_or_si128(_mm_cmpeq_epi8(word, mask1),
 6875|   250k|                                           _mm_cmpeq_epi8(word, mask2))),
 6876|   250k|        _mm_cmpeq_epi8(word, mask3));
 6877|   250k|  }
 6878|   253k|  return _mm_movemask_epi8(running) != 0;
 6879|   312k|}
_ZN3ada7unicode18is_tabs_or_newlineEc:
 6742|   818k|constexpr bool is_tabs_or_newline(char c) noexcept {
 6743|   818k|  return c == '\r' || c == '\n' || c == '\t';
  ------------------
  |  Branch (6743:10): [True: 10, False: 818k]
  |  Branch (6743:23): [True: 10, False: 818k]
  |  Branch (6743:36): [True: 10, False: 818k]
  ------------------
 6744|   818k|}
_ZN3ada7helpers27remove_ascii_tab_or_newlineERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 8174|    778|ada_really_inline void remove_ascii_tab_or_newline(std::string& input) {
 8175|       |  // if this ever becomes a performance issue, we could use an approach similar
 8176|       |  // to has_tabs_or_newline
 8177|    778|  std::erase_if(input, ada::unicode::is_ascii_tab_or_newline);
 8178|    778|}
_ZN3ada7unicode23is_ascii_tab_or_newlineEc:
 7096|  54.6k|    const char c) noexcept {
 7097|  54.6k|  return c == '\t' || c == '\n' || c == '\r';
  ------------------
  |  Branch (7097:10): [True: 1.55k, False: 53.1k]
  |  Branch (7097:23): [True: 1.20k, False: 51.9k]
  |  Branch (7097:36): [True: 1.32k, False: 50.6k]
  ------------------
 7098|  54.6k|}
_ZN3ada7unicode22is_c0_control_or_spaceEc:
 7091|   628k|ada_really_inline constexpr bool is_c0_control_or_space(const char c) noexcept {
 7092|   628k|  return (unsigned char)c <= ' ';
 7093|   628k|}
_ZN3ada7helpers19parse_prepared_pathENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEENS_6scheme4typeERNS1_12basic_stringIcS4_NS1_9allocatorIcEEEE:
 8871|   150k|                                           std::string& path) {
 8872|   150k|  ada_log("parse_prepared_path ", input);
 8873|   150k|  uint8_t accumulator = checkers::path_signature(input);
 8874|       |  // Let us first detect a trivial case.
 8875|       |  // If it is special, we check that we have no dot, no %,  no \ and no
 8876|       |  // character needing percent encoding. Otherwise, we check that we have no %,
 8877|       |  // no dot, and no character needing percent encoding.
 8878|   150k|  constexpr uint8_t need_encoding = 1;
 8879|   150k|  constexpr uint8_t backslash_char = 2;
 8880|   150k|  constexpr uint8_t dot_char = 4;
 8881|   150k|  constexpr uint8_t percent_char = 8;
 8882|   150k|  bool special = type != ada::scheme::NOT_SPECIAL;
 8883|   150k|  bool may_need_slow_file_handling = (type == ada::scheme::type::FILE &&
  ------------------
  |  Branch (8883:39): [True: 1.14k, False: 149k]
  ------------------
 8884|  1.14k|                                      checkers::is_windows_drive_letter(input));
  ------------------
  |  Branch (8884:39): [True: 40, False: 1.10k]
  ------------------
 8885|   150k|  bool trivial_path =
 8886|   150k|      (special ? (accumulator == 0)
  ------------------
  |  Branch (8886:7): [True: 130k, False: 20.4k]
  |  Branch (8886:8): [True: 150k, False: 624]
  ------------------
 8887|   150k|               : ((accumulator & (need_encoding | dot_char | percent_char)) ==
 8888|    624|                  0)) &&
 8889|   130k|      (!may_need_slow_file_handling);
  ------------------
  |  Branch (8889:7): [True: 130k, False: 13]
  ------------------
 8890|   150k|  if (accumulator == dot_char && !may_need_slow_file_handling) {
  ------------------
  |  Branch (8890:7): [True: 9.27k, False: 141k]
  |  Branch (8890:34): [True: 9.24k, False: 22]
  ------------------
 8891|       |    // '4' means that we have at least one dot, but nothing that requires
 8892|       |    // percent encoding or decoding. The only part that is not trivial is
 8893|       |    // that we may have single dots and double dots path segments.
 8894|       |    // If we have such segments, then we either have a path that begins
 8895|       |    // with '.' (easy to check), or we have the sequence './'.
 8896|       |    // Note: input cannot be empty, it must at least contain one character ('.')
 8897|       |    // Note: we know that '\' is not present.
 8898|  9.24k|    if (input[0] != '.') {
  ------------------
  |  Branch (8898:9): [True: 8.28k, False: 964]
  ------------------
 8899|  8.28k|      size_t slashdot = 0;
 8900|  8.28k|      bool dot_is_file = true;
 8901|  24.3k|      for (;;) {
 8902|  24.3k|        slashdot = input.find("/.", slashdot);
 8903|  24.3k|        if (slashdot == std::string_view::npos) {  // common case
  ------------------
  |  Branch (8903:13): [True: 8.28k, False: 16.0k]
  ------------------
 8904|  8.28k|          break;
 8905|  16.0k|        } else {  // uncommon
 8906|       |          // only three cases matter: /./, /.. or a final /
 8907|  16.0k|          slashdot += 2;
 8908|  16.0k|          dot_is_file &= !(slashdot == input.size() || input[slashdot] == '.' ||
  ------------------
  |  Branch (8908:28): [True: 20, False: 16.0k]
  |  Branch (8908:56): [True: 7.89k, False: 8.11k]
  ------------------
 8909|  8.11k|                           input[slashdot] == '/');
  ------------------
  |  Branch (8909:28): [True: 7.09k, False: 1.02k]
  ------------------
 8910|  16.0k|        }
 8911|  24.3k|      }
 8912|  8.28k|      trivial_path = dot_is_file;
 8913|  8.28k|    }
 8914|  9.24k|  }
 8915|   150k|  if (trivial_path) {
  ------------------
  |  Branch (8915:7): [True: 131k, False: 19.5k]
  ------------------
 8916|   131k|    ada_log("parse_path trivial");
 8917|   131k|    path += '/';
 8918|   131k|    path += input;
 8919|   131k|    return;
 8920|   131k|  }
 8921|       |  // We are going to need to look a bit at the path, but let us see if we can
 8922|       |  // ignore percent encoding *and* backslashes *and* percent characters.
 8923|       |  // Except for the trivial case, this is likely to capture 99% of paths out
 8924|       |  // there.
 8925|  19.5k|  bool fast_path =
 8926|  19.5k|      (special &&
  ------------------
  |  Branch (8926:8): [True: 19.1k, False: 346]
  ------------------
 8927|  19.1k|       (accumulator & (need_encoding | backslash_char | percent_char)) == 0) &&
  ------------------
  |  Branch (8927:8): [True: 8.24k, False: 10.9k]
  ------------------
 8928|  8.24k|      (type != ada::scheme::type::FILE);
  ------------------
  |  Branch (8928:7): [True: 8.15k, False: 99]
  ------------------
 8929|  19.5k|  if (fast_path) {
  ------------------
  |  Branch (8929:7): [True: 8.15k, False: 11.3k]
  ------------------
 8930|  8.15k|    ada_log("parse_prepared_path fast");
 8931|       |    // Here we don't need to worry about \ or percent encoding.
 8932|       |    // We also do not have a file protocol. We might have dots, however,
 8933|       |    // but dots must as appear as '.', and they cannot be encoded because
 8934|       |    // the symbol '%' is not present.
 8935|  8.15k|    size_t previous_location = 0;  // We start at 0.
 8936|  46.5k|    do {
 8937|  46.5k|      size_t new_location = input.find('/', previous_location);
 8938|       |      // std::string_view path_view = input;
 8939|       |      //  We process the last segment separately:
 8940|  46.5k|      if (new_location == std::string_view::npos) {
  ------------------
  |  Branch (8940:11): [True: 8.15k, False: 38.3k]
  ------------------
 8941|  8.15k|        std::string_view path_view = input.substr(previous_location);
 8942|  8.15k|        if (path_view == "..") {  // The path ends with ..
  ------------------
  |  Branch (8942:13): [True: 37, False: 8.11k]
  ------------------
 8943|       |          // e.g., if you receive ".." with an empty path, you go to "/".
 8944|     37|          if (path.empty()) {
  ------------------
  |  Branch (8944:15): [True: 5, False: 32]
  ------------------
 8945|      5|            path = '/';
 8946|      5|            return;
 8947|      5|          }
 8948|       |          // Fast case where we have nothing to do:
 8949|     32|          if (path.back() == '/') {
  ------------------
  |  Branch (8949:15): [True: 9, False: 23]
  ------------------
 8950|      9|            return;
 8951|      9|          }
 8952|       |          // If you have the path "/joe/myfriend",
 8953|       |          // then you delete 'myfriend'.
 8954|     23|          path.resize(path.rfind('/') + 1);
 8955|     23|          return;
 8956|     32|        }
 8957|  8.11k|        path += '/';
 8958|  8.11k|        if (path_view != ".") {
  ------------------
  |  Branch (8958:13): [True: 8.08k, False: 29]
  ------------------
 8959|  8.08k|          path.append(path_view);
 8960|  8.08k|        }
 8961|  8.11k|        return;
 8962|  38.3k|      } else {
 8963|       |        // This is a non-final segment.
 8964|  38.3k|        std::string_view path_view =
 8965|  38.3k|            input.substr(previous_location, new_location - previous_location);
 8966|  38.3k|        previous_location = new_location + 1;
 8967|  38.3k|        if (path_view == "..") {
  ------------------
  |  Branch (8967:13): [True: 8.19k, False: 30.2k]
  ------------------
 8968|  8.19k|          size_t last_delimiter = path.rfind('/');
 8969|  8.19k|          if (last_delimiter != std::string::npos) {
  ------------------
  |  Branch (8969:15): [True: 7.29k, False: 894]
  ------------------
 8970|  7.29k|            path.erase(last_delimiter);
 8971|  7.29k|          }
 8972|  30.2k|        } else if (path_view != ".") {
  ------------------
  |  Branch (8972:20): [True: 22.7k, False: 7.47k]
  ------------------
 8973|  22.7k|          path += '/';
 8974|  22.7k|          path.append(path_view);
 8975|  22.7k|        }
 8976|  38.3k|      }
 8977|  46.5k|    } while (true);
  ------------------
  |  Branch (8977:14): [True: 38.3k, Folded]
  ------------------
 8978|  11.3k|  } else {
 8979|  11.3k|    ada_log("parse_path slow");
 8980|       |    // we have reached the general case
 8981|  11.3k|    bool needs_percent_encoding = (accumulator & 1);
 8982|  11.3k|    std::string path_buffer_tmp;
 8983|  32.0k|    do {
 8984|  32.0k|      size_t location = (special && (accumulator & 2))
  ------------------
  |  Branch (8984:26): [True: 30.4k, False: 1.60k]
  |  Branch (8984:37): [True: 2.21k, False: 28.2k]
  ------------------
 8985|  32.0k|                            ? input.find_first_of("/\\")
 8986|  32.0k|                            : input.find('/');
 8987|  32.0k|      std::string_view path_view = input;
 8988|  32.0k|      if (location != std::string_view::npos) {
  ------------------
  |  Branch (8988:11): [True: 20.6k, False: 11.3k]
  ------------------
 8989|  20.6k|        path_view.remove_suffix(path_view.size() - location);
 8990|  20.6k|        input.remove_prefix(location + 1);
 8991|  20.6k|      }
 8992|       |      // path_buffer is either path_view or it might point at a percent encoded
 8993|       |      // temporary file.
 8994|  32.0k|      std::string_view path_buffer =
 8995|  32.0k|          (needs_percent_encoding &&
  ------------------
  |  Branch (8995:12): [True: 5.20k, False: 26.8k]
  ------------------
 8996|  5.20k|           ada::unicode::percent_encode<false>(
  ------------------
  |  Branch (8996:12): [True: 1.99k, False: 3.20k]
  ------------------
 8997|  5.20k|               path_view, character_sets::PATH_PERCENT_ENCODE, path_buffer_tmp))
 8998|  32.0k|              ? path_buffer_tmp
 8999|  32.0k|              : path_view;
 9000|  32.0k|      if (unicode::is_double_dot_path_segment(path_buffer)) {
  ------------------
  |  Branch (9000:11): [True: 8.28k, False: 23.7k]
  ------------------
 9001|  8.28k|        helpers::shorten_path(path, type);
 9002|  8.28k|        if (location == std::string_view::npos) {
  ------------------
  |  Branch (9002:13): [True: 6.93k, False: 1.34k]
  ------------------
 9003|  6.93k|          path += '/';
 9004|  6.93k|        }
 9005|  23.7k|      } else if (unicode::is_single_dot_path_segment(path_buffer) &&
  ------------------
  |  Branch (9005:18): [True: 903, False: 22.8k]
  ------------------
 9006|    903|                 (location == std::string_view::npos)) {
  ------------------
  |  Branch (9006:18): [True: 320, False: 583]
  ------------------
 9007|    320|        path += '/';
 9008|    320|      }
 9009|       |      // Otherwise, if path_buffer is not a single-dot path segment, then:
 9010|  23.4k|      else if (!unicode::is_single_dot_path_segment(path_buffer)) {
  ------------------
  |  Branch (9010:16): [True: 22.8k, False: 583]
  ------------------
 9011|       |        // If url's scheme is "file", url's path is empty, and path_buffer is a
 9012|       |        // Windows drive letter, then replace the second code point in
 9013|       |        // path_buffer with U+003A (:).
 9014|  22.8k|        if (type == ada::scheme::type::FILE && path.empty() &&
  ------------------
  |  Branch (9014:13): [True: 1.71k, False: 21.1k]
  |  Branch (9014:48): [True: 517, False: 1.19k]
  ------------------
 9015|    517|            checkers::is_windows_drive_letter(path_buffer)) {
  ------------------
  |  Branch (9015:13): [True: 42, False: 475]
  ------------------
 9016|     42|          path += '/';
 9017|     42|          path += path_buffer[0];
 9018|     42|          path += ':';
 9019|     42|          path_buffer.remove_prefix(2);
 9020|     42|          path.append(path_buffer);
 9021|  22.8k|        } else {
 9022|       |          // Append path_buffer to url's path.
 9023|  22.8k|          path += '/';
 9024|  22.8k|          path.append(path_buffer);
 9025|  22.8k|        }
 9026|  22.8k|      }
 9027|  32.0k|      if (location == std::string_view::npos) {
  ------------------
  |  Branch (9027:11): [True: 11.3k, False: 20.6k]
  ------------------
 9028|  11.3k|        return;
 9029|  11.3k|      }
 9030|  32.0k|    } while (true);
  ------------------
  |  Branch (9030:14): [True: 20.6k, Folded]
  ------------------
 9031|  11.3k|  }
 9032|  19.5k|}
_ZN3ada8checkers14path_signatureENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   87|   301k|    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|   301k|  size_t i = 0;
   94|   301k|  uint8_t accumulator{};
   95|   401k|  for (; i + 7 < input.size(); i += 8) {
  ------------------
  |  Branch (95:10): [True: 100k, False: 301k]
  ------------------
   96|   100k|    accumulator |= uint8_t(path_signature_table[uint8_t(input[i])] |
   97|   100k|                           path_signature_table[uint8_t(input[i + 1])] |
   98|   100k|                           path_signature_table[uint8_t(input[i + 2])] |
   99|   100k|                           path_signature_table[uint8_t(input[i + 3])] |
  100|   100k|                           path_signature_table[uint8_t(input[i + 4])] |
  101|   100k|                           path_signature_table[uint8_t(input[i + 5])] |
  102|   100k|                           path_signature_table[uint8_t(input[i + 6])] |
  103|   100k|                           path_signature_table[uint8_t(input[i + 7])]);
  104|   100k|  }
  105|   545k|  for (; i < input.size(); i++) {
  ------------------
  |  Branch (105:10): [True: 243k, False: 301k]
  ------------------
  106|   243k|    accumulator |= uint8_t(path_signature_table[uint8_t(input[i])]);
  107|   243k|  }
  108|   301k|  return accumulator;
  109|   301k|}
_ZN3ada7unicode14percent_encodeILb0EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKhRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEE:
 7332|  10.4k|                    std::string& out) {
 7333|  10.4k|  ada_log("percent_encode ", input, " to output string while ",
 7334|  10.4k|          append ? "appending" : "overwriting");
 7335|  10.4k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7336|  10.4k|    return character_sets::bit_at(character_set, c);
 7337|  10.4k|  });
 7338|  10.4k|  ada_log("percent_encode done checking, moved to ",
 7339|  10.4k|          std::distance(input.begin(), pointer));
 7340|       |
 7341|       |  // Optimization: Don't iterate if percent encode is not required
 7342|  10.4k|  if (pointer == input.end()) {
  ------------------
  |  Branch (7342:7): [True: 6.41k, False: 3.99k]
  ------------------
 7343|  6.41k|    ada_log("percent_encode encoding not needed.");
 7344|  6.41k|    return false;
 7345|  6.41k|  }
 7346|  3.99k|  if constexpr (!append) {
 7347|  3.99k|    out.clear();
 7348|  3.99k|  }
 7349|  3.99k|  ada_log("percent_encode appending ", std::distance(input.begin(), pointer),
 7350|  3.99k|          " bytes");
 7351|       |  // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
 7352|  3.99k|  out.append(input.data(), std::distance(input.begin(), pointer));
 7353|  3.99k|  ada_log("percent_encode processing ", std::distance(pointer, input.end()),
 7354|  3.99k|          " bytes");
 7355|  60.2k|  for (; pointer != input.end(); pointer++) {
  ------------------
  |  Branch (7355:10): [True: 56.2k, False: 3.99k]
  ------------------
 7356|  56.2k|    if (character_sets::bit_at(character_set, *pointer)) {
  ------------------
  |  Branch (7356:9): [True: 47.1k, False: 9.06k]
  ------------------
 7357|  47.1k|      out.append(character_sets::hex + uint8_t(*pointer) * 4, 3);
 7358|  47.1k|    } else {
 7359|  9.06k|      out += *pointer;
 7360|  9.06k|    }
 7361|  56.2k|  }
 7362|  3.99k|  return true;
 7363|  10.4k|}
_ZZN3ada7unicode14percent_encodeILb0EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKhRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEEENKUlcE_clEc:
 7335|  21.6k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7336|  21.6k|    return character_sets::bit_at(character_set, c);
 7337|  21.6k|  });
_ZN3ada7unicode26is_double_dot_path_segmentENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 7104|  64.0k|    std::string_view input) noexcept {
 7105|       |  // This will catch most cases:
 7106|       |  // The length must be 2,4 or 6.
 7107|       |  // We divide by two and require
 7108|       |  // that the result be between 1 and 3 inclusively.
 7109|  64.0k|  uint64_t half_length = uint64_t(input.size()) / 2;
 7110|  64.0k|  if (half_length - 1 > 2) {
  ------------------
  |  Branch (7110:7): [True: 20.3k, False: 43.7k]
  ------------------
 7111|  20.3k|    return false;
 7112|  20.3k|  }
 7113|       |  // We have a string of length 2, 4 or 6.
 7114|       |  // We now check the first character:
 7115|  43.7k|  if ((input[0] != '.') && (input[0] != '%')) {
  ------------------
  |  Branch (7115:7): [True: 39.6k, False: 4.11k]
  |  Branch (7115:28): [True: 17.3k, False: 22.2k]
  ------------------
 7116|  17.3k|    return false;
 7117|  17.3k|  }
 7118|       |  // We are unlikely the get beyond this point.
 7119|  26.4k|  int hash_value = (input.size() + (unsigned)(input[0])) & 3;
 7120|  26.4k|  const std::string_view target = table_is_double_dot_path_segment[hash_value];
 7121|  26.4k|  if (target.size() != input.size()) {
  ------------------
  |  Branch (7121:7): [True: 6.36k, False: 20.0k]
  ------------------
 7122|  6.36k|    return false;
 7123|  6.36k|  }
 7124|       |  // We almost never get here.
 7125|       |  // Optimizing the rest is relatively unimportant.
 7126|  20.0k|  auto prefix_equal_unsafe = [](std::string_view a, std::string_view b) {
 7127|  20.0k|    uint16_t A, B;
 7128|  20.0k|    memcpy(&A, a.data(), sizeof(A));
 7129|  20.0k|    memcpy(&B, b.data(), sizeof(B));
 7130|  20.0k|    return A == B;
 7131|  20.0k|  };
 7132|  20.0k|  if (!prefix_equal_unsafe(input, target)) {
  ------------------
  |  Branch (7132:7): [True: 672, False: 19.3k]
  ------------------
 7133|    672|    return false;
 7134|    672|  }
 7135|  78.3k|  for (size_t i = 2; i < input.size(); i++) {
  ------------------
  |  Branch (7135:22): [True: 61.8k, False: 16.5k]
  ------------------
 7136|  61.8k|    char c = input[i];
 7137|  61.8k|    if ((uint8_t((c | 0x20) - 0x61) <= 25 ? (c | 0x20) : c) != target[i]) {
  ------------------
  |  Branch (7137:9): [True: 2.80k, False: 59.0k]
  |  Branch (7137:10): [True: 30.2k, False: 31.5k]
  ------------------
 7138|  2.80k|      return false;
 7139|  2.80k|    }
 7140|  61.8k|  }
 7141|  16.5k|  return true;
 7142|       |  // The above code might be a bit better than the code below. Compilers
 7143|       |  // are not stupid and may use the fact that these strings have length 2,4 and
 7144|       |  // 6 and other tricks.
 7145|       |  // return input == ".." ||
 7146|       |  //  input == ".%2e" || input == ".%2E" ||
 7147|       |  //  input == "%2e." || input == "%2E." ||
 7148|       |  //  input == "%2e%2e" || input == "%2E%2E" || input == "%2E%2e" || input ==
 7149|       |  //  "%2e%2E";
 7150|  19.3k|}
_ZZN3ada7unicode26is_double_dot_path_segmentENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEENKUlS5_S5_E_clES5_S5_:
 7126|  20.0k|  auto prefix_equal_unsafe = [](std::string_view a, std::string_view b) {
 7127|  20.0k|    uint16_t A, B;
 7128|  20.0k|    memcpy(&A, a.data(), sizeof(A));
 7129|  20.0k|    memcpy(&B, b.data(), sizeof(B));
 7130|  20.0k|    return A == B;
 7131|  20.0k|  };
_ZN3ada7unicode26is_single_dot_path_segmentENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 7153|  94.3k|    std::string_view input) noexcept {
 7154|  94.3k|  return input == "." || input == "%2e" || input == "%2E";
  ------------------
  |  Branch (7154:10): [True: 1.43k, False: 92.9k]
  |  Branch (7154:26): [True: 1.52k, False: 91.4k]
  |  Branch (7154:44): [True: 12, False: 91.4k]
  ------------------
 7155|  94.3k|}
_ZN3ada7unicode28is_forbidden_host_code_pointEc:
 6974|  13.8k|    const char c) noexcept {
 6975|  13.8k|  return is_forbidden_host_code_point_table[uint8_t(c)];
 6976|  13.8k|}
_ZN3ada6detail17parse_ipv4_numberERPKcS2_RmRb:
 9149|  31.4k|                              bool& is_pure_decimal) noexcept {
 9150|  31.4k|  is_pure_decimal = false;
 9151|  31.4k|  if (p >= end) [[unlikely]] {
  ------------------
  |  Branch (9151:7): [True: 0, False: 31.4k]
  ------------------
 9152|      0|    return false;
 9153|      0|  }
 9154|  31.4k|  if (end - p >= 2 && p[0] == '0' && ((p[1] | 0x20) == 'x')) {
  ------------------
  |  Branch (9154:7): [True: 16.3k, False: 15.1k]
  |  Branch (9154:23): [True: 14.5k, False: 1.82k]
  |  Branch (9154:38): [True: 14.1k, False: 360]
  ------------------
 9155|  14.1k|    p += 2;
 9156|  14.1k|    if (p == end || *p == '.') {
  ------------------
  |  Branch (9156:9): [True: 42, False: 14.1k]
  |  Branch (9156:21): [True: 14, False: 14.1k]
  ------------------
 9157|     56|      value = 0;
 9158|     56|      return true;
 9159|     56|    }
 9160|  14.1k|    uint64_t v = 0;
 9161|  14.1k|    int digits = 0;
 9162|  45.0k|    while (p < end && *p != '.') {
  ------------------
  |  Branch (9162:12): [True: 44.8k, False: 234]
  |  Branch (9162:23): [True: 30.9k, False: 13.8k]
  ------------------
 9163|  30.9k|      const uint8_t nib = hex_nibble[static_cast<unsigned char>(*p)];
 9164|  30.9k|      if (nib == 0xff) [[unlikely]] {
  ------------------
  |  Branch (9164:11): [True: 14, False: 30.9k]
  ------------------
 9165|     14|        return false;
 9166|     14|      }
 9167|  30.9k|      if (v > (0xFFFFFFFFULL >> 4)) [[unlikely]] {
  ------------------
  |  Branch (9167:11): [True: 16, False: 30.9k]
  ------------------
 9168|     16|        return false;
 9169|     16|      }
 9170|  30.9k|      v = (v << 4) | nib;
 9171|  30.9k|      ++p;
 9172|  30.9k|      ++digits;
 9173|  30.9k|    }
 9174|  14.0k|    if (digits == 0) [[unlikely]] {
  ------------------
  |  Branch (9174:9): [True: 0, False: 14.0k]
  ------------------
 9175|      0|      return false;
 9176|      0|    }
 9177|  14.0k|    value = v;
 9178|  14.0k|    return true;
 9179|  14.0k|  }
 9180|  17.3k|  if (end - p >= 2 && p[0] == '0' && p[1] >= '0' && p[1] <= '9') {
  ------------------
  |  Branch (9180:7): [True: 2.18k, False: 15.1k]
  |  Branch (9180:23): [True: 360, False: 1.82k]
  |  Branch (9180:38): [True: 212, False: 148]
  |  Branch (9180:53): [True: 198, False: 14]
  ------------------
 9181|    198|    ++p;
 9182|    198|    uint64_t v = 0;
 9183|  4.49k|    while (p < end && *p != '.') {
  ------------------
  |  Branch (9183:12): [True: 4.37k, False: 122]
  |  Branch (9183:23): [True: 4.34k, False: 32]
  ------------------
 9184|  4.34k|      const char c = *p;
 9185|  4.34k|      if (c < '0' || c > '7') [[unlikely]] {
  ------------------
  |  Branch (9185:11): [True: 6, False: 4.33k]
  |  Branch (9185:22): [True: 22, False: 4.31k]
  ------------------
 9186|     28|        return false;
 9187|     28|      }
 9188|  4.31k|      if (v > (0xFFFFFFFFULL >> 3)) [[unlikely]] {
  ------------------
  |  Branch (9188:11): [True: 16, False: 4.30k]
  ------------------
 9189|     16|        return false;
 9190|     16|      }
 9191|  4.30k|      v = (v << 3) | static_cast<uint64_t>(c - '0');
 9192|  4.30k|      ++p;
 9193|  4.30k|    }
 9194|    154|    value = v;
 9195|    154|    return true;
 9196|    198|  }
 9197|  17.1k|  if (*p < '0' || *p > '9') [[unlikely]] {
  ------------------
  |  Branch (9197:7): [True: 68, False: 17.0k]
  |  Branch (9197:19): [True: 130, False: 16.9k]
  ------------------
 9198|    198|    return false;
 9199|    198|  }
 9200|  16.9k|  is_pure_decimal = true;
 9201|  16.9k|  uint64_t v = static_cast<uint64_t>(*p - '0');
 9202|  16.9k|  ++p;
 9203|  23.5k|  while (p < end && *p != '.') {
  ------------------
  |  Branch (9203:10): [True: 7.85k, False: 15.7k]
  |  Branch (9203:21): [True: 6.79k, False: 1.06k]
  ------------------
 9204|  6.79k|    const char c = *p;
 9205|  6.79k|    if (c < '0' || c > '9') [[unlikely]] {
  ------------------
  |  Branch (9205:9): [True: 26, False: 6.76k]
  |  Branch (9205:20): [True: 50, False: 6.71k]
  ------------------
 9206|     76|      return false;
 9207|     76|    }
 9208|  6.71k|    if (v > 429496729ULL) [[unlikely]] {
  ------------------
  |  Branch (9208:9): [True: 42, False: 6.67k]
  ------------------
 9209|     42|      return false;
 9210|     42|    }
 9211|  6.67k|    v = v * 10u + static_cast<uint64_t>(c - '0');
 9212|  6.67k|    if (v > 0xFFFFFFFFULL) [[unlikely]] {
  ------------------
  |  Branch (9212:9): [True: 8, False: 6.66k]
  ------------------
 9213|      8|      return false;
 9214|      8|    }
 9215|  6.66k|    ++p;
 9216|  6.66k|  }
 9217|  16.7k|  value = v;
 9218|  16.7k|  return true;
 9219|  16.9k|}
_ZN3ada6detail15parse_hex_pieceERPKcS2_Rt:
 9223|  1.96k|                           uint16_t& value) noexcept {
 9224|  1.96k|  if (pointer == end) {
  ------------------
  |  Branch (9224:7): [True: 0, False: 1.96k]
  ------------------
 9225|      0|    return 0;
 9226|      0|  }
 9227|  1.96k|  const uint8_t n0 = hex_nibble[static_cast<unsigned char>(*pointer)];
 9228|  1.96k|  if (n0 == 0xff) {
  ------------------
  |  Branch (9228:7): [True: 44, False: 1.92k]
  ------------------
 9229|     44|    return 0;
 9230|     44|  }
 9231|  1.92k|  uint32_t v = n0;
 9232|  1.92k|  ++pointer;
 9233|  1.92k|  int length = 1;
 9234|  1.92k|  if (pointer != end) {
  ------------------
  |  Branch (9234:7): [True: 1.69k, False: 224]
  ------------------
 9235|  1.69k|    const uint8_t n1 = hex_nibble[static_cast<unsigned char>(*pointer)];
 9236|  1.69k|    if (n1 != 0xff) {
  ------------------
  |  Branch (9236:9): [True: 628, False: 1.07k]
  ------------------
 9237|    628|      v = (v << 4) | n1;
 9238|    628|      ++pointer;
 9239|    628|      ++length;
 9240|    628|      if (pointer != end) {
  ------------------
  |  Branch (9240:11): [True: 566, False: 62]
  ------------------
 9241|    566|        const uint8_t n2 = hex_nibble[static_cast<unsigned char>(*pointer)];
 9242|    566|        if (n2 != 0xff) {
  ------------------
  |  Branch (9242:13): [True: 404, False: 162]
  ------------------
 9243|    404|          v = (v << 4) | n2;
 9244|    404|          ++pointer;
 9245|    404|          ++length;
 9246|    404|          if (pointer != end) {
  ------------------
  |  Branch (9246:15): [True: 304, False: 100]
  ------------------
 9247|    304|            const uint8_t n3 = hex_nibble[static_cast<unsigned char>(*pointer)];
 9248|    304|            if (n3 != 0xff) {
  ------------------
  |  Branch (9248:17): [True: 128, False: 176]
  ------------------
 9249|    128|              v = (v << 4) | n3;
 9250|    128|              ++pointer;
 9251|    128|              ++length;
 9252|    128|            }
 9253|    304|          }
 9254|    404|        }
 9255|    566|      }
 9256|    628|    }
 9257|  1.69k|  }
 9258|  1.92k|  value = static_cast<uint16_t>(v);
 9259|  1.92k|  return length;
 9260|  1.96k|}
_ZN3ada7unicode13is_alnum_plusEc:
 7068|  1.45M|ada_really_inline constexpr bool is_alnum_plus(const char c) noexcept {
 7069|  1.45M|  return is_alnum_plus_table[uint8_t(c)];
 7070|       |  // A table is almost surely much faster than the
 7071|       |  // following under most compilers: return
 7072|       |  // return (std::isalnum(c) || c == '+' || c == '-' || c == '.');
 7073|  1.45M|}
_ZN3ada7helpers10prune_hashERNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8114|   312k|    std::string_view& input) noexcept {
 8115|       |  // compiles down to 20--30 instructions including a class to memchr (C
 8116|       |  // function). this function should be quite fast.
 8117|   312k|  size_t location_of_first = input.find('#');
 8118|   312k|  if (location_of_first == std::string_view::npos) {
  ------------------
  |  Branch (8118:7): [True: 291k, False: 20.7k]
  ------------------
 8119|   291k|    return std::nullopt;
 8120|   291k|  }
 8121|  20.7k|  std::string_view hash = input;
 8122|  20.7k|  hash.remove_prefix(location_of_first + 1);
 8123|  20.7k|  input.remove_suffix(input.size() - location_of_first);
 8124|  20.7k|  return hash;
 8125|   312k|}
_ZN3ada7helpers32find_authority_delimiter_specialENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 9067|   114k|find_authority_delimiter_special(std::string_view view) noexcept {
 9068|       |  // performance note: we might be able to gain further performance
 9069|       |  // with SIMD intrinsics.
 9070|  1.35M|  for (auto pos = view.begin(); pos != view.end(); ++pos) {
  ------------------
  |  Branch (9070:33): [True: 1.35M, False: 766]
  ------------------
 9071|  1.35M|    if (authority_delimiter_special[(uint8_t)*pos]) {
  ------------------
  |  Branch (9071:9): [True: 113k, False: 1.24M]
  ------------------
 9072|   113k|      return pos - view.begin();
 9073|   113k|    }
 9074|  1.35M|  }
 9075|    766|  return size_t(view.size());
 9076|   114k|}
_ZN3ada7helpers24find_authority_delimiterENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 9088|    512|find_authority_delimiter(std::string_view view) noexcept {
 9089|       |  // performance note: we might be able to gain further performance
 9090|       |  // with SIMD instrinsics.
 9091|  6.17k|  for (auto pos = view.begin(); pos != view.end(); ++pos) {
  ------------------
  |  Branch (9091:33): [True: 6.11k, False: 64]
  ------------------
 9092|  6.11k|    if (authority_delimiter[(uint8_t)*pos]) {
  ------------------
  |  Branch (9092:9): [True: 448, False: 5.66k]
  ------------------
 9093|    448|      return pos - view.begin();
 9094|    448|    }
 9095|  6.11k|  }
 9096|     64|  return size_t(view.size());
 9097|    512|}
_ZN3ada7helpers12shorten_pathERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_6scheme4typeE:
 8127|  16.5k|ada_really_inline bool shorten_path(std::string& path, ada::scheme::type type) {
 8128|       |  // Let path be url's path.
 8129|       |  // If url's scheme is "file", path's size is 1, and path[0] is a normalized
 8130|       |  // Windows drive letter, then return.
 8131|  16.5k|  if (type == ada::scheme::type::FILE &&
  ------------------
  |  Branch (8131:7): [True: 328, False: 16.2k]
  ------------------
 8132|    328|      path.find('/', 1) == std::string_view::npos && !path.empty()) {
  ------------------
  |  Branch (8132:7): [True: 192, False: 136]
  |  Branch (8132:54): [True: 150, False: 42]
  ------------------
 8133|    150|    if (checkers::is_normalized_windows_drive_letter(
  ------------------
  |  Branch (8133:9): [True: 22, False: 128]
  ------------------
 8134|    150|            helpers::substring(path, 1))) {
 8135|     22|      return false;
 8136|     22|    }
 8137|    150|  }
 8138|       |
 8139|       |  // Remove path's last item, if any.
 8140|  16.5k|  size_t last_delimiter = path.rfind('/');
 8141|  16.5k|  if (last_delimiter != std::string::npos) {
  ------------------
  |  Branch (8141:7): [True: 14.9k, False: 1.57k]
  ------------------
 8142|  14.9k|    path.erase(last_delimiter);
 8143|  14.9k|    return true;
 8144|  14.9k|  }
 8145|       |
 8146|  1.57k|  return false;
 8147|  16.5k|}
_ZN3ada7helpers27get_host_delimiter_locationEbRNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8780|   307k|    const bool is_special, std::string_view& view) noexcept {
 8781|       |  /**
 8782|       |   * The spec at https://url.spec.whatwg.org/#hostname-state expects us to
 8783|       |   * compute a variable called insideBrackets but this variable is only used
 8784|       |   * once, to check whether a ':' character was found outside brackets. Exact
 8785|       |   * text: "Otherwise, if c is U+003A (:) and insideBrackets is false, then:".
 8786|       |   * It is conceptually simpler and arguably more efficient to just return a
 8787|       |   * Boolean indicating whether ':' was found outside brackets.
 8788|       |   */
 8789|   307k|  const size_t view_size = view.size();
 8790|   307k|  size_t location = 0;
 8791|   307k|  bool found_colon = false;
 8792|       |  /**
 8793|       |   * Performance analysis:
 8794|       |   *
 8795|       |   * We are basically seeking the end of the hostname which can be indicated
 8796|       |   * by the end of the view, or by one of the characters ':', '/', '?', '\\'
 8797|       |   * (where '\\' is only applicable for special URLs). However, these must
 8798|       |   * appear outside a bracket range. E.g., if you have [something?]fd: then the
 8799|       |   * '?' does not count.
 8800|       |   *
 8801|       |   * So we can skip ahead to the next delimiter, as long as we include '[' in
 8802|       |   * the set of delimiters, and that we handle it first.
 8803|       |   *
 8804|       |   * So the trick is to have a fast function that locates the next delimiter.
 8805|       |   * Unless we find '[', then it only needs to be called once! Ideally, such a
 8806|       |   * function would be provided by the C++ standard library, but it seems that
 8807|       |   * find_first_of is not very fast, so we are forced to roll our own.
 8808|       |   *
 8809|       |   * We do not break into two loops for speed, but for clarity.
 8810|       |   */
 8811|   307k|  if (is_special) {
  ------------------
  |  Branch (8811:7): [True: 306k, False: 1.16k]
  ------------------
 8812|       |    // We move to the next delimiter.
 8813|   306k|    location = find_next_host_delimiter_special(view, location);
 8814|       |    // Unless we find '[' then we are going only going to have to call
 8815|       |    // find_next_host_delimiter_special once.
 8816|   308k|    for (; location < view_size;
  ------------------
  |  Branch (8816:12): [True: 302k, False: 6.02k]
  ------------------
 8817|   306k|         location = find_next_host_delimiter_special(view, location)) {
 8818|   302k|      if (view[location] == '[') {
  ------------------
  |  Branch (8818:11): [True: 2.44k, False: 300k]
  ------------------
 8819|  2.44k|        location = view.find(']', location);
 8820|  2.44k|        if (location == std::string_view::npos) {
  ------------------
  |  Branch (8820:13): [True: 218, False: 2.22k]
  ------------------
 8821|       |          // performance: view.find might get translated to a memchr, which
 8822|       |          // has no notion of std::string_view::npos, so the code does not
 8823|       |          // reflect the assembly.
 8824|    218|          location = view_size;
 8825|    218|          break;
 8826|    218|        }
 8827|   300k|      } else {
 8828|   300k|        found_colon = view[location] == ':';
 8829|   300k|        break;
 8830|   300k|      }
 8831|   302k|    }
 8832|   306k|  } else {
 8833|       |    // We move to the next delimiter.
 8834|  1.16k|    location = find_next_host_delimiter(view, location);
 8835|       |    // Unless we find '[' then we are going only going to have to call
 8836|       |    // find_next_host_delimiter_special once.
 8837|  1.31k|    for (; location < view_size;
  ------------------
  |  Branch (8837:12): [True: 1.09k, False: 222]
  ------------------
 8838|  1.16k|         location = find_next_host_delimiter(view, location)) {
 8839|  1.09k|      if (view[location] == '[') {
  ------------------
  |  Branch (8839:11): [True: 158, False: 934]
  ------------------
 8840|    158|        location = view.find(']', location);
 8841|    158|        if (location == std::string_view::npos) {
  ------------------
  |  Branch (8841:13): [True: 8, False: 150]
  ------------------
 8842|       |          // performance: view.find might get translated to a memchr, which
 8843|       |          // has no notion of std::string_view::npos, so the code does not
 8844|       |          // reflect the assembly.
 8845|      8|          location = view_size;
 8846|      8|          break;
 8847|      8|        }
 8848|    934|      } else {
 8849|    934|        found_colon = view[location] == ':';
 8850|    934|        break;
 8851|    934|      }
 8852|  1.09k|    }
 8853|  1.16k|  }
 8854|       |  // performance: remove_suffix may translate into a single instruction.
 8855|   307k|  view.remove_suffix(view_size - location);
 8856|   307k|  return {location, found_colon};
 8857|   307k|}
_ZN3ada7helpers32find_next_host_delimiter_specialENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEm:
 8370|   308k|    std::string_view view, size_t location) noexcept {
 8371|       |  // first check for short strings in which case we do it naively.
 8372|   308k|  if (view.size() - location < 16) {  // slow path
  ------------------
  |  Branch (8372:7): [True: 175k, False: 133k]
  ------------------
 8373|  1.66M|    for (size_t i = location; i < view.size(); i++) {
  ------------------
  |  Branch (8373:31): [True: 1.66M, False: 4.30k]
  ------------------
 8374|  1.66M|      if (view[i] == ':' || view[i] == '/' || view[i] == '\\' ||
  ------------------
  |  Branch (8374:11): [True: 1.35k, False: 1.65M]
  |  Branch (8374:29): [True: 168k, False: 1.49M]
  |  Branch (8374:47): [True: 190, False: 1.49M]
  ------------------
 8375|  1.49M|          view[i] == '?' || view[i] == '[') {
  ------------------
  |  Branch (8375:11): [True: 462, False: 1.49M]
  |  Branch (8375:29): [True: 1.07k, False: 1.48M]
  ------------------
 8376|   171k|        return i;
 8377|   171k|      }
 8378|  1.66M|    }
 8379|  4.30k|    return size_t(view.size());
 8380|   175k|  }
 8381|       |  // fast path for long strings (expected to be common)
 8382|   133k|  size_t i = location;
 8383|   133k|  const __m128i mask1 = _mm_set1_epi8(':');
 8384|   133k|  const __m128i mask2 = _mm_set1_epi8('/');
 8385|   133k|  const __m128i mask3 = _mm_set1_epi8('\\');
 8386|   133k|  const __m128i mask4 = _mm_set1_epi8('?');
 8387|   133k|  const __m128i mask5 = _mm_set1_epi8('[');
 8388|       |
 8389|   233k|  for (; i + 15 < view.size(); i += 16) {
  ------------------
  |  Branch (8389:10): [True: 188k, False: 44.8k]
  ------------------
 8390|   188k|    __m128i word = _mm_loadu_si128((const __m128i*)(view.data() + i));
 8391|   188k|    __m128i m1 = _mm_cmpeq_epi8(word, mask1);
 8392|   188k|    __m128i m2 = _mm_cmpeq_epi8(word, mask2);
 8393|   188k|    __m128i m3 = _mm_cmpeq_epi8(word, mask3);
 8394|   188k|    __m128i m4 = _mm_cmpeq_epi8(word, mask4);
 8395|   188k|    __m128i m5 = _mm_cmpeq_epi8(word, mask5);
 8396|   188k|    __m128i m = _mm_or_si128(
 8397|   188k|        _mm_or_si128(_mm_or_si128(m1, m2), _mm_or_si128(m3, m4)), m5);
 8398|   188k|    int mask = _mm_movemask_epi8(m);
 8399|   188k|    if (mask != 0) {
  ------------------
  |  Branch (8399:9): [True: 88.1k, False: 99.9k]
  ------------------
 8400|  88.1k|      return i + trailing_zeroes(mask);
 8401|  88.1k|    }
 8402|   188k|  }
 8403|  44.8k|  if (i < view.size()) {
  ------------------
  |  Branch (8403:7): [True: 44.6k, False: 258]
  ------------------
 8404|  44.6k|    __m128i word =
 8405|  44.6k|        _mm_loadu_si128((const __m128i*)(view.data() + view.length() - 16));
 8406|  44.6k|    __m128i m1 = _mm_cmpeq_epi8(word, mask1);
 8407|  44.6k|    __m128i m2 = _mm_cmpeq_epi8(word, mask2);
 8408|  44.6k|    __m128i m3 = _mm_cmpeq_epi8(word, mask3);
 8409|  44.6k|    __m128i m4 = _mm_cmpeq_epi8(word, mask4);
 8410|  44.6k|    __m128i m5 = _mm_cmpeq_epi8(word, mask5);
 8411|  44.6k|    __m128i m = _mm_or_si128(
 8412|  44.6k|        _mm_or_si128(_mm_or_si128(m1, m2), _mm_or_si128(m3, m4)), m5);
 8413|  44.6k|    int mask = _mm_movemask_epi8(m);
 8414|  44.6k|    if (mask != 0) {
  ------------------
  |  Branch (8414:9): [True: 43.1k, False: 1.45k]
  ------------------
 8415|  43.1k|      return view.length() - 16 + trailing_zeroes(mask);
 8416|  43.1k|    }
 8417|  44.6k|  }
 8418|  1.71k|  return size_t(view.length());
 8419|  44.8k|}
_ZN3ada7helpers15trailing_zeroesEj:
 8195|   132k|ada_really_inline int trailing_zeroes(uint32_t input_num) noexcept {
 8196|       |#ifdef ADA_REGULAR_VISUAL_STUDIO
 8197|       |  unsigned long ret;
 8198|       |  // Search the mask data from least significant bit (LSB)
 8199|       |  // to the most significant bit (MSB) for a set bit (1).
 8200|       |  _BitScanForward(&ret, input_num);
 8201|       |  return (int)ret;
 8202|       |#else   // ADA_REGULAR_VISUAL_STUDIO
 8203|   132k|  return __builtin_ctzl(input_num);
 8204|   132k|#endif  // ADA_REGULAR_VISUAL_STUDIO
 8205|   132k|}
_ZN3ada7helpers24find_next_host_delimiterENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEm:
 8646|  1.31k|                                                  size_t location) noexcept {
 8647|       |  // first check for short strings in which case we do it naively.
 8648|  1.31k|  if (view.size() - location < 16) {  // slow path
  ------------------
  |  Branch (8648:7): [True: 442, False: 872]
  ------------------
 8649|  2.39k|    for (size_t i = location; i < view.size(); i++) {
  ------------------
  |  Branch (8649:31): [True: 2.23k, False: 162]
  ------------------
 8650|  2.23k|      if (view[i] == ':' || view[i] == '/' || view[i] == '?' ||
  ------------------
  |  Branch (8650:11): [True: 42, False: 2.19k]
  |  Branch (8650:29): [True: 134, False: 2.06k]
  |  Branch (8650:47): [True: 54, False: 2.00k]
  ------------------
 8651|  2.00k|          view[i] == '[') {
  ------------------
  |  Branch (8651:11): [True: 50, False: 1.95k]
  ------------------
 8652|    280|        return i;
 8653|    280|      }
 8654|  2.23k|    }
 8655|    162|    return size_t(view.size());
 8656|    442|  }
 8657|       |  // fast path for long strings (expected to be common)
 8658|    872|  size_t i = location;
 8659|    872|  const __m128i mask1 = _mm_set1_epi8(':');
 8660|    872|  const __m128i mask2 = _mm_set1_epi8('/');
 8661|    872|  const __m128i mask4 = _mm_set1_epi8('?');
 8662|    872|  const __m128i mask5 = _mm_set1_epi8('[');
 8663|       |
 8664|  1.35k|  for (; i + 15 < view.size(); i += 16) {
  ------------------
  |  Branch (8664:10): [True: 1.17k, False: 174]
  ------------------
 8665|  1.17k|    __m128i word = _mm_loadu_si128((const __m128i*)(view.data() + i));
 8666|  1.17k|    __m128i m1 = _mm_cmpeq_epi8(word, mask1);
 8667|  1.17k|    __m128i m2 = _mm_cmpeq_epi8(word, mask2);
 8668|  1.17k|    __m128i m4 = _mm_cmpeq_epi8(word, mask4);
 8669|  1.17k|    __m128i m5 = _mm_cmpeq_epi8(word, mask5);
 8670|  1.17k|    __m128i m = _mm_or_si128(_mm_or_si128(m1, m2), _mm_or_si128(m4, m5));
 8671|  1.17k|    int mask = _mm_movemask_epi8(m);
 8672|  1.17k|    if (mask != 0) {
  ------------------
  |  Branch (8672:9): [True: 698, False: 480]
  ------------------
 8673|    698|      return i + trailing_zeroes(mask);
 8674|    698|    }
 8675|  1.17k|  }
 8676|    174|  if (i < view.size()) {
  ------------------
  |  Branch (8676:7): [True: 154, False: 20]
  ------------------
 8677|    154|    __m128i word =
 8678|    154|        _mm_loadu_si128((const __m128i*)(view.data() + view.length() - 16));
 8679|    154|    __m128i m1 = _mm_cmpeq_epi8(word, mask1);
 8680|    154|    __m128i m2 = _mm_cmpeq_epi8(word, mask2);
 8681|    154|    __m128i m4 = _mm_cmpeq_epi8(word, mask4);
 8682|    154|    __m128i m5 = _mm_cmpeq_epi8(word, mask5);
 8683|    154|    __m128i m = _mm_or_si128(_mm_or_si128(m1, m2), _mm_or_si128(m4, m5));
 8684|    154|    int mask = _mm_movemask_epi8(m);
 8685|    154|    if (mask != 0) {
  ------------------
  |  Branch (8685:9): [True: 114, False: 40]
  ------------------
 8686|    114|      return view.length() - 16 + trailing_zeroes(mask);
 8687|    114|    }
 8688|    154|  }
 8689|     60|  return size_t(view.length());
 8690|    174|}
_ZN3ada3url10parse_hostENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 9625|   154k|ada_really_inline bool url::parse_host(std::string_view input) {
 9626|   154k|  ada_log("parse_host ", input, " [", input.size(), " bytes]");
 9627|   154k|  if (input.empty()) {
  ------------------
  |  Branch (9627:7): [True: 7, False: 154k]
  ------------------
 9628|      7|    return is_valid = false;
 9629|      7|  }  // technically unnecessary.
 9630|       |  // If input starts with U+005B ([), then:
 9631|   154k|  if (input[0] == '[') {
  ------------------
  |  Branch (9631:7): [True: 690, False: 153k]
  ------------------
 9632|       |    // If input does not end with U+005D (]), validation error, return failure.
 9633|    690|    if (input.back() != ']') {
  ------------------
  |  Branch (9633:9): [True: 85, False: 605]
  ------------------
 9634|     85|      return is_valid = false;
 9635|     85|    }
 9636|    605|    ada_log("parse_host ipv6");
 9637|       |
 9638|       |    // Return the result of IPv6 parsing input with its leading U+005B ([) and
 9639|       |    // trailing U+005D (]) removed.
 9640|    605|    input.remove_prefix(1);
 9641|    605|    input.remove_suffix(1);
 9642|    605|    return parse_ipv6(input);
 9643|    690|  }
 9644|       |
 9645|       |  // If isNotSpecial is true, then return the result of opaque-host parsing
 9646|       |  // input.
 9647|   153k|  if (!is_special()) {
  ------------------
  |  Branch (9647:7): [True: 500, False: 153k]
  ------------------
 9648|    500|    return parse_opaque_host(input);
 9649|    500|  }
 9650|       |
 9651|       |  // Fast path: try to parse as pure decimal IPv4(a.b.c.d) first.
 9652|   153k|  const uint64_t fast_result = checkers::try_parse_ipv4_fast(input);
 9653|   153k|  if (fast_result < checkers::ipv4_fast_fail) {
  ------------------
  |  Branch (9653:7): [True: 36.8k, False: 116k]
  ------------------
 9654|       |    // Fast path succeeded - input is pure decimal IPv4
 9655|  36.8k|    if (!input.empty() && input.back() == '.') {
  ------------------
  |  Branch (9655:9): [True: 36.8k, False: 0]
  |  Branch (9655:27): [True: 10, False: 36.8k]
  ------------------
 9656|     10|      host = input.substr(0, input.size() - 1);
 9657|  36.8k|    } else {
 9658|  36.8k|      host = input;
 9659|  36.8k|    }
 9660|  36.8k|    host_type = IPV4;
 9661|  36.8k|    is_valid = true;
 9662|  36.8k|    ada_log("parse_host fast path decimal ipv4");
 9663|  36.8k|    return true;
 9664|  36.8k|  }
 9665|       |  // Let domain be the result of running UTF-8 decode without BOM on the
 9666|       |  // percent-decoding of input. Let asciiDomain be the result of running domain
 9667|       |  // to ASCII with domain and false. The most common case is an ASCII input, in
 9668|       |  // which case we do not need to call the expensive 'to_ascii' if a few
 9669|       |  // conditions are met: no '%' and no 'xn-' subsequence.
 9670|   116k|  std::string buffer = std::string(input);
 9671|       |  // This next function checks that the result is ascii, but we are going to
 9672|       |  // to check anyhow with is_forbidden.
 9673|       |  // bool is_ascii =
 9674|   116k|  unicode::to_lower_ascii(buffer.data(), buffer.size());
 9675|   116k|  bool is_forbidden = unicode::contains_forbidden_domain_code_point(
 9676|   116k|      buffer.data(), buffer.size());
 9677|   116k|  static constexpr std::string_view xn_dash{"xn-", 3};
 9678|   116k|  if (is_forbidden == 0 && buffer.find(xn_dash) == std::string_view::npos) {
  ------------------
  |  Branch (9678:7): [True: 113k, False: 2.99k]
  |  Branch (9678:28): [True: 69.2k, False: 44.2k]
  ------------------
 9679|       |    // fast path
 9680|  69.2k|    host = std::move(buffer);
 9681|       |
 9682|       |    // Check for other IPv4 formats (hex, octal, etc.)
 9683|  69.2k|    if (checkers::is_ipv4(host.value())) {
  ------------------
  |  Branch (9683:9): [True: 8.23k, False: 61.0k]
  ------------------
 9684|  8.23k|      ada_log("parse_host fast path ipv4");
 9685|  8.23k|      return parse_ipv4(host.value());
 9686|  8.23k|    }
 9687|  61.0k|    ada_log("parse_host fast path ", *host);
 9688|  61.0k|    is_valid = true;
 9689|  61.0k|    return true;
 9690|  69.2k|  }
 9691|  47.2k|  ada_log("parse_host calling to_ascii");
 9692|  47.2k|  is_valid = ada::unicode::to_ascii(host, input, input.find('%'));
 9693|  47.2k|  if (!is_valid || !host.has_value()) {
  ------------------
  |  Branch (9693:7): [True: 1.64k, False: 45.5k]
  |  Branch (9693:20): [True: 0, False: 45.5k]
  ------------------
 9694|  1.64k|    ada_log("parse_host to_ascii returns false");
 9695|  1.64k|    return is_valid = false;
 9696|  1.64k|  }
 9697|  45.5k|  ada_log("parse_host to_ascii succeeded ", *host, " [", host->size(),
 9698|  45.5k|          " bytes]");
 9699|       |
 9700|  45.5k|  if (std::any_of(host->begin(), host->end(),
  ------------------
  |  Branch (9700:7): [True: 0, False: 45.5k]
  ------------------
 9701|  45.5k|                  ada::unicode::is_forbidden_domain_code_point)) {
 9702|      0|    host = std::nullopt;
 9703|      0|    return is_valid = false;
 9704|      0|  }
 9705|       |
 9706|       |  // If asciiDomain ends in a number, then return the result of IPv4 parsing
 9707|       |  // asciiDomain.
 9708|  45.5k|  if (checkers::is_ipv4(*host)) {
  ------------------
  |  Branch (9708:7): [True: 97, False: 45.4k]
  ------------------
 9709|     97|    ada_log("parse_host got ipv4 ", *host);
 9710|     97|    return parse_ipv4(*host);
 9711|     97|  }
 9712|       |
 9713|  45.4k|  return true;
 9714|  45.5k|}
_ZN3ada7unicode30is_forbidden_domain_code_pointEc:
 6997|  1.97M|    const char c) noexcept {
 6998|  1.97M|  return is_forbidden_domain_code_point_table[uint8_t(c)];
 6999|  1.97M|}
_ZN3ada7unicode14percent_encodeILb1EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKhRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEE:
 7332|  19.0k|                    std::string& out) {
 7333|  19.0k|  ada_log("percent_encode ", input, " to output string while ",
 7334|  19.0k|          append ? "appending" : "overwriting");
 7335|  19.0k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7336|  19.0k|    return character_sets::bit_at(character_set, c);
 7337|  19.0k|  });
 7338|  19.0k|  ada_log("percent_encode done checking, moved to ",
 7339|  19.0k|          std::distance(input.begin(), pointer));
 7340|       |
 7341|       |  // Optimization: Don't iterate if percent encode is not required
 7342|  19.0k|  if (pointer == input.end()) {
  ------------------
  |  Branch (7342:7): [True: 18.8k, False: 267]
  ------------------
 7343|  18.8k|    ada_log("percent_encode encoding not needed.");
 7344|  18.8k|    return false;
 7345|  18.8k|  }
 7346|       |  if constexpr (!append) {
 7347|       |    out.clear();
 7348|       |  }
 7349|    267|  ada_log("percent_encode appending ", std::distance(input.begin(), pointer),
 7350|    267|          " bytes");
 7351|       |  // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
 7352|    267|  out.append(input.data(), std::distance(input.begin(), pointer));
 7353|    267|  ada_log("percent_encode processing ", std::distance(pointer, input.end()),
 7354|    267|          " bytes");
 7355|  15.7k|  for (; pointer != input.end(); pointer++) {
  ------------------
  |  Branch (7355:10): [True: 15.5k, False: 267]
  ------------------
 7356|  15.5k|    if (character_sets::bit_at(character_set, *pointer)) {
  ------------------
  |  Branch (7356:9): [True: 11.5k, False: 3.92k]
  ------------------
 7357|  11.5k|      out.append(character_sets::hex + uint8_t(*pointer) * 4, 3);
 7358|  11.5k|    } else {
 7359|  3.92k|      out += *pointer;
 7360|  3.92k|    }
 7361|  15.5k|  }
 7362|    267|  return true;
 7363|  19.0k|}
_ZZN3ada7unicode14percent_encodeILb1EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKhRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEEENKUlcE_clEc:
 7335|   184k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7336|   184k|    return character_sets::bit_at(character_set, c);
 7337|   184k|  });
simple_absolute.cc:_ZN12_GLOBAL__N_132apply_shifted_non_scheme_offsetsERN3ada14url_componentsEj:
11575|   156k|    ada::url_components& components, uint32_t new_difference) {
11576|   156k|  components.username_end += new_difference;
11577|   156k|  components.host_start += new_difference;
11578|   156k|  components.host_end += new_difference;
11579|   156k|  components.pathname_start += new_difference;
11580|   156k|  if (components.search_start != ada::url_components::omitted) {
  ------------------
  |  Branch (11580:7): [True: 0, False: 156k]
  ------------------
11581|      0|    components.search_start += new_difference;
11582|      0|  }
11583|   156k|  if (components.hash_start != ada::url_components::omitted) {
  ------------------
  |  Branch (11583:7): [True: 0, False: 156k]
  ------------------
11584|      0|    components.hash_start += new_difference;
11585|      0|  }
11586|   156k|}
_ZN3ada14url_aggregator10parse_hostENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
12064|   154k|ada_really_inline bool url_aggregator::parse_host(std::string_view input) {
12065|   154k|  ada_log("url_aggregator:parse_host \"", input, "\" [", input.size(),
12066|   154k|          " bytes]");
12067|   154k|  ADA_ASSERT_TRUE(validate());
12068|   154k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
12069|   154k|  if (input.empty()) {
  ------------------
  |  Branch (12069:7): [True: 7, False: 154k]
  ------------------
12070|      7|    return is_valid = false;
12071|      7|  }  // technically unnecessary.
12072|       |  // If input starts with U+005B ([), then:
12073|   154k|  if (input[0] == '[') {
  ------------------
  |  Branch (12073:7): [True: 690, False: 153k]
  ------------------
12074|       |    // If input does not end with U+005D (]), validation error, return failure.
12075|    690|    if (input.back() != ']') {
  ------------------
  |  Branch (12075:9): [True: 85, False: 605]
  ------------------
12076|     85|      return is_valid = false;
12077|     85|    }
12078|    605|    ada_log("parse_host ipv6");
12079|       |
12080|       |    // Return the result of IPv6 parsing input with its leading U+005B ([) and
12081|       |    // trailing U+005D (]) removed.
12082|    605|    input.remove_prefix(1);
12083|    605|    input.remove_suffix(1);
12084|    605|    return parse_ipv6(input);
12085|    690|  }
12086|       |
12087|       |  // If isNotSpecial is true, then return the result of opaque-host parsing
12088|       |  // input.
12089|   153k|  if (!is_special()) {
  ------------------
  |  Branch (12089:7): [True: 500, False: 153k]
  ------------------
12090|    500|    return parse_opaque_host(input);
12091|    500|  }
12092|       |  // Let domain be the result of running UTF-8 decode without BOM on the
12093|       |  // percent-decoding of input. Let asciiDomain be the result of running domain
12094|       |  // to ASCII with domain and false. The most common case is an ASCII input, in
12095|       |  // which case we do not need to call the expensive 'to_ascii' if a few
12096|       |  // conditions are met: no '%' and no 'xn-' subsequence.
12097|       |
12098|       |  // Often, the input does not contain any forbidden code points, and no upper
12099|       |  // case ASCII letter, then we can just copy it to the buffer. We want to
12100|       |  // optimize for such a common case.
12101|       |
12102|       |  // Fast path: try to parse as pure decimal IPv4(a.b.c.d) first.
12103|   153k|  const uint64_t fast_result = checkers::try_parse_ipv4_fast(input);
12104|   153k|  if (fast_result < checkers::ipv4_fast_fail) {
  ------------------
  |  Branch (12104:7): [True: 36.8k, False: 116k]
  ------------------
12105|       |    // Fast path succeeded - input is pure decimal IPv4
12106|  36.8k|    if (!input.empty() && input.back() == '.') {
  ------------------
  |  Branch (12106:9): [True: 36.8k, False: 0]
  |  Branch (12106:27): [True: 10, False: 36.8k]
  ------------------
12107|     10|      update_base_hostname(input.substr(0, input.size() - 1));
12108|  36.8k|    } else {
12109|  36.8k|      update_base_hostname(input);
12110|  36.8k|    }
12111|  36.8k|    host_type = IPV4;
12112|  36.8k|    is_valid = true;
12113|  36.8k|    ada_log("parse_host fast path decimal ipv4");
12114|  36.8k|    ADA_ASSERT_TRUE(validate());
12115|  36.8k|    return true;
12116|  36.8k|  }
12117|   116k|  uint8_t is_forbidden_or_upper =
12118|   116k|      unicode::contains_forbidden_domain_code_point_or_upper(input.data(),
12119|   116k|                                                             input.size());
12120|       |  // Minor optimization opportunity:
12121|       |  // contains_forbidden_domain_code_point_or_upper could be extend to check for
12122|       |  // the presence of characters that cannot appear in the ipv4 address and we
12123|       |  // could also check whether x and n and - are present, and so we could skip
12124|       |  // some of the checks below. However, the gains are likely to be small, and
12125|       |  // the code would be more complex.
12126|   116k|  static constexpr std::string_view xn_dash{"xn-", 3};
12127|   116k|  if (is_forbidden_or_upper == 0 &&
  ------------------
  |  Branch (12127:7): [True: 112k, False: 3.61k]
  ------------------
12128|   112k|      input.find(xn_dash) == std::string_view::npos) {
  ------------------
  |  Branch (12128:7): [True: 68.8k, False: 44.0k]
  ------------------
12129|       |    // fast path
12130|  68.8k|    update_base_hostname(input);
12131|       |
12132|       |    // Check for other IPv4 formats (hex, octal, etc.)
12133|  68.8k|    if (checkers::is_ipv4(get_hostname())) {
  ------------------
  |  Branch (12133:9): [True: 8.12k, False: 60.6k]
  ------------------
12134|  8.12k|      ada_log("parse_host fast path ipv4");
12135|  8.12k|      return parse_ipv4(get_hostname(), true);
12136|  8.12k|    }
12137|  60.6k|    ada_log("parse_host fast path ", get_hostname());
12138|  60.6k|    is_valid = true;
12139|  60.6k|    return true;
12140|  68.8k|  }
12141|       |  // We have encountered at least one forbidden code point or the input contains
12142|       |  // 'xn-' (case insensitive), so we need to call 'to_ascii' to perform the full
12143|       |  // conversion.
12144|       |
12145|  47.6k|  ada_log("parse_host calling to_ascii");
12146|  47.6k|  std::optional<std::string> host = std::string(get_hostname());
12147|  47.6k|  is_valid = ada::unicode::to_ascii(host, input, input.find('%'));
12148|  47.6k|  if (!is_valid) {
  ------------------
  |  Branch (12148:7): [True: 1.64k, False: 46.0k]
  ------------------
12149|  1.64k|    ada_log("parse_host to_ascii returns false");
12150|  1.64k|    return is_valid = false;
12151|  1.64k|  }
12152|  46.0k|  ada_log("parse_host to_ascii succeeded ", *host, " [", host->size(),
12153|  46.0k|          " bytes]");
12154|       |
12155|  46.0k|  if (std::ranges::any_of(host.value(),
  ------------------
  |  Branch (12155:7): [True: 0, False: 46.0k]
  ------------------
12156|  46.0k|                          ada::unicode::is_forbidden_domain_code_point)) {
12157|      0|    return is_valid = false;
12158|      0|  }
12159|       |
12160|       |  // If asciiDomain ends in a number, then return the result of IPv4 parsing
12161|       |  // asciiDomain.
12162|  46.0k|  if (checkers::is_ipv4(host.value())) {
  ------------------
  |  Branch (12162:7): [True: 206, False: 45.8k]
  ------------------
12163|    206|    ada_log("parse_host got ipv4 ", *host);
12164|    206|    return parse_ipv4(host.value(), false);
12165|    206|  }
12166|       |
12167|  45.8k|  update_base_hostname(host.value());
12168|  45.8k|  ADA_ASSERT_TRUE(validate());
12169|  45.8k|  return true;
12170|  46.0k|}
_ZN3ada7unicode45contains_forbidden_domain_code_point_or_upperEPKcm:
 7038|   116k|                                              size_t length) noexcept {
 7039|   116k|  size_t i = 0;
 7040|   116k|  uint8_t accumulator{};
 7041|   473k|  for (; i + 4 <= length; i += 4) {
  ------------------
  |  Branch (7041:10): [True: 356k, False: 116k]
  ------------------
 7042|   356k|    accumulator |=
 7043|   356k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i])];
 7044|   356k|    accumulator |=
 7045|   356k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i + 1])];
 7046|   356k|    accumulator |=
 7047|   356k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i + 2])];
 7048|   356k|    accumulator |=
 7049|   356k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i + 3])];
 7050|   356k|  }
 7051|   338k|  for (; i < length; i++) {
  ------------------
  |  Branch (7051:10): [True: 222k, False: 116k]
  ------------------
 7052|   222k|    accumulator |=
 7053|   222k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i])];
 7054|   222k|  }
 7055|   116k|  return accumulator;
 7056|   116k|}
_ZN3ada7helpers9substringENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEm:
 8181|  16.3k|                                                       size_t pos) {
 8182|  16.3k|  ADA_ASSERT_TRUE(pos <= input.size());
 8183|       |  // The following is safer but unneeded if we have the above line:
 8184|       |  // return pos > input.size() ? std::string_view() : input.substr(pos);
 8185|  16.3k|  return input.substr(pos);
 8186|  16.3k|}
_ZN3ada14url_aggregator21consume_prepared_pathENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
12977|   150k|inline void url_aggregator::consume_prepared_path(std::string_view input) {
12978|   150k|  ada_log("url_aggregator::consume_prepared_path ", input);
12979|       |  /***
12980|       |   * This is largely duplicated code from helpers::parse_prepared_path, which is
12981|       |   * unfortunate. This particular function is nearly identical, except that it
12982|       |   * is a method on url_aggregator. The idea is that the trivial path (which is
12983|       |   * very common) merely appends to the buffer. This is the same trivial path as
12984|       |   * with helpers::parse_prepared_path, except that we have the additional check
12985|       |   * for is_at_path(). Otherwise, we grab a copy of the current path and we
12986|       |   * modify it, and then insert it back into the buffer.
12987|       |   */
12988|   150k|  uint8_t accumulator = checkers::path_signature(input);
12989|       |  // Let us first detect a trivial case.
12990|       |  // If it is special, we check that we have no dot, no %,  no \ and no
12991|       |  // character needing percent encoding. Otherwise, we check that we have no %,
12992|       |  // no dot, and no character needing percent encoding.
12993|   150k|  constexpr uint8_t need_encoding = 1;
12994|   150k|  constexpr uint8_t backslash_char = 2;
12995|   150k|  constexpr uint8_t dot_char = 4;
12996|   150k|  constexpr uint8_t percent_char = 8;
12997|   150k|  bool special = type != ada::scheme::NOT_SPECIAL;
12998|   150k|  bool may_need_slow_file_handling = (type == ada::scheme::type::FILE &&
  ------------------
  |  Branch (12998:39): [True: 1.14k, False: 149k]
  ------------------
12999|  1.14k|                                      checkers::is_windows_drive_letter(input));
  ------------------
  |  Branch (12999:39): [True: 40, False: 1.10k]
  ------------------
13000|   150k|  bool trivial_path =
13001|   150k|      (special ? (accumulator == 0)
  ------------------
  |  Branch (13001:7): [True: 130k, False: 20.4k]
  |  Branch (13001:8): [True: 150k, False: 624]
  ------------------
13002|   150k|               : ((accumulator & (need_encoding | dot_char | percent_char)) ==
13003|    624|                  0)) &&
13004|   130k|      (!may_need_slow_file_handling);
  ------------------
  |  Branch (13004:7): [True: 130k, False: 13]
  ------------------
13005|   150k|  if (accumulator == dot_char && !may_need_slow_file_handling) {
  ------------------
  |  Branch (13005:7): [True: 9.27k, False: 141k]
  |  Branch (13005:34): [True: 9.24k, False: 22]
  ------------------
13006|       |    // '4' means that we have at least one dot, but nothing that requires
13007|       |    // percent encoding or decoding. The only part that is not trivial is
13008|       |    // that we may have single dots and double dots path segments.
13009|       |    // If we have such segments, then we either have a path that begins
13010|       |    // with '.' (easy to check), or we have the sequence './'.
13011|       |    // Note: input cannot be empty, it must at least contain one character ('.')
13012|       |    // Note: we know that '\' is not present.
13013|  9.24k|    if (input[0] != '.') {
  ------------------
  |  Branch (13013:9): [True: 8.28k, False: 964]
  ------------------
13014|  8.28k|      size_t slashdot = 0;
13015|  8.28k|      bool dot_is_file = true;
13016|  24.3k|      for (;;) {
13017|  24.3k|        slashdot = input.find("/.", slashdot);
13018|  24.3k|        if (slashdot == std::string_view::npos) {  // common case
  ------------------
  |  Branch (13018:13): [True: 8.28k, False: 16.0k]
  ------------------
13019|  8.28k|          break;
13020|  16.0k|        } else {  // uncommon
13021|       |          // only three cases matter: /./, /.. or a final /
13022|  16.0k|          slashdot += 2;
13023|  16.0k|          dot_is_file &= !(slashdot == input.size() || input[slashdot] == '.' ||
  ------------------
  |  Branch (13023:28): [True: 20, False: 16.0k]
  |  Branch (13023:56): [True: 7.89k, False: 8.11k]
  ------------------
13024|  8.11k|                           input[slashdot] == '/');
  ------------------
  |  Branch (13024:28): [True: 7.09k, False: 1.02k]
  ------------------
13025|  16.0k|        }
13026|  24.3k|      }
13027|  8.28k|      trivial_path = dot_is_file;
13028|  8.28k|    }
13029|  9.24k|  }
13030|   150k|  if (trivial_path && is_at_path()) {
  ------------------
  |  Branch (13030:7): [True: 131k, False: 19.5k]
  |  Branch (13030:23): [True: 131k, False: 0]
  ------------------
13031|   131k|    ada_log("parse_path trivial");
13032|   131k|    buffer += '/';
13033|   131k|    buffer += input;
13034|   131k|    return;
13035|   131k|  }
13036|  19.5k|  std::string path = std::string(get_pathname());
13037|       |  // We are going to need to look a bit at the path, but let us see if we can
13038|       |  // ignore percent encoding *and* backslashes *and* percent characters.
13039|       |  // Except for the trivial case, this is likely to capture 99% of paths out
13040|       |  // there.
13041|  19.5k|  bool fast_path =
13042|  19.5k|      (special &&
  ------------------
  |  Branch (13042:8): [True: 19.1k, False: 346]
  ------------------
13043|  19.1k|       (accumulator & (need_encoding | backslash_char | percent_char)) == 0) &&
  ------------------
  |  Branch (13043:8): [True: 8.24k, False: 10.9k]
  ------------------
13044|  8.24k|      (type != ada::scheme::type::FILE);
  ------------------
  |  Branch (13044:7): [True: 8.15k, False: 99]
  ------------------
13045|  19.5k|  if (fast_path) {
  ------------------
  |  Branch (13045:7): [True: 8.15k, False: 11.3k]
  ------------------
13046|  8.15k|    ada_log("parse_prepared_path fast");
13047|       |    // Here we don't need to worry about \ or percent encoding.
13048|       |    // We also do not have a file protocol. We might have dots, however,
13049|       |    // but dots must as appear as '.', and they cannot be encoded because
13050|       |    // the symbol '%' is not present.
13051|  8.15k|    size_t previous_location = 0;  // We start at 0.
13052|  46.5k|    do {
13053|  46.5k|      size_t new_location = input.find('/', previous_location);
13054|       |      // std::string_view path_view = input;
13055|       |      //  We process the last segment separately:
13056|  46.5k|      if (new_location == std::string_view::npos) {
  ------------------
  |  Branch (13056:11): [True: 8.15k, False: 38.3k]
  ------------------
13057|  8.15k|        std::string_view path_view = input.substr(previous_location);
13058|  8.15k|        if (path_view == "..") {  // The path ends with ..
  ------------------
  |  Branch (13058:13): [True: 37, False: 8.11k]
  ------------------
13059|       |          // e.g., if you receive ".." with an empty path, you go to "/".
13060|     37|          if (path.empty()) {
  ------------------
  |  Branch (13060:15): [True: 5, False: 32]
  ------------------
13061|      5|            path = '/';
13062|      5|            update_base_pathname(path);
13063|      5|            return;
13064|      5|          }
13065|       |          // Fast case where we have nothing to do:
13066|     32|          if (path.back() == '/') {
  ------------------
  |  Branch (13066:15): [True: 9, False: 23]
  ------------------
13067|      9|            update_base_pathname(path);
13068|      9|            return;
13069|      9|          }
13070|       |          // If you have the path "/joe/myfriend",
13071|       |          // then you delete 'myfriend'.
13072|     23|          path.resize(path.rfind('/') + 1);
13073|     23|          update_base_pathname(path);
13074|     23|          return;
13075|     32|        }
13076|  8.11k|        path += '/';
13077|  8.11k|        if (path_view != ".") {
  ------------------
  |  Branch (13077:13): [True: 8.08k, False: 29]
  ------------------
13078|  8.08k|          path.append(path_view);
13079|  8.08k|        }
13080|  8.11k|        update_base_pathname(path);
13081|  8.11k|        return;
13082|  38.3k|      } else {
13083|       |        // This is a non-final segment.
13084|  38.3k|        std::string_view path_view =
13085|  38.3k|            input.substr(previous_location, new_location - previous_location);
13086|  38.3k|        previous_location = new_location + 1;
13087|  38.3k|        if (path_view == "..") {
  ------------------
  |  Branch (13087:13): [True: 8.19k, False: 30.2k]
  ------------------
13088|  8.19k|          size_t last_delimiter = path.rfind('/');
13089|  8.19k|          if (last_delimiter != std::string::npos) {
  ------------------
  |  Branch (13089:15): [True: 7.29k, False: 894]
  ------------------
13090|  7.29k|            path.erase(last_delimiter);
13091|  7.29k|          }
13092|  30.2k|        } else if (path_view != ".") {
  ------------------
  |  Branch (13092:20): [True: 22.7k, False: 7.47k]
  ------------------
13093|  22.7k|          path += '/';
13094|  22.7k|          path.append(path_view);
13095|  22.7k|        }
13096|  38.3k|      }
13097|  46.5k|    } while (true);
  ------------------
  |  Branch (13097:14): [True: 38.3k, Folded]
  ------------------
13098|  11.3k|  } else {
13099|  11.3k|    ada_log("parse_path slow");
13100|       |    // we have reached the general case
13101|  11.3k|    bool needs_percent_encoding = (accumulator & 1);
13102|  11.3k|    std::string path_buffer_tmp;
13103|  32.0k|    do {
13104|  32.0k|      size_t location = (special && (accumulator & 2))
  ------------------
  |  Branch (13104:26): [True: 30.4k, False: 1.60k]
  |  Branch (13104:37): [True: 2.21k, False: 28.2k]
  ------------------
13105|  32.0k|                            ? input.find_first_of("/\\")
13106|  32.0k|                            : input.find('/');
13107|  32.0k|      std::string_view path_view = input;
13108|  32.0k|      if (location != std::string_view::npos) {
  ------------------
  |  Branch (13108:11): [True: 20.6k, False: 11.3k]
  ------------------
13109|  20.6k|        path_view.remove_suffix(path_view.size() - location);
13110|  20.6k|        input.remove_prefix(location + 1);
13111|  20.6k|      }
13112|       |      // path_buffer is either path_view or it might point at a percent encoded
13113|       |      // temporary string.
13114|  32.0k|      std::string_view path_buffer =
13115|  32.0k|          (needs_percent_encoding &&
  ------------------
  |  Branch (13115:12): [True: 5.20k, False: 26.8k]
  ------------------
13116|  5.20k|           ada::unicode::percent_encode<false>(
  ------------------
  |  Branch (13116:12): [True: 1.99k, False: 3.20k]
  ------------------
13117|  5.20k|               path_view, character_sets::PATH_PERCENT_ENCODE, path_buffer_tmp))
13118|  32.0k|              ? path_buffer_tmp
13119|  32.0k|              : path_view;
13120|  32.0k|      if (unicode::is_double_dot_path_segment(path_buffer)) {
  ------------------
  |  Branch (13120:11): [True: 8.28k, False: 23.7k]
  ------------------
13121|  8.28k|        helpers::shorten_path(path, type);
13122|  8.28k|        if (location == std::string_view::npos) {
  ------------------
  |  Branch (13122:13): [True: 6.93k, False: 1.34k]
  ------------------
13123|  6.93k|          path += '/';
13124|  6.93k|        }
13125|  23.7k|      } else if (unicode::is_single_dot_path_segment(path_buffer) &&
  ------------------
  |  Branch (13125:18): [True: 903, False: 22.8k]
  ------------------
13126|    903|                 (location == std::string_view::npos)) {
  ------------------
  |  Branch (13126:18): [True: 320, False: 583]
  ------------------
13127|    320|        path += '/';
13128|    320|      }
13129|       |      // Otherwise, if path_buffer is not a single-dot path segment, then:
13130|  23.4k|      else if (!unicode::is_single_dot_path_segment(path_buffer)) {
  ------------------
  |  Branch (13130:16): [True: 22.8k, False: 583]
  ------------------
13131|       |        // If url's scheme is "file", url's path is empty, and path_buffer is a
13132|       |        // Windows drive letter, then replace the second code point in
13133|       |        // path_buffer with U+003A (:).
13134|  22.8k|        if (type == ada::scheme::type::FILE && path.empty() &&
  ------------------
  |  Branch (13134:13): [True: 1.71k, False: 21.1k]
  |  Branch (13134:48): [True: 517, False: 1.19k]
  ------------------
13135|    517|            checkers::is_windows_drive_letter(path_buffer)) {
  ------------------
  |  Branch (13135:13): [True: 42, False: 475]
  ------------------
13136|     42|          path += '/';
13137|     42|          path += path_buffer[0];
13138|     42|          path += ':';
13139|     42|          path_buffer.remove_prefix(2);
13140|     42|          path.append(path_buffer);
13141|  22.8k|        } else {
13142|       |          // Append path_buffer to url's path.
13143|  22.8k|          path += '/';
13144|  22.8k|          path.append(path_buffer);
13145|  22.8k|        }
13146|  22.8k|      }
13147|  32.0k|      if (location == std::string_view::npos) {
  ------------------
  |  Branch (13147:11): [True: 11.3k, False: 20.6k]
  ------------------
13148|  11.3k|        update_base_pathname(path);
13149|  11.3k|        return;
13150|  11.3k|      }
13151|  32.0k|    } while (true);
  ------------------
  |  Branch (13151:14): [True: 20.6k, Folded]
  ------------------
13152|  11.3k|  }
13153|  19.5k|}
_ZN3ada7unicode14to_lower_asciiEPcm:
 6750|   151k|constexpr bool to_lower_ascii(char* input, size_t length) noexcept {
 6751|   151k|  uint64_t broadcast_80 = broadcast(0x80);
 6752|   151k|  uint64_t broadcast_Ap = broadcast(128 - 'A');
 6753|   151k|  uint64_t broadcast_Zp = broadcast(128 - 'Z' - 1);
 6754|   151k|  uint64_t non_ascii = 0;
 6755|   151k|  size_t i = 0;
 6756|       |
 6757|   340k|  for (; i + 7 < length; i += 8) {
  ------------------
  |  Branch (6757:10): [True: 189k, False: 151k]
  ------------------
 6758|   189k|    uint64_t word{};
 6759|   189k|    memcpy(&word, input + i, sizeof(word));
 6760|   189k|    non_ascii |= (word & broadcast_80);
 6761|   189k|    word ^=
 6762|   189k|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
 6763|   189k|    memcpy(input + i, &word, sizeof(word));
 6764|   189k|  }
 6765|   151k|  if (i < length) {
  ------------------
  |  Branch (6765:7): [True: 129k, False: 21.5k]
  ------------------
 6766|   129k|    uint64_t word{};
 6767|   129k|    memcpy(&word, input + i, length - i);
 6768|   129k|    non_ascii |= (word & broadcast_80);
 6769|   129k|    word ^=
 6770|   129k|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
 6771|   129k|    memcpy(input + i, &word, length - i);
 6772|   129k|  }
 6773|   151k|  return non_ascii == 0;
 6774|   151k|}
_ZN3ada7unicode9broadcastEh:
 6746|   453k|constexpr uint64_t broadcast(uint8_t v) noexcept {
 6747|   453k|  return 0x101010101010101ull * v;
 6748|   453k|}
_ZN3ada8checkers7is_ipv4ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   12|   729k|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|   729k|  if (view.ends_with('.')) {
  ------------------
  |  Branch (20:7): [True: 2.56k, False: 726k]
  ------------------
   21|  2.56k|    view.remove_suffix(1);
   22|  2.56k|    if (view.empty()) {
  ------------------
  |  Branch (22:9): [True: 1.58k, False: 976]
  ------------------
   23|  1.58k|      return false;
   24|  1.58k|    }
   25|  2.56k|  }
   26|   727k|  char last_char = view.back();
   27|   727k|  bool possible_ipv4 = (last_char >= '0' && last_char <= '9') ||
  ------------------
  |  Branch (27:25): [True: 725k, False: 1.66k]
  |  Branch (27:45): [True: 17.4k, False: 708k]
  ------------------
   28|   710k|                       (last_char >= 'a' && last_char <= 'f') ||
  ------------------
  |  Branch (28:25): [True: 708k, False: 1.93k]
  |  Branch (28:45): [True: 95.6k, False: 612k]
  ------------------
   29|   614k|                       last_char == 'x';
  ------------------
  |  Branch (29:24): [True: 944, False: 613k]
  ------------------
   30|   727k|  if (!possible_ipv4) {
  ------------------
  |  Branch (30:7): [True: 613k, False: 114k]
  ------------------
   31|   613k|    return false;
   32|   613k|  }
   33|       |  // From the last character, find the last dot.
   34|   114k|  size_t last_dot = view.rfind('.');
   35|   114k|  if (last_dot != std::string_view::npos) {
  ------------------
  |  Branch (35:7): [True: 20.0k, False: 93.9k]
  ------------------
   36|       |    // We have at least one dot.
   37|  20.0k|    view.remove_prefix(last_dot + 1);
   38|  20.0k|  }
   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|   114k|  if (std::ranges::all_of(view, ada::checkers::is_digit)) {
  ------------------
  |  Branch (42:7): [True: 16.3k, False: 97.6k]
  ------------------
   43|  16.3k|    return true;
   44|  16.3k|  }
   45|       |  // It could be hex (0x), but not if there is a single character.
   46|  97.6k|  if (view.size() == 1) {
  ------------------
  |  Branch (46:7): [True: 4.77k, False: 92.8k]
  ------------------
   47|  4.77k|    return false;
   48|  4.77k|  }
   49|       |  // It must start with 0x.
   50|  92.8k|  if (!view.starts_with("0x")) {
  ------------------
  |  Branch (50:7): [True: 91.4k, False: 1.43k]
  ------------------
   51|  91.4k|    return false;
   52|  91.4k|  }
   53|       |  // We must allow "0x".
   54|  1.43k|  if (view.size() == 2) {
  ------------------
  |  Branch (54:7): [True: 68, False: 1.37k]
  ------------------
   55|     68|    return true;
   56|     68|  }
   57|       |  // We have 0x followed by some characters, we need to check that they are
   58|       |  // hexadecimals.
   59|  1.37k|  view.remove_prefix(2);
   60|  1.37k|  return std::ranges::all_of(view, ada::unicode::is_lowercase_hex);
   61|  1.43k|}
_ZN3ada7unicode16is_lowercase_hexEc:
 7157|  11.2k|ada_really_inline constexpr bool is_lowercase_hex(const char c) noexcept {
 7158|  11.2k|  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f');
  ------------------
  |  Branch (7158:11): [True: 10.8k, False: 344]
  |  Branch (7158:23): [True: 6.77k, False: 4.08k]
  |  Branch (7158:37): [True: 4.06k, False: 370]
  |  Branch (7158:49): [True: 3.37k, False: 692]
  ------------------
 7159|  11.2k|}
_ZN3ada6parser25try_parse_simple_absoluteINS_3urlEEEbNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEERT_:
10248|   302k|                                                result_type& out) {
10249|   302k|  constexpr bool is_ada_url = std::is_same_v<result_type, ada::url>;
10250|   302k|  constexpr bool is_aggregator =
10251|   302k|      std::is_same_v<result_type, ada::url_aggregator>;
10252|   302k|  static_assert(is_ada_url || is_aggregator);
10253|       |
10254|   302k|  const size_t len = input.size();
10255|   302k|  if (len < 8) [[unlikely]] {
  ------------------
  |  Branch (10255:7): [True: 34, False: 302k]
  ------------------
10256|     34|    return false;
10257|     34|  }
10258|   302k|  const auto* b = reinterpret_cast<const uint8_t*>(input.data());
10259|       |
10260|   302k|  size_t pos;
10261|   302k|  ada::scheme::type scheme_type;
10262|   302k|  uint32_t protocol_end;
10263|   302k|  if (b[0] == 'h' && b[1] == 't' && b[2] == 't' && b[3] == 'p') {
  ------------------
  |  Branch (10263:7): [True: 298k, False: 3.42k]
  |  Branch (10263:22): [True: 298k, False: 54]
  |  Branch (10263:37): [True: 298k, False: 543]
  |  Branch (10263:52): [True: 298k, False: 27]
  ------------------
10264|   298k|    if (b[4] == ':' && b[5] == '/' && b[6] == '/') {
  ------------------
  |  Branch (10264:9): [True: 49.5k, False: 248k]
  |  Branch (10264:24): [True: 49.0k, False: 480]
  |  Branch (10264:39): [True: 49.0k, False: 76]
  ------------------
10265|  49.0k|      pos = 7;
10266|  49.0k|      scheme_type = ada::scheme::type::HTTP;
10267|  49.0k|      protocol_end = 5;
10268|   249k|    } else if (len >= 8 && b[4] == 's' && b[5] == ':' && b[6] == '/' &&
  ------------------
  |  Branch (10268:16): [True: 249k, False: 0]
  |  Branch (10268:28): [True: 248k, False: 591]
  |  Branch (10268:43): [True: 248k, False: 28]
  |  Branch (10268:58): [True: 247k, False: 638]
  ------------------
10269|   247k|               b[7] == '/') {
  ------------------
  |  Branch (10269:16): [True: 247k, False: 55]
  ------------------
10270|   247k|      pos = 8;
10271|   247k|      scheme_type = ada::scheme::type::HTTPS;
10272|   247k|      protocol_end = 6;
10273|   247k|    } else {
10274|  1.31k|      return false;
10275|  1.31k|    }
10276|   298k|  } else {
10277|  4.04k|    return false;
10278|  4.04k|  }
10279|   296k|  if (pos < len && (b[pos] == '/' || b[pos] == '\\')) [[unlikely]] {
  ------------------
  |  Branch (10279:7): [True: 296k, False: 2]
  |  Branch (10279:21): [True: 88, False: 296k]
  |  Branch (10279:38): [True: 16, False: 296k]
  ------------------
10280|    104|    return false;
10281|    104|  }
10282|       |
10283|       |  // Digit-led hosts are IPv4/numeric; skip before scanning.
10284|   296k|  if (pos < len && b[pos] >= '0' && b[pos] <= '9') {
  ------------------
  |  Branch (10284:7): [True: 296k, False: 2]
  |  Branch (10284:20): [True: 295k, False: 1.56k]
  |  Branch (10284:37): [True: 0, False: 295k]
  ------------------
10285|      0|    return false;
10286|      0|  }
10287|       |
10288|   296k|  const size_t host_start = pos;
10289|   296k|  bool has_upper = false;
10290|   296k|  size_t i = pos;
10291|  3.84M|  for (; i < len; ++i) {
  ------------------
  |  Branch (10291:10): [True: 3.84M, False: 6.88k]
  ------------------
10292|  3.84M|    const uint8_t c = b[i];
10293|  3.84M|    const uint8_t cls = k_host_class[c];
10294|  3.84M|    if (cls == 1) {
  ------------------
  |  Branch (10294:9): [True: 243k, False: 3.59M]
  ------------------
10295|   243k|      break;
10296|   243k|    }
10297|  3.59M|    if (cls == 2) [[unlikely]] {
  ------------------
  |  Branch (10297:9): [True: 46.6k, False: 3.55M]
  ------------------
10298|  46.6k|      return false;
10299|  46.6k|    }
10300|  3.55M|    if (c >= 'A' && c <= 'Z') {
  ------------------
  |  Branch (10300:9): [True: 2.93M, False: 613k]
  |  Branch (10300:21): [True: 49.9k, False: 2.88M]
  ------------------
10301|  49.9k|      has_upper = true;
10302|  49.9k|    }
10303|  3.55M|  }
10304|   250k|  const size_t host_end = i;
10305|   250k|  if (host_start == host_end) [[unlikely]] {
  ------------------
  |  Branch (10305:7): [True: 24, False: 249k]
  ------------------
10306|     24|    return false;
10307|     24|  }
10308|   249k|  const size_t host_len = host_end - host_start;
10309|   249k|  if (host_len > 253) [[unlikely]] {
  ------------------
  |  Branch (10309:7): [True: 240, False: 249k]
  ------------------
10310|    240|    return false;
10311|    240|  }
10312|   249k|  {
10313|   249k|    std::string_view hv(input.data() + host_start, host_len);
10314|   249k|    char host_buf[256];
10315|   249k|    if (has_upper) [[unlikely]] {
  ------------------
  |  Branch (10315:9): [True: 6.88k, False: 242k]
  ------------------
10316|  6.88k|      std::memcpy(host_buf, input.data() + host_start, host_len);
10317|  6.88k|      unicode::to_lower_ascii(host_buf, host_len);
10318|  6.88k|      hv = std::string_view(host_buf, host_len);
10319|  6.88k|    }
10320|   249k|    if (checkers::is_ipv4(hv)) [[unlikely]] {
  ------------------
  |  Branch (10320:9): [True: 31, False: 249k]
  ------------------
10321|     31|      return false;
10322|     31|    }
10323|   249k|    static constexpr std::string_view xn{"xn-", 3};
10324|   249k|    if (hv.find(xn) != std::string_view::npos) [[unlikely]] {
  ------------------
  |  Branch (10324:9): [True: 43.0k, False: 206k]
  ------------------
10325|  43.0k|      return false;
10326|  43.0k|    }
10327|   249k|  }
10328|       |
10329|   206k|  size_t path_start = host_end;
10330|   206k|  size_t path_end = host_end;
10331|   206k|  size_t query_start = std::string_view::npos;
10332|   206k|  size_t hash_start = std::string_view::npos;
10333|   206k|  bool has_path = false;
10334|   206k|  bool path_has_dot = false;
10335|       |
10336|   206k|  if (i < len && b[i] == '/') {
  ------------------
  |  Branch (10336:7): [True: 199k, False: 6.84k]
  |  Branch (10336:18): [True: 186k, False: 13.7k]
  ------------------
10337|   186k|    has_path = true;
10338|   186k|    path_start = i;
10339|   186k|    ++i;
10340|   840k|    for (; i < len; ++i) {
  ------------------
  |  Branch (10340:12): [True: 732k, False: 108k]
  ------------------
10341|   732k|      const uint8_t c = b[i];
10342|   732k|      const uint8_t cls = k_rest[c];
10343|   732k|      if (cls == 0) {
  ------------------
  |  Branch (10343:11): [True: 654k, False: 77.7k]
  ------------------
10344|   654k|        path_has_dot |= (c == '.');
10345|   654k|        continue;
10346|   654k|      }
10347|  77.7k|      if (cls == 1) {
  ------------------
  |  Branch (10347:11): [True: 69.7k, False: 7.97k]
  ------------------
10348|  69.7k|        path_end = i;
10349|  69.7k|        if (c == '?') {
  ------------------
  |  Branch (10349:13): [True: 55.6k, False: 14.0k]
  ------------------
10350|  55.6k|          query_start = i;
10351|  55.6k|          ++i;
10352|  55.6k|          goto scan_query;
10353|  55.6k|        }
10354|  14.0k|        hash_start = i;
10355|  14.0k|        ++i;
10356|  14.0k|        goto scan_hash;
10357|  69.7k|      }
10358|  7.97k|      return false;
10359|  77.7k|    }
10360|   108k|    path_end = i;
10361|   108k|  } else if (i < len && b[i] == '?') {
  ------------------
  |  Branch (10361:14): [True: 13.7k, False: 6.84k]
  |  Branch (10361:25): [True: 6.91k, False: 6.79k]
  ------------------
10362|  6.91k|    query_start = i;
10363|  6.91k|    ++i;
10364|  6.91k|    goto scan_query;
10365|  13.6k|  } else if (i < len && b[i] == '#') {
  ------------------
  |  Branch (10365:14): [True: 6.79k, False: 6.84k]
  |  Branch (10365:25): [True: 6.79k, False: 0]
  ------------------
10366|  6.79k|    hash_start = i;
10367|  6.79k|    ++i;
10368|  6.79k|    goto scan_hash;
10369|  6.79k|  }
10370|   115k|  goto after_rest;
10371|       |
10372|   115k|scan_query:
10373|   493k|  for (; i < len; ++i) {
  ------------------
  |  Branch (10373:10): [True: 452k, False: 40.8k]
  ------------------
10374|   452k|    const uint8_t c = b[i];
10375|   452k|    if (c == '#') {
  ------------------
  |  Branch (10375:9): [True: 21.6k, False: 430k]
  ------------------
10376|  21.6k|      hash_start = i;
10377|  21.6k|      ++i;
10378|  21.6k|      goto scan_hash;
10379|  21.6k|    }
10380|   430k|    if (c == '?' || c == '%') {
  ------------------
  |  Branch (10380:9): [True: 766, False: 429k]
  |  Branch (10380:21): [True: 13.1k, False: 416k]
  ------------------
10381|  13.8k|      continue;
10382|  13.8k|    }
10383|   416k|    if (k_rest[c] == 2) [[unlikely]] {
  ------------------
  |  Branch (10383:9): [True: 83, False: 416k]
  ------------------
10384|     83|      return false;
10385|     83|    }
10386|   416k|  }
10387|  40.8k|  goto after_rest;
10388|       |
10389|  42.4k|scan_hash:
10390|   237k|  for (; i < len; ++i) {
  ------------------
  |  Branch (10390:10): [True: 195k, False: 42.4k]
  ------------------
10391|   195k|    const uint8_t c = b[i];
10392|   195k|    if (c == '?' || c == '#' || c == '%') {
  ------------------
  |  Branch (10392:9): [True: 511, False: 194k]
  |  Branch (10392:21): [True: 519, False: 194k]
  |  Branch (10392:33): [True: 9.09k, False: 184k]
  ------------------
10393|  10.1k|      continue;
10394|  10.1k|    }
10395|   184k|    if (k_rest[c] == 2) [[unlikely]] {
  ------------------
  |  Branch (10395:9): [True: 56, False: 184k]
  ------------------
10396|     56|      return false;
10397|     56|    }
10398|   184k|  }
10399|       |
10400|   198k|after_rest:
10401|   198k|  if (path_has_dot) [[unlikely]] {
  ------------------
  |  Branch (10401:7): [True: 47.4k, False: 151k]
  ------------------
10402|  47.4k|    const std::string_view path_body(input.data() + path_start,
10403|  47.4k|                                     path_end - path_start);
10404|  47.4k|    if (path_body.size() >= 2 && path_body[1] == '.') {
  ------------------
  |  Branch (10404:9): [True: 47.4k, False: 0]
  |  Branch (10404:34): [True: 165, False: 47.2k]
  ------------------
10405|    165|      if (path_body.size() == 2 || path_body[2] == '/' ||
  ------------------
  |  Branch (10405:11): [True: 5, False: 160]
  |  Branch (10405:36): [True: 26, False: 134]
  ------------------
10406|    134|          (path_body.size() >= 3 && path_body[2] == '.' &&
  ------------------
  |  Branch (10406:12): [True: 134, False: 0]
  |  Branch (10406:37): [True: 78, False: 56]
  ------------------
10407|     78|           (path_body.size() == 3 || path_body[3] == '/'))) {
  ------------------
  |  Branch (10407:13): [True: 3, False: 75]
  |  Branch (10407:38): [True: 36, False: 39]
  ------------------
10408|     70|        return false;
10409|     70|      }
10410|    165|    }
10411|  47.3k|    static constexpr std::string_view slash_dot{"/.", 2};
10412|  47.3k|    size_t p = 1;
10413|  49.4k|    while ((p = path_body.find(slash_dot, p)) != std::string_view::npos) {
  ------------------
  |  Branch (10413:12): [True: 8.92k, False: 40.5k]
  ------------------
10414|  8.92k|      const size_t after = p + 2;
10415|  8.92k|      if (after == path_body.size() || path_body[after] == '/' ||
  ------------------
  |  Branch (10415:11): [True: 18, False: 8.90k]
  |  Branch (10415:40): [True: 6.74k, False: 2.15k]
  ------------------
10416|  2.15k|          (after + 1 <= path_body.size() && path_body[after] == '.' &&
  ------------------
  |  Branch (10416:12): [True: 2.15k, False: 0]
  |  Branch (10416:45): [True: 597, False: 1.56k]
  ------------------
10417|  6.80k|           (after + 1 == path_body.size() || path_body[after + 1] == '/'))) {
  ------------------
  |  Branch (10417:13): [True: 17, False: 580]
  |  Branch (10417:46): [True: 22, False: 558]
  ------------------
10418|  6.80k|        return false;
10419|  6.80k|      }
10420|  2.12k|      p = after;
10421|  2.12k|    }
10422|  47.3k|  }
10423|       |
10424|   191k|  const bool need_slash = !has_path;
10425|   191k|  out.type = scheme_type;
10426|   191k|  out.is_valid = true;
10427|   191k|  out.has_opaque_path = false;
10428|   191k|  out.host_type = DEFAULT;
10429|       |
10430|       |  if constexpr (is_aggregator) {
10431|       |    if (!need_slash) {
10432|       |      out.buffer.resize(len);
10433|       |      // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
10434|       |      std::memcpy(out.buffer.data(), input.data(), len);
10435|       |      if (has_upper) {
10436|       |        unicode::to_lower_ascii(out.buffer.data() + host_start,
10437|       |                                host_end - host_start);
10438|       |      }
10439|       |      out.components.protocol_end = protocol_end;
10440|       |      out.components.username_end = protocol_end + 2;
10441|       |      out.components.host_start = protocol_end + 2;
10442|       |      out.components.host_end = static_cast<uint32_t>(host_end);
10443|       |      out.components.port = url_components::omitted;
10444|       |      out.components.pathname_start = static_cast<uint32_t>(path_start);
10445|       |      out.components.search_start = (query_start != std::string_view::npos)
10446|       |                                        ? static_cast<uint32_t>(query_start)
10447|       |                                        : url_components::omitted;
10448|       |      out.components.hash_start = (hash_start != std::string_view::npos)
10449|       |                                      ? static_cast<uint32_t>(hash_start)
10450|       |                                      : url_components::omitted;
10451|       |    } else {
10452|       |      out.buffer.resize(len + 1);
10453|       |      // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
10454|       |      std::memcpy(out.buffer.data(), input.data(), host_end);
10455|       |      out.buffer[host_end] = '/';
10456|       |      if (host_end < len) {
10457|       |        std::memcpy(out.buffer.data() + host_end + 1, input.data() + host_end,
10458|       |                    len - host_end);
10459|       |      }
10460|       |      if (has_upper) {
10461|       |        unicode::to_lower_ascii(out.buffer.data() + host_start,
10462|       |                                host_end - host_start);
10463|       |      }
10464|       |      out.components.protocol_end = protocol_end;
10465|       |      out.components.username_end = protocol_end + 2;
10466|       |      out.components.host_start = protocol_end + 2;
10467|       |      out.components.host_end = static_cast<uint32_t>(host_end);
10468|       |      out.components.port = url_components::omitted;
10469|       |      out.components.pathname_start = static_cast<uint32_t>(host_end);
10470|       |      out.components.search_start = (query_start != std::string_view::npos)
10471|       |                                        ? static_cast<uint32_t>(query_start + 1)
10472|       |                                        : url_components::omitted;
10473|       |      out.components.hash_start = (hash_start != std::string_view::npos)
10474|       |                                      ? static_cast<uint32_t>(hash_start + 1)
10475|       |                                      : url_components::omitted;
10476|       |    }
10477|   191k|  } else {
10478|   191k|    std::string host_str(input.substr(host_start, host_end - host_start));
10479|   191k|    if (has_upper) {
  ------------------
  |  Branch (10479:9): [True: 6.76k, False: 184k]
  ------------------
10480|  6.76k|      unicode::to_lower_ascii(host_str.data(), host_str.size());
10481|  6.76k|    }
10482|   191k|    out.host = std::move(host_str);
10483|   191k|    if (need_slash) {
  ------------------
  |  Branch (10483:9): [True: 20.4k, False: 171k]
  ------------------
10484|  20.4k|      out.path = "/";
10485|   171k|    } else {
10486|   171k|      out.path.assign(input.data() + path_start, path_end - path_start);
10487|   171k|    }
10488|   191k|    if (query_start != std::string_view::npos) {
  ------------------
  |  Branch (10488:9): [True: 62.4k, False: 129k]
  ------------------
10489|  62.4k|      const size_t q_end =
10490|  62.4k|          (hash_start != std::string_view::npos) ? hash_start : len;
  ------------------
  |  Branch (10490:11): [True: 21.5k, False: 40.8k]
  ------------------
10491|  62.4k|      out.query.emplace(input.data() + query_start + 1,
10492|  62.4k|                        q_end - query_start - 1);
10493|  62.4k|    }
10494|   191k|    if (hash_start != std::string_view::npos) {
  ------------------
  |  Branch (10494:9): [True: 42.3k, False: 149k]
  ------------------
10495|  42.3k|      out.hash.emplace(input.data() + hash_start + 1, len - hash_start - 1);
10496|  42.3k|    }
10497|   191k|  }
10498|   191k|  return true;
10499|   198k|}
_ZN3ada3url12parse_schemeILb0EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
 9527|   156k|ada_really_inline bool url::parse_scheme(const std::string_view input) {
 9528|   156k|  auto parsed_type = ada::scheme::get_scheme_type(input);
 9529|   156k|  bool is_input_special = (parsed_type != ada::scheme::NOT_SPECIAL);
 9530|       |  /**
 9531|       |   * In the common case, we will immediately recognize a special scheme (e.g.,
 9532|       |   *http, https), in which case, we can go really fast.
 9533|       |   **/
 9534|   156k|  if (is_input_special) {  // fast path!!!
  ------------------
  |  Branch (9534:7): [True: 152k, False: 3.76k]
  ------------------
 9535|       |    if constexpr (has_state_override) {
 9536|       |      // If url's scheme is not a special scheme and buffer is a special scheme,
 9537|       |      // then return.
 9538|       |      if (is_special() != is_input_special) {
 9539|       |        return false;
 9540|       |      }
 9541|       |
 9542|       |      // If url includes credentials or has a non-null port, and buffer is
 9543|       |      // "file", then return.
 9544|       |      if ((has_credentials() || port.has_value()) &&
 9545|       |          parsed_type == ada::scheme::type::FILE) {
 9546|       |        return false;
 9547|       |      }
 9548|       |
 9549|       |      // If url's scheme is "file" and its host is an empty host, then return.
 9550|       |      // An empty host is the empty string.
 9551|       |      if (type == ada::scheme::type::FILE && host.has_value() &&
 9552|       |          host->empty()) {
 9553|       |        return false;
 9554|       |      }
 9555|       |    }
 9556|       |
 9557|   152k|    type = parsed_type;
 9558|       |
 9559|       |    if constexpr (has_state_override) {
 9560|       |      // This is uncommon.
 9561|       |      uint16_t urls_scheme_port = get_special_port();
 9562|       |
 9563|       |      if (urls_scheme_port) {
 9564|       |        // If url's port is url's scheme's default port, then set url's port to
 9565|       |        // null.
 9566|       |        if (port.has_value() && *port == urls_scheme_port) {
 9567|       |          port = std::nullopt;
 9568|       |        }
 9569|       |      }
 9570|       |    }
 9571|   152k|  } else {  // slow path
 9572|  3.76k|    std::string _buffer(input);
 9573|       |    // Next function is only valid if the input is ASCII and returns false
 9574|       |    // otherwise, but it seems that we always have ascii content so we do not
 9575|       |    // need to check the return value.
 9576|       |    // bool is_ascii =
 9577|  3.76k|    unicode::to_lower_ascii(_buffer.data(), _buffer.size());
 9578|       |
 9579|       |    if constexpr (has_state_override) {
 9580|       |      // The state-override validation errors below ("return" in the WHATWG URL
 9581|       |      // parser) leave the URL unchanged. The setter contract is
 9582|       |      // "true on success, false if the scheme is invalid" -- the fast path
 9583|       |      // above already returns false here, so the slow path must agree.
 9584|       |
 9585|       |      // If url's scheme is a special scheme and buffer is not a special scheme,
 9586|       |      // then return. If url's scheme is not a special scheme and buffer is a
 9587|       |      // special scheme, then return.
 9588|       |      if (is_special() != ada::scheme::is_special(_buffer)) {
 9589|       |        return false;
 9590|       |      }
 9591|       |
 9592|       |      // If url includes credentials or has a non-null port, and buffer is
 9593|       |      // "file", then return.
 9594|       |      if ((has_credentials() || port.has_value()) && _buffer == "file") {
 9595|       |        return false;
 9596|       |      }
 9597|       |
 9598|       |      // If url's scheme is "file" and its host is an empty host, then return.
 9599|       |      // An empty host is the empty string.
 9600|       |      if (type == ada::scheme::type::FILE && host.has_value() &&
 9601|       |          host->empty()) {
 9602|       |        return false;
 9603|       |      }
 9604|       |    }
 9605|       |
 9606|  3.76k|    set_scheme(std::move(_buffer));
 9607|       |
 9608|       |    if constexpr (has_state_override) {
 9609|       |      // This is uncommon.
 9610|       |      uint16_t urls_scheme_port = get_special_port();
 9611|       |
 9612|       |      if (urls_scheme_port) {
 9613|       |        // If url's port is url's scheme's default port, then set url's port to
 9614|       |        // null.
 9615|       |        if (port.has_value() && *port == urls_scheme_port) {
 9616|       |          port = std::nullopt;
 9617|       |        }
 9618|       |      }
 9619|       |    }
 9620|  3.76k|  }
 9621|       |
 9622|   156k|  return true;
 9623|   156k|}
_ZN3ada6parser25try_parse_simple_absoluteINS_14url_aggregatorEEEbNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEERT_:
10248|   302k|                                                result_type& out) {
10249|   302k|  constexpr bool is_ada_url = std::is_same_v<result_type, ada::url>;
10250|   302k|  constexpr bool is_aggregator =
10251|   302k|      std::is_same_v<result_type, ada::url_aggregator>;
10252|   302k|  static_assert(is_ada_url || is_aggregator);
10253|       |
10254|   302k|  const size_t len = input.size();
10255|   302k|  if (len < 8) [[unlikely]] {
  ------------------
  |  Branch (10255:7): [True: 34, False: 302k]
  ------------------
10256|     34|    return false;
10257|     34|  }
10258|   302k|  const auto* b = reinterpret_cast<const uint8_t*>(input.data());
10259|       |
10260|   302k|  size_t pos;
10261|   302k|  ada::scheme::type scheme_type;
10262|   302k|  uint32_t protocol_end;
10263|   302k|  if (b[0] == 'h' && b[1] == 't' && b[2] == 't' && b[3] == 'p') {
  ------------------
  |  Branch (10263:7): [True: 298k, False: 3.42k]
  |  Branch (10263:22): [True: 298k, False: 54]
  |  Branch (10263:37): [True: 298k, False: 543]
  |  Branch (10263:52): [True: 298k, False: 27]
  ------------------
10264|   298k|    if (b[4] == ':' && b[5] == '/' && b[6] == '/') {
  ------------------
  |  Branch (10264:9): [True: 49.5k, False: 248k]
  |  Branch (10264:24): [True: 49.0k, False: 480]
  |  Branch (10264:39): [True: 49.0k, False: 76]
  ------------------
10265|  49.0k|      pos = 7;
10266|  49.0k|      scheme_type = ada::scheme::type::HTTP;
10267|  49.0k|      protocol_end = 5;
10268|   249k|    } else if (len >= 8 && b[4] == 's' && b[5] == ':' && b[6] == '/' &&
  ------------------
  |  Branch (10268:16): [True: 249k, False: 0]
  |  Branch (10268:28): [True: 248k, False: 591]
  |  Branch (10268:43): [True: 248k, False: 28]
  |  Branch (10268:58): [True: 247k, False: 638]
  ------------------
10269|   247k|               b[7] == '/') {
  ------------------
  |  Branch (10269:16): [True: 247k, False: 55]
  ------------------
10270|   247k|      pos = 8;
10271|   247k|      scheme_type = ada::scheme::type::HTTPS;
10272|   247k|      protocol_end = 6;
10273|   247k|    } else {
10274|  1.31k|      return false;
10275|  1.31k|    }
10276|   298k|  } else {
10277|  4.04k|    return false;
10278|  4.04k|  }
10279|   296k|  if (pos < len && (b[pos] == '/' || b[pos] == '\\')) [[unlikely]] {
  ------------------
  |  Branch (10279:7): [True: 296k, False: 2]
  |  Branch (10279:21): [True: 88, False: 296k]
  |  Branch (10279:38): [True: 16, False: 296k]
  ------------------
10280|    104|    return false;
10281|    104|  }
10282|       |
10283|       |  // Digit-led hosts are IPv4/numeric; skip before scanning.
10284|   296k|  if (pos < len && b[pos] >= '0' && b[pos] <= '9') {
  ------------------
  |  Branch (10284:7): [True: 296k, False: 2]
  |  Branch (10284:20): [True: 295k, False: 1.56k]
  |  Branch (10284:37): [True: 0, False: 295k]
  ------------------
10285|      0|    return false;
10286|      0|  }
10287|       |
10288|   296k|  const size_t host_start = pos;
10289|   296k|  bool has_upper = false;
10290|   296k|  size_t i = pos;
10291|  3.84M|  for (; i < len; ++i) {
  ------------------
  |  Branch (10291:10): [True: 3.84M, False: 6.88k]
  ------------------
10292|  3.84M|    const uint8_t c = b[i];
10293|  3.84M|    const uint8_t cls = k_host_class[c];
10294|  3.84M|    if (cls == 1) {
  ------------------
  |  Branch (10294:9): [True: 243k, False: 3.59M]
  ------------------
10295|   243k|      break;
10296|   243k|    }
10297|  3.59M|    if (cls == 2) [[unlikely]] {
  ------------------
  |  Branch (10297:9): [True: 46.6k, False: 3.55M]
  ------------------
10298|  46.6k|      return false;
10299|  46.6k|    }
10300|  3.55M|    if (c >= 'A' && c <= 'Z') {
  ------------------
  |  Branch (10300:9): [True: 2.93M, False: 613k]
  |  Branch (10300:21): [True: 49.9k, False: 2.88M]
  ------------------
10301|  49.9k|      has_upper = true;
10302|  49.9k|    }
10303|  3.55M|  }
10304|   250k|  const size_t host_end = i;
10305|   250k|  if (host_start == host_end) [[unlikely]] {
  ------------------
  |  Branch (10305:7): [True: 24, False: 249k]
  ------------------
10306|     24|    return false;
10307|     24|  }
10308|   249k|  const size_t host_len = host_end - host_start;
10309|   249k|  if (host_len > 253) [[unlikely]] {
  ------------------
  |  Branch (10309:7): [True: 240, False: 249k]
  ------------------
10310|    240|    return false;
10311|    240|  }
10312|   249k|  {
10313|   249k|    std::string_view hv(input.data() + host_start, host_len);
10314|   249k|    char host_buf[256];
10315|   249k|    if (has_upper) [[unlikely]] {
  ------------------
  |  Branch (10315:9): [True: 6.88k, False: 242k]
  ------------------
10316|  6.88k|      std::memcpy(host_buf, input.data() + host_start, host_len);
10317|  6.88k|      unicode::to_lower_ascii(host_buf, host_len);
10318|  6.88k|      hv = std::string_view(host_buf, host_len);
10319|  6.88k|    }
10320|   249k|    if (checkers::is_ipv4(hv)) [[unlikely]] {
  ------------------
  |  Branch (10320:9): [True: 31, False: 249k]
  ------------------
10321|     31|      return false;
10322|     31|    }
10323|   249k|    static constexpr std::string_view xn{"xn-", 3};
10324|   249k|    if (hv.find(xn) != std::string_view::npos) [[unlikely]] {
  ------------------
  |  Branch (10324:9): [True: 43.0k, False: 206k]
  ------------------
10325|  43.0k|      return false;
10326|  43.0k|    }
10327|   249k|  }
10328|       |
10329|   206k|  size_t path_start = host_end;
10330|   206k|  size_t path_end = host_end;
10331|   206k|  size_t query_start = std::string_view::npos;
10332|   206k|  size_t hash_start = std::string_view::npos;
10333|   206k|  bool has_path = false;
10334|   206k|  bool path_has_dot = false;
10335|       |
10336|   206k|  if (i < len && b[i] == '/') {
  ------------------
  |  Branch (10336:7): [True: 199k, False: 6.84k]
  |  Branch (10336:18): [True: 186k, False: 13.7k]
  ------------------
10337|   186k|    has_path = true;
10338|   186k|    path_start = i;
10339|   186k|    ++i;
10340|   840k|    for (; i < len; ++i) {
  ------------------
  |  Branch (10340:12): [True: 732k, False: 108k]
  ------------------
10341|   732k|      const uint8_t c = b[i];
10342|   732k|      const uint8_t cls = k_rest[c];
10343|   732k|      if (cls == 0) {
  ------------------
  |  Branch (10343:11): [True: 654k, False: 77.7k]
  ------------------
10344|   654k|        path_has_dot |= (c == '.');
10345|   654k|        continue;
10346|   654k|      }
10347|  77.7k|      if (cls == 1) {
  ------------------
  |  Branch (10347:11): [True: 69.7k, False: 7.97k]
  ------------------
10348|  69.7k|        path_end = i;
10349|  69.7k|        if (c == '?') {
  ------------------
  |  Branch (10349:13): [True: 55.6k, False: 14.0k]
  ------------------
10350|  55.6k|          query_start = i;
10351|  55.6k|          ++i;
10352|  55.6k|          goto scan_query;
10353|  55.6k|        }
10354|  14.0k|        hash_start = i;
10355|  14.0k|        ++i;
10356|  14.0k|        goto scan_hash;
10357|  69.7k|      }
10358|  7.97k|      return false;
10359|  77.7k|    }
10360|   108k|    path_end = i;
10361|   108k|  } else if (i < len && b[i] == '?') {
  ------------------
  |  Branch (10361:14): [True: 13.7k, False: 6.84k]
  |  Branch (10361:25): [True: 6.91k, False: 6.79k]
  ------------------
10362|  6.91k|    query_start = i;
10363|  6.91k|    ++i;
10364|  6.91k|    goto scan_query;
10365|  13.6k|  } else if (i < len && b[i] == '#') {
  ------------------
  |  Branch (10365:14): [True: 6.79k, False: 6.84k]
  |  Branch (10365:25): [True: 6.79k, False: 0]
  ------------------
10366|  6.79k|    hash_start = i;
10367|  6.79k|    ++i;
10368|  6.79k|    goto scan_hash;
10369|  6.79k|  }
10370|   115k|  goto after_rest;
10371|       |
10372|   115k|scan_query:
10373|   493k|  for (; i < len; ++i) {
  ------------------
  |  Branch (10373:10): [True: 452k, False: 40.8k]
  ------------------
10374|   452k|    const uint8_t c = b[i];
10375|   452k|    if (c == '#') {
  ------------------
  |  Branch (10375:9): [True: 21.6k, False: 430k]
  ------------------
10376|  21.6k|      hash_start = i;
10377|  21.6k|      ++i;
10378|  21.6k|      goto scan_hash;
10379|  21.6k|    }
10380|   430k|    if (c == '?' || c == '%') {
  ------------------
  |  Branch (10380:9): [True: 766, False: 429k]
  |  Branch (10380:21): [True: 13.1k, False: 416k]
  ------------------
10381|  13.8k|      continue;
10382|  13.8k|    }
10383|   416k|    if (k_rest[c] == 2) [[unlikely]] {
  ------------------
  |  Branch (10383:9): [True: 83, False: 416k]
  ------------------
10384|     83|      return false;
10385|     83|    }
10386|   416k|  }
10387|  40.8k|  goto after_rest;
10388|       |
10389|  42.4k|scan_hash:
10390|   237k|  for (; i < len; ++i) {
  ------------------
  |  Branch (10390:10): [True: 195k, False: 42.4k]
  ------------------
10391|   195k|    const uint8_t c = b[i];
10392|   195k|    if (c == '?' || c == '#' || c == '%') {
  ------------------
  |  Branch (10392:9): [True: 511, False: 194k]
  |  Branch (10392:21): [True: 519, False: 194k]
  |  Branch (10392:33): [True: 9.09k, False: 184k]
  ------------------
10393|  10.1k|      continue;
10394|  10.1k|    }
10395|   184k|    if (k_rest[c] == 2) [[unlikely]] {
  ------------------
  |  Branch (10395:9): [True: 56, False: 184k]
  ------------------
10396|     56|      return false;
10397|     56|    }
10398|   184k|  }
10399|       |
10400|   198k|after_rest:
10401|   198k|  if (path_has_dot) [[unlikely]] {
  ------------------
  |  Branch (10401:7): [True: 47.4k, False: 151k]
  ------------------
10402|  47.4k|    const std::string_view path_body(input.data() + path_start,
10403|  47.4k|                                     path_end - path_start);
10404|  47.4k|    if (path_body.size() >= 2 && path_body[1] == '.') {
  ------------------
  |  Branch (10404:9): [True: 47.4k, False: 0]
  |  Branch (10404:34): [True: 165, False: 47.2k]
  ------------------
10405|    165|      if (path_body.size() == 2 || path_body[2] == '/' ||
  ------------------
  |  Branch (10405:11): [True: 5, False: 160]
  |  Branch (10405:36): [True: 26, False: 134]
  ------------------
10406|    134|          (path_body.size() >= 3 && path_body[2] == '.' &&
  ------------------
  |  Branch (10406:12): [True: 134, False: 0]
  |  Branch (10406:37): [True: 78, False: 56]
  ------------------
10407|     78|           (path_body.size() == 3 || path_body[3] == '/'))) {
  ------------------
  |  Branch (10407:13): [True: 3, False: 75]
  |  Branch (10407:38): [True: 36, False: 39]
  ------------------
10408|     70|        return false;
10409|     70|      }
10410|    165|    }
10411|  47.3k|    static constexpr std::string_view slash_dot{"/.", 2};
10412|  47.3k|    size_t p = 1;
10413|  49.4k|    while ((p = path_body.find(slash_dot, p)) != std::string_view::npos) {
  ------------------
  |  Branch (10413:12): [True: 8.92k, False: 40.5k]
  ------------------
10414|  8.92k|      const size_t after = p + 2;
10415|  8.92k|      if (after == path_body.size() || path_body[after] == '/' ||
  ------------------
  |  Branch (10415:11): [True: 18, False: 8.90k]
  |  Branch (10415:40): [True: 6.74k, False: 2.15k]
  ------------------
10416|  2.15k|          (after + 1 <= path_body.size() && path_body[after] == '.' &&
  ------------------
  |  Branch (10416:12): [True: 2.15k, False: 0]
  |  Branch (10416:45): [True: 597, False: 1.56k]
  ------------------
10417|  6.80k|           (after + 1 == path_body.size() || path_body[after + 1] == '/'))) {
  ------------------
  |  Branch (10417:13): [True: 17, False: 580]
  |  Branch (10417:46): [True: 22, False: 558]
  ------------------
10418|  6.80k|        return false;
10419|  6.80k|      }
10420|  2.12k|      p = after;
10421|  2.12k|    }
10422|  47.3k|  }
10423|       |
10424|   191k|  const bool need_slash = !has_path;
10425|   191k|  out.type = scheme_type;
10426|   191k|  out.is_valid = true;
10427|   191k|  out.has_opaque_path = false;
10428|   191k|  out.host_type = DEFAULT;
10429|       |
10430|   191k|  if constexpr (is_aggregator) {
10431|   191k|    if (!need_slash) {
  ------------------
  |  Branch (10431:9): [True: 171k, False: 20.4k]
  ------------------
10432|   171k|      out.buffer.resize(len);
10433|       |      // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
10434|   171k|      std::memcpy(out.buffer.data(), input.data(), len);
10435|   171k|      if (has_upper) {
  ------------------
  |  Branch (10435:11): [True: 6.71k, False: 164k]
  ------------------
10436|  6.71k|        unicode::to_lower_ascii(out.buffer.data() + host_start,
10437|  6.71k|                                host_end - host_start);
10438|  6.71k|      }
10439|   171k|      out.components.protocol_end = protocol_end;
10440|   171k|      out.components.username_end = protocol_end + 2;
10441|   171k|      out.components.host_start = protocol_end + 2;
10442|   171k|      out.components.host_end = static_cast<uint32_t>(host_end);
10443|   171k|      out.components.port = url_components::omitted;
10444|   171k|      out.components.pathname_start = static_cast<uint32_t>(path_start);
10445|   171k|      out.components.search_start = (query_start != std::string_view::npos)
  ------------------
  |  Branch (10445:37): [True: 55.5k, False: 115k]
  ------------------
10446|   171k|                                        ? static_cast<uint32_t>(query_start)
10447|   171k|                                        : url_components::omitted;
10448|   171k|      out.components.hash_start = (hash_start != std::string_view::npos)
  ------------------
  |  Branch (10448:35): [True: 35.4k, False: 135k]
  ------------------
10449|   171k|                                      ? static_cast<uint32_t>(hash_start)
10450|   171k|                                      : url_components::omitted;
10451|   171k|    } else {
10452|  20.4k|      out.buffer.resize(len + 1);
10453|       |      // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
10454|  20.4k|      std::memcpy(out.buffer.data(), input.data(), host_end);
10455|  20.4k|      out.buffer[host_end] = '/';
10456|  20.4k|      if (host_end < len) {
  ------------------
  |  Branch (10456:11): [True: 13.6k, False: 6.84k]
  ------------------
10457|  13.6k|        std::memcpy(out.buffer.data() + host_end + 1, input.data() + host_end,
10458|  13.6k|                    len - host_end);
10459|  13.6k|      }
10460|  20.4k|      if (has_upper) {
  ------------------
  |  Branch (10460:11): [True: 48, False: 20.4k]
  ------------------
10461|     48|        unicode::to_lower_ascii(out.buffer.data() + host_start,
10462|     48|                                host_end - host_start);
10463|     48|      }
10464|  20.4k|      out.components.protocol_end = protocol_end;
10465|  20.4k|      out.components.username_end = protocol_end + 2;
10466|  20.4k|      out.components.host_start = protocol_end + 2;
10467|  20.4k|      out.components.host_end = static_cast<uint32_t>(host_end);
10468|  20.4k|      out.components.port = url_components::omitted;
10469|  20.4k|      out.components.pathname_start = static_cast<uint32_t>(host_end);
10470|  20.4k|      out.components.search_start = (query_start != std::string_view::npos)
  ------------------
  |  Branch (10470:37): [True: 6.85k, False: 13.6k]
  ------------------
10471|  20.4k|                                        ? static_cast<uint32_t>(query_start + 1)
10472|  20.4k|                                        : url_components::omitted;
10473|  20.4k|      out.components.hash_start = (hash_start != std::string_view::npos)
  ------------------
  |  Branch (10473:35): [True: 6.86k, False: 13.5k]
  ------------------
10474|  20.4k|                                      ? static_cast<uint32_t>(hash_start + 1)
10475|  20.4k|                                      : url_components::omitted;
10476|  20.4k|    }
10477|       |  } else {
10478|       |    std::string host_str(input.substr(host_start, host_end - host_start));
10479|       |    if (has_upper) {
10480|       |      unicode::to_lower_ascii(host_str.data(), host_str.size());
10481|       |    }
10482|       |    out.host = std::move(host_str);
10483|       |    if (need_slash) {
10484|       |      out.path = "/";
10485|       |    } else {
10486|       |      out.path.assign(input.data() + path_start, path_end - path_start);
10487|       |    }
10488|       |    if (query_start != std::string_view::npos) {
10489|       |      const size_t q_end =
10490|       |          (hash_start != std::string_view::npos) ? hash_start : len;
10491|       |      out.query.emplace(input.data() + query_start + 1,
10492|       |                        q_end - query_start - 1);
10493|       |    }
10494|       |    if (hash_start != std::string_view::npos) {
10495|       |      out.hash.emplace(input.data() + hash_start + 1, len - hash_start - 1);
10496|       |    }
10497|       |  }
10498|   191k|  return true;
10499|   198k|}
_ZN3ada14url_aggregator23parse_scheme_with_colonILb0EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
11593|   156k|    const std::string_view input_with_colon) {
11594|   156k|  ada_log("url_aggregator::parse_scheme_with_colon ", input_with_colon);
11595|   156k|  ADA_ASSERT_TRUE(validate());
11596|   156k|  ADA_ASSERT_TRUE(!helpers::overlaps(input_with_colon, buffer));
11597|   156k|  std::string_view input{input_with_colon};
11598|   156k|  input.remove_suffix(1);
11599|   156k|  auto parsed_type = ada::scheme::get_scheme_type(input);
11600|   156k|  const bool is_input_special = (parsed_type != ada::scheme::NOT_SPECIAL);
11601|       |  /**
11602|       |   * In the common case, we will immediately recognize a special scheme (e.g.,
11603|       |   *http, https), in which case, we can go really fast.
11604|       |   **/
11605|   156k|  if (is_input_special) {  // fast path!!!
  ------------------
  |  Branch (11605:7): [True: 152k, False: 3.76k]
  ------------------
11606|       |    if constexpr (has_state_override) {
11607|       |      // If url's scheme is not a special scheme and buffer is a special scheme,
11608|       |      // then return.
11609|       |      if (is_special() != is_input_special) {
11610|       |        return false;
11611|       |      }
11612|       |
11613|       |      // If url includes credentials or has a non-null port, and buffer is
11614|       |      // "file", then return.
11615|       |      if ((has_credentials() || components.port != url_components::omitted) &&
11616|       |          parsed_type == ada::scheme::type::FILE) {
11617|       |        return false;
11618|       |      }
11619|       |
11620|       |      // If url's scheme is "file" and its host is an empty host, then return.
11621|       |      // An empty host is the empty string.
11622|       |      if (type == ada::scheme::type::FILE &&
11623|       |          components.host_start == components.host_end) {
11624|       |        return false;
11625|       |      }
11626|       |    }
11627|       |
11628|   152k|    type = parsed_type;
11629|   152k|    set_scheme_from_view_with_colon(input_with_colon);
11630|       |
11631|       |    if constexpr (has_state_override) {
11632|       |      // This is uncommon.
11633|       |      uint16_t urls_scheme_port = get_special_port();
11634|       |
11635|       |      if (urls_scheme_port) {
11636|       |        // If url's port is url's scheme's default port, then set url's port to
11637|       |        // null.
11638|       |        if (components.port == urls_scheme_port) {
11639|       |          clear_port();
11640|       |        }
11641|       |      }
11642|       |    }
11643|   152k|  } else {  // slow path
11644|  3.76k|    std::string _buffer(input);
11645|       |    // Next function is only valid if the input is ASCII and returns false
11646|       |    // otherwise, but it seems that we always have ascii content so we do not
11647|       |    // need to check the return value.
11648|  3.76k|    unicode::to_lower_ascii(_buffer.data(), _buffer.size());
11649|       |
11650|       |    if constexpr (has_state_override) {
11651|       |      // The state-override validation errors below ("return" in the WHATWG URL
11652|       |      // parser) leave the URL unchanged. The setter contract is
11653|       |      // "true on success, false if the scheme is invalid" -- the fast path
11654|       |      // above already returns false here, so the slow path must agree.
11655|       |
11656|       |      // If url's scheme is a special scheme and buffer is not a special scheme,
11657|       |      // then return. If url's scheme is not a special scheme and buffer is a
11658|       |      // special scheme, then return.
11659|       |      if (is_special() != ada::scheme::is_special(_buffer)) {
11660|       |        return false;
11661|       |      }
11662|       |
11663|       |      // If url includes credentials or has a non-null port, and buffer is
11664|       |      // "file", then return.
11665|       |      if ((has_credentials() || components.port != url_components::omitted) &&
11666|       |          _buffer == "file") {
11667|       |        return false;
11668|       |      }
11669|       |
11670|       |      // If url's scheme is "file" and its host is an empty host, then return.
11671|       |      // An empty host is the empty string.
11672|       |      if (type == ada::scheme::type::FILE &&
11673|       |          components.host_start == components.host_end) {
11674|       |        return false;
11675|       |      }
11676|       |    }
11677|       |
11678|  3.76k|    set_scheme(_buffer);
11679|       |
11680|       |    if constexpr (has_state_override) {
11681|       |      // This is uncommon.
11682|       |      uint16_t urls_scheme_port = get_special_port();
11683|       |
11684|       |      if (urls_scheme_port) {
11685|       |        // If url's port is url's scheme's default port, then set url's port to
11686|       |        // null.
11687|       |        if (components.port == urls_scheme_port) {
11688|       |          clear_port();
11689|       |        }
11690|       |      }
11691|       |    }
11692|  3.76k|  }
11693|   156k|  ADA_ASSERT_TRUE(validate());
11694|   156k|  return true;
11695|   156k|}
_ZN3ada14url_aggregator31set_scheme_from_view_with_colonENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
11719|   152k|    std::string_view new_scheme_with_colon) {
11720|   152k|  ada_log("url_aggregator::set_scheme_from_view_with_colon ",
11721|   152k|          new_scheme_with_colon);
11722|   152k|  ADA_ASSERT_TRUE(validate());
11723|   152k|  ADA_ASSERT_TRUE(!new_scheme_with_colon.empty() &&
11724|   152k|                  new_scheme_with_colon.back() == ':');
11725|       |  // next line could overflow but unsigned arithmetic has well-defined
11726|       |  // overflows.
11727|   152k|  uint32_t new_difference =
11728|   152k|      uint32_t(new_scheme_with_colon.size()) - components.protocol_end;
11729|       |
11730|   152k|  if (buffer.empty()) {
  ------------------
  |  Branch (11730:7): [True: 152k, False: 0]
  ------------------
11731|   152k|    buffer.append(new_scheme_with_colon);
11732|   152k|  } else {
11733|      0|    buffer.erase(0, components.protocol_end);
11734|      0|    buffer.insert(0, new_scheme_with_colon);
11735|      0|  }
11736|   152k|  components.protocol_end += new_difference;
11737|       |
11738|   152k|  apply_shifted_non_scheme_offsets(components, new_difference);
11739|   152k|  ADA_ASSERT_TRUE(validate());
11740|   152k|}
_ZN3ada14url_aggregator10set_schemeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
11742|  3.76k|inline void url_aggregator::set_scheme(std::string_view new_scheme) {
11743|  3.76k|  ada_log("url_aggregator::set_scheme ", new_scheme);
11744|  3.76k|  ADA_ASSERT_TRUE(validate());
11745|  3.76k|  ADA_ASSERT_TRUE(new_scheme.empty() || new_scheme.back() != ':');
11746|       |  // next line could overflow but unsigned arithmetic has well-defined
11747|       |  // overflows.
11748|  3.76k|  uint32_t new_difference =
11749|  3.76k|      uint32_t(new_scheme.size()) - components.protocol_end + 1;
11750|       |
11751|  3.76k|  type = ada::scheme::get_scheme_type(new_scheme);
11752|  3.76k|  if (buffer.empty()) {
  ------------------
  |  Branch (11752:7): [True: 3.76k, False: 0]
  ------------------
11753|  3.76k|    buffer.append(helpers::concat(new_scheme, ":"));
11754|  3.76k|  } else {
11755|      0|    buffer.erase(0, components.protocol_end);
11756|      0|    buffer.insert(0, helpers::concat(new_scheme, ":"));
11757|      0|  }
11758|  3.76k|  components.protocol_end = uint32_t(new_scheme.size() + 1);
11759|       |
11760|  3.76k|  apply_shifted_non_scheme_offsets(components, new_difference);
11761|  3.76k|  ADA_ASSERT_TRUE(validate());
11762|  3.76k|}

_ZN3ada37url_pattern_compile_component_optionsC2ENSt3__18optionalIcEES3_:
 5632|      6|      : delimiter(new_delimiter), prefix(new_prefix) {}
_ZN3ada14character_sets6bit_atEPKhh:
 1074|  1.14M|ada_really_inline constexpr bool bit_at(const uint8_t a[], const uint8_t i) {
 1075|  1.14M|  return !!(a[i >> 3] & (1 << (i & 7)));
 1076|  1.14M|}
_ZN2tl10unexpectedIN3ada6errorsEEC2EOS2_:
 2087|  10.8k|  constexpr explicit unexpected(E&& e) : m_val(std::move(e)) {}
_ZN2tl8expectedIN3ada3urlENS1_6errorsEEC2IS3_TnPNSt3__19enable_ifIXsr3std16is_constructibleIS3_OT_EE5valueEvE4typeELPv0ETnPNS7_IXsr3std14is_convertibleIS9_S3_EE5valueEvE4typeELSD_0EEEONS_10unexpectedIS8_EE:
 3573|  2.70k|      : impl_base(unexpect, std::move(e.value())),
 3574|  2.70k|        ctor_base(detail::default_constructor_tag{}) {}
_ZNR2tl10unexpectedIN3ada6errorsEE5valueEv:
 2101|  5.40k|  TL_EXPECTED_11_CONSTEXPR E& value() & { return m_val; }
_ZN2tl6detail21expected_storage_baseIN3ada3urlENS2_6errorsELb0ELb1EEC2IJS4_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS4_DpOT_EE5valueEvE4typeELPv0EEENS_10unexpect_tESB_:
 2559|  2.70k|      : m_unexpect(std::forward<Args>(args)...), m_has_val(false) {}
_ZN2tl6detail26expected_default_ctor_baseIN3ada3urlENS2_6errorsELb1EEC2ENS0_23default_constructor_tagE:
 3177|   347k|  constexpr explicit expected_default_ctor_base(default_constructor_tag) {}
_ZN2tl8expectedIN3ada3urlENS1_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_:
 3659|   345k|      : expected(in_place, std::forward<U>(v)) {}
_ZN2tl8expectedIN3ada3urlENS1_6errorsEEC2IJS2_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS2_DpOT_EE5valueEvE4typeELPv0EEENS_10in_place_tESA_:
 3532|   345k|      : impl_base(in_place, std::forward<Args>(args)...),
 3533|   345k|        ctor_base(detail::default_constructor_tag{}) {}
_ZN2tl6detail21expected_storage_baseIN3ada3urlENS2_6errorsELb0ELb1EEC2IJS3_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS3_DpOT_EE5valueEvE4typeELPv0EEENS_10in_place_tESB_:
 2547|   345k|      : m_val(std::forward<Args>(args)...), m_has_val(true) {}
_ZN3ada3urlC2EOS0_:
 4928|   345k|  url(url&& u) noexcept = default;
_ZN3ada8url_baseD2Ev:
 1591|  1.38M|  virtual ~url_base() = default;
_ZN3ada3urlD2Ev:
 4931|   693k|  ~url() override = default;
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEC2IS3_TnPNSt3__19enable_ifIXsr3std16is_constructibleIS3_OT_EE5valueEvE4typeELPv0ETnPNS7_IXsr3std14is_convertibleIS9_S3_EE5valueEvE4typeELSD_0EEEONS_10unexpectedIS8_EE:
 3573|  2.70k|      : impl_base(unexpect, std::move(e.value())),
 3574|  2.70k|        ctor_base(detail::default_constructor_tag{}) {}
_ZN2tl6detail21expected_storage_baseIN3ada14url_aggregatorENS2_6errorsELb0ELb1EEC2IJS4_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS4_DpOT_EE5valueEvE4typeELPv0EEENS_10unexpect_tESB_:
 2559|  2.70k|      : m_unexpect(std::forward<Args>(args)...), m_has_val(false) {}
_ZN2tl6detail26expected_default_ctor_baseIN3ada14url_aggregatorENS2_6errorsELb1EEC2ENS0_23default_constructor_tagE:
 3177|   347k|  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_:
 3659|   345k|      : expected(in_place, std::forward<U>(v)) {}
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEC2IJS2_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS2_DpOT_EE5valueEvE4typeELPv0EEENS_10in_place_tESA_:
 3532|   345k|      : impl_base(in_place, std::forward<Args>(args)...),
 3533|   345k|        ctor_base(detail::default_constructor_tag{}) {}
_ZN2tl6detail21expected_storage_baseIN3ada14url_aggregatorENS2_6errorsELb0ELb1EEC2IJS3_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS3_DpOT_EE5valueEvE4typeELPv0EEENS_10in_place_tESB_:
 2547|   345k|      : m_val(std::forward<Args>(args)...), m_has_val(true) {}
_ZN3ada14url_aggregatorC2EOS0_:
 7645|   345k|  url_aggregator(url_aggregator&& u) noexcept = default;
_ZN3ada14url_aggregatorD2Ev:
 7648|   693k|  ~url_aggregator() override = default;
_ZN3ada6scheme15get_scheme_typeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6663|   319k|constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept {
 6664|   319k|  if (scheme.empty()) {
  ------------------
  |  Branch (6664:7): [True: 0, False: 319k]
  ------------------
 6665|      0|    return ada::scheme::NOT_SPECIAL;
 6666|      0|  }
 6667|   319k|  int hash_value = (2 * scheme.size() + (unsigned)(scheme[0])) & 7;
 6668|   319k|  const std::string_view target = details::is_special_list[hash_value];
 6669|   319k|  if (scheme.size() == target.size() &&
  ------------------
  |  Branch (6669:7): [True: 315k, False: 4.02k]
  ------------------
 6670|   315k|      details::branchless_load5(scheme.data(), scheme.size()) ==
  ------------------
  |  Branch (6670:7): [True: 309k, False: 6.26k]
  ------------------
 6671|   315k|          details::scheme_keys[hash_value]) {
 6672|   309k|    return ada::scheme::type(hash_value);
 6673|   309k|  } else {
 6674|  10.2k|    return ada::scheme::NOT_SPECIAL;
 6675|  10.2k|  }
 6676|   319k|}
_ZN3ada6scheme7details16branchless_load5EPKcm:
 6604|   315k|inline uint64_t branchless_load5(const char* p, size_t n) {
 6605|   315k|  uint64_t input = (uint8_t)p[0];
 6606|   315k|  input |= ((uint64_t)(uint8_t)p[n > 1] << 8) & (0 - (uint64_t)(n > 1));
 6607|   315k|  input |= ((uint64_t)(uint8_t)p[(n > 2) * 2] << 16) & (0 - (uint64_t)(n > 2));
 6608|   315k|  input |= ((uint64_t)(uint8_t)p[(n > 3) * 3] << 24) & (0 - (uint64_t)(n > 3));
 6609|   315k|  input |= ((uint64_t)(uint8_t)p[(n > 4) * 4] << 32) & (0 - (uint64_t)(n > 4));
 6610|   315k|  return input;
 6611|   315k|}
_ZN3ada14url_aggregatorC2Ev:
 7643|   347k|  url_aggregator() = default;
_ZN3ada14url_componentsC2Ev:
 4837|   347k|  url_components() = default;
_ZN3ada8checkers19try_parse_ipv4_fastENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1344|   323k|try_parse_ipv4_fast(std::string_view input) noexcept {
 1345|   323k|  const size_t len = input.size();
 1346|       |  // Shortest pure decimal: "0.0.0.0" (7). Longest + trailing dot: 16.
 1347|   323k|  if (len < 7 || len > 16) [[unlikely]] {
  ------------------
  |  Branch (1347:7): [True: 80.4k, False: 242k]
  |  Branch (1347:18): [True: 5.83k, False: 237k]
  ------------------
 1348|  86.2k|    return ipv4_fast_fail;
 1349|  86.2k|  }
 1350|   237k|  const char* data = input.data();
 1351|       |
 1352|       |#if defined(ADA_AVX512)
 1353|       |  return detail::try_parse_ipv4_avx512(data, len);
 1354|       |#else
 1355|   237k|  return detail::parse_ipv4_decimal_scalar(data, data + len);
 1356|   323k|#endif
 1357|   323k|}
_ZN3ada8checkers6detail25parse_ipv4_decimal_scalarEPKcS3_:
 1244|   237k|parse_ipv4_decimal_scalar(const char* p, const char* pend) noexcept {
 1245|   237k|  uint32_t ipv4 = 0;
 1246|   533k|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (1246:19): [True: 459k, False: 73.9k]
  ------------------
 1247|   459k|    if (p == pend) [[unlikely]] {
  ------------------
  |  Branch (1247:9): [True: 14, False: 459k]
  ------------------
 1248|     14|      return ipv4_fast_fail;
 1249|     14|    }
 1250|   459k|    uint32_t val;
 1251|   459k|    char c = *p;
 1252|   459k|    if (c >= '0' && c <= '9') [[likely]] {
  ------------------
  |  Branch (1252:9): [True: 458k, False: 902]
  |  Branch (1252:21): [True: 299k, False: 159k]
  ------------------
 1253|   299k|      val = static_cast<uint32_t>(c - '0');
 1254|   299k|      ++p;
 1255|   299k|    } else {
 1256|   160k|      return ipv4_fast_fail;
 1257|   160k|    }
 1258|   299k|    if (p < pend) {
  ------------------
  |  Branch (1258:9): [True: 226k, False: 72.9k]
  ------------------
 1259|   226k|      c = *p;
 1260|   226k|      if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (1260:11): [True: 118k, False: 107k]
  |  Branch (1260:23): [True: 118k, False: 668]
  ------------------
 1261|   118k|        if (val == 0) [[unlikely]] {
  ------------------
  |  Branch (1261:13): [True: 306, False: 117k]
  ------------------
 1262|    306|          return ipv4_fast_fail;
 1263|    306|        }
 1264|   117k|        val = val * 10u + static_cast<uint32_t>(c - '0');
 1265|   117k|        ++p;
 1266|   117k|        if (p < pend) {
  ------------------
  |  Branch (1266:13): [True: 117k, False: 308]
  ------------------
 1267|   117k|          c = *p;
 1268|   117k|          if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (1268:15): [True: 116k, False: 652]
  |  Branch (1268:27): [True: 116k, False: 122]
  ------------------
 1269|   116k|            val = val * 10u + static_cast<uint32_t>(c - '0');
 1270|   116k|            ++p;
 1271|   116k|            if (val > 255u) [[unlikely]] {
  ------------------
  |  Branch (1271:17): [True: 1.21k, False: 115k]
  ------------------
 1272|  1.21k|              return ipv4_fast_fail;
 1273|  1.21k|            }
 1274|   116k|          }
 1275|   117k|        }
 1276|   117k|      }
 1277|   226k|    }
 1278|   297k|    ipv4 = (ipv4 << 8) | val;
 1279|   297k|    if (i < 3) {
  ------------------
  |  Branch (1279:9): [True: 223k, False: 73.9k]
  ------------------
 1280|   223k|      if (p == pend || *p != '.') [[unlikely]] {
  ------------------
  |  Branch (1280:11): [True: 96, False: 223k]
  |  Branch (1280:24): [True: 866, False: 222k]
  ------------------
 1281|    962|        return ipv4_fast_fail;
 1282|    962|      }
 1283|   222k|      ++p;
 1284|   222k|    }
 1285|   297k|  }
 1286|  73.9k|  if (p != pend) {
  ------------------
  |  Branch (1286:7): [True: 328, False: 73.6k]
  ------------------
 1287|    328|    if (p == pend - 1 && *p == '.') {
  ------------------
  |  Branch (1287:9): [True: 178, False: 150]
  |  Branch (1287:26): [True: 20, False: 158]
  ------------------
 1288|     20|      return ipv4;
 1289|     20|    }
 1290|    308|    return ipv4_fast_fail;
 1291|    328|  }
 1292|  73.6k|  return ipv4;
 1293|  73.9k|}
_ZNK3ada3url15has_credentialsEv:
 7181|   889k|[[nodiscard]] ada_really_inline bool url::has_credentials() const noexcept {
 7182|   889k|  return !username.empty() || !password.empty();
  ------------------
  |  Branch (7182:10): [True: 146k, False: 742k]
  |  Branch (7182:31): [True: 734, False: 742k]
  ------------------
 7183|   889k|}
_ZNK3ada8url_base10is_specialEv:
 7146|  3.49M|    const noexcept {
 7147|  3.49M|  return type != ada::scheme::NOT_SPECIAL;
 7148|  3.49M|}
_ZNK2tl8expectedIN3ada3urlENS1_6errorsEEcvbEv:
 3972|   347k|  constexpr explicit operator bool() const noexcept { return this->m_has_val; }
_ZN2tl8expectedIN3ada3urlENS1_6errorsEEptEv:
 3941|   575k|  TL_EXPECTED_11_CONSTEXPR T* operator->() {
 3942|   575k|    TL_ASSERT(has_value());
  ------------------
  |  | 1994|   575k|#define TL_ASSERT(x) assert(x)
  ------------------
  |  Branch (3942:5): [True: 575k, False: 0]
  ------------------
 3943|   575k|    return valptr();
 3944|   575k|  }
_ZN2tl8expectedIN3ada3urlENS1_6errorsEE6valptrEv:
 3237|   575k|  T* valptr() { return std::addressof(this->m_val); }
_ZN2tl6detail21expected_storage_baseIN3ada3urlENS2_6errorsELb0ELb1EED2Ev:
 2569|   347k|  ~expected_storage_base() {
 2570|   347k|    if (m_has_val) {
  ------------------
  |  Branch (2570:9): [True: 345k, False: 2.70k]
  ------------------
 2571|   345k|      m_val.~T();
 2572|   345k|    }
 2573|   347k|  }
_ZNK3ada3url13get_href_sizeEv:
 7436|   786k|[[nodiscard]] inline size_t url::get_href_size() const noexcept {
 7437|   786k|  size_t size = 0;
 7438|   786k|  if (is_special()) {
  ------------------
  |  Branch (7438:7): [True: 781k, False: 4.80k]
  ------------------
 7439|   781k|    size += ada::scheme::details::is_special_list[type].size() + 1;
 7440|   781k|  } else {
 7441|  4.80k|    size += non_special_scheme.size() + 1;
 7442|  4.80k|  }
 7443|   786k|  if (host.has_value()) {
  ------------------
  |  Branch (7443:7): [True: 783k, False: 2.92k]
  ------------------
 7444|   783k|    size += host->size();
 7445|   783k|    size += 2;
 7446|   783k|    if (has_credentials()) {
  ------------------
  |  Branch (7446:9): [True: 95.1k, False: 688k]
  ------------------
 7447|  95.1k|      size += username.size();
 7448|  95.1k|      if (!password.empty()) {
  ------------------
  |  Branch (7448:11): [True: 91.6k, False: 3.48k]
  ------------------
 7449|  91.6k|        size += 1 + password.size();
 7450|  91.6k|      }
 7451|  95.1k|      size += 1;
 7452|  95.1k|    }
 7453|   783k|    if (port.has_value()) {
  ------------------
  |  Branch (7453:9): [True: 97.0k, False: 686k]
  ------------------
 7454|  97.0k|      size += 1;
 7455|  97.0k|      uint16_t p = *port;
 7456|  97.0k|      size += (p >= 10000)  ? 5
  ------------------
  |  Branch (7456:15): [True: 3.37k, False: 93.6k]
  ------------------
 7457|  97.0k|              : (p >= 1000) ? 4
  ------------------
  |  Branch (7457:17): [True: 89.3k, False: 4.31k]
  ------------------
 7458|  93.6k|              : (p >= 100)  ? 3
  ------------------
  |  Branch (7458:17): [True: 270, False: 4.04k]
  ------------------
 7459|  4.31k|              : (p >= 10)   ? 2
  ------------------
  |  Branch (7459:17): [True: 264, False: 3.77k]
  ------------------
 7460|  4.04k|                            : 1;
 7461|  97.0k|    }
 7462|   783k|  } else if (!has_opaque_path && path.starts_with("//")) {
  ------------------
  |  Branch (7462:14): [True: 1.09k, False: 1.82k]
  |  Branch (7462:34): [True: 46, False: 1.05k]
  ------------------
 7463|     46|    size += 2;
 7464|     46|  }
 7465|   786k|  size += path.size();
 7466|   786k|  if (query.has_value()) {
  ------------------
  |  Branch (7466:7): [True: 142k, False: 643k]
  ------------------
 7467|   142k|    size += 1 + query->size();
 7468|   142k|  }
 7469|   786k|  if (hash.has_value()) {
  ------------------
  |  Branch (7469:7): [True: 104k, False: 681k]
  ------------------
 7470|   104k|    size += 1 + hash->size();
 7471|   104k|  }
 7472|   786k|  return size;
 7473|   786k|}
_ZN3ada8checkers8is_alphaEc:
 1224|   316k|constexpr bool is_alpha(char x) noexcept {
 1225|   316k|  return (to_lower(x) >= 'a') && (to_lower(x) <= 'z');
  ------------------
  |  Branch (1225:10): [True: 315k, False: 1.49k]
  |  Branch (1225:34): [True: 315k, False: 56]
  ------------------
 1226|   316k|}
_ZN3ada8checkers8to_lowerEc:
 1222|   631k|constexpr char to_lower(char x) noexcept { return (x | 0x20); }
_ZNR2tl8expectedIN3ada3urlENS1_6errorsEEdeIS2_TnPNSt3__19enable_ifIXntsr3std7is_voidIT_EE5valueEvE4typeELPv0EEERS8_v:
 3954|   575k|  TL_EXPECTED_11_CONSTEXPR U& operator*() & {
 3955|   575k|    TL_ASSERT(has_value());
  ------------------
  |  | 1994|   575k|#define TL_ASSERT(x) assert(x)
  ------------------
  |  Branch (3955:5): [True: 575k, False: 0]
  ------------------
 3956|   575k|    return val();
 3957|   575k|  }
_ZN2tl8expectedIN3ada3urlENS1_6errorsEE3valIS2_TnPNSt3__19enable_ifIXntsr3std7is_voidIT_EE5valueEvE4typeELPv0EEERS8_v:
 3246|   575k|  TL_EXPECTED_11_CONSTEXPR U& val() {
 3247|   575k|    return this->m_val;
 3248|   575k|  }
_ZN3ada3urlaSERKS0_:
 4930|   115k|  url& operator=(const url& u) = default;
_ZNK2tl8expectedIN3ada3urlENS1_6errorsEE9has_valueEv:
 3971|  1.38M|  constexpr bool has_value() const noexcept { return this->m_has_val; }
_ZN3ada3urlC2Ev:
 4926|   347k|  url() = default;
_ZN3ada3url26update_unencoded_base_hashENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 7286|  9.52k|inline void url::update_unencoded_base_hash(std::string_view input) {
 7287|       |  // We do the percent encoding
 7288|  9.52k|  hash = unicode::percent_encode(input,
 7289|  9.52k|                                 ada::character_sets::FRAGMENT_PERCENT_ENCODE);
 7290|  9.52k|}
_ZN3ada3url18update_base_searchENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKh:
 7293|  9.53k|                                    const uint8_t query_percent_encode_set[]) {
 7294|  9.53k|  query = ada::unicode::percent_encode(input, query_percent_encode_set);
 7295|  9.53k|}
_ZN3ada3url20update_base_hostnameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 7284|     42|inline void url::update_base_hostname(std::string_view input) { host = input; }
_ZN3ada3url20update_base_pathnameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 7301|  2.59k|inline void url::update_base_pathname(const std::string_view input) {
 7302|  2.59k|  path = input;
 7303|  2.59k|}
_ZN3ada3url10parse_portENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEb:
 7476|  23.1k|                                         bool check_trailing_content) noexcept {
 7477|  23.1k|  ada_log("parse_port('", view, "') ", view.size());
 7478|  23.1k|  if (!view.empty() && view[0] == '-') {
  ------------------
  |  Branch (7478:7): [True: 23.0k, False: 145]
  |  Branch (7478:24): [True: 5, False: 23.0k]
  ------------------
 7479|      5|    ada_log("parse_port: view[0] == '0' && view.size() > 1");
 7480|      5|    is_valid = false;
 7481|      5|    return 0;
 7482|      5|  }
 7483|  23.1k|  uint16_t parsed_port{};
 7484|  23.1k|  auto r = std::from_chars(view.data(), view.data() + view.size(), parsed_port);
 7485|  23.1k|  if (r.ec == std::errc::result_out_of_range) {
  ------------------
  |  Branch (7485:7): [True: 21, False: 23.1k]
  ------------------
 7486|     21|    ada_log("parse_port: r.ec == std::errc::result_out_of_range");
 7487|     21|    is_valid = false;
 7488|     21|    return 0;
 7489|     21|  }
 7490|  23.1k|  ada_log("parse_port: ", parsed_port);
 7491|  23.1k|  const auto consumed = size_t(r.ptr - view.data());
 7492|  23.1k|  ada_log("parse_port: consumed ", consumed);
 7493|  23.1k|  if (check_trailing_content) {
  ------------------
  |  Branch (7493:7): [True: 23.1k, False: 0]
  ------------------
 7494|  23.1k|    is_valid &=
 7495|  23.1k|        (consumed == view.size() || view[consumed] == '/' ||
  ------------------
  |  Branch (7495:10): [True: 388, False: 22.7k]
  |  Branch (7495:37): [True: 22.4k, False: 279]
  ------------------
 7496|    279|         view[consumed] == '?' || (is_special() && view[consumed] == '\\'));
  ------------------
  |  Branch (7496:10): [True: 109, False: 170]
  |  Branch (7496:36): [True: 162, False: 8]
  |  Branch (7496:52): [True: 53, False: 109]
  ------------------
 7497|  23.1k|  }
 7498|  23.1k|  ada_log("parse_port: is_valid = ", is_valid);
 7499|  23.1k|  if (is_valid) {
  ------------------
  |  Branch (7499:7): [True: 23.0k, False: 117]
  ------------------
 7500|       |    // scheme_default_port can return 0, and we should allow 0 as a base port.
 7501|  23.0k|    auto default_port = scheme_default_port();
 7502|  23.0k|    bool is_port_valid = (default_port == 0 && parsed_port == 0) ||
  ------------------
  |  Branch (7502:27): [True: 99, False: 22.9k]
  |  Branch (7502:48): [True: 30, False: 69]
  ------------------
 7503|  22.9k|                         (default_port != parsed_port);
  ------------------
  |  Branch (7503:26): [True: 22.9k, False: 3]
  ------------------
 7504|  23.0k|    port = (r.ec == std::errc() && is_port_valid) ? std::optional(parsed_port)
  ------------------
  |  Branch (7504:13): [True: 22.8k, False: 223]
  |  Branch (7504:36): [True: 22.8k, False: 3]
  ------------------
 7505|  23.0k|                                                  : std::nullopt;
 7506|  23.0k|  }
 7507|  23.1k|  return consumed;
 7508|  23.1k|}
_ZNK3ada8url_base19scheme_default_portEv:
 7155|  46.0k|url_base::scheme_default_port() const noexcept {
 7156|  46.0k|  return scheme::get_special_port(type);
 7157|  46.0k|}
_ZN3ada6scheme16get_special_portENS0_4typeE:
 6660|  46.0k|constexpr uint16_t get_special_port(ada::scheme::type type) noexcept {
 6661|  46.0k|  return details::special_ports[int(type)];
 6662|  46.0k|}
_ZNK3ada3url12get_pathnameEv:
 7207|   115k|[[nodiscard]] constexpr std::string_view url::get_pathname() const noexcept {
 7208|   115k|  return path;
 7209|   115k|}
_ZN3ada8checkers23is_windows_drive_letterENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1228|  5.51k|constexpr bool is_windows_drive_letter(std::string_view input) noexcept {
 1229|  5.51k|  return input.size() >= 2 &&
  ------------------
  |  Branch (1229:10): [True: 4.17k, False: 1.33k]
  ------------------
 1230|  4.17k|         (is_alpha(input[0]) && ((input[1] == ':') || (input[1] == '|'))) &&
  ------------------
  |  Branch (1230:11): [True: 2.70k, False: 1.47k]
  |  Branch (1230:34): [True: 372, False: 2.33k]
  |  Branch (1230:55): [True: 104, False: 2.22k]
  ------------------
 1231|    476|         ((input.size() == 2) || (input[2] == '/' || input[2] == '\\' ||
  ------------------
  |  Branch (1231:11): [True: 100, False: 376]
  |  Branch (1231:35): [True: 64, False: 312]
  |  Branch (1231:54): [True: 2, False: 310]
  ------------------
 1232|    310|                                  input[2] == '?' || input[2] == '#'));
  ------------------
  |  Branch (1232:35): [True: 0, False: 310]
  |  Branch (1232:54): [True: 0, False: 310]
  ------------------
 1233|  5.51k|}
_ZN3ada8checkers34is_normalized_windows_drive_letterENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1236|    150|    std::string_view input) noexcept {
 1237|    150|  return input.size() == 2 && (is_alpha(input[0]) && (input[1] == ':'));
  ------------------
  |  Branch (1237:10): [True: 50, False: 100]
  |  Branch (1237:32): [True: 36, False: 14]
  |  Branch (1237:54): [True: 22, False: 14]
  ------------------
 1238|    150|}
_ZN3ada3url20set_protocol_as_fileEv:
 7329|  1.26k|constexpr void url::set_protocol_as_file() { type = ada::scheme::type::FILE; }
_ZN3ada7helpers14leading_zeroesEj:
 1876|   163k|inline int leading_zeroes(uint32_t input_num) noexcept {
 1877|       |#if ADA_REGULAR_VISUAL_STUDIO
 1878|       |  unsigned long leading_zero(0);
 1879|       |  unsigned long in(input_num);
 1880|       |  return _BitScanReverse(&leading_zero, in) ? int(31 - leading_zero) : 32;
 1881|       |#else
 1882|   163k|  return __builtin_clz(input_num);
 1883|   163k|#endif  // ADA_REGULAR_VISUAL_STUDIO
 1884|   163k|}
_ZN3ada14url_aggregator7reserveEj:
 8866|   156k|constexpr void ada::url_aggregator::reserve(uint32_t capacity) {
 8867|   156k|  buffer.reserve(capacity);
 8868|   156k|}
_ZN3ada14url_aggregator20update_base_pathnameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8356|  22.1k|inline void url_aggregator::update_base_pathname(const std::string_view input) {
 8357|  22.1k|  ada_log("url_aggregator::update_base_pathname '", input, "' [", input.size(),
 8358|  22.1k|          " bytes] \n", to_diagram());
 8359|  22.1k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8360|  22.1k|  ADA_ASSERT_TRUE(validate());
 8361|       |
 8362|  22.1k|  const bool begins_with_dashdash = input.starts_with("//");
 8363|  22.1k|  if (!begins_with_dashdash && has_dash_dot()) {
  ------------------
  |  Branch (8363:7): [True: 21.7k, False: 398]
  |  Branch (8363:32): [True: 0, False: 21.7k]
  ------------------
 8364|       |    // We must delete the ./
 8365|      0|    delete_dash_dot();
 8366|      0|  }
 8367|       |
 8368|  22.1k|  if (begins_with_dashdash && !has_opaque_path && !has_authority() &&
  ------------------
  |  Branch (8368:7): [True: 398, False: 21.7k]
  |  Branch (8368:31): [True: 398, False: 0]
  |  Branch (8368:51): [True: 12, False: 386]
  ------------------
 8369|     12|      !has_dash_dot()) {
  ------------------
  |  Branch (8369:7): [True: 12, False: 0]
  ------------------
 8370|       |    // If url's host is null, url does not have an opaque path, url's path's
 8371|       |    // size is greater than 1, then append U+002F (/) followed by U+002E (.) to
 8372|       |    // output.
 8373|     12|    buffer.insert(components.pathname_start, "/.");
 8374|     12|    components.pathname_start += 2;
 8375|     12|    if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8375:9): [True: 0, False: 12]
  ------------------
 8376|      0|      components.search_start += 2;
 8377|      0|    }
 8378|     12|    if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8378:9): [True: 0, False: 12]
  ------------------
 8379|      0|      components.hash_start += 2;
 8380|      0|    }
 8381|     12|  }
 8382|       |
 8383|  22.1k|  uint32_t difference = replace_and_resize(
 8384|  22.1k|      components.pathname_start,
 8385|  22.1k|      components.pathname_start + get_pathname_length(), input);
 8386|  22.1k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8386:7): [True: 0, False: 22.1k]
  ------------------
 8387|      0|    components.search_start += difference;
 8388|      0|  }
 8389|  22.1k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8389:7): [True: 0, False: 22.1k]
  ------------------
 8390|      0|    components.hash_start += difference;
 8391|      0|  }
 8392|  22.1k|  ADA_ASSERT_TRUE(validate());
 8393|  22.1k|}
_ZN3ada14url_aggregator18replace_and_resizeEjjNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8199|   184k|    uint32_t start, uint32_t end, std::string_view input) {
 8200|   184k|  uint32_t current_length = end - start;
 8201|   184k|  uint32_t input_size = uint32_t(input.size());
 8202|   184k|  uint32_t new_difference = input_size - current_length;
 8203|       |
 8204|   184k|  if (current_length == 0) {
  ------------------
  |  Branch (8204:7): [True: 153k, False: 30.2k]
  ------------------
 8205|   153k|    buffer.insert(start, input);
 8206|   153k|  } else if (input_size == current_length) {
  ------------------
  |  Branch (8206:14): [True: 524, False: 29.7k]
  ------------------
 8207|    524|    buffer.replace(start, input_size, input);
 8208|  29.7k|  } else if (input_size < current_length) {
  ------------------
  |  Branch (8208:14): [True: 42, False: 29.6k]
  ------------------
 8209|     42|    buffer.erase(start, current_length - input_size);
 8210|     42|    buffer.replace(start, input_size, input);
 8211|  29.6k|  } else {
 8212|  29.6k|    buffer.replace(start, current_length, input.substr(0, current_length));
 8213|  29.6k|    buffer.insert(start + current_length, input.substr(current_length));
 8214|  29.6k|  }
 8215|       |
 8216|   184k|  return new_difference;
 8217|   184k|}
_ZNK3ada14url_aggregator19get_pathname_lengthEv:
 8248|  22.1k|url_aggregator::get_pathname_length() const noexcept {
 8249|  22.1k|  ada_log("url_aggregator::get_pathname_length");
 8250|  22.1k|  uint32_t ending_index = uint32_t(buffer.size());
 8251|  22.1k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8251:7): [True: 0, False: 22.1k]
  ------------------
 8252|      0|    ending_index = components.search_start;
 8253|  22.1k|  } else if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8253:14): [True: 0, False: 22.1k]
  ------------------
 8254|      0|    ending_index = components.hash_start;
 8255|      0|  }
 8256|  22.1k|  return ending_index - components.pathname_start;
 8257|  22.1k|}
_ZNK3ada14url_aggregator12get_pathnameEv:
 9193|   134k|    ada_lifetime_bound {
 9194|   134k|  ada_log("url_aggregator::get_pathname pathname_start = ",
 9195|   134k|          components.pathname_start, " buffer.size() = ", buffer.size(),
 9196|   134k|          " components.search_start = ", components.search_start,
 9197|   134k|          " components.hash_start = ", components.hash_start);
 9198|   134k|  auto ending_index = uint32_t(buffer.size());
 9199|   134k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (9199:7): [True: 23.9k, False: 110k]
  ------------------
 9200|  23.9k|    ending_index = components.search_start;
 9201|   110k|  } else if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (9201:14): [True: 7.77k, False: 102k]
  ------------------
 9202|  7.77k|    ending_index = components.hash_start;
 9203|  7.77k|  }
 9204|   134k|  return helpers::substring(buffer, components.pathname_start, ending_index);
 9205|   134k|}
_ZN3ada14url_aggregator26update_unencoded_base_hashENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8175|  9.52k|inline void url_aggregator::update_unencoded_base_hash(std::string_view input) {
 8176|  9.52k|  ada_log("url_aggregator::update_unencoded_base_hash ", input, " [",
 8177|  9.52k|          input.size(), " bytes], buffer is '", buffer, "' [", buffer.size(),
 8178|  9.52k|          " bytes] components.hash_start = ", components.hash_start);
 8179|  9.52k|  ADA_ASSERT_TRUE(validate());
 8180|  9.52k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8181|  9.52k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8181:7): [True: 0, False: 9.52k]
  ------------------
 8182|      0|    buffer.resize(components.hash_start);
 8183|      0|  }
 8184|  9.52k|  components.hash_start = uint32_t(buffer.size());
 8185|  9.52k|  buffer += "#";
 8186|  9.52k|  bool encoding_required = unicode::percent_encode<true>(
 8187|  9.52k|      input, ada::character_sets::FRAGMENT_PERCENT_ENCODE, buffer);
 8188|       |  // When encoding_required is false, then buffer is left unchanged, and percent
 8189|       |  // encoding was not deemed required.
 8190|  9.52k|  if (!encoding_required) {
  ------------------
  |  Branch (8190:7): [True: 9.41k, False: 116]
  ------------------
 8191|  9.41k|    buffer.append(input);
 8192|  9.41k|  }
 8193|  9.52k|  ada_log("url_aggregator::update_unencoded_base_hash final buffer is '",
 8194|  9.52k|          buffer, "' [", buffer.size(), " bytes]");
 8195|  9.52k|  ADA_ASSERT_TRUE(validate());
 8196|  9.52k|}
_ZN3ada14url_aggregator20append_base_passwordENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8584|  28.2k|inline void url_aggregator::append_base_password(const std::string_view input) {
 8585|  28.2k|  ada_log("url_aggregator::append_base_password ", input, " ", to_string(),
 8586|  28.2k|          "\n", to_diagram());
 8587|  28.2k|  ADA_ASSERT_TRUE(validate());
 8588|  28.2k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8589|       |#if ADA_DEVELOPMENT_CHECKS
 8590|       |  // computing the expected password.
 8591|       |  std::string password_expected = std::string(get_password());
 8592|       |  password_expected.append(input);
 8593|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8594|  28.2k|  add_authority_slashes_if_needed();
 8595|       |
 8596|       |  // If input is empty, do nothing.
 8597|  28.2k|  if (input.empty()) {
  ------------------
  |  Branch (8597:7): [True: 2.90k, False: 25.3k]
  ------------------
 8598|  2.90k|    return;
 8599|  2.90k|  }
 8600|       |
 8601|  25.3k|  uint32_t difference = uint32_t(input.size());
 8602|  25.3k|  if (has_password()) {
  ------------------
  |  Branch (8602:7): [True: 3.91k, False: 21.4k]
  ------------------
 8603|  3.91k|    buffer.insert(components.host_start, input);
 8604|  21.4k|  } else {
 8605|  21.4k|    difference++;  // Increment for ":"
 8606|  21.4k|    buffer.insert(components.username_end, ":");
 8607|  21.4k|    buffer.insert(components.username_end + 1, input);
 8608|  21.4k|  }
 8609|  25.3k|  components.host_start += difference;
 8610|       |
 8611|       |  // The following line is required to add "@" to hostname. When updating
 8612|       |  // password if hostname does not start with "@", it is "append_base_password"s
 8613|       |  // responsibility to set it.
 8614|  25.3k|  if (buffer[components.host_start] != '@') {
  ------------------
  |  Branch (8614:7): [True: 172, False: 25.1k]
  ------------------
 8615|    172|    buffer.insert(components.host_start, "@");
 8616|    172|    difference++;
 8617|    172|  }
 8618|       |
 8619|  25.3k|  components.host_end += difference;
 8620|  25.3k|  components.pathname_start += difference;
 8621|  25.3k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8621:7): [True: 0, False: 25.3k]
  ------------------
 8622|      0|    components.search_start += difference;
 8623|      0|  }
 8624|  25.3k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8624:7): [True: 0, False: 25.3k]
  ------------------
 8625|      0|    components.hash_start += difference;
 8626|      0|  }
 8627|       |#if ADA_DEVELOPMENT_CHECKS
 8628|       |  std::string password_after(get_password());
 8629|       |  ADA_ASSERT_EQUAL(
 8630|       |      password_expected, password_after,
 8631|       |      "append_base_password problem after inserting " + std::string(input));
 8632|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8633|  25.3k|  ADA_ASSERT_TRUE(validate());
 8634|  25.3k|}
_ZN3ada14url_aggregator31add_authority_slashes_if_neededEv:
 8840|   230k|inline void ada::url_aggregator::add_authority_slashes_if_needed() {
 8841|   230k|  ada_log("url_aggregator::add_authority_slashes_if_needed");
 8842|   230k|  ADA_ASSERT_TRUE(validate());
 8843|       |  // Protocol setter will insert `http:` to the URL. It is up to hostname setter
 8844|       |  // to insert
 8845|       |  // `//` initially to the buffer, since it depends on the hostname existence.
 8846|   230k|  if (has_authority()) {
  ------------------
  |  Branch (8846:7): [True: 76.9k, False: 153k]
  ------------------
 8847|  76.9k|    return;
 8848|  76.9k|  }
 8849|       |  // Performance: the common case is components.protocol_end == buffer.size()
 8850|       |  // Optimization opportunity: in many cases, the "//" is part of the input and
 8851|       |  // the insert could be fused with another insert.
 8852|   153k|  buffer.insert(components.protocol_end, "//");
 8853|   153k|  components.username_end += 2;
 8854|   153k|  components.host_start += 2;
 8855|   153k|  components.host_end += 2;
 8856|   153k|  components.pathname_start += 2;
 8857|   153k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8857:7): [True: 0, False: 153k]
  ------------------
 8858|      0|    components.search_start += 2;
 8859|      0|  }
 8860|   153k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8860:7): [True: 0, False: 153k]
  ------------------
 8861|      0|    components.hash_start += 2;
 8862|      0|  }
 8863|   153k|  ADA_ASSERT_TRUE(validate());
 8864|   153k|}
_ZN3ada14url_aggregator20append_base_usernameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8466|  39.9k|inline void url_aggregator::append_base_username(const std::string_view input) {
 8467|  39.9k|  ada_log("url_aggregator::append_base_username ", input);
 8468|  39.9k|  ADA_ASSERT_TRUE(validate());
 8469|  39.9k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8470|       |#if ADA_DEVELOPMENT_CHECKS
 8471|       |  // computing the expected password.
 8472|       |  std::string username_expected(get_username());
 8473|       |  username_expected.append(input);
 8474|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8475|  39.9k|  add_authority_slashes_if_needed();
 8476|       |
 8477|       |  // If input is empty, do nothing.
 8478|  39.9k|  if (input.empty()) {
  ------------------
  |  Branch (8478:7): [True: 7.80k, False: 32.1k]
  ------------------
 8479|  7.80k|    return;
 8480|  7.80k|  }
 8481|       |
 8482|  32.1k|  uint32_t difference = uint32_t(input.size());
 8483|  32.1k|  buffer.insert(components.username_end, input);
 8484|  32.1k|  components.username_end += difference;
 8485|  32.1k|  components.host_start += difference;
 8486|       |
 8487|  32.1k|  if (buffer[components.host_start] != '@' &&
  ------------------
  |  Branch (8487:7): [True: 22.3k, False: 9.85k]
  ------------------
 8488|  22.3k|      components.host_start != components.host_end) {
  ------------------
  |  Branch (8488:7): [True: 22.3k, False: 0]
  ------------------
 8489|  22.3k|    buffer.insert(components.host_start, "@");
 8490|  22.3k|    difference++;
 8491|  22.3k|  }
 8492|       |
 8493|  32.1k|  components.host_end += difference;
 8494|  32.1k|  components.pathname_start += difference;
 8495|  32.1k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8495:7): [True: 0, False: 32.1k]
  ------------------
 8496|      0|    components.search_start += difference;
 8497|      0|  }
 8498|  32.1k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8498:7): [True: 0, False: 32.1k]
  ------------------
 8499|      0|    components.hash_start += difference;
 8500|      0|  }
 8501|       |#if ADA_DEVELOPMENT_CHECKS
 8502|       |  std::string username_after(get_username());
 8503|       |  ADA_ASSERT_EQUAL(
 8504|       |      username_expected, username_after,
 8505|       |      "append_base_username problem after inserting " + std::string(input));
 8506|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8507|  32.1k|  ADA_ASSERT_TRUE(validate());
 8508|  32.1k|}
_ZNK3ada14url_aggregator8get_hrefEv:
 8944|   690k|    const noexcept ada_lifetime_bound {
 8945|   690k|  ada_log("url_aggregator::get_href");
 8946|   690k|  return buffer;
 8947|   690k|}
_ZN3ada14url_aggregator16update_base_portEj:
 8636|  22.8k|inline void url_aggregator::update_base_port(uint32_t input) {
 8637|  22.8k|  ada_log("url_aggregator::update_base_port");
 8638|  22.8k|  ADA_ASSERT_TRUE(validate());
 8639|  22.8k|  if (input == url_components::omitted) {
  ------------------
  |  Branch (8639:7): [True: 0, False: 22.8k]
  ------------------
 8640|      0|    clear_port();
 8641|      0|    return;
 8642|      0|  }
 8643|       |  // calling std::to_string(input.value()) is unfortunate given that the port
 8644|       |  // value is probably already available as a string.
 8645|  22.8k|  std::string value = helpers::concat(":", std::to_string(input));
 8646|  22.8k|  uint32_t difference = uint32_t(value.size());
 8647|       |
 8648|  22.8k|  if (components.port != url_components::omitted) {
  ------------------
  |  Branch (8648:7): [True: 0, False: 22.8k]
  ------------------
 8649|      0|    difference -= components.pathname_start - components.host_end;
 8650|      0|    buffer.erase(components.host_end,
 8651|      0|                 components.pathname_start - components.host_end);
 8652|      0|  }
 8653|       |
 8654|  22.8k|  buffer.insert(components.host_end, value);
 8655|  22.8k|  components.pathname_start += difference;
 8656|  22.8k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8656:7): [True: 0, False: 22.8k]
  ------------------
 8657|      0|    components.search_start += difference;
 8658|      0|  }
 8659|  22.8k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8659:7): [True: 0, False: 22.8k]
  ------------------
 8660|      0|    components.hash_start += difference;
 8661|      0|  }
 8662|  22.8k|  components.port = input;
 8663|  22.8k|  ADA_ASSERT_TRUE(validate());
 8664|  22.8k|}
_ZN3ada7helpers6concatIJPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEESA_DpT_:
 1866|  22.8k|std::string concat(Args... args) {
 1867|  22.8k|  std::string answer;
 1868|  22.8k|  inner_concat(answer, args...);
 1869|  22.8k|  return answer;
 1870|  22.8k|}
_ZN3ada7helpers12inner_concatIPKcJNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEEvRSA_T_DpT0_:
 1855|  22.8k|inline void inner_concat(std::string& buffer, T t, Args... args) {
 1856|  22.8k|  buffer.append(t);
 1857|  22.8k|  return inner_concat(buffer, args...);
 1858|  22.8k|}
_ZN3ada7helpers12inner_concatINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEJEEEvRS8_T_:
 1847|  22.8k|inline void inner_concat(std::string& buffer, T t) {
 1848|  22.8k|  buffer.append(t);
 1849|  22.8k|}
_ZN3ada14url_aggregator18update_base_searchENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKh:
 8304|  9.53k|    std::string_view input, const uint8_t query_percent_encode_set[]) {
 8305|  9.53k|  ada_log("url_aggregator::update_base_search ", input,
 8306|  9.53k|          " with encoding parameter ", to_string(), "\n", to_diagram());
 8307|  9.53k|  ADA_ASSERT_TRUE(validate());
 8308|  9.53k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8309|       |
 8310|  9.53k|  if (components.hash_start == url_components::omitted) {
  ------------------
  |  Branch (8310:7): [True: 9.53k, False: 0]
  ------------------
 8311|  9.53k|    if (components.search_start == url_components::omitted) {
  ------------------
  |  Branch (8311:9): [True: 9.53k, False: 0]
  ------------------
 8312|  9.53k|      components.search_start = uint32_t(buffer.size());
 8313|  9.53k|      buffer += "?";
 8314|  9.53k|    } else {
 8315|      0|      buffer.resize(components.search_start + 1);
 8316|      0|    }
 8317|       |
 8318|  9.53k|    bool encoding_required =
 8319|  9.53k|        unicode::percent_encode<true>(input, query_percent_encode_set, buffer);
 8320|       |    // When encoding_required is false, then buffer is left unchanged, and
 8321|       |    // percent encoding was not deemed required.
 8322|  9.53k|    if (!encoding_required) {
  ------------------
  |  Branch (8322:9): [True: 9.38k, False: 151]
  ------------------
 8323|  9.38k|      buffer.append(input);
 8324|  9.38k|    }
 8325|  9.53k|  } else {
 8326|      0|    if (components.search_start == url_components::omitted) {
  ------------------
  |  Branch (8326:9): [True: 0, False: 0]
  ------------------
 8327|      0|      components.search_start = components.hash_start;
 8328|      0|    } else {
 8329|      0|      buffer.erase(components.search_start,
 8330|      0|                   components.hash_start - components.search_start);
 8331|      0|      components.hash_start = components.search_start;
 8332|      0|    }
 8333|       |
 8334|      0|    buffer.insert(components.search_start, "?");
 8335|      0|    size_t idx =
 8336|      0|        ada::unicode::percent_encode_index(input, query_percent_encode_set);
 8337|      0|    if (idx == input.size()) {
  ------------------
  |  Branch (8337:9): [True: 0, False: 0]
  ------------------
 8338|      0|      buffer.insert(components.search_start + 1, input);
 8339|      0|      components.hash_start += uint32_t(input.size() + 1);  // Do not forget `?`
 8340|      0|    } else {
 8341|      0|      buffer.insert(components.search_start + 1, input, 0, idx);
 8342|      0|      input.remove_prefix(idx);
 8343|       |      // We only create a temporary string if we need percent encoding and
 8344|       |      // we attempt to create as small a temporary string as we can.
 8345|      0|      std::string encoded =
 8346|      0|          ada::unicode::percent_encode(input, query_percent_encode_set);
 8347|      0|      buffer.insert(components.search_start + idx + 1, encoded);
 8348|      0|      components.hash_start +=
 8349|      0|          uint32_t(encoded.size() + idx + 1);  // Do not forget `?`
 8350|      0|    }
 8351|      0|  }
 8352|       |
 8353|  9.53k|  ADA_ASSERT_TRUE(validate());
 8354|  9.53k|}
_ZN3ada14url_aggregator20update_base_hostnameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8219|   162k|inline void url_aggregator::update_base_hostname(const std::string_view input) {
 8220|   162k|  ada_log("url_aggregator::update_base_hostname ", input, " [", input.size(),
 8221|   162k|          " bytes], buffer is '", buffer, "' [", buffer.size(), " bytes]");
 8222|   162k|  ADA_ASSERT_TRUE(validate());
 8223|   162k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8224|       |
 8225|       |  // This next line is required for when parsing a URL like `foo://`
 8226|   162k|  add_authority_slashes_if_needed();
 8227|       |
 8228|   162k|  bool has_credentials = components.protocol_end + 2 < components.host_start;
 8229|   162k|  uint32_t new_difference =
 8230|   162k|      replace_and_resize(components.host_start, components.host_end, input);
 8231|       |
 8232|   162k|  if (has_credentials) {
  ------------------
  |  Branch (8232:7): [True: 22.3k, False: 139k]
  ------------------
 8233|  22.3k|    buffer.insert(components.host_start, "@");
 8234|  22.3k|    new_difference++;
 8235|  22.3k|  }
 8236|   162k|  components.host_end += new_difference;
 8237|   162k|  components.pathname_start += new_difference;
 8238|   162k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8238:7): [True: 0, False: 162k]
  ------------------
 8239|      0|    components.search_start += new_difference;
 8240|      0|  }
 8241|   162k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8241:7): [True: 0, False: 162k]
  ------------------
 8242|      0|    components.hash_start += new_difference;
 8243|      0|  }
 8244|   162k|  ADA_ASSERT_TRUE(validate());
 8245|   162k|}
_ZN3ada14url_aggregator10parse_portENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEb:
 8954|  23.1k|url_aggregator::parse_port(std::string_view view, bool check_trailing_content) {
 8955|  23.1k|  ada_log("url_aggregator::parse_port('", view, "') ", view.size());
 8956|  23.1k|  if (!view.empty() && view[0] == '-') {
  ------------------
  |  Branch (8956:7): [True: 23.0k, False: 145]
  |  Branch (8956:24): [True: 5, False: 23.0k]
  ------------------
 8957|      5|    ada_log("parse_port: view[0] == '0' && view.size() > 1");
 8958|      5|    is_valid = false;
 8959|      5|    return 0;
 8960|      5|  }
 8961|  23.1k|  uint16_t parsed_port{};
 8962|  23.1k|  auto r = std::from_chars(view.data(), view.data() + view.size(), parsed_port);
 8963|  23.1k|  if (r.ec == std::errc::result_out_of_range) {
  ------------------
  |  Branch (8963:7): [True: 21, False: 23.1k]
  ------------------
 8964|     21|    ada_log("parse_port: r.ec == std::errc::result_out_of_range");
 8965|     21|    is_valid = false;
 8966|     21|    return 0;
 8967|     21|  }
 8968|  23.1k|  ada_log("parse_port: ", parsed_port);
 8969|  23.1k|  const size_t consumed = size_t(r.ptr - view.data());
 8970|  23.1k|  ada_log("parse_port: consumed ", consumed);
 8971|  23.1k|  if (check_trailing_content) {
  ------------------
  |  Branch (8971:7): [True: 23.1k, False: 0]
  ------------------
 8972|  23.1k|    is_valid &=
 8973|  23.1k|        (consumed == view.size() || view[consumed] == '/' ||
  ------------------
  |  Branch (8973:10): [True: 388, False: 22.7k]
  |  Branch (8973:37): [True: 22.4k, False: 279]
  ------------------
 8974|    279|         view[consumed] == '?' || (is_special() && view[consumed] == '\\'));
  ------------------
  |  Branch (8974:10): [True: 109, False: 170]
  |  Branch (8974:36): [True: 162, False: 8]
  |  Branch (8974:52): [True: 53, False: 109]
  ------------------
 8975|  23.1k|  }
 8976|  23.1k|  ada_log("parse_port: is_valid = ", is_valid);
 8977|  23.1k|  if (is_valid) {
  ------------------
  |  Branch (8977:7): [True: 23.0k, False: 117]
  ------------------
 8978|  23.0k|    ada_log("parse_port", r.ec == std::errc());
 8979|       |    // scheme_default_port can return 0, and we should allow 0 as a base port.
 8980|  23.0k|    auto default_port = scheme_default_port();
 8981|  23.0k|    bool is_port_valid = (default_port == 0 && parsed_port == 0) ||
  ------------------
  |  Branch (8981:27): [True: 99, False: 22.9k]
  |  Branch (8981:48): [True: 30, False: 69]
  ------------------
 8982|  22.9k|                         (default_port != parsed_port);
  ------------------
  |  Branch (8982:26): [True: 22.9k, False: 3]
  ------------------
 8983|  23.0k|    if (r.ec == std::errc() && is_port_valid) {
  ------------------
  |  Branch (8983:9): [True: 22.8k, False: 223]
  |  Branch (8983:32): [True: 22.8k, False: 3]
  ------------------
 8984|  22.8k|      update_base_port(parsed_port);
 8985|  22.8k|    } else {
 8986|    226|      clear_port();
 8987|    226|    }
 8988|  23.0k|  }
 8989|  23.1k|  return consumed;
 8990|  23.1k|}
_ZN3ada14url_aggregator20set_protocol_as_fileEv:
 8992|  1.26k|constexpr void url_aggregator::set_protocol_as_file() {
 8993|  1.26k|  ada_log("url_aggregator::set_protocol_as_file ");
 8994|  1.26k|  ADA_ASSERT_TRUE(validate());
 8995|  1.26k|  type = ada::scheme::type::FILE;
 8996|       |  // next line could overflow but unsigned arithmetic has well-defined
 8997|       |  // overflows.
 8998|  1.26k|  uint32_t new_difference = 5 - components.protocol_end;
 8999|       |
 9000|  1.26k|  if (buffer.empty()) {
  ------------------
  |  Branch (9000:7): [True: 0, False: 1.26k]
  ------------------
 9001|      0|    buffer.append("file:");
 9002|  1.26k|  } else {
 9003|  1.26k|    buffer.erase(0, components.protocol_end);
 9004|  1.26k|    buffer.insert(0, "file:");
 9005|  1.26k|  }
 9006|  1.26k|  components.protocol_end = 5;
 9007|       |
 9008|       |  // Update the rest of the components.
 9009|  1.26k|  components.username_end += new_difference;
 9010|  1.26k|  components.host_start += new_difference;
 9011|  1.26k|  components.host_end += new_difference;
 9012|  1.26k|  components.pathname_start += new_difference;
 9013|  1.26k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (9013:7): [True: 0, False: 1.26k]
  ------------------
 9014|      0|    components.search_start += new_difference;
 9015|      0|  }
 9016|  1.26k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (9016:7): [True: 0, False: 1.26k]
  ------------------
 9017|      0|    components.hash_start += new_difference;
 9018|      0|  }
 9019|  1.26k|  ADA_ASSERT_TRUE(validate());
 9020|  1.26k|}
_ZN3ada7unicode20percent_encode_indexENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKh:
 8077|    467|                                              const uint8_t character_set[]) {
 8078|    467|  const char* data = input.data();
 8079|    467|  const size_t size = input.size();
 8080|       |
 8081|       |  // Process 8 bytes at a time using unrolled loop
 8082|    467|  size_t i = 0;
 8083|  1.05k|  for (; i + 8 <= size; i += 8) {
  ------------------
  |  Branch (8083:10): [True: 626, False: 433]
  ------------------
 8084|    626|    unsigned char chunk[8];
 8085|    626|    std::memcpy(&chunk, data + i,
 8086|    626|                8);  // entices compiler to unconditionally process 8 characters
 8087|       |
 8088|       |    // Check 8 characters at once
 8089|  5.47k|    for (size_t j = 0; j < 8; j++) {
  ------------------
  |  Branch (8089:24): [True: 4.88k, False: 592]
  ------------------
 8090|  4.88k|      if (character_sets::bit_at(character_set, chunk[j])) {
  ------------------
  |  Branch (8090:11): [True: 34, False: 4.85k]
  ------------------
 8091|     34|        return i + j;
 8092|     34|      }
 8093|  4.88k|    }
 8094|    626|  }
 8095|       |
 8096|       |  // Handle remaining bytes
 8097|  1.66k|  for (; i < size; i++) {
  ------------------
  |  Branch (8097:10): [True: 1.23k, False: 425]
  ------------------
 8098|  1.23k|    if (character_sets::bit_at(character_set, data[i])) {
  ------------------
  |  Branch (8098:9): [True: 8, False: 1.22k]
  ------------------
 8099|      8|      return i;
 8100|      8|    }
 8101|  1.23k|  }
 8102|       |
 8103|    425|  return size;
 8104|    433|}
_ZN3ada14url_aggregator10clear_portEv:
 8666|    226|inline void url_aggregator::clear_port() {
 8667|    226|  ada_log("url_aggregator::clear_port");
 8668|    226|  ADA_ASSERT_TRUE(validate());
 8669|    226|  if (components.port == url_components::omitted) {
  ------------------
  |  Branch (8669:7): [True: 226, False: 0]
  ------------------
 8670|    226|    return;
 8671|    226|  }
 8672|      0|  uint32_t length = components.pathname_start - components.host_end;
 8673|      0|  buffer.erase(components.host_end, length);
 8674|      0|  components.pathname_start -= length;
 8675|      0|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8675:7): [True: 0, False: 0]
  ------------------
 8676|      0|    components.search_start -= length;
 8677|      0|  }
 8678|      0|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8678:7): [True: 0, False: 0]
  ------------------
 8679|      0|    components.hash_start -= length;
 8680|      0|  }
 8681|      0|  components.port = url_components::omitted;
 8682|      0|  ADA_ASSERT_TRUE(validate());
 8683|      0|}
_ZNK3ada14url_aggregator13has_authorityEv:
 8831|   230k|    const noexcept {
 8832|   230k|  ada_log("url_aggregator::has_authority");
 8833|       |  // Performance: instead of doing this potentially expensive check, we could
 8834|       |  // have a boolean in the struct.
 8835|   230k|  return components.protocol_end + 2 <= components.host_start &&
  ------------------
  |  Branch (8835:10): [True: 77.3k, False: 153k]
  ------------------
 8836|  77.3k|         buffer[components.protocol_end] == '/' &&
  ------------------
  |  Branch (8836:10): [True: 77.3k, False: 0]
  ------------------
 8837|  77.3k|         buffer[components.protocol_end + 1] == '/';
  ------------------
  |  Branch (8837:10): [True: 77.3k, False: 0]
  ------------------
 8838|   230k|}
_ZNK3ada14url_aggregator12has_dash_dotEv:
 8911|  21.7k|[[nodiscard]] constexpr bool url_aggregator::has_dash_dot() const noexcept {
 8912|       |  // If url's host is null, url does not have an opaque path, url's path's size
 8913|       |  // is greater than 1, and url's path[0] is the empty string, then append
 8914|       |  // U+002F (/) followed by U+002E (.) to output.
 8915|  21.7k|  ada_log("url_aggregator::has_dash_dot");
 8916|       |#if ADA_DEVELOPMENT_CHECKS
 8917|       |  // If pathname_start and host_end are exactly two characters apart, then we
 8918|       |  // either have a one-digit port such as http://test.com:5?param=1 or else we
 8919|       |  // have a /.: sequence such as "non-spec:/.//". We test that this is the case.
 8920|       |  if (components.pathname_start == components.host_end + 2) {
 8921|       |    ADA_ASSERT_TRUE((buffer[components.host_end] == '/' &&
 8922|       |                     buffer[components.host_end + 1] == '.') ||
 8923|       |                    (buffer[components.host_end] == ':' &&
 8924|       |                     checkers::is_digit(buffer[components.host_end + 1])));
 8925|       |  }
 8926|       |  if (components.pathname_start == components.host_end + 2 &&
 8927|       |      buffer[components.host_end] == '/' &&
 8928|       |      buffer[components.host_end + 1] == '.') {
 8929|       |    ADA_ASSERT_TRUE(components.pathname_start + 1 < buffer.size());
 8930|       |    ADA_ASSERT_TRUE(buffer[components.pathname_start] == '/');
 8931|       |    ADA_ASSERT_TRUE(buffer[components.pathname_start + 1] == '/');
 8932|       |  }
 8933|       |#endif
 8934|       |  // Performance: it should be uncommon for components.pathname_start ==
 8935|       |  // components.host_end + 2 to be true. So we put this check first in the
 8936|       |  // sequence. Most times, we do not have an opaque path. Checking for '/.' is
 8937|       |  // more expensive, but should be uncommon.
 8938|  21.7k|  return components.pathname_start == components.host_end + 2 &&
  ------------------
  |  Branch (8938:10): [True: 318, False: 21.4k]
  ------------------
 8939|    318|         !has_opaque_path && buffer[components.host_end] == '/' &&
  ------------------
  |  Branch (8939:10): [True: 318, False: 0]
  |  Branch (8939:30): [True: 0, False: 318]
  ------------------
 8940|      0|         buffer[components.host_end + 1] == '.';
  ------------------
  |  Branch (8940:10): [True: 0, False: 0]
  ------------------
 8941|  21.7k|}
_ZNK2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEcvbEv:
 3972|   230k|  constexpr explicit operator bool() const noexcept { return this->m_has_val; }
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEptEv:
 3941|   575k|  TL_EXPECTED_11_CONSTEXPR T* operator->() {
 3942|   575k|    TL_ASSERT(has_value());
  ------------------
  |  | 1994|   575k|#define TL_ASSERT(x) assert(x)
  ------------------
  |  Branch (3942:5): [True: 575k, False: 0]
  ------------------
 3943|   575k|    return valptr();
 3944|   575k|  }
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEE6valptrEv:
 3237|   575k|  T* valptr() { return std::addressof(this->m_val); }
_ZNR2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEdeIS2_TnPNSt3__19enable_ifIXntsr3std7is_voidIT_EE5valueEvE4typeELPv0EEERS8_v:
 3954|   575k|  TL_EXPECTED_11_CONSTEXPR U& operator*() & {
 3955|   575k|    TL_ASSERT(has_value());
  ------------------
  |  | 1994|   575k|#define TL_ASSERT(x) assert(x)
  ------------------
  |  Branch (3955:5): [True: 575k, False: 0]
  ------------------
 3956|   575k|    return val();
 3957|   575k|  }
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEE3valIS2_TnPNSt3__19enable_ifIXntsr3std7is_voidIT_EE5valueEvE4typeELPv0EEERS8_v:
 3246|   575k|  TL_EXPECTED_11_CONSTEXPR U& val() {
 3247|   575k|    return this->m_val;
 3248|   575k|  }
_ZN3ada14url_aggregatoraSERKS0_:
 7647|   115k|  url_aggregator& operator=(const url_aggregator& u) = default;
_ZNK2tl8expectedIN3ada14url_aggregatorENS1_6errorsEE9has_valueEv:
 3971|  1.38M|  constexpr bool has_value() const noexcept { return this->m_has_val; }
_ZN2tl6detail21expected_storage_baseIN3ada14url_aggregatorENS2_6errorsELb0ELb1EED2Ev:
 2569|   347k|  ~expected_storage_base() {
 2570|   347k|    if (m_has_val) {
  ------------------
  |  Branch (2570:9): [True: 345k, False: 2.70k]
  ------------------
 2571|   345k|      m_val.~T();
 2572|   345k|    }
 2573|   347k|  }
_ZNK3ada14url_aggregator22has_non_empty_usernameEv:
 8870|   115k|constexpr bool url_aggregator::has_non_empty_username() const noexcept {
 8871|   115k|  ada_log("url_aggregator::has_non_empty_username");
 8872|   115k|  return components.protocol_end + 2 < components.username_end;
 8873|   115k|}
_ZN3ada7helpers9substringENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEmm:
 1788|   650k|                                                       size_t pos2) {
 1789|       |#if ADA_DEVELOPMENT_CHECKS
 1790|       |  if (pos2 < pos1) {
 1791|       |    std::cerr << "Negative-length substring: [" << pos1 << " to " << pos2 << ")"
 1792|       |              << std::endl;
 1793|       |    abort();
 1794|       |  }
 1795|       |#endif
 1796|   650k|  return input.substr(pos1, pos2 - pos1);
 1797|   650k|}
_ZNK3ada14url_aggregator22has_non_empty_passwordEv:
 8875|   115k|constexpr bool url_aggregator::has_non_empty_password() const noexcept {
 8876|   115k|  ada_log("url_aggregator::has_non_empty_password");
 8877|   115k|  return components.host_start > components.username_end;
 8878|   115k|}
_ZNK3ada14url_aggregator10is_at_pathEv:
 8260|   131k|    const noexcept {
 8261|   131k|  return buffer.size() == components.pathname_start;
 8262|   131k|}
_ZN3ada8checkers8is_digitEc:
 1220|   128k|constexpr bool is_digit(char x) noexcept { return (x >= '0') & (x <= '9'); }
_ZNK3ada14url_aggregator12has_passwordEv:
 8880|  25.3k|constexpr bool url_aggregator::has_password() const noexcept {
 8881|  25.3k|  ada_log("url_aggregator::has_password");
 8882|       |  // This function does not care about the length of the password
 8883|  25.3k|  return components.host_start > components.username_end &&
  ------------------
  |  Branch (8883:10): [True: 3.91k, False: 21.4k]
  ------------------
 8884|  3.91k|         buffer[components.username_end] == ':';
  ------------------
  |  Branch (8884:10): [True: 3.91k, False: 0]
  ------------------
 8885|  25.3k|}
_ZNK3ada14url_aggregator13get_href_sizeEv:
 8949|   230k|[[nodiscard]] constexpr size_t url_aggregator::get_href_size() const noexcept {
 8950|   230k|  return buffer.size();
 8951|   230k|}
_ZNK3ada3url8get_hrefEv:
 7349|   805k|[[nodiscard]] ada_really_inline std::string url::get_href() const {
 7350|   805k|  if (is_special() && host.has_value() && username.empty() &&
  ------------------
  |  Branch (7350:7): [True: 802k, False: 3.05k]
  |  Branch (7350:23): [True: 802k, False: 0]
  |  Branch (7350:43): [True: 750k, False: 51.4k]
  ------------------
 7351|   750k|      password.empty() && !port.has_value()) [[likely]] {
  ------------------
  |  Branch (7351:7): [True: 750k, False: 280]
  |  Branch (7351:27): [True: 697k, False: 52.8k]
  ------------------
 7352|   697k|    const std::string_view scheme = ada::scheme::details::is_special_list[type];
 7353|   697k|    const size_t host_size = host->size();
 7354|   697k|    const size_t path_size = path.size();
 7355|   697k|    const size_t query_size = query.has_value() ? query->size() : 0;
  ------------------
  |  Branch (7355:31): [True: 159k, False: 537k]
  ------------------
 7356|   697k|    const size_t hash_size = hash.has_value() ? hash->size() : 0;
  ------------------
  |  Branch (7356:30): [True: 112k, False: 584k]
  ------------------
 7357|   697k|    const size_t total = scheme.size() + 3 + host_size + path_size +
 7358|   697k|                         (query.has_value() ? query_size + 1 : 0) +
  ------------------
  |  Branch (7358:27): [True: 159k, False: 537k]
  ------------------
 7359|   697k|                         (hash.has_value() ? hash_size + 1 : 0);
  ------------------
  |  Branch (7359:27): [True: 112k, False: 584k]
  ------------------
 7360|   697k|    std::string output(total, '\0');
 7361|   697k|    char* p = output.data();
 7362|   697k|    std::memcpy(p, scheme.data(), scheme.size());
 7363|   697k|    p += scheme.size();
 7364|   697k|    p[0] = ':';
 7365|   697k|    p[1] = '/';
 7366|   697k|    p[2] = '/';
 7367|   697k|    p += 3;
 7368|       |    // NOLINTNEXTLINE(bugprone-not-null-terminated-result)
 7369|   697k|    std::memcpy(p, host->data(), host_size);
 7370|   697k|    p += host_size;
 7371|   697k|    std::memcpy(p, path.data(), path_size);
 7372|   697k|    p += path_size;
 7373|   697k|    if (query.has_value()) {
  ------------------
  |  Branch (7373:9): [True: 159k, False: 537k]
  ------------------
 7374|   159k|      *p++ = '?';
 7375|       |      // NOLINTNEXTLINE(bugprone-not-null-terminated-result)
 7376|   159k|      std::memcpy(p, query->data(), query_size);
 7377|   159k|      p += query_size;
 7378|   159k|    }
 7379|   697k|    if (hash.has_value()) {
  ------------------
  |  Branch (7379:9): [True: 112k, False: 584k]
  ------------------
 7380|   112k|      *p++ = '#';
 7381|       |      // NOLINTNEXTLINE(bugprone-not-null-terminated-result)
 7382|   112k|      std::memcpy(p, hash->data(), hash_size);
 7383|   112k|    }
 7384|   697k|    return output;
 7385|   697k|  }
 7386|       |
 7387|   107k|  std::string output;
 7388|   107k|  output.reserve(get_href_size());
 7389|       |
 7390|   107k|  if (is_special()) {
  ------------------
  |  Branch (7390:7): [True: 104k, False: 3.05k]
  ------------------
 7391|   104k|    output.append(ada::scheme::details::is_special_list[type]);
 7392|   104k|    output += ':';
 7393|   104k|  } else {
 7394|  3.05k|    output.append(non_special_scheme);
 7395|  3.05k|    output += ':';
 7396|  3.05k|  }
 7397|       |
 7398|   107k|  if (host.has_value()) {
  ------------------
  |  Branch (7398:7): [True: 105k, False: 1.85k]
  ------------------
 7399|   105k|    output += '/';
 7400|   105k|    output += '/';
 7401|   105k|    if (has_credentials()) {
  ------------------
  |  Branch (7401:9): [True: 51.9k, False: 53.8k]
  ------------------
 7402|  51.9k|      output.append(username);
 7403|  51.9k|      if (!password.empty()) {
  ------------------
  |  Branch (7403:11): [True: 49.8k, False: 2.16k]
  ------------------
 7404|  49.8k|        output += ':';
 7405|  49.8k|        output.append(password);
 7406|  49.8k|      }
 7407|  51.9k|      output += '@';
 7408|  51.9k|    }
 7409|   105k|    output.append(*host);
 7410|   105k|    if (port.has_value()) {
  ------------------
  |  Branch (7410:9): [True: 53.2k, False: 52.6k]
  ------------------
 7411|  53.2k|      output += ':';
 7412|  53.2k|      char port_buf[5];
 7413|  53.2k|      auto [ptr, ec] = std::to_chars(port_buf, port_buf + 5, *port);
 7414|  53.2k|      (void)ec;
 7415|  53.2k|      output.append(port_buf, static_cast<size_t>(ptr - port_buf));
 7416|  53.2k|    }
 7417|   105k|  } else if (!has_opaque_path && path.starts_with("//")) {
  ------------------
  |  Branch (7417:14): [True: 700, False: 1.15k]
  |  Branch (7417:34): [True: 28, False: 672]
  ------------------
 7418|       |    // If url's host is null, url does not have an opaque path, url's path's
 7419|       |    // size is greater than 1, and url's path[0] is the empty string, then
 7420|       |    // append U+002F (/) followed by U+002E (.) to output.
 7421|     28|    output += '/';
 7422|     28|    output += '.';
 7423|     28|  }
 7424|   107k|  output.append(path);
 7425|   107k|  if (query.has_value()) {
  ------------------
  |  Branch (7425:7): [True: 8.01k, False: 99.6k]
  ------------------
 7426|  8.01k|    output += '?';
 7427|  8.01k|    output.append(*query);
 7428|  8.01k|  }
 7429|   107k|  if (hash.has_value()) {
  ------------------
  |  Branch (7429:7): [True: 8.27k, False: 99.4k]
  ------------------
 7430|  8.27k|    output += '#';
 7431|  8.27k|    output.append(*hash);
 7432|  8.27k|  }
 7433|   107k|  return output;
 7434|   805k|}
_ZNK3ada14url_aggregator8validateEv:
 9022|   115k|[[nodiscard]] constexpr bool url_aggregator::validate() const noexcept {
 9023|   115k|  if (!is_valid) {
  ------------------
  |  Branch (9023:7): [True: 0, False: 115k]
  ------------------
 9024|      0|    return true;
 9025|      0|  }
 9026|   115k|  if (!components.check_offset_consistency()) {
  ------------------
  |  Branch (9026:7): [True: 0, False: 115k]
  ------------------
 9027|      0|    ada_log("url_aggregator::validate inconsistent components \n",
 9028|      0|            to_diagram());
 9029|      0|    return false;
 9030|      0|  }
 9031|       |  // We have a credible components struct, but let us investivate more
 9032|       |  // carefully:
 9033|       |  /**
 9034|       |   * https://user:pass@example.com:1234/foo/bar?baz#quux
 9035|       |   *       |     |    |          | ^^^^|       |   |
 9036|       |   *       |     |    |          | |   |       |   `----- hash_start
 9037|       |   *       |     |    |          | |   |       `--------- search_start
 9038|       |   *       |     |    |          | |   `----------------- pathname_start
 9039|       |   *       |     |    |          | `--------------------- port
 9040|       |   *       |     |    |          `----------------------- host_end
 9041|       |   *       |     |    `---------------------------------- host_start
 9042|       |   *       |     `--------------------------------------- username_end
 9043|       |   *       `--------------------------------------------- protocol_end
 9044|       |   */
 9045|   115k|  if (components.protocol_end == url_components::omitted) {
  ------------------
  |  Branch (9045:7): [True: 0, False: 115k]
  ------------------
 9046|      0|    ada_log("url_aggregator::validate omitted protocol_end \n", to_diagram());
 9047|      0|    return false;
 9048|      0|  }
 9049|   115k|  if (components.username_end == url_components::omitted) {
  ------------------
  |  Branch (9049:7): [True: 0, False: 115k]
  ------------------
 9050|      0|    ada_log("url_aggregator::validate omitted username_end \n", to_diagram());
 9051|      0|    return false;
 9052|      0|  }
 9053|   115k|  if (components.host_start == url_components::omitted) {
  ------------------
  |  Branch (9053:7): [True: 0, False: 115k]
  ------------------
 9054|      0|    ada_log("url_aggregator::validate omitted host_start \n", to_diagram());
 9055|      0|    return false;
 9056|      0|  }
 9057|   115k|  if (components.host_end == url_components::omitted) {
  ------------------
  |  Branch (9057:7): [True: 0, False: 115k]
  ------------------
 9058|      0|    ada_log("url_aggregator::validate omitted host_end \n", to_diagram());
 9059|      0|    return false;
 9060|      0|  }
 9061|   115k|  if (components.pathname_start == url_components::omitted) {
  ------------------
  |  Branch (9061:7): [True: 0, False: 115k]
  ------------------
 9062|      0|    ada_log("url_aggregator::validate omitted pathname_start \n", to_diagram());
 9063|      0|    return false;
 9064|      0|  }
 9065|       |
 9066|   115k|  if (components.protocol_end > buffer.size()) {
  ------------------
  |  Branch (9066:7): [True: 0, False: 115k]
  ------------------
 9067|      0|    ada_log("url_aggregator::validate protocol_end overflow \n", to_diagram());
 9068|      0|    return false;
 9069|      0|  }
 9070|   115k|  if (components.username_end > buffer.size()) {
  ------------------
  |  Branch (9070:7): [True: 0, False: 115k]
  ------------------
 9071|      0|    ada_log("url_aggregator::validate username_end overflow \n", to_diagram());
 9072|      0|    return false;
 9073|      0|  }
 9074|   115k|  if (components.host_start > buffer.size()) {
  ------------------
  |  Branch (9074:7): [True: 0, False: 115k]
  ------------------
 9075|      0|    ada_log("url_aggregator::validate host_start overflow \n", to_diagram());
 9076|      0|    return false;
 9077|      0|  }
 9078|   115k|  if (components.host_end > buffer.size()) {
  ------------------
  |  Branch (9078:7): [True: 0, False: 115k]
  ------------------
 9079|      0|    ada_log("url_aggregator::validate host_end overflow \n", to_diagram());
 9080|      0|    return false;
 9081|      0|  }
 9082|   115k|  if (components.pathname_start > buffer.size()) {
  ------------------
  |  Branch (9082:7): [True: 0, False: 115k]
  ------------------
 9083|      0|    ada_log("url_aggregator::validate pathname_start overflow \n",
 9084|      0|            to_diagram());
 9085|      0|    return false;
 9086|      0|  }
 9087|       |
 9088|   115k|  if (components.protocol_end > 0) {
  ------------------
  |  Branch (9088:7): [True: 115k, False: 0]
  ------------------
 9089|   115k|    if (buffer[components.protocol_end - 1] != ':') {
  ------------------
  |  Branch (9089:9): [True: 0, False: 115k]
  ------------------
 9090|      0|      ada_log(
 9091|      0|          "url_aggregator::validate missing : at the end of the protocol \n",
 9092|      0|          to_diagram());
 9093|      0|      return false;
 9094|      0|    }
 9095|   115k|  }
 9096|       |
 9097|   115k|  if (components.username_end != buffer.size() &&
  ------------------
  |  Branch (9097:7): [True: 115k, False: 4]
  ------------------
 9098|   115k|      components.username_end > components.protocol_end + 2) {
  ------------------
  |  Branch (9098:7): [True: 7.38k, False: 107k]
  ------------------
 9099|  7.38k|    if (buffer[components.username_end] != ':' &&
  ------------------
  |  Branch (9099:9): [True: 309, False: 7.07k]
  ------------------
 9100|    309|        buffer[components.username_end] != '@') {
  ------------------
  |  Branch (9100:9): [True: 0, False: 309]
  ------------------
 9101|      0|      ada_log(
 9102|      0|          "url_aggregator::validate missing : or @ at the end of the username "
 9103|      0|          "\n",
 9104|      0|          to_diagram());
 9105|      0|      return false;
 9106|      0|    }
 9107|  7.38k|  }
 9108|       |
 9109|   115k|  if (components.host_start != buffer.size()) {
  ------------------
  |  Branch (9109:7): [True: 115k, False: 4]
  ------------------
 9110|   115k|    if (components.host_start > components.username_end) {
  ------------------
  |  Branch (9110:9): [True: 7.11k, False: 107k]
  ------------------
 9111|  7.11k|      if (buffer[components.host_start] != '@') {
  ------------------
  |  Branch (9111:11): [True: 0, False: 7.11k]
  ------------------
 9112|      0|        ada_log(
 9113|      0|            "url_aggregator::validate missing @ at the end of the password \n",
 9114|      0|            to_diagram());
 9115|      0|        return false;
 9116|      0|      }
 9117|   107k|    } else if (components.host_start == components.username_end &&
  ------------------
  |  Branch (9117:16): [True: 107k, False: 0]
  ------------------
 9118|   107k|               components.host_end > components.host_start) {
  ------------------
  |  Branch (9118:16): [True: 107k, False: 443]
  ------------------
 9119|   107k|      if (components.host_start == components.protocol_end + 2) {
  ------------------
  |  Branch (9119:11): [True: 107k, False: 309]
  ------------------
 9120|   107k|        if (buffer[components.protocol_end] != '/' ||
  ------------------
  |  Branch (9120:13): [True: 0, False: 107k]
  ------------------
 9121|   107k|            buffer[components.protocol_end + 1] != '/') {
  ------------------
  |  Branch (9121:13): [True: 0, False: 107k]
  ------------------
 9122|      0|          ada_log(
 9123|      0|              "url_aggregator::validate missing // between protocol and host "
 9124|      0|              "\n",
 9125|      0|              to_diagram());
 9126|      0|          return false;
 9127|      0|        }
 9128|   107k|      } else {
 9129|    309|        if (components.host_start > components.protocol_end &&
  ------------------
  |  Branch (9129:13): [True: 309, False: 0]
  ------------------
 9130|    309|            buffer[components.host_start] != '@') {
  ------------------
  |  Branch (9130:13): [True: 0, False: 309]
  ------------------
 9131|      0|          ada_log(
 9132|      0|              "url_aggregator::validate missing @ at the end of the username "
 9133|      0|              "\n",
 9134|      0|              to_diagram());
 9135|      0|          return false;
 9136|      0|        }
 9137|    309|      }
 9138|   107k|    } else {
 9139|    443|      if (components.host_end != components.host_start) {
  ------------------
  |  Branch (9139:11): [True: 0, False: 443]
  ------------------
 9140|      0|        ada_log("url_aggregator::validate expected omitted host \n",
 9141|      0|                to_diagram());
 9142|      0|        return false;
 9143|      0|      }
 9144|    443|    }
 9145|   115k|  }
 9146|   115k|  if (components.host_end != buffer.size() &&
  ------------------
  |  Branch (9146:7): [True: 115k, False: 13]
  ------------------
 9147|   115k|      components.pathname_start > components.host_end) {
  ------------------
  |  Branch (9147:7): [True: 7.60k, False: 107k]
  ------------------
 9148|  7.60k|    if (components.pathname_start == components.host_end + 2 &&
  ------------------
  |  Branch (9148:9): [True: 337, False: 7.26k]
  ------------------
 9149|    337|        buffer[components.host_end] == '/' &&
  ------------------
  |  Branch (9149:9): [True: 4, False: 333]
  ------------------
 9150|      4|        buffer[components.host_end + 1] == '.') {
  ------------------
  |  Branch (9150:9): [True: 4, False: 0]
  ------------------
 9151|      4|      if (components.pathname_start + 1 >= buffer.size() ||
  ------------------
  |  Branch (9151:11): [True: 0, False: 4]
  ------------------
 9152|      4|          buffer[components.pathname_start] != '/' ||
  ------------------
  |  Branch (9152:11): [True: 0, False: 4]
  ------------------
 9153|      4|          buffer[components.pathname_start + 1] != '/') {
  ------------------
  |  Branch (9153:11): [True: 0, False: 4]
  ------------------
 9154|      0|        ada_log(
 9155|      0|            "url_aggregator::validate expected the path to begin with // \n",
 9156|      0|            to_diagram());
 9157|      0|        return false;
 9158|      0|      }
 9159|  7.60k|    } else if (buffer[components.host_end] != ':') {
  ------------------
  |  Branch (9159:16): [True: 0, False: 7.60k]
  ------------------
 9160|      0|      ada_log("url_aggregator::validate missing : at the port \n",
 9161|      0|              to_diagram());
 9162|      0|      return false;
 9163|      0|    }
 9164|  7.60k|  }
 9165|   115k|  if (components.pathname_start != buffer.size() &&
  ------------------
  |  Branch (9165:7): [True: 115k, False: 14]
  ------------------
 9166|   115k|      components.pathname_start < components.search_start &&
  ------------------
  |  Branch (9166:7): [True: 115k, False: 36]
  ------------------
 9167|   115k|      components.pathname_start < components.hash_start && !has_opaque_path) {
  ------------------
  |  Branch (9167:7): [True: 114k, False: 45]
  |  Branch (9167:60): [True: 114k, False: 133]
  ------------------
 9168|   114k|    if (buffer[components.pathname_start] != '/') {
  ------------------
  |  Branch (9168:9): [True: 0, False: 114k]
  ------------------
 9169|      0|      ada_log("url_aggregator::validate missing / at the path \n",
 9170|      0|              to_diagram());
 9171|      0|      return false;
 9172|      0|    }
 9173|   114k|  }
 9174|   115k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (9174:7): [True: 23.9k, False: 91.0k]
  ------------------
 9175|  23.9k|    if (buffer[components.search_start] != '?') {
  ------------------
  |  Branch (9175:9): [True: 0, False: 23.9k]
  ------------------
 9176|      0|      ada_log("url_aggregator::validate missing ? at the search \n",
 9177|      0|              to_diagram());
 9178|      0|      return false;
 9179|      0|    }
 9180|  23.9k|  }
 9181|   115k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (9181:7): [True: 17.2k, False: 97.7k]
  ------------------
 9182|  17.2k|    if (buffer[components.hash_start] != '#') {
  ------------------
  |  Branch (9182:9): [True: 0, False: 17.2k]
  ------------------
 9183|      0|      ada_log("url_aggregator::validate missing # at the hash \n",
 9184|      0|              to_diagram());
 9185|      0|      return false;
 9186|      0|    }
 9187|  17.2k|  }
 9188|       |
 9189|   115k|  return true;
 9190|   115k|}
_ZNK3ada14url_components24check_offset_consistencyEv:
 7526|   115k|    const noexcept {
 7527|       |  /**
 7528|       |   * https://user:pass@example.com:1234/foo/bar?baz#quux
 7529|       |   *       |     |    |          | ^^^^|       |   |
 7530|       |   *       |     |    |          | |   |       |   `----- hash_start
 7531|       |   *       |     |    |          | |   |       `--------- search_start
 7532|       |   *       |     |    |          | |   `----------------- pathname_start
 7533|       |   *       |     |    |          | `--------------------- port
 7534|       |   *       |     |    |          `----------------------- host_end
 7535|       |   *       |     |    `---------------------------------- host_start
 7536|       |   *       |     `--------------------------------------- username_end
 7537|       |   *       `--------------------------------------------- protocol_end
 7538|       |   */
 7539|       |  // These conditions can be made more strict.
 7540|   115k|  if (protocol_end == url_components::omitted) {
  ------------------
  |  Branch (7540:7): [True: 0, False: 115k]
  ------------------
 7541|      0|    return false;
 7542|      0|  }
 7543|   115k|  uint32_t index = protocol_end;
 7544|       |
 7545|   115k|  if (username_end == url_components::omitted) {
  ------------------
  |  Branch (7545:7): [True: 0, False: 115k]
  ------------------
 7546|      0|    return false;
 7547|      0|  }
 7548|   115k|  if (username_end < index) {
  ------------------
  |  Branch (7548:7): [True: 0, False: 115k]
  ------------------
 7549|      0|    return false;
 7550|      0|  }
 7551|   115k|  index = username_end;
 7552|       |
 7553|   115k|  if (host_start == url_components::omitted) {
  ------------------
  |  Branch (7553:7): [True: 0, False: 115k]
  ------------------
 7554|      0|    return false;
 7555|      0|  }
 7556|   115k|  if (host_start < index) {
  ------------------
  |  Branch (7556:7): [True: 0, False: 115k]
  ------------------
 7557|      0|    return false;
 7558|      0|  }
 7559|   115k|  index = host_start;
 7560|       |
 7561|   115k|  if (port != url_components::omitted) {
  ------------------
  |  Branch (7561:7): [True: 7.60k, False: 107k]
  ------------------
 7562|  7.60k|    if (port > 0xffff) {
  ------------------
  |  Branch (7562:9): [True: 0, False: 7.60k]
  ------------------
 7563|      0|      return false;
 7564|      0|    }
 7565|  7.60k|    uint32_t port_length = helpers::fast_digit_count(port) + 1;
 7566|  7.60k|    if (index + port_length < index) {
  ------------------
  |  Branch (7566:9): [True: 0, False: 7.60k]
  ------------------
 7567|      0|      return false;
 7568|      0|    }
 7569|  7.60k|    index += port_length;
 7570|  7.60k|  }
 7571|       |
 7572|   115k|  if (pathname_start == url_components::omitted) {
  ------------------
  |  Branch (7572:7): [True: 0, False: 115k]
  ------------------
 7573|      0|    return false;
 7574|      0|  }
 7575|   115k|  if (pathname_start < index) {
  ------------------
  |  Branch (7575:7): [True: 0, False: 115k]
  ------------------
 7576|      0|    return false;
 7577|      0|  }
 7578|   115k|  index = pathname_start;
 7579|       |
 7580|   115k|  if (search_start != url_components::omitted) {
  ------------------
  |  Branch (7580:7): [True: 23.9k, False: 91.0k]
  ------------------
 7581|  23.9k|    if (search_start < index) {
  ------------------
  |  Branch (7581:9): [True: 0, False: 23.9k]
  ------------------
 7582|      0|      return false;
 7583|      0|    }
 7584|  23.9k|    index = search_start;
 7585|  23.9k|  }
 7586|       |
 7587|   115k|  if (hash_start != url_components::omitted) {
  ------------------
  |  Branch (7587:7): [True: 17.2k, False: 97.7k]
  ------------------
 7588|  17.2k|    if (hash_start < index) {
  ------------------
  |  Branch (7588:9): [True: 0, False: 17.2k]
  ------------------
 7589|      0|      return false;
 7590|      0|    }
 7591|  17.2k|  }
 7592|       |
 7593|   115k|  return true;
 7594|   115k|}
_ZN3ada7helpers16fast_digit_countEj:
 1892|  7.60k|inline int fast_digit_count(uint32_t x) noexcept {
 1893|  7.60k|  auto int_log2 = [](uint32_t z) -> int {
 1894|  7.60k|    return 31 - ada::helpers::leading_zeroes(z | 1);
 1895|  7.60k|  };
 1896|       |  // Compiles to very few instructions. Note that the
 1897|       |  // table is static and thus effectively a constant.
 1898|       |  // We leave it inside the function because it is meaningless
 1899|       |  // outside of it (this comes at no performance cost).
 1900|  7.60k|  const static uint64_t table[] = {
 1901|  7.60k|      4294967296,  8589934582,  8589934582,  8589934582,  12884901788,
 1902|  7.60k|      12884901788, 12884901788, 17179868184, 17179868184, 17179868184,
 1903|  7.60k|      21474826480, 21474826480, 21474826480, 21474826480, 25769703776,
 1904|  7.60k|      25769703776, 25769703776, 30063771072, 30063771072, 30063771072,
 1905|  7.60k|      34349738368, 34349738368, 34349738368, 34349738368, 38554705664,
 1906|  7.60k|      38554705664, 38554705664, 41949672960, 41949672960, 41949672960,
 1907|  7.60k|      42949672960, 42949672960};
 1908|  7.60k|  return int((x + table[int_log2(x)]) >> 32);
 1909|  7.60k|}
_ZZN3ada7helpers16fast_digit_countEjENKUljE_clEj:
 1893|  7.60k|  auto int_log2 = [](uint32_t z) -> int {
 1894|  7.60k|    return 31 - ada::helpers::leading_zeroes(z | 1);
 1895|  7.60k|  };
_ZN3ada7helpers6concatIJNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKcEEENS2_12basic_stringIcS5_NS2_9allocatorIcEEEEDpT_:
 1866|   118k|std::string concat(Args... args) {
 1867|   118k|  std::string answer;
 1868|   118k|  inner_concat(answer, args...);
 1869|   118k|  return answer;
 1870|   118k|}
_ZN3ada7helpers12inner_concatINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJPKcEEEvRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEET_DpT0_:
 1855|   118k|inline void inner_concat(std::string& buffer, T t, Args... args) {
 1856|   118k|  buffer.append(t);
 1857|   118k|  return inner_concat(buffer, args...);
 1858|   118k|}
_ZN3ada7helpers12inner_concatIPKcJEEEvRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEET_:
 1847|   118k|inline void inner_concat(std::string& buffer, T t) {
 1848|   118k|  buffer.append(t);
 1849|   118k|}
_ZN3ada7helpers6concatIJNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcEEES8_DpT_:
 1866|    436|std::string concat(Args... args) {
 1867|    436|  std::string answer;
 1868|    436|  inner_concat(answer, args...);
 1869|    436|  return answer;
 1870|    436|}
_ZN3ada7helpers12inner_concatINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEJPKcEEEvRS8_T_DpT0_:
 1855|    436|inline void inner_concat(std::string& buffer, T t, Args... args) {
 1856|    436|  buffer.append(t);
 1857|    436|  return inner_concat(buffer, args...);
 1858|    436|}
_ZN3ada3url10set_schemeEONSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 7331|  3.76k|inline void url::set_scheme(std::string&& new_scheme) noexcept {
 7332|  3.76k|  type = ada::scheme::get_scheme_type(new_scheme);
 7333|       |  // We only move the 'scheme' if it is non-special.
 7334|  3.76k|  if (!is_special()) {
  ------------------
  |  Branch (7334:7): [True: 1.37k, False: 2.38k]
  ------------------
 7335|  1.37k|    non_special_scheme = std::move(new_scheme);
 7336|  1.37k|  }
 7337|  3.76k|}

LLVMFuzzerTestOneInput:
  211|  6.69k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
  212|  6.69k|  FuzzedDataProvider fdp(data, size);
  213|       |
  214|  6.69k|  fuzz_one_input(make_candidate(fdp));
  215|       |
  216|  6.69k|  if (fdp.remaining_bytes() > 0) {
  ------------------
  |  Branch (216:7): [True: 3.94k, False: 2.75k]
  ------------------
  217|  3.94k|    std::string raw = fdp.ConsumeRemainingBytesAsString();
  218|  3.94k|    if (raw.size() > 512) {
  ------------------
  |  Branch (218:9): [True: 26, False: 3.91k]
  ------------------
  219|     26|      raw.resize(512);
  220|     26|    }
  221|  3.94k|    if (!raw.empty() && (static_cast<unsigned char>(raw[0]) & 1u)) {
  ------------------
  |  Branch (221:9): [True: 3.94k, False: 0]
  |  Branch (221:25): [True: 1.83k, False: 2.10k]
  ------------------
  222|  1.83k|      raw = std::string("https://") + raw;
  223|  2.10k|    } else if (!raw.empty()) {
  ------------------
  |  Branch (223:16): [True: 2.10k, False: 0]
  ------------------
  224|  2.10k|      raw = std::string("http://") + raw;
  225|  2.10k|    }
  226|  3.94k|    fuzz_one_input(raw);
  227|  3.94k|  }
  228|       |
  229|  6.69k|  static constexpr const char* kAnchors[] = {
  230|  6.69k|      "https://example.com",
  231|  6.69k|      "https://example.com/",
  232|  6.69k|      "https://example.com?q=1",
  233|  6.69k|      "https://example.com#frag",
  234|  6.69k|      "https://example.com/?q=1#frag",
  235|  6.69k|      "http://www.example.com/path/file.js",
  236|  6.69k|      "http://WWW.Example.COM/file.js",
  237|  6.69k|      "https://www.google.com/imghp?hl=en&tab=wi",
  238|  6.69k|      "http://192.168.0.1/x",
  239|  6.69k|      "http://0x7f.1/",
  240|  6.69k|      "https://user:pass@example.com/x",
  241|  6.69k|      "https://example.com:8080/x",
  242|  6.69k|      "https://example.com/a/./b/../c",
  243|  6.69k|      "https://example.com/foo/%2e%2e",
  244|  6.69k|      "https://xn--nxasmq6b.com/",
  245|  6.69k|      "https://xn--a/",
  246|  6.69k|  };
  247|   107k|  for (const char* seed : kAnchors) {
  ------------------
  |  Branch (247:25): [True: 107k, False: 6.69k]
  ------------------
  248|   107k|    fuzz_one_input(seed);
  249|   107k|  }
  250|       |
  251|  6.69k|  return 0;
  252|  6.69k|}
simple_absolute.cc:_ZL14fuzz_one_inputNSt3__117basic_string_viewIcNS_11char_traitsIcEEEE:
  170|   117k|static void fuzz_one_input(std::string_view input) {
  171|   117k|  auto url = ada::parse<ada::url>(input);
  172|   117k|  auto agg = ada::parse<ada::url_aggregator>(input);
  173|       |
  174|   117k|  if (url.has_value() != agg.has_value()) {
  ------------------
  |  Branch (174:7): [True: 0, False: 117k]
  ------------------
  175|      0|    printf(
  176|      0|        "parse agreement failure\n"
  177|      0|        "  input: %.*s\n"
  178|      0|        "  url: %d aggregator: %d\n",
  179|      0|        static_cast<int>(input.size()), input.data(), url.has_value(),
  180|      0|        agg.has_value());
  181|      0|    abort();
  182|      0|  }
  183|       |
  184|   117k|  if (!url) {
  ------------------
  |  Branch (184:7): [True: 2.70k, False: 115k]
  ------------------
  185|  2.70k|    return;
  186|  2.70k|  }
  187|       |
  188|   115k|  check_components_agree(*url, *agg, input);
  189|   115k|  check_href_size(*url, input);
  190|   115k|  check_href_size(*agg, input);
  191|   115k|  check_reparse_idempotent(*url, input);
  192|   115k|  check_reparse_idempotent(*agg, input);
  193|       |
  194|   115k|  const std::string href = url->get_href();
  195|   115k|  url->set_href(href);
  196|   115k|  agg->set_href(href);
  197|   115k|  if (url->get_href() != std::string(agg->get_href())) {
  ------------------
  |  Branch (197:7): [True: 0, False: 115k]
  ------------------
  198|      0|    printf(
  199|      0|        "set_href agreement failure\n"
  200|      0|        "  href: %s\n",
  201|      0|        href.c_str());
  202|      0|    abort();
  203|      0|  }
  204|   115k|  check_href_size(*url, href);
  205|   115k|  check_href_size(*agg, href);
  206|       |
  207|   115k|  volatile bool valid = agg->validate();
  208|   115k|  (void)valid;
  209|   115k|}
simple_absolute.cc:_ZL22check_components_agreeRKN3ada3urlERKNS_14url_aggregatorENSt3__117basic_string_viewIcNS6_11char_traitsIcEEEE:
  148|   115k|                                   std::string_view input) {
  149|   115k|  if (u.get_protocol() != a.get_protocol() ||
  ------------------
  |  Branch (149:7): [True: 0, False: 115k]
  |  Branch (149:7): [True: 0, False: 115k]
  ------------------
  150|   115k|      u.get_href() != std::string(a.get_href()) ||
  ------------------
  |  Branch (150:7): [True: 0, False: 115k]
  ------------------
  151|   115k|      std::string(u.get_hostname()) != std::string(a.get_hostname()) ||
  ------------------
  |  Branch (151:7): [True: 0, False: 115k]
  ------------------
  152|   115k|      std::string(u.get_pathname()) != std::string(a.get_pathname()) ||
  ------------------
  |  Branch (152:7): [True: 0, False: 115k]
  ------------------
  153|   115k|      std::string(u.get_search()) != std::string(a.get_search()) ||
  ------------------
  |  Branch (153:7): [True: 0, False: 115k]
  ------------------
  154|   115k|      std::string(u.get_hash()) != std::string(a.get_hash()) ||
  ------------------
  |  Branch (154:7): [True: 0, False: 115k]
  ------------------
  155|   115k|      std::string(u.get_port()) != std::string(a.get_port()) ||
  ------------------
  |  Branch (155:7): [True: 0, False: 115k]
  ------------------
  156|   115k|      u.get_username() != std::string(a.get_username()) ||
  ------------------
  |  Branch (156:7): [True: 0, False: 115k]
  ------------------
  157|   115k|      u.get_password() != std::string(a.get_password()) ||
  ------------------
  |  Branch (157:7): [True: 0, False: 115k]
  ------------------
  158|   115k|      std::string(u.get_host()) != std::string(a.get_host())) {
  ------------------
  |  Branch (158:7): [True: 0, False: 115k]
  ------------------
  159|      0|    printf(
  160|      0|        "url vs aggregator component mismatch\n"
  161|      0|        "  input: %.*s\n"
  162|      0|        "  url href: %s\n"
  163|      0|        "  agg href: %s\n",
  164|      0|        static_cast<int>(input.size()), input.data(), u.get_href().c_str(),
  165|      0|        std::string(a.get_href()).c_str());
  166|      0|    abort();
  167|      0|  }
  168|   115k|}
simple_absolute.cc:_ZL15check_href_sizeRKN3ada3urlENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   94|   230k|static void check_href_size(const ada::url& u, std::string_view input) {
   95|   230k|  if (u.get_href_size() != u.get_href().size()) {
  ------------------
  |  Branch (95:7): [True: 0, False: 230k]
  ------------------
   96|      0|    printf(
   97|      0|        "get_href_size mismatch (url)\n"
   98|      0|        "  input: %.*s\n"
   99|      0|        "  size:  %zu href.size: %zu\n"
  100|      0|        "  href:  %s\n",
  101|      0|        static_cast<int>(input.size()), input.data(), u.get_href_size(),
  102|      0|        u.get_href().size(), u.get_href().c_str());
  103|      0|    abort();
  104|      0|  }
  105|   230k|}
simple_absolute.cc:_ZL15check_href_sizeRKN3ada14url_aggregatorENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
  108|   230k|                            std::string_view input) {
  109|   230k|  if (u.get_href_size() != u.get_href().size()) {
  ------------------
  |  Branch (109:7): [True: 0, False: 230k]
  ------------------
  110|      0|    printf(
  111|      0|        "get_href_size mismatch (aggregator)\n"
  112|      0|        "  input: %.*s\n"
  113|      0|        "  size:  %zu href.size: %zu\n"
  114|      0|        "  href:  %s\n",
  115|      0|        static_cast<int>(input.size()), input.data(), u.get_href_size(),
  116|      0|        u.get_href().size(), std::string(u.get_href()).c_str());
  117|      0|    abort();
  118|      0|  }
  119|   230k|}
simple_absolute.cc:_ZL24check_reparse_idempotentIN3ada3urlEEvRKT_NSt3__117basic_string_viewIcNS5_11char_traitsIcEEEE:
  123|   115k|                                     std::string_view input) {
  124|   115k|  const std::string href = std::string(parsed.get_href());
  125|   115k|  auto again = ada::parse<Result>(href);
  126|   115k|  if (!again) {
  ------------------
  |  Branch (126:7): [True: 0, False: 115k]
  ------------------
  127|      0|    printf(
  128|      0|        "re-parse of href failed\n"
  129|      0|        "  input: %.*s\n"
  130|      0|        "  href:  %s\n",
  131|      0|        static_cast<int>(input.size()), input.data(), href.c_str());
  132|      0|    abort();
  133|      0|  }
  134|   115k|  if (std::string(again->get_href()) != href) {
  ------------------
  |  Branch (134:7): [True: 0, False: 115k]
  ------------------
  135|      0|    printf(
  136|      0|        "href not idempotent\n"
  137|      0|        "  input: %.*s\n"
  138|      0|        "  href1: %s\n"
  139|      0|        "  href2: %s\n",
  140|      0|        static_cast<int>(input.size()), input.data(), href.c_str(),
  141|      0|        std::string(again->get_href()).c_str());
  142|      0|    abort();
  143|      0|  }
  144|   115k|}
simple_absolute.cc:_ZL24check_reparse_idempotentIN3ada14url_aggregatorEEvRKT_NSt3__117basic_string_viewIcNS5_11char_traitsIcEEEE:
  123|   115k|                                     std::string_view input) {
  124|   115k|  const std::string href = std::string(parsed.get_href());
  125|   115k|  auto again = ada::parse<Result>(href);
  126|   115k|  if (!again) {
  ------------------
  |  Branch (126:7): [True: 0, False: 115k]
  ------------------
  127|      0|    printf(
  128|      0|        "re-parse of href failed\n"
  129|      0|        "  input: %.*s\n"
  130|      0|        "  href:  %s\n",
  131|      0|        static_cast<int>(input.size()), input.data(), href.c_str());
  132|      0|    abort();
  133|      0|  }
  134|   115k|  if (std::string(again->get_href()) != href) {
  ------------------
  |  Branch (134:7): [True: 0, False: 115k]
  ------------------
  135|      0|    printf(
  136|      0|        "href not idempotent\n"
  137|      0|        "  input: %.*s\n"
  138|      0|        "  href1: %s\n"
  139|      0|        "  href2: %s\n",
  140|      0|        static_cast<int>(input.size()), input.data(), href.c_str(),
  141|      0|        std::string(again->get_href()).c_str());
  142|      0|    abort();
  143|      0|  }
  144|   115k|}
simple_absolute.cc:_ZL14make_candidateR18FuzzedDataProvider:
   74|  6.69k|static std::string make_candidate(FuzzedDataProvider& fdp) {
   75|  6.69k|  std::string out;
   76|  6.69k|  out += pick(fdp, kSchemes);
   77|  6.69k|  out += pick(fdp, kHosts);
   78|  6.69k|  out += pick(fdp, kPaths);
   79|  6.69k|  out += pick(fdp, kQueries);
   80|  6.69k|  out += pick(fdp, kFrags);
   81|       |
   82|  6.69k|  if (fdp.ConsumeBool() && !out.empty()) {
  ------------------
  |  Branch (82:7): [True: 2.20k, False: 4.48k]
  |  Branch (82:28): [True: 2.20k, False: 0]
  ------------------
   83|  2.20k|    std::string mid = fdp.ConsumeRandomLengthString(24);
   84|  2.20k|    size_t pos = fdp.ConsumeIntegralInRange<size_t>(0, out.size());
   85|  2.20k|    out.insert(pos, mid);
   86|  2.20k|  }
   87|  6.69k|  if (fdp.ConsumeBool() && !out.empty()) {
  ------------------
  |  Branch (87:7): [True: 1.32k, False: 5.37k]
  |  Branch (87:28): [True: 1.32k, False: 0]
  ------------------
   88|  1.32k|    size_t i = fdp.ConsumeIntegralInRange<size_t>(0, out.size() - 1);
   89|  1.32k|    out[i] = static_cast<char>(fdp.ConsumeIntegral<uint8_t>());
   90|  1.32k|  }
   91|  6.69k|  return out;
   92|  6.69k|}
simple_absolute.cc:_ZL4pickILm8EEPKcR18FuzzedDataProviderRAT__KS1_:
   70|  6.69k|static const char* pick(FuzzedDataProvider& fdp, const char* const (&arr)[N]) {
   71|  6.69k|  return arr[fdp.ConsumeIntegralInRange<size_t>(0, N - 1)];
   72|  6.69k|}
simple_absolute.cc:_ZL4pickILm20EEPKcR18FuzzedDataProviderRAT__KS1_:
   70|  6.69k|static const char* pick(FuzzedDataProvider& fdp, const char* const (&arr)[N]) {
   71|  6.69k|  return arr[fdp.ConsumeIntegralInRange<size_t>(0, N - 1)];
   72|  6.69k|}
simple_absolute.cc:_ZL4pickILm16EEPKcR18FuzzedDataProviderRAT__KS1_:
   70|  6.69k|static const char* pick(FuzzedDataProvider& fdp, const char* const (&arr)[N]) {
   71|  6.69k|  return arr[fdp.ConsumeIntegralInRange<size_t>(0, N - 1)];
   72|  6.69k|}
simple_absolute.cc:_ZL4pickILm6EEPKcR18FuzzedDataProviderRAT__KS1_:
   70|  6.69k|static const char* pick(FuzzedDataProvider& fdp, const char* const (&arr)[N]) {
   71|  6.69k|  return arr[fdp.ConsumeIntegralInRange<size_t>(0, N - 1)];
   72|  6.69k|}
simple_absolute.cc:_ZL4pickILm5EEPKcR18FuzzedDataProviderRAT__KS1_:
   70|  6.69k|static const char* pick(FuzzedDataProvider& fdp, const char* const (&arr)[N]) {
   71|  6.69k|  return arr[fdp.ConsumeIntegralInRange<size_t>(0, N - 1)];
   72|  6.69k|}

