_ZN6icu_7810CharString6appendEcR10UErrorCode:
  113|     61|CharString &CharString::append(char c, UErrorCode &errorCode) {
  114|     61|    if(ensureCapacity(len+2, 0, errorCode)) {
  ------------------
  |  Branch (114:8): [True: 61, False: 0]
  ------------------
  115|     61|        buffer[len++]=c;
  116|     61|        buffer[len]=0;
  117|     61|    }
  118|     61|    return *this;
  119|     61|}
_ZN6icu_7810CharString6appendEPKciR10UErrorCode:
  121|    271|CharString &CharString::append(const char *s, int32_t sLength, UErrorCode &errorCode) {
  122|    271|    if(U_FAILURE(errorCode)) {
  ------------------
  |  Branch (122:8): [True: 0, False: 271]
  ------------------
  123|      0|        return *this;
  124|      0|    }
  125|    271|    if(sLength<-1 || (s==nullptr && sLength!=0)) {
  ------------------
  |  Branch (125:8): [True: 0, False: 271]
  |  Branch (125:23): [True: 0, False: 271]
  |  Branch (125:37): [True: 0, False: 0]
  ------------------
  126|      0|        errorCode=U_ILLEGAL_ARGUMENT_ERROR;
  127|      0|        return *this;
  128|      0|    }
  129|    271|    if(sLength<0) {
  ------------------
  |  Branch (129:8): [True: 0, False: 271]
  ------------------
  130|      0|        sLength= static_cast<int32_t>(uprv_strlen(s));
  ------------------
  |  |   37|      0|#define uprv_strlen(str) U_STANDARD_CPP_NAMESPACE strlen(str)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  131|      0|    }
  132|    271|    if(sLength>0) {
  ------------------
  |  Branch (132:8): [True: 271, False: 0]
  ------------------
  133|    271|        if(s==(buffer.getAlias()+len)) {
  ------------------
  |  Branch (133:12): [True: 0, False: 271]
  ------------------
  134|       |            // The caller wrote into the getAppendBuffer().
  135|      0|            if(sLength>=(buffer.getCapacity()-len)) {
  ------------------
  |  Branch (135:16): [True: 0, False: 0]
  ------------------
  136|       |                // The caller wrote too much.
  137|      0|                errorCode=U_INTERNAL_PROGRAM_ERROR;
  138|      0|            } else {
  139|      0|                buffer[len+=sLength]=0;
  140|      0|            }
  141|    271|        } else if(buffer.getAlias()<=s && s<(buffer.getAlias()+len) &&
  ------------------
  |  Branch (141:19): [True: 102, False: 169]
  |  Branch (141:43): [True: 0, False: 102]
  ------------------
  142|    271|                  sLength>=(buffer.getCapacity()-len)
  ------------------
  |  Branch (142:19): [True: 0, False: 0]
  ------------------
  143|    271|        ) {
  144|       |            // (Part of) this string is appended to itself which requires reallocation,
  145|       |            // so we have to make a copy of the substring and append that.
  146|      0|            return append(CharString(s, sLength, errorCode), errorCode);
  147|    271|        } else if(ensureCapacity(len+sLength+1, 0, errorCode)) {
  ------------------
  |  Branch (147:19): [True: 271, False: 0]
  ------------------
  148|    271|            uprv_memcpy(buffer.getAlias()+len, s, sLength);
  ------------------
  |  |   42|    271|#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|    271|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  |   43|    271|    /* Suppress warnings about addresses that will never be NULL */ \
  |  |   44|    271|    _Pragma("clang diagnostic push") \
  |  |   45|    271|    _Pragma("clang diagnostic ignored \"-Waddress\"") \
  |  |   46|    271|    U_ASSERT(dst != NULL); \
  |  |  ------------------
  |  |  |  |   35|    271|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   47|    271|    U_ASSERT(src != NULL); \
  |  |  ------------------
  |  |  |  |   35|    271|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   48|    271|    _Pragma("clang diagnostic pop") \
  |  |   49|    271|    U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
  |  |  ------------------
  |  |  |  |  393|    271|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  |  |   50|    271|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|    271|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  149|    271|            buffer[len+=sLength]=0;
  150|    271|        }
  151|    271|    }
  152|    271|    return *this;
  153|    271|}
_ZN6icu_7810CharString14ensureCapacityEiiR10UErrorCode:
  230|    332|                                 UErrorCode &errorCode) {
  231|    332|    if(U_FAILURE(errorCode)) {
  ------------------
  |  Branch (231:8): [True: 0, False: 332]
  ------------------
  232|      0|        return false;
  233|      0|    }
  234|    332|    if(capacity>buffer.getCapacity()) {
  ------------------
  |  Branch (234:8): [True: 0, False: 332]
  ------------------
  235|      0|        if(desiredCapacityHint==0) {
  ------------------
  |  Branch (235:12): [True: 0, False: 0]
  ------------------
  236|      0|            desiredCapacityHint=capacity+buffer.getCapacity();
  237|      0|        }
  238|      0|        if( (desiredCapacityHint<=capacity || buffer.resize(desiredCapacityHint, len+1)==nullptr) &&
  ------------------
  |  Branch (238:14): [True: 0, False: 0]
  |  Branch (238:47): [True: 0, False: 0]
  ------------------
  239|      0|            buffer.resize(capacity, len+1)==nullptr
  ------------------
  |  Branch (239:13): [True: 0, False: 0]
  ------------------
  240|      0|        ) {
  241|      0|            errorCode=U_MEMORY_ALLOCATION_ERROR;
  242|      0|            return false;
  243|      0|        }
  244|      0|    }
  245|    332|    return true;
  246|    332|}

_ZN6icu_7810CharString4dataEv:
   85|     91|    char *data() { return buffer.getAlias(); }
_ZN6icu_7810CharStringD2Ev:
   56|    123|    ~CharString() {}
_ZN6icu_7810CharString6appendENS_11StringPieceER10UErrorCode:
  131|    211|    CharString &append(StringPiece s, UErrorCode &errorCode) {
  132|    211|        return append(s.data(), s.length(), errorCode);
  133|    211|    }
_ZN6icu_7810CharStringC2Ev:
   43|    123|    CharString() : len(0) { buffer[0]=0; }
_ZNK6icu_7810CharString7isEmptyEv:
   79|     30|    UBool isEmpty() const { return len==0; }
_ZNK6icu_7810CharString6lengthEv:
   80|     90|    int32_t length() const { return len; }
_ZNK6icu_7810CharString4dataEv:
   84|     60|    const char *data() const { return buffer.getAlias(); }
_ZN6icu_7810CharString6appendERKS0_R10UErrorCode:
  134|     60|    CharString &append(const CharString &s, UErrorCode &errorCode) {
  135|     60|        return append(s.data(), s.length(), errorCode);
  136|     60|    }

uprv_malloc_78:
   45|  5.25k|uprv_malloc(size_t s) {
   46|       |#if U_DEBUG && defined(UPRV_MALLOC_COUNT)
   47|       |#if 1
   48|       |  putchar('>');
   49|       |  fflush(stdout);
   50|       |#else
   51|       |  fprintf(stderr,"MALLOC\t#%d\t%ul bytes\t%ul total\n", ++n,s,(b+=s)); fflush(stderr);
   52|       |#endif
   53|       |#endif
   54|  5.25k|    if (s > 0) {
  ------------------
  |  Branch (54:9): [True: 5.25k, False: 0]
  ------------------
   55|  5.25k|        if (pAlloc) {
  ------------------
  |  Branch (55:13): [True: 0, False: 5.25k]
  ------------------
   56|      0|            return (*pAlloc)(pContext, s);
   57|  5.25k|        } else {
   58|  5.25k|            return uprv_default_malloc(s);
  ------------------
  |  |  615|  5.25k|# define uprv_default_malloc(x) malloc(x)
  ------------------
   59|  5.25k|        }
   60|  5.25k|    } else {
   61|      0|        return (void *)zeroMem;
   62|      0|    }
   63|  5.25k|}
uprv_free_78:
   90|  5.22k|uprv_free(void *buffer) {
   91|       |#if U_DEBUG && defined(UPRV_MALLOC_COUNT)
   92|       |  putchar('<');
   93|       |  fflush(stdout);
   94|       |#endif
   95|  5.22k|    if (buffer != zeroMem) {
  ------------------
  |  Branch (95:9): [True: 5.22k, False: 0]
  ------------------
   96|  5.22k|        if (pFree) {
  ------------------
  |  Branch (96:13): [True: 0, False: 5.22k]
  ------------------
   97|      0|            (*pFree)(pContext, buffer);
   98|  5.22k|        } else {
   99|  5.22k|            uprv_default_free(buffer);
  ------------------
  |  |  617|  5.22k|# define uprv_default_free(x) free(x)
  ------------------
  100|  5.22k|        }
  101|  5.22k|    }
  102|  5.22k|}
uprv_calloc_78:
  105|    247|uprv_calloc(size_t num, size_t size) {
  106|    247|    void *mem = nullptr;
  107|    247|    size *= num;
  108|    247|    mem = uprv_malloc(size);
  ------------------
  |  | 1524|    247|#define uprv_malloc U_ICU_ENTRY_POINT_RENAME(uprv_malloc)
  |  |  ------------------
  |  |  |  |  123|    247|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|    247|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|    247|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  109|    247|    if (mem) {
  ------------------
  |  Branch (109:9): [True: 247, False: 0]
  ------------------
  110|    247|        uprv_memset(mem, 0, size);
  ------------------
  |  |  100|    247|#define uprv_memset(buffer, mark, size) U_STANDARD_CPP_NAMESPACE memset(buffer, mark, size)
  |  |  ------------------
  |  |  |  |  393|    247|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  111|    247|    }
  112|    247|    return mem;
  113|    247|}

_ZN6icu_7815MaybeStackArrayIcLi40EEC2Ev:
  344|    123|    MaybeStackArray() : ptr(stackArray), capacity(stackCapacity), needToRelease(false) {}
_ZN6icu_7815MaybeStackArrayIcLi40EED2Ev:
  363|    123|    ~MaybeStackArray() { releaseArray(); }
_ZNK6icu_7815MaybeStackArrayIcLi40EE11getCapacityEv:
  376|    332|    int32_t getCapacity() const { return capacity; }
_ZNK6icu_7815MaybeStackArrayIcLi40EE8getAliasEv:
  381|  1.06k|    T *getAlias() const { return ptr; }
_ZN6icu_7815MaybeStackArrayIcLi40EEixEl:
  402|    516|    T &operator[](ptrdiff_t i) { return ptr[i]; }
_ZN6icu_7815MaybeStackArrayIcLi40EE12releaseArrayEv:
  458|    123|    void releaseArray() {
  459|    123|        if(needToRelease) {
  ------------------
  |  Branch (459:12): [True: 0, False: 123]
  ------------------
  460|      0|            uprv_free(ptr);
  ------------------
  |  | 1503|      0|#define uprv_free U_ICU_ENTRY_POINT_RENAME(uprv_free)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  461|      0|        }
  462|    123|    }
umutex.cpp:_ZZN6icu_78L9umtx_initEvENK3$_0clEv:
  144|      1|#define STATIC_NEW(type) [] () { \
  145|      1|    alignas(type) static char storage[sizeof(type)]; \
  146|      1|    return new(storage) type();} ()
umutex.cpp:_ZZN6icu_78L9umtx_initEvENK3$_1clEv:
  144|      1|#define STATIC_NEW(type) [] () { \
  145|      1|    alignas(type) static char storage[sizeof(type)]; \
  146|      1|    return new(storage) type();} ()

_ZN6icu_785MutexC2EPNS_6UMutexE:
   58|     55|    Mutex(UMutex *mutex = nullptr) : fMutex(mutex) {
   59|     55|        umtx_lock(fMutex);
  ------------------
  |  | 1250|     55|#define umtx_lock U_ICU_ENTRY_POINT_RENAME(umtx_lock)
  |  |  ------------------
  |  |  |  |  123|     55|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|     55|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|     55|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   60|     55|    }
_ZN6icu_785MutexD2Ev:
   61|     55|    ~Mutex() {
   62|     55|        umtx_unlock(fMutex);
  ------------------
  |  | 1251|     55|#define umtx_unlock U_ICU_ENTRY_POINT_RENAME(umtx_unlock)
  |  |  ------------------
  |  |  |  |  123|     55|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|     55|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|     55|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   63|     55|    }

u_setDataDirectory_78:
 1316|      1|u_setDataDirectory(const char *directory) {
 1317|      1|    char *newDataDir;
 1318|      1|    int32_t length;
 1319|       |
 1320|      1|    if(directory==nullptr || *directory==0) {
  ------------------
  |  Branch (1320:8): [True: 0, False: 1]
  |  Branch (1320:30): [True: 1, False: 0]
  ------------------
 1321|       |        /* A small optimization to prevent the malloc and copy when the
 1322|       |        shared library is used, and this is a way to make sure that nullptr
 1323|       |        is never returned.
 1324|       |        */
 1325|      1|        newDataDir = (char *)"";
 1326|      1|    }
 1327|      0|    else {
 1328|      0|        length=(int32_t)uprv_strlen(directory);
  ------------------
  |  |   37|      0|#define uprv_strlen(str) U_STANDARD_CPP_NAMESPACE strlen(str)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
 1329|      0|        newDataDir = (char *)uprv_malloc(length + 2);
  ------------------
  |  | 1524|      0|#define uprv_malloc U_ICU_ENTRY_POINT_RENAME(uprv_malloc)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1330|       |        /* Exit out if newDataDir could not be created. */
 1331|      0|        if (newDataDir == nullptr) {
  ------------------
  |  Branch (1331:13): [True: 0, False: 0]
  ------------------
 1332|      0|            return;
 1333|      0|        }
 1334|      0|        uprv_strcpy(newDataDir, directory);
  ------------------
  |  |   36|      0|#define uprv_strcpy(dst, src) U_STANDARD_CPP_NAMESPACE  strcpy(dst, src)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
 1335|       |
 1336|       |#if (U_FILE_SEP_CHAR != U_FILE_ALT_SEP_CHAR)
 1337|       |        {
 1338|       |            char *p;
 1339|       |            while((p = uprv_strchr(newDataDir, U_FILE_ALT_SEP_CHAR)) != nullptr) {
 1340|       |                *p = U_FILE_SEP_CHAR;
 1341|       |            }
 1342|       |        }
 1343|       |#endif
 1344|      0|    }
 1345|       |
 1346|      1|    if (gDataDirectory && *gDataDirectory) {
  ------------------
  |  Branch (1346:9): [True: 0, False: 1]
  |  Branch (1346:27): [True: 0, False: 0]
  ------------------
 1347|      0|        uprv_free(gDataDirectory);
  ------------------
  |  | 1503|      0|#define uprv_free U_ICU_ENTRY_POINT_RENAME(uprv_free)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1348|      0|    }
 1349|      1|    gDataDirectory = newDataDir;
 1350|      1|    ucln_common_registerCleanup(UCLN_COMMON_PUTIL, putil_cleanup);
  ------------------
  |  |  617|      1|#define ucln_common_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_common_registerCleanup)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1351|      1|}
u_getDataDirectory_78:
 1499|     31|u_getDataDirectory() {
 1500|     31|    umtx_initOnce(gDataDirInitOnce, &dataDirectoryInitFn);
 1501|     31|    return gDataDirectory;
 1502|     31|}
putil.cpp:_ZL19dataDirectoryInitFnv:
 1424|      1|static void U_CALLCONV dataDirectoryInitFn() {
 1425|       |    /* If we already have the directory, then return immediately. Will happen if user called
 1426|       |     * u_setDataDirectory().
 1427|       |     */
 1428|      1|    if (gDataDirectory) {
  ------------------
  |  Branch (1428:9): [True: 0, False: 1]
  ------------------
 1429|      0|        return;
 1430|      0|    }
 1431|       |
 1432|      1|    const char *path = nullptr;
 1433|       |#if defined(ICU_DATA_DIR_PREFIX_ENV_VAR)
 1434|       |    char datadir_path_buffer[PATH_MAX];
 1435|       |#endif
 1436|       |
 1437|       |    /*
 1438|       |    When ICU_NO_USER_DATA_OVERRIDE is defined, users aren't allowed to
 1439|       |    override ICU's data with the ICU_DATA environment variable. This prevents
 1440|       |    problems where multiple custom copies of ICU's specific version of data
 1441|       |    are installed on a system. Either the application must define the data
 1442|       |    directory with u_setDataDirectory, define ICU_DATA_DIR when compiling
 1443|       |    ICU, set the data with udata_setCommonData or trust that all of the
 1444|       |    required data is contained in ICU's data library that contains
 1445|       |    the entry point defined by U_ICUDATA_ENTRY_POINT.
 1446|       |
 1447|       |    There may also be some platforms where environment variables
 1448|       |    are not allowed.
 1449|       |    */
 1450|      1|#   if !defined(ICU_NO_USER_DATA_OVERRIDE) && !UCONFIG_NO_FILE_IO
 1451|       |    /* First try to get the environment variable */
 1452|      1|#     if U_PLATFORM_HAS_WINUWP_API == 0  // Windows UWP does not support getenv
 1453|      1|        path=getenv("ICU_DATA");
 1454|      1|#     endif
 1455|      1|#   endif
 1456|       |
 1457|       |    /* ICU_DATA_DIR may be set as a compile option.
 1458|       |     * U_ICU_DATA_DEFAULT_DIR is provided and is set by ICU at compile time
 1459|       |     * and is used only when data is built in archive mode eliminating the need
 1460|       |     * for ICU_DATA_DIR to be set. U_ICU_DATA_DEFAULT_DIR is set to the installation
 1461|       |     * directory of the data dat file. Users should use ICU_DATA_DIR if they want to
 1462|       |     * set their own path.
 1463|       |     */
 1464|       |#if defined(ICU_DATA_DIR) || defined(U_ICU_DATA_DEFAULT_DIR)
 1465|       |    if(path==nullptr || *path==0) {
 1466|       |# if defined(ICU_DATA_DIR_PREFIX_ENV_VAR)
 1467|       |        const char *prefix = getenv(ICU_DATA_DIR_PREFIX_ENV_VAR);
 1468|       |# endif
 1469|       |# ifdef ICU_DATA_DIR
 1470|       |        path=ICU_DATA_DIR;
 1471|       |# else
 1472|       |        path=U_ICU_DATA_DEFAULT_DIR;
 1473|       |# endif
 1474|       |# if defined(ICU_DATA_DIR_PREFIX_ENV_VAR)
 1475|       |        if (prefix != nullptr) {
 1476|       |            snprintf(datadir_path_buffer, sizeof(datadir_path_buffer), "%s%s", prefix, path);
 1477|       |            path=datadir_path_buffer;
 1478|       |        }
 1479|       |# endif
 1480|       |    }
 1481|       |#endif
 1482|       |
 1483|       |#if defined(ICU_DATA_DIR_WINDOWS)
 1484|       |    char datadir_path_buffer[MAX_PATH];
 1485|       |    if (getIcuDataDirectoryUnderWindowsDirectory(datadir_path_buffer, UPRV_LENGTHOF(datadir_path_buffer))) {
 1486|       |        path = datadir_path_buffer;
 1487|       |    }
 1488|       |#endif
 1489|       |
 1490|      1|    if(path==nullptr) {
  ------------------
  |  Branch (1490:8): [True: 1, False: 0]
  ------------------
 1491|       |        /* It looks really bad, set it to something. */
 1492|      1|        path = "";
 1493|      1|    }
 1494|       |
 1495|      1|    u_setDataDirectory(path);
  ------------------
  |  |  347|      1|#define u_setDataDirectory U_ICU_ENTRY_POINT_RENAME(u_setDataDirectory)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1496|      1|}

_ZN6icu_7810FileTracer9traceOpenEPKcS2_S2_:
  140|     30|    static void traceOpen(const char*, const char*, const char*) {}

_ZN6icu_7811StringPieceC2EPKc:
   19|    212|    : ptr_(str), length_((str == nullptr) ? 0 : static_cast<int32_t>(uprv_strlen(str))) { }
  ------------------
  |  |   37|    212|#define uprv_strlen(str) U_STANDARD_CPP_NAMESPACE strlen(str)
  |  |  ------------------
  |  |  |  |  393|    212|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (19:26): [True: 0, False: 212]
  ------------------

ucln_common_registerCleanup_78:
   67|      6|{
   68|       |    // Thread safety messiness: From ticket 10295, calls to registerCleanup() may occur
   69|       |    // concurrently. Although such cases should be storing the same value, they raise errors
   70|       |    // from the thread sanity checker. Doing the store within a mutex avoids those.
   71|       |    // BUT that can trigger a recursive entry into std::call_once() in umutex.cpp when this code,
   72|       |    // running from the call_once function, tries to grab the ICU global mutex, which
   73|       |    // re-enters the mutex init path. So, work-around by special casing UCLN_COMMON_MUTEX, not
   74|       |    // using the ICU global mutex for it.
   75|       |    //
   76|       |    // No other point in ICU uses std::call_once().
   77|       |
   78|      6|    U_ASSERT(UCLN_COMMON_START < type && type < UCLN_COMMON_COUNT);
  ------------------
  |  |   35|      6|#   define U_ASSERT(exp) (void)0
  ------------------
   79|      6|    if (type == UCLN_COMMON_MUTEX) {
  ------------------
  |  Branch (79:9): [True: 1, False: 5]
  ------------------
   80|      1|        gCommonCleanupFunctions[type] = func;
   81|      5|    } else if (UCLN_COMMON_START < type && type < UCLN_COMMON_COUNT)  {
  ------------------
  |  Branch (81:16): [True: 5, False: 0]
  |  Branch (81:44): [True: 5, False: 0]
  ------------------
   82|      5|        icu::Mutex m;     // See ticket 10295 for discussion.
   83|      5|        gCommonCleanupFunctions[type] = func;
   84|      5|    }
   85|       |#if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL))
   86|       |    ucln_registerAutomaticCleanup();
   87|       |#endif
   88|      6|}

udata_getHeaderSize_78:
   36|     12|udata_getHeaderSize(const DataHeader *udh) {
   37|     12|    if(udh==nullptr) {
  ------------------
  |  Branch (37:8): [True: 0, False: 12]
  ------------------
   38|      0|        return 0;
   39|     12|    } else if(udh->info.isBigEndian==U_IS_BIG_ENDIAN) {
  ------------------
  |  |  353|     12|#   define U_IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  ------------------
  |  Branch (39:15): [True: 12, False: 0]
  ------------------
   40|       |        /* same endianness */
   41|     12|        return udh->dataHeader.headerSize;
   42|     12|    } else {
   43|       |        /* opposite endianness */
   44|      0|        uint16_t x=udh->dataHeader.headerSize;
   45|      0|        return (uint16_t)((x<<8)|(x>>8));
   46|      0|    }
   47|     12|}
udata_getInfoSize_78:
   50|      8|udata_getInfoSize(const UDataInfo *info) {
   51|      8|    if(info==nullptr) {
  ------------------
  |  Branch (51:8): [True: 0, False: 8]
  ------------------
   52|      0|        return 0;
   53|      8|    } else if(info->isBigEndian==U_IS_BIG_ENDIAN) {
  ------------------
  |  |  353|      8|#   define U_IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  ------------------
  |  Branch (53:15): [True: 8, False: 0]
  ------------------
   54|       |        /* same endianness */
   55|      8|        return info->size;
   56|      8|    } else {
   57|       |        /* opposite endianness */
   58|      0|        uint16_t x=info->size;
   59|      0|        return (uint16_t)((x<<8)|(x>>8));
   60|      0|    }
   61|      8|}
udata_checkCommonData_78:
  326|      1|U_CFUNC void udata_checkCommonData(UDataMemory *udm, UErrorCode *err) {
  327|      1|    if (U_FAILURE(*err)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 1]
  ------------------
  328|      0|        return;
  329|      0|    }
  330|       |
  331|      1|    if(udm==nullptr || udm->pHeader==nullptr) {
  ------------------
  |  Branch (331:8): [True: 0, False: 1]
  |  Branch (331:24): [True: 0, False: 1]
  ------------------
  332|      0|      *err=U_INVALID_FORMAT_ERROR;
  333|      1|    } else if(!(udm->pHeader->dataHeader.magic1==0xda &&
  ------------------
  |  Branch (333:17): [True: 1, False: 0]
  ------------------
  334|      1|        udm->pHeader->dataHeader.magic2==0x27 &&
  ------------------
  |  Branch (334:9): [True: 1, False: 0]
  ------------------
  335|      1|        udm->pHeader->info.isBigEndian==U_IS_BIG_ENDIAN &&
  ------------------
  |  |  353|      2|#   define U_IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  ------------------
  |  Branch (335:9): [True: 1, False: 0]
  ------------------
  336|      1|        udm->pHeader->info.charsetFamily==U_CHARSET_FAMILY)
  ------------------
  |  |  588|      1|#   define U_CHARSET_FAMILY U_ASCII_FAMILY
  |  |  ------------------
  |  |  |  |  531|      1|#define U_ASCII_FAMILY 0
  |  |  ------------------
  ------------------
  |  Branch (336:9): [True: 1, False: 0]
  ------------------
  337|      1|        ) {
  338|       |        /* header not valid */
  339|      0|        *err=U_INVALID_FORMAT_ERROR;
  340|      0|    }
  341|      1|    else if (udm->pHeader->info.dataFormat[0]==0x43 &&
  ------------------
  |  Branch (341:14): [True: 1, False: 0]
  ------------------
  342|      1|        udm->pHeader->info.dataFormat[1]==0x6d &&
  ------------------
  |  Branch (342:9): [True: 1, False: 0]
  ------------------
  343|      1|        udm->pHeader->info.dataFormat[2]==0x6e &&
  ------------------
  |  Branch (343:9): [True: 1, False: 0]
  ------------------
  344|      1|        udm->pHeader->info.dataFormat[3]==0x44 &&
  ------------------
  |  Branch (344:9): [True: 1, False: 0]
  ------------------
  345|      1|        udm->pHeader->info.formatVersion[0]==1
  ------------------
  |  Branch (345:9): [True: 1, False: 0]
  ------------------
  346|      1|        ) {
  347|       |        /* dataFormat="CmnD" */
  348|      1|        udm->vFuncs = &CmnDFuncs;
  349|      1|        udm->toc=(const char *)udm->pHeader+udata_getHeaderSize(udm->pHeader);
  ------------------
  |  |  887|      1|#define udata_getHeaderSize U_ICU_ENTRY_POINT_RENAME(udata_getHeaderSize)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  350|      1|    }
  351|      0|    else if(udm->pHeader->info.dataFormat[0]==0x54 &&
  ------------------
  |  Branch (351:13): [True: 0, False: 0]
  ------------------
  352|      0|        udm->pHeader->info.dataFormat[1]==0x6f &&
  ------------------
  |  Branch (352:9): [True: 0, False: 0]
  ------------------
  353|      0|        udm->pHeader->info.dataFormat[2]==0x43 &&
  ------------------
  |  Branch (353:9): [True: 0, False: 0]
  ------------------
  354|      0|        udm->pHeader->info.dataFormat[3]==0x50 &&
  ------------------
  |  Branch (354:9): [True: 0, False: 0]
  ------------------
  355|      0|        udm->pHeader->info.formatVersion[0]==1
  ------------------
  |  Branch (355:9): [True: 0, False: 0]
  ------------------
  356|      0|        ) {
  357|       |        /* dataFormat="ToCP" */
  358|      0|        udm->vFuncs = &ToCPFuncs;
  359|      0|        udm->toc=(const char *)udm->pHeader+udata_getHeaderSize(udm->pHeader);
  ------------------
  |  |  887|      0|#define udata_getHeaderSize U_ICU_ENTRY_POINT_RENAME(udata_getHeaderSize)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  360|      0|    }
  361|      0|    else {
  362|       |        /* dataFormat not recognized */
  363|      0|        *err=U_INVALID_FORMAT_ERROR;
  364|      0|    }
  365|       |
  366|      1|    if (U_FAILURE(*err)) {
  ------------------
  |  Branch (366:9): [True: 0, False: 1]
  ------------------
  367|       |        /* If the data is no good and we memory-mapped it ourselves,
  368|       |         *  close the memory mapping so it doesn't leak.  Note that this has
  369|       |         *  no effect on non-memory mapped data, other than clearing fields in udm.
  370|       |         */
  371|      0|        udata_close(udm);
  ------------------
  |  |  885|      0|#define udata_close U_ICU_ENTRY_POINT_RENAME(udata_close)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  372|      0|    }
  373|      1|}
ucmndata.cpp:_ZL17offsetTOCLookupFnPK11UDataMemoryPKcPiP10UErrorCode:
  229|     30|                  UErrorCode *pErrorCode) {
  230|     30|    (void)pErrorCode;
  231|     30|    const UDataOffsetTOC  *toc = (UDataOffsetTOC *)pData->toc;
  232|     30|    if(toc!=nullptr) {
  ------------------
  |  Branch (232:8): [True: 30, False: 0]
  ------------------
  233|     30|        const char *base=(const char *)toc;
  234|     30|        int32_t number, count=(int32_t)toc->count;
  235|       |
  236|       |        /* perform a binary search for the data in the common data's table of contents */
  237|       |#if defined (UDATA_DEBUG_DUMP)
  238|       |        /* list the contents of the TOC each time .. not recommended */
  239|       |        for(number=0; number<count; ++number) {
  240|       |            fprintf(stderr, "\tx%d: %s\n", number, &base[toc->entry[number].nameOffset]);
  241|       |        }
  242|       |#endif
  243|     30|        number=offsetTOCPrefixBinarySearch(tocEntryName, base, toc->entry, count);
  244|     30|        if(number>=0) {
  ------------------
  |  Branch (244:12): [True: 11, False: 19]
  ------------------
  245|       |            /* found it */
  246|     11|            const UDataOffsetTOCEntry *entry=toc->entry+number;
  247|       |#ifdef UDATA_DEBUG
  248|       |            fprintf(stderr, "%s: Found.\n", tocEntryName);
  249|       |#endif
  250|     11|            if((number+1) < count) {
  ------------------
  |  Branch (250:16): [True: 11, False: 0]
  ------------------
  251|     11|                *pLength = (int32_t)(entry[1].dataOffset - entry->dataOffset);
  252|     11|            } else {
  253|      0|                *pLength = -1;
  254|      0|            }
  255|     11|            return (const DataHeader *)(base+entry->dataOffset);
  256|     19|        } else {
  257|       |#ifdef UDATA_DEBUG
  258|       |            fprintf(stderr, "%s: Not found.\n", tocEntryName);
  259|       |#endif
  260|     19|            return nullptr;
  261|     19|        }
  262|     30|    } else {
  263|       |#ifdef UDATA_DEBUG
  264|       |        fprintf(stderr, "returning header\n");
  265|       |#endif
  266|       |
  267|      0|        return pData->pHeader;
  268|      0|    }
  269|     30|}
ucmndata.cpp:_ZL27offsetTOCPrefixBinarySearchPKcS0_PK19UDataOffsetTOCEntryi:
  125|     30|                            const UDataOffsetTOCEntry *toc, int32_t count) {
  126|     30|    int32_t start=0;
  127|     30|    int32_t limit=count;
  128|       |    /*
  129|       |     * Remember the shared prefix between s, start and limit,
  130|       |     * and don't compare that shared prefix again.
  131|       |     * The shared prefix should get longer as we narrow the [start, limit[ range.
  132|       |     */
  133|     30|    int32_t startPrefixLength=0;
  134|     30|    int32_t limitPrefixLength=0;
  135|     30|    if(count==0) {
  ------------------
  |  Branch (135:8): [True: 0, False: 30]
  ------------------
  136|      0|        return -1;
  137|      0|    }
  138|       |    /*
  139|       |     * Prime the prefix lengths so that we don't keep prefixLength at 0 until
  140|       |     * both the start and limit indexes have moved.
  141|       |     * At the same time, we find if s is one of the start and (limit-1) names,
  142|       |     * and if not, exclude them from the actual binary search.
  143|       |     */
  144|     30|    if(0==strcmpAfterPrefix(s, names+toc[0].nameOffset, &startPrefixLength)) {
  ------------------
  |  Branch (144:8): [True: 0, False: 30]
  ------------------
  145|      0|        return 0;
  146|      0|    }
  147|     30|    ++start;
  148|     30|    --limit;
  149|     30|    if(0==strcmpAfterPrefix(s, names+toc[limit].nameOffset, &limitPrefixLength)) {
  ------------------
  |  Branch (149:8): [True: 0, False: 30]
  ------------------
  150|      0|        return limit;
  151|      0|    }
  152|    370|    while(start<limit) {
  ------------------
  |  Branch (152:11): [True: 351, False: 19]
  ------------------
  153|    351|        int32_t i=(start+limit)/2;
  154|    351|        int32_t prefixLength=MIN(startPrefixLength, limitPrefixLength);
  ------------------
  |  |   97|    351|#define MIN(a,b) (((a)<(b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (97:19): [True: 102, False: 249]
  |  |  ------------------
  ------------------
  155|    351|        int32_t cmp=strcmpAfterPrefix(s, names+toc[i].nameOffset, &prefixLength);
  156|    351|        if(cmp<0) {
  ------------------
  |  Branch (156:12): [True: 156, False: 195]
  ------------------
  157|    156|            limit=i;
  158|    156|            limitPrefixLength=prefixLength;
  159|    195|        } else if(cmp==0) {
  ------------------
  |  Branch (159:19): [True: 11, False: 184]
  ------------------
  160|     11|            return i;
  161|    184|        } else {
  162|    184|            start=i+1;
  163|    184|            startPrefixLength=prefixLength;
  164|    184|        }
  165|    351|    }
  166|     19|    return -1;
  167|     30|}
ucmndata.cpp:_ZL17strcmpAfterPrefixPKcS0_Pi:
  105|    411|strcmpAfterPrefix(const char *s1, const char *s2, int32_t *pPrefixLength) {
  106|    411|    int32_t pl=*pPrefixLength;
  107|    411|    int32_t cmp=0;
  108|    411|    s1+=pl;
  109|    411|    s2+=pl;
  110|  1.45k|    for(;;) {
  111|  1.45k|        int32_t c1 = static_cast<uint8_t>(*s1++);
  112|  1.45k|        int32_t c2 = static_cast<uint8_t>(*s2++);
  113|  1.45k|        cmp=c1-c2;
  114|  1.45k|        if(cmp!=0 || c1==0) {  /* different or done */
  ------------------
  |  Branch (114:12): [True: 400, False: 1.05k]
  |  Branch (114:22): [True: 11, False: 1.04k]
  ------------------
  115|    411|            break;
  116|    411|        }
  117|  1.04k|        ++pl;  /* increment shared same-prefix length */
  118|  1.04k|    }
  119|    411|    *pPrefixLength=pl;
  120|    411|    return cmp;
  121|    411|}

ucnv_open_78:
   75|  3.01k|{
   76|  3.01k|    UConverter *r;
   77|       |
   78|  3.01k|    if (err == nullptr || U_FAILURE (*err)) {
  ------------------
  |  Branch (78:9): [True: 0, False: 3.01k]
  |  Branch (78:27): [True: 0, False: 3.01k]
  ------------------
   79|      0|        return nullptr;
   80|      0|    }
   81|       |
   82|  3.01k|    r =  ucnv_createConverter(nullptr, name, err);
  ------------------
  |  |  647|  3.01k|#define ucnv_createConverter U_ICU_ENTRY_POINT_RENAME(ucnv_createConverter)
  |  |  ------------------
  |  |  |  |  123|  3.01k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  3.01k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  3.01k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   83|  3.01k|    return r;
   84|  3.01k|}
ucnv_close_78:
  334|  3.79k|{
  335|  3.79k|    UErrorCode errorCode = U_ZERO_ERROR;
  336|       |
  337|  3.79k|    UTRACE_ENTRY_OC(UTRACE_UCNV_CLOSE);
  338|       |
  339|  3.79k|    if (converter == nullptr)
  ------------------
  |  Branch (339:9): [True: 802, False: 2.99k]
  ------------------
  340|    802|    {
  341|    802|        UTRACE_EXIT();
  342|    802|        return;
  343|    802|    }
  344|       |
  345|  2.99k|    UTRACE_DATA3(UTRACE_OPEN_CLOSE, "close converter %s at %p, isCopyLocal=%b",
  346|  2.99k|        ucnv_getName(converter, &errorCode), converter, converter->isCopyLocal);
  347|       |
  348|       |    /* In order to speed up the close, only call the callbacks when they have been changed.
  349|       |    This performance check will only work when the callbacks are set within a shared library
  350|       |    or from user code that statically links this code. */
  351|       |    /* first, notify the callback functions that the converter is closed */
  352|  2.99k|    if (converter->fromCharErrorBehaviour != UCNV_TO_U_DEFAULT_CALLBACK) {
  ------------------
  |  |  134|  2.99k|#define UCNV_TO_U_DEFAULT_CALLBACK ((UConverterToUCallback) UCNV_TO_U_CALLBACK_SUBSTITUTE)
  |  |  ------------------
  |  |  |  |   78|  2.99k|#define UCNV_TO_U_CALLBACK_SUBSTITUTE U_ICU_ENTRY_POINT_RENAME(UCNV_TO_U_CALLBACK_SUBSTITUTE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  2.99k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  122|  2.99k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  121|  2.99k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (352:9): [True: 0, False: 2.99k]
  ------------------
  353|      0|        UConverterToUnicodeArgs toUArgs = {
  354|      0|            sizeof(UConverterToUnicodeArgs),
  355|      0|                true,
  356|      0|                nullptr,
  357|      0|                nullptr,
  358|      0|                nullptr,
  359|      0|                nullptr,
  360|      0|                nullptr,
  361|      0|                nullptr
  362|      0|        };
  363|       |
  364|      0|        toUArgs.converter = converter;
  365|      0|        errorCode = U_ZERO_ERROR;
  366|      0|        converter->fromCharErrorBehaviour(converter->toUContext, &toUArgs, nullptr, 0, UCNV_CLOSE, &errorCode);
  367|      0|    }
  368|  2.99k|    if (converter->fromUCharErrorBehaviour != UCNV_FROM_U_DEFAULT_CALLBACK) {
  ------------------
  |  |  135|  2.99k|#define UCNV_FROM_U_DEFAULT_CALLBACK ((UConverterFromUCallback) UCNV_FROM_U_CALLBACK_SUBSTITUTE)
  |  |  ------------------
  |  |  |  |   74|  2.99k|#define UCNV_FROM_U_CALLBACK_SUBSTITUTE U_ICU_ENTRY_POINT_RENAME(UCNV_FROM_U_CALLBACK_SUBSTITUTE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  2.99k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  122|  2.99k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  121|  2.99k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (368:9): [True: 0, False: 2.99k]
  ------------------
  369|      0|        UConverterFromUnicodeArgs fromUArgs = {
  370|      0|            sizeof(UConverterFromUnicodeArgs),
  371|      0|                true,
  372|      0|                nullptr,
  373|      0|                nullptr,
  374|      0|                nullptr,
  375|      0|                nullptr,
  376|      0|                nullptr,
  377|      0|                nullptr
  378|      0|        };
  379|      0|        fromUArgs.converter = converter;
  380|      0|        errorCode = U_ZERO_ERROR;
  381|      0|        converter->fromUCharErrorBehaviour(converter->fromUContext, &fromUArgs, nullptr, 0, 0, UCNV_CLOSE, &errorCode);
  382|      0|    }
  383|       |
  384|  2.99k|    if (converter->sharedData->impl->close != nullptr) {
  ------------------
  |  Branch (384:9): [True: 1.29k, False: 1.70k]
  ------------------
  385|  1.29k|        converter->sharedData->impl->close(converter);
  386|  1.29k|    }
  387|       |
  388|  2.99k|    if (converter->subChars != (uint8_t *)converter->subUChars) {
  ------------------
  |  Branch (388:9): [True: 0, False: 2.99k]
  ------------------
  389|      0|        uprv_free(converter->subChars);
  ------------------
  |  | 1503|      0|#define uprv_free U_ICU_ENTRY_POINT_RENAME(uprv_free)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  390|      0|    }
  391|       |
  392|  2.99k|    if (converter->sharedData->isReferenceCounted) {
  ------------------
  |  Branch (392:9): [True: 923, False: 2.07k]
  ------------------
  393|    923|        ucnv_unloadSharedDataIfReady(converter->sharedData);
  ------------------
  |  |  726|    923|#define ucnv_unloadSharedDataIfReady U_ICU_ENTRY_POINT_RENAME(ucnv_unloadSharedDataIfReady)
  |  |  ------------------
  |  |  |  |  123|    923|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|    923|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|    923|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  394|    923|    }
  395|       |
  396|  2.99k|    if(!converter->isCopyLocal){
  ------------------
  |  Branch (396:8): [True: 2.99k, False: 0]
  ------------------
  397|  2.99k|        uprv_free(converter);
  ------------------
  |  | 1503|  2.99k|#define uprv_free U_ICU_ENTRY_POINT_RENAME(uprv_free)
  |  |  ------------------
  |  |  |  |  123|  2.99k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  2.99k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  2.99k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  398|  2.99k|    }
  399|       |
  400|  2.99k|    UTRACE_EXIT();
  401|  2.99k|}
ucnv_toUnicode_78:
 1626|  2.50k|               UErrorCode *err) {
 1627|  2.50k|    UConverterToUnicodeArgs args;
 1628|  2.50k|    const char *s;
 1629|  2.50k|    char16_t *t;
 1630|       |
 1631|       |    /* check parameters */
 1632|  2.50k|    if(err==nullptr || U_FAILURE(*err)) {
  ------------------
  |  Branch (1632:8): [True: 0, False: 2.50k]
  |  Branch (1632:24): [True: 0, False: 2.50k]
  ------------------
 1633|      0|        return;
 1634|      0|    }
 1635|       |
 1636|  2.50k|    if(cnv==nullptr || target==nullptr || source==nullptr) {
  ------------------
  |  Branch (1636:8): [True: 0, False: 2.50k]
  |  Branch (1636:24): [True: 0, False: 2.50k]
  |  Branch (1636:43): [True: 0, False: 2.50k]
  ------------------
 1637|      0|        *err=U_ILLEGAL_ARGUMENT_ERROR;
 1638|      0|        return;
 1639|      0|    }
 1640|       |
 1641|  2.50k|    s=*source;
 1642|  2.50k|    t=*target;
 1643|       |
 1644|  2.50k|    if ((const void *)U_MAX_PTR(targetLimit) == (const void *)targetLimit) {
  ------------------
  |  |  523|  2.50k|    ((void *)(((uintptr_t)(base)+0x7fffffffu) > (uintptr_t)(base) \
  |  |  ------------------
  |  |  |  Branch (523:15): [True: 2.50k, False: 0]
  |  |  ------------------
  |  |  524|  2.50k|        ? ((uintptr_t)(base)+0x7fffffffu) \
  |  |  525|  2.50k|        : (uintptr_t)-1))
  ------------------
  |  Branch (1644:9): [True: 0, False: 2.50k]
  ------------------
 1645|       |        /*
 1646|       |        Prevent code from going into an infinite loop in case we do hit this
 1647|       |        limit. The limit pointer is expected to be on a char16_t * boundary.
 1648|       |        This also prevents the next argument check from failing.
 1649|       |        */
 1650|      0|        targetLimit = (const char16_t *)(((const char *)targetLimit) - 1);
 1651|      0|    }
 1652|       |
 1653|       |    /*
 1654|       |     * All these conditions should never happen.
 1655|       |     *
 1656|       |     * 1) Make sure that the limits are >= to the address source or target
 1657|       |     *
 1658|       |     * 2) Make sure that the buffer sizes do not exceed the number range for
 1659|       |     * int32_t because some functions use the size (in units or bytes)
 1660|       |     * rather than comparing pointers, and because offsets are int32_t values.
 1661|       |     *
 1662|       |     * size_t is guaranteed to be unsigned and large enough for the job.
 1663|       |     *
 1664|       |     * Return with an error instead of adjusting the limits because we would
 1665|       |     * not be able to maintain the semantics that either the source must be
 1666|       |     * consumed or the target filled (unless an error occurs).
 1667|       |     * An adjustment would be sourceLimit=t+0x7fffffff; for example.
 1668|       |     *
 1669|       |     * 3) Make sure that the user didn't incorrectly cast a char16_t * pointer
 1670|       |     * to a char * pointer and provide an incomplete char16_t code unit.
 1671|       |     */
 1672|  2.50k|    if (sourceLimit<s || targetLimit<t ||
  ------------------
  |  Branch (1672:9): [True: 0, False: 2.50k]
  |  Branch (1672:26): [True: 0, False: 2.50k]
  ------------------
 1673|  2.50k|        ((size_t)(sourceLimit-s)>(size_t)0x7fffffff && sourceLimit>s) ||
  ------------------
  |  Branch (1673:10): [True: 0, False: 2.50k]
  |  Branch (1673:56): [True: 0, False: 0]
  ------------------
 1674|  2.50k|        ((size_t)(targetLimit-t)>(size_t)0x3fffffff && targetLimit>t) ||
  ------------------
  |  Branch (1674:10): [True: 0, False: 2.50k]
  |  Branch (1674:56): [True: 0, False: 0]
  ------------------
 1675|  2.50k|        (((const char *)targetLimit-(const char *)t) & 1) != 0
  ------------------
  |  Branch (1675:9): [True: 0, False: 2.50k]
  ------------------
 1676|  2.50k|    ) {
 1677|      0|        *err=U_ILLEGAL_ARGUMENT_ERROR;
 1678|      0|        return;
 1679|      0|    }
 1680|       |    
 1681|       |    /* output the target overflow buffer */
 1682|  2.50k|    if( cnv->UCharErrorBufferLength>0 &&
  ------------------
  |  Branch (1682:9): [True: 0, False: 2.50k]
  ------------------
 1683|  2.50k|        ucnv_outputOverflowToUnicode(cnv, target, targetLimit, &offsets, err)
  ------------------
  |  Branch (1683:9): [True: 0, False: 0]
  ------------------
 1684|  2.50k|    ) {
 1685|       |        /* U_BUFFER_OVERFLOW_ERROR */
 1686|      0|        return;
 1687|      0|    }
 1688|       |    /* *target may have moved, therefore stop using t */
 1689|       |
 1690|  2.50k|    if(!flush && s==sourceLimit && cnv->preToULength>=0) {
  ------------------
  |  Branch (1690:8): [True: 0, False: 2.50k]
  |  Branch (1690:18): [True: 0, False: 0]
  |  Branch (1690:36): [True: 0, False: 0]
  ------------------
 1691|       |        /* the overflow buffer is emptied and there is no new input: we are done */
 1692|      0|        return;
 1693|      0|    }
 1694|       |
 1695|       |    /*
 1696|       |     * Do not simply return with a buffer overflow error if
 1697|       |     * !flush && t==targetLimit
 1698|       |     * because it is possible that the source will not generate any output.
 1699|       |     * For example, the skip callback may be called;
 1700|       |     * it does not output anything.
 1701|       |     */
 1702|       |
 1703|       |    /* prepare the converter arguments */
 1704|  2.50k|    args.converter=cnv;
 1705|  2.50k|    args.flush=flush;
 1706|  2.50k|    args.offsets=offsets;
 1707|  2.50k|    args.source=s;
 1708|  2.50k|    args.sourceLimit=sourceLimit;
 1709|  2.50k|    args.target=*target;
 1710|  2.50k|    args.targetLimit=targetLimit;
 1711|  2.50k|    args.size=sizeof(args);
 1712|       |
 1713|  2.50k|    _toUnicodeWithCallback(&args, err);
 1714|       |
 1715|  2.50k|    *source=args.source;
 1716|  2.50k|    *target=args.target;
 1717|  2.50k|}
ucnv.cpp:_ZL6_resetP10UConverter21UConverterResetChoicea:
  569|  2.50k|                   UBool callCallback) {
  570|  2.50k|    if(converter == nullptr) {
  ------------------
  |  Branch (570:8): [True: 0, False: 2.50k]
  ------------------
  571|      0|        return;
  572|      0|    }
  573|       |
  574|  2.50k|    if(callCallback) {
  ------------------
  |  Branch (574:8): [True: 0, False: 2.50k]
  ------------------
  575|       |        /* first, notify the callback functions that the converter is reset */
  576|      0|        UErrorCode errorCode;
  577|       |
  578|      0|        if(choice<=UCNV_RESET_TO_UNICODE && converter->fromCharErrorBehaviour != UCNV_TO_U_DEFAULT_CALLBACK) {
  ------------------
  |  |  134|      0|#define UCNV_TO_U_DEFAULT_CALLBACK ((UConverterToUCallback) UCNV_TO_U_CALLBACK_SUBSTITUTE)
  |  |  ------------------
  |  |  |  |   78|      0|#define UCNV_TO_U_CALLBACK_SUBSTITUTE U_ICU_ENTRY_POINT_RENAME(UCNV_TO_U_CALLBACK_SUBSTITUTE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (578:12): [True: 0, False: 0]
  |  Branch (578:45): [True: 0, False: 0]
  ------------------
  579|      0|            UConverterToUnicodeArgs toUArgs = {
  580|      0|                sizeof(UConverterToUnicodeArgs),
  581|      0|                true,
  582|      0|                nullptr,
  583|      0|                nullptr,
  584|      0|                nullptr,
  585|      0|                nullptr,
  586|      0|                nullptr,
  587|      0|                nullptr
  588|      0|            };
  589|      0|            toUArgs.converter = converter;
  590|      0|            errorCode = U_ZERO_ERROR;
  591|      0|            converter->fromCharErrorBehaviour(converter->toUContext, &toUArgs, nullptr, 0, UCNV_RESET, &errorCode);
  592|      0|        }
  593|      0|        if(choice!=UCNV_RESET_TO_UNICODE && converter->fromUCharErrorBehaviour != UCNV_FROM_U_DEFAULT_CALLBACK) {
  ------------------
  |  |  135|      0|#define UCNV_FROM_U_DEFAULT_CALLBACK ((UConverterFromUCallback) UCNV_FROM_U_CALLBACK_SUBSTITUTE)
  |  |  ------------------
  |  |  |  |   74|      0|#define UCNV_FROM_U_CALLBACK_SUBSTITUTE U_ICU_ENTRY_POINT_RENAME(UCNV_FROM_U_CALLBACK_SUBSTITUTE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (593:12): [True: 0, False: 0]
  |  Branch (593:45): [True: 0, False: 0]
  ------------------
  594|      0|            UConverterFromUnicodeArgs fromUArgs = {
  595|      0|                sizeof(UConverterFromUnicodeArgs),
  596|      0|                true,
  597|      0|                nullptr,
  598|      0|                nullptr,
  599|      0|                nullptr,
  600|      0|                nullptr,
  601|      0|                nullptr,
  602|      0|                nullptr
  603|      0|            };
  604|      0|            fromUArgs.converter = converter;
  605|      0|            errorCode = U_ZERO_ERROR;
  606|      0|            converter->fromUCharErrorBehaviour(converter->fromUContext, &fromUArgs, nullptr, 0, 0, UCNV_RESET, &errorCode);
  607|      0|        }
  608|      0|    }
  609|       |
  610|       |    /* now reset the converter itself */
  611|  2.50k|    if(choice<=UCNV_RESET_TO_UNICODE) {
  ------------------
  |  Branch (611:8): [True: 2.50k, False: 0]
  ------------------
  612|  2.50k|        converter->toUnicodeStatus = converter->sharedData->toUnicodeStatus;
  613|  2.50k|        converter->mode = 0;
  614|  2.50k|        converter->toULength = 0;
  615|  2.50k|        converter->invalidCharLength = converter->UCharErrorBufferLength = 0;
  616|  2.50k|        converter->preToULength = 0;
  617|  2.50k|    }
  618|  2.50k|    if(choice!=UCNV_RESET_TO_UNICODE) {
  ------------------
  |  Branch (618:8): [True: 0, False: 2.50k]
  ------------------
  619|      0|        converter->fromUnicodeStatus = 0;
  620|      0|        converter->fromUChar32 = 0;
  621|      0|        converter->invalidUCharLength = converter->charErrorBufferLength = 0;
  622|      0|        converter->preFromUFirstCP = U_SENTINEL;
  ------------------
  |  |  469|      0|#define U_SENTINEL (-1)
  ------------------
  623|      0|        converter->preFromULength = 0;
  624|      0|    }
  625|       |
  626|  2.50k|    if (converter->sharedData->impl->reset != nullptr) {
  ------------------
  |  Branch (626:9): [True: 1.80k, False: 704]
  ------------------
  627|       |        /* call the custom reset function */
  628|  1.80k|        converter->sharedData->impl->reset(converter, choice);
  629|  1.80k|    }
  630|  2.50k|}
ucnv.cpp:_ZL22_toUnicodeWithCallbackP23UConverterToUnicodeArgsP10UErrorCode:
 1276|  2.50k|_toUnicodeWithCallback(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
 1277|  2.50k|    UConverterToUnicode toUnicode;
 1278|  2.50k|    UConverter *cnv;
 1279|  2.50k|    const char *s;
 1280|  2.50k|    char16_t *t;
 1281|  2.50k|    int32_t *offsets;
 1282|  2.50k|    int32_t sourceIndex;
 1283|  2.50k|    int32_t errorInputLength;
 1284|  2.50k|    UBool converterSawEndOfInput, calledCallback;
 1285|       |
 1286|       |    /* variables for m:n conversion */
 1287|  2.50k|    char replay[UCNV_EXT_MAX_BYTES];
 1288|  2.50k|    const char *realSource, *realSourceLimit;
 1289|  2.50k|    int32_t realSourceIndex;
 1290|  2.50k|    UBool realFlush;
 1291|       |
 1292|  2.50k|    cnv=pArgs->converter;
 1293|  2.50k|    s=pArgs->source;
 1294|  2.50k|    t=pArgs->target;
 1295|  2.50k|    offsets=pArgs->offsets;
 1296|       |
 1297|       |    /* get the converter implementation function */
 1298|  2.50k|    sourceIndex=0;
 1299|  2.50k|    if(offsets==nullptr) {
  ------------------
  |  Branch (1299:8): [True: 2.50k, False: 0]
  ------------------
 1300|  2.50k|        toUnicode=cnv->sharedData->impl->toUnicode;
 1301|  2.50k|    } else {
 1302|      0|        toUnicode=cnv->sharedData->impl->toUnicodeWithOffsets;
 1303|      0|        if(toUnicode==nullptr) {
  ------------------
  |  Branch (1303:12): [True: 0, False: 0]
  ------------------
 1304|       |            /* there is no WithOffsets implementation */
 1305|      0|            toUnicode=cnv->sharedData->impl->toUnicode;
 1306|       |            /* we will write -1 for each offset */
 1307|      0|            sourceIndex=-1;
 1308|      0|        }
 1309|      0|    }
 1310|       |
 1311|  2.50k|    if(cnv->preToULength>=0) {
  ------------------
  |  Branch (1311:8): [True: 2.50k, False: 0]
  ------------------
 1312|       |        /* normal mode */
 1313|  2.50k|        realSource=nullptr;
 1314|       |
 1315|       |        /* avoid compiler warnings - not otherwise necessary, and the values do not matter */
 1316|  2.50k|        realSourceLimit=nullptr;
 1317|  2.50k|        realFlush=false;
 1318|  2.50k|        realSourceIndex=0;
 1319|  2.50k|    } else {
 1320|       |        /*
 1321|       |         * Previous m:n conversion stored source units from a partial match
 1322|       |         * and failed to consume all of them.
 1323|       |         * We need to "replay" them from a temporary buffer and convert them first.
 1324|       |         */
 1325|      0|        realSource=pArgs->source;
 1326|      0|        realSourceLimit=pArgs->sourceLimit;
 1327|      0|        realFlush=pArgs->flush;
 1328|      0|        realSourceIndex=sourceIndex;
 1329|       |
 1330|      0|        uprv_memcpy(replay, cnv->preToU, -cnv->preToULength);
  ------------------
  |  |   42|      0|#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|      0|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  |   43|      0|    /* Suppress warnings about addresses that will never be NULL */ \
  |  |   44|      0|    _Pragma("clang diagnostic push") \
  |  |   45|      0|    _Pragma("clang diagnostic ignored \"-Waddress\"") \
  |  |   46|      0|    U_ASSERT(dst != NULL); \
  |  |  ------------------
  |  |  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   47|      0|    U_ASSERT(src != NULL); \
  |  |  ------------------
  |  |  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   48|      0|    _Pragma("clang diagnostic pop") \
  |  |   49|      0|    U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  |  |   50|      0|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|      0|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1331|      0|        pArgs->source=replay;
 1332|      0|        pArgs->sourceLimit=replay-cnv->preToULength;
 1333|      0|        pArgs->flush=false;
 1334|      0|        sourceIndex=-1;
 1335|       |
 1336|      0|        cnv->preToULength=0;
 1337|      0|    }
 1338|       |
 1339|       |    /*
 1340|       |     * loop for conversion and error handling
 1341|       |     *
 1342|       |     * loop {
 1343|       |     *   convert
 1344|       |     *   loop {
 1345|       |     *     update offsets
 1346|       |     *     handle end of input
 1347|       |     *     handle errors/call callback
 1348|       |     *   }
 1349|       |     * }
 1350|       |     */
 1351|  4.93M|    for(;;) {
 1352|  4.93M|        if(U_SUCCESS(*err)) {
  ------------------
  |  Branch (1352:12): [True: 4.93M, False: 0]
  ------------------
 1353|       |            /* convert */
 1354|  4.93M|            toUnicode(pArgs, err);
 1355|       |
 1356|       |            /*
 1357|       |             * set a flag for whether the converter
 1358|       |             * successfully processed the end of the input
 1359|       |             *
 1360|       |             * need not check cnv->preToULength==0 because a replay (<0) will cause
 1361|       |             * s<sourceLimit before converterSawEndOfInput is checked
 1362|       |             */
 1363|  4.93M|            converterSawEndOfInput=
 1364|  4.93M|                static_cast<UBool>(U_SUCCESS(*err) &&
  ------------------
  |  Branch (1364:36): [True: 2.98k, False: 4.93M]
  ------------------
 1365|  4.93M|                        pArgs->flush && pArgs->source==pArgs->sourceLimit &&
  ------------------
  |  Branch (1365:25): [True: 2.98k, False: 0]
  |  Branch (1365:41): [True: 2.98k, False: 0]
  ------------------
 1366|  4.93M|                        cnv->toULength==0);
  ------------------
  |  Branch (1366:25): [True: 2.50k, False: 481]
  ------------------
 1367|  4.93M|        } else {
 1368|       |            /* handle error from getNextUChar() or ucnv_convertEx() */
 1369|      0|            converterSawEndOfInput=false;
 1370|      0|        }
 1371|       |
 1372|       |        /* no callback called yet for this iteration */
 1373|  4.93M|        calledCallback=false;
 1374|       |
 1375|       |        /* no sourceIndex adjustment for conversion, only for callback output */
 1376|  4.93M|        errorInputLength=0;
 1377|       |
 1378|       |        /*
 1379|       |         * loop for offsets and error handling
 1380|       |         *
 1381|       |         * iterates at most 3 times:
 1382|       |         * 1. to clean up after the conversion function
 1383|       |         * 2. after the callback
 1384|       |         * 3. after the callback again if there was truncated input
 1385|       |         */
 1386|  9.86M|        for(;;) {
 1387|       |            /* update offsets if we write any */
 1388|  9.86M|            if(offsets!=nullptr) {
  ------------------
  |  Branch (1388:16): [True: 0, False: 9.86M]
  ------------------
 1389|      0|                int32_t length = static_cast<int32_t>(pArgs->target - t);
 1390|      0|                if(length>0) {
  ------------------
  |  Branch (1390:20): [True: 0, False: 0]
  ------------------
 1391|      0|                    _updateOffsets(offsets, length, sourceIndex, errorInputLength);
 1392|       |
 1393|       |                    /*
 1394|       |                     * if a converter handles offsets and updates the offsets
 1395|       |                     * pointer at the end, then pArgs->offset should not change
 1396|       |                     * here;
 1397|       |                     * however, some converters do not handle offsets at all
 1398|       |                     * (sourceIndex<0) or may not update the offsets pointer
 1399|       |                     */
 1400|      0|                    pArgs->offsets=offsets+=length;
 1401|      0|                }
 1402|       |
 1403|      0|                if(sourceIndex>=0) {
  ------------------
  |  Branch (1403:20): [True: 0, False: 0]
  ------------------
 1404|      0|                    sourceIndex += static_cast<int32_t>(pArgs->source - s);
 1405|      0|                }
 1406|      0|            }
 1407|       |
 1408|  9.86M|            if(cnv->preToULength<0) {
  ------------------
  |  Branch (1408:16): [True: 0, False: 9.86M]
  ------------------
 1409|       |                /*
 1410|       |                 * switch the source to new replay units (cannot occur while replaying)
 1411|       |                 * after offset handling and before end-of-input and callback handling
 1412|       |                 */
 1413|      0|                if(realSource==nullptr) {
  ------------------
  |  Branch (1413:20): [True: 0, False: 0]
  ------------------
 1414|      0|                    realSource=pArgs->source;
 1415|      0|                    realSourceLimit=pArgs->sourceLimit;
 1416|      0|                    realFlush=pArgs->flush;
 1417|      0|                    realSourceIndex=sourceIndex;
 1418|       |
 1419|      0|                    uprv_memcpy(replay, cnv->preToU, -cnv->preToULength);
  ------------------
  |  |   42|      0|#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|      0|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  |   43|      0|    /* Suppress warnings about addresses that will never be NULL */ \
  |  |   44|      0|    _Pragma("clang diagnostic push") \
  |  |   45|      0|    _Pragma("clang diagnostic ignored \"-Waddress\"") \
  |  |   46|      0|    U_ASSERT(dst != NULL); \
  |  |  ------------------
  |  |  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   47|      0|    U_ASSERT(src != NULL); \
  |  |  ------------------
  |  |  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   48|      0|    _Pragma("clang diagnostic pop") \
  |  |   49|      0|    U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  |  |   50|      0|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|      0|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1420|      0|                    pArgs->source=replay;
 1421|      0|                    pArgs->sourceLimit=replay-cnv->preToULength;
 1422|      0|                    pArgs->flush=false;
 1423|      0|                    if((sourceIndex+=cnv->preToULength)<0) {
  ------------------
  |  Branch (1423:24): [True: 0, False: 0]
  ------------------
 1424|      0|                        sourceIndex=-1;
 1425|      0|                    }
 1426|       |
 1427|      0|                    cnv->preToULength=0;
 1428|      0|                } else {
 1429|       |                    /* see implementation note before _fromUnicodeWithCallback() */
 1430|      0|                    U_ASSERT(realSource==nullptr);
  ------------------
  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  ------------------
 1431|      0|                    *err=U_INTERNAL_PROGRAM_ERROR;
 1432|      0|                }
 1433|      0|            }
 1434|       |
 1435|       |            /* update pointers */
 1436|  9.86M|            s=pArgs->source;
 1437|  9.86M|            t=pArgs->target;
 1438|       |
 1439|  9.86M|            if(U_SUCCESS(*err)) {
  ------------------
  |  Branch (1439:16): [True: 4.93M, False: 4.93M]
  ------------------
 1440|  4.93M|                if(s<pArgs->sourceLimit) {
  ------------------
  |  Branch (1440:20): [True: 4.93M, False: 4.20k]
  ------------------
 1441|       |                    /*
 1442|       |                     * continue with the conversion loop while there is still input left
 1443|       |                     * (continue converting by breaking out of only the inner loop)
 1444|       |                     */
 1445|  4.93M|                    break;
 1446|  4.93M|                } else if(realSource!=nullptr) {
  ------------------
  |  Branch (1446:27): [True: 0, False: 4.20k]
  ------------------
 1447|       |                    /* switch back from replaying to the real source and continue */
 1448|      0|                    pArgs->source=realSource;
 1449|      0|                    pArgs->sourceLimit=realSourceLimit;
 1450|      0|                    pArgs->flush=realFlush;
 1451|      0|                    sourceIndex=realSourceIndex;
 1452|       |
 1453|      0|                    realSource=nullptr;
 1454|      0|                    break;
 1455|  4.20k|                } else if(pArgs->flush && cnv->toULength>0) {
  ------------------
  |  Branch (1455:27): [True: 4.20k, False: 0]
  |  Branch (1455:43): [True: 481, False: 3.71k]
  ------------------
 1456|       |                    /*
 1457|       |                     * the entire input stream is consumed
 1458|       |                     * and there is a partial, truncated input sequence left
 1459|       |                     */
 1460|       |
 1461|       |                    /* inject an error and continue with callback handling */
 1462|    481|                    *err=U_TRUNCATED_CHAR_FOUND;
 1463|    481|                    calledCallback=false; /* new error condition */
 1464|  3.71k|                } else {
 1465|       |                    /* input consumed */
 1466|  3.71k|                    if(pArgs->flush) {
  ------------------
  |  Branch (1466:24): [True: 3.71k, False: 0]
  ------------------
 1467|       |                        /*
 1468|       |                         * return to the conversion loop once more if the flush
 1469|       |                         * flag is set and the conversion function has not
 1470|       |                         * successfully processed the end of the input yet
 1471|       |                         *
 1472|       |                         * (continue converting by breaking out of only the inner loop)
 1473|       |                         */
 1474|  3.71k|                        if(!converterSawEndOfInput) {
  ------------------
  |  Branch (1474:28): [True: 1.21k, False: 2.50k]
  ------------------
 1475|  1.21k|                            break;
 1476|  1.21k|                        }
 1477|       |
 1478|       |                        /* reset the converter without calling the callback function */
 1479|  2.50k|                        _reset(cnv, UCNV_RESET_TO_UNICODE, false);
 1480|  2.50k|                    }
 1481|       |
 1482|       |                    /* done successfully */
 1483|  2.50k|                    return;
 1484|  3.71k|                }
 1485|  4.93M|            }
 1486|       |
 1487|       |            /* U_FAILURE(*err) */
 1488|  4.93M|            {
 1489|  4.93M|                UErrorCode e;
 1490|       |
 1491|  4.93M|                if( calledCallback ||
  ------------------
  |  Branch (1491:21): [True: 0, False: 4.93M]
  ------------------
 1492|  4.93M|                    (e=*err)==U_BUFFER_OVERFLOW_ERROR ||
  ------------------
  |  Branch (1492:21): [True: 0, False: 4.93M]
  ------------------
 1493|  4.93M|                    (e!=U_INVALID_CHAR_FOUND &&
  ------------------
  |  Branch (1493:22): [True: 3.63M, False: 1.29M]
  ------------------
 1494|  4.93M|                     e!=U_ILLEGAL_CHAR_FOUND &&
  ------------------
  |  Branch (1494:22): [True: 64.6k, False: 3.57M]
  ------------------
 1495|  4.93M|                     e!=U_TRUNCATED_CHAR_FOUND &&
  ------------------
  |  Branch (1495:22): [True: 64.1k, False: 481]
  ------------------
 1496|  4.93M|                     e!=U_ILLEGAL_ESCAPE_SEQUENCE &&
  ------------------
  |  Branch (1496:22): [True: 23.0k, False: 41.1k]
  ------------------
 1497|  4.93M|                     e!=U_UNSUPPORTED_ESCAPE_SEQUENCE)
  ------------------
  |  Branch (1497:22): [True: 0, False: 23.0k]
  ------------------
 1498|  4.93M|                ) {
 1499|       |                    /*
 1500|       |                     * the callback did not or cannot resolve the error:
 1501|       |                     * set output pointers and return
 1502|       |                     *
 1503|       |                     * the check for buffer overflow is redundant but it is
 1504|       |                     * a high-runner case and hopefully documents the intent
 1505|       |                     * well
 1506|       |                     *
 1507|       |                     * if we were replaying, then the replay buffer must be
 1508|       |                     * copied back into the UConverter
 1509|       |                     * and the real arguments must be restored
 1510|       |                     */
 1511|      0|                    if(realSource!=nullptr) {
  ------------------
  |  Branch (1511:24): [True: 0, False: 0]
  ------------------
 1512|      0|                        int32_t length;
 1513|       |
 1514|      0|                        U_ASSERT(cnv->preToULength==0);
  ------------------
  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  ------------------
 1515|       |
 1516|      0|                        length = static_cast<int32_t>(pArgs->sourceLimit - pArgs->source);
 1517|      0|                        if(length>0) {
  ------------------
  |  Branch (1517:28): [True: 0, False: 0]
  ------------------
 1518|      0|                            uprv_memcpy(cnv->preToU, pArgs->source, length);
  ------------------
  |  |   42|      0|#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|      0|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  |   43|      0|    /* Suppress warnings about addresses that will never be NULL */ \
  |  |   44|      0|    _Pragma("clang diagnostic push") \
  |  |   45|      0|    _Pragma("clang diagnostic ignored \"-Waddress\"") \
  |  |   46|      0|    U_ASSERT(dst != NULL); \
  |  |  ------------------
  |  |  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   47|      0|    U_ASSERT(src != NULL); \
  |  |  ------------------
  |  |  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   48|      0|    _Pragma("clang diagnostic pop") \
  |  |   49|      0|    U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  |  |   50|      0|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|      0|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1519|      0|                            cnv->preToULength = static_cast<int8_t>(-length);
 1520|      0|                        }
 1521|       |
 1522|      0|                        pArgs->source=realSource;
 1523|      0|                        pArgs->sourceLimit=realSourceLimit;
 1524|      0|                        pArgs->flush=realFlush;
 1525|      0|                    }
 1526|       |
 1527|      0|                    return;
 1528|      0|                }
 1529|  4.93M|            }
 1530|       |
 1531|       |            /* copy toUBytes[] to invalidCharBuffer[] */
 1532|  4.93M|            errorInputLength=cnv->invalidCharLength=cnv->toULength;
 1533|  4.93M|            if(errorInputLength>0) {
  ------------------
  |  Branch (1533:16): [True: 4.93M, False: 0]
  ------------------
 1534|  4.93M|                uprv_memcpy(cnv->invalidCharBuffer, cnv->toUBytes, errorInputLength);
  ------------------
  |  |   42|  4.93M|#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|  4.93M|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  |   43|  4.93M|    /* Suppress warnings about addresses that will never be NULL */ \
  |  |   44|  4.93M|    _Pragma("clang diagnostic push") \
  |  |   45|  4.93M|    _Pragma("clang diagnostic ignored \"-Waddress\"") \
  |  |   46|  4.93M|    U_ASSERT(dst != NULL); \
  |  |  ------------------
  |  |  |  |   35|  4.93M|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   47|  4.93M|    U_ASSERT(src != NULL); \
  |  |  ------------------
  |  |  |  |   35|  4.93M|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   48|  4.93M|    _Pragma("clang diagnostic pop") \
  |  |   49|  4.93M|    U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
  |  |  ------------------
  |  |  |  |  393|  4.93M|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  |  |   50|  4.93M|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|  4.93M|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1535|  4.93M|            }
 1536|       |
 1537|       |            /* set the converter state to deal with the next character */
 1538|  4.93M|            cnv->toULength=0;
 1539|       |
 1540|       |            /* call the callback function */
 1541|  4.93M|            if(cnv->toUCallbackReason==UCNV_ILLEGAL && *err==U_INVALID_CHAR_FOUND) {
  ------------------
  |  Branch (1541:16): [True: 4.90M, False: 25.8k]
  |  Branch (1541:56): [True: 1.29M, False: 3.61M]
  ------------------
 1542|  1.29M|                cnv->toUCallbackReason = UCNV_UNASSIGNED;
 1543|  1.29M|            }
 1544|  4.93M|            cnv->fromCharErrorBehaviour(cnv->toUContext, pArgs,
 1545|  4.93M|                cnv->invalidCharBuffer, errorInputLength,
 1546|  4.93M|                cnv->toUCallbackReason,
 1547|  4.93M|                err);
 1548|  4.93M|            cnv->toUCallbackReason = UCNV_ILLEGAL; /* reset to default value */
 1549|       |
 1550|       |            /*
 1551|       |             * loop back to the offset handling
 1552|       |             *
 1553|       |             * this flag will indicate after offset handling
 1554|       |             * that a callback was called;
 1555|       |             * if the callback did not resolve the error, then we return
 1556|       |             */
 1557|  4.93M|            calledCallback=true;
 1558|  4.93M|        }
 1559|  4.93M|    }
 1560|  2.50k|}

ucnv2022.cpp:_ZL12_ISO2022OpenP10UConverterP18UConverterLoadArgsP10UErrorCode:
  479|  1.04k|_ISO2022Open(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorCode){
  480|       |
  481|  1.04k|    char myLocale[7]={' ',' ',' ',' ',' ',' ', '\0'};
  482|       |
  483|  1.04k|    cnv->extraInfo = uprv_malloc (sizeof (UConverterDataISO2022));
  ------------------
  |  | 1524|  1.04k|#define uprv_malloc U_ICU_ENTRY_POINT_RENAME(uprv_malloc)
  |  |  ------------------
  |  |  |  |  123|  1.04k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  1.04k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  1.04k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  484|  1.04k|    if(cnv->extraInfo != nullptr) {
  ------------------
  |  Branch (484:8): [True: 1.04k, False: 0]
  ------------------
  485|  1.04k|        UConverterNamePieces stackPieces;
  486|  1.04k|        UConverterLoadArgs stackArgs=UCNV_LOAD_ARGS_INITIALIZER;
  ------------------
  |  |   62|  1.04k|    { (int32_t)sizeof(UConverterLoadArgs), 0, false, false, 0, 0, NULL, NULL, NULL }
  ------------------
  487|  1.04k|        UConverterDataISO2022* myConverterData = static_cast<UConverterDataISO2022*>(cnv->extraInfo);
  488|  1.04k|        uint32_t version;
  489|       |
  490|  1.04k|        stackArgs.onlyTestIsLoadable = pArgs->onlyTestIsLoadable;
  491|       |
  492|  1.04k|        uprv_memset(myConverterData, 0, sizeof(UConverterDataISO2022));
  ------------------
  |  |  100|  1.04k|#define uprv_memset(buffer, mark, size) U_STANDARD_CPP_NAMESPACE memset(buffer, mark, size)
  |  |  ------------------
  |  |  |  |  393|  1.04k|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  493|  1.04k|        myConverterData->currentType = ASCII1;
  494|  1.04k|        cnv->fromUnicodeStatus =false;
  495|  1.04k|        if(pArgs->locale){
  ------------------
  |  Branch (495:12): [True: 1.04k, False: 0]
  ------------------
  496|  1.04k|            uprv_strncpy(myLocale, pArgs->locale, sizeof(myLocale)-1);
  ------------------
  |  |   43|  1.04k|#define uprv_strncpy(dst, src, size) U_STANDARD_CPP_NAMESPACE strncpy(dst, src, size)
  |  |  ------------------
  |  |  |  |  393|  1.04k|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  497|  1.04k|        }
  498|  1.04k|        version = pArgs->options & UCNV_OPTIONS_VERSION_MASK;
  ------------------
  |  |  206|  1.04k|#define UCNV_OPTIONS_VERSION_MASK 0xf
  ------------------
  499|  1.04k|        myConverterData->version = version;
  500|  1.04k|        if(myLocale[0]=='j' && (myLocale[1]=='a'|| myLocale[1]=='p') &&
  ------------------
  |  Branch (500:12): [True: 431, False: 614]
  |  Branch (500:33): [True: 431, False: 0]
  |  Branch (500:52): [True: 0, False: 0]
  ------------------
  501|  1.04k|            (myLocale[2]=='_' || myLocale[2]=='\0'))
  ------------------
  |  Branch (501:14): [True: 0, False: 431]
  |  Branch (501:34): [True: 431, False: 0]
  ------------------
  502|    431|        {
  503|       |            /* open the required converters and cache them */
  504|    431|            if(version>MAX_JA_VERSION) {
  ------------------
  |  Branch (504:16): [True: 0, False: 431]
  ------------------
  505|       |                // ICU 55 fails to open a converter for an unsupported version.
  506|       |                // Previously, it fell back to version 0, but that would yield
  507|       |                // unexpected behavior.
  508|      0|                *errorCode = U_MISSING_RESOURCE_ERROR;
  509|      0|                return;
  510|      0|            }
  511|    431|            if(jpCharsetMasks[version]&CSM(ISO8859_7)) {
  ------------------
  |  |  165|    431|#define CSM(cs) ((uint16_t)1<<(cs))
  ------------------
  |  Branch (511:16): [True: 0, False: 431]
  ------------------
  512|      0|                myConverterData->myConverterArray[ISO8859_7] =
  513|      0|                    ucnv_loadSharedData("ISO8859_7", &stackPieces, &stackArgs, errorCode);
  ------------------
  |  |  700|      0|#define ucnv_loadSharedData U_ICU_ENTRY_POINT_RENAME(ucnv_loadSharedData)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  514|      0|            }
  515|    431|            myConverterData->myConverterArray[JISX208] =
  516|    431|                ucnv_loadSharedData("Shift-JIS", &stackPieces, &stackArgs, errorCode);
  ------------------
  |  |  700|    431|#define ucnv_loadSharedData U_ICU_ENTRY_POINT_RENAME(ucnv_loadSharedData)
  |  |  ------------------
  |  |  |  |  123|    431|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|    431|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|    431|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  517|    431|            if(jpCharsetMasks[version]&CSM(JISX212)) {
  ------------------
  |  |  165|    431|#define CSM(cs) ((uint16_t)1<<(cs))
  ------------------
  |  Branch (517:16): [True: 0, False: 431]
  ------------------
  518|      0|                myConverterData->myConverterArray[JISX212] =
  519|      0|                    ucnv_loadSharedData("jisx-212", &stackPieces, &stackArgs, errorCode);
  ------------------
  |  |  700|      0|#define ucnv_loadSharedData U_ICU_ENTRY_POINT_RENAME(ucnv_loadSharedData)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  520|      0|            }
  521|    431|            if(jpCharsetMasks[version]&CSM(GB2312)) {
  ------------------
  |  |  165|    431|#define CSM(cs) ((uint16_t)1<<(cs))
  ------------------
  |  Branch (521:16): [True: 0, False: 431]
  ------------------
  522|      0|                myConverterData->myConverterArray[GB2312] =
  523|      0|                    ucnv_loadSharedData("ibm-5478", &stackPieces, &stackArgs, errorCode);   /* gb_2312_80-1 */
  ------------------
  |  |  700|      0|#define ucnv_loadSharedData U_ICU_ENTRY_POINT_RENAME(ucnv_loadSharedData)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  524|      0|            }
  525|    431|            if(jpCharsetMasks[version]&CSM(KSC5601)) {
  ------------------
  |  |  165|    431|#define CSM(cs) ((uint16_t)1<<(cs))
  ------------------
  |  Branch (525:16): [True: 0, False: 431]
  ------------------
  526|      0|                myConverterData->myConverterArray[KSC5601] =
  527|      0|                    ucnv_loadSharedData("ksc_5601", &stackPieces, &stackArgs, errorCode);
  ------------------
  |  |  700|      0|#define ucnv_loadSharedData U_ICU_ENTRY_POINT_RENAME(ucnv_loadSharedData)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  528|      0|            }
  529|       |
  530|       |            /* set the function pointers to appropriate functions */
  531|    431|            cnv->sharedData = const_cast<UConverterSharedData*>(&_ISO2022JPData);
  532|    431|            uprv_strcpy(myConverterData->locale,"ja");
  ------------------
  |  |   36|    431|#define uprv_strcpy(dst, src) U_STANDARD_CPP_NAMESPACE  strcpy(dst, src)
  |  |  ------------------
  |  |  |  |  393|    431|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  533|       |
  534|    431|            (void)uprv_strcpy(myConverterData->name,"ISO_2022,locale=ja,version=");
  ------------------
  |  |   36|    431|#define uprv_strcpy(dst, src) U_STANDARD_CPP_NAMESPACE  strcpy(dst, src)
  |  |  ------------------
  |  |  |  |  393|    431|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  535|    431|            size_t len = uprv_strlen(myConverterData->name);
  ------------------
  |  |   37|    431|#define uprv_strlen(str) U_STANDARD_CPP_NAMESPACE strlen(str)
  |  |  ------------------
  |  |  |  |  393|    431|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  536|    431|            myConverterData->name[len] = static_cast<char>(myConverterData->version + static_cast<int>('0'));
  537|    431|            myConverterData->name[len+1]='\0';
  538|    431|        }
  539|    614|#if !UCONFIG_ONLY_HTML_CONVERSION
  540|    614|        else if(myLocale[0]=='k' && (myLocale[1]=='o'|| myLocale[1]=='r') &&
  ------------------
  |  Branch (540:17): [True: 243, False: 371]
  |  Branch (540:38): [True: 243, False: 0]
  |  Branch (540:57): [True: 0, False: 0]
  ------------------
  541|    614|            (myLocale[2]=='_' || myLocale[2]=='\0'))
  ------------------
  |  Branch (541:14): [True: 0, False: 243]
  |  Branch (541:34): [True: 243, False: 0]
  ------------------
  542|    243|        {
  543|    243|            if(version>1) {
  ------------------
  |  Branch (543:16): [True: 0, False: 243]
  ------------------
  544|       |                // ICU 55 fails to open a converter for an unsupported version.
  545|       |                // Previously, it fell back to version 0, but that would yield
  546|       |                // unexpected behavior.
  547|      0|                *errorCode = U_MISSING_RESOURCE_ERROR;
  548|      0|                return;
  549|      0|            }
  550|    243|            const char *cnvName;
  551|    243|            if(version==1) {
  ------------------
  |  Branch (551:16): [True: 0, False: 243]
  ------------------
  552|      0|                cnvName="icu-internal-25546";
  553|    243|            } else {
  554|    243|                cnvName="ibm-949";
  555|    243|                myConverterData->version=version=0;
  556|    243|            }
  557|    243|            if(pArgs->onlyTestIsLoadable) {
  ------------------
  |  Branch (557:16): [True: 0, False: 243]
  ------------------
  558|      0|                ucnv_canCreateConverter(cnvName, errorCode);  /* errorCode carries result */
  ------------------
  |  |  632|      0|#define ucnv_canCreateConverter U_ICU_ENTRY_POINT_RENAME(ucnv_canCreateConverter)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  559|      0|                uprv_free(cnv->extraInfo);
  ------------------
  |  | 1503|      0|#define uprv_free U_ICU_ENTRY_POINT_RENAME(uprv_free)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  560|      0|                cnv->extraInfo=nullptr;
  561|      0|                return;
  562|    243|            } else {
  563|    243|                myConverterData->currentConverter=ucnv_open(cnvName, errorCode);
  ------------------
  |  |  701|    243|#define ucnv_open U_ICU_ENTRY_POINT_RENAME(ucnv_open)
  |  |  ------------------
  |  |  |  |  123|    243|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|    243|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|    243|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  564|    243|                if (U_FAILURE(*errorCode)) {
  ------------------
  |  Branch (564:21): [True: 0, False: 243]
  ------------------
  565|      0|                    _ISO2022Close(cnv);
  566|      0|                    return;
  567|      0|                }
  568|       |
  569|    243|                if(version==1) {
  ------------------
  |  Branch (569:20): [True: 0, False: 243]
  ------------------
  570|      0|                    (void)uprv_strcpy(myConverterData->name,"ISO_2022,locale=ko,version=1");
  ------------------
  |  |   36|      0|#define uprv_strcpy(dst, src) U_STANDARD_CPP_NAMESPACE  strcpy(dst, src)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  571|      0|                    uprv_memcpy(cnv->subChars, myConverterData->currentConverter->subChars, 4);
  ------------------
  |  |   42|      0|#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|      0|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  |   43|      0|    /* Suppress warnings about addresses that will never be NULL */ \
  |  |   44|      0|    _Pragma("clang diagnostic push") \
  |  |   45|      0|    _Pragma("clang diagnostic ignored \"-Waddress\"") \
  |  |   46|      0|    U_ASSERT(dst != NULL); \
  |  |  ------------------
  |  |  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   47|      0|    U_ASSERT(src != NULL); \
  |  |  ------------------
  |  |  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   48|      0|    _Pragma("clang diagnostic pop") \
  |  |   49|      0|    U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  |  |   50|      0|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|      0|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  572|      0|                    cnv->subCharLen = myConverterData->currentConverter->subCharLen;
  573|    243|                }else{
  574|    243|                    (void)uprv_strcpy(myConverterData->name,"ISO_2022,locale=ko,version=0");
  ------------------
  |  |   36|    243|#define uprv_strcpy(dst, src) U_STANDARD_CPP_NAMESPACE  strcpy(dst, src)
  |  |  ------------------
  |  |  |  |  393|    243|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  575|    243|                }
  576|       |
  577|       |                /* initialize the state variables */
  578|    243|                setInitialStateToUnicodeKR(cnv, myConverterData);
  579|    243|                setInitialStateFromUnicodeKR(cnv, myConverterData);
  580|       |
  581|       |                /* set the function pointers to appropriate functions */
  582|    243|                cnv->sharedData = const_cast<UConverterSharedData*>(&_ISO2022KRData);
  583|    243|                uprv_strcpy(myConverterData->locale,"ko");
  ------------------
  |  |   36|    243|#define uprv_strcpy(dst, src) U_STANDARD_CPP_NAMESPACE  strcpy(dst, src)
  |  |  ------------------
  |  |  |  |  393|    243|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  584|    243|            }
  585|    243|        }
  586|    371|        else if(((myLocale[0]=='z' && myLocale[1]=='h') || (myLocale[0]=='c'&& myLocale[1]=='n'))&&
  ------------------
  |  Branch (586:19): [True: 371, False: 0]
  |  Branch (586:39): [True: 371, False: 0]
  |  Branch (586:61): [True: 0, False: 0]
  |  Branch (586:80): [True: 0, False: 0]
  ------------------
  587|    371|            (myLocale[2]=='_' || myLocale[2]=='\0'))
  ------------------
  |  Branch (587:14): [True: 0, False: 371]
  |  Branch (587:34): [True: 371, False: 0]
  ------------------
  588|    371|        {
  589|    371|            if(version>2) {
  ------------------
  |  Branch (589:16): [True: 0, False: 371]
  ------------------
  590|       |                // ICU 55 fails to open a converter for an unsupported version.
  591|       |                // Previously, it fell back to version 0, but that would yield
  592|       |                // unexpected behavior.
  593|      0|                *errorCode = U_MISSING_RESOURCE_ERROR;
  594|      0|                return;
  595|      0|            }
  596|       |
  597|       |            /* open the required converters and cache them */
  598|    371|            myConverterData->myConverterArray[GB2312_1] =
  599|    371|                ucnv_loadSharedData("ibm-5478", &stackPieces, &stackArgs, errorCode);
  ------------------
  |  |  700|    371|#define ucnv_loadSharedData U_ICU_ENTRY_POINT_RENAME(ucnv_loadSharedData)
  |  |  ------------------
  |  |  |  |  123|    371|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|    371|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|    371|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  600|    371|            if(version==1) {
  ------------------
  |  Branch (600:16): [True: 263, False: 108]
  ------------------
  601|    263|                myConverterData->myConverterArray[ISO_IR_165] =
  602|    263|                    ucnv_loadSharedData("iso-ir-165", &stackPieces, &stackArgs, errorCode);
  ------------------
  |  |  700|    263|#define ucnv_loadSharedData U_ICU_ENTRY_POINT_RENAME(ucnv_loadSharedData)
  |  |  ------------------
  |  |  |  |  123|    263|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|    263|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|    263|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  603|    263|            }
  604|    371|            myConverterData->myConverterArray[CNS_11643] =
  605|    371|                ucnv_loadSharedData("cns-11643-1992", &stackPieces, &stackArgs, errorCode);
  ------------------
  |  |  700|    371|#define ucnv_loadSharedData U_ICU_ENTRY_POINT_RENAME(ucnv_loadSharedData)
  |  |  ------------------
  |  |  |  |  123|    371|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|    371|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|    371|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  606|       |
  607|       |
  608|       |            /* set the function pointers to appropriate functions */
  609|    371|            cnv->sharedData = const_cast<UConverterSharedData*>(&_ISO2022CNData);
  610|    371|            uprv_strcpy(myConverterData->locale,"cn");
  ------------------
  |  |   36|    371|#define uprv_strcpy(dst, src) U_STANDARD_CPP_NAMESPACE  strcpy(dst, src)
  |  |  ------------------
  |  |  |  |  393|    371|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  611|       |
  612|    371|            if (version==0){
  ------------------
  |  Branch (612:17): [True: 108, False: 263]
  ------------------
  613|    108|                myConverterData->version = 0;
  614|    108|                (void)uprv_strcpy(myConverterData->name,"ISO_2022,locale=zh,version=0");
  ------------------
  |  |   36|    108|#define uprv_strcpy(dst, src) U_STANDARD_CPP_NAMESPACE  strcpy(dst, src)
  |  |  ------------------
  |  |  |  |  393|    108|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  615|    263|            }else if (version==1){
  ------------------
  |  Branch (615:23): [True: 263, False: 0]
  ------------------
  616|    263|                myConverterData->version = 1;
  617|    263|                (void)uprv_strcpy(myConverterData->name,"ISO_2022,locale=zh,version=1");
  ------------------
  |  |   36|    263|#define uprv_strcpy(dst, src) U_STANDARD_CPP_NAMESPACE  strcpy(dst, src)
  |  |  ------------------
  |  |  |  |  393|    263|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  618|    263|            }else {
  619|      0|                myConverterData->version = 2;
  620|      0|                (void)uprv_strcpy(myConverterData->name,"ISO_2022,locale=zh,version=2");
  ------------------
  |  |   36|      0|#define uprv_strcpy(dst, src) U_STANDARD_CPP_NAMESPACE  strcpy(dst, src)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  621|      0|            }
  622|    371|        }
  623|      0|#endif  // !UCONFIG_ONLY_HTML_CONVERSION
  624|      0|        else{
  625|       |#ifdef U_ENABLE_GENERIC_ISO_2022
  626|       |            myConverterData->isFirstBuffer = true;
  627|       |
  628|       |            /* append the UTF-8 escape sequence */
  629|       |            cnv->charErrorBufferLength = 3;
  630|       |            cnv->charErrorBuffer[0] = 0x1b;
  631|       |            cnv->charErrorBuffer[1] = 0x25;
  632|       |            cnv->charErrorBuffer[2] = 0x42;
  633|       |
  634|       |            cnv->sharedData=(UConverterSharedData*)&_ISO2022Data;
  635|       |            /* initialize the state variables */
  636|       |            uprv_strcpy(myConverterData->name,"ISO_2022");
  637|       |#else
  638|      0|            *errorCode = U_MISSING_RESOURCE_ERROR;
  639|       |            // Was U_UNSUPPORTED_ERROR but changed in ICU 55 to a more standard
  640|       |            // data loading error code.
  641|      0|            return;
  642|      0|#endif
  643|      0|        }
  644|       |
  645|  1.04k|        cnv->maxBytesPerUChar=cnv->sharedData->staticData->maxBytesPerChar;
  646|       |
  647|  1.04k|        if(U_FAILURE(*errorCode) || pArgs->onlyTestIsLoadable) {
  ------------------
  |  Branch (647:12): [True: 0, False: 1.04k]
  |  Branch (647:37): [True: 0, False: 1.04k]
  ------------------
  648|      0|            _ISO2022Close(cnv);
  649|      0|        }
  650|  1.04k|    } else {
  651|      0|        *errorCode = U_MEMORY_ALLOCATION_ERROR;
  652|      0|    }
  653|  1.04k|}
ucnv2022.cpp:_ZL46UConverter_toUnicode_ISO_2022_JP_OFFSETS_LOGICP23UConverterToUnicodeArgsP10UErrorCode:
 2082|   484k|                                               UErrorCode* err){
 2083|   484k|    char tempBuf[2];
 2084|   484k|    const char* mySource = const_cast<char*>(args->source);
 2085|   484k|    char16_t *myTarget = args->target;
 2086|   484k|    const char *mySourceLimit = args->sourceLimit;
 2087|   484k|    uint32_t targetUniChar = 0x0000;
 2088|   484k|    uint32_t mySourceChar = 0x0000;
 2089|   484k|    uint32_t tmpSourceChar = 0x0000;
 2090|   484k|    UConverterDataISO2022* myData;
 2091|   484k|    ISO2022State *pToU2022State;
 2092|   484k|    StateEnum cs;
 2093|       |
 2094|   484k|    myData = static_cast<UConverterDataISO2022*>(args->converter->extraInfo);
 2095|   484k|    pToU2022State = &myData->toU2022State;
 2096|       |
 2097|   484k|    if(myData->key != 0) {
  ------------------
  |  Branch (2097:8): [True: 25, False: 484k]
  ------------------
 2098|       |        /* continue with a partial escape sequence */
 2099|     25|        goto escape;
 2100|   484k|    } else if(args->converter->toULength == 1 && mySource < mySourceLimit && myTarget < args->targetLimit) {
  ------------------
  |  Branch (2100:15): [True: 0, False: 484k]
  |  Branch (2100:50): [True: 0, False: 0]
  |  Branch (2100:78): [True: 0, False: 0]
  ------------------
 2101|       |        /* continue with a partial double-byte character */
 2102|      0|        mySourceChar = args->converter->toUBytes[0];
 2103|      0|        args->converter->toULength = 0;
 2104|      0|        cs = static_cast<StateEnum>(pToU2022State->cs[pToU2022State->g]);
 2105|      0|        targetUniChar = missingCharMarker;
  ------------------
  |  |   34|      0|#define missingCharMarker 0xFFFF
  ------------------
 2106|      0|        goto getTrailByte;
 2107|      0|    }
 2108|       |
 2109|  1.04M|    while(mySource < mySourceLimit){
  ------------------
  |  Branch (2109:11): [True: 1.04M, False: 456]
  ------------------
 2110|       |
 2111|  1.04M|        targetUniChar =missingCharMarker;
  ------------------
  |  |   34|  1.04M|#define missingCharMarker 0xFFFF
  ------------------
 2112|       |
 2113|  1.04M|        if(myTarget < args->targetLimit){
  ------------------
  |  Branch (2113:12): [True: 1.04M, False: 0]
  ------------------
 2114|       |
 2115|  1.04M|            mySourceChar = static_cast<unsigned char>(*mySource++);
 2116|       |
 2117|  1.04M|            switch(mySourceChar) {
 2118|  2.14k|            case UCNV_SI:
  ------------------
  |  |   84|  2.14k|#define  UCNV_SI 0x0F
  ------------------
  |  Branch (2118:13): [True: 2.14k, False: 1.04M]
  ------------------
 2119|  2.14k|                if(myData->version==3) {
  ------------------
  |  Branch (2119:20): [True: 0, False: 2.14k]
  ------------------
 2120|      0|                    pToU2022State->g=0;
 2121|      0|                    continue;
 2122|  2.14k|                } else {
 2123|       |                    /* only JIS7 uses SI/SO, not ISO-2022-JP-x */
 2124|  2.14k|                    myData->isEmptySegment = false;	/* reset this, we have a different error */
 2125|  2.14k|                    break;
 2126|  2.14k|                }
 2127|       |
 2128|  6.65k|            case UCNV_SO:
  ------------------
  |  |   86|  6.65k|#define  UCNV_SO 0x0E
  ------------------
  |  Branch (2128:13): [True: 6.65k, False: 1.03M]
  ------------------
 2129|  6.65k|                if(myData->version==3) {
  ------------------
  |  Branch (2129:20): [True: 0, False: 6.65k]
  ------------------
 2130|       |                    /* JIS7: switch to G1 half-width Katakana */
 2131|      0|                    pToU2022State->cs[1] = static_cast<int8_t>(HWKANA_7BIT);
 2132|      0|                    pToU2022State->g=1;
 2133|      0|                    continue;
 2134|  6.65k|                } else {
 2135|       |                    /* only JIS7 uses SI/SO, not ISO-2022-JP-x */
 2136|  6.65k|                    myData->isEmptySegment = false;	/* reset this, we have a different error */
 2137|  6.65k|                    break;
 2138|  6.65k|                }
 2139|       |
 2140|  23.9k|            case ESC_2022:
  ------------------
  |  |  235|  23.9k|#define ESC_2022 0x1B /*ESC*/
  ------------------
  |  Branch (2140:13): [True: 23.9k, False: 1.01M]
  ------------------
 2141|  23.9k|                mySource--;
 2142|  23.9k|escape:
 2143|  23.9k|                {
 2144|  23.9k|                    const char * mySourceBefore = mySource;
 2145|  23.9k|                    int8_t toULengthBefore = args->converter->toULength;
 2146|       |
 2147|  23.9k|                    changeState_2022(args->converter,&(mySource),
 2148|  23.9k|                        mySourceLimit, ISO_2022_JP,err);
 2149|       |
 2150|       |                    /* If in ISO-2022-JP only and we successfully completed an escape sequence, but previous segment was empty, create an error */
 2151|  23.9k|                    if(myData->version==0 && myData->key==0 && U_SUCCESS(*err) && myData->isEmptySegment) {
  ------------------
  |  Branch (2151:24): [True: 23.9k, False: 0]
  |  Branch (2151:46): [True: 23.8k, False: 50]
  |  Branch (2151:64): [True: 3.57k, False: 20.3k]
  |  Branch (2151:83): [True: 651, False: 2.92k]
  ------------------
 2152|    651|                        *err = U_ILLEGAL_ESCAPE_SEQUENCE;
 2153|    651|                        args->converter->toUCallbackReason = UCNV_IRREGULAR;
 2154|    651|                        args->converter->toULength = static_cast<int8_t>(toULengthBefore + (mySource - mySourceBefore));
 2155|    651|                    }
 2156|  23.9k|                }
 2157|       |
 2158|       |                /* invalid or illegal escape sequence */
 2159|  23.9k|                if(U_FAILURE(*err)){
  ------------------
  |  Branch (2159:20): [True: 20.9k, False: 2.97k]
  ------------------
 2160|  20.9k|                    args->target = myTarget;
 2161|  20.9k|                    args->source = mySource;
 2162|  20.9k|                    myData->isEmptySegment = false;	/* Reset to avoid future spurious errors */
 2163|  20.9k|                    return;
 2164|  20.9k|                }
 2165|       |                /* If we successfully completed an escape sequence, we begin a new segment, empty so far */
 2166|  2.97k|                if(myData->key==0) {
  ------------------
  |  Branch (2166:20): [True: 2.92k, False: 50]
  ------------------
 2167|  2.92k|                    myData->isEmptySegment = true;
 2168|  2.92k|                }
 2169|  2.97k|                continue;
 2170|       |
 2171|       |            /* ISO-2022-JP does not use single-byte (C1) SS2 and SS3 */
 2172|       |
 2173|  1.86k|            case CR:
  ------------------
  |  |   85|  1.86k|#define CR      0x0D
  ------------------
  |  Branch (2173:13): [True: 1.86k, False: 1.04M]
  ------------------
 2174|  4.99k|            case LF:
  ------------------
  |  |   86|  4.99k|#define LF      0x0A
  ------------------
  |  Branch (2174:13): [True: 3.12k, False: 1.03M]
  ------------------
 2175|       |                /* automatically reset to single-byte mode */
 2176|  4.99k|                if (static_cast<StateEnum>(pToU2022State->cs[0]) != ASCII &&
  ------------------
  |  Branch (2176:21): [True: 1.50k, False: 3.48k]
  ------------------
 2177|  4.99k|                    static_cast<StateEnum>(pToU2022State->cs[0]) != JISX201) {
  ------------------
  |  Branch (2177:21): [True: 747, False: 760]
  ------------------
 2178|    747|                    pToU2022State->cs[0] = static_cast<int8_t>(ASCII);
 2179|    747|                }
 2180|  4.99k|                pToU2022State->cs[2] = 0;
 2181|  4.99k|                pToU2022State->g = 0;
 2182|  4.99k|                U_FALLTHROUGH;
  ------------------
  |  |  511|  4.99k|#       define U_FALLTHROUGH [[clang::fallthrough]]
  ------------------
 2183|  1.00M|            default:
  ------------------
  |  Branch (2183:13): [True: 1.00M, False: 37.7k]
  ------------------
 2184|       |                /* convert one or two bytes */
 2185|  1.00M|                myData->isEmptySegment = false;
 2186|  1.00M|                cs = static_cast<StateEnum>(pToU2022State->cs[pToU2022State->g]);
 2187|  1.00M|                if (static_cast<uint8_t>(mySourceChar - 0xa1) <= (0xdf - 0xa1) && myData->version == 4 &&
  ------------------
  |  Branch (2187:21): [True: 147k, False: 862k]
  |  Branch (2187:83): [True: 0, False: 147k]
  ------------------
 2188|  1.00M|                    !IS_JP_DBCS(cs)
  ------------------
  |  |  162|      0|#define IS_JP_DBCS(cs) (JISX208<=(cs) && (cs)<=KSC5601)
  |  |  ------------------
  |  |  |  Branch (162:25): [True: 0, False: 0]
  |  |  |  Branch (162:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2189|  1.00M|                ) {
 2190|       |                    /* 8-bit halfwidth katakana in any single-byte mode for JIS8 */
 2191|      0|                    targetUniChar = mySourceChar + (HWKANA_START - 0xa1);
 2192|       |
 2193|       |                    /* return from a single-shift state to the previous one */
 2194|      0|                    if(pToU2022State->g >= 2) {
  ------------------
  |  Branch (2194:24): [True: 0, False: 0]
  ------------------
 2195|      0|                        pToU2022State->g=pToU2022State->prevG;
 2196|      0|                    }
 2197|  1.00M|                } else switch(cs) {
 2198|   478k|                case ASCII:
  ------------------
  |  Branch (2198:17): [True: 478k, False: 530k]
  ------------------
 2199|   478k|                    if(mySourceChar <= 0x7f) {
  ------------------
  |  Branch (2199:24): [True: 309k, False: 169k]
  ------------------
 2200|   309k|                        targetUniChar = mySourceChar;
 2201|   309k|                    }
 2202|   478k|                    break;
 2203|      0|                case ISO8859_1:
  ------------------
  |  Branch (2203:17): [True: 0, False: 1.00M]
  ------------------
 2204|      0|                    if(mySourceChar <= 0x7f) {
  ------------------
  |  Branch (2204:24): [True: 0, False: 0]
  ------------------
 2205|      0|                        targetUniChar = mySourceChar + 0x80;
 2206|      0|                    }
 2207|       |                    /* return from a single-shift state to the previous one */
 2208|      0|                    pToU2022State->g=pToU2022State->prevG;
 2209|      0|                    break;
 2210|      0|                case ISO8859_7:
  ------------------
  |  Branch (2210:17): [True: 0, False: 1.00M]
  ------------------
 2211|      0|                    if(mySourceChar <= 0x7f) {
  ------------------
  |  Branch (2211:24): [True: 0, False: 0]
  ------------------
 2212|       |                        /* convert mySourceChar+0x80 to use a normal 8-bit table */
 2213|      0|                        targetUniChar =
 2214|      0|                            _MBCS_SINGLE_SIMPLE_GET_NEXT_BMP(
  ------------------
  |  |  516|      0|    (UChar)MBCS_ENTRY_FINAL_VALUE_16((sharedData)->mbcs.stateTable[0][(uint8_t)(b)])
  |  |  ------------------
  |  |  |  |  294|      0|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  |  |  ------------------
  ------------------
 2215|      0|                                myData->myConverterArray[cs],
 2216|      0|                                mySourceChar + 0x80);
 2217|      0|                    }
 2218|       |                    /* return from a single-shift state to the previous one */
 2219|      0|                    pToU2022State->g=pToU2022State->prevG;
 2220|      0|                    break;
 2221|   252k|                case JISX201:
  ------------------
  |  Branch (2221:17): [True: 252k, False: 757k]
  ------------------
 2222|   252k|                    if(mySourceChar <= 0x7f) {
  ------------------
  |  Branch (2222:24): [True: 167k, False: 85.4k]
  ------------------
 2223|   167k|                        targetUniChar = jisx201ToU(mySourceChar);
 2224|   167k|                    }
 2225|   252k|                    break;
 2226|  54.4k|                case HWKANA_7BIT:
  ------------------
  |  Branch (2226:17): [True: 54.4k, False: 955k]
  ------------------
 2227|  54.4k|                    if (static_cast<uint8_t>(mySourceChar - 0x21) <= (0x5f - 0x21)) {
  ------------------
  |  Branch (2227:25): [True: 8.56k, False: 45.8k]
  ------------------
 2228|       |                        /* 7-bit halfwidth Katakana */
 2229|  8.56k|                        targetUniChar = mySourceChar + (HWKANA_START - 0x21);
 2230|  8.56k|                    }
 2231|  54.4k|                    break;
 2232|   223k|                default:
  ------------------
  |  Branch (2232:17): [True: 223k, False: 785k]
  ------------------
 2233|       |                    /* G0 DBCS */
 2234|   223k|                    if(mySource < mySourceLimit) {
  ------------------
  |  Branch (2234:24): [True: 223k, False: 13]
  ------------------
 2235|   223k|                        int leadIsOk, trailIsOk;
 2236|   223k|                        uint8_t trailByte;
 2237|   223k|getTrailByte:
 2238|   223k|                        trailByte = static_cast<uint8_t>(*mySource);
 2239|       |                        /*
 2240|       |                         * Ticket 5691: consistent illegal sequences:
 2241|       |                         * - We include at least the first byte in the illegal sequence.
 2242|       |                         * - If any of the non-initial bytes could be the start of a character,
 2243|       |                         *   we stop the illegal sequence before the first one of those.
 2244|       |                         *
 2245|       |                         * In ISO-2022 DBCS, if the second byte is in the 21..7e range or is
 2246|       |                         * an ESC/SO/SI, we report only the first byte as the illegal sequence.
 2247|       |                         * Otherwise we convert or report the pair of bytes.
 2248|       |                         */
 2249|   223k|                        leadIsOk = static_cast<uint8_t>(mySourceChar - 0x21) <= (0x7e - 0x21);
 2250|   223k|                        trailIsOk = static_cast<uint8_t>(trailByte - 0x21) <= (0x7e - 0x21);
 2251|   223k|                        if (leadIsOk && trailIsOk) {
  ------------------
  |  Branch (2251:29): [True: 93.0k, False: 130k]
  |  Branch (2251:41): [True: 77.2k, False: 15.8k]
  ------------------
 2252|  77.2k|                            ++mySource;
 2253|  77.2k|                            tmpSourceChar = (mySourceChar << 8) | trailByte;
 2254|  77.2k|                            if(cs == JISX208) {
  ------------------
  |  Branch (2254:32): [True: 77.2k, False: 0]
  ------------------
 2255|  77.2k|                                _2022ToSJIS(static_cast<uint8_t>(mySourceChar), trailByte, tempBuf);
 2256|  77.2k|                                mySourceChar = tmpSourceChar;
 2257|  77.2k|                            } else {
 2258|       |                                /* Copy before we modify tmpSourceChar so toUnicodeCallback() sees the correct bytes. */
 2259|      0|                                mySourceChar = tmpSourceChar;
 2260|      0|                                if (cs == KSC5601) {
  ------------------
  |  Branch (2260:37): [True: 0, False: 0]
  ------------------
 2261|      0|                                    tmpSourceChar += 0x8080;  /* = _2022ToGR94DBCS(tmpSourceChar) */
 2262|      0|                                }
 2263|      0|                                tempBuf[0] = static_cast<char>(tmpSourceChar >> 8);
 2264|      0|                                tempBuf[1] = static_cast<char>(tmpSourceChar);
 2265|      0|                            }
 2266|  77.2k|                            targetUniChar = ucnv_MBCSSimpleGetNextUChar(myData->myConverterArray[cs], tempBuf, 2, false);
  ------------------
  |  |  628|  77.2k|#define ucnv_MBCSSimpleGetNextUChar U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSSimpleGetNextUChar)
  |  |  ------------------
  |  |  |  |  123|  77.2k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  77.2k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  77.2k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2267|   146k|                        } else if (!(trailIsOk || IS_2022_CONTROL(trailByte))) {
  ------------------
  |  |  117|   138k|#define IS_2022_CONTROL(c) (((c)<0x20) && (((uint32_t)1<<(c))&0x0800c000)!=0)
  |  |  ------------------
  |  |  |  Branch (117:29): [True: 59.7k, False: 78.8k]
  |  |  |  Branch (117:43): [True: 4.02k, False: 55.7k]
  |  |  ------------------
  ------------------
  |  Branch (2267:38): [True: 8.01k, False: 138k]
  ------------------
 2268|       |                            /* report a pair of illegal bytes if the second byte is not a DBCS starter */
 2269|   134k|                            ++mySource;
 2270|       |                            /* add another bit so that the code below writes 2 bytes in case of error */
 2271|   134k|                            mySourceChar = 0x10000 | (mySourceChar << 8) | trailByte;
 2272|   134k|                        }
 2273|   223k|                    } else {
 2274|     13|                        args->converter->toUBytes[0] = static_cast<uint8_t>(mySourceChar);
 2275|     13|                        args->converter->toULength = 1;
 2276|     13|                        goto endloop;
 2277|     13|                    }
 2278|  1.00M|                }  /* End of inner switch */
 2279|  1.00M|                break;
 2280|  1.04M|            }  /* End of outer switch */
 2281|  1.01M|            if(targetUniChar < (missingCharMarker-1/*0xfffe*/)){
  ------------------
  |  |   34|  1.01M|#define missingCharMarker 0xFFFF
  ------------------
  |  Branch (2281:16): [True: 555k, False: 463k]
  ------------------
 2282|   555k|                if(args->offsets){
  ------------------
  |  Branch (2282:20): [True: 0, False: 555k]
  ------------------
 2283|      0|                    args->offsets[myTarget - args->target] = static_cast<int32_t>(mySource - args->source - (mySourceChar <= 0xff ? 1 : 2));
  ------------------
  |  Branch (2283:110): [True: 0, False: 0]
  ------------------
 2284|      0|                }
 2285|   555k|                *(myTarget++) = static_cast<char16_t>(targetUniChar);
 2286|   555k|            }
 2287|   463k|            else if(targetUniChar > missingCharMarker){
  ------------------
  |  |   34|   463k|#define missingCharMarker 0xFFFF
  ------------------
  |  Branch (2287:21): [True: 0, False: 463k]
  ------------------
 2288|       |                /* disassemble the surrogate pair and write to output*/
 2289|      0|                targetUniChar-=0x0010000;
 2290|      0|                *myTarget = static_cast<char16_t>(0xd800 + static_cast<char16_t>(targetUniChar >> 10));
 2291|      0|                if(args->offsets){
  ------------------
  |  Branch (2291:20): [True: 0, False: 0]
  ------------------
 2292|      0|                    args->offsets[myTarget - args->target] = static_cast<int32_t>(mySource - args->source - (mySourceChar <= 0xff ? 1 : 2));
  ------------------
  |  Branch (2292:110): [True: 0, False: 0]
  ------------------
 2293|      0|                }
 2294|      0|                ++myTarget;
 2295|      0|                if(myTarget< args->targetLimit){
  ------------------
  |  Branch (2295:20): [True: 0, False: 0]
  ------------------
 2296|      0|                    *myTarget = static_cast<char16_t>(0xdc00 + static_cast<char16_t>(targetUniChar & 0x3ff));
 2297|      0|                    if(args->offsets){
  ------------------
  |  Branch (2297:24): [True: 0, False: 0]
  ------------------
 2298|      0|                        args->offsets[myTarget - args->target] = static_cast<int32_t>(mySource - args->source - (mySourceChar <= 0xff ? 1 : 2));
  ------------------
  |  Branch (2298:114): [True: 0, False: 0]
  ------------------
 2299|      0|                    }
 2300|      0|                    ++myTarget;
 2301|      0|                }else{
 2302|      0|                    args->converter->UCharErrorBuffer[args->converter->UCharErrorBufferLength++]=
 2303|      0|                                    static_cast<char16_t>(0xdc00 + static_cast<char16_t>(targetUniChar & 0x3ff));
 2304|      0|                }
 2305|       |
 2306|      0|            }
 2307|   463k|            else{
 2308|       |                /* Call the callback function*/
 2309|   463k|                toUnicodeCallback(args->converter,mySourceChar,targetUniChar,err);
 2310|   463k|                break;
 2311|   463k|            }
 2312|  1.01M|        }
 2313|      0|        else{    /* goes with "if(myTarget < args->targetLimit)"  way up near top of function */
 2314|      0|            *err =U_BUFFER_OVERFLOW_ERROR;
 2315|      0|            break;
 2316|      0|        }
 2317|  1.04M|    }
 2318|   464k|endloop:
 2319|   464k|    args->target = myTarget;
 2320|   464k|    args->source = mySource;
 2321|   464k|}
ucnv2022.cpp:_ZL16changeState_2022P10UConverterPPKcS2_11Variant2022P10UErrorCode:
  830|  71.1k|                UErrorCode* err){
  831|  71.1k|    UCNV_TableStates_2022 value;
  832|  71.1k|    UConverterDataISO2022* myData2022 = static_cast<UConverterDataISO2022*>(_this->extraInfo);
  833|  71.1k|    uint32_t key = myData2022->key;
  834|  71.1k|    int32_t offset = 0;
  835|  71.1k|    int8_t initialToULength = _this->toULength;
  836|  71.1k|    char c;
  837|       |
  838|  71.1k|    value = VALID_NON_TERMINAL_2022;
  839|   189k|    while (*source < sourceLimit) {
  ------------------
  |  Branch (839:12): [True: 189k, False: 194]
  ------------------
  840|   189k|        c = *(*source)++;
  841|   189k|        _this->toUBytes[_this->toULength++] = static_cast<uint8_t>(c);
  842|   189k|        value = getKey_2022(c, reinterpret_cast<int32_t*>(&key), &offset);
  843|       |
  844|   189k|        switch (value){
  ------------------
  |  Branch (844:17): [True: 0, False: 189k]
  ------------------
  845|       |
  846|   118k|        case VALID_NON_TERMINAL_2022 :
  ------------------
  |  Branch (846:9): [True: 118k, False: 70.9k]
  ------------------
  847|       |            /* continue with the loop */
  848|   118k|            break;
  849|       |
  850|  46.6k|        case VALID_TERMINAL_2022:
  ------------------
  |  Branch (850:9): [True: 46.6k, False: 142k]
  ------------------
  851|  46.6k|            key = 0;
  852|  46.6k|            goto DONE;
  853|       |
  854|  23.3k|        case INVALID_2022:
  ------------------
  |  Branch (854:9): [True: 23.3k, False: 166k]
  ------------------
  855|  23.3k|            goto DONE;
  856|       |
  857|    921|        case VALID_MAYBE_TERMINAL_2022:
  ------------------
  |  Branch (857:9): [True: 921, False: 188k]
  ------------------
  858|       |#ifdef U_ENABLE_GENERIC_ISO_2022
  859|       |            /* ESC ( B is ambiguous only for ISO_2022 itself */
  860|       |            if(var == ISO_2022) {
  861|       |                /* discard toUBytes[] for ESC ( B because this sequence is correct and complete */
  862|       |                _this->toULength = 0;
  863|       |
  864|       |                /* TODO need to indicate that ESC ( B was seen; if failure, then need to replay from source or from MBCS-style replay */
  865|       |
  866|       |                /* continue with the loop */
  867|       |                value = VALID_NON_TERMINAL_2022;
  868|       |                break;
  869|       |            } else
  870|       |#endif
  871|    921|            {
  872|       |                /* not ISO_2022 itself, finish here */
  873|    921|                value = VALID_TERMINAL_2022;
  874|    921|                key = 0;
  875|    921|                goto DONE;
  876|      0|            }
  877|   189k|        }
  878|   189k|    }
  879|       |
  880|  71.1k|DONE:
  881|  71.1k|    myData2022->key = key;
  882|       |
  883|  71.1k|    if (value == VALID_NON_TERMINAL_2022) {
  ------------------
  |  Branch (883:9): [True: 194, False: 70.9k]
  ------------------
  884|       |        /* indicate that the escape sequence is incomplete: key!=0 */
  885|    194|        return;
  886|  70.9k|    } else if (value == INVALID_2022 ) {
  ------------------
  |  Branch (886:16): [True: 23.3k, False: 47.5k]
  ------------------
  887|  23.3k|        *err = U_ILLEGAL_ESCAPE_SEQUENCE;
  888|  47.5k|    } else /* value == VALID_TERMINAL_2022 */ {
  889|  47.5k|        switch(var){
  890|       |#ifdef U_ENABLE_GENERIC_ISO_2022
  891|       |        case ISO_2022:
  892|       |        {
  893|       |            const char *chosenConverterName = escSeqStateTable_Result_2022[offset];
  894|       |            if(chosenConverterName == nullptr) {
  895|       |                /* SS2 or SS3 */
  896|       |                *err = U_UNSUPPORTED_ESCAPE_SEQUENCE;
  897|       |                _this->toUCallbackReason = UCNV_UNASSIGNED;
  898|       |                return;
  899|       |            }
  900|       |
  901|       |            _this->mode = UCNV_SI;
  902|       |            ucnv_close(myData2022->currentConverter);
  903|       |            myData2022->currentConverter = myUConverter = ucnv_open(chosenConverterName, err);
  904|       |            if(U_SUCCESS(*err)) {
  905|       |                myUConverter->fromCharErrorBehaviour = UCNV_TO_U_CALLBACK_STOP;
  906|       |                _this->mode = UCNV_SO;
  907|       |            }
  908|       |            break;
  909|       |        }
  910|       |#endif
  911|  17.2k|        case ISO_2022_JP:
  ------------------
  |  Branch (911:9): [True: 17.2k, False: 30.3k]
  ------------------
  912|  17.2k|            {
  913|  17.2k|                StateEnum tempState = static_cast<StateEnum>(nextStateToUnicodeJP[offset]);
  914|  17.2k|                switch(tempState) {
  915|  6.02k|                case INVALID_STATE:
  ------------------
  |  Branch (915:17): [True: 6.02k, False: 11.1k]
  ------------------
  916|  6.02k|                    *err = U_UNSUPPORTED_ESCAPE_SEQUENCE;
  917|  6.02k|                    break;
  918|  6.64k|                case SS2_STATE:
  ------------------
  |  Branch (918:17): [True: 6.64k, False: 10.5k]
  ------------------
  919|  6.64k|                    if(myData2022->toU2022State.cs[2]!=0) {
  ------------------
  |  Branch (919:24): [True: 0, False: 6.64k]
  ------------------
  920|      0|                        if(myData2022->toU2022State.g<2) {
  ------------------
  |  Branch (920:28): [True: 0, False: 0]
  ------------------
  921|      0|                            myData2022->toU2022State.prevG=myData2022->toU2022State.g;
  922|      0|                        }
  923|      0|                        myData2022->toU2022State.g=2;
  924|  6.64k|                    } else {
  925|       |                        /* illegal to have SS2 before a matching designator */
  926|  6.64k|                        *err = U_ILLEGAL_ESCAPE_SEQUENCE;
  927|  6.64k|                    }
  928|  6.64k|                    break;
  929|       |                /* case SS3_STATE: not used in ISO-2022-JP-x */
  930|    444|                case ISO8859_1:
  ------------------
  |  Branch (930:17): [True: 444, False: 16.7k]
  ------------------
  931|    781|                case ISO8859_7:
  ------------------
  |  Branch (931:17): [True: 337, False: 16.8k]
  ------------------
  932|    781|                    if((jpCharsetMasks[myData2022->version] & CSM(tempState)) == 0) {
  ------------------
  |  |  165|    781|#define CSM(cs) ((uint16_t)1<<(cs))
  ------------------
  |  Branch (932:24): [True: 781, False: 0]
  ------------------
  933|    781|                        *err = U_UNSUPPORTED_ESCAPE_SEQUENCE;
  934|    781|                    } else {
  935|       |                        /* G2 charset for SS2 */
  936|      0|                        myData2022->toU2022State.cs[2] = static_cast<int8_t>(tempState);
  937|      0|                    }
  938|    781|                    break;
  939|  3.76k|                default:
  ------------------
  |  Branch (939:17): [True: 3.76k, False: 13.4k]
  ------------------
  940|  3.76k|                    if((jpCharsetMasks[myData2022->version] & CSM(tempState)) == 0) {
  ------------------
  |  |  165|  3.76k|#define CSM(cs) ((uint16_t)1<<(cs))
  ------------------
  |  Branch (940:24): [True: 194, False: 3.57k]
  ------------------
  941|    194|                        *err = U_UNSUPPORTED_ESCAPE_SEQUENCE;
  942|  3.57k|                    } else {
  943|       |                        /* G0 charset */
  944|  3.57k|                        myData2022->toU2022State.cs[0] = static_cast<int8_t>(tempState);
  945|  3.57k|                    }
  946|  3.76k|                    break;
  947|  17.2k|                }
  948|  17.2k|            }
  949|  17.2k|            break;
  950|  17.2k|#if !UCONFIG_ONLY_HTML_CONVERSION
  951|  19.4k|        case ISO_2022_CN:
  ------------------
  |  Branch (951:9): [True: 19.4k, False: 28.1k]
  ------------------
  952|  19.4k|            {
  953|  19.4k|                StateEnum tempState = static_cast<StateEnum>(nextStateToUnicodeCN[offset]);
  954|  19.4k|                switch(tempState) {
  955|  5.25k|                case INVALID_STATE:
  ------------------
  |  Branch (955:17): [True: 5.25k, False: 14.2k]
  ------------------
  956|  5.25k|                    *err = U_UNSUPPORTED_ESCAPE_SEQUENCE;
  957|  5.25k|                    break;
  958|  5.85k|                case SS2_STATE:
  ------------------
  |  Branch (958:17): [True: 5.85k, False: 13.6k]
  ------------------
  959|  5.85k|                    if(myData2022->toU2022State.cs[2]!=0) {
  ------------------
  |  Branch (959:24): [True: 2.52k, False: 3.33k]
  ------------------
  960|  2.52k|                        if(myData2022->toU2022State.g<2) {
  ------------------
  |  Branch (960:28): [True: 1.39k, False: 1.12k]
  ------------------
  961|  1.39k|                            myData2022->toU2022State.prevG=myData2022->toU2022State.g;
  962|  1.39k|                        }
  963|  2.52k|                        myData2022->toU2022State.g=2;
  964|  3.33k|                    } else {
  965|       |                        /* illegal to have SS2 before a matching designator */
  966|  3.33k|                        *err = U_ILLEGAL_ESCAPE_SEQUENCE;
  967|  3.33k|                    }
  968|  5.85k|                    break;
  969|  2.66k|                case SS3_STATE:
  ------------------
  |  Branch (969:17): [True: 2.66k, False: 16.8k]
  ------------------
  970|  2.66k|                    if(myData2022->toU2022State.cs[3]!=0) {
  ------------------
  |  Branch (970:24): [True: 1.00k, False: 1.66k]
  ------------------
  971|  1.00k|                        if(myData2022->toU2022State.g<2) {
  ------------------
  |  Branch (971:28): [True: 712, False: 291]
  ------------------
  972|    712|                            myData2022->toU2022State.prevG=myData2022->toU2022State.g;
  973|    712|                        }
  974|  1.00k|                        myData2022->toU2022State.g=3;
  975|  1.66k|                    } else {
  976|       |                        /* illegal to have SS3 before a matching designator */
  977|  1.66k|                        *err = U_ILLEGAL_ESCAPE_SEQUENCE;
  978|  1.66k|                    }
  979|  2.66k|                    break;
  980|    631|                case ISO_IR_165:
  ------------------
  |  Branch (980:17): [True: 631, False: 18.8k]
  ------------------
  981|    631|                    if(myData2022->version==0) {
  ------------------
  |  Branch (981:24): [True: 273, False: 358]
  ------------------
  982|    273|                        *err = U_UNSUPPORTED_ESCAPE_SEQUENCE;
  983|    273|                        break;
  984|    273|                    }
  985|    358|                    U_FALLTHROUGH;
  ------------------
  |  |  511|    358|#       define U_FALLTHROUGH [[clang::fallthrough]]
  ------------------
  986|  1.61k|                case GB2312_1:
  ------------------
  |  Branch (986:17): [True: 1.26k, False: 18.2k]
  ------------------
  987|  1.61k|                    U_FALLTHROUGH;
  ------------------
  |  |  511|  1.61k|#       define U_FALLTHROUGH [[clang::fallthrough]]
  ------------------
  988|  2.09k|                case CNS_11643_1:
  ------------------
  |  Branch (988:17): [True: 480, False: 19.0k]
  ------------------
  989|  2.09k|                    myData2022->toU2022State.cs[1] = static_cast<int8_t>(tempState);
  990|  2.09k|                    break;
  991|  2.37k|                case CNS_11643_2:
  ------------------
  |  Branch (991:17): [True: 2.37k, False: 17.1k]
  ------------------
  992|  2.37k|                    myData2022->toU2022State.cs[2] = static_cast<int8_t>(tempState);
  993|  2.37k|                    break;
  994|    964|                default:
  ------------------
  |  Branch (994:17): [True: 964, False: 18.5k]
  ------------------
  995|       |                    /* other CNS 11643 planes */
  996|    964|                    if(myData2022->version==0) {
  ------------------
  |  Branch (996:24): [True: 327, False: 637]
  ------------------
  997|    327|                        *err = U_UNSUPPORTED_ESCAPE_SEQUENCE;
  998|    637|                    } else {
  999|    637|                        myData2022->toU2022State.cs[3] = static_cast<int8_t>(tempState);
 1000|    637|                    }
 1001|    964|                    break;
 1002|  19.4k|                }
 1003|  19.4k|            }
 1004|  19.4k|            break;
 1005|  19.4k|        case ISO_2022_KR:
  ------------------
  |  Branch (1005:9): [True: 10.9k, False: 36.6k]
  ------------------
 1006|  10.9k|            if(offset==0x30){
  ------------------
  |  Branch (1006:16): [True: 702, False: 10.2k]
  ------------------
 1007|       |                /* nothing to be done, just accept this one escape sequence */
 1008|  10.2k|            } else {
 1009|  10.2k|                *err = U_UNSUPPORTED_ESCAPE_SEQUENCE;
 1010|  10.2k|            }
 1011|  10.9k|            break;
 1012|      0|#endif  // !UCONFIG_ONLY_HTML_CONVERSION
 1013|       |
 1014|      0|        default:
  ------------------
  |  Branch (1014:9): [True: 0, False: 47.5k]
  ------------------
 1015|      0|            *err = U_ILLEGAL_ESCAPE_SEQUENCE;
 1016|      0|            break;
 1017|  47.5k|        }
 1018|  47.5k|    }
 1019|  70.9k|    if(U_SUCCESS(*err)) {
  ------------------
  |  Branch (1019:8): [True: 12.9k, False: 58.0k]
  ------------------
 1020|  12.9k|        _this->toULength = 0;
 1021|  58.0k|    } else if(*err==U_ILLEGAL_ESCAPE_SEQUENCE) {
  ------------------
  |  Branch (1021:15): [True: 35.0k, False: 23.0k]
  ------------------
 1022|  35.0k|        if(_this->toULength>1) {
  ------------------
  |  Branch (1022:12): [True: 35.0k, False: 0]
  ------------------
 1023|       |            /*
 1024|       |             * Ticket 5691: consistent illegal sequences:
 1025|       |             * - We include at least the first byte (ESC) in the illegal sequence.
 1026|       |             * - If any of the non-initial bytes could be the start of a character,
 1027|       |             *   we stop the illegal sequence before the first one of those.
 1028|       |             *   In escape sequences, all following bytes are "printable", that is,
 1029|       |             *   unless they are completely illegal (>7f in SBCS, outside 21..7e in DBCS),
 1030|       |             *   they are valid single/lead bytes.
 1031|       |             *   For simplicity, we always only report the initial ESC byte as the
 1032|       |             *   illegal sequence and back out all other bytes we looked at.
 1033|       |             */
 1034|       |            /* Back out some bytes. */
 1035|  35.0k|            int8_t backOutDistance=_this->toULength-1;
 1036|  35.0k|            int8_t bytesFromThisBuffer=_this->toULength-initialToULength;
 1037|  35.0k|            if(backOutDistance<=bytesFromThisBuffer) {
  ------------------
  |  Branch (1037:16): [True: 35.0k, False: 0]
  ------------------
 1038|       |                /* same as initialToULength<=1 */
 1039|  35.0k|                *source-=backOutDistance;
 1040|  35.0k|            } else {
 1041|       |                /* Back out bytes from the previous buffer: Need to replay them. */
 1042|      0|                _this->preToULength = static_cast<int8_t>(bytesFromThisBuffer - backOutDistance);
 1043|       |                /* same as -(initialToULength-1) */
 1044|       |                /* preToULength is negative! */
 1045|      0|                uprv_memcpy(_this->preToU, _this->toUBytes+1, -_this->preToULength);
  ------------------
  |  |   42|      0|#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|      0|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  |   43|      0|    /* Suppress warnings about addresses that will never be NULL */ \
  |  |   44|      0|    _Pragma("clang diagnostic push") \
  |  |   45|      0|    _Pragma("clang diagnostic ignored \"-Waddress\"") \
  |  |   46|      0|    U_ASSERT(dst != NULL); \
  |  |  ------------------
  |  |  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   47|      0|    U_ASSERT(src != NULL); \
  |  |  ------------------
  |  |  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   48|      0|    _Pragma("clang diagnostic pop") \
  |  |   49|      0|    U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  |  |   50|      0|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|      0|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1046|      0|                *source-=bytesFromThisBuffer;
 1047|      0|            }
 1048|  35.0k|            _this->toULength=1;
 1049|  35.0k|        }
 1050|  35.0k|    } else if(*err==U_UNSUPPORTED_ESCAPE_SEQUENCE) {
  ------------------
  |  Branch (1050:15): [True: 23.0k, False: 0]
  ------------------
 1051|  23.0k|        _this->toUCallbackReason = UCNV_UNASSIGNED;
 1052|  23.0k|    }
 1053|  70.9k|}
ucnv2022.cpp:_ZL11getKey_2022cPiS_:
  781|   189k|getKey_2022(char c,int32_t* key,int32_t* offset){
  782|   189k|    int32_t togo;
  783|   189k|    int32_t low = 0;
  784|   189k|    int32_t hi = MAX_STATES_2022;
  ------------------
  |  |  332|   189k|#define MAX_STATES_2022 74
  ------------------
  785|   189k|    int32_t oldmid=0;
  786|       |
  787|   189k|    togo = normalize_esq_chars_2022[static_cast<uint8_t>(c)];
  788|   189k|    if(togo == 0) {
  ------------------
  |  Branch (788:8): [True: 17.8k, False: 171k]
  ------------------
  789|       |        /* not a valid character anywhere in an escape sequence */
  790|  17.8k|        *key = 0;
  791|  17.8k|        *offset = 0;
  792|  17.8k|        return INVALID_2022;
  793|  17.8k|    }
  794|   171k|    togo = (*key << 5) + togo;
  795|       |
  796|  1.06M|    while (hi != low)  /*binary search*/{
  ------------------
  |  Branch (796:12): [True: 1.06M, False: 0]
  ------------------
  797|       |
  798|  1.06M|        int32_t mid = (hi+low) >> 1; /*Finds median*/
  799|       |
  800|  1.06M|        if (mid == oldmid)
  ------------------
  |  Branch (800:13): [True: 5.56k, False: 1.05M]
  ------------------
  801|  5.56k|            break;
  802|       |
  803|  1.05M|        if (escSeqStateTable_Key_2022[mid] > togo){
  ------------------
  |  Branch (803:13): [True: 732k, False: 326k]
  ------------------
  804|   732k|            hi = mid;
  805|   732k|        }
  806|   326k|        else if (escSeqStateTable_Key_2022[mid] < togo){
  ------------------
  |  Branch (806:18): [True: 160k, False: 166k]
  ------------------
  807|   160k|            low = mid;
  808|   160k|        }
  809|   166k|        else /*we found it*/{
  810|   166k|            *key = togo;
  811|   166k|            *offset = mid;
  812|   166k|            return static_cast<UCNV_TableStates_2022>(escSeqStateTable_Value_2022[mid]);
  813|   166k|        }
  814|   892k|        oldmid = mid;
  815|       |
  816|   892k|    }
  817|       |
  818|  5.56k|    *key = 0;
  819|  5.56k|    *offset = 0;
  820|  5.56k|    return INVALID_2022;
  821|   171k|}
ucnv2022.cpp:_ZL10jisx201ToUj:
 1490|   167k|jisx201ToU(uint32_t value) {
 1491|   167k|    if(value < 0x5c) {
  ------------------
  |  Branch (1491:8): [True: 71.2k, False: 95.8k]
  ------------------
 1492|  71.2k|        return value;
 1493|  95.8k|    } else if(value == 0x5c) {
  ------------------
  |  Branch (1493:15): [True: 402, False: 95.4k]
  ------------------
 1494|    402|        return 0xa5;
 1495|  95.4k|    } else if(value == 0x7e) {
  ------------------
  |  Branch (1495:15): [True: 5.37k, False: 90.0k]
  ------------------
 1496|  5.37k|        return 0x203e;
 1497|  90.0k|    } else /* value <= 0x7f */ {
 1498|  90.0k|        return value;
 1499|  90.0k|    }
 1500|   167k|}
ucnv2022.cpp:_ZL11_2022ToSJIShhPc:
 1561|  77.2k|_2022ToSJIS(uint8_t c1, uint8_t c2, char bytes[2]) {
 1562|  77.2k|    if(c1&1) {
  ------------------
  |  Branch (1562:8): [True: 61.8k, False: 15.3k]
  ------------------
 1563|  61.8k|        ++c1;
 1564|  61.8k|        if(c2 <= 0x5f) {
  ------------------
  |  Branch (1564:12): [True: 9.35k, False: 52.5k]
  ------------------
 1565|  9.35k|            c2 += 0x1f;
 1566|  52.5k|        } else if(c2 <= 0x7e) {
  ------------------
  |  Branch (1566:19): [True: 52.5k, False: 0]
  ------------------
 1567|  52.5k|            c2 += 0x20;
 1568|  52.5k|        } else {
 1569|      0|            c2 = 0;  /* invalid */
 1570|      0|        }
 1571|  61.8k|    } else {
 1572|  15.3k|        if (static_cast<uint8_t>(c2 - 0x21) <= ((0x7e) - 0x21)) {
  ------------------
  |  Branch (1572:13): [True: 15.3k, False: 0]
  ------------------
 1573|  15.3k|            c2 += 0x7e;
 1574|  15.3k|        } else {
 1575|      0|            c2 = 0;  /* invalid */
 1576|      0|        }
 1577|  15.3k|    }
 1578|  77.2k|    c1 >>= 1;
 1579|  77.2k|    if(c1 <= 0x2f) {
  ------------------
  |  Branch (1579:8): [True: 15.8k, False: 61.3k]
  ------------------
 1580|  15.8k|        c1 += 0x70;
 1581|  61.3k|    } else if(c1 <= 0x3f) {
  ------------------
  |  Branch (1581:15): [True: 61.3k, False: 0]
  ------------------
 1582|  61.3k|        c1 += 0xb0;
 1583|  61.3k|    } else {
 1584|      0|        c1 = 0;  /* invalid */
 1585|      0|    }
 1586|  77.2k|    bytes[0] = static_cast<char>(c1);
 1587|  77.2k|    bytes[1] = static_cast<char>(c2);
 1588|  77.2k|}
ucnv2022.cpp:_ZL17toUnicodeCallbackP10UConverterjjP10UErrorCode:
 1369|  1.98M|                  UErrorCode* err){
 1370|  1.98M|    if(sourceChar>0xff){
  ------------------
  |  Branch (1370:8): [True: 557k, False: 1.42M]
  ------------------
 1371|   557k|        cnv->toUBytes[0] = static_cast<uint8_t>(sourceChar >> 8);
 1372|   557k|        cnv->toUBytes[1] = static_cast<uint8_t>(sourceChar);
 1373|   557k|        cnv->toULength = 2;
 1374|   557k|    }
 1375|  1.42M|    else{
 1376|  1.42M|        cnv->toUBytes[0] = static_cast<char>(sourceChar);
 1377|  1.42M|        cnv->toULength = 1;
 1378|  1.42M|    }
 1379|       |
 1380|  1.98M|    if(targetUniChar == (missingCharMarker-1/*0xfffe*/)){
  ------------------
  |  |   34|  1.98M|#define missingCharMarker 0xFFFF
  ------------------
  |  Branch (1380:8): [True: 29.3k, False: 1.95M]
  ------------------
 1381|  29.3k|        *err = U_INVALID_CHAR_FOUND;
 1382|  29.3k|    }
 1383|  1.95M|    else{
 1384|  1.95M|        *err = U_ILLEGAL_CHAR_FOUND;
 1385|  1.95M|    }
 1386|  1.98M|}
ucnv2022.cpp:_ZL26setInitialStateToUnicodeKRP10UConverterP21UConverterDataISO2022:
  447|    486|setInitialStateToUnicodeKR(UConverter* /*converter*/, UConverterDataISO2022 *myConverterData){
  448|    486|    if(myConverterData->version == 1) {
  ------------------
  |  Branch (448:8): [True: 0, False: 486]
  ------------------
  449|      0|        UConverter *cnv = myConverterData->currentConverter;
  450|       |
  451|      0|        cnv->toUnicodeStatus=0;     /* offset */
  452|      0|        cnv->mode=0;                /* state */
  453|      0|        cnv->toULength=0;           /* byteIndex */
  454|      0|    }
  455|    486|}
ucnv2022.cpp:_ZL28setInitialStateFromUnicodeKRP10UConverterP21UConverterDataISO2022:
  458|    243|setInitialStateFromUnicodeKR(UConverter* converter,UConverterDataISO2022 *myConverterData){
  459|       |   /* in ISO-2022-KR the designator sequence appears only once
  460|       |    * in a file so we append it only once
  461|       |    */
  462|    243|    if( converter->charErrorBufferLength==0){
  ------------------
  |  Branch (462:9): [True: 243, False: 0]
  ------------------
  463|       |
  464|    243|        converter->charErrorBufferLength = 4;
  465|    243|        converter->charErrorBuffer[0] = 0x1b;
  466|    243|        converter->charErrorBuffer[1] = 0x24;
  467|    243|        converter->charErrorBuffer[2] = 0x29;
  468|    243|        converter->charErrorBuffer[3] = 0x43;
  469|    243|    }
  470|    243|    if(myConverterData->version == 1) {
  ------------------
  |  Branch (470:8): [True: 0, False: 243]
  ------------------
  471|      0|        UConverter *cnv = myConverterData->currentConverter;
  472|       |
  473|      0|        cnv->fromUChar32=0;
  474|      0|        cnv->fromUnicodeStatus=1;   /* prevLength */
  475|      0|    }
  476|    243|}
ucnv2022.cpp:_ZL46UConverter_toUnicode_ISO_2022_KR_OFFSETS_LOGICP23UConverterToUnicodeArgsP10UErrorCode:
 2676|   489k|                                                            UErrorCode* err){
 2677|   489k|    char tempBuf[2];
 2678|   489k|    const char* mySource = const_cast<char*>(args->source);
 2679|   489k|    char16_t *myTarget = args->target;
 2680|   489k|    const char *mySourceLimit = args->sourceLimit;
 2681|   489k|    UChar32 targetUniChar = 0x0000;
 2682|   489k|    char16_t mySourceChar = 0x0000;
 2683|   489k|    UConverterDataISO2022* myData;
 2684|   489k|    UConverterSharedData* sharedData ;
 2685|   489k|    UBool useFallback;
 2686|       |
 2687|   489k|    myData = static_cast<UConverterDataISO2022*>(args->converter->extraInfo);
 2688|   489k|    if(myData->version==1){
  ------------------
  |  Branch (2688:8): [True: 0, False: 489k]
  ------------------
 2689|      0|        UConverter_toUnicode_ISO_2022_KR_OFFSETS_LOGIC_IBM(args,err);
 2690|      0|        return;
 2691|      0|    }
 2692|       |
 2693|       |    /* initialize state */
 2694|   489k|    sharedData = myData->currentConverter->sharedData;
 2695|   489k|    useFallback = args->converter->useFallback;
 2696|       |
 2697|   489k|    if(myData->key != 0) {
  ------------------
  |  Branch (2697:8): [True: 27, False: 489k]
  ------------------
 2698|       |        /* continue with a partial escape sequence */
 2699|     27|        goto escape;
 2700|   489k|    } else if(args->converter->toULength == 1 && mySource < mySourceLimit && myTarget < args->targetLimit) {
  ------------------
  |  Branch (2700:15): [True: 0, False: 489k]
  |  Branch (2700:50): [True: 0, False: 0]
  |  Branch (2700:78): [True: 0, False: 0]
  ------------------
 2701|       |        /* continue with a partial double-byte character */
 2702|      0|        mySourceChar = args->converter->toUBytes[0];
 2703|      0|        args->converter->toULength = 0;
 2704|      0|        goto getTrailByte;
 2705|      0|    }
 2706|       |
 2707|  1.10M|    while(mySource< mySourceLimit){
  ------------------
  |  Branch (2707:11): [True: 1.09M, False: 270]
  ------------------
 2708|       |
 2709|  1.09M|        if(myTarget < args->targetLimit){
  ------------------
  |  Branch (2709:12): [True: 1.09M, False: 0]
  ------------------
 2710|       |
 2711|  1.09M|            mySourceChar = static_cast<unsigned char>(*mySource++);
 2712|       |
 2713|  1.09M|            if(mySourceChar==UCNV_SI){
  ------------------
  |  |   84|  1.09M|#define  UCNV_SI 0x0F
  ------------------
  |  Branch (2713:16): [True: 2.48k, False: 1.09M]
  ------------------
 2714|  2.48k|                myData->toU2022State.g = 0;
 2715|  2.48k|                if (myData->isEmptySegment) {
  ------------------
  |  Branch (2715:21): [True: 452, False: 2.03k]
  ------------------
 2716|    452|                    myData->isEmptySegment = false;	/* we are handling it, reset to avoid future spurious errors */
 2717|    452|                    *err = U_ILLEGAL_ESCAPE_SEQUENCE;
 2718|    452|                    args->converter->toUCallbackReason = UCNV_IRREGULAR;
 2719|    452|                    args->converter->toUBytes[0] = static_cast<uint8_t>(mySourceChar);
 2720|    452|                    args->converter->toULength = 1;
 2721|    452|                    args->target = myTarget;
 2722|    452|                    args->source = mySource;
 2723|    452|                    return;
 2724|    452|                }
 2725|       |                /*consume the source */
 2726|  2.03k|                continue;
 2727|  1.09M|            }else if(mySourceChar==UCNV_SO){
  ------------------
  |  |   86|  1.09M|#define  UCNV_SO 0x0E
  ------------------
  |  Branch (2727:22): [True: 4.69k, False: 1.09M]
  ------------------
 2728|  4.69k|                myData->toU2022State.g = 1;
 2729|  4.69k|                myData->isEmptySegment = true;	/* Begin a new segment, empty so far */
 2730|       |                /*consume the source */
 2731|  4.69k|                continue;
 2732|  1.09M|            }else if(mySourceChar==ESC_2022){
  ------------------
  |  |  235|  1.09M|#define ESC_2022 0x1B /*ESC*/
  ------------------
  |  Branch (2732:22): [True: 17.0k, False: 1.07M]
  ------------------
 2733|  17.0k|                mySource--;
 2734|  17.1k|escape:
 2735|  17.1k|                myData->isEmptySegment = false;	/* Any invalid ESC sequences will be detected separately, so just reset this */
 2736|  17.1k|                changeState_2022(args->converter,&(mySource),
 2737|  17.1k|                                mySourceLimit, ISO_2022_KR, err);
 2738|  17.1k|                if(U_FAILURE(*err)){
  ------------------
  |  Branch (2738:20): [True: 16.3k, False: 756]
  ------------------
 2739|  16.3k|                    args->target = myTarget;
 2740|  16.3k|                    args->source = mySource;
 2741|  16.3k|                    return;
 2742|  16.3k|                }
 2743|    756|                continue;
 2744|  17.1k|            }
 2745|       |
 2746|  1.07M|            myData->isEmptySegment = false;	/* Any invalid char errors will be detected separately, so just reset this */
 2747|  1.07M|            if(myData->toU2022State.g == 1) {
  ------------------
  |  Branch (2747:16): [True: 647k, False: 427k]
  ------------------
 2748|   647k|                if(mySource < mySourceLimit) {
  ------------------
  |  Branch (2748:20): [True: 647k, False: 23]
  ------------------
 2749|   647k|                    int leadIsOk, trailIsOk;
 2750|   647k|                    uint8_t trailByte;
 2751|   647k|getTrailByte:
 2752|   647k|                    targetUniChar = missingCharMarker;
  ------------------
  |  |   34|   647k|#define missingCharMarker 0xFFFF
  ------------------
 2753|   647k|                    trailByte = static_cast<uint8_t>(*mySource);
 2754|       |                    /*
 2755|       |                     * Ticket 5691: consistent illegal sequences:
 2756|       |                     * - We include at least the first byte in the illegal sequence.
 2757|       |                     * - If any of the non-initial bytes could be the start of a character,
 2758|       |                     *   we stop the illegal sequence before the first one of those.
 2759|       |                     *
 2760|       |                     * In ISO-2022 DBCS, if the second byte is in the 21..7e range or is
 2761|       |                     * an ESC/SO/SI, we report only the first byte as the illegal sequence.
 2762|       |                     * Otherwise we convert or report the pair of bytes.
 2763|       |                     */
 2764|   647k|                    leadIsOk = static_cast<uint8_t>(mySourceChar - 0x21) <= (0x7e - 0x21);
 2765|   647k|                    trailIsOk = static_cast<uint8_t>(trailByte - 0x21) <= (0x7e - 0x21);
 2766|   647k|                    if (leadIsOk && trailIsOk) {
  ------------------
  |  Branch (2766:25): [True: 383k, False: 264k]
  |  Branch (2766:37): [True: 330k, False: 52.7k]
  ------------------
 2767|   330k|                        ++mySource;
 2768|   330k|                        tempBuf[0] = static_cast<char>(mySourceChar + 0x80);
 2769|   330k|                        tempBuf[1] = static_cast<char>(trailByte + 0x80);
 2770|   330k|                        targetUniChar = ucnv_MBCSSimpleGetNextUChar(sharedData, tempBuf, 2, useFallback);
  ------------------
  |  |  628|   330k|#define ucnv_MBCSSimpleGetNextUChar U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSSimpleGetNextUChar)
  |  |  ------------------
  |  |  |  |  123|   330k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|   330k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|   330k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2771|   330k|                        mySourceChar = (mySourceChar << 8) | trailByte;
 2772|   330k|                    } else if (!(trailIsOk || IS_2022_CONTROL(trailByte))) {
  ------------------
  |  |  117|   289k|#define IS_2022_CONTROL(c) (((c)<0x20) && (((uint32_t)1<<(c))&0x0800c000)!=0)
  |  |  ------------------
  |  |  |  Branch (117:29): [True: 127k, False: 161k]
  |  |  |  Branch (117:43): [True: 6.13k, False: 121k]
  |  |  ------------------
  ------------------
  |  Branch (2772:34): [True: 27.3k, False: 289k]
  ------------------
 2773|       |                        /* report a pair of illegal bytes if the second byte is not a DBCS starter */
 2774|   283k|                        ++mySource;
 2775|       |                        /* add another bit so that the code below writes 2 bytes in case of error */
 2776|   283k|                        mySourceChar = static_cast<char16_t>(0x10000 | (mySourceChar << 8) | trailByte);
 2777|   283k|                    }
 2778|   647k|                } else {
 2779|     23|                    args->converter->toUBytes[0] = static_cast<uint8_t>(mySourceChar);
 2780|     23|                    args->converter->toULength = 1;
 2781|     23|                    break;
 2782|     23|                }
 2783|   647k|            }
 2784|   427k|            else if(mySourceChar <= 0x7f) {
  ------------------
  |  Branch (2784:21): [True: 273k, False: 153k]
  ------------------
 2785|   273k|                targetUniChar = ucnv_MBCSSimpleGetNextUChar(sharedData, mySource - 1, 1, useFallback);
  ------------------
  |  |  628|   273k|#define ucnv_MBCSSimpleGetNextUChar U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSSimpleGetNextUChar)
  |  |  ------------------
  |  |  |  |  123|   273k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|   273k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|   273k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2786|   273k|            } else {
 2787|   153k|                targetUniChar = 0xffff;
 2788|   153k|            }
 2789|  1.07M|            if(targetUniChar < 0xfffe){
  ------------------
  |  Branch (2789:16): [True: 602k, False: 472k]
  ------------------
 2790|   602k|                if(args->offsets) {
  ------------------
  |  Branch (2790:20): [True: 0, False: 602k]
  ------------------
 2791|      0|                    args->offsets[myTarget - args->target] = static_cast<int32_t>(mySource - args->source - (mySourceChar <= 0xff ? 1 : 2));
  ------------------
  |  Branch (2791:110): [True: 0, False: 0]
  ------------------
 2792|      0|                }
 2793|   602k|                *(myTarget++) = static_cast<char16_t>(targetUniChar);
 2794|   602k|            }
 2795|   472k|            else {
 2796|       |                /* Call the callback function*/
 2797|   472k|                toUnicodeCallback(args->converter,mySourceChar,targetUniChar,err);
 2798|   472k|                break;
 2799|   472k|            }
 2800|  1.07M|        }
 2801|      0|        else{
 2802|      0|            *err =U_BUFFER_OVERFLOW_ERROR;
 2803|      0|            break;
 2804|      0|        }
 2805|  1.09M|    }
 2806|   473k|    args->target = myTarget;
 2807|   473k|    args->source = mySource;
 2808|   473k|}
ucnv2022.cpp:_ZL46UConverter_toUnicode_ISO_2022_CN_OFFSETS_LOGICP23UConverterToUnicodeArgsP10UErrorCode:
 3269|  1.07M|                                               UErrorCode* err){
 3270|  1.07M|    char tempBuf[3];
 3271|  1.07M|    const char* mySource = const_cast<char*>(args->source);
 3272|  1.07M|    char16_t *myTarget = args->target;
 3273|  1.07M|    const char *mySourceLimit = args->sourceLimit;
 3274|  1.07M|    uint32_t targetUniChar = 0x0000;
 3275|  1.07M|    uint32_t mySourceChar = 0x0000;
 3276|  1.07M|    UConverterDataISO2022* myData;
 3277|  1.07M|    ISO2022State *pToU2022State;
 3278|       |
 3279|  1.07M|    myData = static_cast<UConverterDataISO2022*>(args->converter->extraInfo);
 3280|  1.07M|    pToU2022State = &myData->toU2022State;
 3281|       |
 3282|  1.07M|    if(myData->key != 0) {
  ------------------
  |  Branch (3282:8): [True: 45, False: 1.07M]
  ------------------
 3283|       |        /* continue with a partial escape sequence */
 3284|     45|        goto escape;
 3285|  1.07M|    } else if(args->converter->toULength == 1 && mySource < mySourceLimit && myTarget < args->targetLimit) {
  ------------------
  |  Branch (3285:15): [True: 0, False: 1.07M]
  |  Branch (3285:50): [True: 0, False: 0]
  |  Branch (3285:78): [True: 0, False: 0]
  ------------------
 3286|       |        /* continue with a partial double-byte character */
 3287|      0|        mySourceChar = args->converter->toUBytes[0];
 3288|      0|        args->converter->toULength = 0;
 3289|      0|        targetUniChar = missingCharMarker;
  ------------------
  |  |   34|      0|#define missingCharMarker 0xFFFF
  ------------------
 3290|      0|        goto getTrailByte;
 3291|      0|    }
 3292|       |
 3293|  2.36M|    while(mySource < mySourceLimit){
  ------------------
  |  Branch (3293:11): [True: 2.36M, False: 416]
  ------------------
 3294|       |
 3295|  2.36M|        targetUniChar =missingCharMarker;
  ------------------
  |  |   34|  2.36M|#define missingCharMarker 0xFFFF
  ------------------
 3296|       |
 3297|  2.36M|        if(myTarget < args->targetLimit){
  ------------------
  |  Branch (3297:12): [True: 2.36M, False: 0]
  ------------------
 3298|       |
 3299|  2.36M|            mySourceChar = static_cast<unsigned char>(*mySource++);
 3300|       |
 3301|  2.36M|            switch(mySourceChar){
 3302|  6.53k|            case UCNV_SI:
  ------------------
  |  |   84|  6.53k|#define  UCNV_SI 0x0F
  ------------------
  |  Branch (3302:13): [True: 6.53k, False: 2.36M]
  ------------------
 3303|  6.53k|                pToU2022State->g=0;
 3304|  6.53k|                if (myData->isEmptySegment) {
  ------------------
  |  Branch (3304:21): [True: 532, False: 6.00k]
  ------------------
 3305|    532|                    myData->isEmptySegment = false;	/* we are handling it, reset to avoid future spurious errors */
 3306|    532|                    *err = U_ILLEGAL_ESCAPE_SEQUENCE;
 3307|    532|                    args->converter->toUCallbackReason = UCNV_IRREGULAR;
 3308|    532|                    args->converter->toUBytes[0] = static_cast<uint8_t>(mySourceChar);
 3309|    532|                    args->converter->toULength = 1;
 3310|    532|                    args->target = myTarget;
 3311|    532|                    args->source = mySource;
 3312|    532|                    return;
 3313|    532|                }
 3314|  6.00k|                continue;
 3315|       |
 3316|  10.0k|            case UCNV_SO:
  ------------------
  |  |   86|  10.0k|#define  UCNV_SO 0x0E
  ------------------
  |  Branch (3316:13): [True: 10.0k, False: 2.35M]
  ------------------
 3317|  10.0k|                if(pToU2022State->cs[1] != 0) {
  ------------------
  |  Branch (3317:20): [True: 3.53k, False: 6.54k]
  ------------------
 3318|  3.53k|                    pToU2022State->g=1;
 3319|  3.53k|                    myData->isEmptySegment = true;	/* Begin a new segment, empty so far */
 3320|  3.53k|                    continue;
 3321|  6.54k|                } else {
 3322|       |                    /* illegal to have SO before a matching designator */
 3323|  6.54k|                    myData->isEmptySegment = false;	/* Handling a different error, reset this to avoid future spurious errs */
 3324|  6.54k|                    break;
 3325|  6.54k|                }
 3326|       |
 3327|  30.0k|            case ESC_2022:
  ------------------
  |  |  235|  30.0k|#define ESC_2022 0x1B /*ESC*/
  ------------------
  |  Branch (3327:13): [True: 30.0k, False: 2.33M]
  ------------------
 3328|  30.0k|                mySource--;
 3329|  30.1k|escape:
 3330|  30.1k|                {
 3331|  30.1k|                    const char * mySourceBefore = mySource;
 3332|  30.1k|                    int8_t toULengthBefore = args->converter->toULength;
 3333|       |
 3334|  30.1k|                    changeState_2022(args->converter,&(mySource),
 3335|  30.1k|                        mySourceLimit, ISO_2022_CN,err);
 3336|       |
 3337|       |                    /* After SO there must be at least one character before a designator (designator error handled separately) */
 3338|  30.1k|                    if(myData->key==0 && U_SUCCESS(*err) && myData->isEmptySegment) {
  ------------------
  |  Branch (3338:24): [True: 30.0k, False: 90]
  |  Branch (3338:42): [True: 8.63k, False: 21.3k]
  |  Branch (3338:61): [True: 678, False: 7.96k]
  ------------------
 3339|    678|                        *err = U_ILLEGAL_ESCAPE_SEQUENCE;
 3340|    678|                        args->converter->toUCallbackReason = UCNV_IRREGULAR;
 3341|    678|                        args->converter->toULength = static_cast<int8_t>(toULengthBefore + (mySource - mySourceBefore));
 3342|    678|                    }
 3343|  30.1k|                }
 3344|       |
 3345|       |                /* invalid or illegal escape sequence */
 3346|  30.1k|                if(U_FAILURE(*err)){
  ------------------
  |  Branch (3346:20): [True: 22.0k, False: 8.05k]
  ------------------
 3347|  22.0k|                    args->target = myTarget;
 3348|  22.0k|                    args->source = mySource;
 3349|  22.0k|                    myData->isEmptySegment = false;	/* Reset to avoid future spurious errors */
 3350|  22.0k|                    return;
 3351|  22.0k|                }
 3352|  8.05k|                continue;
 3353|       |
 3354|       |            /* ISO-2022-CN does not use single-byte (C1) SS2 and SS3 */
 3355|       |
 3356|  8.05k|            case CR:
  ------------------
  |  |   85|  4.73k|#define CR      0x0D
  ------------------
  |  Branch (3356:13): [True: 4.73k, False: 2.36M]
  ------------------
 3357|  12.0k|            case LF:
  ------------------
  |  |   86|  12.0k|#define LF      0x0A
  ------------------
  |  Branch (3357:13): [True: 7.34k, False: 2.36M]
  ------------------
 3358|  12.0k|                uprv_memset(pToU2022State, 0, sizeof(ISO2022State));
  ------------------
  |  |  100|  12.0k|#define uprv_memset(buffer, mark, size) U_STANDARD_CPP_NAMESPACE memset(buffer, mark, size)
  |  |  ------------------
  |  |  |  |  393|  12.0k|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
 3359|  12.0k|                U_FALLTHROUGH;
  ------------------
  |  |  511|  12.0k|#       define U_FALLTHROUGH [[clang::fallthrough]]
  ------------------
 3360|  2.32M|            default:
  ------------------
  |  Branch (3360:13): [True: 2.30M, False: 58.7k]
  ------------------
 3361|       |                /* convert one or two bytes */
 3362|  2.32M|                myData->isEmptySegment = false;
 3363|  2.32M|                if(pToU2022State->g != 0) {
  ------------------
  |  Branch (3363:20): [True: 390k, False: 1.93M]
  ------------------
 3364|   390k|                    if(mySource < mySourceLimit) {
  ------------------
  |  Branch (3364:24): [True: 390k, False: 13]
  ------------------
 3365|   390k|                        UConverterSharedData *cnv;
 3366|   390k|                        StateEnum tempState;
 3367|   390k|                        int32_t tempBufLen;
 3368|   390k|                        int leadIsOk, trailIsOk;
 3369|   390k|                        uint8_t trailByte;
 3370|   390k|getTrailByte:
 3371|   390k|                        trailByte = static_cast<uint8_t>(*mySource);
 3372|       |                        /*
 3373|       |                         * Ticket 5691: consistent illegal sequences:
 3374|       |                         * - We include at least the first byte in the illegal sequence.
 3375|       |                         * - If any of the non-initial bytes could be the start of a character,
 3376|       |                         *   we stop the illegal sequence before the first one of those.
 3377|       |                         *
 3378|       |                         * In ISO-2022 DBCS, if the second byte is in the 21..7e range or is
 3379|       |                         * an ESC/SO/SI, we report only the first byte as the illegal sequence.
 3380|       |                         * Otherwise we convert or report the pair of bytes.
 3381|       |                         */
 3382|   390k|                        leadIsOk = static_cast<uint8_t>(mySourceChar - 0x21) <= (0x7e - 0x21);
 3383|   390k|                        trailIsOk = static_cast<uint8_t>(trailByte - 0x21) <= (0x7e - 0x21);
 3384|   390k|                        if (leadIsOk && trailIsOk) {
  ------------------
  |  Branch (3384:29): [True: 202k, False: 187k]
  |  Branch (3384:41): [True: 177k, False: 25.3k]
  ------------------
 3385|   177k|                            ++mySource;
 3386|   177k|                            tempState = static_cast<StateEnum>(pToU2022State->cs[pToU2022State->g]);
 3387|   177k|                            if(tempState >= CNS_11643_0) {
  ------------------
  |  Branch (3387:32): [True: 76.2k, False: 101k]
  ------------------
 3388|  76.2k|                                cnv = myData->myConverterArray[CNS_11643];
 3389|  76.2k|                                tempBuf[0] = static_cast<char>(0x80 + (tempState - CNS_11643_0));
 3390|  76.2k|                                tempBuf[1] = static_cast<char>(mySourceChar);
 3391|  76.2k|                                tempBuf[2] = static_cast<char>(trailByte);
 3392|  76.2k|                                tempBufLen = 3;
 3393|       |
 3394|   101k|                            }else{
 3395|   101k|                                U_ASSERT(tempState<UCNV_2022_MAX_CONVERTERS);
  ------------------
  |  |   35|   101k|#   define U_ASSERT(exp) (void)0
  ------------------
 3396|   101k|                                cnv = myData->myConverterArray[tempState];
 3397|   101k|                                tempBuf[0] = static_cast<char>(mySourceChar);
 3398|   101k|                                tempBuf[1] = static_cast<char>(trailByte);
 3399|   101k|                                tempBufLen = 2;
 3400|   101k|                            }
 3401|   177k|                            targetUniChar = ucnv_MBCSSimpleGetNextUChar(cnv, tempBuf, tempBufLen, false);
  ------------------
  |  |  628|   177k|#define ucnv_MBCSSimpleGetNextUChar U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSSimpleGetNextUChar)
  |  |  ------------------
  |  |  |  |  123|   177k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|   177k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|   177k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3402|   177k|                            mySourceChar = (mySourceChar << 8) | trailByte;
 3403|   213k|                        } else if (!(trailIsOk || IS_2022_CONTROL(trailByte))) {
  ------------------
  |  |  117|   201k|#define IS_2022_CONTROL(c) (((c)<0x20) && (((uint32_t)1<<(c))&0x0800c000)!=0)
  |  |  ------------------
  |  |  |  Branch (117:29): [True: 98.5k, False: 102k]
  |  |  |  Branch (117:43): [True: 4.58k, False: 93.9k]
  |  |  ------------------
  ------------------
  |  Branch (3403:38): [True: 11.8k, False: 201k]
  ------------------
 3404|       |                            /* report a pair of illegal bytes if the second byte is not a DBCS starter */
 3405|   196k|                            ++mySource;
 3406|       |                            /* add another bit so that the code below writes 2 bytes in case of error */
 3407|   196k|                            mySourceChar = 0x10000 | (mySourceChar << 8) | trailByte;
 3408|   196k|                        }
 3409|   390k|                        if(pToU2022State->g>=2) {
  ------------------
  |  Branch (3409:28): [True: 1.40k, False: 389k]
  ------------------
 3410|       |                            /* return from a single-shift state to the previous one */
 3411|  1.40k|                            pToU2022State->g=pToU2022State->prevG;
 3412|  1.40k|                        }
 3413|   390k|                    } else {
 3414|     13|                        args->converter->toUBytes[0] = static_cast<uint8_t>(mySourceChar);
 3415|     13|                        args->converter->toULength = 1;
 3416|     13|                        goto endloop;
 3417|     13|                    }
 3418|   390k|                }
 3419|  1.93M|                else{
 3420|  1.93M|                    if(mySourceChar <= 0x7f) {
  ------------------
  |  Branch (3420:24): [True: 1.12M, False: 810k]
  ------------------
 3421|  1.12M|                        targetUniChar = static_cast<char16_t>(mySourceChar);
 3422|  1.12M|                    }
 3423|  1.93M|                }
 3424|  2.32M|                break;
 3425|  2.36M|            }
 3426|  2.32M|            if(targetUniChar < (missingCharMarker-1/*0xfffe*/)){
  ------------------
  |  |   34|  2.32M|#define missingCharMarker 0xFFFF
  ------------------
  |  Branch (3426:16): [True: 1.27M, False: 1.05M]
  ------------------
 3427|  1.27M|                if(args->offsets){
  ------------------
  |  Branch (3427:20): [True: 0, False: 1.27M]
  ------------------
 3428|      0|                    args->offsets[myTarget - args->target] = static_cast<int32_t>(mySource - args->source - (mySourceChar <= 0xff ? 1 : 2));
  ------------------
  |  Branch (3428:110): [True: 0, False: 0]
  ------------------
 3429|      0|                }
 3430|  1.27M|                *(myTarget++) = static_cast<char16_t>(targetUniChar);
 3431|  1.27M|            }
 3432|  1.05M|            else if(targetUniChar > missingCharMarker){
  ------------------
  |  |   34|  1.05M|#define missingCharMarker 0xFFFF
  ------------------
  |  Branch (3432:21): [True: 0, False: 1.05M]
  ------------------
 3433|       |                /* disassemble the surrogate pair and write to output*/
 3434|      0|                targetUniChar-=0x0010000;
 3435|      0|                *myTarget = static_cast<char16_t>(0xd800 + static_cast<char16_t>(targetUniChar >> 10));
 3436|      0|                if(args->offsets){
  ------------------
  |  Branch (3436:20): [True: 0, False: 0]
  ------------------
 3437|      0|                    args->offsets[myTarget - args->target] = static_cast<int32_t>(mySource - args->source - (mySourceChar <= 0xff ? 1 : 2));
  ------------------
  |  Branch (3437:110): [True: 0, False: 0]
  ------------------
 3438|      0|                }
 3439|      0|                ++myTarget;
 3440|      0|                if(myTarget< args->targetLimit){
  ------------------
  |  Branch (3440:20): [True: 0, False: 0]
  ------------------
 3441|      0|                    *myTarget = static_cast<char16_t>(0xdc00 + static_cast<char16_t>(targetUniChar & 0x3ff));
 3442|      0|                    if(args->offsets){
  ------------------
  |  Branch (3442:24): [True: 0, False: 0]
  ------------------
 3443|      0|                        args->offsets[myTarget - args->target] = static_cast<int32_t>(mySource - args->source - (mySourceChar <= 0xff ? 1 : 2));
  ------------------
  |  Branch (3443:114): [True: 0, False: 0]
  ------------------
 3444|      0|                    }
 3445|      0|                    ++myTarget;
 3446|      0|                }else{
 3447|      0|                    args->converter->UCharErrorBuffer[args->converter->UCharErrorBufferLength++]=
 3448|      0|                                    static_cast<char16_t>(0xdc00 + static_cast<char16_t>(targetUniChar & 0x3ff));
 3449|      0|                }
 3450|       |
 3451|      0|            }
 3452|  1.05M|            else{
 3453|       |                /* Call the callback function*/
 3454|  1.05M|                toUnicodeCallback(args->converter,mySourceChar,targetUniChar,err);
 3455|  1.05M|                break;
 3456|  1.05M|            }
 3457|  2.32M|        }
 3458|      0|        else{
 3459|      0|            *err =U_BUFFER_OVERFLOW_ERROR;
 3460|      0|            break;
 3461|      0|        }
 3462|  2.36M|    }
 3463|  1.05M|endloop:
 3464|  1.05M|    args->target = myTarget;
 3465|  1.05M|    args->source = mySource;
 3466|  1.05M|}
ucnv2022.cpp:_ZL13_ISO2022CloseP10UConverter:
  657|  1.04k|_ISO2022Close(UConverter *converter) {
  658|  1.04k|    UConverterDataISO2022* myData = static_cast<UConverterDataISO2022*>(converter->extraInfo);
  659|  1.04k|    UConverterSharedData **array = myData->myConverterArray;
  660|  1.04k|    int32_t i;
  661|       |
  662|  1.04k|    if (converter->extraInfo != nullptr) {
  ------------------
  |  Branch (662:9): [True: 1.04k, False: 0]
  ------------------
  663|       |        /*close the array of converter pointers and free the memory*/
  664|  11.4k|        for (i=0; i<UCNV_2022_MAX_CONVERTERS; i++) {
  ------------------
  |  |  207|  11.4k|#define UCNV_2022_MAX_CONVERTERS 10
  ------------------
  |  Branch (664:19): [True: 10.4k, False: 1.04k]
  ------------------
  665|  10.4k|            if(array[i]!=nullptr) {
  ------------------
  |  Branch (665:16): [True: 1.43k, False: 9.01k]
  ------------------
  666|  1.43k|                ucnv_unloadSharedDataIfReady(array[i]);
  ------------------
  |  |  726|  1.43k|#define ucnv_unloadSharedDataIfReady U_ICU_ENTRY_POINT_RENAME(ucnv_unloadSharedDataIfReady)
  |  |  ------------------
  |  |  |  |  123|  1.43k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  1.43k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  1.43k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  667|  1.43k|            }
  668|  10.4k|        }
  669|       |
  670|  1.04k|        ucnv_close(myData->currentConverter);
  ------------------
  |  |  639|  1.04k|#define ucnv_close U_ICU_ENTRY_POINT_RENAME(ucnv_close)
  |  |  ------------------
  |  |  |  |  123|  1.04k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  1.04k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  1.04k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  671|       |
  672|  1.04k|        if(!converter->isExtraLocal){
  ------------------
  |  Branch (672:12): [True: 1.04k, False: 0]
  ------------------
  673|  1.04k|            uprv_free (converter->extraInfo);
  ------------------
  |  | 1503|  1.04k|#define uprv_free U_ICU_ENTRY_POINT_RENAME(uprv_free)
  |  |  ------------------
  |  |  |  |  123|  1.04k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  1.04k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  1.04k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  674|  1.04k|            converter->extraInfo = nullptr;
  675|  1.04k|        }
  676|  1.04k|    }
  677|  1.04k|}
ucnv2022.cpp:_ZL13_ISO2022ResetP10UConverter21UConverterResetChoice:
  680|  1.04k|_ISO2022Reset(UConverter *converter, UConverterResetChoice choice) {
  681|  1.04k|    UConverterDataISO2022* myConverterData = static_cast<UConverterDataISO2022*>(converter->extraInfo);
  682|  1.04k|    if(choice<=UCNV_RESET_TO_UNICODE) {
  ------------------
  |  Branch (682:8): [True: 1.04k, False: 0]
  ------------------
  683|  1.04k|        uprv_memset(&myConverterData->toU2022State, 0, sizeof(ISO2022State));
  ------------------
  |  |  100|  1.04k|#define uprv_memset(buffer, mark, size) U_STANDARD_CPP_NAMESPACE memset(buffer, mark, size)
  |  |  ------------------
  |  |  |  |  393|  1.04k|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  684|  1.04k|        myConverterData->key = 0;
  685|  1.04k|        myConverterData->isEmptySegment = false;
  686|  1.04k|    }
  687|  1.04k|    if(choice!=UCNV_RESET_TO_UNICODE) {
  ------------------
  |  Branch (687:8): [True: 0, False: 1.04k]
  ------------------
  688|      0|        uprv_memset(&myConverterData->fromU2022State, 0, sizeof(ISO2022State));
  ------------------
  |  |  100|      0|#define uprv_memset(buffer, mark, size) U_STANDARD_CPP_NAMESPACE memset(buffer, mark, size)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  689|      0|    }
  690|       |#ifdef U_ENABLE_GENERIC_ISO_2022
  691|       |    if(myConverterData->locale[0] == 0){
  692|       |        if(choice<=UCNV_RESET_TO_UNICODE) {
  693|       |            myConverterData->isFirstBuffer = true;
  694|       |            myConverterData->key = 0;
  695|       |            if (converter->mode == UCNV_SO){
  696|       |                ucnv_close (myConverterData->currentConverter);
  697|       |                myConverterData->currentConverter=nullptr;
  698|       |            }
  699|       |            converter->mode = UCNV_SI;
  700|       |        }
  701|       |        if(choice!=UCNV_RESET_TO_UNICODE) {
  702|       |            /* re-append UTF-8 escape sequence */
  703|       |            converter->charErrorBufferLength = 3;
  704|       |            converter->charErrorBuffer[0] = 0x1b;
  705|       |            converter->charErrorBuffer[1] = 0x28;
  706|       |            converter->charErrorBuffer[2] = 0x42;
  707|       |        }
  708|       |    }
  709|       |    else
  710|       |#endif
  711|  1.04k|    {
  712|       |        /* reset the state variables */
  713|  1.04k|        if(myConverterData->locale[0] == 'k'){
  ------------------
  |  Branch (713:12): [True: 243, False: 802]
  ------------------
  714|    243|            if(choice<=UCNV_RESET_TO_UNICODE) {
  ------------------
  |  Branch (714:16): [True: 243, False: 0]
  ------------------
  715|    243|                setInitialStateToUnicodeKR(converter, myConverterData);
  716|    243|            }
  717|    243|            if(choice!=UCNV_RESET_TO_UNICODE) {
  ------------------
  |  Branch (717:16): [True: 0, False: 243]
  ------------------
  718|      0|                setInitialStateFromUnicodeKR(converter, myConverterData);
  719|      0|            }
  720|    243|        }
  721|  1.04k|    }
  722|  1.04k|}

ucnv_enableCleanup_78:
  265|      1|ucnv_enableCleanup() {
  266|      1|    ucln_common_registerCleanup(UCLN_COMMON_UCNV, ucnv_cleanup);
  ------------------
  |  |  617|      1|#define ucln_common_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_common_registerCleanup)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  267|      1|}
ucnv_load_78:
  543|  2.38k|ucnv_load(UConverterLoadArgs *pArgs, UErrorCode *err) {
  544|  2.38k|    UConverterSharedData *mySharedConverterData;
  545|       |
  546|  2.38k|    if(err == nullptr || U_FAILURE(*err)) {
  ------------------
  |  Branch (546:8): [True: 0, False: 2.38k]
  |  Branch (546:26): [True: 0, False: 2.38k]
  ------------------
  547|      0|        return nullptr;
  548|      0|    }
  549|       |
  550|  2.38k|    if(pArgs->pkg != nullptr && *pArgs->pkg != 0) {
  ------------------
  |  Branch (550:8): [True: 0, False: 2.38k]
  |  Branch (550:33): [True: 0, False: 0]
  ------------------
  551|       |        /* application-provided converters are not currently cached */
  552|      0|        return createConverterFromFile(pArgs, err);
  553|      0|    }
  554|       |
  555|  2.38k|    mySharedConverterData = ucnv_getSharedConverterData(pArgs->name);
  556|  2.38k|    if (mySharedConverterData == nullptr)
  ------------------
  |  Branch (556:9): [True: 29, False: 2.35k]
  ------------------
  557|     29|    {
  558|       |        /*Not cached, we need to stream it in from file */
  559|     29|        mySharedConverterData = createConverterFromFile(pArgs, err);
  560|     29|        if (U_FAILURE (*err) || (mySharedConverterData == nullptr))
  ------------------
  |  Branch (560:13): [True: 19, False: 10]
  |  Branch (560:33): [True: 0, False: 10]
  ------------------
  561|     19|        {
  562|     19|            return nullptr;
  563|     19|        }
  564|     10|        else if (!pArgs->onlyTestIsLoadable)
  ------------------
  |  Branch (564:18): [True: 10, False: 0]
  ------------------
  565|     10|        {
  566|       |            /* share it with other library clients */
  567|     10|            ucnv_shareConverterData(mySharedConverterData);
  568|     10|        }
  569|     29|    }
  570|  2.35k|    else
  571|  2.35k|    {
  572|       |        /* The data for this converter was already in the cache.            */
  573|       |        /* Update the reference counter on the shared data: one more client */
  574|  2.35k|        mySharedConverterData->referenceCounter++;
  575|  2.35k|    }
  576|       |
  577|  2.36k|    return mySharedConverterData;
  578|  2.38k|}
ucnv_unload_78:
  586|  2.35k|ucnv_unload(UConverterSharedData *sharedData) {
  587|  2.35k|    if(sharedData != nullptr) {
  ------------------
  |  Branch (587:8): [True: 2.35k, False: 0]
  ------------------
  588|  2.35k|        if (sharedData->referenceCounter > 0) {
  ------------------
  |  Branch (588:13): [True: 2.35k, False: 0]
  ------------------
  589|  2.35k|            sharedData->referenceCounter--;
  590|  2.35k|        }
  591|       |
  592|  2.35k|        if((sharedData->referenceCounter <= 0)&&(sharedData->sharedDataCached == false)) {
  ------------------
  |  Branch (592:12): [True: 2.35k, False: 0]
  |  Branch (592:49): [True: 0, False: 2.35k]
  ------------------
  593|      0|            ucnv_deleteSharedConverterData(sharedData);
  594|      0|        }
  595|  2.35k|    }
  596|  2.35k|}
ucnv_unloadSharedDataIfReady_78:
  600|  2.37k|{
  601|  2.37k|    if(sharedData != nullptr && sharedData->isReferenceCounted) {
  ------------------
  |  Branch (601:8): [True: 2.35k, False: 19]
  |  Branch (601:33): [True: 2.35k, False: 0]
  ------------------
  602|  2.35k|        umtx_lock(&cnvCacheMutex);
  ------------------
  |  | 1250|  2.35k|#define umtx_lock U_ICU_ENTRY_POINT_RENAME(umtx_lock)
  |  |  ------------------
  |  |  |  |  123|  2.35k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  2.35k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  2.35k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  603|  2.35k|        ucnv_unload(sharedData);
  ------------------
  |  |  725|  2.35k|#define ucnv_unload U_ICU_ENTRY_POINT_RENAME(ucnv_unload)
  |  |  ------------------
  |  |  |  |  123|  2.35k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  2.35k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  2.35k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  604|  2.35k|        umtx_unlock(&cnvCacheMutex);
  ------------------
  |  | 1251|  2.35k|#define umtx_unlock U_ICU_ENTRY_POINT_RENAME(umtx_unlock)
  |  |  ------------------
  |  |  |  |  123|  2.35k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  2.35k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  2.35k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  605|  2.35k|    }
  606|  2.37k|}
ucnv_loadSharedData_78:
  715|  4.44k|                    UErrorCode * err) {
  716|  4.44k|    UConverterNamePieces stackPieces;
  717|  4.44k|    UConverterLoadArgs stackArgs;
  718|  4.44k|    UConverterSharedData *mySharedConverterData = nullptr;
  719|  4.44k|    UErrorCode internalErrorCode = U_ZERO_ERROR;
  720|  4.44k|    UBool mayContainOption = true;
  721|  4.44k|    UBool checkForAlgorithmic = true;
  722|       |
  723|  4.44k|    if (U_FAILURE (*err)) {
  ------------------
  |  Branch (723:9): [True: 0, False: 4.44k]
  ------------------
  724|      0|        return nullptr;
  725|      0|    }
  726|       |
  727|  4.44k|    if(pPieces == nullptr) {
  ------------------
  |  Branch (727:8): [True: 0, False: 4.44k]
  ------------------
  728|      0|        if(pArgs != nullptr) {
  ------------------
  |  Branch (728:12): [True: 0, False: 0]
  ------------------
  729|       |            /*
  730|       |             * Bad: We may set pArgs pointers to stackPieces fields
  731|       |             * which will be invalid after this function returns.
  732|       |             */
  733|      0|            *err = U_INTERNAL_PROGRAM_ERROR;
  734|      0|            return nullptr;
  735|      0|        }
  736|      0|        pPieces = &stackPieces;
  737|      0|    }
  738|  4.44k|    if(pArgs == nullptr) {
  ------------------
  |  Branch (738:8): [True: 0, False: 4.44k]
  ------------------
  739|      0|        uprv_memset(&stackArgs, 0, sizeof(stackArgs));
  ------------------
  |  |  100|      0|#define uprv_memset(buffer, mark, size) U_STANDARD_CPP_NAMESPACE memset(buffer, mark, size)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  740|      0|        stackArgs.size = (int32_t)sizeof(stackArgs);
  741|      0|        pArgs = &stackArgs;
  742|      0|    }
  743|       |
  744|  4.44k|    pPieces->cnvName[0] = 0;
  745|  4.44k|    pPieces->locale[0] = 0;
  746|  4.44k|    pPieces->options = 0;
  747|       |
  748|  4.44k|    pArgs->name = converterName;
  749|  4.44k|    pArgs->locale = pPieces->locale;
  750|  4.44k|    pArgs->options = pPieces->options;
  751|       |
  752|       |    /* In case "name" is nullptr we want to open the default converter. */
  753|  4.44k|    if (converterName == nullptr) {
  ------------------
  |  Branch (753:9): [True: 0, False: 4.44k]
  ------------------
  754|      0|#if U_CHARSET_IS_UTF8
  755|      0|        pArgs->name = "UTF-8";
  756|      0|        return (UConverterSharedData *)converterData[UCNV_UTF8];
  757|       |#else
  758|       |        /* Call ucnv_getDefaultName first to query the name from the OS. */
  759|       |        pArgs->name = ucnv_getDefaultName();
  760|       |        if (pArgs->name == nullptr) {
  761|       |            *err = U_MISSING_RESOURCE_ERROR;
  762|       |            return nullptr;
  763|       |        }
  764|       |        mySharedConverterData = (UConverterSharedData *)gDefaultAlgorithmicSharedData;
  765|       |        checkForAlgorithmic = false;
  766|       |        mayContainOption = gDefaultConverterContainsOption;
  767|       |        /* the default converter name is already canonical */
  768|       |#endif
  769|      0|    }
  770|  4.44k|    else if(UCNV_FAST_IS_UTF8(converterName)) {
  ------------------
  |  |   40|  4.44k|    (((name[0]=='U' ? \
  |  |  ------------------
  |  |  |  Branch (40:6): [True: 779, False: 3.67k]
  |  |  |  Branch (40:8): [True: 410, False: 4.03k]
  |  |  ------------------
  |  |   41|  4.44k|      (                name[1]=='T' && name[2]=='F') : \
  |  |  ------------------
  |  |  |  Branch (41:24): [True: 410, False: 0]
  |  |  |  Branch (41:40): [True: 410, False: 0]
  |  |  ------------------
  |  |   42|  4.44k|      (name[0]=='u' && name[1]=='t' && name[2]=='f'))) \
  |  |  ------------------
  |  |  |  Branch (42:8): [True: 369, False: 3.67k]
  |  |  |  Branch (42:24): [True: 369, False: 0]
  |  |  |  Branch (42:40): [True: 369, False: 0]
  |  |  ------------------
  |  |   43|  4.44k|  && (name[3]=='-' ? \
  |  |  ------------------
  |  |  |  Branch (43:6): [True: 137, False: 642]
  |  |  |  Branch (43:7): [True: 779, False: 0]
  |  |  ------------------
  |  |   44|    779|     (name[4]=='8' && name[5]==0) : \
  |  |  ------------------
  |  |  |  Branch (44:7): [True: 137, False: 642]
  |  |  |  Branch (44:23): [True: 137, False: 0]
  |  |  ------------------
  |  |   45|    779|     (name[3]=='8' && name[4]==0)))
  |  |  ------------------
  |  |  |  Branch (45:7): [True: 0, False: 0]
  |  |  |  Branch (45:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  771|       |        /* fastpath for UTF-8 */
  772|    137|        pArgs->name = "UTF-8";
  773|    137|        return (UConverterSharedData *)converterData[UCNV_UTF8];
  774|    137|    }
  775|  4.31k|    else {
  776|       |        /* separate the converter name from the options */
  777|  4.31k|        parseConverterOptions(converterName, pPieces, pArgs, err);
  778|  4.31k|        if (U_FAILURE(*err)) {
  ------------------
  |  Branch (778:13): [True: 0, False: 4.31k]
  ------------------
  779|       |            /* Very bad name used. */
  780|      0|            return nullptr;
  781|      0|        }
  782|       |
  783|       |        /* get the canonical converter name */
  784|  4.31k|        pArgs->name = ucnv_io_getConverterName(pArgs->name, &mayContainOption, &internalErrorCode);
  ------------------
  |  |  694|  4.31k|#define ucnv_io_getConverterName U_ICU_ENTRY_POINT_RENAME(ucnv_io_getConverterName)
  |  |  ------------------
  |  |  |  |  123|  4.31k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  4.31k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  4.31k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  785|  4.31k|        if (U_FAILURE(internalErrorCode) || pArgs->name == nullptr) {
  ------------------
  |  Branch (785:13): [True: 0, False: 4.31k]
  |  Branch (785:45): [True: 1.08k, False: 3.22k]
  ------------------
  786|       |            /*
  787|       |            * set the input name in case the converter was added
  788|       |            * without updating the alias table, or when there is no alias table
  789|       |            */
  790|  1.08k|            pArgs->name = pPieces->cnvName;
  791|  3.22k|        } else if (internalErrorCode == U_AMBIGUOUS_ALIAS_WARNING) {
  ------------------
  |  Branch (791:20): [True: 674, False: 2.55k]
  ------------------
  792|    674|            *err = U_AMBIGUOUS_ALIAS_WARNING;
  793|    674|        }
  794|  4.31k|    }
  795|       |
  796|       |    /* separate the converter name from the options */
  797|  4.31k|    if(mayContainOption && pArgs->name != pPieces->cnvName) {
  ------------------
  |  Branch (797:8): [True: 1.69k, False: 2.61k]
  |  Branch (797:28): [True: 614, False: 1.08k]
  ------------------
  798|    614|        parseConverterOptions(pArgs->name, pPieces, pArgs, err);
  799|    614|    }
  800|       |
  801|       |    /* get the shared data for an algorithmic converter, if it is one */
  802|  4.31k|    if (checkForAlgorithmic) {
  ------------------
  |  Branch (802:9): [True: 4.31k, False: 0]
  ------------------
  803|  4.31k|        mySharedConverterData = (UConverterSharedData *)getAlgorithmicTypeFromName(pArgs->name);
  804|  4.31k|    }
  805|  4.31k|    if (mySharedConverterData == nullptr)
  ------------------
  |  Branch (805:9): [True: 2.37k, False: 1.93k]
  ------------------
  806|  2.37k|    {
  807|       |        /* it is a data-based converter, get its shared data.               */
  808|       |        /* Hold the cnvCacheMutex through the whole process of checking the */
  809|       |        /*   converter data cache, and adding new entries to the cache      */
  810|       |        /*   to prevent other threads from modifying the cache during the   */
  811|       |        /*   process.                                                       */
  812|  2.37k|        pArgs->nestedLoads=1;
  813|  2.37k|        pArgs->pkg=nullptr;
  814|       |
  815|  2.37k|        umtx_lock(&cnvCacheMutex);
  ------------------
  |  | 1250|  2.37k|#define umtx_lock U_ICU_ENTRY_POINT_RENAME(umtx_lock)
  |  |  ------------------
  |  |  |  |  123|  2.37k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  2.37k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  2.37k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  816|  2.37k|        mySharedConverterData = ucnv_load(pArgs, err);
  ------------------
  |  |  699|  2.37k|#define ucnv_load U_ICU_ENTRY_POINT_RENAME(ucnv_load)
  |  |  ------------------
  |  |  |  |  123|  2.37k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  2.37k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  2.37k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  817|  2.37k|        umtx_unlock(&cnvCacheMutex);
  ------------------
  |  | 1251|  2.37k|#define umtx_unlock U_ICU_ENTRY_POINT_RENAME(umtx_unlock)
  |  |  ------------------
  |  |  |  |  123|  2.37k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  2.37k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  2.37k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  818|  2.37k|        if (U_FAILURE (*err) || (mySharedConverterData == nullptr))
  ------------------
  |  Branch (818:13): [True: 19, False: 2.35k]
  |  Branch (818:33): [True: 0, False: 2.35k]
  ------------------
  819|     19|        {
  820|     19|            return nullptr;
  821|     19|        }
  822|  2.37k|    }
  823|       |
  824|  4.29k|    return mySharedConverterData;
  825|  4.31k|}
ucnv_createConverter_78:
  829|  3.01k|{
  830|  3.01k|    UConverterNamePieces stackPieces;
  831|  3.01k|    UConverterLoadArgs stackArgs=UCNV_LOAD_ARGS_INITIALIZER;
  ------------------
  |  |   62|  3.01k|    { (int32_t)sizeof(UConverterLoadArgs), 0, false, false, 0, 0, NULL, NULL, NULL }
  ------------------
  832|  3.01k|    UConverterSharedData *mySharedConverterData;
  833|       |
  834|  3.01k|    UTRACE_ENTRY_OC(UTRACE_UCNV_OPEN);
  835|       |
  836|  3.01k|    if(U_SUCCESS(*err)) {
  ------------------
  |  Branch (836:8): [True: 3.01k, False: 0]
  ------------------
  837|  3.01k|        UTRACE_DATA1(UTRACE_OPEN_CLOSE, "open converter %s", converterName);
  838|       |
  839|  3.01k|        mySharedConverterData = ucnv_loadSharedData(converterName, &stackPieces, &stackArgs, err);
  ------------------
  |  |  700|  3.01k|#define ucnv_loadSharedData U_ICU_ENTRY_POINT_RENAME(ucnv_loadSharedData)
  |  |  ------------------
  |  |  |  |  123|  3.01k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  3.01k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  3.01k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  840|       |
  841|  3.01k|        myUConverter = ucnv_createConverterFromSharedData(
  ------------------
  |  |  649|  3.01k|#define ucnv_createConverterFromSharedData U_ICU_ENTRY_POINT_RENAME(ucnv_createConverterFromSharedData)
  |  |  ------------------
  |  |  |  |  123|  3.01k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  3.01k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  3.01k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  842|  3.01k|            myUConverter, mySharedConverterData,
  843|  3.01k|            &stackArgs,
  844|  3.01k|            err);
  845|       |
  846|  3.01k|        if(U_SUCCESS(*err)) {
  ------------------
  |  Branch (846:12): [True: 2.99k, False: 19]
  ------------------
  847|  2.99k|            UTRACE_EXIT_PTR_STATUS(myUConverter, *err);
  848|  2.99k|            return myUConverter;
  849|  2.99k|        }
  850|  3.01k|    }
  851|       |
  852|       |    /* exit with error */
  853|     19|    UTRACE_EXIT_STATUS(*err);
  854|     19|    return nullptr;
  855|  3.01k|}
ucnv_createConverterFromSharedData_78:
  976|  3.01k|{
  977|  3.01k|    UBool isCopyLocal;
  978|       |
  979|  3.01k|    if(U_FAILURE(*err)) {
  ------------------
  |  Branch (979:8): [True: 19, False: 2.99k]
  ------------------
  980|     19|        ucnv_unloadSharedDataIfReady(mySharedConverterData);
  ------------------
  |  |  726|     19|#define ucnv_unloadSharedDataIfReady U_ICU_ENTRY_POINT_RENAME(ucnv_unloadSharedDataIfReady)
  |  |  ------------------
  |  |  |  |  123|     19|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|     19|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|     19|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  981|     19|        return myUConverter;
  982|     19|    }
  983|  2.99k|    if(myUConverter == nullptr)
  ------------------
  |  Branch (983:8): [True: 2.99k, False: 0]
  ------------------
  984|  2.99k|    {
  985|  2.99k|        myUConverter = (UConverter *) uprv_malloc (sizeof (UConverter));
  ------------------
  |  | 1524|  2.99k|#define uprv_malloc U_ICU_ENTRY_POINT_RENAME(uprv_malloc)
  |  |  ------------------
  |  |  |  |  123|  2.99k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  2.99k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  2.99k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  986|  2.99k|        if(myUConverter == nullptr)
  ------------------
  |  Branch (986:12): [True: 0, False: 2.99k]
  ------------------
  987|      0|        {
  988|      0|            *err = U_MEMORY_ALLOCATION_ERROR;
  989|      0|            ucnv_unloadSharedDataIfReady(mySharedConverterData);
  ------------------
  |  |  726|      0|#define ucnv_unloadSharedDataIfReady U_ICU_ENTRY_POINT_RENAME(ucnv_unloadSharedDataIfReady)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  990|      0|            return nullptr;
  991|      0|        }
  992|  2.99k|        isCopyLocal = false;
  993|  2.99k|    } else {
  994|      0|        isCopyLocal = true;
  995|      0|    }
  996|       |
  997|       |    /* initialize the converter */
  998|  2.99k|    uprv_memset(myUConverter, 0, sizeof(UConverter));
  ------------------
  |  |  100|  2.99k|#define uprv_memset(buffer, mark, size) U_STANDARD_CPP_NAMESPACE memset(buffer, mark, size)
  |  |  ------------------
  |  |  |  |  393|  2.99k|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  999|  2.99k|    myUConverter->isCopyLocal = isCopyLocal;
 1000|       |    /*myUConverter->isExtraLocal = false;*/ /* Set by the memset call */
 1001|  2.99k|    myUConverter->sharedData = mySharedConverterData;
 1002|  2.99k|    myUConverter->options = pArgs->options;
 1003|  2.99k|    if(!pArgs->onlyTestIsLoadable) {
  ------------------
  |  Branch (1003:8): [True: 2.99k, False: 0]
  ------------------
 1004|  2.99k|        myUConverter->preFromUFirstCP = U_SENTINEL;
  ------------------
  |  |  469|  2.99k|#define U_SENTINEL (-1)
  ------------------
 1005|  2.99k|        myUConverter->fromCharErrorBehaviour = UCNV_TO_U_DEFAULT_CALLBACK;
  ------------------
  |  |  134|  2.99k|#define UCNV_TO_U_DEFAULT_CALLBACK ((UConverterToUCallback) UCNV_TO_U_CALLBACK_SUBSTITUTE)
  |  |  ------------------
  |  |  |  |   78|  2.99k|#define UCNV_TO_U_CALLBACK_SUBSTITUTE U_ICU_ENTRY_POINT_RENAME(UCNV_TO_U_CALLBACK_SUBSTITUTE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  2.99k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  122|  2.99k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  121|  2.99k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1006|  2.99k|        myUConverter->fromUCharErrorBehaviour = UCNV_FROM_U_DEFAULT_CALLBACK;
  ------------------
  |  |  135|  2.99k|#define UCNV_FROM_U_DEFAULT_CALLBACK ((UConverterFromUCallback) UCNV_FROM_U_CALLBACK_SUBSTITUTE)
  |  |  ------------------
  |  |  |  |   74|  2.99k|#define UCNV_FROM_U_CALLBACK_SUBSTITUTE U_ICU_ENTRY_POINT_RENAME(UCNV_FROM_U_CALLBACK_SUBSTITUTE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  2.99k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  122|  2.99k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  121|  2.99k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1007|  2.99k|        myUConverter->toUnicodeStatus = mySharedConverterData->toUnicodeStatus;
 1008|  2.99k|        myUConverter->maxBytesPerUChar = mySharedConverterData->staticData->maxBytesPerChar;
 1009|  2.99k|        myUConverter->subChar1 = mySharedConverterData->staticData->subChar1;
 1010|  2.99k|        myUConverter->subCharLen = mySharedConverterData->staticData->subCharLen;
 1011|  2.99k|        myUConverter->subChars = (uint8_t *)myUConverter->subUChars;
 1012|  2.99k|        uprv_memcpy(myUConverter->subChars, mySharedConverterData->staticData->subChar, myUConverter->subCharLen);
  ------------------
  |  |   42|  2.99k|#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|  2.99k|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  |   43|  2.99k|    /* Suppress warnings about addresses that will never be NULL */ \
  |  |   44|  2.99k|    _Pragma("clang diagnostic push") \
  |  |   45|  2.99k|    _Pragma("clang diagnostic ignored \"-Waddress\"") \
  |  |   46|  2.99k|    U_ASSERT(dst != NULL); \
  |  |  ------------------
  |  |  |  |   35|  2.99k|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   47|  2.99k|    U_ASSERT(src != NULL); \
  |  |  ------------------
  |  |  |  |   35|  2.99k|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   48|  2.99k|    _Pragma("clang diagnostic pop") \
  |  |   49|  2.99k|    U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
  |  |  ------------------
  |  |  |  |  393|  2.99k|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  |  |   50|  2.99k|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|  2.99k|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1013|  2.99k|        myUConverter->toUCallbackReason = UCNV_ILLEGAL; /* default reason to invoke (*fromCharErrorBehaviour) */
 1014|  2.99k|    }
 1015|       |
 1016|  2.99k|    if(mySharedConverterData->impl->open != nullptr) {
  ------------------
  |  Branch (1016:8): [True: 2.72k, False: 271]
  ------------------
 1017|  2.72k|        mySharedConverterData->impl->open(myUConverter, pArgs, err);
 1018|  2.72k|        if(U_FAILURE(*err) && !pArgs->onlyTestIsLoadable) {
  ------------------
  |  Branch (1018:12): [True: 0, False: 2.72k]
  |  Branch (1018:31): [True: 0, False: 0]
  ------------------
 1019|       |            /* don't ucnv_close() if onlyTestIsLoadable because not fully initialized */
 1020|      0|            ucnv_close(myUConverter);
  ------------------
  |  |  639|      0|#define ucnv_close U_ICU_ENTRY_POINT_RENAME(ucnv_close)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1021|      0|            return nullptr;
 1022|      0|        }
 1023|  2.72k|    }
 1024|       |
 1025|  2.99k|    return myUConverter;
 1026|  2.99k|}
ucnv_bld.cpp:_ZL23createConverterFromFileP18UConverterLoadArgsP10UErrorCode:
  341|     29|{
  342|     29|    UDataMemory *data;
  343|     29|    UConverterSharedData *sharedData;
  344|       |
  345|     29|    UTRACE_ENTRY_OC(UTRACE_UCNV_LOAD);
  346|       |
  347|     29|    if (U_FAILURE (*err)) {
  ------------------
  |  Branch (347:9): [True: 0, False: 29]
  ------------------
  348|      0|        UTRACE_EXIT_STATUS(*err);
  349|      0|        return nullptr;
  350|      0|    }
  351|       |
  352|     29|    UTRACE_DATA2(UTRACE_OPEN_CLOSE, "load converter %s from package %s", pArgs->name, pArgs->pkg);
  353|       |
  354|     29|    data = udata_openChoice(pArgs->pkg, DATA_TYPE, pArgs->name, isCnvAcceptable, nullptr, err);
  ------------------
  |  |  894|     29|#define udata_openChoice U_ICU_ENTRY_POINT_RENAME(udata_openChoice)
  |  |  ------------------
  |  |  |  |  123|     29|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|     29|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|     29|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  355|     29|    if(U_FAILURE(*err))
  ------------------
  |  Branch (355:8): [True: 19, False: 10]
  ------------------
  356|     19|    {
  357|     19|        UTRACE_EXIT_STATUS(*err);
  358|     19|        return nullptr;
  359|     19|    }
  360|       |
  361|     10|    sharedData = ucnv_data_unFlattenClone(pArgs, data, err);
  362|     10|    if(U_FAILURE(*err))
  ------------------
  |  Branch (362:8): [True: 0, False: 10]
  ------------------
  363|      0|    {
  364|      0|        udata_close(data);
  ------------------
  |  |  885|      0|#define udata_close U_ICU_ENTRY_POINT_RENAME(udata_close)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  365|      0|        UTRACE_EXIT_STATUS(*err);
  366|      0|        return nullptr;
  367|      0|    }
  368|       |
  369|       |    /*
  370|       |     * TODO Store pkg in a field in the shared data so that delta-only converters
  371|       |     * can load base converters from the same package.
  372|       |     * If the pkg name is longer than the field, then either do not load the converter
  373|       |     * in the first place, or just set the pkg field to "".
  374|       |     */
  375|       |
  376|     10|    UTRACE_EXIT_PTR_STATUS(sharedData, *err);
  377|     10|    return sharedData;
  378|     10|}
ucnv_bld.cpp:_ZL15isCnvAcceptablePvPKcS1_PK9UDataInfo:
  272|     10|                const UDataInfo *pInfo) {
  273|     10|    return
  274|     10|        pInfo->size>=20 &&
  ------------------
  |  Branch (274:9): [True: 10, False: 0]
  ------------------
  275|     10|        pInfo->isBigEndian==U_IS_BIG_ENDIAN &&
  ------------------
  |  |  353|     20|#   define U_IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  ------------------
  |  Branch (275:9): [True: 10, False: 0]
  ------------------
  276|     10|        pInfo->charsetFamily==U_CHARSET_FAMILY &&
  ------------------
  |  |  588|     10|#   define U_CHARSET_FAMILY U_ASCII_FAMILY
  |  |  ------------------
  |  |  |  |  531|     20|#define U_ASCII_FAMILY 0
  |  |  ------------------
  ------------------
  |  Branch (276:9): [True: 10, False: 0]
  ------------------
  277|     10|        pInfo->sizeofUChar==U_SIZEOF_UCHAR &&
  ------------------
  |  |  352|     20|#define U_SIZEOF_UCHAR 2
  ------------------
  |  Branch (277:9): [True: 10, False: 0]
  ------------------
  278|     10|        pInfo->dataFormat[0]==0x63 &&   /* dataFormat="cnvt" */
  ------------------
  |  Branch (278:9): [True: 10, False: 0]
  ------------------
  279|     10|        pInfo->dataFormat[1]==0x6e &&
  ------------------
  |  Branch (279:9): [True: 10, False: 0]
  ------------------
  280|     10|        pInfo->dataFormat[2]==0x76 &&
  ------------------
  |  Branch (280:9): [True: 10, False: 0]
  ------------------
  281|     10|        pInfo->dataFormat[3]==0x74 &&
  ------------------
  |  Branch (281:9): [True: 10, False: 0]
  ------------------
  282|     10|        pInfo->formatVersion[0]==6;  /* Everything will be version 6 */
  ------------------
  |  Branch (282:9): [True: 10, False: 0]
  ------------------
  283|     10|}
ucnv_bld.cpp:_ZL24ucnv_data_unFlattenCloneP18UConverterLoadArgsP11UDataMemoryP10UErrorCode:
  290|     10|{
  291|       |    /* UDataInfo info; -- necessary only if some converters have different formatVersion */
  292|     10|    const uint8_t* raw = static_cast<const uint8_t*>(udata_getMemory(pData));
  ------------------
  |  |  891|     10|#define udata_getMemory U_ICU_ENTRY_POINT_RENAME(udata_getMemory)
  |  |  ------------------
  |  |  |  |  123|     10|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|     10|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|     10|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  293|     10|    const UConverterStaticData* source = reinterpret_cast<const UConverterStaticData*>(raw);
  294|     10|    UConverterSharedData *data;
  295|     10|    UConverterType type = static_cast<UConverterType>(source->conversionType);
  296|       |
  297|     10|    if(U_FAILURE(*status))
  ------------------
  |  Branch (297:8): [True: 0, False: 10]
  ------------------
  298|      0|        return nullptr;
  299|       |
  300|     10|    if (static_cast<uint16_t>(type) >= UCNV_NUMBER_OF_SUPPORTED_CONVERTER_TYPES ||
  ------------------
  |  Branch (300:9): [True: 0, False: 10]
  ------------------
  301|     10|        converterData[type] == nullptr ||
  ------------------
  |  Branch (301:9): [True: 0, False: 10]
  ------------------
  302|     10|        !converterData[type]->isReferenceCounted ||
  ------------------
  |  Branch (302:9): [True: 0, False: 10]
  ------------------
  303|     10|        converterData[type]->referenceCounter != 1 ||
  ------------------
  |  Branch (303:9): [True: 0, False: 10]
  ------------------
  304|     10|        source->structSize != sizeof(UConverterStaticData))
  ------------------
  |  Branch (304:9): [True: 0, False: 10]
  ------------------
  305|      0|    {
  306|      0|        *status = U_INVALID_TABLE_FORMAT;
  307|      0|        return nullptr;
  308|      0|    }
  309|       |
  310|     10|    data = static_cast<UConverterSharedData*>(uprv_malloc(sizeof(UConverterSharedData)));
  ------------------
  |  | 1524|     10|#define uprv_malloc U_ICU_ENTRY_POINT_RENAME(uprv_malloc)
  |  |  ------------------
  |  |  |  |  123|     10|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|     10|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|     10|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  311|     10|    if(data == nullptr) {
  ------------------
  |  Branch (311:8): [True: 0, False: 10]
  ------------------
  312|      0|        *status = U_MEMORY_ALLOCATION_ERROR;
  313|      0|        return nullptr;
  314|      0|    }
  315|       |
  316|       |    /* copy initial values from the static structure for this type */
  317|     10|    uprv_memcpy(data, converterData[type], sizeof(UConverterSharedData));
  ------------------
  |  |   42|     10|#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|     10|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  |   43|     10|    /* Suppress warnings about addresses that will never be NULL */ \
  |  |   44|     10|    _Pragma("clang diagnostic push") \
  |  |   45|     10|    _Pragma("clang diagnostic ignored \"-Waddress\"") \
  |  |   46|     10|    U_ASSERT(dst != NULL); \
  |  |  ------------------
  |  |  |  |   35|     10|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   47|     10|    U_ASSERT(src != NULL); \
  |  |  ------------------
  |  |  |  |   35|     10|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   48|     10|    _Pragma("clang diagnostic pop") \
  |  |   49|     10|    U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
  |  |  ------------------
  |  |  |  |  393|     10|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  |  |   50|     10|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|     10|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|       |
  319|     10|    data->staticData = source;
  320|       |
  321|     10|    data->sharedDataCached = false;
  322|       |
  323|       |    /* fill in fields from the loaded data */
  324|     10|    data->dataMemory = (void*)pData; /* for future use */
  325|       |
  326|     10|    if(data->impl->load != nullptr) {
  ------------------
  |  Branch (326:8): [True: 10, False: 0]
  ------------------
  327|     10|        data->impl->load(data, pArgs, raw + source->structSize, status);
  328|     10|        if(U_FAILURE(*status)) {
  ------------------
  |  Branch (328:12): [True: 0, False: 10]
  ------------------
  329|      0|            uprv_free(data);
  ------------------
  |  | 1503|      0|#define uprv_free U_ICU_ENTRY_POINT_RENAME(uprv_free)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  330|      0|            return nullptr;
  331|      0|        }
  332|     10|    }
  333|     10|    return data;
  334|     10|}
ucnv_bld.cpp:_ZL27ucnv_getSharedConverterDataPKc:
  484|  2.38k|{
  485|       |    /*special case when no Table has yet been created we return nullptr */
  486|  2.38k|    if (SHARED_DATA_HASHTABLE == nullptr)
  ------------------
  |  Branch (486:9): [True: 2, False: 2.37k]
  ------------------
  487|      2|    {
  488|      2|        return nullptr;
  489|      2|    }
  490|  2.37k|    else
  491|  2.37k|    {
  492|  2.37k|        UConverterSharedData *rc;
  493|       |
  494|  2.37k|        rc = static_cast<UConverterSharedData*>(uhash_get(SHARED_DATA_HASHTABLE, name));
  ------------------
  |  | 1007|  2.37k|#define uhash_get U_ICU_ENTRY_POINT_RENAME(uhash_get)
  |  |  ------------------
  |  |  |  |  123|  2.37k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  2.37k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  2.37k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  495|  2.37k|        UCNV_DEBUG_LOG("get",name,rc);
  496|  2.37k|        return rc;
  497|  2.37k|    }
  498|  2.38k|}
ucnv_bld.cpp:_ZL23ucnv_shareConverterDataP20UConverterSharedData:
  437|     10|{
  438|     10|    UErrorCode err = U_ZERO_ERROR;
  439|       |    /*Lazy evaluates the Hashtable itself */
  440|       |    /*void *sanity = nullptr;*/
  441|       |
  442|     10|    if (SHARED_DATA_HASHTABLE == nullptr)
  ------------------
  |  Branch (442:9): [True: 1, False: 9]
  ------------------
  443|      1|    {
  444|      1|        SHARED_DATA_HASHTABLE = uhash_openSize(uhash_hashChars, uhash_compareChars, nullptr,
  ------------------
  |  | 1031|      1|#define uhash_openSize U_ICU_ENTRY_POINT_RENAME(uhash_openSize)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      SHARED_DATA_HASHTABLE = uhash_openSize(uhash_hashChars, uhash_compareChars, nullptr,
  ------------------
  |  | 1011|      1|#define uhash_hashChars U_ICU_ENTRY_POINT_RENAME(uhash_hashChars)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      SHARED_DATA_HASHTABLE = uhash_openSize(uhash_hashChars, uhash_compareChars, nullptr,
  ------------------
  |  |  993|      1|#define uhash_compareChars U_ICU_ENTRY_POINT_RENAME(uhash_compareChars)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  445|      1|                            ucnv_io_countKnownConverters(&err)*UCNV_CACHE_LOAD_FACTOR,
  ------------------
  |  |  693|      1|#define ucnv_io_countKnownConverters U_ICU_ENTRY_POINT_RENAME(ucnv_io_countKnownConverters)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                          ucnv_io_countKnownConverters(&err)*UCNV_CACHE_LOAD_FACTOR,
  ------------------
  |  |  427|      1|#define UCNV_CACHE_LOAD_FACTOR 2
  ------------------
  446|      1|                            &err);
  447|      1|        ucnv_enableCleanup();
  ------------------
  |  |  651|      1|#define ucnv_enableCleanup U_ICU_ENTRY_POINT_RENAME(ucnv_enableCleanup)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  448|       |
  449|      1|        if (U_FAILURE(err))
  ------------------
  |  Branch (449:13): [True: 0, False: 1]
  ------------------
  450|      0|            return;
  451|      1|    }
  452|       |
  453|       |    /* ### check to see if the element is not already there! */
  454|       |
  455|       |    /*
  456|       |    sanity =   ucnv_getSharedConverterData (data->staticData->name);
  457|       |    if(sanity != nullptr)
  458|       |    {
  459|       |    UCNV_DEBUG_LOG("put:overwrite!",data->staticData->name,sanity);
  460|       |    }
  461|       |    UCNV_DEBUG_LOG("put:chk",data->staticData->name,sanity);
  462|       |    */
  463|       |
  464|       |    /* Mark it shared */
  465|     10|    data->sharedDataCached = true;
  466|       |
  467|     10|    uhash_put(SHARED_DATA_HASHTABLE,
  ------------------
  |  | 1032|     10|#define uhash_put U_ICU_ENTRY_POINT_RENAME(uhash_put)
  |  |  ------------------
  |  |  |  |  123|     10|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|     10|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|     10|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  468|     10|            (void*) data->staticData->name, /* Okay to cast away const as long as
  469|       |            keyDeleter == nullptr */
  470|     10|            data,
  471|     10|            &err);
  472|     10|    UCNV_DEBUG_LOG("put", data->staticData->name,data);
  473|       |
  474|     10|}
ucnv_bld.cpp:_ZL21parseConverterOptionsPKcP20UConverterNamePiecesP18UConverterLoadArgsP10UErrorCode:
  630|  4.92k|{
  631|  4.92k|    char *cnvName = pPieces->cnvName;
  632|  4.92k|    char c;
  633|  4.92k|    int32_t len = 0;
  634|       |
  635|  4.92k|    pArgs->name=inName;
  636|  4.92k|    pArgs->locale=pPieces->locale;
  637|  4.92k|    pArgs->options=pPieces->options;
  638|       |
  639|       |    /* copy the converter name itself to cnvName */
  640|  49.9k|    while((c=*inName)!=0 && c!=UCNV_OPTION_SEP_CHAR) {
  ------------------
  |  |  240|  46.0k|#define UCNV_OPTION_SEP_CHAR ','
  ------------------
  |  Branch (640:11): [True: 46.0k, False: 3.88k]
  |  Branch (640:29): [True: 44.9k, False: 1.04k]
  ------------------
  641|  44.9k|        if (++len>=UCNV_MAX_CONVERTER_NAME_LENGTH) {
  ------------------
  |  |   79|  44.9k|#define UCNV_MAX_CONVERTER_NAME_LENGTH 60
  ------------------
  |  Branch (641:13): [True: 0, False: 44.9k]
  ------------------
  642|      0|            *err = U_ILLEGAL_ARGUMENT_ERROR;    /* bad name */
  643|      0|            pPieces->cnvName[0]=0;
  644|      0|            return;
  645|      0|        }
  646|  44.9k|        *cnvName++=c;
  647|  44.9k|        inName++;
  648|  44.9k|    }
  649|  4.92k|    *cnvName=0;
  650|  4.92k|    pArgs->name=pPieces->cnvName;
  651|       |
  652|       |    /* parse options. No more name copying should occur. */
  653|  7.01k|    while((c=*inName)!=0) {
  ------------------
  |  Branch (653:11): [True: 2.09k, False: 4.92k]
  ------------------
  654|  2.09k|        if(c==UCNV_OPTION_SEP_CHAR) {
  ------------------
  |  |  240|  2.09k|#define UCNV_OPTION_SEP_CHAR ','
  ------------------
  |  Branch (654:12): [True: 2.09k, False: 0]
  ------------------
  655|  2.09k|            ++inName;
  656|  2.09k|        }
  657|       |
  658|       |        /* inName is behind an option separator */
  659|  2.09k|        if(uprv_strncmp(inName, "locale=", 7)==0) {
  ------------------
  |  |   44|  2.09k|#define uprv_strncmp(s1, s2, n) U_STANDARD_CPP_NAMESPACE strncmp(s1, s2, n)
  |  |  ------------------
  |  |  |  |  393|  2.09k|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (659:12): [True: 1.04k, False: 1.04k]
  ------------------
  660|       |            /* do not modify locale itself in case we have multiple locale options */
  661|  1.04k|            char *dest=pPieces->locale;
  662|       |
  663|       |            /* copy the locale option value */
  664|  1.04k|            inName+=7;
  665|  1.04k|            len=0;
  666|  3.13k|            while((c=*inName)!=0 && c!=UCNV_OPTION_SEP_CHAR) {
  ------------------
  |  |  240|  3.13k|#define UCNV_OPTION_SEP_CHAR ','
  ------------------
  |  Branch (666:19): [True: 3.13k, False: 0]
  |  Branch (666:37): [True: 2.09k, False: 1.04k]
  ------------------
  667|  2.09k|                ++inName;
  668|       |
  669|  2.09k|                if(++len>=ULOC_FULLNAME_CAPACITY) {
  ------------------
  |  |  264|  2.09k|#define ULOC_FULLNAME_CAPACITY 157
  ------------------
  |  Branch (669:20): [True: 0, False: 2.09k]
  ------------------
  670|      0|                    *err=U_ILLEGAL_ARGUMENT_ERROR;    /* bad name */
  671|      0|                    pPieces->locale[0]=0;
  672|      0|                    return;
  673|      0|                }
  674|       |
  675|  2.09k|                *dest++=c;
  676|  2.09k|            }
  677|  1.04k|            *dest=0;
  678|  1.04k|        } else if(uprv_strncmp(inName, "version=", 8)==0) {
  ------------------
  |  |   44|  1.04k|#define uprv_strncmp(s1, s2, n) U_STANDARD_CPP_NAMESPACE strncmp(s1, s2, n)
  |  |  ------------------
  |  |  |  |  393|  1.04k|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (678:19): [True: 1.04k, False: 0]
  ------------------
  679|       |            /* copy the version option value into bits 3..0 of pPieces->options */
  680|  1.04k|            inName+=8;
  681|  1.04k|            c=*inName;
  682|  1.04k|            if(c==0) {
  ------------------
  |  Branch (682:16): [True: 0, False: 1.04k]
  ------------------
  683|      0|                pArgs->options=(pPieces->options&=~UCNV_OPTION_VERSION);
  ------------------
  |  |   44|      0|#define UCNV_OPTION_VERSION     0xf
  ------------------
  684|      0|                return;
  685|  1.04k|            } else if (static_cast<uint8_t>(c - '0') < 10) {
  ------------------
  |  Branch (685:24): [True: 1.04k, False: 0]
  ------------------
  686|  1.04k|                pArgs->options = pPieces->options = (pPieces->options & ~UCNV_OPTION_VERSION) | static_cast<uint32_t>(c - '0');
  ------------------
  |  |   44|  1.04k|#define UCNV_OPTION_VERSION     0xf
  ------------------
  687|  1.04k|                ++inName;
  688|  1.04k|            }
  689|  1.04k|        } else if(uprv_strncmp(inName, "swaplfnl", 8)==0) {
  ------------------
  |  |   44|      0|#define uprv_strncmp(s1, s2, n) U_STANDARD_CPP_NAMESPACE strncmp(s1, s2, n)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (689:19): [True: 0, False: 0]
  ------------------
  690|      0|            inName+=8;
  691|      0|            pArgs->options=(pPieces->options|=UCNV_OPTION_SWAP_LFNL);
  ------------------
  |  |   45|      0|#define UCNV_OPTION_SWAP_LFNL   0x10
  ------------------
  692|       |        /* add processing for new options here with another } else if(uprv_strncmp(inName, "option-name=", XX)==0) { */
  693|      0|        } else {
  694|       |            /* ignore any other options until we define some */
  695|      0|            while(((c = *inName++) != 0) && (c != UCNV_OPTION_SEP_CHAR)) {
  ------------------
  |  |  240|      0|#define UCNV_OPTION_SEP_CHAR ','
  ------------------
  |  Branch (695:19): [True: 0, False: 0]
  |  Branch (695:45): [True: 0, False: 0]
  ------------------
  696|      0|            }
  697|      0|            if(c==0) {
  ------------------
  |  Branch (697:16): [True: 0, False: 0]
  ------------------
  698|      0|                return;
  699|      0|            }
  700|      0|        }
  701|  2.09k|    }
  702|  4.92k|}
ucnv_bld.cpp:_ZL26getAlgorithmicTypeFromNamePKc:
  384|  4.31k|{
  385|  4.31k|    uint32_t mid, start, limit;
  386|  4.31k|    uint32_t lastMid;
  387|  4.31k|    int result;
  388|  4.31k|    char strippedName[UCNV_MAX_CONVERTER_NAME_LENGTH];
  389|       |
  390|       |    /* Lower case and remove ignoreable characters. */
  391|  4.31k|    ucnv_io_stripForCompare(strippedName, realName);
  ------------------
  |  |   73|  4.31k|#   define ucnv_io_stripForCompare ucnv_io_stripASCIIForCompare
  |  |  ------------------
  |  |  |  |  695|  4.31k|#define ucnv_io_stripASCIIForCompare U_ICU_ENTRY_POINT_RENAME(ucnv_io_stripASCIIForCompare)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  4.31k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  122|  4.31k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  121|  4.31k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  392|       |
  393|       |    /* do a binary search for the alias */
  394|  4.31k|    start = 0;
  395|  4.31k|    limit = UPRV_LENGTHOF(cnvNameType);
  ------------------
  |  |   99|  4.31k|#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
  ------------------
  396|  4.31k|    mid = limit;
  397|  4.31k|    lastMid = UINT32_MAX;
  398|       |
  399|  25.5k|    for (;;) {
  400|  25.5k|        mid = (start + limit) / 2;
  401|  25.5k|        if (lastMid == mid) {   /* Have we moved? */
  ------------------
  |  Branch (401:13): [True: 2.37k, False: 23.1k]
  ------------------
  402|  2.37k|            break;  /* We haven't moved, and it wasn't found. */
  403|  2.37k|        }
  404|  23.1k|        lastMid = mid;
  405|  23.1k|        result = uprv_strcmp(strippedName, cnvNameType[mid].name);
  ------------------
  |  |   38|  23.1k|#define uprv_strcmp(s1, s2) U_STANDARD_CPP_NAMESPACE strcmp(s1, s2)
  |  |  ------------------
  |  |  |  |  393|  23.1k|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  406|       |
  407|  23.1k|        if (result < 0) {
  ------------------
  |  Branch (407:13): [True: 13.1k, False: 9.96k]
  ------------------
  408|  13.1k|            limit = mid;
  409|  13.1k|        } else if (result > 0) {
  ------------------
  |  Branch (409:20): [True: 8.03k, False: 1.93k]
  ------------------
  410|  8.03k|            start = mid;
  411|  8.03k|        } else {
  412|  1.93k|            return converterData[cnvNameType[mid].type];
  413|  1.93k|        }
  414|  23.1k|    }
  415|       |
  416|  2.37k|    return nullptr;
  417|  4.31k|}

ucnv_cbToUWriteUChars_78:
  233|  4.93M|{
  234|  4.93M|    if(U_FAILURE(*err)) {
  ------------------
  |  Branch (234:8): [True: 0, False: 4.93M]
  ------------------
  235|      0|        return;
  236|      0|    }
  237|       |
  238|  4.93M|    ucnv_toUWriteUChars(
  ------------------
  |  |  723|  4.93M|#define ucnv_toUWriteUChars U_ICU_ENTRY_POINT_RENAME(ucnv_toUWriteUChars)
  |  |  ------------------
  |  |  |  |  123|  4.93M|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  4.93M|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  4.93M|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  239|  4.93M|        args->converter,
  240|  4.93M|        source, length,
  241|  4.93M|        &args->target, args->targetLimit,
  242|  4.93M|        &args->offsets, offsetIndex,
  243|  4.93M|        err);
  244|  4.93M|}
ucnv_cbToUWriteSub_78:
  250|  4.93M|{
  251|  4.93M|    static const char16_t kSubstituteChar1 = 0x1A, kSubstituteChar = 0xFFFD;
  252|       |
  253|       |    /* could optimize this case, just one uchar */
  254|  4.93M|    if(args->converter->invalidCharLength == 1 && args->converter->subChar1 != 0) {
  ------------------
  |  Branch (254:8): [True: 3.55M, False: 1.37M]
  |  Branch (254:51): [True: 0, False: 3.55M]
  ------------------
  255|      0|        ucnv_cbToUWriteUChars(args, &kSubstituteChar1, 1, offsetIndex, err);
  ------------------
  |  |  637|      0|#define ucnv_cbToUWriteUChars U_ICU_ENTRY_POINT_RENAME(ucnv_cbToUWriteUChars)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|  4.93M|    } else {
  257|  4.93M|        ucnv_cbToUWriteUChars(args, &kSubstituteChar, 1, offsetIndex, err);
  ------------------
  |  |  637|  4.93M|#define ucnv_cbToUWriteUChars U_ICU_ENTRY_POINT_RENAME(ucnv_cbToUWriteUChars)
  |  |  ------------------
  |  |  |  |  123|  4.93M|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  4.93M|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  4.93M|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  258|  4.93M|    }
  259|  4.93M|}

ucnv_toUWriteUChars_78:
  100|  4.93M|                    UErrorCode *pErrorCode) {
  101|  4.93M|    char16_t *t=*target;
  102|  4.93M|    int32_t *o;
  103|       |
  104|       |    /* write UChars */
  105|  4.93M|    if(offsets==nullptr || (o=*offsets)==nullptr) {
  ------------------
  |  Branch (105:8): [True: 0, False: 4.93M]
  |  Branch (105:28): [True: 4.93M, False: 0]
  ------------------
  106|  9.86M|        while(length>0 && t<targetLimit) {
  ------------------
  |  Branch (106:15): [True: 4.93M, False: 4.93M]
  |  Branch (106:27): [True: 4.93M, False: 0]
  ------------------
  107|  4.93M|            *t++=*uchars++;
  108|  4.93M|            --length;
  109|  4.93M|        }
  110|  4.93M|    } else {
  111|       |        /* output with offsets */
  112|      0|        while(length>0 && t<targetLimit) {
  ------------------
  |  Branch (112:15): [True: 0, False: 0]
  |  Branch (112:27): [True: 0, False: 0]
  ------------------
  113|      0|            *t++=*uchars++;
  114|      0|            *o++=sourceIndex;
  115|      0|            --length;
  116|      0|        }
  117|      0|        *offsets=o;
  118|      0|    }
  119|  4.93M|    *target=t;
  120|       |
  121|       |    /* write overflow */
  122|  4.93M|    if(length>0) {
  ------------------
  |  Branch (122:8): [True: 0, False: 4.93M]
  ------------------
  123|      0|        if(cnv!=nullptr) {
  ------------------
  |  Branch (123:12): [True: 0, False: 0]
  ------------------
  124|      0|            t=cnv->UCharErrorBuffer;
  125|      0|            cnv->UCharErrorBufferLength=(int8_t)length;
  126|      0|            do {
  127|      0|                *t++=*uchars++;
  128|      0|            } while(--length>0);
  ------------------
  |  Branch (128:21): [True: 0, False: 0]
  ------------------
  129|      0|        }
  130|      0|        *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
  131|      0|    }
  132|  4.93M|}
ucnv_toUWriteCodePoint_78:
  140|  4.97k|                       UErrorCode *pErrorCode) {
  141|  4.97k|    char16_t *t;
  142|  4.97k|    int32_t *o;
  143|       |
  144|  4.97k|    t=*target;
  145|       |
  146|  4.97k|    if(t<targetLimit) {
  ------------------
  |  Branch (146:8): [True: 4.97k, False: 0]
  ------------------
  147|  4.97k|        if(c<=0xffff) {
  ------------------
  |  Branch (147:12): [True: 4.08k, False: 892]
  ------------------
  148|  4.08k|            *t++=(char16_t)c;
  149|  4.08k|            c=U_SENTINEL;
  ------------------
  |  |  469|  4.08k|#define U_SENTINEL (-1)
  ------------------
  150|  4.08k|        } else /* c is a supplementary code point */ {
  151|    892|            *t++=U16_LEAD(c);
  ------------------
  |  |  123|    892|#define U16_LEAD(supplementary) (UChar)(((supplementary)>>10)+0xd7c0)
  ------------------
  152|    892|            c=U16_TRAIL(c);
  ------------------
  |  |  132|    892|#define U16_TRAIL(supplementary) (UChar)(((supplementary)&0x3ff)|0xdc00)
  ------------------
  153|    892|            if(t<targetLimit) {
  ------------------
  |  Branch (153:16): [True: 892, False: 0]
  ------------------
  154|    892|                *t++=(char16_t)c;
  155|    892|                c=U_SENTINEL;
  ------------------
  |  |  469|    892|#define U_SENTINEL (-1)
  ------------------
  156|    892|            }
  157|    892|        }
  158|       |
  159|       |        /* write offsets */
  160|  4.97k|        if(offsets!=nullptr && (o=*offsets)!=nullptr) {
  ------------------
  |  Branch (160:12): [True: 4.97k, False: 0]
  |  Branch (160:32): [True: 0, False: 4.97k]
  ------------------
  161|      0|            *o++=sourceIndex;
  162|      0|            if((*target+1)<t) {
  ------------------
  |  Branch (162:16): [True: 0, False: 0]
  ------------------
  163|      0|                *o++=sourceIndex;
  164|      0|            }
  165|      0|            *offsets=o;
  166|      0|        }
  167|  4.97k|    }
  168|       |
  169|  4.97k|    *target=t;
  170|       |
  171|       |    /* write overflow from c */
  172|  4.97k|    if(c>=0) {
  ------------------
  |  Branch (172:8): [True: 0, False: 4.97k]
  ------------------
  173|      0|        if(cnv!=nullptr) {
  ------------------
  |  Branch (173:12): [True: 0, False: 0]
  ------------------
  174|      0|            int8_t i=0;
  175|      0|            U16_APPEND_UNSAFE(cnv->UCharErrorBuffer, i, c);
  ------------------
  |  |  367|      0|#define U16_APPEND_UNSAFE(s, i, c) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|      0|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  |  368|      0|    if((uint32_t)(c)<=0xffff) { \
  |  |  ------------------
  |  |  |  Branch (368:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  369|      0|        (s)[(i)++]=(uint16_t)(c); \
  |  |  370|      0|    } else { \
  |  |  371|      0|        (s)[(i)++]=(uint16_t)(((c)>>10)+0xd7c0); \
  |  |  372|      0|        (s)[(i)++]=(uint16_t)(((c)&0x3ff)|0xdc00); \
  |  |  373|      0|    } \
  |  |  374|      0|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|      0|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  176|      0|            cnv->UCharErrorBufferLength=i;
  177|      0|        }
  178|      0|        *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
  179|      0|    }
  180|  4.97k|}

UCNV_TO_U_CALLBACK_SUBSTITUTE_78:
  389|  4.93M|{
  390|  4.93M|    (void)codeUnits;
  391|  4.93M|    (void)length;
  392|  4.93M|    if (reason <= UCNV_IRREGULAR)
  ------------------
  |  Branch (392:9): [True: 4.93M, False: 0]
  ------------------
  393|  4.93M|    {
  394|  4.93M|        if (context == nullptr || (*((char*)context) == UCNV_PRV_STOP_ON_ILLEGAL && reason == UCNV_UNASSIGNED))
  ------------------
  |  |   53|      0|#define UCNV_PRV_STOP_ON_ILLEGAL    'i'
  ------------------
  |  Branch (394:13): [True: 4.93M, False: 0]
  |  Branch (394:36): [True: 0, False: 0]
  |  Branch (394:85): [True: 0, False: 0]
  ------------------
  395|  4.93M|        {
  396|  4.93M|            *err = U_ZERO_ERROR;
  397|  4.93M|            ucnv_cbToUWriteSub(toArgs,0,err);
  ------------------
  |  |  636|  4.93M|#define ucnv_cbToUWriteSub U_ICU_ENTRY_POINT_RENAME(ucnv_cbToUWriteSub)
  |  |  ------------------
  |  |  |  |  123|  4.93M|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  4.93M|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  4.93M|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  398|  4.93M|        }
  399|       |        /* else the caller must have set the error code accordingly. */
  400|  4.93M|    }
  401|       |    /* else ignore the reset, close and clone calls. */
  402|  4.93M|}

ucnv_extInitialMatchToU_78:
  285|  7.06k|                        UErrorCode *pErrorCode) {
  286|  7.06k|    uint32_t value = 0;  /* initialize output-only param to 0 to silence gcc */
  287|  7.06k|    int32_t match;
  288|       |
  289|       |    /* try to match */
  290|  7.06k|    match=ucnv_extMatchToU(cx, (int8_t)UCNV_SISO_STATE(cnv),
  ------------------
  |  |  272|  7.06k|    ((cnv)->sharedData->mbcs.outputType==MBCS_OUTPUT_2_SISO ? (int8_t)(cnv)->mode : \
  |  |  ------------------
  |  |  |  Branch (272:6): [True: 0, False: 7.06k]
  |  |  ------------------
  |  |  273|  7.06k|     (cnv)->sharedData->mbcs.outputType==MBCS_OUTPUT_DBCS_ONLY ? 1 : -1)
  |  |  ------------------
  |  |  |  Branch (273:6): [True: 0, False: 7.06k]
  |  |  ------------------
  ------------------
  291|  7.06k|                           (const char *)cnv->toUBytes, firstLength,
  292|  7.06k|                           *src, (int32_t)(srcLimit-*src),
  293|  7.06k|                           &value,
  294|  7.06k|                           cnv->useFallback, flush);
  295|  7.06k|    if(match>0) {
  ------------------
  |  Branch (295:8): [True: 592, False: 6.47k]
  ------------------
  296|       |        /* advance src pointer for the consumed input */
  297|    592|        *src+=match-firstLength;
  298|       |
  299|       |        /* write result to target */
  300|    592|        ucnv_extWriteToU(cnv, cx,
  301|    592|                         value,
  302|    592|                         target, targetLimit,
  303|    592|                         offsets, srcIndex,
  304|    592|                         pErrorCode);
  305|    592|        return true;
  306|  6.47k|    } else if(match<0) {
  ------------------
  |  Branch (306:15): [True: 0, False: 6.47k]
  ------------------
  307|       |        /* save state for partial match */
  308|      0|        const char *s;
  309|      0|        int32_t j;
  310|       |
  311|       |        /* copy the first code point */
  312|      0|        s=(const char *)cnv->toUBytes;
  313|      0|        cnv->preToUFirstLength=(int8_t)firstLength;
  314|      0|        for(j=0; j<firstLength; ++j) {
  ------------------
  |  Branch (314:18): [True: 0, False: 0]
  ------------------
  315|      0|            cnv->preToU[j]=*s++;
  316|      0|        }
  317|       |
  318|       |        /* now copy the newly consumed input */
  319|      0|        s=*src;
  320|      0|        match=-match;
  321|      0|        for(; j<match; ++j) {
  ------------------
  |  Branch (321:15): [True: 0, False: 0]
  ------------------
  322|      0|            cnv->preToU[j]=*s++;
  323|      0|        }
  324|      0|        *src=s; /* same as *src=srcLimit; because we reached the end of input */
  325|      0|        cnv->preToULength=(int8_t)match;
  326|      0|        return true;
  327|  6.47k|    } else /* match==0 no match */ {
  328|  6.47k|        return false;
  329|  6.47k|    }
  330|  7.06k|}
ucnv_extSimpleMatchToU_78:
  335|  11.1k|                       UBool useFallback) {
  336|  11.1k|    uint32_t value = 0;  /* initialize output-only param to 0 to silence gcc */
  337|  11.1k|    int32_t match;
  338|       |
  339|  11.1k|    if(length<=0) {
  ------------------
  |  Branch (339:8): [True: 0, False: 11.1k]
  ------------------
  340|      0|        return 0xffff;
  341|      0|    }
  342|       |
  343|       |    /* try to match */
  344|  11.1k|    match=ucnv_extMatchToU(cx, -1,
  345|  11.1k|                           source, length,
  346|  11.1k|                           nullptr, 0,
  347|  11.1k|                           &value,
  348|  11.1k|                           useFallback, true);
  349|  11.1k|    if(match==length) {
  ------------------
  |  Branch (349:8): [True: 2.16k, False: 9.00k]
  ------------------
  350|       |        /* write result for simple, single-character conversion */
  351|  2.16k|        if(UCNV_EXT_TO_U_IS_CODE_POINT(value)) {
  ------------------
  |  |  433|  2.16k|#define UCNV_EXT_TO_U_IS_CODE_POINT(value) ((value)<=UCNV_EXT_TO_U_MAX_CODE_POINT)
  |  |  ------------------
  |  |  |  |  412|  2.16k|#define UCNV_EXT_TO_U_MAX_CODE_POINT 0x2fffff
  |  |  ------------------
  |  |  |  Branch (433:44): [True: 2.16k, False: 0]
  |  |  ------------------
  ------------------
  352|  2.16k|            return UCNV_EXT_TO_U_GET_CODE_POINT(value);
  ------------------
  |  |  434|  2.16k|#define UCNV_EXT_TO_U_GET_CODE_POINT(value) ((value)-UCNV_EXT_TO_U_MIN_CODE_POINT)
  |  |  ------------------
  |  |  |  |  411|  2.16k|#define UCNV_EXT_TO_U_MIN_CODE_POINT 0x1f0000
  |  |  ------------------
  ------------------
  353|  2.16k|        }
  354|  2.16k|    }
  355|       |
  356|       |    /*
  357|       |     * return no match because
  358|       |     * - match>0 && value points to string: simple conversion cannot handle multiple code points
  359|       |     * - match>0 && match!=length: not all input consumed, forbidden for this function
  360|       |     * - match==0: no match found in the first place
  361|       |     * - match<0: partial match, not supported for simple conversion (and flush==true)
  362|       |     */
  363|  9.00k|    return 0xfffe;
  364|  11.1k|}
ucnv_ext.cpp:_ZL16ucnv_extMatchToUPKiaPKciS2_iPjaa:
  128|  18.2k|                 UBool /*useFallback*/, UBool flush) {
  129|  18.2k|    const uint32_t *toUTable, *toUSection;
  130|       |
  131|  18.2k|    uint32_t value, matchValue;
  132|  18.2k|    int32_t i, j, idx, length, matchLength;
  133|  18.2k|    uint8_t b;
  134|       |
  135|  18.2k|    if(cx==nullptr || cx[UCNV_EXT_TO_U_LENGTH]<=0) {
  ------------------
  |  Branch (135:8): [True: 0, False: 18.2k]
  |  Branch (135:23): [True: 0, False: 18.2k]
  ------------------
  136|      0|        return 0; /* no extension data, no match */
  137|      0|    }
  138|       |
  139|       |    /* initialize */
  140|  18.2k|    toUTable=UCNV_EXT_ARRAY(cx, UCNV_EXT_TO_U_INDEX, uint32_t);
  ------------------
  |  |  345|  18.2k|    ((const itemType *)((const char *)(indexes)+(indexes)[index]))
  ------------------
  141|  18.2k|    idx=0;
  142|       |
  143|  18.2k|    matchValue=0;
  144|  18.2k|    i=j=matchLength=0;
  145|       |
  146|  18.2k|    if(sisoState==0) {
  ------------------
  |  Branch (146:8): [True: 0, False: 18.2k]
  ------------------
  147|       |        /* SBCS state of an SI/SO stateful converter, look at only exactly 1 byte */
  148|      0|        if(preLength>1) {
  ------------------
  |  Branch (148:12): [True: 0, False: 0]
  ------------------
  149|      0|            return 0; /* no match of a DBCS sequence in SBCS mode */
  150|      0|        } else if(preLength==1) {
  ------------------
  |  Branch (150:19): [True: 0, False: 0]
  ------------------
  151|      0|            srcLength=0;
  152|      0|        } else /* preLength==0 */ {
  153|      0|            if(srcLength>1) {
  ------------------
  |  Branch (153:16): [True: 0, False: 0]
  ------------------
  154|      0|                srcLength=1;
  155|      0|            }
  156|      0|        }
  157|      0|        flush=true;
  158|      0|    }
  159|       |
  160|       |    /* we must not remember fallback matches when not using fallbacks */
  161|       |
  162|       |    /* match input units until there is a full match or the input is consumed */
  163|  22.0k|    for(;;) {
  164|       |        /* go to the next section */
  165|  22.0k|        toUSection=toUTable+idx;
  166|       |
  167|       |        /* read first pair of the section */
  168|  22.0k|        value=*toUSection++;
  169|  22.0k|        length=UCNV_EXT_TO_U_GET_BYTE(value);
  ------------------
  |  |  423|  22.0k|#define UCNV_EXT_TO_U_GET_BYTE(word) ((word)>>UCNV_EXT_TO_U_BYTE_SHIFT)
  |  |  ------------------
  |  |  |  |  409|  22.0k|#define UCNV_EXT_TO_U_BYTE_SHIFT 24
  |  |  ------------------
  ------------------
  170|  22.0k|        value=UCNV_EXT_TO_U_GET_VALUE(value);
  ------------------
  |  |  424|  22.0k|#define UCNV_EXT_TO_U_GET_VALUE(word) ((word)&UCNV_EXT_TO_U_VALUE_MASK)
  |  |  ------------------
  |  |  |  |  410|  22.0k|#define UCNV_EXT_TO_U_VALUE_MASK 0xffffff
  |  |  ------------------
  ------------------
  171|  22.0k|        if( value!=0 &&
  ------------------
  |  Branch (171:13): [True: 0, False: 22.0k]
  ------------------
  172|  22.0k|            (UCNV_EXT_TO_U_IS_ROUNDTRIP(value) ||
  ------------------
  |  |  429|      0|#define UCNV_EXT_TO_U_IS_ROUNDTRIP(value) (((value)&UCNV_EXT_TO_U_ROUNDTRIP_FLAG)!=0)
  |  |  ------------------
  |  |  |  |  413|      0|#define UCNV_EXT_TO_U_ROUNDTRIP_FLAG ((uint32_t)1<<23)
  |  |  ------------------
  |  |  |  Branch (429:43): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  173|      0|             TO_U_USE_FALLBACK(useFallback)) &&
  ------------------
  |  |  270|      0|#define TO_U_USE_FALLBACK(useFallback) true
  |  |  ------------------
  |  |  |  Branch (270:40): [Folded - Ignored]
  |  |  ------------------
  ------------------
  174|  22.0k|            UCNV_EXT_TO_U_VERIFY_SISO_MATCH(sisoState, i+j)
  ------------------
  |  |  115|      0|    ((sisoState)<0 || ((sisoState)==0) == (match==1))
  |  |  ------------------
  |  |  |  Branch (115:6): [True: 0, False: 0]
  |  |  |  Branch (115:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  175|  22.0k|        ) {
  176|       |            /* remember longest match so far */
  177|      0|            matchValue=value;
  178|      0|            matchLength=i+j;
  179|      0|        }
  180|       |
  181|       |        /* match pre[] then src[] */
  182|  22.0k|        if(i<preLength) {
  ------------------
  |  Branch (182:12): [True: 22.0k, False: 0]
  ------------------
  183|  22.0k|            b = static_cast<uint8_t>(pre[i++]);
  184|  22.0k|        } else if(j<srcLength) {
  ------------------
  |  Branch (184:19): [True: 0, False: 0]
  ------------------
  185|      0|            b = static_cast<uint8_t>(src[j++]);
  186|      0|        } else {
  187|       |            /* all input consumed, partial match */
  188|      0|            if(flush || (length=(i+j))>UCNV_EXT_MAX_BYTES) {
  ------------------
  |  |  465|      0|#define UCNV_EXT_MAX_BYTES 0x1f
  ------------------
  |  Branch (188:16): [True: 0, False: 0]
  |  Branch (188:25): [True: 0, False: 0]
  ------------------
  189|       |                /*
  190|       |                 * end of the entire input stream, stop with the longest match so far
  191|       |                 * or: partial match must not be longer than UCNV_EXT_MAX_BYTES
  192|       |                 * because it must fit into state buffers
  193|       |                 */
  194|      0|                break;
  195|      0|            } else {
  196|       |                /* continue with more input next time */
  197|      0|                return -length;
  198|      0|            }
  199|      0|        }
  200|       |
  201|       |        /* search for the current char16_t */
  202|  22.0k|        value=ucnv_extFindToU(toUSection, length, b);
  203|  22.0k|        if(value==0) {
  ------------------
  |  Branch (203:12): [True: 15.4k, False: 6.57k]
  ------------------
  204|       |            /* no match here, stop with the longest match so far */
  205|  15.4k|            break;
  206|  15.4k|        } else {
  207|  6.57k|            if(UCNV_EXT_TO_U_IS_PARTIAL(value)) {
  ------------------
  |  |  426|  6.57k|#define UCNV_EXT_TO_U_IS_PARTIAL(value) ((value)<UCNV_EXT_TO_U_MIN_CODE_POINT)
  |  |  ------------------
  |  |  |  |  411|  6.57k|#define UCNV_EXT_TO_U_MIN_CODE_POINT 0x1f0000
  |  |  ------------------
  |  |  |  Branch (426:41): [True: 3.81k, False: 2.75k]
  |  |  ------------------
  ------------------
  208|       |                /* partial match, continue */
  209|  3.81k|                idx = static_cast<int32_t>(UCNV_EXT_TO_U_GET_PARTIAL_INDEX(value));
  ------------------
  |  |  427|  3.81k|#define UCNV_EXT_TO_U_GET_PARTIAL_INDEX(value) (value)
  ------------------
  210|  3.81k|            } else {
  211|  2.75k|                if( (UCNV_EXT_TO_U_IS_ROUNDTRIP(value) ||
  ------------------
  |  |  429|  5.51k|#define UCNV_EXT_TO_U_IS_ROUNDTRIP(value) (((value)&UCNV_EXT_TO_U_ROUNDTRIP_FLAG)!=0)
  |  |  ------------------
  |  |  |  |  413|  2.75k|#define UCNV_EXT_TO_U_ROUNDTRIP_FLAG ((uint32_t)1<<23)
  |  |  ------------------
  |  |  |  Branch (429:43): [True: 1.97k, False: 784]
  |  |  ------------------
  ------------------
  212|  2.75k|                     TO_U_USE_FALLBACK(useFallback)) &&
  ------------------
  |  |  270|    784|#define TO_U_USE_FALLBACK(useFallback) true
  |  |  ------------------
  |  |  |  Branch (270:40): [Folded - Ignored]
  |  |  ------------------
  ------------------
  213|  2.75k|                    UCNV_EXT_TO_U_VERIFY_SISO_MATCH(sisoState, i+j)
  ------------------
  |  |  115|  2.75k|    ((sisoState)<0 || ((sisoState)==0) == (match==1))
  |  |  ------------------
  |  |  |  Branch (115:6): [True: 2.75k, False: 0]
  |  |  |  Branch (115:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  214|  2.75k|                ) {
  215|       |                    /* full match, stop with result */
  216|  2.75k|                    matchValue=value;
  217|  2.75k|                    matchLength=i+j;
  218|  2.75k|                } else {
  219|       |                    /* full match on fallback not taken, stop with the longest match so far */
  220|      0|                }
  221|  2.75k|                break;
  222|  2.75k|            }
  223|  6.57k|        }
  224|  22.0k|    }
  225|       |
  226|  18.2k|    if(matchLength==0) {
  ------------------
  |  Branch (226:8): [True: 15.4k, False: 2.75k]
  ------------------
  227|       |        /* no match at all */
  228|  15.4k|        return 0;
  229|  15.4k|    }
  230|       |
  231|       |    /* return result */
  232|  2.75k|    *pMatchValue=UCNV_EXT_TO_U_MASK_ROUNDTRIP(matchValue);
  ------------------
  |  |  430|  2.75k|#define UCNV_EXT_TO_U_MASK_ROUNDTRIP(value) ((value)&~UCNV_EXT_TO_U_ROUNDTRIP_FLAG)
  |  |  ------------------
  |  |  |  |  413|  2.75k|#define UCNV_EXT_TO_U_ROUNDTRIP_FLAG ((uint32_t)1<<23)
  |  |  ------------------
  ------------------
  233|  2.75k|    return matchLength;
  234|  18.2k|}
ucnv_ext.cpp:_ZL15ucnv_extFindToUPKjih:
   39|  22.0k|ucnv_extFindToU(const uint32_t *toUSection, int32_t length, uint8_t byte) {
   40|  22.0k|    uint32_t word0, word;
   41|  22.0k|    int32_t i, start, limit;
   42|       |
   43|       |    /* check the input byte against the lowest and highest section bytes */
   44|  22.0k|    start = static_cast<int32_t>(UCNV_EXT_TO_U_GET_BYTE(toUSection[0]));
  ------------------
  |  |  423|  22.0k|#define UCNV_EXT_TO_U_GET_BYTE(word) ((word)>>UCNV_EXT_TO_U_BYTE_SHIFT)
  |  |  ------------------
  |  |  |  |  409|  22.0k|#define UCNV_EXT_TO_U_BYTE_SHIFT 24
  |  |  ------------------
  ------------------
   45|  22.0k|    limit = static_cast<int32_t>(UCNV_EXT_TO_U_GET_BYTE(toUSection[length - 1]));
  ------------------
  |  |  423|  22.0k|#define UCNV_EXT_TO_U_GET_BYTE(word) ((word)>>UCNV_EXT_TO_U_BYTE_SHIFT)
  |  |  ------------------
  |  |  |  |  409|  22.0k|#define UCNV_EXT_TO_U_BYTE_SHIFT 24
  |  |  ------------------
  ------------------
   46|  22.0k|    if(byte<start || limit<byte) {
  ------------------
  |  Branch (46:8): [True: 612, False: 21.4k]
  |  Branch (46:22): [True: 9.14k, False: 12.2k]
  ------------------
   47|  9.75k|        return 0; /* the byte is out of range */
   48|  9.75k|    }
   49|       |
   50|  12.2k|    if(length==((limit-start)+1)) {
  ------------------
  |  Branch (50:8): [True: 10.9k, False: 1.31k]
  ------------------
   51|       |        /* direct access on a linear array */
   52|  10.9k|        return UCNV_EXT_TO_U_GET_VALUE(toUSection[byte-start]); /* could be 0 */
  ------------------
  |  |  424|  10.9k|#define UCNV_EXT_TO_U_GET_VALUE(word) ((word)&UCNV_EXT_TO_U_VALUE_MASK)
  |  |  ------------------
  |  |  |  |  410|  10.9k|#define UCNV_EXT_TO_U_VALUE_MASK 0xffffff
  |  |  ------------------
  ------------------
   53|  10.9k|    }
   54|       |
   55|       |    /* word0 is suitable for <=toUSection[] comparison, word for <toUSection[] */
   56|  1.31k|    word0=UCNV_EXT_TO_U_MAKE_WORD(byte, 0);
  ------------------
  |  |  421|  1.31k|#define UCNV_EXT_TO_U_MAKE_WORD(byte, value) (((uint32_t)(byte)<<UCNV_EXT_TO_U_BYTE_SHIFT)|(value))
  |  |  ------------------
  |  |  |  |  409|  1.31k|#define UCNV_EXT_TO_U_BYTE_SHIFT 24
  |  |  ------------------
  ------------------
   57|       |
   58|       |    /*
   59|       |     * Shift byte once instead of each section word and add 0xffffff.
   60|       |     * We will compare the shifted/added byte (bbffffff) against
   61|       |     * section words which have byte values in the same bit position.
   62|       |     * If and only if byte bb < section byte ss then bbffffff<ssvvvvvv
   63|       |     * for all v=0..f
   64|       |     * so we need not mask off the lower 24 bits of each section word.
   65|       |     */
   66|  1.31k|    word=word0|UCNV_EXT_TO_U_VALUE_MASK;
  ------------------
  |  |  410|  1.31k|#define UCNV_EXT_TO_U_VALUE_MASK 0xffffff
  ------------------
   67|       |
   68|       |    /* binary search */
   69|  1.31k|    start=0;
   70|  1.31k|    limit=length;
   71|  2.25k|    for(;;) {
   72|  2.25k|        i=limit-start;
   73|  2.25k|        if(i<=1) {
  ------------------
  |  Branch (73:12): [True: 0, False: 2.25k]
  ------------------
   74|      0|            break; /* done */
   75|      0|        }
   76|       |        /* start<limit-1 */
   77|       |
   78|  2.25k|        if(i<=4) {
  ------------------
  |  Branch (78:12): [True: 1.31k, False: 945]
  ------------------
   79|       |            /* linear search for the last part */
   80|  1.31k|            if(word0<=toUSection[start]) {
  ------------------
  |  Branch (80:16): [True: 206, False: 1.10k]
  ------------------
   81|    206|                break;
   82|    206|            }
   83|  1.10k|            if(++start<limit && word0<=toUSection[start]) {
  ------------------
  |  Branch (83:16): [True: 1.10k, False: 0]
  |  Branch (83:33): [True: 438, False: 669]
  ------------------
   84|    438|                break;
   85|    438|            }
   86|    669|            if(++start<limit && word0<=toUSection[start]) {
  ------------------
  |  Branch (86:16): [True: 669, False: 0]
  |  Branch (86:33): [True: 473, False: 196]
  ------------------
   87|    473|                break;
   88|    473|            }
   89|       |            /* always break at start==limit-1 */
   90|    196|            ++start;
   91|    196|            break;
   92|    669|        }
   93|       |
   94|    945|        i=(start+limit)/2;
   95|    945|        if(word<toUSection[i]) {
  ------------------
  |  Branch (95:12): [True: 436, False: 509]
  ------------------
   96|    436|            limit=i;
   97|    509|        } else {
   98|    509|            start=i;
   99|    509|        }
  100|    945|    }
  101|       |
  102|       |    /* did we really find it? */
  103|  1.31k|    if(start<limit && byte==UCNV_EXT_TO_U_GET_BYTE(word=toUSection[start])) {
  ------------------
  |  |  423|  1.31k|#define UCNV_EXT_TO_U_GET_BYTE(word) ((word)>>UCNV_EXT_TO_U_BYTE_SHIFT)
  |  |  ------------------
  |  |  |  |  409|  1.31k|#define UCNV_EXT_TO_U_BYTE_SHIFT 24
  |  |  ------------------
  ------------------
  |  Branch (103:8): [True: 1.31k, False: 0]
  |  Branch (103:23): [True: 679, False: 634]
  ------------------
  104|    679|        return UCNV_EXT_TO_U_GET_VALUE(word); /* never 0 */
  ------------------
  |  |  424|    679|#define UCNV_EXT_TO_U_GET_VALUE(word) ((word)&UCNV_EXT_TO_U_VALUE_MASK)
  |  |  ------------------
  |  |  |  |  410|    679|#define UCNV_EXT_TO_U_VALUE_MASK 0xffffff
  |  |  ------------------
  ------------------
  105|    679|    } else {
  106|    634|        return 0; /* not found */
  107|    634|    }
  108|  1.31k|}
ucnv_ext.cpp:_ZL16ucnv_extWriteToUP10UConverterPKijPPDsPKDsPPiiP10UErrorCode:
  241|    592|                 UErrorCode *pErrorCode) {
  242|       |    /* output the result */
  243|    592|    if(UCNV_EXT_TO_U_IS_CODE_POINT(value)) {
  ------------------
  |  |  433|    592|#define UCNV_EXT_TO_U_IS_CODE_POINT(value) ((value)<=UCNV_EXT_TO_U_MAX_CODE_POINT)
  |  |  ------------------
  |  |  |  |  412|    592|#define UCNV_EXT_TO_U_MAX_CODE_POINT 0x2fffff
  |  |  ------------------
  |  |  |  Branch (433:44): [True: 592, False: 0]
  |  |  ------------------
  ------------------
  244|       |        /* output a single code point */
  245|    592|        ucnv_toUWriteCodePoint(
  ------------------
  |  |  722|    592|#define ucnv_toUWriteCodePoint U_ICU_ENTRY_POINT_RENAME(ucnv_toUWriteCodePoint)
  |  |  ------------------
  |  |  |  |  123|    592|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|    592|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|    592|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  246|    592|            cnv, UCNV_EXT_TO_U_GET_CODE_POINT(value),
  ------------------
  |  |  434|    592|#define UCNV_EXT_TO_U_GET_CODE_POINT(value) ((value)-UCNV_EXT_TO_U_MIN_CODE_POINT)
  |  |  ------------------
  |  |  |  |  411|    592|#define UCNV_EXT_TO_U_MIN_CODE_POINT 0x1f0000
  |  |  ------------------
  ------------------
  247|    592|            target, targetLimit,
  248|    592|            offsets, srcIndex,
  249|    592|            pErrorCode);
  250|    592|    } else {
  251|       |        /* output a string - with correct data we have resultLength>0 */
  252|      0|        ucnv_toUWriteUChars(
  ------------------
  |  |  723|      0|#define ucnv_toUWriteUChars U_ICU_ENTRY_POINT_RENAME(ucnv_toUWriteUChars)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|      0|            cnv,
  254|      0|            UCNV_EXT_ARRAY(cx, UCNV_EXT_TO_U_UCHARS_INDEX, char16_t)+
  ------------------
  |  |  345|      0|    ((const itemType *)((const char *)(indexes)+(indexes)[index]))
  ------------------
  255|      0|                UCNV_EXT_TO_U_GET_INDEX(value),
  ------------------
  |  |  436|      0|#define UCNV_EXT_TO_U_GET_INDEX(value) ((value)&UCNV_EXT_TO_U_INDEX_MASK)
  |  |  ------------------
  |  |  |  |  414|      0|#define UCNV_EXT_TO_U_INDEX_MASK 0x3ffff
  |  |  ------------------
  ------------------
  256|      0|            UCNV_EXT_TO_U_GET_LENGTH(value),
  ------------------
  |  |  437|      0|#define UCNV_EXT_TO_U_GET_LENGTH(value) (((value)>>UCNV_EXT_TO_U_LENGTH_SHIFT)-UCNV_EXT_TO_U_LENGTH_OFFSET)
  |  |  ------------------
  |  |  |  |  415|      0|#define UCNV_EXT_TO_U_LENGTH_SHIFT 18
  |  |  ------------------
  |  |               #define UCNV_EXT_TO_U_GET_LENGTH(value) (((value)>>UCNV_EXT_TO_U_LENGTH_SHIFT)-UCNV_EXT_TO_U_LENGTH_OFFSET)
  |  |  ------------------
  |  |  |  |  416|      0|#define UCNV_EXT_TO_U_LENGTH_OFFSET 12
  |  |  ------------------
  ------------------
  257|      0|            target, targetLimit,
  258|      0|            offsets, srcIndex,
  259|      0|            pErrorCode);
  260|      0|    }
  261|    592|}

ucnv_io_stripASCIIForCompare_78:
  387|  8.62k|ucnv_io_stripASCIIForCompare(char *dst, const char *name) {
  388|  8.62k|    char *dstItr = dst;
  389|  8.62k|    uint8_t type, nextType;
  390|  8.62k|    char c1;
  391|  8.62k|    UBool afterDigit = false;
  392|       |
  393|  98.7k|    while ((c1 = *name++) != 0) {
  ------------------
  |  Branch (393:12): [True: 90.1k, False: 8.62k]
  ------------------
  394|  90.1k|        type = GET_ASCII_TYPE(c1);
  ------------------
  |  |  360|  90.1k|#define GET_ASCII_TYPE(c) ((int8_t)(c) >= 0 ? asciiTypes[(uint8_t)c] : (uint8_t)UIGNORE)
  |  |  ------------------
  |  |  |  Branch (360:28): [True: 90.1k, False: 0]
  |  |  ------------------
  ------------------
  395|  90.1k|        switch (type) {
  396|  13.2k|        case UIGNORE:
  ------------------
  |  Branch (396:9): [True: 13.2k, False: 76.8k]
  ------------------
  397|  13.2k|            afterDigit = false;
  398|  13.2k|            continue; /* ignore all but letters and digits */
  399|  6.64k|        case ZERO:
  ------------------
  |  Branch (399:9): [True: 6.64k, False: 83.4k]
  ------------------
  400|  6.64k|            if (!afterDigit) {
  ------------------
  |  Branch (400:17): [True: 0, False: 6.64k]
  ------------------
  401|      0|                nextType = GET_ASCII_TYPE(*name);
  ------------------
  |  |  360|      0|#define GET_ASCII_TYPE(c) ((int8_t)(c) >= 0 ? asciiTypes[(uint8_t)c] : (uint8_t)UIGNORE)
  |  |  ------------------
  |  |  |  Branch (360:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  402|      0|                if (nextType == ZERO || nextType == NONZERO) {
  ------------------
  |  Branch (402:21): [True: 0, False: 0]
  |  Branch (402:41): [True: 0, False: 0]
  ------------------
  403|      0|                    continue; /* ignore leading zero before another digit */
  404|      0|                }
  405|      0|            }
  406|  6.64k|            break;
  407|  34.2k|        case NONZERO:
  ------------------
  |  Branch (407:9): [True: 34.2k, False: 55.8k]
  ------------------
  408|  34.2k|            afterDigit = true;
  409|  34.2k|            break;
  410|  35.9k|        default:
  ------------------
  |  Branch (410:9): [True: 35.9k, False: 54.1k]
  ------------------
  411|  35.9k|            c1 = (char)type; /* lowercased letter */
  412|  35.9k|            afterDigit = false;
  413|  35.9k|            break;
  414|  90.1k|        }
  415|  76.8k|        *dstItr++ = c1;
  416|  76.8k|    }
  417|  8.62k|    *dstItr = 0;
  418|  8.62k|    return dst;
  419|  8.62k|}
ucnv_io_getConverterName_78:
  738|  4.31k|ucnv_io_getConverterName(const char *alias, UBool *containsOption, UErrorCode *pErrorCode) {
  739|  4.31k|    const char *aliasTmp = alias;
  740|  4.31k|    int32_t i = 0;
  741|  5.39k|    for (i = 0; i < 2; i++) {
  ------------------
  |  Branch (741:17): [True: 5.39k, False: 1]
  ------------------
  742|  5.39k|        if (i == 1) {
  ------------------
  |  Branch (742:13): [True: 1.08k, False: 4.31k]
  ------------------
  743|       |            /*
  744|       |             * After the first unsuccess converter lookup, check to see if
  745|       |             * the name begins with 'x-'. If it does, strip it off and try
  746|       |             * again.  This behaviour is similar to how ICU4J does it.
  747|       |             */
  748|  1.08k|            if (aliasTmp[0] == 'x' && aliasTmp[1] == '-') {
  ------------------
  |  Branch (748:17): [True: 1, False: 1.08k]
  |  Branch (748:39): [True: 1, False: 0]
  ------------------
  749|      1|                aliasTmp = aliasTmp+2;
  750|  1.08k|            } else {
  751|  1.08k|                break;
  752|  1.08k|            }
  753|  1.08k|        }
  754|  4.31k|        if(haveAliasData(pErrorCode) && isAlias(aliasTmp, pErrorCode)) {
  ------------------
  |  Branch (754:12): [True: 4.31k, False: 0]
  |  Branch (754:41): [True: 4.31k, False: 0]
  ------------------
  755|  4.31k|            uint32_t convNum = findConverter(aliasTmp, containsOption, pErrorCode);
  756|  4.31k|            if (convNum < gMainTable.converterListSize) {
  ------------------
  |  Branch (756:17): [True: 3.22k, False: 1.08k]
  ------------------
  757|  3.22k|                return GET_STRING(gMainTable.converterList[convNum]);
  ------------------
  |  |  201|  3.22k|#define GET_STRING(idx) (const char *)(gMainTable.stringTable + (idx))
  ------------------
  758|  3.22k|            }
  759|       |            /* else converter not found */
  760|  4.31k|        } else {
  761|      0|            break;
  762|      0|        }
  763|  4.31k|    }
  764|       |
  765|  1.08k|    return nullptr;
  766|  4.31k|}
ucnv_io_countKnownConverters_78:
 1088|      1|ucnv_io_countKnownConverters(UErrorCode *pErrorCode) {
 1089|      1|    if (haveAliasData(pErrorCode)) {
  ------------------
  |  Branch (1089:9): [True: 1, False: 0]
  ------------------
 1090|      1|        return (uint16_t)gMainTable.converterListSize;
 1091|      1|    }
 1092|      0|    return 0;
 1093|      1|}
ucnv_io.cpp:_ZL13haveAliasDataP10UErrorCode:
  313|  4.31k|haveAliasData(UErrorCode *pErrorCode) {
  314|  4.31k|    umtx_initOnce(gAliasDataInitOnce, &initAliasData, *pErrorCode);
  315|  4.31k|    return U_SUCCESS(*pErrorCode);
  316|  4.31k|}
ucnv_io.cpp:_ZL13initAliasDataR10UErrorCode:
  232|      1|static void U_CALLCONV initAliasData(UErrorCode &errCode) {
  233|      1|    UDataMemory *data;
  234|      1|    const uint16_t *table;
  235|      1|    const uint32_t *sectionSizes;
  236|      1|    uint32_t tableStart;
  237|      1|    uint32_t currOffset;
  238|       |
  239|      1|    ucln_common_registerCleanup(UCLN_COMMON_UCNV_IO, ucnv_io_cleanup);
  ------------------
  |  |  617|      1|#define ucln_common_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_common_registerCleanup)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  240|       |
  241|      1|    U_ASSERT(gAliasData == nullptr);
  ------------------
  |  |   35|      1|#   define U_ASSERT(exp) (void)0
  ------------------
  242|      1|    data = udata_openChoice(nullptr, DATA_TYPE, DATA_NAME, isAcceptable, nullptr, &errCode);
  ------------------
  |  |  894|      1|#define udata_openChoice U_ICU_ENTRY_POINT_RENAME(udata_openChoice)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  243|      1|    if(U_FAILURE(errCode)) {
  ------------------
  |  Branch (243:8): [True: 0, False: 1]
  ------------------
  244|      0|        return;
  245|      0|    }
  246|       |
  247|      1|    sectionSizes = static_cast<const uint32_t*>(udata_getMemory(data));
  ------------------
  |  |  891|      1|#define udata_getMemory U_ICU_ENTRY_POINT_RENAME(udata_getMemory)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  248|      1|    table = reinterpret_cast<const uint16_t*>(sectionSizes);
  249|       |
  250|      1|    tableStart      = sectionSizes[0];
  251|      1|    if (tableStart < minTocLength) {
  ------------------
  |  Branch (251:9): [True: 0, False: 1]
  ------------------
  252|      0|        errCode = U_INVALID_FORMAT_ERROR;
  253|      0|        udata_close(data);
  ------------------
  |  |  885|      0|#define udata_close U_ICU_ENTRY_POINT_RENAME(udata_close)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|      0|        return;
  255|      0|    }
  256|      1|    gAliasData = data;
  257|       |
  258|      1|    gMainTable.converterListSize      = sectionSizes[1];
  259|      1|    gMainTable.tagListSize            = sectionSizes[2];
  260|      1|    gMainTable.aliasListSize          = sectionSizes[3];
  261|      1|    gMainTable.untaggedConvArraySize  = sectionSizes[4];
  262|      1|    gMainTable.taggedAliasArraySize   = sectionSizes[5];
  263|      1|    gMainTable.taggedAliasListsSize   = sectionSizes[6];
  264|      1|    gMainTable.optionTableSize        = sectionSizes[7];
  265|      1|    gMainTable.stringTableSize        = sectionSizes[8];
  266|       |
  267|      1|    if (tableStart > 8) {
  ------------------
  |  Branch (267:9): [True: 1, False: 0]
  ------------------
  268|      1|        gMainTable.normalizedStringTableSize = sectionSizes[9];
  269|      1|    }
  270|       |
  271|      1|    currOffset = tableStart * (sizeof(uint32_t)/sizeof(uint16_t)) + (sizeof(uint32_t)/sizeof(uint16_t));
  272|      1|    gMainTable.converterList = table + currOffset;
  273|       |
  274|      1|    currOffset += gMainTable.converterListSize;
  275|      1|    gMainTable.tagList = table + currOffset;
  276|       |
  277|      1|    currOffset += gMainTable.tagListSize;
  278|      1|    gMainTable.aliasList = table + currOffset;
  279|       |
  280|      1|    currOffset += gMainTable.aliasListSize;
  281|      1|    gMainTable.untaggedConvArray = table + currOffset;
  282|       |
  283|      1|    currOffset += gMainTable.untaggedConvArraySize;
  284|      1|    gMainTable.taggedAliasArray = table + currOffset;
  285|       |
  286|       |    /* aliasLists is a 1's based array, but it has a padding character */
  287|      1|    currOffset += gMainTable.taggedAliasArraySize;
  288|      1|    gMainTable.taggedAliasLists = table + currOffset;
  289|       |
  290|      1|    currOffset += gMainTable.taggedAliasListsSize;
  291|      1|    if (gMainTable.optionTableSize > 0
  ------------------
  |  Branch (291:9): [True: 1, False: 0]
  ------------------
  292|      1|        && reinterpret_cast<const UConverterAliasOptions*>(table + currOffset)->stringNormalizationType < UCNV_IO_NORM_TYPE_COUNT)
  ------------------
  |  Branch (292:12): [True: 1, False: 0]
  ------------------
  293|      1|    {
  294|       |        /* Faster table */
  295|      1|        gMainTable.optionTable = reinterpret_cast<const UConverterAliasOptions*>(table + currOffset);
  296|      1|    }
  297|      0|    else {
  298|       |        /* Smaller table, or I can't handle this normalization mode!
  299|       |        Use the original slower table lookup. */
  300|      0|        gMainTable.optionTable = &defaultTableOptions;
  301|      0|    }
  302|       |
  303|      1|    currOffset += gMainTable.optionTableSize;
  304|      1|    gMainTable.stringTable = table + currOffset;
  305|       |
  306|      1|    currOffset += gMainTable.stringTableSize;
  307|      1|    gMainTable.normalizedStringTable = ((gMainTable.optionTable->stringNormalizationType == UCNV_IO_UNNORMALIZED)
  ------------------
  |  Branch (307:41): [True: 0, False: 1]
  ------------------
  308|      1|        ? gMainTable.stringTable : (table + currOffset));
  309|      1|}
ucnv_io.cpp:_ZL12isAcceptablePvPKcS1_PK9UDataInfo:
  207|      1|             const UDataInfo *pInfo) {
  208|      1|    return
  209|      1|        pInfo->size>=20 &&
  ------------------
  |  Branch (209:9): [True: 1, False: 0]
  ------------------
  210|      1|        pInfo->isBigEndian==U_IS_BIG_ENDIAN &&
  ------------------
  |  |  353|      2|#   define U_IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  ------------------
  |  Branch (210:9): [True: 1, False: 0]
  ------------------
  211|      1|        pInfo->charsetFamily==U_CHARSET_FAMILY &&
  ------------------
  |  |  588|      1|#   define U_CHARSET_FAMILY U_ASCII_FAMILY
  |  |  ------------------
  |  |  |  |  531|      2|#define U_ASCII_FAMILY 0
  |  |  ------------------
  ------------------
  |  Branch (211:9): [True: 1, False: 0]
  ------------------
  212|      1|        pInfo->dataFormat[0]==0x43 &&   /* dataFormat="CvAl" */
  ------------------
  |  Branch (212:9): [True: 1, False: 0]
  ------------------
  213|      1|        pInfo->dataFormat[1]==0x76 &&
  ------------------
  |  Branch (213:9): [True: 1, False: 0]
  ------------------
  214|      1|        pInfo->dataFormat[2]==0x41 &&
  ------------------
  |  Branch (214:9): [True: 1, False: 0]
  ------------------
  215|      1|        pInfo->dataFormat[3]==0x6c &&
  ------------------
  |  Branch (215:9): [True: 1, False: 0]
  ------------------
  216|      1|        pInfo->formatVersion[0]==3;
  ------------------
  |  Branch (216:9): [True: 1, False: 0]
  ------------------
  217|      1|}
ucnv_io.cpp:_ZL7isAliasPKcP10UErrorCode:
  319|  4.31k|isAlias(const char *alias, UErrorCode *pErrorCode) {
  320|  4.31k|    if(alias==nullptr) {
  ------------------
  |  Branch (320:8): [True: 0, False: 4.31k]
  ------------------
  321|      0|        *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
  322|      0|        return false;
  323|      0|    }
  324|  4.31k|    return *alias != 0;
  325|  4.31k|}
ucnv_io.cpp:_ZL13findConverterPKcPaP10UErrorCode:
  552|  4.31k|findConverter(const char *alias, UBool *containsOption, UErrorCode *pErrorCode) {
  553|  4.31k|    uint32_t mid, start, limit;
  554|  4.31k|    uint32_t lastMid;
  555|  4.31k|    int result;
  556|  4.31k|    int isUnnormalized = (gMainTable.optionTable->stringNormalizationType == UCNV_IO_UNNORMALIZED);
  557|  4.31k|    char strippedName[UCNV_MAX_CONVERTER_NAME_LENGTH];
  558|       |
  559|  4.31k|    if (!isUnnormalized) {
  ------------------
  |  Branch (559:9): [True: 4.31k, False: 0]
  ------------------
  560|  4.31k|        if (uprv_strlen(alias) >= UCNV_MAX_CONVERTER_NAME_LENGTH) {
  ------------------
  |  |   37|  4.31k|#define uprv_strlen(str) U_STANDARD_CPP_NAMESPACE strlen(str)
  |  |  ------------------
  |  |  |  |  393|  4.31k|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
                      if (uprv_strlen(alias) >= UCNV_MAX_CONVERTER_NAME_LENGTH) {
  ------------------
  |  |   79|  4.31k|#define UCNV_MAX_CONVERTER_NAME_LENGTH 60
  ------------------
  |  Branch (560:13): [True: 0, False: 4.31k]
  ------------------
  561|      0|            *pErrorCode = U_BUFFER_OVERFLOW_ERROR;
  562|      0|            return UINT32_MAX;
  563|      0|        }
  564|       |
  565|       |        /* Lower case and remove ignoreable characters. */
  566|  4.31k|        ucnv_io_stripForCompare(strippedName, alias);
  ------------------
  |  |   73|  4.31k|#   define ucnv_io_stripForCompare ucnv_io_stripASCIIForCompare
  |  |  ------------------
  |  |  |  |  695|  4.31k|#define ucnv_io_stripASCIIForCompare U_ICU_ENTRY_POINT_RENAME(ucnv_io_stripASCIIForCompare)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  4.31k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  122|  4.31k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  121|  4.31k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  567|  4.31k|        alias = strippedName;
  568|  4.31k|    }
  569|       |
  570|       |    /* do a binary search for the alias */
  571|  4.31k|    start = 0;
  572|  4.31k|    limit = gMainTable.untaggedConvArraySize;
  573|  4.31k|    mid = limit;
  574|  4.31k|    lastMid = UINT32_MAX;
  575|       |
  576|  44.7k|    for (;;) {
  577|  44.7k|        mid = (start + limit) / 2;
  578|  44.7k|        if (lastMid == mid) {   /* Have we moved? */
  ------------------
  |  Branch (578:13): [True: 1.08k, False: 43.6k]
  ------------------
  579|  1.08k|            break;  /* We haven't moved, and it wasn't found. */
  580|  1.08k|        }
  581|  43.6k|        lastMid = mid;
  582|  43.6k|        if (isUnnormalized) {
  ------------------
  |  Branch (582:13): [True: 0, False: 43.6k]
  ------------------
  583|      0|            result = ucnv_compareNames(alias, GET_STRING(gMainTable.aliasList[mid]));
  ------------------
  |  |  640|      0|#define ucnv_compareNames U_ICU_ENTRY_POINT_RENAME(ucnv_compareNames)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          result = ucnv_compareNames(alias, GET_STRING(gMainTable.aliasList[mid]));
  ------------------
  |  |  201|      0|#define GET_STRING(idx) (const char *)(gMainTable.stringTable + (idx))
  ------------------
  584|      0|        }
  585|  43.6k|        else {
  586|  43.6k|            result = uprv_strcmp(alias, GET_NORMALIZED_STRING(gMainTable.aliasList[mid]));
  ------------------
  |  |   38|  43.6k|#define uprv_strcmp(s1, s2) U_STANDARD_CPP_NAMESPACE strcmp(s1, s2)
  |  |  ------------------
  |  |  |  |  393|  43.6k|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  587|  43.6k|        }
  588|       |
  589|  43.6k|        if (result < 0) {
  ------------------
  |  Branch (589:13): [True: 18.9k, False: 24.6k]
  ------------------
  590|  18.9k|            limit = mid;
  591|  24.6k|        } else if (result > 0) {
  ------------------
  |  Branch (591:20): [True: 21.4k, False: 3.22k]
  ------------------
  592|  21.4k|            start = mid;
  593|  21.4k|        } else {
  594|       |            /* Since the gencnval tool folds duplicates into one entry,
  595|       |             * this alias in gAliasList is unique, but different standards
  596|       |             * may map an alias to different converters.
  597|       |             */
  598|  3.22k|            if (gMainTable.untaggedConvArray[mid] & UCNV_AMBIGUOUS_ALIAS_MAP_BIT) {
  ------------------
  |  |   24|  3.22k|#define UCNV_AMBIGUOUS_ALIAS_MAP_BIT 0x8000
  ------------------
  |  Branch (598:17): [True: 674, False: 2.55k]
  ------------------
  599|    674|                *pErrorCode = U_AMBIGUOUS_ALIAS_WARNING;
  600|    674|            }
  601|       |            /* State whether the canonical converter name contains an option.
  602|       |            This information is contained in this list in order to maintain backward & forward compatibility. */
  603|  3.22k|            if (containsOption) {
  ------------------
  |  Branch (603:17): [True: 3.22k, False: 0]
  ------------------
  604|  3.22k|                UBool containsCnvOptionInfo = static_cast<UBool>(gMainTable.optionTable->containsCnvOptionInfo);
  605|  3.22k|                *containsOption = static_cast<UBool>((containsCnvOptionInfo
  ------------------
  |  Branch (605:55): [True: 3.22k, False: 0]
  ------------------
  606|  3.22k|                    && ((gMainTable.untaggedConvArray[mid] & UCNV_CONTAINS_OPTION_BIT) != 0))
  ------------------
  |  |   25|  3.22k|#define UCNV_CONTAINS_OPTION_BIT 0x4000
  ------------------
  |  Branch (606:24): [True: 614, False: 2.61k]
  ------------------
  607|  3.22k|                    || !containsCnvOptionInfo);
  ------------------
  |  Branch (607:24): [True: 0, False: 2.61k]
  ------------------
  608|  3.22k|            }
  609|  3.22k|            return gMainTable.untaggedConvArray[mid] & UCNV_CONVERTER_INDEX_MASK;
  ------------------
  |  |   26|  3.22k|#define UCNV_CONVERTER_INDEX_MASK 0xFFF
  ------------------
  610|  3.22k|        }
  611|  43.6k|    }
  612|       |
  613|  1.08k|    return UINT32_MAX;
  614|  4.31k|}

ucnv_u16.cpp:_ZL12_UTF16BEOpenP10UConverterP18UConverterLoadArgsP10UErrorCode:
  591|    166|             UErrorCode *pErrorCode) {
  592|    166|    (void)pArgs;
  593|    166|    if(UCNV_GET_VERSION(cnv)<=1) {
  ------------------
  |  |   47|    166|#define UCNV_GET_VERSION(cnv) ((cnv)->options&UCNV_OPTION_VERSION)
  |  |  ------------------
  |  |  |  |   44|    166|#define UCNV_OPTION_VERSION     0xf
  |  |  ------------------
  ------------------
  |  Branch (593:8): [True: 166, False: 0]
  ------------------
  594|    166|        _UTF16BEReset(cnv, UCNV_RESET_BOTH);
  595|    166|    } else {
  596|      0|        *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
  597|      0|    }
  598|    166|}
ucnv_u16.cpp:_ZL13_UTF16BEResetP10UConverter21UConverterResetChoice:
  573|    332|_UTF16BEReset(UConverter *cnv, UConverterResetChoice choice) {
  574|    332|    if(choice<=UCNV_RESET_TO_UNICODE) {
  ------------------
  |  Branch (574:8): [True: 332, False: 0]
  ------------------
  575|       |        /* reset toUnicode state */
  576|    332|        if(UCNV_GET_VERSION(cnv)==0) {
  ------------------
  |  |   47|    332|#define UCNV_GET_VERSION(cnv) ((cnv)->options&UCNV_OPTION_VERSION)
  |  |  ------------------
  |  |  |  |   44|    332|#define UCNV_OPTION_VERSION     0xf
  |  |  ------------------
  ------------------
  |  Branch (576:12): [True: 332, False: 0]
  ------------------
  577|    332|            cnv->mode=8; /* no BOM handling */
  578|    332|        } else {
  579|      0|            cnv->mode=0; /* Java-specific "UnicodeBig" requires BE BOM or no BOM */
  580|      0|        }
  581|    332|    }
  582|    332|    if(choice!=UCNV_RESET_TO_UNICODE && UCNV_GET_VERSION(cnv)==1) {
  ------------------
  |  |   47|    166|#define UCNV_GET_VERSION(cnv) ((cnv)->options&UCNV_OPTION_VERSION)
  |  |  ------------------
  |  |  |  |   44|    166|#define UCNV_OPTION_VERSION     0xf
  |  |  ------------------
  ------------------
  |  Branch (582:8): [True: 166, False: 166]
  |  Branch (582:41): [True: 0, False: 166]
  ------------------
  583|       |        /* reset fromUnicode for "UnicodeBig": prepare to output the UTF-16BE BOM */
  584|      0|        cnv->fromUnicodeStatus=UCNV_NEED_TO_WRITE_BOM;
  585|      0|    }
  586|    332|}
ucnv_u16.cpp:_ZL28_UTF16BEToUnicodeWithOffsetsP23UConverterToUnicodeArgsP10UErrorCode:
  257|   168k|                             UErrorCode *pErrorCode) {
  258|   168k|    UConverter *cnv;
  259|   168k|    const uint8_t *source;
  260|   168k|    char16_t *target;
  261|   168k|    int32_t *offsets;
  262|       |
  263|   168k|    uint32_t targetCapacity, length, count, sourceIndex;
  264|   168k|    char16_t c, trail;
  265|       |
  266|   168k|    if(pArgs->converter->mode<8) {
  ------------------
  |  Branch (266:8): [True: 0, False: 168k]
  ------------------
  267|      0|        _UTF16ToUnicodeWithOffsets(pArgs, pErrorCode);
  268|      0|        return;
  269|      0|    }
  270|       |
  271|   168k|    cnv=pArgs->converter;
  272|   168k|    source=(const uint8_t *)pArgs->source;
  273|   168k|    length=(int32_t)((const uint8_t *)pArgs->sourceLimit-source);
  274|   168k|    if(length<=0 && cnv->toUnicodeStatus==0) {
  ------------------
  |  Branch (274:8): [True: 93, False: 168k]
  |  Branch (274:21): [True: 93, False: 0]
  ------------------
  275|       |        /* no input, nothing to do */
  276|     93|        return;
  277|     93|    }
  278|       |
  279|   168k|    target=pArgs->target;
  280|   168k|    if(target >= pArgs->targetLimit) {
  ------------------
  |  Branch (280:8): [True: 0, False: 168k]
  ------------------
  281|      0|        *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
  282|      0|        return;
  283|      0|    }
  284|       |
  285|   168k|    targetCapacity=(uint32_t)(pArgs->targetLimit-target);
  286|   168k|    offsets=pArgs->offsets;
  287|   168k|    sourceIndex=0;
  288|   168k|    c=0;
  289|       |
  290|       |    /* complete a partial char16_t or pair from the last call */
  291|   168k|    if(cnv->toUnicodeStatus!=0) {
  ------------------
  |  Branch (291:8): [True: 0, False: 168k]
  ------------------
  292|       |        /*
  293|       |         * special case: single byte from a previous buffer,
  294|       |         * where the byte turned out not to belong to a trail surrogate
  295|       |         * and the preceding, unmatched lead surrogate was put into toUBytes[]
  296|       |         * for error handling
  297|       |         */
  298|      0|        cnv->toUBytes[0]=(uint8_t)cnv->toUnicodeStatus;
  299|      0|        cnv->toULength=1;
  300|      0|        cnv->toUnicodeStatus=0;
  301|      0|    }
  302|   168k|    if((count=cnv->toULength)!=0) {
  ------------------
  |  Branch (302:8): [True: 0, False: 168k]
  ------------------
  303|      0|        uint8_t *p=cnv->toUBytes;
  304|      0|        do {
  305|      0|            p[count++]=*source++;
  306|      0|            ++sourceIndex;
  307|      0|            --length;
  308|      0|            if(count==2) {
  ------------------
  |  Branch (308:16): [True: 0, False: 0]
  ------------------
  309|      0|                c=((char16_t)p[0]<<8)|p[1];
  310|      0|                if(U16_IS_SINGLE(c)) {
  ------------------
  |  |   51|      0|#define U16_IS_SINGLE(c) !U_IS_SURROGATE(c)
  |  |  ------------------
  |  |  |  |  193|      0|#define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800)
  |  |  ------------------
  |  |  |  Branch (51:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  311|       |                    /* output the BMP code point */
  312|      0|                    *target++=c;
  313|      0|                    if(offsets!=nullptr) {
  ------------------
  |  Branch (313:24): [True: 0, False: 0]
  ------------------
  314|      0|                        *offsets++=-1;
  315|      0|                    }
  316|      0|                    --targetCapacity;
  317|      0|                    count=0;
  318|      0|                    c=0;
  319|      0|                    break;
  320|      0|                } else if(U16_IS_SURROGATE_LEAD(c)) {
  ------------------
  |  |   84|      0|#define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
  |  |  ------------------
  |  |  |  Branch (84:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  321|       |                    /* continue collecting bytes for the trail surrogate */
  322|      0|                    c=0; /* avoid unnecessary surrogate handling below */
  323|      0|                } else {
  324|       |                    /* fall through to error handling for an unmatched trail surrogate */
  325|      0|                    break;
  326|      0|                }
  327|      0|            } else if(count==4) {
  ------------------
  |  Branch (327:23): [True: 0, False: 0]
  ------------------
  328|      0|                c=((char16_t)p[0]<<8)|p[1];
  329|      0|                trail=((char16_t)p[2]<<8)|p[3];
  330|      0|                if(U16_IS_TRAIL(trail)) {
  ------------------
  |  |   67|      0|#define U16_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00)
  |  |  ------------------
  |  |  |  Branch (67:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  331|       |                    /* output the surrogate pair */
  332|      0|                    *target++=c;
  333|      0|                    if(targetCapacity>=2) {
  ------------------
  |  Branch (333:24): [True: 0, False: 0]
  ------------------
  334|      0|                        *target++=trail;
  335|      0|                        if(offsets!=nullptr) {
  ------------------
  |  Branch (335:28): [True: 0, False: 0]
  ------------------
  336|      0|                            *offsets++=-1;
  337|      0|                            *offsets++=-1;
  338|      0|                        }
  339|      0|                        targetCapacity-=2;
  340|      0|                    } else /* targetCapacity==1 */ {
  341|      0|                        targetCapacity=0;
  342|      0|                        cnv->UCharErrorBuffer[0]=trail;
  343|      0|                        cnv->UCharErrorBufferLength=1;
  344|      0|                        *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
  345|      0|                    }
  346|      0|                    count=0;
  347|      0|                    c=0;
  348|      0|                    break;
  349|      0|                } else {
  350|       |                    /* unmatched lead surrogate, handle here for consistent toUBytes[] */
  351|      0|                    *pErrorCode=U_ILLEGAL_CHAR_FOUND;
  352|       |
  353|       |                    /* back out reading the code unit after it */
  354|      0|                    if(((const uint8_t *)pArgs->source-source)>=2) {
  ------------------
  |  Branch (354:24): [True: 0, False: 0]
  ------------------
  355|      0|                        source-=2;
  356|      0|                    } else {
  357|       |                        /*
  358|       |                         * if the trail unit's first byte was in a previous buffer, then
  359|       |                         * we need to put it into a special place because toUBytes[] will be
  360|       |                         * used for the lead unit's bytes
  361|       |                         */
  362|      0|                        cnv->toUnicodeStatus=0x100|p[2];
  363|      0|                        --source;
  364|      0|                    }
  365|      0|                    cnv->toULength=2;
  366|       |
  367|       |                    /* write back the updated pointers */
  368|      0|                    pArgs->source=(const char *)source;
  369|      0|                    pArgs->target=target;
  370|      0|                    pArgs->offsets=offsets;
  371|      0|                    return;
  372|      0|                }
  373|      0|            }
  374|      0|        } while(length>0);
  ------------------
  |  Branch (374:17): [True: 0, False: 0]
  ------------------
  375|      0|        cnv->toULength=(int8_t)count;
  376|      0|    }
  377|       |
  378|       |    /* copy an even number of bytes for complete UChars */
  379|   168k|    count=2*targetCapacity;
  380|   168k|    if(count>length) {
  ------------------
  |  Branch (380:8): [True: 168k, False: 0]
  ------------------
  381|   168k|        count=length&~1;
  382|   168k|    }
  383|   168k|    if(c==0 && count>0) {
  ------------------
  |  Branch (383:8): [True: 168k, False: 0]
  |  Branch (383:16): [True: 168k, False: 16]
  ------------------
  384|   168k|        length-=count;
  385|   168k|        count>>=1;
  386|   168k|        targetCapacity-=count;
  387|   168k|        if(offsets==nullptr) {
  ------------------
  |  Branch (387:12): [True: 168k, False: 0]
  ------------------
  388|  7.61M|            do {
  389|  7.61M|                c=((char16_t)source[0]<<8)|source[1];
  390|  7.61M|                source+=2;
  391|  7.61M|                if(U16_IS_SINGLE(c)) {
  ------------------
  |  |   51|  7.61M|#define U16_IS_SINGLE(c) !U_IS_SURROGATE(c)
  |  |  ------------------
  |  |  |  |  193|  7.61M|#define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800)
  |  |  ------------------
  |  |  |  Branch (51:26): [True: 7.44M, False: 171k]
  |  |  ------------------
  ------------------
  392|  7.44M|                    *target++=c;
  393|  7.44M|                } else if(U16_IS_SURROGATE_LEAD(c) && count>=2 &&
  ------------------
  |  |   84|   343k|#define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
  |  |  ------------------
  |  |  |  Branch (84:34): [True: 57.4k, False: 114k]
  |  |  ------------------
  ------------------
  |  Branch (393:55): [True: 57.4k, False: 20]
  ------------------
  394|   171k|                          U16_IS_TRAIL(trail=((char16_t)source[0]<<8)|source[1])
  ------------------
  |  |   67|  57.4k|#define U16_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00)
  |  |  ------------------
  |  |  |  Branch (67:25): [True: 3.37k, False: 54.0k]
  |  |  ------------------
  ------------------
  395|   171k|                ) {
  396|  3.37k|                    source+=2;
  397|  3.37k|                    --count;
  398|  3.37k|                    *target++=c;
  399|  3.37k|                    *target++=trail;
  400|   168k|                } else {
  401|   168k|                    break;
  402|   168k|                }
  403|  7.61M|            } while(--count>0);
  ------------------
  |  Branch (403:21): [True: 7.44M, False: 111]
  ------------------
  404|   168k|        } else {
  405|      0|            do {
  406|      0|                c=((char16_t)source[0]<<8)|source[1];
  407|      0|                source+=2;
  408|      0|                if(U16_IS_SINGLE(c)) {
  ------------------
  |  |   51|      0|#define U16_IS_SINGLE(c) !U_IS_SURROGATE(c)
  |  |  ------------------
  |  |  |  |  193|      0|#define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800)
  |  |  ------------------
  |  |  |  Branch (51:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  409|      0|                    *target++=c;
  410|      0|                    *offsets++=sourceIndex;
  411|      0|                    sourceIndex+=2;
  412|      0|                } else if(U16_IS_SURROGATE_LEAD(c) && count>=2 &&
  ------------------
  |  |   84|      0|#define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
  |  |  ------------------
  |  |  |  Branch (84:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (412:55): [True: 0, False: 0]
  ------------------
  413|      0|                          U16_IS_TRAIL(trail=((char16_t)source[0]<<8)|source[1])
  ------------------
  |  |   67|      0|#define U16_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00)
  |  |  ------------------
  |  |  |  Branch (67:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  414|      0|                ) {
  415|      0|                    source+=2;
  416|      0|                    --count;
  417|      0|                    *target++=c;
  418|      0|                    *target++=trail;
  419|      0|                    *offsets++=sourceIndex;
  420|      0|                    *offsets++=sourceIndex;
  421|      0|                    sourceIndex+=4;
  422|      0|                } else {
  423|      0|                    break;
  424|      0|                }
  425|      0|            } while(--count>0);
  ------------------
  |  Branch (425:21): [True: 0, False: 0]
  ------------------
  426|      0|        }
  427|       |
  428|   168k|        if(count==0) {
  ------------------
  |  Branch (428:12): [True: 111, False: 168k]
  ------------------
  429|       |            /* done with the loop for complete UChars */
  430|    111|            c=0;
  431|   168k|        } else {
  432|       |            /* keep c for surrogate handling, trail will be set there */
  433|   168k|            length+=2*(count-1); /* one more byte pair was consumed than count decremented */
  434|   168k|            targetCapacity+=count;
  435|   168k|        }
  436|   168k|    }
  437|       |
  438|   168k|    if(c!=0) {
  ------------------
  |  Branch (438:8): [True: 168k, False: 127]
  ------------------
  439|       |        /*
  440|       |         * c is a surrogate, and
  441|       |         * - source or target too short
  442|       |         * - or the surrogate is unmatched
  443|       |         */
  444|   168k|        cnv->toUBytes[0]=(uint8_t)(c>>8);
  445|   168k|        cnv->toUBytes[1]=(uint8_t)c;
  446|   168k|        cnv->toULength=2;
  447|       |
  448|   168k|        if(U16_IS_SURROGATE_LEAD(c)) {
  ------------------
  |  |   84|   168k|#define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
  |  |  ------------------
  |  |  |  Branch (84:34): [True: 54.0k, False: 114k]
  |  |  ------------------
  ------------------
  449|  54.0k|            if(length>=2) {
  ------------------
  |  Branch (449:16): [True: 54.0k, False: 20]
  ------------------
  450|  54.0k|                if(U16_IS_TRAIL(trail=((char16_t)source[0]<<8)|source[1])) {
  ------------------
  |  |   67|  54.0k|#define U16_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00)
  |  |  ------------------
  |  |  |  Branch (67:25): [True: 0, False: 54.0k]
  |  |  ------------------
  ------------------
  451|       |                    /* output the surrogate pair, will overflow (see conditions comment above) */
  452|      0|                    source+=2;
  453|      0|                    length-=2;
  454|      0|                    *target++=c;
  455|      0|                    if(offsets!=nullptr) {
  ------------------
  |  Branch (455:24): [True: 0, False: 0]
  ------------------
  456|      0|                        *offsets++=sourceIndex;
  457|      0|                    }
  458|      0|                    cnv->UCharErrorBuffer[0]=trail;
  459|      0|                    cnv->UCharErrorBufferLength=1;
  460|      0|                    cnv->toULength=0;
  461|      0|                    *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
  462|  54.0k|                } else {
  463|       |                    /* unmatched lead surrogate */
  464|  54.0k|                    *pErrorCode=U_ILLEGAL_CHAR_FOUND;
  465|  54.0k|                }
  466|  54.0k|            } else {
  467|       |                /* see if the trail surrogate is in the next buffer */
  468|     20|            }
  469|   114k|        } else {
  470|       |            /* unmatched trail surrogate */
  471|   114k|            *pErrorCode=U_ILLEGAL_CHAR_FOUND;
  472|   114k|        }
  473|   168k|    }
  474|       |
  475|   168k|    if(U_SUCCESS(*pErrorCode)) {
  ------------------
  |  Branch (475:8): [True: 147, False: 168k]
  ------------------
  476|       |        /* check for a remaining source byte */
  477|    147|        if(length>0) {
  ------------------
  |  Branch (477:12): [True: 57, False: 90]
  ------------------
  478|     57|            if(targetCapacity==0) {
  ------------------
  |  Branch (478:16): [True: 0, False: 57]
  ------------------
  479|      0|                *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
  480|     57|            } else {
  481|       |                /* it must be length==1 because otherwise the above would have copied more */
  482|     57|                cnv->toUBytes[cnv->toULength++]=*source++;
  483|     57|            }
  484|     57|        }
  485|    147|    }
  486|       |
  487|       |    /* write back the updated pointers */
  488|   168k|    pArgs->source=(const char *)source;
  489|   168k|    pArgs->target=target;
  490|   168k|    pArgs->offsets=offsets;
  491|   168k|}
ucnv_u16.cpp:_ZL28_UTF16LEToUnicodeWithOffsetsP23UConverterToUnicodeArgsP10UErrorCode:
  858|   303k|                             UErrorCode *pErrorCode) {
  859|   303k|    UConverter *cnv;
  860|   303k|    const uint8_t *source;
  861|   303k|    char16_t *target;
  862|   303k|    int32_t *offsets;
  863|       |
  864|   303k|    uint32_t targetCapacity, length, count, sourceIndex;
  865|   303k|    char16_t c, trail;
  866|       |
  867|   303k|    if(pArgs->converter->mode<8) {
  ------------------
  |  Branch (867:8): [True: 0, False: 303k]
  ------------------
  868|      0|        _UTF16ToUnicodeWithOffsets(pArgs, pErrorCode);
  869|      0|        return;
  870|      0|    }
  871|       |
  872|   303k|    cnv=pArgs->converter;
  873|   303k|    source=(const uint8_t *)pArgs->source;
  874|   303k|    length=(int32_t)((const uint8_t *)pArgs->sourceLimit-source);
  875|   303k|    if(length<=0 && cnv->toUnicodeStatus==0) {
  ------------------
  |  Branch (875:8): [True: 107, False: 303k]
  |  Branch (875:21): [True: 107, False: 0]
  ------------------
  876|       |        /* no input, nothing to do */
  877|    107|        return;
  878|    107|    }
  879|       |
  880|   303k|    target=pArgs->target;
  881|   303k|    if(target >= pArgs->targetLimit) {
  ------------------
  |  Branch (881:8): [True: 0, False: 303k]
  ------------------
  882|      0|        *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
  883|      0|        return;
  884|      0|    }
  885|       |
  886|   303k|    targetCapacity=(uint32_t)(pArgs->targetLimit-pArgs->target);
  887|   303k|    offsets=pArgs->offsets;
  888|   303k|    sourceIndex=0;
  889|   303k|    c=0;
  890|       |
  891|       |    /* complete a partial char16_t or pair from the last call */
  892|   303k|    if(cnv->toUnicodeStatus!=0) {
  ------------------
  |  Branch (892:8): [True: 0, False: 303k]
  ------------------
  893|       |        /*
  894|       |         * special case: single byte from a previous buffer,
  895|       |         * where the byte turned out not to belong to a trail surrogate
  896|       |         * and the preceding, unmatched lead surrogate was put into toUBytes[]
  897|       |         * for error handling
  898|       |         */
  899|      0|        cnv->toUBytes[0]=(uint8_t)cnv->toUnicodeStatus;
  900|      0|        cnv->toULength=1;
  901|      0|        cnv->toUnicodeStatus=0;
  902|      0|    }
  903|   303k|    if((count=cnv->toULength)!=0) {
  ------------------
  |  Branch (903:8): [True: 0, False: 303k]
  ------------------
  904|      0|        uint8_t *p=cnv->toUBytes;
  905|      0|        do {
  906|      0|            p[count++]=*source++;
  907|      0|            ++sourceIndex;
  908|      0|            --length;
  909|      0|            if(count==2) {
  ------------------
  |  Branch (909:16): [True: 0, False: 0]
  ------------------
  910|      0|                c=((char16_t)p[1]<<8)|p[0];
  911|      0|                if(U16_IS_SINGLE(c)) {
  ------------------
  |  |   51|      0|#define U16_IS_SINGLE(c) !U_IS_SURROGATE(c)
  |  |  ------------------
  |  |  |  |  193|      0|#define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800)
  |  |  ------------------
  |  |  |  Branch (51:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  912|       |                    /* output the BMP code point */
  913|      0|                    *target++=c;
  914|      0|                    if(offsets!=nullptr) {
  ------------------
  |  Branch (914:24): [True: 0, False: 0]
  ------------------
  915|      0|                        *offsets++=-1;
  916|      0|                    }
  917|      0|                    --targetCapacity;
  918|      0|                    count=0;
  919|      0|                    c=0;
  920|      0|                    break;
  921|      0|                } else if(U16_IS_SURROGATE_LEAD(c)) {
  ------------------
  |  |   84|      0|#define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
  |  |  ------------------
  |  |  |  Branch (84:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  922|       |                    /* continue collecting bytes for the trail surrogate */
  923|      0|                    c=0; /* avoid unnecessary surrogate handling below */
  924|      0|                } else {
  925|       |                    /* fall through to error handling for an unmatched trail surrogate */
  926|      0|                    break;
  927|      0|                }
  928|      0|            } else if(count==4) {
  ------------------
  |  Branch (928:23): [True: 0, False: 0]
  ------------------
  929|      0|                c=((char16_t)p[1]<<8)|p[0];
  930|      0|                trail=((char16_t)p[3]<<8)|p[2];
  931|      0|                if(U16_IS_TRAIL(trail)) {
  ------------------
  |  |   67|      0|#define U16_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00)
  |  |  ------------------
  |  |  |  Branch (67:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  932|       |                    /* output the surrogate pair */
  933|      0|                    *target++=c;
  934|      0|                    if(targetCapacity>=2) {
  ------------------
  |  Branch (934:24): [True: 0, False: 0]
  ------------------
  935|      0|                        *target++=trail;
  936|      0|                        if(offsets!=nullptr) {
  ------------------
  |  Branch (936:28): [True: 0, False: 0]
  ------------------
  937|      0|                            *offsets++=-1;
  938|      0|                            *offsets++=-1;
  939|      0|                        }
  940|      0|                        targetCapacity-=2;
  941|      0|                    } else /* targetCapacity==1 */ {
  942|      0|                        targetCapacity=0;
  943|      0|                        cnv->UCharErrorBuffer[0]=trail;
  944|      0|                        cnv->UCharErrorBufferLength=1;
  945|      0|                        *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
  946|      0|                    }
  947|      0|                    count=0;
  948|      0|                    c=0;
  949|      0|                    break;
  950|      0|                } else {
  951|       |                    /* unmatched lead surrogate, handle here for consistent toUBytes[] */
  952|      0|                    *pErrorCode=U_ILLEGAL_CHAR_FOUND;
  953|       |
  954|       |                    /* back out reading the code unit after it */
  955|      0|                    if(((const uint8_t *)pArgs->source-source)>=2) {
  ------------------
  |  Branch (955:24): [True: 0, False: 0]
  ------------------
  956|      0|                        source-=2;
  957|      0|                    } else {
  958|       |                        /*
  959|       |                         * if the trail unit's first byte was in a previous buffer, then
  960|       |                         * we need to put it into a special place because toUBytes[] will be
  961|       |                         * used for the lead unit's bytes
  962|       |                         */
  963|      0|                        cnv->toUnicodeStatus=0x100|p[2];
  964|      0|                        --source;
  965|      0|                    }
  966|      0|                    cnv->toULength=2;
  967|       |
  968|       |                    /* write back the updated pointers */
  969|      0|                    pArgs->source=(const char *)source;
  970|      0|                    pArgs->target=target;
  971|      0|                    pArgs->offsets=offsets;
  972|      0|                    return;
  973|      0|                }
  974|      0|            }
  975|      0|        } while(length>0);
  ------------------
  |  Branch (975:17): [True: 0, False: 0]
  ------------------
  976|      0|        cnv->toULength=(int8_t)count;
  977|      0|    }
  978|       |
  979|       |    /* copy an even number of bytes for complete UChars */
  980|   303k|    count=2*targetCapacity;
  981|   303k|    if(count>length) {
  ------------------
  |  Branch (981:8): [True: 303k, False: 0]
  ------------------
  982|   303k|        count=length&~1;
  983|   303k|    }
  984|   303k|    if(c==0 && count>0) {
  ------------------
  |  Branch (984:8): [True: 303k, False: 0]
  |  Branch (984:16): [True: 303k, False: 21]
  ------------------
  985|   303k|        length-=count;
  986|   303k|        count>>=1;
  987|   303k|        targetCapacity-=count;
  988|   303k|        if(offsets==nullptr) {
  ------------------
  |  Branch (988:12): [True: 303k, False: 0]
  ------------------
  989|  8.74M|            do {
  990|  8.74M|                c=((char16_t)source[1]<<8)|source[0];
  991|  8.74M|                source+=2;
  992|  8.74M|                if(U16_IS_SINGLE(c)) {
  ------------------
  |  |   51|  8.74M|#define U16_IS_SINGLE(c) !U_IS_SURROGATE(c)
  |  |  ------------------
  |  |  |  |  193|  8.74M|#define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800)
  |  |  ------------------
  |  |  |  Branch (51:26): [True: 8.43M, False: 309k]
  |  |  ------------------
  ------------------
  993|  8.43M|                    *target++=c;
  994|  8.43M|                } else if(U16_IS_SURROGATE_LEAD(c) && count>=2 &&
  ------------------
  |  |   84|   619k|#define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
  |  |  ------------------
  |  |  |  Branch (84:34): [True: 116k, False: 193k]
  |  |  ------------------
  ------------------
  |  Branch (994:55): [True: 116k, False: 19]
  ------------------
  995|   309k|                          U16_IS_TRAIL(trail=((char16_t)source[1]<<8)|source[0])
  ------------------
  |  |   67|   116k|#define U16_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00)
  |  |  ------------------
  |  |  |  Branch (67:25): [True: 6.21k, False: 110k]
  |  |  ------------------
  ------------------
  996|   309k|                ) {
  997|  6.21k|                    source+=2;
  998|  6.21k|                    --count;
  999|  6.21k|                    *target++=c;
 1000|  6.21k|                    *target++=trail;
 1001|   303k|                } else {
 1002|   303k|                    break;
 1003|   303k|                }
 1004|  8.74M|            } while(--count>0);
  ------------------
  |  Branch (1004:21): [True: 8.43M, False: 150]
  ------------------
 1005|   303k|        } else {
 1006|      0|            do {
 1007|      0|                c=((char16_t)source[1]<<8)|source[0];
 1008|      0|                source+=2;
 1009|      0|                if(U16_IS_SINGLE(c)) {
  ------------------
  |  |   51|      0|#define U16_IS_SINGLE(c) !U_IS_SURROGATE(c)
  |  |  ------------------
  |  |  |  |  193|      0|#define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800)
  |  |  ------------------
  |  |  |  Branch (51:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1010|      0|                    *target++=c;
 1011|      0|                    *offsets++=sourceIndex;
 1012|      0|                    sourceIndex+=2;
 1013|      0|                } else if(U16_IS_SURROGATE_LEAD(c) && count>=2 &&
  ------------------
  |  |   84|      0|#define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
  |  |  ------------------
  |  |  |  Branch (84:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1013:55): [True: 0, False: 0]
  ------------------
 1014|      0|                          U16_IS_TRAIL(trail=((char16_t)source[1]<<8)|source[0])
  ------------------
  |  |   67|      0|#define U16_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00)
  |  |  ------------------
  |  |  |  Branch (67:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1015|      0|                ) {
 1016|      0|                    source+=2;
 1017|      0|                    --count;
 1018|      0|                    *target++=c;
 1019|      0|                    *target++=trail;
 1020|      0|                    *offsets++=sourceIndex;
 1021|      0|                    *offsets++=sourceIndex;
 1022|      0|                    sourceIndex+=4;
 1023|      0|                } else {
 1024|      0|                    break;
 1025|      0|                }
 1026|      0|            } while(--count>0);
  ------------------
  |  Branch (1026:21): [True: 0, False: 0]
  ------------------
 1027|      0|        }
 1028|       |
 1029|   303k|        if(count==0) {
  ------------------
  |  Branch (1029:12): [True: 150, False: 303k]
  ------------------
 1030|       |            /* done with the loop for complete UChars */
 1031|    150|            c=0;
 1032|   303k|        } else {
 1033|       |            /* keep c for surrogate handling, trail will be set there */
 1034|   303k|            length+=2*(count-1); /* one more byte pair was consumed than count decremented */
 1035|   303k|            targetCapacity+=count;
 1036|   303k|        }
 1037|   303k|    }
 1038|       |
 1039|   303k|    if(c!=0) {
  ------------------
  |  Branch (1039:8): [True: 303k, False: 171]
  ------------------
 1040|       |        /*
 1041|       |         * c is a surrogate, and
 1042|       |         * - source or target too short
 1043|       |         * - or the surrogate is unmatched
 1044|       |         */
 1045|   303k|        cnv->toUBytes[0]=(uint8_t)c;
 1046|   303k|        cnv->toUBytes[1]=(uint8_t)(c>>8);
 1047|   303k|        cnv->toULength=2;
 1048|       |
 1049|   303k|        if(U16_IS_SURROGATE_LEAD(c)) {
  ------------------
  |  |   84|   303k|#define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
  |  |  ------------------
  |  |  |  Branch (84:34): [True: 110k, False: 193k]
  |  |  ------------------
  ------------------
 1050|   110k|            if(length>=2) {
  ------------------
  |  Branch (1050:16): [True: 110k, False: 19]
  ------------------
 1051|   110k|                if(U16_IS_TRAIL(trail=((char16_t)source[1]<<8)|source[0])) {
  ------------------
  |  |   67|   110k|#define U16_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00)
  |  |  ------------------
  |  |  |  Branch (67:25): [True: 0, False: 110k]
  |  |  ------------------
  ------------------
 1052|       |                    /* output the surrogate pair, will overflow (see conditions comment above) */
 1053|      0|                    source+=2;
 1054|      0|                    length-=2;
 1055|      0|                    *target++=c;
 1056|      0|                    if(offsets!=nullptr) {
  ------------------
  |  Branch (1056:24): [True: 0, False: 0]
  ------------------
 1057|      0|                        *offsets++=sourceIndex;
 1058|      0|                    }
 1059|      0|                    cnv->UCharErrorBuffer[0]=trail;
 1060|      0|                    cnv->UCharErrorBufferLength=1;
 1061|      0|                    cnv->toULength=0;
 1062|      0|                    *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
 1063|   110k|                } else {
 1064|       |                    /* unmatched lead surrogate */
 1065|   110k|                    *pErrorCode=U_ILLEGAL_CHAR_FOUND;
 1066|   110k|                }
 1067|   110k|            } else {
 1068|       |                /* see if the trail surrogate is in the next buffer */
 1069|     19|            }
 1070|   193k|        } else {
 1071|       |            /* unmatched trail surrogate */
 1072|   193k|            *pErrorCode=U_ILLEGAL_CHAR_FOUND;
 1073|   193k|        }
 1074|   303k|    }
 1075|       |
 1076|   303k|    if(U_SUCCESS(*pErrorCode)) {
  ------------------
  |  Branch (1076:8): [True: 190, False: 303k]
  ------------------
 1077|       |        /* check for a remaining source byte */
 1078|    190|        if(length>0) {
  ------------------
  |  Branch (1078:12): [True: 81, False: 109]
  ------------------
 1079|     81|            if(targetCapacity==0) {
  ------------------
  |  Branch (1079:16): [True: 0, False: 81]
  ------------------
 1080|      0|                *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
 1081|     81|            } else {
 1082|       |                /* it must be length==1 because otherwise the above would have copied more */
 1083|     81|                cnv->toUBytes[cnv->toULength++]=*source++;
 1084|     81|            }
 1085|     81|        }
 1086|    190|    }
 1087|       |
 1088|       |    /* write back the updated pointers */
 1089|   303k|    pArgs->source=(const char *)source;
 1090|   303k|    pArgs->target=target;
 1091|   303k|    pArgs->offsets=offsets;
 1092|   303k|}
ucnv_u16.cpp:_ZL12_UTF16LEOpenP10UConverterP18UConverterLoadArgsP10UErrorCode:
 1192|    203|             UErrorCode *pErrorCode) {
 1193|    203|    (void)pArgs;
 1194|    203|    if(UCNV_GET_VERSION(cnv)<=1) {
  ------------------
  |  |   47|    203|#define UCNV_GET_VERSION(cnv) ((cnv)->options&UCNV_OPTION_VERSION)
  |  |  ------------------
  |  |  |  |   44|    203|#define UCNV_OPTION_VERSION     0xf
  |  |  ------------------
  ------------------
  |  Branch (1194:8): [True: 203, False: 0]
  ------------------
 1195|    203|        _UTF16LEReset(cnv, UCNV_RESET_BOTH);
 1196|    203|    } else {
 1197|      0|        *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
 1198|      0|    }
 1199|    203|}
ucnv_u16.cpp:_ZL13_UTF16LEResetP10UConverter21UConverterResetChoice:
 1174|    406|_UTF16LEReset(UConverter *cnv, UConverterResetChoice choice) {
 1175|    406|    if(choice<=UCNV_RESET_TO_UNICODE) {
  ------------------
  |  Branch (1175:8): [True: 406, False: 0]
  ------------------
 1176|       |        /* reset toUnicode state */
 1177|    406|        if(UCNV_GET_VERSION(cnv)==0) {
  ------------------
  |  |   47|    406|#define UCNV_GET_VERSION(cnv) ((cnv)->options&UCNV_OPTION_VERSION)
  |  |  ------------------
  |  |  |  |   44|    406|#define UCNV_OPTION_VERSION     0xf
  |  |  ------------------
  ------------------
  |  Branch (1177:12): [True: 406, False: 0]
  ------------------
 1178|    406|            cnv->mode=8; /* no BOM handling */
 1179|    406|        } else {
 1180|      0|            cnv->mode=0; /* Java-specific "UnicodeLittle" requires LE BOM or no BOM */
 1181|      0|        }
 1182|    406|    }
 1183|    406|    if(choice!=UCNV_RESET_TO_UNICODE && UCNV_GET_VERSION(cnv)==1) {
  ------------------
  |  |   47|    203|#define UCNV_GET_VERSION(cnv) ((cnv)->options&UCNV_OPTION_VERSION)
  |  |  ------------------
  |  |  |  |   44|    203|#define UCNV_OPTION_VERSION     0xf
  |  |  ------------------
  ------------------
  |  Branch (1183:8): [True: 203, False: 203]
  |  Branch (1183:41): [True: 0, False: 203]
  ------------------
 1184|       |        /* reset fromUnicode for "UnicodeLittle": prepare to output the UTF-16LE BOM */
 1185|      0|        cnv->fromUnicodeStatus=UCNV_NEED_TO_WRITE_BOM;
 1186|      0|    }
 1187|    406|}

ucnv_u32.cpp:_ZL31T_UConverter_toUnicode_UTF32_BEP23UConverterToUnicodeArgsP10UErrorCode:
   49|  12.4k|{
   50|  12.4k|    const unsigned char *mySource = (unsigned char *) args->source;
   51|  12.4k|    char16_t *myTarget = args->target;
   52|  12.4k|    const unsigned char *sourceLimit = (unsigned char *) args->sourceLimit;
   53|  12.4k|    const char16_t *targetLimit = args->targetLimit;
   54|  12.4k|    unsigned char *toUBytes = args->converter->toUBytes;
   55|  12.4k|    uint32_t ch, i;
   56|       |
   57|       |    /* Restore state of current sequence */
   58|  12.4k|    if (args->converter->toULength > 0 && myTarget < targetLimit) {
  ------------------
  |  Branch (58:9): [True: 73, False: 12.3k]
  |  Branch (58:43): [True: 73, False: 0]
  ------------------
   59|     73|        i = args->converter->toULength;       /* restore # of bytes consumed */
   60|     73|        args->converter->toULength = 0;
   61|       |
   62|     73|        ch = args->converter->toUnicodeStatus - 1;/*Stores the previously calculated ch from a previous call*/
   63|     73|        args->converter->toUnicodeStatus = 0;
   64|     73|        goto morebytes;
   65|     73|    }
   66|       |
   67|  16.0k|    while (mySource < sourceLimit && myTarget < targetLimit) {
  ------------------
  |  Branch (67:12): [True: 15.8k, False: 196]
  |  Branch (67:38): [True: 15.8k, False: 0]
  ------------------
   68|  15.8k|        i = 0;
   69|  15.8k|        ch = 0;
   70|  15.8k|morebytes:
   71|  78.9k|        while (i < sizeof(uint32_t)) {
  ------------------
  |  Branch (71:16): [True: 63.2k, False: 15.7k]
  ------------------
   72|  63.2k|            if (mySource < sourceLimit) {
  ------------------
  |  Branch (72:17): [True: 63.1k, False: 100]
  ------------------
   73|  63.1k|                ch = (ch << 8) | (uint8_t)(*mySource);
   74|  63.1k|                toUBytes[i++] = (char) *(mySource++);
   75|  63.1k|            }
   76|    100|            else {
   77|       |                /* stores a partially calculated target*/
   78|       |                /* + 1 to make 0 a valid character */
   79|    100|                args->converter->toUnicodeStatus = ch + 1;
   80|    100|                args->converter->toULength = (int8_t) i;
   81|    100|                goto donefornow;
   82|    100|            }
   83|  63.2k|        }
   84|       |
   85|  15.7k|        if (ch <= MAXIMUM_UTF && !U_IS_SURROGATE(ch)) {
  ------------------
  |  |   30|  31.5k|#define MAXIMUM_UTF             0x0010FFFF
  ------------------
                      if (ch <= MAXIMUM_UTF && !U_IS_SURROGATE(ch)) {
  ------------------
  |  |  193|  3.88k|#define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800)
  ------------------
  |  Branch (85:13): [True: 3.88k, False: 11.8k]
  |  Branch (85:34): [True: 3.61k, False: 269]
  ------------------
   86|       |            /* Normal valid byte when the loop has not prematurely terminated (i < inBytes) */
   87|  3.61k|            if (ch <= MAXIMUM_UCS2) 
  ------------------
  |  |   29|  3.61k|#define MAXIMUM_UCS2            0x0000FFFF
  ------------------
  |  Branch (87:17): [True: 2.97k, False: 647]
  ------------------
   88|  2.97k|            {
   89|       |                /* fits in 16 bits */
   90|  2.97k|                *(myTarget++) = (char16_t) ch;
   91|  2.97k|            }
   92|    647|            else {
   93|       |                /* write out the surrogates */
   94|    647|                *(myTarget++) = U16_LEAD(ch);
  ------------------
  |  |  123|    647|#define U16_LEAD(supplementary) (UChar)(((supplementary)>>10)+0xd7c0)
  ------------------
   95|    647|                ch = U16_TRAIL(ch);
  ------------------
  |  |  132|    647|#define U16_TRAIL(supplementary) (UChar)(((supplementary)&0x3ff)|0xdc00)
  ------------------
   96|    647|                if (myTarget < targetLimit) {
  ------------------
  |  Branch (96:21): [True: 647, False: 0]
  ------------------
   97|    647|                    *(myTarget++) = (char16_t)ch;
   98|    647|                }
   99|      0|                else {
  100|       |                    /* Put in overflow buffer (not handled here) */
  101|      0|                    args->converter->UCharErrorBuffer[0] = (char16_t) ch;
  102|      0|                    args->converter->UCharErrorBufferLength = 1;
  103|      0|                    *err = U_BUFFER_OVERFLOW_ERROR;
  104|      0|                    break;
  105|      0|                }
  106|    647|            }
  107|  3.61k|        }
  108|  12.1k|        else {
  109|  12.1k|            args->converter->toULength = (int8_t)i;
  110|  12.1k|            *err = U_ILLEGAL_CHAR_FOUND;
  111|  12.1k|            break;
  112|  12.1k|        }
  113|  15.7k|    }
  114|       |
  115|  12.4k|donefornow:
  116|  12.4k|    if (mySource < sourceLimit && myTarget >= targetLimit && U_SUCCESS(*err)) {
  ------------------
  |  Branch (116:9): [True: 12.1k, False: 362]
  |  Branch (116:35): [True: 0, False: 12.1k]
  |  Branch (116:62): [True: 0, False: 0]
  ------------------
  117|       |        /* End of target buffer */
  118|      0|        *err = U_BUFFER_OVERFLOW_ERROR;
  119|      0|    }
  120|       |
  121|  12.4k|    args->target = myTarget;
  122|  12.4k|    args->source = (const char *) mySource;
  123|  12.4k|}
ucnv_u32.cpp:_ZL31T_UConverter_toUnicode_UTF32_LEP23UConverterToUnicodeArgsP10UErrorCode:
  511|  66.4k|{
  512|  66.4k|    const unsigned char *mySource = (unsigned char *) args->source;
  513|  66.4k|    char16_t *myTarget = args->target;
  514|  66.4k|    const unsigned char *sourceLimit = (unsigned char *) args->sourceLimit;
  515|  66.4k|    const char16_t *targetLimit = args->targetLimit;
  516|  66.4k|    unsigned char *toUBytes = args->converter->toUBytes;
  517|  66.4k|    uint32_t ch, i;
  518|       |
  519|       |    /* Restore state of current sequence */
  520|  66.4k|    if (args->converter->toULength > 0 && myTarget < targetLimit)
  ------------------
  |  Branch (520:9): [True: 15, False: 66.4k]
  |  Branch (520:43): [True: 15, False: 0]
  ------------------
  521|     15|    {
  522|     15|        i = args->converter->toULength;       /* restore # of bytes consumed */
  523|     15|        args->converter->toULength = 0;
  524|       |
  525|       |        /* Stores the previously calculated ch from a previous call*/
  526|     15|        ch = args->converter->toUnicodeStatus - 1;
  527|     15|        args->converter->toUnicodeStatus = 0;
  528|     15|        goto morebytes;
  529|     15|    }
  530|       |
  531|   107k|    while (mySource < sourceLimit && myTarget < targetLimit)
  ------------------
  |  Branch (531:12): [True: 107k, False: 120]
  |  Branch (531:38): [True: 107k, False: 0]
  ------------------
  532|   107k|    {
  533|   107k|        i = 0;
  534|   107k|        ch = 0;
  535|   107k|morebytes:
  536|   537k|        while (i < sizeof(uint32_t))
  ------------------
  |  Branch (536:16): [True: 430k, False: 107k]
  ------------------
  537|   430k|        {
  538|   430k|            if (mySource < sourceLimit)
  ------------------
  |  Branch (538:17): [True: 430k, False: 50]
  ------------------
  539|   430k|            {
  540|   430k|                ch |= ((uint8_t)(*mySource)) << (i * 8);
  541|   430k|                toUBytes[i++] = (char) *(mySource++);
  542|   430k|            }
  543|     50|            else
  544|     50|            {
  545|       |                /* stores a partially calculated target*/
  546|       |                /* + 1 to make 0 a valid character */
  547|     50|                args->converter->toUnicodeStatus = ch + 1;
  548|     50|                args->converter->toULength = (int8_t) i;
  549|     50|                goto donefornow;
  550|     50|            }
  551|   430k|        }
  552|       |
  553|   107k|        if (ch <= MAXIMUM_UTF && !U_IS_SURROGATE(ch)) {
  ------------------
  |  |   30|   215k|#define MAXIMUM_UTF             0x0010FFFF
  ------------------
                      if (ch <= MAXIMUM_UTF && !U_IS_SURROGATE(ch)) {
  ------------------
  |  |  193|  41.4k|#define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800)
  ------------------
  |  Branch (553:13): [True: 41.4k, False: 66.0k]
  |  Branch (553:34): [True: 41.2k, False: 217]
  ------------------
  554|       |            /* Normal valid byte when the loop has not prematurely terminated (i < inBytes) */
  555|  41.2k|            if (ch <= MAXIMUM_UCS2) {
  ------------------
  |  |   29|  41.2k|#define MAXIMUM_UCS2            0x0000FFFF
  ------------------
  |  Branch (555:17): [True: 30.7k, False: 10.4k]
  ------------------
  556|       |                /* fits in 16 bits */
  557|  30.7k|                *(myTarget++) = (char16_t) ch;
  558|  30.7k|            }
  559|  10.4k|            else {
  560|       |                /* write out the surrogates */
  561|  10.4k|                *(myTarget++) = U16_LEAD(ch);
  ------------------
  |  |  123|  10.4k|#define U16_LEAD(supplementary) (UChar)(((supplementary)>>10)+0xd7c0)
  ------------------
  562|  10.4k|                ch = U16_TRAIL(ch);
  ------------------
  |  |  132|  10.4k|#define U16_TRAIL(supplementary) (UChar)(((supplementary)&0x3ff)|0xdc00)
  ------------------
  563|  10.4k|                if (myTarget < targetLimit) {
  ------------------
  |  Branch (563:21): [True: 10.4k, False: 0]
  ------------------
  564|  10.4k|                    *(myTarget++) = (char16_t)ch;
  565|  10.4k|                }
  566|      0|                else {
  567|       |                    /* Put in overflow buffer (not handled here) */
  568|      0|                    args->converter->UCharErrorBuffer[0] = (char16_t) ch;
  569|      0|                    args->converter->UCharErrorBufferLength = 1;
  570|      0|                    *err = U_BUFFER_OVERFLOW_ERROR;
  571|      0|                    break;
  572|      0|                }
  573|  10.4k|            }
  574|  41.2k|        }
  575|  66.2k|        else {
  576|  66.2k|            args->converter->toULength = (int8_t)i;
  577|  66.2k|            *err = U_ILLEGAL_CHAR_FOUND;
  578|  66.2k|            break;
  579|  66.2k|        }
  580|   107k|    }
  581|       |
  582|  66.4k|donefornow:
  583|  66.4k|    if (mySource < sourceLimit && myTarget >= targetLimit && U_SUCCESS(*err))
  ------------------
  |  Branch (583:9): [True: 66.2k, False: 209]
  |  Branch (583:35): [True: 0, False: 66.2k]
  |  Branch (583:62): [True: 0, False: 0]
  ------------------
  584|      0|    {
  585|       |        /* End of target buffer */
  586|      0|        *err = U_BUFFER_OVERFLOW_ERROR;
  587|      0|    }
  588|       |
  589|  66.4k|    args->target = myTarget;
  590|  66.4k|    args->source = (const char *) mySource;
  591|  66.4k|}
ucnv_u32.cpp:_ZL10_UTF32OpenP10UConverterP18UConverterLoadArgsP10UErrorCode:
 1040|    139|           UErrorCode *pErrorCode) {
 1041|    139|    (void)pArgs;
 1042|    139|    (void)pErrorCode;
 1043|    139|    _UTF32Reset(cnv, UCNV_RESET_BOTH);
 1044|    139|}
ucnv_u32.cpp:_ZL11_UTF32ResetP10UConverter21UConverterResetChoice:
 1026|    278|_UTF32Reset(UConverter *cnv, UConverterResetChoice choice) {
 1027|    278|    if(choice<=UCNV_RESET_TO_UNICODE) {
  ------------------
  |  Branch (1027:8): [True: 278, False: 0]
  ------------------
 1028|       |        /* reset toUnicode: state=0 */
 1029|    278|        cnv->mode=0;
 1030|    278|    }
 1031|    278|    if(choice!=UCNV_RESET_TO_UNICODE) {
  ------------------
  |  Branch (1031:8): [True: 139, False: 139]
  ------------------
 1032|       |        /* reset fromUnicode: prepare to output the UTF-32PE BOM */
 1033|    139|        cnv->fromUnicodeStatus=UCNV_NEED_TO_WRITE_BOM;
 1034|    139|    }
 1035|    278|}
ucnv_u32.cpp:_ZL26_UTF32ToUnicodeWithOffsetsP23UConverterToUnicodeArgsP10UErrorCode:
 1050|  77.6k|                           UErrorCode *pErrorCode) {
 1051|  77.6k|    UConverter *cnv=pArgs->converter;
 1052|  77.6k|    const char *source=pArgs->source;
 1053|  77.6k|    const char *sourceLimit=pArgs->sourceLimit;
 1054|  77.6k|    int32_t *offsets=pArgs->offsets;
 1055|       |
 1056|  77.6k|    int32_t state, offsetDelta;
 1057|  77.6k|    char b;
 1058|       |
 1059|  77.6k|    state=cnv->mode;
 1060|       |
 1061|       |    /*
 1062|       |     * If we detect a BOM in this buffer, then we must add the BOM size to the
 1063|       |     * offsets because the actual converter function will not see and count the BOM.
 1064|       |     * offsetDelta will have the number of the BOM bytes that are in the current buffer.
 1065|       |     */
 1066|  77.6k|    offsetDelta=0;
 1067|       |
 1068|   155k|    while(source<sourceLimit && U_SUCCESS(*pErrorCode)) {
  ------------------
  |  Branch (1068:11): [True: 155k, False: 233]
  |  Branch (1068:33): [True: 77.8k, False: 77.3k]
  ------------------
 1069|  77.8k|        switch(state) {
 1070|    139|        case 0:
  ------------------
  |  Branch (1070:9): [True: 139, False: 77.6k]
  ------------------
 1071|    139|            b=*source;
 1072|    139|            if(b==0) {
  ------------------
  |  Branch (1072:16): [True: 68, False: 71]
  ------------------
 1073|     68|                state=1; /* could be 00 00 FE FF */
 1074|     71|            } else if(b==(char)0xffu) {
  ------------------
  |  Branch (1074:23): [True: 33, False: 38]
  ------------------
 1075|     33|                state=5; /* could be FF FE 00 00 */
 1076|     38|            } else {
 1077|     38|                state=8; /* default to UTF-32BE */
 1078|     38|                continue;
 1079|     38|            }
 1080|    101|            ++source;
 1081|    101|            break;
 1082|     67|        case 1:
  ------------------
  |  Branch (1082:9): [True: 67, False: 77.7k]
  ------------------
 1083|     99|        case 2:
  ------------------
  |  Branch (1083:9): [True: 32, False: 77.7k]
  ------------------
 1084|    103|        case 3:
  ------------------
  |  Branch (1084:9): [True: 4, False: 77.8k]
  ------------------
 1085|    135|        case 5:
  ------------------
  |  Branch (1085:9): [True: 32, False: 77.7k]
  ------------------
 1086|    158|        case 6:
  ------------------
  |  Branch (1086:9): [True: 23, False: 77.7k]
  ------------------
 1087|    176|        case 7:
  ------------------
  |  Branch (1087:9): [True: 18, False: 77.8k]
  ------------------
 1088|    176|            if(*source==utf32BOM[state]) {
  ------------------
  |  Branch (1088:16): [True: 99, False: 77]
  ------------------
 1089|     99|                ++state;
 1090|     99|                ++source;
 1091|     99|                if(state==4) {
  ------------------
  |  Branch (1091:20): [True: 1, False: 98]
  ------------------
 1092|      1|                    state=8; /* detect UTF-32BE */
 1093|      1|                    offsetDelta=(int32_t)(source-pArgs->source);
 1094|     98|                } else if(state==8) {
  ------------------
  |  Branch (1094:27): [True: 17, False: 81]
  ------------------
 1095|     17|                    state=9; /* detect UTF-32LE */
 1096|     17|                    offsetDelta=(int32_t)(source-pArgs->source);
 1097|     17|                }
 1098|     99|            } else {
 1099|       |                /* switch to UTF-32BE and pass the previous bytes */
 1100|     77|                int32_t count=(int32_t)(source-pArgs->source); /* number of bytes from this buffer */
 1101|       |
 1102|       |                /* reset the source */
 1103|     77|                source=pArgs->source;
 1104|       |
 1105|     77|                if(count==(state&3)) {
  ------------------
  |  Branch (1105:20): [True: 77, False: 0]
  ------------------
 1106|       |                    /* simple: all in the same buffer, just reset source */
 1107|     77|                } else {
 1108|      0|                    UBool oldFlush=pArgs->flush;
 1109|       |
 1110|       |                    /* some of the bytes are from a previous buffer, replay those first */
 1111|      0|                    pArgs->source=utf32BOM+(state&4); /* select the correct BOM */
 1112|      0|                    pArgs->sourceLimit=pArgs->source+((state&3)-count); /* replay previous bytes */
 1113|      0|                    pArgs->flush=false; /* this sourceLimit is not the real source stream limit */
 1114|       |
 1115|       |                    /* no offsets: bytes from previous buffer, and not enough for output */
 1116|      0|                    T_UConverter_toUnicode_UTF32_BE(pArgs, pErrorCode);
 1117|       |
 1118|       |                    /* restore real pointers; pArgs->source will be set in case 8/9 */
 1119|      0|                    pArgs->sourceLimit=sourceLimit;
 1120|      0|                    pArgs->flush=oldFlush;
 1121|      0|                }
 1122|     77|                state=8;
 1123|     77|                continue;
 1124|     77|            }
 1125|     99|            break;
 1126|  12.1k|        case 8:
  ------------------
  |  Branch (1126:9): [True: 12.1k, False: 65.6k]
  ------------------
 1127|       |            /* call UTF-32BE */
 1128|  12.1k|            pArgs->source=source;
 1129|  12.1k|            if(offsets==nullptr) {
  ------------------
  |  Branch (1129:16): [True: 12.1k, False: 0]
  ------------------
 1130|  12.1k|                T_UConverter_toUnicode_UTF32_BE(pArgs, pErrorCode);
 1131|  12.1k|            } else {
 1132|      0|                T_UConverter_toUnicode_UTF32_BE_OFFSET_LOGIC(pArgs, pErrorCode);
 1133|      0|            }
 1134|  12.1k|            source=pArgs->source;
 1135|  12.1k|            break;
 1136|  65.3k|        case 9:
  ------------------
  |  Branch (1136:9): [True: 65.3k, False: 12.4k]
  ------------------
 1137|       |            /* call UTF-32LE */
 1138|  65.3k|            pArgs->source=source;
 1139|  65.3k|            if(offsets==nullptr) {
  ------------------
  |  Branch (1139:16): [True: 65.3k, False: 0]
  ------------------
 1140|  65.3k|                T_UConverter_toUnicode_UTF32_LE(pArgs, pErrorCode);
 1141|  65.3k|            } else {
 1142|      0|                T_UConverter_toUnicode_UTF32_LE_OFFSET_LOGIC(pArgs, pErrorCode);
 1143|      0|            }
 1144|  65.3k|            source=pArgs->source;
 1145|  65.3k|            break;
 1146|      0|        default:
  ------------------
  |  Branch (1146:9): [True: 0, False: 77.8k]
  ------------------
 1147|      0|            break; /* does not occur */
 1148|  77.8k|        }
 1149|  77.8k|    }
 1150|       |
 1151|       |    /* add BOM size to offsets - see comment at offsetDelta declaration */
 1152|  77.6k|    if(offsets!=nullptr && offsetDelta!=0) {
  ------------------
  |  Branch (1152:8): [True: 0, False: 77.6k]
  |  Branch (1152:28): [True: 0, False: 0]
  ------------------
 1153|      0|        int32_t *offsetsLimit=pArgs->offsets;
 1154|      0|        while(offsets<offsetsLimit) {
  ------------------
  |  Branch (1154:15): [True: 0, False: 0]
  ------------------
 1155|      0|            *offsets++ += offsetDelta;
 1156|      0|        }
 1157|      0|    }
 1158|       |
 1159|  77.6k|    pArgs->source=source;
 1160|       |
 1161|  77.6k|    if(source==sourceLimit && pArgs->flush) {
  ------------------
  |  Branch (1161:8): [True: 233, False: 77.3k]
  |  Branch (1161:31): [True: 233, False: 0]
  ------------------
 1162|       |        /* handle truncated input */
 1163|    233|        switch(state) {
 1164|      0|        case 0:
  ------------------
  |  Branch (1164:9): [True: 0, False: 233]
  ------------------
 1165|      0|            break; /* no input at all, nothing to do */
 1166|    195|        case 8:
  ------------------
  |  Branch (1166:9): [True: 195, False: 38]
  ------------------
 1167|    195|            T_UConverter_toUnicode_UTF32_BE(pArgs, pErrorCode);
 1168|    195|            break;
 1169|     32|        case 9:
  ------------------
  |  Branch (1169:9): [True: 32, False: 201]
  ------------------
 1170|     32|            T_UConverter_toUnicode_UTF32_LE(pArgs, pErrorCode);
 1171|     32|            break;
 1172|      6|        default:
  ------------------
  |  Branch (1172:9): [True: 6, False: 227]
  ------------------
 1173|       |            /* handle 0<state<8: call UTF-32BE with too-short input */
 1174|      6|            pArgs->source=utf32BOM+(state&4); /* select the correct BOM */
 1175|      6|            pArgs->sourceLimit=pArgs->source+(state&3); /* replay bytes */
 1176|       |
 1177|       |            /* no offsets: not enough for output */
 1178|      6|            T_UConverter_toUnicode_UTF32_BE(pArgs, pErrorCode);
 1179|      6|            pArgs->source=source;
 1180|      6|            pArgs->sourceLimit=sourceLimit;
 1181|      6|            state=8;
 1182|      6|            break;
 1183|    233|        }
 1184|    233|    }
 1185|       |
 1186|  77.6k|    cnv->mode=state;
 1187|  77.6k|}

ucnv_u8.cpp:_ZL12hasCESU8DataPK10UConverter:
   57|   364k|{
   58|       |#if UCONFIG_ONLY_HTML_CONVERSION
   59|       |    return false;
   60|       |#else
   61|   364k|    return cnv->sharedData == &_CESU8Data;
  ------------------
  |  |   87|   364k|#define _CESU8Data U_ICU_ENTRY_POINT_RENAME(_CESU8Data)
  |  |  ------------------
  |  |  |  |  123|   364k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|   364k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|   364k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   62|   364k|#endif
   63|   364k|}
ucnv_u8.cpp:_ZL19ucnv_toUnicode_UTF8P23UConverterToUnicodeArgsP10UErrorCode:
   67|   364k|{
   68|   364k|    UConverter *cnv = args->converter;
   69|   364k|    const unsigned char *mySource = (unsigned char *) args->source;
   70|   364k|    char16_t *myTarget = args->target;
   71|   364k|    const unsigned char *sourceLimit = (unsigned char *) args->sourceLimit;
   72|   364k|    const char16_t *targetLimit = args->targetLimit;
   73|   364k|    unsigned char *toUBytes = cnv->toUBytes;
   74|   364k|    UBool isCESU8 = hasCESU8Data(cnv);
   75|   364k|    uint32_t ch, ch2 = 0;
   76|   364k|    int32_t i, inBytes;
   77|       |
   78|       |    /* Restore size of current sequence */
   79|   364k|    if (cnv->toULength > 0 && myTarget < targetLimit)
  ------------------
  |  Branch (79:9): [True: 0, False: 364k]
  |  Branch (79:31): [True: 0, False: 0]
  ------------------
   80|      0|    {
   81|      0|        inBytes = cnv->mode;            /* restore # of bytes to consume */
   82|      0|        i = cnv->toULength;             /* restore # of bytes consumed */
   83|      0|        cnv->toULength = 0;
   84|       |
   85|      0|        ch = cnv->toUnicodeStatus;/*Stores the previously calculated ch from a previous call*/
   86|      0|        cnv->toUnicodeStatus = 0;
   87|      0|        goto morebytes;
   88|      0|    }
   89|       |
   90|       |
   91|  5.00M|    while (mySource < sourceLimit && myTarget < targetLimit)
  ------------------
  |  Branch (91:12): [True: 5.00M, False: 137]
  |  Branch (91:38): [True: 5.00M, False: 0]
  ------------------
   92|  5.00M|    {
   93|  5.00M|        ch = *(mySource++);
   94|  5.00M|        if (U8_IS_SINGLE(ch))        /* Simple case */
  ------------------
  |  |  173|  5.00M|#define U8_IS_SINGLE(c) (((c)&0x80)==0)
  |  |  ------------------
  |  |  |  Branch (173:25): [True: 4.60M, False: 392k]
  |  |  ------------------
  ------------------
   95|  4.60M|        {
   96|  4.60M|            *(myTarget++) = (char16_t) ch;
   97|  4.60M|        }
   98|   392k|        else
   99|   392k|        {
  100|       |            /* store the first char */
  101|   392k|            toUBytes[0] = (char)ch;
  102|   392k|            inBytes = U8_COUNT_BYTES_NON_ASCII(ch); /* lookup current sequence length */
  ------------------
  |  |  118|   392k|    (U8_IS_LEAD(leadByte) ? ((uint8_t)(leadByte)>=0xe0)+((uint8_t)(leadByte)>=0xf0)+2 : 0)
  |  |  ------------------
  |  |  |  |  181|   392k|#define U8_IS_LEAD(c) ((uint8_t)((c)-0xc2)<=0x32)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:23): [True: 170k, False: 221k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  103|   392k|            i = 1;
  104|       |
  105|   392k|morebytes:
  106|   437k|            while (i < inBytes)
  ------------------
  |  Branch (106:20): [True: 188k, False: 249k]
  ------------------
  107|   188k|            {
  108|   188k|                if (mySource < sourceLimit)
  ------------------
  |  Branch (108:21): [True: 188k, False: 44]
  ------------------
  109|   188k|                {
  110|   188k|                    toUBytes[i] = (char) (ch2 = *mySource);
  111|   188k|                    if (!icu::UTF8::isValidTrail(ch, static_cast<uint8_t>(ch2), i, inBytes) &&
  ------------------
  |  Branch (111:25): [True: 142k, False: 45.1k]
  ------------------
  112|   188k|                            !(isCESU8 && i == 1 && ch == 0xed && U8_IS_TRAIL(ch2)))
  ------------------
  |  |  190|      0|#define U8_IS_TRAIL(c) ((int8_t)(c)<-0x40)
  |  |  ------------------
  |  |  |  Branch (190:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (112:31): [True: 0, False: 142k]
  |  Branch (112:42): [True: 0, False: 0]
  |  Branch (112:52): [True: 0, False: 0]
  ------------------
  113|   142k|                    {
  114|   142k|                        break; /* i < inBytes */
  115|   142k|                    }
  116|  45.1k|                    ch = (ch << 6) + ch2;
  117|  45.1k|                    ++mySource;
  118|  45.1k|                    i++;
  119|  45.1k|                }
  120|     44|                else
  121|     44|                {
  122|       |                    /* stores a partially calculated target*/
  123|     44|                    cnv->toUnicodeStatus = ch;
  124|     44|                    cnv->mode = inBytes;
  125|     44|                    cnv->toULength = (int8_t) i;
  126|     44|                    goto donefornow;
  127|     44|                }
  128|   188k|            }
  129|       |
  130|       |            // In CESU-8, only surrogates, not supplementary code points, are encoded directly.
  131|   392k|            if (i == inBytes && (!isCESU8 || i <= 3))
  ------------------
  |  Branch (131:17): [True: 27.8k, False: 364k]
  |  Branch (131:34): [True: 27.8k, False: 0]
  |  Branch (131:46): [True: 0, False: 0]
  ------------------
  132|  27.8k|            {
  133|       |                /* Remove the accumulated high bits */
  134|  27.8k|                ch -= offsetsFromUTF8[inBytes];
  135|       |
  136|       |                /* Normal valid byte when the loop has not prematurely terminated (i < inBytes) */
  137|  27.8k|                if (ch <= MAXIMUM_UCS2) 
  ------------------
  |  |   49|  27.8k|#define MAXIMUM_UCS2            0x0000FFFF
  ------------------
  |  Branch (137:21): [True: 27.4k, False: 436]
  ------------------
  138|  27.4k|                {
  139|       |                    /* fits in 16 bits */
  140|  27.4k|                    *(myTarget++) = (char16_t) ch;
  141|  27.4k|                }
  142|    436|                else
  143|    436|                {
  144|       |                    /* write out the surrogates */
  145|    436|                    *(myTarget++) = U16_LEAD(ch);
  ------------------
  |  |  123|    436|#define U16_LEAD(supplementary) (UChar)(((supplementary)>>10)+0xd7c0)
  ------------------
  146|    436|                    ch = U16_TRAIL(ch);
  ------------------
  |  |  132|    436|#define U16_TRAIL(supplementary) (UChar)(((supplementary)&0x3ff)|0xdc00)
  ------------------
  147|    436|                    if (myTarget < targetLimit)
  ------------------
  |  Branch (147:25): [True: 436, False: 0]
  ------------------
  148|    436|                    {
  149|    436|                        *(myTarget++) = (char16_t)ch;
  150|    436|                    }
  151|      0|                    else
  152|      0|                    {
  153|       |                        /* Put in overflow buffer (not handled here) */
  154|      0|                        cnv->UCharErrorBuffer[0] = (char16_t) ch;
  155|      0|                        cnv->UCharErrorBufferLength = 1;
  156|      0|                        *err = U_BUFFER_OVERFLOW_ERROR;
  157|      0|                        break;
  158|      0|                    }
  159|    436|                }
  160|  27.8k|            }
  161|   364k|            else
  162|   364k|            {
  163|   364k|                cnv->toULength = (int8_t)i;
  164|   364k|                *err = U_ILLEGAL_CHAR_FOUND;
  165|   364k|                break;
  166|   364k|            }
  167|   392k|        }
  168|  5.00M|    }
  169|       |
  170|   364k|donefornow:
  171|   364k|    if (mySource < sourceLimit && myTarget >= targetLimit && U_SUCCESS(*err))
  ------------------
  |  Branch (171:9): [True: 364k, False: 198]
  |  Branch (171:35): [True: 0, False: 364k]
  |  Branch (171:62): [True: 0, False: 0]
  ------------------
  172|      0|    {
  173|       |        /* End of target buffer */
  174|      0|        *err = U_BUFFER_OVERFLOW_ERROR;
  175|      0|    }
  176|       |
  177|   364k|    args->target = myTarget;
  178|   364k|    args->source = (const char *) mySource;
  179|   364k|}

ucnvhz.cpp:_ZL7_HZOpenP10UConverterP18UConverterLoadArgsP10UErrorCode:
   72|    247|_HZOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorCode){
   73|    247|    UConverter *gbConverter;
   74|    247|    if(pArgs->onlyTestIsLoadable) {
  ------------------
  |  Branch (74:8): [True: 0, False: 247]
  ------------------
   75|      0|        ucnv_canCreateConverter("GBK", errorCode);  /* errorCode carries result */
  ------------------
  |  |  632|      0|#define ucnv_canCreateConverter U_ICU_ENTRY_POINT_RENAME(ucnv_canCreateConverter)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   76|      0|        return;
   77|      0|    }
   78|    247|    gbConverter = ucnv_open("GBK", errorCode);
  ------------------
  |  |  701|    247|#define ucnv_open U_ICU_ENTRY_POINT_RENAME(ucnv_open)
  |  |  ------------------
  |  |  |  |  123|    247|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|    247|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|    247|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   79|    247|    if(U_FAILURE(*errorCode)) {
  ------------------
  |  Branch (79:8): [True: 0, False: 247]
  ------------------
   80|      0|        return;
   81|      0|    }
   82|    247|    cnv->toUnicodeStatus = 0;
   83|    247|    cnv->fromUnicodeStatus= 0;
   84|    247|    cnv->mode=0;
   85|    247|    cnv->fromUChar32=0x0000;
   86|    247|    cnv->extraInfo = uprv_calloc(1, sizeof(UConverterDataHZ));
  ------------------
  |  | 1398|    247|#define uprv_calloc U_ICU_ENTRY_POINT_RENAME(uprv_calloc)
  |  |  ------------------
  |  |  |  |  123|    247|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|    247|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|    247|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   87|    247|    if(cnv->extraInfo != nullptr){
  ------------------
  |  Branch (87:8): [True: 247, False: 0]
  ------------------
   88|    247|        ((UConverterDataHZ*)cnv->extraInfo)->gbConverter = gbConverter;
   89|    247|    }
   90|      0|    else {
   91|      0|        ucnv_close(gbConverter);
  ------------------
  |  |  639|      0|#define ucnv_close U_ICU_ENTRY_POINT_RENAME(ucnv_close)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   92|      0|        *errorCode = U_MEMORY_ALLOCATION_ERROR;
   93|      0|        return;
   94|      0|    }
   95|    247|}
ucnvhz.cpp:_ZL8_HZCloseP10UConverter:
   98|    247|_HZClose(UConverter *cnv){
   99|    247|    if(cnv->extraInfo != nullptr) {
  ------------------
  |  Branch (99:8): [True: 247, False: 0]
  ------------------
  100|    247|        ucnv_close (((UConverterDataHZ *) (cnv->extraInfo))->gbConverter);
  ------------------
  |  |  639|    247|#define ucnv_close U_ICU_ENTRY_POINT_RENAME(ucnv_close)
  |  |  ------------------
  |  |  |  |  123|    247|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|    247|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|    247|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  101|    247|        if(!cnv->isExtraLocal) {
  ------------------
  |  Branch (101:12): [True: 247, False: 0]
  ------------------
  102|    247|            uprv_free(cnv->extraInfo);
  ------------------
  |  | 1503|    247|#define uprv_free U_ICU_ENTRY_POINT_RENAME(uprv_free)
  |  |  ------------------
  |  |  |  |  123|    247|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|    247|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|    247|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  103|    247|        }
  104|    247|        cnv->extraInfo = nullptr;
  105|    247|    }
  106|    247|}
ucnvhz.cpp:_ZL8_HZResetP10UConverter21UConverterResetChoice:
  109|    247|_HZReset(UConverter *cnv, UConverterResetChoice choice){
  110|    247|    if(choice<=UCNV_RESET_TO_UNICODE) {
  ------------------
  |  Branch (110:8): [True: 247, False: 0]
  ------------------
  111|    247|        cnv->toUnicodeStatus = 0;
  112|    247|        cnv->mode=0;
  113|    247|        if(cnv->extraInfo != nullptr){
  ------------------
  |  Branch (113:12): [True: 247, False: 0]
  ------------------
  114|    247|            ((UConverterDataHZ*)cnv->extraInfo)->isStateDBCS = false;
  115|    247|            ((UConverterDataHZ*)cnv->extraInfo)->isEmptySegment = false;
  116|    247|        }
  117|    247|    }
  118|    247|    if(choice!=UCNV_RESET_TO_UNICODE) {
  ------------------
  |  Branch (118:8): [True: 0, False: 247]
  ------------------
  119|      0|        cnv->fromUnicodeStatus= 0;
  120|      0|        cnv->fromUChar32=0x0000; 
  121|      0|        if(cnv->extraInfo != nullptr){
  ------------------
  |  Branch (121:12): [True: 0, False: 0]
  ------------------
  122|      0|            ((UConverterDataHZ*)cnv->extraInfo)->isEscapeAppended = false;
  123|      0|            ((UConverterDataHZ*)cnv->extraInfo)->targetIndex = 0;
  124|      0|            ((UConverterDataHZ*)cnv->extraInfo)->sourceIndex = 0;
  125|      0|            ((UConverterDataHZ*)cnv->extraInfo)->isTargetUCharDBCS = false;
  126|      0|        }
  127|      0|    }
  128|    247|}
ucnvhz.cpp:_ZL37UConverter_toUnicode_HZ_OFFSETS_LOGICP23UConverterToUnicodeArgsP10UErrorCode:
  157|   326k|                                                            UErrorCode* err){
  158|   326k|    char tempBuf[2];
  159|   326k|    const char *mySource = ( char *) args->source;
  160|   326k|    char16_t *myTarget = args->target;
  161|   326k|    const char *mySourceLimit = args->sourceLimit;
  162|   326k|    UChar32 targetUniChar = 0x0000;
  163|   326k|    int32_t mySourceChar = 0x0000;
  164|   326k|    UConverterDataHZ* myData=(UConverterDataHZ*)(args->converter->extraInfo);
  165|   326k|    tempBuf[0]=0; 
  166|   326k|    tempBuf[1]=0;
  167|       |
  168|       |    /* Calling code already handles this situation. */
  169|       |    /*if ((args->converter == nullptr) || (args->targetLimit < args->target) || (mySourceLimit < args->source)){
  170|       |        *err = U_ILLEGAL_ARGUMENT_ERROR;
  171|       |        return;
  172|       |    }*/
  173|       |    
  174|  1.07M|    while(mySource< mySourceLimit){
  ------------------
  |  Branch (174:11): [True: 1.07M, False: 247]
  ------------------
  175|       |        
  176|  1.07M|        if(myTarget < args->targetLimit){
  ------------------
  |  Branch (176:12): [True: 1.07M, False: 0]
  ------------------
  177|       |            
  178|  1.07M|            mySourceChar= (unsigned char) *mySource++;
  179|       |
  180|  1.07M|            if(args->converter->mode == UCNV_TILDE) {
  ------------------
  |  |   32|  1.07M|#define UCNV_TILDE 0x7E          /* ~ */
  ------------------
  |  Branch (180:16): [True: 6.36k, False: 1.06M]
  ------------------
  181|       |                /* second byte after ~ */
  182|  6.36k|                args->converter->mode=0;
  183|  6.36k|                switch(mySourceChar) {
  184|    319|                case 0x0A:
  ------------------
  |  Branch (184:17): [True: 319, False: 6.04k]
  ------------------
  185|       |                    /* no output for ~\n (line-continuation marker) */
  186|    319|                    continue;
  187|  1.31k|                case UCNV_TILDE:
  ------------------
  |  |   32|  1.31k|#define UCNV_TILDE 0x7E          /* ~ */
  ------------------
  |  Branch (187:17): [True: 1.31k, False: 5.05k]
  ------------------
  188|  1.31k|                    if(args->offsets) {
  ------------------
  |  Branch (188:24): [True: 0, False: 1.31k]
  ------------------
  189|      0|                        args->offsets[myTarget - args->target]=(int32_t)(mySource - args->source - 2);
  190|      0|                    }
  191|  1.31k|                    *(myTarget++)=(char16_t)mySourceChar;
  192|  1.31k|                    myData->isEmptySegment = false;
  193|  1.31k|                    continue;
  194|    526|                case UCNV_OPEN_BRACE:
  ------------------
  |  |   33|    526|#define UCNV_OPEN_BRACE 0x7B     /* { */
  ------------------
  |  Branch (194:17): [True: 526, False: 5.84k]
  ------------------
  195|  1.38k|                case UCNV_CLOSE_BRACE:
  ------------------
  |  |   34|  1.38k|#define UCNV_CLOSE_BRACE 0x7D   /* } */
  ------------------
  |  Branch (195:17): [True: 855, False: 5.51k]
  ------------------
  196|  1.38k|                    myData->isStateDBCS = (mySourceChar == UCNV_OPEN_BRACE);
  ------------------
  |  |   33|  1.38k|#define UCNV_OPEN_BRACE 0x7B     /* { */
  ------------------
  197|  1.38k|                    if (myData->isEmptySegment) {
  ------------------
  |  Branch (197:25): [True: 463, False: 918]
  ------------------
  198|    463|                        myData->isEmptySegment = false; /* we are handling it, reset to avoid future spurious errors */
  199|    463|                        *err = U_ILLEGAL_ESCAPE_SEQUENCE;
  200|    463|                        args->converter->toUCallbackReason = UCNV_IRREGULAR;
  201|    463|                        args->converter->toUBytes[0] = UCNV_TILDE;
  ------------------
  |  |   32|    463|#define UCNV_TILDE 0x7E          /* ~ */
  ------------------
  202|    463|                        args->converter->toUBytes[1] = static_cast<uint8_t>(mySourceChar);
  203|    463|                        args->converter->toULength = 2;
  204|    463|                        args->target = myTarget;
  205|    463|                        args->source = mySource;
  206|    463|                        return;
  207|    463|                    }
  208|    918|                    myData->isEmptySegment = true;
  209|    918|                    continue;
  210|  3.35k|                default:
  ------------------
  |  Branch (210:17): [True: 3.35k, False: 3.01k]
  ------------------
  211|       |                     /* if the first byte is equal to TILDE and the trail byte
  212|       |                     * is not a valid byte then it is an error condition
  213|       |                     */
  214|       |                    /*
  215|       |                     * Ticket 5691: consistent illegal sequences:
  216|       |                     * - We include at least the first byte in the illegal sequence.
  217|       |                     * - If any of the non-initial bytes could be the start of a character,
  218|       |                     *   we stop the illegal sequence before the first one of those.
  219|       |                     */
  220|  3.35k|                    myData->isEmptySegment = false; /* different error here, reset this to avoid spurious future error */
  221|  3.35k|                    *err = U_ILLEGAL_ESCAPE_SEQUENCE;
  222|  3.35k|                    args->converter->toUBytes[0] = UCNV_TILDE;
  ------------------
  |  |   32|  3.35k|#define UCNV_TILDE 0x7E          /* ~ */
  ------------------
  223|  3.35k|                    if( myData->isStateDBCS ?
  ------------------
  |  Branch (223:25): [True: 2.23k, False: 1.12k]
  |  Branch (223:25): [True: 1.60k, False: 1.74k]
  ------------------
  224|  2.23k|                            (0x21 <= mySourceChar && mySourceChar <= 0x7e) :
  ------------------
  |  Branch (224:30): [True: 1.96k, False: 267]
  |  Branch (224:54): [True: 925, False: 1.04k]
  ------------------
  225|  3.35k|                            mySourceChar <= 0x7f
  226|  3.35k|                    ) {
  227|       |                        /* The current byte could be the start of a character: Back it out. */
  228|  1.60k|                        args->converter->toULength = 1;
  229|  1.60k|                        --mySource;
  230|  1.74k|                    } else {
  231|       |                        /* Include the current byte in the illegal sequence. */
  232|  1.74k|                        args->converter->toUBytes[1] = static_cast<uint8_t>(mySourceChar);
  233|  1.74k|                        args->converter->toULength = 2;
  234|  1.74k|                    }
  235|  3.35k|                    args->target = myTarget;
  236|  3.35k|                    args->source = mySource;
  237|  3.35k|                    return;
  238|  6.36k|                }
  239|  1.06M|            } else if(myData->isStateDBCS) {
  ------------------
  |  Branch (239:23): [True: 851k, False: 215k]
  ------------------
  240|   851k|                if(args->converter->toUnicodeStatus == 0x00){
  ------------------
  |  Branch (240:20): [True: 427k, False: 424k]
  ------------------
  241|       |                    /* lead byte */
  242|   427k|                    if(mySourceChar == UCNV_TILDE) {
  ------------------
  |  |   32|   427k|#define UCNV_TILDE 0x7E          /* ~ */
  ------------------
  |  Branch (242:24): [True: 3.70k, False: 424k]
  ------------------
  243|  3.70k|                        args->converter->mode = UCNV_TILDE;
  ------------------
  |  |   32|  3.70k|#define UCNV_TILDE 0x7E          /* ~ */
  ------------------
  244|   424k|                    } else {
  245|       |                        /* add another bit to distinguish a 0 byte from not having seen a lead byte */
  246|   424k|                        args->converter->toUnicodeStatus = (uint32_t) (mySourceChar | 0x100);
  247|   424k|                        myData->isEmptySegment = false; /* the segment has something, either valid or will produce a different error, so reset this */
  248|   424k|                    }
  249|   427k|                    continue;
  250|   427k|                }
  251|   424k|                else{
  252|       |                    /* trail byte */
  253|   424k|                    int leadIsOk, trailIsOk;
  254|   424k|                    uint32_t leadByte = args->converter->toUnicodeStatus & 0xff;
  255|   424k|                    targetUniChar = 0xffff;
  256|       |                    /*
  257|       |                     * Ticket 5691: consistent illegal sequences:
  258|       |                     * - We include at least the first byte in the illegal sequence.
  259|       |                     * - If any of the non-initial bytes could be the start of a character,
  260|       |                     *   we stop the illegal sequence before the first one of those.
  261|       |                     *
  262|       |                     * In HZ DBCS, if the second byte is in the 21..7e range,
  263|       |                     * we report only the first byte as the illegal sequence.
  264|       |                     * Otherwise we convert or report the pair of bytes.
  265|       |                     */
  266|   424k|                    leadIsOk = (uint8_t)(leadByte - 0x21) <= (0x7d - 0x21);
  267|   424k|                    trailIsOk = (uint8_t)(mySourceChar - 0x21) <= (0x7e - 0x21);
  268|   424k|                    if (leadIsOk && trailIsOk) {
  ------------------
  |  Branch (268:25): [True: 218k, False: 205k]
  |  Branch (268:37): [True: 172k, False: 46.3k]
  ------------------
  269|   172k|                        tempBuf[0] = (char) (leadByte+0x80) ;
  270|   172k|                        tempBuf[1] = (char) (mySourceChar+0x80);
  271|   172k|                        targetUniChar = ucnv_MBCSSimpleGetNextUChar(myData->gbConverter->sharedData,
  ------------------
  |  |  628|   172k|#define ucnv_MBCSSimpleGetNextUChar U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSSimpleGetNextUChar)
  |  |  ------------------
  |  |  |  |  123|   172k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|   172k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|   172k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  272|   172k|                            tempBuf, 2, args->converter->useFallback);
  273|   172k|                        mySourceChar= (leadByte << 8) | mySourceChar;
  274|   251k|                    } else if (trailIsOk) {
  ------------------
  |  Branch (274:32): [True: 26.1k, False: 225k]
  ------------------
  275|       |                        /* report a single illegal byte and continue with the following DBCS starter byte */
  276|  26.1k|                        --mySource;
  277|  26.1k|                        mySourceChar = (int32_t)leadByte;
  278|   225k|                    } else {
  279|       |                        /* report a pair of illegal bytes if the second byte is not a DBCS starter */
  280|       |                        /* add another bit so that the code below writes 2 bytes in case of error */
  281|   225k|                        mySourceChar= 0x10000 | (leadByte << 8) | mySourceChar;
  282|   225k|                    }
  283|   424k|                    args->converter->toUnicodeStatus =0x00;
  284|   424k|                }
  285|   851k|            }
  286|   215k|            else{
  287|   215k|                if(mySourceChar == UCNV_TILDE) {
  ------------------
  |  |   32|   215k|#define UCNV_TILDE 0x7E          /* ~ */
  ------------------
  |  Branch (287:20): [True: 2.68k, False: 213k]
  ------------------
  288|  2.68k|                    args->converter->mode = UCNV_TILDE;
  ------------------
  |  |   32|  2.68k|#define UCNV_TILDE 0x7E          /* ~ */
  ------------------
  289|  2.68k|                    continue;
  290|   213k|                } else if(mySourceChar <= 0x7f) {
  ------------------
  |  Branch (290:27): [True: 142k, False: 71.2k]
  ------------------
  291|   142k|                    targetUniChar = (char16_t)mySourceChar;  /* ASCII */
  292|   142k|                    myData->isEmptySegment = false; /* the segment has something valid */
  293|   142k|                } else {
  294|  71.2k|                    targetUniChar = 0xffff;
  295|  71.2k|                    myData->isEmptySegment = false; /* different error here, reset this to avoid spurious future error */
  296|  71.2k|                }
  297|   215k|            }
  298|   637k|            if(targetUniChar < 0xfffe){
  ------------------
  |  Branch (298:16): [True: 314k, False: 322k]
  ------------------
  299|   314k|                if(args->offsets) {
  ------------------
  |  Branch (299:20): [True: 0, False: 314k]
  ------------------
  300|      0|                    args->offsets[myTarget - args->target]=(int32_t)(mySource - args->source - 1-(myData->isStateDBCS));
  301|      0|                }
  302|       |
  303|   314k|                *(myTarget++)=(char16_t)targetUniChar;
  304|   314k|            }
  305|   322k|            else /* targetUniChar>=0xfffe */ {
  306|   322k|                if(targetUniChar == 0xfffe){
  ------------------
  |  Branch (306:20): [True: 0, False: 322k]
  ------------------
  307|      0|                    *err = U_INVALID_CHAR_FOUND;
  308|      0|                }
  309|   322k|                else{
  310|   322k|                    *err = U_ILLEGAL_CHAR_FOUND;
  311|   322k|                }
  312|   322k|                if(mySourceChar > 0xff){
  ------------------
  |  Branch (312:20): [True: 225k, False: 97.4k]
  ------------------
  313|   225k|                    args->converter->toUBytes[0] = (uint8_t)(mySourceChar >> 8);
  314|   225k|                    args->converter->toUBytes[1] = (uint8_t)mySourceChar;
  315|   225k|                    args->converter->toULength=2;
  316|   225k|                }
  317|  97.4k|                else{
  318|  97.4k|                    args->converter->toUBytes[0] = (uint8_t)mySourceChar;
  319|  97.4k|                    args->converter->toULength=1;
  320|  97.4k|                }
  321|   322k|                break;
  322|   322k|            }
  323|   637k|        }
  324|      0|        else{
  325|      0|            *err =U_BUFFER_OVERFLOW_ERROR;
  326|      0|            break;
  327|      0|        }
  328|  1.07M|    }
  329|       |
  330|   323k|    args->target = myTarget;
  331|   323k|    args->source = mySource;
  332|   323k|}

ucnv_MBCSToUnicodeWithOffsets_78:
 2466|  1.64M|                          UErrorCode *pErrorCode) {
 2467|  1.64M|    UConverter *cnv;
 2468|  1.64M|    const uint8_t *source, *sourceLimit;
 2469|  1.64M|    char16_t *target;
 2470|  1.64M|    const char16_t *targetLimit;
 2471|  1.64M|    int32_t *offsets;
 2472|       |
 2473|  1.64M|    const int32_t (*stateTable)[256];
 2474|  1.64M|    const uint16_t *unicodeCodeUnits;
 2475|       |
 2476|  1.64M|    uint32_t offset;
 2477|  1.64M|    uint8_t state;
 2478|  1.64M|    int8_t byteIndex;
 2479|  1.64M|    uint8_t *bytes;
 2480|       |
 2481|  1.64M|    int32_t sourceIndex, nextSourceIndex;
 2482|       |
 2483|  1.64M|    int32_t entry;
 2484|  1.64M|    char16_t c;
 2485|  1.64M|    uint8_t action;
 2486|       |
 2487|       |    /* use optimized function if possible */
 2488|  1.64M|    cnv=pArgs->converter;
 2489|       |
 2490|  1.64M|    if(cnv->preToULength>0) {
  ------------------
  |  Branch (2490:8): [True: 0, False: 1.64M]
  ------------------
 2491|       |        /*
 2492|       |         * pass sourceIndex=-1 because we continue from an earlier buffer
 2493|       |         * in the future, this may change with continuous offsets
 2494|       |         */
 2495|      0|        ucnv_extContinueMatchToU(cnv, pArgs, -1, pErrorCode);
  ------------------
  |  |  653|      0|#define ucnv_extContinueMatchToU U_ICU_ENTRY_POINT_RENAME(ucnv_extContinueMatchToU)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2496|       |
 2497|      0|        if(U_FAILURE(*pErrorCode) || cnv->preToULength<0) {
  ------------------
  |  Branch (2497:12): [True: 0, False: 0]
  |  Branch (2497:38): [True: 0, False: 0]
  ------------------
 2498|      0|            return;
 2499|      0|        }
 2500|      0|    }
 2501|       |
 2502|  1.64M|    if(cnv->sharedData->mbcs.countStates==1) {
  ------------------
  |  Branch (2502:8): [True: 1.26M, False: 380k]
  ------------------
 2503|  1.26M|        if(!(cnv->sharedData->mbcs.unicodeMask&UCNV_HAS_SUPPLEMENTARY)) {
  ------------------
  |  |   64|  1.26M|#define UCNV_HAS_SUPPLEMENTARY 1
  ------------------
  |  Branch (2503:12): [True: 1.26M, False: 0]
  ------------------
 2504|  1.26M|            ucnv_MBCSSingleToBMPWithOffsets(pArgs, pErrorCode);
 2505|  1.26M|        } else {
 2506|      0|            ucnv_MBCSSingleToUnicodeWithOffsets(pArgs, pErrorCode);
 2507|      0|        }
 2508|  1.26M|        return;
 2509|  1.26M|    }
 2510|       |
 2511|       |    /* set up the local pointers */
 2512|   380k|    source=(const uint8_t *)pArgs->source;
 2513|   380k|    sourceLimit=(const uint8_t *)pArgs->sourceLimit;
 2514|   380k|    target=pArgs->target;
 2515|   380k|    targetLimit=pArgs->targetLimit;
 2516|   380k|    offsets=pArgs->offsets;
 2517|       |
 2518|   380k|    if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0) {
  ------------------
  |  |   45|   380k|#define UCNV_OPTION_SWAP_LFNL   0x10
  ------------------
  |  Branch (2518:8): [True: 0, False: 380k]
  ------------------
 2519|      0|        stateTable=(const int32_t (*)[256])cnv->sharedData->mbcs.swapLFNLStateTable;
 2520|   380k|    } else {
 2521|   380k|        stateTable=cnv->sharedData->mbcs.stateTable;
 2522|   380k|    }
 2523|   380k|    unicodeCodeUnits=cnv->sharedData->mbcs.unicodeCodeUnits;
 2524|       |
 2525|       |    /* get the converter state from UConverter */
 2526|   380k|    offset=cnv->toUnicodeStatus;
 2527|   380k|    byteIndex=cnv->toULength;
 2528|   380k|    bytes=cnv->toUBytes;
 2529|       |
 2530|       |    /*
 2531|       |     * if we are in the SBCS state for a DBCS-only converter,
 2532|       |     * then load the DBCS state from the MBCS data
 2533|       |     * (dbcsOnlyState==0 if it is not a DBCS-only converter)
 2534|       |     */
 2535|   380k|    if((state=(uint8_t)(cnv->mode))==0) {
  ------------------
  |  Branch (2535:8): [True: 380k, False: 29]
  ------------------
 2536|   380k|        state=cnv->sharedData->mbcs.dbcsOnlyState;
 2537|   380k|    }
 2538|       |
 2539|       |    /* sourceIndex=-1 if the current character began in the previous buffer */
 2540|   380k|    sourceIndex=byteIndex==0 ? 0 : -1;
  ------------------
  |  Branch (2540:17): [True: 380k, False: 0]
  ------------------
 2541|   380k|    nextSourceIndex=0;
 2542|       |
 2543|       |    /* conversion loop */
 2544|   437k|    while(source<sourceLimit) {
  ------------------
  |  Branch (2544:11): [True: 437k, False: 235]
  ------------------
 2545|       |        /*
 2546|       |         * This following test is to see if available input would overflow the output.
 2547|       |         * It does not catch output of more than one code unit that
 2548|       |         * overflows as a result of a surrogate pair or callback output
 2549|       |         * from the last source byte.
 2550|       |         * Therefore, those situations also test for overflows and will
 2551|       |         * then break the loop, too.
 2552|       |         */
 2553|   437k|        if(target>=targetLimit) {
  ------------------
  |  Branch (2553:12): [True: 0, False: 437k]
  ------------------
 2554|       |            /* target is full */
 2555|      0|            *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
 2556|      0|            break;
 2557|      0|        }
 2558|       |
 2559|   437k|        if(byteIndex==0) {
  ------------------
  |  Branch (2559:12): [True: 397k, False: 39.5k]
  ------------------
 2560|       |            /* optimized loop for 1/2-byte input and BMP output */
 2561|   397k|            if(offsets==nullptr) {
  ------------------
  |  Branch (2561:16): [True: 397k, False: 0]
  ------------------
 2562|  10.4M|                do {
 2563|  10.4M|                    entry=stateTable[state][*source];
 2564|  10.4M|                    if(MBCS_ENTRY_IS_TRANSITION(entry)) {
  ------------------
  |  |  284|  10.4M|#define MBCS_ENTRY_IS_TRANSITION(entry) ((entry)>=0)
  |  |  ------------------
  |  |  |  Branch (284:41): [True: 852k, False: 9.59M]
  |  |  ------------------
  ------------------
 2565|   852k|                        state=(uint8_t)MBCS_ENTRY_TRANSITION_STATE(entry);
  ------------------
  |  |  287|   852k|#define MBCS_ENTRY_TRANSITION_STATE(entry) (((uint32_t)entry)>>24)
  ------------------
 2566|   852k|                        offset=MBCS_ENTRY_TRANSITION_OFFSET(entry);
  ------------------
  |  |  288|   852k|#define MBCS_ENTRY_TRANSITION_OFFSET(entry) ((entry)&0xffffff)
  ------------------
 2567|       |
 2568|   852k|                        ++source;
 2569|   852k|                        if( source<sourceLimit &&
  ------------------
  |  Branch (2569:29): [True: 852k, False: 10]
  ------------------
 2570|   852k|                            MBCS_ENTRY_IS_FINAL(entry=stateTable[state][*source]) &&
  ------------------
  |  |  285|  1.70M|#define MBCS_ENTRY_IS_FINAL(entry) ((entry)<0)
  |  |  ------------------
  |  |  |  Branch (285:36): [True: 829k, False: 22.5k]
  |  |  ------------------
  ------------------
 2571|   852k|                            MBCS_ENTRY_FINAL_ACTION(entry)==MBCS_STATE_VALID_16 &&
  ------------------
  |  |  292|   829k|#define MBCS_ENTRY_FINAL_ACTION(entry) ((((uint32_t)entry)>>20)&0xf)
  ------------------
  |  Branch (2571:29): [True: 586k, False: 243k]
  ------------------
 2572|   852k|                            (c=unicodeCodeUnits[offset+MBCS_ENTRY_FINAL_VALUE_16(entry)])<0xfffe
  ------------------
  |  |  294|   586k|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
  |  Branch (2572:29): [True: 585k, False: 593]
  ------------------
 2573|   852k|                        ) {
 2574|   585k|                            ++source;
 2575|   585k|                            *target++=c;
 2576|   585k|                            state=(uint8_t)MBCS_ENTRY_FINAL_STATE(entry); /* typically 0 */
  ------------------
  |  |  290|   585k|#define MBCS_ENTRY_FINAL_STATE(entry) ((((uint32_t)entry)>>24)&0x7f)
  ------------------
 2577|   585k|                            offset=0;
 2578|   585k|                        } else {
 2579|       |                            /* set the state and leave the optimized loop */
 2580|   266k|                            bytes[0]=*(source-1);
 2581|   266k|                            byteIndex=1;
 2582|   266k|                            break;
 2583|   266k|                        }
 2584|  9.59M|                    } else {
 2585|  9.59M|                        if(MBCS_ENTRY_FINAL_IS_VALID_DIRECT_16(entry)) {
  ------------------
  |  |  291|  9.59M|#define MBCS_ENTRY_FINAL_IS_VALID_DIRECT_16(entry) ((entry)<(int32_t)0x80100000)
  |  |  ------------------
  |  |  |  Branch (291:52): [True: 9.46M, False: 131k]
  |  |  ------------------
  ------------------
 2586|       |                            /* output BMP code point */
 2587|  9.46M|                            ++source;
 2588|  9.46M|                            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
  ------------------
  |  |  294|  9.46M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2589|  9.46M|                            state=(uint8_t)MBCS_ENTRY_FINAL_STATE(entry); /* typically 0 */
  ------------------
  |  |  290|  9.46M|#define MBCS_ENTRY_FINAL_STATE(entry) ((((uint32_t)entry)>>24)&0x7f)
  ------------------
 2590|  9.46M|                        } else {
 2591|       |                            /* leave the optimized loop */
 2592|   131k|                            break;
 2593|   131k|                        }
 2594|  9.59M|                    }
 2595|  10.4M|                } while(source<sourceLimit && target<targetLimit);
  ------------------
  |  Branch (2595:25): [True: 10.0M, False: 92]
  |  Branch (2595:47): [True: 10.0M, False: 0]
  ------------------
 2596|   397k|            } else /* offsets!=nullptr */ {
 2597|      0|                do {
 2598|      0|                    entry=stateTable[state][*source];
 2599|      0|                    if(MBCS_ENTRY_IS_TRANSITION(entry)) {
  ------------------
  |  |  284|      0|#define MBCS_ENTRY_IS_TRANSITION(entry) ((entry)>=0)
  |  |  ------------------
  |  |  |  Branch (284:41): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2600|      0|                        state=(uint8_t)MBCS_ENTRY_TRANSITION_STATE(entry);
  ------------------
  |  |  287|      0|#define MBCS_ENTRY_TRANSITION_STATE(entry) (((uint32_t)entry)>>24)
  ------------------
 2601|      0|                        offset=MBCS_ENTRY_TRANSITION_OFFSET(entry);
  ------------------
  |  |  288|      0|#define MBCS_ENTRY_TRANSITION_OFFSET(entry) ((entry)&0xffffff)
  ------------------
 2602|       |
 2603|      0|                        ++source;
 2604|      0|                        if( source<sourceLimit &&
  ------------------
  |  Branch (2604:29): [True: 0, False: 0]
  ------------------
 2605|      0|                            MBCS_ENTRY_IS_FINAL(entry=stateTable[state][*source]) &&
  ------------------
  |  |  285|      0|#define MBCS_ENTRY_IS_FINAL(entry) ((entry)<0)
  |  |  ------------------
  |  |  |  Branch (285:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2606|      0|                            MBCS_ENTRY_FINAL_ACTION(entry)==MBCS_STATE_VALID_16 &&
  ------------------
  |  |  292|      0|#define MBCS_ENTRY_FINAL_ACTION(entry) ((((uint32_t)entry)>>20)&0xf)
  ------------------
  |  Branch (2606:29): [True: 0, False: 0]
  ------------------
 2607|      0|                            (c=unicodeCodeUnits[offset+MBCS_ENTRY_FINAL_VALUE_16(entry)])<0xfffe
  ------------------
  |  |  294|      0|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
  |  Branch (2607:29): [True: 0, False: 0]
  ------------------
 2608|      0|                        ) {
 2609|      0|                            ++source;
 2610|      0|                            *target++=c;
 2611|      0|                            if(offsets!=nullptr) {
  ------------------
  |  Branch (2611:32): [True: 0, False: 0]
  ------------------
 2612|      0|                                *offsets++=sourceIndex;
 2613|      0|                                sourceIndex=(nextSourceIndex+=2);
 2614|      0|                            }
 2615|      0|                            state=(uint8_t)MBCS_ENTRY_FINAL_STATE(entry); /* typically 0 */
  ------------------
  |  |  290|      0|#define MBCS_ENTRY_FINAL_STATE(entry) ((((uint32_t)entry)>>24)&0x7f)
  ------------------
 2616|      0|                            offset=0;
 2617|      0|                        } else {
 2618|       |                            /* set the state and leave the optimized loop */
 2619|      0|                            ++nextSourceIndex;
 2620|      0|                            bytes[0]=*(source-1);
 2621|      0|                            byteIndex=1;
 2622|      0|                            break;
 2623|      0|                        }
 2624|      0|                    } else {
 2625|      0|                        if(MBCS_ENTRY_FINAL_IS_VALID_DIRECT_16(entry)) {
  ------------------
  |  |  291|      0|#define MBCS_ENTRY_FINAL_IS_VALID_DIRECT_16(entry) ((entry)<(int32_t)0x80100000)
  |  |  ------------------
  |  |  |  Branch (291:52): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2626|       |                            /* output BMP code point */
 2627|      0|                            ++source;
 2628|      0|                            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
  ------------------
  |  |  294|      0|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2629|      0|                            if(offsets!=nullptr) {
  ------------------
  |  Branch (2629:32): [True: 0, False: 0]
  ------------------
 2630|      0|                                *offsets++=sourceIndex;
 2631|      0|                                sourceIndex=++nextSourceIndex;
 2632|      0|                            }
 2633|      0|                            state=(uint8_t)MBCS_ENTRY_FINAL_STATE(entry); /* typically 0 */
  ------------------
  |  |  290|      0|#define MBCS_ENTRY_FINAL_STATE(entry) ((((uint32_t)entry)>>24)&0x7f)
  ------------------
 2634|      0|                        } else {
 2635|       |                            /* leave the optimized loop */
 2636|      0|                            break;
 2637|      0|                        }
 2638|      0|                    }
 2639|      0|                } while(source<sourceLimit && target<targetLimit);
  ------------------
  |  Branch (2639:25): [True: 0, False: 0]
  |  Branch (2639:47): [True: 0, False: 0]
  ------------------
 2640|      0|            }
 2641|       |
 2642|       |            /*
 2643|       |             * these tests and break statements could be put inside the loop
 2644|       |             * if C had "break outerLoop" like Java
 2645|       |             */
 2646|   397k|            if(source>=sourceLimit) {
  ------------------
  |  Branch (2646:16): [True: 102, False: 397k]
  ------------------
 2647|    102|                break;
 2648|    102|            }
 2649|   397k|            if(target>=targetLimit) {
  ------------------
  |  Branch (2649:16): [True: 0, False: 397k]
  ------------------
 2650|       |                /* target is full */
 2651|      0|                *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
 2652|      0|                break;
 2653|      0|            }
 2654|       |
 2655|   397k|            ++nextSourceIndex;
 2656|   397k|            bytes[byteIndex++]=*source++;
 2657|   397k|        } else /* byteIndex>0 */ {
 2658|  39.5k|            ++nextSourceIndex;
 2659|  39.5k|            entry=stateTable[state][bytes[byteIndex++]=*source++];
 2660|  39.5k|        }
 2661|       |
 2662|   437k|        if(MBCS_ENTRY_IS_TRANSITION(entry)) {
  ------------------
  |  |  284|   437k|#define MBCS_ENTRY_IS_TRANSITION(entry) ((entry)>=0)
  |  |  ------------------
  |  |  |  Branch (284:41): [True: 39.5k, False: 397k]
  |  |  ------------------
  ------------------
 2663|  39.5k|            state=(uint8_t)MBCS_ENTRY_TRANSITION_STATE(entry);
  ------------------
  |  |  287|  39.5k|#define MBCS_ENTRY_TRANSITION_STATE(entry) (((uint32_t)entry)>>24)
  ------------------
 2664|  39.5k|            offset+=MBCS_ENTRY_TRANSITION_OFFSET(entry);
  ------------------
  |  |  288|  39.5k|#define MBCS_ENTRY_TRANSITION_OFFSET(entry) ((entry)&0xffffff)
  ------------------
 2665|  39.5k|            continue;
 2666|  39.5k|        }
 2667|       |
 2668|       |        /* save the previous state for proper extension mapping with SI/SO-stateful converters */
 2669|   397k|        cnv->mode=state;
 2670|       |
 2671|       |        /* set the next state early so that we can reuse the entry variable */
 2672|   397k|        state=(uint8_t)MBCS_ENTRY_FINAL_STATE(entry); /* typically 0 */
  ------------------
  |  |  290|   397k|#define MBCS_ENTRY_FINAL_STATE(entry) ((((uint32_t)entry)>>24)&0x7f)
  ------------------
 2673|       |
 2674|       |        /*
 2675|       |         * An if-else-if chain provides more reliable performance for
 2676|       |         * the most common cases compared to a switch.
 2677|       |         */
 2678|   397k|        action=(uint8_t)(MBCS_ENTRY_FINAL_ACTION(entry));
  ------------------
  |  |  292|   397k|#define MBCS_ENTRY_FINAL_ACTION(entry) ((((uint32_t)entry)>>20)&0xf)
  ------------------
 2679|   397k|        if(action==MBCS_STATE_VALID_16) {
  ------------------
  |  Branch (2679:12): [True: 9.51k, False: 388k]
  ------------------
 2680|  9.51k|            offset+=MBCS_ENTRY_FINAL_VALUE_16(entry);
  ------------------
  |  |  294|  9.51k|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2681|  9.51k|            c=unicodeCodeUnits[offset];
 2682|  9.51k|            if(c<0xfffe) {
  ------------------
  |  Branch (2682:16): [True: 6.06k, False: 3.44k]
  ------------------
 2683|       |                /* output BMP code point */
 2684|  6.06k|                *target++=c;
 2685|  6.06k|                if(offsets!=nullptr) {
  ------------------
  |  Branch (2685:20): [True: 0, False: 6.06k]
  ------------------
 2686|      0|                    *offsets++=sourceIndex;
 2687|      0|                }
 2688|  6.06k|                byteIndex=0;
 2689|  6.06k|            } else if(c==0xfffe) {
  ------------------
  |  Branch (2689:23): [True: 3.44k, False: 0]
  ------------------
 2690|  3.44k|                if(UCNV_TO_U_USE_FALLBACK(cnv) && (entry=(int32_t)ucnv_MBCSGetFallback(&cnv->sharedData->mbcs, offset))!=0xfffe) {
  ------------------
  |  |  271|  6.89k|#define UCNV_TO_U_USE_FALLBACK(cnv) true
  |  |  ------------------
  |  |  |  Branch (271:37): [Folded - Ignored]
  |  |  ------------------
  ------------------
  |  Branch (2690:51): [True: 435, False: 3.01k]
  ------------------
 2691|       |                    /* output fallback BMP code point */
 2692|    435|                    *target++=(char16_t)entry;
 2693|    435|                    if(offsets!=nullptr) {
  ------------------
  |  Branch (2693:24): [True: 0, False: 435]
  ------------------
 2694|      0|                        *offsets++=sourceIndex;
 2695|      0|                    }
 2696|    435|                    byteIndex=0;
 2697|    435|                }
 2698|  3.44k|            } else {
 2699|       |                /* callback(illegal) */
 2700|      0|                *pErrorCode=U_ILLEGAL_CHAR_FOUND;
 2701|      0|            }
 2702|   388k|        } else if(action==MBCS_STATE_VALID_DIRECT_16) {
  ------------------
  |  Branch (2702:19): [True: 0, False: 388k]
  ------------------
 2703|       |            /* output BMP code point */
 2704|      0|            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
  ------------------
  |  |  294|      0|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2705|      0|            if(offsets!=nullptr) {
  ------------------
  |  Branch (2705:16): [True: 0, False: 0]
  ------------------
 2706|      0|                *offsets++=sourceIndex;
 2707|      0|            }
 2708|      0|            byteIndex=0;
 2709|   388k|        } else if(action==MBCS_STATE_VALID_16_PAIR) {
  ------------------
  |  Branch (2709:19): [True: 0, False: 388k]
  ------------------
 2710|      0|            offset+=MBCS_ENTRY_FINAL_VALUE_16(entry);
  ------------------
  |  |  294|      0|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2711|      0|            c=unicodeCodeUnits[offset++];
 2712|      0|            if(c<0xd800) {
  ------------------
  |  Branch (2712:16): [True: 0, False: 0]
  ------------------
 2713|       |                /* output BMP code point below 0xd800 */
 2714|      0|                *target++=c;
 2715|      0|                if(offsets!=nullptr) {
  ------------------
  |  Branch (2715:20): [True: 0, False: 0]
  ------------------
 2716|      0|                    *offsets++=sourceIndex;
 2717|      0|                }
 2718|      0|                byteIndex=0;
 2719|      0|            } else if(UCNV_TO_U_USE_FALLBACK(cnv) ? c<=0xdfff : c<=0xdbff) {
  ------------------
  |  |  271|      0|#define UCNV_TO_U_USE_FALLBACK(cnv) true
  |  |  ------------------
  |  |  |  Branch (271:37): [Folded - Ignored]
  |  |  ------------------
  ------------------
  |  Branch (2719:23): [True: 0, False: 0]
  ------------------
 2720|       |                /* output roundtrip or fallback surrogate pair */
 2721|      0|                *target++=(char16_t)(c&0xdbff);
 2722|      0|                if(offsets!=nullptr) {
  ------------------
  |  Branch (2722:20): [True: 0, False: 0]
  ------------------
 2723|      0|                    *offsets++=sourceIndex;
 2724|      0|                }
 2725|      0|                byteIndex=0;
 2726|      0|                if(target<targetLimit) {
  ------------------
  |  Branch (2726:20): [True: 0, False: 0]
  ------------------
 2727|      0|                    *target++=unicodeCodeUnits[offset];
 2728|      0|                    if(offsets!=nullptr) {
  ------------------
  |  Branch (2728:24): [True: 0, False: 0]
  ------------------
 2729|      0|                        *offsets++=sourceIndex;
 2730|      0|                    }
 2731|      0|                } else {
 2732|       |                    /* target overflow */
 2733|      0|                    cnv->UCharErrorBuffer[0]=unicodeCodeUnits[offset];
 2734|      0|                    cnv->UCharErrorBufferLength=1;
 2735|      0|                    *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
 2736|       |
 2737|      0|                    offset=0;
 2738|      0|                    break;
 2739|      0|                }
 2740|      0|            } else if(UCNV_TO_U_USE_FALLBACK(cnv) ? (c&0xfffe)==0xe000 : c==0xe000) {
  ------------------
  |  |  271|      0|#define UCNV_TO_U_USE_FALLBACK(cnv) true
  |  |  ------------------
  |  |  |  Branch (271:37): [Folded - Ignored]
  |  |  ------------------
  ------------------
  |  Branch (2740:23): [True: 0, False: 0]
  ------------------
 2741|       |                /* output roundtrip BMP code point above 0xd800 or fallback BMP code point */
 2742|      0|                *target++=unicodeCodeUnits[offset];
 2743|      0|                if(offsets!=nullptr) {
  ------------------
  |  Branch (2743:20): [True: 0, False: 0]
  ------------------
 2744|      0|                    *offsets++=sourceIndex;
 2745|      0|                }
 2746|      0|                byteIndex=0;
 2747|      0|            } else if(c==0xffff) {
  ------------------
  |  Branch (2747:23): [True: 0, False: 0]
  ------------------
 2748|       |                /* callback(illegal) */
 2749|      0|                *pErrorCode=U_ILLEGAL_CHAR_FOUND;
 2750|      0|            }
 2751|   388k|        } else if(action==MBCS_STATE_VALID_DIRECT_20 ||
  ------------------
  |  Branch (2751:19): [True: 0, False: 388k]
  ------------------
 2752|   388k|                  (action==MBCS_STATE_FALLBACK_DIRECT_20 && UCNV_TO_U_USE_FALLBACK(cnv))
  ------------------
  |  |  271|      0|#define UCNV_TO_U_USE_FALLBACK(cnv) true
  |  |  ------------------
  |  |  |  Branch (271:37): [Folded - Ignored]
  |  |  ------------------
  ------------------
  |  Branch (2752:20): [True: 0, False: 388k]
  ------------------
 2753|   388k|        ) {
 2754|      0|            entry=MBCS_ENTRY_FINAL_VALUE(entry);
  ------------------
  |  |  293|      0|#define MBCS_ENTRY_FINAL_VALUE(entry) ((entry)&0xfffff)
  ------------------
 2755|       |            /* output surrogate pair */
 2756|      0|            *target++=(char16_t)(0xd800|(char16_t)(entry>>10));
 2757|      0|            if(offsets!=nullptr) {
  ------------------
  |  Branch (2757:16): [True: 0, False: 0]
  ------------------
 2758|      0|                *offsets++=sourceIndex;
 2759|      0|            }
 2760|      0|            byteIndex=0;
 2761|      0|            c=(char16_t)(0xdc00|(char16_t)(entry&0x3ff));
 2762|      0|            if(target<targetLimit) {
  ------------------
  |  Branch (2762:16): [True: 0, False: 0]
  ------------------
 2763|      0|                *target++=c;
 2764|      0|                if(offsets!=nullptr) {
  ------------------
  |  Branch (2764:20): [True: 0, False: 0]
  ------------------
 2765|      0|                    *offsets++=sourceIndex;
 2766|      0|                }
 2767|      0|            } else {
 2768|       |                /* target overflow */
 2769|      0|                cnv->UCharErrorBuffer[0]=c;
 2770|      0|                cnv->UCharErrorBufferLength=1;
 2771|      0|                *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
 2772|       |
 2773|      0|                offset=0;
 2774|      0|                break;
 2775|      0|            }
 2776|   388k|        } else if(action==MBCS_STATE_CHANGE_ONLY) {
  ------------------
  |  Branch (2776:19): [True: 0, False: 388k]
  ------------------
 2777|       |            /*
 2778|       |             * This serves as a state change without any output.
 2779|       |             * It is useful for reading simple stateful encodings,
 2780|       |             * for example using just Shift-In/Shift-Out codes.
 2781|       |             * The 21 unused bits may later be used for more sophisticated
 2782|       |             * state transitions.
 2783|       |             */
 2784|      0|            if(cnv->sharedData->mbcs.dbcsOnlyState==0) {
  ------------------
  |  Branch (2784:16): [True: 0, False: 0]
  ------------------
 2785|      0|                byteIndex=0;
 2786|      0|            } else {
 2787|       |                /* SI/SO are illegal for DBCS-only conversion */
 2788|      0|                state=(uint8_t)(cnv->mode); /* restore the previous state */
 2789|       |
 2790|       |                /* callback(illegal) */
 2791|      0|                *pErrorCode=U_ILLEGAL_CHAR_FOUND;
 2792|      0|            }
 2793|   388k|        } else if(action==MBCS_STATE_FALLBACK_DIRECT_16) {
  ------------------
  |  Branch (2793:19): [True: 6.04k, False: 382k]
  ------------------
 2794|  6.04k|            if(UCNV_TO_U_USE_FALLBACK(cnv)) {
  ------------------
  |  |  271|  6.04k|#define UCNV_TO_U_USE_FALLBACK(cnv) true
  |  |  ------------------
  |  |  |  Branch (271:37): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2795|       |                /* output BMP code point */
 2796|  6.04k|                *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
  ------------------
  |  |  294|  6.04k|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2797|  6.04k|                if(offsets!=nullptr) {
  ------------------
  |  Branch (2797:20): [True: 0, False: 6.04k]
  ------------------
 2798|      0|                    *offsets++=sourceIndex;
 2799|      0|                }
 2800|  6.04k|                byteIndex=0;
 2801|  6.04k|            }
 2802|   382k|        } else if(action==MBCS_STATE_UNASSIGNED) {
  ------------------
  |  Branch (2802:19): [True: 4.05k, False: 378k]
  ------------------
 2803|       |            /* just fall through */
 2804|   378k|        } else if(action==MBCS_STATE_ILLEGAL) {
  ------------------
  |  Branch (2804:19): [True: 378k, False: 0]
  ------------------
 2805|       |            /* callback(illegal) */
 2806|   378k|            *pErrorCode=U_ILLEGAL_CHAR_FOUND;
 2807|   378k|        } else {
 2808|       |            /* reserved, must never occur */
 2809|      0|            byteIndex=0;
 2810|      0|        }
 2811|       |
 2812|       |        /* end of action codes: prepare for a new character */
 2813|   397k|        offset=0;
 2814|       |
 2815|   397k|        if(byteIndex==0) {
  ------------------
  |  Branch (2815:12): [True: 12.5k, False: 385k]
  ------------------
 2816|  12.5k|            sourceIndex=nextSourceIndex;
 2817|   385k|        } else if(U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (2817:19): [True: 378k, False: 7.06k]
  ------------------
 2818|       |            /* callback(illegal) */
 2819|   378k|            if(byteIndex>1) {
  ------------------
  |  Branch (2819:16): [True: 253k, False: 125k]
  ------------------
 2820|       |                /*
 2821|       |                 * Ticket 5691: consistent illegal sequences:
 2822|       |                 * - We include at least the first byte in the illegal sequence.
 2823|       |                 * - If any of the non-initial bytes could be the start of a character,
 2824|       |                 *   we stop the illegal sequence before the first one of those.
 2825|       |                 */
 2826|   253k|                UBool isDBCSOnly = cnv->sharedData->mbcs.dbcsOnlyState != 0;
 2827|   253k|                int8_t i;
 2828|   253k|                for(i=1;
 2829|   257k|                    i<byteIndex && !isSingleOrLead(stateTable, state, isDBCSOnly, bytes[i]);
  ------------------
  |  Branch (2829:21): [True: 253k, False: 4.16k]
  |  Branch (2829:36): [True: 4.16k, False: 248k]
  ------------------
 2830|   253k|                    ++i) {}
 2831|   253k|                if(i<byteIndex) {
  ------------------
  |  Branch (2831:20): [True: 248k, False: 4.16k]
  ------------------
 2832|       |                    /* Back out some bytes. */
 2833|   248k|                    int8_t backOutDistance=byteIndex-i;
 2834|   248k|                    int32_t bytesFromThisBuffer=(int32_t)(source-(const uint8_t *)pArgs->source);
 2835|   248k|                    byteIndex=i;  /* length of reported illegal byte sequence */
 2836|   248k|                    if(backOutDistance<=bytesFromThisBuffer) {
  ------------------
  |  Branch (2836:24): [True: 248k, False: 0]
  ------------------
 2837|   248k|                        source-=backOutDistance;
 2838|   248k|                    } else {
 2839|       |                        /* Back out bytes from the previous buffer: Need to replay them. */
 2840|      0|                        cnv->preToULength=(int8_t)(bytesFromThisBuffer-backOutDistance);
 2841|       |                        /* preToULength is negative! */
 2842|      0|                        uprv_memcpy(cnv->preToU, bytes+i, -cnv->preToULength);
  ------------------
  |  |   42|      0|#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|      0|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  |   43|      0|    /* Suppress warnings about addresses that will never be NULL */ \
  |  |   44|      0|    _Pragma("clang diagnostic push") \
  |  |   45|      0|    _Pragma("clang diagnostic ignored \"-Waddress\"") \
  |  |   46|      0|    U_ASSERT(dst != NULL); \
  |  |  ------------------
  |  |  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   47|      0|    U_ASSERT(src != NULL); \
  |  |  ------------------
  |  |  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   48|      0|    _Pragma("clang diagnostic pop") \
  |  |   49|      0|    U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  |  |   50|      0|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|      0|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2843|      0|                        source=(const uint8_t *)pArgs->source;
 2844|      0|                    }
 2845|   248k|                }
 2846|   253k|            }
 2847|   378k|            break;
 2848|   378k|        } else /* unassigned sequences indicated with byteIndex>0 */ {
 2849|       |            /* try an extension mapping */
 2850|  7.06k|            pArgs->source=(const char *)source;
 2851|  7.06k|            byteIndex=_extToU(cnv, cnv->sharedData,
 2852|  7.06k|                              byteIndex, &source, sourceLimit,
 2853|  7.06k|                              &target, targetLimit,
 2854|  7.06k|                              &offsets, sourceIndex,
 2855|  7.06k|                              pArgs->flush,
 2856|  7.06k|                              pErrorCode);
 2857|  7.06k|            sourceIndex=nextSourceIndex+=(int32_t)(source-(const uint8_t *)pArgs->source);
 2858|       |
 2859|  7.06k|            if(U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (2859:16): [True: 2.08k, False: 4.97k]
  ------------------
 2860|       |                /* not mappable or buffer overflow */
 2861|  2.08k|                break;
 2862|  2.08k|            }
 2863|  7.06k|        }
 2864|   397k|    }
 2865|       |
 2866|       |    /* set the converter state back into UConverter */
 2867|   380k|    cnv->toUnicodeStatus=offset;
 2868|   380k|    cnv->mode=state;
 2869|   380k|    cnv->toULength=byteIndex;
 2870|       |
 2871|       |    /* write back the updated pointers */
 2872|   380k|    pArgs->source=(const char *)source;
 2873|   380k|    pArgs->target=target;
 2874|   380k|    pArgs->offsets=offsets;
 2875|   380k|}
ucnv_MBCSSimpleGetNextUChar_78:
 3263|  1.03M|                        UBool useFallback) {
 3264|  1.03M|    const int32_t (*stateTable)[256];
 3265|  1.03M|    const uint16_t *unicodeCodeUnits;
 3266|       |
 3267|  1.03M|    uint32_t offset;
 3268|  1.03M|    uint8_t state, action;
 3269|       |
 3270|  1.03M|    UChar32 c;
 3271|  1.03M|    int32_t i, entry;
 3272|       |
 3273|  1.03M|    if(length<=0) {
  ------------------
  |  Branch (3273:8): [True: 0, False: 1.03M]
  ------------------
 3274|       |        /* no input at all: "illegal" */
 3275|      0|        return 0xffff;
 3276|      0|    }
 3277|       |
 3278|       |#if 0
 3279|       |/*
 3280|       | * Code disabled 2002dec09 (ICU 2.4) because it is not currently used in ICU. markus
 3281|       | * TODO In future releases, verify that this function is never called for SBCS
 3282|       | * conversions, i.e., that sharedData->mbcs.countStates==1 is still true.
 3283|       | * Removal improves code coverage.
 3284|       | */
 3285|       |    /* use optimized function if possible */
 3286|       |    if(sharedData->mbcs.countStates==1) {
 3287|       |        if(length==1) {
 3288|       |            return ucnv_MBCSSingleSimpleGetNextUChar(sharedData, (uint8_t)*source, useFallback);
 3289|       |        } else {
 3290|       |            return 0xffff; /* illegal: more than a single byte for an SBCS converter */
 3291|       |        }
 3292|       |    }
 3293|       |#endif
 3294|       |
 3295|       |    /* set up the local pointers */
 3296|  1.03M|    stateTable=sharedData->mbcs.stateTable;
 3297|  1.03M|    unicodeCodeUnits=sharedData->mbcs.unicodeCodeUnits;
 3298|       |
 3299|       |    /* converter state */
 3300|  1.03M|    offset=0;
 3301|  1.03M|    state=sharedData->mbcs.dbcsOnlyState;
 3302|       |
 3303|       |    /* conversion loop */
 3304|  1.86M|    for(i=0;;) {
 3305|  1.86M|        entry=stateTable[state][(uint8_t)source[i++]];
 3306|  1.86M|        if(MBCS_ENTRY_IS_TRANSITION(entry)) {
  ------------------
  |  |  284|  1.86M|#define MBCS_ENTRY_IS_TRANSITION(entry) ((entry)>=0)
  |  |  ------------------
  |  |  |  Branch (284:41): [True: 834k, False: 1.03M]
  |  |  ------------------
  ------------------
 3307|   834k|            state=(uint8_t)MBCS_ENTRY_TRANSITION_STATE(entry);
  ------------------
  |  |  287|   834k|#define MBCS_ENTRY_TRANSITION_STATE(entry) (((uint32_t)entry)>>24)
  ------------------
 3308|   834k|            offset+=MBCS_ENTRY_TRANSITION_OFFSET(entry);
  ------------------
  |  |  288|   834k|#define MBCS_ENTRY_TRANSITION_OFFSET(entry) ((entry)&0xffffff)
  ------------------
 3309|       |
 3310|   834k|            if(i==length) {
  ------------------
  |  Branch (3310:16): [True: 0, False: 834k]
  ------------------
 3311|      0|                return 0xffff; /* truncated character */
 3312|      0|            }
 3313|  1.03M|        } else {
 3314|       |            /*
 3315|       |             * An if-else-if chain provides more reliable performance for
 3316|       |             * the most common cases compared to a switch.
 3317|       |             */
 3318|  1.03M|            action=(uint8_t)(MBCS_ENTRY_FINAL_ACTION(entry));
  ------------------
  |  |  292|  1.03M|#define MBCS_ENTRY_FINAL_ACTION(entry) ((((uint32_t)entry)>>20)&0xf)
  ------------------
 3319|  1.03M|            if(action==MBCS_STATE_VALID_16) {
  ------------------
  |  Branch (3319:16): [True: 750k, False: 281k]
  ------------------
 3320|   750k|                offset+=MBCS_ENTRY_FINAL_VALUE_16(entry);
  ------------------
  |  |  294|   750k|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 3321|   750k|                c=unicodeCodeUnits[offset];
 3322|   750k|                if(c!=0xfffe) {
  ------------------
  |  Branch (3322:20): [True: 727k, False: 23.7k]
  ------------------
 3323|       |                    /* done */
 3324|   727k|                } else if(UCNV_TO_U_USE_FALLBACK(cnv)) {
  ------------------
  |  |  271|  23.7k|#define UCNV_TO_U_USE_FALLBACK(cnv) true
  |  |  ------------------
  |  |  |  Branch (271:37): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3325|  23.7k|                    c=ucnv_MBCSGetFallback(&sharedData->mbcs, offset);
 3326|       |                /* else done with 0xfffe */
 3327|  23.7k|                }
 3328|   750k|                break;
 3329|   750k|            } else if(action==MBCS_STATE_VALID_DIRECT_16) {
  ------------------
  |  Branch (3329:23): [True: 273k, False: 7.84k]
  ------------------
 3330|       |                /* output BMP code point */
 3331|   273k|                c=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
  ------------------
  |  |  294|   273k|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 3332|   273k|                break;
 3333|   273k|            } else if(action==MBCS_STATE_VALID_16_PAIR) {
  ------------------
  |  Branch (3333:23): [True: 0, False: 7.84k]
  ------------------
 3334|      0|                offset+=MBCS_ENTRY_FINAL_VALUE_16(entry);
  ------------------
  |  |  294|      0|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 3335|      0|                c=unicodeCodeUnits[offset++];
 3336|      0|                if(c<0xd800) {
  ------------------
  |  Branch (3336:20): [True: 0, False: 0]
  ------------------
 3337|       |                    /* output BMP code point below 0xd800 */
 3338|      0|                } else if(UCNV_TO_U_USE_FALLBACK(cnv) ? c<=0xdfff : c<=0xdbff) {
  ------------------
  |  |  271|      0|#define UCNV_TO_U_USE_FALLBACK(cnv) true
  |  |  ------------------
  |  |  |  Branch (271:37): [Folded - Ignored]
  |  |  ------------------
  ------------------
  |  Branch (3338:27): [True: 0, False: 0]
  ------------------
 3339|       |                    /* output roundtrip or fallback supplementary code point */
 3340|      0|                    c=(UChar32)(((c&0x3ff)<<10)+unicodeCodeUnits[offset]+(0x10000-0xdc00));
 3341|      0|                } else if(UCNV_TO_U_USE_FALLBACK(cnv) ? (c&0xfffe)==0xe000 : c==0xe000) {
  ------------------
  |  |  271|      0|#define UCNV_TO_U_USE_FALLBACK(cnv) true
  |  |  ------------------
  |  |  |  Branch (271:37): [Folded - Ignored]
  |  |  ------------------
  ------------------
  |  Branch (3341:27): [True: 0, False: 0]
  ------------------
 3342|       |                    /* output roundtrip BMP code point above 0xd800 or fallback BMP code point */
 3343|      0|                    c=unicodeCodeUnits[offset];
 3344|      0|                } else if(c==0xffff) {
  ------------------
  |  Branch (3344:27): [True: 0, False: 0]
  ------------------
 3345|      0|                    return 0xffff;
 3346|      0|                } else {
 3347|      0|                    c=0xfffe;
 3348|      0|                }
 3349|      0|                break;
 3350|  7.84k|            } else if(action==MBCS_STATE_VALID_DIRECT_20) {
  ------------------
  |  Branch (3350:23): [True: 0, False: 7.84k]
  ------------------
 3351|       |                /* output supplementary code point */
 3352|      0|                c=0x10000+MBCS_ENTRY_FINAL_VALUE(entry);
  ------------------
  |  |  293|      0|#define MBCS_ENTRY_FINAL_VALUE(entry) ((entry)&0xfffff)
  ------------------
 3353|      0|                break;
 3354|  7.84k|            } else if(action==MBCS_STATE_FALLBACK_DIRECT_16) {
  ------------------
  |  Branch (3354:23): [True: 0, False: 7.84k]
  ------------------
 3355|      0|                if(!TO_U_USE_FALLBACK(useFallback)) {
  ------------------
  |  |  270|      0|#define TO_U_USE_FALLBACK(useFallback) true
  ------------------
  |  Branch (3355:20): [Folded - Ignored]
  ------------------
 3356|      0|                    c=0xfffe;
 3357|      0|                    break;
 3358|      0|                }
 3359|       |                /* output BMP code point */
 3360|      0|                c=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
  ------------------
  |  |  294|      0|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 3361|      0|                break;
 3362|  7.84k|            } else if(action==MBCS_STATE_FALLBACK_DIRECT_20) {
  ------------------
  |  Branch (3362:23): [True: 0, False: 7.84k]
  ------------------
 3363|      0|                if(!TO_U_USE_FALLBACK(useFallback)) {
  ------------------
  |  |  270|      0|#define TO_U_USE_FALLBACK(useFallback) true
  ------------------
  |  Branch (3363:20): [Folded - Ignored]
  ------------------
 3364|      0|                    c=0xfffe;
 3365|      0|                    break;
 3366|      0|                }
 3367|       |                /* output supplementary code point */
 3368|      0|                c=0x10000+MBCS_ENTRY_FINAL_VALUE(entry);
  ------------------
  |  |  293|      0|#define MBCS_ENTRY_FINAL_VALUE(entry) ((entry)&0xfffff)
  ------------------
 3369|      0|                break;
 3370|  7.84k|            } else if(action==MBCS_STATE_UNASSIGNED) {
  ------------------
  |  Branch (3370:23): [True: 7.84k, False: 0]
  ------------------
 3371|  7.84k|                c=0xfffe;
 3372|  7.84k|                break;
 3373|  7.84k|            }
 3374|       |
 3375|       |            /*
 3376|       |             * forbid MBCS_STATE_CHANGE_ONLY for this function,
 3377|       |             * and MBCS_STATE_ILLEGAL and reserved action codes
 3378|       |             */
 3379|      0|            return 0xffff;
 3380|  1.03M|        }
 3381|  1.86M|    }
 3382|       |
 3383|  1.03M|    if(i!=length) {
  ------------------
  |  Branch (3383:8): [True: 0, False: 1.03M]
  ------------------
 3384|       |        /* illegal for this function: not all input consumed */
 3385|      0|        return 0xffff;
 3386|      0|    }
 3387|       |
 3388|  1.03M|    if(c==0xfffe) {
  ------------------
  |  Branch (3388:8): [True: 31.5k, False: 1.00M]
  ------------------
 3389|       |        /* try an extension mapping */
 3390|  31.5k|        const int32_t *cx=sharedData->mbcs.extIndexes;
 3391|  31.5k|        if(cx!=nullptr) {
  ------------------
  |  Branch (3391:12): [True: 11.1k, False: 20.3k]
  ------------------
 3392|  11.1k|            return ucnv_extSimpleMatchToU(cx, source, length, useFallback);
  ------------------
  |  |  658|  11.1k|#define ucnv_extSimpleMatchToU U_ICU_ENTRY_POINT_RENAME(ucnv_extSimpleMatchToU)
  |  |  ------------------
  |  |  |  |  123|  11.1k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  11.1k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  11.1k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3393|  11.1k|        }
 3394|  31.5k|    }
 3395|       |
 3396|  1.02M|    return c;
 3397|  1.03M|}
ucnvmbcs.cpp:_ZL13ucnv_MBCSLoadP20UConverterSharedDataP18UConverterLoadArgsPKhP10UErrorCode:
 1558|     10|          UErrorCode *pErrorCode) {
 1559|     10|    UDataInfo info;
 1560|     10|    UConverterMBCSTable *mbcsTable=&sharedData->mbcs;
 1561|     10|    _MBCSHeader *header=(_MBCSHeader *)raw;
 1562|     10|    uint32_t offset;
 1563|     10|    uint32_t headerLength;
 1564|     10|    UBool noFromU=false;
 1565|       |
 1566|     10|    if(header->version[0]==4) {
  ------------------
  |  Branch (1566:8): [True: 10, False: 0]
  ------------------
 1567|     10|        headerLength=MBCS_HEADER_V4_LENGTH;
 1568|     10|    } else if(header->version[0]==5 && header->version[1]>=3 &&
  ------------------
  |  Branch (1568:15): [True: 0, False: 0]
  |  Branch (1568:40): [True: 0, False: 0]
  ------------------
 1569|      0|              (header->options&MBCS_OPT_UNKNOWN_INCOMPATIBLE_MASK)==0) {
  ------------------
  |  Branch (1569:15): [True: 0, False: 0]
  ------------------
 1570|      0|        headerLength=header->options&MBCS_OPT_LENGTH_MASK;
 1571|      0|        noFromU = static_cast<UBool>((header->options & MBCS_OPT_NO_FROM_U) != 0);
 1572|      0|    } else {
 1573|      0|        *pErrorCode=U_INVALID_TABLE_FORMAT;
 1574|      0|        return;
 1575|      0|    }
 1576|       |
 1577|     10|    mbcsTable->outputType = static_cast<uint8_t>(header->flags);
 1578|     10|    if(noFromU && mbcsTable->outputType==MBCS_OUTPUT_1) {
  ------------------
  |  Branch (1578:8): [True: 0, False: 10]
  |  Branch (1578:19): [True: 0, False: 0]
  ------------------
 1579|      0|        *pErrorCode=U_INVALID_TABLE_FORMAT;
 1580|      0|        return;
 1581|      0|    }
 1582|       |
 1583|       |    /* extension data, header version 4.2 and higher */
 1584|     10|    offset=header->flags>>8;
 1585|     10|    if(offset!=0) {
  ------------------
  |  Branch (1585:8): [True: 6, False: 4]
  ------------------
 1586|      6|        mbcsTable->extIndexes = reinterpret_cast<const int32_t*>(raw + offset);
 1587|      6|    }
 1588|       |
 1589|     10|    if(mbcsTable->outputType==MBCS_OUTPUT_EXT_ONLY) {
  ------------------
  |  Branch (1589:8): [True: 2, False: 8]
  ------------------
 1590|      2|        UConverterLoadArgs args=UCNV_LOAD_ARGS_INITIALIZER;
  ------------------
  |  |   62|      2|    { (int32_t)sizeof(UConverterLoadArgs), 0, false, false, 0, 0, NULL, NULL, NULL }
  ------------------
 1591|      2|        UConverterSharedData *baseSharedData;
 1592|      2|        const int32_t *extIndexes;
 1593|      2|        const char *baseName;
 1594|       |
 1595|       |        /* extension-only file, load the base table and set values appropriately */
 1596|      2|        if((extIndexes=mbcsTable->extIndexes)==nullptr) {
  ------------------
  |  Branch (1596:12): [True: 0, False: 2]
  ------------------
 1597|       |            /* extension-only file without extension */
 1598|      0|            *pErrorCode=U_INVALID_TABLE_FORMAT;
 1599|      0|            return;
 1600|      0|        }
 1601|       |
 1602|      2|        if(pArgs->nestedLoads!=1) {
  ------------------
  |  Branch (1602:12): [True: 0, False: 2]
  ------------------
 1603|       |            /* an extension table must not be loaded as a base table */
 1604|      0|            *pErrorCode=U_INVALID_TABLE_FILE;
 1605|      0|            return;
 1606|      0|        }
 1607|       |
 1608|       |        /* load the base table */
 1609|      2|        baseName = reinterpret_cast<const char*>(header) + headerLength * 4;
 1610|      2|        if(0==uprv_strcmp(baseName, sharedData->staticData->name)) {
  ------------------
  |  |   38|      2|#define uprv_strcmp(s1, s2) U_STANDARD_CPP_NAMESPACE strcmp(s1, s2)
  |  |  ------------------
  |  |  |  |  393|      2|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (1610:12): [True: 0, False: 2]
  ------------------
 1611|       |            /* forbid loading this same extension-only file */
 1612|      0|            *pErrorCode=U_INVALID_TABLE_FORMAT;
 1613|      0|            return;
 1614|      0|        }
 1615|       |
 1616|       |        /* TODO parse package name out of the prefix of the base name in the extension .cnv file? */
 1617|      2|        args.size=sizeof(UConverterLoadArgs);
 1618|      2|        args.nestedLoads=2;
 1619|      2|        args.onlyTestIsLoadable=pArgs->onlyTestIsLoadable;
 1620|      2|        args.reserved=pArgs->reserved;
 1621|      2|        args.options=pArgs->options;
 1622|      2|        args.pkg=pArgs->pkg;
 1623|      2|        args.name=baseName;
 1624|      2|        baseSharedData=ucnv_load(&args, pErrorCode);
  ------------------
  |  |  699|      2|#define ucnv_load U_ICU_ENTRY_POINT_RENAME(ucnv_load)
  |  |  ------------------
  |  |  |  |  123|      2|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      2|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      2|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1625|      2|        if(U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (1625:12): [True: 0, False: 2]
  ------------------
 1626|      0|            return;
 1627|      0|        }
 1628|      2|        if( baseSharedData->staticData->conversionType!=UCNV_MBCS ||
  ------------------
  |  Branch (1628:13): [True: 0, False: 2]
  ------------------
 1629|      2|            baseSharedData->mbcs.baseSharedData!=nullptr
  ------------------
  |  Branch (1629:13): [True: 0, False: 2]
  ------------------
 1630|      2|        ) {
 1631|      0|            ucnv_unload(baseSharedData);
  ------------------
  |  |  725|      0|#define ucnv_unload U_ICU_ENTRY_POINT_RENAME(ucnv_unload)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1632|      0|            *pErrorCode=U_INVALID_TABLE_FORMAT;
 1633|      0|            return;
 1634|      0|        }
 1635|      2|        if(pArgs->onlyTestIsLoadable) {
  ------------------
  |  Branch (1635:12): [True: 0, False: 2]
  ------------------
 1636|       |            /*
 1637|       |             * Exit as soon as we know that we can load the converter
 1638|       |             * and the format is valid and supported.
 1639|       |             * The worst that can happen in the following code is a memory
 1640|       |             * allocation error.
 1641|       |             */
 1642|      0|            ucnv_unload(baseSharedData);
  ------------------
  |  |  725|      0|#define ucnv_unload U_ICU_ENTRY_POINT_RENAME(ucnv_unload)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1643|      0|            return;
 1644|      0|        }
 1645|       |
 1646|       |        /* copy the base table data */
 1647|      2|        uprv_memcpy(mbcsTable, &baseSharedData->mbcs, sizeof(UConverterMBCSTable));
  ------------------
  |  |   42|      2|#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|      2|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  |   43|      2|    /* Suppress warnings about addresses that will never be NULL */ \
  |  |   44|      2|    _Pragma("clang diagnostic push") \
  |  |   45|      2|    _Pragma("clang diagnostic ignored \"-Waddress\"") \
  |  |   46|      2|    U_ASSERT(dst != NULL); \
  |  |  ------------------
  |  |  |  |   35|      2|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   47|      2|    U_ASSERT(src != NULL); \
  |  |  ------------------
  |  |  |  |   35|      2|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   48|      2|    _Pragma("clang diagnostic pop") \
  |  |   49|      2|    U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
  |  |  ------------------
  |  |  |  |  393|      2|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  |  |   50|      2|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|      2|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1648|       |
 1649|       |        /* overwrite values with relevant ones for the extension converter */
 1650|      2|        mbcsTable->baseSharedData=baseSharedData;
 1651|      2|        mbcsTable->extIndexes=extIndexes;
 1652|       |
 1653|       |        /*
 1654|       |         * It would be possible to share the swapLFNL data with a base converter,
 1655|       |         * but the generated name would have to be different, and the memory
 1656|       |         * would have to be free'd only once.
 1657|       |         * It is easier to just create the data for the extension converter
 1658|       |         * separately when it is requested.
 1659|       |         */
 1660|      2|        mbcsTable->swapLFNLStateTable=nullptr;
 1661|      2|        mbcsTable->swapLFNLFromUnicodeBytes=nullptr;
 1662|      2|        mbcsTable->swapLFNLName=nullptr;
 1663|       |
 1664|       |        /*
 1665|       |         * The reconstitutedData must be deleted only when the base converter
 1666|       |         * is unloaded.
 1667|       |         */
 1668|      2|        mbcsTable->reconstitutedData=nullptr;
 1669|       |
 1670|       |        /*
 1671|       |         * Set a special, runtime-only outputType if the extension converter
 1672|       |         * is a DBCS version of a base converter that also maps single bytes.
 1673|       |         */
 1674|      2|        if( sharedData->staticData->conversionType==UCNV_DBCS ||
  ------------------
  |  Branch (1674:13): [True: 0, False: 2]
  ------------------
 1675|      2|                (sharedData->staticData->conversionType==UCNV_MBCS &&
  ------------------
  |  Branch (1675:18): [True: 2, False: 0]
  ------------------
 1676|      2|                 sharedData->staticData->minBytesPerChar>=2)
  ------------------
  |  Branch (1676:18): [True: 0, False: 2]
  ------------------
 1677|      2|        ) {
 1678|      0|            if(baseSharedData->mbcs.outputType==MBCS_OUTPUT_2_SISO) {
  ------------------
  |  Branch (1678:16): [True: 0, False: 0]
  ------------------
 1679|       |                /* the base converter is SI/SO-stateful */
 1680|      0|                int32_t entry;
 1681|       |
 1682|       |                /* get the dbcs state from the state table entry for SO=0x0e */
 1683|      0|                entry=mbcsTable->stateTable[0][0xe];
 1684|      0|                if( MBCS_ENTRY_IS_FINAL(entry) &&
  ------------------
  |  |  285|      0|#define MBCS_ENTRY_IS_FINAL(entry) ((entry)<0)
  |  |  ------------------
  |  |  |  Branch (285:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1685|      0|                    MBCS_ENTRY_FINAL_ACTION(entry)==MBCS_STATE_CHANGE_ONLY &&
  ------------------
  |  |  292|      0|#define MBCS_ENTRY_FINAL_ACTION(entry) ((((uint32_t)entry)>>20)&0xf)
  ------------------
  |  Branch (1685:21): [True: 0, False: 0]
  ------------------
 1686|      0|                    MBCS_ENTRY_FINAL_STATE(entry)!=0
  ------------------
  |  |  290|      0|#define MBCS_ENTRY_FINAL_STATE(entry) ((((uint32_t)entry)>>24)&0x7f)
  ------------------
  |  Branch (1686:21): [True: 0, False: 0]
  ------------------
 1687|      0|                ) {
 1688|      0|                    mbcsTable->dbcsOnlyState = static_cast<uint8_t>(MBCS_ENTRY_FINAL_STATE(entry));
  ------------------
  |  |  290|      0|#define MBCS_ENTRY_FINAL_STATE(entry) ((((uint32_t)entry)>>24)&0x7f)
  ------------------
 1689|       |
 1690|      0|                    mbcsTable->outputType=MBCS_OUTPUT_DBCS_ONLY;
 1691|      0|                }
 1692|      0|            } else if(
 1693|      0|                baseSharedData->staticData->conversionType==UCNV_MBCS &&
  ------------------
  |  Branch (1693:17): [True: 0, False: 0]
  ------------------
 1694|      0|                baseSharedData->staticData->minBytesPerChar==1 &&
  ------------------
  |  Branch (1694:17): [True: 0, False: 0]
  ------------------
 1695|      0|                baseSharedData->staticData->maxBytesPerChar==2 &&
  ------------------
  |  Branch (1695:17): [True: 0, False: 0]
  ------------------
 1696|      0|                mbcsTable->countStates<=127
  ------------------
  |  Branch (1696:17): [True: 0, False: 0]
  ------------------
 1697|      0|            ) {
 1698|       |                /* non-stateful base converter, need to modify the state table */
 1699|      0|                int32_t (*newStateTable)[256];
 1700|      0|                int32_t *state;
 1701|      0|                int32_t i, count;
 1702|       |
 1703|       |                /* allocate a new state table and copy the base state table contents */
 1704|      0|                count=mbcsTable->countStates;
 1705|      0|                newStateTable = static_cast<int32_t(*)[256]>(uprv_malloc((count + 1) * 1024));
  ------------------
  |  | 1524|      0|#define uprv_malloc U_ICU_ENTRY_POINT_RENAME(uprv_malloc)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1706|      0|                if(newStateTable==nullptr) {
  ------------------
  |  Branch (1706:20): [True: 0, False: 0]
  ------------------
 1707|      0|                    ucnv_unload(baseSharedData);
  ------------------
  |  |  725|      0|#define ucnv_unload U_ICU_ENTRY_POINT_RENAME(ucnv_unload)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1708|      0|                    *pErrorCode=U_MEMORY_ALLOCATION_ERROR;
 1709|      0|                    return;
 1710|      0|                }
 1711|       |
 1712|      0|                uprv_memcpy(newStateTable, mbcsTable->stateTable, count*1024);
  ------------------
  |  |   42|      0|#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|      0|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  |   43|      0|    /* Suppress warnings about addresses that will never be NULL */ \
  |  |   44|      0|    _Pragma("clang diagnostic push") \
  |  |   45|      0|    _Pragma("clang diagnostic ignored \"-Waddress\"") \
  |  |   46|      0|    U_ASSERT(dst != NULL); \
  |  |  ------------------
  |  |  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   47|      0|    U_ASSERT(src != NULL); \
  |  |  ------------------
  |  |  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   48|      0|    _Pragma("clang diagnostic pop") \
  |  |   49|      0|    U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  |  |   50|      0|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|      0|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1713|       |
 1714|       |                /* change all final single-byte entries to go to a new all-illegal state */
 1715|      0|                state=newStateTable[0];
 1716|      0|                for(i=0; i<256; ++i) {
  ------------------
  |  Branch (1716:26): [True: 0, False: 0]
  ------------------
 1717|      0|                    if(MBCS_ENTRY_IS_FINAL(state[i])) {
  ------------------
  |  |  285|      0|#define MBCS_ENTRY_IS_FINAL(entry) ((entry)<0)
  |  |  ------------------
  |  |  |  Branch (285:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1718|      0|                        state[i]=MBCS_ENTRY_TRANSITION(count, 0);
  ------------------
  |  |  270|      0|#define MBCS_ENTRY_TRANSITION(state, offset) (int32_t)(((int32_t)(state)<<24L)|(offset))
  ------------------
 1719|      0|                    }
 1720|      0|                }
 1721|       |
 1722|       |                /* build the new all-illegal state */
 1723|      0|                state=newStateTable[count];
 1724|      0|                for(i=0; i<256; ++i) {
  ------------------
  |  Branch (1724:26): [True: 0, False: 0]
  ------------------
 1725|      0|                    state[i]=MBCS_ENTRY_FINAL(0, MBCS_STATE_ILLEGAL, 0);
  ------------------
  |  |  274|      0|#define MBCS_ENTRY_FINAL(state, action, value) (int32_t)(0x80000000|((int32_t)(state)<<24L)|((action)<<20L)|(value))
  ------------------
 1726|      0|                }
 1727|      0|                mbcsTable->stateTable=(const int32_t (*)[256])newStateTable;
 1728|      0|                mbcsTable->countStates = static_cast<uint8_t>(count + 1);
 1729|      0|                mbcsTable->stateTableOwned=true;
 1730|       |
 1731|      0|                mbcsTable->outputType=MBCS_OUTPUT_DBCS_ONLY;
 1732|      0|            }
 1733|      0|        }
 1734|       |
 1735|       |        /*
 1736|       |         * unlike below for files with base tables, do not get the unicodeMask
 1737|       |         * from the sharedData; instead, use the base table's unicodeMask,
 1738|       |         * which we copied in the memcpy above;
 1739|       |         * this is necessary because the static data unicodeMask, especially
 1740|       |         * the UCNV_HAS_SUPPLEMENTARY flag, is part of the base table data
 1741|       |         */
 1742|      8|    } else {
 1743|       |        /* conversion file with a base table; an additional extension table is optional */
 1744|       |        /* make sure that the output type is known */
 1745|      8|        switch(mbcsTable->outputType) {
 1746|      1|        case MBCS_OUTPUT_1:
  ------------------
  |  Branch (1746:9): [True: 1, False: 7]
  ------------------
 1747|      6|        case MBCS_OUTPUT_2:
  ------------------
  |  Branch (1747:9): [True: 5, False: 3]
  ------------------
 1748|      7|        case MBCS_OUTPUT_3:
  ------------------
  |  Branch (1748:9): [True: 1, False: 7]
  ------------------
 1749|      8|        case MBCS_OUTPUT_4:
  ------------------
  |  Branch (1749:9): [True: 1, False: 7]
  ------------------
 1750|      8|        case MBCS_OUTPUT_3_EUC:
  ------------------
  |  Branch (1750:9): [True: 0, False: 8]
  ------------------
 1751|      8|        case MBCS_OUTPUT_4_EUC:
  ------------------
  |  Branch (1751:9): [True: 0, False: 8]
  ------------------
 1752|      8|        case MBCS_OUTPUT_2_SISO:
  ------------------
  |  Branch (1752:9): [True: 0, False: 8]
  ------------------
 1753|       |            /* OK */
 1754|      8|            break;
 1755|      0|        default:
  ------------------
  |  Branch (1755:9): [True: 0, False: 8]
  ------------------
 1756|      0|            *pErrorCode=U_INVALID_TABLE_FORMAT;
 1757|      0|            return;
 1758|      8|        }
 1759|      8|        if(pArgs->onlyTestIsLoadable) {
  ------------------
  |  Branch (1759:12): [True: 0, False: 8]
  ------------------
 1760|       |            /*
 1761|       |             * Exit as soon as we know that we can load the converter
 1762|       |             * and the format is valid and supported.
 1763|       |             * The worst that can happen in the following code is a memory
 1764|       |             * allocation error.
 1765|       |             */
 1766|      0|            return;
 1767|      0|        }
 1768|       |
 1769|      8|        mbcsTable->countStates = static_cast<uint8_t>(header->countStates);
 1770|      8|        mbcsTable->countToUFallbacks=header->countToUFallbacks;
 1771|      8|        mbcsTable->stateTable = reinterpret_cast<const int32_t(*)[256]>(raw + headerLength * 4);
 1772|      8|        mbcsTable->toUFallbacks = reinterpret_cast<const _MBCSToUFallback*>(mbcsTable->stateTable + header->countStates);
 1773|      8|        mbcsTable->unicodeCodeUnits = reinterpret_cast<const uint16_t*>(raw + header->offsetToUCodeUnits);
 1774|       |
 1775|      8|        mbcsTable->fromUnicodeTable = reinterpret_cast<const uint16_t*>(raw + header->offsetFromUTable);
 1776|      8|        mbcsTable->fromUnicodeBytes = raw + header->offsetFromUBytes;
 1777|      8|        mbcsTable->fromUBytesLength=header->fromUBytesLength;
 1778|       |
 1779|       |        /*
 1780|       |         * converter versions 6.1 and up contain a unicodeMask that is
 1781|       |         * used here to select the most efficient function implementations
 1782|       |         */
 1783|      8|        info.size=sizeof(UDataInfo);
 1784|      8|        udata_getInfo((UDataMemory *)sharedData->dataMemory, &info);
  ------------------
  |  |  888|      8|#define udata_getInfo U_ICU_ENTRY_POINT_RENAME(udata_getInfo)
  |  |  ------------------
  |  |  |  |  123|      8|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      8|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      8|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1785|      8|        if(info.formatVersion[0]>6 || (info.formatVersion[0]==6 && info.formatVersion[1]>=1)) {
  ------------------
  |  Branch (1785:12): [True: 0, False: 8]
  |  Branch (1785:40): [True: 8, False: 0]
  |  Branch (1785:68): [True: 8, False: 0]
  ------------------
 1786|       |            /* mask off possible future extensions to be safe */
 1787|      8|            mbcsTable->unicodeMask = static_cast<uint8_t>(sharedData->staticData->unicodeMask & 3);
 1788|      8|        } else {
 1789|       |            /* for older versions, assume worst case: contains anything possible (prevent over-optimizations) */
 1790|      0|            mbcsTable->unicodeMask=UCNV_HAS_SUPPLEMENTARY|UCNV_HAS_SURROGATES;
  ------------------
  |  |   64|      0|#define UCNV_HAS_SUPPLEMENTARY 1
  ------------------
                          mbcsTable->unicodeMask=UCNV_HAS_SUPPLEMENTARY|UCNV_HAS_SURROGATES;
  ------------------
  |  |   65|      0|#define UCNV_HAS_SURROGATES    2
  ------------------
 1791|      0|        }
 1792|       |
 1793|       |        /*
 1794|       |         * _MBCSHeader.version 4.3 adds utf8Friendly data structures.
 1795|       |         * Check for the header version, SBCS vs. MBCS, and for whether the
 1796|       |         * data structures are optimized for code points as high as what the
 1797|       |         * runtime code is designed for.
 1798|       |         * The implementation does not handle mapping tables with entries for
 1799|       |         * unpaired surrogates.
 1800|       |         */
 1801|      8|        if( header->version[1]>=3 &&
  ------------------
  |  Branch (1801:13): [True: 8, False: 0]
  ------------------
 1802|      8|            (mbcsTable->unicodeMask&UCNV_HAS_SURROGATES)==0 &&
  ------------------
  |  |   65|      8|#define UCNV_HAS_SURROGATES    2
  ------------------
  |  Branch (1802:13): [True: 8, False: 0]
  ------------------
 1803|      8|            (mbcsTable->countStates==1 ?
  ------------------
  |  Branch (1803:13): [True: 8, False: 0]
  |  Branch (1803:14): [True: 1, False: 7]
  ------------------
 1804|      1|                (header->version[2]>=(SBCS_FAST_MAX>>8)) :
 1805|      8|                (header->version[2]>=(MBCS_FAST_MAX>>8))
 1806|      8|            )
 1807|      8|        ) {
 1808|      8|            mbcsTable->utf8Friendly=true;
 1809|       |
 1810|      8|            if(mbcsTable->countStates==1) {
  ------------------
  |  Branch (1810:16): [True: 1, False: 7]
  ------------------
 1811|       |                /*
 1812|       |                 * SBCS: Stage 3 is allocated in 64-entry blocks for U+0000..SBCS_FAST_MAX or higher.
 1813|       |                 * Build a table with indexes to each block, to be used instead of
 1814|       |                 * the regular stage 1/2 table.
 1815|       |                 */
 1816|      1|                int32_t i;
 1817|     65|                for(i=0; i<(SBCS_FAST_LIMIT>>6); ++i) {
  ------------------
  |  Branch (1817:26): [True: 64, False: 1]
  ------------------
 1818|     64|                    mbcsTable->sbcsIndex[i]=mbcsTable->fromUnicodeTable[mbcsTable->fromUnicodeTable[i>>4]+((i<<2)&0x3c)];
 1819|     64|                }
 1820|       |                /* set SBCS_FAST_MAX to reflect the reach of sbcsIndex[] even if header->version[2]>(SBCS_FAST_MAX>>8) */
 1821|      1|                mbcsTable->maxFastUChar=SBCS_FAST_MAX;
 1822|      7|            } else {
 1823|       |                /*
 1824|       |                 * MBCS: Stage 3 is allocated in 64-entry blocks for U+0000..MBCS_FAST_MAX or higher.
 1825|       |                 * The .cnv file is prebuilt with an additional stage table with indexes
 1826|       |                 * to each block.
 1827|       |                 */
 1828|      7|                mbcsTable->mbcsIndex = reinterpret_cast<const uint16_t*>(
 1829|      7|                    mbcsTable->fromUnicodeBytes +
 1830|      7|                     (noFromU ? 0 : mbcsTable->fromUBytesLength));
  ------------------
  |  Branch (1830:23): [True: 0, False: 7]
  ------------------
 1831|      7|                mbcsTable->maxFastUChar = (static_cast<char16_t>(header->version[2]) << 8) | 0xff;
 1832|      7|            }
 1833|      8|        }
 1834|       |
 1835|       |        /* calculate a bit set of 4 ASCII characters per bit that round-trip to ASCII bytes */
 1836|      8|        {
 1837|      8|            uint32_t asciiRoundtrips=0xffffffff;
 1838|      8|            int32_t i;
 1839|       |
 1840|  1.03k|            for(i=0; i<0x80; ++i) {
  ------------------
  |  Branch (1840:22): [True: 1.02k, False: 8]
  ------------------
 1841|  1.02k|                if(mbcsTable->stateTable[0][i]!=MBCS_ENTRY_FINAL(0, MBCS_STATE_VALID_DIRECT_16, i)) {
  ------------------
  |  |  274|  1.02k|#define MBCS_ENTRY_FINAL(state, action, value) (int32_t)(0x80000000|((int32_t)(state)<<24L)|((action)<<20L)|(value))
  ------------------
  |  Branch (1841:20): [True: 396, False: 628]
  ------------------
 1842|    396|                    asciiRoundtrips &= ~(static_cast<uint32_t>(1) << (i >> 2));
 1843|    396|                }
 1844|  1.02k|            }
 1845|      8|            mbcsTable->asciiRoundtrips=asciiRoundtrips;
 1846|      8|        }
 1847|       |
 1848|      8|        if(noFromU) {
  ------------------
  |  Branch (1848:12): [True: 0, False: 8]
  ------------------
 1849|      0|            uint32_t stage1Length=
 1850|      0|                mbcsTable->unicodeMask&UCNV_HAS_SUPPLEMENTARY ?
  ------------------
  |  |   64|      0|#define UCNV_HAS_SUPPLEMENTARY 1
  ------------------
  |  Branch (1850:17): [True: 0, False: 0]
  ------------------
 1851|      0|                    0x440 : 0x40;
 1852|      0|            uint32_t stage2Length=
 1853|      0|                (header->offsetFromUBytes-header->offsetFromUTable)/4-
 1854|      0|                stage1Length/2;
 1855|      0|            reconstituteData(mbcsTable, stage1Length, stage2Length, header->fullStage2Length, pErrorCode);
 1856|      0|        }
 1857|      8|    }
 1858|       |
 1859|       |    /* Set the impl pointer here so that it is set for both extension-only and base tables. */
 1860|     10|    if(mbcsTable->utf8Friendly) {
  ------------------
  |  Branch (1860:8): [True: 10, False: 0]
  ------------------
 1861|     10|        if(mbcsTable->countStates==1) {
  ------------------
  |  Branch (1861:12): [True: 1, False: 9]
  ------------------
 1862|      1|            sharedData->impl=&_SBCSUTF8Impl;
 1863|      9|        } else {
 1864|      9|            if(mbcsTable->outputType==MBCS_OUTPUT_2) {
  ------------------
  |  Branch (1864:16): [True: 7, False: 2]
  ------------------
 1865|      7|                sharedData->impl=&_DBCSUTF8Impl;
 1866|      7|            }
 1867|      9|        }
 1868|     10|    }
 1869|       |
 1870|     10|    if(mbcsTable->outputType==MBCS_OUTPUT_DBCS_ONLY || mbcsTable->outputType==MBCS_OUTPUT_2_SISO) {
  ------------------
  |  Branch (1870:8): [True: 0, False: 10]
  |  Branch (1870:56): [True: 0, False: 10]
  ------------------
 1871|       |        /*
 1872|       |         * MBCS_OUTPUT_DBCS_ONLY: No SBCS mappings, therefore ASCII does not roundtrip.
 1873|       |         * MBCS_OUTPUT_2_SISO: Bypass the ASCII fastpath to handle prevLength correctly.
 1874|       |         */
 1875|      0|        mbcsTable->asciiRoundtrips=0;
 1876|      0|    }
 1877|     10|}
ucnvmbcs.cpp:_ZL13ucnv_MBCSOpenP10UConverterP18UConverterLoadArgsP10UErrorCode:
 1900|    923|              UErrorCode *pErrorCode) {
 1901|    923|    UConverterMBCSTable *mbcsTable;
 1902|    923|    const int32_t *extIndexes;
 1903|    923|    uint8_t outputType;
 1904|    923|    int8_t maxBytesPerUChar;
 1905|       |
 1906|    923|    if(pArgs->onlyTestIsLoadable) {
  ------------------
  |  Branch (1906:8): [True: 0, False: 923]
  ------------------
 1907|      0|        return;
 1908|      0|    }
 1909|       |
 1910|    923|    mbcsTable=&cnv->sharedData->mbcs;
 1911|    923|    outputType=mbcsTable->outputType;
 1912|       |
 1913|    923|    if(outputType==MBCS_OUTPUT_DBCS_ONLY) {
  ------------------
  |  Branch (1913:8): [True: 0, False: 923]
  ------------------
 1914|       |        /* the swaplfnl option does not apply, remove it */
 1915|      0|        cnv->options=pArgs->options&=~UCNV_OPTION_SWAP_LFNL;
  ------------------
  |  |   45|      0|#define UCNV_OPTION_SWAP_LFNL   0x10
  ------------------
 1916|      0|    }
 1917|       |
 1918|    923|    if((pArgs->options&UCNV_OPTION_SWAP_LFNL)!=0) {
  ------------------
  |  |   45|    923|#define UCNV_OPTION_SWAP_LFNL   0x10
  ------------------
  |  Branch (1918:8): [True: 0, False: 923]
  ------------------
 1919|       |        /* do this because double-checked locking is broken */
 1920|      0|        UBool isCached;
 1921|       |
 1922|      0|        icu::umtx_lock(nullptr);
  ------------------
  |  | 1250|      0|#define umtx_lock U_ICU_ENTRY_POINT_RENAME(umtx_lock)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1923|      0|        isCached=mbcsTable->swapLFNLStateTable!=nullptr;
 1924|      0|        icu::umtx_unlock(nullptr);
  ------------------
  |  | 1251|      0|#define umtx_unlock U_ICU_ENTRY_POINT_RENAME(umtx_unlock)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1925|       |
 1926|      0|        if(!isCached) {
  ------------------
  |  Branch (1926:12): [True: 0, False: 0]
  ------------------
 1927|      0|            if(!_EBCDICSwapLFNL(cnv->sharedData, pErrorCode)) {
  ------------------
  |  Branch (1927:16): [True: 0, False: 0]
  ------------------
 1928|      0|                if(U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (1928:20): [True: 0, False: 0]
  ------------------
 1929|      0|                    return; /* something went wrong */
 1930|      0|                }
 1931|       |
 1932|       |                /* the option does not apply, remove it */
 1933|      0|                cnv->options=pArgs->options&=~UCNV_OPTION_SWAP_LFNL;
  ------------------
  |  |   45|      0|#define UCNV_OPTION_SWAP_LFNL   0x10
  ------------------
 1934|      0|            }
 1935|      0|        }
 1936|      0|    }
 1937|       |
 1938|    923|    if(uprv_strstr(pArgs->name, "18030")!=nullptr) {
  ------------------
  |  |   41|    923|#define uprv_strstr(s, c) U_STANDARD_CPP_NAMESPACE strstr(s, c)
  |  |  ------------------
  |  |  |  |  393|    923|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (1938:8): [True: 258, False: 665]
  ------------------
 1939|    258|        if(uprv_strstr(pArgs->name, "gb18030")!=nullptr || uprv_strstr(pArgs->name, "GB18030")!=nullptr) {
  ------------------
  |  |   41|    258|#define uprv_strstr(s, c) U_STANDARD_CPP_NAMESPACE strstr(s, c)
  |  |  ------------------
  |  |  |  |  393|    258|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
                      if(uprv_strstr(pArgs->name, "gb18030")!=nullptr || uprv_strstr(pArgs->name, "GB18030")!=nullptr) {
  ------------------
  |  |   41|      0|#define uprv_strstr(s, c) U_STANDARD_CPP_NAMESPACE strstr(s, c)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (1939:12): [True: 258, False: 0]
  |  Branch (1939:60): [True: 0, False: 0]
  ------------------
 1940|       |            /* set a flag for GB 18030 mode, which changes the callback behavior */
 1941|    258|            cnv->options|=_MBCS_OPTION_GB18030;
  ------------------
  |  |  559|    258|#define _MBCS_OPTION_GB18030 0x8000
  ------------------
 1942|    258|        }
 1943|    665|    } else if((uprv_strstr(pArgs->name, "KEIS")!=nullptr) || (uprv_strstr(pArgs->name, "keis")!=nullptr)) {
  ------------------
  |  |   41|    665|#define uprv_strstr(s, c) U_STANDARD_CPP_NAMESPACE strstr(s, c)
  |  |  ------------------
  |  |  |  |  393|    665|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
                  } else if((uprv_strstr(pArgs->name, "KEIS")!=nullptr) || (uprv_strstr(pArgs->name, "keis")!=nullptr)) {
  ------------------
  |  |   41|    665|#define uprv_strstr(s, c) U_STANDARD_CPP_NAMESPACE strstr(s, c)
  |  |  ------------------
  |  |  |  |  393|    665|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (1943:15): [True: 0, False: 665]
  |  Branch (1943:62): [True: 0, False: 665]
  ------------------
 1944|       |        /* set a flag for KEIS converter, which changes the SI/SO character sequence */
 1945|      0|        cnv->options|=_MBCS_OPTION_KEIS;
  ------------------
  |  |  562|      0|#define _MBCS_OPTION_KEIS 0x01000
  ------------------
 1946|    665|    } else if((uprv_strstr(pArgs->name, "JEF")!=nullptr) || (uprv_strstr(pArgs->name, "jef")!=nullptr)) {
  ------------------
  |  |   41|    665|#define uprv_strstr(s, c) U_STANDARD_CPP_NAMESPACE strstr(s, c)
  |  |  ------------------
  |  |  |  |  393|    665|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
                  } else if((uprv_strstr(pArgs->name, "JEF")!=nullptr) || (uprv_strstr(pArgs->name, "jef")!=nullptr)) {
  ------------------
  |  |   41|    665|#define uprv_strstr(s, c) U_STANDARD_CPP_NAMESPACE strstr(s, c)
  |  |  ------------------
  |  |  |  |  393|    665|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (1946:15): [True: 0, False: 665]
  |  Branch (1946:61): [True: 0, False: 665]
  ------------------
 1947|       |        /* set a flag for JEF converter, which changes the SI/SO character sequence */
 1948|      0|        cnv->options|=_MBCS_OPTION_JEF;
  ------------------
  |  |  563|      0|#define _MBCS_OPTION_JEF  0x02000
  ------------------
 1949|    665|    } else if((uprv_strstr(pArgs->name, "JIPS")!=nullptr) || (uprv_strstr(pArgs->name, "jips")!=nullptr)) {
  ------------------
  |  |   41|    665|#define uprv_strstr(s, c) U_STANDARD_CPP_NAMESPACE strstr(s, c)
  |  |  ------------------
  |  |  |  |  393|    665|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
                  } else if((uprv_strstr(pArgs->name, "JIPS")!=nullptr) || (uprv_strstr(pArgs->name, "jips")!=nullptr)) {
  ------------------
  |  |   41|    665|#define uprv_strstr(s, c) U_STANDARD_CPP_NAMESPACE strstr(s, c)
  |  |  ------------------
  |  |  |  |  393|    665|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (1949:15): [True: 0, False: 665]
  |  Branch (1949:62): [True: 0, False: 665]
  ------------------
 1950|       |        /* set a flag for JIPS converter, which changes the SI/SO character sequence */
 1951|      0|        cnv->options|=_MBCS_OPTION_JIPS;
  ------------------
  |  |  564|      0|#define _MBCS_OPTION_JIPS 0x04000
  ------------------
 1952|      0|    }
 1953|       |
 1954|       |    /* fix maxBytesPerUChar depending on outputType and options etc. */
 1955|    923|    if(outputType==MBCS_OUTPUT_2_SISO) {
  ------------------
  |  Branch (1955:8): [True: 0, False: 923]
  ------------------
 1956|      0|        cnv->maxBytesPerUChar=3; /* SO+DBCS */
 1957|      0|    }
 1958|       |
 1959|    923|    extIndexes=mbcsTable->extIndexes;
 1960|    923|    if(extIndexes!=nullptr) {
  ------------------
  |  Branch (1960:8): [True: 798, False: 125]
  ------------------
 1961|    798|        maxBytesPerUChar = static_cast<int8_t>(UCNV_GET_MAX_BYTES_PER_UCHAR(extIndexes));
  ------------------
  |  |  348|    798|    ((indexes)[UCNV_EXT_COUNT_BYTES]&0xff)
  ------------------
 1962|    798|        if(outputType==MBCS_OUTPUT_2_SISO) {
  ------------------
  |  Branch (1962:12): [True: 0, False: 798]
  ------------------
 1963|      0|            ++maxBytesPerUChar; /* SO + multiple DBCS */
 1964|      0|        }
 1965|       |
 1966|    798|        if(maxBytesPerUChar>cnv->maxBytesPerUChar) {
  ------------------
  |  Branch (1966:12): [True: 0, False: 798]
  ------------------
 1967|      0|            cnv->maxBytesPerUChar=maxBytesPerUChar;
 1968|      0|        }
 1969|    798|    }
 1970|       |
 1971|       |#if 0
 1972|       |    /*
 1973|       |     * documentation of UConverter fields used for status
 1974|       |     * all of these fields are (re)set to 0 by ucnv_bld.c and ucnv_reset()
 1975|       |     */
 1976|       |
 1977|       |    /* toUnicode */
 1978|       |    cnv->toUnicodeStatus=0;     /* offset */
 1979|       |    cnv->mode=0;                /* state */
 1980|       |    cnv->toULength=0;           /* byteIndex */
 1981|       |
 1982|       |    /* fromUnicode */
 1983|       |    cnv->fromUChar32=0;
 1984|       |    cnv->fromUnicodeStatus=1;   /* prevLength */
 1985|       |#endif
 1986|    923|}
ucnvmbcs.cpp:_ZL31ucnv_MBCSSingleToBMPWithOffsetsP23UConverterToUnicodeArgsP10UErrorCode:
 2186|  1.26M|                            UErrorCode *pErrorCode) {
 2187|  1.26M|    UConverter *cnv;
 2188|  1.26M|    const uint8_t *source, *sourceLimit, *lastSource;
 2189|  1.26M|    char16_t *target;
 2190|  1.26M|    int32_t targetCapacity, length;
 2191|  1.26M|    int32_t *offsets;
 2192|       |
 2193|  1.26M|    const int32_t (*stateTable)[256];
 2194|       |
 2195|  1.26M|    int32_t sourceIndex;
 2196|       |
 2197|  1.26M|    int32_t entry;
 2198|  1.26M|    uint8_t action;
 2199|       |
 2200|       |    /* set up the local pointers */
 2201|  1.26M|    cnv=pArgs->converter;
 2202|  1.26M|    source = reinterpret_cast<const uint8_t*>(pArgs->source);
 2203|  1.26M|    sourceLimit = reinterpret_cast<const uint8_t*>(pArgs->sourceLimit);
 2204|  1.26M|    target=pArgs->target;
 2205|  1.26M|    targetCapacity = static_cast<int32_t>(pArgs->targetLimit - pArgs->target);
 2206|  1.26M|    offsets=pArgs->offsets;
 2207|       |
 2208|  1.26M|    if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0) {
  ------------------
  |  |   45|  1.26M|#define UCNV_OPTION_SWAP_LFNL   0x10
  ------------------
  |  Branch (2208:8): [True: 0, False: 1.26M]
  ------------------
 2209|      0|        stateTable=(const int32_t (*)[256])cnv->sharedData->mbcs.swapLFNLStateTable;
 2210|  1.26M|    } else {
 2211|  1.26M|        stateTable=cnv->sharedData->mbcs.stateTable;
 2212|  1.26M|    }
 2213|       |
 2214|       |    /* sourceIndex=-1 if the current character began in the previous buffer */
 2215|  1.26M|    sourceIndex=0;
 2216|  1.26M|    lastSource=source;
 2217|       |
 2218|       |    /*
 2219|       |     * since the conversion here is 1:1 char16_t:uint8_t, we need only one counter
 2220|       |     * for the minimum of the sourceLength and targetCapacity
 2221|       |     */
 2222|  1.26M|    length = static_cast<int32_t>(sourceLimit - source);
 2223|  1.26M|    if(length<targetCapacity) {
  ------------------
  |  Branch (2223:8): [True: 1.26M, False: 37]
  ------------------
 2224|  1.26M|        targetCapacity=length;
 2225|  1.26M|    }
 2226|       |
 2227|  1.26M|#if MBCS_UNROLL_SINGLE_TO_BMP
 2228|       |    /* unrolling makes it faster on Pentium III/Windows 2000 */
 2229|       |    /* unroll the loop with the most common case */
 2230|  1.26M|unrolled:
 2231|  1.26M|    if(targetCapacity>=16) {
  ------------------
  |  Branch (2231:8): [True: 1.26M, False: 438]
  ------------------
 2232|  1.26M|        int32_t count, loops, oredEntries;
 2233|       |
 2234|  1.26M|        loops=count=targetCapacity>>4;
 2235|  1.54M|        do {
 2236|  1.54M|            oredEntries=entry=stateTable[0][*source++];
 2237|  1.54M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  1.54M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2238|  1.54M|            oredEntries|=entry=stateTable[0][*source++];
 2239|  1.54M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  1.54M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2240|  1.54M|            oredEntries|=entry=stateTable[0][*source++];
 2241|  1.54M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  1.54M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2242|  1.54M|            oredEntries|=entry=stateTable[0][*source++];
 2243|  1.54M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  1.54M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2244|  1.54M|            oredEntries|=entry=stateTable[0][*source++];
 2245|  1.54M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  1.54M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2246|  1.54M|            oredEntries|=entry=stateTable[0][*source++];
 2247|  1.54M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  1.54M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2248|  1.54M|            oredEntries|=entry=stateTable[0][*source++];
 2249|  1.54M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  1.54M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2250|  1.54M|            oredEntries|=entry=stateTable[0][*source++];
 2251|  1.54M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  1.54M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2252|  1.54M|            oredEntries|=entry=stateTable[0][*source++];
 2253|  1.54M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  1.54M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2254|  1.54M|            oredEntries|=entry=stateTable[0][*source++];
 2255|  1.54M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  1.54M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2256|  1.54M|            oredEntries|=entry=stateTable[0][*source++];
 2257|  1.54M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  1.54M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2258|  1.54M|            oredEntries|=entry=stateTable[0][*source++];
 2259|  1.54M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  1.54M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2260|  1.54M|            oredEntries|=entry=stateTable[0][*source++];
 2261|  1.54M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  1.54M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2262|  1.54M|            oredEntries|=entry=stateTable[0][*source++];
 2263|  1.54M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  1.54M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2264|  1.54M|            oredEntries|=entry=stateTable[0][*source++];
 2265|  1.54M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  1.54M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2266|  1.54M|            oredEntries|=entry=stateTable[0][*source++];
 2267|  1.54M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  1.54M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2268|       |
 2269|       |            /* were all 16 entries really valid? */
 2270|  1.54M|            if(!MBCS_ENTRY_FINAL_IS_VALID_DIRECT_16(oredEntries)) {
  ------------------
  |  |  291|  1.54M|#define MBCS_ENTRY_FINAL_IS_VALID_DIRECT_16(entry) ((entry)<(int32_t)0x80100000)
  ------------------
  |  Branch (2270:16): [True: 1.26M, False: 281k]
  ------------------
 2271|       |                /* no, return to the first of these 16 */
 2272|  1.26M|                source-=16;
 2273|  1.26M|                target-=16;
 2274|  1.26M|                break;
 2275|  1.26M|            }
 2276|  1.54M|        } while(--count>0);
  ------------------
  |  Branch (2276:17): [True: 281k, False: 40]
  ------------------
 2277|      0|        count=loops-count;
 2278|  1.26M|        targetCapacity-=16*count;
 2279|       |
 2280|  1.26M|        if(offsets!=nullptr) {
  ------------------
  |  Branch (2280:12): [True: 0, False: 1.26M]
  ------------------
 2281|      0|            lastSource+=16*count;
 2282|      0|            while(count>0) {
  ------------------
  |  Branch (2282:19): [True: 0, False: 0]
  ------------------
 2283|      0|                *offsets++=sourceIndex++;
 2284|      0|                *offsets++=sourceIndex++;
 2285|      0|                *offsets++=sourceIndex++;
 2286|      0|                *offsets++=sourceIndex++;
 2287|      0|                *offsets++=sourceIndex++;
 2288|      0|                *offsets++=sourceIndex++;
 2289|      0|                *offsets++=sourceIndex++;
 2290|      0|                *offsets++=sourceIndex++;
 2291|      0|                *offsets++=sourceIndex++;
 2292|      0|                *offsets++=sourceIndex++;
 2293|      0|                *offsets++=sourceIndex++;
 2294|      0|                *offsets++=sourceIndex++;
 2295|      0|                *offsets++=sourceIndex++;
 2296|      0|                *offsets++=sourceIndex++;
 2297|      0|                *offsets++=sourceIndex++;
 2298|      0|                *offsets++=sourceIndex++;
 2299|      0|                --count;
 2300|      0|            }
 2301|      0|        }
 2302|  1.26M|    }
 2303|      0|#endif
 2304|       |
 2305|       |    /* conversion loop */
 2306|  4.42M|    while(targetCapacity > 0 && source < sourceLimit) {
  ------------------
  |  Branch (2306:11): [True: 4.42M, False: 125]
  |  Branch (2306:33): [True: 4.42M, False: 0]
  ------------------
 2307|  4.42M|        entry=stateTable[0][*source++];
 2308|       |        /* MBCS_ENTRY_IS_FINAL(entry) */
 2309|       |
 2310|       |        /* test the most common case first */
 2311|  4.42M|        if(MBCS_ENTRY_FINAL_IS_VALID_DIRECT_16(entry)) {
  ------------------
  |  |  291|  4.42M|#define MBCS_ENTRY_FINAL_IS_VALID_DIRECT_16(entry) ((entry)<(int32_t)0x80100000)
  |  |  ------------------
  |  |  |  Branch (291:52): [True: 3.15M, False: 1.26M]
  |  |  ------------------
  ------------------
 2312|       |            /* output BMP code point */
 2313|  3.15M|            *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|  3.15M|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2314|  3.15M|            --targetCapacity;
 2315|  3.15M|            continue;
 2316|  3.15M|        }
 2317|       |
 2318|       |        /*
 2319|       |         * An if-else-if chain provides more reliable performance for
 2320|       |         * the most common cases compared to a switch.
 2321|       |         */
 2322|  1.26M|        action = static_cast<uint8_t>(MBCS_ENTRY_FINAL_ACTION(entry));
  ------------------
  |  |  292|  1.26M|#define MBCS_ENTRY_FINAL_ACTION(entry) ((((uint32_t)entry)>>20)&0xf)
  ------------------
 2323|  1.26M|        if(action==MBCS_STATE_FALLBACK_DIRECT_16) {
  ------------------
  |  Branch (2323:12): [True: 0, False: 1.26M]
  ------------------
 2324|      0|            if(UCNV_TO_U_USE_FALLBACK(cnv)) {
  ------------------
  |  |  271|      0|#define UCNV_TO_U_USE_FALLBACK(cnv) true
  |  |  ------------------
  |  |  |  Branch (271:37): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2325|       |                /* output BMP code point */
 2326|      0|                *target++ = static_cast<char16_t>(MBCS_ENTRY_FINAL_VALUE_16(entry));
  ------------------
  |  |  294|      0|#define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
  ------------------
 2327|      0|                --targetCapacity;
 2328|      0|                continue;
 2329|      0|            }
 2330|  1.26M|        } else if(action==MBCS_STATE_UNASSIGNED) {
  ------------------
  |  Branch (2330:19): [True: 1.26M, False: 0]
  ------------------
 2331|       |            /* just fall through */
 2332|  1.26M|        } else if(action==MBCS_STATE_ILLEGAL) {
  ------------------
  |  Branch (2332:19): [True: 0, False: 0]
  ------------------
 2333|       |            /* callback(illegal) */
 2334|      0|            *pErrorCode=U_ILLEGAL_CHAR_FOUND;
 2335|      0|        } else {
 2336|       |            /* reserved, must never occur */
 2337|      0|            continue;
 2338|      0|        }
 2339|       |
 2340|       |        /* set offsets since the start or the last extension */
 2341|  1.26M|        if(offsets!=nullptr) {
  ------------------
  |  Branch (2341:12): [True: 0, False: 1.26M]
  ------------------
 2342|      0|            int32_t count = static_cast<int32_t>(source - lastSource);
 2343|       |
 2344|       |            /* predecrement: do not set the offset for the callback-causing character */
 2345|      0|            while(--count>0) {
  ------------------
  |  Branch (2345:19): [True: 0, False: 0]
  ------------------
 2346|      0|                *offsets++=sourceIndex++;
 2347|      0|            }
 2348|       |            /* offset and sourceIndex are now set for the current character */
 2349|      0|        }
 2350|       |
 2351|  1.26M|        if(U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (2351:12): [True: 0, False: 1.26M]
  ------------------
 2352|       |            /* callback(illegal) */
 2353|      0|            break;
 2354|  1.26M|        } else /* unassigned sequences indicated with byteIndex>0 */ {
 2355|       |            /* try an extension mapping */
 2356|  1.26M|            lastSource=source;
 2357|  1.26M|            cnv->toUBytes[0]=*(source-1);
 2358|  1.26M|            cnv->toULength=_extToU(cnv, cnv->sharedData,
 2359|  1.26M|                                    1, &source, sourceLimit,
 2360|  1.26M|                                    &target, pArgs->targetLimit,
 2361|  1.26M|                                    &offsets, sourceIndex,
 2362|  1.26M|                                    pArgs->flush,
 2363|  1.26M|                                    pErrorCode);
 2364|  1.26M|            sourceIndex += 1 + static_cast<int32_t>(source - lastSource);
 2365|       |
 2366|  1.26M|            if(U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (2366:16): [True: 1.26M, False: 0]
  ------------------
 2367|       |                /* not mappable or buffer overflow */
 2368|  1.26M|                break;
 2369|  1.26M|            }
 2370|       |
 2371|       |            /* recalculate the targetCapacity after an extension mapping */
 2372|      0|            targetCapacity = static_cast<int32_t>(pArgs->targetLimit - target);
 2373|      0|            length = static_cast<int32_t>(sourceLimit - source);
 2374|      0|            if(length<targetCapacity) {
  ------------------
  |  Branch (2374:16): [True: 0, False: 0]
  ------------------
 2375|      0|                targetCapacity=length;
 2376|      0|            }
 2377|      0|        }
 2378|       |
 2379|      0|#if MBCS_UNROLL_SINGLE_TO_BMP
 2380|       |        /* unrolling makes it faster on Pentium III/Windows 2000 */
 2381|      0|        goto unrolled;
 2382|  1.26M|#endif
 2383|  1.26M|    }
 2384|       |
 2385|  1.26M|    if(U_SUCCESS(*pErrorCode) && source<sourceLimit && target>=pArgs->targetLimit) {
  ------------------
  |  Branch (2385:8): [True: 125, False: 1.26M]
  |  Branch (2385:34): [True: 0, False: 125]
  |  Branch (2385:56): [True: 0, False: 0]
  ------------------
 2386|       |        /* target is full */
 2387|      0|        *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
 2388|      0|    }
 2389|       |
 2390|       |    /* set offsets since the start or the last callback */
 2391|  1.26M|    if(offsets!=nullptr) {
  ------------------
  |  Branch (2391:8): [True: 0, False: 1.26M]
  ------------------
 2392|      0|        size_t count=source-lastSource;
 2393|      0|        while(count>0) {
  ------------------
  |  Branch (2393:15): [True: 0, False: 0]
  ------------------
 2394|      0|            *offsets++=sourceIndex++;
 2395|      0|            --count;
 2396|      0|        }
 2397|      0|    }
 2398|       |
 2399|       |    /* write back the updated pointers */
 2400|  1.26M|    pArgs->source = reinterpret_cast<const char*>(source);
 2401|  1.26M|    pArgs->target=target;
 2402|  1.26M|    pArgs->offsets=offsets;
 2403|  1.26M|}
ucnvmbcs.cpp:_ZL20ucnv_MBCSGetFallbackP19UConverterMBCSTablej:
 2004|  27.1k|ucnv_MBCSGetFallback(UConverterMBCSTable *mbcsTable, uint32_t offset) {
 2005|  27.1k|    const _MBCSToUFallback *toUFallbacks;
 2006|  27.1k|    uint32_t i, start, limit;
 2007|       |
 2008|  27.1k|    limit=mbcsTable->countToUFallbacks;
 2009|  27.1k|    if(limit>0) {
  ------------------
  |  Branch (2009:8): [True: 3.24k, False: 23.9k]
  ------------------
 2010|       |        /* do a binary search for the fallback mapping */
 2011|  3.24k|        toUFallbacks=mbcsTable->toUFallbacks;
 2012|  3.24k|        start=0;
 2013|  17.1k|        while(start<limit-1) {
  ------------------
  |  Branch (2013:15): [True: 13.8k, False: 3.24k]
  ------------------
 2014|  13.8k|            i=(start+limit)/2;
 2015|  13.8k|            if(offset<toUFallbacks[i].offset) {
  ------------------
  |  Branch (2015:16): [True: 10.1k, False: 3.68k]
  ------------------
 2016|  10.1k|                limit=i;
 2017|  10.1k|            } else {
 2018|  3.68k|                start=i;
 2019|  3.68k|            }
 2020|  13.8k|        }
 2021|       |
 2022|       |        /* did we really find it? */
 2023|  3.24k|        if(offset==toUFallbacks[start].offset) {
  ------------------
  |  Branch (2023:12): [True: 435, False: 2.81k]
  ------------------
 2024|    435|            return toUFallbacks[start].codePoint;
 2025|    435|        }
 2026|  3.24k|    }
 2027|       |
 2028|  26.7k|    return 0xfffe;
 2029|  27.1k|}
ucnvmbcs.cpp:_ZL14isSingleOrLeadPA256_Kihah:
 2449|   253k|isSingleOrLead(const int32_t (*stateTable)[256], uint8_t state, UBool isDBCSOnly, uint8_t b) {
 2450|   253k|    const int32_t *row=stateTable[state];
 2451|   253k|    int32_t entry=row[b];
 2452|   253k|    if(MBCS_ENTRY_IS_TRANSITION(entry)) {   /* lead byte */
  ------------------
  |  |  284|   253k|#define MBCS_ENTRY_IS_TRANSITION(entry) ((entry)>=0)
  |  |  ------------------
  |  |  |  Branch (284:41): [True: 0, False: 253k]
  |  |  ------------------
  ------------------
 2453|      0|        return hasValidTrailBytes(stateTable, static_cast<uint8_t>(MBCS_ENTRY_TRANSITION_STATE(entry)));
  ------------------
  |  |  287|      0|#define MBCS_ENTRY_TRANSITION_STATE(entry) (((uint32_t)entry)>>24)
  ------------------
 2454|   253k|    } else {
 2455|   253k|        uint8_t action = static_cast<uint8_t>(MBCS_ENTRY_FINAL_ACTION(entry));
  ------------------
  |  |  292|   253k|#define MBCS_ENTRY_FINAL_ACTION(entry) ((((uint32_t)entry)>>20)&0xf)
  ------------------
 2456|   253k|        if(action==MBCS_STATE_CHANGE_ONLY && isDBCSOnly) {
  ------------------
  |  Branch (2456:12): [True: 0, False: 253k]
  |  Branch (2456:46): [True: 0, False: 0]
  ------------------
 2457|      0|            return false;   /* SI/SO are illegal for DBCS-only conversion */
 2458|   253k|        } else {
 2459|   253k|            return action!=MBCS_STATE_ILLEGAL;
 2460|   253k|        }
 2461|   253k|    }
 2462|   253k|}
ucnvmbcs.cpp:_ZL7_extToUP10UConverterPK20UConverterSharedDataaPPKhS5_PPDsPKDsPPiiaP10UErrorCode:
 1178|  1.26M|        UErrorCode *pErrorCode) {
 1179|  1.26M|    const int32_t *cx;
 1180|       |
 1181|  1.26M|    if( (cx=sharedData->mbcs.extIndexes)!=nullptr &&
  ------------------
  |  Branch (1181:9): [True: 7.06k, False: 1.26M]
  ------------------
 1182|  1.26M|        ucnv_extInitialMatchToU(
  ------------------
  |  |  656|  7.06k|#define ucnv_extInitialMatchToU U_ICU_ENTRY_POINT_RENAME(ucnv_extInitialMatchToU)
  |  |  ------------------
  |  |  |  |  123|  7.06k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  7.06k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  7.06k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1182:9): [True: 592, False: 6.47k]
  ------------------
 1183|  7.06k|            cnv, cx,
 1184|  7.06k|            length, reinterpret_cast<const char**>(source), reinterpret_cast<const char*>(sourceLimit),
 1185|  7.06k|            target, targetLimit,
 1186|  7.06k|            offsets, sourceIndex,
 1187|  7.06k|            flush,
 1188|  7.06k|            pErrorCode)
 1189|  1.26M|    ) {
 1190|    592|        return 0; /* an extension mapping handled the input */
 1191|    592|    }
 1192|       |
 1193|       |    /* GB 18030 */
 1194|  1.26M|    if(length==4 && (cnv->options&_MBCS_OPTION_GB18030)!=0) {
  ------------------
  |  |  559|  6.47k|#define _MBCS_OPTION_GB18030 0x8000
  ------------------
  |  Branch (1194:8): [True: 6.47k, False: 1.26M]
  |  Branch (1194:21): [True: 6.47k, False: 0]
  ------------------
 1195|  6.47k|        const uint32_t *range;
 1196|  6.47k|        uint32_t linear;
 1197|  6.47k|        int32_t i;
 1198|       |
 1199|  6.47k|        linear=LINEAR_18030(cnv->toUBytes[0], cnv->toUBytes[1], cnv->toUBytes[2], cnv->toUBytes[3]);
  ------------------
  |  |  525|  6.47k|#define LINEAR_18030(a, b, c, d) ((((a)*10+(b))*126L+(c))*10L+(d))
  ------------------
 1200|  6.47k|        range=gb18030Ranges[0];
 1201|  51.5k|        for(i=0; i<UPRV_LENGTHOF(gb18030Ranges); range+=4, ++i) {
  ------------------
  |  |   99|  51.5k|#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
  ------------------
  |  Branch (1201:18): [True: 49.4k, False: 2.08k]
  ------------------
 1202|  49.4k|            if(range[2]<=linear && linear<=range[3]) {
  ------------------
  |  Branch (1202:16): [True: 40.8k, False: 8.63k]
  |  Branch (1202:36): [True: 4.38k, False: 36.4k]
  ------------------
 1203|       |                /* found the sequence, output the Unicode code point for it */
 1204|  4.38k|                *pErrorCode=U_ZERO_ERROR;
 1205|       |
 1206|       |                /* add the linear difference between the input and start sequences to the start code point */
 1207|  4.38k|                linear=range[0]+(linear-range[2]);
 1208|       |
 1209|       |                /* output this code point */
 1210|  4.38k|                ucnv_toUWriteCodePoint(cnv, linear, target, targetLimit, offsets, sourceIndex, pErrorCode);
  ------------------
  |  |  722|  4.38k|#define ucnv_toUWriteCodePoint U_ICU_ENTRY_POINT_RENAME(ucnv_toUWriteCodePoint)
  |  |  ------------------
  |  |  |  |  123|  4.38k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  4.38k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  4.38k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1211|       |
 1212|  4.38k|                return 0;
 1213|  4.38k|            }
 1214|  49.4k|        }
 1215|  6.47k|    }
 1216|       |
 1217|       |    /* no mapping */
 1218|  1.26M|    *pErrorCode=U_INVALID_CHAR_FOUND;
 1219|  1.26M|    return length;
 1220|  1.26M|}

_ZN6icu_7817UDataPathIteratorC2EPKcS2_S2_S2_aP10UErrorCode:
  451|      1|{
  452|       |#ifdef UDATA_DEBUG
  453|       |        fprintf(stderr, "SUFFIX1=%s PATH=%s\n", inSuffix, inPath);
  454|       |#endif
  455|       |    /** Path **/
  456|      1|    if(inPath == nullptr) {
  ------------------
  |  Branch (456:8): [True: 0, False: 1]
  ------------------
  457|      0|        path = u_getDataDirectory();
  ------------------
  |  |  271|      0|#define u_getDataDirectory U_ICU_ENTRY_POINT_RENAME(u_getDataDirectory)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  458|      1|    } else {
  459|      1|        path = inPath;
  460|      1|    }
  461|       |
  462|       |    /** Package **/
  463|      1|    if(pkg != nullptr) {
  ------------------
  |  Branch (463:8): [True: 1, False: 0]
  ------------------
  464|      1|      packageStub.append(U_FILE_SEP_CHAR, *pErrorCode).append(pkg, *pErrorCode);
  ------------------
  |  |  130|      1|#   define U_FILE_SEP_CHAR '/'
  ------------------
  465|       |#ifdef UDATA_DEBUG
  466|       |      fprintf(stderr, "STUB=%s [%d]\n", packageStub.data(), packageStub.length());
  467|       |#endif
  468|      1|    }
  469|       |
  470|       |    /** Item **/
  471|      1|    basename = findBasename(item);
  472|      1|    basenameLen = static_cast<int32_t>(uprv_strlen(basename));
  ------------------
  |  |   37|      1|#define uprv_strlen(str) U_STANDARD_CPP_NAMESPACE strlen(str)
  |  |  ------------------
  |  |  |  |  393|      1|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  473|       |
  474|       |    /** Item path **/
  475|      1|    if(basename == item) {
  ------------------
  |  Branch (475:8): [True: 1, False: 0]
  ------------------
  476|      1|        nextPath = path;
  477|      1|    } else {
  478|      0|        itemPath.append(item, static_cast<int32_t>(basename - item), *pErrorCode);
  479|      0|        nextPath = itemPath.data();
  480|      0|    }
  481|       |#ifdef UDATA_DEBUG
  482|       |    fprintf(stderr, "SUFFIX=%s [%p]\n", inSuffix, (void*) inSuffix);
  483|       |#endif
  484|       |
  485|       |    /** Suffix  **/
  486|      1|    if(inSuffix != nullptr) {
  ------------------
  |  Branch (486:8): [True: 1, False: 0]
  ------------------
  487|      1|        suffix = inSuffix;
  488|      1|    } else {
  489|      0|        suffix = "";
  490|      0|    }
  491|       |
  492|      1|    checkLastFour = doCheckLastFour;
  493|       |
  494|       |    /* pathBuffer will hold the output path strings returned by this iterator */
  495|       |
  496|       |#ifdef UDATA_DEBUG
  497|       |    fprintf(stderr, "0: init %s -> [path=%s], [base=%s], [suff=%s], [itempath=%s], [nextpath=%s], [checklast4=%s]\n",
  498|       |            item,
  499|       |            path,
  500|       |            basename,
  501|       |            suffix.data(),
  502|       |            itemPath.data(),
  503|       |            nextPath,
  504|       |            checkLastFour?"true":"false");
  505|       |#endif
  506|      1|}
_ZN6icu_7817UDataPathIterator4nextEP10UErrorCode:
  516|      1|{
  517|      1|    if(U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (517:8): [True: 0, False: 1]
  ------------------
  518|      0|        return nullptr;
  519|      0|    }
  520|       |
  521|      1|    const char *currentPath = nullptr;
  522|      1|    int32_t     pathLen = 0;
  523|      1|    const char *pathBasename;
  524|       |
  525|      1|    do
  526|      2|    {
  527|      2|        if( nextPath == nullptr ) {
  ------------------
  |  Branch (527:13): [True: 1, False: 1]
  ------------------
  528|      1|            break;
  529|      1|        }
  530|      1|        currentPath = nextPath;
  531|       |
  532|      1|        if(nextPath == itemPath.data()) { /* we were processing item's path. */
  ------------------
  |  Branch (532:12): [True: 0, False: 1]
  ------------------
  533|      0|            nextPath = path; /* start with regular path next tm. */
  534|      0|            pathLen = static_cast<int32_t>(uprv_strlen(currentPath));
  ------------------
  |  |   37|      0|#define uprv_strlen(str) U_STANDARD_CPP_NAMESPACE strlen(str)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  535|      1|        } else {
  536|       |            /* fix up next for next time */
  537|      1|            nextPath = uprv_strchr(currentPath, U_PATH_SEP_CHAR);
  ------------------
  |  |   40|      1|#define uprv_strchr(s, c) U_STANDARD_CPP_NAMESPACE strchr(s, c)
  |  |  ------------------
  |  |  |  |  393|      1|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  538|      1|            if(nextPath == nullptr) {
  ------------------
  |  Branch (538:16): [True: 1, False: 0]
  ------------------
  539|       |                /* segment: entire path */
  540|      1|                pathLen = static_cast<int32_t>(uprv_strlen(currentPath));
  ------------------
  |  |   37|      1|#define uprv_strlen(str) U_STANDARD_CPP_NAMESPACE strlen(str)
  |  |  ------------------
  |  |  |  |  393|      1|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  541|      1|            } else {
  542|       |                /* segment: until next segment */
  543|      0|                pathLen = static_cast<int32_t>(nextPath - currentPath);
  544|       |                /* skip divider */
  545|      0|                nextPath ++;
  546|      0|            }
  547|      1|        }
  548|       |
  549|      1|        if(pathLen == 0) {
  ------------------
  |  Branch (549:12): [True: 1, False: 0]
  ------------------
  550|      1|            continue;
  551|      1|        }
  552|       |
  553|       |#ifdef UDATA_DEBUG
  554|       |        fprintf(stderr, "rest of path (IDD) = %s\n", currentPath);
  555|       |        fprintf(stderr, "                     ");
  556|       |        { 
  557|       |            int32_t qqq;
  558|       |            for(qqq=0;qqq<pathLen;qqq++)
  559|       |            {
  560|       |                fprintf(stderr, " ");
  561|       |            }
  562|       |
  563|       |            fprintf(stderr, "^\n");
  564|       |        }
  565|       |#endif
  566|      0|        pathBuffer.clear().append(currentPath, pathLen, *pErrorCode);
  567|       |
  568|       |        /* check for .dat files */
  569|      0|        pathBasename = findBasename(pathBuffer.data());
  570|       |
  571|      0|        if(checkLastFour && 
  ------------------
  |  Branch (571:12): [True: 0, False: 0]
  ------------------
  572|      0|           (pathLen>=4) &&
  ------------------
  |  Branch (572:12): [True: 0, False: 0]
  ------------------
  573|      0|           uprv_strncmp(pathBuffer.data() +(pathLen-4), suffix.data(), 4)==0 && /* suffix matches */
  ------------------
  |  |   44|      0|#define uprv_strncmp(s1, s2, n) U_STANDARD_CPP_NAMESPACE strncmp(s1, s2, n)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (573:12): [True: 0, False: 0]
  ------------------
  574|      0|           uprv_strncmp(findBasename(pathBuffer.data()), basename, basenameLen)==0  && /* base matches */
  ------------------
  |  |   44|      0|#define uprv_strncmp(s1, s2, n) U_STANDARD_CPP_NAMESPACE strncmp(s1, s2, n)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (574:12): [True: 0, False: 0]
  ------------------
  575|      0|           uprv_strlen(pathBasename)==(basenameLen+4)) { /* base+suffix = full len */
  ------------------
  |  |   37|      0|#define uprv_strlen(str) U_STANDARD_CPP_NAMESPACE strlen(str)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (575:12): [True: 0, False: 0]
  ------------------
  576|       |
  577|       |#ifdef UDATA_DEBUG
  578|       |            fprintf(stderr, "Have %s file on the path: %s\n", suffix.data(), pathBuffer.data());
  579|       |#endif
  580|       |            /* do nothing */
  581|      0|        }
  582|      0|        else 
  583|      0|        {       /* regular dir path */
  584|      0|            if(pathBuffer[pathLen-1] != U_FILE_SEP_CHAR) {
  ------------------
  |  |  130|      0|#   define U_FILE_SEP_CHAR '/'
  ------------------
  |  Branch (584:16): [True: 0, False: 0]
  ------------------
  585|      0|                if((pathLen>=4) &&
  ------------------
  |  Branch (585:20): [True: 0, False: 0]
  ------------------
  586|      0|                   uprv_strncmp(pathBuffer.data()+(pathLen-4), ".dat", 4) == 0)
  ------------------
  |  |   44|      0|#define uprv_strncmp(s1, s2, n) U_STANDARD_CPP_NAMESPACE strncmp(s1, s2, n)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (586:20): [True: 0, False: 0]
  ------------------
  587|      0|                {
  588|       |#ifdef UDATA_DEBUG
  589|       |                    fprintf(stderr, "skipping non-directory .dat file %s\n", pathBuffer.data());
  590|       |#endif
  591|      0|                    continue;
  592|      0|                }
  593|       |
  594|       |                /* Check if it is a directory with the same name as our package */
  595|      0|                if(!packageStub.isEmpty() &&
  ------------------
  |  Branch (595:20): [True: 0, False: 0]
  ------------------
  596|      0|                   (pathLen > packageStub.length()) &&
  ------------------
  |  Branch (596:20): [True: 0, False: 0]
  ------------------
  597|      0|                   !uprv_strcmp(pathBuffer.data() + pathLen - packageStub.length(), packageStub.data())) {
  ------------------
  |  |   38|      0|#define uprv_strcmp(s1, s2) U_STANDARD_CPP_NAMESPACE strcmp(s1, s2)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (597:20): [True: 0, False: 0]
  ------------------
  598|       |#ifdef UDATA_DEBUG
  599|       |                  fprintf(stderr, "Found stub %s (will add package %s of len %d)\n", packageStub.data(), basename, basenameLen);
  600|       |#endif
  601|      0|                  pathBuffer.truncate(pathLen - packageStub.length());
  602|      0|                }
  603|      0|                pathBuffer.append(U_FILE_SEP_CHAR, *pErrorCode);
  ------------------
  |  |  130|      0|#   define U_FILE_SEP_CHAR '/'
  ------------------
  604|      0|            }
  605|       |
  606|       |            /* + basename */
  607|      0|            pathBuffer.append(packageStub.data()+1, packageStub.length()-1, *pErrorCode);
  608|       |
  609|      0|            if (!suffix.empty())  /* tack on suffix */
  ------------------
  |  Branch (609:17): [True: 0, False: 0]
  ------------------
  610|      0|            {
  611|      0|                if (suffix.length() > 4) {
  ------------------
  |  Branch (611:21): [True: 0, False: 0]
  ------------------
  612|       |                    // If the suffix is actually an item ("ibm-5348_P100-1997.cnv") and not an extension (".res")
  613|       |                    // then we need to ensure that the path ends with a separator.
  614|      0|                    pathBuffer.ensureEndsWithFileSeparator(*pErrorCode);
  615|      0|                }
  616|      0|                pathBuffer.append(suffix, *pErrorCode);
  617|      0|            }
  618|      0|        }
  619|       |
  620|       |#ifdef UDATA_DEBUG
  621|       |        fprintf(stderr, " -->  %s\n", pathBuffer.data());
  622|       |#endif
  623|       |
  624|      0|        return pathBuffer.data();
  625|       |
  626|      1|    } while(path);
  ------------------
  |  Branch (626:13): [True: 1, False: 0]
  ------------------
  627|       |
  628|       |    /* fell way off the end */
  629|      1|    return nullptr;
  630|      1|}
udata_openChoice_78:
 1406|     30|                 UErrorCode *pErrorCode) {
 1407|       |#ifdef UDATA_DEBUG
 1408|       |  fprintf(stderr, "udata_openChoice(): Opening: %s : %s . %s\n", (path?path:"nullptr"), name, type);
 1409|       |#endif
 1410|       |
 1411|     30|    if(pErrorCode==nullptr || U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (1411:8): [True: 0, False: 30]
  |  Branch (1411:31): [True: 0, False: 30]
  ------------------
 1412|      0|        return nullptr;
 1413|     30|    } else if(name==nullptr || *name==0 || isAcceptable==nullptr) {
  ------------------
  |  Branch (1413:15): [True: 0, False: 30]
  |  Branch (1413:32): [True: 0, False: 30]
  |  Branch (1413:44): [True: 0, False: 30]
  ------------------
 1414|      0|        *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
 1415|      0|        return nullptr;
 1416|     30|    } else {
 1417|     30|        return doOpenChoice(path, type, name, isAcceptable, context, pErrorCode);
 1418|     30|    }
 1419|     30|}
udata_getInfo_78:
 1424|      8|udata_getInfo(UDataMemory *pData, UDataInfo *pInfo) {
 1425|      8|    if(pInfo!=nullptr) {
  ------------------
  |  Branch (1425:8): [True: 8, False: 0]
  ------------------
 1426|      8|        if(pData!=nullptr && pData->pHeader!=nullptr) {
  ------------------
  |  Branch (1426:12): [True: 8, False: 0]
  |  Branch (1426:30): [True: 8, False: 0]
  ------------------
 1427|      8|            const UDataInfo *info=&pData->pHeader->info;
 1428|      8|            uint16_t dataInfoSize=udata_getInfoSize(info);
  ------------------
  |  |  889|      8|#define udata_getInfoSize U_ICU_ENTRY_POINT_RENAME(udata_getInfoSize)
  |  |  ------------------
  |  |  |  |  123|      8|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      8|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      8|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1429|      8|            if(pInfo->size>dataInfoSize) {
  ------------------
  |  Branch (1429:16): [True: 0, False: 8]
  ------------------
 1430|      0|                pInfo->size=dataInfoSize;
 1431|      0|            }
 1432|      8|            uprv_memcpy((uint16_t *)pInfo+1, (const uint16_t *)info+1, pInfo->size-2);
  ------------------
  |  |   42|      8|#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|      8|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  |   43|      8|    /* Suppress warnings about addresses that will never be NULL */ \
  |  |   44|      8|    _Pragma("clang diagnostic push") \
  |  |   45|      8|    _Pragma("clang diagnostic ignored \"-Waddress\"") \
  |  |   46|      8|    U_ASSERT(dst != NULL); \
  |  |  ------------------
  |  |  |  |   35|      8|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   47|      8|    U_ASSERT(src != NULL); \
  |  |  ------------------
  |  |  |  |   35|      8|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   48|      8|    _Pragma("clang diagnostic pop") \
  |  |   49|      8|    U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
  |  |  ------------------
  |  |  |  |  393|      8|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  |  |   50|      8|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|      8|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1433|      8|            if(info->isBigEndian!=U_IS_BIG_ENDIAN) {
  ------------------
  |  |  353|      8|#   define U_IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  ------------------
  |  Branch (1433:16): [True: 0, False: 8]
  ------------------
 1434|       |                /* opposite endianness */
 1435|      0|                uint16_t x=info->reservedWord;
 1436|      0|                pInfo->reservedWord=(uint16_t)((x<<8)|(x>>8));
 1437|      0|            }
 1438|      8|        } else {
 1439|      0|            pInfo->size=0;
 1440|      0|        }
 1441|      8|    }
 1442|      8|}
udata.cpp:_ZL12findBasenamePKc:
  225|     21|findBasename(const char *path) {
  226|     21|    const char *basename=uprv_strrchr(path, U_FILE_SEP_CHAR);
  ------------------
  |  |   42|     21|#define uprv_strrchr(s, c) U_STANDARD_CPP_NAMESPACE strrchr(s, c)
  |  |  ------------------
  |  |  |  |  393|     21|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  227|     21|    if(basename==nullptr) {
  ------------------
  |  Branch (227:8): [True: 21, False: 0]
  ------------------
  228|     21|        return path;
  229|     21|    } else {
  230|      0|        return basename+1;
  231|      0|    }
  232|     21|}
udata.cpp:_ZL16setCommonICUDataP11UDataMemoryaP10UErrorCode:
  174|      1|{
  175|      1|    UDataMemory  *newCommonData = UDataMemory_createNewInstance(pErr);
  ------------------
  |  |   79|      1|#define UDataMemory_createNewInstance U_ICU_ENTRY_POINT_RENAME(UDataMemory_createNewInstance)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  176|      1|    int32_t i;
  177|      1|    UBool didUpdate = false;
  178|      1|    if (U_FAILURE(*pErr)) {
  ------------------
  |  Branch (178:9): [True: 0, False: 1]
  ------------------
  179|      0|        return false;
  180|      0|    }
  181|       |
  182|       |    /*  For the assignment, other threads must cleanly see either the old            */
  183|       |    /*    or the new, not some partially initialized new.  The old can not be        */
  184|       |    /*    deleted - someone may still have a pointer to it lying around in           */
  185|       |    /*    their locals.                                                              */
  186|      1|    UDatamemory_assign(newCommonData, pData);
  ------------------
  |  |   84|      1|#define UDatamemory_assign U_ICU_ENTRY_POINT_RENAME(UDatamemory_assign)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  187|      1|    umtx_lock(nullptr);
  ------------------
  |  | 1250|      1|#define umtx_lock U_ICU_ENTRY_POINT_RENAME(umtx_lock)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  188|      1|    for (i = 0; i < UPRV_LENGTHOF(gCommonICUDataArray); ++i) {
  ------------------
  |  |   99|      1|#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
  ------------------
  |  Branch (188:17): [True: 1, False: 0]
  ------------------
  189|      1|        if (gCommonICUDataArray[i] == nullptr) {
  ------------------
  |  Branch (189:13): [True: 1, False: 0]
  ------------------
  190|      1|            gCommonICUDataArray[i] = newCommonData;
  191|      1|            didUpdate = true;
  192|      1|            break;
  193|      1|        } else if (gCommonICUDataArray[i]->pHeader == pData->pHeader) {
  ------------------
  |  Branch (193:20): [True: 0, False: 0]
  ------------------
  194|       |            /* The same data pointer is already in the array. */
  195|      0|            break;
  196|      0|        }
  197|      1|    }
  198|      1|    umtx_unlock(nullptr);
  ------------------
  |  | 1251|      1|#define umtx_unlock U_ICU_ENTRY_POINT_RENAME(umtx_unlock)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  199|       |
  200|      1|    if (i == UPRV_LENGTHOF(gCommonICUDataArray) && warn) {
  ------------------
  |  |   99|      2|#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
  ------------------
  |  Branch (200:9): [True: 0, False: 1]
  |  Branch (200:52): [True: 0, False: 0]
  ------------------
  201|      0|        *pErr = U_USING_DEFAULT_WARNING;
  202|      0|    }
  203|      1|    if (didUpdate) {
  ------------------
  |  Branch (203:9): [True: 1, False: 0]
  ------------------
  204|      1|        ucln_common_registerCleanup(UCLN_COMMON_UDATA, udata_cleanup);
  ------------------
  |  |  617|      1|#define ucln_common_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_common_registerCleanup)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|      1|    } else {
  206|      0|        uprv_free(newCommonData);
  ------------------
  |  | 1503|      0|#define uprv_free U_ICU_ENTRY_POINT_RENAME(uprv_free)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  207|      0|    }
  208|      1|    return didUpdate;
  209|      1|}
udata.cpp:_ZL18udata_getHashTableR10UErrorCode:
  298|     20|static UHashtable *udata_getHashTable(UErrorCode &err) {
  299|     20|    umtx_initOnce(gCommonDataCacheInitOnce, &udata_initHashTable, err);
  300|     20|    return gCommonDataCache;
  301|     20|}
udata.cpp:_ZL19udata_initHashTableR10UErrorCode:
  283|      1|static void U_CALLCONV udata_initHashTable(UErrorCode &err) {
  284|      1|    U_ASSERT(gCommonDataCache == nullptr);
  ------------------
  |  |   35|      1|#   define U_ASSERT(exp) (void)0
  ------------------
  285|      1|    gCommonDataCache = uhash_open(uhash_hashChars, uhash_compareChars, nullptr, &err);
  ------------------
  |  | 1030|      1|#define uhash_open U_ICU_ENTRY_POINT_RENAME(uhash_open)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  gCommonDataCache = uhash_open(uhash_hashChars, uhash_compareChars, nullptr, &err);
  ------------------
  |  | 1011|      1|#define uhash_hashChars U_ICU_ENTRY_POINT_RENAME(uhash_hashChars)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  gCommonDataCache = uhash_open(uhash_hashChars, uhash_compareChars, nullptr, &err);
  ------------------
  |  |  993|      1|#define uhash_compareChars U_ICU_ENTRY_POINT_RENAME(uhash_compareChars)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  286|      1|    if (U_FAILURE(err)) {
  ------------------
  |  Branch (286:9): [True: 0, False: 1]
  ------------------
  287|      0|       return;
  288|      0|    }
  289|      1|    U_ASSERT(gCommonDataCache != nullptr);
  ------------------
  |  |   35|      1|#   define U_ASSERT(exp) (void)0
  ------------------
  290|      1|    uhash_setValueDeleter(gCommonDataCache, DataCacheElement_deleter);
  ------------------
  |  | 1044|      1|#define uhash_setValueDeleter U_ICU_ENTRY_POINT_RENAME(uhash_setValueDeleter)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  291|      1|    ucln_common_registerCleanup(UCLN_COMMON_UDATA, udata_cleanup);
  ------------------
  |  |  617|      1|#define ucln_common_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_common_registerCleanup)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  292|      1|}
udata.cpp:_ZL12doOpenChoicePKcS0_S0_PFaPvS0_S0_PK9UDataInfoES1_P10UErrorCode:
 1151|     30|{
 1152|     30|    UDataMemory         *retVal = nullptr;
 1153|       |
 1154|     30|    const char         *dataPath;
 1155|       |
 1156|     30|    int32_t             tocEntrySuffixIndex;
 1157|     30|    const char         *tocEntryPathSuffix;
 1158|     30|    UErrorCode          subErrorCode=U_ZERO_ERROR;
 1159|     30|    const char         *treeChar;
 1160|       |
 1161|     30|    UBool               isICUData = false;
 1162|       |
 1163|       |
 1164|     30|    FileTracer::traceOpen(path, type, name);
 1165|       |
 1166|       |
 1167|       |    /* Is this path ICU data? */
 1168|     30|    if(path == nullptr ||
  ------------------
  |  Branch (1168:8): [True: 30, False: 0]
  ------------------
 1169|     30|       !strcmp(path, U_ICUDATA_ALIAS) ||  /* "ICUDATA" */
  ------------------
  |  |   74|      0|#define U_ICUDATA_ALIAS "ICUDATA"
  ------------------
  |  Branch (1169:8): [True: 0, False: 0]
  ------------------
 1170|     30|       !uprv_strncmp(path, U_ICUDATA_NAME U_TREE_SEPARATOR_STRING, /* "icudt26e-" */
  ------------------
  |  |   44|      0|#define uprv_strncmp(s1, s2, n) U_STANDARD_CPP_NAMESPACE strncmp(s1, s2, n)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (1170:8): [True: 0, False: 0]
  ------------------
 1171|     30|                     uprv_strlen(U_ICUDATA_NAME U_TREE_SEPARATOR_STRING)) ||  
 1172|     30|       !uprv_strncmp(path, U_ICUDATA_ALIAS U_TREE_SEPARATOR_STRING, /* "ICUDATA-" */
  ------------------
  |  |   44|      0|#define uprv_strncmp(s1, s2, n) U_STANDARD_CPP_NAMESPACE strncmp(s1, s2, n)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (1172:8): [True: 0, False: 0]
  ------------------
 1173|     30|                     uprv_strlen(U_ICUDATA_ALIAS U_TREE_SEPARATOR_STRING))) {
 1174|     30|      isICUData = true;
 1175|     30|    }
 1176|       |
 1177|       |#if (U_FILE_SEP_CHAR != U_FILE_ALT_SEP_CHAR)  /* Windows:  try "foo\bar" and "foo/bar" */
 1178|       |    /* remap from alternate path char to the main one */
 1179|       |    CharString altSepPath;
 1180|       |    if(path) {
 1181|       |        if(uprv_strchr(path,U_FILE_ALT_SEP_CHAR) != nullptr) {
 1182|       |            altSepPath.append(path, *pErrorCode);
 1183|       |            char *p;
 1184|       |            while ((p = uprv_strchr(altSepPath.data(), U_FILE_ALT_SEP_CHAR)) != nullptr) {
 1185|       |                *p = U_FILE_SEP_CHAR;
 1186|       |            }
 1187|       |#if defined (UDATA_DEBUG)
 1188|       |            fprintf(stderr, "Changed path from [%s] to [%s]\n", path, altSepPath.data());
 1189|       |#endif
 1190|       |            path = altSepPath.data();
 1191|       |        }
 1192|       |    }
 1193|       |#endif
 1194|       |
 1195|     30|    CharString tocEntryName; /* entry name in tree format. ex:  'icudt28b/coll/ar.res' */
 1196|     30|    CharString tocEntryPath; /* entry name in path format. ex:  'icudt28b\\coll\\ar.res' */
 1197|       |
 1198|     30|    CharString pkgName;
 1199|     30|    CharString treeName;
 1200|       |
 1201|       |    /* ======= Set up strings */
 1202|     30|    if(path==nullptr) {
  ------------------
  |  Branch (1202:8): [True: 30, False: 0]
  ------------------
 1203|     30|        pkgName.append(U_ICUDATA_NAME, *pErrorCode);
  ------------------
  |  |  154|     30|#define U_ICUDATA_NAME    "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER
  |  |  ------------------
  |  |  |  |  144|     30|#     define U_ICUDATA_TYPE_LETTER "l"
  |  |  ------------------
  ------------------
 1204|     30|    } else {
 1205|      0|        const char *pkg;
 1206|      0|        const char *first;
 1207|      0|        pkg = uprv_strrchr(path, U_FILE_SEP_CHAR);
  ------------------
  |  |   42|      0|#define uprv_strrchr(s, c) U_STANDARD_CPP_NAMESPACE strrchr(s, c)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
 1208|      0|        first = uprv_strchr(path, U_FILE_SEP_CHAR);
  ------------------
  |  |   40|      0|#define uprv_strchr(s, c) U_STANDARD_CPP_NAMESPACE strchr(s, c)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
 1209|      0|        if(uprv_pathIsAbsolute(path) || (pkg != first)) { /* more than one slash in the path- not a tree name */
  ------------------
  |  | 1533|      0|#define uprv_pathIsAbsolute U_ICU_ENTRY_POINT_RENAME(uprv_pathIsAbsolute)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1209:12): [True: 0, False: 0]
  |  Branch (1209:41): [True: 0, False: 0]
  ------------------
 1210|       |            /* see if this is an /absolute/path/to/package  path */
 1211|      0|            if(pkg) {
  ------------------
  |  Branch (1211:16): [True: 0, False: 0]
  ------------------
 1212|      0|                pkgName.append(pkg+1, *pErrorCode);
 1213|      0|            } else {
 1214|      0|                pkgName.append(path, *pErrorCode);
 1215|      0|            }
 1216|      0|        } else {
 1217|      0|            treeChar = uprv_strchr(path, U_TREE_SEPARATOR);
  ------------------
  |  |   40|      0|#define uprv_strchr(s, c) U_STANDARD_CPP_NAMESPACE strchr(s, c)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
 1218|      0|            if(treeChar) { 
  ------------------
  |  Branch (1218:16): [True: 0, False: 0]
  ------------------
 1219|      0|                treeName.append(treeChar+1, *pErrorCode); /* following '-' */
 1220|      0|                if(isICUData) {
  ------------------
  |  Branch (1220:20): [True: 0, False: 0]
  ------------------
 1221|      0|                    pkgName.append(U_ICUDATA_NAME, *pErrorCode);
  ------------------
  |  |  154|      0|#define U_ICUDATA_NAME    "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER
  |  |  ------------------
  |  |  |  |  144|      0|#     define U_ICUDATA_TYPE_LETTER "l"
  |  |  ------------------
  ------------------
 1222|      0|                } else {
 1223|      0|                    pkgName.append(path, static_cast<int32_t>(treeChar - path), *pErrorCode);
 1224|      0|                    if (first == nullptr) {
  ------------------
  |  Branch (1224:25): [True: 0, False: 0]
  ------------------
 1225|       |                        /*
 1226|       |                        This user data has no path, but there is a tree name.
 1227|       |                        Look up the correct path from the data cache later.
 1228|       |                        */
 1229|      0|                        path = pkgName.data();
 1230|      0|                    }
 1231|      0|                }
 1232|      0|            } else {
 1233|      0|                if(isICUData) {
  ------------------
  |  Branch (1233:20): [True: 0, False: 0]
  ------------------
 1234|      0|                    pkgName.append(U_ICUDATA_NAME, *pErrorCode);
  ------------------
  |  |  154|      0|#define U_ICUDATA_NAME    "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER
  |  |  ------------------
  |  |  |  |  144|      0|#     define U_ICUDATA_TYPE_LETTER "l"
  |  |  ------------------
  ------------------
 1235|      0|                } else {
 1236|      0|                    pkgName.append(path, *pErrorCode);
 1237|      0|                }
 1238|      0|            }
 1239|      0|        }
 1240|      0|    }
 1241|       |
 1242|       |#ifdef UDATA_DEBUG
 1243|       |    fprintf(stderr, " P=%s T=%s\n", pkgName.data(), treeName.data());
 1244|       |#endif
 1245|       |
 1246|       |    /* setting up the entry name and file name 
 1247|       |     * Make up a full name by appending the type to the supplied
 1248|       |     *  name, assuming that a type was supplied.
 1249|       |     */
 1250|       |
 1251|       |    /* prepend the package */
 1252|     30|    tocEntryName.append(pkgName, *pErrorCode);
 1253|     30|    tocEntryPath.append(pkgName, *pErrorCode);
 1254|     30|    tocEntrySuffixIndex = tocEntryName.length();
 1255|       |
 1256|     30|    if(!treeName.isEmpty()) {
  ------------------
  |  Branch (1256:8): [True: 0, False: 30]
  ------------------
 1257|      0|        tocEntryName.append(U_TREE_ENTRY_SEP_CHAR, *pErrorCode).append(treeName, *pErrorCode);
  ------------------
  |  |   62|      0|#define U_TREE_ENTRY_SEP_CHAR '/'
  ------------------
 1258|      0|        tocEntryPath.append(U_FILE_SEP_CHAR, *pErrorCode).append(treeName, *pErrorCode);
  ------------------
  |  |  130|      0|#   define U_FILE_SEP_CHAR '/'
  ------------------
 1259|      0|    }
 1260|       |
 1261|     30|    tocEntryName.append(U_TREE_ENTRY_SEP_CHAR, *pErrorCode).append(name, *pErrorCode);
  ------------------
  |  |   62|     30|#define U_TREE_ENTRY_SEP_CHAR '/'
  ------------------
 1262|     30|    tocEntryPath.append(U_FILE_SEP_CHAR, *pErrorCode).append(name, *pErrorCode);
  ------------------
  |  |  130|     30|#   define U_FILE_SEP_CHAR '/'
  ------------------
 1263|     30|    if(type!=nullptr && *type!=0) {
  ------------------
  |  Branch (1263:8): [True: 30, False: 0]
  |  Branch (1263:25): [True: 30, False: 0]
  ------------------
 1264|     30|        tocEntryName.append(".", *pErrorCode).append(type, *pErrorCode);
 1265|     30|        tocEntryPath.append(".", *pErrorCode).append(type, *pErrorCode);
 1266|     30|    }
 1267|       |    // The +1 is for the U_FILE_SEP_CHAR that is always appended above.
 1268|     30|    tocEntryPathSuffix = tocEntryPath.data() + tocEntrySuffixIndex + 1; /* suffix starts here */
 1269|       |
 1270|       |#ifdef UDATA_DEBUG
 1271|       |    fprintf(stderr, " tocEntryName = %s\n", tocEntryName.data());
 1272|       |    fprintf(stderr, " tocEntryPath = %s\n", tocEntryName.data());
 1273|       |#endif
 1274|       |
 1275|     30|#if !defined(ICU_DATA_DIR_WINDOWS)
 1276|     30|    if(path == nullptr) {
  ------------------
  |  Branch (1276:8): [True: 30, False: 0]
  ------------------
 1277|     30|        path = COMMON_DATA_NAME; /* "icudt26e" */
  ------------------
  |  |   34|     30|#define COMMON_DATA_NAME U_ICUDATA_NAME
  |  |  ------------------
  |  |  |  |  154|     30|#define U_ICUDATA_NAME    "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|     30|#     define U_ICUDATA_TYPE_LETTER "l"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1278|     30|    }
 1279|       |#else
 1280|       |    // When using the Windows system data, we expects only a single data file.
 1281|       |    path = COMMON_DATA_NAME; /* "icudt26e" */
 1282|       |#endif
 1283|       |
 1284|       |    /************************ Begin loop looking for ind. files ***************/
 1285|       |#ifdef UDATA_DEBUG
 1286|       |    fprintf(stderr, "IND: inBasename = %s, pkg=%s\n", "(n/a)", packageNameFromPath(path));
 1287|       |#endif
 1288|       |
 1289|       |    /* End of dealing with a null basename */
 1290|     30|    dataPath = u_getDataDirectory();
  ------------------
  |  |  271|     30|#define u_getDataDirectory U_ICU_ENTRY_POINT_RENAME(u_getDataDirectory)
  |  |  ------------------
  |  |  |  |  123|     30|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|     30|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|     30|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1291|       |
 1292|       |    /****    Time zone individual files override  */
 1293|     30|    if (isICUData && isTimeZoneFile(name, type)) {
  ------------------
  |  Branch (1293:9): [True: 30, False: 0]
  |  Branch (1293:22): [True: 0, False: 30]
  ------------------
 1294|      0|        const char *tzFilesDir = u_getTimeZoneFilesDirectory(pErrorCode);
  ------------------
  |  |  287|      0|#define u_getTimeZoneFilesDirectory U_ICU_ENTRY_POINT_RENAME(u_getTimeZoneFilesDirectory)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1295|      0|        if (tzFilesDir[0] != 0) {
  ------------------
  |  Branch (1295:13): [True: 0, False: 0]
  ------------------
 1296|       |#ifdef UDATA_DEBUG
 1297|       |            fprintf(stderr, "Trying Time Zone Files directory = %s\n", tzFilesDir);
 1298|       |#endif
 1299|      0|            retVal = doLoadFromIndividualFiles(/* pkgName.data() */ "", tzFilesDir, tocEntryPathSuffix,
 1300|      0|                            /* path */ "", type, name, isAcceptable, context, &subErrorCode, pErrorCode);
 1301|      0|            if((retVal != nullptr) || U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (1301:16): [True: 0, False: 0]
  |  Branch (1301:39): [True: 0, False: 0]
  ------------------
 1302|      0|                return retVal;
 1303|      0|            }
 1304|      0|        }
 1305|      0|    }
 1306|       |
 1307|       |    /****    COMMON PACKAGE  - only if packages are first. */
 1308|     30|    if(gDataFileAccess == UDATA_PACKAGES_FIRST) {
  ------------------
  |  Branch (1308:8): [True: 0, False: 30]
  ------------------
 1309|       |#ifdef UDATA_DEBUG
 1310|       |        fprintf(stderr, "Trying packages (UDATA_PACKAGES_FIRST)\n");
 1311|       |#endif
 1312|       |        /* #2 */
 1313|      0|        retVal = doLoadFromCommonData(isICUData, 
 1314|      0|                            pkgName.data(), dataPath, tocEntryPathSuffix, tocEntryName.data(),
 1315|      0|                            path, type, name, isAcceptable, context, &subErrorCode, pErrorCode);
 1316|      0|        if((retVal != nullptr) || U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (1316:12): [True: 0, False: 0]
  |  Branch (1316:35): [True: 0, False: 0]
  ------------------
 1317|      0|            return retVal;
 1318|      0|        }
 1319|      0|    }
 1320|       |
 1321|       |    /****    INDIVIDUAL FILES  */
 1322|     30|    if((gDataFileAccess==UDATA_PACKAGES_FIRST) ||
  ------------------
  |  Branch (1322:8): [True: 0, False: 30]
  ------------------
 1323|     30|       (gDataFileAccess==UDATA_FILES_FIRST)) {
  ------------------
  |  Branch (1323:8): [True: 30, False: 0]
  ------------------
 1324|       |#ifdef UDATA_DEBUG
 1325|       |        fprintf(stderr, "Trying individual files\n");
 1326|       |#endif
 1327|       |        /* Check to make sure that there is a dataPath to iterate over */
 1328|     30|        if ((dataPath && *dataPath) || !isICUData) {
  ------------------
  |  Branch (1328:14): [True: 30, False: 0]
  |  Branch (1328:26): [True: 0, False: 30]
  |  Branch (1328:40): [True: 0, False: 30]
  ------------------
 1329|      0|            retVal = doLoadFromIndividualFiles(pkgName.data(), dataPath, tocEntryPathSuffix,
 1330|      0|                            path, type, name, isAcceptable, context, &subErrorCode, pErrorCode);
 1331|      0|            if((retVal != nullptr) || U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (1331:16): [True: 0, False: 0]
  |  Branch (1331:39): [True: 0, False: 0]
  ------------------
 1332|      0|                return retVal;
 1333|      0|            }
 1334|      0|        }
 1335|     30|    }
 1336|       |
 1337|       |    /****    COMMON PACKAGE  */
 1338|     30|    if((gDataFileAccess==UDATA_ONLY_PACKAGES) || 
  ------------------
  |  Branch (1338:8): [True: 0, False: 30]
  ------------------
 1339|     30|       (gDataFileAccess==UDATA_FILES_FIRST)) {
  ------------------
  |  Branch (1339:8): [True: 30, False: 0]
  ------------------
 1340|       |#ifdef UDATA_DEBUG
 1341|       |        fprintf(stderr, "Trying packages (UDATA_ONLY_PACKAGES || UDATA_FILES_FIRST)\n");
 1342|       |#endif
 1343|     30|        retVal = doLoadFromCommonData(isICUData,
 1344|     30|                            pkgName.data(), dataPath, tocEntryPathSuffix, tocEntryName.data(),
 1345|     30|                            path, type, name, isAcceptable, context, &subErrorCode, pErrorCode);
 1346|     30|        if((retVal != nullptr) || U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (1346:12): [True: 11, False: 19]
  |  Branch (1346:35): [True: 0, False: 19]
  ------------------
 1347|     11|            return retVal;
 1348|     11|        }
 1349|     30|    }
 1350|       |    
 1351|       |    /* Load from DLL.  If we haven't attempted package load, we also haven't had any chance to
 1352|       |        try a DLL (static or setCommonData/etc)  load.
 1353|       |         If we ever have a "UDATA_ONLY_FILES", add it to the or list here.  */  
 1354|     19|    if(gDataFileAccess==UDATA_NO_FILES) {
  ------------------
  |  Branch (1354:8): [True: 0, False: 19]
  ------------------
 1355|       |#ifdef UDATA_DEBUG
 1356|       |        fprintf(stderr, "Trying common data (UDATA_NO_FILES)\n");
 1357|       |#endif
 1358|      0|        retVal = doLoadFromCommonData(isICUData,
 1359|      0|                            pkgName.data(), "", tocEntryPathSuffix, tocEntryName.data(),
 1360|      0|                            path, type, name, isAcceptable, context, &subErrorCode, pErrorCode);
 1361|      0|        if((retVal != nullptr) || U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (1361:12): [True: 0, False: 0]
  |  Branch (1361:35): [True: 0, False: 0]
  ------------------
 1362|      0|            return retVal;
 1363|      0|        }
 1364|      0|    }
 1365|       |
 1366|       |    /* data not found */
 1367|     19|    if(U_SUCCESS(*pErrorCode)) {
  ------------------
  |  Branch (1367:8): [True: 19, False: 0]
  ------------------
 1368|     19|        if(U_SUCCESS(subErrorCode)) {
  ------------------
  |  Branch (1368:12): [True: 18, False: 1]
  ------------------
 1369|       |            /* file not found */
 1370|     18|            *pErrorCode=U_FILE_ACCESS_ERROR;
 1371|     18|        } else {
 1372|       |            /* entry point not found or rejected */
 1373|      1|            *pErrorCode=subErrorCode;
 1374|      1|        }
 1375|     19|    }
 1376|     19|    return retVal;
 1377|     19|}
udata.cpp:_ZL14isTimeZoneFilePKcS0_:
 1107|     30|static UBool isTimeZoneFile(const char *name, const char *type) {
 1108|     30|    return ((uprv_strcmp(type, "res") == 0) &&
  ------------------
  |  |   38|     30|#define uprv_strcmp(s1, s2) U_STANDARD_CPP_NAMESPACE strcmp(s1, s2)
  |  |  ------------------
  |  |  |  |  393|     30|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (1108:13): [True: 0, False: 30]
  ------------------
 1109|     30|            (uprv_strcmp(name, "zoneinfo64") == 0 ||
  ------------------
  |  |   38|      0|#define uprv_strcmp(s1, s2) U_STANDARD_CPP_NAMESPACE strcmp(s1, s2)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (1109:14): [True: 0, False: 0]
  ------------------
 1110|      0|             uprv_strcmp(name, "timezoneTypes") == 0 ||
  ------------------
  |  |   38|      0|#define uprv_strcmp(s1, s2) U_STANDARD_CPP_NAMESPACE strcmp(s1, s2)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (1110:14): [True: 0, False: 0]
  ------------------
 1111|      0|             uprv_strcmp(name, "windowsZones") == 0 ||
  ------------------
  |  |   38|      0|#define uprv_strcmp(s1, s2) U_STANDARD_CPP_NAMESPACE strcmp(s1, s2)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (1111:14): [True: 0, False: 0]
  ------------------
 1112|      0|             uprv_strcmp(name, "metaZones") == 0));
  ------------------
  |  |   38|      0|#define uprv_strcmp(s1, s2) U_STANDARD_CPP_NAMESPACE strcmp(s1, s2)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (1112:14): [True: 0, False: 0]
  ------------------
 1113|     30|}
udata.cpp:_ZL13checkDataItemPK10DataHeaderPFaPvPKcS4_PK9UDataInfoES2_S4_S4_P10UErrorCodeSB_:
  949|     11|{
  950|     11|    UDataMemory  *rDataMem = nullptr;          /* the new UDataMemory, to be returned.        */
  951|       |
  952|     11|    if (U_FAILURE(*fatalErr)) {
  ------------------
  |  Branch (952:9): [True: 0, False: 11]
  ------------------
  953|      0|        return nullptr;
  954|      0|    }
  955|       |
  956|     11|    if(pHeader->dataHeader.magic1==0xda &&
  ------------------
  |  Branch (956:8): [True: 11, False: 0]
  ------------------
  957|     11|        pHeader->dataHeader.magic2==0x27 &&
  ------------------
  |  Branch (957:9): [True: 11, False: 0]
  ------------------
  958|     11|        (isAcceptable==nullptr || isAcceptable(context, type, name, &pHeader->info))
  ------------------
  |  Branch (958:10): [True: 0, False: 11]
  |  Branch (958:35): [True: 11, False: 0]
  ------------------
  959|     11|    ) {
  960|     11|        rDataMem=UDataMemory_createNewInstance(fatalErr);
  ------------------
  |  |   79|     11|#define UDataMemory_createNewInstance U_ICU_ENTRY_POINT_RENAME(UDataMemory_createNewInstance)
  |  |  ------------------
  |  |  |  |  123|     11|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|     11|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|     11|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  961|     11|        if (U_FAILURE(*fatalErr)) {
  ------------------
  |  Branch (961:13): [True: 0, False: 11]
  ------------------
  962|      0|            return nullptr;
  963|      0|        }
  964|     11|        rDataMem->pHeader = pHeader;
  965|     11|    } else {
  966|       |        /* the data is not acceptable, look further */
  967|       |        /* If we eventually find something good, this errorcode will be */
  968|       |        /*    cleared out.                                              */
  969|      0|        *nonFatalErr=U_INVALID_FORMAT_ERROR;
  970|      0|    }
  971|     11|    return rDataMem;
  972|     11|}
udata.cpp:_ZL20doLoadFromCommonDataaPKcS0_S0_S0_S0_S0_S0_PFaPvS0_S0_PK9UDataInfoES1_P10UErrorCodeS8_:
 1042|     30|{
 1043|     30|    UDataMemory        *pEntryData;
 1044|     30|    const DataHeader   *pHeader;
 1045|     30|    UDataMemory        *pCommonData;
 1046|     30|    int32_t            commonDataIndex;
 1047|     30|    UBool              checkedExtendedICUData = false;
 1048|       |    /* try to get common data.  The loop is for platforms such as the 390 that do
 1049|       |     *  not initially load the full set of ICU data.  If the lookup of an ICU data item
 1050|       |     *  fails, the full (but slower to load) set is loaded, the and the loop repeats,
 1051|       |     *  trying the lookup again.  Once the full set of ICU data is loaded, the loop wont
 1052|       |     *  repeat because the full set will be checked the first time through.
 1053|       |     *
 1054|       |     *  The loop also handles the fallback to a .dat file if the application linked
 1055|       |     *   to the stub data library rather than a real library.
 1056|       |     */
 1057|     49|    for (commonDataIndex = isICUData ? 0 : -1;;) {
  ------------------
  |  Branch (1057:28): [True: 30, False: 0]
  ------------------
 1058|     49|        pCommonData=openCommonData(path, commonDataIndex, subErrorCode); /** search for pkg **/
 1059|       |
 1060|     49|        if(U_SUCCESS(*subErrorCode) && pCommonData!=nullptr) {
  ------------------
  |  Branch (1060:12): [True: 49, False: 0]
  |  Branch (1060:40): [True: 30, False: 19]
  ------------------
 1061|     30|            int32_t length;
 1062|       |
 1063|       |            /* look up the data piece in the common data */
 1064|     30|            pHeader=pCommonData->vFuncs->Lookup(pCommonData, tocEntryName, &length, subErrorCode);
 1065|       |#ifdef UDATA_DEBUG
 1066|       |            fprintf(stderr, "%s: pHeader=%p - %s\n", tocEntryName, (void*) pHeader, u_errorName(*subErrorCode));
 1067|       |#endif
 1068|       |
 1069|     30|            if(pHeader!=nullptr) {
  ------------------
  |  Branch (1069:16): [True: 11, False: 19]
  ------------------
 1070|     11|                pEntryData = checkDataItem(pHeader, isAcceptable, context, type, name, subErrorCode, pErrorCode);
 1071|       |#ifdef UDATA_DEBUG
 1072|       |                fprintf(stderr, "pEntryData=%p\n", (void*) pEntryData);
 1073|       |#endif
 1074|     11|                if (U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (1074:21): [True: 0, False: 11]
  ------------------
 1075|      0|                    return nullptr;
 1076|      0|                }
 1077|     11|                if (pEntryData != nullptr) {
  ------------------
  |  Branch (1077:21): [True: 11, False: 0]
  ------------------
 1078|     11|                    pEntryData->length = length;
 1079|     11|                    return pEntryData;
 1080|     11|                }
 1081|     11|            }
 1082|     30|        }
 1083|       |        // If we failed due to being out-of-memory, then stop early and report the error.
 1084|     38|        if (*subErrorCode == U_MEMORY_ALLOCATION_ERROR) {
  ------------------
  |  Branch (1084:13): [True: 0, False: 38]
  ------------------
 1085|      0|            *pErrorCode = *subErrorCode;
 1086|      0|            return nullptr;
 1087|      0|        }
 1088|       |        /* Data wasn't found.  If we were looking for an ICUData item and there is
 1089|       |         * more data available, load it and try again,
 1090|       |         * otherwise break out of this loop. */
 1091|     38|        if (!isICUData) {
  ------------------
  |  Branch (1091:13): [True: 0, False: 38]
  ------------------
 1092|      0|            return nullptr;
 1093|     38|        } else if (pCommonData != nullptr) {
  ------------------
  |  Branch (1093:20): [True: 19, False: 19]
  ------------------
 1094|     19|            ++commonDataIndex;  /* try the next data package */
 1095|     19|        } else if ((!checkedExtendedICUData) && extendICUData(subErrorCode)) {
  ------------------
  |  Branch (1095:20): [True: 19, False: 0]
  |  Branch (1095:49): [True: 0, False: 19]
  ------------------
 1096|      0|            checkedExtendedICUData = true;
 1097|       |            /* try this data package slot again: it changed from nullptr to non-nullptr */
 1098|     19|        } else {
 1099|     19|            return nullptr;
 1100|     19|        }
 1101|     38|    }
 1102|     30|}
udata.cpp:_ZL14openCommonDataPKciP10UErrorCode:
  673|     50|{
  674|     50|    UDataMemory tData;
  675|     50|    const char *pathBuffer;
  676|     50|    const char *inBasename;
  677|       |
  678|     50|    if (U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (678:9): [True: 0, False: 50]
  ------------------
  679|      0|        return nullptr;
  680|      0|    }
  681|       |
  682|     50|    UDataMemory_init(&tData);
  ------------------
  |  |   80|     50|#define UDataMemory_init U_ICU_ENTRY_POINT_RENAME(UDataMemory_init)
  |  |  ------------------
  |  |  |  |  123|     50|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|     50|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|     50|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  683|       |
  684|       |    /* ??????? TODO revisit this */ 
  685|     50|    if (commonDataIndex >= 0) {
  ------------------
  |  Branch (685:9): [True: 49, False: 1]
  ------------------
  686|       |        /* "mini-cache" for common ICU data */
  687|     49|        if(commonDataIndex >= UPRV_LENGTHOF(gCommonICUDataArray)) {
  ------------------
  |  |   99|     49|#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
  ------------------
  |  Branch (687:12): [True: 0, False: 49]
  ------------------
  688|      0|            return nullptr;
  689|      0|        }
  690|     49|        {
  691|     49|            Mutex lock;
  692|     49|            if(gCommonICUDataArray[commonDataIndex] != nullptr) {
  ------------------
  |  Branch (692:16): [True: 29, False: 20]
  ------------------
  693|     29|                return gCommonICUDataArray[commonDataIndex];
  694|     29|            }
  695|     20|#if !defined(ICU_DATA_DIR_WINDOWS)
  696|       |// When using the Windows system data, we expect only a single data file.
  697|     20|            int32_t i;
  698|     20|            for(i = 0; i < commonDataIndex; ++i) {
  ------------------
  |  Branch (698:24): [True: 19, False: 1]
  ------------------
  699|     19|                if(gCommonICUDataArray[i]->pHeader == &U_ICUDATA_ENTRY_POINT) {
  ------------------
  |  |  171|     19|#define U_ICUDATA_ENTRY_POINT  U_DEF2_ICUDATA_ENTRY_POINT(U_ICU_VERSION_MAJOR_NUM,U_LIB_SUFFIX_C_NAME)
  |  |  ------------------
  |  |  |  |  178|     19|#define U_DEF2_ICUDATA_ENTRY_POINT(major,suff) U_DEF_ICUDATA_ENTRY_POINT(major,suff)
  |  |  |  |  ------------------
  |  |  |  |  |  |  187|     19|#define U_DEF_ICUDATA_ENTRY_POINT(major, suff) icudt##major##_dat
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (699:20): [True: 19, False: 0]
  ------------------
  700|       |                    /* The linked-in data is already in the list. */
  701|     19|                    return nullptr;
  702|     19|                }
  703|     19|            }
  704|     20|#endif
  705|     20|        }
  706|       |
  707|       |        /* Add the linked-in data to the list. */
  708|       |        /*
  709|       |         * This is where we would check and call weakly linked partial-data-library
  710|       |         * access functions.
  711|       |         */
  712|       |        /*
  713|       |        if (uprv_getICUData_collation) {
  714|       |            setCommonICUDataPointer(uprv_getICUData_collation(), false, pErrorCode);
  715|       |        }
  716|       |        if (uprv_getICUData_conversion) {
  717|       |            setCommonICUDataPointer(uprv_getICUData_conversion(), false, pErrorCode);
  718|       |        }
  719|       |        */
  720|      1|#if !defined(ICU_DATA_DIR_WINDOWS)
  721|       |// When using the Windows system data, we expect only a single data file.
  722|      1|        setCommonICUDataPointer(&U_ICUDATA_ENTRY_POINT, false, pErrorCode);
  ------------------
  |  |  171|      1|#define U_ICUDATA_ENTRY_POINT  U_DEF2_ICUDATA_ENTRY_POINT(U_ICU_VERSION_MAJOR_NUM,U_LIB_SUFFIX_C_NAME)
  |  |  ------------------
  |  |  |  |  178|      1|#define U_DEF2_ICUDATA_ENTRY_POINT(major,suff) U_DEF_ICUDATA_ENTRY_POINT(major,suff)
  |  |  |  |  ------------------
  |  |  |  |  |  |  187|      1|#define U_DEF_ICUDATA_ENTRY_POINT(major, suff) icudt##major##_dat
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  723|      1|        {
  724|      1|            Mutex lock;
  725|      1|            return gCommonICUDataArray[commonDataIndex];
  726|     20|        }
  727|     20|#endif
  728|     20|    }
  729|       |
  730|       |
  731|       |    /* request is NOT for ICU Data.  */
  732|       |
  733|       |    /* Find the base name portion of the supplied path.   */
  734|       |    /*   inBasename will be left pointing somewhere within the original path string.      */
  735|      1|    inBasename = findBasename(path);
  736|       |#ifdef UDATA_DEBUG
  737|       |    fprintf(stderr, "inBasename = %s\n", inBasename);
  738|       |#endif
  739|       |
  740|      1|    if(*inBasename==0) {
  ------------------
  |  Branch (740:8): [True: 0, False: 1]
  ------------------
  741|       |        /* no basename.     This will happen if the original path was a directory name,   */
  742|       |        /*    like  "a/b/c/".   (Fallback to separate files will still work.)             */
  743|       |#ifdef UDATA_DEBUG
  744|       |        fprintf(stderr, "ocd: no basename in %s, bailing.\n", path);
  745|       |#endif
  746|      0|        if (U_SUCCESS(*pErrorCode)) {
  ------------------
  |  Branch (746:13): [True: 0, False: 0]
  ------------------
  747|      0|            *pErrorCode=U_FILE_ACCESS_ERROR;
  748|      0|        }
  749|      0|        return nullptr;
  750|      0|    }
  751|       |
  752|       |   /* Is the requested common data file already open and cached?                     */
  753|       |   /*   Note that the cache is keyed by the base name only.  The rest of the path,   */
  754|       |   /*     if any, is not considered.                                                 */
  755|      1|    UDataMemory  *dataToReturn = udata_findCachedData(inBasename, *pErrorCode);
  756|      1|    if (dataToReturn != nullptr || U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (756:9): [True: 0, False: 1]
  |  Branch (756:36): [True: 0, False: 1]
  ------------------
  757|      0|        return dataToReturn;
  758|      0|    }
  759|       |
  760|       |    /* Requested item is not in the cache.
  761|       |     * Hunt it down, trying all the path locations
  762|       |     */
  763|       |
  764|      1|    UDataPathIterator iter(u_getDataDirectory(), inBasename, path, ".dat", true, pErrorCode);
  ------------------
  |  |  271|      1|#define u_getDataDirectory U_ICU_ENTRY_POINT_RENAME(u_getDataDirectory)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  765|       |
  766|      1|    while ((UDataMemory_isLoaded(&tData)==false) && (pathBuffer = iter.next(pErrorCode)) != nullptr)
  ------------------
  |  |   81|      1|#define UDataMemory_isLoaded U_ICU_ENTRY_POINT_RENAME(UDataMemory_isLoaded)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (766:12): [True: 1, False: 0]
  |  Branch (766:53): [True: 0, False: 1]
  ------------------
  767|      0|    {
  768|       |#ifdef UDATA_DEBUG
  769|       |        fprintf(stderr, "ocd: trying path %s - ", pathBuffer);
  770|       |#endif
  771|      0|        uprv_mapFile(&tData, pathBuffer, pErrorCode);
  ------------------
  |  | 1525|      0|#define uprv_mapFile U_ICU_ENTRY_POINT_RENAME(uprv_mapFile)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  772|       |#ifdef UDATA_DEBUG
  773|       |        fprintf(stderr, "%s\n", UDataMemory_isLoaded(&tData)?"LOADED":"not loaded");
  774|       |#endif
  775|      0|    }
  776|      1|    if (U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (776:9): [True: 0, False: 1]
  ------------------
  777|      0|        return nullptr;
  778|      0|    }
  779|       |
  780|      1|    if (U_FAILURE(*pErrorCode)) {
  ------------------
  |  Branch (780:9): [True: 0, False: 1]
  ------------------
  781|      0|        return nullptr;
  782|      0|    }
  783|      1|    if (!UDataMemory_isLoaded(&tData)) {
  ------------------
  |  |   81|      1|#define UDataMemory_isLoaded U_ICU_ENTRY_POINT_RENAME(UDataMemory_isLoaded)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (783:9): [True: 1, False: 0]
  ------------------
  784|       |        /* no common data */
  785|      1|        *pErrorCode=U_FILE_ACCESS_ERROR;
  786|      1|        return nullptr;
  787|      1|    }
  788|       |
  789|       |    /* we have mapped a file, check its header */
  790|      0|    udata_checkCommonData(&tData, pErrorCode);
  ------------------
  |  |  884|      0|#define udata_checkCommonData U_ICU_ENTRY_POINT_RENAME(udata_checkCommonData)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  791|       |
  792|       |
  793|       |    /* Cache the UDataMemory struct for this .dat file,
  794|       |     *   so we won't need to hunt it down and map it again next time
  795|       |     *   something is needed from it.                */
  796|      0|    return udata_cacheDataItem(inBasename, &tData, pErrorCode);
  797|      1|}
udata.cpp:_ZL23setCommonICUDataPointerPKvaP10UErrorCode:
  214|      1|setCommonICUDataPointer(const void *pData, UBool /*warn*/, UErrorCode *pErrorCode) {
  215|      1|    UDataMemory tData;
  216|      1|    UDataMemory_init(&tData);
  ------------------
  |  |   80|      1|#define UDataMemory_init U_ICU_ENTRY_POINT_RENAME(UDataMemory_init)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  217|      1|    UDataMemory_setData(&tData, pData);
  ------------------
  |  |   83|      1|#define UDataMemory_setData U_ICU_ENTRY_POINT_RENAME(UDataMemory_setData)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  218|      1|    udata_checkCommonData(&tData, pErrorCode);
  ------------------
  |  |  884|      1|#define udata_checkCommonData U_ICU_ENTRY_POINT_RENAME(udata_checkCommonData)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  219|      1|    return setCommonICUData(&tData, false, pErrorCode);
  220|      1|}
udata.cpp:_ZL20udata_findCachedDataPKcR10UErrorCode:
  306|     20|{
  307|     20|    UHashtable        *htable;
  308|     20|    UDataMemory       *retVal = nullptr;
  309|     20|    DataCacheElement  *el;
  310|     20|    const char        *baseName;
  311|       |
  312|     20|    htable = udata_getHashTable(err);
  313|     20|    if (U_FAILURE(err)) {
  ------------------
  |  Branch (313:9): [True: 1, False: 19]
  ------------------
  314|      1|        return nullptr;
  315|      1|    }
  316|       |
  317|     19|    baseName = findBasename(path);   /* Cache remembers only the base name, not the full path. */
  318|     19|    umtx_lock(nullptr);
  ------------------
  |  | 1250|     19|#define umtx_lock U_ICU_ENTRY_POINT_RENAME(umtx_lock)
  |  |  ------------------
  |  |  |  |  123|     19|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|     19|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|     19|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  319|     19|    el = static_cast<DataCacheElement*>(uhash_get(htable, baseName));
  ------------------
  |  | 1007|     19|#define uhash_get U_ICU_ENTRY_POINT_RENAME(uhash_get)
  |  |  ------------------
  |  |  |  |  123|     19|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|     19|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|     19|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  320|     19|    umtx_unlock(nullptr);
  ------------------
  |  | 1251|     19|#define umtx_unlock U_ICU_ENTRY_POINT_RENAME(umtx_unlock)
  |  |  ------------------
  |  |  |  |  123|     19|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|     19|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|     19|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  321|     19|    if (el != nullptr) {
  ------------------
  |  Branch (321:9): [True: 0, False: 19]
  ------------------
  322|      0|        retVal = el->item;
  323|      0|    }
  324|       |#ifdef UDATA_DEBUG
  325|       |    fprintf(stderr, "Cache: [%s] -> %p\n", baseName, (void*) retVal);
  326|       |#endif
  327|     19|    return retVal;
  328|     20|}
udata.cpp:_ZL13extendICUDataP10UErrorCode:
  811|     19|{
  812|     19|    UDataMemory   *pData;
  813|     19|    UDataMemory   copyPData;
  814|     19|    UBool         didUpdate = false;
  815|       |
  816|       |    /*
  817|       |     * There is a chance for a race condition here.
  818|       |     * Normally, ICU data is loaded from a DLL or via mmap() and
  819|       |     * setCommonICUData() will detect if the same address is set twice.
  820|       |     * If ICU is built with data loading via fread() then the address will
  821|       |     * be different each time the common data is loaded and we may add
  822|       |     * multiple copies of the data.
  823|       |     * In this case, use a mutex to prevent the race.
  824|       |     * Use a specific mutex to avoid nested locks of the global mutex.
  825|       |     */
  826|       |#if MAP_IMPLEMENTATION==MAP_STDIO
  827|       |    static UMutex extendICUDataMutex;
  828|       |    umtx_lock(&extendICUDataMutex);
  829|       |#endif
  830|     19|    if(!umtx_loadAcquire(gHaveTriedToLoadCommonData)) {
  ------------------
  |  Branch (830:8): [True: 1, False: 18]
  ------------------
  831|       |        /* See if we can explicitly open a .dat file for the ICUData. */
  832|      1|        pData = openCommonData(
  833|      1|                   U_ICUDATA_NAME,            /*  "icudt20l" , for example.          */
  ------------------
  |  |  154|      1|#define U_ICUDATA_NAME    "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER
  |  |  ------------------
  |  |  |  |  144|      1|#     define U_ICUDATA_TYPE_LETTER "l"
  |  |  ------------------
  ------------------
  834|      1|                   -1,                        /*  Pretend we're not opening ICUData  */
  835|      1|                   pErr);
  836|       |
  837|       |        /* How about if there is no pData, eh... */
  838|       |
  839|      1|       UDataMemory_init(&copyPData);
  ------------------
  |  |   80|      1|#define UDataMemory_init U_ICU_ENTRY_POINT_RENAME(UDataMemory_init)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  840|      1|       if(pData != nullptr) {
  ------------------
  |  Branch (840:11): [True: 0, False: 1]
  ------------------
  841|      0|          UDatamemory_assign(&copyPData, pData);
  ------------------
  |  |   84|      0|#define UDatamemory_assign U_ICU_ENTRY_POINT_RENAME(UDatamemory_assign)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  842|      0|          copyPData.map = nullptr;     /* The mapping for this data is owned by the hash table */
  843|      0|          copyPData.mapAddr = nullptr; /*   which will unmap it when ICU is shut down.         */
  844|       |                                       /* CommonICUData is also unmapped when ICU is shut down.*/
  845|       |                                       /* To avoid unmapping the data twice, zero out the map  */
  846|       |                                       /*   fields in the UDataMemory that we're assigning     */
  847|       |                                       /*   to CommonICUData.                                  */
  848|       |
  849|      0|          didUpdate = /* no longer using this result */
  850|      0|              setCommonICUData(&copyPData,/*  The new common data.                                */
  851|      0|                       false,             /*  No warnings if write didn't happen                  */
  852|      0|                       pErr);             /*  setCommonICUData honors errors; NOP if error set    */
  853|      0|        }
  854|       |
  855|      1|        umtx_storeRelease(gHaveTriedToLoadCommonData, 1);
  856|      1|    }
  857|       |
  858|     19|    didUpdate = findCommonICUDataByName(U_ICUDATA_NAME, *pErr);  /* Return 'true' when a racing writes out the extended                 */
  ------------------
  |  |  154|     19|#define U_ICUDATA_NAME    "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER
  |  |  ------------------
  |  |  |  |  144|     19|#     define U_ICUDATA_TYPE_LETTER "l"
  |  |  ------------------
  ------------------
  859|       |                                                          /* data after another thread has failed to see it (in openCommonData), so     */
  860|       |                                                          /* extended data can be examined.                                             */
  861|       |                                                          /* Also handles a race through here before gHaveTriedToLoadCommonData is set. */
  862|       |
  863|       |#if MAP_IMPLEMENTATION==MAP_STDIO
  864|       |    umtx_unlock(&extendICUDataMutex);
  865|       |#endif
  866|     19|    return didUpdate;               /* Return true if ICUData pointer was updated.   */
  867|       |                                    /*   (Could potentially have been done by another thread racing */
  868|       |                                    /*   us through here, but that's fine, we still return true    */
  869|       |                                    /*   so that current thread will also examine extended data.   */
  870|     19|}
udata.cpp:_ZL23findCommonICUDataByNamePKcR10UErrorCode:
  144|     19|{
  145|     19|    UBool found = false;
  146|     19|    int32_t i;
  147|       |
  148|     19|    UDataMemory  *pData = udata_findCachedData(inBasename, err);
  149|     19|    if (U_FAILURE(err) || pData == nullptr)
  ------------------
  |  Branch (149:9): [True: 1, False: 18]
  |  Branch (149:27): [True: 18, False: 0]
  ------------------
  150|     19|        return false;
  151|       |
  152|      0|    {
  153|      0|        Mutex lock;
  154|      0|        for (i = 0; i < UPRV_LENGTHOF(gCommonICUDataArray); ++i) {
  ------------------
  |  |   99|      0|#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
  ------------------
  |  Branch (154:21): [True: 0, False: 0]
  ------------------
  155|      0|            if ((gCommonICUDataArray[i] != nullptr) && (gCommonICUDataArray[i]->pHeader == pData->pHeader)) {
  ------------------
  |  Branch (155:17): [True: 0, False: 0]
  |  Branch (155:56): [True: 0, False: 0]
  ------------------
  156|       |                /* The data pointer is already in the array. */
  157|      0|                found = true;
  158|      0|                break;
  159|      0|            }
  160|      0|        }
  161|      0|    }
  162|      0|    return found;
  163|     19|}

UDataMemory_init_78:
   28|     64|U_CFUNC void UDataMemory_init(UDataMemory *This) {
   29|     64|    uprv_memset(This, 0, sizeof(UDataMemory));
  ------------------
  |  |  100|     64|#define uprv_memset(buffer, mark, size) U_STANDARD_CPP_NAMESPACE memset(buffer, mark, size)
  |  |  ------------------
  |  |  |  |  393|     64|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
   30|     64|    This->length=-1;
   31|     64|}
UDatamemory_assign_78:
   34|      1|U_CFUNC void UDatamemory_assign(UDataMemory *dest, UDataMemory *source) {
   35|       |    /* UDataMemory Assignment.  Destination UDataMemory must be initialized first.  */
   36|      1|    UBool mallocedFlag = dest->heapAllocated;
   37|      1|    uprv_memcpy(dest, source, sizeof(UDataMemory));
  ------------------
  |  |   42|      1|#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|      1|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  |   43|      1|    /* Suppress warnings about addresses that will never be NULL */ \
  |  |   44|      1|    _Pragma("clang diagnostic push") \
  |  |   45|      1|    _Pragma("clang diagnostic ignored \"-Waddress\"") \
  |  |   46|      1|    U_ASSERT(dst != NULL); \
  |  |  ------------------
  |  |  |  |   35|      1|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   47|      1|    U_ASSERT(src != NULL); \
  |  |  ------------------
  |  |  |  |   35|      1|#   define U_ASSERT(exp) (void)0
  |  |  ------------------
  |  |   48|      1|    _Pragma("clang diagnostic pop") \
  |  |   49|      1|    U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
  |  |  ------------------
  |  |  |  |  393|      1|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  |  |   50|      1|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|      1|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   38|      1|    dest->heapAllocated = mallocedFlag;
   39|      1|}
UDataMemory_createNewInstance_78:
   41|     12|U_CFUNC UDataMemory *UDataMemory_createNewInstance(UErrorCode *pErr) {
   42|     12|    UDataMemory *This;
   43|       |
   44|     12|    if (U_FAILURE(*pErr)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 12]
  ------------------
   45|      0|        return nullptr;
   46|      0|    }
   47|     12|    This = (UDataMemory *)uprv_malloc(sizeof(UDataMemory));
  ------------------
  |  | 1524|     12|#define uprv_malloc U_ICU_ENTRY_POINT_RENAME(uprv_malloc)
  |  |  ------------------
  |  |  |  |  123|     12|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|     12|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|     12|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   48|     12|    if (This == nullptr) {
  ------------------
  |  Branch (48:9): [True: 0, False: 12]
  ------------------
   49|      0|        *pErr = U_MEMORY_ALLOCATION_ERROR; }
   50|     12|    else {
   51|     12|        UDataMemory_init(This);
  ------------------
  |  |   80|     12|#define UDataMemory_init U_ICU_ENTRY_POINT_RENAME(UDataMemory_init)
  |  |  ------------------
  |  |  |  |  123|     12|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|     12|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|     12|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   52|     12|        This->heapAllocated = true;
   53|     12|    }
   54|     12|    return This;
   55|     12|}
UDataMemory_normalizeDataPointer_78:
   59|      1|UDataMemory_normalizeDataPointer(const void *p) {
   60|       |    /* allow the data to be optionally prepended with an alignment-forcing double value */
   61|      1|    const DataHeader *pdh = (const DataHeader *)p;
   62|      1|    if(pdh==nullptr || (pdh->dataHeader.magic1==0xda && pdh->dataHeader.magic2==0x27)) {
  ------------------
  |  Branch (62:8): [True: 0, False: 1]
  |  Branch (62:25): [True: 1, False: 0]
  |  Branch (62:57): [True: 1, False: 0]
  ------------------
   63|      1|        return pdh;
   64|      1|    } else {
   65|       |#if U_PLATFORM == U_PF_OS400
   66|       |        /*
   67|       |        TODO: Fix this once the compiler implements this feature. Keep in sync with genccode.c
   68|       |
   69|       |        This is here because this platform can't currently put
   70|       |        const data into the read-only pages of an object or
   71|       |        shared library (service program). Only strings are allowed in read-only
   72|       |        pages, so we use char * strings to store the data.
   73|       |
   74|       |        In order to prevent the beginning of the data from ever matching the
   75|       |        magic numbers we must skip the initial double.
   76|       |        [grhoten 4/24/2003]
   77|       |        */
   78|       |        return (const DataHeader *)*((const void **)p+1);
   79|       |#else
   80|      0|        return (const DataHeader *)((const double *)p+1);
   81|      0|#endif
   82|      0|    }
   83|      1|}
UDataMemory_setData_78:
   86|      1|U_CFUNC void UDataMemory_setData (UDataMemory *This, const void *dataAddr) {
   87|      1|    This->pHeader = UDataMemory_normalizeDataPointer(dataAddr);
  ------------------
  |  |   82|      1|#define UDataMemory_normalizeDataPointer U_ICU_ENTRY_POINT_RENAME(UDataMemory_normalizeDataPointer)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|      1|}
udata_getMemory_78:
  104|     11|udata_getMemory(UDataMemory *pData) {
  105|     11|    if(pData!=nullptr && pData->pHeader!=nullptr) {
  ------------------
  |  Branch (105:8): [True: 11, False: 0]
  |  Branch (105:26): [True: 11, False: 0]
  ------------------
  106|     11|        return (char *)(pData->pHeader)+udata_getHeaderSize(pData->pHeader);
  ------------------
  |  |  887|     11|#define udata_getHeaderSize U_ICU_ENTRY_POINT_RENAME(udata_getHeaderSize)
  |  |  ------------------
  |  |  |  |  123|     11|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|     11|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|     11|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  107|     11|    } else {
  108|      0|        return nullptr;
  109|      0|    }
  110|     11|}
UDataMemory_isLoaded_78:
  159|      2|U_CFUNC UBool UDataMemory_isLoaded(const UDataMemory *This) {
  160|      2|    return This->pHeader != nullptr;
  161|      2|}

uhash_open_78:
  547|      1|           UErrorCode *status) {
  548|       |
  549|      1|    return _uhash_create(keyHash, keyComp, valueComp, DEFAULT_PRIME_INDEX, status);
  ------------------
  |  |   91|      1|#define DEFAULT_PRIME_INDEX 4
  ------------------
  550|      1|}
uhash_openSize_78:
  557|      1|               UErrorCode *status) {
  558|       |
  559|       |    /* Find the smallest index i for which PRIMES[i] >= size. */
  560|      1|    int32_t i = 0;
  561|      8|    while (i<(PRIMES_LENGTH-1) && PRIMES[i]<size) {
  ------------------
  |  |   90|      8|#define PRIMES_LENGTH UPRV_LENGTHOF(PRIMES)
  |  |  ------------------
  |  |  |  |   99|      8|#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
  |  |  ------------------
  ------------------
  |  Branch (561:12): [True: 8, False: 0]
  |  Branch (561:35): [True: 7, False: 1]
  ------------------
  562|      7|        ++i;
  563|      7|    }
  564|       |
  565|      1|    return _uhash_create(keyHash, keyComp, valueComp, i, status);
  566|      1|}
uhash_setValueDeleter_78:
  643|      1|uhash_setValueDeleter(UHashtable *hash, UObjectDeleter *fn) {
  644|      1|    UObjectDeleter *result = hash->valueDeleter;
  645|      1|    hash->valueDeleter = fn;
  646|      1|    return result;
  647|      1|}
uhash_get_78:
  665|  2.39k|          const void* key) {
  666|  2.39k|    UHashTok keyholder;
  667|  2.39k|    keyholder.pointer = (void*) key;
  668|  2.39k|    return _uhash_find(hash, keyholder, hash->keyHasher(keyholder))->value.pointer;
  669|  2.39k|}
uhash_put_78:
  721|     10|          UErrorCode *status) {
  722|     10|    UHashTok keyholder, valueholder;
  723|     10|    keyholder.pointer = key;
  724|     10|    valueholder.pointer = value;
  725|     10|    return _uhash_put(hash, keyholder, valueholder,
  726|     10|                      HINT_KEY_POINTER | HINT_VALUE_POINTER,
  ------------------
  |  |  139|     10|#define HINT_KEY_POINTER   (1)
  ------------------
                                    HINT_KEY_POINTER | HINT_VALUE_POINTER,
  ------------------
  |  |  140|     10|#define HINT_VALUE_POINTER (2)
  ------------------
  727|     10|                      status).pointer;
  728|     10|}
uhash_hashChars_78:
  938|  2.40k|uhash_hashChars(const UHashTok key) {
  939|  2.40k|    const char *s = (const char *)key.pointer;
  940|  2.40k|    return s == nullptr ? 0 : static_cast<int32_t>(ustr_hashCharsN(s, static_cast<int32_t>(uprv_strlen(s))));
  ------------------
  |  | 1878|  2.40k|#define ustr_hashCharsN U_ICU_ENTRY_POINT_RENAME(ustr_hashCharsN)
  |  |  ------------------
  |  |  |  |  123|  2.40k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  2.40k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  2.40k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  return s == nullptr ? 0 : static_cast<int32_t>(ustr_hashCharsN(s, static_cast<int32_t>(uprv_strlen(s))));
  ------------------
  |  |   37|  2.40k|#define uprv_strlen(str) U_STANDARD_CPP_NAMESPACE strlen(str)
  |  |  ------------------
  |  |  |  |  393|  2.40k|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  |  Branch (940:12): [True: 0, False: 2.40k]
  ------------------
  941|  2.40k|}
uhash_compareChars_78:
 1029|  2.35k|uhash_compareChars(const UHashTok key1, const UHashTok key2) {
 1030|  2.35k|    const char *p1 = (const char*) key1.pointer;
 1031|  2.35k|    const char *p2 = (const char*) key2.pointer;
 1032|  2.35k|    if (p1 == p2) {
  ------------------
  |  Branch (1032:9): [True: 0, False: 2.35k]
  ------------------
 1033|      0|        return true;
 1034|      0|    }
 1035|  2.35k|    if (p1 == nullptr || p2 == nullptr) {
  ------------------
  |  Branch (1035:9): [True: 0, False: 2.35k]
  |  Branch (1035:26): [True: 0, False: 2.35k]
  ------------------
 1036|      0|        return false;
 1037|      0|    }
 1038|  38.2k|    while (*p1 != 0 && *p1 == *p2) {
  ------------------
  |  Branch (1038:12): [True: 35.9k, False: 2.35k]
  |  Branch (1038:24): [True: 35.9k, False: 0]
  ------------------
 1039|  35.9k|        ++p1;
 1040|  35.9k|        ++p2;
 1041|  35.9k|    }
 1042|  2.35k|    return *p1 == *p2;
 1043|  2.35k|}
uhash.cpp:_ZL13_uhash_createPFi8UElementEPFaS_S_ES3_iP10UErrorCode:
  287|      2|              UErrorCode *status) {
  288|      2|    UHashtable *result;
  289|       |
  290|      2|    if (U_FAILURE(*status)) return nullptr;
  ------------------
  |  Branch (290:9): [True: 0, False: 2]
  ------------------
  291|       |
  292|      2|    result = static_cast<UHashtable*>(uprv_malloc(sizeof(UHashtable)));
  ------------------
  |  | 1524|      2|#define uprv_malloc U_ICU_ENTRY_POINT_RENAME(uprv_malloc)
  |  |  ------------------
  |  |  |  |  123|      2|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      2|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      2|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  293|      2|    if (result == nullptr) {
  ------------------
  |  Branch (293:9): [True: 0, False: 2]
  ------------------
  294|      0|        *status = U_MEMORY_ALLOCATION_ERROR;
  295|      0|        return nullptr;
  296|      0|    }
  297|       |
  298|      2|    _uhash_init(result, keyHash, keyComp, valueComp, primeIndex, status);
  299|      2|    result->allocated       = true;
  300|       |
  301|      2|    if (U_FAILURE(*status)) {
  ------------------
  |  Branch (301:9): [True: 0, False: 2]
  ------------------
  302|      0|        uprv_free(result);
  ------------------
  |  | 1503|      0|#define uprv_free U_ICU_ENTRY_POINT_RENAME(uprv_free)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  303|      0|        return nullptr;
  304|      0|    }
  305|       |
  306|      2|    return result;
  307|      2|}
uhash.cpp:_ZL11_uhash_initP10UHashtablePFi8UElementEPFaS1_S1_ES5_iP10UErrorCode:
  260|      2|{
  261|      2|    if (U_FAILURE(*status)) return nullptr;
  ------------------
  |  Branch (261:9): [True: 0, False: 2]
  ------------------
  262|      2|    U_ASSERT(keyHash != nullptr);
  ------------------
  |  |   35|      2|#   define U_ASSERT(exp) (void)0
  ------------------
  263|      2|    U_ASSERT(keyComp != nullptr);
  ------------------
  |  |   35|      2|#   define U_ASSERT(exp) (void)0
  ------------------
  264|       |
  265|      2|    result->keyHasher       = keyHash;
  266|      2|    result->keyComparator   = keyComp;
  267|      2|    result->valueComparator = valueComp;
  268|      2|    result->keyDeleter      = nullptr;
  269|      2|    result->valueDeleter    = nullptr;
  270|      2|    result->allocated       = false;
  271|      2|    _uhash_internalSetResizePolicy(result, U_GROW);
  272|       |
  273|      2|    _uhash_allocate(result, primeIndex, status);
  274|       |
  275|      2|    if (U_FAILURE(*status)) {
  ------------------
  |  Branch (275:9): [True: 0, False: 2]
  ------------------
  276|      0|        return nullptr;
  277|      0|    }
  278|       |
  279|      2|    return result;
  280|      2|}
uhash.cpp:_ZL15_uhash_allocateP10UHashtableiP10UErrorCode:
  217|      2|                UErrorCode *status) {
  218|       |
  219|      2|    UHashElement *p, *limit;
  220|      2|    UHashTok emptytok;
  221|       |
  222|      2|    if (U_FAILURE(*status)) return;
  ------------------
  |  Branch (222:9): [True: 0, False: 2]
  ------------------
  223|       |
  224|      2|    U_ASSERT(primeIndex >= 0 && primeIndex < PRIMES_LENGTH);
  ------------------
  |  |   35|      2|#   define U_ASSERT(exp) (void)0
  ------------------
  225|       |
  226|      2|    hash->primeIndex = static_cast<int8_t>(primeIndex);
  227|      2|    hash->length = PRIMES[primeIndex];
  228|       |
  229|      2|    p = hash->elements = static_cast<UHashElement*>(
  230|      2|        uprv_malloc(sizeof(UHashElement) * hash->length));
  ------------------
  |  | 1524|      2|#define uprv_malloc U_ICU_ENTRY_POINT_RENAME(uprv_malloc)
  |  |  ------------------
  |  |  |  |  123|      2|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      2|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      2|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|       |
  232|      2|    if (hash->elements == nullptr) {
  ------------------
  |  Branch (232:9): [True: 0, False: 2]
  ------------------
  233|      0|        *status = U_MEMORY_ALLOCATION_ERROR;
  234|      0|        return;
  235|      0|    }
  236|       |
  237|      2|    emptytok.pointer = nullptr; /* Only one of these two is needed */
  238|      2|    emptytok.integer = 0;    /* but we don't know which one. */
  239|       |
  240|      2|    limit = p + hash->length;
  241|  1.15k|    while (p < limit) {
  ------------------
  |  Branch (241:12): [True: 1.14k, False: 2]
  ------------------
  242|  1.14k|        p->key = emptytok;
  243|  1.14k|        p->value = emptytok;
  244|  1.14k|        p->hashcode = HASH_EMPTY;
  ------------------
  |  |  118|  1.14k|#define HASH_EMPTY      ((int32_t) HASH_DELETED + 1)
  |  |  ------------------
  |  |  |  |  117|  1.14k|#define HASH_DELETED    ((int32_t) 0x80000000)
  |  |  ------------------
  ------------------
  245|  1.14k|        ++p;
  246|  1.14k|    }
  247|       |
  248|      2|    hash->count = 0;
  249|      2|    hash->lowWaterMark = static_cast<int32_t>(hash->length * hash->lowWaterRatio);
  250|      2|    hash->highWaterMark = static_cast<int32_t>(hash->length * hash->highWaterRatio);
  251|      2|}
uhash.cpp:_ZL30_uhash_internalSetResizePolicyP10UHashtable17UHashResizePolicy:
  197|      2|_uhash_internalSetResizePolicy(UHashtable *hash, enum UHashResizePolicy policy) {
  198|      2|    U_ASSERT(hash != nullptr);
  ------------------
  |  |   35|      2|#   define U_ASSERT(exp) (void)0
  ------------------
  199|      2|    U_ASSERT(((int32_t)policy) >= 0);
  ------------------
  |  |   35|      2|#   define U_ASSERT(exp) (void)0
  ------------------
  200|      2|    U_ASSERT(((int32_t)policy) < 3);
  ------------------
  |  |   35|      2|#   define U_ASSERT(exp) (void)0
  ------------------
  201|      2|    hash->lowWaterRatio  = RESIZE_POLICY_RATIO_TABLE[policy * 2];
  202|      2|    hash->highWaterRatio = RESIZE_POLICY_RATIO_TABLE[policy * 2 + 1];
  203|      2|}
uhash.cpp:_ZL11_uhash_findPK10UHashtable8UElementi:
  339|  2.40k|            int32_t hashcode) {
  340|       |
  341|  2.40k|    int32_t firstDeleted = -1;  /* assume invalid index */
  342|  2.40k|    int32_t theIndex, startIndex;
  343|  2.40k|    int32_t jump = 0; /* lazy evaluate */
  344|  2.40k|    int32_t tableHash;
  345|  2.40k|    UHashElement *elements = hash->elements;
  346|       |
  347|  2.40k|    hashcode &= 0x7FFFFFFF; /* must be positive */
  348|  2.40k|    startIndex = theIndex = (hashcode ^ 0x4000000) % hash->length;
  349|       |
  350|  2.40k|    do {
  351|  2.40k|        tableHash = elements[theIndex].hashcode;
  352|  2.40k|        if (tableHash == hashcode) {          /* quick check */
  ------------------
  |  Branch (352:13): [True: 2.35k, False: 56]
  ------------------
  353|  2.35k|            if ((*hash->keyComparator)(key, elements[theIndex].key)) {
  ------------------
  |  Branch (353:17): [True: 2.35k, False: 0]
  ------------------
  354|  2.35k|                return &(elements[theIndex]);
  355|  2.35k|            }
  356|  2.35k|        } else if (!IS_EMPTY_OR_DELETED(tableHash)) {
  ------------------
  |  |  120|     56|#define IS_EMPTY_OR_DELETED(x) ((x) < 0)
  ------------------
  |  Branch (356:20): [True: 0, False: 56]
  ------------------
  357|       |            /* We have hit a slot which contains a key-value pair,
  358|       |             * but for which the hash code does not match.  Keep
  359|       |             * looking.
  360|       |             */
  361|     56|        } else if (tableHash == HASH_EMPTY) { /* empty, end o' the line */
  ------------------
  |  |  118|     56|#define HASH_EMPTY      ((int32_t) HASH_DELETED + 1)
  |  |  ------------------
  |  |  |  |  117|     56|#define HASH_DELETED    ((int32_t) 0x80000000)
  |  |  ------------------
  ------------------
  |  Branch (361:20): [True: 56, False: 0]
  ------------------
  362|     56|            break;
  363|     56|        } else if (firstDeleted < 0) { /* remember first deleted */
  ------------------
  |  Branch (363:20): [True: 0, False: 0]
  ------------------
  364|      0|            firstDeleted = theIndex;
  365|      0|        }
  366|      0|        if (jump == 0) { /* lazy compute jump */
  ------------------
  |  Branch (366:13): [True: 0, False: 0]
  ------------------
  367|       |            /* The jump value must be relatively prime to the table
  368|       |             * length.  As long as the length is prime, then any value
  369|       |             * 1..length-1 will be relatively prime to it.
  370|       |             */
  371|      0|            jump = (hashcode % (hash->length - 1)) + 1;
  372|      0|        }
  373|      0|        theIndex = (theIndex + jump) % hash->length;
  374|      0|    } while (theIndex != startIndex);
  ------------------
  |  Branch (374:14): [True: 0, False: 0]
  ------------------
  375|       |
  376|     56|    if (firstDeleted >= 0) {
  ------------------
  |  Branch (376:9): [True: 0, False: 56]
  ------------------
  377|      0|        theIndex = firstDeleted; /* reset if had deleted slot */
  378|     56|    } else if (tableHash != HASH_EMPTY) {
  ------------------
  |  |  118|     56|#define HASH_EMPTY      ((int32_t) HASH_DELETED + 1)
  |  |  ------------------
  |  |  |  |  117|     56|#define HASH_DELETED    ((int32_t) 0x80000000)
  |  |  ------------------
  ------------------
  |  Branch (378:16): [True: 0, False: 56]
  ------------------
  379|       |        /* We get to this point if the hashtable is full (no empty or
  380|       |         * deleted slots), and we've failed to find a match.  THIS
  381|       |         * WILL NEVER HAPPEN as long as uhash_put() makes sure that
  382|       |         * count is always < length.
  383|       |         */
  384|      0|        UPRV_UNREACHABLE_EXIT;
  ------------------
  |  |   68|      0|#   define UPRV_UNREACHABLE_EXIT abort()
  ------------------
  385|      0|    }
  386|     56|    return &(elements[theIndex]);
  387|     56|}
uhash.cpp:_ZL10_uhash_putP10UHashtable8UElementS1_aP10UErrorCode:
  471|     10|           UErrorCode *status) {
  472|       |
  473|       |    /* Put finds the position in the table for the new value.  If the
  474|       |     * key is already in the table, it is deleted, if there is a
  475|       |     * non-nullptr keyDeleter.  Then the key, the hash and the value are
  476|       |     * all put at the position in their respective arrays.
  477|       |     */
  478|     10|    int32_t hashcode;
  479|     10|    UHashElement* e;
  480|     10|    UHashTok emptytok;
  481|       |
  482|     10|    if (U_FAILURE(*status)) {
  ------------------
  |  Branch (482:9): [True: 0, False: 10]
  ------------------
  483|      0|        goto err;
  484|      0|    }
  485|     10|    U_ASSERT(hash != nullptr);
  ------------------
  |  |   35|     10|#   define U_ASSERT(exp) (void)0
  ------------------
  486|     10|    if ((hint & HINT_VALUE_POINTER) ?
  ------------------
  |  |  140|     10|#define HINT_VALUE_POINTER (2)
  ------------------
  |  Branch (486:9): [True: 10, False: 0]
  |  Branch (486:9): [True: 0, False: 10]
  ------------------
  487|     10|            value.pointer == nullptr :
  488|     10|            value.integer == 0 && (hint & HINT_ALLOW_ZERO) == 0) {
  ------------------
  |  |  141|      0|#define HINT_ALLOW_ZERO    (4)
  ------------------
  |  Branch (488:13): [True: 0, False: 0]
  |  Branch (488:35): [True: 0, False: 0]
  ------------------
  489|       |        /* Disallow storage of nullptr values, since nullptr is returned by
  490|       |         * get() to indicate an absent key.  Storing nullptr == removing.
  491|       |         */
  492|      0|        return _uhash_remove(hash, key);
  493|      0|    }
  494|     10|    if (hash->count > hash->highWaterMark) {
  ------------------
  |  Branch (494:9): [True: 0, False: 10]
  ------------------
  495|      0|        _uhash_rehash(hash, status);
  496|      0|        if (U_FAILURE(*status)) {
  ------------------
  |  Branch (496:13): [True: 0, False: 0]
  ------------------
  497|      0|            goto err;
  498|      0|        }
  499|      0|    }
  500|       |
  501|     10|    hashcode = (*hash->keyHasher)(key);
  502|     10|    e = _uhash_find(hash, key, hashcode);
  503|     10|    U_ASSERT(e != nullptr);
  ------------------
  |  |   35|     10|#   define U_ASSERT(exp) (void)0
  ------------------
  504|       |
  505|     10|    if (IS_EMPTY_OR_DELETED(e->hashcode)) {
  ------------------
  |  |  120|     10|#define IS_EMPTY_OR_DELETED(x) ((x) < 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 10, False: 0]
  |  |  ------------------
  ------------------
  506|       |        /* Important: We must never actually fill the table up.  If we
  507|       |         * do so, then _uhash_find() will return nullptr, and we'll have
  508|       |         * to check for nullptr after every call to _uhash_find().  To
  509|       |         * avoid this we make sure there is always at least one empty
  510|       |         * or deleted slot in the table.  This only is a problem if we
  511|       |         * are out of memory and rehash isn't working.
  512|       |         */
  513|     10|        ++hash->count;
  514|     10|        if (hash->count == hash->length) {
  ------------------
  |  Branch (514:13): [True: 0, False: 10]
  ------------------
  515|       |            /* Don't allow count to reach length */
  516|      0|            --hash->count;
  517|      0|            *status = U_MEMORY_ALLOCATION_ERROR;
  518|      0|            goto err;
  519|      0|        }
  520|     10|    }
  521|       |
  522|       |    /* We must in all cases handle storage properly.  If there was an
  523|       |     * old key, then it must be deleted (if the deleter != nullptr).
  524|       |     * Make hashcodes stored in table positive.
  525|       |     */
  526|     10|    return _uhash_setElement(hash, e, hashcode & 0x7FFFFFFF, key, value, hint);
  527|       |
  528|      0| err:
  529|       |    /* If the deleters are non-nullptr, this method adopts its key and/or
  530|       |     * value arguments, and we must be sure to delete the key and/or
  531|       |     * value in all cases, even upon failure.
  532|       |     */
  533|      0|    HASH_DELETE_KEY_VALUE(hash, key.pointer, value.pointer);
  ------------------
  |  |  124|      0|#define HASH_DELETE_KEY_VALUE(hash, keypointer, valuepointer) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|      0|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  |  125|      0|    if (hash->keyDeleter != nullptr && keypointer != nullptr) { \
  |  |  ------------------
  |  |  |  Branch (125:9): [True: 0, False: 0]
  |  |  |  Branch (125:40): [True: 0, False: 0]
  |  |  ------------------
  |  |  126|      0|        (*hash->keyDeleter)(keypointer); \
  |  |  127|      0|    } \
  |  |  128|      0|    if (hash->valueDeleter != nullptr && valuepointer != nullptr) { \
  |  |  ------------------
  |  |  |  Branch (128:9): [True: 0, False: 0]
  |  |  |  Branch (128:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  129|      0|        (*hash->valueDeleter)(valuepointer); \
  |  |  130|      0|    } \
  |  |  131|      0|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|      0|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  534|      0|    emptytok.pointer = nullptr; emptytok.integer = 0;
  535|      0|    return emptytok;
  536|     10|}
uhash.cpp:_ZL17_uhash_setElementP10UHashtableP12UHashElementi8UElementS3_a:
  150|     10|                  UHashTok key, UHashTok value, int8_t hint) {
  151|       |
  152|     10|    UHashTok oldValue = e->value;
  153|     10|    if (hash->keyDeleter != nullptr && e->key.pointer != nullptr &&
  ------------------
  |  Branch (153:9): [True: 0, False: 10]
  |  Branch (153:40): [True: 0, False: 0]
  ------------------
  154|     10|        e->key.pointer != key.pointer) { /* Avoid double deletion */
  ------------------
  |  Branch (154:9): [True: 0, False: 0]
  ------------------
  155|      0|        (*hash->keyDeleter)(e->key.pointer);
  156|      0|    }
  157|     10|    if (hash->valueDeleter != nullptr) {
  ------------------
  |  Branch (157:9): [True: 0, False: 10]
  ------------------
  158|      0|        if (oldValue.pointer != nullptr &&
  ------------------
  |  Branch (158:13): [True: 0, False: 0]
  ------------------
  159|      0|            oldValue.pointer != value.pointer) { /* Avoid double deletion */
  ------------------
  |  Branch (159:13): [True: 0, False: 0]
  ------------------
  160|      0|            (*hash->valueDeleter)(oldValue.pointer);
  161|      0|        }
  162|      0|        oldValue.pointer = nullptr;
  163|      0|    }
  164|       |    /* Compilers should copy the UHashTok union correctly, but even if
  165|       |     * they do, memory heap tools (e.g. BoundsChecker) can get
  166|       |     * confused when a pointer is cloaked in a union and then copied.
  167|       |     * TO ALLEVIATE THIS, we use hints (based on what API the user is
  168|       |     * calling) to copy pointers when we know the user thinks
  169|       |     * something is a pointer. */
  170|     10|    if (hint & HINT_KEY_POINTER) {
  ------------------
  |  |  139|     10|#define HINT_KEY_POINTER   (1)
  ------------------
  |  Branch (170:9): [True: 10, False: 0]
  ------------------
  171|     10|        e->key.pointer = key.pointer;
  172|     10|    } else {
  173|      0|        e->key = key;
  174|      0|    }
  175|     10|    if (hint & HINT_VALUE_POINTER) {
  ------------------
  |  |  140|     10|#define HINT_VALUE_POINTER (2)
  ------------------
  |  Branch (175:9): [True: 10, False: 0]
  ------------------
  176|     10|        e->value.pointer = value.pointer;
  177|     10|    } else {
  178|      0|        e->value = value;
  179|      0|    }
  180|     10|    e->hashcode = hashcode;
  181|     10|    return oldValue;
  182|     10|}

_ZN6icu_786UMutex8getMutexEv:
   80|      2|std::mutex *UMutex::getMutex() {
   81|      2|    std::mutex *retPtr = fMutex.load(std::memory_order_acquire);
   82|      2|    if (retPtr == nullptr) {
  ------------------
  |  Branch (82:9): [True: 2, False: 0]
  ------------------
   83|      2|        std::call_once(*pInitFlag, umtx_init);
   84|      2|        std::lock_guard<std::mutex> guard(*initMutex);
   85|      2|        retPtr = fMutex.load(std::memory_order_acquire);
   86|      2|        if (retPtr == nullptr) {
  ------------------
  |  Branch (86:13): [True: 2, False: 0]
  ------------------
   87|      2|            fMutex = new(fStorage) std::mutex();
   88|      2|            retPtr = fMutex;
   89|      2|            fListLink = gListHead;
   90|      2|            gListHead = this;
   91|      2|        }
   92|      2|    }
   93|      2|    U_ASSERT(retPtr != nullptr);
  ------------------
  |  |   35|      2|#   define U_ASSERT(exp) (void)0
  ------------------
   94|      2|    return retPtr;
   95|      2|}
umtx_lock_78:
  112|  4.81k|umtx_lock(UMutex *mutex) {
  113|  4.81k|    if (mutex == nullptr) {
  ------------------
  |  Branch (113:9): [True: 75, False: 4.73k]
  ------------------
  114|     75|        mutex = &globalMutex;
  115|     75|    }
  116|  4.81k|    mutex->lock();
  117|  4.81k|}
umtx_unlock_78:
  122|  4.81k|{
  123|  4.81k|    if (mutex == nullptr) {
  ------------------
  |  Branch (123:9): [True: 75, False: 4.73k]
  ------------------
  124|     75|        mutex = &globalMutex;
  125|     75|    }
  126|  4.81k|    mutex->unlock();
  127|  4.81k|}
_ZN6icu_7820umtx_initImplPreInitERNS_9UInitOnceE:
  145|      3|umtx_initImplPreInit(UInitOnce &uio) {
  146|      3|    std::call_once(*pInitFlag, umtx_init);
  147|      3|    std::unique_lock<std::mutex> lock(*initMutex);
  148|      3|    if (umtx_loadAcquire(uio.fState) == 0) {
  ------------------
  |  Branch (148:9): [True: 3, False: 0]
  ------------------
  149|      3|        umtx_storeRelease(uio.fState, 1);
  150|      3|        return true;      // Caller will next call the init function.
  151|      3|    } else {
  152|      0|        while (umtx_loadAcquire(uio.fState) == 1) {
  ------------------
  |  Branch (152:16): [True: 0, False: 0]
  ------------------
  153|       |            // Another thread is currently running the initialization.
  154|       |            // Wait until it completes.
  155|      0|            initCondition->wait(lock);
  156|      0|        }
  157|      0|        U_ASSERT(uio.fState == 2);
  ------------------
  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  ------------------
  158|      0|        return false;
  159|      0|    }
  160|      3|}
_ZN6icu_7821umtx_initImplPostInitERNS_9UInitOnceE:
  170|      3|umtx_initImplPostInit(UInitOnce &uio) {
  171|      3|    {
  172|      3|        std::unique_lock<std::mutex> lock(*initMutex);
  173|      3|        umtx_storeRelease(uio.fState, 2);
  174|      3|    }
  175|      3|    initCondition->notify_all();
  176|      3|}
umutex.cpp:_ZN6icu_78L9umtx_initEv:
   72|      1|static void U_CALLCONV umtx_init() {
   73|      1|    initMutex = STATIC_NEW(std::mutex);
  ------------------
  |  |  144|      1|#define STATIC_NEW(type) [] () { \
  |  |  145|      1|    alignas(type) static char storage[sizeof(type)]; \
  |  |  146|      1|    return new(storage) type();} ()
  ------------------
   74|      1|    initCondition = STATIC_NEW(std::condition_variable);
  ------------------
  |  |  144|      1|#define STATIC_NEW(type) [] () { \
  |  |  145|      1|    alignas(type) static char storage[sizeof(type)]; \
  |  |  146|      1|    return new(storage) type();} ()
  ------------------
   75|      1|    ucln_common_registerCleanup(UCLN_COMMON_MUTEX, umtx_cleanup);
  ------------------
  |  |  617|      1|#define ucln_common_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_common_registerCleanup)
  |  |  ------------------
  |  |  |  |  123|      1|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      1|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      1|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   76|      1|}

_ZN6icu_7813umtx_initOnceERNS_9UInitOnceEPFvR10UErrorCodeES3_:
  135|  4.33k|inline void umtx_initOnce(UInitOnce &uio, void (U_CALLCONV *fp)(UErrorCode &), UErrorCode &errCode) {
  136|  4.33k|    if (U_FAILURE(errCode)) {
  ------------------
  |  Branch (136:9): [True: 1, False: 4.33k]
  ------------------
  137|      1|        return;
  138|      1|    }
  139|  4.33k|    if (umtx_loadAcquire(uio.fState) != 2 && umtx_initImplPreInit(uio)) {
  ------------------
  |  Branch (139:9): [True: 2, False: 4.33k]
  |  Branch (139:46): [True: 2, False: 0]
  ------------------
  140|       |        // We run the initialization.
  141|      2|        (*fp)(errCode);
  142|      2|        uio.fErrCode = errCode;
  143|      2|        umtx_initImplPostInit(uio);
  144|  4.33k|    } else {
  145|       |        // Someone else already ran the initialization.
  146|  4.33k|        if (U_FAILURE(uio.fErrCode)) {
  ------------------
  |  Branch (146:13): [True: 0, False: 4.33k]
  ------------------
  147|      0|            errCode = uio.fErrCode;
  148|      0|        }
  149|  4.33k|    }
  150|  4.33k|}
_ZN6icu_7816umtx_loadAcquireERNSt3__16atomicIiEE:
   75|  4.38k|inline int32_t umtx_loadAcquire(u_atomic_int32_t &var) {
   76|  4.38k|    return var.load(std::memory_order_acquire);
   77|  4.38k|}
_ZN6icu_786UMutex4lockEv:
  229|  4.81k|    void lock() {
  230|  4.81k|        std::mutex *m = fMutex.load(std::memory_order_acquire);
  231|  4.81k|        if (m == nullptr) { m = getMutex(); }
  ------------------
  |  Branch (231:13): [True: 2, False: 4.81k]
  ------------------
  232|  4.81k|        m->lock();
  233|  4.81k|    }
_ZN6icu_786UMutex6unlockEv:
  234|  4.81k|    void unlock() { fMutex.load(std::memory_order_relaxed)->unlock(); }
_ZN6icu_7817umtx_storeReleaseERNSt3__16atomicIiEEi:
   79|      7|inline void umtx_storeRelease(u_atomic_int32_t &var, int32_t val) {
   80|      7|    var.store(val, std::memory_order_release);
   81|      7|}
_ZN6icu_7815umtx_atomic_decEPNSt3__16atomicIiEE:
   87|    939|inline int32_t umtx_atomic_dec(u_atomic_int32_t *var) {
   88|    939|    return var->fetch_sub(1) - 1;
   89|    939|}
_ZN6icu_7813umtx_initOnceERNS_9UInitOnceEPFvvE:
  123|     31|inline void umtx_initOnce(UInitOnce &uio, void (U_CALLCONV *fp)()) {
  124|     31|    if (umtx_loadAcquire(uio.fState) == 2) {
  ------------------
  |  Branch (124:9): [True: 30, False: 1]
  ------------------
  125|     30|        return;
  126|     30|    }
  127|      1|    if (umtx_initImplPreInit(uio)) {
  ------------------
  |  Branch (127:9): [True: 1, False: 0]
  ------------------
  128|      1|        (*fp)();
  129|      1|        umtx_initImplPostInit(uio);
  130|      1|    }
  131|      1|}

_ZN6icu_7811ReplaceableC2Ev:
  243|  2.52k|inline Replaceable::Replaceable() {}

_ZN6icu_7811StringPieceC2Ev:
   71|      1|  StringPiece() : ptr_(nullptr), length_(0) { }
_ZNK6icu_7811StringPiece4dataEv:
  200|    211|  const char* data() const { return ptr_; }
_ZNK6icu_7811StringPiece6lengthEv:
  212|    211|  int32_t length() const { return length_; }

_ZN6icu_7813UnicodeString13getArrayStartEv:
 4166|  2.50k|UnicodeString::getArrayStart() {
 4167|  2.50k|  return (fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) ?
  ------------------
  |  Branch (4167:10): [True: 1.56k, False: 939]
  ------------------
 4168|  1.56k|    fUnion.fStackFields.fBuffer : fUnion.fFields.fArray;
 4169|  2.50k|}
_ZNK6icu_7813UnicodeString14hasShortLengthEv:
 4202|  3.44k|UnicodeString::hasShortLength() const {
 4203|  3.44k|  return fUnion.fFields.fLengthAndFlags>=0;
 4204|  3.44k|}
_ZNK6icu_7813UnicodeString14getShortLengthEv:
 4207|  3.44k|UnicodeString::getShortLength() const {
 4208|       |  // fLengthAndFlags must be non-negative -> short length >= 0
 4209|       |  // and arithmetic or logical shift does not matter.
 4210|  3.44k|  return fUnion.fFields.fLengthAndFlags>>kLengthShift;
 4211|  3.44k|}
_ZNK6icu_7813UnicodeString6lengthEv:
 4214|  3.44k|UnicodeString::length() const {
 4215|  3.44k|  return hasShortLength() ? getShortLength() : fUnion.fFields.fLength;
  ------------------
  |  Branch (4215:10): [True: 3.44k, False: 0]
  ------------------
 4216|  3.44k|}
_ZNK6icu_7813UnicodeString11getCapacityEv:
 4219|  5.00k|UnicodeString::getCapacity() const {
 4220|  5.00k|  return (fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) ?
  ------------------
  |  Branch (4220:10): [True: 4.06k, False: 939]
  ------------------
 4221|  4.06k|    US_STACKBUF_SIZE : fUnion.fFields.fCapacity;
 4222|  5.00k|}
_ZNK6icu_7813UnicodeString10isWritableEv:
 4234|  2.50k|{ return !(fUnion.fFields.fLengthAndFlags & (kOpenGetBuffer | kIsBogus)); }
_ZN6icu_7813UnicodeString13setZeroLengthEv:
 4872|    939|UnicodeString::setZeroLength() {
 4873|    939|  fUnion.fFields.fLengthAndFlags &= kAllStorageFlags;
 4874|    939|}
_ZN6icu_7813UnicodeString14setShortLengthEi:
 4877|  2.24k|UnicodeString::setShortLength(int32_t len) {
 4878|       |  // requires 0 <= len <= kMaxShortLength
 4879|  2.24k|  fUnion.fFields.fLengthAndFlags =
 4880|  2.24k|    static_cast<int16_t>((fUnion.fFields.fLengthAndFlags & kAllStorageFlags) | (len << kLengthShift));
 4881|  2.24k|}
_ZN6icu_7813UnicodeString9setLengthEi:
 4884|  2.50k|UnicodeString::setLength(int32_t len) {
 4885|  2.50k|  if(len <= kMaxShortLength) {
  ------------------
  |  Branch (4885:6): [True: 2.24k, False: 260]
  ------------------
 4886|  2.24k|    setShortLength(len);
 4887|  2.24k|  } else {
 4888|    260|    fUnion.fFields.fLengthAndFlags |= kLengthIsLarge;
 4889|    260|    fUnion.fFields.fLength = len;
 4890|    260|  }
 4891|  2.50k|}

uhash.cpp:_ZL9U_FAILURE10UErrorCode:
  737|     20|    inline UBool U_FAILURE(UErrorCode code) { return code > U_ZERO_ERROR; }
unistr_cnv.cpp:_ZL9U_FAILURE10UErrorCode:
  737|  10.0k|    inline UBool U_FAILURE(UErrorCode code) { return code > U_ZERO_ERROR; }
charstr.cpp:_ZL9U_FAILURE10UErrorCode:
  737|    603|    inline UBool U_FAILURE(UErrorCode code) { return code > U_ZERO_ERROR; }
ucnv.cpp:_ZL9U_FAILURE10UErrorCode:
  737|  5.51k|    inline UBool U_FAILURE(UErrorCode code) { return code > U_ZERO_ERROR; }
ucnv.cpp:_ZL9U_SUCCESS10UErrorCode:
  731|  19.7M|    inline UBool U_SUCCESS(UErrorCode code) { return code <= U_ZERO_ERROR; }
ucnv_bld.cpp:_ZL9U_FAILURE10UErrorCode:
  737|  23.6k|    inline UBool U_FAILURE(UErrorCode code) { return code > U_ZERO_ERROR; }
ucnv_bld.cpp:_ZL9U_SUCCESS10UErrorCode:
  731|  6.02k|    inline UBool U_SUCCESS(UErrorCode code) { return code <= U_ZERO_ERROR; }
ucnv_io.cpp:_ZL9U_FAILURE10UErrorCode:
  737|  8.62k|    inline UBool U_FAILURE(UErrorCode code) { return code > U_ZERO_ERROR; }
ucnv_io.cpp:_ZL9U_SUCCESS10UErrorCode:
  731|  4.31k|    inline UBool U_SUCCESS(UErrorCode code) { return code <= U_ZERO_ERROR; }
ucnv_u16.cpp:_ZL9U_SUCCESS10UErrorCode:
  731|   472k|    inline UBool U_SUCCESS(UErrorCode code) { return code <= U_ZERO_ERROR; }
ucnv_u32.cpp:_ZL9U_SUCCESS10UErrorCode:
  731|   155k|    inline UBool U_SUCCESS(UErrorCode code) { return code <= U_ZERO_ERROR; }
ucnvhz.cpp:_ZL9U_FAILURE10UErrorCode:
  737|    247|    inline UBool U_FAILURE(UErrorCode code) { return code > U_ZERO_ERROR; }
ucnvmbcs.cpp:_ZL9U_FAILURE10UErrorCode:
  737|  2.91M|    inline UBool U_FAILURE(UErrorCode code) { return code > U_ZERO_ERROR; }
ucnvmbcs.cpp:_ZL9U_SUCCESS10UErrorCode:
  731|  1.26M|    inline UBool U_SUCCESS(UErrorCode code) { return code <= U_ZERO_ERROR; }
udata.cpp:_ZL9U_FAILURE10UErrorCode:
  737|    215|    inline UBool U_FAILURE(UErrorCode code) { return code > U_ZERO_ERROR; }
udata.cpp:_ZL9U_SUCCESS10UErrorCode:
  731|     87|    inline UBool U_SUCCESS(UErrorCode code) { return code <= U_ZERO_ERROR; }
udatamem.cpp:_ZL9U_FAILURE10UErrorCode:
  737|     12|    inline UBool U_FAILURE(UErrorCode code) { return code > U_ZERO_ERROR; }
ucmndata.cpp:_ZL9U_FAILURE10UErrorCode:
  737|      2|    inline UBool U_FAILURE(UErrorCode code) { return code > U_ZERO_ERROR; }
ucnv2022.cpp:_ZL9U_SUCCESS10UErrorCode:
  731|   124k|    inline UBool U_SUCCESS(UErrorCode code) { return code <= U_ZERO_ERROR; }
ucnv2022.cpp:_ZL9U_FAILURE10UErrorCode:
  737|  72.4k|    inline UBool U_FAILURE(UErrorCode code) { return code > U_ZERO_ERROR; }
ucnv_cb.cpp:_ZL9U_FAILURE10UErrorCode:
  737|  4.93M|    inline UBool U_FAILURE(UErrorCode code) { return code > U_ZERO_ERROR; }

_ZN6icu_7811ReplaceableD2Ev:
  106|  2.52k|Replaceable::~Replaceable() {}
_ZN6icu_7813UnicodeString9removeRefEv:
  151|    939|UnicodeString::removeRef() {
  152|    939|  return umtx_atomic_dec(reinterpret_cast<u_atomic_int32_t*>(fUnion.fFields.fArray) - 1);
  153|    939|}
_ZN6icu_7813UnicodeString12releaseArrayEv:
  161|  2.54k|UnicodeString::releaseArray() {
  162|  2.54k|  if((fUnion.fFields.fLengthAndFlags & kRefCounted) && removeRef() == 0) {
  ------------------
  |  Branch (162:6): [True: 939, False: 1.60k]
  |  Branch (162:56): [True: 939, False: 0]
  ------------------
  163|    939|    uprv_free(reinterpret_cast<int32_t*>(fUnion.fFields.fArray) - 1);
  ------------------
  |  | 1503|    939|#define uprv_free U_ICU_ENTRY_POINT_RENAME(uprv_free)
  |  |  ------------------
  |  |  |  |  123|    939|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|    939|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|    939|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  164|    939|  }
  165|  2.54k|}
_ZN6icu_7813UnicodeString8allocateEi:
  409|    939|UnicodeString::allocate(int32_t capacity) {
  410|    939|  if(capacity <= US_STACKBUF_SIZE) {
  ------------------
  |  Branch (410:6): [True: 0, False: 939]
  ------------------
  411|      0|    fUnion.fFields.fLengthAndFlags = kShortString;
  412|      0|    return true;
  413|      0|  }
  414|    939|  if(capacity <= kMaxCapacity) {
  ------------------
  |  Branch (414:6): [True: 939, False: 0]
  ------------------
  415|    939|    ++capacity;  // for the NUL
  416|       |    // Switch to size_t which is unsigned so that we can allocate up to 4GB.
  417|       |    // Reference counter + UChars.
  418|    939|    size_t numBytes = sizeof(int32_t) + static_cast<size_t>(capacity) * U_SIZEOF_UCHAR;
  ------------------
  |  |  352|    939|#define U_SIZEOF_UCHAR 2
  ------------------
  419|       |    // Round up to a multiple of 16.
  420|    939|    numBytes = (numBytes + 15) & ~15;
  421|    939|    int32_t* array = static_cast<int32_t*>(uprv_malloc(numBytes));
  ------------------
  |  | 1524|    939|#define uprv_malloc U_ICU_ENTRY_POINT_RENAME(uprv_malloc)
  |  |  ------------------
  |  |  |  |  123|    939|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|    939|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|    939|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  422|    939|    if(array != nullptr) {
  ------------------
  |  Branch (422:8): [True: 939, False: 0]
  ------------------
  423|       |      // set initial refCount and point behind the refCount
  424|    939|      *array++ = 1;
  425|    939|      numBytes -= sizeof(int32_t);
  426|       |
  427|       |      // have fArray point to the first char16_t
  428|    939|      fUnion.fFields.fArray = reinterpret_cast<char16_t*>(array);
  429|    939|      fUnion.fFields.fCapacity = static_cast<int32_t>(numBytes / U_SIZEOF_UCHAR);
  ------------------
  |  |  352|    939|#define U_SIZEOF_UCHAR 2
  ------------------
  430|    939|      fUnion.fFields.fLengthAndFlags = kLongString;
  431|    939|      return true;
  432|    939|    }
  433|    939|  }
  434|      0|  fUnion.fFields.fLengthAndFlags = kIsBogus;
  435|      0|  fUnion.fFields.fArray = nullptr;
  436|      0|  fUnion.fFields.fCapacity = 0;
  437|      0|  return false;
  438|    939|}
_ZN6icu_7813UnicodeStringD2Ev:
  462|  2.52k|{
  463|       |#ifdef UNISTR_COUNT_FINAL_STRING_LENGTHS
  464|       |  // Count lengths of strings at the end of their lifetime.
  465|       |  // Useful for discussion of a desirable stack buffer size.
  466|       |  // Count the contents length, not the optional NUL terminator nor further capacity.
  467|       |  // Ignore open-buffer strings and strings which alias external storage.
  468|       |  if((fUnion.fFields.fLengthAndFlags&(kOpenGetBuffer|kReadonlyAlias|kWritableAlias)) == 0) {
  469|       |    if(hasShortLength()) {
  470|       |      umtx_atomic_inc(finalLengthCounts + getShortLength());
  471|       |    } else {
  472|       |      umtx_atomic_inc(&beyondCount);
  473|       |    }
  474|       |  }
  475|       |#endif
  476|       |
  477|  2.52k|  releaseArray();
  478|  2.52k|}
_ZN6icu_7813UnicodeString10setToBogusEv:
 1283|     19|{
 1284|     19|  releaseArray();
 1285|       |
 1286|     19|  fUnion.fFields.fLengthAndFlags = kIsBogus;
 1287|     19|  fUnion.fFields.fArray = nullptr;
 1288|     19|  fUnion.fFields.fCapacity = 0;
 1289|     19|}
_ZN6icu_7813UnicodeString18cloneArrayIfNeededEiiaPPia:
 1917|  2.50k|                                  UBool forceClone) {
 1918|       |  // default parameters need to be static, therefore
 1919|       |  // the defaults are -1 to have convenience defaults
 1920|  2.50k|  if(newCapacity == -1) {
  ------------------
  |  Branch (1920:6): [True: 0, False: 2.50k]
  ------------------
 1921|      0|    newCapacity = getCapacity();
 1922|      0|  }
 1923|       |
 1924|       |  // while a getBuffer(minCapacity) is "open",
 1925|       |  // prevent any modifications of the string by returning false here
 1926|       |  // if the string is bogus, then only an assignment or similar can revive it
 1927|  2.50k|  if(!isWritable()) {
  ------------------
  |  Branch (1927:6): [True: 0, False: 2.50k]
  ------------------
 1928|      0|    return false;
 1929|      0|  }
 1930|       |
 1931|       |  /*
 1932|       |   * We need to make a copy of the array if
 1933|       |   * the buffer is read-only, or
 1934|       |   * the buffer is refCounted (shared), and refCount>1, or
 1935|       |   * the buffer is too small.
 1936|       |   * Return false if memory could not be allocated.
 1937|       |   */
 1938|  2.50k|  if(forceClone ||
  ------------------
  |  Branch (1938:6): [True: 0, False: 2.50k]
  ------------------
 1939|  2.50k|     fUnion.fFields.fLengthAndFlags & kBufferIsReadonly ||
  ------------------
  |  Branch (1939:6): [True: 0, False: 2.50k]
  ------------------
 1940|  2.50k|     (fUnion.fFields.fLengthAndFlags & kRefCounted && refCount() > 1) ||
  ------------------
  |  Branch (1940:7): [True: 0, False: 2.50k]
  |  Branch (1940:55): [True: 0, False: 0]
  ------------------
 1941|  2.50k|     newCapacity > getCapacity()
  ------------------
  |  Branch (1941:6): [True: 939, False: 1.56k]
  ------------------
 1942|  2.50k|  ) {
 1943|       |    // check growCapacity for default value and use of the stack buffer
 1944|    939|    if(growCapacity < 0) {
  ------------------
  |  Branch (1944:8): [True: 0, False: 939]
  ------------------
 1945|      0|      growCapacity = newCapacity;
 1946|    939|    } else if(newCapacity <= US_STACKBUF_SIZE && growCapacity > US_STACKBUF_SIZE) {
  ------------------
  |  Branch (1946:15): [True: 0, False: 939]
  |  Branch (1946:50): [True: 0, False: 0]
  ------------------
 1947|      0|      growCapacity = US_STACKBUF_SIZE;
 1948|    939|    } else if(newCapacity > growCapacity) {
  ------------------
  |  Branch (1948:15): [True: 0, False: 939]
  ------------------
 1949|      0|      setToBogus();
 1950|      0|      return false;  // bad inputs
 1951|      0|    }
 1952|    939|    if(growCapacity > kMaxCapacity) {
  ------------------
  |  Branch (1952:8): [True: 0, False: 939]
  ------------------
 1953|      0|      setToBogus();
 1954|      0|      return false;
 1955|      0|    }
 1956|       |
 1957|       |    // save old values
 1958|    939|    char16_t oldStackBuffer[US_STACKBUF_SIZE];
 1959|    939|    char16_t *oldArray;
 1960|    939|    int32_t oldLength = length();
 1961|    939|    int16_t flags = fUnion.fFields.fLengthAndFlags;
 1962|       |
 1963|    939|    if(flags&kUsingStackBuffer) {
  ------------------
  |  Branch (1963:8): [True: 939, False: 0]
  ------------------
 1964|    939|      U_ASSERT(!(flags&kRefCounted)); /* kRefCounted and kUsingStackBuffer are mutally exclusive */
  ------------------
  |  |   35|    939|#   define U_ASSERT(exp) (void)0
  ------------------
 1965|    939|      if(doCopyArray && growCapacity > US_STACKBUF_SIZE) {
  ------------------
  |  Branch (1965:10): [True: 0, False: 939]
  |  Branch (1965:25): [True: 0, False: 0]
  ------------------
 1966|       |        // copy the stack buffer contents because it will be overwritten with
 1967|       |        // fUnion.fFields values
 1968|      0|        us_arrayCopy(fUnion.fStackFields.fBuffer, 0, oldStackBuffer, 0, oldLength);
 1969|      0|        oldArray = oldStackBuffer;
 1970|    939|      } else {
 1971|    939|        oldArray = nullptr; // no need to copy from the stack buffer to itself
 1972|    939|      }
 1973|    939|    } else {
 1974|      0|      oldArray = fUnion.fFields.fArray;
 1975|      0|      U_ASSERT(oldArray!=nullptr); /* when stack buffer is not used, oldArray must have a non-nullptr reference */
  ------------------
  |  |   35|      0|#   define U_ASSERT(exp) (void)0
  ------------------
 1976|      0|    }
 1977|       |
 1978|       |    // allocate a new array
 1979|    939|    if(allocate(growCapacity) ||
  ------------------
  |  Branch (1979:8): [True: 939, False: 0]
  ------------------
 1980|    939|       (newCapacity < growCapacity && allocate(newCapacity))
  ------------------
  |  Branch (1980:9): [True: 0, False: 0]
  |  Branch (1980:39): [True: 0, False: 0]
  ------------------
 1981|    939|    ) {
 1982|    939|      if(doCopyArray) {
  ------------------
  |  Branch (1982:10): [True: 0, False: 939]
  ------------------
 1983|       |        // copy the contents
 1984|       |        // do not copy more than what fits - it may be smaller than before
 1985|      0|        int32_t minLength = oldLength;
 1986|      0|        newCapacity = getCapacity();
 1987|      0|        if(newCapacity < minLength) {
  ------------------
  |  Branch (1987:12): [True: 0, False: 0]
  ------------------
 1988|      0|          minLength = newCapacity;
 1989|      0|        }
 1990|      0|        if(oldArray != nullptr) {
  ------------------
  |  Branch (1990:12): [True: 0, False: 0]
  ------------------
 1991|      0|          us_arrayCopy(oldArray, 0, getArrayStart(), 0, minLength);
 1992|      0|        }
 1993|      0|        setLength(minLength);
 1994|    939|      } else {
 1995|    939|        setZeroLength();
 1996|    939|      }
 1997|       |
 1998|       |      // release the old array
 1999|    939|      if(flags & kRefCounted) {
  ------------------
  |  Branch (1999:10): [True: 0, False: 939]
  ------------------
 2000|       |        // the array is refCounted; decrement and release if 0
 2001|      0|        u_atomic_int32_t* pRefCount = reinterpret_cast<u_atomic_int32_t*>(oldArray) - 1;
 2002|      0|        if(umtx_atomic_dec(pRefCount) == 0) {
  ------------------
  |  Branch (2002:12): [True: 0, False: 0]
  ------------------
 2003|      0|          if (pBufferToDelete == nullptr) {
  ------------------
  |  Branch (2003:15): [True: 0, False: 0]
  ------------------
 2004|       |              // Note: cast to (void *) is needed with MSVC, where u_atomic_int32_t
 2005|       |              // is defined as volatile. (Volatile has useful non-standard behavior
 2006|       |              //   with this compiler.)
 2007|      0|            uprv_free((void *)pRefCount);
  ------------------
  |  | 1503|      0|#define uprv_free U_ICU_ENTRY_POINT_RENAME(uprv_free)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2008|      0|          } else {
 2009|       |            // the caller requested to delete it himself
 2010|      0|            *pBufferToDelete = reinterpret_cast<int32_t*>(pRefCount);
 2011|      0|          }
 2012|      0|        }
 2013|      0|      }
 2014|    939|    } else {
 2015|       |      // not enough memory for growCapacity and not even for the smaller newCapacity
 2016|       |      // reset the old values for setToBogus() to release the array
 2017|      0|      if(!(flags&kUsingStackBuffer)) {
  ------------------
  |  Branch (2017:10): [True: 0, False: 0]
  ------------------
 2018|      0|        fUnion.fFields.fArray = oldArray;
 2019|      0|      }
 2020|      0|      fUnion.fFields.fLengthAndFlags = flags;
 2021|      0|      setToBogus();
 2022|      0|      return false;
 2023|      0|    }
 2024|    939|  }
 2025|  2.50k|  return true;
 2026|  2.50k|}

_ZN6icu_7813UnicodeStringC2EPKciS2_:
   72|  2.52k|                             const char *codepage) {
   73|  2.52k|    fUnion.fFields.fLengthAndFlags = kShortString;
   74|  2.52k|    if (codepageData != nullptr) {
  ------------------
  |  Branch (74:9): [True: 2.52k, False: 0]
  ------------------
   75|  2.52k|        doCodepageCreate(codepageData, dataLength, codepage);
   76|  2.52k|    }
   77|  2.52k|}
_ZN6icu_7813UnicodeString16doCodepageCreateEPKciS2_:
  305|  2.52k|{
  306|       |    // if there's nothing to convert, do nothing
  307|  2.52k|    if (codepageData == nullptr || dataLength == 0 || dataLength < -1) {
  ------------------
  |  Branch (307:9): [True: 0, False: 2.52k]
  |  Branch (307:36): [True: 1, False: 2.52k]
  |  Branch (307:55): [True: 0, False: 2.52k]
  ------------------
  308|      1|        return;
  309|      1|    }
  310|  2.52k|    if(dataLength == -1) {
  ------------------
  |  Branch (310:8): [True: 0, False: 2.52k]
  ------------------
  311|      0|        dataLength = static_cast<int32_t>(uprv_strlen(codepageData));
  ------------------
  |  |   37|      0|#define uprv_strlen(str) U_STANDARD_CPP_NAMESPACE strlen(str)
  |  |  ------------------
  |  |  |  |  393|      0|#define U_STANDARD_CPP_NAMESPACE        ::
  |  |  ------------------
  ------------------
  312|      0|    }
  313|       |
  314|  2.52k|    UErrorCode status = U_ZERO_ERROR;
  315|       |
  316|       |    // create the converter
  317|       |    // if the codepage is the default, use our cache
  318|       |    // if it is an empty string, then use the "invariant character" conversion
  319|  2.52k|    UConverter *converter;
  320|  2.52k|    if (codepage == nullptr) {
  ------------------
  |  Branch (320:9): [True: 0, False: 2.52k]
  ------------------
  321|      0|        const char *defaultName = ucnv_getDefaultName();
  ------------------
  |  |  674|      0|#define ucnv_getDefaultName U_ICU_ENTRY_POINT_RENAME(ucnv_getDefaultName)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  322|      0|        if(UCNV_FAST_IS_UTF8(defaultName)) {
  ------------------
  |  |   40|      0|    (((name[0]=='U' ? \
  |  |  ------------------
  |  |  |  Branch (40:6): [True: 0, False: 0]
  |  |  |  Branch (40:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   41|      0|      (                name[1]=='T' && name[2]=='F') : \
  |  |  ------------------
  |  |  |  Branch (41:24): [True: 0, False: 0]
  |  |  |  Branch (41:40): [True: 0, False: 0]
  |  |  ------------------
  |  |   42|      0|      (name[0]=='u' && name[1]=='t' && name[2]=='f'))) \
  |  |  ------------------
  |  |  |  Branch (42:8): [True: 0, False: 0]
  |  |  |  Branch (42:24): [True: 0, False: 0]
  |  |  |  Branch (42:40): [True: 0, False: 0]
  |  |  ------------------
  |  |   43|      0|  && (name[3]=='-' ? \
  |  |  ------------------
  |  |  |  Branch (43:6): [True: 0, False: 0]
  |  |  |  Branch (43:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   44|      0|     (name[4]=='8' && name[5]==0) : \
  |  |  ------------------
  |  |  |  Branch (44:7): [True: 0, False: 0]
  |  |  |  Branch (44:23): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|     (name[3]=='8' && name[4]==0)))
  |  |  ------------------
  |  |  |  Branch (45:7): [True: 0, False: 0]
  |  |  |  Branch (45:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  323|      0|            setToUTF8(StringPiece(codepageData, dataLength));
  324|      0|            return;
  325|      0|        }
  326|      0|        converter = u_getDefaultConverter(&status);
  ------------------
  |  |  273|      0|#define u_getDefaultConverter U_ICU_ENTRY_POINT_RENAME(u_getDefaultConverter)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  327|  2.52k|    } else if (*codepage == 0) {
  ------------------
  |  Branch (327:16): [True: 0, False: 2.52k]
  ------------------
  328|       |        // use the "invariant characters" conversion
  329|      0|        if(cloneArrayIfNeeded(dataLength, dataLength, false)) {
  ------------------
  |  Branch (329:12): [True: 0, False: 0]
  ------------------
  330|      0|            u_charsToUChars(codepageData, getArrayStart(), dataLength);
  ------------------
  |  |  226|      0|#define u_charsToUChars U_ICU_ENTRY_POINT_RENAME(u_charsToUChars)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  331|      0|            setLength(dataLength);
  332|      0|        } else {
  333|      0|            setToBogus();
  334|      0|        }
  335|      0|        return;
  336|  2.52k|    } else {
  337|  2.52k|        converter = ucnv_open(codepage, &status);
  ------------------
  |  |  701|  2.52k|#define ucnv_open U_ICU_ENTRY_POINT_RENAME(ucnv_open)
  |  |  ------------------
  |  |  |  |  123|  2.52k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  2.52k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  2.52k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  338|  2.52k|    }
  339|       |
  340|       |    // if we failed, set the appropriate flags and return
  341|  2.52k|    if(U_FAILURE(status)) {
  ------------------
  |  Branch (341:8): [True: 19, False: 2.50k]
  ------------------
  342|     19|        setToBogus();
  343|     19|        return;
  344|     19|    }
  345|       |
  346|       |    // perform the conversion
  347|  2.50k|    doCodepageCreate(codepageData, dataLength, converter, status);
  348|  2.50k|    if(U_FAILURE(status)) {
  ------------------
  |  Branch (348:8): [True: 0, False: 2.50k]
  ------------------
  349|      0|        setToBogus();
  350|      0|    }
  351|       |
  352|       |    // close the converter
  353|  2.50k|    if (codepage == nullptr) {
  ------------------
  |  Branch (353:9): [True: 0, False: 2.50k]
  ------------------
  354|      0|        u_releaseDefaultConverter(converter);
  ------------------
  |  |  344|      0|#define u_releaseDefaultConverter U_ICU_ENTRY_POINT_RENAME(u_releaseDefaultConverter)
  |  |  ------------------
  |  |  |  |  123|      0|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|      0|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  355|  2.50k|    } else {
  356|  2.50k|        ucnv_close(converter);
  ------------------
  |  |  639|  2.50k|#define ucnv_close U_ICU_ENTRY_POINT_RENAME(ucnv_close)
  |  |  ------------------
  |  |  |  |  123|  2.50k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  2.50k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  2.50k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  357|  2.50k|    }
  358|  2.50k|}
_ZN6icu_7813UnicodeString16doCodepageCreateEPKciP10UConverterR10UErrorCode:
  365|  2.50k|{
  366|  2.50k|    if(U_FAILURE(status)) {
  ------------------
  |  Branch (366:8): [True: 0, False: 2.50k]
  ------------------
  367|      0|        return;
  368|      0|    }
  369|       |
  370|       |    // set up the conversion parameters
  371|  2.50k|    const char *mySource     = codepageData;
  372|  2.50k|    const char *mySourceEnd  = mySource + dataLength;
  373|  2.50k|    char16_t *array, *myTarget;
  374|       |
  375|       |    // estimate the size needed:
  376|  2.50k|    int32_t arraySize;
  377|  2.50k|    if(dataLength <= US_STACKBUF_SIZE) {
  ------------------
  |  Branch (377:8): [True: 1.56k, False: 939]
  ------------------
  378|       |        // try to use the stack buffer
  379|  1.56k|        arraySize = US_STACKBUF_SIZE;
  380|  1.56k|    } else {
  381|       |        // 1.25 char16_t's per source byte should cover most cases
  382|    939|        arraySize = dataLength + (dataLength >> 2);
  383|    939|    }
  384|       |
  385|       |    // we do not care about the current contents
  386|  2.50k|    UBool doCopyArray = false;
  387|  2.50k|    for(;;) {
  388|  2.50k|        if(!cloneArrayIfNeeded(arraySize, arraySize, doCopyArray)) {
  ------------------
  |  Branch (388:12): [True: 0, False: 2.50k]
  ------------------
  389|      0|            setToBogus();
  390|      0|            break;
  391|      0|        }
  392|       |
  393|       |        // perform the conversion
  394|  2.50k|        array = getArrayStart();
  395|  2.50k|        myTarget = array + length();
  396|  2.50k|        UErrorCode bufferStatus = U_ZERO_ERROR;
  397|  2.50k|        ucnv_toUnicode(converter, &myTarget,  array + getCapacity(),
  ------------------
  |  |  724|  2.50k|#define ucnv_toUnicode U_ICU_ENTRY_POINT_RENAME(ucnv_toUnicode)
  |  |  ------------------
  |  |  |  |  123|  2.50k|#       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  2.50k|#       define U_DEF2_ICU_ENTRY_POINT_RENAME(x,y) U_DEF_ICU_ENTRY_POINT_RENAME(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  121|  2.50k|#       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  398|  2.50k|            &mySource, mySourceEnd, nullptr, true, &bufferStatus);
  399|       |
  400|       |        // update the conversion parameters
  401|  2.50k|        setLength(static_cast<int32_t>(myTarget - array));
  402|       |
  403|       |        // allocate more space and copy data, if needed
  404|  2.50k|        if(bufferStatus == U_BUFFER_OVERFLOW_ERROR) {
  ------------------
  |  Branch (404:12): [True: 0, False: 2.50k]
  ------------------
  405|       |            // keep the previous conversion results
  406|      0|            doCopyArray = true;
  407|       |
  408|       |            // estimate the new size needed, larger than before
  409|       |            // try 2 char16_t's per remaining source byte
  410|      0|            arraySize = static_cast<int32_t>(length() + 2 * (mySourceEnd - mySource));
  411|  2.50k|        } else {
  412|  2.50k|            if (U_FAILURE(bufferStatus)) {
  ------------------
  |  Branch (412:17): [True: 0, False: 2.50k]
  ------------------
  413|      0|                status = bufferStatus;
  414|      0|            }
  415|  2.50k|            break;
  416|  2.50k|        }
  417|  2.50k|    }
  418|  2.50k|}

_ZN6icu_787UObjectD2Ev:
   94|  2.52k|UObject::~UObject() {}

_ZN6icu_784UTF812isValidTrailEihii:
  138|   188k|    static inline UBool isValidTrail(int32_t prev, uint8_t t, int32_t i, int32_t length) {
  139|       |        // The first trail byte after a 3- or 4-byte lead byte
  140|       |        // needs to be validated together with its lead byte.
  141|   188k|        if (length <= 2 || i > 1) {
  ------------------
  |  Branch (141:13): [True: 99.8k, False: 88.1k]
  |  Branch (141:28): [True: 17.2k, False: 70.9k]
  ------------------
  142|   117k|            return U8_IS_TRAIL(t);
  ------------------
  |  |  190|   117k|#define U8_IS_TRAIL(c) ((int8_t)(c)<-0x40)
  ------------------
  143|   117k|        } else if (length == 3) {
  ------------------
  |  Branch (143:20): [True: 52.9k, False: 17.9k]
  ------------------
  144|  52.9k|            return U8_IS_VALID_LEAD3_AND_T1(prev, t);
  ------------------
  |  |   98|  52.9k|#define U8_IS_VALID_LEAD3_AND_T1(lead, t1) (U8_LEAD3_T1_BITS[(lead)&0xf]&(1<<((uint8_t)(t1)>>5)))
  |  |  ------------------
  |  |  |  |   91|  52.9k|#define U8_LEAD3_T1_BITS "\x20\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x10\x30\x30"
  |  |  ------------------
  ------------------
  145|  52.9k|        } else {  // length == 4
  146|  17.9k|            return U8_IS_VALID_LEAD4_AND_T1(prev, t);
  ------------------
  |  |  115|  17.9k|#define U8_IS_VALID_LEAD4_AND_T1(lead, t1) (U8_LEAD4_T1_BITS[(uint8_t)(t1)>>4]&(1<<((lead)&7)))
  |  |  ------------------
  |  |  |  |  108|  17.9k|#define U8_LEAD4_T1_BITS "\x00\x00\x00\x00\x00\x00\x00\x00\x1E\x0F\x0F\x0F\x00\x00\x00\x00"
  |  |  ------------------
  ------------------
  147|  17.9k|        }
  148|   188k|    }

ustr_hashCharsN_78:
 1528|  2.40k|ustr_hashCharsN(const char *str, int32_t length) {
 1529|  2.40k|    STRING_HASH(uint8_t, str, length, *p);
  ------------------
  |  | 1506|  2.40k|#define STRING_HASH(TYPE, STR, STRLEN, DEREF) UPRV_BLOCK_MACRO_BEGIN { \
  |  |  ------------------
  |  |  |  |  169|  2.40k|#define UPRV_BLOCK_MACRO_BEGIN do
  |  |  ------------------
  |  | 1507|  2.40k|    uint32_t hash = 0;                        \
  |  | 1508|  2.40k|    const TYPE *p = (const TYPE*) STR;        \
  |  | 1509|  2.40k|    if (p != nullptr) {                          \
  |  |  ------------------
  |  |  |  Branch (1509:9): [True: 2.40k, False: 0]
  |  |  ------------------
  |  | 1510|  2.40k|        int32_t len = (int32_t)(STRLEN);      \
  |  | 1511|  2.40k|        int32_t inc = ((len - 32) / 32) + 1;  \
  |  | 1512|  2.40k|        const TYPE *limit = p + len;          \
  |  | 1513|  39.0k|        while (p<limit) {                     \
  |  |  ------------------
  |  |  |  Branch (1513:16): [True: 36.6k, False: 2.40k]
  |  |  ------------------
  |  | 1514|  36.6k|            hash = (hash * 37) + DEREF;       \
  |  | 1515|  36.6k|            p += inc;                         \
  |  | 1516|  36.6k|        }                                     \
  |  | 1517|  2.40k|    }                                         \
  |  | 1518|  2.40k|    return static_cast<int32_t>(hash);        \
  |  | 1519|  2.40k|} UPRV_BLOCK_MACRO_END
  |  |  ------------------
  |  |  |  |  178|  2.40k|#define UPRV_BLOCK_MACRO_END while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:37): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1530|  2.40k|}

_ZN14IcuEnvironmentC2Ev:
   14|      2|  IcuEnvironment() {
   15|       |    // nothing to initialize yet;
   16|      2|  }

LLVMFuzzerTestOneInput:
   68|  2.52k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   69|  2.52k|  if (size < 1) {
  ------------------
  |  Branch (69:7): [True: 0, False: 2.52k]
  ------------------
   70|      0|    return 0;
   71|      0|  }
   72|       |
   73|       |  // First byte is used for random converter selection.
   74|  2.52k|  uint8_t rnd = *data;
   75|  2.52k|  data++;
   76|  2.52k|  size--;
   77|       |
   78|  2.52k|  std::unique_ptr<char[]> fuzzbuff(new char[size]);
   79|  2.52k|  std::memcpy(fuzzbuff.get(), data, size);
   80|       |
   81|  2.52k|  icu::UnicodeString str(fuzzbuff.get(), size,
   82|  2.52k|                         kConverters[rnd % kConverters.size()]);
   83|       |
   84|  2.52k|  return 0;
   85|  2.52k|}

