_ZN3ada4idna13utf8_to_utf32EPKcmPDi:
  160|  14.8k|size_t utf8_to_utf32(const char* buf, size_t len, char32_t* utf32_output) {
  161|  14.8k|  const uint8_t* data = reinterpret_cast<const uint8_t*>(buf);
  162|  14.8k|  size_t pos = 0;
  163|  14.8k|  const char32_t* start{utf32_output};
  164|   133k|  while (pos < len) {
  ------------------
  |  Branch (164:10): [True: 119k, False: 13.9k]
  ------------------
  165|       |    // try to convert the next block of 16 ASCII bytes
  166|   119k|    if (pos + 16 <= len) {  // if it is safe to read 16 more
  ------------------
  |  Branch (166:9): [True: 51.1k, False: 68.3k]
  ------------------
  167|       |                            // bytes, check that they are ascii
  168|  51.1k|      uint64_t v1;
  169|  51.1k|      std::memcpy(&v1, data + pos, sizeof(uint64_t));
  170|  51.1k|      uint64_t v2;
  171|  51.1k|      std::memcpy(&v2, data + pos + sizeof(uint64_t), sizeof(uint64_t));
  172|  51.1k|      uint64_t v{v1 | v2};
  173|  51.1k|      if ((v & 0x8080808080808080) == 0) {
  ------------------
  |  Branch (173:11): [True: 10.2k, False: 40.8k]
  ------------------
  174|  10.2k|        size_t final_pos = pos + 16;
  175|   174k|        while (pos < final_pos) {
  ------------------
  |  Branch (175:16): [True: 164k, False: 10.2k]
  ------------------
  176|   164k|          *utf32_output++ = char32_t(buf[pos]);
  177|   164k|          pos++;
  178|   164k|        }
  179|  10.2k|        continue;
  180|  10.2k|      }
  181|  51.1k|    }
  182|   109k|    uint8_t leading_byte = data[pos];  // leading byte
  183|   109k|    if (leading_byte < 0b10000000) {
  ------------------
  |  Branch (183:9): [True: 59.9k, False: 49.2k]
  ------------------
  184|       |      // converting one ASCII byte !!!
  185|  59.9k|      *utf32_output++ = char32_t(leading_byte);
  186|  59.9k|      pos++;
  187|  59.9k|    } else if ((leading_byte & 0b11100000) == 0b11000000) {
  ------------------
  |  Branch (187:16): [True: 14.3k, False: 34.9k]
  ------------------
  188|       |      // We have a two-byte UTF-8
  189|  14.3k|      if (pos + 1 >= len) {
  ------------------
  |  Branch (189:11): [True: 53, False: 14.2k]
  ------------------
  190|     53|        return 0;
  191|     53|      }  // minimal bound checking
  192|  14.2k|      if ((data[pos + 1] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (192:11): [True: 93, False: 14.1k]
  ------------------
  193|     93|        return 0;
  194|     93|      }
  195|       |      // range check
  196|  14.1k|      uint32_t code_point =
  197|  14.1k|          (leading_byte & 0b00011111) << 6 | (data[pos + 1] & 0b00111111);
  198|  14.1k|      if (code_point < 0x80 || 0x7ff < code_point) {
  ------------------
  |  Branch (198:11): [True: 12, False: 14.1k]
  |  Branch (198:32): [True: 0, False: 14.1k]
  ------------------
  199|     12|        return 0;
  200|     12|      }
  201|  14.1k|      *utf32_output++ = char32_t(code_point);
  202|  14.1k|      pos += 2;
  203|  34.9k|    } else if ((leading_byte & 0b11110000) == 0b11100000) {
  ------------------
  |  Branch (203:16): [True: 32.5k, False: 2.37k]
  ------------------
  204|       |      // We have a three-byte UTF-8
  205|  32.5k|      if (pos + 2 >= len) {
  ------------------
  |  Branch (205:11): [True: 47, False: 32.4k]
  ------------------
  206|     47|        return 0;
  207|     47|      }  // minimal bound checking
  208|       |
  209|  32.4k|      if ((data[pos + 1] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (209:11): [True: 83, False: 32.4k]
  ------------------
  210|     83|        return 0;
  211|     83|      }
  212|  32.4k|      if ((data[pos + 2] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (212:11): [True: 29, False: 32.3k]
  ------------------
  213|     29|        return 0;
  214|     29|      }
  215|       |      // range check
  216|  32.3k|      uint32_t code_point = (leading_byte & 0b00001111) << 12 |
  217|  32.3k|                            (data[pos + 1] & 0b00111111) << 6 |
  218|  32.3k|                            (data[pos + 2] & 0b00111111);
  219|  32.3k|      if (code_point < 0x800 || 0xffff < code_point ||
  ------------------
  |  Branch (219:11): [True: 5, False: 32.3k]
  |  Branch (219:33): [True: 0, False: 32.3k]
  ------------------
  220|  32.3k|          (0xd7ff < code_point && code_point < 0xe000)) {
  ------------------
  |  Branch (220:12): [True: 20.2k, False: 12.1k]
  |  Branch (220:35): [True: 5, False: 20.2k]
  ------------------
  221|     10|        return 0;
  222|     10|      }
  223|  32.3k|      *utf32_output++ = char32_t(code_point);
  224|  32.3k|      pos += 3;
  225|  32.3k|    } else if ((leading_byte & 0b11111000) == 0b11110000) {  // 0b11110000
  ------------------
  |  Branch (225:16): [True: 1.95k, False: 417]
  ------------------
  226|       |      // we have a 4-byte UTF-8 word.
  227|  1.95k|      if (pos + 3 >= len) {
  ------------------
  |  Branch (227:11): [True: 48, False: 1.90k]
  ------------------
  228|     48|        return 0;
  229|     48|      }  // minimal bound checking
  230|  1.90k|      if ((data[pos + 1] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (230:11): [True: 52, False: 1.85k]
  ------------------
  231|     52|        return 0;
  232|     52|      }
  233|  1.85k|      if ((data[pos + 2] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (233:11): [True: 7, False: 1.84k]
  ------------------
  234|      7|        return 0;
  235|      7|      }
  236|  1.84k|      if ((data[pos + 3] & 0b11000000) != 0b10000000) {
  ------------------
  |  Branch (236:11): [True: 18, False: 1.83k]
  ------------------
  237|     18|        return 0;
  238|     18|      }
  239|       |
  240|       |      // range check
  241|  1.83k|      uint32_t code_point = (leading_byte & 0b00000111) << 18 |
  242|  1.83k|                            (data[pos + 1] & 0b00111111) << 12 |
  243|  1.83k|                            (data[pos + 2] & 0b00111111) << 6 |
  244|  1.83k|                            (data[pos + 3] & 0b00111111);
  245|  1.83k|      if (code_point <= 0xffff || 0x10ffff < code_point) {
  ------------------
  |  Branch (245:11): [True: 21, False: 1.81k]
  |  Branch (245:35): [True: 9, False: 1.80k]
  ------------------
  246|     30|        return 0;
  247|     30|      }
  248|  1.80k|      *utf32_output++ = char32_t(code_point);
  249|  1.80k|      pos += 4;
  250|  1.80k|    } else {
  251|    417|      return 0;
  252|    417|    }
  253|   109k|  }
  254|  13.9k|  return utf32_output - start;
  255|  14.8k|}
_ZN3ada4idna22utf8_length_from_utf32EPKDim:
  257|  8.54k|size_t utf8_length_from_utf32(const char32_t* buf, size_t len) {
  258|       |  // We are not BOM aware.
  259|  8.54k|  const uint32_t* p = reinterpret_cast<const uint32_t*>(buf);
  260|  8.54k|  size_t counter{0};
  261|   167k|  for (size_t i = 0; i != len; ++i) {
  ------------------
  |  Branch (261:22): [True: 158k, False: 8.54k]
  ------------------
  262|   158k|    ++counter;                                      // ASCII
  263|   158k|    counter += static_cast<size_t>(p[i] > 0x7F);    // two-byte
  264|   158k|    counter += static_cast<size_t>(p[i] > 0x7FF);   // three-byte
  265|   158k|    counter += static_cast<size_t>(p[i] > 0xFFFF);  // four-bytes
  266|   158k|  }
  267|  8.54k|  return counter;
  268|  8.54k|}
_ZN3ada4idna22utf32_length_from_utf8EPKcm:
  270|  16.6k|size_t utf32_length_from_utf8(const char* buf, size_t len) {
  271|  16.6k|  const int8_t* p = reinterpret_cast<const int8_t*>(buf);
  272|  16.6k|  return std::count_if(p, std::next(p, len), [](int8_t c) {
  273|       |    // -65 is 0b10111111, anything larger in two-complement's
  274|       |    // should start a new code point.
  275|  16.6k|    return c > -65;
  276|  16.6k|  });
  277|  16.6k|}
_ZN3ada4idna13utf32_to_utf8EPKDimPc:
  279|  8.54k|size_t utf32_to_utf8(const char32_t* buf, size_t len, char* utf8_output) {
  280|  8.54k|  const uint32_t* data = reinterpret_cast<const uint32_t*>(buf);
  281|  8.54k|  size_t pos = 0;
  282|  8.54k|  const char* start{utf8_output};
  283|   134k|  while (pos < len) {
  ------------------
  |  Branch (283:10): [True: 126k, False: 8.54k]
  ------------------
  284|       |    // try to convert the next block of 2 ASCII characters
  285|   126k|    if (pos + 2 <= len) {  // if it is safe to read 8 more
  ------------------
  |  Branch (285:9): [True: 118k, False: 7.63k]
  ------------------
  286|       |                           // bytes, check that they are ascii
  287|   118k|      uint64_t v;
  288|   118k|      std::memcpy(&v, data + pos, sizeof(uint64_t));
  289|   118k|      if ((v & 0xFFFFFF80FFFFFF80) == 0) {
  ------------------
  |  Branch (289:11): [True: 32.9k, False: 85.4k]
  ------------------
  290|  32.9k|        *utf8_output++ = char(buf[pos]);
  291|  32.9k|        *utf8_output++ = char(buf[pos + 1]);
  292|  32.9k|        pos += 2;
  293|  32.9k|        continue;
  294|  32.9k|      }
  295|   118k|    }
  296|  93.0k|    uint32_t word = data[pos];
  297|  93.0k|    if ((word & 0xFFFFFF80) == 0) {
  ------------------
  |  Branch (297:9): [True: 14.5k, False: 78.5k]
  ------------------
  298|       |      // will generate one UTF-8 bytes
  299|  14.5k|      *utf8_output++ = char(word);
  300|  14.5k|      pos++;
  301|  78.5k|    } else if ((word & 0xFFFFF800) == 0) {
  ------------------
  |  Branch (301:16): [True: 59.9k, False: 18.5k]
  ------------------
  302|       |      // will generate two UTF-8 bytes
  303|       |      // we have 0b110XXXXX 0b10XXXXXX
  304|  59.9k|      *utf8_output++ = char((word >> 6) | 0b11000000);
  305|  59.9k|      *utf8_output++ = char((word & 0b111111) | 0b10000000);
  306|  59.9k|      pos++;
  307|  59.9k|    } else if ((word & 0xFFFF0000) == 0) {
  ------------------
  |  Branch (307:16): [True: 15.8k, False: 2.72k]
  ------------------
  308|       |      // will generate three UTF-8 bytes
  309|       |      // we have 0b1110XXXX 0b10XXXXXX 0b10XXXXXX
  310|  15.8k|      if (word >= 0xD800 && word <= 0xDFFF) {
  ------------------
  |  Branch (310:11): [True: 5.13k, False: 10.7k]
  |  Branch (310:29): [True: 0, False: 5.13k]
  ------------------
  311|      0|        return 0;
  312|      0|      }
  313|  15.8k|      *utf8_output++ = char((word >> 12) | 0b11100000);
  314|  15.8k|      *utf8_output++ = char(((word >> 6) & 0b111111) | 0b10000000);
  315|  15.8k|      *utf8_output++ = char((word & 0b111111) | 0b10000000);
  316|  15.8k|      pos++;
  317|  15.8k|    } else {
  318|       |      // will generate four UTF-8 bytes
  319|       |      // we have 0b11110XXX 0b10XXXXXX 0b10XXXXXX
  320|       |      // 0b10XXXXXX
  321|  2.72k|      if (word > 0x10FFFF) {
  ------------------
  |  Branch (321:11): [True: 0, False: 2.72k]
  ------------------
  322|      0|        return 0;
  323|      0|      }
  324|  2.72k|      *utf8_output++ = char((word >> 18) | 0b11110000);
  325|  2.72k|      *utf8_output++ = char(((word >> 12) & 0b111111) | 0b10000000);
  326|  2.72k|      *utf8_output++ = char(((word >> 6) & 0b111111) | 0b10000000);
  327|  2.72k|      *utf8_output++ = char((word & 0b111111) | 0b10000000);
  328|  2.72k|      pos++;
  329|  2.72k|    }
  330|  93.0k|  }
  331|  8.54k|  return utf8_output - start;
  332|  8.54k|}
_ZN3ada4idna7deflate9BitReader3getEi:
  405|   457k|  uint32_t get(int n) {
  406|   457k|    if (!ensure(n)) return UINT32_MAX;
  ------------------
  |  Branch (406:9): [True: 0, False: 457k]
  ------------------
  407|   457k|    uint32_t v = acc & ((1u << n) - 1);
  408|   457k|    acc >>= n;
  409|   457k|    bits -= n;
  410|   457k|    return v;
  411|   457k|  }
_ZN3ada4idna9ascii_mapEPcm:
 5126|  13.5k|void ascii_map(char* input, size_t length) {
 5127|  13.5k|  auto broadcast = [](uint8_t v) -> uint64_t {
 5128|  13.5k|    return 0x101010101010101ull * v;
 5129|  13.5k|  };
 5130|  13.5k|  uint64_t broadcast_80 = broadcast(0x80);
 5131|  13.5k|  uint64_t broadcast_Ap = broadcast(128 - 'A');
 5132|  13.5k|  uint64_t broadcast_Zp = broadcast(128 - 'Z' - 1);
 5133|  13.5k|  size_t i = 0;
 5134|       |
 5135|  50.6k|  for (; i + 7 < length; i += 8) {
  ------------------
  |  Branch (5135:10): [True: 37.0k, False: 13.5k]
  ------------------
 5136|  37.0k|    uint64_t word{};
 5137|  37.0k|    std::memcpy(&word, input + i, sizeof(word));
 5138|  37.0k|    word ^=
 5139|  37.0k|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
 5140|  37.0k|    std::memcpy(input + i, &word, sizeof(word));
 5141|  37.0k|  }
 5142|  13.5k|  if (i < length) {
  ------------------
  |  Branch (5142:7): [True: 7.21k, False: 6.31k]
  ------------------
 5143|  7.21k|    uint64_t word{};
 5144|  7.21k|    std::memcpy(&word, input + i, length - i);
 5145|  7.21k|    word ^=
 5146|  7.21k|        (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2;
 5147|  7.21k|    std::memcpy(input + i, &word, length - i);
 5148|  7.21k|  }
 5149|  13.5k|}
_ZN3ada4idna3mapENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEERNS1_12basic_stringIDiS4_NS1_9allocatorIDiEEEE:
 5153|  18.3k|bool map(std::u32string_view input, std::u32string& out) {
 5154|       |  //  [Map](https://www.unicode.org/reports/tr46/#ProcessingStepMap).
 5155|  18.3k|  out.clear();
 5156|  18.3k|  if (!ensure_tables()) {
  ------------------
  |  Branch (5156:7): [True: 0, False: 18.3k]
  ------------------
 5157|      0|    return false;
 5158|      0|  }
 5159|       |
 5160|       |  // Pass 1: validate and compute exact output length.
 5161|  18.3k|  size_t out_size = 0;
 5162|   225k|  for (char32_t x : input) {
  ------------------
  |  Branch (5162:19): [True: 225k, False: 16.6k]
  ------------------
 5163|   225k|    uint16_t status = idna_lookup(static_cast<uint32_t>(x));
 5164|   225k|    if (status == IDNA_DISALLOWED) {
  ------------------
  |  Branch (5164:9): [True: 1.72k, False: 223k]
  ------------------
 5165|  1.72k|      return false;
 5166|  1.72k|    }
 5167|   223k|    if (status == IDNA_VALID) {
  ------------------
  |  Branch (5167:9): [True: 191k, False: 32.1k]
  ------------------
 5168|   191k|      ++out_size;
 5169|   191k|      continue;
 5170|   191k|    }
 5171|  32.1k|    if (static_cast<size_t>(status) >= idna_utf8_mappings_size) {
  ------------------
  |  Branch (5171:9): [True: 0, False: 32.1k]
  ------------------
 5172|      0|      return false;
 5173|      0|    }
 5174|  32.1k|    out_size += utf8_count_codepoints(idna_utf8_mappings + status);
 5175|  32.1k|  }
 5176|       |
 5177|       |  // Pass 2: write into a single allocation.
 5178|  16.6k|  out.resize(out_size);
 5179|  16.6k|  size_t w = 0;
 5180|   222k|  for (char32_t x : input) {
  ------------------
  |  Branch (5180:19): [True: 222k, False: 16.6k]
  ------------------
 5181|   222k|    uint16_t status = idna_lookup(static_cast<uint32_t>(x));
 5182|   222k|    if (status == IDNA_VALID) {
  ------------------
  |  Branch (5182:9): [True: 190k, False: 31.9k]
  ------------------
 5183|   190k|      out[w++] = x;
 5184|   190k|      continue;
 5185|   190k|    }
 5186|       |    // IGNORED or mapped (status already validated in pass 1).
 5187|  31.9k|    const uint8_t* ptr = idna_utf8_mappings + status;
 5188|   391k|    while (*ptr != 0) {
  ------------------
  |  Branch (5188:12): [True: 359k, False: 31.9k]
  ------------------
 5189|   359k|      out[w++] = utf8_next(ptr);
 5190|   359k|    }
 5191|  31.9k|  }
 5192|  16.6k|  return true;
 5193|  18.3k|}
_ZN3ada4idna3mapENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5195|  3.77k|std::u32string map(std::u32string_view input) {
 5196|  3.77k|  std::u32string answer;
 5197|  3.77k|  if (!map(input, answer)) {
  ------------------
  |  Branch (5197:7): [True: 281, False: 3.49k]
  ------------------
 5198|    281|    return {};
 5199|    281|  }
 5200|  3.49k|  return answer;
 5201|  3.77k|}
_ZN3ada4idna28compute_decomposition_lengthENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5286|  4.12k|    const std::u32string_view input) noexcept {
 5287|  4.12k|  bool decomposition_needed{false};
 5288|  4.12k|  size_t additional_elements{0};
 5289|  33.6k|  for (char32_t current_character : input) {
  ------------------
  |  Branch (5289:35): [True: 33.6k, False: 4.12k]
  ------------------
 5290|  33.6k|    size_t decomposition_length{0};
 5291|       |
 5292|  33.6k|    if (current_character >= hangul_sbase &&
  ------------------
  |  Branch (5292:9): [True: 3.29k, False: 30.3k]
  ------------------
 5293|  3.29k|        current_character < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5293:9): [True: 1.77k, False: 1.51k]
  ------------------
 5294|       |      // Full NFD-style Hangul decomp for the decompose() step.
 5295|  1.77k|      decomposition_length = 2;
 5296|  1.77k|      if ((current_character - hangul_sbase) % hangul_tcount) {
  ------------------
  |  Branch (5296:11): [True: 1.08k, False: 698]
  ------------------
 5297|  1.08k|        decomposition_length = 3;
 5298|  1.08k|      }
 5299|  31.8k|    } else if (current_character < 0x110000) {
  ------------------
  |  Branch (5299:16): [True: 31.8k, False: 0]
  ------------------
 5300|  31.8k|      const uint8_t di = decomposition_index[current_character >> 8];
 5301|  31.8k|      const uint16_t* const decomposition =
 5302|  31.8k|          decomposition_block_row(di) + (current_character % 256);
 5303|  31.8k|      decomposition_length = (decomposition[1] >> 2) - (decomposition[0] >> 2);
 5304|  31.8k|      if ((decomposition_length > 0) && (decomposition[0] & 1)) {
  ------------------
  |  Branch (5304:11): [True: 4.92k, False: 26.8k]
  |  Branch (5304:41): [True: 347, False: 4.58k]
  ------------------
 5305|    347|        decomposition_length = 0;
 5306|    347|      }
 5307|  31.8k|    }
 5308|  33.6k|    if (decomposition_length != 0) {
  ------------------
  |  Branch (5308:9): [True: 6.36k, False: 27.2k]
  ------------------
 5309|  6.36k|      decomposition_needed = true;
 5310|  6.36k|      additional_elements += decomposition_length - 1;
 5311|  6.36k|    }
 5312|  33.6k|  }
 5313|  4.12k|  return {decomposition_needed, additional_elements};
 5314|  4.12k|}
_ZN3ada4idna9decomposeERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEEm:
 5316|  2.79k|void decompose(std::u32string& input, size_t additional_elements) {
 5317|  2.79k|  input.resize(input.size() + additional_elements);
 5318|  2.79k|  for (size_t descending_idx = input.size(),
 5319|  2.79k|              input_count = descending_idx - additional_elements;
 5320|  25.8k|       input_count--;) {
  ------------------
  |  Branch (5320:8): [True: 23.0k, False: 2.79k]
  ------------------
 5321|  23.0k|    if (input[input_count] >= hangul_sbase &&
  ------------------
  |  Branch (5321:9): [True: 2.76k, False: 20.3k]
  ------------------
 5322|  2.76k|        input[input_count] < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5322:9): [True: 1.77k, False: 983]
  ------------------
 5323|       |      // Hangul decomposition.
 5324|  1.77k|      char32_t s_index = input[input_count] - hangul_sbase;
 5325|  1.77k|      if (s_index % hangul_tcount != 0) {
  ------------------
  |  Branch (5325:11): [True: 1.08k, False: 698]
  ------------------
 5326|  1.08k|        input[--descending_idx] = hangul_tbase + s_index % hangul_tcount;
 5327|  1.08k|      }
 5328|  1.77k|      input[--descending_idx] =
 5329|  1.77k|          hangul_vbase + (s_index % hangul_ncount) / hangul_tcount;
 5330|  1.77k|      input[--descending_idx] = hangul_lbase + s_index / hangul_ncount;
 5331|  21.3k|    } else if (input[input_count] < 0x110000) {
  ------------------
  |  Branch (5331:16): [True: 21.3k, False: 0]
  ------------------
 5332|  21.3k|      const uint16_t* decomposition =
 5333|  21.3k|          decomposition_block_row(
 5334|  21.3k|              decomposition_index[input[input_count] >> 8]) +
 5335|  21.3k|          (input[input_count] % 256);
 5336|  21.3k|      uint16_t decomposition_length =
 5337|  21.3k|          (decomposition[1] >> 2) - (decomposition[0] >> 2);
 5338|  21.3k|      if (decomposition_length > 0 && (decomposition[0] & 1)) {
  ------------------
  |  Branch (5338:11): [True: 4.91k, False: 16.3k]
  |  Branch (5338:39): [True: 337, False: 4.58k]
  ------------------
 5339|    337|        decomposition_length = 0;
 5340|    337|      }
 5341|  21.3k|      if (decomposition_length > 0) {
  ------------------
  |  Branch (5341:11): [True: 4.58k, False: 16.7k]
  ------------------
 5342|  4.58k|        const size_t base = static_cast<size_t>(decomposition[0] >> 2);
 5343|  4.58k|        if (base + decomposition_length > decomposition_data_size) {
  ------------------
  |  Branch (5343:13): [True: 0, False: 4.58k]
  ------------------
 5344|      0|          input[--descending_idx] = input[input_count];
 5345|  4.58k|        } else {
 5346|  14.5k|          while (decomposition_length-- > 0) {
  ------------------
  |  Branch (5346:18): [True: 9.97k, False: 4.58k]
  ------------------
 5347|  9.97k|            input[--descending_idx] =
 5348|  9.97k|                decomposition_data[base + decomposition_length];
 5349|  9.97k|          }
 5350|  4.58k|        }
 5351|  16.7k|      } else {
 5352|  16.7k|        input[--descending_idx] = input[input_count];
 5353|  16.7k|      }
 5354|  21.3k|    } else {
 5355|      0|      input[--descending_idx] = input[input_count];
 5356|      0|    }
 5357|  23.0k|  }
 5358|  2.79k|}
_ZN3ada4idna7get_cccEDi:
 5360|   935k|uint8_t get_ccc(char32_t c) noexcept {
 5361|   935k|  if (c >= 0x110000) {
  ------------------
  |  Branch (5361:7): [True: 0, False: 935k]
  ------------------
 5362|      0|    return 0;
 5363|      0|  }
 5364|   935k|  return ccc_block_row(ccc_index[c >> 8])[c % 256];
 5365|   935k|}
_ZN3ada4idna10sort_marksERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 5367|  4.12k|void sort_marks(std::u32string& input) {
 5368|  41.8k|  for (size_t idx = 1; idx < input.size(); idx++) {
  ------------------
  |  Branch (5368:24): [True: 37.7k, False: 4.12k]
  ------------------
 5369|  37.7k|    uint8_t ccc = get_ccc(input[idx]);
 5370|  37.7k|    if (ccc == 0) {
  ------------------
  |  Branch (5370:9): [True: 27.8k, False: 9.88k]
  ------------------
 5371|  27.8k|      continue;
 5372|  27.8k|    }
 5373|  9.88k|    auto current_character = input[idx];
 5374|  9.88k|    size_t back_idx = idx;
 5375|  16.3k|    while (back_idx != 0 && get_ccc(input[back_idx - 1]) > ccc) {
  ------------------
  |  Branch (5375:12): [True: 15.3k, False: 1.04k]
  |  Branch (5375:29): [True: 6.51k, False: 8.84k]
  ------------------
 5376|  6.51k|      input[back_idx] = input[back_idx - 1];
 5377|  6.51k|      back_idx--;
 5378|  6.51k|    }
 5379|  9.88k|    input[back_idx] = current_character;
 5380|  9.88k|  }
 5381|  4.12k|}
_ZN3ada4idna13decompose_nfcERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 5383|  4.12k|void decompose_nfc(std::u32string& input) {
 5384|       |  /**
 5385|       |   * Decompose the domain_name string to Unicode Normalization Form C.
 5386|       |   * @see https://www.unicode.org/reports/tr46/#ProcessingStepDecompose
 5387|       |   */
 5388|  4.12k|  auto [decomposition_needed, additional_elements] =
 5389|  4.12k|      compute_decomposition_length(input);
 5390|  4.12k|  if (decomposition_needed) {
  ------------------
  |  Branch (5390:7): [True: 2.79k, False: 1.32k]
  ------------------
 5391|  2.79k|    decompose(input, additional_elements);
 5392|  2.79k|  }
 5393|  4.12k|  sort_marks(input);
 5394|  4.12k|}
_ZN3ada4idna14is_already_nfcENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5477|  16.4k|bool is_already_nfc(std::u32string_view input) noexcept {
 5478|  16.4k|  if (input.empty()) {
  ------------------
  |  Branch (5478:7): [True: 0, False: 16.4k]
  ------------------
 5479|      0|    return true;
 5480|      0|  }
 5481|  16.4k|  if (!tables_are_ready() && !ensure_tables()) {
  ------------------
  |  Branch (5481:7): [True: 0, False: 16.4k]
  |  Branch (5481:30): [True: 0, False: 0]
  ------------------
 5482|      0|    return false;
 5483|      0|  }
 5484|       |  // 1) Singleton decompositions are never NFC (e.g. U+212B ANGSTROM SIGN).
 5485|       |  //    Multi-code-point decomps are primary composites that are NFC as-is.
 5486|   309k|  for (char32_t c : input) {
  ------------------
  |  Branch (5486:19): [True: 309k, False: 16.1k]
  ------------------
 5487|   309k|    if (canonical_decomp_length(c) == 1) {
  ------------------
  |  Branch (5487:9): [True: 394, False: 309k]
  ------------------
 5488|    394|      return false;
 5489|    394|    }
 5490|   309k|  }
 5491|       |  // 2) Combining marks already in canonical order. prev_ccc carries the
 5492|       |  //    trailing class of the previous character's canonical decomposition so a
 5493|       |  //    composite starter followed by a lower-class mark is caught.
 5494|  16.1k|  uint8_t prev_ccc = 0;
 5495|   299k|  for (char32_t c : input) {
  ------------------
  |  Branch (5495:19): [True: 299k, False: 12.8k]
  ------------------
 5496|   299k|    uint8_t ccc = get_ccc(c);
 5497|   299k|    if (ccc != 0 && prev_ccc > ccc) {
  ------------------
  |  Branch (5497:9): [True: 9.96k, False: 290k]
  |  Branch (5497:21): [True: 3.24k, False: 6.71k]
  ------------------
 5498|  3.24k|      return false;
 5499|  3.24k|    }
 5500|   296k|    prev_ccc = trailing_ccc(c);
 5501|   296k|  }
 5502|       |  // 3) No pairwise composition would apply (including Hangul L+V / LV+T).
 5503|  12.8k|  return !would_compose(input);
 5504|  16.1k|}
_ZN3ada4idna7composeERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 5506|  4.12k|void compose(std::u32string& input) {
 5507|       |  /**
 5508|       |   * Compose the domain_name string to Unicode Normalization Form C.
 5509|       |   * @see https://www.unicode.org/reports/tr46/#ProcessingStepCompose
 5510|       |   */
 5511|  4.12k|  size_t input_count{0};
 5512|  4.12k|  size_t composition_count{0};
 5513|  31.7k|  for (; input_count < input.size(); input_count++, composition_count++) {
  ------------------
  |  Branch (5513:10): [True: 27.6k, False: 4.12k]
  ------------------
 5514|  27.6k|    input[composition_count] = input[input_count];
 5515|  27.6k|    if (input[input_count] >= hangul_lbase &&
  ------------------
  |  Branch (5515:9): [True: 7.75k, False: 19.9k]
  ------------------
 5516|  7.75k|        input[input_count] < hangul_lbase + hangul_lcount) {
  ------------------
  |  Branch (5516:9): [True: 3.14k, False: 4.61k]
  ------------------
 5517|  3.14k|      if (input_count + 1 < input.size() &&
  ------------------
  |  Branch (5517:11): [True: 3.06k, False: 79]
  ------------------
 5518|  3.06k|          input[input_count + 1] >= hangul_vbase &&
  ------------------
  |  Branch (5518:11): [True: 2.49k, False: 564]
  ------------------
 5519|  2.49k|          input[input_count + 1] < hangul_vbase + hangul_vcount) {
  ------------------
  |  Branch (5519:11): [True: 2.17k, False: 326]
  ------------------
 5520|  2.17k|        input[composition_count] =
 5521|  2.17k|            hangul_sbase +
 5522|  2.17k|            ((input[input_count] - hangul_lbase) * hangul_vcount +
 5523|  2.17k|             input[input_count + 1] - hangul_vbase) *
 5524|  2.17k|                hangul_tcount;
 5525|  2.17k|        input_count++;
 5526|  2.17k|        if (input_count + 1 < input.size() &&
  ------------------
  |  Branch (5526:13): [True: 1.96k, False: 206]
  ------------------
 5527|  1.96k|            input[input_count + 1] > hangul_tbase &&
  ------------------
  |  Branch (5527:13): [True: 1.39k, False: 575]
  ------------------
 5528|  1.39k|            input[input_count + 1] < hangul_tbase + hangul_tcount) {
  ------------------
  |  Branch (5528:13): [True: 1.14k, False: 245]
  ------------------
 5529|  1.14k|          input[composition_count] += input[++input_count] - hangul_tbase;
 5530|  1.14k|        }
 5531|  2.17k|      }
 5532|  24.5k|    } else if (input[input_count] >= hangul_sbase &&
  ------------------
  |  Branch (5532:16): [True: 1.26k, False: 23.2k]
  ------------------
 5533|  1.26k|               input[input_count] < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5533:16): [True: 0, False: 1.26k]
  ------------------
 5534|      0|      if ((input[input_count] - hangul_sbase) % hangul_tcount &&
  ------------------
  |  Branch (5534:11): [True: 0, False: 0]
  ------------------
 5535|      0|          input_count + 1 < input.size() &&
  ------------------
  |  Branch (5535:11): [True: 0, False: 0]
  ------------------
 5536|      0|          input[input_count + 1] > hangul_tbase &&
  ------------------
  |  Branch (5536:11): [True: 0, False: 0]
  ------------------
 5537|      0|          input[input_count + 1] < hangul_tbase + hangul_tcount) {
  ------------------
  |  Branch (5537:11): [True: 0, False: 0]
  ------------------
 5538|      0|        input[composition_count] += input[++input_count] - hangul_tbase;
 5539|      0|      }
 5540|  24.5k|    } else if (input[input_count] < 0x110000) {
  ------------------
  |  Branch (5540:16): [True: 24.5k, False: 0]
  ------------------
 5541|  24.5k|      const uint16_t* composition =
 5542|  24.5k|          composition_block_row(composition_index[input[input_count] >> 8]) +
 5543|  24.5k|          (input[input_count] % 256);
 5544|  24.5k|      size_t initial_composition_count = composition_count;
 5545|  35.3k|      for (int32_t previous_ccc = -1; input_count + 1 < input.size();
  ------------------
  |  Branch (5545:39): [True: 31.6k, False: 3.74k]
  ------------------
 5546|  31.6k|           input_count++) {
 5547|  31.6k|        uint8_t ccc = get_ccc(input[input_count + 1]);
 5548|       |
 5549|  31.6k|        if (composition[1] != composition[0] && previous_ccc < ccc) {
  ------------------
  |  Branch (5549:13): [True: 13.1k, False: 18.5k]
  |  Branch (5549:49): [True: 12.4k, False: 659]
  ------------------
 5550|  12.4k|          int left = composition[0];
 5551|  12.4k|          int right = composition[1];
 5552|  12.4k|          if (left < 0 || right < left ||
  ------------------
  |  Branch (5552:15): [True: 0, False: 12.4k]
  |  Branch (5552:27): [True: 0, False: 12.4k]
  ------------------
 5553|  12.4k|              static_cast<size_t>(right) > composition_data_size) {
  ------------------
  |  Branch (5553:15): [True: 0, False: 12.4k]
  ------------------
 5554|      0|            break;
 5555|      0|          }
 5556|  34.2k|          while (left + 2 < right) {
  ------------------
  |  Branch (5556:18): [True: 21.7k, False: 12.4k]
  ------------------
 5557|  21.7k|            int middle = left + (((right - left) >> 1) & ~1);
 5558|  21.7k|            if (composition_data[static_cast<size_t>(middle)] <=
  ------------------
  |  Branch (5558:17): [True: 14.0k, False: 7.69k]
  ------------------
 5559|  21.7k|                input[input_count + 1]) {
 5560|  14.0k|              left = middle;
 5561|  14.0k|            }
 5562|  21.7k|            if (composition_data[static_cast<size_t>(middle)] >=
  ------------------
  |  Branch (5562:17): [True: 10.7k, False: 11.0k]
  ------------------
 5563|  21.7k|                input[input_count + 1]) {
 5564|  10.7k|              right = middle;
 5565|  10.7k|            }
 5566|  21.7k|          }
 5567|  12.4k|          if (static_cast<size_t>(left + 1) < composition_data_size &&
  ------------------
  |  Branch (5567:15): [True: 12.4k, False: 0]
  ------------------
 5568|  12.4k|              composition_data[static_cast<size_t>(left)] ==
  ------------------
  |  Branch (5568:15): [True: 5.61k, False: 6.83k]
  ------------------
 5569|  12.4k|                  input[input_count + 1]) {
 5570|  5.61k|            char32_t composed = composition_data[static_cast<size_t>(left + 1)];
 5571|  5.61k|            input[initial_composition_count] = composed;
 5572|  5.61k|            composition =
 5573|  5.61k|                composition_block_row(composition_index[composed >> 8]) +
 5574|  5.61k|                (composed % 256);
 5575|  5.61k|            continue;
 5576|  5.61k|          }
 5577|  12.4k|        }
 5578|       |
 5579|  26.0k|        if (ccc == 0) {
  ------------------
  |  Branch (5579:13): [True: 20.7k, False: 5.24k]
  ------------------
 5580|  20.7k|          break;
 5581|  20.7k|        }
 5582|  5.24k|        previous_ccc = ccc;
 5583|  5.24k|        input[++composition_count] = input[input_count + 1];
 5584|  5.24k|      }
 5585|  24.5k|    }
 5586|  27.6k|  }
 5587|       |
 5588|  4.12k|  if (composition_count < input_count) {
  ------------------
  |  Branch (5588:7): [True: 3.07k, False: 1.04k]
  ------------------
 5589|  3.07k|    input.resize(composition_count);
 5590|  3.07k|  }
 5591|  4.12k|}
_ZN3ada4idna9normalizeERNSt3__112basic_stringIDiNS1_11char_traitsIDiEENS1_9allocatorIDiEEEE:
 5593|  13.2k|bool normalize(std::u32string& input) {
 5594|       |  /**
 5595|       |   * Normalize the characters according to IDNA (Unicode Normalization Form C).
 5596|       |   * @see https://www.unicode.org/reports/tr46/#ProcessingStepNormalize
 5597|       |   */
 5598|  13.2k|  if (!ensure_tables() || decomposition_index == nullptr ||
  ------------------
  |  Branch (5598:7): [True: 0, False: 13.2k]
  |  Branch (5598:27): [True: 0, False: 13.2k]
  ------------------
 5599|  13.2k|      composition_index == nullptr) {
  ------------------
  |  Branch (5599:7): [True: 0, False: 13.2k]
  ------------------
 5600|      0|    return false;
 5601|      0|  }
 5602|  13.2k|  if (is_already_nfc(input)) {
  ------------------
  |  Branch (5602:7): [True: 9.14k, False: 4.12k]
  ------------------
 5603|  9.14k|    return true;
 5604|  9.14k|  }
 5605|  4.12k|  decompose_nfc(input);
 5606|  4.12k|  compose(input);
 5607|  4.12k|  return true;
 5608|  13.2k|}
_ZN3ada4idna17punycode_to_utf32ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEERNS1_12basic_stringIDiNS3_IDiEENS1_9allocatorIDiEEEE:
 5668|  28.8k|bool punycode_to_utf32(std::string_view input, std::u32string &out) {
 5669|  28.8k|  int32_t written_out{0};
 5670|  28.8k|  out.reserve(out.size() + input.size());
 5671|  28.8k|  uint32_t n = initial_n;
 5672|  28.8k|  int32_t i = 0;
 5673|  28.8k|  int32_t bias = initial_bias;
 5674|       |  // grab ascii content
 5675|  28.8k|  size_t end_of_ascii = input.find_last_of('-');
 5676|  28.8k|  if (end_of_ascii != std::string_view::npos) {
  ------------------
  |  Branch (5676:7): [True: 4.59k, False: 24.2k]
  ------------------
 5677|  60.9k|    for (uint8_t c : input.substr(0, end_of_ascii)) {
  ------------------
  |  Branch (5677:20): [True: 60.9k, False: 4.25k]
  ------------------
 5678|  60.9k|      if (c >= 0x80) {
  ------------------
  |  Branch (5678:11): [True: 339, False: 60.6k]
  ------------------
 5679|    339|        return false;
 5680|    339|      }
 5681|  60.6k|      out.push_back(c);
 5682|  60.6k|      written_out++;
 5683|  60.6k|    }
 5684|  4.25k|    input.remove_prefix(end_of_ascii + 1);
 5685|  4.25k|  }
 5686|   143k|  while (!input.empty()) {
  ------------------
  |  Branch (5686:10): [True: 119k, False: 23.9k]
  ------------------
 5687|   119k|    int32_t oldi = i;
 5688|   119k|    int32_t w = 1;
 5689|   169k|    for (int32_t k = base;; k += base) {
 5690|   169k|      if (input.empty()) {
  ------------------
  |  Branch (5690:11): [True: 432, False: 168k]
  ------------------
 5691|    432|        return false;
 5692|    432|      }
 5693|   168k|      uint8_t code_point = input.front();
 5694|   168k|      input.remove_prefix(1);
 5695|   168k|      int32_t digit = char_to_digit_value(code_point);
 5696|   168k|      if (digit < 0) {
  ------------------
  |  Branch (5696:11): [True: 3.84k, False: 164k]
  ------------------
 5697|  3.84k|        return false;
 5698|  3.84k|      }
 5699|   164k|      if (digit > (0x7fffffff - i) / w) {
  ------------------
  |  Branch (5699:11): [True: 84, False: 164k]
  ------------------
 5700|     84|        return false;
 5701|     84|      }
 5702|   164k|      i = i + digit * w;
 5703|   164k|      int32_t t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;
  ------------------
  |  Branch (5703:19): [True: 33.0k, False: 131k]
  |  Branch (5703:38): [True: 122k, False: 9.02k]
  ------------------
 5704|   164k|      if (digit < t) {
  ------------------
  |  Branch (5704:11): [True: 115k, False: 49.4k]
  ------------------
 5705|   115k|        break;
 5706|   115k|      }
 5707|  49.4k|      if (w > 0x7fffffff / (base - t)) {
  ------------------
  |  Branch (5707:11): [True: 0, False: 49.4k]
  ------------------
 5708|      0|        return false;
 5709|      0|      }
 5710|  49.4k|      w = w * (base - t);
 5711|  49.4k|    }
 5712|   115k|    bias = adapt(i - oldi, written_out + 1, oldi == 0);
 5713|   115k|    if (i / (written_out + 1) > int32_t(0x7fffffff - n)) {
  ------------------
  |  Branch (5713:9): [True: 127, False: 115k]
  ------------------
 5714|    127|      return false;
 5715|    127|    }
 5716|   115k|    n = n + i / (written_out + 1);
 5717|   115k|    i = i % (written_out + 1);
 5718|   115k|    if (n < 0x80) {
  ------------------
  |  Branch (5718:9): [True: 0, False: 115k]
  ------------------
 5719|      0|      return false;
 5720|      0|    }
 5721|   115k|    out.insert(out.begin() + i, n);
 5722|   115k|    written_out++;
 5723|   115k|    ++i;
 5724|   115k|  }
 5725|       |  // See https://github.com/whatwg/url/issues/803
 5726|       |  // Reject labels whose decoded form begins with "xn--" (double-encoded ACE).
 5727|  23.9k|  if (out.size() >= 4 && out[0] == U'x' && out[1] == U'n' && out[2] == U'-' &&
  ------------------
  |  Branch (5727:7): [True: 4.27k, False: 19.7k]
  |  Branch (5727:26): [True: 1.25k, False: 3.01k]
  |  Branch (5727:44): [True: 742, False: 514]
  |  Branch (5727:62): [True: 511, False: 231]
  ------------------
 5728|    511|      out[3] == U'-') {
  ------------------
  |  Branch (5728:7): [True: 332, False: 179]
  ------------------
 5729|    332|    return false;
 5730|    332|  }
 5731|  23.6k|  return true;
 5732|  23.9k|}
_ZN3ada4idna15verify_punycodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 5734|  4.56k|bool verify_punycode(std::string_view input) {
 5735|       |  // Track only the first 4 decoded code points to check for the "xn--" prefix.
 5736|       |  // This avoids heap allocation while still detecting double-encoded ACE
 5737|       |  // labels.
 5738|  4.56k|  uint32_t first4[4]{};
 5739|  4.56k|  size_t written_out{0};
 5740|  4.56k|  uint32_t n = initial_n;
 5741|  4.56k|  int32_t i = 0;
 5742|  4.56k|  int32_t bias = initial_bias;
 5743|       |  // grab ascii content
 5744|  4.56k|  size_t end_of_ascii = input.find_last_of('-');
 5745|  4.56k|  if (end_of_ascii != std::string_view::npos) {
  ------------------
  |  Branch (5745:7): [True: 1.40k, False: 3.16k]
  ------------------
 5746|  35.0k|    for (uint8_t c : input.substr(0, end_of_ascii)) {
  ------------------
  |  Branch (5746:20): [True: 35.0k, False: 1.10k]
  ------------------
 5747|  35.0k|      if (c >= 0x80) {
  ------------------
  |  Branch (5747:11): [True: 306, False: 34.7k]
  ------------------
 5748|    306|        return false;
 5749|    306|      }
 5750|  34.7k|      if (written_out < 4) {
  ------------------
  |  Branch (5750:11): [True: 4.23k, False: 30.5k]
  ------------------
 5751|  4.23k|        first4[written_out] = c;
 5752|  4.23k|      }
 5753|  34.7k|      written_out++;
 5754|  34.7k|    }
 5755|  1.10k|    input.remove_prefix(end_of_ascii + 1);
 5756|  1.10k|  }
 5757|  14.2k|  while (!input.empty()) {
  ------------------
  |  Branch (5757:10): [True: 12.6k, False: 1.54k]
  ------------------
 5758|  12.6k|    int32_t oldi = i;
 5759|  12.6k|    int32_t w = 1;
 5760|  18.9k|    for (int32_t k = base;; k += base) {
 5761|  18.9k|      if (input.empty()) {
  ------------------
  |  Branch (5761:11): [True: 86, False: 18.8k]
  ------------------
 5762|     86|        return false;
 5763|     86|      }
 5764|  18.8k|      uint8_t code_point = input.front();
 5765|  18.8k|      input.remove_prefix(1);
 5766|  18.8k|      int32_t digit = char_to_digit_value(code_point);
 5767|  18.8k|      if (digit < 0) {
  ------------------
  |  Branch (5767:11): [True: 2.58k, False: 16.2k]
  ------------------
 5768|  2.58k|        return false;
 5769|  2.58k|      }
 5770|  16.2k|      if (digit > (0x7fffffff - i) / w) {
  ------------------
  |  Branch (5770:11): [True: 17, False: 16.2k]
  ------------------
 5771|     17|        return false;
 5772|     17|      }
 5773|  16.2k|      i = i + digit * w;
 5774|  16.2k|      int32_t t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;
  ------------------
  |  Branch (5774:19): [True: 4.12k, False: 12.1k]
  |  Branch (5774:38): [True: 11.4k, False: 665]
  ------------------
 5775|  16.2k|      if (digit < t) {
  ------------------
  |  Branch (5775:11): [True: 9.98k, False: 6.26k]
  ------------------
 5776|  9.98k|        break;
 5777|  9.98k|      }
 5778|  6.26k|      if (w > 0x7fffffff / (base - t)) {
  ------------------
  |  Branch (5778:11): [True: 0, False: 6.26k]
  ------------------
 5779|      0|        return false;
 5780|      0|      }
 5781|  6.26k|      w = w * (base - t);
 5782|  6.26k|    }
 5783|  9.98k|    bias = adapt(i - oldi, int32_t(written_out + 1), oldi == 0);
 5784|  9.98k|    if (i / (written_out + 1) > 0x7fffffff - n) {
  ------------------
  |  Branch (5784:9): [True: 31, False: 9.95k]
  ------------------
 5785|     31|      return false;
 5786|     31|    }
 5787|  9.95k|    n = n + i / int32_t(written_out + 1);
 5788|  9.95k|    i = i % int32_t(written_out + 1);
 5789|  9.95k|    if (n < 0x80) {
  ------------------
  |  Branch (5789:9): [True: 0, False: 9.95k]
  ------------------
 5790|      0|      return false;
 5791|      0|    }
 5792|       |    // Simulate insert at position i, maintaining only the first 4 slots.
 5793|  9.95k|    size_t insert_pos = size_t(i);
 5794|  9.95k|    if (insert_pos < 4) {
  ------------------
  |  Branch (5794:9): [True: 2.42k, False: 7.52k]
  ------------------
 5795|  6.65k|      for (size_t j = 3; j > insert_pos; j--) {
  ------------------
  |  Branch (5795:26): [True: 4.22k, False: 2.42k]
  ------------------
 5796|  4.22k|        first4[j] = first4[j - 1];
 5797|  4.22k|      }
 5798|  2.42k|      first4[insert_pos] = n;
 5799|  2.42k|    }
 5800|  9.95k|    written_out++;
 5801|  9.95k|    ++i;
 5802|  9.95k|  }
 5803|       |  // See https://github.com/whatwg/url/issues/803
 5804|       |  // Reject labels whose decoded form begins with "xn--" (double-encoded ACE).
 5805|  1.54k|  if (written_out >= 4 && first4[0] == U'x' && first4[1] == U'n' &&
  ------------------
  |  Branch (5805:7): [True: 797, False: 750]
  |  Branch (5805:27): [True: 503, False: 294]
  |  Branch (5805:48): [True: 383, False: 120]
  ------------------
 5806|    383|      first4[2] == U'-' && first4[3] == U'-') {
  ------------------
  |  Branch (5806:7): [True: 302, False: 81]
  |  Branch (5806:28): [True: 224, False: 78]
  ------------------
 5807|    224|    return false;
 5808|    224|  }
 5809|  1.32k|  return true;
 5810|  1.54k|}
_ZN3ada4idna17utf32_to_punycodeENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEERNS1_12basic_stringIcNS3_IcEENS1_9allocatorIcEEEE:
 5812|  4.10k|bool utf32_to_punycode(std::u32string_view input, std::string &out) {
 5813|  4.10k|  out.reserve(input.size() + out.size());
 5814|  4.10k|  uint32_t n = initial_n;
 5815|  4.10k|  int32_t d = 0;
 5816|  4.10k|  int32_t bias = initial_bias;
 5817|  4.10k|  size_t h = 0;
 5818|       |  // first push the ascii content
 5819|  99.5k|  for (uint32_t c : input) {
  ------------------
  |  Branch (5819:19): [True: 99.5k, False: 3.93k]
  ------------------
 5820|  99.5k|    if (c < 0x80) {
  ------------------
  |  Branch (5820:9): [True: 23.6k, False: 75.9k]
  ------------------
 5821|  23.6k|      ++h;
 5822|  23.6k|      out.push_back(char(c));
 5823|  23.6k|    }
 5824|  99.5k|    if (c > 0x10ffff || (c >= 0xd800 && c < 0xe000)) {
  ------------------
  |  Branch (5824:9): [True: 154, False: 99.4k]
  |  Branch (5824:26): [True: 817, False: 98.6k]
  |  Branch (5824:41): [True: 15, False: 802]
  ------------------
 5825|    169|      return false;
 5826|    169|    }
 5827|  99.5k|  }
 5828|  3.93k|  size_t b = h;
 5829|  3.93k|  if (b > 0) {
  ------------------
  |  Branch (5829:7): [True: 1.81k, False: 2.11k]
  ------------------
 5830|  1.81k|    out.push_back('-');
 5831|  1.81k|  }
 5832|  16.3k|  while (h < input.size()) {
  ------------------
  |  Branch (5832:10): [True: 12.4k, False: 3.93k]
  ------------------
 5833|  12.4k|    uint32_t m = 0x10FFFF;
 5834|  1.04M|    for (auto code_point : input) {
  ------------------
  |  Branch (5834:26): [True: 1.04M, False: 12.4k]
  ------------------
 5835|  1.04M|      if (code_point >= n && code_point < m) m = code_point;
  ------------------
  |  Branch (5835:11): [True: 435k, False: 604k]
  |  Branch (5835:30): [True: 22.5k, False: 413k]
  ------------------
 5836|  1.04M|    }
 5837|       |
 5838|  12.4k|    if ((m - n) > (0x7fffffff - d) / (h + 1)) {
  ------------------
  |  Branch (5838:9): [True: 0, False: 12.4k]
  ------------------
 5839|      0|      return false;
 5840|      0|    }
 5841|  12.4k|    d = d + int32_t((m - n) * (h + 1));
 5842|  12.4k|    n = m;
 5843|  1.04M|    for (auto c : input) {
  ------------------
  |  Branch (5843:17): [True: 1.04M, False: 12.4k]
  ------------------
 5844|  1.04M|      if (c < n) {
  ------------------
  |  Branch (5844:11): [True: 604k, False: 435k]
  ------------------
 5845|   604k|        if (d == 0x7fffffff) {
  ------------------
  |  Branch (5845:13): [True: 0, False: 604k]
  ------------------
 5846|      0|          return false;
 5847|      0|        }
 5848|   604k|        ++d;
 5849|   604k|      }
 5850|  1.04M|      if (c == n) {
  ------------------
  |  Branch (5850:11): [True: 75.8k, False: 964k]
  ------------------
 5851|  75.8k|        int32_t q = d;
 5852|  96.2k|        for (int32_t k = base;; k += base) {
 5853|  96.2k|          int32_t t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;
  ------------------
  |  Branch (5853:23): [True: 10.1k, False: 86.1k]
  |  Branch (5853:42): [True: 81.5k, False: 4.53k]
  ------------------
 5854|       |
 5855|  96.2k|          if (q < t) {
  ------------------
  |  Branch (5855:15): [True: 75.8k, False: 20.4k]
  ------------------
 5856|  75.8k|            break;
 5857|  75.8k|          }
 5858|  20.4k|          out.push_back(digit_to_char(t + ((q - t) % (base - t))));
 5859|  20.4k|          q = (q - t) / (base - t);
 5860|  20.4k|        }
 5861|  75.8k|        out.push_back(digit_to_char(q));
 5862|  75.8k|        bias = adapt(d, int32_t(h + 1), h == b);
 5863|  75.8k|        d = 0;
 5864|  75.8k|        ++h;
 5865|  75.8k|      }
 5866|  1.04M|    }
 5867|  12.4k|    ++d;
 5868|  12.4k|    ++n;
 5869|  12.4k|  }
 5870|  3.93k|  return true;
 5871|  3.93k|}
_ZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5955|  12.4k|bool is_label_valid(const std::u32string_view label) {
 5956|  12.4k|  if (label.empty()) {
  ------------------
  |  Branch (5956:7): [True: 0, False: 12.4k]
  ------------------
 5957|      0|    return true;
 5958|      0|  }
 5959|  12.4k|  if (!ensure_tables() || combining_ranges == nullptr || dir_start == nullptr ||
  ------------------
  |  Branch (5959:7): [True: 0, False: 12.4k]
  |  Branch (5959:27): [True: 0, False: 12.4k]
  |  Branch (5959:58): [True: 0, False: 12.4k]
  ------------------
 5960|  12.4k|      dir_final == nullptr || dir_value == nullptr) {
  ------------------
  |  Branch (5960:7): [True: 0, False: 12.4k]
  |  Branch (5960:31): [True: 0, False: 12.4k]
  ------------------
 5961|      0|    return false;
 5962|      0|  }
 5963|       |
 5964|       |  ///////////////
 5965|       |  // We have a normalization step which ensures that we are in NFC.
 5966|       |  // If we receive punycode, we normalize and check that the normalized
 5967|       |  // version matches the original.
 5968|       |  // --------------------------------------
 5969|       |  // The label must be in Unicode Normalization Form NFC.
 5970|       |
 5971|       |  // Current URL standard indicatest that CheckHyphens is set to false.
 5972|       |  // ---------------------------------------
 5973|       |  // If CheckHyphens, the label must not contain a U+002D HYPHEN-MINUS character
 5974|       |  // in both the third and fourth positions. If CheckHyphens, the label must
 5975|       |  // neither begin nor end with a U+002D HYPHEN-MINUS character.
 5976|       |
 5977|       |  // This is not necessary because we segment the
 5978|       |  // labels by '.'.
 5979|       |  // ---------------------------------------
 5980|       |  // The label must not contain a U+002E ( . ) FULL STOP.
 5981|       |  // if (label.find('.') != std::string_view::npos) return false;
 5982|       |
 5983|       |  // The label must not begin with a combining mark.
 5984|       |  // Range membership via lower_bound on range end.
 5985|  12.4k|  const std::span<const uint32_t[2]> comb_span{combining_ranges,
 5986|  12.4k|                                               combining_range_count};
 5987|  12.4k|  const auto comb_it = std::ranges::lower_bound(
 5988|  12.4k|      comb_span, label.front(), {}, [](const auto& range) { return range[1]; });
 5989|  12.4k|  if (comb_it != comb_span.end() && label.front() >= (*comb_it)[0]) {
  ------------------
  |  Branch (5989:7): [True: 12.3k, False: 106]
  |  Branch (5989:7): [True: 272, False: 12.2k]
  |  Branch (5989:37): [True: 272, False: 12.1k]
  ------------------
 5990|    272|    return false;
 5991|    272|  }
 5992|       |  // We verify this next step as part of the mapping:
 5993|       |  // ---------------------------------------------
 5994|       |  // Each code point in the label must only have certain status values
 5995|       |  // according to Section 5, IDNA Mapping Table:
 5996|       |  // - For Transitional Processing, each value must be valid.
 5997|       |  // - For Nontransitional Processing, each value must be either valid or
 5998|       |  // deviation.
 5999|       |
 6000|       |  // If CheckJoiners, the label must satisfy the ContextJ rules from Appendix
 6001|       |  // A, in The Unicode Code Points and Internationalized Domain Names for
 6002|       |  // Applications (IDNA) [IDNA2008].
 6003|  12.2k|  constexpr static uint32_t virama[] = {
 6004|  12.2k|      0x094D,  0x09CD,  0x0A4D,  0x0ACD,  0x0B4D,  0x0BCD,  0x0C4D,  0x0CCD,
 6005|  12.2k|      0x0D3B,  0x0D3C,  0x0D4D,  0x0DCA,  0x0E3A,  0x0EBA,  0x0F84,  0x1039,
 6006|  12.2k|      0x103A,  0x1714,  0x1734,  0x17D2,  0x1A60,  0x1B44,  0x1BAA,  0x1BAB,
 6007|  12.2k|      0x1BF2,  0x1BF3,  0x2D7F,  0xA806,  0xA82C,  0xA8C4,  0xA953,  0xA9C0,
 6008|  12.2k|      0xAAF6,  0xABED,  0x10A3F, 0x11046, 0x1107F, 0x110B9, 0x11133, 0x11134,
 6009|  12.2k|      0x111C0, 0x11235, 0x112EA, 0x1134D, 0x11442, 0x114C2, 0x115BF, 0x1163F,
 6010|  12.2k|      0x116B6, 0x1172B, 0x11839, 0x1193D, 0x1193E, 0x119E0, 0x11A34, 0x11A47,
 6011|  12.2k|      0x11A99, 0x11C3F, 0x11D44, 0x11D45, 0x11D97};
 6012|  12.2k|  constexpr static uint32_t R[] = {
 6013|  12.2k|      0x622, 0x623, 0x624, 0x625, 0x627, 0x629, 0x62f, 0x630, 0x631,
 6014|  12.2k|      0x632, 0x648, 0x671, 0x672, 0x673, 0x675, 0x676, 0x677, 0x688,
 6015|  12.2k|      0x689, 0x68a, 0x68b, 0x68c, 0x68d, 0x68e, 0x68f, 0x690, 0x691,
 6016|  12.2k|      0x692, 0x693, 0x694, 0x695, 0x696, 0x697, 0x698, 0x699, 0x6c0,
 6017|  12.2k|      0x6c3, 0x6c4, 0x6c5, 0x6c6, 0x6c7, 0x6c8, 0x6c9, 0x6ca, 0x6cb,
 6018|  12.2k|      0x6cd, 0x6cf, 0x6d2, 0x6d3, 0x6d5, 0x6ee, 0x6ef, 0x710, 0x715,
 6019|  12.2k|      0x716, 0x717, 0x718, 0x719, 0x71e, 0x728, 0x72a, 0x72c, 0x72f,
 6020|  12.2k|      0x74d, 0x759, 0x75a, 0x75b, 0x854, 0x8aa, 0x8ab, 0x8ac};
 6021|  12.2k|  constexpr static uint32_t L[] = {0xa872};
 6022|  12.2k|  constexpr static uint32_t D[] = {
 6023|  12.2k|      0x620,  0x626,  0x628,  0x62a,  0x62b,  0x62c,  0x62d,  0x62e,  0x633,
 6024|  12.2k|      0x634,  0x635,  0x636,  0x637,  0x638,  0x639,  0x63a,  0x63b,  0x63c,
 6025|  12.2k|      0x63d,  0x63e,  0x63f,  0x641,  0x642,  0x643,  0x644,  0x645,  0x646,
 6026|  12.2k|      0x647,  0x649,  0x64a,  0x66e,  0x66f,  0x678,  0x679,  0x67a,  0x67b,
 6027|  12.2k|      0x67c,  0x67d,  0x67e,  0x67f,  0x680,  0x681,  0x682,  0x683,  0x684,
 6028|  12.2k|      0x685,  0x686,  0x687,  0x69a,  0x69b,  0x69c,  0x69d,  0x69e,  0x69f,
 6029|  12.2k|      0x6a0,  0x6a1,  0x6a2,  0x6a3,  0x6a4,  0x6a5,  0x6a6,  0x6a7,  0x6a8,
 6030|  12.2k|      0x6a9,  0x6aa,  0x6ab,  0x6ac,  0x6ad,  0x6ae,  0x6af,  0x6b0,  0x6b1,
 6031|  12.2k|      0x6b2,  0x6b3,  0x6b4,  0x6b5,  0x6b6,  0x6b7,  0x6b8,  0x6b9,  0x6ba,
 6032|  12.2k|      0x6bb,  0x6bc,  0x6bd,  0x6be,  0x6bf,  0x6c1,  0x6c2,  0x6cc,  0x6ce,
 6033|  12.2k|      0x6d0,  0x6d1,  0x6fa,  0x6fb,  0x6fc,  0x6ff,  0x712,  0x713,  0x714,
 6034|  12.2k|      0x71a,  0x71b,  0x71c,  0x71d,  0x71f,  0x720,  0x721,  0x722,  0x723,
 6035|  12.2k|      0x724,  0x725,  0x726,  0x727,  0x729,  0x72b,  0x72d,  0x72e,  0x74e,
 6036|  12.2k|      0x74f,  0x750,  0x751,  0x752,  0x753,  0x754,  0x755,  0x756,  0x757,
 6037|  12.2k|      0x758,  0x75c,  0x75d,  0x75e,  0x75f,  0x760,  0x761,  0x762,  0x763,
 6038|  12.2k|      0x764,  0x765,  0x766,  0x850,  0x851,  0x852,  0x853,  0x855,  0x8a0,
 6039|  12.2k|      0x8a2,  0x8a3,  0x8a4,  0x8a5,  0x8a6,  0x8a7,  0x8a8,  0x8a9,  0x1807,
 6040|  12.2k|      0x1820, 0x1821, 0x1822, 0x1823, 0x1824, 0x1825, 0x1826, 0x1827, 0x1828,
 6041|  12.2k|      0x1829, 0x182a, 0x182b, 0x182c, 0x182d, 0x182e, 0x182f, 0x1830, 0x1831,
 6042|  12.2k|      0x1832, 0x1833, 0x1834, 0x1835, 0x1836, 0x1837, 0x1838, 0x1839, 0x183a,
 6043|  12.2k|      0x183b, 0x183c, 0x183d, 0x183e, 0x183f, 0x1840, 0x1841, 0x1842, 0x1843,
 6044|  12.2k|      0x1844, 0x1845, 0x1846, 0x1847, 0x1848, 0x1849, 0x184a, 0x184b, 0x184c,
 6045|  12.2k|      0x184d, 0x184e, 0x184f, 0x1850, 0x1851, 0x1852, 0x1853, 0x1854, 0x1855,
 6046|  12.2k|      0x1856, 0x1857, 0x1858, 0x1859, 0x185a, 0x185b, 0x185c, 0x185d, 0x185e,
 6047|  12.2k|      0x185f, 0x1860, 0x1861, 0x1862, 0x1863, 0x1864, 0x1865, 0x1866, 0x1867,
 6048|  12.2k|      0x1868, 0x1869, 0x186a, 0x186b, 0x186c, 0x186d, 0x186e, 0x186f, 0x1870,
 6049|  12.2k|      0x1871, 0x1872, 0x1873, 0x1874, 0x1875, 0x1876, 0x1877, 0x1887, 0x1888,
 6050|  12.2k|      0x1889, 0x188a, 0x188b, 0x188c, 0x188d, 0x188e, 0x188f, 0x1890, 0x1891,
 6051|  12.2k|      0x1892, 0x1893, 0x1894, 0x1895, 0x1896, 0x1897, 0x1898, 0x1899, 0x189a,
 6052|  12.2k|      0x189b, 0x189c, 0x189d, 0x189e, 0x189f, 0x18a0, 0x18a1, 0x18a2, 0x18a3,
 6053|  12.2k|      0x18a4, 0x18a5, 0x18a6, 0x18a7, 0x18a8, 0x18aa, 0xa840, 0xa841, 0xa842,
 6054|  12.2k|      0xa843, 0xa844, 0xa845, 0xa846, 0xa847, 0xa848, 0xa849, 0xa84a, 0xa84b,
 6055|  12.2k|      0xa84c, 0xa84d, 0xa84e, 0xa84f, 0xa850, 0xa851, 0xa852, 0xa853, 0xa854,
 6056|  12.2k|      0xa855, 0xa856, 0xa857, 0xa858, 0xa859, 0xa85a, 0xa85b, 0xa85c, 0xa85d,
 6057|  12.2k|      0xa85e, 0xa85f, 0xa860, 0xa861, 0xa862, 0xa863, 0xa864, 0xa865, 0xa866,
 6058|  12.2k|      0xa867, 0xa868, 0xa869, 0xa86a, 0xa86b, 0xa86c, 0xa86d, 0xa86e, 0xa86f,
 6059|  12.2k|      0xa870, 0xa871};
 6060|       |
 6061|   103k|  for (size_t i = 0; i < label.size(); i++) {
  ------------------
  |  Branch (6061:22): [True: 93.3k, False: 9.95k]
  ------------------
 6062|  93.3k|    uint32_t c = label[i];
 6063|  93.3k|    if (c == 0x200c) {
  ------------------
  |  Branch (6063:9): [True: 1.52k, False: 91.8k]
  ------------------
 6064|  1.52k|      if (i > 0) {
  ------------------
  |  Branch (6064:11): [True: 1.43k, False: 85]
  ------------------
 6065|  1.43k|        if (std::ranges::binary_search(virama, label[i - 1])) {
  ------------------
  |  Branch (6065:13): [True: 70, False: 1.36k]
  ------------------
 6066|     70|          return true;
 6067|     70|        }
 6068|  1.43k|      }
 6069|  1.45k|      if ((i == 0) || (i + 1 >= label.size())) {
  ------------------
  |  Branch (6069:11): [True: 85, False: 1.36k]
  |  Branch (6069:23): [True: 425, False: 943]
  ------------------
 6070|    510|        return false;
 6071|    510|      }
 6072|       |      // we go backward looking for L or D
 6073|    943|      auto is_l_or_d = [](uint32_t code) {
 6074|    943|        return std::ranges::binary_search(L, code) ||
 6075|    943|               std::ranges::binary_search(D, code);
 6076|    943|      };
 6077|    943|      auto is_r_or_d = [](uint32_t code) {
 6078|    943|        return std::ranges::binary_search(R, code) ||
 6079|    943|               std::ranges::binary_search(D, code);
 6080|    943|      };
 6081|    943|      std::u32string_view before = label.substr(0, i);
 6082|    943|      std::u32string_view after = label.substr(i + 1);
 6083|    943|      return (std::find_if(before.begin(), before.end(), is_l_or_d) !=
  ------------------
  |  Branch (6083:14): [True: 782, False: 161]
  ------------------
 6084|    943|              before.end()) &&
 6085|    782|             (std::find_if(after.begin(), after.end(), is_r_or_d) !=
  ------------------
  |  Branch (6085:14): [True: 616, False: 166]
  ------------------
 6086|    782|              after.end());
 6087|  91.8k|    } else if (c == 0x200d) {
  ------------------
  |  Branch (6087:16): [True: 734, False: 91.0k]
  ------------------
 6088|    734|      if (i > 0) {
  ------------------
  |  Branch (6088:11): [True: 606, False: 128]
  ------------------
 6089|    606|        if (std::ranges::binary_search(virama, label[i - 1])) {
  ------------------
  |  Branch (6089:13): [True: 72, False: 534]
  ------------------
 6090|     72|          return true;
 6091|     72|        }
 6092|    606|      }
 6093|    662|      return false;
 6094|    734|    }
 6095|  93.3k|  }
 6096|       |
 6097|       |  // If CheckBidi, and if the domain name is a  Bidi domain name, then the label
 6098|       |  // must satisfy all six of the numbered conditions in [IDNA2008] RFC 5893,
 6099|       |  // Section 2.
 6100|       |
 6101|       |  // The following rule, consisting of six conditions, applies to labels
 6102|       |  // in Bidi domain names.  The requirements that this rule satisfies are
 6103|       |  // described in Section 3.  All of the conditions must be satisfied for
 6104|       |  // the rule to be satisfied.
 6105|       |  //
 6106|       |  //  1.  The first character must be a character with Bidi property L, R,
 6107|       |  //     or AL.  If it has the R or AL property, it is an RTL label; if it
 6108|       |  //     has the L property, it is an LTR label.
 6109|       |  //
 6110|       |  //  2.  In an RTL label, only characters with the Bidi properties R, AL,
 6111|       |  //      AN, EN, ES, CS, ET, ON, BN, or NSM are allowed.
 6112|       |  //
 6113|       |  //   3.  In an RTL label, the end of the label must be a character with
 6114|       |  //       Bidi property R, AL, EN, or AN, followed by zero or more
 6115|       |  //       characters with Bidi property NSM.
 6116|       |  //
 6117|       |  //   4.  In an RTL label, if an EN is present, no AN may be present, and
 6118|       |  //       vice versa.
 6119|       |  //
 6120|       |  //  5.  In an LTR label, only characters with the Bidi properties L, EN,
 6121|       |  //       ES, CS, ET, ON, BN, or NSM are allowed.
 6122|       |  //
 6123|       |  //   6.  In an LTR label, the end of the label must be a character with
 6124|       |  //       Bidi property L or EN, followed by zero or more characters with
 6125|       |  //       Bidi property NSM.
 6126|       |
 6127|  9.95k|  size_t last_non_nsm_char = find_last_not_of_nsm(label);
 6128|  9.95k|  if (last_non_nsm_char == std::u32string_view::npos) {
  ------------------
  |  Branch (6128:7): [True: 0, False: 9.95k]
  ------------------
 6129|      0|    return false;
 6130|      0|  }
 6131|       |
 6132|       |  // A "Bidi domain name" is a domain name that contains at least one RTL label.
 6133|       |  // The following rule, consisting of six conditions, applies to labels in Bidi
 6134|       |  // domain names.
 6135|  9.95k|  if (is_rtl_label(label)) {
  ------------------
  |  Branch (6135:7): [True: 2.70k, False: 7.25k]
  ------------------
 6136|       |    // The first character must be a character with Bidi property L, R,
 6137|       |    // or AL. If it has the R or AL property, it is an RTL label; if it
 6138|       |    // has the L property, it is an LTR label.
 6139|       |
 6140|  2.70k|    if (find_direction(label[0]) == direction::L) {
  ------------------
  |  Branch (6140:9): [True: 450, False: 2.25k]
  ------------------
 6141|       |      // Eval as LTR
 6142|       |
 6143|       |      // In an LTR label, only characters with the Bidi properties L, EN,
 6144|       |      // ES, CS, ET, ON, BN, or NSM are allowed.
 6145|  3.39k|      for (size_t i = 0; i <= last_non_nsm_char; i++) {
  ------------------
  |  Branch (6145:26): [True: 3.39k, False: 0]
  ------------------
 6146|  3.39k|        const direction d = find_direction(label[i]);
 6147|  3.39k|        if (!(d == direction::L || d == direction::EN || d == direction::ES ||
  ------------------
  |  Branch (6147:15): [True: 828, False: 2.57k]
  |  Branch (6147:36): [True: 233, False: 2.33k]
  |  Branch (6147:58): [True: 250, False: 2.08k]
  ------------------
 6148|  2.08k|              d == direction::CS || d == direction::ET || d == direction::ON ||
  ------------------
  |  Branch (6148:15): [True: 221, False: 1.86k]
  |  Branch (6148:37): [True: 227, False: 1.63k]
  |  Branch (6148:59): [True: 289, False: 1.35k]
  ------------------
 6149|  1.35k|              d == direction::BN || d == direction::NSM)) {
  ------------------
  |  Branch (6149:15): [True: 431, False: 919]
  |  Branch (6149:37): [True: 469, False: 450]
  ------------------
 6150|    450|          return false;
 6151|    450|        }
 6152|  3.39k|      }
 6153|       |
 6154|      0|      const direction last_dir = find_direction(label[last_non_nsm_char]);
 6155|      0|      if (!(last_dir == direction::L || last_dir == direction::EN)) {
  ------------------
  |  Branch (6155:13): [True: 0, False: 0]
  |  Branch (6155:41): [True: 0, False: 0]
  ------------------
 6156|      0|        return false;
 6157|      0|      }
 6158|       |
 6159|      0|      return true;
 6160|       |
 6161|  2.25k|    } else {
 6162|       |      // Eval as RTL
 6163|       |
 6164|       |      // The first character must be R or AL; a leading AN (or any other
 6165|       |      // direction) does not start a valid RTL label.
 6166|  2.25k|      const direction first_dir = find_direction(label[0]);
 6167|  2.25k|      if (first_dir != direction::R && first_dir != direction::AL) {
  ------------------
  |  Branch (6167:11): [True: 1.23k, False: 1.02k]
  |  Branch (6167:40): [True: 118, False: 1.11k]
  ------------------
 6168|    118|        return false;
 6169|    118|      }
 6170|       |
 6171|  2.13k|      bool has_an = false;
 6172|  2.13k|      bool has_en = false;
 6173|  9.24k|      for (size_t i = 0; i <= last_non_nsm_char; i++) {
  ------------------
  |  Branch (6173:26): [True: 7.64k, False: 1.59k]
  ------------------
 6174|  7.64k|        const direction d = find_direction(label[i]);
 6175|       |
 6176|       |        // In an RTL label, if an EN is present, no AN may be present, and vice
 6177|       |        // versa.
 6178|  7.64k|        if ((d == direction::EN && ((has_en = true) && has_an)) ||
  ------------------
  |  Branch (6178:14): [True: 658, False: 6.98k]
  |  Branch (6178:37): [True: 658, False: 0]
  |  Branch (6178:56): [True: 78, False: 580]
  ------------------
 6179|  7.56k|            (d == direction::AN && ((has_an = true) && has_en))) {
  ------------------
  |  Branch (6179:14): [True: 541, False: 7.02k]
  |  Branch (6179:37): [True: 541, False: 0]
  |  Branch (6179:56): [True: 70, False: 471]
  ------------------
 6180|    148|          return false;
 6181|    148|        }
 6182|       |
 6183|  7.49k|        if (!(d == direction::R || d == direction::AL || d == direction::AN ||
  ------------------
  |  Branch (6183:15): [True: 2.03k, False: 5.46k]
  |  Branch (6183:36): [True: 2.69k, False: 2.76k]
  |  Branch (6183:58): [True: 471, False: 2.29k]
  ------------------
 6184|  2.29k|              d == direction::EN || d == direction::ES || d == direction::CS ||
  ------------------
  |  Branch (6184:15): [True: 580, False: 1.71k]
  |  Branch (6184:37): [True: 219, False: 1.49k]
  |  Branch (6184:59): [True: 228, False: 1.27k]
  ------------------
 6185|  1.27k|              d == direction::ET || d == direction::ON || d == direction::BN ||
  ------------------
  |  Branch (6185:15): [True: 214, False: 1.05k]
  |  Branch (6185:37): [True: 305, False: 752]
  |  Branch (6185:59): [True: 281, False: 471]
  ------------------
 6186|    471|              d == direction::NSM)) {
  ------------------
  |  Branch (6186:15): [True: 226, False: 245]
  ------------------
 6187|    245|          return false;
 6188|    245|        }
 6189|       |
 6190|  7.25k|        if (i == last_non_nsm_char &&
  ------------------
  |  Branch (6190:13): [True: 1.74k, False: 5.51k]
  ------------------
 6191|  1.74k|            !(d == direction::R || d == direction::AL || d == direction::AN ||
  ------------------
  |  Branch (6191:15): [True: 607, False: 1.13k]
  |  Branch (6191:36): [True: 510, False: 626]
  |  Branch (6191:58): [True: 201, False: 425]
  ------------------
 6192|    425|              d == direction::EN)) {
  ------------------
  |  Branch (6192:15): [True: 281, False: 144]
  ------------------
 6193|    144|          return false;
 6194|    144|        }
 6195|  7.25k|      }
 6196|       |
 6197|  1.59k|      return true;
 6198|  2.13k|    }
 6199|  2.70k|  }
 6200|       |
 6201|  7.25k|  return true;
 6202|  9.95k|}
_ZN3ada4idna36contains_forbidden_domain_code_pointENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6329|  4.56k|bool contains_forbidden_domain_code_point(std::string_view view) {
 6330|  4.56k|  return std::ranges::any_of(view, is_forbidden_domain_code_point);
 6331|  4.56k|}
_ZN3ada4idna8to_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEERNS1_12basic_stringIcS4_NS1_9allocatorIcEEEE:
 6359|  11.9k|[[nodiscard]] bool to_ascii(std::string_view ut8_string, std::string& out) {
 6360|  11.9k|  out.clear();
 6361|  11.9k|  if (ut8_string.size() > max_domain_input_bytes) {
  ------------------
  |  Branch (6361:7): [True: 0, False: 11.9k]
  ------------------
 6362|      0|    return false;
 6363|      0|  }
 6364|  11.9k|  if (is_ascii(ut8_string)) {
  ------------------
  |  Branch (6364:7): [True: 8.96k, False: 2.98k]
  ------------------
 6365|  8.96k|    from_ascii_to_ascii(ut8_string, out);
 6366|  8.96k|    return true;
 6367|  8.96k|  }
 6368|       |
 6369|       |#ifdef ADA_USE_SIMDUTF
 6370|       |  size_t utf32_length =
 6371|       |      simdutf::utf32_length_from_utf8(ut8_string.data(), ut8_string.size());
 6372|       |  if (utf32_length == 0 && !ut8_string.empty()) {
 6373|       |    return false;
 6374|       |  }
 6375|       |  std::u32string working(utf32_length, U'\0');
 6376|       |  size_t actual_utf32_length = simdutf::convert_utf8_to_utf32(
 6377|       |      ut8_string.data(), ut8_string.size(), working.data());
 6378|       |#else
 6379|  2.98k|  size_t utf32_length =
 6380|  2.98k|      ada::idna::utf32_length_from_utf8(ut8_string.data(), ut8_string.size());
 6381|  2.98k|  if (utf32_length == 0 && !ut8_string.empty()) {
  ------------------
  |  Branch (6381:7): [True: 25, False: 2.96k]
  |  Branch (6381:28): [True: 25, False: 0]
  ------------------
 6382|     25|    return false;
 6383|     25|  }
 6384|  2.96k|  std::u32string working(utf32_length, U'\0');
 6385|  2.96k|  size_t actual_utf32_length = ada::idna::utf8_to_utf32(
 6386|  2.96k|      ut8_string.data(), ut8_string.size(), working.data());
 6387|  2.96k|#endif
 6388|  2.96k|  if (actual_utf32_length == 0 || actual_utf32_length != utf32_length) {
  ------------------
  |  Branch (6388:7): [True: 342, False: 2.61k]
  |  Branch (6388:35): [True: 0, False: 2.61k]
  ------------------
 6389|    342|    return false;
 6390|    342|  }
 6391|  2.61k|  working.resize(actual_utf32_length);
 6392|       |
 6393|       |  // Map into a second buffer with exact sizing (no growth reallocs).
 6394|  2.61k|  std::u32string mapped;
 6395|  2.61k|  if (!ada::idna::map(working, mapped)) {
  ------------------
  |  Branch (6395:7): [True: 286, False: 2.33k]
  ------------------
 6396|    286|    return false;
 6397|    286|  }
 6398|       |  // Drop UTF-32 input; reuse `working` as scratch for ACE validation below.
 6399|  2.33k|  working.clear();
 6400|       |
 6401|       |  // Skip NFC when already normalized (ASCII is a fast subset of this check).
 6402|  2.33k|  if (!is_ascii(mapped) && !is_already_nfc(mapped)) {
  ------------------
  |  Branch (6402:7): [True: 2.03k, False: 293]
  |  Branch (6402:28): [True: 309, False: 1.73k]
  ------------------
 6403|    309|    if (!normalize(mapped)) {
  ------------------
  |  Branch (6403:9): [True: 0, False: 309]
  ------------------
 6404|      0|      return false;
 6405|      0|    }
 6406|    309|  }
 6407|       |
 6408|       |  // Estimate ASCII output size (punycode may expand non-ASCII labels).
 6409|  2.33k|  out.reserve(mapped.size() + 8);
 6410|       |
 6411|       |  // Walk labels with a single pointer scan (no repeated string::find).
 6412|  2.33k|  const char32_t* p = mapped.data();
 6413|  2.33k|  const char32_t* const end = p + mapped.size();
 6414|  2.33k|  std::u32string post_map;
 6415|       |
 6416|  7.68k|  while (p < end) {
  ------------------
  |  Branch (6416:10): [True: 6.06k, False: 1.62k]
  ------------------
 6417|  6.06k|    const char32_t* label_begin = p;
 6418|   127k|    while (p < end && *p != U'.') {
  ------------------
  |  Branch (6418:12): [True: 125k, False: 2.21k]
  |  Branch (6418:23): [True: 121k, False: 3.84k]
  ------------------
 6419|   121k|      ++p;
 6420|   121k|    }
 6421|  6.06k|    const size_t label_size = static_cast<size_t>(p - label_begin);
 6422|  6.06k|    std::u32string_view label_view(label_begin, label_size);
 6423|  6.06k|    const bool is_last_label = (p == end);
 6424|  6.06k|    if (p < end) {
  ------------------
  |  Branch (6424:9): [True: 3.84k, False: 2.21k]
  ------------------
 6425|  3.84k|      ++p;  // skip dot
 6426|  3.84k|    }
 6427|       |
 6428|  6.06k|    if (label_size == 0) {
  ------------------
  |  Branch (6428:9): [True: 451, False: 5.61k]
  ------------------
 6429|       |      // empty label
 6430|  5.61k|    } else if (is_ace_prefix(label_view)) {
  ------------------
  |  Branch (6430:16): [True: 1.34k, False: 4.27k]
  ------------------
 6431|  14.3k|      for (char32_t c : label_view) {
  ------------------
  |  Branch (6431:23): [True: 14.3k, False: 1.32k]
  ------------------
 6432|  14.3k|        if (c >= 0x80) {
  ------------------
  |  Branch (6432:13): [True: 19, False: 14.2k]
  ------------------
 6433|     19|          out.clear();
 6434|     19|          return false;
 6435|     19|        }
 6436|  14.3k|      }
 6437|  1.32k|      append_ascii_label(out, label_view);
 6438|  1.32k|      std::string_view puny_segment_ascii(
 6439|  1.32k|          out.data() + (out.size() - label_size) + 4, label_size - 4);
 6440|  1.32k|      working.clear();
 6441|  1.32k|      if (!ada::idna::punycode_to_utf32(puny_segment_ascii, working)) {
  ------------------
  |  Branch (6441:11): [True: 14, False: 1.31k]
  ------------------
 6442|     14|        out.clear();
 6443|     14|        return false;
 6444|     14|      }
 6445|  1.31k|      if (is_ascii(working)) {
  ------------------
  |  Branch (6445:11): [True: 41, False: 1.26k]
  ------------------
 6446|     41|        out.clear();
 6447|     41|        return false;
 6448|     41|      }
 6449|  1.26k|      if (!ada::idna::map(working, post_map) || working != post_map) {
  ------------------
  |  Branch (6449:11): [True: 33, False: 1.23k]
  |  Branch (6449:49): [True: 37, False: 1.19k]
  ------------------
 6450|     70|        out.clear();
 6451|     70|        return false;
 6452|     70|      }
 6453|       |      // Mapping must be stable; NFC must not change the mapped form either.
 6454|  1.19k|      if (!is_ascii(post_map) && !is_already_nfc(post_map)) {
  ------------------
  |  Branch (6454:11): [True: 1.19k, False: 0]
  |  Branch (6454:34): [True: 518, False: 681]
  ------------------
 6455|    518|        if (!normalize(post_map) || post_map != working) {
  ------------------
  |  Branch (6455:13): [True: 0, False: 518]
  |  Branch (6455:37): [True: 25, False: 493]
  ------------------
 6456|     25|          out.clear();
 6457|     25|          return false;
 6458|     25|        }
 6459|    518|      }
 6460|  1.17k|      if (post_map.empty() || !is_label_valid(post_map)) {
  ------------------
  |  Branch (6460:11): [True: 0, False: 1.17k]
  |  Branch (6460:31): [True: 10, False: 1.16k]
  ------------------
 6461|     10|        out.clear();
 6462|     10|        return false;
 6463|     10|      }
 6464|  4.27k|    } else if (is_ascii(label_view)) {
  ------------------
  |  Branch (6464:16): [True: 435, False: 3.83k]
  ------------------
 6465|    435|      append_ascii_label(out, label_view);
 6466|  3.83k|    } else {
 6467|  3.83k|      if (!is_label_valid(label_view)) {
  ------------------
  |  Branch (6467:11): [True: 532, False: 3.30k]
  ------------------
 6468|    532|        out.clear();
 6469|    532|        return false;
 6470|    532|      }
 6471|  3.30k|      out.append("xn--");
 6472|  3.30k|      if (!ada::idna::utf32_to_punycode(label_view, out)) {
  ------------------
  |  Branch (6472:11): [True: 0, False: 3.30k]
  ------------------
 6473|      0|        out.clear();
 6474|      0|        return false;
 6475|      0|      }
 6476|  3.30k|    }
 6477|  5.35k|    if (!is_last_label) {
  ------------------
  |  Branch (6477:9): [True: 3.80k, False: 1.54k]
  ------------------
 6478|  3.80k|      out.push_back('.');
 6479|  3.80k|    }
 6480|  5.35k|  }
 6481|  1.62k|  return true;
 6482|  2.33k|}
_ZN3ada4idna8to_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6484|  11.9k|std::string to_ascii(std::string_view ut8_string) {
 6485|  11.9k|  std::string out;
 6486|  11.9k|  if (!to_ascii(ut8_string, out)) {
  ------------------
  |  Branch (6486:7): [True: 1.36k, False: 10.5k]
  ------------------
 6487|  1.36k|    return {};
 6488|  1.36k|  }
 6489|  10.5k|  return out;
 6490|  11.9k|}
_ZN3ada4idna10to_unicodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEERNS1_12basic_stringIcS4_NS1_9allocatorIcEEEE:
 6558|  11.3k|[[nodiscard]] bool to_unicode(std::string_view input, std::string& output) {
 6559|  11.3k|  output.clear();
 6560|  11.3k|  if (input.size() > max_domain_input_bytes) {
  ------------------
  |  Branch (6560:7): [True: 0, False: 11.3k]
  ------------------
 6561|      0|    return false;
 6562|      0|  }
 6563|  11.3k|  output.reserve(input.size());
 6564|       |
 6565|  11.3k|  size_t label_start = 0;
 6566|  11.3k|  std::u32string tmp_buffer;
 6567|  11.3k|  std::u32string post_map;
 6568|  40.6k|  while (label_start < input.size()) {
  ------------------
  |  Branch (6568:10): [True: 29.3k, False: 11.3k]
  ------------------
 6569|  29.3k|    size_t loc_dot = input.find('.', label_start);
 6570|  29.3k|    bool is_last_label = (loc_dot == std::string_view::npos);
 6571|  29.3k|    size_t label_size =
 6572|  29.3k|        is_last_label ? input.size() - label_start : loc_dot - label_start;
  ------------------
  |  Branch (6572:9): [True: 10.7k, False: 18.5k]
  ------------------
 6573|  29.3k|    auto label_view = std::string_view(input.data() + label_start, label_size);
 6574|       |
 6575|  29.3k|    if (label_view.starts_with("xn--") && ada::idna::is_ascii(label_view)) {
  ------------------
  |  Branch (6575:9): [True: 14.1k, False: 15.1k]
  |  Branch (6575:43): [True: 13.7k, False: 360]
  ------------------
 6576|  13.7k|      label_view.remove_prefix(4);
 6577|  13.7k|      tmp_buffer.clear();
 6578|  13.7k|      if (ada::idna::punycode_to_utf32(label_view, tmp_buffer)) {
  ------------------
  |  Branch (6578:11): [True: 12.1k, False: 1.59k]
  ------------------
 6579|       |        // Per UTS #46, the decoded label must be re-validated. Reject decodings
 6580|       |        // that are pure ASCII (xn-- encoding of an ASCII-only label), or whose
 6581|       |        // mapping/normalization is not stable, or that fail label validity.
 6582|  12.1k|        bool accept_decoded = true;
 6583|  12.1k|        if (ada::idna::is_ascii(tmp_buffer)) {
  ------------------
  |  Branch (6583:13): [True: 1.45k, False: 10.7k]
  ------------------
 6584|  1.45k|          accept_decoded = false;
 6585|  10.7k|        } else {
 6586|  10.7k|          post_map.clear();
 6587|  10.7k|          if (!ada::idna::map(tmp_buffer, post_map) || post_map != tmp_buffer) {
  ------------------
  |  Branch (6587:15): [True: 1.12k, False: 9.58k]
  |  Branch (6587:56): [True: 925, False: 8.66k]
  ------------------
 6588|  2.05k|            accept_decoded = false;
 6589|  8.66k|          } else if (!ada::idna::normalize(post_map) ||
  ------------------
  |  Branch (6589:22): [True: 0, False: 8.66k]
  ------------------
 6590|  8.66k|                     post_map != tmp_buffer || post_map.empty() ||
  ------------------
  |  Branch (6590:22): [True: 1.69k, False: 6.96k]
  |  Branch (6590:48): [True: 0, False: 6.96k]
  ------------------
 6591|  6.96k|                     !ada::idna::is_label_valid(post_map)) {
  ------------------
  |  Branch (6591:22): [True: 2.20k, False: 4.75k]
  ------------------
 6592|  3.90k|            accept_decoded = false;
 6593|  3.90k|          }
 6594|  10.7k|        }
 6595|       |
 6596|  12.1k|        if (accept_decoded) {
  ------------------
  |  Branch (6596:13): [True: 4.75k, False: 7.41k]
  ------------------
 6597|       |#ifdef ADA_USE_SIMDUTF
 6598|       |          auto utf8_size = simdutf::utf8_length_from_utf32(tmp_buffer.data(),
 6599|       |                                                           tmp_buffer.size());
 6600|       |          size_t old_size = output.size();
 6601|       |          output.resize(old_size + utf8_size);
 6602|       |          size_t written = simdutf::convert_utf32_to_utf8(
 6603|       |              tmp_buffer.data(), tmp_buffer.size(), output.data() + old_size);
 6604|       |          if (written != utf8_size) {
 6605|       |            output.resize(old_size);
 6606|       |            output.append(
 6607|       |                std::string_view(input.data() + label_start, label_size));
 6608|       |          }
 6609|       |#else
 6610|  4.75k|          auto utf8_size = ada::idna::utf8_length_from_utf32(tmp_buffer.data(),
 6611|  4.75k|                                                             tmp_buffer.size());
 6612|  4.75k|          size_t old_size = output.size();
 6613|  4.75k|          output.resize(old_size + utf8_size);
 6614|  4.75k|          size_t written = ada::idna::utf32_to_utf8(
 6615|  4.75k|              tmp_buffer.data(), tmp_buffer.size(), output.data() + old_size);
 6616|  4.75k|          if (written != utf8_size) {
  ------------------
  |  Branch (6616:15): [True: 0, False: 4.75k]
  ------------------
 6617|      0|            output.resize(old_size);
 6618|      0|            output.append(
 6619|      0|                std::string_view(input.data() + label_start, label_size));
 6620|      0|          }
 6621|  4.75k|#endif
 6622|  7.41k|        } else {
 6623|       |          // ToUnicode never fails. If any step fails, return the original
 6624|       |          // input sequence for the label.
 6625|  7.41k|          output.append(
 6626|  7.41k|              std::string_view(input.data() + label_start, label_size));
 6627|  7.41k|        }
 6628|  12.1k|      } else {
 6629|  1.59k|        output.append(std::string_view(input.data() + label_start, label_size));
 6630|  1.59k|      }
 6631|  15.5k|    } else {
 6632|  15.5k|      output.append(label_view);
 6633|  15.5k|    }
 6634|       |
 6635|  29.3k|    if (!is_last_label) {
  ------------------
  |  Branch (6635:9): [True: 18.5k, False: 10.7k]
  ------------------
 6636|  18.5k|      output.push_back('.');
 6637|  18.5k|    }
 6638|       |
 6639|  29.3k|    label_start += label_size + 1;
 6640|  29.3k|  }
 6641|       |
 6642|  11.3k|  return true;
 6643|  11.3k|}
_ZN3ada4idna10to_unicodeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6645|  11.3k|std::string to_unicode(std::string_view input) {
 6646|  11.3k|  std::string output;
 6647|  11.3k|  if (!to_unicode(input, output)) {
  ------------------
  |  Branch (6647:7): [True: 0, False: 11.3k]
  ------------------
 6648|       |    // Over-limit input: return original (ToUnicode never fails in the sense of
 6649|       |    // producing no answer for valid-length inputs).
 6650|      0|    return std::string(input);
 6651|      0|  }
 6652|  11.3k|  return output;
 6653|  11.3k|}
idna.cc:_ZZN3ada4idna22utf32_length_from_utf8EPKcmENK3$_0clEa:
  272|   410k|  return std::count_if(p, std::next(p, len), [](int8_t c) {
  273|       |    // -65 is 0b10111111, anything larger in two-complement's
  274|       |    // should start a new code point.
  275|   410k|    return c > -65;
  276|   410k|  });
_ZN3ada4idna7deflate22make_fixed_litlen_huffEv:
  483|      2|inline Huff make_fixed_litlen_huff() {
  484|      2|  Huff h;
  485|      2|  uint8_t lens[288];
  486|       |  // Fixed Huffman: 0-143:8, 144-255:9, 256-279:7, 280-287:8
  487|    290|  for (int i = 0; i <= 143; i++) lens[i] = 8;
  ------------------
  |  Branch (487:19): [True: 288, False: 2]
  ------------------
  488|    226|  for (int i = 144; i <= 255; i++) lens[i] = 9;
  ------------------
  |  Branch (488:21): [True: 224, False: 2]
  ------------------
  489|     50|  for (int i = 256; i <= 279; i++) lens[i] = 7;
  ------------------
  |  Branch (489:21): [True: 48, False: 2]
  ------------------
  490|     18|  for (int i = 280; i <= 287; i++) lens[i] = 8;
  ------------------
  |  Branch (490:21): [True: 16, False: 2]
  ------------------
  491|      2|  h.build(lens, 288);
  492|      2|  return h;
  493|      2|}
_ZN3ada4idna7deflate4Huff5buildEPKhi:
  432|     16|  bool build(const uint8_t* lens, int n) {
  433|     16|    std::memset(counts, 0, sizeof(counts));
  434|     16|    std::memset(first_code, 0, sizeof(first_code));
  435|     16|    std::memset(base_idx, 0, sizeof(base_idx));
  436|     16|    nsymbols = n;
  437|     16|    max_bits = 0;
  438|  1.98k|    for (int i = 0; i < n; i++) {
  ------------------
  |  Branch (438:21): [True: 1.96k, False: 16]
  ------------------
  439|  1.96k|      lengths[i] = lens[i];
  440|  1.96k|      if (lens[i]) {
  ------------------
  |  Branch (440:11): [True: 1.91k, False: 49]
  ------------------
  441|  1.91k|        counts[lens[i]]++;
  442|  1.91k|        if (lens[i] > max_bits) max_bits = lens[i];
  ------------------
  |  Branch (442:13): [True: 46, False: 1.87k]
  ------------------
  443|  1.91k|      }
  444|  1.96k|    }
  445|       |    // Canonical first code for each bit length (RFC 1951).
  446|     16|    int code = 0;
  447|    256|    for (int bits = 1; bits <= MAXBITS; bits++) {
  ------------------
  |  Branch (447:24): [True: 240, False: 16]
  ------------------
  448|    240|      code = (code + counts[bits - 1]) << 1;
  449|    240|      first_code[bits] = code;
  450|    240|    }
  451|     16|    int idx = 0;
  452|    158|    for (int bits = 1; bits <= max_bits; bits++) {
  ------------------
  |  Branch (452:24): [True: 142, False: 16]
  ------------------
  453|    142|      base_idx[bits] = idx;
  454|       |      // assign symbols in symbol order for codes of this length
  455|  21.6k|      for (int sym = 0; sym < n; sym++) {
  ------------------
  |  Branch (455:25): [True: 21.5k, False: 142]
  ------------------
  456|  21.5k|        if (lengths[sym] == bits) {
  ------------------
  |  Branch (456:13): [True: 1.91k, False: 19.6k]
  ------------------
  457|  1.91k|          symbols[idx++] = static_cast<int16_t>(sym);
  458|  1.91k|        }
  459|  21.5k|      }
  460|    142|    }
  461|     16|    return true;
  462|     16|  }
_ZN3ada4idna7deflate20make_fixed_dist_huffEv:
  495|      2|inline Huff make_fixed_dist_huff() {
  496|      2|  Huff h;
  497|      2|  uint8_t lens[32];
  498|     66|  for (int i = 0; i < 32; i++) lens[i] = 5;
  ------------------
  |  Branch (498:19): [True: 64, False: 2]
  ------------------
  499|      2|  h.build(lens, 32);
  500|      2|  return h;
  501|      2|}
_ZN3ada4idna7deflate9BitReader6ensureEi:
  392|   457k|  bool ensure(int n) {
  393|   520k|    while (bits < n) {
  ------------------
  |  Branch (393:12): [True: 62.3k, False: 457k]
  ------------------
  394|  62.3k|      if (p >= end) return false;
  ------------------
  |  Branch (394:11): [True: 0, False: 62.3k]
  ------------------
  395|  62.3k|      acc |= uint32_t(*p++) << bits;
  396|  62.3k|      bits += 8;
  397|  62.3k|    }
  398|   457k|    return true;
  399|   457k|  }
idna.cc:_ZZN3ada4idna9ascii_mapEPcmENK3$_0clEh:
 5127|  40.5k|  auto broadcast = [](uint8_t v) -> uint64_t {
 5128|  40.5k|    return 0x101010101010101ull * v;
 5129|  40.5k|  };
_ZN3ada4idna13ensure_tablesEv:
 4878|  44.1k|[[nodiscard]] inline bool ensure_tables() noexcept {
 4879|  44.1k|  uint8_t state = tables_init_state.load(std::memory_order_acquire);
 4880|  44.1k|  if (state == kTablesReady) {
  ------------------
  |  Branch (4880:7): [True: 44.1k, False: 1]
  ------------------
 4881|  44.1k|    return true;
 4882|  44.1k|  }
 4883|      1|  if (state == kTablesFailed) {
  ------------------
  |  Branch (4883:7): [True: 0, False: 1]
  ------------------
 4884|      0|    return false;
 4885|      0|  }
 4886|       |
 4887|      1|  uint8_t expected = kTablesUninit;
 4888|      1|  if (tables_init_state.compare_exchange_strong(expected, kTablesInProgress,
  ------------------
  |  Branch (4888:7): [True: 1, False: 0]
  ------------------
 4889|      1|                                                std::memory_order_acq_rel,
 4890|      1|                                                std::memory_order_acquire)) {
 4891|      1|    uint8_t* buffer = new (std::nothrow) uint8_t[table_blob::uncompressed_size];
 4892|      1|    if (buffer == nullptr) {
  ------------------
  |  Branch (4892:9): [True: 0, False: 1]
  ------------------
 4893|      0|      tables_init_state.store(kTablesFailed, std::memory_order_release);
 4894|      0|      return false;
 4895|      0|    }
 4896|       |
 4897|      1|    const size_t n = deflate::inflate_raw(table_blob::compressed,
 4898|      1|                                          table_blob::compressed_size, buffer,
 4899|      1|                                          table_blob::uncompressed_size);
 4900|      1|    if (n != table_blob::uncompressed_size ||
  ------------------
  |  Branch (4900:9): [True: 0, False: 1]
  ------------------
 4901|      1|        crc32_ieee(buffer, n) != table_blob::uncompressed_crc32) {
  ------------------
  |  Branch (4901:9): [True: 0, False: 1]
  ------------------
 4902|      0|      delete[] buffer;
 4903|      0|      tables_init_state.store(kTablesFailed, std::memory_order_release);
 4904|      0|      return false;
 4905|      0|    }
 4906|       |
 4907|       |    // LE payload verified; convert multi-byte fields for big-endian hosts.
 4908|      1|    detail::convert_table_blob_to_host_endian(buffer);
 4909|       |
 4910|      1|    auto at = [&](size_t off) noexcept -> const uint8_t* {
 4911|      1|      return buffer + off;
 4912|      1|    };
 4913|       |
 4914|       |    // Publish all non-atomic pointers before READY. Waiters synchronize via
 4915|       |    // acquire on tables_init_state and then observe these writes.
 4916|      1|    idna_stage1 =
 4917|      1|        reinterpret_cast<const uint16_t*>(at(table_blob::off_idna_stage1));
 4918|      1|    idna_stage2 =
 4919|      1|        reinterpret_cast<const uint16_t*>(at(table_blob::off_idna_stage2));
 4920|      1|    idna_bool_blocks =
 4921|      1|        reinterpret_cast<const uint64_t*>(at(table_blob::off_idna_bool_blocks));
 4922|      1|    idna_utf8_mappings = at(table_blob::off_idna_utf8_mappings);
 4923|       |
 4924|      1|    decomposition_index = at(table_blob::off_decomposition_index);
 4925|      1|    decomposition_block_flat = reinterpret_cast<const uint16_t*>(
 4926|      1|        at(table_blob::off_decomposition_block));
 4927|      1|    decomposition_data = reinterpret_cast<const char32_t*>(
 4928|      1|        at(table_blob::off_decomposition_data));
 4929|      1|    ccc_index = at(table_blob::off_ccc_index);
 4930|      1|    ccc_block_flat = at(table_blob::off_ccc_block);
 4931|      1|    composition_index = at(table_blob::off_composition_index);
 4932|      1|    composition_block_flat = reinterpret_cast<const uint16_t*>(
 4933|      1|        at(table_blob::off_composition_block));
 4934|      1|    composition_data =
 4935|      1|        reinterpret_cast<const char32_t*>(at(table_blob::off_composition_data));
 4936|       |
 4937|      1|    id_continue =
 4938|      1|        reinterpret_cast<range_pair_ptr>(at(table_blob::off_id_continue_flat));
 4939|      1|    id_start =
 4940|      1|        reinterpret_cast<range_pair_ptr>(at(table_blob::off_id_start_flat));
 4941|       |
 4942|      1|    dir_start =
 4943|      1|        reinterpret_cast<const uint32_t*>(at(table_blob::off_dir_start));
 4944|      1|    dir_final =
 4945|      1|        reinterpret_cast<const uint32_t*>(at(table_blob::off_dir_final));
 4946|      1|    dir_value = at(table_blob::off_dir_value);
 4947|      1|    combining_ranges =
 4948|      1|        reinterpret_cast<range_pair_ptr>(at(table_blob::off_combining_flat));
 4949|       |
 4950|      1|    tables_buffer = buffer;
 4951|      1|    tables_init_state.store(kTablesReady, std::memory_order_release);
 4952|      1|    return true;
 4953|      1|  }
 4954|       |
 4955|       |  // Another thread owns init (or finished between our loads).
 4956|      0|  for (uint64_t spins = 0; spins < kTablesSpinLimit; ++spins) {
  ------------------
  |  Branch (4956:28): [True: 0, False: 0]
  ------------------
 4957|      0|    state = tables_init_state.load(std::memory_order_acquire);
 4958|      0|    if (state == kTablesReady) {
  ------------------
  |  Branch (4958:9): [True: 0, False: 0]
  ------------------
 4959|      0|      return true;
 4960|      0|    }
 4961|      0|    if (state == kTablesFailed) {
  ------------------
  |  Branch (4961:9): [True: 0, False: 0]
  ------------------
 4962|      0|      return false;
 4963|      0|    }
 4964|      0|#if defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || \
 4965|      0|    defined(_M_IX86)
 4966|      0|#if defined(__GNUC__) || defined(__clang__)
 4967|      0|    __builtin_ia32_pause();
 4968|      0|#endif
 4969|       |#elif defined(__aarch64__) || defined(_M_ARM64)
 4970|       |#if defined(__GNUC__) || defined(__clang__)
 4971|       |    asm volatile("yield" ::: "memory");
 4972|       |#endif
 4973|       |#endif
 4974|      0|  }
 4975|       |  // Timed out waiting for a peer - treat as failure rather than hang.
 4976|      0|  return false;
 4977|      0|}
_ZN3ada4idna7deflate11inflate_rawEPKhmPhm:
  528|      1|                          size_t dst_cap) {
  529|      1|  BitReader br(src, src_len);
  530|      1|  size_t out = 0;
  531|      4|  for (;;) {
  532|      4|    uint32_t bfinal = br.get(1);
  533|      4|    uint32_t btype = br.get(2);
  534|      4|    if (bfinal == UINT32_MAX || btype == UINT32_MAX) return 0;
  ------------------
  |  Branch (534:9): [True: 0, False: 4]
  |  Branch (534:33): [True: 0, False: 4]
  ------------------
  535|      4|    if (btype == 0) {
  ------------------
  |  Branch (535:9): [True: 0, False: 4]
  ------------------
  536|       |      // stored
  537|      0|      br.align_byte();
  538|      0|      if (!br.ensure(16)) return 0;
  ------------------
  |  Branch (538:11): [True: 0, False: 0]
  ------------------
  539|       |      // read 16+16 from bit buffer awkwardly - use byte path
  540|       |      // Align: bits is multiple of 8
  541|       |      // Get len from remaining bits then bytes
  542|      0|      uint32_t len = br.get(16);
  543|      0|      uint32_t nlen = br.get(16);
  544|      0|      if (len == UINT32_MAX || nlen == UINT32_MAX) return 0;
  ------------------
  |  Branch (544:11): [True: 0, False: 0]
  |  Branch (544:32): [True: 0, False: 0]
  ------------------
  545|      0|      if ((len ^ 0xFFFF) != nlen) return 0;
  ------------------
  |  Branch (545:11): [True: 0, False: 0]
  ------------------
  546|       |      // After get, may have bits in acc from previous - for stored, should be
  547|       |      // byte aligned Copy len bytes from p
  548|      0|      if (br.bits != 0) {
  ------------------
  |  Branch (548:11): [True: 0, False: 0]
  ------------------
  549|       |        // leftover bits should be 0 if aligned
  550|      0|      }
  551|      0|      if (size_t(br.end - br.p) < len) return 0;
  ------------------
  |  Branch (551:11): [True: 0, False: 0]
  ------------------
  552|      0|      if (out + len > dst_cap) return 0;
  ------------------
  |  Branch (552:11): [True: 0, False: 0]
  ------------------
  553|      0|      std::memcpy(dst + out, br.p, len);
  554|      0|      br.p += len;
  555|      0|      out += len;
  556|      4|    } else if (btype == 1 || btype == 2) {
  ------------------
  |  Branch (556:16): [True: 0, False: 4]
  |  Branch (556:30): [True: 4, False: 0]
  ------------------
  557|      4|      Huff lit, dist;
  558|      4|      if (btype == 1) {
  ------------------
  |  Branch (558:11): [True: 0, False: 4]
  ------------------
  559|       |        // use fixed via functions
  560|      4|      } else {
  561|       |        // dynamic
  562|      4|        uint32_t hlit = br.get(5);
  563|      4|        if (hlit == UINT32_MAX) return 0;
  ------------------
  |  Branch (563:13): [True: 0, False: 4]
  ------------------
  564|      4|        hlit += 257;
  565|      4|        uint32_t hdist = br.get(5);
  566|      4|        if (hdist == UINT32_MAX) return 0;
  ------------------
  |  Branch (566:13): [True: 0, False: 4]
  ------------------
  567|      4|        hdist += 1;
  568|      4|        uint32_t hclen = br.get(4);
  569|      4|        if (hclen == UINT32_MAX) return 0;
  ------------------
  |  Branch (569:13): [True: 0, False: 4]
  ------------------
  570|      4|        hclen += 4;
  571|      4|        static const int order[19] = {16, 17, 18, 0, 8,  7, 9,  6, 10, 5,
  572|      4|                                      11, 4,  12, 3, 13, 2, 14, 1, 15};
  573|      4|        uint8_t clen[19]{};
  574|     69|        for (uint32_t i = 0; i < hclen; i++) {
  ------------------
  |  Branch (574:30): [True: 65, False: 4]
  ------------------
  575|     65|          uint32_t v = br.get(3);
  576|     65|          if (v == UINT32_MAX) return 0;
  ------------------
  |  Branch (576:15): [True: 0, False: 65]
  ------------------
  577|     65|          clen[order[i]] = uint8_t(v);
  578|     65|        }
  579|      4|        Huff cl;
  580|      4|        if (!cl.build(clen, 19)) return 0;
  ------------------
  |  Branch (580:13): [True: 0, False: 4]
  ------------------
  581|      4|        uint8_t lens[288 + 32]{};
  582|      4|        uint32_t n = hlit + hdist;
  583|  1.09k|        for (uint32_t i = 0; i < n;) {
  ------------------
  |  Branch (583:30): [True: 1.08k, False: 4]
  ------------------
  584|  1.08k|          int sym = cl.decode(br);
  585|  1.08k|          if (sym < 0) return 0;
  ------------------
  |  Branch (585:15): [True: 0, False: 1.08k]
  ------------------
  586|  1.08k|          if (sym < 16) {
  ------------------
  |  Branch (586:15): [True: 1.03k, False: 49]
  ------------------
  587|  1.03k|            lens[i++] = uint8_t(sym);
  588|  1.03k|          } else if (sym == 16) {
  ------------------
  |  Branch (588:22): [True: 49, False: 0]
  ------------------
  589|     49|            uint32_t rep = br.get(2);
  590|     49|            if (rep == UINT32_MAX) return 0;
  ------------------
  |  Branch (590:17): [True: 0, False: 49]
  ------------------
  591|     49|            rep += 3;
  592|     49|            if (i == 0) return 0;
  ------------------
  |  Branch (592:17): [True: 0, False: 49]
  ------------------
  593|     49|            uint8_t v = lens[i - 1];
  594|    263|            while (rep--) lens[i++] = v;
  ------------------
  |  Branch (594:20): [True: 214, False: 49]
  ------------------
  595|     49|          } else if (sym == 17) {
  ------------------
  |  Branch (595:22): [True: 0, False: 0]
  ------------------
  596|      0|            uint32_t rep = br.get(3);
  597|      0|            if (rep == UINT32_MAX) return 0;
  ------------------
  |  Branch (597:17): [True: 0, False: 0]
  ------------------
  598|      0|            rep += 3;
  599|      0|            while (rep--) lens[i++] = 0;
  ------------------
  |  Branch (599:20): [True: 0, False: 0]
  ------------------
  600|      0|          } else if (sym == 18) {
  ------------------
  |  Branch (600:22): [True: 0, False: 0]
  ------------------
  601|      0|            uint32_t rep = br.get(7);
  602|      0|            if (rep == UINT32_MAX) return 0;
  ------------------
  |  Branch (602:17): [True: 0, False: 0]
  ------------------
  603|      0|            rep += 11;
  604|      0|            while (rep--) lens[i++] = 0;
  ------------------
  |  Branch (604:20): [True: 0, False: 0]
  ------------------
  605|      0|          } else
  606|      0|            return 0;
  607|  1.08k|        }
  608|      4|        if (!lit.build(lens, int(hlit))) return 0;
  ------------------
  |  Branch (608:13): [True: 0, False: 4]
  ------------------
  609|      4|        if (!dist.build(lens + hlit, int(hdist))) return 0;
  ------------------
  |  Branch (609:13): [True: 0, False: 4]
  ------------------
  610|      4|      }
  611|  52.2k|      for (;;) {
  612|  52.2k|        int sym;
  613|  52.2k|        if (btype == 1)
  ------------------
  |  Branch (613:13): [True: 0, False: 52.2k]
  ------------------
  614|      0|          sym = fixed_litlen(br);
  615|  52.2k|        else
  616|  52.2k|          sym = lit.decode(br);
  617|  52.2k|        if (sym < 0) return 0;
  ------------------
  |  Branch (617:13): [True: 0, False: 52.2k]
  ------------------
  618|  52.2k|        if (sym < 256) {
  ------------------
  |  Branch (618:13): [True: 37.2k, False: 14.9k]
  ------------------
  619|  37.2k|          if (out >= dst_cap) return 0;
  ------------------
  |  Branch (619:15): [True: 0, False: 37.2k]
  ------------------
  620|  37.2k|          dst[out++] = uint8_t(sym);
  621|  37.2k|        } else if (sym == 256) {
  ------------------
  |  Branch (621:20): [True: 4, False: 14.9k]
  ------------------
  622|      4|          break;
  623|  14.9k|        } else {
  624|  14.9k|          int len_code = sym - 257;
  625|  14.9k|          if (len_code < 0 || len_code > 28) return 0;
  ------------------
  |  Branch (625:15): [True: 0, False: 14.9k]
  |  Branch (625:31): [True: 0, False: 14.9k]
  ------------------
  626|  14.9k|          uint32_t extra = br.get(len_extra[len_code]);
  627|  14.9k|          if (len_extra[len_code] && extra == UINT32_MAX) return 0;
  ------------------
  |  Branch (627:15): [True: 2.03k, False: 12.9k]
  |  Branch (627:38): [True: 0, False: 2.03k]
  ------------------
  628|  14.9k|          uint32_t length =
  629|  14.9k|              len_base[len_code] + (len_extra[len_code] ? extra : 0);
  ------------------
  |  Branch (629:37): [True: 2.03k, False: 12.9k]
  ------------------
  630|  14.9k|          int dsym;
  631|  14.9k|          if (btype == 1)
  ------------------
  |  Branch (631:15): [True: 0, False: 14.9k]
  ------------------
  632|      0|            dsym = fixed_dist(br);
  633|  14.9k|          else
  634|  14.9k|            dsym = dist.decode(br);
  635|  14.9k|          if (dsym < 0 || dsym > 29) return 0;
  ------------------
  |  Branch (635:15): [True: 0, False: 14.9k]
  |  Branch (635:27): [True: 0, False: 14.9k]
  ------------------
  636|  14.9k|          uint32_t dextra = br.get(dist_extra[dsym]);
  637|  14.9k|          if (dist_extra[dsym] && dextra == UINT32_MAX) return 0;
  ------------------
  |  Branch (637:15): [True: 9.97k, False: 5.01k]
  |  Branch (637:35): [True: 0, False: 9.97k]
  ------------------
  638|  14.9k|          uint32_t distance = dist_base[dsym] + (dist_extra[dsym] ? dextra : 0);
  ------------------
  |  Branch (638:50): [True: 9.97k, False: 5.01k]
  ------------------
  639|  14.9k|          if (distance > out || out + length > dst_cap) return 0;
  ------------------
  |  Branch (639:15): [True: 0, False: 14.9k]
  |  Branch (639:33): [True: 0, False: 14.9k]
  ------------------
  640|   202k|          for (uint32_t k = 0; k < length; k++) {
  ------------------
  |  Branch (640:32): [True: 187k, False: 14.9k]
  ------------------
  641|   187k|            dst[out] = dst[out - distance];
  642|   187k|            out++;
  643|   187k|          }
  644|  14.9k|        }
  645|  52.2k|      }
  646|      4|    } else {
  647|      0|      return 0;  // reserved
  648|      0|    }
  649|      4|    if (bfinal) break;
  ------------------
  |  Branch (649:9): [True: 1, False: 3]
  ------------------
  650|      4|  }
  651|      1|  return out;
  652|      1|}
_ZN3ada4idna7deflate9BitReaderC2EPKhm:
  390|      1|      : p(data), end(data + len) {}
_ZNK3ada4idna7deflate4Huff6decodeERNS1_9BitReaderE:
  464|  68.3k|  int decode(BitReader& br) const {
  465|  68.3k|    if (max_bits == 0) return -1;
  ------------------
  |  Branch (465:9): [True: 0, False: 68.3k]
  ------------------
  466|  68.3k|    int code = 0;
  467|   427k|    for (int len = 1; len <= max_bits; len++) {
  ------------------
  |  Branch (467:23): [True: 427k, False: 0]
  ------------------
  468|   427k|      uint32_t b = br.get(1);
  469|   427k|      if (b == UINT32_MAX) return -1;
  ------------------
  |  Branch (469:11): [True: 0, False: 427k]
  ------------------
  470|   427k|      code = (code << 1) | int(b);
  471|   427k|      int first = first_code[len];
  472|   427k|      int cnt = counts[len];
  473|   427k|      if (cnt && code - first < cnt) {
  ------------------
  |  Branch (473:11): [True: 263k, False: 164k]
  |  Branch (473:18): [True: 68.3k, False: 195k]
  ------------------
  474|  68.3k|        return symbols[base_idx[len] + (code - first)];
  475|  68.3k|      }
  476|   427k|    }
  477|      0|    return -1;
  478|  68.3k|  }
_ZN3ada4idna10crc32_ieeeEPKhm:
 4861|      1|                                         size_t len) noexcept {
 4862|      1|  uint32_t c = 0xFFFFFFFFu;
 4863|   224k|  for (size_t i = 0; i < len; ++i) {
  ------------------
  |  Branch (4863:22): [True: 224k, False: 1]
  ------------------
 4864|   224k|    c ^= data[i];
 4865|  2.02M|    for (int k = 0; k < 8; ++k) {
  ------------------
  |  Branch (4865:21): [True: 1.79M, False: 224k]
  ------------------
 4866|  1.79M|      const uint32_t mask = 0u - (c & 1u);
 4867|  1.79M|      c = (c >> 1) ^ (0xEDB88320u & mask);
 4868|  1.79M|    }
 4869|   224k|  }
 4870|      1|  return ~c;
 4871|      1|}
