LLVMFuzzerTestOneInput:
   46|     71|{
   47|     71|	static int first_run = 1;
   48|     71|	psl_ctx_t *psl;
   49|     71|	char *domain, *res;
   50|     71|	int rc;
   51|       |
   52|     71|	if (size > 64 * 1024 - 1)
  ------------------
  |  Branch (52:6): [True: 6, False: 65]
  ------------------
   53|      6|		return 0;
   54|       |
   55|     65|	domain = (char *) malloc(size + 1);
   56|     65|	assert(domain != NULL);
   57|       |
   58|       |	/* 0 terminate */
   59|      0|	memcpy(domain, data, size);
   60|     65|	domain[size] = 0;
   61|       |
   62|     65|	psl = (psl_ctx_t *) psl_builtin();
   63|       |
   64|     65|	psl_is_public_suffix(psl, domain);
   65|     65|	psl_is_public_suffix2(psl, domain, PSL_TYPE_PRIVATE);
  ------------------
  |  |   66|     65|#define PSL_TYPE_PRIVATE      (1<<1)
  ------------------
   66|     65|	psl_is_public_suffix2(psl, domain, PSL_TYPE_ICANN);
  ------------------
  |  |   65|     65|#define PSL_TYPE_ICANN        (1<<0)
  ------------------
   67|     65|	psl_is_public_suffix2(psl, domain, PSL_TYPE_NO_STAR_RULE);
  ------------------
  |  |   67|     65|#define PSL_TYPE_NO_STAR_RULE (1<<2)
  ------------------
   68|     65|	psl_is_public_suffix2(psl, domain, PSL_TYPE_NO_STAR_RULE|PSL_TYPE_ANY);
  ------------------
  |  |   67|     65|#define PSL_TYPE_NO_STAR_RULE (1<<2)
  ------------------
              	psl_is_public_suffix2(psl, domain, PSL_TYPE_NO_STAR_RULE|PSL_TYPE_ANY);
  ------------------
  |  |   68|     65|#define PSL_TYPE_ANY          (PSL_TYPE_ICANN | PSL_TYPE_PRIVATE)
  |  |  ------------------
  |  |  |  |   65|     65|#define PSL_TYPE_ICANN        (1<<0)
  |  |  ------------------
  |  |               #define PSL_TYPE_ANY          (PSL_TYPE_ICANN | PSL_TYPE_PRIVATE)
  |  |  ------------------
  |  |  |  |   66|     65|#define PSL_TYPE_PRIVATE      (1<<1)
  |  |  ------------------
  ------------------
   69|     65|	psl_unregistrable_domain(psl, domain);
   70|     65|	psl_registrable_domain(psl, domain);
   71|       |
   72|     65|	psl_is_cookie_domain_acceptable(psl, "", NULL);
   73|     65|	psl_is_cookie_domain_acceptable(psl, "a.b.c.e.com", domain);
   74|       |
   75|     65|	if ((rc = psl_str_to_utf8lower(domain, "utf-8", NULL, &res)) == PSL_SUCCESS)
  ------------------
  |  Branch (75:6): [True: 45, False: 20]
  ------------------
   76|     45|		free(res);
   77|     65|	if ((rc = psl_str_to_utf8lower(domain, "iso-8859-1", NULL, &res)) == PSL_SUCCESS)
  ------------------
  |  Branch (77:6): [True: 45, False: 20]
  ------------------
   78|     45|		free(res);
   79|     65|	if ((rc = psl_str_to_utf8lower(domain, NULL, NULL, &res)) == PSL_SUCCESS)
  ------------------
  |  Branch (79:6): [True: 45, False: 20]
  ------------------
   80|     45|		free(res);
   81|       |
   82|     65|	psl_free(psl);
   83|       |
   84|     65|	if (first_run) {
  ------------------
  |  Branch (84:6): [True: 1, False: 64]
  ------------------
   85|      1|		psl_is_public_suffix(NULL, domain);
   86|      1|		psl_check_version_number(1);
   87|      1|		psl_get_version();
   88|      1|		psl_dist_filename();
   89|      1|		psl_builtin_outdated();
   90|      1|		psl_builtin_filename();
   91|      1|		psl_builtin_sha1sum();
   92|      1|		psl_builtin_file_time();
   93|      1|		first_run = 0;
   94|      1|	}
   95|       |
   96|     65|	free(domain);
   97|       |
   98|       |#if defined(WITH_LIBICU)
   99|       |	u_cleanup(); /* free all library internal memory to avoid memory leaks being reported */
  100|       |#endif
  101|       |
  102|     65|	return 0;
  103|     71|}

