_ZN3ada4idna13utf8_to_utf32EPKcmPDi:
  172|    881|size_t utf8_to_utf32(const char* buf, size_t len, char32_t* utf32_output) {
  173|    881|  const uint8_t* data = reinterpret_cast<const uint8_t*>(buf);
  174|    881|  size_t pos = 0;
  175|    881|  const char32_t* start{utf32_output};
  176|  15.0k|  while (pos < len) {
  ------------------
  |  Branch (176:10): [True: 14.3k, False: 735]
  ------------------
  177|       |    // try to convert the next block of 16 ASCII bytes
  178|  14.3k|    if (pos + 16 <= len) {  // if it is safe to read 16 more
  ------------------
  |  Branch (178:9): [True: 7.18k, False: 7.17k]
  ------------------
  179|       |                            // bytes, check that they are ascii
  180|  7.18k|      uint64_t v1;
  181|  7.18k|      std::memcpy(&v1, data + pos, sizeof(uint64_t));
  182|  7.18k|      uint64_t v2;
  183|  7.18k|      std::memcpy(&v2, data + pos + sizeof(uint64_t), sizeof(uint64_t));
  184|  7.18k|      uint64_t v{v1 | v2};
  185|  7.18k|      if ((v & 0x8080808080808080) == 0) {
  ------------------
  |  Branch (185:11): [True: 627, False: 6.56k]
  ------------------
  186|    627|        size_t final_pos = pos + 16;
  187|  10.6k|        while (pos < final_pos) {
  ------------------
  |  Branch (187:16): [True: 10.0k, False: 627]
  ------------------
  188|  10.0k|          *utf32_output++ = char32_t(buf[pos]);
  189|  10.0k|          pos++;
  190|  10.0k|        }
  191|    627|        continue;
  192|    627|      }
  193|  7.18k|    }
  194|  13.7k|    uint8_t leading_byte = data[pos];  // leading byte
  195|  13.7k|    if (leading_byte < 0b10000000) {
  ------------------
  |  Branch (195:9): [True: 11.8k, False: 1.83k]
  ------------------
  196|       |      // converting one ASCII byte !!!
  197|  11.8k|      *utf32_output++ = char32_t(leading_byte);
  198|  11.8k|      pos++;
  199|  11.8k|    } else if ((leading_byte & 0b11100000) == 0b11000000) {
  ------------------
  |  Branch (199:16): [True: 696, False: 1.14k]
  ------------------
  200|       |      // We have a two-byte UTF-8
  201|    696|      if (pos + 1 >= len) {
  ------------------
  |  Branch (201:11): [True: 1, False: 695]
  ------------------
  202|      1|        return 0;
  203|      1|      }  // minimal bound checking
  204|    695|      if ((data[pos + 1] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (204:11): [True: 33, False: 662]
  ------------------
  205|     33|        return 0;
  206|     33|      }
  207|       |      // range check
  208|    662|      uint32_t code_point =
  209|    662|          (leading_byte & 0b00011111) << 6 | (data[pos + 1] & 0b00111111);
  210|    662|      if (code_point < 0x80 || 0x7ff < code_point) {
  ------------------
  |  Branch (210:11): [True: 6, False: 656]
  |  Branch (210:32): [True: 0, False: 656]
  ------------------
  211|      6|        return 0;
  212|      6|      }
  213|    656|      *utf32_output++ = char32_t(code_point);
  214|    656|      pos += 2;
  215|  1.14k|    } else if ((leading_byte & 0b11110000) == 0b11100000) {
  ------------------
  |  Branch (215:16): [True: 837, False: 305]
  ------------------
  216|       |      // We have a three-byte UTF-8
  217|    837|      if (pos + 2 >= len) {
  ------------------
  |  Branch (217:11): [True: 2, False: 835]
  ------------------
  218|      2|        return 0;
  219|      2|      }  // minimal bound checking
  220|       |
  221|    835|      if ((data[pos + 1] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (221:11): [True: 8, False: 827]
  ------------------
  222|      8|        return 0;
  223|      8|      }
  224|    827|      if ((data[pos + 2] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (224:11): [True: 6, False: 821]
  ------------------
  225|      6|        return 0;
  226|      6|      }
  227|       |      // range check
  228|    821|      uint32_t code_point = (leading_byte & 0b00001111) << 12 |
  229|    821|                            (data[pos + 1] & 0b00111111) << 6 |
  230|    821|                            (data[pos + 2] & 0b00111111);
  231|    821|      if (code_point < 0x800 || 0xffff < code_point ||
  ------------------
  |  Branch (231:11): [True: 3, False: 818]
  |  Branch (231:33): [True: 0, False: 818]
  ------------------
  232|    818|          (0xd7ff < code_point && code_point < 0xe000)) {
  ------------------
  |  Branch (232:12): [True: 176, False: 642]
  |  Branch (232:35): [True: 1, False: 175]
  ------------------
  233|      4|        return 0;
  234|      4|      }
  235|    817|      *utf32_output++ = char32_t(code_point);
  236|    817|      pos += 3;
  237|    817|    } else if ((leading_byte & 0b11111000) == 0b11110000) {  // 0b11110000
  ------------------
  |  Branch (237:16): [True: 243, False: 62]
  ------------------
  238|       |      // we have a 4-byte UTF-8 word.
  239|    243|      if (pos + 3 >= len) {
  ------------------
  |  Branch (239:11): [True: 5, False: 238]
  ------------------
  240|      5|        return 0;
  241|      5|      }  // minimal bound checking
  242|    238|      if ((data[pos + 1] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (242:11): [True: 10, False: 228]
  ------------------
  243|     10|        return 0;
  244|     10|      }
  245|    228|      if ((data[pos + 2] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (245:11): [True: 4, False: 224]
  ------------------
  246|      4|        return 0;
  247|      4|      }
  248|    224|      if ((data[pos + 3] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (248:11): [True: 2, False: 222]
  ------------------
  249|      2|        return 0;
  250|      2|      }
  251|       |
  252|       |      // range check
  253|    222|      uint32_t code_point = (leading_byte & 0b00000111) << 18 |
  254|    222|                            (data[pos + 1] & 0b00111111) << 12 |
  255|    222|                            (data[pos + 2] & 0b00111111) << 6 |
  256|    222|                            (data[pos + 3] & 0b00111111);
  257|    222|      if (code_point <= 0xffff || 0x10ffff < code_point) {
  ------------------
  |  Branch (257:11): [True: 1, False: 221]
  |  Branch (257:35): [True: 2, False: 219]
  ------------------
  258|      3|        return 0;
  259|      3|      }
  260|    219|      *utf32_output++ = char32_t(code_point);
  261|    219|      pos += 4;
  262|    219|    } else {
  263|     62|      return 0;
  264|     62|    }
  265|  13.7k|  }
  266|    735|  return utf32_output - start;
  267|    881|}
_ZN3ada4idna22utf32_length_from_utf8EPKcm:
  282|    883|size_t utf32_length_from_utf8(const char* buf, size_t len) {
  283|    883|  const int8_t* p = reinterpret_cast<const int8_t*>(buf);
  284|    883|  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|    883|    return c > -65;
  288|    883|  });
  289|    883|}
_ZN3ada4idna9ascii_mapEPcm:
 5133|    337|void ascii_map(char* input, size_t length) {
 5134|    337|  auto broadcast = [](uint8_t v) -> uint64_t {
 5135|    337|    return 0x101010101010101ull * v;
 5136|    337|  };
 5137|    337|  uint64_t broadcast_80 = broadcast(0x80);
 5138|    337|  uint64_t broadcast_Ap = broadcast(128 - 'A');
 5139|    337|  uint64_t broadcast_Zp = broadcast(128 - 'Z' - 1);
 5140|    337|  size_t i = 0;
 5141|       |
 5142|    672|  for (; i + 7 < length; i += 8) {
  ------------------
  |  Branch (5142:10): [True: 335, False: 337]
  ------------------
 5143|    335|    uint64_t word{};
 5144|    335|    std::memcpy(&word, input + i, sizeof(word));
 5145|    335|    word ^=
 5146|    335|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
 5147|    335|    std::memcpy(input + i, &word, sizeof(word));
 5148|    335|  }
 5149|    337|  if (i < length) {
  ------------------
  |  Branch (5149:7): [True: 320, False: 17]
  ------------------
 5150|    320|    uint64_t word{};
 5151|    320|    std::memcpy(&word, input + i, length - i);
 5152|    320|    word ^=
 5153|    320|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
 5154|    320|    std::memcpy(input + i, &word, length - i);
 5155|    320|  }
 5156|    337|}
_ZN3ada4idna3mapENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEERNS1_12basic_stringIDiS4_NS1_9allocatorIDiEEEE:
 5160|    817|bool map(std::u32string_view input, std::u32string& out) {
 5161|       |  //  [Map](https://www.unicode.org/reports/tr46/#ProcessingStepMap).
 5162|    817|  out.clear();
 5163|    817|  if (!ensure_tables()) {
  ------------------
  |  Branch (5163:7): [True: 0, False: 817]
  ------------------
 5164|      0|    return false;
 5165|      0|  }
 5166|       |
 5167|       |  // Pass 1: validate and compute exact output length.
 5168|    817|  size_t out_size = 0;
 5169|  23.7k|  for (char32_t x : input) {
  ------------------
  |  Branch (5169:19): [True: 23.7k, False: 761]
  ------------------
 5170|  23.7k|    uint16_t status = idna_lookup(static_cast<uint32_t>(x));
 5171|  23.7k|    if (status == IDNA_DISALLOWED) {
  ------------------
  |  Branch (5171:9): [True: 56, False: 23.6k]
  ------------------
 5172|     56|      return false;
 5173|     56|    }
 5174|  23.6k|    if (status == IDNA_VALID) {
  ------------------
  |  Branch (5174:9): [True: 20.7k, False: 2.91k]
  ------------------
 5175|  20.7k|      ++out_size;
 5176|  20.7k|      continue;
 5177|  20.7k|    }
 5178|  2.91k|    if (static_cast<size_t>(status) >= idna_utf8_mappings_size) {
  ------------------
  |  Branch (5178:9): [True: 0, False: 2.91k]
  ------------------
 5179|      0|      return false;
 5180|      0|    }
 5181|  2.91k|    out_size += utf8_count_codepoints(idna_utf8_mappings + status);
 5182|  2.91k|  }
 5183|       |
 5184|       |  // Pass 2: write into a single allocation.
 5185|    761|  out.resize(out_size);
 5186|    761|  size_t w = 0;
 5187|  23.1k|  for (char32_t x : input) {
  ------------------
  |  Branch (5187:19): [True: 23.1k, False: 761]
  ------------------
 5188|  23.1k|    uint16_t status = idna_lookup(static_cast<uint32_t>(x));
 5189|  23.1k|    if (status == IDNA_VALID) {
  ------------------
  |  Branch (5189:9): [True: 20.3k, False: 2.88k]
  ------------------
 5190|  20.3k|      out[w++] = x;
 5191|  20.3k|      continue;
 5192|  20.3k|    }
 5193|       |    // IGNORED or mapped (status already validated in pass 1).
 5194|  2.88k|    const uint8_t* ptr = idna_utf8_mappings + status;
 5195|  6.54k|    while (*ptr != 0) {
  ------------------
  |  Branch (5195:12): [True: 3.66k, False: 2.88k]
  ------------------
 5196|  3.66k|      out[w++] = utf8_next(ptr);
 5197|  3.66k|    }
 5198|  2.88k|  }
 5199|    761|  return true;
 5200|    817|}
_ZN3ada4idna28compute_decomposition_lengthENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5293|     15|    const std::u32string_view input) noexcept {
 5294|     15|  bool decomposition_needed{false};
 5295|     15|  size_t additional_elements{0};
 5296|    568|  for (char32_t current_character : input) {
  ------------------
  |  Branch (5296:35): [True: 568, False: 15]
  ------------------
 5297|    568|    size_t decomposition_length{0};
 5298|       |
 5299|    568|    if (current_character >= hangul_sbase &&
  ------------------
  |  Branch (5299:9): [True: 0, False: 568]
  ------------------
 5300|      0|        current_character < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5300:9): [True: 0, False: 0]
  ------------------
 5301|       |      // Full NFD-style Hangul decomp for the decompose() step.
 5302|      0|      decomposition_length = 2;
 5303|      0|      if ((current_character - hangul_sbase) % hangul_tcount) {
  ------------------
  |  Branch (5303:11): [True: 0, False: 0]
  ------------------
 5304|      0|        decomposition_length = 3;
 5305|      0|      }
 5306|    568|    } else if (current_character < 0x110000) {
  ------------------
  |  Branch (5306:16): [True: 568, False: 0]
  ------------------
 5307|    568|      const uint8_t di = decomposition_index[current_character >> 8];
 5308|    568|      const uint16_t* const decomposition =
 5309|    568|          decomposition_block_row(di) + (current_character % 256);
 5310|    568|      decomposition_length = (decomposition[1] >> 2) - (decomposition[0] >> 2);
 5311|    568|      if ((decomposition_length > 0) && (decomposition[0] & 1)) {
  ------------------
  |  Branch (5311:11): [True: 0, False: 568]
  |  Branch (5311:41): [True: 0, False: 0]
  ------------------
 5312|      0|        decomposition_length = 0;
 5313|      0|      }
 5314|    568|    }
 5315|    568|    if (decomposition_length != 0) {
  ------------------
  |  Branch (5315:9): [True: 0, False: 568]
  ------------------
 5316|      0|      decomposition_needed = true;
 5317|      0|      additional_elements += decomposition_length - 1;
 5318|      0|    }
 5319|    568|  }
 5320|     15|  return {decomposition_needed, additional_elements};
 5321|     15|}
_ZN3ada4idna7get_cccEDi:
 5367|  40.2k|uint8_t get_ccc(char32_t c) noexcept {
 5368|  40.2k|  if (c >= 0x110000) {
  ------------------
  |  Branch (5368:7): [True: 0, False: 40.2k]
  ------------------
 5369|      0|    return 0;
 5370|      0|  }
 5371|  40.2k|  return ccc_block_row(ccc_index[c >> 8])[c % 256];
 5372|  40.2k|}
_ZN3ada4idna10sort_marksERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 5374|     15|void sort_marks(std::u32string& input) {
 5375|    568|  for (size_t idx = 1; idx < input.size(); idx++) {
  ------------------
  |  Branch (5375:24): [True: 553, False: 15]
  ------------------
 5376|    553|    uint8_t ccc = get_ccc(input[idx]);
 5377|    553|    if (ccc == 0) {
  ------------------
  |  Branch (5377:9): [True: 512, False: 41]
  ------------------
 5378|    512|      continue;
 5379|    512|    }
 5380|     41|    auto current_character = input[idx];
 5381|     41|    size_t back_idx = idx;
 5382|     64|    while (back_idx != 0 && get_ccc(input[back_idx - 1]) > ccc) {
  ------------------
  |  Branch (5382:12): [True: 59, False: 5]
  |  Branch (5382:29): [True: 23, False: 36]
  ------------------
 5383|     23|      input[back_idx] = input[back_idx - 1];
 5384|     23|      back_idx--;
 5385|     23|    }
 5386|     41|    input[back_idx] = current_character;
 5387|     41|  }
 5388|     15|}
_ZN3ada4idna13decompose_nfcERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 5390|     15|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|     15|  auto [decomposition_needed, additional_elements] =
 5396|     15|      compute_decomposition_length(input);
 5397|     15|  if (decomposition_needed) {
  ------------------
  |  Branch (5397:7): [True: 0, False: 15]
  ------------------
 5398|      0|    decompose(input, additional_elements);
 5399|      0|  }
 5400|     15|  sort_marks(input);
 5401|     15|}
_ZN3ada4idna14is_already_nfcENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5468|    637|bool is_already_nfc(std::u32string_view input) noexcept {
 5469|    637|  if (input.empty()) {
  ------------------
  |  Branch (5469:7): [True: 0, False: 637]
  ------------------
 5470|      0|    return true;
 5471|      0|  }
 5472|    637|  if (!tables_are_ready() && !ensure_tables()) {
  ------------------
  |  Branch (5472:7): [True: 0, False: 637]
  |  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|  20.7k|  for (char32_t c : input) {
  ------------------
  |  Branch (5477:19): [True: 20.7k, False: 637]
  ------------------
 5478|  20.7k|    if (canonical_decomp_length(c) == 1) {
  ------------------
  |  Branch (5478:9): [True: 0, False: 20.7k]
  ------------------
 5479|      0|      return false;
 5480|      0|    }
 5481|  20.7k|  }
 5482|       |  // 2) Combining marks already in canonical order.
 5483|    637|  uint8_t prev_ccc = 0;
 5484|  20.1k|  for (char32_t c : input) {
  ------------------
  |  Branch (5484:19): [True: 20.1k, False: 611]
  ------------------
 5485|  20.1k|    uint8_t ccc = get_ccc(c);
 5486|  20.1k|    if (ccc != 0 && prev_ccc > ccc) {
  ------------------
  |  Branch (5486:9): [True: 343, False: 19.8k]
  |  Branch (5486:21): [True: 26, False: 317]
  ------------------
 5487|     26|      return false;
 5488|     26|    }
 5489|  20.1k|    prev_ccc = ccc;
 5490|  20.1k|  }
 5491|       |  // 3) No pairwise composition would apply (including Hangul L+V / LV+T).
 5492|    611|  return !would_compose(input);
 5493|    637|}
_ZN3ada4idna7composeERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 5495|     15|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|     15|  size_t input_count{0};
 5501|     15|  size_t composition_count{0};
 5502|    542|  for (; input_count < input.size(); input_count++, composition_count++) {
  ------------------
  |  Branch (5502:10): [True: 527, False: 15]
  ------------------
 5503|    527|    input[composition_count] = input[input_count];
 5504|    527|    if (input[input_count] >= hangul_lbase &&
  ------------------
  |  Branch (5504:9): [True: 11, False: 516]
  ------------------
 5505|     11|        input[input_count] < hangul_lbase + hangul_lcount) {
  ------------------
  |  Branch (5505:9): [True: 3, False: 8]
  ------------------
 5506|      3|      if (input_count + 1 < input.size() &&
  ------------------
  |  Branch (5506:11): [True: 3, False: 0]
  ------------------
 5507|      3|          input[input_count + 1] >= hangul_vbase &&
  ------------------
  |  Branch (5507:11): [True: 3, False: 0]
  ------------------
 5508|      3|          input[input_count + 1] < hangul_vbase + hangul_vcount) {
  ------------------
  |  Branch (5508:11): [True: 0, False: 3]
  ------------------
 5509|      0|        input[composition_count] =
 5510|      0|            hangul_sbase +
 5511|      0|            ((input[input_count] - hangul_lbase) * hangul_vcount +
 5512|      0|             input[input_count + 1] - hangul_vbase) *
 5513|      0|                hangul_tcount;
 5514|      0|        input_count++;
 5515|      0|        if (input_count + 1 < input.size() &&
  ------------------
  |  Branch (5515:13): [True: 0, False: 0]
  ------------------
 5516|      0|            input[input_count + 1] > hangul_tbase &&
  ------------------
  |  Branch (5516:13): [True: 0, False: 0]
  ------------------
 5517|      0|            input[input_count + 1] < hangul_tbase + hangul_tcount) {
  ------------------
  |  Branch (5517:13): [True: 0, False: 0]
  ------------------
 5518|      0|          input[composition_count] += input[++input_count] - hangul_tbase;
 5519|      0|        }
 5520|      0|      }
 5521|    524|    } else if (input[input_count] >= hangul_sbase &&
  ------------------
  |  Branch (5521:16): [True: 0, False: 524]
  ------------------
 5522|      0|               input[input_count] < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5522:16): [True: 0, False: 0]
  ------------------
 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|    524|    } else if (input[input_count] < 0x110000) {
  ------------------
  |  Branch (5529:16): [True: 524, False: 0]
  ------------------
 5530|    524|      const uint16_t* composition =
 5531|    524|          composition_block_row(composition_index[input[input_count] >> 8]) +
 5532|    524|          (input[input_count] % 256);
 5533|    524|      size_t initial_composition_count = composition_count;
 5534|    565|      for (int32_t previous_ccc = -1; input_count + 1 < input.size();
  ------------------
  |  Branch (5534:39): [True: 550, False: 15]
  ------------------
 5535|    550|           input_count++) {
 5536|    550|        uint8_t ccc = get_ccc(input[input_count + 1]);
 5537|       |
 5538|    550|        if (composition[1] != composition[0] && previous_ccc < ccc) {
  ------------------
  |  Branch (5538:13): [True: 276, False: 274]
  |  Branch (5538:49): [True: 276, False: 0]
  ------------------
 5539|    276|          int left = composition[0];
 5540|    276|          int right = composition[1];
 5541|    276|          if (left < 0 || right < left ||
  ------------------
  |  Branch (5541:15): [True: 0, False: 276]
  |  Branch (5541:27): [True: 0, False: 276]
  ------------------
 5542|    276|              static_cast<size_t>(right) > composition_data_size) {
  ------------------
  |  Branch (5542:15): [True: 0, False: 276]
  ------------------
 5543|      0|            break;
 5544|      0|          }
 5545|    998|          while (left + 2 < right) {
  ------------------
  |  Branch (5545:18): [True: 722, False: 276]
  ------------------
 5546|    722|            int middle = left + (((right - left) >> 1) & ~1);
 5547|    722|            if (composition_data[static_cast<size_t>(middle)] <=
  ------------------
  |  Branch (5547:17): [True: 18, False: 704]
  ------------------
 5548|    722|                input[input_count + 1]) {
 5549|     18|              left = middle;
 5550|     18|            }
 5551|    722|            if (composition_data[static_cast<size_t>(middle)] >=
  ------------------
  |  Branch (5551:17): [True: 704, False: 18]
  ------------------
 5552|    722|                input[input_count + 1]) {
 5553|    704|              right = middle;
 5554|    704|            }
 5555|    722|          }
 5556|    276|          if (static_cast<size_t>(left + 1) < composition_data_size &&
  ------------------
  |  Branch (5556:15): [True: 276, False: 0]
  ------------------
 5557|    276|              composition_data[static_cast<size_t>(left)] ==
  ------------------
  |  Branch (5557:15): [True: 2, False: 274]
  ------------------
 5558|    276|                  input[input_count + 1]) {
 5559|      2|            char32_t composed = composition_data[static_cast<size_t>(left + 1)];
 5560|      2|            input[initial_composition_count] = composed;
 5561|      2|            composition =
 5562|      2|                composition_block_row(composition_index[composed >> 8]) +
 5563|      2|                (composed % 256);
 5564|      2|            continue;
 5565|      2|          }
 5566|    276|        }
 5567|       |
 5568|    548|        if (ccc == 0) {
  ------------------
  |  Branch (5568:13): [True: 509, False: 39]
  ------------------
 5569|    509|          break;
 5570|    509|        }
 5571|     39|        previous_ccc = ccc;
 5572|     39|        input[++composition_count] = input[input_count + 1];
 5573|     39|      }
 5574|    524|    }
 5575|    527|  }
 5576|       |
 5577|     15|  if (composition_count < input_count) {
  ------------------
  |  Branch (5577:7): [True: 2, False: 13]
  ------------------
 5578|      2|    input.resize(composition_count);
 5579|      2|  }
 5580|     15|}
_ZN3ada4idna9normalizeERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 5582|     15|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|     15|  if (!ensure_tables() || decomposition_index == nullptr ||
  ------------------
  |  Branch (5587:7): [True: 0, False: 15]
  |  Branch (5587:27): [True: 0, False: 15]
  ------------------
 5588|     15|      composition_index == nullptr) {
  ------------------
  |  Branch (5588:7): [True: 0, False: 15]
  ------------------
 5589|      0|    return false;
 5590|      0|  }
 5591|     15|  if (is_already_nfc(input)) {
  ------------------
  |  Branch (5591:7): [True: 0, False: 15]
  ------------------
 5592|      0|    return true;
 5593|      0|  }
 5594|     15|  decompose_nfc(input);
 5595|     15|  compose(input);
 5596|     15|  return true;
 5597|     15|}
_ZN3ada4idna17punycode_to_utf32ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEERNS1_12basic_stringIDiNS3_IDiEENS1_9allocatorIDiEEEE:
 5657|    100|bool punycode_to_utf32(std::string_view input, std::u32string &out) {
 5658|    100|  int32_t written_out{0};
 5659|    100|  out.reserve(out.size() + input.size());
 5660|    100|  uint32_t n = initial_n;
 5661|    100|  int32_t i = 0;
 5662|    100|  int32_t bias = initial_bias;
 5663|       |  // grab ascii content
 5664|    100|  size_t end_of_ascii = input.find_last_of('-');
 5665|    100|  if (end_of_ascii != std::string_view::npos) {
  ------------------
  |  Branch (5665:7): [True: 51, False: 49]
  ------------------
 5666|    939|    for (uint8_t c : input.substr(0, end_of_ascii)) {
  ------------------
  |  Branch (5666:20): [True: 939, False: 51]
  ------------------
 5667|    939|      if (c >= 0x80) {
  ------------------
  |  Branch (5667:11): [True: 0, False: 939]
  ------------------
 5668|      0|        return false;
 5669|      0|      }
 5670|    939|      out.push_back(c);
 5671|    939|      written_out++;
 5672|    939|    }
 5673|     51|    input.remove_prefix(end_of_ascii + 1);
 5674|     51|  }
 5675|    827|  while (!input.empty()) {
  ------------------
  |  Branch (5675:10): [True: 742, False: 85]
  ------------------
 5676|    742|    int32_t oldi = i;
 5677|    742|    int32_t w = 1;
 5678|  1.11k|    for (int32_t k = base;; k += base) {
 5679|  1.11k|      if (input.empty()) {
  ------------------
  |  Branch (5679:11): [True: 5, False: 1.11k]
  ------------------
 5680|      5|        return false;
 5681|      5|      }
 5682|  1.11k|      uint8_t code_point = input.front();
 5683|  1.11k|      input.remove_prefix(1);
 5684|  1.11k|      int32_t digit = char_to_digit_value(code_point);
 5685|  1.11k|      if (digit < 0) {
  ------------------
  |  Branch (5685:11): [True: 8, False: 1.10k]
  ------------------
 5686|      8|        return false;
 5687|      8|      }
 5688|  1.10k|      if (digit > (0x7fffffff - i) / w) {
  ------------------
  |  Branch (5688:11): [True: 2, False: 1.10k]
  ------------------
 5689|      2|        return false;
 5690|      2|      }
 5691|  1.10k|      i = i + digit * w;
 5692|  1.10k|      int32_t t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;
  ------------------
  |  Branch (5692:19): [True: 209, False: 893]
  |  Branch (5692:38): [True: 826, False: 67]
  ------------------
 5693|  1.10k|      if (digit < t) {
  ------------------
  |  Branch (5693:11): [True: 727, False: 375]
  ------------------
 5694|    727|        break;
 5695|    727|      }
 5696|    375|      if (w > 0x7fffffff / (base - t)) {
  ------------------
  |  Branch (5696:11): [True: 0, False: 375]
  ------------------
 5697|      0|        return false;
 5698|      0|      }
 5699|    375|      w = w * (base - t);
 5700|    375|    }
 5701|    727|    bias = adapt(i - oldi, written_out + 1, oldi == 0);
 5702|    727|    if (i / (written_out + 1) > int32_t(0x7fffffff - n)) {
  ------------------
  |  Branch (5702:9): [True: 0, False: 727]
  ------------------
 5703|      0|      return false;
 5704|      0|    }
 5705|    727|    n = n + i / (written_out + 1);
 5706|    727|    i = i % (written_out + 1);
 5707|    727|    if (n < 0x80) {
  ------------------
  |  Branch (5707:9): [True: 0, False: 727]
  ------------------
 5708|      0|      return false;
 5709|      0|    }
 5710|    727|    out.insert(out.begin() + i, n);
 5711|    727|    written_out++;
 5712|    727|    ++i;
 5713|    727|  }
 5714|       |  // See https://github.com/whatwg/url/issues/803
 5715|       |  // Reject labels whose decoded form begins with "xn--" (double-encoded ACE).
 5716|     85|  if (out.size() >= 4 && out[0] == U'x' && out[1] == U'n' && out[2] == U'-' &&
  ------------------
  |  Branch (5716:7): [True: 68, False: 17]
  |  Branch (5716:26): [True: 2, False: 66]
  |  Branch (5716:44): [True: 0, False: 2]
  |  Branch (5716:62): [True: 0, False: 0]
  ------------------
 5717|      0|      out[3] == U'-') {
  ------------------
  |  Branch (5717:7): [True: 0, False: 0]
  ------------------
 5718|      0|    return false;
 5719|      0|  }
 5720|     85|  return true;
 5721|     85|}
_ZN3ada4idna17utf32_to_punycodeENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEERNS1_12basic_stringIcNS3_IcEENS1_9allocatorIcEEEE:
 5801|    600|bool utf32_to_punycode(std::u32string_view input, std::string &out) {
 5802|    600|  out.reserve(input.size() + out.size());
 5803|    600|  uint32_t n = initial_n;
 5804|    600|  int32_t d = 0;
 5805|    600|  int32_t bias = initial_bias;
 5806|    600|  size_t h = 0;
 5807|       |  // first push the ascii content
 5808|  6.17k|  for (uint32_t c : input) {
  ------------------
  |  Branch (5808:19): [True: 6.17k, False: 600]
  ------------------
 5809|  6.17k|    if (c < 0x80) {
  ------------------
  |  Branch (5809:9): [True: 5.07k, False: 1.10k]
  ------------------
 5810|  5.07k|      ++h;
 5811|  5.07k|      out.push_back(char(c));
 5812|  5.07k|    }
 5813|  6.17k|    if (c > 0x10ffff || (c >= 0xd800 && c < 0xe000)) {
  ------------------
  |  Branch (5813:9): [True: 0, False: 6.17k]
  |  Branch (5813:26): [True: 327, False: 5.85k]
  |  Branch (5813:41): [True: 0, False: 327]
  ------------------
 5814|      0|      return false;
 5815|      0|    }
 5816|  6.17k|  }
 5817|    600|  size_t b = h;
 5818|    600|  if (b > 0) {
  ------------------
  |  Branch (5818:7): [True: 529, False: 71]
  ------------------
 5819|    529|    out.push_back('-');
 5820|    529|  }
 5821|  1.57k|  while (h < input.size()) {
  ------------------
  |  Branch (5821:10): [True: 973, False: 600]
  ------------------
 5822|    973|    uint32_t m = 0x10FFFF;
 5823|  15.9k|    for (auto code_point : input) {
  ------------------
  |  Branch (5823:26): [True: 15.9k, False: 973]
  ------------------
 5824|  15.9k|      if (code_point >= n && code_point < m) m = code_point;
  ------------------
  |  Branch (5824:11): [True: 2.20k, False: 13.7k]
  |  Branch (5824:30): [True: 1.20k, False: 1.00k]
  ------------------
 5825|  15.9k|    }
 5826|       |
 5827|    973|    if ((m - n) > (0x7fffffff - d) / (h + 1)) {
  ------------------
  |  Branch (5827:9): [True: 0, False: 973]
  ------------------
 5828|      0|      return false;
 5829|      0|    }
 5830|    973|    d = d + int32_t((m - n) * (h + 1));
 5831|    973|    n = m;
 5832|  15.9k|    for (auto c : input) {
  ------------------
  |  Branch (5832:17): [True: 15.9k, False: 973]
  ------------------
 5833|  15.9k|      if (c < n) {
  ------------------
  |  Branch (5833:11): [True: 13.7k, False: 2.20k]
  ------------------
 5834|  13.7k|        if (d == 0x7fffffff) {
  ------------------
  |  Branch (5834:13): [True: 0, False: 13.7k]
  ------------------
 5835|      0|          return false;
 5836|      0|        }
 5837|  13.7k|        ++d;
 5838|  13.7k|      }
 5839|  15.9k|      if (c == n) {
  ------------------
  |  Branch (5839:11): [True: 1.10k, False: 14.8k]
  ------------------
 5840|  1.10k|        int32_t q = d;
 5841|  3.44k|        for (int32_t k = base;; k += base) {
 5842|  3.44k|          int32_t t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;
  ------------------
  |  Branch (5842:23): [True: 1.41k, False: 2.02k]
  |  Branch (5842:42): [True: 1.79k, False: 237]
  ------------------
 5843|       |
 5844|  3.44k|          if (q < t) {
  ------------------
  |  Branch (5844:15): [True: 1.10k, False: 2.33k]
  ------------------
 5845|  1.10k|            break;
 5846|  1.10k|          }
 5847|  2.33k|          out.push_back(digit_to_char(t + ((q - t) % (base - t))));
 5848|  2.33k|          q = (q - t) / (base - t);
 5849|  2.33k|        }
 5850|  1.10k|        out.push_back(digit_to_char(q));
 5851|  1.10k|        bias = adapt(d, int32_t(h + 1), h == b);
 5852|  1.10k|        d = 0;
 5853|  1.10k|        ++h;
 5854|  1.10k|      }
 5855|  15.9k|    }
 5856|    973|    ++d;
 5857|    973|    ++n;
 5858|    973|  }
 5859|    600|  return true;
 5860|    600|}
_ZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5944|    835|bool is_label_valid(const std::u32string_view label) {
 5945|    835|  if (label.empty()) {
  ------------------
  |  Branch (5945:7): [True: 0, False: 835]
  ------------------
 5946|      0|    return true;
 5947|      0|  }
 5948|    835|  if (!ensure_tables() || combining_ranges == nullptr || dir_start == nullptr ||
  ------------------
  |  Branch (5948:7): [True: 0, False: 835]
  |  Branch (5948:27): [True: 0, False: 835]
  |  Branch (5948:58): [True: 0, False: 835]
  ------------------
 5949|    835|      dir_final == nullptr || dir_value == nullptr) {
  ------------------
  |  Branch (5949:7): [True: 0, False: 835]
  |  Branch (5949:31): [True: 0, False: 835]
  ------------------
 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|    835|  const std::span<const uint32_t[2]> comb_span{combining_ranges,
 5975|    835|                                               combining_range_count};
 5976|    835|  const auto comb_it = std::ranges::lower_bound(
 5977|    835|      comb_span, label.front(), {}, [](const auto& range) { return range[1]; });
 5978|    835|  if (comb_it != comb_span.end() && label.front() >= (*comb_it)[0]) {
  ------------------
  |  Branch (5978:7): [True: 835, False: 0]
  |  Branch (5978:7): [True: 2, False: 833]
  |  Branch (5978:37): [True: 2, False: 833]
  ------------------
 5979|      2|    return false;
 5980|      2|  }
 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|    833|  constexpr static uint32_t virama[] = {
 5993|    833|      0x094D,  0x09CD,  0x0A4D,  0x0ACD,  0x0B4D,  0x0BCD,  0x0C4D,  0x0CCD,
 5994|    833|      0x0D3B,  0x0D3C,  0x0D4D,  0x0DCA,  0x0E3A,  0x0EBA,  0x0F84,  0x1039,
 5995|    833|      0x103A,  0x1714,  0x1734,  0x17D2,  0x1A60,  0x1B44,  0x1BAA,  0x1BAB,
 5996|    833|      0x1BF2,  0x1BF3,  0x2D7F,  0xA806,  0xA82C,  0xA8C4,  0xA953,  0xA9C0,
 5997|    833|      0xAAF6,  0xABED,  0x10A3F, 0x11046, 0x1107F, 0x110B9, 0x11133, 0x11134,
 5998|    833|      0x111C0, 0x11235, 0x112EA, 0x1134D, 0x11442, 0x114C2, 0x115BF, 0x1163F,
 5999|    833|      0x116B6, 0x1172B, 0x11839, 0x1193D, 0x1193E, 0x119E0, 0x11A34, 0x11A47,
 6000|    833|      0x11A99, 0x11C3F, 0x11D44, 0x11D45, 0x11D97};
 6001|    833|  constexpr static uint32_t R[] = {
 6002|    833|      0x622, 0x623, 0x624, 0x625, 0x627, 0x629, 0x62f, 0x630, 0x631,
 6003|    833|      0x632, 0x648, 0x671, 0x672, 0x673, 0x675, 0x676, 0x677, 0x688,
 6004|    833|      0x689, 0x68a, 0x68b, 0x68c, 0x68d, 0x68e, 0x68f, 0x690, 0x691,
 6005|    833|      0x692, 0x693, 0x694, 0x695, 0x696, 0x697, 0x698, 0x699, 0x6c0,
 6006|    833|      0x6c3, 0x6c4, 0x6c5, 0x6c6, 0x6c7, 0x6c8, 0x6c9, 0x6ca, 0x6cb,
 6007|    833|      0x6cd, 0x6cf, 0x6d2, 0x6d3, 0x6d5, 0x6ee, 0x6ef, 0x710, 0x715,
 6008|    833|      0x716, 0x717, 0x718, 0x719, 0x71e, 0x728, 0x72a, 0x72c, 0x72f,
 6009|    833|      0x74d, 0x759, 0x75a, 0x75b, 0x854, 0x8aa, 0x8ab, 0x8ac};
 6010|    833|  constexpr static uint32_t L[] = {0xa872};
 6011|    833|  constexpr static uint32_t D[] = {
 6012|    833|      0x620,  0x626,  0x628,  0x62a,  0x62b,  0x62c,  0x62d,  0x62e,  0x633,
 6013|    833|      0x634,  0x635,  0x636,  0x637,  0x638,  0x639,  0x63a,  0x63b,  0x63c,
 6014|    833|      0x63d,  0x63e,  0x63f,  0x641,  0x642,  0x643,  0x644,  0x645,  0x646,
 6015|    833|      0x647,  0x649,  0x64a,  0x66e,  0x66f,  0x678,  0x679,  0x67a,  0x67b,
 6016|    833|      0x67c,  0x67d,  0x67e,  0x67f,  0x680,  0x681,  0x682,  0x683,  0x684,
 6017|    833|      0x685,  0x686,  0x687,  0x69a,  0x69b,  0x69c,  0x69d,  0x69e,  0x69f,
 6018|    833|      0x6a0,  0x6a1,  0x6a2,  0x6a3,  0x6a4,  0x6a5,  0x6a6,  0x6a7,  0x6a8,
 6019|    833|      0x6a9,  0x6aa,  0x6ab,  0x6ac,  0x6ad,  0x6ae,  0x6af,  0x6b0,  0x6b1,
 6020|    833|      0x6b2,  0x6b3,  0x6b4,  0x6b5,  0x6b6,  0x6b7,  0x6b8,  0x6b9,  0x6ba,
 6021|    833|      0x6bb,  0x6bc,  0x6bd,  0x6be,  0x6bf,  0x6c1,  0x6c2,  0x6cc,  0x6ce,
 6022|    833|      0x6d0,  0x6d1,  0x6fa,  0x6fb,  0x6fc,  0x6ff,  0x712,  0x713,  0x714,
 6023|    833|      0x71a,  0x71b,  0x71c,  0x71d,  0x71f,  0x720,  0x721,  0x722,  0x723,
 6024|    833|      0x724,  0x725,  0x726,  0x727,  0x729,  0x72b,  0x72d,  0x72e,  0x74e,
 6025|    833|      0x74f,  0x750,  0x751,  0x752,  0x753,  0x754,  0x755,  0x756,  0x757,
 6026|    833|      0x758,  0x75c,  0x75d,  0x75e,  0x75f,  0x760,  0x761,  0x762,  0x763,
 6027|    833|      0x764,  0x765,  0x766,  0x850,  0x851,  0x852,  0x853,  0x855,  0x8a0,
 6028|    833|      0x8a2,  0x8a3,  0x8a4,  0x8a5,  0x8a6,  0x8a7,  0x8a8,  0x8a9,  0x1807,
 6029|    833|      0x1820, 0x1821, 0x1822, 0x1823, 0x1824, 0x1825, 0x1826, 0x1827, 0x1828,
 6030|    833|      0x1829, 0x182a, 0x182b, 0x182c, 0x182d, 0x182e, 0x182f, 0x1830, 0x1831,
 6031|    833|      0x1832, 0x1833, 0x1834, 0x1835, 0x1836, 0x1837, 0x1838, 0x1839, 0x183a,
 6032|    833|      0x183b, 0x183c, 0x183d, 0x183e, 0x183f, 0x1840, 0x1841, 0x1842, 0x1843,
 6033|    833|      0x1844, 0x1845, 0x1846, 0x1847, 0x1848, 0x1849, 0x184a, 0x184b, 0x184c,
 6034|    833|      0x184d, 0x184e, 0x184f, 0x1850, 0x1851, 0x1852, 0x1853, 0x1854, 0x1855,
 6035|    833|      0x1856, 0x1857, 0x1858, 0x1859, 0x185a, 0x185b, 0x185c, 0x185d, 0x185e,
 6036|    833|      0x185f, 0x1860, 0x1861, 0x1862, 0x1863, 0x1864, 0x1865, 0x1866, 0x1867,
 6037|    833|      0x1868, 0x1869, 0x186a, 0x186b, 0x186c, 0x186d, 0x186e, 0x186f, 0x1870,
 6038|    833|      0x1871, 0x1872, 0x1873, 0x1874, 0x1875, 0x1876, 0x1877, 0x1887, 0x1888,
 6039|    833|      0x1889, 0x188a, 0x188b, 0x188c, 0x188d, 0x188e, 0x188f, 0x1890, 0x1891,
 6040|    833|      0x1892, 0x1893, 0x1894, 0x1895, 0x1896, 0x1897, 0x1898, 0x1899, 0x189a,
 6041|    833|      0x189b, 0x189c, 0x189d, 0x189e, 0x189f, 0x18a0, 0x18a1, 0x18a2, 0x18a3,
 6042|    833|      0x18a4, 0x18a5, 0x18a6, 0x18a7, 0x18a8, 0x18aa, 0xa840, 0xa841, 0xa842,
 6043|    833|      0xa843, 0xa844, 0xa845, 0xa846, 0xa847, 0xa848, 0xa849, 0xa84a, 0xa84b,
 6044|    833|      0xa84c, 0xa84d, 0xa84e, 0xa84f, 0xa850, 0xa851, 0xa852, 0xa853, 0xa854,
 6045|    833|      0xa855, 0xa856, 0xa857, 0xa858, 0xa859, 0xa85a, 0xa85b, 0xa85c, 0xa85d,
 6046|    833|      0xa85e, 0xa85f, 0xa860, 0xa861, 0xa862, 0xa863, 0xa864, 0xa865, 0xa866,
 6047|    833|      0xa867, 0xa868, 0xa869, 0xa86a, 0xa86b, 0xa86c, 0xa86d, 0xa86e, 0xa86f,
 6048|    833|      0xa870, 0xa871};
 6049|       |
 6050|  12.1k|  for (size_t i = 0; i < label.size(); i++) {
  ------------------
  |  Branch (6050:22): [True: 11.4k, False: 754]
  ------------------
 6051|  11.4k|    uint32_t c = label[i];
 6052|  11.4k|    if (c == 0x200c) {
  ------------------
  |  Branch (6052:9): [True: 71, False: 11.3k]
  ------------------
 6053|     71|      if (i > 0) {
  ------------------
  |  Branch (6053:11): [True: 70, False: 1]
  ------------------
 6054|     70|        if (std::ranges::binary_search(virama, label[i - 1])) {
  ------------------
  |  Branch (6054:13): [True: 1, False: 69]
  ------------------
 6055|      1|          return true;
 6056|      1|        }
 6057|     70|      }
 6058|     70|      if ((i == 0) || (i + 1 >= label.size())) {
  ------------------
  |  Branch (6058:11): [True: 1, False: 69]
  |  Branch (6058:23): [True: 2, False: 67]
  ------------------
 6059|      3|        return false;
 6060|      3|      }
 6061|       |      // we go backward looking for L or D
 6062|     67|      auto is_l_or_d = [](uint32_t code) {
 6063|     67|        return std::ranges::binary_search(L, code) ||
 6064|     67|               std::ranges::binary_search(D, code);
 6065|     67|      };
 6066|     67|      auto is_r_or_d = [](uint32_t code) {
 6067|     67|        return std::ranges::binary_search(R, code) ||
 6068|     67|               std::ranges::binary_search(D, code);
 6069|     67|      };
 6070|     67|      std::u32string_view before = label.substr(0, i);
 6071|     67|      std::u32string_view after = label.substr(i + 1);
 6072|     67|      return (std::find_if(before.begin(), before.end(), is_l_or_d) !=
  ------------------
  |  Branch (6072:14): [True: 41, False: 26]
  ------------------
 6073|     67|              before.end()) &&
 6074|     41|             (std::find_if(after.begin(), after.end(), is_r_or_d) !=
  ------------------
  |  Branch (6074:14): [True: 9, False: 32]
  ------------------
 6075|     41|              after.end());
 6076|  11.3k|    } else if (c == 0x200d) {
  ------------------
  |  Branch (6076:16): [True: 8, False: 11.3k]
  ------------------
 6077|      8|      if (i > 0) {
  ------------------
  |  Branch (6077:11): [True: 7, False: 1]
  ------------------
 6078|      7|        if (std::ranges::binary_search(virama, label[i - 1])) {
  ------------------
  |  Branch (6078:13): [True: 0, False: 7]
  ------------------
 6079|      0|          return true;
 6080|      0|        }
 6081|      7|      }
 6082|      8|      return false;
 6083|      8|    }
 6084|  11.4k|  }
 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|    754|  size_t last_non_nsm_char = find_last_not_of_nsm(label);
 6117|    754|  if (last_non_nsm_char == std::u32string_view::npos) {
  ------------------
  |  Branch (6117:7): [True: 0, False: 754]
  ------------------
 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|    754|  if (is_rtl_label(label)) {
  ------------------
  |  Branch (6124:7): [True: 185, False: 569]
  ------------------
 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|    185|    if (find_direction(label[0]) == direction::L) {
  ------------------
  |  Branch (6129:9): [True: 67, False: 118]
  ------------------
 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|  1.71k|      for (size_t i = 0; i <= last_non_nsm_char; i++) {
  ------------------
  |  Branch (6134:26): [True: 1.71k, False: 0]
  ------------------
 6135|  1.71k|        const direction d = find_direction(label[i]);
 6136|  1.71k|        if (!(d == direction::L || d == direction::EN || d == direction::ES ||
  ------------------
  |  Branch (6136:15): [True: 699, False: 1.01k]
  |  Branch (6136:36): [True: 347, False: 669]
  |  Branch (6136:58): [True: 187, False: 482]
  ------------------
 6137|    482|              d == direction::CS || d == direction::ET || d == direction::ON ||
  ------------------
  |  Branch (6137:15): [True: 116, False: 366]
  |  Branch (6137:37): [True: 74, False: 292]
  |  Branch (6137:59): [True: 107, False: 185]
  ------------------
 6138|    185|              d == direction::BN || d == direction::NSM)) {
  ------------------
  |  Branch (6138:15): [True: 110, False: 75]
  |  Branch (6138:37): [True: 8, False: 67]
  ------------------
 6139|     67|          return false;
 6140|     67|        }
 6141|  1.71k|      }
 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|    118|    } 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|    118|      const direction first_dir = find_direction(label[0]);
 6156|    118|      if (first_dir != direction::R && first_dir != direction::AL) {
  ------------------
  |  Branch (6156:11): [True: 76, False: 42]
  |  Branch (6156:40): [True: 16, False: 60]
  ------------------
 6157|     16|        return false;
 6158|     16|      }
 6159|       |
 6160|    102|      bool has_an = false;
 6161|    102|      bool has_en = false;
 6162|  1.21k|      for (size_t i = 0; i <= last_non_nsm_char; i++) {
  ------------------
  |  Branch (6162:26): [True: 1.15k, False: 56]
  ------------------
 6163|  1.15k|        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|  1.15k|        if ((d == direction::EN && ((has_en = true) && has_an)) ||
  ------------------
  |  Branch (6167:14): [True: 227, False: 927]
  |  Branch (6167:37): [True: 227, False: 0]
  |  Branch (6167:56): [True: 0, False: 227]
  ------------------
 6168|  1.15k|            (d == direction::AN && ((has_an = true) && has_en))) {
  ------------------
  |  Branch (6168:14): [True: 1, False: 1.15k]
  |  Branch (6168:37): [True: 1, False: 0]
  |  Branch (6168:56): [True: 0, False: 1]
  ------------------
 6169|      0|          return false;
 6170|      0|        }
 6171|       |
 6172|  1.15k|        if (!(d == direction::R || d == direction::AL || d == direction::AN ||
  ------------------
  |  Branch (6172:15): [True: 44, False: 1.11k]
  |  Branch (6172:36): [True: 107, False: 1.00k]
  |  Branch (6172:58): [True: 1, False: 1.00k]
  ------------------
 6173|  1.00k|              d == direction::EN || d == direction::ES || d == direction::CS ||
  ------------------
  |  Branch (6173:15): [True: 227, False: 775]
  |  Branch (6173:37): [True: 207, False: 568]
  |  Branch (6173:59): [True: 115, False: 453]
  ------------------
 6174|    453|              d == direction::ET || d == direction::ON || d == direction::BN ||
  ------------------
  |  Branch (6174:15): [True: 117, False: 336]
  |  Branch (6174:37): [True: 195, False: 141]
  |  Branch (6174:59): [True: 94, False: 47]
  ------------------
 6175|     47|              d == direction::NSM)) {
  ------------------
  |  Branch (6175:15): [True: 14, False: 33]
  ------------------
 6176|     33|          return false;
 6177|     33|        }
 6178|       |
 6179|  1.12k|        if (i == last_non_nsm_char &&
  ------------------
  |  Branch (6179:13): [True: 69, False: 1.05k]
  ------------------
 6180|     69|            !(d == direction::R || d == direction::AL || d == direction::AN ||
  ------------------
  |  Branch (6180:15): [True: 1, False: 68]
  |  Branch (6180:36): [True: 4, False: 64]
  |  Branch (6180:58): [True: 1, False: 63]
  ------------------
 6181|     63|              d == direction::EN)) {
  ------------------
  |  Branch (6181:15): [True: 50, False: 13]
  ------------------
 6182|     13|          return false;
 6183|     13|        }
 6184|  1.12k|      }
 6185|       |
 6186|     56|      return true;
 6187|    102|    }
 6188|    185|  }
 6189|       |
 6190|    569|  return true;
 6191|    754|}
_ZN3ada4idna8to_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEERNS1_12basic_stringIcS4_NS1_9allocatorIcEEEE:
 6348|  1.22k|[[nodiscard]] bool to_ascii(std::string_view ut8_string, std::string& out) {
 6349|  1.22k|  out.clear();
 6350|  1.22k|  if (ut8_string.size() > max_domain_input_bytes) {
  ------------------
  |  Branch (6350:7): [True: 0, False: 1.22k]
  ------------------
 6351|      0|    return false;
 6352|      0|  }
 6353|  1.22k|  if (is_ascii(ut8_string)) {
  ------------------
  |  Branch (6353:7): [True: 337, False: 883]
  ------------------
 6354|    337|    from_ascii_to_ascii(ut8_string, out);
 6355|    337|    return true;
 6356|    337|  }
 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|    883|  size_t utf32_length =
 6369|    883|      ada::idna::utf32_length_from_utf8(ut8_string.data(), ut8_string.size());
 6370|    883|  if (utf32_length == 0 && !ut8_string.empty()) {
  ------------------
  |  Branch (6370:7): [True: 2, False: 881]
  |  Branch (6370:28): [True: 2, False: 0]
  ------------------
 6371|      2|    return false;
 6372|      2|  }
 6373|    881|  std::u32string working(utf32_length, U'\0');
 6374|    881|  size_t actual_utf32_length = ada::idna::utf8_to_utf32(
 6375|    881|      ut8_string.data(), ut8_string.size(), working.data());
 6376|    881|#endif
 6377|    881|  if (actual_utf32_length == 0 || actual_utf32_length != utf32_length) {
  ------------------
  |  Branch (6377:7): [True: 146, False: 735]
  |  Branch (6377:35): [True: 0, False: 735]
  ------------------
 6378|    146|    return false;
 6379|    146|  }
 6380|    735|  working.resize(actual_utf32_length);
 6381|       |
 6382|       |  // Map into a second buffer with exact sizing (no growth reallocs).
 6383|    735|  std::u32string mapped;
 6384|    735|  if (!ada::idna::map(working, mapped)) {
  ------------------
  |  Branch (6384:7): [True: 36, False: 699]
  ------------------
 6385|     36|    return false;
 6386|     36|  }
 6387|       |  // Drop UTF-32 input; reuse `working` as scratch for ACE validation below.
 6388|    699|  working.clear();
 6389|       |
 6390|       |  // Skip NFC when already normalized (ASCII is a fast subset of this check).
 6391|    699|  if (!is_ascii(mapped) && !is_already_nfc(mapped)) {
  ------------------
  |  Branch (6391:7): [True: 570, False: 129]
  |  Branch (6391:28): [True: 6, False: 564]
  ------------------
 6392|      6|    if (!normalize(mapped)) {
  ------------------
  |  Branch (6392:9): [True: 0, False: 6]
  ------------------
 6393|      0|      return false;
 6394|      0|    }
 6395|      6|  }
 6396|       |
 6397|       |  // Estimate ASCII output size (punycode may expand non-ASCII labels).
 6398|    699|  out.reserve(mapped.size() + 8);
 6399|       |
 6400|       |  // Walk labels with a single pointer scan (no repeated string::find).
 6401|    699|  const char32_t* p = mapped.data();
 6402|    699|  const char32_t* const end = p + mapped.size();
 6403|    699|  std::u32string post_map;
 6404|       |
 6405|  2.62k|  while (p < end) {
  ------------------
  |  Branch (6405:10): [True: 2.19k, False: 437]
  ------------------
 6406|  2.19k|    const char32_t* label_begin = p;
 6407|  21.7k|    while (p < end && *p != U'.') {
  ------------------
  |  Branch (6407:12): [True: 21.3k, False: 428]
  |  Branch (6407:23): [True: 19.5k, False: 1.76k]
  ------------------
 6408|  19.5k|      ++p;
 6409|  19.5k|    }
 6410|  2.19k|    const size_t label_size = static_cast<size_t>(p - label_begin);
 6411|  2.19k|    std::u32string_view label_view(label_begin, label_size);
 6412|  2.19k|    const bool is_last_label = (p == end);
 6413|  2.19k|    if (p < end) {
  ------------------
  |  Branch (6413:9): [True: 1.76k, False: 428]
  ------------------
 6414|  1.76k|      ++p;  // skip dot
 6415|  1.76k|    }
 6416|       |
 6417|  2.19k|    if (label_size == 0) {
  ------------------
  |  Branch (6417:9): [True: 213, False: 1.97k]
  ------------------
 6418|       |      // empty label
 6419|  1.97k|    } else if (is_ace_prefix(label_view)) {
  ------------------
  |  Branch (6419:16): [True: 105, False: 1.87k]
  ------------------
 6420|  2.62k|      for (char32_t c : label_view) {
  ------------------
  |  Branch (6420:23): [True: 2.62k, False: 100]
  ------------------
 6421|  2.62k|        if (c >= 0x80) {
  ------------------
  |  Branch (6421:13): [True: 5, False: 2.62k]
  ------------------
 6422|      5|          out.clear();
 6423|      5|          return false;
 6424|      5|        }
 6425|  2.62k|      }
 6426|    100|      append_ascii_label(out, label_view);
 6427|    100|      std::string_view puny_segment_ascii(
 6428|    100|          out.data() + (out.size() - label_size) + 4, label_size - 4);
 6429|    100|      working.clear();
 6430|    100|      if (!ada::idna::punycode_to_utf32(puny_segment_ascii, working)) {
  ------------------
  |  Branch (6430:11): [True: 15, False: 85]
  ------------------
 6431|     15|        out.clear();
 6432|     15|        return false;
 6433|     15|      }
 6434|     85|      if (is_ascii(working)) {
  ------------------
  |  Branch (6434:11): [True: 3, False: 82]
  ------------------
 6435|      3|        out.clear();
 6436|      3|        return false;
 6437|      3|      }
 6438|     82|      if (!ada::idna::map(working, post_map) || working != post_map) {
  ------------------
  |  Branch (6438:11): [True: 20, False: 62]
  |  Branch (6438:49): [True: 10, False: 52]
  ------------------
 6439|     30|        out.clear();
 6440|     30|        return false;
 6441|     30|      }
 6442|       |      // Mapping must be stable; NFC must not change the mapped form either.
 6443|     52|      if (!is_ascii(post_map) && !is_already_nfc(post_map)) {
  ------------------
  |  Branch (6443:11): [True: 52, False: 0]
  |  Branch (6443:34): [True: 9, False: 43]
  ------------------
 6444|      9|        if (!normalize(post_map) || post_map != working) {
  ------------------
  |  Branch (6444:13): [True: 0, False: 9]
  |  Branch (6444:37): [True: 9, False: 0]
  ------------------
 6445|      9|          out.clear();
 6446|      9|          return false;
 6447|      9|        }
 6448|      9|      }
 6449|     43|      if (post_map.empty() || !is_label_valid(post_map)) {
  ------------------
  |  Branch (6449:11): [True: 0, False: 43]
  |  Branch (6449:31): [True: 8, False: 35]
  ------------------
 6450|      8|        out.clear();
 6451|      8|        return false;
 6452|      8|      }
 6453|  1.87k|    } else if (is_ascii(label_view)) {
  ------------------
  |  Branch (6453:16): [True: 1.08k, False: 792]
  ------------------
 6454|  1.08k|      append_ascii_label(out, label_view);
 6455|  1.08k|    } else {
 6456|    792|      if (!is_label_valid(label_view)) {
  ------------------
  |  Branch (6456:11): [True: 192, False: 600]
  ------------------
 6457|    192|        out.clear();
 6458|    192|        return false;
 6459|    192|      }
 6460|    600|      out.append("xn--");
 6461|    600|      if (!ada::idna::utf32_to_punycode(label_view, out)) {
  ------------------
  |  Branch (6461:11): [True: 0, False: 600]
  ------------------
 6462|      0|        out.clear();
 6463|      0|        return false;
 6464|      0|      }
 6465|    600|    }
 6466|  1.93k|    if (!is_last_label) {
  ------------------
  |  Branch (6466:9): [True: 1.54k, False: 382]
  ------------------
 6467|  1.54k|      out.push_back('.');
 6468|  1.54k|    }
 6469|  1.93k|  }
 6470|    437|  return true;
 6471|    699|}
_ZN3ada4idna8to_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6473|  1.22k|std::string to_ascii(std::string_view ut8_string) {
 6474|  1.22k|  std::string out;
 6475|  1.22k|  if (!to_ascii(ut8_string, out)) {
  ------------------
  |  Branch (6475:7): [True: 446, False: 774]
  ------------------
 6476|    446|    return {};
 6477|    446|  }
 6478|    774|  return out;
 6479|  1.22k|}
_ZN3ada7unicode14percent_decodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEm:
 7165|  1.24k|std::string percent_decode(const std::string_view input, size_t first_percent) {
 7166|       |  // next line is for safety only, we expect users to avoid calling
 7167|       |  // percent_decode when first_percent is outside the range.
 7168|  1.24k|  if (first_percent == std::string_view::npos) {
  ------------------
  |  Branch (7168:7): [True: 0, False: 1.24k]
  ------------------
 7169|      0|    return std::string(input);
 7170|      0|  }
 7171|  1.24k|  std::string dest;
 7172|  1.24k|  dest.reserve(input.length());
 7173|  1.24k|  dest.append(input.substr(0, first_percent));
 7174|  1.24k|  const char* pointer = input.data() + first_percent;
 7175|  1.24k|  const char* end = input.data() + input.size();
 7176|       |  // Optimization opportunity: if the following code gets
 7177|       |  // called often, it can be optimized quite a bit.
 7178|  20.8k|  while (pointer < end) {
  ------------------
  |  Branch (7178:10): [True: 19.6k, False: 1.24k]
  ------------------
 7179|  19.6k|    const char ch = pointer[0];
 7180|  19.6k|    size_t remaining = end - pointer - 1;
 7181|  19.6k|    if (ch != '%' || remaining < 2 ||
  ------------------
  |  Branch (7181:9): [True: 11.3k, False: 8.23k]
  |  Branch (7181:22): [True: 69, False: 8.16k]
  ------------------
 7182|  8.16k|        (  // ch == '%' && // It is unnecessary to check that ch == '%'.
 7183|  8.16k|            (!is_ascii_hex_digit(pointer[1]) ||
  ------------------
  |  Branch (7183:14): [True: 713, False: 7.45k]
  ------------------
 7184|  12.5k|             !is_ascii_hex_digit(pointer[2])))) {
  ------------------
  |  Branch (7184:14): [True: 370, False: 7.08k]
  ------------------
 7185|  12.5k|      dest += ch;
 7186|  12.5k|      pointer++;
 7187|  12.5k|    } else {
 7188|  7.08k|      unsigned a = convert_hex_to_binary(pointer[1]);
 7189|  7.08k|      unsigned b = convert_hex_to_binary(pointer[2]);
 7190|  7.08k|      char c = static_cast<char>(a * 16 + b);
 7191|  7.08k|      dest += c;
 7192|  7.08k|      pointer += 3;
 7193|  7.08k|    }
 7194|  19.6k|  }
 7195|  1.24k|  return dest;
 7196|  1.24k|}
_ZN3ada7unicode14percent_encodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKh:
 7281|  21.4k|                           const uint8_t character_set[]) {
 7282|  21.4k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7283|  21.4k|    return character_sets::bit_at(character_set, c);
 7284|  21.4k|  });
 7285|       |  // Optimization: Don't iterate if percent encode is not required
 7286|  21.4k|  if (pointer == input.end()) {
  ------------------
  |  Branch (7286:7): [True: 14.7k, False: 6.65k]
  ------------------
 7287|  14.7k|    return std::string(input);
 7288|  14.7k|  }
 7289|       |
 7290|  6.65k|  std::string result;
 7291|  6.65k|  result.reserve(input.length());  // in the worst case, percent encoding might
 7292|       |                                   // produce 3 characters.
 7293|  6.65k|  result.append(input.substr(0, std::distance(input.begin(), pointer)));
 7294|       |
 7295|  85.7k|  for (; pointer != input.end(); pointer++) {
  ------------------
  |  Branch (7295:10): [True: 79.1k, False: 6.65k]
  ------------------
 7296|  79.1k|    if (character_sets::bit_at(character_set, *pointer)) {
  ------------------
  |  Branch (7296:9): [True: 49.8k, False: 29.2k]
  ------------------
 7297|  49.8k|      result.append(character_sets::hex + uint8_t(*pointer) * 4, 3);
 7298|  49.8k|    } else {
 7299|  29.2k|      result += *pointer;
 7300|  29.2k|    }
 7301|  79.1k|  }
 7302|       |
 7303|  6.65k|  return result;
 7304|  21.4k|}
_ZN3ada7unicode8to_asciiERNSt3__18optionalINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEENS1_17basic_string_viewIcS5_EEm:
 7342|  1.22k|              size_t first_percent) {
 7343|  1.22k|  std::string percent_decoded_buffer;
 7344|  1.22k|  std::string_view input = plain;
 7345|  1.22k|  if (first_percent != std::string_view::npos) {
  ------------------
  |  Branch (7345:7): [True: 213, False: 1.00k]
  ------------------
 7346|    213|    percent_decoded_buffer = unicode::percent_decode(plain, first_percent);
 7347|    213|    input = percent_decoded_buffer;
 7348|    213|  }
 7349|       |  // input is a non-empty UTF-8 string, must be percent decoded
 7350|  1.22k|  std::string idna_ascii = ada::idna::to_ascii(input);
 7351|  1.22k|  if (idna_ascii.empty() || contains_forbidden_domain_code_point(
  ------------------
  |  Branch (7351:7): [True: 447, False: 773]
  |  Branch (7351:29): [True: 192, False: 581]
  ------------------
 7352|    773|                                idna_ascii.data(), idna_ascii.size())) {
 7353|    639|    return false;
 7354|    639|  }
 7355|    581|  out = std::move(idna_ascii);
 7356|    581|  return true;
 7357|  1.22k|}
_ZN3ada7unicode14percent_encodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKhm:
 7360|  17.2k|                           const uint8_t character_set[], size_t index) {
 7361|  17.2k|  std::string out;
 7362|       |  // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
 7363|  17.2k|  out.append(input.data(), index);
 7364|  17.2k|  auto pointer = input.begin() + index;
 7365|  87.4k|  for (; pointer != input.end(); pointer++) {
  ------------------
  |  Branch (7365:10): [True: 70.1k, False: 17.2k]
  ------------------
 7366|  70.1k|    if (character_sets::bit_at(character_set, *pointer)) {
  ------------------
  |  Branch (7366:9): [True: 29.6k, False: 40.4k]
  ------------------
 7367|  29.6k|      out.append(character_sets::hex + uint8_t(*pointer) * 4, 3);
 7368|  40.4k|    } else {
 7369|  40.4k|      out += *pointer;
 7370|  40.4k|    }
 7371|  70.1k|  }
 7372|  17.2k|  return out;
 7373|  17.2k|}
_ZN3ada11serializers36find_longest_sequence_of_ipv6_piecesERKNSt3__15arrayItLm8EEERmS6_:
 7437|  5.75k|    size_t& compress_length) noexcept {
 7438|  5.75k|  compress = 0;
 7439|  5.75k|  compress_length = 0;
 7440|  5.75k|  size_t i = 0;
 7441|  48.8k|  while (i < 8) {
  ------------------
  |  Branch (7441:10): [True: 43.1k, False: 5.75k]
  ------------------
 7442|  43.1k|    if (address[i] != 0) {
  ------------------
  |  Branch (7442:9): [True: 41.9k, False: 1.19k]
  ------------------
 7443|  41.9k|      ++i;
 7444|  41.9k|      continue;
 7445|  41.9k|    }
 7446|  1.19k|    size_t next = i + 1;
 7447|  4.14k|    while (next < 8 && address[next] == 0) {
  ------------------
  |  Branch (7447:12): [True: 3.62k, False: 520]
  |  Branch (7447:24): [True: 2.94k, False: 673]
  ------------------
 7448|  2.94k|      ++next;
 7449|  2.94k|    }
 7450|  1.19k|    const size_t count = next - i;
 7451|  1.19k|    if (count > compress_length) {
  ------------------
  |  Branch (7451:9): [True: 1.09k, False: 102]
  ------------------
 7452|  1.09k|      compress_length = count;
 7453|  1.09k|      compress = i;
 7454|  1.09k|    }
 7455|  1.19k|    i = next;
 7456|  1.19k|  }
 7457|  5.75k|}
_ZN3ada11serializers4ipv6ERKNSt3__15arrayItLm8EEE:
 7459|  2.88k|std::string ipv6(const std::array<uint16_t, 8>& address) {
 7460|  2.88k|  size_t compress = 0;
 7461|  2.88k|  size_t compress_length = 0;
 7462|  2.88k|  find_longest_sequence_of_ipv6_pieces(address, compress, compress_length);
 7463|       |
 7464|       |  // Skip compression when the longest zero run is a single piece.
 7465|  2.88k|  if (compress_length <= 1) {
  ------------------
  |  Branch (7465:7): [True: 2.56k, False: 322]
  ------------------
 7466|  2.56k|    compress = compress_length = 8;
 7467|  2.56k|  }
 7468|       |
 7469|       |  // Max: '[' + 8*4 hex + 7 ':' + ']' = 41
 7470|  2.88k|  std::string output(4 * 8 + 7 + 2, '\0');
 7471|  2.88k|  char* point = output.data();
 7472|  2.88k|  *point++ = '[';
 7473|  2.88k|  size_t piece_index = 0;
 7474|  21.5k|  while (true) {
  ------------------
  |  Branch (7474:10): [True: 21.5k, Folded]
  ------------------
 7475|  21.5k|    if (piece_index == compress) {
  ------------------
  |  Branch (7475:9): [True: 322, False: 21.1k]
  ------------------
 7476|    322|      *point++ = ':';
 7477|       |      // If we skip a value initially, we need to write '::'.
 7478|    322|      if (piece_index == 0) {
  ------------------
  |  Branch (7478:11): [True: 178, False: 144]
  ------------------
 7479|    178|        *point++ = ':';
 7480|    178|      }
 7481|    322|      piece_index += compress_length;
 7482|    322|      if (piece_index == 8) {
  ------------------
  |  Branch (7482:11): [True: 222, False: 100]
  ------------------
 7483|    222|        break;
 7484|    222|      }
 7485|    322|    }
 7486|  21.2k|    point = write_hex_u16(point, address[piece_index]);
 7487|  21.2k|    ++piece_index;
 7488|  21.2k|    if (piece_index == 8) {
  ------------------
  |  Branch (7488:9): [True: 2.66k, False: 18.6k]
  ------------------
 7489|  2.66k|      break;
 7490|  2.66k|    }
 7491|  18.6k|    *point++ = ':';
 7492|  18.6k|  }
 7493|  2.88k|  *point++ = ']';
 7494|  2.88k|  output.resize(static_cast<size_t>(point - output.data()));
 7495|  2.88k|  return output;
 7496|  2.88k|}
_ZN3ada11serializers4ipv4Em:
 7498|  3.27k|std::string ipv4(const uint64_t address) {
 7499|  3.27k|  std::string output(15, '\0');
 7500|  3.27k|  char* point = output.data();
 7501|  3.27k|  point = write_u8(point, static_cast<uint8_t>(address >> 24));
 7502|  3.27k|  *point++ = '.';
 7503|  3.27k|  point = write_u8(point, static_cast<uint8_t>(address >> 16));
 7504|  3.27k|  *point++ = '.';
 7505|  3.27k|  point = write_u8(point, static_cast<uint8_t>(address >> 8));
 7506|  3.27k|  *point++ = '.';
 7507|  3.27k|  point = write_u8(point, static_cast<uint8_t>(address));
 7508|  3.27k|  output.resize(static_cast<size_t>(point - output.data()));
 7509|  3.27k|  return output;
 7510|  3.27k|}
_ZN3ada5parseINS_14url_aggregatorEEEN2tl8expectedIT_NS_6errorsEEENSt3__117basic_string_viewIcNS7_11char_traitsIcEEEEPKS4_:
 7782|  5.13k|    std::string_view input, const result_type* base_url) {
 7783|  5.13k|  result_type u = ada::parser::parse_url_impl<result_type>(input, base_url);
 7784|  5.13k|  if (!u.is_valid) {
  ------------------
  |  Branch (7784:7): [True: 4.19k, False: 943]
  ------------------
 7785|  4.19k|    return tl::unexpected(errors::type_error);
 7786|  4.19k|  }
 7787|    943|  return u;
 7788|  5.13k|}
_ZN3ada20get_max_input_lengthEv:
 7531|  5.13k|uint32_t get_max_input_length() {
 7532|  5.13k|  return max_input_length_.load(std::memory_order_relaxed);
 7533|  5.13k|}
_ZN3ada7helpers18trim_c0_whitespaceERNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8724|  5.09k|void trim_c0_whitespace(std::string_view& input) noexcept {
 8725|  5.09k|  while (!input.empty() &&
  ------------------
  |  Branch (8725:10): [True: 5.09k, False: 0]
  ------------------
 8726|  5.09k|         ada::unicode::is_c0_control_or_space(input.front())) {
  ------------------
  |  Branch (8726:10): [True: 0, False: 5.09k]
  ------------------
 8727|      0|    input.remove_prefix(1);
 8728|      0|  }
 8729|  5.09k|  while (!input.empty() && ada::unicode::is_c0_control_or_space(input.back())) {
  ------------------
  |  Branch (8729:10): [True: 5.09k, False: 0]
  |  Branch (8729:28): [True: 0, False: 5.09k]
  ------------------
 8730|      0|    input.remove_suffix(1);
 8731|      0|  }
 8732|  5.09k|}
_ZN3ada6parser14parse_url_implINS_14url_aggregatorELb1EEET_NSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPKS3_:
10361|  5.13k|                           const result_type* base_url) {
10362|       |  // We can specialize the implementation per type.
10363|       |  // Important: result_type_is_ada_url is evaluated at *compile time*. This
10364|       |  // means that doing if constexpr(result_type_is_ada_url) { something } else {
10365|       |  // something else } is free (at runtime). This means that ada::url_aggregator
10366|       |  // and ada::url **do not have to support the exact same API**.
10367|  5.13k|  constexpr bool result_type_is_ada_url = std::is_same_v<url, result_type>;
10368|  5.13k|  constexpr bool result_type_is_ada_url_aggregator =
10369|  5.13k|      std::is_same_v<url_aggregator, result_type>;
10370|  5.13k|  static_assert(result_type_is_ada_url ||
10371|  5.13k|                result_type_is_ada_url_aggregator);  // We don't support
10372|       |                                                     // anything else for now.
10373|       |
10374|  5.13k|  ada_log("ada::parser::parse_url('", user_input, "' [", user_input.size(),
10375|  5.13k|          " bytes],", (base_url != nullptr ? base_url->to_string() : "null"),
10376|  5.13k|          ")");
10377|       |
10378|  5.13k|  state state = state::SCHEME_START;
10379|  5.13k|  result_type url{};
10380|       |
10381|  5.13k|  const uint32_t max_input_length = ada::get_max_input_length();
10382|       |
10383|       |  // We refuse to parse URL strings that exceed the maximum input length.
10384|       |  // By default, this is 4GB but can be configured via
10385|       |  // ada::set_max_input_length().
10386|  5.13k|  if (user_input.size() > max_input_length) [[unlikely]] {
  ------------------
  |  Branch (10386:7): [True: 0, False: 5.13k]
  ------------------
10387|      0|    url.is_valid = false;
10388|      0|  }
10389|       |  // Going forward, user_input.size() is in [0,
10390|       |  // std::numeric_limits<uint32_t>::max). If we are provided with an invalid
10391|       |  // base, or the optional_url was invalid, we must return.
10392|  5.13k|  if (base_url != nullptr) {
  ------------------
  |  Branch (10392:7): [True: 0, False: 5.13k]
  ------------------
10393|      0|    url.is_valid &= base_url->is_valid;
10394|      0|  }
10395|  5.13k|  if (!url.is_valid) {
  ------------------
  |  Branch (10395:7): [True: 0, False: 5.13k]
  ------------------
10396|      0|    return url;
10397|      0|  }
10398|       |
10399|       |  // Simple absolute http(s) fast path (before tabs/newline scan).
10400|       |  // Skip digit-led hosts (IPv4) with a cheap peek.
10401|  5.13k|  if constexpr (store_values) {
10402|  5.13k|    if (base_url == nullptr) {
  ------------------
  |  Branch (10402:9): [True: 5.13k, False: 0]
  ------------------
10403|  5.13k|      const auto* p = reinterpret_cast<const uint8_t*>(user_input.data());
10404|  5.13k|      const size_t n = user_input.size();
10405|  5.13k|      const bool digit_led_host = (n >= 8 && p[4] == ':' && p[5] == '/' &&
  ------------------
  |  Branch (10405:36): [True: 5.13k, False: 0]
  |  Branch (10405:46): [True: 5.13k, False: 0]
  |  Branch (10405:61): [True: 5.13k, False: 0]
  ------------------
10406|  5.13k|                                   p[6] == '/' && p[7] >= '0' && p[7] <= '9') ||
  ------------------
  |  Branch (10406:36): [True: 5.13k, False: 0]
  |  Branch (10406:51): [True: 4.73k, False: 407]
  |  Branch (10406:66): [True: 871, False: 3.86k]
  ------------------
10407|  4.26k|                                  (n >= 9 && p[5] == ':' && p[6] == '/' &&
  ------------------
  |  Branch (10407:36): [True: 4.26k, False: 0]
  |  Branch (10407:46): [True: 0, False: 4.26k]
  |  Branch (10407:61): [True: 0, False: 0]
  ------------------
10408|      0|                                   p[7] == '/' && p[8] >= '0' && p[8] <= '9');
  ------------------
  |  Branch (10408:36): [True: 0, False: 0]
  |  Branch (10408:51): [True: 0, False: 0]
  |  Branch (10408:66): [True: 0, False: 0]
  ------------------
10409|  5.13k|      if (!digit_led_host && try_parse_simple_absolute(user_input, url)) {
  ------------------
  |  Branch (10409:11): [True: 4.26k, False: 871]
  |  Branch (10409:30): [True: 40, False: 4.22k]
  ------------------
10410|     40|        if constexpr (result_type_is_ada_url_aggregator) {
10411|     40|          if (url.buffer.size() > max_input_length) [[unlikely]] {
  ------------------
  |  Branch (10411:15): [True: 0, False: 40]
  ------------------
10412|      0|            url.is_valid = false;
10413|      0|          }
10414|       |        } else {
10415|       |          if (url.get_href_size() > max_input_length) [[unlikely]] {
10416|       |            url.is_valid = false;
10417|       |          }
10418|       |        }
10419|     40|        return url;
10420|     40|      }
10421|  5.13k|    }
10422|  5.13k|  }
10423|       |
10424|  5.09k|  std::string tmp_buffer;
10425|  5.13k|  std::string_view url_data;
10426|  5.13k|  if (unicode::has_tabs_or_newline(user_input)) [[unlikely]] {
  ------------------
  |  Branch (10426:7): [True: 211, False: 4.92k]
  ------------------
10427|    211|    tmp_buffer = user_input;
10428|       |    // Optimization opportunity: Instead of copying and then pruning, we could
10429|       |    // just directly build the string from user_input.
10430|    211|    helpers::remove_ascii_tab_or_newline(tmp_buffer);
10431|    211|    url_data = tmp_buffer;
10432|  4.92k|  } else [[likely]] {
10433|  4.92k|    url_data = user_input;
10434|  4.92k|  }
10435|       |
10436|       |  // Leading and trailing control characters are uncommon and easy to deal with
10437|       |  // (no performance concern).
10438|  5.13k|  helpers::trim_c0_whitespace(url_data);
10439|       |
10440|  5.13k|  if constexpr (result_type_is_ada_url_aggregator && store_values) {
10441|       |    // Most of the time, we just need user_input.size().
10442|       |    // In some instances, we may need a bit more.
10443|       |    ///////////////////////////
10444|       |    // This is *very* important. This line should *not* be removed
10445|       |    // hastily. There are principled reasons why reserve is important
10446|       |    // for performance. If you have a benchmark with small inputs,
10447|       |    // it may not matter, but in other instances, it could.
10448|       |    ////
10449|       |    // This rounds up to the next power of two.
10450|       |    // We know that user_input.size() is in [0,
10451|       |    // std::numeric_limits<uint32_t>::max).
10452|  5.13k|    uint32_t reserve_capacity =
10453|  5.13k|        (0xFFFFFFFF >>
10454|  5.13k|         helpers::leading_zeroes(uint32_t(1 | user_input.size()))) +
10455|  5.13k|        1;
10456|  5.13k|    url.reserve(reserve_capacity);
10457|  5.13k|  }
10458|       |
10459|       |  // Optimization opportunity. Most websites do not have fragment.
10460|  5.13k|  std::optional<std::string_view> fragment = helpers::prune_hash(url_data);
10461|       |  // We add it last so that an implementation like ada::url_aggregator
10462|       |  // can append it last to its internal buffer, thus improving performance.
10463|       |
10464|       |  // Here url_data no longer has its fragment.
10465|       |  // We are going to access the data from url_data (it is immutable).
10466|       |  // At any given time, we are pointing at byte 'input_position' in url_data.
10467|       |  // The input_position variable should range from 0 to input_size.
10468|       |  // It is illegal to access url_data at input_size.
10469|  5.13k|  size_t input_position = 0;
10470|  5.13k|  const size_t input_size = url_data.size();
10471|       |  // Keep running the following state machine by switching on state.
10472|       |  // If after a run pointer points to the EOF code point, go to the next step.
10473|       |  // Otherwise, increase pointer by 1 and continue with the state machine.
10474|       |  // We never decrement input_position.
10475|  28.3k|  while (input_position <= input_size) {
  ------------------
  |  Branch (10475:10): [True: 27.7k, False: 626]
  ------------------
10476|  27.7k|    ada_log("In parsing at ", input_position, " out of ", input_size,
10477|  27.7k|            " in state ", ada::to_string(state));
10478|  27.7k|    switch (state) {
10479|  5.09k|      case state::SCHEME_START: {
  ------------------
  |  Branch (10479:7): [True: 5.09k, False: 22.6k]
  ------------------
10480|  5.09k|        ada_log("SCHEME_START ", helpers::substring(url_data, input_position));
10481|       |        // If c is an ASCII alpha, append c, lowercased, to buffer, and set
10482|       |        // state to scheme state.
10483|  5.09k|        if ((input_position != input_size) &&
  ------------------
  |  Branch (10483:13): [True: 5.09k, False: 0]
  ------------------
10484|  5.09k|            checkers::is_alpha(url_data[input_position])) {
  ------------------
  |  Branch (10484:13): [True: 5.09k, False: 0]
  ------------------
10485|  5.09k|          state = state::SCHEME;
10486|  5.09k|          input_position++;
10487|  5.09k|        } else {
10488|       |          // Otherwise, if state override is not given, set state to no scheme
10489|       |          // state and decrease pointer by 1.
10490|      0|          state = state::NO_SCHEME;
10491|      0|        }
10492|  5.09k|        break;
10493|      0|      }
10494|  5.09k|      case state::SCHEME: {
  ------------------
  |  Branch (10494:7): [True: 5.09k, False: 22.6k]
  ------------------
10495|  5.09k|        ada_log("SCHEME ", helpers::substring(url_data, input_position));
10496|       |        // If c is an ASCII alphanumeric, U+002B (+), U+002D (-), or U+002E (.),
10497|       |        // append c, lowercased, to buffer.
10498|  20.3k|        while ((input_position != input_size) &&
  ------------------
  |  Branch (10498:16): [True: 20.3k, False: 0]
  ------------------
10499|  20.3k|               (unicode::is_alnum_plus(url_data[input_position]))) {
  ------------------
  |  Branch (10499:16): [True: 15.2k, False: 5.09k]
  ------------------
10500|  15.2k|          input_position++;
10501|  15.2k|        }
10502|       |        // Otherwise, if c is U+003A (:), then:
10503|  5.09k|        if ((input_position != input_size) &&
  ------------------
  |  Branch (10503:13): [True: 5.09k, False: 0]
  ------------------
10504|  5.09k|            (url_data[input_position] == ':')) {
  ------------------
  |  Branch (10504:13): [True: 5.09k, False: 0]
  ------------------
10505|  5.09k|          ada_log("SCHEME the scheme should be ",
10506|  5.09k|                  url_data.substr(0, input_position));
10507|       |          if constexpr (result_type_is_ada_url) {
10508|       |            if (!url.parse_scheme(url_data.substr(0, input_position))) {
10509|       |              return url;
10510|       |            }
10511|  5.09k|          } else {
10512|       |            // we pass the colon along instead of painfully adding it back.
10513|  5.09k|            if (!url.parse_scheme_with_colon(
  ------------------
  |  Branch (10513:17): [True: 0, False: 5.09k]
  ------------------
10514|  5.09k|                    url_data.substr(0, input_position + 1))) {
10515|      0|              return url;
10516|      0|            }
10517|  5.09k|          }
10518|  5.09k|          ada_log("SCHEME the scheme is ", url.get_protocol());
10519|       |
10520|       |          // If url's scheme is "file", then:
10521|       |          // NOLINTNEXTLINE(bugprone-branch-clone)
10522|  5.09k|          if (url.type == scheme::type::FILE) {
  ------------------
  |  Branch (10522:15): [True: 0, False: 5.09k]
  ------------------
10523|       |            // Set state to file state.
10524|      0|            state = state::FILE;
10525|      0|          }
10526|       |          // Otherwise, if url is special, base is non-null, and base's scheme
10527|       |          // is url's scheme: Note: Doing base_url->scheme is unsafe if base_url
10528|       |          // != nullptr is false.
10529|  5.09k|          else if (url.is_special() && base_url != nullptr &&
  ------------------
  |  Branch (10529:20): [True: 5.09k, False: 0]
  |  Branch (10529:40): [True: 0, False: 5.09k]
  ------------------
10530|      0|                   base_url->type == url.type) {
  ------------------
  |  Branch (10530:20): [True: 0, False: 0]
  ------------------
10531|       |            // Set state to special relative or authority state.
10532|      0|            state = state::SPECIAL_RELATIVE_OR_AUTHORITY;
10533|      0|          }
10534|       |          // Otherwise, if url is special, set state to special authority
10535|       |          // slashes state.
10536|  5.09k|          else if (url.is_special()) {
  ------------------
  |  Branch (10536:20): [True: 5.09k, False: 0]
  ------------------
10537|  5.09k|            state = state::SPECIAL_AUTHORITY_SLASHES;
10538|  5.09k|          }
10539|       |          // Otherwise, if remaining starts with an U+002F (/), set state to
10540|       |          // path or authority state and increase pointer by 1.
10541|      0|          else if (input_position + 1 < input_size &&
  ------------------
  |  Branch (10541:20): [True: 0, False: 0]
  ------------------
10542|      0|                   url_data[input_position + 1] == '/') {
  ------------------
  |  Branch (10542:20): [True: 0, False: 0]
  ------------------
10543|      0|            state = state::PATH_OR_AUTHORITY;
10544|      0|            input_position++;
10545|      0|          }
10546|       |          // Otherwise, set url's path to the empty string and set state to
10547|       |          // opaque path state.
10548|      0|          else {
10549|      0|            state = state::OPAQUE_PATH;
10550|      0|          }
10551|  5.09k|        }
10552|       |        // Otherwise, if state override is not given, set buffer to the empty
10553|       |        // string, state to no scheme state, and start over (from the first code
10554|       |        // point in input).
10555|      0|        else {
10556|      0|          state = state::NO_SCHEME;
10557|      0|          input_position = 0;
10558|      0|          break;
10559|      0|        }
10560|  5.09k|        input_position++;
10561|  5.09k|        break;
10562|  5.09k|      }
10563|      0|      case state::NO_SCHEME: {
  ------------------
  |  Branch (10563:7): [True: 0, False: 27.7k]
  ------------------
10564|      0|        ada_log("NO_SCHEME ", helpers::substring(url_data, input_position));
10565|       |        // If base is null, or base has an opaque path and c is not U+0023 (#),
10566|       |        // validation error, return failure.
10567|      0|        if (base_url == nullptr ||
  ------------------
  |  Branch (10567:13): [True: 0, False: 0]
  ------------------
10568|      0|            (base_url->has_opaque_path && !fragment.has_value())) {
  ------------------
  |  Branch (10568:14): [True: 0, False: 0]
  |  Branch (10568:43): [True: 0, False: 0]
  ------------------
10569|      0|          ada_log("NO_SCHEME validation error");
10570|      0|          url.is_valid = false;
10571|      0|          return url;
10572|      0|        }
10573|       |        // Otherwise, if base has an opaque path and c is U+0023 (#),
10574|       |        // set url's scheme to base's scheme, url's path to base's path, url's
10575|       |        // query to base's query, and set state to fragment state.
10576|      0|        else if (base_url->has_opaque_path && fragment.has_value() &&
  ------------------
  |  Branch (10576:18): [True: 0, False: 0]
  |  Branch (10576:47): [True: 0, False: 0]
  ------------------
10577|      0|                 input_position == input_size) {
  ------------------
  |  Branch (10577:18): [True: 0, False: 0]
  ------------------
10578|      0|          ada_log("NO_SCHEME opaque base with fragment");
10579|      0|          url.copy_scheme(*base_url);
10580|      0|          url.has_opaque_path = base_url->has_opaque_path;
10581|       |
10582|       |          if constexpr (result_type_is_ada_url) {
10583|       |            url.path = base_url->path;
10584|       |            url.query = base_url->query;
10585|      0|          } else {
10586|      0|            url.update_base_pathname(base_url->get_pathname());
10587|      0|            if (base_url->has_search()) {
  ------------------
  |  Branch (10587:17): [True: 0, False: 0]
  ------------------
10588|       |              // get_search() returns "" for an empty query string (URL ends
10589|       |              // with '?'). update_base_search("") would incorrectly clear the
10590|       |              // query, so pass "?" to preserve the empty query distinction.
10591|      0|              auto s = base_url->get_search();
10592|      0|              url.update_base_search(s.empty() ? std::string_view("?") : s);
  ------------------
  |  Branch (10592:38): [True: 0, False: 0]
  ------------------
10593|      0|            }
10594|      0|          }
10595|      0|          url.update_unencoded_base_hash(*fragment);
10596|      0|          return url;
10597|      0|        }
10598|       |        // Otherwise, if base's scheme is not "file", set state to relative
10599|       |        // state and decrease pointer by 1.
10600|       |        // NOLINTNEXTLINE(bugprone-branch-clone)
10601|      0|        else if (base_url->type != scheme::type::FILE) {
  ------------------
  |  Branch (10601:18): [True: 0, False: 0]
  ------------------
10602|      0|          ada_log("NO_SCHEME non-file relative path");
10603|      0|          state = state::RELATIVE_SCHEME;
10604|      0|        }
10605|       |        // Otherwise, set state to file state and decrease pointer by 1.
10606|      0|        else {
10607|      0|          ada_log("NO_SCHEME file base type");
10608|      0|          state = state::FILE;
10609|      0|        }
10610|      0|        break;
10611|      0|      }
10612|  5.09k|      case state::AUTHORITY: {
  ------------------
  |  Branch (10612:7): [True: 5.09k, False: 22.6k]
  ------------------
10613|  5.09k|        ada_log("AUTHORITY ", helpers::substring(url_data, input_position));
10614|       |        // most URLs have no @. Having no @ tells us that we don't have to worry
10615|       |        // about AUTHORITY. Of course, we could have @ and still not have to
10616|       |        // worry about AUTHORITY.
10617|       |        // TODO: Instead of just collecting a bool, collect the location of the
10618|       |        // '@' and do something useful with it.
10619|       |        // TODO: We could do various processing early on, using a single pass
10620|       |        // over the string to collect information about it, e.g., telling us
10621|       |        // whether there is a @ and if so, where (or how many).
10622|       |
10623|       |        // Check if url data contains an @.
10624|  5.09k|        if (url_data.find('@', input_position) == std::string_view::npos) {
  ------------------
  |  Branch (10624:13): [True: 4.89k, False: 202]
  ------------------
10625|  4.89k|          state = state::HOST;
10626|  4.89k|          break;
10627|  4.89k|        }
10628|    202|        bool at_sign_seen{false};
10629|    202|        bool password_token_seen{false};
10630|       |        /**
10631|       |         * We expect something of the sort...
10632|       |         * https://user:pass@example.com:1234/foo/bar?baz#quux
10633|       |         * --------^
10634|       |         */
10635|  1.40k|        do {
10636|  1.40k|          std::string_view view = url_data.substr(input_position);
10637|       |          // The delimiters are @, /, ? \\.
10638|  1.40k|          size_t location =
10639|  1.40k|              url.is_special() ? helpers::find_authority_delimiter_special(view)
  ------------------
  |  Branch (10639:15): [True: 1.40k, False: 0]
  ------------------
10640|  1.40k|                               : helpers::find_authority_delimiter(view);
10641|  1.40k|          std::string_view authority_view = view.substr(0, location);
10642|  1.40k|          size_t end_of_authority = input_position + authority_view.size();
10643|       |          // If c is U+0040 (@), then:
10644|  1.40k|          if ((end_of_authority != input_size) &&
  ------------------
  |  Branch (10644:15): [True: 1.39k, False: 11]
  ------------------
10645|  1.39k|              (url_data[end_of_authority] == '@')) {
  ------------------
  |  Branch (10645:15): [True: 1.19k, False: 191]
  ------------------
10646|       |            // If atSignSeen is true, then prepend "%40" to buffer.
10647|  1.19k|            if (at_sign_seen) {
  ------------------
  |  Branch (10647:17): [True: 1.02k, False: 177]
  ------------------
10648|  1.02k|              if (password_token_seen) {
  ------------------
  |  Branch (10648:19): [True: 445, False: 577]
  ------------------
10649|       |                if constexpr (result_type_is_ada_url) {
10650|       |                  url.password += "%40";
10651|    445|                } else {
10652|    445|                  url.append_base_password("%40");
10653|    445|                }
10654|    577|              } else {
10655|       |                if constexpr (result_type_is_ada_url) {
10656|       |                  url.username += "%40";
10657|    577|                } else {
10658|    577|                  url.append_base_username("%40");
10659|    577|                }
10660|    577|              }
10661|  1.02k|            }
10662|       |
10663|  1.19k|            at_sign_seen = true;
10664|       |
10665|  1.19k|            if (!password_token_seen) {
  ------------------
  |  Branch (10665:17): [True: 754, False: 445]
  ------------------
10666|    754|              size_t password_token_location = authority_view.find(':');
10667|    754|              password_token_seen =
10668|    754|                  password_token_location != std::string_view::npos;
10669|       |
10670|    754|              if constexpr (store_values) {
10671|    754|                if (!password_token_seen) {
  ------------------
  |  Branch (10671:21): [True: 671, False: 83]
  ------------------
10672|       |                  if constexpr (result_type_is_ada_url) {
10673|       |                    url.username += unicode::percent_encode(
10674|       |                        authority_view,
10675|       |                        character_sets::USERINFO_PERCENT_ENCODE);
10676|    671|                  } else {
10677|    671|                    url.append_base_username(unicode::percent_encode(
10678|    671|                        authority_view,
10679|    671|                        character_sets::USERINFO_PERCENT_ENCODE));
10680|    671|                  }
10681|    671|                } else {
10682|       |                  if constexpr (result_type_is_ada_url) {
10683|       |                    url.username += unicode::percent_encode(
10684|       |                        authority_view.substr(0, password_token_location),
10685|       |                        character_sets::USERINFO_PERCENT_ENCODE);
10686|       |                    url.password += unicode::percent_encode(
10687|       |                        authority_view.substr(password_token_location + 1),
10688|       |                        character_sets::USERINFO_PERCENT_ENCODE);
10689|     83|                  } else {
10690|     83|                    url.append_base_username(unicode::percent_encode(
10691|     83|                        authority_view.substr(0, password_token_location),
10692|     83|                        character_sets::USERINFO_PERCENT_ENCODE));
10693|     83|                    url.append_base_password(unicode::percent_encode(
10694|     83|                        authority_view.substr(password_token_location + 1),
10695|     83|                        character_sets::USERINFO_PERCENT_ENCODE));
10696|     83|                  }
10697|     83|                }
10698|    754|              }
10699|    754|            } else if constexpr (store_values) {
10700|       |              if constexpr (result_type_is_ada_url) {
10701|       |                url.password += unicode::percent_encode(
10702|       |                    authority_view, character_sets::USERINFO_PERCENT_ENCODE);
10703|    445|              } else {
10704|    445|                url.append_base_password(unicode::percent_encode(
10705|    445|                    authority_view, character_sets::USERINFO_PERCENT_ENCODE));
10706|    445|              }
10707|    445|            }
10708|  1.19k|          }
10709|       |          // Otherwise, if one of the following is true:
10710|       |          // - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#)
10711|       |          // - url is special and c is U+005C (\)
10712|    202|          else if (end_of_authority == input_size ||
  ------------------
  |  Branch (10712:20): [True: 11, False: 191]
  ------------------
10713|    191|                   url_data[end_of_authority] == '/' ||
  ------------------
  |  Branch (10713:20): [True: 184, False: 7]
  ------------------
10714|      7|                   url_data[end_of_authority] == '?' ||
  ------------------
  |  Branch (10714:20): [True: 1, False: 6]
  ------------------
10715|    202|                   (url.is_special() && url_data[end_of_authority] == '\\')) {
  ------------------
  |  Branch (10715:21): [True: 6, False: 0]
  |  Branch (10715:41): [True: 6, False: 0]
  ------------------
10716|       |            // If atSignSeen is true and authority_view is the empty string,
10717|       |            // validation error, return failure.
10718|    202|            if (at_sign_seen && authority_view.empty()) {
  ------------------
  |  Branch (10718:17): [True: 177, False: 25]
  |  Branch (10718:33): [True: 3, False: 174]
  ------------------
10719|      3|              url.is_valid = false;
10720|      3|              return url;
10721|      3|            }
10722|    199|            state = state::HOST;
10723|    199|            break;
10724|    202|          }
10725|  1.19k|          if (end_of_authority == input_size) {
  ------------------
  |  Branch (10725:15): [True: 0, False: 1.19k]
  ------------------
10726|      0|            if constexpr (store_values) {
10727|      0|              if (fragment.has_value()) {
  ------------------
  |  Branch (10727:19): [True: 0, False: 0]
  ------------------
10728|      0|                url.update_unencoded_base_hash(*fragment);
10729|      0|              }
10730|      0|            }
10731|      0|            return url;
10732|      0|          }
10733|  1.19k|          input_position = end_of_authority + 1;
10734|  1.19k|        } while (true);
  ------------------
  |  Branch (10734:18): [True: 1.19k, Folded]
  ------------------
10735|       |
10736|    199|        break;
10737|    202|      }
10738|    199|      case state::SPECIAL_RELATIVE_OR_AUTHORITY: {
  ------------------
  |  Branch (10738:7): [True: 0, False: 27.7k]
  ------------------
10739|      0|        ada_log("SPECIAL_RELATIVE_OR_AUTHORITY ",
10740|      0|                helpers::substring(url_data, input_position));
10741|       |
10742|       |        // If c is U+002F (/) and remaining starts with U+002F (/),
10743|       |        // then set state to special authority ignore slashes state and increase
10744|       |        // pointer by 1.
10745|      0|        if (url_data.substr(input_position, 2) == "//") {
  ------------------
  |  Branch (10745:13): [True: 0, False: 0]
  ------------------
10746|      0|          state = state::SPECIAL_AUTHORITY_IGNORE_SLASHES;
10747|      0|          input_position += 2;
10748|      0|        } else {
10749|       |          // Otherwise, validation error, set state to relative state and
10750|       |          // decrease pointer by 1.
10751|      0|          state = state::RELATIVE_SCHEME;
10752|      0|        }
10753|       |
10754|      0|        break;
10755|    202|      }
10756|      0|      case state::PATH_OR_AUTHORITY: {
  ------------------
  |  Branch (10756:7): [True: 0, False: 27.7k]
  ------------------
10757|      0|        ada_log("PATH_OR_AUTHORITY ",
10758|      0|                helpers::substring(url_data, input_position));
10759|       |
10760|       |        // If c is U+002F (/), then set state to authority state.
10761|      0|        if ((input_position != input_size) &&
  ------------------
  |  Branch (10761:13): [True: 0, False: 0]
  ------------------
10762|      0|            (url_data[input_position] == '/')) {
  ------------------
  |  Branch (10762:13): [True: 0, False: 0]
  ------------------
10763|      0|          state = state::AUTHORITY;
10764|      0|          input_position++;
10765|      0|        } else {
10766|       |          // Otherwise, set state to path state, and decrease pointer by 1.
10767|      0|          state = state::PATH;
10768|      0|        }
10769|       |
10770|      0|        break;
10771|    202|      }
10772|      0|      case state::RELATIVE_SCHEME: {
  ------------------
  |  Branch (10772:7): [True: 0, False: 27.7k]
  ------------------
10773|      0|        ada_log("RELATIVE_SCHEME ",
10774|      0|                helpers::substring(url_data, input_position));
10775|       |
10776|       |        // Set url's scheme to base's scheme.
10777|      0|        url.copy_scheme(*base_url);
10778|       |
10779|       |        // If c is U+002F (/), then set state to relative slash state.
10780|      0|        if ((input_position != input_size) &&
  ------------------
  |  Branch (10780:13): [True: 0, False: 0]
  ------------------
10781|       |            // NOLINTNEXTLINE(bugprone-branch-clone)
10782|      0|            (url_data[input_position] == '/')) {
  ------------------
  |  Branch (10782:13): [True: 0, False: 0]
  ------------------
10783|      0|          ada_log(
10784|      0|              "RELATIVE_SCHEME if c is U+002F (/), then set state to relative "
10785|      0|              "slash state");
10786|      0|          state = state::RELATIVE_SLASH;
10787|      0|        } else if (url.is_special() && (input_position != input_size) &&
  ------------------
  |  Branch (10787:20): [True: 0, False: 0]
  |  Branch (10787:40): [True: 0, False: 0]
  ------------------
10788|      0|                   (url_data[input_position] == '\\')) {
  ------------------
  |  Branch (10788:20): [True: 0, False: 0]
  ------------------
10789|       |          // Otherwise, if url is special and c is U+005C (\), validation error,
10790|       |          // set state to relative slash state.
10791|      0|          ada_log(
10792|      0|              "RELATIVE_SCHEME  if url is special and c is U+005C, validation "
10793|      0|              "error, set state to relative slash state");
10794|      0|          state = state::RELATIVE_SLASH;
10795|      0|        } else {
10796|      0|          ada_log("RELATIVE_SCHEME otherwise");
10797|       |          // Set url's username to base's username, url's password to base's
10798|       |          // password, url's host to base's host, url's port to base's port,
10799|       |          // url's path to a clone of base's path, and url's query to base's
10800|       |          // query.
10801|       |          if constexpr (result_type_is_ada_url) {
10802|       |            url.username = base_url->username;
10803|       |            url.password = base_url->password;
10804|       |            url.host = base_url->host;
10805|       |            url.port = base_url->port;
10806|       |            // cloning the base path includes cloning the has_opaque_path flag
10807|       |            url.has_opaque_path = base_url->has_opaque_path;
10808|       |            url.path = base_url->path;
10809|       |            url.query = base_url->query;
10810|      0|          } else {
10811|      0|            url.update_base_authority(base_url->get_href(),
10812|      0|                                      base_url->get_components());
10813|      0|            url.update_host_to_base_host(base_url->get_hostname());
10814|      0|            url.update_base_port(base_url->retrieve_base_port());
10815|       |            // cloning the base path includes cloning the has_opaque_path flag
10816|      0|            url.has_opaque_path = base_url->has_opaque_path;
10817|      0|            url.update_base_pathname(base_url->get_pathname());
10818|      0|            if (base_url->has_search()) {
  ------------------
  |  Branch (10818:17): [True: 0, False: 0]
  ------------------
10819|       |              // get_search() returns "" for an empty query string (URL ends
10820|       |              // with '?'). update_base_search("") would incorrectly clear the
10821|       |              // query, so pass "?" to preserve the empty query distinction.
10822|      0|              auto s = base_url->get_search();
10823|      0|              url.update_base_search(s.empty() ? std::string_view("?") : s);
  ------------------
  |  Branch (10823:38): [True: 0, False: 0]
  ------------------
10824|      0|            }
10825|      0|          }
10826|       |
10827|      0|          url.has_opaque_path = base_url->has_opaque_path;
10828|       |
10829|       |          // If c is U+003F (?), then set url's query to the empty string, and
10830|       |          // state to query state.
10831|      0|          if ((input_position != input_size) &&
  ------------------
  |  Branch (10831:15): [True: 0, False: 0]
  ------------------
10832|      0|              (url_data[input_position] == '?')) {
  ------------------
  |  Branch (10832:15): [True: 0, False: 0]
  ------------------
10833|      0|            state = state::QUERY;
10834|      0|          }
10835|       |          // Otherwise, if c is not the EOF code point:
10836|      0|          else if (input_position != input_size) {
  ------------------
  |  Branch (10836:20): [True: 0, False: 0]
  ------------------
10837|       |            // Set url's query to null.
10838|      0|            url.clear_search();
10839|       |            if constexpr (result_type_is_ada_url) {
10840|       |              // Shorten url's path.
10841|       |              helpers::shorten_path(url.path, url.type);
10842|      0|            } else {
10843|      0|              std::string_view path = url.get_pathname();
10844|      0|              if (helpers::shorten_path(path, url.type)) {
  ------------------
  |  Branch (10844:19): [True: 0, False: 0]
  ------------------
10845|      0|                url.update_base_pathname(std::move(std::string(path)));
10846|      0|              }
10847|      0|            }
10848|       |            // Set state to path state and decrease pointer by 1.
10849|      0|            state = state::PATH;
10850|      0|            break;
10851|      0|          }
10852|      0|        }
10853|      0|        input_position++;
10854|      0|        break;
10855|      0|      }
10856|      0|      case state::RELATIVE_SLASH: {
  ------------------
  |  Branch (10856:7): [True: 0, False: 27.7k]
  ------------------
10857|      0|        ada_log("RELATIVE_SLASH ",
10858|      0|                helpers::substring(url_data, input_position));
10859|       |
10860|       |        // If url is special and c is U+002F (/) or U+005C (\), then:
10861|       |        // NOLINTNEXTLINE(bugprone-branch-clone)
10862|      0|        if (url.is_special() && (input_position != input_size) &&
  ------------------
  |  Branch (10862:13): [True: 0, False: 0]
  |  Branch (10862:33): [True: 0, False: 0]
  ------------------
10863|      0|            (url_data[input_position] == '/' ||
  ------------------
  |  Branch (10863:14): [True: 0, False: 0]
  ------------------
10864|      0|             url_data[input_position] == '\\')) {
  ------------------
  |  Branch (10864:14): [True: 0, False: 0]
  ------------------
10865|       |          // Set state to special authority ignore slashes state.
10866|      0|          state = state::SPECIAL_AUTHORITY_IGNORE_SLASHES;
10867|      0|        }
10868|       |        // Otherwise, if c is U+002F (/), then set state to authority state.
10869|      0|        else if ((input_position != input_size) &&
  ------------------
  |  Branch (10869:18): [True: 0, False: 0]
  ------------------
10870|      0|                 (url_data[input_position] == '/')) {
  ------------------
  |  Branch (10870:18): [True: 0, False: 0]
  ------------------
10871|      0|          state = state::AUTHORITY;
10872|      0|        }
10873|       |        // Otherwise, set
10874|       |        // - url's username to base's username,
10875|       |        // - url's password to base's password,
10876|       |        // - url's host to base's host,
10877|       |        // - url's port to base's port,
10878|       |        // - state to path state, and then, decrease pointer by 1.
10879|      0|        else {
10880|       |          if constexpr (result_type_is_ada_url) {
10881|       |            url.username = base_url->username;
10882|       |            url.password = base_url->password;
10883|       |            url.host = base_url->host;
10884|       |            url.port = base_url->port;
10885|      0|          } else {
10886|      0|            url.update_base_authority(base_url->get_href(),
10887|      0|                                      base_url->get_components());
10888|      0|            url.update_host_to_base_host(base_url->get_hostname());
10889|      0|            url.update_base_port(base_url->retrieve_base_port());
10890|      0|          }
10891|      0|          state = state::PATH;
10892|      0|          break;
10893|      0|        }
10894|       |
10895|      0|        input_position++;
10896|      0|        break;
10897|      0|      }
10898|  5.09k|      case state::SPECIAL_AUTHORITY_SLASHES: {
  ------------------
  |  Branch (10898:7): [True: 5.09k, False: 22.6k]
  ------------------
10899|  5.09k|        ada_log("SPECIAL_AUTHORITY_SLASHES ",
10900|  5.09k|                helpers::substring(url_data, input_position));
10901|       |
10902|       |        // If c is U+002F (/) and remaining starts with U+002F (/),
10903|       |        // then set state to special authority ignore slashes state and increase
10904|       |        // pointer by 1.
10905|  5.09k|        if (url_data.substr(input_position, 2) == "//") {
  ------------------
  |  Branch (10905:13): [True: 5.09k, False: 0]
  ------------------
10906|  5.09k|          input_position += 2;
10907|  5.09k|        }
10908|       |
10909|  5.09k|        [[fallthrough]];
10910|  5.09k|      }
10911|  5.09k|      case state::SPECIAL_AUTHORITY_IGNORE_SLASHES: {
  ------------------
  |  Branch (10911:7): [True: 0, False: 27.7k]
  ------------------
10912|  5.09k|        ada_log("SPECIAL_AUTHORITY_IGNORE_SLASHES ",
10913|  5.09k|                helpers::substring(url_data, input_position));
10914|       |
10915|       |        // If c is neither U+002F (/) nor U+005C (\), then set state to
10916|       |        // authority state and decrease pointer by 1.
10917|  5.28k|        while ((input_position != input_size) &&
  ------------------
  |  Branch (10917:16): [True: 5.28k, False: 2]
  ------------------
10918|  5.28k|               ((url_data[input_position] == '/') ||
  ------------------
  |  Branch (10918:17): [True: 96, False: 5.18k]
  ------------------
10919|  5.18k|                (url_data[input_position] == '\\'))) {
  ------------------
  |  Branch (10919:17): [True: 92, False: 5.09k]
  ------------------
10920|    188|          input_position++;
10921|    188|        }
10922|  5.09k|        state = state::AUTHORITY;
10923|       |
10924|  5.09k|        break;
10925|  5.09k|      }
10926|    280|      case state::QUERY: {
  ------------------
  |  Branch (10926:7): [True: 280, False: 27.4k]
  ------------------
10927|    280|        ada_log("QUERY ", helpers::substring(url_data, input_position));
10928|    280|        if constexpr (store_values) {
10929|       |          // Let queryPercentEncodeSet be the special-query percent-encode set
10930|       |          // if url is special; otherwise the query percent-encode set.
10931|    280|          const uint8_t* query_percent_encode_set =
10932|    280|              url.is_special() ? character_sets::SPECIAL_QUERY_PERCENT_ENCODE
  ------------------
  |  Branch (10932:15): [True: 280, False: 0]
  ------------------
10933|    280|                               : character_sets::QUERY_PERCENT_ENCODE;
10934|       |
10935|       |          // Percent-encode after encoding, with encoding, buffer, and
10936|       |          // queryPercentEncodeSet, and append the result to url's query.
10937|    280|          url.update_base_search(url_data.substr(input_position),
10938|    280|                                 query_percent_encode_set);
10939|    280|          ada_log("QUERY update_base_search completed ");
10940|    280|          if (fragment.has_value()) {
  ------------------
  |  Branch (10940:15): [True: 8, False: 272]
  ------------------
10941|      8|            url.update_unencoded_base_hash(*fragment);
10942|      8|          }
10943|    280|        }
10944|    280|        return url;
10945|  5.09k|      }
10946|  5.09k|      case state::HOST: {
  ------------------
  |  Branch (10946:7): [True: 5.09k, False: 22.6k]
  ------------------
10947|  5.09k|        ada_log("HOST ", helpers::substring(url_data, input_position));
10948|       |
10949|  5.09k|        std::string_view host_view = url_data.substr(input_position);
10950|  5.09k|        auto [location, found_colon] =
10951|  5.09k|            helpers::get_host_delimiter_location(url.is_special(), host_view);
10952|  5.09k|        input_position = (location != std::string_view::npos)
  ------------------
  |  Branch (10952:26): [True: 5.09k, False: 0]
  ------------------
10953|  5.09k|                             ? input_position + location
10954|  5.09k|                             : input_size;
10955|       |        // Otherwise, if c is U+003A (:) and insideBrackets is false, then:
10956|       |        // Note: the 'found_colon' value is true if and only if a colon was
10957|       |        // encountered while not inside brackets.
10958|  5.09k|        if (found_colon) {
  ------------------
  |  Branch (10958:13): [True: 433, False: 4.66k]
  ------------------
10959|       |          // If buffer is the empty string, validation error, return failure.
10960|       |          // Let host be the result of host parsing buffer with url is not
10961|       |          // special.
10962|    433|          ada_log("HOST parsing ", host_view);
10963|    433|          if (!url.parse_host(host_view)) {
  ------------------
  |  Branch (10963:15): [True: 161, False: 272]
  ------------------
10964|    161|            return url;
10965|    161|          }
10966|    272|          ada_log("HOST parsing results in ", url.get_hostname());
10967|       |          // Set url's host to host, buffer to the empty string, and state to
10968|       |          // port state.
10969|    272|          state = state::PORT;
10970|    272|          input_position++;
10971|    272|        }
10972|       |        // Otherwise, if one of the following is true:
10973|       |        // - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#)
10974|       |        // - url is special and c is U+005C (\)
10975|       |        // The get_host_delimiter_location function either brings us to
10976|       |        // the colon outside of the bracket, or to one of those characters.
10977|  4.66k|        else {
10978|       |          // If url is special and host_view is the empty string, validation
10979|       |          // error, return failure.
10980|  4.66k|          if (host_view.empty() && url.is_special()) {
  ------------------
  |  Branch (10980:15): [True: 2, False: 4.66k]
  |  Branch (10980:36): [True: 2, False: 0]
  ------------------
10981|      2|            url.is_valid = false;
10982|      2|            return url;
10983|      2|          }
10984|  4.66k|          ada_log("HOST parsing ", host_view, " href=", url.get_href());
10985|       |          // Let host be the result of host parsing host_view with url is not
10986|       |          // special.
10987|  4.66k|          if (host_view.empty()) {
  ------------------
  |  Branch (10987:15): [True: 0, False: 4.66k]
  ------------------
10988|      0|            url.update_base_hostname("");
10989|  4.66k|          } else if (!url.parse_host(host_view)) {
  ------------------
  |  Branch (10989:22): [True: 3.84k, False: 819]
  ------------------
10990|  3.84k|            return url;
10991|  3.84k|          }
10992|    819|          ada_log("HOST parsing results in ", url.get_hostname(),
10993|    819|                  " href=", url.get_href());
10994|       |
10995|       |          // Set url's host to host, and state to path start state.
10996|    819|          state = state::PATH_START;
10997|    819|        }
10998|       |
10999|  1.09k|        break;
11000|  5.09k|      }
11001|  1.09k|      case state::OPAQUE_PATH: {
  ------------------
  |  Branch (11001:7): [True: 0, False: 27.7k]
  ------------------
11002|      0|        ada_log("OPAQUE_PATH ", helpers::substring(url_data, input_position));
11003|       |        // Opaque path, query, and fragment are structurally always valid:
11004|       |        // the parser would just percent-encode whatever is there. When we
11005|       |        // are not storing values (can_parse), we can return immediately.
11006|       |        // We must set has_opaque_path = true before returning so that when
11007|       |        // this URL is used as an internal base inside can_parse, NO_SCHEME
11008|       |        // correctly rejects relative inputs against an opaque-path base
11009|       |        // (e.g. can_parse("", &"W:") must return false).
11010|       |        if constexpr (!store_values) {
11011|       |          url.has_opaque_path = true;
11012|       |          return url;
11013|       |        }
11014|      0|        std::string_view view = url_data.substr(input_position);
11015|       |        // If c is U+003F (?), then set url's query to the empty string and
11016|       |        // state to query state.
11017|      0|        size_t location = view.find('?');
11018|      0|        if (location != std::string_view::npos) {
  ------------------
  |  Branch (11018:13): [True: 0, False: 0]
  ------------------
11019|      0|          view.remove_suffix(view.size() - location);
11020|      0|          state = state::QUERY;
11021|      0|          input_position += location + 1;
11022|      0|        } else {
11023|      0|          input_position = input_size + 1;
11024|      0|        }
11025|      0|        url.has_opaque_path = true;
11026|       |
11027|       |        // This is a really unlikely scenario in real world. We should not seek
11028|       |        // to optimize it.
11029|      0|        if (view.ends_with(' ')) {
  ------------------
  |  Branch (11029:13): [True: 0, False: 0]
  ------------------
11030|      0|          std::string modified_view =
11031|      0|              std::string(view.substr(0, view.size() - 1)) + "%20";
11032|      0|          url.update_base_pathname(unicode::percent_encode(
11033|      0|              modified_view, character_sets::C0_CONTROL_PERCENT_ENCODE));
11034|      0|        } else {
11035|      0|          url.update_base_pathname(unicode::percent_encode(
11036|      0|              view, character_sets::C0_CONTROL_PERCENT_ENCODE));
11037|      0|        }
11038|      0|        break;
11039|  5.09k|      }
11040|    272|      case state::PORT: {
  ------------------
  |  Branch (11040:7): [True: 272, False: 27.4k]
  ------------------
11041|    272|        ada_log("PORT ", helpers::substring(url_data, input_position));
11042|    272|        std::string_view port_view = url_data.substr(input_position);
11043|    272|        input_position += url.parse_port(port_view, true);
11044|    272|        if (!url.is_valid) {
  ------------------
  |  Branch (11044:13): [True: 188, False: 84]
  ------------------
11045|    188|          return url;
11046|    188|        }
11047|     84|        state = state::PATH_START;
11048|     84|        [[fallthrough]];
11049|     84|      }
11050|    903|      case state::PATH_START: {
  ------------------
  |  Branch (11050:7): [True: 819, False: 26.9k]
  ------------------
11051|    903|        ada_log("PATH_START ", helpers::substring(url_data, input_position));
11052|       |        // Path, query, and fragment are structurally always valid: the
11053|       |        // parser would just percent-encode whatever is there. When we are
11054|       |        // not storing values (can_parse), we can return immediately since
11055|       |        // no subsequent state can invalidate the URL.
11056|       |        if constexpr (!store_values) {
11057|       |          return url;
11058|       |        }
11059|       |
11060|       |        // If url is special, then:
11061|    903|        if (url.is_special()) {
  ------------------
  |  Branch (11061:13): [True: 903, False: 0]
  ------------------
11062|       |          // Set state to path state.
11063|    903|          state = state::PATH;
11064|       |
11065|       |          // Optimization: Avoiding going into PATH state improves the
11066|       |          // performance of urls ending with /.
11067|    903|          if (input_position == input_size) {
  ------------------
  |  Branch (11067:15): [True: 37, False: 866]
  ------------------
11068|     37|            if constexpr (store_values) {
11069|     37|              url.update_base_pathname("/");
11070|     37|              if (fragment.has_value()) {
  ------------------
  |  Branch (11070:19): [True: 37, False: 0]
  ------------------
11071|     37|                url.update_unencoded_base_hash(*fragment);
11072|     37|              }
11073|     37|            }
11074|     37|            return url;
11075|     37|          }
11076|       |          // If c is neither U+002F (/) nor U+005C (\), then decrease pointer
11077|       |          // by 1. We know that (input_position == input_size) is impossible
11078|       |          // here, because of the previous if-check.
11079|    866|          if ((url_data[input_position] != '/') &&
  ------------------
  |  Branch (11079:15): [True: 85, False: 781]
  ------------------
11080|     85|              (url_data[input_position] != '\\')) {
  ------------------
  |  Branch (11080:15): [True: 29, False: 56]
  ------------------
11081|     29|            break;
11082|     29|          }
11083|    866|        }
11084|       |        // Otherwise, if state override is not given and c is U+003F (?),
11085|       |        // set url's query to the empty string and state to query state.
11086|      0|        else if ((input_position != input_size) &&
  ------------------
  |  Branch (11086:18): [True: 0, False: 0]
  ------------------
11087|      0|                 (url_data[input_position] == '?')) {
  ------------------
  |  Branch (11087:18): [True: 0, False: 0]
  ------------------
11088|      0|          state = state::QUERY;
11089|      0|        }
11090|       |        // Otherwise, if c is not the EOF code point:
11091|      0|        else if (input_position != input_size) {
  ------------------
  |  Branch (11091:18): [True: 0, False: 0]
  ------------------
11092|       |          // Set state to path state.
11093|      0|          state = state::PATH;
11094|       |
11095|       |          // If c is not U+002F (/), then decrease pointer by 1.
11096|      0|          if (url_data[input_position] != '/') {
  ------------------
  |  Branch (11096:15): [True: 0, False: 0]
  ------------------
11097|      0|            break;
11098|      0|          }
11099|      0|        }
11100|       |
11101|    837|        input_position++;
11102|    837|        break;
11103|    903|      }
11104|    866|      case state::PATH: {
  ------------------
  |  Branch (11104:7): [True: 866, False: 26.8k]
  ------------------
11105|    866|        ada_log("PATH ", helpers::substring(url_data, input_position));
11106|       |        // Path, query, and fragment are structurally always valid: the
11107|       |        // parser would just percent-encode whatever is there. When we are
11108|       |        // not storing values (can_parse), we can return immediately since
11109|       |        // no subsequent state can invalidate the URL.
11110|       |        if constexpr (!store_values) {
11111|       |          return url;
11112|       |        }
11113|    866|        std::string_view view = url_data.substr(input_position);
11114|       |
11115|       |        // Most time, we do not need percent encoding.
11116|       |        // Furthermore, we can immediately locate the '?'.
11117|    866|        size_t locofquestionmark = view.find('?');
11118|    866|        if (locofquestionmark != std::string_view::npos) {
  ------------------
  |  Branch (11118:13): [True: 280, False: 586]
  ------------------
11119|    280|          state = state::QUERY;
11120|    280|          view.remove_suffix(view.size() - locofquestionmark);
11121|    280|          input_position += locofquestionmark + 1;
11122|    586|        } else {
11123|    586|          input_position = input_size + 1;
11124|    586|        }
11125|    866|        if constexpr (store_values) {
11126|       |          if constexpr (result_type_is_ada_url) {
11127|       |            helpers::parse_prepared_path(view, url.type, url.path);
11128|    866|          } else {
11129|    866|            url.consume_prepared_path(view);
11130|    866|            ADA_ASSERT_TRUE(url.validate());
11131|    866|          }
11132|    866|        }
11133|    866|        break;
11134|    903|      }
11135|      0|      case state::FILE_SLASH: {
  ------------------
  |  Branch (11135:7): [True: 0, False: 27.7k]
  ------------------
11136|      0|        ada_log("FILE_SLASH ", helpers::substring(url_data, input_position));
11137|       |
11138|       |        // If c is U+002F (/) or U+005C (\), then:
11139|      0|        if ((input_position != input_size) &&
  ------------------
  |  Branch (11139:13): [True: 0, False: 0]
  ------------------
11140|      0|            (url_data[input_position] == '/' ||
  ------------------
  |  Branch (11140:14): [True: 0, False: 0]
  ------------------
11141|      0|             url_data[input_position] == '\\')) {
  ------------------
  |  Branch (11141:14): [True: 0, False: 0]
  ------------------
11142|      0|          ada_log("FILE_SLASH c is U+002F or U+005C");
11143|       |          // Set state to file host state.
11144|      0|          state = state::FILE_HOST;
11145|      0|          input_position++;
11146|      0|        } else {
11147|      0|          ada_log("FILE_SLASH otherwise");
11148|       |          // If base is non-null and base's scheme is "file", then:
11149|       |          // Note: it is unsafe to do base_url->scheme unless you know that
11150|       |          // base_url_has_value() is true.
11151|      0|          if (base_url != nullptr && base_url->type == scheme::type::FILE) {
  ------------------
  |  Branch (11151:15): [True: 0, False: 0]
  |  Branch (11151:38): [True: 0, False: 0]
  ------------------
11152|       |            // Set url's host to base's host.
11153|       |            if constexpr (result_type_is_ada_url) {
11154|       |              url.host = base_url->host;
11155|      0|            } else {
11156|      0|              url.update_host_to_base_host(base_url->get_host());
11157|      0|            }
11158|       |            // If the code point substring from pointer to the end of input does
11159|       |            // not start with a Windows drive letter and base's path[0] is a
11160|       |            // normalized Windows drive letter, then append base's path[0] to
11161|       |            // url's path.
11162|      0|            if (!base_url->get_pathname().empty()) {
  ------------------
  |  Branch (11162:17): [True: 0, False: 0]
  ------------------
11163|      0|              if (!checkers::is_windows_drive_letter(
  ------------------
  |  Branch (11163:19): [True: 0, False: 0]
  ------------------
11164|      0|                      url_data.substr(input_position))) {
11165|      0|                std::string_view first_base_url_path =
11166|      0|                    base_url->get_pathname().substr(1);
11167|      0|                size_t loc = first_base_url_path.find('/');
11168|      0|                if (loc != std::string_view::npos) {
  ------------------
  |  Branch (11168:21): [True: 0, False: 0]
  ------------------
11169|      0|                  helpers::resize(first_base_url_path, loc);
11170|      0|                }
11171|      0|                if (checkers::is_normalized_windows_drive_letter(
  ------------------
  |  Branch (11171:21): [True: 0, False: 0]
  ------------------
11172|      0|                        first_base_url_path)) {
11173|       |                  if constexpr (result_type_is_ada_url) {
11174|       |                    url.path += '/';
11175|       |                    url.path += first_base_url_path;
11176|      0|                  } else {
11177|      0|                    url.append_base_pathname(
11178|      0|                        helpers::concat("/", first_base_url_path));
11179|      0|                  }
11180|      0|                }
11181|      0|              }
11182|      0|            }
11183|      0|          }
11184|       |
11185|       |          // Set state to path state, and decrease pointer by 1.
11186|      0|          state = state::PATH;
11187|      0|        }
11188|       |
11189|      0|        break;
11190|    903|      }
11191|      0|      case state::FILE_HOST: {
  ------------------
  |  Branch (11191:7): [True: 0, False: 27.7k]
  ------------------
11192|      0|        ada_log("FILE_HOST ", helpers::substring(url_data, input_position));
11193|      0|        std::string_view view = url_data.substr(input_position);
11194|       |
11195|      0|        size_t location = view.find_first_of("/\\?");
11196|      0|        std::string_view file_host_buffer = view.substr(
11197|      0|            0, (location != std::string_view::npos) ? location : view.size());
  ------------------
  |  Branch (11197:16): [True: 0, False: 0]
  ------------------
11198|       |
11199|      0|        if (checkers::is_windows_drive_letter(file_host_buffer)) {
  ------------------
  |  Branch (11199:13): [True: 0, False: 0]
  ------------------
11200|      0|          state = state::PATH;
11201|      0|        } else if (file_host_buffer.empty()) {
  ------------------
  |  Branch (11201:20): [True: 0, False: 0]
  ------------------
11202|       |          // Set url's host to the empty string.
11203|       |          if constexpr (result_type_is_ada_url) {
11204|       |            url.host = "";
11205|      0|          } else {
11206|      0|            url.update_base_hostname("");
11207|      0|          }
11208|       |          // Set state to path start state.
11209|      0|          state = state::PATH_START;
11210|      0|        } else {
11211|      0|          size_t consumed_bytes = file_host_buffer.size();
11212|      0|          input_position += consumed_bytes;
11213|       |          // Let host be the result of host parsing buffer with url is not
11214|       |          // special.
11215|      0|          if (!url.parse_host(file_host_buffer)) {
  ------------------
  |  Branch (11215:15): [True: 0, False: 0]
  ------------------
11216|      0|            return url;
11217|      0|          }
11218|       |
11219|       |          if constexpr (result_type_is_ada_url) {
11220|       |            // If host is "localhost", then set host to the empty string.
11221|       |            if (url.host.has_value() && url.host.value() == "localhost") {
11222|       |              url.host = "";
11223|       |            }
11224|      0|          } else {
11225|      0|            if (url.get_hostname() == "localhost") {
  ------------------
  |  Branch (11225:17): [True: 0, False: 0]
  ------------------
11226|      0|              url.update_base_hostname("");
11227|      0|            }
11228|      0|          }
11229|       |
11230|       |          // Set buffer to the empty string and state to path start state.
11231|      0|          state = state::PATH_START;
11232|      0|        }
11233|       |
11234|      0|        break;
11235|      0|      }
11236|      0|      case state::FILE: {
  ------------------
  |  Branch (11236:7): [True: 0, False: 27.7k]
  ------------------
11237|      0|        ada_log("FILE ", helpers::substring(url_data, input_position));
11238|      0|        std::string_view file_view = url_data.substr(input_position);
11239|       |
11240|      0|        url.set_protocol_as_file();
11241|       |        if constexpr (result_type_is_ada_url) {
11242|       |          // Set url's host to the empty string.
11243|       |          url.host = "";
11244|      0|        } else {
11245|      0|          url.update_base_hostname("");
11246|      0|        }
11247|       |        // If c is U+002F (/) or U+005C (\), then:
11248|      0|        if (input_position != input_size &&
  ------------------
  |  Branch (11248:13): [True: 0, False: 0]
  ------------------
11249|      0|            (url_data[input_position] == '/' ||
  ------------------
  |  Branch (11249:14): [True: 0, False: 0]
  ------------------
11250|      0|             url_data[input_position] == '\\')) {
  ------------------
  |  Branch (11250:14): [True: 0, False: 0]
  ------------------
11251|      0|          ada_log("FILE c is U+002F or U+005C");
11252|       |          // Set state to file slash state.
11253|      0|          state = state::FILE_SLASH;
11254|      0|        }
11255|       |        // Otherwise, if base is non-null and base's scheme is "file":
11256|      0|        else if (base_url != nullptr && base_url->type == scheme::type::FILE) {
  ------------------
  |  Branch (11256:18): [True: 0, False: 0]
  |  Branch (11256:41): [True: 0, False: 0]
  ------------------
11257|       |          // Set url's host to base's host, url's path to a clone of base's
11258|       |          // path, and url's query to base's query.
11259|      0|          ada_log("FILE base non-null");
11260|       |          if constexpr (result_type_is_ada_url) {
11261|       |            url.host = base_url->host;
11262|       |            url.path = base_url->path;
11263|       |            url.query = base_url->query;
11264|      0|          } else {
11265|      0|            url.update_host_to_base_host(base_url->get_hostname());
11266|      0|            url.update_base_pathname(base_url->get_pathname());
11267|      0|            if (base_url->has_search()) {
  ------------------
  |  Branch (11267:17): [True: 0, False: 0]
  ------------------
11268|       |              // get_search() returns "" for an empty query string (URL ends
11269|       |              // with '?'). update_base_search("") would incorrectly clear the
11270|       |              // query, so pass "?" to preserve the empty query distinction.
11271|      0|              auto s = base_url->get_search();
11272|      0|              url.update_base_search(s.empty() ? std::string_view("?") : s);
  ------------------
  |  Branch (11272:38): [True: 0, False: 0]
  ------------------
11273|      0|            }
11274|      0|          }
11275|      0|          url.has_opaque_path = base_url->has_opaque_path;
11276|       |
11277|       |          // If c is U+003F (?), then set url's query to the empty string and
11278|       |          // state to query state.
11279|      0|          if (input_position != input_size && url_data[input_position] == '?') {
  ------------------
  |  Branch (11279:15): [True: 0, False: 0]
  |  Branch (11279:47): [True: 0, False: 0]
  ------------------
11280|      0|            state = state::QUERY;
11281|      0|          }
11282|       |          // Otherwise, if c is not the EOF code point:
11283|      0|          else if (input_position != input_size) {
  ------------------
  |  Branch (11283:20): [True: 0, False: 0]
  ------------------
11284|       |            // Set url's query to null.
11285|      0|            url.clear_search();
11286|       |            // If the code point substring from pointer to the end of input does
11287|       |            // not start with a Windows drive letter, then shorten url's path.
11288|      0|            if (!checkers::is_windows_drive_letter(file_view)) {
  ------------------
  |  Branch (11288:17): [True: 0, False: 0]
  ------------------
11289|       |              if constexpr (result_type_is_ada_url) {
11290|       |                helpers::shorten_path(url.path, url.type);
11291|      0|              } else {
11292|      0|                std::string_view path = url.get_pathname();
11293|      0|                if (helpers::shorten_path(path, url.type)) {
  ------------------
  |  Branch (11293:21): [True: 0, False: 0]
  ------------------
11294|      0|                  url.update_base_pathname(std::move(std::string(path)));
11295|      0|                }
11296|      0|              }
11297|      0|            }
11298|       |            // Otherwise:
11299|      0|            else {
11300|       |              // Set url's path to an empty list.
11301|      0|              url.clear_pathname();
11302|      0|              url.has_opaque_path = true;
11303|      0|            }
11304|       |
11305|       |            // Set state to path state and decrease pointer by 1.
11306|      0|            state = state::PATH;
11307|      0|            break;
11308|      0|          }
11309|      0|        }
11310|       |        // Otherwise, set state to path state, and decrease pointer by 1.
11311|      0|        else {
11312|      0|          ada_log("FILE go to path");
11313|      0|          state = state::PATH;
11314|      0|          break;
11315|      0|        }
11316|       |
11317|      0|        input_position++;
11318|      0|        break;
11319|      0|      }
11320|      0|      default:
  ------------------
  |  Branch (11320:7): [True: 0, False: 27.7k]
  ------------------
11321|      0|        unreachable();
11322|  27.7k|    }
11323|  27.7k|  }
11324|    626|  if constexpr (store_values) {
11325|    626|    if (fragment.has_value()) {
  ------------------
  |  Branch (11325:9): [True: 26, False: 600]
  ------------------
11326|     26|      url.update_unencoded_base_hash(*fragment);
11327|     26|    }
11328|    626|  }
11329|       |  // Check the resulting (normalized) URL size against the maximum input length.
11330|       |  // Normalization (percent-encoding, IDNA, etc.) can expand the URL beyond the
11331|       |  // original input size.
11332|    626|  if constexpr (store_values) {
11333|    626|    if (url.is_valid) {
  ------------------
  |  Branch (11333:9): [True: 586, False: 40]
  ------------------
11334|    586|      if constexpr (result_type_is_ada_url_aggregator) {
11335|    586|        if (url.buffer.size() > max_input_length) {
  ------------------
  |  Branch (11335:13): [True: 0, False: 586]
  ------------------
11336|      0|          url.is_valid = false;
11337|      0|        }
11338|       |      } else {
11339|       |        if (url.get_href_size() > max_input_length) {
11340|       |          url.is_valid = false;
11341|       |        }
11342|       |      }
11343|    586|    }
11344|    626|  }
11345|    626|  return url;
11346|  5.13k|}
_ZNK3ada14url_aggregator12get_hostnameEv:
12243|  2.67k|    ada_lifetime_bound {
12244|  2.67k|  ada_log("url_aggregator::get_hostname");
12245|       |  // Technically, we should check if there is a hostname, but
12246|       |  // the code below works even if there isn't.
12247|       |  // if(!has_hostname()) { return ""; }
12248|  2.67k|  size_t start = components.host_start;
12249|       |  // So host_start is not where the host begins.
12250|  2.67k|  if (components.host_end > components.host_start &&
  ------------------
  |  Branch (12250:7): [True: 1.48k, False: 1.18k]
  ------------------
12251|  1.48k|      buffer[components.host_start] == '@') {
  ------------------
  |  Branch (12251:7): [True: 235, False: 1.25k]
  ------------------
12252|    235|    start++;
12253|    235|  }
12254|  2.67k|  return helpers::substring(buffer, start, components.host_end);
12255|  2.67k|}
_ZN3ada14url_aggregator10parse_ipv4ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEb:
12388|    779|bool url_aggregator::parse_ipv4(std::string_view input, bool in_place) {
12389|    779|  ada_log("parse_ipv4 ", input, " [", input.size(),
12390|    779|          " bytes], overlaps with buffer: ",
12391|    779|          helpers::overlaps(input, buffer) ? "yes" : "no");
12392|    779|  ADA_ASSERT_TRUE(validate());
12393|    779|  if (input.empty()) {
  ------------------
  |  Branch (12393:7): [True: 0, False: 779]
  ------------------
12394|      0|    return is_valid = false;
12395|      0|  }
12396|    779|  const bool trailing_dot = (input.back() == '.');
12397|    779|  if (trailing_dot) {
  ------------------
  |  Branch (12397:7): [True: 83, False: 696]
  ------------------
12398|     83|    input.remove_suffix(1);
12399|     83|    if (input.empty()) {
  ------------------
  |  Branch (12399:9): [True: 0, False: 83]
  ------------------
12400|      0|      return is_valid = false;
12401|      0|    }
12402|     83|  }
12403|       |
12404|    779|  const uint64_t fast = checkers::try_parse_ipv4_fast(input);
12405|    779|  if (fast < checkers::ipv4_fast_fail) [[likely]] {
  ------------------
  |  Branch (12405:7): [True: 1, False: 778]
  ------------------
12406|       |    // Pure decimal: keep the buffer when it already holds the address.
12407|       |    // Otherwise write the (trailing-dot-stripped) input.
12408|      1|    if (!(in_place && !trailing_dot)) {
  ------------------
  |  Branch (12408:11): [True: 0, False: 1]
  |  Branch (12408:23): [True: 0, False: 0]
  ------------------
12409|      1|      update_base_hostname(input);
12410|      1|    }
12411|      1|    host_type = IPV4;
12412|      1|    ADA_ASSERT_TRUE(validate());
12413|      1|    return true;
12414|      1|  }
12415|       |
12416|    778|  const char* p = input.data();
12417|    778|  const char* end = p + input.size();
12418|    778|  uint64_t ipv4 = 0;
12419|    778|  int digit_count = 0;
12420|    778|  int pure_decimal_count = 0;
12421|       |
12422|  1.03k|  for (; digit_count < 4 && p < end; ++digit_count) {
  ------------------
  |  Branch (12422:10): [True: 1.03k, False: 5]
  |  Branch (12422:29): [True: 1.03k, False: 0]
  ------------------
12423|  1.03k|    uint64_t segment = 0;
12424|  1.03k|    bool pure = false;
12425|  1.03k|    if (!detail::parse_ipv4_number(p, end, segment, pure)) {
  ------------------
  |  Branch (12425:9): [True: 371, False: 659]
  ------------------
12426|    371|      return is_valid = false;
12427|    371|    }
12428|    659|    if (pure) {
  ------------------
  |  Branch (12428:9): [True: 502, False: 157]
  ------------------
12429|    502|      ++pure_decimal_count;
12430|    502|    }
12431|    659|    if (p >= end) {
  ------------------
  |  Branch (12431:9): [True: 377, False: 282]
  ------------------
12432|    377|      const unsigned shift = static_cast<unsigned>(32 - digit_count * 8);
12433|    377|      if (segment >= (uint64_t{1} << shift)) {
  ------------------
  |  Branch (12433:11): [True: 17, False: 360]
  ------------------
12434|     17|        return is_valid = false;
12435|     17|      }
12436|    360|      ipv4 = (ipv4 << shift) | segment;
12437|    360|      goto ipv4_done;
12438|    377|    }
12439|    282|    if (segment > 255 || *p != '.') {
  ------------------
  |  Branch (12439:9): [True: 25, False: 257]
  |  Branch (12439:26): [True: 0, False: 257]
  ------------------
12440|     25|      return is_valid = false;
12441|     25|    }
12442|    257|    ipv4 = (ipv4 << 8) | segment;
12443|    257|    ++p;
12444|    257|  }
12445|      5|  if (digit_count != 4 || p != end) {
  ------------------
  |  Branch (12445:7): [True: 0, False: 5]
  |  Branch (12445:27): [True: 5, False: 0]
  ------------------
12446|      5|    return is_valid = false;
12447|      5|  }
12448|    360|ipv4_done:
12449|    360|  ada_log("url_aggregator::parse_ipv4 completed ", get_href(),
12450|    360|          " host: ", get_host());
12451|    360|  if (in_place && pure_decimal_count == 4 && !trailing_dot) {
  ------------------
  |  Branch (12451:7): [True: 349, False: 11]
  |  Branch (12451:19): [True: 0, False: 349]
  |  Branch (12451:46): [True: 0, False: 0]
  ------------------
12452|      0|    ada_log(
12453|      0|        "url_aggregator::parse_ipv4 completed and was already correct in the "
12454|      0|        "buffer");
12455|    360|  } else {
12456|    360|    update_base_hostname(ada::serializers::ipv4(ipv4));
12457|    360|  }
12458|    360|  host_type = IPV4;
12459|    360|  ADA_ASSERT_TRUE(validate());
12460|    360|  return true;
12461|      5|}
_ZN3ada14url_aggregator10parse_ipv6ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
12463|  2.93k|bool url_aggregator::parse_ipv6(std::string_view input) {
12464|  2.93k|  ada_log("parse_ipv6 ", input, " [", input.size(), " bytes]");
12465|  2.93k|  ADA_ASSERT_TRUE(validate());
12466|  2.93k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
12467|  2.93k|  if (input.empty() || input.size() > 45) [[unlikely]] {
  ------------------
  |  Branch (12467:7): [True: 1, False: 2.93k]
  |  Branch (12467:24): [True: 2, False: 2.93k]
  ------------------
12468|      3|    return is_valid = false;
12469|      3|  }
12470|       |#if defined(ADA_AVX512)
12471|       |  if (!detail::ipv6_structure_plausible(input.data(), input.size()))
12472|       |      [[unlikely]] {
12473|       |    return is_valid = false;
12474|       |  }
12475|       |#endif
12476|       |
12477|  2.93k|  std::array<uint16_t, 8> address{};
12478|  2.93k|  const char* pointer = input.data();
12479|  2.93k|  const char* const end = pointer + input.size();
12480|  2.93k|  int piece_index = 0;
12481|  2.93k|  int compress = -1;
12482|       |
12483|  2.93k|  if (*pointer == ':') {
  ------------------
  |  Branch (12483:7): [True: 4, False: 2.92k]
  ------------------
12484|      4|    if (input.size() == 1 || pointer[1] != ':') [[unlikely]] {
  ------------------
  |  Branch (12484:9): [True: 1, False: 3]
  |  Branch (12484:30): [True: 1, False: 2]
  ------------------
12485|      2|      return is_valid = false;
12486|      2|    }
12487|      2|    pointer += 2;
12488|      2|    compress = ++piece_index;
12489|      2|  }
12490|       |
12491|  3.09k|  while (pointer != end) {
  ------------------
  |  Branch (12491:10): [True: 3.08k, False: 6]
  ------------------
12492|  3.08k|    if (piece_index == 8) [[unlikely]] {
  ------------------
  |  Branch (12492:9): [True: 3, False: 3.08k]
  ------------------
12493|      3|      return is_valid = false;
12494|      3|    }
12495|  3.08k|    if (*pointer == ':') {
  ------------------
  |  Branch (12495:9): [True: 21, False: 3.06k]
  ------------------
12496|     21|      if (compress != -1) [[unlikely]] {
  ------------------
  |  Branch (12496:11): [True: 1, False: 20]
  ------------------
12497|      1|        return is_valid = false;
12498|      1|      }
12499|     20|      ++pointer;
12500|     20|      compress = ++piece_index;
12501|     20|      continue;
12502|     21|    }
12503|       |
12504|  3.06k|    uint16_t value = 0;
12505|  3.06k|    const int length = detail::parse_hex_piece(pointer, end, value);
12506|       |
12507|  3.06k|    if (pointer != end && *pointer == '.') {
  ------------------
  |  Branch (12507:9): [True: 3.05k, False: 4]
  |  Branch (12507:27): [True: 33, False: 3.02k]
  ------------------
12508|     33|      if (length == 0) [[unlikely]] {
  ------------------
  |  Branch (12508:11): [True: 1, False: 32]
  ------------------
12509|      1|        return is_valid = false;
12510|      1|      }
12511|     32|      pointer -= length;
12512|     32|      if (piece_index > 6) [[unlikely]] {
  ------------------
  |  Branch (12512:11): [True: 2, False: 30]
  ------------------
12513|      2|        return is_valid = false;
12514|      2|      }
12515|       |
12516|     30|      int numbers_seen = 0;
12517|     87|      while (pointer != end) {
  ------------------
  |  Branch (12517:14): [True: 79, False: 8]
  ------------------
12518|     79|        int ipv4_piece = -1;
12519|     79|        if (numbers_seen > 0) {
  ------------------
  |  Branch (12519:13): [True: 49, False: 30]
  ------------------
12520|     49|          if (*pointer == '.' && numbers_seen < 4) {
  ------------------
  |  Branch (12520:15): [True: 44, False: 5]
  |  Branch (12520:34): [True: 42, False: 2]
  ------------------
12521|     42|            ++pointer;
12522|     42|          } else {
12523|      7|            return is_valid = false;
12524|      7|          }
12525|     49|        }
12526|     72|        if (pointer == end || *pointer < '0' || *pointer > '9') [[unlikely]] {
  ------------------
  |  Branch (12526:13): [True: 1, False: 71]
  |  Branch (12526:31): [True: 5, False: 66]
  |  Branch (12526:49): [True: 6, False: 60]
  ------------------
12527|     12|          return is_valid = false;
12528|     12|        }
12529|     60|        ipv4_piece = *pointer - '0';
12530|     60|        ++pointer;
12531|     60|        if (pointer != end && *pointer >= '0' && *pointer <= '9') {
  ------------------
  |  Branch (12531:13): [True: 56, False: 4]
  |  Branch (12531:31): [True: 41, False: 15]
  |  Branch (12531:50): [True: 39, False: 2]
  ------------------
12532|     39|          if (ipv4_piece == 0) [[unlikely]] {
  ------------------
  |  Branch (12532:15): [True: 1, False: 38]
  ------------------
12533|      1|            return is_valid = false;
12534|      1|          }
12535|     38|          ipv4_piece = ipv4_piece * 10 + (*pointer - '0');
12536|     38|          ++pointer;
12537|     38|          if (pointer != end && *pointer >= '0' && *pointer <= '9') {
  ------------------
  |  Branch (12537:15): [True: 34, False: 4]
  |  Branch (12537:33): [True: 26, False: 8]
  |  Branch (12537:52): [True: 26, False: 0]
  ------------------
12538|     26|            ipv4_piece = ipv4_piece * 10 + (*pointer - '0');
12539|     26|            ++pointer;
12540|     26|            if (ipv4_piece > 255) [[unlikely]] {
  ------------------
  |  Branch (12540:17): [True: 2, False: 24]
  ------------------
12541|      2|              return is_valid = false;
12542|      2|            }
12543|     26|          }
12544|     38|        }
12545|     57|        address[static_cast<size_t>(piece_index)] = static_cast<uint16_t>(
12546|     57|            address[static_cast<size_t>(piece_index)] * 0x100 +
12547|     57|            static_cast<uint16_t>(ipv4_piece));
12548|     57|        ++numbers_seen;
12549|     57|        if (numbers_seen == 2 || numbers_seen == 4) {
  ------------------
  |  Branch (12549:13): [True: 15, False: 42]
  |  Branch (12549:34): [True: 7, False: 35]
  ------------------
12550|     22|          ++piece_index;
12551|     22|        }
12552|     57|      }
12553|      8|      if (numbers_seen != 4) [[unlikely]] {
  ------------------
  |  Branch (12553:11): [True: 3, False: 5]
  ------------------
12554|      3|        return is_valid = false;
12555|      3|      }
12556|      5|      break;
12557|      8|    }
12558|       |
12559|  3.02k|    if (length == 0) [[unlikely]] {
  ------------------
  |  Branch (12559:9): [True: 2.87k, False: 152]
  ------------------
12560|  2.87k|      return is_valid = false;
12561|  2.87k|    }
12562|       |
12563|    152|    if (pointer != end && *pointer == ':') {
  ------------------
  |  Branch (12563:9): [True: 148, False: 4]
  |  Branch (12563:27): [True: 138, False: 10]
  ------------------
12564|    138|      ++pointer;
12565|    138|      if (pointer == end) [[unlikely]] {
  ------------------
  |  Branch (12565:11): [True: 1, False: 137]
  ------------------
12566|      1|        return is_valid = false;
12567|      1|      }
12568|    138|    } else if (pointer != end) [[unlikely]] {
  ------------------
  |  Branch (12568:16): [True: 10, False: 4]
  ------------------
12569|     10|      return is_valid = false;
12570|     10|    }
12571|       |
12572|    141|    address[static_cast<size_t>(piece_index)] = value;
12573|    141|    ++piece_index;
12574|    141|  }
12575|       |
12576|     11|  if (compress != -1) {
  ------------------
  |  Branch (12576:7): [True: 6, False: 5]
  ------------------
12577|      6|    const int right = piece_index - compress;
12578|      6|    if (right > 0) {
  ------------------
  |  Branch (12578:9): [True: 4, False: 2]
  ------------------
12579|      4|      const size_t dest = static_cast<size_t>(8 - right);
12580|      4|      const size_t src = static_cast<size_t>(compress);
12581|      4|      if (dest != src) {
  ------------------
  |  Branch (12581:11): [True: 3, False: 1]
  ------------------
12582|     12|        for (size_t i = static_cast<size_t>(right); i-- > 0;) {
  ------------------
  |  Branch (12582:53): [True: 9, False: 3]
  ------------------
12583|      9|          address[dest + i] = address[src + i];
12584|      9|          address[src + i] = 0;
12585|      9|        }
12586|      3|      }
12587|      4|    }
12588|      6|  } else if (piece_index != 8) [[unlikely]] {
  ------------------
  |  Branch (12588:14): [True: 3, False: 2]
  ------------------
12589|      3|    return is_valid = false;
12590|      3|  }
12591|       |
12592|       |  // Serialize once; skip rewrite when hostname is already canonical.
12593|      8|  const std::string serialized = ada::serializers::ipv6(address);
12594|      8|  const std::string_view current = get_hostname();
12595|      8|  if (current.size() == serialized.size() &&
  ------------------
  |  Branch (12595:7): [True: 0, False: 8]
  ------------------
12596|      0|      std::memcmp(current.data(), serialized.data(), serialized.size()) == 0) {
  ------------------
  |  Branch (12596:7): [True: 0, False: 0]
  ------------------
12597|      0|    ada_log("parse_ipv6 in-place canonical match");
12598|      8|  } else {
12599|      8|    update_base_hostname(serialized);
12600|      8|  }
12601|      8|  ada_log("parse_ipv6 ", get_hostname());
12602|      8|  ADA_ASSERT_TRUE(validate());
12603|      8|  host_type = IPV6;
12604|      8|  return true;
12605|     11|}
serializers.cc:_ZZN3ada4idna22utf32_length_from_utf8EPKcmENK3$_0clEa:
  284|  29.5k|  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|  29.5k|    return c > -65;
  288|  29.5k|  });
_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|}
serializers.cc:_ZZN3ada4idna9ascii_mapEPcmENK3$_0clEh:
 5134|  1.01k|  auto broadcast = [](uint8_t v) -> uint64_t {
 5135|  1.01k|    return 0x101010101010101ull * v;
 5136|  1.01k|  };
_ZN3ada4idna13ensure_tablesEv:
 4885|  1.66k|[[nodiscard]] inline bool ensure_tables() noexcept {
 4886|  1.66k|  uint8_t state = tables_init_state.load(std::memory_order_acquire);
 4887|  1.66k|  if (state == kTablesReady) {
  ------------------
  |  Branch (4887:7): [True: 1.66k, False: 1]
  ------------------
 4888|  1.66k|    return true;
 4889|  1.66k|  }
 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|    };
serializers.cc:_ZN3ada4idnaL11idna_lookupEj:
 5072|  46.8k|static uint16_t idna_lookup(uint32_t cp) noexcept {
 5073|  46.8k|  if (cp < IDNA_LOW_RANGE_END) {
  ------------------
  |  Branch (5073:7): [True: 46.8k, False: 48]
  ------------------
 5074|  46.8k|    uint16_t ref = idna_stage1[cp >> IDNA_BLOCK_BITS];
 5075|  46.8k|    if (ref & IDNA_BOOL_FLAG) {
  ------------------
  |  Branch (5075:9): [True: 29.0k, False: 17.7k]
  ------------------
 5076|  29.0k|      uint32_t bit_idx =
 5077|  29.0k|          static_cast<uint32_t>(ref & ~IDNA_BOOL_FLAG) * IDNA_BLOCK_SIZE +
 5078|  29.0k|          (cp & IDNA_BLOCK_MASK);
 5079|  29.0k|      bool is_valid = (idna_bool_blocks[bit_idx >> 6] >> (bit_idx & 63u)) & 1u;
 5080|  29.0k|      return is_valid ? IDNA_VALID : IDNA_DISALLOWED;
  ------------------
  |  Branch (5080:14): [True: 29.0k, False: 4]
  ------------------
 5081|  29.0k|    }
 5082|  17.7k|    return idna_stage2[ref + (cp & IDNA_BLOCK_MASK)];
 5083|  46.8k|  }
 5084|       |
 5085|     48|  if (cp >= IDNA_HIGH_IGNORED_START && cp < IDNA_HIGH_IGNORED_END) {
  ------------------
  |  Branch (5085:7): [True: 28, False: 20]
  |  Branch (5085:40): [True: 20, False: 8]
  ------------------
 5086|     20|    return IDNA_IGNORED;
 5087|     20|  }
 5088|       |
 5089|     28|  return IDNA_DISALLOWED;
 5090|     48|}
serializers.cc:_ZN3ada4idnaL21utf8_count_codepointsEPKh:
 5115|  2.91k|static size_t utf8_count_codepoints(const uint8_t* ptr) noexcept {
 5116|  2.91k|  size_t n = 0;
 5117|  6.62k|  while (*ptr != 0) {
  ------------------
  |  Branch (5117:10): [True: 3.71k, False: 2.91k]
  ------------------
 5118|  3.71k|    ++n;
 5119|  3.71k|    if (*ptr < 0x80u) {
  ------------------
  |  Branch (5119:9): [True: 2.40k, False: 1.30k]
  ------------------
 5120|  2.40k|      ++ptr;
 5121|  2.40k|    } else if (*ptr < 0xE0u) {
  ------------------
  |  Branch (5121:16): [True: 922, False: 387]
  ------------------
 5122|    922|      ptr += 2;
 5123|    922|    } else if (*ptr < 0xF0u) {
  ------------------
  |  Branch (5123:16): [True: 101, False: 286]
  ------------------
 5124|    101|      ptr += 3;
 5125|    286|    } else {
 5126|    286|      ptr += 4;
 5127|    286|    }
 5128|  3.71k|  }
 5129|  2.91k|  return n;
 5130|  2.91k|}
serializers.cc:_ZN3ada4idnaL9utf8_nextERPKh:
 5093|  3.66k|static char32_t utf8_next(const uint8_t*& ptr) noexcept {
 5094|  3.66k|  uint8_t b0 = *ptr++;
 5095|  3.66k|  if (b0 < 0x80u) return static_cast<char32_t>(b0);
  ------------------
  |  Branch (5095:7): [True: 2.37k, False: 1.29k]
  ------------------
 5096|  1.29k|  if (b0 < 0xE0u) {
  ------------------
  |  Branch (5096:7): [True: 904, False: 387]
  ------------------
 5097|    904|    uint32_t cp = (b0 & 0x1Fu) << 6;
 5098|    904|    cp |= (*ptr++ & 0x3Fu);
 5099|    904|    return static_cast<char32_t>(cp);
 5100|    904|  }
 5101|    387|  if (b0 < 0xF0u) {
  ------------------
  |  Branch (5101:7): [True: 101, False: 286]
  ------------------
 5102|    101|    uint32_t cp = (b0 & 0x0Fu) << 12;
 5103|    101|    cp |= ((*ptr++ & 0x3Fu) << 6);
 5104|    101|    cp |= (*ptr++ & 0x3Fu);
 5105|    101|    return static_cast<char32_t>(cp);
 5106|    101|  }
 5107|    286|  uint32_t cp = (b0 & 0x07u) << 18;
 5108|    286|  cp |= ((*ptr++ & 0x3Fu) << 12);
 5109|    286|  cp |= ((*ptr++ & 0x3Fu) << 6);
 5110|    286|  cp |= (*ptr++ & 0x3Fu);
 5111|    286|  return static_cast<char32_t>(cp);
 5112|    387|}
_ZN3ada4idna23decomposition_block_rowEh:
 4989|  21.2k|inline const uint16_t* decomposition_block_row(uint8_t bi) noexcept {
 4990|  21.2k|  if (bi >= kDecompBlockRows) {
  ------------------
  |  Branch (4990:7): [True: 0, False: 21.2k]
  ------------------
 4991|      0|    bi = 0;
 4992|      0|  }
 4993|  21.2k|  return decomposition_block_flat + static_cast<size_t>(bi) * kDecompBlockCols;
 4994|  21.2k|}
_ZN3ada4idna13ccc_block_rowEh:
 4996|  40.2k|inline const uint8_t* ccc_block_row(uint8_t bi) noexcept {
 4997|  40.2k|  if (bi >= kCccBlockRows) {
  ------------------
  |  Branch (4997:7): [True: 0, False: 40.2k]
  ------------------
 4998|      0|    bi = 0;
 4999|      0|  }
 5000|  40.2k|  return ccc_block_flat + static_cast<size_t>(bi) * kCccBlockCols;
 5001|  40.2k|}
_ZN3ada4idna16tables_are_readyEv:
 4880|    637|[[nodiscard]] inline bool tables_are_ready() noexcept {
 4881|    637|  return tables_init_state.load(std::memory_order_acquire) == kTablesReady;
 4882|    637|}
serializers.cc:_ZN3ada4idnaL23canonical_decomp_lengthEDi:
 5272|  20.7k|static size_t canonical_decomp_length(char32_t current_character) noexcept {
 5273|  20.7k|  if (current_character >= hangul_sbase &&
  ------------------
  |  Branch (5273:7): [True: 411, False: 20.3k]
  ------------------
 5274|    411|      current_character < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5274:7): [True: 46, False: 365]
  ------------------
 5275|       |    // Hangul precomposed syllables are NFC.
 5276|     46|    return 0;
 5277|     46|  }
 5278|  20.6k|  if (current_character >= 0x110000) {
  ------------------
  |  Branch (5278:7): [True: 0, False: 20.6k]
  ------------------
 5279|      0|    return 0;
 5280|      0|  }
 5281|  20.6k|  const uint8_t di = decomposition_index[current_character >> 8];
 5282|  20.6k|  const uint16_t* const decomposition =
 5283|  20.6k|      decomposition_block_row(di) + (current_character % 256);
 5284|  20.6k|  size_t decomposition_length =
 5285|  20.6k|      (decomposition[1] >> 2) - (decomposition[0] >> 2);
 5286|  20.6k|  if ((decomposition_length > 0) && (decomposition[0] & 1)) {
  ------------------
  |  Branch (5286:7): [True: 269, False: 20.3k]
  |  Branch (5286:37): [True: 0, False: 269]
  ------------------
 5287|      0|    decomposition_length = 0;  // compatibility-only: ignored for NFC
 5288|      0|  }
 5289|  20.6k|  return decomposition_length;
 5290|  20.6k|}
serializers.cc:_ZN3ada4idnaL13would_composeENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5404|    611|static bool would_compose(std::u32string_view input) noexcept {
 5405|  19.9k|  for (size_t input_count = 0; input_count < input.size();) {
  ------------------
  |  Branch (5405:32): [True: 19.3k, False: 607]
  ------------------
 5406|  19.3k|    const char32_t current = input[input_count];
 5407|  19.3k|    if (current >= hangul_lbase && current < hangul_lbase + hangul_lcount) {
  ------------------
  |  Branch (5407:9): [True: 832, False: 18.4k]
  |  Branch (5407:36): [True: 3, False: 829]
  ------------------
 5408|      3|      if (input_count + 1 < input.size() &&
  ------------------
  |  Branch (5408:11): [True: 2, False: 1]
  ------------------
 5409|      2|          input[input_count + 1] >= hangul_vbase &&
  ------------------
  |  Branch (5409:11): [True: 0, False: 2]
  ------------------
 5410|      0|          input[input_count + 1] < hangul_vbase + hangul_vcount) {
  ------------------
  |  Branch (5410:11): [True: 0, False: 0]
  ------------------
 5411|      0|        return true;
 5412|      0|      }
 5413|      3|      ++input_count;
 5414|      3|      continue;
 5415|      3|    }
 5416|  19.3k|    if (current >= hangul_sbase && current < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5416:9): [True: 222, False: 19.0k]
  |  Branch (5416:36): [True: 46, False: 176]
  ------------------
 5417|     46|      if ((current - hangul_sbase) % hangul_tcount &&
  ------------------
  |  Branch (5417:11): [True: 45, False: 1]
  ------------------
 5418|     45|          input_count + 1 < input.size() &&
  ------------------
  |  Branch (5418:11): [True: 42, False: 3]
  ------------------
 5419|     42|          input[input_count + 1] > hangul_tbase &&
  ------------------
  |  Branch (5419:11): [True: 17, False: 25]
  ------------------
 5420|     17|          input[input_count + 1] < hangul_tbase + hangul_tcount) {
  ------------------
  |  Branch (5420:11): [True: 0, False: 17]
  ------------------
 5421|      0|        return true;
 5422|      0|      }
 5423|     46|      ++input_count;
 5424|     46|      continue;
 5425|     46|    }
 5426|  19.2k|    if (current < 0x110000) {
  ------------------
  |  Branch (5426:9): [True: 19.2k, False: 0]
  ------------------
 5427|  19.2k|      const uint16_t* composition =
 5428|  19.2k|          composition_block_row(composition_index[current >> 8]) +
 5429|  19.2k|          (current % 256);
 5430|  19.2k|      int32_t previous_ccc = -1;
 5431|  19.2k|      size_t j = input_count;
 5432|  19.5k|      for (; j + 1 < input.size(); ++j) {
  ------------------
  |  Branch (5432:14): [True: 18.9k, False: 603]
  ------------------
 5433|  18.9k|        uint8_t ccc = get_ccc(input[j + 1]);
 5434|  18.9k|        if (composition[1] != composition[0] && previous_ccc < ccc) {
  ------------------
  |  Branch (5434:13): [True: 5.86k, False: 13.0k]
  |  Branch (5434:49): [True: 5.85k, False: 13]
  ------------------
 5435|  5.85k|          int left = composition[0];
 5436|  5.85k|          int right = composition[1];
 5437|  5.85k|          if (left < 0 || right < left ||
  ------------------
  |  Branch (5437:15): [True: 0, False: 5.85k]
  |  Branch (5437:27): [True: 0, False: 5.85k]
  ------------------
 5438|  5.85k|              static_cast<size_t>(right) > composition_data_size) {
  ------------------
  |  Branch (5438:15): [True: 0, False: 5.85k]
  ------------------
 5439|      0|            break;
 5440|      0|          }
 5441|  18.5k|          while (left + 2 < right) {
  ------------------
  |  Branch (5441:18): [True: 12.6k, False: 5.85k]
  ------------------
 5442|  12.6k|            int middle = left + (((right - left) >> 1) & ~1);
 5443|  12.6k|            if (composition_data[static_cast<size_t>(middle)] <= input[j + 1]) {
  ------------------
  |  Branch (5443:17): [True: 948, False: 11.7k]
  ------------------
 5444|    948|              left = middle;
 5445|    948|            }
 5446|  12.6k|            if (composition_data[static_cast<size_t>(middle)] >= input[j + 1]) {
  ------------------
  |  Branch (5446:17): [True: 11.7k, False: 948]
  ------------------
 5447|  11.7k|              right = middle;
 5448|  11.7k|            }
 5449|  12.6k|          }
 5450|  5.85k|          if (static_cast<size_t>(left + 1) < composition_data_size &&
  ------------------
  |  Branch (5450:15): [True: 5.85k, False: 0]
  ------------------
 5451|  5.85k|              composition_data[static_cast<size_t>(left)] == input[j + 1]) {
  ------------------
  |  Branch (5451:15): [True: 4, False: 5.84k]
  ------------------
 5452|      4|            return true;
 5453|      4|          }
 5454|  5.85k|        }
 5455|  18.9k|        if (ccc == 0) {
  ------------------
  |  Branch (5455:13): [True: 18.6k, False: 272]
  ------------------
 5456|  18.6k|          break;
 5457|  18.6k|        }
 5458|    272|        previous_ccc = ccc;
 5459|    272|      }
 5460|  19.2k|      input_count = j + 1;
 5461|  19.2k|      continue;
 5462|  19.2k|    }
 5463|      0|    ++input_count;
 5464|      0|  }
 5465|    607|  return false;
 5466|    611|}
_ZN3ada4idna21composition_block_rowEh:
 5003|  19.7k|inline const uint16_t* composition_block_row(uint8_t bi) noexcept {
 5004|  19.7k|  if (bi >= kCompBlockRows) {
  ------------------
  |  Branch (5004:7): [True: 0, False: 19.7k]
  ------------------
 5005|      0|    bi = 0;
 5006|      0|  }
 5007|  19.7k|  return composition_block_flat + static_cast<size_t>(bi) * kCompBlockCols;
 5008|  19.7k|}
serializers.cc:_ZN3ada4idnaL19char_to_digit_valueEc:
 5632|  1.11k|static constexpr int32_t char_to_digit_value(char value) {
 5633|  1.11k|  if (value >= 'a' && value <= 'z') return value - 'a';
  ------------------
  |  Branch (5633:7): [True: 869, False: 243]
  |  Branch (5633:23): [True: 868, False: 1]
  ------------------
 5634|    244|  if (value >= '0' && value <= '9') return value - '0' + 26;
  ------------------
  |  Branch (5634:7): [True: 238, False: 6]
  |  Branch (5634:23): [True: 236, False: 2]
  ------------------
 5635|      8|  return -1;
 5636|    244|}
serializers.cc:_ZN3ada4idnaL5adaptEiib:
 5642|  1.83k|static constexpr int32_t adapt(int32_t d, int32_t n, bool firsttime) {
 5643|  1.83k|  if (firsttime) {
  ------------------
  |  Branch (5643:7): [True: 687, False: 1.14k]
  ------------------
 5644|    687|    d = d / damp;
 5645|  1.14k|  } else {
 5646|  1.14k|    d = d / 2;
 5647|  1.14k|  }
 5648|  1.83k|  d += d / n;
 5649|  1.83k|  int32_t k = 0;
 5650|  2.30k|  while (d > ((base - tmin) * tmax) / 2) {
  ------------------
  |  Branch (5650:10): [True: 469, False: 1.83k]
  ------------------
 5651|    469|    d /= base - tmin;
 5652|    469|    k += base;
 5653|    469|  }
 5654|  1.83k|  return k + (((base - tmin + 1) * d) / (d + skew));
 5655|  1.83k|}
serializers.cc:_ZN3ada4idnaL13digit_to_charEi:
 5638|  3.44k|static constexpr char digit_to_char(int32_t digit) {
 5639|  3.44k|  return digit < 26 ? char(digit + 97) : char(digit + 22);
  ------------------
  |  Branch (5639:10): [True: 2.22k, False: 1.22k]
  ------------------
 5640|  3.44k|}
serializers.cc:_ZZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEEENK3$_0clIA2_jEEDaRKT_:
 5977|  7.33k|      comb_span, label.front(), {}, [](const auto& range) { return range[1]; });
serializers.cc:_ZZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEEENK3$_1clEj:
 6062|  1.10k|      auto is_l_or_d = [](uint32_t code) {
 6063|  1.10k|        return std::ranges::binary_search(L, code) ||
  ------------------
  |  Branch (6063:16): [True: 0, False: 1.10k]
  ------------------
 6064|  1.10k|               std::ranges::binary_search(D, code);
  ------------------
  |  Branch (6064:16): [True: 41, False: 1.06k]
  ------------------
 6065|  1.10k|      };
serializers.cc:_ZZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEEENK3$_2clEj:
 6066|    937|      auto is_r_or_d = [](uint32_t code) {
 6067|    937|        return std::ranges::binary_search(R, code) ||
  ------------------
  |  Branch (6067:16): [True: 1, False: 936]
  ------------------
 6068|    936|               std::ranges::binary_search(D, code);
  ------------------
  |  Branch (6068:16): [True: 8, False: 928]
  ------------------
 6069|    937|      };
serializers.cc:_ZN3ada4idnaL20find_last_not_of_nsmENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5924|    754|    const std::u32string_view label) noexcept {
 5925|    768|  for (int i = static_cast<int>(label.size() - 1); i >= 0; i--)
  ------------------
  |  Branch (5925:52): [True: 768, False: 0]
  ------------------
 5926|    768|    if (find_direction(label[i]) != direction::NSM) return i;
  ------------------
  |  Branch (5926:9): [True: 754, False: 14]
  ------------------
 5927|       |
 5928|      0|  return std::u32string_view::npos;
 5929|    754|}
serializers.cc:_ZN3ada4idnaL12is_rtl_labelENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5933|    754|inline static bool is_rtl_label(const std::u32string_view label) noexcept {
 5934|    754|  const size_t mask =
 5935|    754|      (1u << direction::R) | (1u << direction::AL) | (1u << direction::AN);
 5936|       |
 5937|    754|  size_t directions = 0;
 5938|  10.7k|  for (size_t i = 0; i < label.size(); i++) {
  ------------------
  |  Branch (5938:22): [True: 9.99k, False: 754]
  ------------------
 5939|  9.99k|    directions |= 1u << find_direction(label[i]);
 5940|  9.99k|  }
 5941|    754|  return (directions & mask) != 0;
 5942|    754|}
serializers.cc:_ZN3ada4idnaL14find_directionEj:
 5905|  13.9k|inline static direction find_direction(uint32_t code_point) noexcept {
 5906|       |  // Binary search on dir_final (sorted upper bounds).
 5907|  13.9k|  size_t lo = 0, hi = dir_table_count;
 5908|   158k|  while (lo < hi) {
  ------------------
  |  Branch (5908:10): [True: 144k, False: 13.9k]
  ------------------
 5909|   144k|    size_t mid = lo + (hi - lo) / 2;
 5910|   144k|    if (dir_final[mid] < code_point) {
  ------------------
  |  Branch (5910:9): [True: 44.3k, False: 99.7k]
  ------------------
 5911|  44.3k|      lo = mid + 1;
 5912|  99.7k|    } else {
 5913|  99.7k|      hi = mid;
 5914|  99.7k|    }
 5915|   144k|  }
 5916|  13.9k|  if (lo == dir_table_count) {
  ------------------
  |  Branch (5916:7): [True: 0, False: 13.9k]
  ------------------
 5917|      0|    return direction::NONE;
 5918|      0|  }
 5919|  13.9k|  return code_point >= dir_start[lo] ? static_cast<direction>(dir_value[lo])
  ------------------
  |  Branch (5919:10): [True: 13.9k, False: 3]
  ------------------
 5920|  13.9k|                                     : direction::NONE;
 5921|  13.9k|}
_ZN3ada4idna8is_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6290|  1.22k|bool constexpr is_ascii(std::string_view view) {
 6291|  12.2k|  for (uint8_t c : view) {
  ------------------
  |  Branch (6291:18): [True: 12.2k, False: 337]
  ------------------
 6292|  12.2k|    if (c >= 0x80) {
  ------------------
  |  Branch (6292:9): [True: 883, False: 11.4k]
  ------------------
 6293|    883|      return false;
 6294|    883|    }
 6295|  12.2k|  }
 6296|    337|  return true;
 6297|  1.22k|}
serializers.cc:_ZN3ada4idnaL19from_ascii_to_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEERNS1_12basic_stringIcS4_NS1_9allocatorIcEEEE:
 6327|    337|static void from_ascii_to_ascii(std::string_view ut8_string, std::string& out) {
 6328|    337|  out.assign(ut8_string);
 6329|    337|  ascii_map(out.data(), out.size());
 6330|    337|}
_ZN3ada4idna8is_asciiENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 6281|  2.71k|bool constexpr is_ascii(std::u32string_view view) {
 6282|  21.0k|  for (uint32_t c : view) {
  ------------------
  |  Branch (6282:19): [True: 21.0k, False: 1.21k]
  ------------------
 6283|  21.0k|    if (c >= 0x80) {
  ------------------
  |  Branch (6283:9): [True: 1.49k, False: 19.5k]
  ------------------
 6284|  1.49k|      return false;
 6285|  1.49k|    }
 6286|  21.0k|  }
 6287|  1.21k|  return true;
 6288|  2.71k|}
serializers.cc:_ZN3ada4idnaL13is_ace_prefixENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 6343|  1.97k|static bool is_ace_prefix(std::u32string_view label) noexcept {
 6344|  1.97k|  return label.size() >= 4 && label[0] == U'x' && label[1] == U'n' &&
  ------------------
  |  Branch (6344:10): [True: 1.02k, False: 959]
  |  Branch (6344:31): [True: 118, False: 902]
  |  Branch (6344:51): [True: 116, False: 2]
  ------------------
 6345|    116|         label[2] == U'-' && label[3] == U'-';
  ------------------
  |  Branch (6345:10): [True: 109, False: 7]
  |  Branch (6345:30): [True: 105, False: 4]
  ------------------
 6346|  1.97k|}
serializers.cc:_ZN3ada4idnaL18append_ascii_labelERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIDiNS3_IDiEEEE:
 6333|  1.18k|static void append_ascii_label(std::string& out, std::u32string_view label) {
 6334|  1.18k|  const size_t old = out.size();
 6335|  1.18k|  out.resize(old + label.size());
 6336|  1.18k|  char* dest = out.data() + old;
 6337|  7.31k|  for (char32_t c : label) {
  ------------------
  |  Branch (6337:19): [True: 7.31k, False: 1.18k]
  ------------------
 6338|  7.31k|    *dest++ = static_cast<char>(c);
 6339|  7.31k|  }
 6340|  1.18k|}
_ZN3ada7unicode18is_ascii_hex_digitEc:
 7071|  15.6k|ada_really_inline constexpr bool is_ascii_hex_digit(const char c) noexcept {
 7072|  15.6k|  return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') ||
  ------------------
  |  Branch (7072:11): [True: 14.9k, False: 716]
  |  Branch (7072:23): [True: 7.58k, False: 7.31k]
  |  Branch (7072:37): [True: 7.26k, False: 774]
  |  Branch (7072:49): [True: 6.25k, False: 1.00k]
  ------------------
 7073|  1.78k|         (c >= 'a' && c <= 'f');
  ------------------
  |  Branch (7073:11): [True: 955, False: 826]
  |  Branch (7073:23): [True: 698, False: 257]
  ------------------
 7074|  15.6k|}
_ZN3ada7unicode21convert_hex_to_binaryEc:
 7161|  14.1k|unsigned constexpr convert_hex_to_binary(const char c) noexcept {
 7162|  14.1k|  return hex_to_binary_table[c - '0'];
 7163|  14.1k|}
serializers.cc:_ZZN3ada7unicode14percent_encodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKhENK3$_0clEc:
 7282|  51.3k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7283|  51.3k|    return character_sets::bit_at(character_set, c);
 7284|  51.3k|  });
_ZN3ada7unicode36contains_forbidden_domain_code_pointEPKcm:
 6998|  3.64k|    const char* input, size_t length) noexcept {
 6999|  3.64k|  size_t i = 0;
 7000|  3.64k|  uint8_t accumulator{};
 7001|  27.9k|  for (; i + 4 <= length; i += 4) {
  ------------------
  |  Branch (7001:10): [True: 24.3k, False: 3.64k]
  ------------------
 7002|  24.3k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i])];
 7003|  24.3k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i + 1])];
 7004|  24.3k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i + 2])];
 7005|  24.3k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i + 3])];
 7006|  24.3k|  }
 7007|  8.10k|  for (; i < length; i++) {
  ------------------
  |  Branch (7007:10): [True: 4.45k, False: 3.64k]
  ------------------
 7008|  4.45k|    accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i])];
 7009|  4.45k|  }
 7010|  3.64k|  return accumulator;
 7011|  3.64k|}
serializers.cc:_ZN3ada11serializers12_GLOBAL__N_113write_hex_u16EPct:
 7413|  21.2k|ada_really_inline char* write_hex_u16(char* p, uint16_t v) noexcept {
 7414|  21.2k|  static constexpr char kHex[] = "0123456789abcdef";
 7415|  21.2k|  if (v >= 0x1000) {
  ------------------
  |  Branch (7415:7): [True: 20.2k, False: 1.05k]
  ------------------
 7416|  20.2k|    *p++ = kHex[(v >> 12) & 0xf];
 7417|  20.2k|    *p++ = kHex[(v >> 8) & 0xf];
 7418|  20.2k|    *p++ = kHex[(v >> 4) & 0xf];
 7419|  20.2k|    *p++ = kHex[v & 0xf];
 7420|  20.2k|  } else if (v >= 0x100) {
  ------------------
  |  Branch (7420:14): [True: 324, False: 734]
  ------------------
 7421|    324|    *p++ = kHex[(v >> 8) & 0xf];
 7422|    324|    *p++ = kHex[(v >> 4) & 0xf];
 7423|    324|    *p++ = kHex[v & 0xf];
 7424|    734|  } else if (v >= 0x10) {
  ------------------
  |  Branch (7424:14): [True: 331, False: 403]
  ------------------
 7425|    331|    *p++ = kHex[(v >> 4) & 0xf];
 7426|    331|    *p++ = kHex[v & 0xf];
 7427|    403|  } else {
 7428|    403|    *p++ = kHex[v & 0xf];
 7429|    403|  }
 7430|  21.2k|  return p;
 7431|  21.2k|}
serializers.cc:_ZN3ada11serializers12_GLOBAL__N_18write_u8EPch:
 7399|  13.0k|ada_really_inline char* write_u8(char* p, uint8_t v) noexcept {
 7400|  13.0k|  if (v < 10) {
  ------------------
  |  Branch (7400:7): [True: 2.24k, False: 10.8k]
  ------------------
 7401|  2.24k|    *p++ = static_cast<char>('0' + v);
 7402|  10.8k|  } else if (v < 100) {
  ------------------
  |  Branch (7402:14): [True: 7.25k, False: 3.59k]
  ------------------
 7403|  7.25k|    std::memcpy(p, &digit_pairs[static_cast<size_t>(v) * 2], 2);
 7404|  7.25k|    p += 2;
 7405|  7.25k|  } else {
 7406|  3.59k|    *p++ = static_cast<char>('0' + v / 100);
 7407|  3.59k|    std::memcpy(p, &digit_pairs[static_cast<size_t>(v % 100) * 2], 2);
 7408|  3.59k|    p += 2;
 7409|  3.59k|  }
 7410|  13.0k|  return p;
 7411|  13.0k|}
_ZN3ada7unicode19has_tabs_or_newlineENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6847|  7.97k|    std::string_view user_input) noexcept {
 6848|       |  // first check for short strings in which case we do it naively.
 6849|  7.97k|  if (user_input.size() < 16) {  // slow path
  ------------------
  |  Branch (6849:7): [True: 1.49k, False: 6.48k]
  ------------------
 6850|  1.49k|    return std::ranges::any_of(user_input, is_tabs_or_newline);
 6851|  1.49k|  }
 6852|       |  // fast path for long strings (expected to be common)
 6853|  6.48k|  size_t i = 0;
 6854|  6.48k|  const __m128i mask1 = _mm_set1_epi8('\r');
 6855|  6.48k|  const __m128i mask2 = _mm_set1_epi8('\n');
 6856|  6.48k|  const __m128i mask3 = _mm_set1_epi8('\t');
 6857|       |  // If we supported SSSE3, we could use the algorithm that we use for NEON.
 6858|  6.48k|  __m128i running{0};
 6859|  23.5k|  for (; i + 15 < user_input.size(); i += 16) {
  ------------------
  |  Branch (6859:10): [True: 17.0k, False: 6.48k]
  ------------------
 6860|  17.0k|    __m128i word = _mm_loadu_si128((const __m128i*)(user_input.data() + i));
 6861|  17.0k|    running = _mm_or_si128(
 6862|  17.0k|        _mm_or_si128(running, _mm_or_si128(_mm_cmpeq_epi8(word, mask1),
 6863|  17.0k|                                           _mm_cmpeq_epi8(word, mask2))),
 6864|  17.0k|        _mm_cmpeq_epi8(word, mask3));
 6865|  17.0k|  }
 6866|  6.48k|  if (i < user_input.size()) {
  ------------------
  |  Branch (6866:7): [True: 6.12k, False: 354]
  ------------------
 6867|  6.12k|    __m128i word = _mm_loadu_si128(
 6868|  6.12k|        (const __m128i*)(user_input.data() + user_input.length() - 16));
 6869|  6.12k|    running = _mm_or_si128(
 6870|  6.12k|        _mm_or_si128(running, _mm_or_si128(_mm_cmpeq_epi8(word, mask1),
 6871|  6.12k|                                           _mm_cmpeq_epi8(word, mask2))),
 6872|  6.12k|        _mm_cmpeq_epi8(word, mask3));
 6873|  6.12k|  }
 6874|  6.48k|  return _mm_movemask_epi8(running) != 0;
 6875|  7.97k|}
_ZN3ada7unicode18is_tabs_or_newlineEc:
 6742|  7.90k|constexpr bool is_tabs_or_newline(char c) noexcept {
 6743|  7.90k|  return c == '\r' || c == '\n' || c == '\t';
  ------------------
  |  Branch (6743:10): [True: 43, False: 7.86k]
  |  Branch (6743:23): [True: 11, False: 7.85k]
  |  Branch (6743:36): [True: 12, False: 7.83k]
  ------------------
 6744|  7.90k|}
_ZN3ada7helpers27remove_ascii_tab_or_newlineERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 8054|    211|ada_really_inline void remove_ascii_tab_or_newline(std::string& input) {
 8055|       |  // if this ever becomes a performance issue, we could use an approach similar
 8056|       |  // to has_tabs_or_newline
 8057|    211|  std::erase_if(input, ada::unicode::is_ascii_tab_or_newline);
 8058|    211|}
_ZN3ada7unicode23is_ascii_tab_or_newlineEc:
 7092|  9.73k|    const char c) noexcept {
 7093|  9.73k|  return c == '\t' || c == '\n' || c == '\r';
  ------------------
  |  Branch (7093:10): [True: 220, False: 9.51k]
  |  Branch (7093:23): [True: 178, False: 9.33k]
  |  Branch (7093:36): [True: 259, False: 9.07k]
  ------------------
 7094|  9.73k|}
_ZN3ada7unicode22is_c0_control_or_spaceEc:
 7087|  10.1k|ada_really_inline constexpr bool is_c0_control_or_space(const char c) noexcept {
 7088|  10.1k|  return (unsigned char)c <= ' ';
 7089|  10.1k|}
_ZN3ada7unicode26is_double_dot_path_segmentENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 7100|  2.70k|    std::string_view input) noexcept {
 7101|       |  // This will catch most cases:
 7102|       |  // The length must be 2,4 or 6.
 7103|       |  // We divide by two and require
 7104|       |  // that the result be between 1 and 3 inclusively.
 7105|  2.70k|  uint64_t half_length = uint64_t(input.size()) / 2;
 7106|  2.70k|  if (half_length - 1 > 2) {
  ------------------
  |  Branch (7106:7): [True: 1.85k, False: 853]
  ------------------
 7107|  1.85k|    return false;
 7108|  1.85k|  }
 7109|       |  // We have a string of length 2, 4 or 6.
 7110|       |  // We now check the first character:
 7111|    853|  if ((input[0] != '.') && (input[0] != '%')) {
  ------------------
  |  Branch (7111:7): [True: 458, False: 395]
  |  Branch (7111:28): [True: 253, False: 205]
  ------------------
 7112|    253|    return false;
 7113|    253|  }
 7114|       |  // We are unlikely the get beyond this point.
 7115|    600|  int hash_value = (input.size() + (unsigned)(input[0])) & 3;
 7116|    600|  const std::string_view target = table_is_double_dot_path_segment[hash_value];
 7117|    600|  if (target.size() != input.size()) {
  ------------------
  |  Branch (7117:7): [True: 223, False: 377]
  ------------------
 7118|    223|    return false;
 7119|    223|  }
 7120|       |  // We almost never get here.
 7121|       |  // Optimizing the rest is relatively unimportant.
 7122|    377|  auto prefix_equal_unsafe = [](std::string_view a, std::string_view b) {
 7123|    377|    uint16_t A, B;
 7124|    377|    memcpy(&A, a.data(), sizeof(A));
 7125|    377|    memcpy(&B, b.data(), sizeof(B));
 7126|    377|    return A == B;
 7127|    377|  };
 7128|    377|  if (!prefix_equal_unsafe(input, target)) {
  ------------------
  |  Branch (7128:7): [True: 126, False: 251]
  ------------------
 7129|    126|    return false;
 7130|    126|  }
 7131|    404|  for (size_t i = 2; i < input.size(); i++) {
  ------------------
  |  Branch (7131:22): [True: 185, False: 219]
  ------------------
 7132|    185|    char c = input[i];
 7133|    185|    if ((uint8_t((c | 0x20) - 0x61) <= 25 ? (c | 0x20) : c) != target[i]) {
  ------------------
  |  Branch (7133:9): [True: 32, False: 153]
  |  Branch (7133:10): [True: 80, False: 105]
  ------------------
 7134|     32|      return false;
 7135|     32|    }
 7136|    185|  }
 7137|    219|  return true;
 7138|       |  // The above code might be a bit better than the code below. Compilers
 7139|       |  // are not stupid and may use the fact that these strings have length 2,4 and
 7140|       |  // 6 and other tricks.
 7141|       |  // return input == ".." ||
 7142|       |  //  input == ".%2e" || input == ".%2E" ||
 7143|       |  //  input == "%2e." || input == "%2E." ||
 7144|       |  //  input == "%2e%2e" || input == "%2E%2E" || input == "%2E%2e" || input ==
 7145|       |  //  "%2e%2E";
 7146|    251|}
_ZZN3ada7unicode26is_double_dot_path_segmentENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEENKUlS5_S5_E_clES5_S5_:
 7122|    377|  auto prefix_equal_unsafe = [](std::string_view a, std::string_view b) {
 7123|    377|    uint16_t A, B;
 7124|    377|    memcpy(&A, a.data(), sizeof(A));
 7125|    377|    memcpy(&B, b.data(), sizeof(B));
 7126|    377|    return A == B;
 7127|    377|  };
_ZN3ada7unicode26is_single_dot_path_segmentENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 7149|  4.97k|    std::string_view input) noexcept {
 7150|  4.97k|  return input == "." || input == "%2e" || input == "%2E";
  ------------------
  |  Branch (7150:10): [True: 172, False: 4.79k]
  |  Branch (7150:26): [True: 20, False: 4.77k]
  |  Branch (7150:44): [True: 0, False: 4.77k]
  ------------------
 7151|  4.97k|}
_ZN3ada6detail17parse_ipv4_numberERPKcS2_RmRb:
 9014|  1.03k|                              bool& is_pure_decimal) noexcept {
 9015|  1.03k|  is_pure_decimal = false;
 9016|  1.03k|  if (p >= end) [[unlikely]] {
  ------------------
  |  Branch (9016:7): [True: 0, False: 1.03k]
  ------------------
 9017|      0|    return false;
 9018|      0|  }
 9019|  1.03k|  if (end - p >= 2 && p[0] == '0' && ((p[1] | 0x20) == 'x')) {
  ------------------
  |  Branch (9019:7): [True: 877, False: 153]
  |  Branch (9019:23): [True: 264, False: 613]
  |  Branch (9019:38): [True: 126, False: 138]
  ------------------
 9020|    126|    p += 2;
 9021|    126|    if (p == end || *p == '.') {
  ------------------
  |  Branch (9021:9): [True: 7, False: 119]
  |  Branch (9021:21): [True: 3, False: 116]
  ------------------
 9022|     10|      value = 0;
 9023|     10|      return true;
 9024|     10|    }
 9025|    116|    uint64_t v = 0;
 9026|    116|    int digits = 0;
 9027|    560|    while (p < end && *p != '.') {
  ------------------
  |  Branch (9027:12): [True: 522, False: 38]
  |  Branch (9027:23): [True: 483, False: 39]
  ------------------
 9028|    483|      const uint8_t nib = hex_nibble[static_cast<unsigned char>(*p)];
 9029|    483|      if (nib == 0xff) [[unlikely]] {
  ------------------
  |  Branch (9029:11): [True: 9, False: 474]
  ------------------
 9030|      9|        return false;
 9031|      9|      }
 9032|    474|      if (v > (0xFFFFFFFFULL >> 4)) [[unlikely]] {
  ------------------
  |  Branch (9032:11): [True: 30, False: 444]
  ------------------
 9033|     30|        return false;
 9034|     30|      }
 9035|    444|      v = (v << 4) | nib;
 9036|    444|      ++p;
 9037|    444|      ++digits;
 9038|    444|    }
 9039|     77|    if (digits == 0) [[unlikely]] {
  ------------------
  |  Branch (9039:9): [True: 0, False: 77]
  ------------------
 9040|      0|      return false;
 9041|      0|    }
 9042|     77|    value = v;
 9043|     77|    return true;
 9044|     77|  }
 9045|    904|  if (end - p >= 2 && p[0] == '0' && p[1] >= '0' && p[1] <= '9') {
  ------------------
  |  Branch (9045:7): [True: 751, False: 153]
  |  Branch (9045:23): [True: 138, False: 613]
  |  Branch (9045:38): [True: 87, False: 51]
  |  Branch (9045:53): [True: 79, False: 8]
  ------------------
 9046|     79|    ++p;
 9047|     79|    uint64_t v = 0;
 9048|    879|    while (p < end && *p != '.') {
  ------------------
  |  Branch (9048:12): [True: 841, False: 38]
  |  Branch (9048:23): [True: 809, False: 32]
  ------------------
 9049|    809|      const char c = *p;
 9050|    809|      if (c < '0' || c > '7') [[unlikely]] {
  ------------------
  |  Branch (9050:11): [True: 1, False: 808]
  |  Branch (9050:22): [True: 3, False: 805]
  ------------------
 9051|      4|        return false;
 9052|      4|      }
 9053|    805|      if (v > (0xFFFFFFFFULL >> 3)) [[unlikely]] {
  ------------------
  |  Branch (9053:11): [True: 5, False: 800]
  ------------------
 9054|      5|        return false;
 9055|      5|      }
 9056|    800|      v = (v << 3) | static_cast<uint64_t>(c - '0');
 9057|    800|      ++p;
 9058|    800|    }
 9059|     70|    value = v;
 9060|     70|    return true;
 9061|     79|  }
 9062|    825|  if (*p < '0' || *p > '9') [[unlikely]] {
  ------------------
  |  Branch (9062:7): [True: 72, False: 753]
  |  Branch (9062:19): [True: 183, False: 570]
  ------------------
 9063|    255|    return false;
 9064|    255|  }
 9065|    570|  is_pure_decimal = true;
 9066|    570|  uint64_t v = static_cast<uint64_t>(*p - '0');
 9067|    570|  ++p;
 9068|  1.65k|  while (p < end && *p != '.') {
  ------------------
  |  Branch (9068:10): [True: 1.36k, False: 294]
  |  Branch (9068:21): [True: 1.15k, False: 208]
  ------------------
 9069|  1.15k|    const char c = *p;
 9070|  1.15k|    if (c < '0' || c > '9') [[unlikely]] {
  ------------------
  |  Branch (9070:9): [True: 8, False: 1.14k]
  |  Branch (9070:20): [True: 34, False: 1.11k]
  ------------------
 9071|     42|      return false;
 9072|     42|    }
 9073|  1.11k|    if (v > 429496729ULL) [[unlikely]] {
  ------------------
  |  Branch (9073:9): [True: 24, False: 1.08k]
  ------------------
 9074|     24|      return false;
 9075|     24|    }
 9076|  1.08k|    v = v * 10u + static_cast<uint64_t>(c - '0');
 9077|  1.08k|    if (v > 0xFFFFFFFFULL) [[unlikely]] {
  ------------------
  |  Branch (9077:9): [True: 2, False: 1.08k]
  ------------------
 9078|      2|      return false;
 9079|      2|    }
 9080|  1.08k|    ++p;
 9081|  1.08k|  }
 9082|    502|  value = v;
 9083|    502|  return true;
 9084|    570|}
_ZN3ada6detail15parse_hex_pieceERPKcS2_Rt:
 9088|  3.06k|                           uint16_t& value) noexcept {
 9089|  3.06k|  if (pointer == end) {
  ------------------
  |  Branch (9089:7): [True: 0, False: 3.06k]
  ------------------
 9090|      0|    return 0;
 9091|      0|  }
 9092|  3.06k|  const uint8_t n0 = hex_nibble[static_cast<unsigned char>(*pointer)];
 9093|  3.06k|  if (n0 == 0xff) {
  ------------------
  |  Branch (9093:7): [True: 2.87k, False: 184]
  ------------------
 9094|  2.87k|    return 0;
 9095|  2.87k|  }
 9096|    184|  uint32_t v = n0;
 9097|    184|  ++pointer;
 9098|    184|  int length = 1;
 9099|    184|  if (pointer != end) {
  ------------------
  |  Branch (9099:7): [True: 182, False: 2]
  ------------------
 9100|    182|    const uint8_t n1 = hex_nibble[static_cast<unsigned char>(*pointer)];
 9101|    182|    if (n1 != 0xff) {
  ------------------
  |  Branch (9101:9): [True: 142, False: 40]
  ------------------
 9102|    142|      v = (v << 4) | n1;
 9103|    142|      ++pointer;
 9104|    142|      ++length;
 9105|    142|      if (pointer != end) {
  ------------------
  |  Branch (9105:11): [True: 141, False: 1]
  ------------------
 9106|    141|        const uint8_t n2 = hex_nibble[static_cast<unsigned char>(*pointer)];
 9107|    141|        if (n2 != 0xff) {
  ------------------
  |  Branch (9107:13): [True: 93, False: 48]
  ------------------
 9108|     93|          v = (v << 4) | n2;
 9109|     93|          ++pointer;
 9110|     93|          ++length;
 9111|     93|          if (pointer != end) {
  ------------------
  |  Branch (9111:15): [True: 92, False: 1]
  ------------------
 9112|     92|            const uint8_t n3 = hex_nibble[static_cast<unsigned char>(*pointer)];
 9113|     92|            if (n3 != 0xff) {
  ------------------
  |  Branch (9113:17): [True: 48, False: 44]
  ------------------
 9114|     48|              v = (v << 4) | n3;
 9115|     48|              ++pointer;
 9116|     48|              ++length;
 9117|     48|            }
 9118|     92|          }
 9119|     93|        }
 9120|    141|      }
 9121|    142|    }
 9122|    182|  }
 9123|    184|  value = static_cast<uint16_t>(v);
 9124|    184|  return length;
 9125|  3.06k|}
_ZN3ada8checkers17verify_dns_lengthENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  112|  2.87k|    std::string_view input) noexcept {
  113|  2.87k|  if (input.empty()) return false;
  ------------------
  |  Branch (113:7): [True: 595, False: 2.28k]
  ------------------
  114|  2.28k|  if (input.back() == '.') {
  ------------------
  |  Branch (114:7): [True: 227, False: 2.05k]
  ------------------
  115|    227|    if (input.size() > 254) return false;
  ------------------
  |  Branch (115:9): [True: 0, False: 227]
  ------------------
  116|  2.05k|  } else if (input.size() > 253)
  ------------------
  |  Branch (116:14): [True: 0, False: 2.05k]
  ------------------
  117|      0|    return false;
  118|       |
  119|  2.28k|  size_t start = 0;
  120|  9.02k|  while (start < input.size()) {
  ------------------
  |  Branch (120:10): [True: 7.15k, False: 1.86k]
  ------------------
  121|  7.15k|    auto dot_location = input.find('.', start);
  122|       |    // If not found, it's likely the end of the domain
  123|  7.15k|    if (dot_location == std::string_view::npos) dot_location = input.size();
  ------------------
  |  Branch (123:9): [True: 1.70k, False: 5.44k]
  ------------------
  124|       |
  125|  7.15k|    auto label_size = dot_location - start;
  126|  7.15k|    if (label_size > 63 || label_size == 0) return false;
  ------------------
  |  Branch (126:9): [True: 153, False: 7.00k]
  |  Branch (126:28): [True: 261, False: 6.74k]
  ------------------
  127|       |
  128|  6.74k|    start = dot_location + 1;
  129|  6.74k|  }
  130|       |
  131|  1.86k|  return true;
  132|  2.28k|}
_ZN3ada7unicode13is_alnum_plusEc:
 7064|  20.3k|ada_really_inline constexpr bool is_alnum_plus(const char c) noexcept {
 7065|  20.3k|  return is_alnum_plus_table[uint8_t(c)];
 7066|       |  // A table is almost surely much faster than the
 7067|       |  // following under most compilers: return
 7068|       |  // return (std::isalnum(c) || c == '+' || c == '-' || c == '.');
 7069|  20.3k|}
_ZN3ada7helpers10prune_hashERNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 7994|  5.09k|    std::string_view& input) noexcept {
 7995|       |  // compiles down to 20--30 instructions including a class to memchr (C
 7996|       |  // function). this function should be quite fast.
 7997|  5.09k|  size_t location_of_first = input.find('#');
 7998|  5.09k|  if (location_of_first == std::string_view::npos) {
  ------------------
  |  Branch (7998:7): [True: 4.98k, False: 113]
  ------------------
 7999|  4.98k|    return std::nullopt;
 8000|  4.98k|  }
 8001|    113|  std::string_view hash = input;
 8002|    113|  hash.remove_prefix(location_of_first + 1);
 8003|    113|  input.remove_suffix(input.size() - location_of_first);
 8004|    113|  return hash;
 8005|  5.09k|}
_ZN3ada7helpers32find_authority_delimiter_specialENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8932|  1.40k|find_authority_delimiter_special(std::string_view view) noexcept {
 8933|       |  // performance note: we might be able to gain further performance
 8934|       |  // with SIMD intrinsics.
 8935|  7.97k|  for (auto pos = view.begin(); pos != view.end(); ++pos) {
  ------------------
  |  Branch (8935:33): [True: 7.96k, False: 11]
  ------------------
 8936|  7.96k|    if (authority_delimiter_special[(uint8_t)*pos]) {
  ------------------
  |  Branch (8936:9): [True: 1.39k, False: 6.57k]
  ------------------
 8937|  1.39k|      return pos - view.begin();
 8938|  1.39k|    }
 8939|  7.96k|  }
 8940|     11|  return size_t(view.size());
 8941|  1.40k|}
_ZN3ada7helpers12shorten_pathERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_6scheme4typeE:
 8007|    219|ada_really_inline bool shorten_path(std::string& path, ada::scheme::type type) {
 8008|       |  // Let path be url's path.
 8009|       |  // If url's scheme is "file", path's size is 1, and path[0] is a normalized
 8010|       |  // Windows drive letter, then return.
 8011|    219|  if (type == ada::scheme::type::FILE &&
  ------------------
  |  Branch (8011:7): [True: 0, False: 219]
  ------------------
 8012|      0|      path.find('/', 1) == std::string_view::npos && !path.empty()) {
  ------------------
  |  Branch (8012:7): [True: 0, False: 0]
  |  Branch (8012:54): [True: 0, False: 0]
  ------------------
 8013|      0|    if (checkers::is_normalized_windows_drive_letter(
  ------------------
  |  Branch (8013:9): [True: 0, False: 0]
  ------------------
 8014|      0|            helpers::substring(path, 1))) {
 8015|      0|      return false;
 8016|      0|    }
 8017|      0|  }
 8018|       |
 8019|       |  // Remove path's last item, if any.
 8020|    219|  size_t last_delimiter = path.rfind('/');
 8021|    219|  if (last_delimiter != std::string::npos) {
  ------------------
  |  Branch (8021:7): [True: 143, False: 76]
  ------------------
 8022|    143|    path.erase(last_delimiter);
 8023|    143|    return true;
 8024|    143|  }
 8025|       |
 8026|     76|  return false;
 8027|    219|}
_ZN3ada7helpers27get_host_delimiter_locationEbRNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8645|  5.09k|    const bool is_special, std::string_view& view) noexcept {
 8646|       |  /**
 8647|       |   * The spec at https://url.spec.whatwg.org/#hostname-state expects us to
 8648|       |   * compute a variable called insideBrackets but this variable is only used
 8649|       |   * once, to check whether a ':' character was found outside brackets. Exact
 8650|       |   * text: "Otherwise, if c is U+003A (:) and insideBrackets is false, then:".
 8651|       |   * It is conceptually simpler and arguably more efficient to just return a
 8652|       |   * Boolean indicating whether ':' was found outside brackets.
 8653|       |   */
 8654|  5.09k|  const size_t view_size = view.size();
 8655|  5.09k|  size_t location = 0;
 8656|  5.09k|  bool found_colon = false;
 8657|       |  /**
 8658|       |   * Performance analysis:
 8659|       |   *
 8660|       |   * We are basically seeking the end of the hostname which can be indicated
 8661|       |   * by the end of the view, or by one of the characters ':', '/', '?', '\\'
 8662|       |   * (where '\\' is only applicable for special URLs). However, these must
 8663|       |   * appear outside a bracket range. E.g., if you have [something?]fd: then the
 8664|       |   * '?' does not count.
 8665|       |   *
 8666|       |   * So we can skip ahead to the next delimiter, as long as we include '[' in
 8667|       |   * the set of delimiters, and that we handle it first.
 8668|       |   *
 8669|       |   * So the trick is to have a fast function that locates the next delimiter.
 8670|       |   * Unless we find '[', then it only needs to be called once! Ideally, such a
 8671|       |   * function would be provided by the C++ standard library, but it seems that
 8672|       |   * find_first_of is not very fast, so we are forced to roll our own.
 8673|       |   *
 8674|       |   * We do not break into two loops for speed, but for clarity.
 8675|       |   */
 8676|  5.09k|  if (is_special) {
  ------------------
  |  Branch (8676:7): [True: 5.09k, False: 0]
  ------------------
 8677|       |    // We move to the next delimiter.
 8678|  5.09k|    location = find_next_host_delimiter_special(view, location);
 8679|       |    // Unless we find '[' then we are going only going to have to call
 8680|       |    // find_next_host_delimiter_special once.
 8681|  8.21k|    for (; location < view_size;
  ------------------
  |  Branch (8681:12): [True: 8.16k, False: 46]
  ------------------
 8682|  8.16k|         location = find_next_host_delimiter_special(view, location)) {
 8683|  8.16k|      if (view[location] == '[') {
  ------------------
  |  Branch (8683:11): [True: 3.15k, False: 5.01k]
  ------------------
 8684|  3.15k|        location = view.find(']', location);
 8685|  3.15k|        if (location == std::string_view::npos) {
  ------------------
  |  Branch (8685:13): [True: 38, False: 3.12k]
  ------------------
 8686|       |          // performance: view.find might get translated to a memchr, which
 8687|       |          // has no notion of std::string_view::npos, so the code does not
 8688|       |          // reflect the assembly.
 8689|     38|          location = view_size;
 8690|     38|          break;
 8691|     38|        }
 8692|  5.01k|      } else {
 8693|  5.01k|        found_colon = view[location] == ':';
 8694|  5.01k|        break;
 8695|  5.01k|      }
 8696|  8.16k|    }
 8697|  5.09k|  } else {
 8698|       |    // We move to the next delimiter.
 8699|      0|    location = find_next_host_delimiter(view, location);
 8700|       |    // Unless we find '[' then we are going only going to have to call
 8701|       |    // find_next_host_delimiter_special once.
 8702|      0|    for (; location < view_size;
  ------------------
  |  Branch (8702:12): [True: 0, False: 0]
  ------------------
 8703|      0|         location = find_next_host_delimiter(view, location)) {
 8704|      0|      if (view[location] == '[') {
  ------------------
  |  Branch (8704:11): [True: 0, False: 0]
  ------------------
 8705|      0|        location = view.find(']', location);
 8706|      0|        if (location == std::string_view::npos) {
  ------------------
  |  Branch (8706:13): [True: 0, False: 0]
  ------------------
 8707|       |          // performance: view.find might get translated to a memchr, which
 8708|       |          // has no notion of std::string_view::npos, so the code does not
 8709|       |          // reflect the assembly.
 8710|      0|          location = view_size;
 8711|      0|          break;
 8712|      0|        }
 8713|      0|      } else {
 8714|      0|        found_colon = view[location] == ':';
 8715|      0|        break;
 8716|      0|      }
 8717|      0|    }
 8718|      0|  }
 8719|       |  // performance: remove_suffix may translate into a single instruction.
 8720|  5.09k|  view.remove_suffix(view_size - location);
 8721|  5.09k|  return {location, found_colon};
 8722|  5.09k|}
_ZN3ada7helpers32find_next_host_delimiter_specialENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEm:
 8222|  8.21k|    std::string_view view, size_t location) noexcept {
 8223|       |  // first check for short strings in which case we do it naively.
 8224|  8.21k|  if (view.size() - location < 16) {  // slow path
  ------------------
  |  Branch (8224:7): [True: 3.80k, False: 4.40k]
  ------------------
 8225|  13.8k|    for (size_t i = location; i < view.size(); i++) {
  ------------------
  |  Branch (8225:31): [True: 13.7k, False: 40]
  ------------------
 8226|  13.7k|      if (view[i] == ':' || view[i] == '/' || view[i] == '\\' ||
  ------------------
  |  Branch (8226:11): [True: 147, False: 13.6k]
  |  Branch (8226:29): [True: 3.38k, False: 10.2k]
  |  Branch (8226:47): [True: 23, False: 10.2k]
  ------------------
 8227|  10.2k|          view[i] == '?' || view[i] == '[') {
  ------------------
  |  Branch (8227:11): [True: 8, False: 10.2k]
  |  Branch (8227:29): [True: 203, False: 10.0k]
  ------------------
 8228|  3.76k|        return i;
 8229|  3.76k|      }
 8230|  13.7k|    }
 8231|     40|    return size_t(view.size());
 8232|  3.80k|  }
 8233|       |  // fast path for long strings (expected to be common)
 8234|  4.40k|  size_t i = location;
 8235|  4.40k|  const __m128i mask1 = _mm_set1_epi8(':');
 8236|  4.40k|  const __m128i mask2 = _mm_set1_epi8('/');
 8237|  4.40k|  const __m128i mask3 = _mm_set1_epi8('\\');
 8238|  4.40k|  const __m128i mask4 = _mm_set1_epi8('?');
 8239|  4.40k|  const __m128i mask5 = _mm_set1_epi8('[');
 8240|       |
 8241|  6.06k|  for (; i + 15 < view.size(); i += 16) {
  ------------------
  |  Branch (8241:10): [True: 5.45k, False: 612]
  ------------------
 8242|  5.45k|    __m128i word = _mm_loadu_si128((const __m128i*)(view.data() + i));
 8243|  5.45k|    __m128i m1 = _mm_cmpeq_epi8(word, mask1);
 8244|  5.45k|    __m128i m2 = _mm_cmpeq_epi8(word, mask2);
 8245|  5.45k|    __m128i m3 = _mm_cmpeq_epi8(word, mask3);
 8246|  5.45k|    __m128i m4 = _mm_cmpeq_epi8(word, mask4);
 8247|  5.45k|    __m128i m5 = _mm_cmpeq_epi8(word, mask5);
 8248|  5.45k|    __m128i m = _mm_or_si128(
 8249|  5.45k|        _mm_or_si128(_mm_or_si128(m1, m2), _mm_or_si128(m3, m4)), m5);
 8250|  5.45k|    int mask = _mm_movemask_epi8(m);
 8251|  5.45k|    if (mask != 0) {
  ------------------
  |  Branch (8251:9): [True: 3.79k, False: 1.66k]
  ------------------
 8252|  3.79k|      return i + trailing_zeroes(mask);
 8253|  3.79k|    }
 8254|  5.45k|  }
 8255|    612|  if (i < view.size()) {
  ------------------
  |  Branch (8255:7): [True: 609, False: 3]
  ------------------
 8256|    609|    __m128i word =
 8257|    609|        _mm_loadu_si128((const __m128i*)(view.data() + view.length() - 16));
 8258|    609|    __m128i m1 = _mm_cmpeq_epi8(word, mask1);
 8259|    609|    __m128i m2 = _mm_cmpeq_epi8(word, mask2);
 8260|    609|    __m128i m3 = _mm_cmpeq_epi8(word, mask3);
 8261|    609|    __m128i m4 = _mm_cmpeq_epi8(word, mask4);
 8262|    609|    __m128i m5 = _mm_cmpeq_epi8(word, mask5);
 8263|    609|    __m128i m = _mm_or_si128(
 8264|    609|        _mm_or_si128(_mm_or_si128(m1, m2), _mm_or_si128(m3, m4)), m5);
 8265|    609|    int mask = _mm_movemask_epi8(m);
 8266|    609|    if (mask != 0) {
  ------------------
  |  Branch (8266:9): [True: 606, False: 3]
  ------------------
 8267|    606|      return view.length() - 16 + trailing_zeroes(mask);
 8268|    606|    }
 8269|    609|  }
 8270|      6|  return size_t(view.length());
 8271|    612|}
_ZN3ada7helpers15trailing_zeroesEj:
 8075|  4.40k|ada_really_inline int trailing_zeroes(uint32_t input_num) noexcept {
 8076|       |#ifdef ADA_REGULAR_VISUAL_STUDIO
 8077|       |  unsigned long ret;
 8078|       |  // Search the mask data from least significant bit (LSB)
 8079|       |  // to the most significant bit (MSB) for a set bit (1).
 8080|       |  _BitScanForward(&ret, input_num);
 8081|       |  return (int)ret;
 8082|       |#else   // ADA_REGULAR_VISUAL_STUDIO
 8083|  4.40k|  return __builtin_ctzl(input_num);
 8084|  4.40k|#endif  // ADA_REGULAR_VISUAL_STUDIO
 8085|  4.40k|}
_ZN3ada7unicode30is_forbidden_domain_code_pointEc:
 6993|  12.6k|    const char c) noexcept {
 6994|  12.6k|  return is_forbidden_domain_code_point_table[uint8_t(c)];
 6995|  12.6k|}
serializers.cc:_ZN12_GLOBAL__N_132apply_shifted_non_scheme_offsetsERN3ada14url_componentsEj:
11430|  5.09k|    ada::url_components& components, uint32_t new_difference) {
11431|  5.09k|  components.username_end += new_difference;
11432|  5.09k|  components.host_start += new_difference;
11433|  5.09k|  components.host_end += new_difference;
11434|  5.09k|  components.pathname_start += new_difference;
11435|  5.09k|  if (components.search_start != ada::url_components::omitted) {
  ------------------
  |  Branch (11435:7): [True: 0, False: 5.09k]
  ------------------
11436|      0|    components.search_start += new_difference;
11437|      0|  }
11438|  5.09k|  if (components.hash_start != ada::url_components::omitted) {
  ------------------
  |  Branch (11438:7): [True: 0, False: 5.09k]
  ------------------
11439|      0|    components.hash_start += new_difference;
11440|      0|  }
11441|  5.09k|}
_ZN3ada14url_aggregator10parse_hostENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
11890|  5.09k|ada_really_inline bool url_aggregator::parse_host(std::string_view input) {
11891|  5.09k|  ada_log("url_aggregator:parse_host \"", input, "\" [", input.size(),
11892|  5.09k|          " bytes]");
11893|  5.09k|  ADA_ASSERT_TRUE(validate());
11894|  5.09k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
11895|  5.09k|  if (input.empty()) {
  ------------------
  |  Branch (11895:7): [True: 1, False: 5.09k]
  ------------------
11896|      1|    return is_valid = false;
11897|      1|  }  // technically unnecessary.
11898|       |  // If input starts with U+005B ([), then:
11899|  5.09k|  if (input[0] == '[') {
  ------------------
  |  Branch (11899:7): [True: 2.95k, False: 2.14k]
  ------------------
11900|       |    // If input does not end with U+005D (]), validation error, return failure.
11901|  2.95k|    if (input.back() != ']') {
  ------------------
  |  Branch (11901:9): [True: 16, False: 2.93k]
  ------------------
11902|     16|      return is_valid = false;
11903|     16|    }
11904|  2.93k|    ada_log("parse_host ipv6");
11905|       |
11906|       |    // Return the result of IPv6 parsing input with its leading U+005B ([) and
11907|       |    // trailing U+005D (]) removed.
11908|  2.93k|    input.remove_prefix(1);
11909|  2.93k|    input.remove_suffix(1);
11910|  2.93k|    return parse_ipv6(input);
11911|  2.95k|  }
11912|       |
11913|       |  // If isNotSpecial is true, then return the result of opaque-host parsing
11914|       |  // input.
11915|  2.14k|  if (!is_special()) {
  ------------------
  |  Branch (11915:7): [True: 0, False: 2.14k]
  ------------------
11916|      0|    return parse_opaque_host(input);
11917|      0|  }
11918|       |  // Let domain be the result of running UTF-8 decode without BOM on the
11919|       |  // percent-decoding of input. Let asciiDomain be the result of running domain
11920|       |  // to ASCII with domain and false. The most common case is an ASCII input, in
11921|       |  // which case we do not need to call the expensive 'to_ascii' if a few
11922|       |  // conditions are met: no '%' and no 'xn-' subsequence.
11923|       |
11924|       |  // Often, the input does not contain any forbidden code points, and no upper
11925|       |  // case ASCII letter, then we can just copy it to the buffer. We want to
11926|       |  // optimize for such a common case.
11927|       |
11928|       |  // Fast path: try to parse as pure decimal IPv4(a.b.c.d) first.
11929|  2.14k|  const uint64_t fast_result = checkers::try_parse_ipv4_fast(input);
11930|  2.14k|  if (fast_result < checkers::ipv4_fast_fail) {
  ------------------
  |  Branch (11930:7): [True: 156, False: 1.98k]
  ------------------
11931|       |    // Fast path succeeded - input is pure decimal IPv4
11932|    156|    if (!input.empty() && input.back() == '.') {
  ------------------
  |  Branch (11932:9): [True: 156, False: 0]
  |  Branch (11932:27): [True: 2, False: 154]
  ------------------
11933|      2|      update_base_hostname(input.substr(0, input.size() - 1));
11934|    154|    } else {
11935|    154|      update_base_hostname(input);
11936|    154|    }
11937|    156|    host_type = IPV4;
11938|    156|    is_valid = true;
11939|    156|    ada_log("parse_host fast path decimal ipv4");
11940|    156|    ADA_ASSERT_TRUE(validate());
11941|    156|    return true;
11942|    156|  }
11943|  1.98k|  uint8_t is_forbidden_or_upper =
11944|  1.98k|      unicode::contains_forbidden_domain_code_point_or_upper(input.data(),
11945|  1.98k|                                                             input.size());
11946|       |  // Minor optimization opportunity:
11947|       |  // contains_forbidden_domain_code_point_or_upper could be extend to check for
11948|       |  // the presence of characters that cannot appear in the ipv4 address and we
11949|       |  // could also check whether x and n and - are present, and so we could skip
11950|       |  // some of the checks below. However, the gains are likely to be small, and
11951|       |  // the code would be more complex.
11952|  1.98k|  static constexpr std::string_view xn_dash{"xn-", 3};
11953|  1.98k|  if (is_forbidden_or_upper == 0 &&
  ------------------
  |  Branch (11953:7): [True: 784, False: 1.20k]
  ------------------
11954|    784|      input.find(xn_dash) == std::string_view::npos) {
  ------------------
  |  Branch (11954:7): [True: 764, False: 20]
  ------------------
11955|       |    // fast path
11956|    764|    update_base_hostname(input);
11957|       |
11958|       |    // Check for other IPv4 formats (hex, octal, etc.)
11959|    764|    if (checkers::is_ipv4(get_hostname())) {
  ------------------
  |  Branch (11959:9): [True: 535, False: 229]
  ------------------
11960|    535|      ada_log("parse_host fast path ipv4");
11961|    535|      return parse_ipv4(get_hostname(), true);
11962|    535|    }
11963|    229|    ada_log("parse_host fast path ", get_hostname());
11964|    229|    is_valid = true;
11965|    229|    return true;
11966|    764|  }
11967|       |  // We have encountered at least one forbidden code point or the input contains
11968|       |  // 'xn-' (case insensitive), so we need to call 'to_ascii' to perform the full
11969|       |  // conversion.
11970|       |
11971|  1.22k|  ada_log("parse_host calling to_ascii");
11972|  1.22k|  std::optional<std::string> host = std::string(get_hostname());
11973|  1.22k|  is_valid = ada::unicode::to_ascii(host, input, input.find('%'));
11974|  1.22k|  if (!is_valid) {
  ------------------
  |  Branch (11974:7): [True: 639, False: 581]
  ------------------
11975|    639|    ada_log("parse_host to_ascii returns false");
11976|    639|    return is_valid = false;
11977|    639|  }
11978|    581|  ada_log("parse_host to_ascii succeeded ", *host, " [", host->size(),
11979|    581|          " bytes]");
11980|       |
11981|    581|  if (std::ranges::any_of(host.value(),
  ------------------
  |  Branch (11981:7): [True: 0, False: 581]
  ------------------
11982|    581|                          ada::unicode::is_forbidden_domain_code_point)) {
11983|      0|    return is_valid = false;
11984|      0|  }
11985|       |
11986|       |  // If asciiDomain ends in a number, then return the result of IPv4 parsing
11987|       |  // asciiDomain.
11988|    581|  if (checkers::is_ipv4(host.value())) {
  ------------------
  |  Branch (11988:7): [True: 244, False: 337]
  ------------------
11989|    244|    ada_log("parse_host got ipv4 ", *host);
11990|    244|    return parse_ipv4(host.value(), false);
11991|    244|  }
11992|       |
11993|    337|  update_base_hostname(host.value());
11994|    337|  ADA_ASSERT_TRUE(validate());
11995|    337|  return true;
11996|    581|}
_ZN3ada14url_aggregator21consume_prepared_pathENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
12803|    866|inline void url_aggregator::consume_prepared_path(std::string_view input) {
12804|    866|  ada_log("url_aggregator::consume_prepared_path ", input);
12805|       |  /***
12806|       |   * This is largely duplicated code from helpers::parse_prepared_path, which is
12807|       |   * unfortunate. This particular function is nearly identical, except that it
12808|       |   * is a method on url_aggregator. The idea is that the trivial path (which is
12809|       |   * very common) merely appends to the buffer. This is the same trivial path as
12810|       |   * with helpers::parse_prepared_path, except that we have the additional check
12811|       |   * for is_at_path(). Otherwise, we grab a copy of the current path and we
12812|       |   * modify it, and then insert it back into the buffer.
12813|       |   */
12814|    866|  uint8_t accumulator = checkers::path_signature(input);
12815|       |  // Let us first detect a trivial case.
12816|       |  // If it is special, we check that we have no dot, no %,  no \ and no
12817|       |  // character needing percent encoding. Otherwise, we check that we have no %,
12818|       |  // no dot, and no character needing percent encoding.
12819|    866|  constexpr uint8_t need_encoding = 1;
12820|    866|  constexpr uint8_t backslash_char = 2;
12821|    866|  constexpr uint8_t dot_char = 4;
12822|    866|  constexpr uint8_t percent_char = 8;
12823|    866|  bool special = type != ada::scheme::NOT_SPECIAL;
12824|    866|  bool may_need_slow_file_handling = (type == ada::scheme::type::FILE &&
  ------------------
  |  Branch (12824:39): [True: 0, False: 866]
  ------------------
12825|      0|                                      checkers::is_windows_drive_letter(input));
  ------------------
  |  Branch (12825:39): [True: 0, False: 0]
  ------------------
12826|    866|  bool trivial_path =
12827|    866|      (special ? (accumulator == 0)
  ------------------
  |  Branch (12827:7): [True: 360, False: 506]
  |  Branch (12827:8): [True: 866, False: 0]
  ------------------
12828|    866|               : ((accumulator & (need_encoding | dot_char | percent_char)) ==
12829|      0|                  0)) &&
12830|    360|      (!may_need_slow_file_handling);
  ------------------
  |  Branch (12830:7): [True: 360, False: 0]
  ------------------
12831|    866|  if (accumulator == dot_char && !may_need_slow_file_handling) {
  ------------------
  |  Branch (12831:7): [True: 208, False: 658]
  |  Branch (12831:34): [True: 208, False: 0]
  ------------------
12832|       |    // '4' means that we have at least one dot, but nothing that requires
12833|       |    // percent encoding or decoding. The only part that is not trivial is
12834|       |    // that we may have single dots and double dots path segments.
12835|       |    // If we have such segments, then we either have a path that begins
12836|       |    // with '.' (easy to check), or we have the sequence './'.
12837|       |    // Note: input cannot be empty, it must at least contain one character ('.')
12838|       |    // Note: we know that '\' is not present.
12839|    208|    if (input[0] != '.') {
  ------------------
  |  Branch (12839:9): [True: 152, False: 56]
  ------------------
12840|    152|      size_t slashdot = 0;
12841|    152|      bool dot_is_file = true;
12842|    693|      for (;;) {
12843|    693|        slashdot = input.find("/.", slashdot);
12844|    693|        if (slashdot == std::string_view::npos) {  // common case
  ------------------
  |  Branch (12844:13): [True: 152, False: 541]
  ------------------
12845|    152|          break;
12846|    541|        } else {  // uncommon
12847|       |          // only three cases matter: /./, /.. or a final /
12848|    541|          slashdot += 2;
12849|    541|          dot_is_file &= !(slashdot == input.size() || input[slashdot] == '.' ||
  ------------------
  |  Branch (12849:28): [True: 1, False: 540]
  |  Branch (12849:56): [True: 243, False: 297]
  ------------------
12850|    297|                           input[slashdot] == '/');
  ------------------
  |  Branch (12850:28): [True: 147, False: 150]
  ------------------
12851|    541|        }
12852|    693|      }
12853|    152|      trivial_path = dot_is_file;
12854|    152|    }
12855|    208|  }
12856|    866|  if (trivial_path && is_at_path()) {
  ------------------
  |  Branch (12856:7): [True: 413, False: 453]
  |  Branch (12856:23): [True: 413, False: 0]
  ------------------
12857|    413|    ada_log("parse_path trivial");
12858|    413|    buffer += '/';
12859|    413|    buffer += input;
12860|    413|    return;
12861|    413|  }
12862|    453|  std::string path = std::string(get_pathname());
12863|       |  // We are going to need to look a bit at the path, but let us see if we can
12864|       |  // ignore percent encoding *and* backslashes *and* percent characters.
12865|       |  // Except for the trivial case, this is likely to capture 99% of paths out
12866|       |  // there.
12867|    453|  bool fast_path =
12868|    453|      (special &&
  ------------------
  |  Branch (12868:8): [True: 453, False: 0]
  ------------------
12869|    453|       (accumulator & (need_encoding | backslash_char | percent_char)) == 0) &&
  ------------------
  |  Branch (12869:8): [True: 155, False: 298]
  ------------------
12870|    155|      (type != ada::scheme::type::FILE);
  ------------------
  |  Branch (12870:7): [True: 155, False: 0]
  ------------------
12871|    453|  if (fast_path) {
  ------------------
  |  Branch (12871:7): [True: 155, False: 298]
  ------------------
12872|    155|    ada_log("parse_prepared_path fast");
12873|       |    // Here we don't need to worry about \ or percent encoding.
12874|       |    // We also do not have a file protocol. We might have dots, however,
12875|       |    // but dots must as appear as '.', and they cannot be encoded because
12876|       |    // the symbol '%' is not present.
12877|    155|    size_t previous_location = 0;  // We start at 0.
12878|  1.84k|    do {
12879|  1.84k|      size_t new_location = input.find('/', previous_location);
12880|       |      // std::string_view path_view = input;
12881|       |      //  We process the last segment separately:
12882|  1.84k|      if (new_location == std::string_view::npos) {
  ------------------
  |  Branch (12882:11): [True: 155, False: 1.68k]
  ------------------
12883|    155|        std::string_view path_view = input.substr(previous_location);
12884|    155|        if (path_view == "..") {  // The path ends with ..
  ------------------
  |  Branch (12884:13): [True: 26, False: 129]
  ------------------
12885|       |          // e.g., if you receive ".." with an empty path, you go to "/".
12886|     26|          if (path.empty()) {
  ------------------
  |  Branch (12886:15): [True: 7, False: 19]
  ------------------
12887|      7|            path = '/';
12888|      7|            update_base_pathname(path);
12889|      7|            return;
12890|      7|          }
12891|       |          // Fast case where we have nothing to do:
12892|     19|          if (path.back() == '/') {
  ------------------
  |  Branch (12892:15): [True: 4, False: 15]
  ------------------
12893|      4|            update_base_pathname(path);
12894|      4|            return;
12895|      4|          }
12896|       |          // If you have the path "/joe/myfriend",
12897|       |          // then you delete 'myfriend'.
12898|     15|          path.resize(path.rfind('/') + 1);
12899|     15|          update_base_pathname(path);
12900|     15|          return;
12901|     19|        }
12902|    129|        path += '/';
12903|    129|        if (path_view != ".") {
  ------------------
  |  Branch (12903:13): [True: 128, False: 1]
  ------------------
12904|    128|          path.append(path_view);
12905|    128|        }
12906|    129|        update_base_pathname(path);
12907|    129|        return;
12908|  1.68k|      } else {
12909|       |        // This is a non-final segment.
12910|  1.68k|        std::string_view path_view =
12911|  1.68k|            input.substr(previous_location, new_location - previous_location);
12912|  1.68k|        previous_location = new_location + 1;
12913|  1.68k|        if (path_view == "..") {
  ------------------
  |  Branch (12913:13): [True: 181, False: 1.50k]
  ------------------
12914|    181|          size_t last_delimiter = path.rfind('/');
12915|    181|          if (last_delimiter != std::string::npos) {
  ------------------
  |  Branch (12915:15): [True: 118, False: 63]
  ------------------
12916|    118|            path.erase(last_delimiter);
12917|    118|          }
12918|  1.50k|        } else if (path_view != ".") {
  ------------------
  |  Branch (12918:20): [True: 1.30k, False: 203]
  ------------------
12919|  1.30k|          path += '/';
12920|  1.30k|          path.append(path_view);
12921|  1.30k|        }
12922|  1.68k|      }
12923|  1.84k|    } while (true);
  ------------------
  |  Branch (12923:14): [True: 1.68k, Folded]
  ------------------
12924|    298|  } else {
12925|    298|    ada_log("parse_path slow");
12926|       |    // we have reached the general case
12927|    298|    bool needs_percent_encoding = (accumulator & 1);
12928|    298|    std::string path_buffer_tmp;
12929|  2.70k|    do {
12930|  2.70k|      size_t location = (special && (accumulator & 2))
  ------------------
  |  Branch (12930:26): [True: 2.70k, False: 0]
  |  Branch (12930:37): [True: 589, False: 2.11k]
  ------------------
12931|  2.70k|                            ? input.find_first_of("/\\")
12932|  2.70k|                            : input.find('/');
12933|  2.70k|      std::string_view path_view = input;
12934|  2.70k|      if (location != std::string_view::npos) {
  ------------------
  |  Branch (12934:11): [True: 2.40k, False: 298]
  ------------------
12935|  2.40k|        path_view.remove_suffix(path_view.size() - location);
12936|  2.40k|        input.remove_prefix(location + 1);
12937|  2.40k|      }
12938|       |      // path_buffer is either path_view or it might point at a percent encoded
12939|       |      // temporary string.
12940|  2.70k|      std::string_view path_buffer =
12941|  2.70k|          (needs_percent_encoding &&
  ------------------
  |  Branch (12941:12): [True: 2.55k, False: 157]
  ------------------
12942|  2.55k|           ada::unicode::percent_encode<false>(
  ------------------
  |  Branch (12942:12): [True: 657, False: 1.89k]
  ------------------
12943|  2.55k|               path_view, character_sets::PATH_PERCENT_ENCODE, path_buffer_tmp))
12944|  2.70k|              ? path_buffer_tmp
12945|  2.70k|              : path_view;
12946|  2.70k|      if (unicode::is_double_dot_path_segment(path_buffer)) {
  ------------------
  |  Branch (12946:11): [True: 219, False: 2.48k]
  ------------------
12947|    219|        helpers::shorten_path(path, type);
12948|    219|        if (location == std::string_view::npos) {
  ------------------
  |  Branch (12948:13): [True: 10, False: 209]
  ------------------
12949|     10|          path += '/';
12950|     10|        }
12951|  2.48k|      } else if (unicode::is_single_dot_path_segment(path_buffer) &&
  ------------------
  |  Branch (12951:18): [True: 99, False: 2.38k]
  ------------------
12952|     99|                 (location == std::string_view::npos)) {
  ------------------
  |  Branch (12952:18): [True: 6, False: 93]
  ------------------
12953|      6|        path += '/';
12954|      6|      }
12955|       |      // Otherwise, if path_buffer is not a single-dot path segment, then:
12956|  2.48k|      else if (!unicode::is_single_dot_path_segment(path_buffer)) {
  ------------------
  |  Branch (12956:16): [True: 2.38k, False: 93]
  ------------------
12957|       |        // If url's scheme is "file", url's path is empty, and path_buffer is a
12958|       |        // Windows drive letter, then replace the second code point in
12959|       |        // path_buffer with U+003A (:).
12960|  2.38k|        if (type == ada::scheme::type::FILE && path.empty() &&
  ------------------
  |  Branch (12960:13): [True: 0, False: 2.38k]
  |  Branch (12960:48): [True: 0, False: 0]
  ------------------
12961|      0|            checkers::is_windows_drive_letter(path_buffer)) {
  ------------------
  |  Branch (12961:13): [True: 0, False: 0]
  ------------------
12962|      0|          path += '/';
12963|      0|          path += path_buffer[0];
12964|      0|          path += ':';
12965|      0|          path_buffer.remove_prefix(2);
12966|      0|          path.append(path_buffer);
12967|  2.38k|        } else {
12968|       |          // Append path_buffer to url's path.
12969|  2.38k|          path += '/';
12970|  2.38k|          path.append(path_buffer);
12971|  2.38k|        }
12972|  2.38k|      }
12973|  2.70k|      if (location == std::string_view::npos) {
  ------------------
  |  Branch (12973:11): [True: 298, False: 2.40k]
  ------------------
12974|    298|        update_base_pathname(path);
12975|    298|        return;
12976|    298|      }
12977|  2.70k|    } while (true);
  ------------------
  |  Branch (12977:14): [True: 2.40k, Folded]
  ------------------
12978|    298|  }
12979|    453|}
_ZN3ada7unicode14to_lower_asciiEPcm:
 6750|  3.10k|constexpr bool to_lower_ascii(char* input, size_t length) noexcept {
 6751|  3.10k|  uint64_t broadcast_80 = broadcast(0x80);
 6752|  3.10k|  uint64_t broadcast_Ap = broadcast(128 - 'A');
 6753|  3.10k|  uint64_t broadcast_Zp = broadcast(128 - 'Z' - 1);
 6754|  3.10k|  uint64_t non_ascii = 0;
 6755|  3.10k|  size_t i = 0;
 6756|       |
 6757|  12.2k|  for (; i + 7 < length; i += 8) {
  ------------------
  |  Branch (6757:10): [True: 9.13k, False: 3.10k]
  ------------------
 6758|  9.13k|    uint64_t word{};
 6759|  9.13k|    memcpy(&word, input + i, sizeof(word));
 6760|  9.13k|    non_ascii |= (word & broadcast_80);
 6761|  9.13k|    word ^=
 6762|  9.13k|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
 6763|  9.13k|    memcpy(input + i, &word, sizeof(word));
 6764|  9.13k|  }
 6765|  3.10k|  if (i < length) {
  ------------------
  |  Branch (6765:7): [True: 2.16k, False: 939]
  ------------------
 6766|  2.16k|    uint64_t word{};
 6767|  2.16k|    memcpy(&word, input + i, length - i);
 6768|  2.16k|    non_ascii |= (word & broadcast_80);
 6769|  2.16k|    word ^=
 6770|  2.16k|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
 6771|  2.16k|    memcpy(input + i, &word, length - i);
 6772|  2.16k|  }
 6773|  3.10k|  return non_ascii == 0;
 6774|  3.10k|}
_ZN3ada7unicode9broadcastEh:
 6746|  9.30k|constexpr uint64_t broadcast(uint8_t v) noexcept {
 6747|  9.30k|  return 0x101010101010101ull * v;
 6748|  9.30k|}
_ZN3ada8checkers7is_ipv4ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   12|  4.59k|ada_really_inline constexpr bool is_ipv4(std::string_view view) noexcept {
   13|       |  // The string is not empty and does not contain upper case ASCII characters.
   14|       |  //
   15|       |  // Optimization. To be considered as a possible ipv4, the string must end
   16|       |  // with 'x' or a lowercase hex character.
   17|       |  // Most of the time, this will be false so this simple check will save a lot
   18|       |  // of effort.
   19|       |  // If the address ends with a dot, we need to prune it (special case).
   20|  4.59k|  if (view.ends_with('.')) {
  ------------------
  |  Branch (20:7): [True: 464, False: 4.13k]
  ------------------
   21|    464|    view.remove_suffix(1);
   22|    464|    if (view.empty()) {
  ------------------
  |  Branch (22:9): [True: 30, False: 434]
  ------------------
   23|     30|      return false;
   24|     30|    }
   25|    464|  }
   26|  4.56k|  char last_char = view.back();
   27|  4.56k|  bool possible_ipv4 = (last_char >= '0' && last_char <= '9') ||
  ------------------
  |  Branch (27:25): [True: 3.75k, False: 807]
  |  Branch (27:45): [True: 2.95k, False: 799]
  ------------------
   28|  1.60k|                       (last_char >= 'a' && last_char <= 'f') ||
  ------------------
  |  Branch (28:25): [True: 731, False: 875]
  |  Branch (28:45): [True: 535, False: 196]
  ------------------
   29|  1.07k|                       last_char == 'x';
  ------------------
  |  Branch (29:24): [True: 47, False: 1.02k]
  ------------------
   30|  4.56k|  if (!possible_ipv4) {
  ------------------
  |  Branch (30:7): [True: 1.02k, False: 3.54k]
  ------------------
   31|  1.02k|    return false;
   32|  1.02k|  }
   33|       |  // From the last character, find the last dot.
   34|  3.54k|  size_t last_dot = view.rfind('.');
   35|  3.54k|  if (last_dot != std::string_view::npos) {
  ------------------
  |  Branch (35:7): [True: 2.58k, False: 957]
  ------------------
   36|       |    // We have at least one dot.
   37|  2.58k|    view.remove_prefix(last_dot + 1);
   38|  2.58k|  }
   39|       |  /** Optimization opportunity: we have basically identified the last number of
   40|       |     the ipv4 if we return true here. We might as well parse it and have at
   41|       |     least one number parsed when we get to parse_ipv4. */
   42|  3.54k|  if (std::ranges::all_of(view, ada::checkers::is_digit)) {
  ------------------
  |  Branch (42:7): [True: 2.69k, False: 842]
  ------------------
   43|  2.69k|    return true;
   44|  2.69k|  }
   45|       |  // It could be hex (0x), but not if there is a single character.
   46|    842|  if (view.size() == 1) {
  ------------------
  |  Branch (46:7): [True: 340, False: 502]
  ------------------
   47|    340|    return false;
   48|    340|  }
   49|       |  // It must start with 0x.
   50|    502|  if (!view.starts_with("0x")) {
  ------------------
  |  Branch (50:7): [True: 247, False: 255]
  ------------------
   51|    247|    return false;
   52|    247|  }
   53|       |  // We must allow "0x".
   54|    255|  if (view.size() == 2) {
  ------------------
  |  Branch (54:7): [True: 40, False: 215]
  ------------------
   55|     40|    return true;
   56|     40|  }
   57|       |  // We have 0x followed by some characters, we need to check that they are
   58|       |  // hexadecimals.
   59|    215|  view.remove_prefix(2);
   60|    215|  return std::ranges::all_of(view, ada::unicode::is_lowercase_hex);
   61|    255|}
_ZN3ada7unicode16is_lowercase_hexEc:
 7153|  2.08k|ada_really_inline constexpr bool is_lowercase_hex(const char c) noexcept {
 7154|  2.08k|  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f');
  ------------------
  |  Branch (7154:11): [True: 2.07k, False: 11]
  |  Branch (7154:23): [True: 1.48k, False: 587]
  |  Branch (7154:37): [True: 586, False: 12]
  |  Branch (7154:49): [True: 577, False: 9]
  ------------------
 7155|  2.08k|}
_ZN3ada8checkers14path_signatureENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   87|  3.74k|    std::string_view input) noexcept {
   88|       |  // The path percent-encode set is the query percent-encode set and U+003F (?),
   89|       |  // U+0060 (`), U+007B ({), and U+007D (}). The query percent-encode set is the
   90|       |  // C0 control percent-encode set and U+0020 SPACE, U+0022 ("), U+0023 (#),
   91|       |  // U+003C (<), and U+003E (>). The C0 control percent-encode set are the C0
   92|       |  // controls and all code points greater than U+007E (~).
   93|  3.74k|  size_t i = 0;
   94|  3.74k|  uint8_t accumulator{};
   95|  15.0k|  for (; i + 7 < input.size(); i += 8) {
  ------------------
  |  Branch (95:10): [True: 11.2k, False: 3.74k]
  ------------------
   96|  11.2k|    accumulator |= uint8_t(path_signature_table[uint8_t(input[i])] |
   97|  11.2k|                           path_signature_table[uint8_t(input[i + 1])] |
   98|  11.2k|                           path_signature_table[uint8_t(input[i + 2])] |
   99|  11.2k|                           path_signature_table[uint8_t(input[i + 3])] |
  100|  11.2k|                           path_signature_table[uint8_t(input[i + 4])] |
  101|  11.2k|                           path_signature_table[uint8_t(input[i + 5])] |
  102|  11.2k|                           path_signature_table[uint8_t(input[i + 6])] |
  103|  11.2k|                           path_signature_table[uint8_t(input[i + 7])]);
  104|  11.2k|  }
  105|  13.8k|  for (; i < input.size(); i++) {
  ------------------
  |  Branch (105:10): [True: 10.0k, False: 3.74k]
  ------------------
  106|  10.0k|    accumulator |= uint8_t(path_signature_table[uint8_t(input[i])]);
  107|  10.0k|  }
  108|  3.74k|  return accumulator;
  109|  3.74k|}
_ZN3ada7unicode45contains_forbidden_domain_code_point_or_upperEPKcm:
 7034|  4.85k|                                              size_t length) noexcept {
 7035|  4.85k|  size_t i = 0;
 7036|  4.85k|  uint8_t accumulator{};
 7037|  33.3k|  for (; i + 4 <= length; i += 4) {
  ------------------
  |  Branch (7037:10): [True: 28.5k, False: 4.85k]
  ------------------
 7038|  28.5k|    accumulator |=
 7039|  28.5k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i])];
 7040|  28.5k|    accumulator |=
 7041|  28.5k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i + 1])];
 7042|  28.5k|    accumulator |=
 7043|  28.5k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i + 2])];
 7044|  28.5k|    accumulator |=
 7045|  28.5k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i + 3])];
 7046|  28.5k|  }
 7047|  11.2k|  for (; i < length; i++) {
  ------------------
  |  Branch (7047:10): [True: 6.37k, False: 4.85k]
  ------------------
 7048|  6.37k|    accumulator |=
 7049|  6.37k|        is_forbidden_domain_code_point_table_or_upper[uint8_t(input[i])];
 7050|  6.37k|  }
 7051|  4.85k|  return accumulator;
 7052|  4.85k|}
_ZN3ada7unicode14percent_encodeILb1EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKhRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEE:
 7308|  17.6k|                    std::string& out) {
 7309|  17.6k|  ada_log("percent_encode ", input, " to output string while ",
 7310|  17.6k|          append ? "appending" : "overwriting");
 7311|  17.6k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7312|  17.6k|    return character_sets::bit_at(character_set, c);
 7313|  17.6k|  });
 7314|  17.6k|  ada_log("percent_encode done checking, moved to ",
 7315|  17.6k|          std::distance(input.begin(), pointer));
 7316|       |
 7317|       |  // Optimization: Don't iterate if percent encode is not required
 7318|  17.6k|  if (pointer == input.end()) {
  ------------------
  |  Branch (7318:7): [True: 12.0k, False: 5.54k]
  ------------------
 7319|  12.0k|    ada_log("percent_encode encoding not needed.");
 7320|  12.0k|    return false;
 7321|  12.0k|  }
 7322|       |  if constexpr (!append) {
 7323|       |    out.clear();
 7324|       |  }
 7325|  5.54k|  ada_log("percent_encode appending ", std::distance(input.begin(), pointer),
 7326|  5.54k|          " bytes");
 7327|       |  // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
 7328|  5.54k|  out.append(input.data(), std::distance(input.begin(), pointer));
 7329|  5.54k|  ada_log("percent_encode processing ", std::distance(pointer, input.end()),
 7330|  5.54k|          " bytes");
 7331|  71.4k|  for (; pointer != input.end(); pointer++) {
  ------------------
  |  Branch (7331:10): [True: 65.9k, False: 5.54k]
  ------------------
 7332|  65.9k|    if (character_sets::bit_at(character_set, *pointer)) {
  ------------------
  |  Branch (7332:9): [True: 41.1k, False: 24.7k]
  ------------------
 7333|  41.1k|      out.append(character_sets::hex + uint8_t(*pointer) * 4, 3);
 7334|  41.1k|    } else {
 7335|  24.7k|      out += *pointer;
 7336|  24.7k|    }
 7337|  65.9k|  }
 7338|  5.54k|  return true;
 7339|  17.6k|}
_ZZN3ada7unicode14percent_encodeILb1EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKhRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEEENKUlcE_clEc:
 7311|  44.8k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7312|  44.8k|    return character_sets::bit_at(character_set, c);
 7313|  44.8k|  });
_ZN3ada7unicode14percent_encodeILb0EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKhRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEE:
 7308|  19.8k|                    std::string& out) {
 7309|  19.8k|  ada_log("percent_encode ", input, " to output string while ",
 7310|  19.8k|          append ? "appending" : "overwriting");
 7311|  19.8k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7312|  19.8k|    return character_sets::bit_at(character_set, c);
 7313|  19.8k|  });
 7314|  19.8k|  ada_log("percent_encode done checking, moved to ",
 7315|  19.8k|          std::distance(input.begin(), pointer));
 7316|       |
 7317|       |  // Optimization: Don't iterate if percent encode is not required
 7318|  19.8k|  if (pointer == input.end()) {
  ------------------
  |  Branch (7318:7): [True: 13.6k, False: 6.14k]
  ------------------
 7319|  13.6k|    ada_log("percent_encode encoding not needed.");
 7320|  13.6k|    return false;
 7321|  13.6k|  }
 7322|  6.14k|  if constexpr (!append) {
 7323|  6.14k|    out.clear();
 7324|  6.14k|  }
 7325|  6.14k|  ada_log("percent_encode appending ", std::distance(input.begin(), pointer),
 7326|  6.14k|          " bytes");
 7327|       |  // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
 7328|  6.14k|  out.append(input.data(), std::distance(input.begin(), pointer));
 7329|  6.14k|  ada_log("percent_encode processing ", std::distance(pointer, input.end()),
 7330|  6.14k|          " bytes");
 7331|  77.0k|  for (; pointer != input.end(); pointer++) {
  ------------------
  |  Branch (7331:10): [True: 70.8k, False: 6.14k]
  ------------------
 7332|  70.8k|    if (character_sets::bit_at(character_set, *pointer)) {
  ------------------
  |  Branch (7332:9): [True: 44.4k, False: 26.4k]
  ------------------
 7333|  44.4k|      out.append(character_sets::hex + uint8_t(*pointer) * 4, 3);
 7334|  44.4k|    } else {
 7335|  26.4k|      out += *pointer;
 7336|  26.4k|    }
 7337|  70.8k|  }
 7338|  6.14k|  return true;
 7339|  19.8k|}
_ZZN3ada7unicode14percent_encodeILb0EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKhRNS2_12basic_stringIcS5_NS2_9allocatorIcEEEEENKUlcE_clEc:
 7311|  46.7k|  auto pointer = std::ranges::find_if(input, [character_set](const char c) {
 7312|  46.7k|    return character_sets::bit_at(character_set, c);
 7313|  46.7k|  });
_ZN3ada6parser25try_parse_simple_absoluteINS_14url_aggregatorEEEbNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEERT_:
10106|  4.26k|                                                result_type& out) {
10107|  4.26k|  constexpr bool is_ada_url = std::is_same_v<result_type, ada::url>;
10108|  4.26k|  constexpr bool is_aggregator =
10109|  4.26k|      std::is_same_v<result_type, ada::url_aggregator>;
10110|  4.26k|  static_assert(is_ada_url || is_aggregator);
10111|       |
10112|  4.26k|  const size_t len = input.size();
10113|  4.26k|  if (len < 8) [[unlikely]] {
  ------------------
  |  Branch (10113:7): [True: 0, False: 4.26k]
  ------------------
10114|      0|    return false;
10115|      0|  }
10116|  4.26k|  const auto* b = reinterpret_cast<const uint8_t*>(input.data());
10117|       |
10118|  4.26k|  size_t pos;
10119|  4.26k|  ada::scheme::type scheme_type;
10120|  4.26k|  uint32_t protocol_end;
10121|  4.26k|  if (b[0] == 'h' && b[1] == 't' && b[2] == 't' && b[3] == 'p') {
  ------------------
  |  Branch (10121:7): [True: 4.26k, False: 0]
  |  Branch (10121:22): [True: 4.26k, False: 0]
  |  Branch (10121:37): [True: 4.26k, False: 0]
  |  Branch (10121:52): [True: 4.26k, False: 0]
  ------------------
10122|  4.26k|    if (b[4] == ':' && b[5] == '/' && b[6] == '/') {
  ------------------
  |  Branch (10122:9): [True: 4.26k, False: 0]
  |  Branch (10122:24): [True: 4.26k, False: 0]
  |  Branch (10122:39): [True: 4.26k, False: 0]
  ------------------
10123|  4.26k|      pos = 7;
10124|  4.26k|      scheme_type = ada::scheme::type::HTTP;
10125|  4.26k|      protocol_end = 5;
10126|  4.26k|    } else if (len >= 8 && b[4] == 's' && b[5] == ':' && b[6] == '/' &&
  ------------------
  |  Branch (10126:16): [True: 0, False: 0]
  |  Branch (10126:28): [True: 0, False: 0]
  |  Branch (10126:43): [True: 0, False: 0]
  |  Branch (10126:58): [True: 0, False: 0]
  ------------------
10127|      0|               b[7] == '/') {
  ------------------
  |  Branch (10127:16): [True: 0, False: 0]
  ------------------
10128|      0|      pos = 8;
10129|      0|      scheme_type = ada::scheme::type::HTTPS;
10130|      0|      protocol_end = 6;
10131|      0|    } else {
10132|      0|      return false;
10133|      0|    }
10134|  4.26k|  } else {
10135|      0|    return false;
10136|      0|  }
10137|  4.26k|  if (pos < len && (b[pos] == '/' || b[pos] == '\\')) [[unlikely]] {
  ------------------
  |  Branch (10137:7): [True: 4.26k, False: 0]
  |  Branch (10137:21): [True: 28, False: 4.23k]
  |  Branch (10137:38): [True: 19, False: 4.22k]
  ------------------
10138|     47|    return false;
10139|     47|  }
10140|       |
10141|       |  // Digit-led hosts are IPv4/numeric; skip before scanning.
10142|  4.22k|  if (pos < len && b[pos] >= '0' && b[pos] <= '9') {
  ------------------
  |  Branch (10142:7): [True: 4.22k, False: 0]
  |  Branch (10142:20): [True: 3.84k, False: 379]
  |  Branch (10142:37): [True: 0, False: 3.84k]
  ------------------
10143|      0|    return false;
10144|      0|  }
10145|       |
10146|  4.22k|  const size_t host_start = pos;
10147|  4.22k|  bool has_upper = false;
10148|  4.22k|  size_t i = pos;
10149|  11.0k|  for (; i < len; ++i) {
  ------------------
  |  Branch (10149:10): [True: 11.0k, False: 0]
  ------------------
10150|  11.0k|    const uint8_t c = b[i];
10151|  11.0k|    const uint8_t cls = k_host_class[c];
10152|  11.0k|    if (cls == 1) {
  ------------------
  |  Branch (10152:9): [True: 376, False: 10.6k]
  ------------------
10153|    376|      break;
10154|    376|    }
10155|  10.6k|    if (cls == 2) [[unlikely]] {
  ------------------
  |  Branch (10155:9): [True: 3.84k, False: 6.85k]
  ------------------
10156|  3.84k|      return false;
10157|  3.84k|    }
10158|  6.85k|    if (c >= 'A' && c <= 'Z') {
  ------------------
  |  Branch (10158:9): [True: 3.93k, False: 2.91k]
  |  Branch (10158:21): [True: 1.12k, False: 2.81k]
  ------------------
10159|  1.12k|      has_upper = true;
10160|  1.12k|    }
10161|  6.85k|  }
10162|    376|  const size_t host_end = i;
10163|    376|  if (host_start == host_end) [[unlikely]] {
  ------------------
  |  Branch (10163:7): [True: 1, False: 375]
  ------------------
10164|      1|    return false;
10165|      1|  }
10166|    375|  const size_t host_len = host_end - host_start;
10167|    375|  if (host_len > 253) [[unlikely]] {
  ------------------
  |  Branch (10167:7): [True: 0, False: 375]
  ------------------
10168|      0|    return false;
10169|      0|  }
10170|    375|  {
10171|    375|    std::string_view hv(input.data() + host_start, host_len);
10172|    375|    char host_buf[256];
10173|    375|    if (has_upper) [[unlikely]] {
  ------------------
  |  Branch (10173:9): [True: 217, False: 158]
  ------------------
10174|    217|      std::memcpy(host_buf, input.data() + host_start, host_len);
10175|    217|      unicode::to_lower_ascii(host_buf, host_len);
10176|    217|      hv = std::string_view(host_buf, host_len);
10177|    217|    }
10178|    375|    if (checkers::is_ipv4(hv)) [[unlikely]] {
  ------------------
  |  Branch (10178:9): [True: 37, False: 338]
  ------------------
10179|     37|      return false;
10180|     37|    }
10181|    338|    static constexpr std::string_view xn{"xn-", 3};
10182|    338|    if (hv.find(xn) != std::string_view::npos) [[unlikely]] {
  ------------------
  |  Branch (10182:9): [True: 7, False: 331]
  ------------------
10183|      7|      return false;
10184|      7|    }
10185|    338|  }
10186|       |
10187|    331|  size_t path_start = host_end;
10188|    331|  size_t path_end = host_end;
10189|    331|  size_t query_start = std::string_view::npos;
10190|    331|  size_t hash_start = std::string_view::npos;
10191|    331|  bool has_path = false;
10192|    331|  bool path_has_dot = false;
10193|       |
10194|    331|  if (i < len && b[i] == '/') {
  ------------------
  |  Branch (10194:7): [True: 331, False: 0]
  |  Branch (10194:18): [True: 310, False: 21]
  ------------------
10195|    310|    has_path = true;
10196|    310|    path_start = i;
10197|    310|    ++i;
10198|  5.77k|    for (; i < len; ++i) {
  ------------------
  |  Branch (10198:12): [True: 5.70k, False: 65]
  ------------------
10199|  5.70k|      const uint8_t c = b[i];
10200|  5.70k|      const uint8_t cls = k_rest[c];
10201|  5.70k|      if (cls == 0) {
  ------------------
  |  Branch (10201:11): [True: 5.46k, False: 245]
  ------------------
10202|  5.46k|        path_has_dot |= (c == '.');
10203|  5.46k|        continue;
10204|  5.46k|      }
10205|    245|      if (cls == 1) {
  ------------------
  |  Branch (10205:11): [True: 39, False: 206]
  ------------------
10206|     39|        path_end = i;
10207|     39|        if (c == '?') {
  ------------------
  |  Branch (10207:13): [True: 37, False: 2]
  ------------------
10208|     37|          query_start = i;
10209|     37|          ++i;
10210|     37|          goto scan_query;
10211|     37|        }
10212|      2|        hash_start = i;
10213|      2|        ++i;
10214|      2|        goto scan_hash;
10215|     39|      }
10216|    206|      return false;
10217|    245|    }
10218|     65|    path_end = i;
10219|     65|  } else if (i < len && b[i] == '?') {
  ------------------
  |  Branch (10219:14): [True: 21, False: 0]
  |  Branch (10219:25): [True: 10, False: 11]
  ------------------
10220|     10|    query_start = i;
10221|     10|    ++i;
10222|     10|    goto scan_query;
10223|     11|  } else if (i < len && b[i] == '#') {
  ------------------
  |  Branch (10223:14): [True: 11, False: 0]
  |  Branch (10223:25): [True: 11, False: 0]
  ------------------
10224|     11|    hash_start = i;
10225|     11|    ++i;
10226|     11|    goto scan_hash;
10227|     11|  }
10228|     65|  goto after_rest;
10229|       |
10230|     65|scan_query:
10231|    530|  for (; i < len; ++i) {
  ------------------
  |  Branch (10231:10): [True: 495, False: 35]
  ------------------
10232|    495|    const uint8_t c = b[i];
10233|    495|    if (c == '#') {
  ------------------
  |  Branch (10233:9): [True: 3, False: 492]
  ------------------
10234|      3|      hash_start = i;
10235|      3|      ++i;
10236|      3|      goto scan_hash;
10237|      3|    }
10238|    492|    if (c == '?' || c == '%') {
  ------------------
  |  Branch (10238:9): [True: 1, False: 491]
  |  Branch (10238:21): [True: 4, False: 487]
  ------------------
10239|      5|      continue;
10240|      5|    }
10241|    487|    if (k_rest[c] == 2) [[unlikely]] {
  ------------------
  |  Branch (10241:9): [True: 9, False: 478]
  ------------------
10242|      9|      return false;
10243|      9|    }
10244|    487|  }
10245|     35|  goto after_rest;
10246|       |
10247|     35|scan_hash:
10248|    169|  for (; i < len; ++i) {
  ------------------
  |  Branch (10248:10): [True: 158, False: 11]
  ------------------
10249|    158|    const uint8_t c = b[i];
10250|    158|    if (c == '?' || c == '#' || c == '%') {
  ------------------
  |  Branch (10250:9): [True: 3, False: 155]
  |  Branch (10250:21): [True: 4, False: 151]
  |  Branch (10250:33): [True: 3, False: 148]
  ------------------
10251|     10|      continue;
10252|     10|    }
10253|    148|    if (k_rest[c] == 2) [[unlikely]] {
  ------------------
  |  Branch (10253:9): [True: 5, False: 143]
  ------------------
10254|      5|      return false;
10255|      5|    }
10256|    148|  }
10257|       |
10258|    111|after_rest:
10259|    111|  if (path_has_dot) [[unlikely]] {
  ------------------
  |  Branch (10259:7): [True: 100, False: 11]
  ------------------
10260|    100|    const std::string_view path_body(input.data() + path_start,
10261|    100|                                     path_end - path_start);
10262|    100|    if (path_body.size() >= 2 && path_body[1] == '.') {
  ------------------
  |  Branch (10262:9): [True: 100, False: 0]
  |  Branch (10262:34): [True: 17, False: 83]
  ------------------
10263|     17|      if (path_body.size() == 2 || path_body[2] == '/' ||
  ------------------
  |  Branch (10263:11): [True: 0, False: 17]
  |  Branch (10263:36): [True: 0, False: 17]
  ------------------
10264|     17|          (path_body.size() >= 3 && path_body[2] == '.' &&
  ------------------
  |  Branch (10264:12): [True: 17, False: 0]
  |  Branch (10264:37): [True: 1, False: 16]
  ------------------
10265|      1|           (path_body.size() == 3 || path_body[3] == '/'))) {
  ------------------
  |  Branch (10265:13): [True: 0, False: 1]
  |  Branch (10265:38): [True: 1, False: 0]
  ------------------
10266|      1|        return false;
10267|      1|      }
10268|     17|    }
10269|     99|    static constexpr std::string_view slash_dot{"/.", 2};
10270|     99|    size_t p = 1;
10271|    163|    while ((p = path_body.find(slash_dot, p)) != std::string_view::npos) {
  ------------------
  |  Branch (10271:12): [True: 134, False: 29]
  ------------------
10272|    134|      const size_t after = p + 2;
10273|    134|      if (after == path_body.size() || path_body[after] == '/' ||
  ------------------
  |  Branch (10273:11): [True: 0, False: 134]
  |  Branch (10273:40): [True: 30, False: 104]
  ------------------
10274|    104|          (after + 1 <= path_body.size() && path_body[after] == '.' &&
  ------------------
  |  Branch (10274:12): [True: 104, False: 0]
  |  Branch (10274:45): [True: 47, False: 57]
  ------------------
10275|     70|           (after + 1 == path_body.size() || path_body[after + 1] == '/'))) {
  ------------------
  |  Branch (10275:13): [True: 1, False: 46]
  |  Branch (10275:46): [True: 39, False: 7]
  ------------------
10276|     70|        return false;
10277|     70|      }
10278|     64|      p = after;
10279|     64|    }
10280|     99|  }
10281|       |
10282|     40|  const bool need_slash = !has_path;
10283|     40|  out.type = scheme_type;
10284|     40|  out.is_valid = true;
10285|     40|  out.has_opaque_path = false;
10286|     40|  out.host_type = DEFAULT;
10287|       |
10288|     40|  if constexpr (is_aggregator) {
10289|     40|    if (!need_slash) {
  ------------------
  |  Branch (10289:9): [True: 29, False: 11]
  ------------------
10290|     29|      out.buffer.resize(len);
10291|       |      // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
10292|     29|      std::memcpy(out.buffer.data(), input.data(), len);
10293|     29|      if (has_upper) {
  ------------------
  |  Branch (10293:11): [True: 8, False: 21]
  ------------------
10294|      8|        unicode::to_lower_ascii(out.buffer.data() + host_start,
10295|      8|                                host_end - host_start);
10296|      8|      }
10297|     29|      out.components.protocol_end = protocol_end;
10298|     29|      out.components.username_end = protocol_end + 2;
10299|     29|      out.components.host_start = protocol_end + 2;
10300|     29|      out.components.host_end = static_cast<uint32_t>(host_end);
10301|     29|      out.components.port = url_components::omitted;
10302|     29|      out.components.pathname_start = static_cast<uint32_t>(path_start);
10303|     29|      out.components.search_start = (query_start != std::string_view::npos)
  ------------------
  |  Branch (10303:37): [True: 4, False: 25]
  ------------------
10304|     29|                                        ? static_cast<uint32_t>(query_start)
10305|     29|                                        : url_components::omitted;
10306|     29|      out.components.hash_start = (hash_start != std::string_view::npos)
  ------------------
  |  Branch (10306:35): [True: 3, False: 26]
  ------------------
10307|     29|                                      ? static_cast<uint32_t>(hash_start)
10308|     29|                                      : url_components::omitted;
10309|     29|    } else {
10310|     11|      out.buffer.resize(len + 1);
10311|       |      // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage)
10312|     11|      std::memcpy(out.buffer.data(), input.data(), host_end);
10313|     11|      out.buffer[host_end] = '/';
10314|     11|      if (host_end < len) {
  ------------------
  |  Branch (10314:11): [True: 11, False: 0]
  ------------------
10315|     11|        std::memcpy(out.buffer.data() + host_end + 1, input.data() + host_end,
10316|     11|                    len - host_end);
10317|     11|      }
10318|     11|      if (has_upper) {
  ------------------
  |  Branch (10318:11): [True: 3, False: 8]
  ------------------
10319|      3|        unicode::to_lower_ascii(out.buffer.data() + host_start,
10320|      3|                                host_end - host_start);
10321|      3|      }
10322|     11|      out.components.protocol_end = protocol_end;
10323|     11|      out.components.username_end = protocol_end + 2;
10324|     11|      out.components.host_start = protocol_end + 2;
10325|     11|      out.components.host_end = static_cast<uint32_t>(host_end);
10326|     11|      out.components.port = url_components::omitted;
10327|     11|      out.components.pathname_start = static_cast<uint32_t>(host_end);
10328|     11|      out.components.search_start = (query_start != std::string_view::npos)
  ------------------
  |  Branch (10328:37): [True: 5, False: 6]
  ------------------
10329|     11|                                        ? static_cast<uint32_t>(query_start + 1)
10330|     11|                                        : url_components::omitted;
10331|     11|      out.components.hash_start = (hash_start != std::string_view::npos)
  ------------------
  |  Branch (10331:35): [True: 7, False: 4]
  ------------------
10332|     11|                                      ? static_cast<uint32_t>(hash_start + 1)
10333|     11|                                      : url_components::omitted;
10334|     11|    }
10335|       |  } else {
10336|       |    std::string host_str(input.substr(host_start, host_end - host_start));
10337|       |    if (has_upper) {
10338|       |      unicode::to_lower_ascii(host_str.data(), host_str.size());
10339|       |    }
10340|       |    out.host = std::move(host_str);
10341|       |    if (need_slash) {
10342|       |      out.path = "/";
10343|       |    } else {
10344|       |      out.path.assign(input.data() + path_start, path_end - path_start);
10345|       |    }
10346|       |    if (query_start != std::string_view::npos) {
10347|       |      const size_t q_end =
10348|       |          (hash_start != std::string_view::npos) ? hash_start : len;
10349|       |      out.query.emplace(input.data() + query_start + 1,
10350|       |                        q_end - query_start - 1);
10351|       |    }
10352|       |    if (hash_start != std::string_view::npos) {
10353|       |      out.hash.emplace(input.data() + hash_start + 1, len - hash_start - 1);
10354|       |    }
10355|       |  }
10356|     40|  return true;
10357|    111|}
_ZN3ada14url_aggregator23parse_scheme_with_colonILb0EEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
11448|  5.09k|    const std::string_view input_with_colon) {
11449|  5.09k|  ada_log("url_aggregator::parse_scheme_with_colon ", input_with_colon);
11450|  5.09k|  ADA_ASSERT_TRUE(validate());
11451|  5.09k|  ADA_ASSERT_TRUE(!helpers::overlaps(input_with_colon, buffer));
11452|  5.09k|  std::string_view input{input_with_colon};
11453|  5.09k|  input.remove_suffix(1);
11454|  5.09k|  auto parsed_type = ada::scheme::get_scheme_type(input);
11455|  5.09k|  const bool is_input_special = (parsed_type != ada::scheme::NOT_SPECIAL);
11456|       |  /**
11457|       |   * In the common case, we will immediately recognize a special scheme (e.g.,
11458|       |   *http, https), in which case, we can go really fast.
11459|       |   **/
11460|  5.09k|  if (is_input_special) {  // fast path!!!
  ------------------
  |  Branch (11460:7): [True: 5.09k, False: 0]
  ------------------
11461|       |    if constexpr (has_state_override) {
11462|       |      // If url's scheme is not a special scheme and buffer is a special scheme,
11463|       |      // then return.
11464|       |      if (is_special() != is_input_special) {
11465|       |        return false;
11466|       |      }
11467|       |
11468|       |      // If url includes credentials or has a non-null port, and buffer is
11469|       |      // "file", then return.
11470|       |      if ((has_credentials() || components.port != url_components::omitted) &&
11471|       |          parsed_type == ada::scheme::type::FILE) {
11472|       |        return false;
11473|       |      }
11474|       |
11475|       |      // If url's scheme is "file" and its host is an empty host, then return.
11476|       |      // An empty host is the empty string.
11477|       |      if (type == ada::scheme::type::FILE &&
11478|       |          components.host_start == components.host_end) {
11479|       |        return false;
11480|       |      }
11481|       |    }
11482|       |
11483|  5.09k|    type = parsed_type;
11484|  5.09k|    set_scheme_from_view_with_colon(input_with_colon);
11485|       |
11486|       |    if constexpr (has_state_override) {
11487|       |      // This is uncommon.
11488|       |      uint16_t urls_scheme_port = get_special_port();
11489|       |
11490|       |      if (urls_scheme_port) {
11491|       |        // If url's port is url's scheme's default port, then set url's port to
11492|       |        // null.
11493|       |        if (components.port == urls_scheme_port) {
11494|       |          clear_port();
11495|       |        }
11496|       |      }
11497|       |    }
11498|  5.09k|  } else {  // slow path
11499|      0|    std::string _buffer(input);
11500|       |    // Next function is only valid if the input is ASCII and returns false
11501|       |    // otherwise, but it seems that we always have ascii content so we do not
11502|       |    // need to check the return value.
11503|      0|    unicode::to_lower_ascii(_buffer.data(), _buffer.size());
11504|       |
11505|       |    if constexpr (has_state_override) {
11506|       |      // The state-override validation errors below ("return" in the WHATWG URL
11507|       |      // parser) leave the URL unchanged. The setter contract is
11508|       |      // "true on success, false if the scheme is invalid" -- the fast path
11509|       |      // above already returns false here, so the slow path must agree.
11510|       |
11511|       |      // If url's scheme is a special scheme and buffer is not a special scheme,
11512|       |      // then return. If url's scheme is not a special scheme and buffer is a
11513|       |      // special scheme, then return.
11514|       |      if (is_special() != ada::scheme::is_special(_buffer)) {
11515|       |        return false;
11516|       |      }
11517|       |
11518|       |      // If url includes credentials or has a non-null port, and buffer is
11519|       |      // "file", then return.
11520|       |      if ((has_credentials() || components.port != url_components::omitted) &&
11521|       |          _buffer == "file") {
11522|       |        return false;
11523|       |      }
11524|       |
11525|       |      // If url's scheme is "file" and its host is an empty host, then return.
11526|       |      // An empty host is the empty string.
11527|       |      if (type == ada::scheme::type::FILE &&
11528|       |          components.host_start == components.host_end) {
11529|       |        return false;
11530|       |      }
11531|       |    }
11532|       |
11533|      0|    set_scheme(_buffer);
11534|       |
11535|       |    if constexpr (has_state_override) {
11536|       |      // This is uncommon.
11537|       |      uint16_t urls_scheme_port = get_special_port();
11538|       |
11539|       |      if (urls_scheme_port) {
11540|       |        // If url's port is url's scheme's default port, then set url's port to
11541|       |        // null.
11542|       |        if (components.port == urls_scheme_port) {
11543|       |          clear_port();
11544|       |        }
11545|       |      }
11546|       |    }
11547|      0|  }
11548|  5.09k|  ADA_ASSERT_TRUE(validate());
11549|  5.09k|  return true;
11550|  5.09k|}
_ZN3ada14url_aggregator31set_scheme_from_view_with_colonENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
11574|  5.09k|    std::string_view new_scheme_with_colon) {
11575|  5.09k|  ada_log("url_aggregator::set_scheme_from_view_with_colon ",
11576|  5.09k|          new_scheme_with_colon);
11577|  5.09k|  ADA_ASSERT_TRUE(validate());
11578|  5.09k|  ADA_ASSERT_TRUE(!new_scheme_with_colon.empty() &&
11579|  5.09k|                  new_scheme_with_colon.back() == ':');
11580|       |  // next line could overflow but unsigned arithmetic has well-defined
11581|       |  // overflows.
11582|  5.09k|  uint32_t new_difference =
11583|  5.09k|      uint32_t(new_scheme_with_colon.size()) - components.protocol_end;
11584|       |
11585|  5.09k|  if (buffer.empty()) {
  ------------------
  |  Branch (11585:7): [True: 5.09k, False: 0]
  ------------------
11586|  5.09k|    buffer.append(new_scheme_with_colon);
11587|  5.09k|  } else {
11588|      0|    buffer.erase(0, components.protocol_end);
11589|      0|    buffer.insert(0, new_scheme_with_colon);
11590|      0|  }
11591|  5.09k|  components.protocol_end += new_difference;
11592|       |
11593|  5.09k|  apply_shifted_non_scheme_offsets(components, new_difference);
11594|  5.09k|  ADA_ASSERT_TRUE(validate());
11595|  5.09k|}

_ZN3ada37url_pattern_compile_component_optionsC2ENSt3__18optionalIcEES3_:
 5678|      6|      : delimiter(new_delimiter), prefix(new_prefix) {}
_ZN3ada14character_sets6bit_atEPKhh:
 1074|   436k|ada_really_inline constexpr bool bit_at(const uint8_t a[], const uint8_t i) {
 1075|   436k|  return !!(a[i >> 3] & (1 << (i & 7)));
 1076|   436k|}
_ZN2tl10unexpectedIN3ada6errorsEEC2EOS2_:
 2145|  8.39k|  constexpr explicit unexpected(E&& e) : m_val(std::move(e)) {}
_ZNR2tl10unexpectedIN3ada6errorsEE5valueEv:
 2159|  4.19k|  TL_EXPECTED_11_CONSTEXPR E& value() & { return m_val; }
_ZN3ada8url_baseD2Ev:
 1649|  6.08k|  virtual ~url_base() = default;
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEC2IS3_TnPNSt3__19enable_ifIXsr3std16is_constructibleIS3_OT_EE5valueEvE4typeELPv0ETnPNS7_IXsr3std14is_convertibleIS9_S3_EE5valueEvE4typeELSD_0EEEONS_10unexpectedIS8_EE:
 3631|  4.19k|      : impl_base(unexpect, std::move(e.value())),
 3632|  4.19k|        ctor_base(detail::default_constructor_tag{}) {}
_ZN2tl6detail21expected_storage_baseIN3ada14url_aggregatorENS2_6errorsELb0ELb1EEC2IJS4_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS4_DpOT_EE5valueEvE4typeELPv0EEENS_10unexpect_tESB_:
 2617|  4.19k|      : m_unexpect(std::forward<Args>(args)...), m_has_val(false) {}
_ZN2tl6detail26expected_default_ctor_baseIN3ada14url_aggregatorENS2_6errorsELb1EEC2ENS0_23default_constructor_tagE:
 3235|  5.13k|  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_:
 3717|    943|      : expected(in_place, std::forward<U>(v)) {}
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEC2IJS2_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS2_DpOT_EE5valueEvE4typeELPv0EEENS_10in_place_tESA_:
 3590|    943|      : impl_base(in_place, std::forward<Args>(args)...),
 3591|    943|        ctor_base(detail::default_constructor_tag{}) {}
_ZN2tl6detail21expected_storage_baseIN3ada14url_aggregatorENS2_6errorsELb0ELb1EEC2IJS3_ETnPNSt3__19enable_ifIXsr3std16is_constructibleIS3_DpOT_EE5valueEvE4typeELPv0EEENS_10in_place_tESB_:
 2605|    943|      : m_val(std::forward<Args>(args)...), m_has_val(true) {}
_ZN3ada14url_aggregatorC2EOS0_:
 7691|    943|  url_aggregator(url_aggregator&& u) noexcept = default;
_ZN3ada14url_aggregatorD2Ev:
 7694|  6.08k|  ~url_aggregator() override = default;
_ZN3ada6scheme15get_scheme_typeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6709|  5.09k|constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept {
 6710|  5.09k|  if (scheme.empty()) {
  ------------------
  |  Branch (6710:7): [True: 0, False: 5.09k]
  ------------------
 6711|      0|    return ada::scheme::NOT_SPECIAL;
 6712|      0|  }
 6713|  5.09k|  int hash_value = (2 * scheme.size() + (unsigned)(scheme[0])) & 7;
 6714|  5.09k|  const std::string_view target = details::is_special_list[hash_value];
 6715|  5.09k|  if (scheme.size() == target.size() &&
  ------------------
  |  Branch (6715:7): [True: 5.09k, False: 0]
  ------------------
 6716|  5.09k|      details::branchless_load5(scheme.data(), scheme.size()) ==
  ------------------
  |  Branch (6716:7): [True: 5.09k, False: 0]
  ------------------
 6717|  5.09k|          details::scheme_keys[hash_value]) {
 6718|  5.09k|    return ada::scheme::type(hash_value);
 6719|  5.09k|  } else {
 6720|      0|    return ada::scheme::NOT_SPECIAL;
 6721|      0|  }
 6722|  5.09k|}
_ZN3ada6scheme7details16branchless_load5EPKcm:
 6650|  5.09k|inline uint64_t branchless_load5(const char* p, size_t n) {
 6651|  5.09k|  uint64_t input = (uint8_t)p[0];
 6652|  5.09k|  input |= ((uint64_t)(uint8_t)p[n > 1] << 8) & (0 - (uint64_t)(n > 1));
 6653|  5.09k|  input |= ((uint64_t)(uint8_t)p[(n > 2) * 2] << 16) & (0 - (uint64_t)(n > 2));
 6654|  5.09k|  input |= ((uint64_t)(uint8_t)p[(n > 3) * 3] << 24) & (0 - (uint64_t)(n > 3));
 6655|  5.09k|  input |= ((uint64_t)(uint8_t)p[(n > 4) * 4] << 32) & (0 - (uint64_t)(n > 4));
 6656|  5.09k|  return input;
 6657|  5.09k|}
_ZN3ada14url_aggregatorC2Ev:
 7689|  5.13k|  url_aggregator() = default;
_ZN3ada14url_componentsC2Ev:
 4895|  5.13k|  url_components() = default;
_ZN3ada8checkers19try_parse_ipv4_fastENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1402|  5.83k|try_parse_ipv4_fast(std::string_view input) noexcept {
 1403|  5.83k|  const size_t len = input.size();
 1404|       |  // Shortest pure decimal: "0.0.0.0" (7). Longest + trailing dot: 16.
 1405|  5.83k|  if (len < 7 || len > 16) [[unlikely]] {
  ------------------
  |  Branch (1405:7): [True: 3.16k, False: 2.67k]
  |  Branch (1405:18): [True: 1.47k, False: 1.20k]
  ------------------
 1406|  4.63k|    return ipv4_fast_fail;
 1407|  4.63k|  }
 1408|  1.20k|  const char* data = input.data();
 1409|       |
 1410|       |#if defined(ADA_AVX512)
 1411|       |  return detail::try_parse_ipv4_avx512(data, len);
 1412|       |#else
 1413|  1.20k|  return detail::parse_ipv4_decimal_scalar(data, data + len);
 1414|  5.83k|#endif
 1415|  5.83k|}
_ZN3ada8checkers6detail25parse_ipv4_decimal_scalarEPKcS3_:
 1277|  1.20k|parse_ipv4_decimal_scalar(const char* p, const char* pend) noexcept {
 1278|  1.20k|  uint32_t ipv4 = 0;
 1279|  2.34k|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (1279:19): [True: 2.08k, False: 255]
  ------------------
 1280|  2.08k|    if (p == pend) [[unlikely]] {
  ------------------
  |  Branch (1280:9): [True: 2, False: 2.08k]
  ------------------
 1281|      2|      return ipv4_fast_fail;
 1282|      2|    }
 1283|  2.08k|    uint32_t val;
 1284|  2.08k|    char c = *p;
 1285|  2.08k|    if (c >= '0' && c <= '9') [[likely]] {
  ------------------
  |  Branch (1285:9): [True: 1.70k, False: 380]
  |  Branch (1285:21): [True: 1.53k, False: 165]
  ------------------
 1286|  1.53k|      val = static_cast<uint32_t>(c - '0');
 1287|  1.53k|      ++p;
 1288|  1.53k|    } else {
 1289|    545|      return ipv4_fast_fail;
 1290|    545|    }
 1291|  1.53k|    if (p < pend) {
  ------------------
  |  Branch (1291:9): [True: 1.43k, False: 101]
  ------------------
 1292|  1.43k|      c = *p;
 1293|  1.43k|      if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (1293:11): [True: 954, False: 484]
  |  Branch (1293:23): [True: 834, False: 120]
  ------------------
 1294|    834|        if (val == 0) [[unlikely]] {
  ------------------
  |  Branch (1294:13): [True: 53, False: 781]
  ------------------
 1295|     53|          return ipv4_fast_fail;
 1296|     53|        }
 1297|    781|        val = val * 10u + static_cast<uint32_t>(c - '0');
 1298|    781|        ++p;
 1299|    781|        if (p < pend) {
  ------------------
  |  Branch (1299:13): [True: 717, False: 64]
  ------------------
 1300|    717|          c = *p;
 1301|    717|          if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (1301:15): [True: 509, False: 208]
  |  Branch (1301:27): [True: 501, False: 8]
  ------------------
 1302|    501|            val = val * 10u + static_cast<uint32_t>(c - '0');
 1303|    501|            ++p;
 1304|    501|            if (val > 255u) [[unlikely]] {
  ------------------
  |  Branch (1304:17): [True: 111, False: 390]
  ------------------
 1305|    111|              return ipv4_fast_fail;
 1306|    111|            }
 1307|    501|          }
 1308|    717|        }
 1309|    781|      }
 1310|  1.43k|    }
 1311|  1.37k|    ipv4 = (ipv4 << 8) | val;
 1312|  1.37k|    if (i < 3) {
  ------------------
  |  Branch (1312:9): [True: 1.12k, False: 255]
  ------------------
 1313|  1.12k|      if (p == pend || *p != '.') [[unlikely]] {
  ------------------
  |  Branch (1313:11): [True: 11, False: 1.10k]
  |  Branch (1313:24): [True: 223, False: 886]
  ------------------
 1314|    234|        return ipv4_fast_fail;
 1315|    234|      }
 1316|    886|      ++p;
 1317|    886|    }
 1318|  1.37k|  }
 1319|    255|  if (p != pend) {
  ------------------
  |  Branch (1319:7): [True: 27, False: 228]
  ------------------
 1320|     27|    if (p == pend - 1 && *p == '.') {
  ------------------
  |  Branch (1320:9): [True: 15, False: 12]
  |  Branch (1320:26): [True: 5, False: 10]
  ------------------
 1321|      5|      return ipv4;
 1322|      5|    }
 1323|     22|    return ipv4_fast_fail;
 1324|     27|  }
 1325|    228|  return ipv4;
 1326|    255|}
_ZNK3ada8url_base10is_specialEv:
 7192|  20.1k|    const noexcept {
 7193|  20.1k|  return type != ada::scheme::NOT_SPECIAL;
 7194|  20.1k|}
_ZN3ada8checkers8is_alphaEc:
 1257|  7.38k|constexpr bool is_alpha(char x) noexcept {
 1258|  7.38k|  return (to_lower(x) >= 'a') && (to_lower(x) <= 'z');
  ------------------
  |  Branch (1258:10): [True: 5.86k, False: 1.52k]
  |  Branch (1258:34): [True: 5.75k, False: 116]
  ------------------
 1259|  7.38k|}
_ZN3ada8checkers8to_lowerEc:
 1255|  13.2k|constexpr char to_lower(char x) noexcept { return (x | 0x20); }
_ZNK3ada8url_base19scheme_default_portEv:
 7201|     84|url_base::scheme_default_port() const noexcept {
 7202|     84|  return scheme::get_special_port(type);
 7203|     84|}
_ZN3ada6scheme16get_special_portENS0_4typeE:
 6706|     84|constexpr uint16_t get_special_port(ada::scheme::type type) noexcept {
 6707|     84|  return details::special_ports[int(type)];
 6708|     84|}
_ZN3ada8checkers23is_windows_drive_letterENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1261|  2.87k|constexpr bool is_windows_drive_letter(std::string_view input) noexcept {
 1262|  2.87k|  return input.size() >= 2 &&
  ------------------
  |  Branch (1262:10): [True: 2.24k, False: 627]
  ------------------
 1263|  2.24k|         (is_alpha(input[0]) && ((input[1] == ':') || (input[1] == '|'))) &&
  ------------------
  |  Branch (1263:11): [True: 640, False: 1.60k]
  |  Branch (1263:34): [True: 14, False: 626]
  |  Branch (1263:55): [True: 6, False: 620]
  ------------------
 1264|     20|         ((input.size() == 2) || (input[2] == '/' || input[2] == '\\' ||
  ------------------
  |  Branch (1264:11): [True: 2, False: 18]
  |  Branch (1264:35): [True: 5, False: 13]
  |  Branch (1264:54): [True: 1, False: 12]
  ------------------
 1265|     12|                                  input[2] == '?' || input[2] == '#'));
  ------------------
  |  Branch (1265:35): [True: 1, False: 11]
  |  Branch (1265:54): [True: 1, False: 10]
  ------------------
 1266|  2.87k|}
_ZN3ada8checkers34is_normalized_windows_drive_letterENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1269|  2.87k|    std::string_view input) noexcept {
 1270|  2.87k|  return input.size() == 2 && (is_alpha(input[0]) && (input[1] == ':'));
  ------------------
  |  Branch (1270:10): [True: 42, False: 2.83k]
  |  Branch (1270:32): [True: 13, False: 29]
  |  Branch (1270:54): [True: 1, False: 12]
  ------------------
 1271|  2.87k|}
_ZN3ada7helpers14leading_zeroesEj:
 1934|  5.16k|inline int leading_zeroes(uint32_t input_num) noexcept {
 1935|       |#if ADA_REGULAR_VISUAL_STUDIO
 1936|       |  unsigned long leading_zero(0);
 1937|       |  unsigned long in(input_num);
 1938|       |  return _BitScanReverse(&leading_zero, in) ? int(31 - leading_zero) : 32;
 1939|       |#else
 1940|  5.16k|  return __builtin_clz(input_num);
 1941|  5.16k|#endif  // ADA_REGULAR_VISUAL_STUDIO
 1942|  5.16k|}
_ZN3ada14url_aggregator7reserveEj:
 8901|  5.09k|constexpr void ada::url_aggregator::reserve(uint32_t capacity) {
 8902|  5.09k|  buffer.reserve(capacity);
 8903|  5.09k|}
_ZN3ada14url_aggregator20update_base_pathnameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8391|    490|inline void url_aggregator::update_base_pathname(const std::string_view input) {
 8392|    490|  ada_log("url_aggregator::update_base_pathname '", input, "' [", input.size(),
 8393|    490|          " bytes] \n", to_diagram());
 8394|    490|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8395|    490|  ADA_ASSERT_TRUE(validate());
 8396|       |
 8397|    490|  const bool begins_with_dashdash = input.starts_with("//");
 8398|    490|  if (!begins_with_dashdash && has_dash_dot()) {
  ------------------
  |  Branch (8398:7): [True: 366, False: 124]
  |  Branch (8398:32): [True: 0, False: 366]
  ------------------
 8399|       |    // We must delete the ./
 8400|      0|    delete_dash_dot();
 8401|      0|  }
 8402|       |
 8403|    490|  if (begins_with_dashdash && !has_opaque_path && !has_authority() &&
  ------------------
  |  Branch (8403:7): [True: 124, False: 366]
  |  Branch (8403:31): [True: 124, False: 0]
  |  Branch (8403:51): [True: 0, False: 124]
  ------------------
 8404|      0|      !has_dash_dot()) {
  ------------------
  |  Branch (8404:7): [True: 0, False: 0]
  ------------------
 8405|       |    // If url's host is null, url does not have an opaque path, url's path's
 8406|       |    // size is greater than 1, then append U+002F (/) followed by U+002E (.) to
 8407|       |    // output.
 8408|      0|    buffer.insert(components.pathname_start, "/.");
 8409|      0|    components.pathname_start += 2;
 8410|      0|    if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8410:9): [True: 0, False: 0]
  ------------------
 8411|      0|      components.search_start += 2;
 8412|      0|    }
 8413|      0|    if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8413:9): [True: 0, False: 0]
  ------------------
 8414|      0|      components.hash_start += 2;
 8415|      0|    }
 8416|      0|  }
 8417|       |
 8418|    490|  uint32_t difference = replace_and_resize(
 8419|    490|      components.pathname_start,
 8420|    490|      components.pathname_start + get_pathname_length(), input);
 8421|    490|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8421:7): [True: 0, False: 490]
  ------------------
 8422|      0|    components.search_start += difference;
 8423|      0|  }
 8424|    490|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8424:7): [True: 0, False: 490]
  ------------------
 8425|      0|    components.hash_start += difference;
 8426|      0|  }
 8427|    490|  ADA_ASSERT_TRUE(validate());
 8428|    490|}
_ZN3ada14url_aggregator18replace_and_resizeEjjNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8234|  2.11k|    uint32_t start, uint32_t end, std::string_view input) {
 8235|  2.11k|  uint32_t current_length = end - start;
 8236|  2.11k|  uint32_t input_size = uint32_t(input.size());
 8237|  2.11k|  uint32_t new_difference = input_size - current_length;
 8238|       |
 8239|  2.11k|  if (current_length == 0) {
  ------------------
  |  Branch (8239:7): [True: 1.64k, False: 470]
  ------------------
 8240|  1.64k|    buffer.insert(start, input);
 8241|  1.64k|  } else if (input_size == current_length) {
  ------------------
  |  Branch (8241:14): [True: 11, False: 459]
  ------------------
 8242|     11|    buffer.replace(start, input_size, input);
 8243|    459|  } else if (input_size < current_length) {
  ------------------
  |  Branch (8243:14): [True: 27, False: 432]
  ------------------
 8244|     27|    buffer.erase(start, current_length - input_size);
 8245|     27|    buffer.replace(start, input_size, input);
 8246|    432|  } else {
 8247|    432|    buffer.replace(start, current_length, input.substr(0, current_length));
 8248|    432|    buffer.insert(start + current_length, input.substr(current_length));
 8249|    432|  }
 8250|       |
 8251|  2.11k|  return new_difference;
 8252|  2.11k|}
_ZNK3ada14url_aggregator19get_pathname_lengthEv:
 8283|    490|url_aggregator::get_pathname_length() const noexcept {
 8284|    490|  ada_log("url_aggregator::get_pathname_length");
 8285|    490|  uint32_t ending_index = uint32_t(buffer.size());
 8286|    490|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8286:7): [True: 0, False: 490]
  ------------------
 8287|      0|    ending_index = components.search_start;
 8288|    490|  } else if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8288:14): [True: 0, False: 490]
  ------------------
 8289|      0|    ending_index = components.hash_start;
 8290|      0|  }
 8291|    490|  return ending_index - components.pathname_start;
 8292|    490|}
_ZNK3ada14url_aggregator12get_pathnameEv:
 9228|    453|    ada_lifetime_bound {
 9229|    453|  ada_log("url_aggregator::get_pathname pathname_start = ",
 9230|    453|          components.pathname_start, " buffer.size() = ", buffer.size(),
 9231|    453|          " components.search_start = ", components.search_start,
 9232|    453|          " components.hash_start = ", components.hash_start);
 9233|    453|  auto ending_index = uint32_t(buffer.size());
 9234|    453|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (9234:7): [True: 0, False: 453]
  ------------------
 9235|      0|    ending_index = components.search_start;
 9236|    453|  } else if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (9236:14): [True: 0, False: 453]
  ------------------
 9237|      0|    ending_index = components.hash_start;
 9238|      0|  }
 9239|    453|  return helpers::substring(buffer, components.pathname_start, ending_index);
 9240|    453|}
_ZN3ada14url_aggregator26update_unencoded_base_hashENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8210|     71|inline void url_aggregator::update_unencoded_base_hash(std::string_view input) {
 8211|     71|  ada_log("url_aggregator::update_unencoded_base_hash ", input, " [",
 8212|     71|          input.size(), " bytes], buffer is '", buffer, "' [", buffer.size(),
 8213|     71|          " bytes] components.hash_start = ", components.hash_start);
 8214|     71|  ADA_ASSERT_TRUE(validate());
 8215|     71|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8216|     71|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8216:7): [True: 0, False: 71]
  ------------------
 8217|      0|    buffer.resize(components.hash_start);
 8218|      0|  }
 8219|     71|  components.hash_start = uint32_t(buffer.size());
 8220|     71|  buffer += "#";
 8221|     71|  bool encoding_required = unicode::percent_encode<true>(
 8222|     71|      input, ada::character_sets::FRAGMENT_PERCENT_ENCODE, buffer);
 8223|       |  // When encoding_required is false, then buffer is left unchanged, and percent
 8224|       |  // encoding was not deemed required.
 8225|     71|  if (!encoding_required) {
  ------------------
  |  Branch (8225:7): [True: 52, False: 19]
  ------------------
 8226|     52|    buffer.append(input);
 8227|     52|  }
 8228|     71|  ada_log("url_aggregator::update_unencoded_base_hash final buffer is '",
 8229|     71|          buffer, "' [", buffer.size(), " bytes]");
 8230|     71|  ADA_ASSERT_TRUE(validate());
 8231|     71|}
_ZN3ada14url_aggregator20append_base_passwordENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8619|    973|inline void url_aggregator::append_base_password(const std::string_view input) {
 8620|    973|  ada_log("url_aggregator::append_base_password ", input, " ", to_string(),
 8621|    973|          "\n", to_diagram());
 8622|    973|  ADA_ASSERT_TRUE(validate());
 8623|    973|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8624|       |#if ADA_DEVELOPMENT_CHECKS
 8625|       |  // computing the expected password.
 8626|       |  std::string password_expected = std::string(get_password());
 8627|       |  password_expected.append(input);
 8628|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8629|    973|  add_authority_slashes_if_needed();
 8630|       |
 8631|       |  // If input is empty, do nothing.
 8632|    973|  if (input.empty()) {
  ------------------
  |  Branch (8632:7): [True: 355, False: 618]
  ------------------
 8633|    355|    return;
 8634|    355|  }
 8635|       |
 8636|    618|  uint32_t difference = uint32_t(input.size());
 8637|    618|  if (has_password()) {
  ------------------
  |  Branch (8637:7): [True: 536, False: 82]
  ------------------
 8638|    536|    buffer.insert(components.host_start, input);
 8639|    536|  } else {
 8640|     82|    difference++;  // Increment for ":"
 8641|     82|    buffer.insert(components.username_end, ":");
 8642|     82|    buffer.insert(components.username_end + 1, input);
 8643|     82|  }
 8644|    618|  components.host_start += difference;
 8645|       |
 8646|       |  // The following line is required to add "@" to hostname. When updating
 8647|       |  // password if hostname does not start with "@", it is "append_base_password"s
 8648|       |  // responsibility to set it.
 8649|    618|  if (buffer[components.host_start] != '@') {
  ------------------
  |  Branch (8649:7): [True: 24, False: 594]
  ------------------
 8650|     24|    buffer.insert(components.host_start, "@");
 8651|     24|    difference++;
 8652|     24|  }
 8653|       |
 8654|    618|  components.host_end += difference;
 8655|    618|  components.pathname_start += difference;
 8656|    618|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8656:7): [True: 0, False: 618]
  ------------------
 8657|      0|    components.search_start += difference;
 8658|      0|  }
 8659|    618|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8659:7): [True: 0, False: 618]
  ------------------
 8660|      0|    components.hash_start += difference;
 8661|      0|  }
 8662|       |#if ADA_DEVELOPMENT_CHECKS
 8663|       |  std::string password_after(get_password());
 8664|       |  ADA_ASSERT_EQUAL(
 8665|       |      password_expected, password_after,
 8666|       |      "append_base_password problem after inserting " + std::string(input));
 8667|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8668|    618|  ADA_ASSERT_TRUE(validate());
 8669|    618|}
_ZN3ada14url_aggregator31add_authority_slashes_if_neededEv:
 8875|  3.93k|inline void ada::url_aggregator::add_authority_slashes_if_needed() {
 8876|  3.93k|  ada_log("url_aggregator::add_authority_slashes_if_needed");
 8877|  3.93k|  ADA_ASSERT_TRUE(validate());
 8878|       |  // Protocol setter will insert `http:` to the URL. It is up to hostname setter
 8879|       |  // to insert
 8880|       |  // `//` initially to the buffer, since it depends on the hostname existence.
 8881|  3.93k|  if (has_authority()) {
  ------------------
  |  Branch (8881:7): [True: 2.61k, False: 1.31k]
  ------------------
 8882|  2.61k|    return;
 8883|  2.61k|  }
 8884|       |  // Performance: the common case is components.protocol_end == buffer.size()
 8885|       |  // Optimization opportunity: in many cases, the "//" is part of the input and
 8886|       |  // the insert could be fused with another insert.
 8887|  1.31k|  buffer.insert(components.protocol_end, "//");
 8888|  1.31k|  components.username_end += 2;
 8889|  1.31k|  components.host_start += 2;
 8890|  1.31k|  components.host_end += 2;
 8891|  1.31k|  components.pathname_start += 2;
 8892|  1.31k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8892:7): [True: 0, False: 1.31k]
  ------------------
 8893|      0|    components.search_start += 2;
 8894|      0|  }
 8895|  1.31k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8895:7): [True: 0, False: 1.31k]
  ------------------
 8896|      0|    components.hash_start += 2;
 8897|      0|  }
 8898|  1.31k|  ADA_ASSERT_TRUE(validate());
 8899|  1.31k|}
_ZN3ada14url_aggregator20append_base_usernameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8501|  1.33k|inline void url_aggregator::append_base_username(const std::string_view input) {
 8502|  1.33k|  ada_log("url_aggregator::append_base_username ", input);
 8503|  1.33k|  ADA_ASSERT_TRUE(validate());
 8504|  1.33k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8505|       |#if ADA_DEVELOPMENT_CHECKS
 8506|       |  // computing the expected password.
 8507|       |  std::string username_expected(get_username());
 8508|       |  username_expected.append(input);
 8509|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8510|  1.33k|  add_authority_slashes_if_needed();
 8511|       |
 8512|       |  // If input is empty, do nothing.
 8513|  1.33k|  if (input.empty()) {
  ------------------
  |  Branch (8513:7): [True: 576, False: 755]
  ------------------
 8514|    576|    return;
 8515|    576|  }
 8516|       |
 8517|    755|  uint32_t difference = uint32_t(input.size());
 8518|    755|  buffer.insert(components.username_end, input);
 8519|    755|  components.username_end += difference;
 8520|    755|  components.host_start += difference;
 8521|       |
 8522|    755|  if (buffer[components.host_start] != '@' &&
  ------------------
  |  Branch (8522:7): [True: 133, False: 622]
  ------------------
 8523|    133|      components.host_start != components.host_end) {
  ------------------
  |  Branch (8523:7): [True: 133, False: 0]
  ------------------
 8524|    133|    buffer.insert(components.host_start, "@");
 8525|    133|    difference++;
 8526|    133|  }
 8527|       |
 8528|    755|  components.host_end += difference;
 8529|    755|  components.pathname_start += difference;
 8530|    755|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8530:7): [True: 0, False: 755]
  ------------------
 8531|      0|    components.search_start += difference;
 8532|      0|  }
 8533|    755|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8533:7): [True: 0, False: 755]
  ------------------
 8534|      0|    components.hash_start += difference;
 8535|      0|  }
 8536|       |#if ADA_DEVELOPMENT_CHECKS
 8537|       |  std::string username_after(get_username());
 8538|       |  ADA_ASSERT_EQUAL(
 8539|       |      username_expected, username_after,
 8540|       |      "append_base_username problem after inserting " + std::string(input));
 8541|       |#endif  // ADA_DEVELOPMENT_CHECKS
 8542|    755|  ADA_ASSERT_TRUE(validate());
 8543|    755|}
_ZN3ada14url_aggregator16update_base_portEj:
 8671|     63|inline void url_aggregator::update_base_port(uint32_t input) {
 8672|     63|  ada_log("url_aggregator::update_base_port");
 8673|     63|  ADA_ASSERT_TRUE(validate());
 8674|     63|  if (input == url_components::omitted) {
  ------------------
  |  Branch (8674:7): [True: 0, False: 63]
  ------------------
 8675|      0|    clear_port();
 8676|      0|    return;
 8677|      0|  }
 8678|       |  // calling std::to_string(input.value()) is unfortunate given that the port
 8679|       |  // value is probably already available as a string.
 8680|     63|  std::string value = helpers::concat(":", std::to_string(input));
 8681|     63|  uint32_t difference = uint32_t(value.size());
 8682|       |
 8683|     63|  if (components.port != url_components::omitted) {
  ------------------
  |  Branch (8683:7): [True: 0, False: 63]
  ------------------
 8684|      0|    difference -= components.pathname_start - components.host_end;
 8685|      0|    buffer.erase(components.host_end,
 8686|      0|                 components.pathname_start - components.host_end);
 8687|      0|  }
 8688|       |
 8689|     63|  buffer.insert(components.host_end, value);
 8690|     63|  components.pathname_start += difference;
 8691|     63|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8691:7): [True: 0, False: 63]
  ------------------
 8692|      0|    components.search_start += difference;
 8693|      0|  }
 8694|     63|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8694:7): [True: 0, False: 63]
  ------------------
 8695|      0|    components.hash_start += difference;
 8696|      0|  }
 8697|     63|  components.port = input;
 8698|     63|  ADA_ASSERT_TRUE(validate());
 8699|     63|}
_ZN3ada7helpers6concatIJPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEESA_DpT_:
 1924|     63|std::string concat(Args... args) {
 1925|     63|  std::string answer;
 1926|     63|  inner_concat(answer, args...);
 1927|     63|  return answer;
 1928|     63|}
_ZN3ada7helpers12inner_concatIPKcJNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEEvRSA_T_DpT0_:
 1913|     63|inline void inner_concat(std::string& buffer, T t, Args... args) {
 1914|     63|  buffer.append(t);
 1915|     63|  return inner_concat(buffer, args...);
 1916|     63|}
_ZN3ada7helpers12inner_concatINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEJEEEvRS8_T_:
 1905|     63|inline void inner_concat(std::string& buffer, T t) {
 1906|     63|  buffer.append(t);
 1907|     63|}
_ZN3ada14url_aggregator18update_base_searchENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKh:
 8339|    280|    std::string_view input, const uint8_t query_percent_encode_set[]) {
 8340|    280|  ada_log("url_aggregator::update_base_search ", input,
 8341|    280|          " with encoding parameter ", to_string(), "\n", to_diagram());
 8342|    280|  ADA_ASSERT_TRUE(validate());
 8343|    280|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8344|       |
 8345|    280|  if (components.hash_start == url_components::omitted) {
  ------------------
  |  Branch (8345:7): [True: 280, False: 0]
  ------------------
 8346|    280|    if (components.search_start == url_components::omitted) {
  ------------------
  |  Branch (8346:9): [True: 280, False: 0]
  ------------------
 8347|    280|      components.search_start = uint32_t(buffer.size());
 8348|    280|      buffer += "?";
 8349|    280|    } else {
 8350|      0|      buffer.resize(components.search_start + 1);
 8351|      0|    }
 8352|       |
 8353|    280|    bool encoding_required =
 8354|    280|        unicode::percent_encode<true>(input, query_percent_encode_set, buffer);
 8355|       |    // When encoding_required is false, then buffer is left unchanged, and
 8356|       |    // percent encoding was not deemed required.
 8357|    280|    if (!encoding_required) {
  ------------------
  |  Branch (8357:9): [True: 240, False: 40]
  ------------------
 8358|    240|      buffer.append(input);
 8359|    240|    }
 8360|    280|  } else {
 8361|      0|    if (components.search_start == url_components::omitted) {
  ------------------
  |  Branch (8361:9): [True: 0, False: 0]
  ------------------
 8362|      0|      components.search_start = components.hash_start;
 8363|      0|    } else {
 8364|      0|      buffer.erase(components.search_start,
 8365|      0|                   components.hash_start - components.search_start);
 8366|      0|      components.hash_start = components.search_start;
 8367|      0|    }
 8368|       |
 8369|      0|    buffer.insert(components.search_start, "?");
 8370|      0|    size_t idx =
 8371|      0|        ada::unicode::percent_encode_index(input, query_percent_encode_set);
 8372|      0|    if (idx == input.size()) {
  ------------------
  |  Branch (8372:9): [True: 0, False: 0]
  ------------------
 8373|      0|      buffer.insert(components.search_start + 1, input);
 8374|      0|      components.hash_start += uint32_t(input.size() + 1);  // Do not forget `?`
 8375|      0|    } else {
 8376|      0|      buffer.insert(components.search_start + 1, input, 0, idx);
 8377|      0|      input.remove_prefix(idx);
 8378|       |      // We only create a temporary string if we need percent encoding and
 8379|       |      // we attempt to create as small a temporary string as we can.
 8380|      0|      std::string encoded =
 8381|      0|          ada::unicode::percent_encode(input, query_percent_encode_set);
 8382|      0|      buffer.insert(components.search_start + idx + 1, encoded);
 8383|      0|      components.hash_start +=
 8384|      0|          uint32_t(encoded.size() + idx + 1);  // Do not forget `?`
 8385|      0|    }
 8386|      0|  }
 8387|       |
 8388|    280|  ADA_ASSERT_TRUE(validate());
 8389|    280|}
_ZN3ada14url_aggregator20update_base_hostnameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 8254|  1.62k|inline void url_aggregator::update_base_hostname(const std::string_view input) {
 8255|  1.62k|  ada_log("url_aggregator::update_base_hostname ", input, " [", input.size(),
 8256|  1.62k|          " bytes], buffer is '", buffer, "' [", buffer.size(), " bytes]");
 8257|  1.62k|  ADA_ASSERT_TRUE(validate());
 8258|  1.62k|  ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
 8259|       |
 8260|       |  // This next line is required for when parsing a URL like `foo://`
 8261|  1.62k|  add_authority_slashes_if_needed();
 8262|       |
 8263|  1.62k|  bool has_credentials = components.protocol_end + 2 < components.host_start;
 8264|  1.62k|  uint32_t new_difference =
 8265|  1.62k|      replace_and_resize(components.host_start, components.host_end, input);
 8266|       |
 8267|  1.62k|  if (has_credentials) {
  ------------------
  |  Branch (8267:7): [True: 149, False: 1.47k]
  ------------------
 8268|    149|    buffer.insert(components.host_start, "@");
 8269|    149|    new_difference++;
 8270|    149|  }
 8271|  1.62k|  components.host_end += new_difference;
 8272|  1.62k|  components.pathname_start += new_difference;
 8273|  1.62k|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8273:7): [True: 0, False: 1.62k]
  ------------------
 8274|      0|    components.search_start += new_difference;
 8275|      0|  }
 8276|  1.62k|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8276:7): [True: 0, False: 1.62k]
  ------------------
 8277|      0|    components.hash_start += new_difference;
 8278|      0|  }
 8279|  1.62k|  ADA_ASSERT_TRUE(validate());
 8280|  1.62k|}
_ZN3ada14url_aggregator10parse_portENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEb:
 8989|    272|url_aggregator::parse_port(std::string_view view, bool check_trailing_content) {
 8990|    272|  ada_log("url_aggregator::parse_port('", view, "') ", view.size());
 8991|    272|  if (!view.empty() && view[0] == '-') {
  ------------------
  |  Branch (8991:7): [True: 271, False: 1]
  |  Branch (8991:24): [True: 1, False: 270]
  ------------------
 8992|      1|    ada_log("parse_port: view[0] == '0' && view.size() > 1");
 8993|      1|    is_valid = false;
 8994|      1|    return 0;
 8995|      1|  }
 8996|    271|  uint16_t parsed_port{};
 8997|    271|  auto r = std::from_chars(view.data(), view.data() + view.size(), parsed_port);
 8998|    271|  if (r.ec == std::errc::result_out_of_range) {
  ------------------
  |  Branch (8998:7): [True: 25, False: 246]
  ------------------
 8999|     25|    ada_log("parse_port: r.ec == std::errc::result_out_of_range");
 9000|     25|    is_valid = false;
 9001|     25|    return 0;
 9002|     25|  }
 9003|    246|  ada_log("parse_port: ", parsed_port);
 9004|    246|  const size_t consumed = size_t(r.ptr - view.data());
 9005|    246|  ada_log("parse_port: consumed ", consumed);
 9006|    246|  if (check_trailing_content) {
  ------------------
  |  Branch (9006:7): [True: 246, False: 0]
  ------------------
 9007|    246|    is_valid &=
 9008|    246|        (consumed == view.size() || view[consumed] == '/' ||
  ------------------
  |  Branch (9008:10): [True: 20, False: 226]
  |  Branch (9008:37): [True: 46, False: 180]
  ------------------
 9009|    180|         view[consumed] == '?' || (is_special() && view[consumed] == '\\'));
  ------------------
  |  Branch (9009:10): [True: 8, False: 172]
  |  Branch (9009:36): [True: 172, False: 0]
  |  Branch (9009:52): [True: 10, False: 162]
  ------------------
 9010|    246|  }
 9011|    246|  ada_log("parse_port: is_valid = ", is_valid);
 9012|    246|  if (is_valid) {
  ------------------
  |  Branch (9012:7): [True: 84, False: 162]
  ------------------
 9013|     84|    ada_log("parse_port", r.ec == std::errc());
 9014|       |    // scheme_default_port can return 0, and we should allow 0 as a base port.
 9015|     84|    auto default_port = scheme_default_port();
 9016|     84|    bool is_port_valid = (default_port == 0 && parsed_port == 0) ||
  ------------------
  |  Branch (9016:27): [True: 0, False: 84]
  |  Branch (9016:48): [True: 0, False: 0]
  ------------------
 9017|     84|                         (default_port != parsed_port);
  ------------------
  |  Branch (9017:26): [True: 83, False: 1]
  ------------------
 9018|     84|    if (r.ec == std::errc() && is_port_valid) {
  ------------------
  |  Branch (9018:9): [True: 64, False: 20]
  |  Branch (9018:32): [True: 63, False: 1]
  ------------------
 9019|     63|      update_base_port(parsed_port);
 9020|     63|    } else {
 9021|     21|      clear_port();
 9022|     21|    }
 9023|     84|  }
 9024|    246|  return consumed;
 9025|    271|}
_ZN3ada7unicode20percent_encode_indexENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPKh:
 8112|  2.87k|                                              const uint8_t character_set[]) {
 8113|  2.87k|  const char* data = input.data();
 8114|  2.87k|  const size_t size = input.size();
 8115|       |
 8116|       |  // Process 8 bytes at a time using unrolled loop
 8117|  2.87k|  size_t i = 0;
 8118|  3.31k|  for (; i + 8 <= size; i += 8) {
  ------------------
  |  Branch (8118:10): [True: 773, False: 2.54k]
  ------------------
 8119|    773|    unsigned char chunk[8];
 8120|    773|    std::memcpy(&chunk, data + i,
 8121|    773|                8);  // entices compiler to unconditionally process 8 characters
 8122|       |
 8123|       |    // Check 8 characters at once
 8124|  4.75k|    for (size_t j = 0; j < 8; j++) {
  ------------------
  |  Branch (8124:24): [True: 4.31k, False: 441]
  ------------------
 8125|  4.31k|      if (character_sets::bit_at(character_set, chunk[j])) {
  ------------------
  |  Branch (8125:11): [True: 332, False: 3.98k]
  ------------------
 8126|    332|        return i + j;
 8127|    332|      }
 8128|  4.31k|    }
 8129|    773|  }
 8130|       |
 8131|       |  // Handle remaining bytes
 8132|  4.85k|  for (; i < size; i++) {
  ------------------
  |  Branch (8132:10): [True: 2.86k, False: 1.98k]
  ------------------
 8133|  2.86k|    if (character_sets::bit_at(character_set, data[i])) {
  ------------------
  |  Branch (8133:9): [True: 555, False: 2.31k]
  ------------------
 8134|    555|      return i;
 8135|    555|    }
 8136|  2.86k|  }
 8137|       |
 8138|  1.98k|  return size;
 8139|  2.54k|}
_ZN3ada14url_aggregator10clear_portEv:
 8701|     21|inline void url_aggregator::clear_port() {
 8702|     21|  ada_log("url_aggregator::clear_port");
 8703|     21|  ADA_ASSERT_TRUE(validate());
 8704|     21|  if (components.port == url_components::omitted) {
  ------------------
  |  Branch (8704:7): [True: 21, False: 0]
  ------------------
 8705|     21|    return;
 8706|     21|  }
 8707|      0|  uint32_t length = components.pathname_start - components.host_end;
 8708|      0|  buffer.erase(components.host_end, length);
 8709|      0|  components.pathname_start -= length;
 8710|      0|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (8710:7): [True: 0, False: 0]
  ------------------
 8711|      0|    components.search_start -= length;
 8712|      0|  }
 8713|      0|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (8713:7): [True: 0, False: 0]
  ------------------
 8714|      0|    components.hash_start -= length;
 8715|      0|  }
 8716|      0|  components.port = url_components::omitted;
 8717|      0|  ADA_ASSERT_TRUE(validate());
 8718|      0|}
_ZNK3ada14url_aggregator13has_authorityEv:
 8866|  4.05k|    const noexcept {
 8867|  4.05k|  ada_log("url_aggregator::has_authority");
 8868|       |  // Performance: instead of doing this potentially expensive check, we could
 8869|       |  // have a boolean in the struct.
 8870|  4.05k|  return components.protocol_end + 2 <= components.host_start &&
  ------------------
  |  Branch (8870:10): [True: 2.73k, False: 1.31k]
  ------------------
 8871|  2.73k|         buffer[components.protocol_end] == '/' &&
  ------------------
  |  Branch (8871:10): [True: 2.73k, False: 0]
  ------------------
 8872|  2.73k|         buffer[components.protocol_end + 1] == '/';
  ------------------
  |  Branch (8872:10): [True: 2.73k, False: 0]
  ------------------
 8873|  4.05k|}
_ZNK3ada14url_aggregator12has_dash_dotEv:
 8946|    366|[[nodiscard]] constexpr bool url_aggregator::has_dash_dot() const noexcept {
 8947|       |  // If url's host is null, url does not have an opaque path, url's path's size
 8948|       |  // is greater than 1, and url's path[0] is the empty string, then append
 8949|       |  // U+002F (/) followed by U+002E (.) to output.
 8950|    366|  ada_log("url_aggregator::has_dash_dot");
 8951|       |#if ADA_DEVELOPMENT_CHECKS
 8952|       |  // If pathname_start and host_end are exactly two characters apart, then we
 8953|       |  // either have a one-digit port such as http://test.com:5?param=1 or else we
 8954|       |  // have a /.: sequence such as "non-spec:/.//". We test that this is the case.
 8955|       |  if (components.pathname_start == components.host_end + 2) {
 8956|       |    ADA_ASSERT_TRUE((buffer[components.host_end] == '/' &&
 8957|       |                     buffer[components.host_end + 1] == '.') ||
 8958|       |                    (buffer[components.host_end] == ':' &&
 8959|       |                     checkers::is_digit(buffer[components.host_end + 1])));
 8960|       |  }
 8961|       |  if (components.pathname_start == components.host_end + 2 &&
 8962|       |      buffer[components.host_end] == '/' &&
 8963|       |      buffer[components.host_end + 1] == '.') {
 8964|       |    ADA_ASSERT_TRUE(components.pathname_start + 1 < buffer.size());
 8965|       |    ADA_ASSERT_TRUE(buffer[components.pathname_start] == '/');
 8966|       |    ADA_ASSERT_TRUE(buffer[components.pathname_start + 1] == '/');
 8967|       |  }
 8968|       |#endif
 8969|       |  // Performance: it should be uncommon for components.pathname_start ==
 8970|       |  // components.host_end + 2 to be true. So we put this check first in the
 8971|       |  // sequence. Most times, we do not have an opaque path. Checking for '/.' is
 8972|       |  // more expensive, but should be uncommon.
 8973|    366|  return components.pathname_start == components.host_end + 2 &&
  ------------------
  |  Branch (8973:10): [True: 6, False: 360]
  ------------------
 8974|      6|         !has_opaque_path && buffer[components.host_end] == '/' &&
  ------------------
  |  Branch (8974:10): [True: 6, False: 0]
  |  Branch (8974:30): [True: 0, False: 6]
  ------------------
 8975|      0|         buffer[components.host_end + 1] == '.';
  ------------------
  |  Branch (8975:10): [True: 0, False: 0]
  ------------------
 8976|    366|}
_ZNK2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEcvbEv:
 4030|  5.13k|  constexpr explicit operator bool() const noexcept { return this->m_has_val; }
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEEptEv:
 3999|  1.08k|  TL_EXPECTED_11_CONSTEXPR T* operator->() {
 4000|  1.08k|    TL_ASSERT(has_value());
  ------------------
  |  | 2052|  1.08k|#define TL_ASSERT(x) assert(x)
  ------------------
  |  Branch (4000:5): [True: 1.08k, False: 0]
  ------------------
 4001|  1.08k|    return valptr();
 4002|  1.08k|  }
_ZN2tl8expectedIN3ada14url_aggregatorENS1_6errorsEE6valptrEv:
 3295|  1.08k|  T* valptr() { return std::addressof(this->m_val); }
_ZNK2tl8expectedIN3ada14url_aggregatorENS1_6errorsEE9has_valueEv:
 4029|  1.08k|  constexpr bool has_value() const noexcept { return this->m_has_val; }
_ZN2tl6detail21expected_storage_baseIN3ada14url_aggregatorENS2_6errorsELb0ELb1EED2Ev:
 2627|  5.13k|  ~expected_storage_base() {
 2628|  5.13k|    if (m_has_val) {
  ------------------
  |  Branch (2628:9): [True: 943, False: 4.19k]
  ------------------
 2629|    943|      m_val.~T();
 2630|    943|    }
 2631|  5.13k|  }
_ZN3ada7helpers9substringENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEmm:
 1846|  3.12k|                                                       size_t pos2) {
 1847|       |#if ADA_DEVELOPMENT_CHECKS
 1848|       |  if (pos2 < pos1) {
 1849|       |    std::cerr << "Negative-length substring: [" << pos1 << " to " << pos2 << ")"
 1850|       |              << std::endl;
 1851|       |    abort();
 1852|       |  }
 1853|       |#endif
 1854|  3.12k|  return input.substr(pos1, pos2 - pos1);
 1855|  3.12k|}
_ZNK3ada14url_aggregator10is_at_pathEv:
 8295|    413|    const noexcept {
 8296|    413|  return buffer.size() == components.pathname_start;
 8297|    413|}
_ZN3ada8checkers8is_digitEc:
 1253|  11.6k|constexpr bool is_digit(char x) noexcept { return (x >= '0') & (x <= '9'); }
_ZNK3ada14url_aggregator12has_passwordEv:
 8915|    618|constexpr bool url_aggregator::has_password() const noexcept {
 8916|    618|  ada_log("url_aggregator::has_password");
 8917|       |  // This function does not care about the length of the password
 8918|    618|  return components.host_start > components.username_end &&
  ------------------
  |  Branch (8918:10): [True: 536, False: 82]
  ------------------
 8919|    536|         buffer[components.username_end] == ':';
  ------------------
  |  Branch (8919:10): [True: 536, False: 0]
  ------------------
 8920|    618|}
_ZNK3ada14url_aggregator8validateEv:
 9057|    943|[[nodiscard]] constexpr bool url_aggregator::validate() const noexcept {
 9058|    943|  if (!is_valid) {
  ------------------
  |  Branch (9058:7): [True: 0, False: 943]
  ------------------
 9059|      0|    return true;
 9060|      0|  }
 9061|    943|  if (!components.check_offset_consistency()) {
  ------------------
  |  Branch (9061:7): [True: 0, False: 943]
  ------------------
 9062|      0|    ada_log("url_aggregator::validate inconsistent components \n",
 9063|      0|            to_diagram());
 9064|      0|    return false;
 9065|      0|  }
 9066|       |  // We have a credible components struct, but let us investivate more
 9067|       |  // carefully:
 9068|       |  /**
 9069|       |   * https://user:pass@example.com:1234/foo/bar?baz#quux
 9070|       |   *       |     |    |          | ^^^^|       |   |
 9071|       |   *       |     |    |          | |   |       |   `----- hash_start
 9072|       |   *       |     |    |          | |   |       `--------- search_start
 9073|       |   *       |     |    |          | |   `----------------- pathname_start
 9074|       |   *       |     |    |          | `--------------------- port
 9075|       |   *       |     |    |          `----------------------- host_end
 9076|       |   *       |     |    `---------------------------------- host_start
 9077|       |   *       |     `--------------------------------------- username_end
 9078|       |   *       `--------------------------------------------- protocol_end
 9079|       |   */
 9080|    943|  if (components.protocol_end == url_components::omitted) {
  ------------------
  |  Branch (9080:7): [True: 0, False: 943]
  ------------------
 9081|      0|    ada_log("url_aggregator::validate omitted protocol_end \n", to_diagram());
 9082|      0|    return false;
 9083|      0|  }
 9084|    943|  if (components.username_end == url_components::omitted) {
  ------------------
  |  Branch (9084:7): [True: 0, False: 943]
  ------------------
 9085|      0|    ada_log("url_aggregator::validate omitted username_end \n", to_diagram());
 9086|      0|    return false;
 9087|      0|  }
 9088|    943|  if (components.host_start == url_components::omitted) {
  ------------------
  |  Branch (9088:7): [True: 0, False: 943]
  ------------------
 9089|      0|    ada_log("url_aggregator::validate omitted host_start \n", to_diagram());
 9090|      0|    return false;
 9091|      0|  }
 9092|    943|  if (components.host_end == url_components::omitted) {
  ------------------
  |  Branch (9092:7): [True: 0, False: 943]
  ------------------
 9093|      0|    ada_log("url_aggregator::validate omitted host_end \n", to_diagram());
 9094|      0|    return false;
 9095|      0|  }
 9096|    943|  if (components.pathname_start == url_components::omitted) {
  ------------------
  |  Branch (9096:7): [True: 0, False: 943]
  ------------------
 9097|      0|    ada_log("url_aggregator::validate omitted pathname_start \n", to_diagram());
 9098|      0|    return false;
 9099|      0|  }
 9100|       |
 9101|    943|  if (components.protocol_end > buffer.size()) {
  ------------------
  |  Branch (9101:7): [True: 0, False: 943]
  ------------------
 9102|      0|    ada_log("url_aggregator::validate protocol_end overflow \n", to_diagram());
 9103|      0|    return false;
 9104|      0|  }
 9105|    943|  if (components.username_end > buffer.size()) {
  ------------------
  |  Branch (9105:7): [True: 0, False: 943]
  ------------------
 9106|      0|    ada_log("url_aggregator::validate username_end overflow \n", to_diagram());
 9107|      0|    return false;
 9108|      0|  }
 9109|    943|  if (components.host_start > buffer.size()) {
  ------------------
  |  Branch (9109:7): [True: 0, False: 943]
  ------------------
 9110|      0|    ada_log("url_aggregator::validate host_start overflow \n", to_diagram());
 9111|      0|    return false;
 9112|      0|  }
 9113|    943|  if (components.host_end > buffer.size()) {
  ------------------
  |  Branch (9113:7): [True: 0, False: 943]
  ------------------
 9114|      0|    ada_log("url_aggregator::validate host_end overflow \n", to_diagram());
 9115|      0|    return false;
 9116|      0|  }
 9117|    943|  if (components.pathname_start > buffer.size()) {
  ------------------
  |  Branch (9117:7): [True: 0, False: 943]
  ------------------
 9118|      0|    ada_log("url_aggregator::validate pathname_start overflow \n",
 9119|      0|            to_diagram());
 9120|      0|    return false;
 9121|      0|  }
 9122|       |
 9123|    943|  if (components.protocol_end > 0) {
  ------------------
  |  Branch (9123:7): [True: 943, False: 0]
  ------------------
 9124|    943|    if (buffer[components.protocol_end - 1] != ':') {
  ------------------
  |  Branch (9124:9): [True: 0, False: 943]
  ------------------
 9125|      0|      ada_log(
 9126|      0|          "url_aggregator::validate missing : at the end of the protocol \n",
 9127|      0|          to_diagram());
 9128|      0|      return false;
 9129|      0|    }
 9130|    943|  }
 9131|       |
 9132|    943|  if (components.username_end != buffer.size() &&
  ------------------
  |  Branch (9132:7): [True: 943, False: 0]
  ------------------
 9133|    943|      components.username_end > components.protocol_end + 2) {
  ------------------
  |  Branch (9133:7): [True: 49, False: 894]
  ------------------
 9134|     49|    if (buffer[components.username_end] != ':' &&
  ------------------
  |  Branch (9134:9): [True: 24, False: 25]
  ------------------
 9135|     24|        buffer[components.username_end] != '@') {
  ------------------
  |  Branch (9135:9): [True: 0, False: 24]
  ------------------
 9136|      0|      ada_log(
 9137|      0|          "url_aggregator::validate missing : or @ at the end of the username "
 9138|      0|          "\n",
 9139|      0|          to_diagram());
 9140|      0|      return false;
 9141|      0|    }
 9142|     49|  }
 9143|       |
 9144|    943|  if (components.host_start != buffer.size()) {
  ------------------
  |  Branch (9144:7): [True: 943, False: 0]
  ------------------
 9145|    943|    if (components.host_start > components.username_end) {
  ------------------
  |  Branch (9145:9): [True: 39, False: 904]
  ------------------
 9146|     39|      if (buffer[components.host_start] != '@') {
  ------------------
  |  Branch (9146:11): [True: 0, False: 39]
  ------------------
 9147|      0|        ada_log(
 9148|      0|            "url_aggregator::validate missing @ at the end of the password \n",
 9149|      0|            to_diagram());
 9150|      0|        return false;
 9151|      0|      }
 9152|    904|    } else if (components.host_start == components.username_end &&
  ------------------
  |  Branch (9152:16): [True: 904, False: 0]
  ------------------
 9153|    904|               components.host_end > components.host_start) {
  ------------------
  |  Branch (9153:16): [True: 904, False: 0]
  ------------------
 9154|    904|      if (components.host_start == components.protocol_end + 2) {
  ------------------
  |  Branch (9154:11): [True: 880, False: 24]
  ------------------
 9155|    880|        if (buffer[components.protocol_end] != '/' ||
  ------------------
  |  Branch (9155:13): [True: 0, False: 880]
  ------------------
 9156|    880|            buffer[components.protocol_end + 1] != '/') {
  ------------------
  |  Branch (9156:13): [True: 0, False: 880]
  ------------------
 9157|      0|          ada_log(
 9158|      0|              "url_aggregator::validate missing // between protocol and host "
 9159|      0|              "\n",
 9160|      0|              to_diagram());
 9161|      0|          return false;
 9162|      0|        }
 9163|    880|      } else {
 9164|     24|        if (components.host_start > components.protocol_end &&
  ------------------
  |  Branch (9164:13): [True: 24, False: 0]
  ------------------
 9165|     24|            buffer[components.host_start] != '@') {
  ------------------
  |  Branch (9165:13): [True: 0, False: 24]
  ------------------
 9166|      0|          ada_log(
 9167|      0|              "url_aggregator::validate missing @ at the end of the username "
 9168|      0|              "\n",
 9169|      0|              to_diagram());
 9170|      0|          return false;
 9171|      0|        }
 9172|     24|      }
 9173|    904|    } else {
 9174|      0|      if (components.host_end != components.host_start) {
  ------------------
  |  Branch (9174:11): [True: 0, False: 0]
  ------------------
 9175|      0|        ada_log("url_aggregator::validate expected omitted host \n",
 9176|      0|                to_diagram());
 9177|      0|        return false;
 9178|      0|      }
 9179|      0|    }
 9180|    943|  }
 9181|    943|  if (components.host_end != buffer.size() &&
  ------------------
  |  Branch (9181:7): [True: 943, False: 0]
  ------------------
 9182|    943|      components.pathname_start > components.host_end) {
  ------------------
  |  Branch (9182:7): [True: 63, False: 880]
  ------------------
 9183|     63|    if (components.pathname_start == components.host_end + 2 &&
  ------------------
  |  Branch (9183:9): [True: 11, False: 52]
  ------------------
 9184|     11|        buffer[components.host_end] == '/' &&
  ------------------
  |  Branch (9184:9): [True: 0, False: 11]
  ------------------
 9185|      0|        buffer[components.host_end + 1] == '.') {
  ------------------
  |  Branch (9185:9): [True: 0, False: 0]
  ------------------
 9186|      0|      if (components.pathname_start + 1 >= buffer.size() ||
  ------------------
  |  Branch (9186:11): [True: 0, False: 0]
  ------------------
 9187|      0|          buffer[components.pathname_start] != '/' ||
  ------------------
  |  Branch (9187:11): [True: 0, False: 0]
  ------------------
 9188|      0|          buffer[components.pathname_start + 1] != '/') {
  ------------------
  |  Branch (9188:11): [True: 0, False: 0]
  ------------------
 9189|      0|        ada_log(
 9190|      0|            "url_aggregator::validate expected the path to begin with // \n",
 9191|      0|            to_diagram());
 9192|      0|        return false;
 9193|      0|      }
 9194|     63|    } else if (buffer[components.host_end] != ':') {
  ------------------
  |  Branch (9194:16): [True: 0, False: 63]
  ------------------
 9195|      0|      ada_log("url_aggregator::validate missing : at the port \n",
 9196|      0|              to_diagram());
 9197|      0|      return false;
 9198|      0|    }
 9199|     63|  }
 9200|    943|  if (components.pathname_start != buffer.size() &&
  ------------------
  |  Branch (9200:7): [True: 943, False: 0]
  ------------------
 9201|    943|      components.pathname_start < components.search_start &&
  ------------------
  |  Branch (9201:7): [True: 943, False: 0]
  ------------------
 9202|    943|      components.pathname_start < components.hash_start && !has_opaque_path) {
  ------------------
  |  Branch (9202:7): [True: 943, False: 0]
  |  Branch (9202:60): [True: 943, False: 0]
  ------------------
 9203|    943|    if (buffer[components.pathname_start] != '/') {
  ------------------
  |  Branch (9203:9): [True: 0, False: 943]
  ------------------
 9204|      0|      ada_log("url_aggregator::validate missing / at the path \n",
 9205|      0|              to_diagram());
 9206|      0|      return false;
 9207|      0|    }
 9208|    943|  }
 9209|    943|  if (components.search_start != url_components::omitted) {
  ------------------
  |  Branch (9209:7): [True: 289, False: 654]
  ------------------
 9210|    289|    if (buffer[components.search_start] != '?') {
  ------------------
  |  Branch (9210:9): [True: 0, False: 289]
  ------------------
 9211|      0|      ada_log("url_aggregator::validate missing ? at the search \n",
 9212|      0|              to_diagram());
 9213|      0|      return false;
 9214|      0|    }
 9215|    289|  }
 9216|    943|  if (components.hash_start != url_components::omitted) {
  ------------------
  |  Branch (9216:7): [True: 81, False: 862]
  ------------------
 9217|     81|    if (buffer[components.hash_start] != '#') {
  ------------------
  |  Branch (9217:9): [True: 0, False: 81]
  ------------------
 9218|      0|      ada_log("url_aggregator::validate missing # at the hash \n",
 9219|      0|              to_diagram());
 9220|      0|      return false;
 9221|      0|    }
 9222|     81|  }
 9223|       |
 9224|    943|  return true;
 9225|    943|}
_ZNK3ada14url_components24check_offset_consistencyEv:
 7572|    943|    const noexcept {
 7573|       |  /**
 7574|       |   * https://user:pass@example.com:1234/foo/bar?baz#quux
 7575|       |   *       |     |    |          | ^^^^|       |   |
 7576|       |   *       |     |    |          | |   |       |   `----- hash_start
 7577|       |   *       |     |    |          | |   |       `--------- search_start
 7578|       |   *       |     |    |          | |   `----------------- pathname_start
 7579|       |   *       |     |    |          | `--------------------- port
 7580|       |   *       |     |    |          `----------------------- host_end
 7581|       |   *       |     |    `---------------------------------- host_start
 7582|       |   *       |     `--------------------------------------- username_end
 7583|       |   *       `--------------------------------------------- protocol_end
 7584|       |   */
 7585|       |  // These conditions can be made more strict.
 7586|    943|  if (protocol_end == url_components::omitted) {
  ------------------
  |  Branch (7586:7): [True: 0, False: 943]
  ------------------
 7587|      0|    return false;
 7588|      0|  }
 7589|    943|  uint32_t index = protocol_end;
 7590|       |
 7591|    943|  if (username_end == url_components::omitted) {
  ------------------
  |  Branch (7591:7): [True: 0, False: 943]
  ------------------
 7592|      0|    return false;
 7593|      0|  }
 7594|    943|  if (username_end < index) {
  ------------------
  |  Branch (7594:7): [True: 0, False: 943]
  ------------------
 7595|      0|    return false;
 7596|      0|  }
 7597|    943|  index = username_end;
 7598|       |
 7599|    943|  if (host_start == url_components::omitted) {
  ------------------
  |  Branch (7599:7): [True: 0, False: 943]
  ------------------
 7600|      0|    return false;
 7601|      0|  }
 7602|    943|  if (host_start < index) {
  ------------------
  |  Branch (7602:7): [True: 0, False: 943]
  ------------------
 7603|      0|    return false;
 7604|      0|  }
 7605|    943|  index = host_start;
 7606|       |
 7607|    943|  if (port != url_components::omitted) {
  ------------------
  |  Branch (7607:7): [True: 63, False: 880]
  ------------------
 7608|     63|    if (port > 0xffff) {
  ------------------
  |  Branch (7608:9): [True: 0, False: 63]
  ------------------
 7609|      0|      return false;
 7610|      0|    }
 7611|     63|    uint32_t port_length = helpers::fast_digit_count(port) + 1;
 7612|     63|    if (index + port_length < index) {
  ------------------
  |  Branch (7612:9): [True: 0, False: 63]
  ------------------
 7613|      0|      return false;
 7614|      0|    }
 7615|     63|    index += port_length;
 7616|     63|  }
 7617|       |
 7618|    943|  if (pathname_start == url_components::omitted) {
  ------------------
  |  Branch (7618:7): [True: 0, False: 943]
  ------------------
 7619|      0|    return false;
 7620|      0|  }
 7621|    943|  if (pathname_start < index) {
  ------------------
  |  Branch (7621:7): [True: 0, False: 943]
  ------------------
 7622|      0|    return false;
 7623|      0|  }
 7624|    943|  index = pathname_start;
 7625|       |
 7626|    943|  if (search_start != url_components::omitted) {
  ------------------
  |  Branch (7626:7): [True: 289, False: 654]
  ------------------
 7627|    289|    if (search_start < index) {
  ------------------
  |  Branch (7627:9): [True: 0, False: 289]
  ------------------
 7628|      0|      return false;
 7629|      0|    }
 7630|    289|    index = search_start;
 7631|    289|  }
 7632|       |
 7633|    943|  if (hash_start != url_components::omitted) {
  ------------------
  |  Branch (7633:7): [True: 81, False: 862]
  ------------------
 7634|     81|    if (hash_start < index) {
  ------------------
  |  Branch (7634:9): [True: 0, False: 81]
  ------------------
 7635|      0|      return false;
 7636|      0|    }
 7637|     81|  }
 7638|       |
 7639|    943|  return true;
 7640|    943|}
_ZN3ada7helpers16fast_digit_countEj:
 1950|     63|inline int fast_digit_count(uint32_t x) noexcept {
 1951|     63|  auto int_log2 = [](uint32_t z) -> int {
 1952|     63|    return 31 - ada::helpers::leading_zeroes(z | 1);
 1953|     63|  };
 1954|       |  // Compiles to very few instructions. Note that the
 1955|       |  // table is static and thus effectively a constant.
 1956|       |  // We leave it inside the function because it is meaningless
 1957|       |  // outside of it (this comes at no performance cost).
 1958|     63|  const static uint64_t table[] = {
 1959|     63|      4294967296,  8589934582,  8589934582,  8589934582,  12884901788,
 1960|     63|      12884901788, 12884901788, 17179868184, 17179868184, 17179868184,
 1961|     63|      21474826480, 21474826480, 21474826480, 21474826480, 25769703776,
 1962|     63|      25769703776, 25769703776, 30063771072, 30063771072, 30063771072,
 1963|     63|      34349738368, 34349738368, 34349738368, 34349738368, 38554705664,
 1964|     63|      38554705664, 38554705664, 41949672960, 41949672960, 41949672960,
 1965|     63|      42949672960, 42949672960};
 1966|     63|  return int((x + table[int_log2(x)]) >> 32);
 1967|     63|}
_ZZN3ada7helpers16fast_digit_countEjENKUljE_clEj:
 1951|     63|  auto int_log2 = [](uint32_t z) -> int {
 1952|     63|    return 31 - ada::helpers::leading_zeroes(z | 1);
 1953|     63|  };

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