_ZN3ada4idna6detail33convert_table_blob_to_host_endianEPh:
 4684|      1|inline void convert_table_blob_to_host_endian(uint8_t* buffer) noexcept {
 4685|      1|  if constexpr (std::endian::native == std::endian::little) {
 4686|      1|    (void)buffer;
 4687|      1|    return;
 4688|      1|  }
 4689|      0|  auto u16 = [&](size_t off, size_t count) {
 4690|      1|    bswap_inplace(reinterpret_cast<uint16_t*>(buffer + off), count);
 4691|      1|  };
 4692|      1|  auto u32 = [&](size_t off, size_t count) {
 4693|      1|    bswap_inplace(reinterpret_cast<uint32_t*>(buffer + off), count);
 4694|      1|  };
 4695|      1|  auto u64 = [&](size_t off, size_t count) {
 4696|      1|    bswap_inplace(reinterpret_cast<uint64_t*>(buffer + off), count);
 4697|      1|  };
 4698|       |
 4699|      1|  u16(table_blob::off_idna_stage1, table_blob::count_idna_stage1);
 4700|      1|  u16(table_blob::off_idna_stage2, table_blob::count_idna_stage2);
 4701|      1|  u64(table_blob::off_idna_bool_blocks, table_blob::count_idna_bool_blocks);
 4702|      1|  u16(table_blob::off_decomposition_block,
 4703|      1|      table_blob::count_decomposition_block);
 4704|      1|  u32(table_blob::off_decomposition_data, table_blob::count_decomposition_data);
 4705|      1|  u16(table_blob::off_composition_block, table_blob::count_composition_block);
 4706|      1|  u32(table_blob::off_composition_data, table_blob::count_composition_data);
 4707|      1|  u32(table_blob::off_id_continue_flat, table_blob::count_id_continue_flat);
 4708|      1|  u32(table_blob::off_id_start_flat, table_blob::count_id_start_flat);
 4709|      1|  u32(table_blob::off_dir_start, table_blob::count_dir_start);
 4710|      1|  u32(table_blob::off_dir_final, table_blob::count_dir_final);
 4711|      1|  u32(table_blob::off_combining_flat, table_blob::count_combining_flat);
 4712|      1|}