psl_is_public_suffix:
  991|     66|{
  992|     66|	if (!psl || !domain)
  ------------------
  |  Branch (992:6): [True: 66, False: 0]
  |  Branch (992:14): [True: 0, False: 0]
  ------------------
  993|     66|		return 1;
  994|       |
  995|      0|	return is_public_suffix(psl, domain, PSL_TYPE_ANY);
  ------------------
  |  |   68|      0|#define PSL_TYPE_ANY          (PSL_TYPE_ICANN | PSL_TYPE_PRIVATE)
  |  |  ------------------
  |  |  |  |   65|      0|#define PSL_TYPE_ICANN        (1<<0)
  |  |  ------------------
  |  |               #define PSL_TYPE_ANY          (PSL_TYPE_ICANN | PSL_TYPE_PRIVATE)
  |  |  ------------------
  |  |  |  |   66|      0|#define PSL_TYPE_PRIVATE      (1<<1)
  |  |  ------------------
  ------------------
  996|     66|}
psl_is_public_suffix2:
 1026|    260|{
 1027|    260|	if (!psl || !domain)
  ------------------
  |  Branch (1027:6): [True: 260, False: 0]
  |  Branch (1027:14): [True: 0, False: 0]
  ------------------
 1028|    260|		return 1;
 1029|       |
 1030|      0|	return is_public_suffix(psl, domain, type);
 1031|    260|}
psl_unregistrable_domain:
 1054|     65|{
 1055|     65|	int nlabels = 0;
 1056|     65|	const char *p;
 1057|       |
 1058|     65|	if (!psl || !domain)
  ------------------
  |  Branch (1058:6): [True: 65, False: 0]
  |  Branch (1058:14): [True: 0, False: 0]
  ------------------
 1059|     65|		return NULL;
 1060|       |
 1061|       |	/*
 1062|       |	 * In the main loop we introduce a O(N^2) behavior to avoid code duplication.
 1063|       |	 * To avoid nasty CPU hogging, we limit the lookup to max. 8 domain labels to the right.
 1064|       |	 */
 1065|      0|	for (p = domain + strlen(domain) - 1; p >= domain; p--) {
  ------------------
  |  Branch (1065:40): [True: 0, False: 0]
  ------------------
 1066|      0|		if (*p == '.' && ++nlabels > 8) {
  ------------------
  |  Branch (1066:7): [True: 0, False: 0]
  |  Branch (1066:20): [True: 0, False: 0]
  ------------------
 1067|      0|			domain = p + 1;
 1068|      0|			break;
 1069|      0|		}
 1070|      0|	}
 1071|       |
 1072|       |	/*
 1073|       |	 *  We check from left to right to catch special PSL entries like 'forgot.his.name':
 1074|       |	 *   'forgot.his.name' and 'name' are in the PSL while 'his.name' is not.
 1075|       |	 */
 1076|       |
 1077|      0|	while (!is_public_suffix(psl, domain, 0)) {
  ------------------
  |  Branch (1077:9): [True: 0, False: 0]
  ------------------
 1078|      0|		if ((domain = strchr(domain, '.')))
  ------------------
  |  Branch (1078:7): [True: 0, False: 0]
  ------------------
 1079|      0|			domain++;
 1080|      0|		else
 1081|      0|			break; /* prevent endless loop if is_public_suffix() is broken. */
 1082|      0|	}
 1083|       |
 1084|      0|	return domain;
 1085|     65|}
psl_registrable_domain:
 1108|     65|{
 1109|     65|	const char *p, *regdom = NULL;
 1110|     65|	int nlabels = 0;
 1111|       |
 1112|     65|	if (!psl || !domain || *domain == '.')
  ------------------
  |  Branch (1112:6): [True: 65, False: 0]
  |  Branch (1112:14): [True: 0, False: 0]
  |  Branch (1112:25): [True: 0, False: 0]
  ------------------
 1113|     65|		return NULL;
 1114|       |
 1115|       |	/*
 1116|       |	 * In the main loop we introduce a O(N^2) behavior to avoid code duplication.
 1117|       |	 * To avoid nasty CPU hogging, we limit the lookup to max. 8 domain labels to the right.
 1118|       |	 */
 1119|      0|	for (p = domain + strlen(domain) - 1; p >= domain; p--) {
  ------------------
  |  Branch (1119:40): [True: 0, False: 0]
  ------------------
 1120|      0|		if (*p == '.' && ++nlabels > 8) {
  ------------------
  |  Branch (1120:7): [True: 0, False: 0]
  |  Branch (1120:20): [True: 0, False: 0]
  ------------------
 1121|      0|			domain = p + 1;
 1122|      0|			break;
 1123|      0|		}
 1124|      0|	}
 1125|       |
 1126|       |	/*
 1127|       |	 *  We check from left to right to catch special PSL entries like 'forgot.his.name':
 1128|       |	 *   'forgot.his.name' and 'name' are in the PSL while 'his.name' is not.
 1129|       |	 */
 1130|       |
 1131|      0|	while (!is_public_suffix(psl, domain, 0)) {
  ------------------
  |  Branch (1131:9): [True: 0, False: 0]
  ------------------
 1132|      0|		if ((p = strchr(domain, '.'))) {
  ------------------
  |  Branch (1132:7): [True: 0, False: 0]
  ------------------
 1133|      0|			regdom = domain;
 1134|      0|			domain = p + 1;
 1135|      0|		} else
 1136|      0|			break; /* prevent endless loop if is_public_suffix() is broken. */
 1137|      0|	}
 1138|       |
 1139|      0|	return regdom;
 1140|     65|}
psl_free:
 1341|     65|{
 1342|     65|	if (psl && psl != &builtin_psl) {
  ------------------
  |  Branch (1342:6): [True: 0, False: 65]
  |  Branch (1342:13): [True: 0, False: 0]
  ------------------
 1343|      0|		vector_free(&psl->suffixes);
 1344|      0|		free(psl->dafsa);
 1345|      0|		free(psl);
 1346|      0|	}
 1347|     65|}
psl_builtin:
 1366|     65|{
 1367|       |#ifdef ENABLE_BUILTIN
 1368|       |	return &builtin_psl;
 1369|       |#else
 1370|     65|	return NULL;
 1371|     65|#endif
 1372|     65|}
psl_builtin_file_time:
 1456|      1|{
 1457|      1|	return _psl_file_time;
 1458|      1|}
psl_builtin_sha1sum:
 1473|      1|{
 1474|      1|	return _psl_sha1_checksum;
 1475|      1|}
psl_builtin_filename:
 1489|      1|{
 1490|      1|	return _psl_filename;
 1491|      1|}
psl_builtin_outdated:
 1507|      1|{
 1508|      1|	struct stat st;
 1509|       |
 1510|      1|	if (stat(_psl_filename, &st) == 0 && st.st_mtime > _psl_file_time)
  ------------------
  |  Branch (1510:6): [True: 0, False: 1]
  |  Branch (1510:39): [True: 0, False: 0]
  ------------------
 1511|      0|		return 1;
 1512|       |
 1513|      1|	return 0;
 1514|      1|}
psl_dist_filename:
 1529|      1|{
 1530|      1|	return _psl_dist_filename;
 1531|      1|}