_ZZN3ada4idna13ensure_tablesEvENKUlmE_clEm:
 4910|     18|    auto at = [&](size_t off) noexcept -> const uint8_t* {
 4911|     18|      return buffer + off;
 4912|     18|    };
idna.cc:_ZN3ada4idnaL11idna_lookupEj:
 5065|   448k|static uint16_t idna_lookup(uint32_t cp) noexcept {
 5066|   448k|  if (cp < IDNA_LOW_RANGE_END) {
  ------------------
  |  Branch (5066:7): [True: 446k, False: 2.20k]
  ------------------
 5067|   446k|    uint16_t ref = idna_stage1[cp >> IDNA_BLOCK_BITS];
 5068|   446k|    if (ref & IDNA_BOOL_FLAG) {
  ------------------
  |  Branch (5068:9): [True: 179k, False: 266k]
  ------------------
 5069|   179k|      uint32_t bit_idx =
 5070|   179k|          static_cast<uint32_t>(ref & ~IDNA_BOOL_FLAG) * IDNA_BLOCK_SIZE +
 5071|   179k|          (cp & IDNA_BLOCK_MASK);
 5072|   179k|      bool is_valid = (idna_bool_blocks[bit_idx >> 6] >> (bit_idx & 63u)) & 1u;
 5073|   179k|      return is_valid ? IDNA_VALID : IDNA_DISALLOWED;
  ------------------
  |  Branch (5073:14): [True: 179k, False: 129]
  ------------------
 5074|   179k|    }
 5075|   266k|    return idna_stage2[ref + (cp & IDNA_BLOCK_MASK)];
 5076|   446k|  }
 5077|       |
 5078|  2.20k|  if (cp >= IDNA_HIGH_IGNORED_START && cp < IDNA_HIGH_IGNORED_END) {
  ------------------
  |  Branch (5078:7): [True: 2.05k, False: 159]
  |  Branch (5078:40): [True: 1.33k, False: 718]
  ------------------
 5079|  1.33k|    return IDNA_IGNORED;
 5080|  1.33k|  }
 5081|       |
 5082|    877|  return IDNA_DISALLOWED;
 5083|  2.20k|}