psl_get_version:
 1543|      1|{
 1544|       |#ifdef WITH_LIBICU
 1545|       |	return PACKAGE_VERSION " (+libicu/" U_ICU_VERSION ")";
 1546|       |#elif defined(WITH_LIBIDN2)
 1547|       |	return PACKAGE_VERSION " (+libidn2/" IDN2_VERSION ")";
 1548|       |#elif defined(WITH_LIBIDN)
 1549|       |	return PACKAGE_VERSION " (+libidn/" STRINGPREP_VERSION ")";
 1550|       |#else
 1551|      1|	return PACKAGE_VERSION " (no IDNA support)";
  ------------------
  |  |  130|      1|#define PACKAGE_VERSION "0.21.2"
  ------------------
 1552|      1|#endif
 1553|      1|}
psl_check_version_number:
 1569|      1|{
 1570|      1|	if (version) {
  ------------------
  |  Branch (1570:6): [True: 1, False: 0]
  ------------------
 1571|      1|		int major = version >> 16;
 1572|      1|		int minor = (version >> 8) & 0xFF;
 1573|      1|		int patch = version & 0xFF;
 1574|       |
 1575|      1|		if (major < PSL_VERSION_MAJOR
  ------------------
  |  |   38|      2|#define PSL_VERSION_MAJOR 0
  ------------------
  |  Branch (1575:7): [True: 0, False: 1]
  ------------------
 1576|      1|			|| (major == PSL_VERSION_MAJOR && minor < PSL_VERSION_MINOR)
  ------------------
  |  |   38|      2|#define PSL_VERSION_MAJOR 0
  ------------------
              			|| (major == PSL_VERSION_MAJOR && minor < PSL_VERSION_MINOR)
  ------------------
  |  |   39|      1|#define PSL_VERSION_MINOR 21
  ------------------
  |  Branch (1576:8): [True: 1, False: 0]
  |  Branch (1576:38): [True: 1, False: 0]
  ------------------
 1577|      1|			|| (major == PSL_VERSION_MAJOR && minor == PSL_VERSION_MINOR && patch < PSL_VERSION_PATCH))
  ------------------
  |  |   38|      0|#define PSL_VERSION_MAJOR 0
  ------------------
              			|| (major == PSL_VERSION_MAJOR && minor == PSL_VERSION_MINOR && patch < PSL_VERSION_PATCH))
  ------------------
  |  |   39|      0|#define PSL_VERSION_MINOR 21
  ------------------
              			|| (major == PSL_VERSION_MAJOR && minor == PSL_VERSION_MINOR && patch < PSL_VERSION_PATCH))
  ------------------
  |  |   40|      0|#define PSL_VERSION_PATCH 2
  ------------------
  |  Branch (1577:8): [True: 0, False: 0]
  |  Branch (1577:38): [True: 0, False: 0]
  |  Branch (1577:68): [True: 0, False: 0]
  ------------------
 1578|      1|		{
 1579|      1|			return 0;
 1580|      1|		}
 1581|      1|	}
 1582|       |
 1583|      0|	return PSL_VERSION_NUMBER;
  ------------------
  |  |   41|      0|#define PSL_VERSION_NUMBER 0x001502
  ------------------
 1584|      1|}