idna.cc:_ZN3ada4idnaL21utf8_count_codepointsEPKh:
 5108|  32.1k|static size_t utf8_count_codepoints(const uint8_t* ptr) noexcept {
 5109|  32.1k|  size_t n = 0;
 5110|   391k|  while (*ptr != 0) {
  ------------------
  |  Branch (5110:10): [True: 359k, False: 32.1k]
  ------------------
 5111|   359k|    ++n;
 5112|   359k|    if (*ptr < 0x80u) {
  ------------------
  |  Branch (5112:9): [True: 68.7k, False: 290k]
  ------------------
 5113|  68.7k|      ++ptr;
 5114|   290k|    } else if (*ptr < 0xE0u) {
  ------------------
  |  Branch (5114:16): [True: 280k, False: 9.71k]
  ------------------
 5115|   280k|      ptr += 2;
 5116|   280k|    } else if (*ptr < 0xF0u) {
  ------------------
  |  Branch (5116:16): [True: 9.32k, False: 389]
  ------------------
 5117|  9.32k|      ptr += 3;
 5118|  9.32k|    } else {
 5119|    389|      ptr += 4;
 5120|    389|    }
 5121|   359k|  }
 5122|  32.1k|  return n;
 5123|  32.1k|}
idna.cc:_ZN3ada4idnaL9utf8_nextERPKh:
 5086|   359k|static char32_t utf8_next(const uint8_t*& ptr) noexcept {
 5087|   359k|  uint8_t b0 = *ptr++;
 5088|   359k|  if (b0 < 0x80u) return static_cast<char32_t>(b0);
  ------------------
  |  Branch (5088:7): [True: 68.7k, False: 290k]
  ------------------
 5089|   290k|  if (b0 < 0xE0u) {
  ------------------
  |  Branch (5089:7): [True: 280k, False: 9.70k]
  ------------------
 5090|   280k|    uint32_t cp = (b0 & 0x1Fu) << 6;
 5091|   280k|    cp |= (*ptr++ & 0x3Fu);
 5092|   280k|    return static_cast<char32_t>(cp);
 5093|   280k|  }
 5094|  9.70k|  if (b0 < 0xF0u) {
  ------------------
  |  Branch (5094:7): [True: 9.31k, False: 389]
  ------------------
 5095|  9.31k|    uint32_t cp = (b0 & 0x0Fu) << 12;
 5096|  9.31k|    cp |= ((*ptr++ & 0x3Fu) << 6);
 5097|  9.31k|    cp |= (*ptr++ & 0x3Fu);
 5098|  9.31k|    return static_cast<char32_t>(cp);
 5099|  9.31k|  }
 5100|    389|  uint32_t cp = (b0 & 0x07u) << 18;
 5101|    389|  cp |= ((*ptr++ & 0x3Fu) << 12);
 5102|    389|  cp |= ((*ptr++ & 0x3Fu) << 6);
 5103|    389|  cp |= (*ptr++ & 0x3Fu);
 5104|    389|  return static_cast<char32_t>(cp);
 5105|  9.70k|}