psl_is_cookie_domain_acceptable:
 1640|    130|{
 1641|    130|	const char *p;
 1642|    130|	size_t hostname_length, cookie_domain_length;
 1643|       |
 1644|    130|	if (!psl || !hostname || !cookie_domain)
  ------------------
  |  Branch (1644:6): [True: 130, False: 0]
  |  Branch (1644:14): [True: 0, False: 0]
  |  Branch (1644:27): [True: 0, False: 0]
  ------------------
 1645|    130|		return 0;
 1646|       |
 1647|      0|	while (*cookie_domain == '.')
  ------------------
  |  Branch (1647:9): [True: 0, False: 0]
  ------------------
 1648|      0|		cookie_domain++;
 1649|       |
 1650|      0|	if (!strcmp(hostname, cookie_domain))
  ------------------
  |  Branch (1650:6): [True: 0, False: 0]
  ------------------
 1651|      0|		return 1; /* an exact match is acceptable (and pretty common) */
 1652|       |
 1653|      0|	if (isip(hostname))
  ------------------
  |  Branch (1653:6): [True: 0, False: 0]
  ------------------
 1654|      0|		return 0; /* Hostname is an IP address and these must match fully (RFC 6265, 5.1.3) */
 1655|       |
 1656|      0|	cookie_domain_length = strlen(cookie_domain);
 1657|      0|	hostname_length = strlen(hostname);
 1658|       |
 1659|      0|	if (cookie_domain_length >= hostname_length)
  ------------------
  |  Branch (1659:6): [True: 0, False: 0]
  ------------------
 1660|      0|		return 0; /* cookie_domain is too long */
 1661|       |
 1662|      0|	p = hostname + hostname_length - cookie_domain_length;
 1663|      0|	if (!strcmp(p, cookie_domain) && p[-1] == '.') {
  ------------------
  |  Branch (1663:6): [True: 0, False: 0]
  |  Branch (1663:35): [True: 0, False: 0]
  ------------------
 1664|       |		/* OK, cookie_domain matches, but it must be longer than the longest public suffix in 'hostname' */
 1665|       |
 1666|      0|		if (!(p = psl_unregistrable_domain(psl, hostname)))
  ------------------
  |  Branch (1666:7): [True: 0, False: 0]
  ------------------
 1667|      0|			return 1;
 1668|       |
 1669|      0|		if (cookie_domain_length > strlen(p))
  ------------------
  |  Branch (1669:7): [True: 0, False: 0]
  ------------------
 1670|      0|			return 1;
 1671|      0|	}
 1672|       |
 1673|      0|	return 0;
 1674|      0|}