_ZN3ada4idna23decomposition_block_rowEh:
 4982|   658k|inline const uint16_t* decomposition_block_row(uint8_t bi) noexcept {
 4983|   658k|  if (bi >= kDecompBlockRows) {
  ------------------
  |  Branch (4983:7): [True: 0, False: 658k]
  ------------------
 4984|      0|    bi = 0;
 4985|      0|  }
 4986|   658k|  return decomposition_block_flat + static_cast<size_t>(bi) * kDecompBlockCols;
 4987|   658k|}
_ZN3ada4idna13ccc_block_rowEh:
 4989|   935k|inline const uint8_t* ccc_block_row(uint8_t bi) noexcept {
 4990|   935k|  if (bi >= kCccBlockRows) {
  ------------------
  |  Branch (4990:7): [True: 0, False: 935k]
  ------------------
 4991|      0|    bi = 0;
 4992|      0|  }
 4993|   935k|  return ccc_block_flat + static_cast<size_t>(bi) * kCccBlockCols;
 4994|   935k|}
_ZN3ada4idna16tables_are_readyEv:
 4873|  16.4k|[[nodiscard]] inline bool tables_are_ready() noexcept {
 4874|  16.4k|  return tables_init_state.load(std::memory_order_acquire) == kTablesReady;
 4875|  16.4k|}
idna.cc:_ZN3ada4idnaL23canonical_decomp_lengthEDi:
 5265|   606k|static size_t canonical_decomp_length(char32_t current_character) noexcept {
 5266|   606k|  if (current_character >= hangul_sbase &&
  ------------------
  |  Branch (5266:7): [True: 25.4k, False: 580k]
  ------------------
 5267|  25.4k|      current_character < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5267:7): [True: 6.66k, False: 18.7k]
  ------------------
 5268|       |    // Hangul precomposed syllables are NFC.
 5269|  6.66k|    return 0;
 5270|  6.66k|  }
 5271|   599k|  if (current_character >= 0x110000) {
  ------------------
  |  Branch (5271:7): [True: 0, False: 599k]
  ------------------
 5272|      0|    return 0;
 5273|      0|  }
 5274|   599k|  const uint8_t di = decomposition_index[current_character >> 8];
 5275|   599k|  const uint16_t* const decomposition =
 5276|   599k|      decomposition_block_row(di) + (current_character % 256);
 5277|   599k|  size_t decomposition_length =
 5278|   599k|      (decomposition[1] >> 2) - (decomposition[0] >> 2);
 5279|   599k|  if ((decomposition_length > 0) && (decomposition[0] & 1)) {
  ------------------
  |  Branch (5279:7): [True: 27.0k, False: 572k]
  |  Branch (5279:37): [True: 13.7k, False: 13.2k]
  ------------------
 5280|  13.7k|    decomposition_length = 0;  // compatibility-only: ignored for NFC
 5281|  13.7k|  }
 5282|   599k|  return decomposition_length;
 5283|   599k|}