psl_str_to_utf8lower:
 1717|    195|{
 1718|    195|	int ret = PSL_ERR_INVALID_ARG;
 1719|       |
 1720|    195|	if (!str)
  ------------------
  |  Branch (1720:6): [True: 0, False: 195]
  ------------------
 1721|      0|		return PSL_ERR_INVALID_ARG;
 1722|       |
 1723|       |	/* shortcut to avoid costly conversion */
 1724|    195|	if (str_is_ascii(str)) {
  ------------------
  |  Branch (1724:6): [True: 135, False: 60]
  ------------------
 1725|    135|		if (lower) {
  ------------------
  |  Branch (1725:7): [True: 135, False: 0]
  ------------------
 1726|    135|			char *p, *tmp;
 1727|       |
 1728|    135|			if (!(tmp = strdup(str)))
  ------------------
  |  Branch (1728:8): [True: 0, False: 135]
  ------------------
 1729|      0|				return PSL_ERR_NO_MEM;
 1730|       |
 1731|    135|			*lower = tmp;
 1732|       |
 1733|       |			/* convert ASCII string to lowercase */
 1734|  10.6k|			for (p = *lower; *p; p++)
  ------------------
  |  Branch (1734:21): [True: 10.4k, False: 135]
  ------------------
 1735|  10.4k|				if (isupper(*p))
 1736|  8.07k|					*p = tolower(*p);
 1737|    135|		}
 1738|    135|		return PSL_SUCCESS;
 1739|    135|	}
 1740|       |
 1741|       |#ifdef WITH_LIBICU
 1742|       |	do {
 1743|       |	size_t str_length = strlen(str);
 1744|       |	UErrorCode status = 0;
 1745|       |	UChar *utf16_dst, *utf16_lower;
 1746|       |	int32_t utf16_dst_length;
 1747|       |	char *utf8_lower;
 1748|       |	UConverter *uconv;
 1749|       |
 1750|       |	if (str_length < 256) {
 1751|       |		/* C89 allocation */
 1752|       |		utf16_dst   = alloca(sizeof(UChar) * (str_length * 2 + 1));
 1753|       |		utf16_lower = alloca(sizeof(UChar) * (str_length * 2 + 1));
 1754|       |		utf8_lower  = alloca(str_length * 6 + 1);
 1755|       |	} else {
 1756|       |		utf16_dst   = malloc(sizeof(UChar) * (str_length * 2 + 1));
 1757|       |		utf16_lower = malloc(sizeof(UChar) * (str_length * 2 + 1));
 1758|       |		utf8_lower  = malloc(str_length * 6 + 1);
 1759|       |
 1760|       |		if (!utf16_dst || !utf16_lower || !utf8_lower) {
 1761|       |			ret = PSL_ERR_NO_MEM;
 1762|       |			goto out;
 1763|       |		}
 1764|       |	}
 1765|       |
 1766|       |	uconv = ucnv_open(encoding, &status);
 1767|       |	if (U_SUCCESS(status)) {
 1768|       |		utf16_dst_length = ucnv_toUChars(uconv, utf16_dst, str_length * 2 + 1, str, str_length, &status);
 1769|       |		ucnv_close(uconv);
 1770|       |
 1771|       |		if (U_SUCCESS(status)) {
 1772|       |			int32_t utf16_lower_length = u_strToLower(utf16_lower, str_length * 2 + 1, utf16_dst, utf16_dst_length, locale, &status);
 1773|       |			if (U_SUCCESS(status)) {
 1774|       |				u_strToUTF8(utf8_lower, str_length * 6 + 1, NULL, utf16_lower, utf16_lower_length, &status);
 1775|       |				if (U_SUCCESS(status)) {
 1776|       |					ret = PSL_SUCCESS;
 1777|       |					if (lower) {
 1778|       |						char *tmp = strdup(utf8_lower);
 1779|       |
 1780|       |						if (tmp)
 1781|       |							*lower = tmp;
 1782|       |						else
 1783|       |							ret = PSL_ERR_NO_MEM;
 1784|       |					}
 1785|       |				} else {
 1786|       |					ret = PSL_ERR_TO_UTF8;
 1787|       |					/* fprintf(stderr, "Failed to convert UTF-16 to UTF-8 (status %d)\n", status); */
 1788|       |				}
 1789|       |			} else {
 1790|       |				ret = PSL_ERR_TO_LOWER;
 1791|       |				/* fprintf(stderr, "Failed to convert UTF-16 to lowercase (status %d)\n", status); */
 1792|       |			}
 1793|       |		} else {
 1794|       |			ret = PSL_ERR_TO_UTF16;
 1795|       |			/* fprintf(stderr, "Failed to convert string to UTF-16 (status %d)\n", status); */
 1796|       |		}
 1797|       |	} else {
 1798|       |		ret = PSL_ERR_CONVERTER;
 1799|       |		/* fprintf(stderr, "Failed to open converter for '%s' (status %d)\n", encoding, status); */
 1800|       |	}
 1801|       |out:
 1802|       |	if (str_length >= 256) {
 1803|       |		free(utf16_dst);
 1804|       |		free(utf16_lower);
 1805|       |		free(utf8_lower);
 1806|       |	}
 1807|       |	} while (0);
 1808|       |#elif defined(WITH_LIBIDN2) || defined(WITH_LIBIDN)
 1809|       |	do {
 1810|       |		/* find out local charset encoding */
 1811|       |		if (!encoding) {
 1812|       |#ifdef HAVE_NL_LANGINFO
 1813|       |			encoding = nl_langinfo(CODESET);
 1814|       |#elif defined _WIN32
 1815|       |			static char buf[16];
 1816|       |			snprintf(buf, sizeof(buf), "CP%u", GetACP());
 1817|       |			encoding = buf;
 1818|       |#endif
 1819|       |			if (!encoding || !*encoding)
 1820|       |				encoding = "ASCII";
 1821|       |		}
 1822|       |
 1823|       |		/* convert to UTF-8 */
 1824|       |		if (strcasecmp(encoding, "utf-8")) {
 1825|       |			iconv_t cd = iconv_open("utf-8", encoding);
 1826|       |
 1827|       |			if (cd != (iconv_t)-1) {
 1828|       |				char *tmp = (char *)str; /* iconv won't change where str points to, but changes tmp itself */
 1829|       |				size_t tmp_len = strlen(str) + 1;
 1830|       |				size_t dst_len = tmp_len * 6, dst_len_tmp = dst_len;
 1831|       |				char *dst = malloc(dst_len + 1), *dst_tmp = dst;
 1832|       |
 1833|       |				if (!dst) {
 1834|       |					ret = PSL_ERR_NO_MEM;
 1835|       |				}
 1836|       |				else if (iconv(cd, (WINICONV_CONST char **)&tmp, &tmp_len, &dst_tmp, &dst_len_tmp) != (size_t)-1
 1837|       |					&& iconv(cd, NULL, NULL, &dst_tmp, &dst_len_tmp) != (size_t)-1)
 1838|       |				{
 1839|       |					/* start size for u8_tolower internal memory allocation.
 1840|       |					 * u8_tolower() does not terminate the result string. we have 0 byte included in above tmp_len
 1841|       |					 * and thus in len. */
 1842|       |					size_t len = dst_len - dst_len_tmp;
 1843|       |
 1844|       |					if ((tmp = (char *)u8_tolower((uint8_t *)dst, len, 0, UNINORM_NFKC, NULL, &len))) {
 1845|       |						ret = PSL_SUCCESS;
 1846|       |						if (lower) {
 1847|       |							*lower = tmp;
 1848|       |							tmp = NULL;
 1849|       |						} else
 1850|       |							free(tmp);
 1851|       |					} else {
 1852|       |						ret = PSL_ERR_TO_LOWER;
 1853|       |						/* fprintf(stderr, "Failed to convert UTF-8 to lowercase (errno %d)\n", errno); */
 1854|       |					}
 1855|       |				} else {
 1856|       |					ret = PSL_ERR_TO_UTF8;
 1857|       |					/* fprintf(stderr, "Failed to convert '%s' string into '%s' (%d)\n", src_encoding, dst_encoding, errno); */
 1858|       |				}
 1859|       |
 1860|       |				free(dst);
 1861|       |				iconv_close(cd);
 1862|       |			} else {
 1863|       |				ret = PSL_ERR_TO_UTF8;
 1864|       |				/* fprintf(stderr, "Failed to prepare encoding '%s' into '%s' (%d)\n", src_encoding, dst_encoding, errno); */
 1865|       |			}
 1866|       |		} else {
 1867|       |			/* we need a conversion to lowercase */
 1868|       |			uint8_t *tmp;
 1869|       |
 1870|       |			/* start size for u8_tolower internal memory allocation.
 1871|       |			 * u8_tolower() does not terminate the result string, so include terminating 0 byte in len. */
 1872|       |			size_t len = u8_strlen((uint8_t *)str) + 1;
 1873|       |
 1874|       |			if ((tmp = u8_tolower((uint8_t *)str, len, 0, UNINORM_NFKC, NULL, &len))) {
 1875|       |				ret = PSL_SUCCESS;
 1876|       |				if (lower) {
 1877|       |					*lower = (char*)tmp;
 1878|       |					tmp = NULL;
 1879|       |				} else
 1880|       |					free(tmp);
 1881|       |			} else {
 1882|       |				ret = PSL_ERR_TO_LOWER;
 1883|       |				/* fprintf(stderr, "Failed to convert UTF-8 to lowercase (errno %d)\n", errno); */
 1884|       |			}
 1885|       |		}
 1886|       |
 1887|       |	} while (0);
 1888|       |#endif
 1889|       |
 1890|     60|	return ret;
 1891|    195|}
psl.c:str_is_ascii:
  616|    195|{
  617|  11.8k|	while (*s && *((unsigned char *)s) < 128) s++;
  ------------------
  |  Branch (617:9): [True: 11.7k, False: 135]
  |  Branch (617:15): [True: 11.6k, False: 60]
  ------------------
  618|       |
  619|    195|	return !*s;
  620|    195|}