idna.cc:_ZN3ada4idnaL12trailing_cccEDi:
 5466|   296k|static uint8_t trailing_ccc(char32_t c) noexcept {
 5467|   296k|  const size_t length = canonical_decomp_length(c);
 5468|   296k|  if (length == 0) {
  ------------------
  |  Branch (5468:7): [True: 290k, False: 5.87k]
  ------------------
 5469|   290k|    return get_ccc(c);
 5470|   290k|  }
 5471|  5.87k|  const uint16_t* const decomposition =
 5472|  5.87k|      decomposition_block_row(decomposition_index[c >> 8]) + (c % 256);
 5473|  5.87k|  const size_t base = decomposition[0] >> 2;
 5474|  5.87k|  return get_ccc(decomposition_data[base + length - 1]);
 5475|   296k|}
idna.cc:_ZN3ada4idnaL13would_composeENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5397|  12.8k|static bool would_compose(std::u32string_view input) noexcept {
 5398|   276k|  for (size_t input_count = 0; input_count < input.size();) {
  ------------------
  |  Branch (5398:32): [True: 265k, False: 11.5k]
  ------------------
 5399|   265k|    const char32_t current = input[input_count];
 5400|   265k|    if (current >= hangul_lbase && current < hangul_lbase + hangul_lcount) {
  ------------------
  |  Branch (5400:9): [True: 27.3k, False: 237k]
  |  Branch (5400:36): [True: 1.50k, False: 25.8k]
  ------------------
 5401|  1.50k|      if (input_count + 1 < input.size() &&
  ------------------
  |  Branch (5401:11): [True: 1.41k, False: 88]
  ------------------
 5402|  1.41k|          input[input_count + 1] >= hangul_vbase &&
  ------------------
  |  Branch (5402:11): [True: 651, False: 764]
  ------------------
 5403|    651|          input[input_count + 1] < hangul_vbase + hangul_vcount) {
  ------------------
  |  Branch (5403:11): [True: 368, False: 283]
  ------------------
 5404|    368|        return true;
 5405|    368|      }
 5406|  1.13k|      ++input_count;
 5407|  1.13k|      continue;
 5408|  1.50k|    }
 5409|   263k|    if (current >= hangul_sbase && current < hangul_sbase + hangul_scount) {
  ------------------
  |  Branch (5409:9): [True: 10.9k, False: 252k]
  |  Branch (5409:36): [True: 2.40k, False: 8.56k]
  ------------------
 5410|  2.40k|      if ((current - hangul_sbase) % hangul_tcount &&
  ------------------
  |  Branch (5410:11): [True: 1.81k, False: 589]
  ------------------
 5411|  1.81k|          input_count + 1 < input.size() &&
  ------------------
  |  Branch (5411:11): [True: 1.62k, False: 186]
  ------------------
 5412|  1.62k|          input[input_count + 1] > hangul_tbase &&
  ------------------
  |  Branch (5412:11): [True: 1.23k, False: 399]
  ------------------
 5413|  1.23k|          input[input_count + 1] < hangul_tbase + hangul_tcount) {
  ------------------
  |  Branch (5413:11): [True: 336, False: 894]
  ------------------
 5414|    336|        return true;
 5415|    336|      }
 5416|  2.06k|      ++input_count;
 5417|  2.06k|      continue;
 5418|  2.40k|    }
 5419|   261k|    if (current < 0x110000) {
  ------------------
  |  Branch (5419:9): [True: 261k, False: 0]
  ------------------
 5420|   261k|      const uint16_t* composition =
 5421|   261k|          composition_block_row(composition_index[current >> 8]) +
 5422|   261k|          (current % 256);
 5423|   261k|      int32_t previous_ccc = -1;
 5424|   261k|      size_t j = input_count;
 5425|   265k|      for (; j + 1 < input.size(); ++j) {
  ------------------
  |  Branch (5425:14): [True: 254k, False: 11.2k]
  ------------------
 5426|   254k|        uint8_t ccc = get_ccc(input[j + 1]);
 5427|   254k|        if (composition[1] != composition[0] && previous_ccc < ccc) {
  ------------------
  |  Branch (5427:13): [True: 70.7k, False: 183k]
  |  Branch (5427:49): [True: 69.7k, False: 994]
  ------------------
 5428|  69.7k|          int left = composition[0];
 5429|  69.7k|          int right = composition[1];
 5430|  69.7k|          if (left < 0 || right < left ||
  ------------------
  |  Branch (5430:15): [True: 0, False: 69.7k]
  |  Branch (5430:27): [True: 0, False: 69.7k]
  ------------------
 5431|  69.7k|              static_cast<size_t>(right) > composition_data_size) {
  ------------------
  |  Branch (5431:15): [True: 0, False: 69.7k]
  ------------------
 5432|      0|            break;
 5433|      0|          }
 5434|   189k|          while (left + 2 < right) {
  ------------------
  |  Branch (5434:18): [True: 119k, False: 69.7k]
  ------------------
 5435|   119k|            int middle = left + (((right - left) >> 1) & ~1);
 5436|   119k|            if (composition_data[static_cast<size_t>(middle)] <= input[j + 1]) {
  ------------------
  |  Branch (5436:17): [True: 5.15k, False: 114k]
  ------------------
 5437|  5.15k|              left = middle;
 5438|  5.15k|            }
 5439|   119k|            if (composition_data[static_cast<size_t>(middle)] >= input[j + 1]) {
  ------------------
  |  Branch (5439:17): [True: 114k, False: 4.88k]
  ------------------
 5440|   114k|              right = middle;
 5441|   114k|            }
 5442|   119k|          }
 5443|  69.7k|          if (static_cast<size_t>(left + 1) < composition_data_size &&
  ------------------
  |  Branch (5443:15): [True: 69.7k, False: 0]
  ------------------
 5444|  69.7k|              composition_data[static_cast<size_t>(left)] == input[j + 1]) {
  ------------------
  |  Branch (5444:15): [True: 607, False: 69.1k]
  ------------------
 5445|    607|            return true;
 5446|    607|          }
 5447|  69.7k|        }
 5448|   253k|        if (ccc == 0) {
  ------------------
  |  Branch (5448:13): [True: 249k, False: 4.46k]
  ------------------
 5449|   249k|          break;
 5450|   249k|        }
 5451|  4.46k|        previous_ccc = ccc;
 5452|  4.46k|      }
 5453|   260k|      input_count = j + 1;
 5454|   260k|      continue;
 5455|   261k|    }
 5456|      0|    ++input_count;
 5457|      0|  }
 5458|  11.5k|  return false;
 5459|  12.8k|}
_ZN3ada4idna21composition_block_rowEh:
 4996|   291k|inline const uint16_t* composition_block_row(uint8_t bi) noexcept {
 4997|   291k|  if (bi >= kCompBlockRows) {
  ------------------
  |  Branch (4997:7): [True: 0, False: 291k]
  ------------------
 4998|      0|    bi = 0;
 4999|      0|  }
 5000|   291k|  return composition_block_flat + static_cast<size_t>(bi) * kCompBlockCols;
 5001|   291k|}
idna.cc:_ZN3ada4idnaL19char_to_digit_valueEc:
 5643|   187k|static constexpr int32_t char_to_digit_value(char value) {
 5644|   187k|  if (value >= 'a' && value <= 'z') return value - 'a';
  ------------------
  |  Branch (5644:7): [True: 150k, False: 36.5k]
  |  Branch (5644:23): [True: 150k, False: 408]
  ------------------
 5645|  36.9k|  if (value >= '0' && value <= '9') return value - '0' + 26;
  ------------------
  |  Branch (5645:7): [True: 31.8k, False: 5.06k]
  |  Branch (5645:23): [True: 30.5k, False: 1.35k]
  ------------------
 5646|  6.42k|  return -1;
 5647|  36.9k|}
idna.cc:_ZN3ada4idnaL5adaptEiib:
 5653|   201k|static constexpr int32_t adapt(int32_t d, int32_t n, bool firsttime) {
 5654|   201k|  if (firsttime) {
  ------------------
  |  Branch (5654:7): [True: 18.5k, False: 182k]
  ------------------
 5655|  18.5k|    d = d / damp;
 5656|   182k|  } else {
 5657|   182k|    d = d / 2;
 5658|   182k|  }
 5659|   201k|  d += d / n;
 5660|   201k|  int32_t k = 0;
 5661|   218k|  while (d > ((base - tmin) * tmax) / 2) {
  ------------------
  |  Branch (5661:10): [True: 17.1k, False: 201k]
  ------------------
 5662|  17.1k|    d /= base - tmin;
 5663|  17.1k|    k += base;
 5664|  17.1k|  }
 5665|   201k|  return k + (((base - tmin + 1) * d) / (d + skew));
 5666|   201k|}
idna.cc:_ZN3ada4idnaL13digit_to_charEi:
 5649|  96.2k|static constexpr char digit_to_char(int32_t digit) {
 5650|  96.2k|  return digit < 26 ? char(digit + 97) : char(digit + 22);
  ------------------
  |  Branch (5650:10): [True: 84.9k, False: 11.3k]
  ------------------
 5651|  96.2k|}
idna.cc:_ZZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEEENK3$_0clIA2_jEEDaRKT_:
 5988|   107k|      comb_span, label.front(), {}, [](const auto& range) { return range[1]; });
idna.cc:_ZZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEEENK3$_1clEj:
 6073|  2.40k|      auto is_l_or_d = [](uint32_t code) {
 6074|  2.40k|        return std::ranges::binary_search(L, code) ||
  ------------------
  |  Branch (6074:16): [True: 67, False: 2.33k]
  ------------------
 6075|  2.33k|               std::ranges::binary_search(D, code);
  ------------------
  |  Branch (6075:16): [True: 715, False: 1.62k]
  ------------------
 6076|  2.40k|      };
idna.cc:_ZZN3ada4idna14is_label_validENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEEENK3$_2clEj:
 6077|  1.88k|      auto is_r_or_d = [](uint32_t code) {
 6078|  1.88k|        return std::ranges::binary_search(R, code) ||
  ------------------
  |  Branch (6078:16): [True: 170, False: 1.71k]
  ------------------
 6079|  1.71k|               std::ranges::binary_search(D, code);
  ------------------
  |  Branch (6079:16): [True: 446, False: 1.26k]
  ------------------
 6080|  1.88k|      };
idna.cc:_ZN3ada4idnaL20find_last_not_of_nsmENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5935|  9.95k|    const std::u32string_view label) noexcept {
 5936|  13.0k|  for (int i = static_cast<int>(label.size() - 1); i >= 0; i--)
  ------------------
  |  Branch (5936:52): [True: 13.0k, False: 0]
  ------------------
 5937|  13.0k|    if (find_direction(label[i]) != direction::NSM) return i;
  ------------------
  |  Branch (5937:9): [True: 9.95k, False: 3.06k]
  ------------------
 5938|       |
 5939|      0|  return std::u32string_view::npos;
 5940|  9.95k|}
idna.cc:_ZN3ada4idnaL12is_rtl_labelENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 5944|  9.95k|inline static bool is_rtl_label(const std::u32string_view label) noexcept {
 5945|  9.95k|  const size_t mask =
 5946|  9.95k|      (1u << direction::R) | (1u << direction::AL) | (1u << direction::AN);
 5947|       |
 5948|  9.95k|  size_t directions = 0;
 5949|  69.6k|  for (size_t i = 0; i < label.size(); i++) {
  ------------------
  |  Branch (5949:22): [True: 59.6k, False: 9.95k]
  ------------------
 5950|  59.6k|    directions |= 1u << find_direction(label[i]);
 5951|  59.6k|  }
 5952|  9.95k|  return (directions & mask) != 0;
 5953|  9.95k|}
idna.cc:_ZN3ada4idnaL14find_directionEj:
 5916|  88.6k|inline static direction find_direction(uint32_t code_point) noexcept {
 5917|       |  // Binary search on dir_final (sorted upper bounds).
 5918|  88.6k|  size_t lo = 0, hi = dir_table_count;
 5919|  1.02M|  while (lo < hi) {
  ------------------
  |  Branch (5919:10): [True: 931k, False: 88.6k]
  ------------------
 5920|   931k|    size_t mid = lo + (hi - lo) / 2;
 5921|   931k|    if (dir_final[mid] < code_point) {
  ------------------
  |  Branch (5921:9): [True: 361k, False: 569k]
  ------------------
 5922|   361k|      lo = mid + 1;
 5923|   569k|    } else {
 5924|   569k|      hi = mid;
 5925|   569k|    }
 5926|   931k|  }
 5927|  88.6k|  if (lo == dir_table_count) {
  ------------------
  |  Branch (5927:7): [True: 717, False: 87.9k]
  ------------------
 5928|    717|    return direction::NONE;
 5929|    717|  }
 5930|  87.9k|  return code_point >= dir_start[lo] ? static_cast<direction>(dir_value[lo])
  ------------------
  |  Branch (5930:10): [True: 83.8k, False: 4.13k]
  ------------------
 5931|  87.9k|                                     : direction::NONE;
 5932|  88.6k|}
_ZN3ada4idna30is_forbidden_domain_code_pointEc:
 6325|  50.5k|inline bool is_forbidden_domain_code_point(const char c) noexcept {
 6326|  50.5k|  return is_forbidden_domain_code_point_table[uint8_t(c)];
 6327|  50.5k|}
_ZN3ada4idna8is_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 6301|  30.6k|bool constexpr is_ascii(std::string_view view) {
 6302|   528k|  for (uint8_t c : view) {
  ------------------
  |  Branch (6302:18): [True: 528k, False: 24.6k]
  ------------------
 6303|   528k|    if (c >= 0x80) {
  ------------------
  |  Branch (6303:9): [True: 6.02k, False: 522k]
  ------------------
 6304|  6.02k|      return false;
 6305|  6.02k|    }
 6306|   528k|  }
 6307|  24.6k|  return true;
 6308|  30.6k|}
idna.cc:_ZN3ada4idnaL19from_ascii_to_asciiENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEERNS1_12basic_stringIcS4_NS1_9allocatorIcEEEE:
 6338|  8.96k|static void from_ascii_to_ascii(std::string_view ut8_string, std::string& out) {
 6339|  8.96k|  out.assign(ut8_string);
 6340|  8.96k|  ascii_map(out.data(), out.size());
 6341|  8.96k|}
_ZN3ada4idna8is_asciiENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 6292|  21.2k|bool constexpr is_ascii(std::u32string_view view) {
 6293|  47.3k|  for (uint32_t c : view) {
  ------------------
  |  Branch (6293:19): [True: 47.3k, False: 2.22k]
  ------------------
 6294|  47.3k|    if (c >= 0x80) {
  ------------------
  |  Branch (6294:9): [True: 19.0k, False: 28.2k]
  ------------------
 6295|  19.0k|      return false;
 6296|  19.0k|    }
 6297|  47.3k|  }
 6298|  2.22k|  return true;
 6299|  21.2k|}
idna.cc:_ZN3ada4idnaL13is_ace_prefixENSt3__117basic_string_viewIDiNS1_11char_traitsIDiEEEE:
 6354|  5.61k|static bool is_ace_prefix(std::u32string_view label) noexcept {
 6355|  5.61k|  return label.size() >= 4 && label[0] == U'x' && label[1] == U'n' &&
  ------------------
  |  Branch (6355:10): [True: 2.94k, False: 2.67k]
  |  Branch (6355:31): [True: 1.76k, False: 1.18k]
  |  Branch (6355:51): [True: 1.50k, False: 255]
  ------------------
 6356|  1.50k|         label[2] == U'-' && label[3] == U'-';
  ------------------
  |  Branch (6356:10): [True: 1.41k, False: 97]
  |  Branch (6356:30): [True: 1.34k, False: 67]
  ------------------
 6357|  5.61k|}
idna.cc:_ZN3ada4idnaL18append_ascii_labelERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIDiNS3_IDiEEEE:
 6344|  1.75k|static void append_ascii_label(std::string& out, std::u32string_view label) {
 6345|  1.75k|  const size_t old = out.size();
 6346|  1.75k|  out.resize(old + label.size());
 6347|  1.75k|  char* dest = out.data() + old;
 6348|  15.3k|  for (char32_t c : label) {
  ------------------
  |  Branch (6348:19): [True: 15.3k, False: 1.75k]
  ------------------
 6349|  15.3k|    *dest++ = static_cast<char>(c);
 6350|  15.3k|  }
 6351|  1.75k|}
_ZN3ada8checkers17verify_dns_lengthENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  100|  4.75k|    std::string_view input) noexcept {
  101|  4.75k|  if (input.empty()) return false;
  ------------------
  |  Branch (101:7): [True: 4.18k, False: 577]
  ------------------
  102|    577|  if (input.back() == '.') {
  ------------------
  |  Branch (102:7): [True: 87, False: 490]
  ------------------
  103|     87|    if (input.size() > 254) return false;
  ------------------
  |  Branch (103:9): [True: 10, False: 77]
  ------------------
  104|    490|  } else if (input.size() > 253)
  ------------------
  |  Branch (104:14): [True: 68, False: 422]
  ------------------
  105|     68|    return false;
  106|       |
  107|    499|  size_t start = 0;
  108|  2.10k|  while (start < input.size()) {
  ------------------
  |  Branch (108:10): [True: 1.68k, False: 417]
  ------------------
  109|  1.68k|    auto dot_location = input.find('.', start);
  110|       |    // If not found, it's likely the end of the domain
  111|  1.68k|    if (dot_location == std::string_view::npos) dot_location = input.size();
  ------------------
  |  Branch (111:9): [True: 408, False: 1.27k]
  ------------------
  112|       |
  113|  1.68k|    auto label_size = dot_location - start;
  114|  1.68k|    if (label_size > 63 || label_size == 0) return false;
  ------------------
  |  Branch (114:9): [True: 59, False: 1.62k]
  |  Branch (114:28): [True: 23, False: 1.60k]
  ------------------
  115|       |
  116|  1.60k|    start = dot_location + 1;
  117|  1.60k|  }
  118|       |
  119|    417|  return true;
  120|    499|}

_ZN3ada37url_pattern_compile_component_optionsC2ENSt3__18optionalIcEES3_:
 5755|      6|      : delimiter(new_delimiter), prefix(new_prefix) {}

LLVMFuzzerTestOneInput:
    9|  4.56k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   10|  4.56k|  FuzzedDataProvider fdp(data, size);
   11|  4.56k|  std::string source = fdp.ConsumeRandomLengthString(256);
   12|  4.56k|  std::string source2 = fdp.ConsumeRandomLengthString(64);
   13|       |
   14|       |  /**
   15|       |   * High-level IDNA API
   16|       |   */
   17|  4.56k|  std::string ascii_result = ada::idna::to_ascii(source);
   18|  4.56k|  std::string unicode_result = ada::idna::to_unicode(source);
   19|       |
   20|       |  // Avoid dead-code elimination
   21|  4.56k|  volatile size_t length = 0;
   22|  4.56k|  length += ascii_result.size();
   23|  4.56k|  length += unicode_result.size();
   24|       |
   25|       |  /**
   26|       |   * Round-trip property: to_unicode(to_ascii(x)) should not crash.
   27|       |   * We don't assert equality because IDNA may normalize/reject inputs.
   28|       |   */
   29|  4.56k|  if (!ascii_result.empty()) {
  ------------------
  |  Branch (29:7): [True: 2.81k, False: 1.75k]
  ------------------
   30|  2.81k|    std::string roundtrip = ada::idna::to_unicode(ascii_result);
   31|  2.81k|    length += roundtrip.size();
   32|  2.81k|  }
   33|       |
   34|       |  /**
   35|       |   * Punycode functions
   36|       |   */
   37|  4.56k|  {
   38|  4.56k|    std::u32string utf32_out;
   39|       |    // punycode_to_utf32: source can be any string (it's a punycode label)
   40|  4.56k|    bool punycode_ok = ada::idna::punycode_to_utf32(source, utf32_out);
   41|  4.56k|    length += utf32_out.size();
   42|       |
   43|       |    // verify_punycode: checks if source is valid punycode
   44|  4.56k|    volatile bool is_valid_punycode = ada::idna::verify_punycode(source);
   45|  4.56k|    (void)is_valid_punycode;
   46|       |
   47|       |    // utf32_to_punycode: round-trip if punycode_to_utf32 succeeded
   48|  4.56k|    if (punycode_ok && !utf32_out.empty()) {
  ------------------
  |  Branch (48:9): [True: 1.32k, False: 3.24k]
  |  Branch (48:24): [True: 759, False: 564]
  ------------------
   49|    759|      std::string punycode_back;
   50|    759|      volatile bool encode_ok =
   51|    759|          ada::idna::utf32_to_punycode(utf32_out, punycode_back);
   52|    759|      length += punycode_back.size();
   53|    759|      (void)encode_ok;
   54|    759|    }
   55|  4.56k|  }
   56|       |
   57|       |  /**
   58|       |   * Unicode transcoding
   59|       |   */
   60|  4.56k|  {
   61|       |    // UTF-8 to UTF-32 conversion
   62|  4.56k|    size_t utf32_len =
   63|  4.56k|        ada::idna::utf32_length_from_utf8(source.data(), source.size());
   64|  4.56k|    if (utf32_len > 0 && utf32_len < 1024) {
  ------------------
  |  Branch (64:9): [True: 3.98k, False: 583]
  |  Branch (64:26): [True: 3.98k, False: 0]
  ------------------
   65|  3.98k|      std::vector<char32_t> utf32_buf(utf32_len + 1, 0);
   66|  3.98k|      size_t actual = ada::idna::utf8_to_utf32(source.data(), source.size(),
   67|  3.98k|                                               utf32_buf.data());
   68|  3.98k|      length += actual;
   69|       |
   70|       |      // UTF-32 to UTF-8 round-trip
   71|  3.98k|      if (actual > 0) {
  ------------------
  |  Branch (71:11): [True: 3.78k, False: 197]
  ------------------
   72|  3.78k|        size_t utf8_len =
   73|  3.78k|            ada::idna::utf8_length_from_utf32(utf32_buf.data(), actual);
   74|  3.78k|        if (utf8_len > 0 && utf8_len < 4096) {
  ------------------
  |  Branch (74:13): [True: 3.78k, False: 0]
  |  Branch (74:29): [True: 3.78k, False: 0]
  ------------------
   75|  3.78k|          std::string utf8_back(utf8_len, '\0');
   76|  3.78k|          size_t written = ada::idna::utf32_to_utf8(utf32_buf.data(), actual,
   77|  3.78k|                                                    utf8_back.data());
   78|  3.78k|          length += written;
   79|  3.78k|        }
   80|  3.78k|      }
   81|  3.98k|    }
   82|  4.56k|  }
   83|       |
   84|       |  /**
   85|       |   * IDNA label validation
   86|       |   */
   87|  4.56k|  {
   88|       |    // is_label_valid requires a UTF-32 string
   89|  4.56k|    std::u32string utf32_label;
   90|  4.56k|    bool ok = ada::idna::punycode_to_utf32(source2, utf32_label);
   91|  4.56k|    if (ok && !utf32_label.empty()) {
  ------------------
  |  Branch (91:9): [True: 4.42k, False: 140]
  |  Branch (91:15): [True: 181, False: 4.24k]
  ------------------
   92|    181|      volatile bool label_valid = ada::idna::is_label_valid(utf32_label);
   93|    181|      (void)label_valid;
   94|    181|    }
   95|       |
   96|       |    // Also test is_label_valid with direct ASCII-to-UTF32 conversion
   97|  4.56k|    std::u32string ascii_label(source2.begin(), source2.end());
   98|  4.56k|    if (!ascii_label.empty()) {
  ------------------
  |  Branch (98:9): [True: 327, False: 4.24k]
  ------------------
   99|    327|      volatile bool ascii_label_valid = ada::idna::is_label_valid(ascii_label);
  100|    327|      (void)ascii_label_valid;
  101|    327|    }
  102|  4.56k|  }
  103|       |
  104|       |  /**
  105|       |   * IDNA mapping
  106|       |   */
  107|  4.56k|  {
  108|       |    // ASCII mapping: just lowercases ASCII characters
  109|  4.56k|    std::string ascii_copy = source;
  110|  4.56k|    ada::idna::ascii_map(ascii_copy.data(), ascii_copy.size());
  111|  4.56k|    length += ascii_copy.size();
  112|       |
  113|       |    // Unicode mapping: maps UTF-32 characters according to IDNA
  114|  4.56k|    size_t utf32_len =
  115|  4.56k|        ada::idna::utf32_length_from_utf8(source.data(), source.size());
  116|  4.56k|    if (utf32_len > 0 && utf32_len < 256) {
  ------------------
  |  Branch (116:9): [True: 3.98k, False: 583]
  |  Branch (116:26): [True: 3.95k, False: 33]
  ------------------
  117|  3.95k|      std::u32string utf32_input(utf32_len, 0);
  118|  3.95k|      size_t actual = ada::idna::utf8_to_utf32(source.data(), source.size(),
  119|  3.95k|                                               utf32_input.data());
  120|  3.95k|      if (actual > 0) {
  ------------------
  |  Branch (120:11): [True: 3.77k, False: 180]
  ------------------
  121|  3.77k|        utf32_input.resize(actual);
  122|  3.77k|        std::u32string mapped = ada::idna::map(utf32_input);
  123|  3.77k|        length += mapped.size();
  124|  3.77k|      }
  125|  3.95k|    }
  126|  4.56k|  }
  127|       |
  128|       |  /**
  129|       |   * Domain code point validation
  130|       |   */
  131|  4.56k|  {
  132|  4.56k|    volatile bool has_forbidden =
  133|  4.56k|        ada::idna::contains_forbidden_domain_code_point(source);
  134|  4.56k|    (void)has_forbidden;
  135|       |
  136|       |    // is_ascii checks
  137|  4.56k|    volatile bool is_ascii_str =
  138|  4.56k|        ada::idna::is_ascii(std::string_view(source.data(), source.size()));
  139|  4.56k|    (void)is_ascii_str;
  140|  4.56k|  }
  141|       |
  142|       |  /**
  143|       |   * Normalization
  144|       |   */
  145|  4.56k|  {
  146|  4.56k|    size_t utf32_len =
  147|  4.56k|        ada::idna::utf32_length_from_utf8(source.data(), source.size());
  148|  4.56k|    if (utf32_len > 0 && utf32_len < 256) {
  ------------------
  |  Branch (148:9): [True: 3.98k, False: 583]
  |  Branch (148:26): [True: 3.95k, False: 33]
  ------------------
  149|  3.95k|      std::u32string utf32_input(utf32_len, 0);
  150|  3.95k|      size_t actual = ada::idna::utf8_to_utf32(source.data(), source.size(),
  151|  3.95k|                                               utf32_input.data());
  152|  3.95k|      if (actual > 0) {
  ------------------
  |  Branch (152:11): [True: 3.77k, False: 180]
  ------------------
  153|  3.77k|        utf32_input.resize(actual);
  154|  3.77k|        ada::idna::normalize(utf32_input);
  155|  3.77k|        length += utf32_input.size();
  156|  3.77k|      }
  157|  3.95k|    }
  158|  4.56k|  }
  159|       |
  160|       |  /**
  161|       |   * IDNA stability property.
  162|       |   *
  163|       |   * Applying to_ascii twice must be idempotent: if to_ascii(x) produces a
  164|       |   * non-empty result, then to_ascii(to_ascii(x)) must equal to_ascii(x).
  165|       |   * A correctly normalised ACE label is already its own fixed point.
  166|       |   *
  167|       |   * We allow the second call to return an empty string only if the first
  168|       |   * result was itself not a valid IDNA domain (some implementations return
  169|       |   * empty on failure). If the first result is non-empty and looks like a
  170|       |   * valid domain the second application must match.
  171|       |   */
  172|  4.56k|  {
  173|  4.56k|    if (!ascii_result.empty()) {
  ------------------
  |  Branch (173:9): [True: 2.81k, False: 1.75k]
  ------------------
  174|  2.81k|      std::string ascii_result2 = ada::idna::to_ascii(ascii_result);
  175|  2.81k|      if (!ascii_result2.empty() && ascii_result2 != ascii_result) {
  ------------------
  |  Branch (175:11): [True: 2.81k, False: 0]
  |  Branch (175:37): [True: 0, False: 2.81k]
  ------------------
  176|      0|        printf(
  177|      0|            "IDNA to_ascii not idempotent!\n"
  178|      0|            "  input:   %s\n  first:   %s\n  second:  %s\n",
  179|      0|            source.c_str(), ascii_result.c_str(), ascii_result2.c_str());
  180|      0|        abort();
  181|      0|      }
  182|  2.81k|    }
  183|  4.56k|  }
  184|       |
  185|       |  /**
  186|       |   * to_unicode stability.
  187|       |   *
  188|       |   * Applying to_unicode twice should also be idempotent: once a domain is in
  189|       |   * its Unicode presentation form, converting again should give the same
  190|       |   * result.
  191|       |   */
  192|  4.56k|  {
  193|  4.56k|    if (!unicode_result.empty()) {
  ------------------
  |  Branch (193:9): [True: 4.00k, False: 562]
  ------------------
  194|  4.00k|      std::string unicode_result2 = ada::idna::to_unicode(unicode_result);
  195|  4.00k|      if (!unicode_result2.empty() && unicode_result2 != unicode_result) {
  ------------------
  |  Branch (195:11): [True: 4.00k, False: 0]
  |  Branch (195:39): [True: 0, False: 4.00k]
  ------------------
  196|      0|        printf(
  197|      0|            "IDNA to_unicode not idempotent!\n"
  198|      0|            "  input:   %s\n  first:   %s\n  second:  %s\n",
  199|      0|            source.c_str(), unicode_result.c_str(), unicode_result2.c_str());
  200|      0|        abort();
  201|      0|      }
  202|  4.00k|    }
  203|  4.56k|  }
  204|       |
  205|       |  /**
  206|       |   * Long domain names near the DNS length limit (253 characters).
  207|       |   *
  208|       |   * The IDNA and DNS-length checking code has special handling for domains
  209|       |   * close to or exceeding 253/255 characters and 63-character labels. Feed
  210|       |   * the fuzzer inputs of a controlled length to maximise coverage of those
  211|       |   * boundary checks.
  212|       |   */
  213|  4.56k|  {
  214|  4.56k|    std::string long_domain = fdp.ConsumeRandomLengthString(270);
  215|  4.56k|    std::string long_ascii = ada::idna::to_ascii(long_domain);
  216|  4.56k|    length += long_ascii.size();
  217|       |
  218|       |    // verify_dns_length on the long input (already called for `source` above,
  219|       |    // but we want to exercise the boundary cases separately).
  220|  4.56k|    volatile bool long_dns_ok = ada::checkers::verify_dns_length(long_domain);
  221|  4.56k|    (void)long_dns_ok;
  222|       |
  223|  4.56k|    if (!long_ascii.empty()) {
  ------------------
  |  Branch (223:9): [True: 190, False: 4.37k]
  ------------------
  224|    190|      volatile bool long_ascii_dns_ok =
  225|    190|          ada::checkers::verify_dns_length(long_ascii);
  226|    190|      (void)long_ascii_dns_ok;
  227|    190|    }
  228|  4.56k|  }
  229|       |
  230|       |  /**
  231|       |   * Punycode round-trip on arbitrary binary blobs.
  232|       |   *
  233|       |   * Feed random bytes directly into punycode_to_utf32, then if that succeeds
  234|       |   * encode the result back with utf32_to_punycode and verify the round-trip.
  235|       |   */
  236|  4.56k|  {
  237|  4.56k|    std::string blob = fdp.ConsumeRandomLengthString(128);
  238|  4.56k|    std::u32string decoded;
  239|  4.56k|    bool ok = ada::idna::punycode_to_utf32(blob, decoded);
  240|  4.56k|    if (ok && !decoded.empty()) {
  ------------------
  |  Branch (240:9): [True: 4.40k, False: 163]
  |  Branch (240:15): [True: 35, False: 4.37k]
  ------------------
  241|     35|      std::string reencoded;
  242|     35|      bool enc_ok = ada::idna::utf32_to_punycode(decoded, reencoded);
  243|     35|      (void)enc_ok;
  244|     35|      length += reencoded.size();
  245|       |
  246|       |      // Re-decode the re-encoded form; it must match the first decoded form.
  247|     35|      if (enc_ok && !reencoded.empty()) {
  ------------------
  |  Branch (247:11): [True: 32, False: 3]
  |  Branch (247:21): [True: 32, False: 0]
  ------------------
  248|     32|        std::u32string redecoded;
  249|     32|        bool redec_ok = ada::idna::punycode_to_utf32(reencoded, redecoded);
  250|     32|        if (redec_ok && redecoded != decoded) {
  ------------------
  |  Branch (250:13): [True: 32, False: 0]
  |  Branch (250:25): [True: 0, False: 32]
  ------------------
  251|      0|          printf("Punycode round-trip mismatch!\n");
  252|      0|          abort();
  253|      0|        }
  254|     32|      }
  255|     35|    }
  256|  4.56k|  }
  257|       |
  258|  4.56k|  return 0;
  259|  4.56k|}

