LLVMFuzzerTestOneInput:
   20|    780|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   21|    780|  std::vector<uint8_t> image_data = {data, data + size};
   22|    780|  cv::Mat data_matrix =
   23|    780|      cv::Mat(1, image_data.size(), CV_8UC1, image_data.data());
  ------------------
  |  |   88|    780|#define CV_8UC1 CV_MAKETYPE(CV_8U,1)
  |  |  ------------------
  |  |  |  |   85|    780|#define CV_MAKETYPE(depth,cn) (CV_MAT_DEPTH(depth) + (((cn)-1) << CV_CN_SHIFT))
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    780|#define CV_MAT_DEPTH(flags)     ((flags) & CV_MAT_DEPTH_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   82|    780|#define CV_MAT_DEPTH_MASK       (CV_DEPTH_MAX - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   71|    780|#define CV_DEPTH_MAX  (1 << CV_CN_SHIFT)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define CV_MAKETYPE(depth,cn) (CV_MAT_DEPTH(depth) + (((cn)-1) << CV_CN_SHIFT))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   24|    780|  try {
   25|    780|    std::vector<uchar> buffer;
   26|    780|    cv::imencode(".tiff", data_matrix, buffer);
   27|    780|  } catch (cv::Exception e) {
   28|       |    // Do nothing.
   29|      0|  }
   30|    780|  return 0;
   31|    780|}

ittnotify_static.c:__itt_interlocked_compare_exchange:
  371|      2|{
  372|      2|    return __sync_val_compare_and_swap(ptr, exchange, comperand);
  373|      2|}

__itt_init_ittlib:
 1477|      2|{
 1478|      2|    int i;
 1479|      2|    __itt_group_id groups;
 1480|       |#ifdef ITT_COMPLETE_GROUP
 1481|       |    __itt_group_id zero_group = __itt_group_none;
 1482|       |#endif /* ITT_COMPLETE_GROUP */
 1483|      2|    static volatile TIDT current_thread = 0;
 1484|       |
 1485|      2|    if (!_N_(_ittapi_global).api_initialized)
  ------------------
  |  |   32|      2|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      2|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      2|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1485:9): [True: 2, False: 0]
  ------------------
 1486|      2|    {
 1487|      2|#ifndef ITT_SIMPLE_INIT
 1488|      2|        ITT_MUTEX_INIT_AND_LOCK(_N_(_ittapi_global));
  ------------------
  |  |  125|      2|#define ITT_MUTEX_INIT_AND_LOCK(p) {                                 \
  |  |  126|      2|    if (PTHREAD_SYMBOLS)                                             \
  |  |  ------------------
  |  |  |  |  389|      2|#define PTHREAD_SYMBOLS (pthread_mutex_init && pthread_mutex_lock && pthread_mutex_unlock && pthread_mutex_destroy && pthread_mutexattr_init && pthread_mutexattr_settype && pthread_mutexattr_destroy && pthread_self)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (389:26): [True: 2, False: 0]
  |  |  |  |  |  Branch (389:48): [True: 2, False: 0]
  |  |  |  |  |  Branch (389:70): [True: 2, False: 0]
  |  |  |  |  |  Branch (389:94): [True: 2, False: 0]
  |  |  |  |  |  Branch (389:119): [True: 2, False: 0]
  |  |  |  |  |  Branch (389:145): [True: 2, False: 0]
  |  |  |  |  |  Branch (389:174): [True: 2, False: 0]
  |  |  |  |  |  Branch (389:203): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  127|      2|    {                                                                \
  |  |  128|      2|        if (!p.mutex_initialized)                                    \
  |  |  ------------------
  |  |  |  Branch (128:13): [True: 2, False: 0]
  |  |  ------------------
  |  |  129|      2|        {                                                            \
  |  |  130|      2|            if (__itt_interlocked_compare_exchange(&p.atomic_counter, 1, 0) == 0) \
  |  |  ------------------
  |  |  |  Branch (130:17): [True: 2, False: 0]
  |  |  ------------------
  |  |  131|      2|            {                                                        \
  |  |  132|      2|                __itt_mutex_init(&p.mutex);                          \
  |  |  ------------------
  |  |  |  |  288|      2|#define __itt_mutex_init(mutex)   {\
  |  |  |  |  289|      2|    pthread_mutexattr_t mutex_attr;                                         \
  |  |  |  |  290|      2|    int error_code = pthread_mutexattr_init(&mutex_attr);                   \
  |  |  |  |  291|      2|    if (error_code)                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:9): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  292|      2|        __itt_report_error(__itt_error_system, "pthread_mutexattr_init",    \
  |  |  |  |  293|      0|                           error_code);                                     \
  |  |  |  |  294|      2|    error_code = pthread_mutexattr_settype(&mutex_attr,                     \
  |  |  |  |  295|      2|                                           PTHREAD_MUTEX_RECURSIVE);        \
  |  |  |  |  296|      2|    if (error_code)                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (296:9): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  297|      2|        __itt_report_error(__itt_error_system, "pthread_mutexattr_settype", \
  |  |  |  |  298|      0|                           error_code);                                     \
  |  |  |  |  299|      2|    error_code = pthread_mutex_init(mutex, &mutex_attr);                    \
  |  |  |  |  300|      2|    if (error_code)                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (300:9): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  301|      2|        __itt_report_error(__itt_error_system, "pthread_mutex_init",        \
  |  |  |  |  302|      0|                           error_code);                                     \
  |  |  |  |  303|      2|    error_code = pthread_mutexattr_destroy(&mutex_attr);                    \
  |  |  |  |  304|      2|    if (error_code)                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (304:9): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  305|      2|        __itt_report_error(__itt_error_system, "pthread_mutexattr_destroy", \
  |  |  |  |  306|      0|                           error_code);                                     \
  |  |  |  |  307|      2|}
  |  |  ------------------
  |  |  133|      2|                p.mutex_initialized = 1;                             \
  |  |  134|      2|            }                                                        \
  |  |  135|      2|            else                                                     \
  |  |  136|      2|                while (!p.mutex_initialized)                         \
  |  |  ------------------
  |  |  |  Branch (136:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  137|      0|                    __itt_thread_yield();                            \
  |  |  ------------------
  |  |  |  |  338|      0|#define __itt_thread_yield()      sched_yield()
  |  |  ------------------
  |  |  138|      2|        }                                                            \
  |  |  139|      2|        __itt_mutex_lock(&p.mutex);                                  \
  |  |  ------------------
  |  |  |  |  308|      2|#define __itt_mutex_lock(mutex)   pthread_mutex_lock(mutex)
  |  |  ------------------
  |  |  140|      2|    }                                                                \
  |  |  141|      2|}
  ------------------
 1489|      2|#endif /* ITT_SIMPLE_INIT */
 1490|       |
 1491|      2|        if (!_N_(_ittapi_global).api_initialized)
  ------------------
  |  |   32|      2|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      2|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      2|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1491:13): [True: 2, False: 0]
  ------------------
 1492|      2|        {
 1493|      2|            if (current_thread == 0)
  ------------------
  |  Branch (1493:17): [True: 2, False: 0]
  ------------------
 1494|      2|            {
 1495|      2|                if (PTHREAD_SYMBOLS) current_thread = __itt_thread_id();
  ------------------
  |  |  389|      2|#define PTHREAD_SYMBOLS (pthread_mutex_init && pthread_mutex_lock && pthread_mutex_unlock && pthread_mutex_destroy && pthread_mutexattr_init && pthread_mutexattr_settype && pthread_mutexattr_destroy && pthread_self)
  |  |  ------------------
  |  |  |  Branch (389:26): [True: 2, False: 0]
  |  |  |  Branch (389:48): [True: 2, False: 0]
  |  |  |  Branch (389:70): [True: 2, False: 0]
  |  |  |  Branch (389:94): [True: 2, False: 0]
  |  |  |  Branch (389:119): [True: 2, False: 0]
  |  |  |  Branch (389:145): [True: 2, False: 0]
  |  |  |  Branch (389:174): [True: 2, False: 0]
  |  |  |  Branch (389:203): [True: 2, False: 0]
  |  |  ------------------
  ------------------
                              if (PTHREAD_SYMBOLS) current_thread = __itt_thread_id();
  ------------------
  |  |  337|      2|#define __itt_thread_id()         pthread_self()
  ------------------
 1496|      2|                if (lib_name == NULL)
  ------------------
  |  Branch (1496:21): [True: 2, False: 0]
  ------------------
 1497|      2|                {
 1498|      2|                    lib_name = __itt_get_lib_name();
 1499|      2|                }
 1500|      2|                groups = __itt_get_groups();
 1501|      2|                if (DL_SYMBOLS && (groups != __itt_group_none || lib_name != NULL))
  ------------------
  |  |  379|      4|#define DL_SYMBOLS (dlopen && dlsym && dlclose)
  |  |  ------------------
  |  |  |  Branch (379:21): [True: 2, False: 0]
  |  |  |  Branch (379:31): [True: 2, False: 0]
  |  |  |  Branch (379:40): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1501:36): [True: 0, False: 2]
  |  Branch (1501:66): [True: 0, False: 2]
  ------------------
 1502|      0|                {
 1503|      0|                    _N_(_ittapi_global).lib = __itt_load_lib((lib_name == NULL) ? ittnotify_lib_name : lib_name);
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  _N_(_ittapi_global).lib = __itt_load_lib((lib_name == NULL) ? ittnotify_lib_name : lib_name);
  ------------------
  |  |  311|      0|#define __itt_load_lib(name)      dlopen(name, RTLD_LAZY)
  |  |  ------------------
  |  |  |  Branch (311:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1504|       |
 1505|      0|                    if (_N_(_ittapi_global).lib != NULL)
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1505:25): [True: 0, False: 0]
  ------------------
 1506|      0|                    {
 1507|      0|                        _N_(_ittapi_global).state = __itt_collection_init_successful;
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1508|      0|                        __itt_api_init_t* __itt_api_init_ptr;
 1509|      0|                        int lib_version = __itt_lib_version(_N_(_ittapi_global).lib);
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1510|       |
 1511|      0|                        switch (lib_version)
  ------------------
  |  Branch (1511:33): [True: 0, False: 0]
  ------------------
 1512|      0|                        {
 1513|      0|                        case 0:
  ------------------
  |  Branch (1513:25): [True: 0, False: 0]
  ------------------
 1514|      0|                            groups = __itt_group_legacy;
 1515|      0|                            ITT_ATTRIBUTE_FALLTHROUGH;
  ------------------
  |  |   66|      0|#define ITT_ATTRIBUTE_FALLTHROUGH __attribute__((fallthrough))
  ------------------
 1516|      0|                        case 1:
  ------------------
  |  Branch (1516:25): [True: 0, False: 0]
  ------------------
 1517|       |                            /* Fill all pointers from dynamic library */
 1518|      0|                            for (i = 0; _N_(_ittapi_global).api_list_ptr[i].name != NULL; i++)
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1518:41): [True: 0, False: 0]
  ------------------
 1519|      0|                            {
 1520|      0|                                if (_N_(_ittapi_global).api_list_ptr[i].group & groups & init_groups)
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1520:37): [True: 0, False: 0]
  ------------------
 1521|      0|                                {
 1522|      0|                                    *_N_(_ittapi_global).api_list_ptr[i].func_ptr = (void*)__itt_get_proc(_N_(_ittapi_global).lib, _N_(_ittapi_global).api_list_ptr[i].name);
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                                  *_N_(_ittapi_global).api_list_ptr[i].func_ptr = (void*)__itt_get_proc(_N_(_ittapi_global).lib, _N_(_ittapi_global).api_list_ptr[i].name);
  ------------------
  |  |  287|      0|#define __itt_get_proc(lib, name) dlsym(lib, name)
  ------------------
 1523|      0|                                    if (*_N_(_ittapi_global).api_list_ptr[i].func_ptr == NULL)
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1523:41): [True: 0, False: 0]
  ------------------
 1524|      0|                                    {
 1525|       |                                        /* Restore pointers for function with static implementation */
 1526|      0|                                        *_N_(_ittapi_global).api_list_ptr[i].func_ptr = _N_(_ittapi_global).api_list_ptr[i].null_func;
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                                      *_N_(_ittapi_global).api_list_ptr[i].func_ptr = _N_(_ittapi_global).api_list_ptr[i].null_func;
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1527|      0|                                        __itt_report_error(__itt_error_no_symbol, lib_name, _N_(_ittapi_global).api_list_ptr[i].name);
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1528|       |#ifdef ITT_COMPLETE_GROUP
 1529|       |                                        zero_group = (__itt_group_id)(zero_group | _N_(_ittapi_global).api_list_ptr[i].group);
 1530|       |#endif /* ITT_COMPLETE_GROUP */
 1531|      0|                                    }
 1532|      0|                                }
 1533|      0|                                else
 1534|      0|                                    *_N_(_ittapi_global).api_list_ptr[i].func_ptr = _N_(_ittapi_global).api_list_ptr[i].null_func;
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                                  *_N_(_ittapi_global).api_list_ptr[i].func_ptr = _N_(_ittapi_global).api_list_ptr[i].null_func;
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1535|      0|                            }
 1536|       |
 1537|      0|                            if (groups == __itt_group_legacy)
  ------------------
  |  Branch (1537:33): [True: 0, False: 0]
  ------------------
 1538|      0|                            {
 1539|       |                                /* Compatibility with legacy tools */
 1540|      0|                                ITTNOTIFY_NAME(thread_ignore)  = ITTNOTIFY_NAME(thr_ignore);
  ------------------
  |  |  182|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      0|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      0|    ITT_JOIN(_,              \
  |  |  |  |  171|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
                                              ITTNOTIFY_NAME(thread_ignore)  = ITTNOTIFY_NAME(thr_ignore);
  ------------------
  |  |  182|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      0|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      0|    ITT_JOIN(_,              \
  |  |  |  |  171|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
 1541|       |#if ITT_PLATFORM==ITT_PLATFORM_WIN
 1542|       |                                ITTNOTIFY_NAME(sync_createA)   = ITTNOTIFY_NAME(sync_set_nameA);
 1543|       |                                ITTNOTIFY_NAME(sync_createW)   = ITTNOTIFY_NAME(sync_set_nameW);
 1544|       |#else  /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
 1545|      0|                                ITTNOTIFY_NAME(sync_create)    = ITTNOTIFY_NAME(sync_set_name);
  ------------------
  |  |  182|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      0|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      0|    ITT_JOIN(_,              \
  |  |  |  |  171|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
                                              ITTNOTIFY_NAME(sync_create)    = ITTNOTIFY_NAME(sync_set_name);
  ------------------
  |  |  182|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      0|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      0|    ITT_JOIN(_,              \
  |  |  |  |  171|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
 1546|      0|#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
 1547|      0|                                ITTNOTIFY_NAME(sync_prepare)   = ITTNOTIFY_NAME(notify_sync_prepare);
  ------------------
  |  |  182|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      0|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      0|    ITT_JOIN(_,              \
  |  |  |  |  171|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
                                              ITTNOTIFY_NAME(sync_prepare)   = ITTNOTIFY_NAME(notify_sync_prepare);
  ------------------
  |  |  182|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      0|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      0|    ITT_JOIN(_,              \
  |  |  |  |  171|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
 1548|      0|                                ITTNOTIFY_NAME(sync_cancel)    = ITTNOTIFY_NAME(notify_sync_cancel);
  ------------------
  |  |  182|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      0|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      0|    ITT_JOIN(_,              \
  |  |  |  |  171|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
                                              ITTNOTIFY_NAME(sync_cancel)    = ITTNOTIFY_NAME(notify_sync_cancel);
  ------------------
  |  |  182|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      0|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      0|    ITT_JOIN(_,              \
  |  |  |  |  171|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
 1549|      0|                                ITTNOTIFY_NAME(sync_acquired)  = ITTNOTIFY_NAME(notify_sync_acquired);
  ------------------
  |  |  182|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      0|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      0|    ITT_JOIN(_,              \
  |  |  |  |  171|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
                                              ITTNOTIFY_NAME(sync_acquired)  = ITTNOTIFY_NAME(notify_sync_acquired);
  ------------------
  |  |  182|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      0|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      0|    ITT_JOIN(_,              \
  |  |  |  |  171|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
 1550|      0|                                ITTNOTIFY_NAME(sync_releasing) = ITTNOTIFY_NAME(notify_sync_releasing);
  ------------------
  |  |  182|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      0|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      0|    ITT_JOIN(_,              \
  |  |  |  |  171|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
                                              ITTNOTIFY_NAME(sync_releasing) = ITTNOTIFY_NAME(notify_sync_releasing);
  ------------------
  |  |  182|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      0|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      0|    ITT_JOIN(_,              \
  |  |  |  |  171|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
 1551|      0|                            }
 1552|       |
 1553|       |#ifdef ITT_COMPLETE_GROUP
 1554|       |                            for (i = 0; _N_(_ittapi_global).api_list_ptr[i].name != NULL; i++)
 1555|       |                                if (_N_(_ittapi_global).api_list_ptr[i].group & zero_group)
 1556|       |                                    *_N_(_ittapi_global).api_list_ptr[i].func_ptr = _N_(_ittapi_global).api_list_ptr[i].null_func;
 1557|       |#endif /* ITT_COMPLETE_GROUP */
 1558|      0|                            break;
 1559|      0|                        case 2:
  ------------------
  |  Branch (1559:25): [True: 0, False: 0]
  ------------------
 1560|      0|                            __itt_api_init_ptr = (__itt_api_init_t*)(size_t)__itt_get_proc(_N_(_ittapi_global).lib, "__itt_api_init");
  ------------------
  |  |  287|      0|#define __itt_get_proc(lib, name) dlsym(lib, name)
  ------------------
 1561|      0|                            if (__itt_api_init_ptr)
  ------------------
  |  Branch (1561:33): [True: 0, False: 0]
  ------------------
 1562|      0|                                __itt_api_init_ptr(&_N_(_ittapi_global), init_groups);
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1563|      0|                            break;
 1564|      0|                        }
 1565|      0|                    }
 1566|      0|                    else
 1567|      0|                    {
 1568|      0|                        _N_(_ittapi_global).state = __itt_collection_init_fail;
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1569|      0|                        __itt_free_allocated_resources();
 1570|      0|                        __itt_nullify_all_pointers();
 1571|       |
 1572|      0|                        __itt_report_error(__itt_error_no_module, lib_name,
 1573|       |#if ITT_PLATFORM==ITT_PLATFORM_WIN
 1574|       |                            __itt_system_error()
 1575|       |#else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
 1576|      0|                            dlerror()
 1577|      0|#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
 1578|      0|                        );
 1579|      0|                    }
 1580|      0|                }
 1581|      2|                else
 1582|      2|                {
 1583|      2|                    _N_(_ittapi_global).state = __itt_collection_collector_absent;
  ------------------
  |  |   32|      2|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      2|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      2|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1584|      2|                    __itt_nullify_all_pointers();
 1585|      2|                }
 1586|      2|                _N_(_ittapi_global).api_initialized = 1;
  ------------------
  |  |   32|      2|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      2|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      2|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1587|      2|                current_thread = 0;
 1588|       |                /* !!! Just to avoid unused code elimination !!! */
 1589|      2|                if (__itt_fini_ittlib_ptr == _N_(fini_ittlib)) current_thread = 0;
  ------------------
  |  |   32|      2|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      2|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      2|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1589:21): [True: 2, False: 0]
  ------------------
 1590|      2|            }
 1591|      2|        }
 1592|       |
 1593|      2|#ifndef ITT_SIMPLE_INIT
 1594|      2|        if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
  ------------------
  |  |  389|      2|#define PTHREAD_SYMBOLS (pthread_mutex_init && pthread_mutex_lock && pthread_mutex_unlock && pthread_mutex_destroy && pthread_mutexattr_init && pthread_mutexattr_settype && pthread_mutexattr_destroy && pthread_self)
  |  |  ------------------
  |  |  |  Branch (389:26): [True: 2, False: 0]
  |  |  |  Branch (389:48): [True: 2, False: 0]
  |  |  |  Branch (389:70): [True: 2, False: 0]
  |  |  |  Branch (389:94): [True: 2, False: 0]
  |  |  |  Branch (389:119): [True: 2, False: 0]
  |  |  |  Branch (389:145): [True: 2, False: 0]
  |  |  |  Branch (389:174): [True: 2, False: 0]
  |  |  |  Branch (389:203): [True: 2, False: 0]
  |  |  ------------------
  ------------------
                      if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
  ------------------
  |  |  309|      2|#define __itt_mutex_unlock(mutex) pthread_mutex_unlock(mutex)
  ------------------
 1595|      2|#endif /* ITT_SIMPLE_INIT */
 1596|      2|    }
 1597|       |
 1598|       |    /* Evaluating if any function ptr is non empty and it's in init_groups */
 1599|    310|    for (i = 0; _N_(_ittapi_global).api_list_ptr[i].name != NULL; i++)
  ------------------
  |  |   32|    310|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|    310|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|    310|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1599:17): [True: 308, False: 2]
  ------------------
 1600|    308|    {
 1601|    308|        if (*_N_(_ittapi_global).api_list_ptr[i].func_ptr != _N_(_ittapi_global).api_list_ptr[i].null_func &&
  ------------------
  |  |   32|    308|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|    308|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|    308|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (*_N_(_ittapi_global).api_list_ptr[i].func_ptr != _N_(_ittapi_global).api_list_ptr[i].null_func &&
  ------------------
  |  |   32|    308|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|    308|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|    308|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1601:13): [True: 0, False: 308]
  ------------------
 1602|    308|            _N_(_ittapi_global).api_list_ptr[i].group & init_groups)
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1602:13): [True: 0, False: 0]
  ------------------
 1603|      0|        {
 1604|      0|            return 1;
 1605|      0|        }
 1606|    308|    }
 1607|      2|    return 0;
 1608|      2|}
ittnotify_static.c:__itt_api_version_init_3_0:
  186|      2|static type api ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)) args \
  187|      2|{                                                              \
  188|      2|    if (!_N_(_ittapi_global).api_initialized && _N_(_ittapi_global).thread_list == NULL) \
  ------------------
  |  |   32|      2|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      2|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      2|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (!_N_(_ittapi_global).api_initialized && _N_(_ittapi_global).thread_list == NULL) \
  ------------------
  |  |   32|      2|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      2|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      2|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (188:9): [True: 2, False: 0]
  |  Branch (188:49): [True: 2, False: 0]
  ------------------
  189|      2|        __itt_init_ittlib_name(NULL, __itt_group_all);         \
  ------------------
  |  |  165|      2|#define __itt_init_ittlib_name __itt_init_ittlib_ptr
  ------------------
  190|      2|    if (ITTNOTIFY_NAME(name) && ITTNOTIFY_NAME(name) != ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init))) \
  ------------------
  |  |  182|      2|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      2|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      2|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      2|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      2|    ITT_JOIN(_,              \
  |  |  |  |  171|      2|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      2|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
                  if (ITTNOTIFY_NAME(name) && ITTNOTIFY_NAME(name) != ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init))) \
  ------------------
  |  |  182|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      0|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      0|    ITT_JOIN(_,              \
  |  |  |  |  171|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
                  if (ITTNOTIFY_NAME(name) && ITTNOTIFY_NAME(name) != ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init))) \
  ------------------
  |  |  169|      0|    ITT_JOIN(x,              \
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (190:33): [True: 0, False: 0]
  ------------------
  191|      2|        return ITTNOTIFY_NAME(name) params;                    \
  ------------------
  |  |  182|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      0|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      0|    ITT_JOIN(_,              \
  |  |  |  |  171|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
  192|      2|    else                                                       \
  193|      2|        return (type)0;                                        \
  194|      2|}
ittnotify_static.c:__itt_domain_create_init_3_0:
  385|      2|{
  386|      2|    __itt_domain *h_tail = NULL, *h = NULL;
  387|       |
  388|      2|    if (name == NULL)
  ------------------
  |  Branch (388:9): [True: 0, False: 2]
  ------------------
  389|      0|    {
  390|      0|        return NULL;
  391|      0|    }
  392|       |
  393|      2|    ITT_MUTEX_INIT_AND_LOCK(_N_(_ittapi_global));
  ------------------
  |  |  125|      2|#define ITT_MUTEX_INIT_AND_LOCK(p) {                                 \
  |  |  126|      2|    if (PTHREAD_SYMBOLS)                                             \
  |  |  ------------------
  |  |  |  |  389|      2|#define PTHREAD_SYMBOLS (pthread_mutex_init && pthread_mutex_lock && pthread_mutex_unlock && pthread_mutex_destroy && pthread_mutexattr_init && pthread_mutexattr_settype && pthread_mutexattr_destroy && pthread_self)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (389:26): [True: 2, False: 0]
  |  |  |  |  |  Branch (389:48): [True: 2, False: 0]
  |  |  |  |  |  Branch (389:70): [True: 2, False: 0]
  |  |  |  |  |  Branch (389:94): [True: 2, False: 0]
  |  |  |  |  |  Branch (389:119): [True: 2, False: 0]
  |  |  |  |  |  Branch (389:145): [True: 2, False: 0]
  |  |  |  |  |  Branch (389:174): [True: 2, False: 0]
  |  |  |  |  |  Branch (389:203): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  127|      2|    {                                                                \
  |  |  128|      2|        if (!p.mutex_initialized)                                    \
  |  |  ------------------
  |  |  |  Branch (128:13): [True: 0, False: 2]
  |  |  ------------------
  |  |  129|      2|        {                                                            \
  |  |  130|      0|            if (__itt_interlocked_compare_exchange(&p.atomic_counter, 1, 0) == 0) \
  |  |  ------------------
  |  |  |  Branch (130:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  131|      0|            {                                                        \
  |  |  132|      0|                __itt_mutex_init(&p.mutex);                          \
  |  |  ------------------
  |  |  |  |  288|      0|#define __itt_mutex_init(mutex)   {\
  |  |  |  |  289|      0|    pthread_mutexattr_t mutex_attr;                                         \
  |  |  |  |  290|      0|    int error_code = pthread_mutexattr_init(&mutex_attr);                   \
  |  |  |  |  291|      0|    if (error_code)                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  292|      0|        __itt_report_error(__itt_error_system, "pthread_mutexattr_init",    \
  |  |  |  |  293|      0|                           error_code);                                     \
  |  |  |  |  294|      0|    error_code = pthread_mutexattr_settype(&mutex_attr,                     \
  |  |  |  |  295|      0|                                           PTHREAD_MUTEX_RECURSIVE);        \
  |  |  |  |  296|      0|    if (error_code)                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (296:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  297|      0|        __itt_report_error(__itt_error_system, "pthread_mutexattr_settype", \
  |  |  |  |  298|      0|                           error_code);                                     \
  |  |  |  |  299|      0|    error_code = pthread_mutex_init(mutex, &mutex_attr);                    \
  |  |  |  |  300|      0|    if (error_code)                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (300:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  301|      0|        __itt_report_error(__itt_error_system, "pthread_mutex_init",        \
  |  |  |  |  302|      0|                           error_code);                                     \
  |  |  |  |  303|      0|    error_code = pthread_mutexattr_destroy(&mutex_attr);                    \
  |  |  |  |  304|      0|    if (error_code)                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (304:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  305|      0|        __itt_report_error(__itt_error_system, "pthread_mutexattr_destroy", \
  |  |  |  |  306|      0|                           error_code);                                     \
  |  |  |  |  307|      0|}
  |  |  ------------------
  |  |  133|      0|                p.mutex_initialized = 1;                             \
  |  |  134|      0|            }                                                        \
  |  |  135|      0|            else                                                     \
  |  |  136|      0|                while (!p.mutex_initialized)                         \
  |  |  ------------------
  |  |  |  Branch (136:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  137|      0|                    __itt_thread_yield();                            \
  |  |  ------------------
  |  |  |  |  338|      0|#define __itt_thread_yield()      sched_yield()
  |  |  ------------------
  |  |  138|      0|        }                                                            \
  |  |  139|      2|        __itt_mutex_lock(&p.mutex);                                  \
  |  |  ------------------
  |  |  |  |  308|      2|#define __itt_mutex_lock(mutex)   pthread_mutex_lock(mutex)
  |  |  ------------------
  |  |  140|      2|    }                                                                \
  |  |  141|      2|}
  ------------------
  394|      2|    if (_N_(_ittapi_global).api_initialized)
  ------------------
  |  |   32|      2|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      2|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      2|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (394:9): [True: 2, False: 0]
  ------------------
  395|      2|    {
  396|       |#if ITT_PLATFORM==ITT_PLATFORM_WIN
  397|       |        if (ITTNOTIFY_NAME(domain_createA) && ITTNOTIFY_NAME(domain_createA) != ITT_VERSIONIZE(ITT_JOIN(_N_(domain_createA),_init)))
  398|       |        {
  399|       |            __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
  400|       |            return ITTNOTIFY_NAME(domain_createA)(name);
  401|       |        }
  402|       |#else
  403|      2|        if (ITTNOTIFY_NAME(domain_create) && ITTNOTIFY_NAME(domain_create) != ITT_VERSIONIZE(ITT_JOIN(_N_(domain_create),_init)))
  ------------------
  |  |  182|      2|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      2|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      2|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      2|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      2|    ITT_JOIN(_,              \
  |  |  |  |  171|      2|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      2|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
                      if (ITTNOTIFY_NAME(domain_create) && ITTNOTIFY_NAME(domain_create) != ITT_VERSIONIZE(ITT_JOIN(_N_(domain_create),_init)))
  ------------------
  |  |  182|      2|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      2|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      2|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      2|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      2|    ITT_JOIN(_,              \
  |  |  |  |  171|      2|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      2|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
                      if (ITTNOTIFY_NAME(domain_create) && ITTNOTIFY_NAME(domain_create) != ITT_VERSIONIZE(ITT_JOIN(_N_(domain_create),_init)))
  ------------------
  |  |  169|      2|    ITT_JOIN(x,              \
  |  |  ------------------
  |  |  |  |  156|      2|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      2|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (403:46): [True: 0, False: 2]
  ------------------
  404|      0|        {
  405|      0|            if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
  ------------------
  |  |  389|      0|#define PTHREAD_SYMBOLS (pthread_mutex_init && pthread_mutex_lock && pthread_mutex_unlock && pthread_mutex_destroy && pthread_mutexattr_init && pthread_mutexattr_settype && pthread_mutexattr_destroy && pthread_self)
  |  |  ------------------
  |  |  |  Branch (389:26): [True: 0, False: 0]
  |  |  |  Branch (389:48): [True: 0, False: 0]
  |  |  |  Branch (389:70): [True: 0, False: 0]
  |  |  |  Branch (389:94): [True: 0, False: 0]
  |  |  |  Branch (389:119): [True: 0, False: 0]
  |  |  |  Branch (389:145): [True: 0, False: 0]
  |  |  |  Branch (389:174): [True: 0, False: 0]
  |  |  |  Branch (389:203): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                          if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
  ------------------
  |  |  309|      0|#define __itt_mutex_unlock(mutex) pthread_mutex_unlock(mutex)
  ------------------
  406|      0|            return ITTNOTIFY_NAME(domain_create)(name);
  ------------------
  |  |  182|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  ------------------
  |  |  |  |  169|      0|    ITT_JOIN(x,              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  170|      0|    ITT_JOIN(_,              \
  |  |  |  |  171|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  172|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  ------------------
  ------------------
  407|      0|        }
  408|      2|#endif
  409|      2|        else
  410|      2|        {
  411|       |#if ITT_PLATFORM==ITT_PLATFORM_WIN
  412|       |            __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
  413|       |#else
  414|      2|            if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
  ------------------
  |  |  389|      2|#define PTHREAD_SYMBOLS (pthread_mutex_init && pthread_mutex_lock && pthread_mutex_unlock && pthread_mutex_destroy && pthread_mutexattr_init && pthread_mutexattr_settype && pthread_mutexattr_destroy && pthread_self)
  |  |  ------------------
  |  |  |  Branch (389:26): [True: 2, False: 0]
  |  |  |  Branch (389:48): [True: 2, False: 0]
  |  |  |  Branch (389:70): [True: 2, False: 0]
  |  |  |  Branch (389:94): [True: 2, False: 0]
  |  |  |  Branch (389:119): [True: 2, False: 0]
  |  |  |  Branch (389:145): [True: 2, False: 0]
  |  |  |  Branch (389:174): [True: 2, False: 0]
  |  |  |  Branch (389:203): [True: 2, False: 0]
  |  |  ------------------
  ------------------
                          if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
  ------------------
  |  |  309|      2|#define __itt_mutex_unlock(mutex) pthread_mutex_unlock(mutex)
  ------------------
  415|      2|#endif
  416|      2|            return &dummy_domain;
  417|      2|        }
  418|      2|    }
  419|      0|    if (__itt_is_collector_available())
  ------------------
  |  Branch (419:9): [True: 0, False: 0]
  ------------------
  420|      0|    {
  421|      0|        for (h_tail = NULL, h = _N_(_ittapi_global).domain_list; h != NULL; h_tail = h, h = h->next)
  ------------------
  |  |   32|      0|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (421:66): [True: 0, False: 0]
  ------------------
  422|      0|        {
  423|      0|            if (h->nameA != NULL && !__itt_fstrcmp(h->nameA, name)) break;
  ------------------
  |  |  314|      0|#define __itt_fstrcmp(s1, s2)     strcmp(s1, s2)
  ------------------
  |  Branch (423:17): [True: 0, False: 0]
  |  Branch (423:37): [True: 0, False: 0]
  ------------------
  424|      0|        }
  425|      0|        if (h == NULL)
  ------------------
  |  Branch (425:13): [True: 0, False: 0]
  ------------------
  426|      0|        {
  427|      0|            NEW_DOMAIN_A(&_N_(_ittapi_global), h, h_tail, name);
  ------------------
  |  |  557|      0|#define NEW_DOMAIN_A(gptr,h,h_tail,name) { \
  |  |  558|      0|    h = (__itt_domain*)malloc(sizeof(__itt_domain)); \
  |  |  559|      0|    if (h != NULL) { \
  |  |  ------------------
  |  |  |  Branch (559:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  560|      0|        h->flags  = 1;    /* domain is enabled by default */ \
  |  |  561|      0|        char *name_copy = NULL; \
  |  |  562|      0|        __itt_fstrdup(name, name_copy); \
  |  |  ------------------
  |  |  |  |  398|      0|#define __itt_fstrdup(s, new_s) do {                                        \
  |  |  |  |  399|      0|    if (s != NULL) {                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (399:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  400|      0|        size_t s_len = __itt_fstrnlen(s, ITT_STRDUP_MAX_STRING_SIZE);       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|#define __itt_fstrnlen(s, l)      strlen(s)
  |  |  |  |  ------------------
  |  |  |  |  401|      0|        new_s = (char *)malloc(s_len + 1);                                  \
  |  |  |  |  402|      0|        if (new_s != NULL) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (402:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  403|      0|            __itt_fstrcpyn(new_s, s_len + 1, s, s_len);                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  325|      0|#define __itt_fstrcpyn(s1, b, s2, l) {                                      \
  |  |  |  |  |  |  326|      0|    if (b > 0) {                                                            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (326:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|        /* 'volatile' is used to suppress the warning that a destination */ \
  |  |  |  |  |  |  328|      0|        /*  bound depends on the length of the source.                   */ \
  |  |  |  |  |  |  329|      0|        volatile size_t num_to_copy = (size_t)(b - 1) < (size_t)(l) ?       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (329:39): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|                (size_t)(b - 1) : (size_t)(l);                              \
  |  |  |  |  |  |  331|      0|        strncpy(s1, s2, num_to_copy);                                       \
  |  |  |  |  |  |  332|      0|        s1[num_to_copy] = 0;                                                \
  |  |  |  |  |  |  333|      0|    }                                                                       \
  |  |  |  |  |  |  334|      0|}
  |  |  |  |  ------------------
  |  |  |  |  404|      0|        }                                                                   \
  |  |  |  |  405|      0|    }                                                                       \
  |  |  |  |  406|      0|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (406:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  563|      0|        h->nameA  = name_copy; \
  |  |  564|      0|        h->nameW  = NULL; \
  |  |  565|      0|        h->extra1 = 0;    /* reserved */ \
  |  |  566|      0|        h->extra2 = NULL; /* reserved */ \
  |  |  567|      0|        h->next   = NULL; \
  |  |  568|      0|        if (h_tail == NULL) \
  |  |  ------------------
  |  |  |  Branch (568:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  569|      0|            (gptr)->domain_list = h; \
  |  |  570|      0|        else \
  |  |  571|      0|            h_tail->next = h; \
  |  |  572|      0|    } \
  |  |  573|      0|}
  ------------------
  428|      0|        }
  429|      0|    }
  430|      0|    if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
  ------------------
  |  |  389|      0|#define PTHREAD_SYMBOLS (pthread_mutex_init && pthread_mutex_lock && pthread_mutex_unlock && pthread_mutex_destroy && pthread_mutexattr_init && pthread_mutexattr_settype && pthread_mutexattr_destroy && pthread_self)
  |  |  ------------------
  |  |  |  Branch (389:26): [True: 0, False: 0]
  |  |  |  Branch (389:48): [True: 0, False: 0]
  |  |  |  Branch (389:70): [True: 0, False: 0]
  |  |  |  Branch (389:94): [True: 0, False: 0]
  |  |  |  Branch (389:119): [True: 0, False: 0]
  |  |  |  Branch (389:145): [True: 0, False: 0]
  |  |  |  Branch (389:174): [True: 0, False: 0]
  |  |  |  Branch (389:203): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                  if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex);
  ------------------
  |  |  309|      0|#define __itt_mutex_unlock(mutex) pthread_mutex_unlock(mutex)
  ------------------
  431|      0|    return h;
  432|      2|}
ittnotify_static.c:__itt_nullify_all_pointers:
 1338|      2|{
 1339|      2|    int i;
 1340|       |    /* Nulify all pointers except domain_create, string_handle_create  and counter_create */
 1341|    310|    for (i = 0; _N_(_ittapi_global).api_list_ptr[i].name != NULL; i++)
  ------------------
  |  |   32|    310|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|    310|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|    310|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1341:17): [True: 308, False: 2]
  ------------------
 1342|    308|        *_N_(_ittapi_global).api_list_ptr[i].func_ptr = _N_(_ittapi_global).api_list_ptr[i].null_func;
  ------------------
  |  |   32|    308|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|    308|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|    308|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      *_N_(_ittapi_global).api_list_ptr[i].func_ptr = _N_(_ittapi_global).api_list_ptr[i].null_func;
  ------------------
  |  |   32|    308|#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  |  |  ------------------
  |  |  |  |  156|    308|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|    308|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1343|      2|}
ittnotify_static.c:__itt_get_lib_name:
 1259|      2|{
 1260|      2|    const char* lib_name = __itt_get_env_var(ITT_TO_STR(LIB_VAR_NAME));
  ------------------
  |  |  199|      2|#define ITT_TO_STR(x)     ITT_TO_STR_AUX(x)
  |  |  ------------------
  |  |  |  |  198|      2|#define ITT_TO_STR_AUX(x) #x
  |  |  ------------------
  ------------------
 1261|      2|    return lib_name;
 1262|      2|}
ittnotify_static.c:__itt_get_env_var:
 1208|      8|{
 1209|      8|#define MAX_ENV_VALUE_SIZE 4086
 1210|      8|    static char  env_buff[MAX_ENV_VALUE_SIZE];
 1211|      8|    static char* env_value = (char*)env_buff;
 1212|       |
 1213|      8|    if (name != NULL)
  ------------------
  |  Branch (1213:9): [True: 8, False: 0]
  ------------------
 1214|      8|    {
 1215|       |#if ITT_PLATFORM==ITT_PLATFORM_WIN
 1216|       |        size_t max_len = MAX_ENV_VALUE_SIZE - (size_t)(env_value - env_buff);
 1217|       |        DWORD rc = GetEnvironmentVariableA(name, env_value, (DWORD)max_len);
 1218|       |        if (rc >= max_len)
 1219|       |            __itt_report_error(__itt_error_env_too_long, name, (size_t)rc - 1, (size_t)(max_len - 1));
 1220|       |        else if (rc > 0)
 1221|       |        {
 1222|       |            const char* ret = (const char*)env_value;
 1223|       |            env_value += rc + 1;
 1224|       |            return ret;
 1225|       |        }
 1226|       |        else
 1227|       |        {
 1228|       |            /* If environment variable is empty, GetEnvironmentVariables()
 1229|       |             * returns zero (number of characters (not including terminating null),
 1230|       |             * and GetLastError() returns ERROR_SUCCESS. */
 1231|       |            DWORD err = GetLastError();
 1232|       |            if (err == ERROR_SUCCESS)
 1233|       |                return env_value;
 1234|       |
 1235|       |            if (err != ERROR_ENVVAR_NOT_FOUND)
 1236|       |                __itt_report_error(__itt_error_cant_read_env, name, (int)err);
 1237|       |        }
 1238|       |#else  /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
 1239|      8|        char* env = getenv(name);
 1240|      8|        if (env != NULL)
  ------------------
  |  Branch (1240:13): [True: 0, False: 8]
  ------------------
 1241|      0|        {
 1242|      0|            size_t len = __itt_fstrnlen(env, MAX_ENV_VALUE_SIZE);
  ------------------
  |  |  320|      0|#define __itt_fstrnlen(s, l)      strlen(s)
  ------------------
 1243|      0|            size_t max_len = MAX_ENV_VALUE_SIZE - (size_t)(env_value - env_buff);
  ------------------
  |  | 1209|      0|#define MAX_ENV_VALUE_SIZE 4086
  ------------------
 1244|      0|            if (len < max_len)
  ------------------
  |  Branch (1244:17): [True: 0, False: 0]
  ------------------
 1245|      0|            {
 1246|      0|                const char* ret = (const char*)env_value;
 1247|      0|                __itt_fstrcpyn(env_value, max_len, env, len + 1);
  ------------------
  |  |  325|      0|#define __itt_fstrcpyn(s1, b, s2, l) {                                      \
  |  |  326|      0|    if (b > 0) {                                                            \
  |  |  ------------------
  |  |  |  Branch (326:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  327|      0|        /* 'volatile' is used to suppress the warning that a destination */ \
  |  |  328|      0|        /*  bound depends on the length of the source.                   */ \
  |  |  329|      0|        volatile size_t num_to_copy = (size_t)(b - 1) < (size_t)(l) ?       \
  |  |  ------------------
  |  |  |  Branch (329:39): [True: 0, False: 0]
  |  |  ------------------
  |  |  330|      0|                (size_t)(b - 1) : (size_t)(l);                              \
  |  |  331|      0|        strncpy(s1, s2, num_to_copy);                                       \
  |  |  332|      0|        s1[num_to_copy] = 0;                                                \
  |  |  333|      0|    }                                                                       \
  |  |  334|      0|}
  ------------------
 1248|      0|                env_value += len + 1;
 1249|      0|                return ret;
 1250|      0|            } else
 1251|      0|                __itt_report_error(__itt_error_env_too_long, name, (size_t)len, (size_t)(max_len - 1));
 1252|      0|        }
 1253|      8|#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
 1254|      8|    }
 1255|      8|    return NULL;
 1256|      8|}
ittnotify_static.c:__itt_get_groups:
 1268|      2|{
 1269|      2|    int i;
 1270|      2|    __itt_group_id res = __itt_group_none;
 1271|      2|    const char* var_name  = "INTEL_ITTNOTIFY_GROUPS";
 1272|      2|    const char* group_str = __itt_get_env_var(var_name);
 1273|       |
 1274|      2|    if (group_str != NULL)
  ------------------
  |  Branch (1274:9): [True: 0, False: 2]
  ------------------
 1275|      0|    {
 1276|      0|        int len;
 1277|      0|        char gr[255];
 1278|      0|        const char* chunk;
 1279|      0|        while ((group_str = __itt_fsplit(group_str, ",; ", &chunk, &len)) != NULL)
  ------------------
  |  Branch (1279:16): [True: 0, False: 0]
  ------------------
 1280|      0|        {
 1281|      0|            int min_len = __itt_min(len, (int)(sizeof(gr) - 1));
  ------------------
  |  | 1265|      0|#define __itt_min(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (1265:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1282|      0|            __itt_fstrcpyn(gr, sizeof(gr) - 1, chunk,  min_len);
  ------------------
  |  |  325|      0|#define __itt_fstrcpyn(s1, b, s2, l) {                                      \
  |  |  326|      0|    if (b > 0) {                                                            \
  |  |  ------------------
  |  |  |  Branch (326:9): [Folded - Ignored]
  |  |  ------------------
  |  |  327|      0|        /* 'volatile' is used to suppress the warning that a destination */ \
  |  |  328|      0|        /*  bound depends on the length of the source.                   */ \
  |  |  329|      0|        volatile size_t num_to_copy = (size_t)(b - 1) < (size_t)(l) ?       \
  |  |  ------------------
  |  |  |  Branch (329:39): [True: 0, False: 0]
  |  |  ------------------
  |  |  330|      0|                (size_t)(b - 1) : (size_t)(l);                              \
  |  |  331|      0|        strncpy(s1, s2, num_to_copy);                                       \
  |  |  332|      0|        s1[num_to_copy] = 0;                                                \
  |  |  333|      0|    }                                                                       \
  |  |  334|      0|}
  ------------------
 1283|      0|            gr[min_len] = 0;
 1284|       |
 1285|      0|            for (i = 0; group_list[i].name != NULL; i++)
  ------------------
  |  Branch (1285:25): [True: 0, False: 0]
  ------------------
 1286|      0|            {
 1287|      0|                if (!__itt_fstrcmp(gr, group_list[i].name))
  ------------------
  |  |  314|      0|#define __itt_fstrcmp(s1, s2)     strcmp(s1, s2)
  ------------------
  |  Branch (1287:21): [True: 0, False: 0]
  ------------------
 1288|      0|                {
 1289|      0|                    res = (__itt_group_id)(res | group_list[i].id);
 1290|      0|                    break;
 1291|      0|                }
 1292|      0|            }
 1293|      0|        }
 1294|       |        /* TODO: !!! Workaround for bug with warning for unknown group !!!
 1295|       |         * Should be fixed in new initialization scheme.
 1296|       |         * Now the following groups should be set always. */
 1297|      0|        for (i = 0; group_list[i].id != __itt_group_none; i++)
  ------------------
  |  Branch (1297:21): [True: 0, False: 0]
  ------------------
 1298|      0|            if (group_list[i].id != __itt_group_all &&
  ------------------
  |  Branch (1298:17): [True: 0, False: 0]
  ------------------
 1299|      0|                group_list[i].id > __itt_group_splitter_min &&
  ------------------
  |  Branch (1299:17): [True: 0, False: 0]
  ------------------
 1300|      0|                group_list[i].id < __itt_group_splitter_max)
  ------------------
  |  Branch (1300:17): [True: 0, False: 0]
  ------------------
 1301|      0|                res = (__itt_group_id)(res | group_list[i].id);
 1302|      0|        return res;
 1303|      0|    }
 1304|      2|    else
 1305|      2|    {
 1306|      6|        for (i = 0; group_alias[i].env_var != NULL; i++)
  ------------------
  |  Branch (1306:21): [True: 4, False: 2]
  ------------------
 1307|      4|            if (__itt_get_env_var(group_alias[i].env_var) != NULL)
  ------------------
  |  Branch (1307:17): [True: 0, False: 4]
  ------------------
 1308|      0|                return group_alias[i].groups;
 1309|      2|    }
 1310|       |
 1311|      2|    return res;
 1312|      2|}

_TIFFMultiply64:
   49|  7.02k|{
   50|  7.02k|    if (second && first > UINT64_MAX / second)
  ------------------
  |  Branch (50:9): [True: 7.02k, False: 0]
  |  Branch (50:19): [True: 0, False: 7.02k]
  ------------------
   51|      0|    {
   52|      0|        TIFFErrorExtR(tif, where, "Integer overflow in %s", where);
   53|      0|        return 0;
   54|      0|    }
   55|       |
   56|  7.02k|    return first * second;
   57|  7.02k|}
_TIFFMultiplySSize:
   61|  3.90k|{
   62|  3.90k|    if (first <= 0 || second <= 0)
  ------------------
  |  Branch (62:9): [True: 0, False: 3.90k]
  |  Branch (62:23): [True: 0, False: 3.90k]
  ------------------
   63|      0|    {
   64|      0|        if (tif != NULL && where != NULL)
  ------------------
  |  Branch (64:13): [True: 0, False: 0]
  |  Branch (64:28): [True: 0, False: 0]
  ------------------
   65|      0|        {
   66|      0|            TIFFErrorExtR(tif, where,
   67|      0|                          "Invalid argument to _TIFFMultiplySSize() in %s",
   68|      0|                          where);
   69|      0|        }
   70|      0|        return 0;
   71|      0|    }
   72|       |
   73|  3.90k|    if (first > TIFF_TMSIZE_T_MAX / second)
  ------------------
  |  |   66|  3.90k|#define TIFF_TMSIZE_T_MAX (tmsize_t)(SIZE_MAX >> 1)
  ------------------
  |  Branch (73:9): [True: 0, False: 3.90k]
  ------------------
   74|      0|    {
   75|      0|        if (tif != NULL && where != NULL)
  ------------------
  |  Branch (75:13): [True: 0, False: 0]
  |  Branch (75:28): [True: 0, False: 0]
  ------------------
   76|      0|        {
   77|      0|            TIFFErrorExtR(tif, where, "Integer overflow in %s", where);
   78|      0|        }
   79|      0|        return 0;
   80|      0|    }
   81|  3.90k|    return first * second;
   82|  3.90k|}
_TIFFCastUInt64ToSSize:
   85|  3.12k|{
   86|  3.12k|    if (val > (uint64_t)TIFF_TMSIZE_T_MAX)
  ------------------
  |  |   66|  3.12k|#define TIFF_TMSIZE_T_MAX (tmsize_t)(SIZE_MAX >> 1)
  ------------------
  |  Branch (86:9): [True: 0, False: 3.12k]
  ------------------
   87|      0|    {
   88|      0|        if (tif != NULL && module != NULL)
  ------------------
  |  Branch (88:13): [True: 0, False: 0]
  |  Branch (88:28): [True: 0, False: 0]
  ------------------
   89|      0|        {
   90|      0|            TIFFErrorExtR(tif, module, "Integer overflow");
   91|      0|        }
   92|      0|        return 0;
   93|      0|    }
   94|  3.12k|    return (tmsize_t)val;
   95|  3.12k|}
_TIFFCheckRealloc:
   99|  3.90k|{
  100|  3.90k|    void *cp = NULL;
  101|  3.90k|    tmsize_t count = _TIFFMultiplySSize(tif, nmemb, elem_size, NULL);
  102|       |    /*
  103|       |     * Check for integer overflow.
  104|       |     */
  105|  3.90k|    if (count != 0)
  ------------------
  |  Branch (105:9): [True: 3.90k, False: 0]
  ------------------
  106|  3.90k|    {
  107|  3.90k|        cp = _TIFFreallocExt(tif, buffer, count);
  108|  3.90k|    }
  109|       |
  110|  3.90k|    if (cp == NULL)
  ------------------
  |  Branch (110:9): [True: 0, False: 3.90k]
  ------------------
  111|      0|    {
  112|      0|        TIFFErrorExtR(tif, tif->tif_name,
  113|      0|                      "Failed to allocate memory for %s "
  114|      0|                      "(%" TIFF_SSIZE_FORMAT " elements of %" TIFF_SSIZE_FORMAT
  115|      0|                      " bytes each)",
  116|      0|                      what, nmemb, elem_size);
  117|      0|    }
  118|       |
  119|  3.90k|    return cp;
  120|  3.90k|}
_TIFFCheckMalloc:
  124|  3.12k|{
  125|  3.12k|    return _TIFFCheckRealloc(tif, NULL, nmemb, elem_size, what);
  126|  3.12k|}
_TIFFSeekOK:
  454|    780|{
  455|       |    /* Huge offsets, especially -1 / UINT64_MAX, can cause issues */
  456|       |    /* See http://bugzilla.maptools.org/show_bug.cgi?id=2726 */
  457|    780|    return off <= (~(uint64_t)0) / 2 && TIFFSeekFile(tif, off, SEEK_SET) == off;
  ------------------
  |  |  259|    780|    ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence)))
  ------------------
  |  Branch (457:12): [True: 780, False: 0]
  |  Branch (457:41): [True: 780, False: 0]
  ------------------
  458|    780|}

TIFFCleanup:
   45|    780|{
   46|       |    /*
   47|       |     * Flush buffered data and directory (if dirty).
   48|       |     */
   49|    780|    if (tif->tif_mode != O_RDONLY)
  ------------------
  |  Branch (49:9): [True: 780, False: 0]
  ------------------
   50|    780|        TIFFFlush(tif);
   51|    780|    (*tif->tif_cleanup)(tif);
   52|    780|    TIFFFreeDirectory(tif);
   53|       |
   54|    780|    _TIFFCleanupIFDOffsetAndNumberMaps(tif);
   55|       |
   56|       |    /*
   57|       |     * Clean up client info links.
   58|       |     */
   59|    780|    while (tif->tif_clientinfo)
  ------------------
  |  Branch (59:12): [True: 0, False: 780]
  ------------------
   60|      0|    {
   61|      0|        TIFFClientInfoLink *psLink = tif->tif_clientinfo;
   62|       |
   63|      0|        tif->tif_clientinfo = psLink->next;
   64|      0|        _TIFFfreeExt(tif, psLink->name);
   65|      0|        _TIFFfreeExt(tif, psLink);
   66|      0|    }
   67|       |
   68|    780|    if (tif->tif_rawdata && (tif->tif_flags & TIFF_MYBUFFER))
  ------------------
  |  |  119|      0|#define TIFF_MYBUFFER 0x00200U    /* my raw data buffer; free on close */
  ------------------
  |  Branch (68:9): [True: 0, False: 780]
  |  Branch (68:29): [True: 0, False: 0]
  ------------------
   69|      0|        _TIFFfreeExt(tif, tif->tif_rawdata);
   70|    780|    if (isMapped(tif))
  ------------------
  |  |  251|    780|#define isMapped(tif) (((tif)->tif_flags & TIFF_MAPPED) != 0)
  |  |  ------------------
  |  |  |  |  121|    780|#define TIFF_MAPPED 0x00800U      /* file is mapped into memory */
  |  |  ------------------
  |  |  |  Branch (251:23): [True: 0, False: 780]
  |  |  ------------------
  ------------------
   71|      0|        TIFFUnmapFileContents(tif, tif->tif_base, (toff_t)tif->tif_size);
  ------------------
  |  |  265|      0|    ((*(tif)->tif_unmapproc)((tif)->tif_clientdata, (addr), (size)))
  ------------------
   72|       |
   73|       |    /*
   74|       |     * Clean up custom fields.
   75|       |     */
   76|    780|    if (tif->tif_fields && tif->tif_nfields > 0)
  ------------------
  |  Branch (76:9): [True: 780, False: 0]
  |  Branch (76:28): [True: 780, False: 0]
  ------------------
   77|    780|    {
   78|    780|        uint32_t i;
   79|       |
   80|   118k|        for (i = 0; i < tif->tif_nfields; i++)
  ------------------
  |  Branch (80:21): [True: 117k, False: 780]
  ------------------
   81|   117k|        {
   82|   117k|            TIFFField *fld = tif->tif_fields[i];
   83|   117k|            if (fld->field_name != NULL)
  ------------------
  |  Branch (83:17): [True: 117k, False: 0]
  ------------------
   84|   117k|            {
   85|   117k|                if (fld->field_bit == FIELD_CUSTOM &&
  ------------------
  |  |  334|   235k|#define FIELD_CUSTOM 65
  ------------------
  |  Branch (85:21): [True: 78.7k, False: 39.0k]
  ------------------
   86|       |                    /* caution: tif_fields[i] must not be the beginning of a
   87|       |                     * fields-array. Otherwise the following tags are also freed
   88|       |                     * with the first free().
   89|       |                     */
   90|   117k|                    TIFFFieldIsAnonymous(fld))
  ------------------
  |  Branch (90:21): [True: 0, False: 78.7k]
  ------------------
   91|      0|                {
   92|      0|                    _TIFFfreeExt(tif, fld->field_name);
   93|      0|                    _TIFFfreeExt(tif, fld);
   94|      0|                }
   95|   117k|            }
   96|   117k|        }
   97|       |
   98|    780|        _TIFFfreeExt(tif, tif->tif_fields);
   99|    780|    }
  100|       |
  101|    780|    if (tif->tif_nfieldscompat > 0)
  ------------------
  |  Branch (101:9): [True: 0, False: 780]
  ------------------
  102|      0|    {
  103|      0|        uint32_t i;
  104|       |
  105|      0|        for (i = 0; i < tif->tif_nfieldscompat; i++)
  ------------------
  |  Branch (105:21): [True: 0, False: 0]
  ------------------
  106|      0|        {
  107|      0|            if (tif->tif_fieldscompat[i].allocated_size)
  ------------------
  |  Branch (107:17): [True: 0, False: 0]
  ------------------
  108|      0|                _TIFFfreeExt(tif, tif->tif_fieldscompat[i].fields);
  109|      0|        }
  110|      0|        _TIFFfreeExt(tif, tif->tif_fieldscompat);
  111|      0|    }
  112|       |
  113|    780|    _TIFFfreeExt(NULL, tif);
  114|    780|}
_TIFFCleanupIFDOffsetAndNumberMaps:
  121|    780|{
  122|    780|    if (tif->tif_map_dir_offset_to_number)
  ------------------
  |  Branch (122:9): [True: 0, False: 780]
  ------------------
  123|      0|    {
  124|      0|        TIFFHashSetDestroy(tif->tif_map_dir_offset_to_number);
  125|      0|        tif->tif_map_dir_offset_to_number = NULL;
  126|      0|    }
  127|    780|    if (tif->tif_map_dir_number_to_offset)
  ------------------
  |  Branch (127:9): [True: 0, False: 780]
  ------------------
  128|      0|    {
  129|      0|        TIFFHashSetDestroy(tif->tif_map_dir_number_to_offset);
  130|      0|        tif->tif_map_dir_number_to_offset = NULL;
  131|      0|    }
  132|    780|}
TIFFClose:
  149|    780|{
  150|    780|    if (tif != NULL)
  ------------------
  |  Branch (150:9): [True: 780, False: 0]
  ------------------
  151|    780|    {
  152|    780|        TIFFCloseProc closeproc = tif->tif_closeproc;
  153|    780|        thandle_t fd = tif->tif_clientdata;
  154|       |
  155|    780|        TIFFCleanup(tif);
  156|    780|        (void)(*closeproc)(fd);
  157|    780|    }
  158|    780|}

_TIFFSetDefaultCompressionState:
  143|  3.90k|{
  144|  3.90k|    tif->tif_fixuptags = _TIFFNoFixupTags;
  145|  3.90k|    tif->tif_decodestatus = TRUE;
  ------------------
  |  |   70|  3.90k|#define TRUE 1
  ------------------
  146|  3.90k|    tif->tif_setupdecode = _TIFFtrue;
  147|  3.90k|    tif->tif_predecode = _TIFFNoPreCode;
  148|  3.90k|    tif->tif_decoderow = _TIFFNoRowDecode;
  149|  3.90k|    tif->tif_decodestrip = _TIFFNoStripDecode;
  150|  3.90k|    tif->tif_decodetile = _TIFFNoTileDecode;
  151|  3.90k|    tif->tif_encodestatus = TRUE;
  ------------------
  |  |   70|  3.90k|#define TRUE 1
  ------------------
  152|  3.90k|    tif->tif_setupencode = _TIFFtrue;
  153|  3.90k|    tif->tif_preencode = _TIFFNoPreCode;
  154|  3.90k|    tif->tif_postencode = _TIFFtrue;
  155|  3.90k|    tif->tif_encoderow = _TIFFNoRowEncode;
  156|  3.90k|    tif->tif_encodestrip = _TIFFNoStripEncode;
  157|  3.90k|    tif->tif_encodetile = _TIFFNoTileEncode;
  158|  3.90k|    tif->tif_close = _TIFFvoid;
  159|  3.90k|    tif->tif_seek = _TIFFNoSeek;
  160|  3.90k|    tif->tif_cleanup = _TIFFvoid;
  161|  3.90k|    tif->tif_defstripsize = _TIFFDefaultStripSize;
  162|  3.90k|    tif->tif_deftilesize = _TIFFDefaultTileSize;
  163|  3.90k|    tif->tif_flags &= ~(TIFF_NOBITREV | TIFF_NOREADRAW);
  ------------------
  |  |  118|  3.90k|#define TIFF_NOBITREV 0x00100U    /* inhibit bit reversal logic */
  ------------------
                  tif->tif_flags &= ~(TIFF_NOBITREV | TIFF_NOREADRAW);
  ------------------
  |  |  129|  3.90k|    0x20000U /* skip reading of raw uncompressed image data */
  ------------------
  164|  3.90k|}
TIFFSetCompressionScheme:
  167|  2.34k|{
  168|  2.34k|    const TIFFCodec *c = TIFFFindCODEC((uint16_t)scheme);
  169|       |
  170|  2.34k|    _TIFFSetDefaultCompressionState(tif);
  171|       |    /*
  172|       |     * Don't treat an unknown compression scheme as an error.
  173|       |     * This permits applications to open files with data that
  174|       |     * the library does not have builtin support for, but which
  175|       |     * may still be meaningful.
  176|       |     */
  177|  2.34k|    return (c ? (*c->init)(tif, scheme) : 1);
  ------------------
  |  Branch (177:13): [True: 2.34k, False: 0]
  ------------------
  178|  2.34k|}
TIFFFindCODEC:
  193|  2.34k|{
  194|  2.34k|    const TIFFCodec *c;
  195|  2.34k|    codec_t *cd;
  196|       |
  197|  2.34k|    for (cd = registeredCODECS; cd; cd = cd->next)
  ------------------
  |  Branch (197:33): [True: 0, False: 2.34k]
  ------------------
  198|      0|        if (cd->info->scheme == scheme)
  ------------------
  |  Branch (198:13): [True: 0, False: 0]
  ------------------
  199|      0|            return ((const TIFFCodec *)cd->info);
  200|  3.12k|    for (c = _TIFFBuiltinCODECS; c->name; c++)
  ------------------
  |  Branch (200:34): [True: 3.12k, False: 0]
  ------------------
  201|  3.12k|        if (c->scheme == scheme)
  ------------------
  |  Branch (201:13): [True: 2.34k, False: 780]
  ------------------
  202|  2.34k|            return (c);
  203|      0|    return ((const TIFFCodec *)0);
  204|  2.34k|}
tif_compress.c:_TIFFvoid:
  140|  2.34k|static void _TIFFvoid(TIFF *tif) { (void)tif; }

TIFFSetField:
 1147|  9.36k|{
 1148|  9.36k|    va_list ap;
 1149|  9.36k|    int status;
 1150|       |
 1151|  9.36k|    va_start(ap, tag);
 1152|  9.36k|    status = TIFFVSetField(tif, tag, ap);
 1153|  9.36k|    va_end(ap);
 1154|  9.36k|    return (status);
 1155|  9.36k|}
TIFFVSetField:
 1206|  9.36k|{
 1207|  9.36k|    return OkToChangeTag(tif, tag)
  ------------------
  |  Branch (1207:12): [True: 9.36k, False: 0]
  ------------------
 1208|  9.36k|               ? (*tif->tif_tagmethods.vsetfield)(tif, tag, ap)
 1209|  9.36k|               : 0;
 1210|  9.36k|}
TIFFGetField:
 1583|  1.56k|{
 1584|  1.56k|    int status;
 1585|  1.56k|    va_list ap;
 1586|       |
 1587|  1.56k|    va_start(ap, tag);
 1588|  1.56k|    status = TIFFVGetField(tif, tag, ap);
 1589|  1.56k|    va_end(ap);
 1590|  1.56k|    return (status);
 1591|  1.56k|}
TIFFVGetField:
 1600|  1.56k|{
 1601|  1.56k|    const TIFFField *fip = TIFFFindField(tif, tag, TIFF_ANY);
  ------------------
  |  |  329|  1.56k|#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */
  ------------------
 1602|  1.56k|    return (fip && (isPseudoTag(tag) || TIFFFieldSet(tif, fip->field_bit))
  ------------------
  |  |  248|  3.12k|#define isPseudoTag(t) (t > 0xffff) /* is tag value normal or pseudo */
  |  |  ------------------
  |  |  |  Branch (248:24): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
                  return (fip && (isPseudoTag(tag) || TIFFFieldSet(tif, fip->field_bit))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 1.56k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1602:13): [True: 1.56k, False: 0]
  ------------------
 1603|  1.56k|                ? (*tif->tif_tagmethods.vgetfield)(tif, tag, ap)
 1604|  1.56k|                : 0);
 1605|  1.56k|}
TIFFFreeDirectory:
 1620|  1.56k|{
 1621|  1.56k|    TIFFDirectory *td = &tif->tif_dir;
 1622|  1.56k|    int i;
 1623|       |
 1624|  1.56k|    _TIFFmemset(td->td_fieldsset, 0, sizeof(td->td_fieldsset));
 1625|  1.56k|    CleanupField(td_sminsamplevalue);
  ------------------
  |  | 1608|  1.56k|    {                                                                          \
  |  | 1609|  1.56k|        if (td->member)                                                        \
  |  |  ------------------
  |  |  |  Branch (1609:13): [True: 0, False: 1.56k]
  |  |  ------------------
  |  | 1610|  1.56k|        {                                                                      \
  |  | 1611|      0|            _TIFFfreeExt(tif, td->member);                                     \
  |  | 1612|      0|            td->member = 0;                                                    \
  |  | 1613|      0|        }                                                                      \
  |  | 1614|  1.56k|    }
  ------------------
 1626|  1.56k|    CleanupField(td_smaxsamplevalue);
  ------------------
  |  | 1608|  1.56k|    {                                                                          \
  |  | 1609|  1.56k|        if (td->member)                                                        \
  |  |  ------------------
  |  |  |  Branch (1609:13): [True: 0, False: 1.56k]
  |  |  ------------------
  |  | 1610|  1.56k|        {                                                                      \
  |  | 1611|      0|            _TIFFfreeExt(tif, td->member);                                     \
  |  | 1612|      0|            td->member = 0;                                                    \
  |  | 1613|      0|        }                                                                      \
  |  | 1614|  1.56k|    }
  ------------------
 1627|  1.56k|    CleanupField(td_colormap[0]);
  ------------------
  |  | 1608|  1.56k|    {                                                                          \
  |  | 1609|  1.56k|        if (td->member)                                                        \
  |  |  ------------------
  |  |  |  Branch (1609:13): [True: 0, False: 1.56k]
  |  |  ------------------
  |  | 1610|  1.56k|        {                                                                      \
  |  | 1611|      0|            _TIFFfreeExt(tif, td->member);                                     \
  |  | 1612|      0|            td->member = 0;                                                    \
  |  | 1613|      0|        }                                                                      \
  |  | 1614|  1.56k|    }
  ------------------
 1628|  1.56k|    CleanupField(td_colormap[1]);
  ------------------
  |  | 1608|  1.56k|    {                                                                          \
  |  | 1609|  1.56k|        if (td->member)                                                        \
  |  |  ------------------
  |  |  |  Branch (1609:13): [True: 0, False: 1.56k]
  |  |  ------------------
  |  | 1610|  1.56k|        {                                                                      \
  |  | 1611|      0|            _TIFFfreeExt(tif, td->member);                                     \
  |  | 1612|      0|            td->member = 0;                                                    \
  |  | 1613|      0|        }                                                                      \
  |  | 1614|  1.56k|    }
  ------------------
 1629|  1.56k|    CleanupField(td_colormap[2]);
  ------------------
  |  | 1608|  1.56k|    {                                                                          \
  |  | 1609|  1.56k|        if (td->member)                                                        \
  |  |  ------------------
  |  |  |  Branch (1609:13): [True: 0, False: 1.56k]
  |  |  ------------------
  |  | 1610|  1.56k|        {                                                                      \
  |  | 1611|      0|            _TIFFfreeExt(tif, td->member);                                     \
  |  | 1612|      0|            td->member = 0;                                                    \
  |  | 1613|      0|        }                                                                      \
  |  | 1614|  1.56k|    }
  ------------------
 1630|  1.56k|    CleanupField(td_sampleinfo);
  ------------------
  |  | 1608|  1.56k|    {                                                                          \
  |  | 1609|  1.56k|        if (td->member)                                                        \
  |  |  ------------------
  |  |  |  Branch (1609:13): [True: 0, False: 1.56k]
  |  |  ------------------
  |  | 1610|  1.56k|        {                                                                      \
  |  | 1611|      0|            _TIFFfreeExt(tif, td->member);                                     \
  |  | 1612|      0|            td->member = 0;                                                    \
  |  | 1613|      0|        }                                                                      \
  |  | 1614|  1.56k|    }
  ------------------
 1631|  1.56k|    CleanupField(td_subifd);
  ------------------
  |  | 1608|  1.56k|    {                                                                          \
  |  | 1609|  1.56k|        if (td->member)                                                        \
  |  |  ------------------
  |  |  |  Branch (1609:13): [True: 0, False: 1.56k]
  |  |  ------------------
  |  | 1610|  1.56k|        {                                                                      \
  |  | 1611|      0|            _TIFFfreeExt(tif, td->member);                                     \
  |  | 1612|      0|            td->member = 0;                                                    \
  |  | 1613|      0|        }                                                                      \
  |  | 1614|  1.56k|    }
  ------------------
 1632|  1.56k|    CleanupField(td_inknames);
  ------------------
  |  | 1608|  1.56k|    {                                                                          \
  |  | 1609|  1.56k|        if (td->member)                                                        \
  |  |  ------------------
  |  |  |  Branch (1609:13): [True: 0, False: 1.56k]
  |  |  ------------------
  |  | 1610|  1.56k|        {                                                                      \
  |  | 1611|      0|            _TIFFfreeExt(tif, td->member);                                     \
  |  | 1612|      0|            td->member = 0;                                                    \
  |  | 1613|      0|        }                                                                      \
  |  | 1614|  1.56k|    }
  ------------------
 1633|  1.56k|    CleanupField(td_refblackwhite);
  ------------------
  |  | 1608|  1.56k|    {                                                                          \
  |  | 1609|  1.56k|        if (td->member)                                                        \
  |  |  ------------------
  |  |  |  Branch (1609:13): [True: 0, False: 1.56k]
  |  |  ------------------
  |  | 1610|  1.56k|        {                                                                      \
  |  | 1611|      0|            _TIFFfreeExt(tif, td->member);                                     \
  |  | 1612|      0|            td->member = 0;                                                    \
  |  | 1613|      0|        }                                                                      \
  |  | 1614|  1.56k|    }
  ------------------
 1634|  1.56k|    CleanupField(td_transferfunction[0]);
  ------------------
  |  | 1608|  1.56k|    {                                                                          \
  |  | 1609|  1.56k|        if (td->member)                                                        \
  |  |  ------------------
  |  |  |  Branch (1609:13): [True: 0, False: 1.56k]
  |  |  ------------------
  |  | 1610|  1.56k|        {                                                                      \
  |  | 1611|      0|            _TIFFfreeExt(tif, td->member);                                     \
  |  | 1612|      0|            td->member = 0;                                                    \
  |  | 1613|      0|        }                                                                      \
  |  | 1614|  1.56k|    }
  ------------------
 1635|  1.56k|    CleanupField(td_transferfunction[1]);
  ------------------
  |  | 1608|  1.56k|    {                                                                          \
  |  | 1609|  1.56k|        if (td->member)                                                        \
  |  |  ------------------
  |  |  |  Branch (1609:13): [True: 0, False: 1.56k]
  |  |  ------------------
  |  | 1610|  1.56k|        {                                                                      \
  |  | 1611|      0|            _TIFFfreeExt(tif, td->member);                                     \
  |  | 1612|      0|            td->member = 0;                                                    \
  |  | 1613|      0|        }                                                                      \
  |  | 1614|  1.56k|    }
  ------------------
 1636|  1.56k|    CleanupField(td_transferfunction[2]);
  ------------------
  |  | 1608|  1.56k|    {                                                                          \
  |  | 1609|  1.56k|        if (td->member)                                                        \
  |  |  ------------------
  |  |  |  Branch (1609:13): [True: 0, False: 1.56k]
  |  |  ------------------
  |  | 1610|  1.56k|        {                                                                      \
  |  | 1611|      0|            _TIFFfreeExt(tif, td->member);                                     \
  |  | 1612|      0|            td->member = 0;                                                    \
  |  | 1613|      0|        }                                                                      \
  |  | 1614|  1.56k|    }
  ------------------
 1637|  1.56k|    CleanupField(td_stripoffset_p);
  ------------------
  |  | 1608|  1.56k|    {                                                                          \
  |  | 1609|  1.56k|        if (td->member)                                                        \
  |  |  ------------------
  |  |  |  Branch (1609:13): [True: 780, False: 780]
  |  |  ------------------
  |  | 1610|  1.56k|        {                                                                      \
  |  | 1611|    780|            _TIFFfreeExt(tif, td->member);                                     \
  |  | 1612|    780|            td->member = 0;                                                    \
  |  | 1613|    780|        }                                                                      \
  |  | 1614|  1.56k|    }
  ------------------
 1638|  1.56k|    CleanupField(td_stripbytecount_p);
  ------------------
  |  | 1608|  1.56k|    {                                                                          \
  |  | 1609|  1.56k|        if (td->member)                                                        \
  |  |  ------------------
  |  |  |  Branch (1609:13): [True: 780, False: 780]
  |  |  ------------------
  |  | 1610|  1.56k|        {                                                                      \
  |  | 1611|    780|            _TIFFfreeExt(tif, td->member);                                     \
  |  | 1612|    780|            td->member = 0;                                                    \
  |  | 1613|    780|        }                                                                      \
  |  | 1614|  1.56k|    }
  ------------------
 1639|  1.56k|    td->td_stripoffsetbyteallocsize = 0;
 1640|  1.56k|    TIFFClrFieldBit(tif, FIELD_YCBCRSUBSAMPLING);
  ------------------
  |  |  211|  1.56k|#define TIFFClrFieldBit(tif, field) (BITFIELDn(tif, field) &= ~BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFClrFieldBit(tif, field) (BITFIELDn(tif, field) &= ~BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  ------------------
 1641|  1.56k|    TIFFClrFieldBit(tif, FIELD_YCBCRPOSITIONING);
  ------------------
  |  |  211|  1.56k|#define TIFFClrFieldBit(tif, field) (BITFIELDn(tif, field) &= ~BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFClrFieldBit(tif, field) (BITFIELDn(tif, field) &= ~BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  ------------------
 1642|       |
 1643|       |    /* Cleanup custom tag values */
 1644|  1.56k|    for (i = 0; i < td->td_customValueCount; i++)
  ------------------
  |  Branch (1644:17): [True: 0, False: 1.56k]
  ------------------
 1645|      0|    {
 1646|      0|        if (td->td_customValues[i].value)
  ------------------
  |  Branch (1646:13): [True: 0, False: 0]
  ------------------
 1647|      0|            _TIFFfreeExt(tif, td->td_customValues[i].value);
 1648|      0|    }
 1649|       |
 1650|  1.56k|    td->td_customValueCount = 0;
 1651|  1.56k|    CleanupField(td_customValues);
  ------------------
  |  | 1608|  1.56k|    {                                                                          \
  |  | 1609|  1.56k|        if (td->member)                                                        \
  |  |  ------------------
  |  |  |  Branch (1609:13): [True: 0, False: 1.56k]
  |  |  ------------------
  |  | 1610|  1.56k|        {                                                                      \
  |  | 1611|      0|            _TIFFfreeExt(tif, td->member);                                     \
  |  | 1612|      0|            td->member = 0;                                                    \
  |  | 1613|      0|        }                                                                      \
  |  | 1614|  1.56k|    }
  ------------------
 1652|       |
 1653|  1.56k|    _TIFFmemset(&(td->td_stripoffset_entry), 0, sizeof(TIFFDirEntry));
 1654|  1.56k|    _TIFFmemset(&(td->td_stripbytecount_entry), 0, sizeof(TIFFDirEntry));
 1655|  1.56k|}
TIFFCreateDirectory:
 1678|    780|{
 1679|    780|    TIFFDefaultDirectory(tif);
 1680|    780|    tif->tif_diroff = 0;
 1681|    780|    tif->tif_nextdiroff = 0;
 1682|    780|    tif->tif_curoff = 0;
 1683|    780|    tif->tif_row = (uint32_t)-1;
 1684|    780|    tif->tif_curstrip = (uint32_t)-1;
 1685|       |
 1686|    780|    return 0;
 1687|    780|}
TIFFDefaultDirectory:
 1736|  1.56k|{
 1737|  1.56k|    register TIFFDirectory *td = &tif->tif_dir;
 1738|  1.56k|    const TIFFFieldArray *tiffFieldArray;
 1739|       |
 1740|  1.56k|    tiffFieldArray = _TIFFGetFields();
 1741|  1.56k|    _TIFFSetupFields(tif, tiffFieldArray);
 1742|       |
 1743|  1.56k|    _TIFFmemset(td, 0, sizeof(*td));
 1744|  1.56k|    td->td_fillorder = FILLORDER_MSB2LSB;
  ------------------
  |  |  240|  1.56k|#define FILLORDER_MSB2LSB 1                /* most significant -> least */
  ------------------
 1745|  1.56k|    td->td_bitspersample = 1;
 1746|  1.56k|    td->td_threshholding = THRESHHOLD_BILEVEL;
  ------------------
  |  |  234|  1.56k|#define THRESHHOLD_BILEVEL 1               /* b&w art scan */
  ------------------
 1747|  1.56k|    td->td_orientation = ORIENTATION_TOPLEFT;
  ------------------
  |  |  248|  1.56k|#define ORIENTATION_TOPLEFT 1              /* row 0 top, col 0 lhs */
  ------------------
 1748|  1.56k|    td->td_samplesperpixel = 1;
 1749|  1.56k|    td->td_rowsperstrip = (uint32_t)-1;
 1750|  1.56k|    td->td_tilewidth = 0;
 1751|  1.56k|    td->td_tilelength = 0;
 1752|  1.56k|    td->td_tiledepth = 1;
 1753|       |#ifdef STRIPBYTECOUNTSORTED_UNUSED
 1754|       |    td->td_stripbytecountsorted = 1; /* Our own arrays always sorted. */
 1755|       |#endif
 1756|  1.56k|    td->td_resolutionunit = RESUNIT_INCH;
  ------------------
  |  |  288|  1.56k|#define RESUNIT_INCH 2                     /* english */
  ------------------
 1757|  1.56k|    td->td_sampleformat = SAMPLEFORMAT_UINT;
  ------------------
  |  |  333|  1.56k|#define SAMPLEFORMAT_UINT 1                /* !unsigned integer data */
  ------------------
 1758|  1.56k|    td->td_imagedepth = 1;
 1759|  1.56k|    td->td_ycbcrsubsampling[0] = 2;
 1760|  1.56k|    td->td_ycbcrsubsampling[1] = 2;
 1761|  1.56k|    td->td_ycbcrpositioning = YCBCRPOSITION_CENTERED;
  ------------------
  |  |  389|  1.56k|#define YCBCRPOSITION_CENTERED 1           /* !as in PostScript Level 2 */
  ------------------
 1762|  1.56k|    tif->tif_postdecode = _TIFFNoPostDecode;
 1763|  1.56k|    tif->tif_foundfield = NULL;
 1764|  1.56k|    tif->tif_tagmethods.vsetfield = _TIFFVSetField;
 1765|  1.56k|    tif->tif_tagmethods.vgetfield = _TIFFVGetField;
 1766|  1.56k|    tif->tif_tagmethods.printdir = NULL;
 1767|       |    /* additional default values */
 1768|  1.56k|    td->td_planarconfig = PLANARCONFIG_CONTIG;
  ------------------
  |  |  264|  1.56k|#define PLANARCONFIG_CONTIG 1              /* single image plane */
  ------------------
 1769|  1.56k|    td->td_compression = COMPRESSION_NONE;
  ------------------
  |  |  182|  1.56k|#define COMPRESSION_NONE 1            /* dump mode */
  ------------------
 1770|  1.56k|    td->td_subfiletype = 0;
 1771|  1.56k|    td->td_minsamplevalue = 0;
 1772|       |    /* td_bitspersample=1 is always set in TIFFDefaultDirectory().
 1773|       |     * Therefore, td_maxsamplevalue has to be re-calculated in
 1774|       |     * TIFFGetFieldDefaulted(). */
 1775|  1.56k|    td->td_maxsamplevalue = 1; /* Default for td_bitspersample=1 */
 1776|  1.56k|    td->td_extrasamples = 0;
 1777|  1.56k|    td->td_sampleinfo = NULL;
 1778|       |
 1779|       |    /*
 1780|       |     *  Give client code a chance to install their own
 1781|       |     *  tag extensions & methods, prior to compression overloads,
 1782|       |     *  but do some prior cleanup first.
 1783|       |     * (http://trac.osgeo.org/gdal/ticket/5054)
 1784|       |     */
 1785|  1.56k|    if (tif->tif_nfieldscompat > 0)
  ------------------
  |  Branch (1785:9): [True: 0, False: 1.56k]
  ------------------
 1786|      0|    {
 1787|      0|        uint32_t i;
 1788|       |
 1789|      0|        for (i = 0; i < tif->tif_nfieldscompat; i++)
  ------------------
  |  Branch (1789:21): [True: 0, False: 0]
  ------------------
 1790|      0|        {
 1791|      0|            if (tif->tif_fieldscompat[i].allocated_size)
  ------------------
  |  Branch (1791:17): [True: 0, False: 0]
  ------------------
 1792|      0|                _TIFFfreeExt(tif, tif->tif_fieldscompat[i].fields);
 1793|      0|        }
 1794|      0|        _TIFFfreeExt(tif, tif->tif_fieldscompat);
 1795|      0|        tif->tif_nfieldscompat = 0;
 1796|      0|        tif->tif_fieldscompat = NULL;
 1797|      0|    }
 1798|  1.56k|    if (_TIFFextender)
  ------------------
  |  Branch (1798:9): [True: 0, False: 1.56k]
  ------------------
 1799|      0|        (*_TIFFextender)(tif);
 1800|  1.56k|    (void)TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
  ------------------
  |  |  181|  1.56k|#define TIFFTAG_COMPRESSION 259       /* data compression technique */
  ------------------
                  (void)TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
  ------------------
  |  |  182|  1.56k|#define COMPRESSION_NONE 1            /* dump mode */
  ------------------
 1801|       |    /*
 1802|       |     * NB: The directory is marked dirty as a result of setting
 1803|       |     * up the default compression scheme.  However, this really
 1804|       |     * isn't correct -- we want TIFF_DIRTYDIRECT to be set only
 1805|       |     * if the user does something.  We could just do the setup
 1806|       |     * by hand, but it seems better to use the normal mechanism
 1807|       |     * (i.e. TIFFSetField).
 1808|       |     */
 1809|  1.56k|    tif->tif_flags &= ~TIFF_DIRTYDIRECT;
  ------------------
  |  |  113|  1.56k|#define TIFF_DIRTYDIRECT 0x00008U /* current directory must be written */
  ------------------
 1810|       |
 1811|       |    /*
 1812|       |     * As per http://bugzilla.remotesensing.org/show_bug.cgi?id=19
 1813|       |     * we clear the ISTILED flag when setting up a new directory.
 1814|       |     * Should we also be clearing stuff like INSUBIFD?
 1815|       |     */
 1816|  1.56k|    tif->tif_flags &= ~TIFF_ISTILED;
  ------------------
  |  |  120|  1.56k|#define TIFF_ISTILED 0x00400U     /* file is tile, not strip- based */
  ------------------
 1817|       |
 1818|  1.56k|    return (1);
 1819|  1.56k|}
tif_dir.c:OkToChangeTag:
 1114|  9.36k|{
 1115|  9.36k|    const TIFFField *fip = TIFFFindField(tif, tag, TIFF_ANY);
  ------------------
  |  |  329|  9.36k|#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */
  ------------------
 1116|  9.36k|    if (!fip)
  ------------------
  |  Branch (1116:9): [True: 0, False: 9.36k]
  ------------------
 1117|      0|    { /* unknown tag */
 1118|      0|        TIFFErrorExtR(tif, "TIFFSetField", "%s: Unknown %stag %" PRIu32,
 1119|      0|                      tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "", tag);
  ------------------
  |  |  248|      0|#define isPseudoTag(t) (t > 0xffff) /* is tag value normal or pseudo */
  |  |  ------------------
  |  |  |  Branch (248:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1120|      0|        return (0);
 1121|      0|    }
 1122|  9.36k|    if (tag != TIFFTAG_IMAGELENGTH && (tif->tif_flags & TIFF_BEENWRITING) &&
  ------------------
  |  |  179|  18.7k|#define TIFFTAG_IMAGELENGTH 257       /* image height in pixels */
  ------------------
                  if (tag != TIFFTAG_IMAGELENGTH && (tif->tif_flags & TIFF_BEENWRITING) &&
  ------------------
  |  |  116|  8.58k|#define TIFF_BEENWRITING 0x00040U /* written 1+ scanlines to file */
  ------------------
  |  Branch (1122:9): [True: 8.58k, False: 780]
  |  Branch (1122:39): [True: 0, False: 8.58k]
  ------------------
 1123|  9.36k|        !fip->field_oktochange)
  ------------------
  |  Branch (1123:9): [True: 0, False: 0]
  ------------------
 1124|      0|    {
 1125|       |        /*
 1126|       |         * Consult info table to see if tag can be changed
 1127|       |         * after we've started writing.  We only allow changes
 1128|       |         * to those tags that don't/shouldn't affect the
 1129|       |         * compression and/or format of the data.
 1130|       |         */
 1131|      0|        TIFFErrorExtR(tif, "TIFFSetField",
 1132|      0|                      "%s: Cannot modify tag \"%s\" while writing",
 1133|      0|                      tif->tif_name, fip->field_name);
 1134|      0|        return (0);
 1135|      0|    }
 1136|  9.36k|    return (1);
 1137|  9.36k|}
tif_dir.c:_TIFFVSetField:
  221|  8.58k|{
  222|  8.58k|    static const char module[] = "_TIFFVSetField";
  223|       |
  224|  8.58k|    TIFFDirectory *td = &tif->tif_dir;
  225|  8.58k|    int status = 1;
  226|  8.58k|    uint32_t v32, v;
  227|  8.58k|    double dblval;
  228|  8.58k|    char *s;
  229|  8.58k|    const TIFFField *fip = TIFFFindField(tif, tag, TIFF_ANY);
  ------------------
  |  |  329|  8.58k|#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */
  ------------------
  230|  8.58k|    uint32_t standard_tag = tag;
  231|  8.58k|    if (fip == NULL) /* cannot happen since OkToChangeTag() already checks it */
  ------------------
  |  Branch (231:9): [True: 0, False: 8.58k]
  ------------------
  232|      0|        return 0;
  233|       |    /*
  234|       |     * We want to force the custom code to be used for custom
  235|       |     * fields even if the tag happens to match a well known
  236|       |     * one - important for reinterpreted handling of standard
  237|       |     * tag values in custom directories (i.e. EXIF)
  238|       |     */
  239|  8.58k|    if (fip->field_bit == FIELD_CUSTOM)
  ------------------
  |  |  334|  8.58k|#define FIELD_CUSTOM 65
  ------------------
  |  Branch (239:9): [True: 0, False: 8.58k]
  ------------------
  240|      0|    {
  241|      0|        standard_tag = 0;
  242|      0|    }
  243|       |
  244|  8.58k|    switch (standard_tag)
  245|  8.58k|    {
  246|      0|        case TIFFTAG_SUBFILETYPE:
  ------------------
  |  |  170|      0|#define TIFFTAG_SUBFILETYPE 254       /* subfile data descriptor */
  ------------------
  |  Branch (246:9): [True: 0, False: 8.58k]
  ------------------
  247|      0|            td->td_subfiletype = (uint32_t)va_arg(ap, uint32_t);
  248|      0|            break;
  249|    780|        case TIFFTAG_IMAGEWIDTH:
  ------------------
  |  |  178|    780|#define TIFFTAG_IMAGEWIDTH 256        /* image width in pixels */
  ------------------
  |  Branch (249:9): [True: 780, False: 7.80k]
  ------------------
  250|    780|            td->td_imagewidth = (uint32_t)va_arg(ap, uint32_t);
  251|    780|            break;
  252|    780|        case TIFFTAG_IMAGELENGTH:
  ------------------
  |  |  179|    780|#define TIFFTAG_IMAGELENGTH 257       /* image height in pixels */
  ------------------
  |  Branch (252:9): [True: 780, False: 7.80k]
  ------------------
  253|    780|            td->td_imagelength = (uint32_t)va_arg(ap, uint32_t);
  254|    780|            break;
  255|    780|        case TIFFTAG_BITSPERSAMPLE:
  ------------------
  |  |  180|    780|#define TIFFTAG_BITSPERSAMPLE 258     /* bits per channel (sample) */
  ------------------
  |  Branch (255:9): [True: 780, False: 7.80k]
  ------------------
  256|    780|            td->td_bitspersample = (uint16_t)va_arg(ap, uint16_vap);
  257|       |            /*
  258|       |             * If the data require post-decoding processing to byte-swap
  259|       |             * samples, set it up here.  Note that since tags are required
  260|       |             * to be ordered, compression code can override this behavior
  261|       |             * in the setup method if it wants to roll the post decoding
  262|       |             * work in with its normal work.
  263|       |             */
  264|    780|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|    780|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (264:17): [True: 0, False: 780]
  ------------------
  265|      0|            {
  266|      0|                if (td->td_bitspersample == 8)
  ------------------
  |  Branch (266:21): [True: 0, False: 0]
  ------------------
  267|      0|                    tif->tif_postdecode = _TIFFNoPostDecode;
  268|      0|                else if (td->td_bitspersample == 16)
  ------------------
  |  Branch (268:26): [True: 0, False: 0]
  ------------------
  269|      0|                    tif->tif_postdecode = _TIFFSwab16BitData;
  270|      0|                else if (td->td_bitspersample == 24)
  ------------------
  |  Branch (270:26): [True: 0, False: 0]
  ------------------
  271|      0|                    tif->tif_postdecode = _TIFFSwab24BitData;
  272|      0|                else if (td->td_bitspersample == 32)
  ------------------
  |  Branch (272:26): [True: 0, False: 0]
  ------------------
  273|      0|                    tif->tif_postdecode = _TIFFSwab32BitData;
  274|      0|                else if (td->td_bitspersample == 64)
  ------------------
  |  Branch (274:26): [True: 0, False: 0]
  ------------------
  275|      0|                    tif->tif_postdecode = _TIFFSwab64BitData;
  276|      0|                else if (td->td_bitspersample == 128) /* two 64's */
  ------------------
  |  Branch (276:26): [True: 0, False: 0]
  ------------------
  277|      0|                    tif->tif_postdecode = _TIFFSwab64BitData;
  278|      0|            }
  279|    780|            break;
  280|  2.34k|        case TIFFTAG_COMPRESSION:
  ------------------
  |  |  181|  2.34k|#define TIFFTAG_COMPRESSION 259       /* data compression technique */
  ------------------
  |  Branch (280:9): [True: 2.34k, False: 6.24k]
  ------------------
  281|  2.34k|            v = (uint16_t)va_arg(ap, uint16_vap);
  282|       |            /*
  283|       |             * If we're changing the compression scheme, notify the
  284|       |             * previous module so that it can cleanup any state it's
  285|       |             * setup.
  286|       |             */
  287|  2.34k|            if (TIFFFieldSet(tif, FIELD_COMPRESSION))
  ------------------
  |  |  209|  2.34k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  2.34k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  2.34k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 780, False: 1.56k]
  |  |  ------------------
  ------------------
  288|    780|            {
  289|    780|                if ((uint32_t)td->td_compression == v)
  ------------------
  |  Branch (289:21): [True: 0, False: 780]
  ------------------
  290|      0|                    break;
  291|    780|                (*tif->tif_cleanup)(tif);
  292|    780|                tif->tif_flags &= ~TIFF_CODERSETUP;
  ------------------
  |  |  115|    780|#define TIFF_CODERSETUP 0x00020U  /* encoder/decoder setup done */
  ------------------
  293|    780|            }
  294|       |            /*
  295|       |             * Setup new compression routine state.
  296|       |             */
  297|  2.34k|            if ((status = TIFFSetCompressionScheme(tif, v)) != 0)
  ------------------
  |  Branch (297:17): [True: 2.34k, False: 0]
  ------------------
  298|  2.34k|                td->td_compression = (uint16_t)v;
  299|      0|            else
  300|      0|                status = 0;
  301|  2.34k|            break;
  302|    780|        case TIFFTAG_PHOTOMETRIC:
  ------------------
  |  |  219|    780|#define TIFFTAG_PHOTOMETRIC 262            /* photometric interpretation */
  ------------------
  |  Branch (302:9): [True: 780, False: 7.80k]
  ------------------
  303|    780|            td->td_photometric = (uint16_t)va_arg(ap, uint16_vap);
  304|    780|            break;
  305|      0|        case TIFFTAG_THRESHHOLDING:
  ------------------
  |  |  233|      0|#define TIFFTAG_THRESHHOLDING 263          /* +thresholding used on data */
  ------------------
  |  Branch (305:9): [True: 0, False: 8.58k]
  ------------------
  306|      0|            td->td_threshholding = (uint16_t)va_arg(ap, uint16_vap);
  307|      0|            break;
  308|      0|        case TIFFTAG_FILLORDER:
  ------------------
  |  |  239|      0|#define TIFFTAG_FILLORDER 266              /* data order within a byte */
  ------------------
  |  Branch (308:9): [True: 0, False: 8.58k]
  ------------------
  309|      0|            v = (uint16_t)va_arg(ap, uint16_vap);
  310|      0|            if (v != FILLORDER_LSB2MSB && v != FILLORDER_MSB2LSB)
  ------------------
  |  |  241|      0|#define FILLORDER_LSB2MSB 2                /* least significant -> most */
  ------------------
                          if (v != FILLORDER_LSB2MSB && v != FILLORDER_MSB2LSB)
  ------------------
  |  |  240|      0|#define FILLORDER_MSB2LSB 1                /* most significant -> least */
  ------------------
  |  Branch (310:17): [True: 0, False: 0]
  |  Branch (310:43): [True: 0, False: 0]
  ------------------
  311|      0|                goto badvalue;
  312|      0|            td->td_fillorder = (uint16_t)v;
  313|      0|            break;
  314|      0|        case TIFFTAG_ORIENTATION:
  ------------------
  |  |  247|      0|#define TIFFTAG_ORIENTATION 274            /* +image orientation */
  ------------------
  |  Branch (314:9): [True: 0, False: 8.58k]
  ------------------
  315|      0|            v = (uint16_t)va_arg(ap, uint16_vap);
  316|      0|            if (v < ORIENTATION_TOPLEFT || ORIENTATION_LEFTBOT < v)
  ------------------
  |  |  248|      0|#define ORIENTATION_TOPLEFT 1              /* row 0 top, col 0 lhs */
  ------------------
                          if (v < ORIENTATION_TOPLEFT || ORIENTATION_LEFTBOT < v)
  ------------------
  |  |  255|      0|#define ORIENTATION_LEFTBOT 8              /* row 0 lhs, col 0 bottom */
  ------------------
  |  Branch (316:17): [True: 0, False: 0]
  |  Branch (316:44): [True: 0, False: 0]
  ------------------
  317|      0|                goto badvalue;
  318|      0|            else
  319|      0|                td->td_orientation = (uint16_t)v;
  320|      0|            break;
  321|    780|        case TIFFTAG_SAMPLESPERPIXEL:
  ------------------
  |  |  256|    780|#define TIFFTAG_SAMPLESPERPIXEL 277        /* samples per pixel */
  ------------------
  |  Branch (321:9): [True: 780, False: 7.80k]
  ------------------
  322|    780|            v = (uint16_t)va_arg(ap, uint16_vap);
  323|    780|            if (v == 0)
  ------------------
  |  Branch (323:17): [True: 0, False: 780]
  ------------------
  324|      0|                goto badvalue;
  325|    780|            if (v != td->td_samplesperpixel)
  ------------------
  |  Branch (325:17): [True: 0, False: 780]
  ------------------
  326|      0|            {
  327|       |                /* See http://bugzilla.maptools.org/show_bug.cgi?id=2500 */
  328|      0|                if (td->td_sminsamplevalue != NULL)
  ------------------
  |  Branch (328:21): [True: 0, False: 0]
  ------------------
  329|      0|                {
  330|      0|                    TIFFWarningExtR(tif, module,
  331|      0|                                    "SamplesPerPixel tag value is changing, "
  332|      0|                                    "but SMinSampleValue tag was read with a "
  333|      0|                                    "different value. Canceling it");
  334|      0|                    TIFFClrFieldBit(tif, FIELD_SMINSAMPLEVALUE);
  ------------------
  |  |  211|      0|#define TIFFClrFieldBit(tif, field) (BITFIELDn(tif, field) &= ~BITn(field))
  |  |  ------------------
  |  |  |  |  208|      0|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFClrFieldBit(tif, field) (BITFIELDn(tif, field) &= ~BITn(field))
  |  |  ------------------
  |  |  |  |  207|      0|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  ------------------
  335|      0|                    _TIFFfreeExt(tif, td->td_sminsamplevalue);
  336|      0|                    td->td_sminsamplevalue = NULL;
  337|      0|                }
  338|      0|                if (td->td_smaxsamplevalue != NULL)
  ------------------
  |  Branch (338:21): [True: 0, False: 0]
  ------------------
  339|      0|                {
  340|      0|                    TIFFWarningExtR(tif, module,
  341|      0|                                    "SamplesPerPixel tag value is changing, "
  342|      0|                                    "but SMaxSampleValue tag was read with a "
  343|      0|                                    "different value. Canceling it");
  344|      0|                    TIFFClrFieldBit(tif, FIELD_SMAXSAMPLEVALUE);
  ------------------
  |  |  211|      0|#define TIFFClrFieldBit(tif, field) (BITFIELDn(tif, field) &= ~BITn(field))
  |  |  ------------------
  |  |  |  |  208|      0|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFClrFieldBit(tif, field) (BITFIELDn(tif, field) &= ~BITn(field))
  |  |  ------------------
  |  |  |  |  207|      0|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  ------------------
  345|      0|                    _TIFFfreeExt(tif, td->td_smaxsamplevalue);
  346|      0|                    td->td_smaxsamplevalue = NULL;
  347|      0|                }
  348|       |                /* Test if 3 transfer functions instead of just one are now
  349|       |                   needed See http://bugzilla.maptools.org/show_bug.cgi?id=2820
  350|       |                 */
  351|      0|                if (td->td_transferfunction[0] != NULL &&
  ------------------
  |  Branch (351:21): [True: 0, False: 0]
  ------------------
  352|      0|                    (v - td->td_extrasamples > 1) &&
  ------------------
  |  Branch (352:21): [True: 0, False: 0]
  ------------------
  353|      0|                    !(td->td_samplesperpixel - td->td_extrasamples > 1))
  ------------------
  |  Branch (353:21): [True: 0, False: 0]
  ------------------
  354|      0|                {
  355|      0|                    TIFFWarningExtR(tif, module,
  356|      0|                                    "SamplesPerPixel tag value is changing, "
  357|      0|                                    "but TransferFunction was read with a "
  358|      0|                                    "different value. Canceling it");
  359|      0|                    TIFFClrFieldBit(tif, FIELD_TRANSFERFUNCTION);
  ------------------
  |  |  211|      0|#define TIFFClrFieldBit(tif, field) (BITFIELDn(tif, field) &= ~BITn(field))
  |  |  ------------------
  |  |  |  |  208|      0|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFClrFieldBit(tif, field) (BITFIELDn(tif, field) &= ~BITn(field))
  |  |  ------------------
  |  |  |  |  207|      0|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  ------------------
  360|      0|                    _TIFFfreeExt(tif, td->td_transferfunction[0]);
  361|      0|                    td->td_transferfunction[0] = NULL;
  362|      0|                }
  363|      0|            }
  364|    780|            td->td_samplesperpixel = (uint16_t)v;
  365|    780|            break;
  366|    780|        case TIFFTAG_ROWSPERSTRIP:
  ------------------
  |  |  257|    780|#define TIFFTAG_ROWSPERSTRIP 278           /* rows per strip of data */
  ------------------
  |  Branch (366:9): [True: 780, False: 7.80k]
  ------------------
  367|    780|            v32 = (uint32_t)va_arg(ap, uint32_t);
  368|    780|            if (v32 == 0)
  ------------------
  |  Branch (368:17): [True: 0, False: 780]
  ------------------
  369|      0|                goto badvalue32;
  370|    780|            td->td_rowsperstrip = v32;
  371|    780|            if (!TIFFFieldSet(tif, FIELD_TILEDIMENSIONS))
  ------------------
  |  |  209|    780|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|    780|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|    780|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  ------------------
  |  Branch (371:17): [True: 780, False: 0]
  ------------------
  372|    780|            {
  373|    780|                td->td_tilelength = v32;
  374|    780|                td->td_tilewidth = td->td_imagewidth;
  375|    780|            }
  376|    780|            break;
  377|      0|        case TIFFTAG_MINSAMPLEVALUE:
  ------------------
  |  |  259|      0|#define TIFFTAG_MINSAMPLEVALUE 280         /* +minimum sample value */
  ------------------
  |  Branch (377:9): [True: 0, False: 8.58k]
  ------------------
  378|      0|            td->td_minsamplevalue = (uint16_t)va_arg(ap, uint16_vap);
  379|      0|            break;
  380|      0|        case TIFFTAG_MAXSAMPLEVALUE:
  ------------------
  |  |  260|      0|#define TIFFTAG_MAXSAMPLEVALUE 281         /* +maximum sample value */
  ------------------
  |  Branch (380:9): [True: 0, False: 8.58k]
  ------------------
  381|      0|            td->td_maxsamplevalue = (uint16_t)va_arg(ap, uint16_vap);
  382|      0|            break;
  383|      0|        case TIFFTAG_SMINSAMPLEVALUE:
  ------------------
  |  |  339|      0|#define TIFFTAG_SMINSAMPLEVALUE 340        /* !variable MinSampleValue */
  ------------------
  |  Branch (383:9): [True: 0, False: 8.58k]
  ------------------
  384|      0|            if (tif->tif_flags & TIFF_PERSAMPLE)
  ------------------
  |  |  134|      0|#define TIFF_PERSAMPLE 0x400000U  /* get/set per sample tags as arrays */
  ------------------
  |  Branch (384:17): [True: 0, False: 0]
  ------------------
  385|      0|                _TIFFsetDoubleArrayExt(tif, &td->td_sminsamplevalue,
  386|      0|                                       va_arg(ap, double *),
  387|      0|                                       td->td_samplesperpixel);
  388|      0|            else
  389|      0|                setDoubleArrayOneValue(tif, &td->td_sminsamplevalue,
  390|      0|                                       va_arg(ap, double),
  391|      0|                                       td->td_samplesperpixel);
  392|      0|            break;
  393|      0|        case TIFFTAG_SMAXSAMPLEVALUE:
  ------------------
  |  |  340|      0|#define TIFFTAG_SMAXSAMPLEVALUE 341        /* !variable MaxSampleValue */
  ------------------
  |  Branch (393:9): [True: 0, False: 8.58k]
  ------------------
  394|      0|            if (tif->tif_flags & TIFF_PERSAMPLE)
  ------------------
  |  |  134|      0|#define TIFF_PERSAMPLE 0x400000U  /* get/set per sample tags as arrays */
  ------------------
  |  Branch (394:17): [True: 0, False: 0]
  ------------------
  395|      0|                _TIFFsetDoubleArrayExt(tif, &td->td_smaxsamplevalue,
  396|      0|                                       va_arg(ap, double *),
  397|      0|                                       td->td_samplesperpixel);
  398|      0|            else
  399|      0|                setDoubleArrayOneValue(tif, &td->td_smaxsamplevalue,
  400|      0|                                       va_arg(ap, double),
  401|      0|                                       td->td_samplesperpixel);
  402|      0|            break;
  403|      0|        case TIFFTAG_XRESOLUTION:
  ------------------
  |  |  261|      0|#define TIFFTAG_XRESOLUTION 282            /* pixels/resolution in x */
  ------------------
  |  Branch (403:9): [True: 0, False: 8.58k]
  ------------------
  404|      0|            dblval = va_arg(ap, double);
  405|      0|            if (dblval != dblval || dblval < 0)
  ------------------
  |  Branch (405:17): [True: 0, False: 0]
  |  Branch (405:37): [True: 0, False: 0]
  ------------------
  406|      0|                goto badvaluedouble;
  407|      0|            td->td_xresolution = _TIFFClampDoubleToFloat(dblval);
  408|      0|            break;
  409|      0|        case TIFFTAG_YRESOLUTION:
  ------------------
  |  |  262|      0|#define TIFFTAG_YRESOLUTION 283            /* pixels/resolution in y */
  ------------------
  |  Branch (409:9): [True: 0, False: 8.58k]
  ------------------
  410|      0|            dblval = va_arg(ap, double);
  411|      0|            if (dblval != dblval || dblval < 0)
  ------------------
  |  Branch (411:17): [True: 0, False: 0]
  |  Branch (411:37): [True: 0, False: 0]
  ------------------
  412|      0|                goto badvaluedouble;
  413|      0|            td->td_yresolution = _TIFFClampDoubleToFloat(dblval);
  414|      0|            break;
  415|    780|        case TIFFTAG_PLANARCONFIG:
  ------------------
  |  |  263|    780|#define TIFFTAG_PLANARCONFIG 284           /* storage organization */
  ------------------
  |  Branch (415:9): [True: 780, False: 7.80k]
  ------------------
  416|    780|            v = (uint16_t)va_arg(ap, uint16_vap);
  417|    780|            if (v != PLANARCONFIG_CONTIG && v != PLANARCONFIG_SEPARATE)
  ------------------
  |  |  264|  1.56k|#define PLANARCONFIG_CONTIG 1              /* single image plane */
  ------------------
                          if (v != PLANARCONFIG_CONTIG && v != PLANARCONFIG_SEPARATE)
  ------------------
  |  |  265|      0|#define PLANARCONFIG_SEPARATE 2            /* separate planes of data */
  ------------------
  |  Branch (417:17): [True: 0, False: 780]
  |  Branch (417:45): [True: 0, False: 0]
  ------------------
  418|      0|                goto badvalue;
  419|    780|            td->td_planarconfig = (uint16_t)v;
  420|    780|            break;
  421|      0|        case TIFFTAG_XPOSITION:
  ------------------
  |  |  267|      0|#define TIFFTAG_XPOSITION 286              /* x page offset of image lhs */
  ------------------
  |  Branch (421:9): [True: 0, False: 8.58k]
  ------------------
  422|      0|            td->td_xposition = _TIFFClampDoubleToFloat(va_arg(ap, double));
  423|      0|            break;
  424|      0|        case TIFFTAG_YPOSITION:
  ------------------
  |  |  268|      0|#define TIFFTAG_YPOSITION 287              /* y page offset of image lhs */
  ------------------
  |  Branch (424:9): [True: 0, False: 8.58k]
  ------------------
  425|      0|            td->td_yposition = _TIFFClampDoubleToFloat(va_arg(ap, double));
  426|      0|            break;
  427|      0|        case TIFFTAG_RESOLUTIONUNIT:
  ------------------
  |  |  286|      0|#define TIFFTAG_RESOLUTIONUNIT 296         /* units of resolutions */
  ------------------
  |  Branch (427:9): [True: 0, False: 8.58k]
  ------------------
  428|      0|            v = (uint16_t)va_arg(ap, uint16_vap);
  429|      0|            if (v < RESUNIT_NONE || RESUNIT_CENTIMETER < v)
  ------------------
  |  |  287|      0|#define RESUNIT_NONE 1                     /* no meaningful units */
  ------------------
                          if (v < RESUNIT_NONE || RESUNIT_CENTIMETER < v)
  ------------------
  |  |  289|      0|#define RESUNIT_CENTIMETER 3               /* metric */
  ------------------
  |  Branch (429:17): [True: 0, False: 0]
  |  Branch (429:37): [True: 0, False: 0]
  ------------------
  430|      0|                goto badvalue;
  431|      0|            td->td_resolutionunit = (uint16_t)v;
  432|      0|            break;
  433|      0|        case TIFFTAG_PAGENUMBER:
  ------------------
  |  |  290|      0|#define TIFFTAG_PAGENUMBER 297             /* page numbers of multi-page */
  ------------------
  |  Branch (433:9): [True: 0, False: 8.58k]
  ------------------
  434|      0|            td->td_pagenumber[0] = (uint16_t)va_arg(ap, uint16_vap);
  435|      0|            td->td_pagenumber[1] = (uint16_t)va_arg(ap, uint16_vap);
  436|      0|            break;
  437|      0|        case TIFFTAG_HALFTONEHINTS:
  ------------------
  |  |  309|      0|#define TIFFTAG_HALFTONEHINTS 321          /* !highlight+shadow info */
  ------------------
  |  Branch (437:9): [True: 0, False: 8.58k]
  ------------------
  438|      0|            td->td_halftonehints[0] = (uint16_t)va_arg(ap, uint16_vap);
  439|      0|            td->td_halftonehints[1] = (uint16_t)va_arg(ap, uint16_vap);
  440|      0|            break;
  441|      0|        case TIFFTAG_COLORMAP:
  ------------------
  |  |  308|      0|#define TIFFTAG_COLORMAP 320               /* RGB map for palette image */
  ------------------
  |  Branch (441:9): [True: 0, False: 8.58k]
  ------------------
  442|      0|            v32 = (uint32_t)(1L << td->td_bitspersample);
  443|      0|            _TIFFsetShortArrayExt(tif, &td->td_colormap[0],
  444|      0|                                  va_arg(ap, uint16_t *), v32);
  445|      0|            _TIFFsetShortArrayExt(tif, &td->td_colormap[1],
  446|      0|                                  va_arg(ap, uint16_t *), v32);
  447|      0|            _TIFFsetShortArrayExt(tif, &td->td_colormap[2],
  448|      0|                                  va_arg(ap, uint16_t *), v32);
  449|      0|            break;
  450|      0|        case TIFFTAG_EXTRASAMPLES:
  ------------------
  |  |  328|      0|#define TIFFTAG_EXTRASAMPLES 338           /* !info about extra samples */
  ------------------
  |  Branch (450:9): [True: 0, False: 8.58k]
  ------------------
  451|      0|            if (!setExtraSamples(tif, ap, &v))
  ------------------
  |  Branch (451:17): [True: 0, False: 0]
  ------------------
  452|      0|                goto badvalue;
  453|      0|            break;
  454|      0|        case TIFFTAG_MATTEING:
  ------------------
  |  |  404|      0|#define TIFFTAG_MATTEING 32995   /* $use ExtraSamples */
  ------------------
  |  Branch (454:9): [True: 0, False: 8.58k]
  ------------------
  455|      0|            td->td_extrasamples = (((uint16_t)va_arg(ap, uint16_vap)) != 0);
  456|      0|            if (td->td_extrasamples)
  ------------------
  |  Branch (456:17): [True: 0, False: 0]
  ------------------
  457|      0|            {
  458|      0|                uint16_t sv = EXTRASAMPLE_ASSOCALPHA;
  ------------------
  |  |  330|      0|#define EXTRASAMPLE_ASSOCALPHA 1           /* !associated alpha data */
  ------------------
  459|      0|                _TIFFsetShortArrayExt(tif, &td->td_sampleinfo, &sv, 1);
  460|      0|            }
  461|      0|            break;
  462|      0|        case TIFFTAG_TILEWIDTH:
  ------------------
  |  |  310|      0|#define TIFFTAG_TILEWIDTH 322              /* !tile width in pixels */
  ------------------
  |  Branch (462:9): [True: 0, False: 8.58k]
  ------------------
  463|      0|            v32 = (uint32_t)va_arg(ap, uint32_t);
  464|      0|            if (v32 % 16)
  ------------------
  |  Branch (464:17): [True: 0, False: 0]
  ------------------
  465|      0|            {
  466|      0|                if (tif->tif_mode != O_RDONLY)
  ------------------
  |  Branch (466:21): [True: 0, False: 0]
  ------------------
  467|      0|                    goto badvalue32;
  468|      0|                TIFFWarningExtR(
  469|      0|                    tif, tif->tif_name,
  470|      0|                    "Nonstandard tile width %" PRIu32 ", convert file", v32);
  471|      0|            }
  472|      0|            td->td_tilewidth = v32;
  473|      0|            tif->tif_flags |= TIFF_ISTILED;
  ------------------
  |  |  120|      0|#define TIFF_ISTILED 0x00400U     /* file is tile, not strip- based */
  ------------------
  474|      0|            break;
  475|      0|        case TIFFTAG_TILELENGTH:
  ------------------
  |  |  311|      0|#define TIFFTAG_TILELENGTH 323             /* !tile height in pixels */
  ------------------
  |  Branch (475:9): [True: 0, False: 8.58k]
  ------------------
  476|      0|            v32 = (uint32_t)va_arg(ap, uint32_t);
  477|      0|            if (v32 % 16)
  ------------------
  |  Branch (477:17): [True: 0, False: 0]
  ------------------
  478|      0|            {
  479|      0|                if (tif->tif_mode != O_RDONLY)
  ------------------
  |  Branch (479:21): [True: 0, False: 0]
  ------------------
  480|      0|                    goto badvalue32;
  481|      0|                TIFFWarningExtR(
  482|      0|                    tif, tif->tif_name,
  483|      0|                    "Nonstandard tile length %" PRIu32 ", convert file", v32);
  484|      0|            }
  485|      0|            td->td_tilelength = v32;
  486|      0|            tif->tif_flags |= TIFF_ISTILED;
  ------------------
  |  |  120|      0|#define TIFF_ISTILED 0x00400U     /* file is tile, not strip- based */
  ------------------
  487|      0|            break;
  488|      0|        case TIFFTAG_TILEDEPTH:
  ------------------
  |  |  407|      0|#define TIFFTAG_TILEDEPTH 32998  /* z depth/data tile */
  ------------------
  |  Branch (488:9): [True: 0, False: 8.58k]
  ------------------
  489|      0|            v32 = (uint32_t)va_arg(ap, uint32_t);
  490|      0|            if (v32 == 0)
  ------------------
  |  Branch (490:17): [True: 0, False: 0]
  ------------------
  491|      0|                goto badvalue32;
  492|      0|            td->td_tiledepth = v32;
  493|      0|            break;
  494|      0|        case TIFFTAG_DATATYPE:
  ------------------
  |  |  405|      0|#define TIFFTAG_DATATYPE 32996   /* $use SampleFormat */
  ------------------
  |  Branch (494:9): [True: 0, False: 8.58k]
  ------------------
  495|      0|            v = (uint16_t)va_arg(ap, uint16_vap);
  496|      0|            switch (v)
  497|      0|            {
  498|      0|                case DATATYPE_VOID:
  ------------------
  |  |   38|      0|#define DATATYPE_VOID 0   /* !untyped data */
  ------------------
  |  Branch (498:17): [True: 0, False: 0]
  ------------------
  499|      0|                    v = SAMPLEFORMAT_VOID;
  ------------------
  |  |  336|      0|#define SAMPLEFORMAT_VOID 4                /* !untyped data */
  ------------------
  500|      0|                    break;
  501|      0|                case DATATYPE_INT:
  ------------------
  |  |   39|      0|#define DATATYPE_INT 1    /* !signed integer data */
  ------------------
  |  Branch (501:17): [True: 0, False: 0]
  ------------------
  502|      0|                    v = SAMPLEFORMAT_INT;
  ------------------
  |  |  334|      0|#define SAMPLEFORMAT_INT 2                 /* !signed integer data */
  ------------------
  503|      0|                    break;
  504|      0|                case DATATYPE_UINT:
  ------------------
  |  |   40|      0|#define DATATYPE_UINT 2   /* !unsigned integer data */
  ------------------
  |  Branch (504:17): [True: 0, False: 0]
  ------------------
  505|      0|                    v = SAMPLEFORMAT_UINT;
  ------------------
  |  |  333|      0|#define SAMPLEFORMAT_UINT 1                /* !unsigned integer data */
  ------------------
  506|      0|                    break;
  507|      0|                case DATATYPE_IEEEFP:
  ------------------
  |  |   41|      0|#define DATATYPE_IEEEFP 3 /* !IEEE floating point data */
  ------------------
  |  Branch (507:17): [True: 0, False: 0]
  ------------------
  508|      0|                    v = SAMPLEFORMAT_IEEEFP;
  ------------------
  |  |  335|      0|#define SAMPLEFORMAT_IEEEFP 3              /* !IEEE floating point data */
  ------------------
  509|      0|                    break;
  510|      0|                default:
  ------------------
  |  Branch (510:17): [True: 0, False: 0]
  ------------------
  511|      0|                    goto badvalue;
  512|      0|            }
  513|      0|            td->td_sampleformat = (uint16_t)v;
  514|      0|            break;
  515|    780|        case TIFFTAG_SAMPLEFORMAT:
  ------------------
  |  |  332|    780|#define TIFFTAG_SAMPLEFORMAT 339           /* !data sample format */
  ------------------
  |  Branch (515:9): [True: 780, False: 7.80k]
  ------------------
  516|    780|            v = (uint16_t)va_arg(ap, uint16_vap);
  517|    780|            if (v < SAMPLEFORMAT_UINT || SAMPLEFORMAT_COMPLEXIEEEFP < v)
  ------------------
  |  |  333|  1.56k|#define SAMPLEFORMAT_UINT 1                /* !unsigned integer data */
  ------------------
                          if (v < SAMPLEFORMAT_UINT || SAMPLEFORMAT_COMPLEXIEEEFP < v)
  ------------------
  |  |  338|    780|#define SAMPLEFORMAT_COMPLEXIEEEFP 6       /* !complex ieee floating */
  ------------------
  |  Branch (517:17): [True: 0, False: 780]
  |  Branch (517:42): [True: 0, False: 780]
  ------------------
  518|      0|                goto badvalue;
  519|    780|            td->td_sampleformat = (uint16_t)v;
  520|       |
  521|       |            /*  Try to fix up the SWAB function for complex data. */
  522|    780|            if (td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT &&
  ------------------
  |  |  337|  1.56k|#define SAMPLEFORMAT_COMPLEXINT 5          /* !complex signed int */
  ------------------
  |  Branch (522:17): [True: 0, False: 780]
  ------------------
  523|    780|                td->td_bitspersample == 32 &&
  ------------------
  |  Branch (523:17): [True: 0, False: 0]
  ------------------
  524|    780|                tif->tif_postdecode == _TIFFSwab32BitData)
  ------------------
  |  Branch (524:17): [True: 0, False: 0]
  ------------------
  525|      0|                tif->tif_postdecode = _TIFFSwab16BitData;
  526|    780|            else if ((td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT ||
  ------------------
  |  |  337|  1.56k|#define SAMPLEFORMAT_COMPLEXINT 5          /* !complex signed int */
  ------------------
  |  Branch (526:23): [True: 0, False: 780]
  ------------------
  527|    780|                      td->td_sampleformat == SAMPLEFORMAT_COMPLEXIEEEFP) &&
  ------------------
  |  |  338|    780|#define SAMPLEFORMAT_COMPLEXIEEEFP 6       /* !complex ieee floating */
  ------------------
  |  Branch (527:23): [True: 0, False: 780]
  ------------------
  528|    780|                     td->td_bitspersample == 64 &&
  ------------------
  |  Branch (528:22): [True: 0, False: 0]
  ------------------
  529|    780|                     tif->tif_postdecode == _TIFFSwab64BitData)
  ------------------
  |  Branch (529:22): [True: 0, False: 0]
  ------------------
  530|      0|                tif->tif_postdecode = _TIFFSwab32BitData;
  531|    780|            break;
  532|      0|        case TIFFTAG_IMAGEDEPTH:
  ------------------
  |  |  406|      0|#define TIFFTAG_IMAGEDEPTH 32997 /* z depth of image */
  ------------------
  |  Branch (532:9): [True: 0, False: 8.58k]
  ------------------
  533|      0|            td->td_imagedepth = (uint32_t)va_arg(ap, uint32_t);
  534|      0|            break;
  535|      0|        case TIFFTAG_SUBIFD:
  ------------------
  |  |  320|      0|#define TIFFTAG_SUBIFD 330                 /* subimage descriptors */
  ------------------
  |  Branch (535:9): [True: 0, False: 8.58k]
  ------------------
  536|      0|            if ((tif->tif_flags & TIFF_INSUBIFD) == 0)
  ------------------
  |  |  123|      0|#define TIFF_INSUBIFD 0x02000U    /* currently writing a subifd */
  ------------------
  |  Branch (536:17): [True: 0, False: 0]
  ------------------
  537|      0|            {
  538|      0|                td->td_nsubifd = (uint16_t)va_arg(ap, uint16_vap);
  539|      0|                _TIFFsetLong8Array(tif, &td->td_subifd,
  540|      0|                                   (uint64_t *)va_arg(ap, uint64_t *),
  541|      0|                                   (uint32_t)td->td_nsubifd);
  542|      0|            }
  543|      0|            else
  544|      0|            {
  545|      0|                TIFFErrorExtR(tif, module, "%s: Sorry, cannot nest SubIFDs",
  546|      0|                              tif->tif_name);
  547|      0|                status = 0;
  548|      0|            }
  549|      0|            break;
  550|      0|        case TIFFTAG_YCBCRPOSITIONING:
  ------------------
  |  |  388|      0|#define TIFFTAG_YCBCRPOSITIONING 531       /* !subsample positioning */
  ------------------
  |  Branch (550:9): [True: 0, False: 8.58k]
  ------------------
  551|      0|            td->td_ycbcrpositioning = (uint16_t)va_arg(ap, uint16_vap);
  552|      0|            break;
  553|      0|        case TIFFTAG_YCBCRSUBSAMPLING:
  ------------------
  |  |  387|      0|#define TIFFTAG_YCBCRSUBSAMPLING 530       /* !YCbCr subsampling factors */
  ------------------
  |  Branch (553:9): [True: 0, False: 8.58k]
  ------------------
  554|      0|            td->td_ycbcrsubsampling[0] = (uint16_t)va_arg(ap, uint16_vap);
  555|      0|            td->td_ycbcrsubsampling[1] = (uint16_t)va_arg(ap, uint16_vap);
  556|      0|            break;
  557|      0|        case TIFFTAG_TRANSFERFUNCTION:
  ------------------
  |  |  297|      0|#define TIFFTAG_TRANSFERFUNCTION 301       /* !colorimetry info */
  ------------------
  |  Branch (557:9): [True: 0, False: 8.58k]
  ------------------
  558|      0|        {
  559|      0|            uint32_t i;
  560|      0|            v = (td->td_samplesperpixel - td->td_extrasamples) > 1 ? 3 : 1;
  ------------------
  |  Branch (560:17): [True: 0, False: 0]
  ------------------
  561|      0|            for (i = 0; i < v; i++)
  ------------------
  |  Branch (561:25): [True: 0, False: 0]
  ------------------
  562|      0|                _TIFFsetShortArrayExt(tif, &td->td_transferfunction[i],
  563|      0|                                      va_arg(ap, uint16_t *),
  564|      0|                                      1U << td->td_bitspersample);
  565|      0|            break;
  566|    780|        }
  567|      0|        case TIFFTAG_REFERENCEBLACKWHITE:
  ------------------
  |  |  391|      0|#define TIFFTAG_REFERENCEBLACKWHITE 532    /* !colorimetry info */
  ------------------
  |  Branch (567:9): [True: 0, False: 8.58k]
  ------------------
  568|       |            /* XXX should check for null range */
  569|      0|            _TIFFsetFloatArrayExt(tif, &td->td_refblackwhite,
  570|      0|                                  va_arg(ap, float *), 6);
  571|      0|            break;
  572|      0|        case TIFFTAG_INKNAMES:
  ------------------
  |  |  324|      0|#define TIFFTAG_INKNAMES 333               /* !ascii names of inks */
  ------------------
  |  Branch (572:9): [True: 0, False: 8.58k]
  ------------------
  573|      0|        {
  574|      0|            v = (uint16_t)va_arg(ap, uint16_vap);
  575|      0|            s = va_arg(ap, char *);
  576|      0|            uint16_t ninksinstring;
  577|      0|            ninksinstring = countInkNamesString(tif, v, s);
  578|      0|            status = ninksinstring > 0;
  579|      0|            if (ninksinstring > 0)
  ------------------
  |  Branch (579:17): [True: 0, False: 0]
  ------------------
  580|      0|            {
  581|      0|                _TIFFsetNString(tif, &td->td_inknames, s, v);
  582|      0|                td->td_inknameslen = v;
  583|       |                /* Set NumberOfInks to the value ninksinstring */
  584|      0|                if (TIFFFieldSet(tif, FIELD_NUMBEROFINKS))
  ------------------
  |  |  209|      0|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|      0|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|      0|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  585|      0|                {
  586|      0|                    if (td->td_numberofinks != ninksinstring)
  ------------------
  |  Branch (586:25): [True: 0, False: 0]
  ------------------
  587|      0|                    {
  588|      0|                        TIFFErrorExtR(
  589|      0|                            tif, module,
  590|      0|                            "Warning %s; Tag %s:\n  Value %" PRIu16
  591|      0|                            " of NumberOfInks is different from the number of "
  592|      0|                            "inks %" PRIu16
  593|      0|                            ".\n  -> NumberOfInks value adapted to %" PRIu16 "",
  594|      0|                            tif->tif_name, fip->field_name, td->td_numberofinks,
  595|      0|                            ninksinstring, ninksinstring);
  596|      0|                        td->td_numberofinks = ninksinstring;
  597|      0|                    }
  598|      0|                }
  599|      0|                else
  600|      0|                {
  601|      0|                    td->td_numberofinks = ninksinstring;
  602|      0|                    TIFFSetFieldBit(tif, FIELD_NUMBEROFINKS);
  ------------------
  |  |  210|      0|#define TIFFSetFieldBit(tif, field) (BITFIELDn(tif, field) |= BITn(field))
  |  |  ------------------
  |  |  |  |  208|      0|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFSetFieldBit(tif, field) (BITFIELDn(tif, field) |= BITn(field))
  |  |  ------------------
  |  |  |  |  207|      0|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  ------------------
  603|      0|                }
  604|      0|                if (TIFFFieldSet(tif, FIELD_SAMPLESPERPIXEL))
  ------------------
  |  |  209|      0|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|      0|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|      0|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  605|      0|                {
  606|      0|                    if (td->td_numberofinks != td->td_samplesperpixel)
  ------------------
  |  Branch (606:25): [True: 0, False: 0]
  ------------------
  607|      0|                    {
  608|      0|                        TIFFErrorExtR(tif, module,
  609|      0|                                      "Warning %s; Tag %s:\n  Value %" PRIu16
  610|      0|                                      " of NumberOfInks is different from the "
  611|      0|                                      "SamplesPerPixel value %" PRIu16 "",
  612|      0|                                      tif->tif_name, fip->field_name,
  613|      0|                                      td->td_numberofinks,
  614|      0|                                      td->td_samplesperpixel);
  615|      0|                    }
  616|      0|                }
  617|      0|            }
  618|      0|        }
  619|      0|        break;
  620|      0|        case TIFFTAG_NUMBEROFINKS:
  ------------------
  |  |  325|      0|#define TIFFTAG_NUMBEROFINKS 334           /* !number of inks */
  ------------------
  |  Branch (620:9): [True: 0, False: 8.58k]
  ------------------
  621|      0|            v = (uint16_t)va_arg(ap, uint16_vap);
  622|       |            /* If InkNames already set also NumberOfInks is set accordingly and
  623|       |             * should be equal */
  624|      0|            if (TIFFFieldSet(tif, FIELD_INKNAMES))
  ------------------
  |  |  209|      0|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|      0|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|      0|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  625|      0|            {
  626|      0|                if (v != td->td_numberofinks)
  ------------------
  |  Branch (626:21): [True: 0, False: 0]
  ------------------
  627|      0|                {
  628|      0|                    TIFFErrorExtR(
  629|      0|                        tif, module,
  630|      0|                        "Error %s; Tag %s:\n  It is not possible to set the "
  631|      0|                        "value %" PRIu32
  632|      0|                        " for NumberOfInks\n  which is different from the "
  633|      0|                        "number of inks in the InkNames tag (%" PRIu16 ")",
  634|      0|                        tif->tif_name, fip->field_name, v, td->td_numberofinks);
  635|       |                    /* Do not set / overwrite number of inks already set by
  636|       |                     * InkNames case accordingly. */
  637|      0|                    status = 0;
  638|      0|                }
  639|      0|            }
  640|      0|            else
  641|      0|            {
  642|      0|                td->td_numberofinks = (uint16_t)v;
  643|      0|                if (TIFFFieldSet(tif, FIELD_SAMPLESPERPIXEL))
  ------------------
  |  |  209|      0|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|      0|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|      0|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  644|      0|                {
  645|      0|                    if (td->td_numberofinks != td->td_samplesperpixel)
  ------------------
  |  Branch (645:25): [True: 0, False: 0]
  ------------------
  646|      0|                    {
  647|      0|                        TIFFErrorExtR(tif, module,
  648|      0|                                      "Warning %s; Tag %s:\n  Value %" PRIu32
  649|      0|                                      " of NumberOfInks is different from the "
  650|      0|                                      "SamplesPerPixel value %" PRIu16 "",
  651|      0|                                      tif->tif_name, fip->field_name, v,
  652|      0|                                      td->td_samplesperpixel);
  653|      0|                    }
  654|      0|                }
  655|      0|            }
  656|      0|            break;
  657|      0|        case TIFFTAG_PERSAMPLE:
  ------------------
  |  |  751|      0|#define TIFFTAG_PERSAMPLE 65563        /* interface for per sample tags */
  ------------------
  |  Branch (657:9): [True: 0, False: 8.58k]
  ------------------
  658|      0|            v = (uint16_t)va_arg(ap, uint16_vap);
  659|      0|            if (v == PERSAMPLE_MULTI)
  ------------------
  |  |  753|      0|#define PERSAMPLE_MULTI 1              /* present as multiple values */
  ------------------
  |  Branch (659:17): [True: 0, False: 0]
  ------------------
  660|      0|                tif->tif_flags |= TIFF_PERSAMPLE;
  ------------------
  |  |  134|      0|#define TIFF_PERSAMPLE 0x400000U  /* get/set per sample tags as arrays */
  ------------------
  661|      0|            else
  662|      0|                tif->tif_flags &= ~TIFF_PERSAMPLE;
  ------------------
  |  |  134|      0|#define TIFF_PERSAMPLE 0x400000U  /* get/set per sample tags as arrays */
  ------------------
  663|      0|            break;
  664|      0|        default:
  ------------------
  |  Branch (664:9): [True: 0, False: 8.58k]
  ------------------
  665|      0|        {
  666|      0|            TIFFTagValue *tv;
  667|      0|            int tv_size, iCustom;
  668|       |
  669|       |            /*
  670|       |             * This can happen if multiple images are open with different
  671|       |             * codecs which have private tags.  The global tag information
  672|       |             * table may then have tags that are valid for one file but not
  673|       |             * the other. If the client tries to set a tag that is not valid
  674|       |             * for the image's codec then we'll arrive here.  This
  675|       |             * happens, for example, when tiffcp is used to convert between
  676|       |             * compression schemes and codec-specific tags are blindly copied.
  677|       |             *
  678|       |             * This also happens when a FIELD_IGNORE tag is written.
  679|       |             */
  680|      0|            if (fip->field_bit == FIELD_IGNORE)
  ------------------
  |  |  151|      0|#define FIELD_IGNORE 0
  ------------------
  |  Branch (680:17): [True: 0, False: 0]
  ------------------
  681|      0|            {
  682|      0|                TIFFErrorExtR(
  683|      0|                    tif, module,
  684|      0|                    "%s: Ignored %stag \"%s\" (not supported by libtiff)",
  685|      0|                    tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "",
  ------------------
  |  |  248|      0|#define isPseudoTag(t) (t > 0xffff) /* is tag value normal or pseudo */
  |  |  ------------------
  |  |  |  Branch (248:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  686|      0|                    fip->field_name);
  687|      0|                status = 0;
  688|      0|                break;
  689|      0|            }
  690|      0|            if (fip->field_bit != FIELD_CUSTOM)
  ------------------
  |  |  334|      0|#define FIELD_CUSTOM 65
  ------------------
  |  Branch (690:17): [True: 0, False: 0]
  ------------------
  691|      0|            {
  692|      0|                TIFFErrorExtR(
  693|      0|                    tif, module,
  694|      0|                    "%s: Invalid %stag \"%s\" (not supported by codec)",
  695|      0|                    tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "",
  ------------------
  |  |  248|      0|#define isPseudoTag(t) (t > 0xffff) /* is tag value normal or pseudo */
  |  |  ------------------
  |  |  |  Branch (248:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  696|      0|                    fip->field_name);
  697|      0|                status = 0;
  698|      0|                break;
  699|      0|            }
  700|       |
  701|       |            /*
  702|       |             * Find the existing entry for this custom value.
  703|       |             */
  704|      0|            tv = NULL;
  705|      0|            for (iCustom = 0; iCustom < td->td_customValueCount; iCustom++)
  ------------------
  |  Branch (705:31): [True: 0, False: 0]
  ------------------
  706|      0|            {
  707|      0|                if (td->td_customValues[iCustom].info->field_tag == tag)
  ------------------
  |  Branch (707:21): [True: 0, False: 0]
  ------------------
  708|      0|                {
  709|      0|                    tv = td->td_customValues + iCustom;
  710|      0|                    if (tv->value != NULL)
  ------------------
  |  Branch (710:25): [True: 0, False: 0]
  ------------------
  711|      0|                    {
  712|      0|                        _TIFFfreeExt(tif, tv->value);
  713|      0|                        tv->value = NULL;
  714|      0|                    }
  715|      0|                    break;
  716|      0|                }
  717|      0|            }
  718|       |
  719|       |            /*
  720|       |             * Grow the custom list if the entry was not found.
  721|       |             */
  722|      0|            if (tv == NULL)
  ------------------
  |  Branch (722:17): [True: 0, False: 0]
  ------------------
  723|      0|            {
  724|      0|                TIFFTagValue *new_customValues;
  725|       |
  726|      0|                td->td_customValueCount++;
  727|      0|                new_customValues = (TIFFTagValue *)_TIFFreallocExt(
  728|      0|                    tif, td->td_customValues,
  729|      0|                    sizeof(TIFFTagValue) * td->td_customValueCount);
  730|      0|                if (!new_customValues)
  ------------------
  |  Branch (730:21): [True: 0, False: 0]
  ------------------
  731|      0|                {
  732|      0|                    TIFFErrorExtR(tif, module,
  733|      0|                                  "%s: Failed to allocate space for list of "
  734|      0|                                  "custom values",
  735|      0|                                  tif->tif_name);
  736|      0|                    status = 0;
  737|      0|                    goto end;
  738|      0|                }
  739|       |
  740|      0|                td->td_customValues = new_customValues;
  741|       |
  742|      0|                tv = td->td_customValues + (td->td_customValueCount - 1);
  743|      0|                tv->info = fip;
  744|      0|                tv->value = NULL;
  745|      0|                tv->count = 0;
  746|      0|            }
  747|       |
  748|       |            /*
  749|       |             * Set custom value ... save a copy of the custom tag value.
  750|       |             */
  751|       |            /*--: Rational2Double: For Rationals evaluate "set_field_type" to
  752|       |             * determine internal storage size. */
  753|      0|            tv_size = TIFFFieldSetGetSize(fip);
  754|      0|            if (tv_size == 0)
  ------------------
  |  Branch (754:17): [True: 0, False: 0]
  ------------------
  755|      0|            {
  756|      0|                status = 0;
  757|      0|                TIFFErrorExtR(tif, module, "%s: Bad field type %d for \"%s\"",
  758|      0|                              tif->tif_name, fip->field_type, fip->field_name);
  759|      0|                goto end;
  760|      0|            }
  761|       |
  762|      0|            if (fip->field_type == TIFF_ASCII)
  ------------------
  |  Branch (762:17): [True: 0, False: 0]
  ------------------
  763|      0|            {
  764|      0|                uint32_t ma;
  765|      0|                const char *mb;
  766|      0|                if (fip->field_passcount)
  ------------------
  |  Branch (766:21): [True: 0, False: 0]
  ------------------
  767|      0|                {
  768|      0|                    assert(fip->field_writecount == TIFF_VARIABLE2);
  769|      0|                    ma = (uint32_t)va_arg(ap, uint32_t);
  770|      0|                    mb = (const char *)va_arg(ap, const char *);
  771|      0|                }
  772|      0|                else
  773|      0|                {
  774|      0|                    mb = (const char *)va_arg(ap, const char *);
  775|      0|                    size_t len = strlen(mb) + 1;
  776|      0|                    if (len >= 0x80000000U)
  ------------------
  |  Branch (776:25): [True: 0, False: 0]
  ------------------
  777|      0|                    {
  778|      0|                        status = 0;
  779|      0|                        TIFFErrorExtR(tif, module,
  780|      0|                                      "%s: Too long string value for \"%s\". "
  781|      0|                                      "Maximum supported is 2147483647 bytes",
  782|      0|                                      tif->tif_name, fip->field_name);
  783|      0|                        goto end;
  784|      0|                    }
  785|      0|                    ma = (uint32_t)len;
  786|      0|                }
  787|      0|                tv->count = ma;
  788|      0|                setByteArray(tif, &tv->value, mb, ma, 1);
  789|      0|            }
  790|      0|            else
  791|      0|            {
  792|      0|                if (fip->field_passcount)
  ------------------
  |  Branch (792:21): [True: 0, False: 0]
  ------------------
  793|      0|                {
  794|      0|                    if (fip->field_writecount == TIFF_VARIABLE2)
  ------------------
  |  |  332|      0|#define TIFF_VARIABLE2 -3    /* marker for uint32_t var-length tags */
  ------------------
  |  Branch (794:25): [True: 0, False: 0]
  ------------------
  795|      0|                        tv->count = (uint32_t)va_arg(ap, uint32_t);
  796|      0|                    else
  797|      0|                        tv->count = (int)va_arg(ap, int);
  798|      0|                }
  799|      0|                else if (fip->field_writecount == TIFF_VARIABLE ||
  ------------------
  |  |  330|      0|#define TIFF_VARIABLE -1     /* marker for variable length tags */
  ------------------
  |  Branch (799:26): [True: 0, False: 0]
  ------------------
  800|      0|                         fip->field_writecount == TIFF_VARIABLE2)
  ------------------
  |  |  332|      0|#define TIFF_VARIABLE2 -3    /* marker for uint32_t var-length tags */
  ------------------
  |  Branch (800:26): [True: 0, False: 0]
  ------------------
  801|      0|                    tv->count = 1;
  802|      0|                else if (fip->field_writecount == TIFF_SPP)
  ------------------
  |  |  331|      0|#define TIFF_SPP -2          /* marker for SamplesPerPixel tags */
  ------------------
  |  Branch (802:26): [True: 0, False: 0]
  ------------------
  803|      0|                    tv->count = td->td_samplesperpixel;
  804|      0|                else
  805|      0|                    tv->count = fip->field_writecount;
  806|       |
  807|      0|                if (tv->count == 0)
  ------------------
  |  Branch (807:21): [True: 0, False: 0]
  ------------------
  808|      0|                {
  809|      0|                    status = 0;
  810|      0|                    TIFFErrorExtR(tif, module,
  811|      0|                                  "%s: Null count for \"%s\" (type "
  812|      0|                                  "%d, writecount %d, passcount %d)",
  813|      0|                                  tif->tif_name, fip->field_name,
  814|      0|                                  fip->field_type, fip->field_writecount,
  815|      0|                                  fip->field_passcount);
  816|      0|                    goto end;
  817|      0|                }
  818|       |
  819|      0|                tv->value = _TIFFCheckMalloc(tif, tv->count, tv_size,
  820|      0|                                             "custom tag binary object");
  821|      0|                if (!tv->value)
  ------------------
  |  Branch (821:21): [True: 0, False: 0]
  ------------------
  822|      0|                {
  823|      0|                    status = 0;
  824|      0|                    goto end;
  825|      0|                }
  826|       |
  827|      0|                if (fip->field_tag == TIFFTAG_DOTRANGE &&
  ------------------
  |  |  326|      0|#define TIFFTAG_DOTRANGE 336               /* !0% and 100% dot codes */
  ------------------
  |  Branch (827:21): [True: 0, False: 0]
  ------------------
  828|      0|                    strcmp(fip->field_name, "DotRange") == 0)
  ------------------
  |  Branch (828:21): [True: 0, False: 0]
  ------------------
  829|      0|                {
  830|       |                    /* TODO: This is an evil exception and should not have been
  831|       |                       handled this way ... likely best if we move it into
  832|       |                       the directory structure with an explicit field in
  833|       |                       libtiff 4.1 and assign it a FIELD_ value */
  834|      0|                    uint16_t v2[2];
  835|      0|                    v2[0] = (uint16_t)va_arg(ap, int);
  836|      0|                    v2[1] = (uint16_t)va_arg(ap, int);
  837|      0|                    _TIFFmemcpy(tv->value, &v2, 4);
  838|      0|                }
  839|       |
  840|      0|                else if (fip->field_passcount ||
  ------------------
  |  Branch (840:26): [True: 0, False: 0]
  ------------------
  841|      0|                         fip->field_writecount == TIFF_VARIABLE ||
  ------------------
  |  |  330|      0|#define TIFF_VARIABLE -1     /* marker for variable length tags */
  ------------------
  |  Branch (841:26): [True: 0, False: 0]
  ------------------
  842|      0|                         fip->field_writecount == TIFF_VARIABLE2 ||
  ------------------
  |  |  332|      0|#define TIFF_VARIABLE2 -3    /* marker for uint32_t var-length tags */
  ------------------
  |  Branch (842:26): [True: 0, False: 0]
  ------------------
  843|      0|                         fip->field_writecount == TIFF_SPP || tv->count > 1)
  ------------------
  |  |  331|      0|#define TIFF_SPP -2          /* marker for SamplesPerPixel tags */
  ------------------
  |  Branch (843:26): [True: 0, False: 0]
  |  Branch (843:63): [True: 0, False: 0]
  ------------------
  844|      0|                {
  845|       |                    /*--: Rational2Double: For Rationals tv_size is set above to
  846|       |                     * 4 or 8 according to fip->set_field_type! */
  847|      0|                    _TIFFmemcpy(tv->value, va_arg(ap, void *),
  848|      0|                                tv->count * tv_size);
  849|       |                    /* Test here for too big values for LONG8, SLONG8 in
  850|       |                     * ClassicTIFF and delete custom field from custom list */
  851|      0|                    if (!(tif->tif_flags & TIFF_BIGTIFF))
  ------------------
  |  |  131|      0|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (851:25): [True: 0, False: 0]
  ------------------
  852|      0|                    {
  853|      0|                        if (tv->info->field_type == TIFF_LONG8)
  ------------------
  |  Branch (853:29): [True: 0, False: 0]
  ------------------
  854|      0|                        {
  855|      0|                            uint64_t *pui64 = (uint64_t *)tv->value;
  856|      0|                            for (int i = 0; i < tv->count; i++)
  ------------------
  |  Branch (856:45): [True: 0, False: 0]
  ------------------
  857|      0|                            {
  858|      0|                                if (pui64[i] > 0xffffffffu)
  ------------------
  |  Branch (858:37): [True: 0, False: 0]
  ------------------
  859|      0|                                {
  860|      0|                                    TIFFErrorExtR(
  861|      0|                                        tif, module,
  862|      0|                                        "%s: Bad LONG8 value %" PRIu64
  863|      0|                                        " at %d. array position for \"%s\" tag "
  864|      0|                                        "%d in ClassicTIFF. Tag won't be "
  865|      0|                                        "written to file",
  866|      0|                                        tif->tif_name, pui64[i], i,
  867|      0|                                        fip->field_name, tag);
  868|      0|                                    goto badvalueifd8long8;
  869|      0|                                }
  870|      0|                            }
  871|      0|                        }
  872|      0|                        else if (tv->info->field_type == TIFF_SLONG8)
  ------------------
  |  Branch (872:34): [True: 0, False: 0]
  ------------------
  873|      0|                        {
  874|      0|                            int64_t *pi64 = (int64_t *)tv->value;
  875|      0|                            for (int i = 0; i < tv->count; i++)
  ------------------
  |  Branch (875:45): [True: 0, False: 0]
  ------------------
  876|      0|                            {
  877|      0|                                if (pi64[i] > 2147483647 ||
  ------------------
  |  Branch (877:37): [True: 0, False: 0]
  ------------------
  878|      0|                                    pi64[i] < (-2147483647 - 1))
  ------------------
  |  Branch (878:37): [True: 0, False: 0]
  ------------------
  879|      0|                                {
  880|      0|                                    TIFFErrorExtR(
  881|      0|                                        tif, module,
  882|      0|                                        "%s: Bad SLONG8 value %" PRIi64
  883|      0|                                        " at %d. array position for \"%s\" tag "
  884|      0|                                        "%d in ClassicTIFF. Tag won't be "
  885|      0|                                        "written to file",
  886|      0|                                        tif->tif_name, pi64[i], i,
  887|      0|                                        fip->field_name, tag);
  888|      0|                                    goto badvalueifd8long8;
  889|      0|                                }
  890|      0|                            }
  891|      0|                        }
  892|      0|                    }
  893|      0|                }
  894|      0|                else
  895|      0|                {
  896|      0|                    char *val = (char *)tv->value;
  897|      0|                    assert(tv->count == 1);
  898|       |
  899|      0|                    switch (fip->field_type)
  900|      0|                    {
  901|      0|                        case TIFF_BYTE:
  ------------------
  |  Branch (901:25): [True: 0, False: 0]
  ------------------
  902|      0|                        case TIFF_UNDEFINED:
  ------------------
  |  Branch (902:25): [True: 0, False: 0]
  ------------------
  903|      0|                        {
  904|      0|                            uint8_t v2 = (uint8_t)va_arg(ap, int);
  905|      0|                            _TIFFmemcpy(val, &v2, tv_size);
  906|      0|                        }
  907|      0|                        break;
  908|      0|                        case TIFF_SBYTE:
  ------------------
  |  Branch (908:25): [True: 0, False: 0]
  ------------------
  909|      0|                        {
  910|      0|                            int8_t v2 = (int8_t)va_arg(ap, int);
  911|      0|                            _TIFFmemcpy(val, &v2, tv_size);
  912|      0|                        }
  913|      0|                        break;
  914|      0|                        case TIFF_SHORT:
  ------------------
  |  Branch (914:25): [True: 0, False: 0]
  ------------------
  915|      0|                        {
  916|      0|                            uint16_t v2 = (uint16_t)va_arg(ap, int);
  917|      0|                            _TIFFmemcpy(val, &v2, tv_size);
  918|      0|                        }
  919|      0|                        break;
  920|      0|                        case TIFF_SSHORT:
  ------------------
  |  Branch (920:25): [True: 0, False: 0]
  ------------------
  921|      0|                        {
  922|      0|                            int16_t v2 = (int16_t)va_arg(ap, int);
  923|      0|                            _TIFFmemcpy(val, &v2, tv_size);
  924|      0|                        }
  925|      0|                        break;
  926|      0|                        case TIFF_LONG:
  ------------------
  |  Branch (926:25): [True: 0, False: 0]
  ------------------
  927|      0|                        case TIFF_IFD:
  ------------------
  |  Branch (927:25): [True: 0, False: 0]
  ------------------
  928|      0|                        {
  929|      0|                            uint32_t v2 = va_arg(ap, uint32_t);
  930|      0|                            _TIFFmemcpy(val, &v2, tv_size);
  931|      0|                        }
  932|      0|                        break;
  933|      0|                        case TIFF_SLONG:
  ------------------
  |  Branch (933:25): [True: 0, False: 0]
  ------------------
  934|      0|                        {
  935|      0|                            int32_t v2 = va_arg(ap, int32_t);
  936|      0|                            _TIFFmemcpy(val, &v2, tv_size);
  937|      0|                        }
  938|      0|                        break;
  939|      0|                        case TIFF_LONG8:
  ------------------
  |  Branch (939:25): [True: 0, False: 0]
  ------------------
  940|      0|                        case TIFF_IFD8:
  ------------------
  |  Branch (940:25): [True: 0, False: 0]
  ------------------
  941|      0|                        {
  942|      0|                            uint64_t v2 = va_arg(ap, uint64_t);
  943|      0|                            _TIFFmemcpy(val, &v2, tv_size);
  944|       |                            /* Test here for too big values for ClassicTIFF and
  945|       |                             * delete custom field from custom list */
  946|      0|                            if (!(tif->tif_flags & TIFF_BIGTIFF) &&
  ------------------
  |  |  131|      0|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (946:33): [True: 0, False: 0]
  ------------------
  947|      0|                                (v2 > 0xffffffffu))
  ------------------
  |  Branch (947:33): [True: 0, False: 0]
  ------------------
  948|      0|                            {
  949|      0|                                TIFFErrorExtR(
  950|      0|                                    tif, module,
  951|      0|                                    "%s: Bad LONG8 or IFD8 value %" PRIu64
  952|      0|                                    " for \"%s\" tag %d in ClassicTIFF. Tag "
  953|      0|                                    "won't be written to file",
  954|      0|                                    tif->tif_name, v2, fip->field_name, tag);
  955|      0|                                goto badvalueifd8long8;
  956|      0|                            }
  957|      0|                        }
  958|      0|                        break;
  959|      0|                        case TIFF_SLONG8:
  ------------------
  |  Branch (959:25): [True: 0, False: 0]
  ------------------
  960|      0|                        {
  961|      0|                            int64_t v2 = va_arg(ap, int64_t);
  962|      0|                            _TIFFmemcpy(val, &v2, tv_size);
  963|       |                            /* Test here for too big values for ClassicTIFF and
  964|       |                             * delete custom field from custom list */
  965|      0|                            if (!(tif->tif_flags & TIFF_BIGTIFF) &&
  ------------------
  |  |  131|      0|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (965:33): [True: 0, False: 0]
  ------------------
  966|      0|                                ((v2 > 2147483647) || (v2 < (-2147483647 - 1))))
  ------------------
  |  Branch (966:34): [True: 0, False: 0]
  |  Branch (966:55): [True: 0, False: 0]
  ------------------
  967|      0|                            {
  968|      0|                                TIFFErrorExtR(
  969|      0|                                    tif, module,
  970|      0|                                    "%s: Bad SLONG8 value %" PRIi64
  971|      0|                                    " for \"%s\" tag %d in ClassicTIFF. Tag "
  972|      0|                                    "won't be written to file",
  973|      0|                                    tif->tif_name, v2, fip->field_name, tag);
  974|      0|                                goto badvalueifd8long8;
  975|      0|                            }
  976|      0|                        }
  977|      0|                        break;
  978|      0|                        case TIFF_RATIONAL:
  ------------------
  |  Branch (978:25): [True: 0, False: 0]
  ------------------
  979|      0|                        case TIFF_SRATIONAL:
  ------------------
  |  Branch (979:25): [True: 0, False: 0]
  ------------------
  980|       |                            /*-- Rational2Double: For Rationals tv_size is set
  981|       |                             * above to 4 or 8 according to fip->set_field_type!
  982|       |                             */
  983|      0|                            {
  984|      0|                                if (tv_size == 8)
  ------------------
  |  Branch (984:37): [True: 0, False: 0]
  ------------------
  985|      0|                                {
  986|      0|                                    double v2 = va_arg(ap, double);
  987|      0|                                    _TIFFmemcpy(val, &v2, tv_size);
  988|      0|                                }
  989|      0|                                else
  990|      0|                                {
  991|       |                                    /*-- default should be tv_size == 4 */
  992|      0|                                    float v3 = (float)va_arg(ap, double);
  993|      0|                                    _TIFFmemcpy(val, &v3, tv_size);
  994|       |                                    /*-- ToDo: After Testing, this should be
  995|       |                                     * removed and tv_size==4 should be set as
  996|       |                                     * default. */
  997|      0|                                    if (tv_size != 4)
  ------------------
  |  Branch (997:41): [True: 0, False: 0]
  ------------------
  998|      0|                                    {
  999|      0|                                        TIFFErrorExtR(
 1000|      0|                                            tif, module,
 1001|      0|                                            "Rational2Double: .set_field_type "
 1002|      0|                                            "in not 4 but %d",
 1003|      0|                                            tv_size);
 1004|      0|                                    }
 1005|      0|                                }
 1006|      0|                            }
 1007|      0|                            break;
 1008|      0|                        case TIFF_FLOAT:
  ------------------
  |  Branch (1008:25): [True: 0, False: 0]
  ------------------
 1009|      0|                        {
 1010|      0|                            float v2 =
 1011|      0|                                _TIFFClampDoubleToFloat(va_arg(ap, double));
 1012|      0|                            _TIFFmemcpy(val, &v2, tv_size);
 1013|      0|                        }
 1014|      0|                        break;
 1015|      0|                        case TIFF_DOUBLE:
  ------------------
  |  Branch (1015:25): [True: 0, False: 0]
  ------------------
 1016|      0|                        {
 1017|      0|                            double v2 = va_arg(ap, double);
 1018|      0|                            _TIFFmemcpy(val, &v2, tv_size);
 1019|      0|                        }
 1020|      0|                        break;
 1021|      0|                        default:
  ------------------
  |  Branch (1021:25): [True: 0, False: 0]
  ------------------
 1022|      0|                            _TIFFmemset(val, 0, tv_size);
 1023|      0|                            status = 0;
 1024|      0|                            break;
 1025|      0|                    }
 1026|      0|                }
 1027|      0|            }
 1028|      0|        }
 1029|  8.58k|    }
 1030|  8.58k|    if (status)
  ------------------
  |  Branch (1030:9): [True: 8.58k, False: 0]
  ------------------
 1031|  8.58k|    {
 1032|  8.58k|        const TIFFField *fip2 = TIFFFieldWithTag(tif, tag);
 1033|  8.58k|        if (fip2)
  ------------------
  |  Branch (1033:13): [True: 8.58k, False: 0]
  ------------------
 1034|  8.58k|            TIFFSetFieldBit(tif, fip2->field_bit);
  ------------------
  |  |  210|  8.58k|#define TIFFSetFieldBit(tif, field) (BITFIELDn(tif, field) |= BITn(field))
  |  |  ------------------
  |  |  |  |  208|  8.58k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFSetFieldBit(tif, field) (BITFIELDn(tif, field) |= BITn(field))
  |  |  ------------------
  |  |  |  |  207|  8.58k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  ------------------
 1035|  8.58k|        tif->tif_flags |= TIFF_DIRTYDIRECT;
  ------------------
  |  |  113|  8.58k|#define TIFF_DIRTYDIRECT 0x00008U /* current directory must be written */
  ------------------
 1036|  8.58k|    }
 1037|       |
 1038|  8.58k|end:
 1039|  8.58k|    va_end(ap);
 1040|  8.58k|    return (status);
 1041|      0|badvalue:
 1042|      0|{
 1043|      0|    const TIFFField *fip2 = TIFFFieldWithTag(tif, tag);
 1044|      0|    TIFFErrorExtR(tif, module, "%s: Bad value %" PRIu32 " for \"%s\" tag",
 1045|      0|                  tif->tif_name, v, fip2 ? fip2->field_name : "Unknown");
  ------------------
  |  Branch (1045:37): [True: 0, False: 0]
  ------------------
 1046|      0|    va_end(ap);
 1047|      0|}
 1048|      0|    return (0);
 1049|      0|badvalue32:
 1050|      0|{
 1051|      0|    const TIFFField *fip2 = TIFFFieldWithTag(tif, tag);
 1052|      0|    TIFFErrorExtR(tif, module, "%s: Bad value %" PRIu32 " for \"%s\" tag",
 1053|      0|                  tif->tif_name, v32, fip2 ? fip2->field_name : "Unknown");
  ------------------
  |  Branch (1053:39): [True: 0, False: 0]
  ------------------
 1054|      0|    va_end(ap);
 1055|      0|}
 1056|      0|    return (0);
 1057|      0|badvaluedouble:
 1058|      0|{
 1059|      0|    const TIFFField *fip2 = TIFFFieldWithTag(tif, tag);
 1060|      0|    TIFFErrorExtR(tif, module, "%s: Bad value %f for \"%s\" tag", tif->tif_name,
 1061|      0|                  dblval, fip2 ? fip2->field_name : "Unknown");
  ------------------
  |  Branch (1061:27): [True: 0, False: 0]
  ------------------
 1062|      0|    va_end(ap);
 1063|      0|}
 1064|      0|    return (0);
 1065|      0|badvalueifd8long8:
 1066|      0|{
 1067|       |    /* Error message issued already above. */
 1068|      0|    TIFFTagValue *tv2 = NULL;
 1069|      0|    int iCustom2, iC2;
 1070|       |    /* Find the existing entry for this custom value. */
 1071|      0|    for (iCustom2 = 0; iCustom2 < td->td_customValueCount; iCustom2++)
  ------------------
  |  Branch (1071:24): [True: 0, False: 0]
  ------------------
 1072|      0|    {
 1073|      0|        if (td->td_customValues[iCustom2].info->field_tag == tag)
  ------------------
  |  Branch (1073:13): [True: 0, False: 0]
  ------------------
 1074|      0|        {
 1075|      0|            tv2 = td->td_customValues + (iCustom2);
 1076|      0|            break;
 1077|      0|        }
 1078|      0|    }
 1079|      0|    if (tv2 != NULL)
  ------------------
  |  Branch (1079:9): [True: 0, False: 0]
  ------------------
 1080|      0|    {
 1081|       |        /* Remove custom field from custom list */
 1082|      0|        if (tv2->value != NULL)
  ------------------
  |  Branch (1082:13): [True: 0, False: 0]
  ------------------
 1083|      0|        {
 1084|      0|            _TIFFfreeExt(tif, tv2->value);
 1085|      0|            tv2->value = NULL;
 1086|      0|        }
 1087|       |        /* Shorten list and close gap in customValues list.
 1088|       |         * Re-allocation of td_customValues not necessary here. */
 1089|      0|        td->td_customValueCount--;
 1090|      0|        for (iC2 = iCustom2; iC2 < td->td_customValueCount; iC2++)
  ------------------
  |  Branch (1090:30): [True: 0, False: 0]
  ------------------
 1091|      0|        {
 1092|      0|            td->td_customValues[iC2] = td->td_customValues[iC2 + 1];
 1093|      0|        }
 1094|      0|    }
 1095|      0|    else
 1096|      0|    {
 1097|      0|        assert(0);
 1098|      0|    }
 1099|      0|    va_end(ap);
 1100|      0|}
 1101|      0|    return (0);
 1102|  8.58k|} /*-- _TIFFVSetField() --*/

_TIFFGetFields:
  507|  1.56k|const TIFFFieldArray *_TIFFGetFields(void) { return (&tiffFieldArray); }
_TIFFSetupFields:
  514|  1.56k|{
  515|  1.56k|    if (tif->tif_fields && tif->tif_nfields > 0)
  ------------------
  |  Branch (515:9): [True: 780, False: 780]
  |  Branch (515:28): [True: 780, False: 0]
  ------------------
  516|    780|    {
  517|    780|        uint32_t i;
  518|       |
  519|   119k|        for (i = 0; i < tif->tif_nfields; i++)
  ------------------
  |  Branch (519:21): [True: 118k, False: 780]
  ------------------
  520|   118k|        {
  521|   118k|            TIFFField *fld = tif->tif_fields[i];
  522|   118k|            if (fld->field_name != NULL)
  ------------------
  |  Branch (522:17): [True: 118k, False: 0]
  ------------------
  523|   118k|            {
  524|   118k|                if (fld->field_bit == FIELD_CUSTOM && TIFFFieldIsAnonymous(fld))
  ------------------
  |  |  334|   237k|#define FIELD_CUSTOM 65
  ------------------
  |  Branch (524:21): [True: 78.7k, False: 39.7k]
  |  Branch (524:55): [True: 0, False: 78.7k]
  ------------------
  525|      0|                {
  526|      0|                    _TIFFfreeExt(tif, fld->field_name);
  527|       |                    /* caution: tif_fields[i] must not be the beginning of a
  528|       |                     * fields-array. Otherwise the following tags are also freed
  529|       |                     * with the first free().
  530|       |                     */
  531|      0|                    _TIFFfreeExt(tif, fld);
  532|      0|                }
  533|   118k|            }
  534|   118k|        }
  535|       |
  536|    780|        _TIFFfreeExt(tif, tif->tif_fields);
  537|    780|        tif->tif_fields = NULL;
  538|    780|        tif->tif_nfields = 0;
  539|    780|    }
  540|  1.56k|    if (!_TIFFMergeFields(tif, fieldarray->fields, fieldarray->count))
  ------------------
  |  Branch (540:9): [True: 0, False: 1.56k]
  ------------------
  541|      0|    {
  542|      0|        TIFFErrorExtR(tif, "_TIFFSetupFields", "Setting up field info failed");
  543|      0|    }
  544|  1.56k|}
_TIFFMergeFields:
  574|  2.34k|{
  575|  2.34k|    static const char module[] = "_TIFFMergeFields";
  576|  2.34k|    static const char reason[] = "for fields array";
  577|       |    /* TIFFField** tp; */
  578|  2.34k|    uint32_t i;
  579|       |
  580|  2.34k|    tif->tif_foundfield = NULL;
  581|       |
  582|  2.34k|    if (tif->tif_fields && tif->tif_nfields > 0)
  ------------------
  |  Branch (582:9): [True: 780, False: 1.56k]
  |  Branch (582:28): [True: 780, False: 0]
  ------------------
  583|    780|    {
  584|    780|        tif->tif_fields = (TIFFField **)_TIFFCheckRealloc(
  585|    780|            tif, tif->tif_fields, (tif->tif_nfields + n), sizeof(TIFFField *),
  586|    780|            reason);
  587|    780|    }
  588|  1.56k|    else
  589|  1.56k|    {
  590|  1.56k|        tif->tif_fields =
  591|  1.56k|            (TIFFField **)_TIFFCheckMalloc(tif, n, sizeof(TIFFField *), reason);
  592|  1.56k|    }
  593|  2.34k|    if (!tif->tif_fields)
  ------------------
  |  Branch (593:9): [True: 0, False: 2.34k]
  ------------------
  594|      0|    {
  595|      0|        TIFFErrorExtR(tif, module, "Failed to allocate fields array");
  596|      0|        return 0;
  597|      0|    }
  598|       |
  599|       |    /* tp = tif->tif_fields + tif->tif_nfields; */
  600|   238k|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (600:17): [True: 236k, False: 2.34k]
  ------------------
  601|   236k|    {
  602|   236k|        const TIFFField *fip = TIFFFindField(tif, info[i].field_tag, TIFF_ANY);
  ------------------
  |  |  329|   236k|#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */
  ------------------
  603|       |
  604|       |        /* only add definitions that aren't already present */
  605|   236k|        if (!fip)
  ------------------
  |  Branch (605:13): [True: 236k, False: 0]
  ------------------
  606|   236k|        {
  607|   236k|            tif->tif_fields[tif->tif_nfields] = (TIFFField *)(info + i);
  608|   236k|            tif->tif_nfields++;
  609|   236k|        }
  610|   236k|    }
  611|       |
  612|       |    /* Sort the field info by tag number */
  613|  2.34k|    qsort(tif->tif_fields, tif->tif_nfields, sizeof(TIFFField *), tagCompare);
  614|       |
  615|  2.34k|    return n;
  616|  2.34k|}
TIFFFindField:
  795|   264k|{
  796|   264k|    TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0, 0, 0, NULL, NULL};
  797|   264k|    TIFFField *pkey = &key;
  798|   264k|    const TIFFField **ret;
  799|   264k|    if (tif->tif_foundfield && tif->tif_foundfield->field_tag == tag &&
  ------------------
  |  Branch (799:9): [True: 25.7k, False: 238k]
  |  Branch (799:32): [True: 17.9k, False: 7.80k]
  ------------------
  800|   264k|        (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type))
  ------------------
  |  |  329|  35.8k|#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */
  ------------------
  |  Branch (800:10): [True: 17.9k, False: 0]
  |  Branch (800:28): [True: 0, False: 0]
  ------------------
  801|  17.9k|        return tif->tif_foundfield;
  802|       |
  803|       |    /* If we are invoked with no field information, then just return. */
  804|   246k|    if (!tif->tif_fields)
  ------------------
  |  Branch (804:9): [True: 0, False: 246k]
  ------------------
  805|      0|        return NULL;
  806|       |
  807|       |    /* NB: use sorted search (e.g. binary search) */
  808|       |
  809|   246k|    key.field_tag = tag;
  810|   246k|    key.field_type = dt;
  811|       |
  812|   246k|    ret = (const TIFFField **)bsearch(&pkey, tif->tif_fields, tif->tif_nfields,
  813|   246k|                                      sizeof(TIFFField *), tagCompare);
  814|   246k|    return tif->tif_foundfield = (ret ? *ret : NULL);
  ------------------
  |  Branch (814:35): [True: 10.1k, False: 236k]
  ------------------
  815|   246k|}
TIFFFieldWithTag:
  845|  8.58k|{
  846|  8.58k|    const TIFFField *fip = TIFFFindField(tif, tag, TIFF_ANY);
  ------------------
  |  |  329|  8.58k|#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */
  ------------------
  847|  8.58k|    if (!fip)
  ------------------
  |  Branch (847:9): [True: 0, False: 8.58k]
  ------------------
  848|      0|    {
  849|      0|        TIFFWarningExtR(tif, "TIFFFieldWithTag", "Warning, unknown tag 0x%x",
  850|      0|                        (unsigned int)tag);
  851|      0|    }
  852|  8.58k|    return (fip);
  853|  8.58k|}
TIFFFieldIsAnonymous:
  878|   157k|int TIFFFieldIsAnonymous(const TIFFField *fip) { return fip->field_anonymous; }
tif_dirinfo.c:tagCompare:
  547|  2.66M|{
  548|  2.66M|    const TIFFField *ta = *(const TIFFField **)a;
  549|  2.66M|    const TIFFField *tb = *(const TIFFField **)b;
  550|       |    /* NB: be careful of return values for 16-bit platforms */
  551|  2.66M|    if (ta->field_tag != tb->field_tag)
  ------------------
  |  Branch (551:9): [True: 2.65M, False: 10.1k]
  ------------------
  552|  2.65M|        return (int)ta->field_tag - (int)tb->field_tag;
  553|  10.1k|    else
  554|  10.1k|        return (ta->field_type == TIFF_ANY)
  ------------------
  |  |  329|  10.1k|#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */
  ------------------
  |  Branch (554:16): [True: 10.1k, False: 0]
  ------------------
  555|  10.1k|                   ? 0
  556|  10.1k|                   : ((int)tb->field_type - (int)ta->field_type);
  557|  2.66M|}

_TIFFFillStriles:
 7832|  1.56k|int _TIFFFillStriles(TIFF *tif) { return _TIFFFillStrilesInternal(tif, 1); }
tif_dirread.c:_TIFFFillStrilesInternal:
 7835|  1.56k|{
 7836|  1.56k|    register TIFFDirectory *td = &tif->tif_dir;
 7837|  1.56k|    int return_value = 1;
 7838|       |
 7839|       |    /* Do not do anything if TIFF_DEFERSTRILELOAD is not set */
 7840|  1.56k|    if (!(tif->tif_flags & TIFF_DEFERSTRILELOAD) ||
  ------------------
  |  |  138|  1.56k|    0x1000000U /* defer strip/tile offset/bytecount array loading. */
  ------------------
  |  Branch (7840:9): [True: 1.56k, False: 0]
  ------------------
 7841|  1.56k|        (tif->tif_flags & TIFF_CHOPPEDUPARRAYS) != 0)
  ------------------
  |  |  144|      0|    0x4000000U /* set when allocChoppedUpStripArrays() has modified strip      \
  ------------------
  |  Branch (7841:9): [True: 0, False: 0]
  ------------------
 7842|  1.56k|        return 1;
 7843|       |
 7844|      0|    if (tif->tif_flags & TIFF_LAZYSTRILELOAD)
  ------------------
  |  |  140|      0|    0x2000000U /* lazy/ondemand loading of strip/tile offset/bytecount values. \
  ------------------
  |  Branch (7844:9): [True: 0, False: 0]
  ------------------
 7845|      0|    {
 7846|       |        /* In case of lazy loading, reload completely the arrays */
 7847|      0|        _TIFFfreeExt(tif, td->td_stripoffset_p);
 7848|      0|        _TIFFfreeExt(tif, td->td_stripbytecount_p);
 7849|      0|        td->td_stripoffset_p = NULL;
 7850|      0|        td->td_stripbytecount_p = NULL;
 7851|      0|        td->td_stripoffsetbyteallocsize = 0;
 7852|      0|        tif->tif_flags &= ~TIFF_LAZYSTRILELOAD;
  ------------------
  |  |  140|      0|    0x2000000U /* lazy/ondemand loading of strip/tile offset/bytecount values. \
  ------------------
 7853|      0|    }
 7854|       |
 7855|       |    /* If stripoffset array is already loaded, exit with success */
 7856|      0|    if (td->td_stripoffset_p != NULL)
  ------------------
  |  Branch (7856:9): [True: 0, False: 0]
  ------------------
 7857|      0|        return 1;
 7858|       |
 7859|       |    /* If tdir_count was canceled, then we already got there, but in error */
 7860|      0|    if (td->td_stripoffset_entry.tdir_count == 0)
  ------------------
  |  Branch (7860:9): [True: 0, False: 0]
  ------------------
 7861|      0|        return 0;
 7862|       |
 7863|      0|    if (!TIFFFetchStripThing(tif, &(td->td_stripoffset_entry), td->td_nstrips,
  ------------------
  |  Branch (7863:9): [True: 0, False: 0]
  ------------------
 7864|      0|                             &td->td_stripoffset_p))
 7865|      0|    {
 7866|      0|        return_value = 0;
 7867|      0|    }
 7868|       |
 7869|      0|    if (loadStripByteCount &&
  ------------------
  |  Branch (7869:9): [True: 0, False: 0]
  ------------------
 7870|      0|        !TIFFFetchStripThing(tif, &(td->td_stripbytecount_entry),
  ------------------
  |  Branch (7870:9): [True: 0, False: 0]
  ------------------
 7871|      0|                             td->td_nstrips, &td->td_stripbytecount_p))
 7872|      0|    {
 7873|      0|        return_value = 0;
 7874|      0|    }
 7875|       |
 7876|      0|    _TIFFmemset(&(td->td_stripoffset_entry), 0, sizeof(TIFFDirEntry));
 7877|      0|    _TIFFmemset(&(td->td_stripbytecount_entry), 0, sizeof(TIFFDirEntry));
 7878|       |
 7879|       |#ifdef STRIPBYTECOUNTSORTED_UNUSED
 7880|       |    if (tif->tif_dir.td_nstrips > 1 && return_value == 1)
 7881|       |    {
 7882|       |        uint32_t strip;
 7883|       |
 7884|       |        tif->tif_dir.td_stripbytecountsorted = 1;
 7885|       |        for (strip = 1; strip < tif->tif_dir.td_nstrips; strip++)
 7886|       |        {
 7887|       |            if (tif->tif_dir.td_stripoffset_p[strip - 1] >
 7888|       |                tif->tif_dir.td_stripoffset_p[strip])
 7889|       |            {
 7890|       |                tif->tif_dir.td_stripbytecountsorted = 0;
 7891|       |                break;
 7892|       |            }
 7893|       |        }
 7894|       |    }
 7895|       |#endif
 7896|       |
 7897|      0|    return return_value;
 7898|      0|}

TIFFWriteDirectory:
  236|    780|{
  237|    780|    return TIFFWriteDirectorySec(tif, TRUE, TRUE, NULL);
  ------------------
  |  |   70|    780|#define TRUE 1
  ------------------
                  return TIFFWriteDirectorySec(tif, TRUE, TRUE, NULL);
  ------------------
  |  |   70|    780|#define TRUE 1
  ------------------
  238|    780|}
tif_dirwrite.c:TIFFWriteDirectorySec:
  475|    780|{
  476|    780|    static const char module[] = "TIFFWriteDirectorySec";
  477|    780|    uint32_t ndir;
  478|    780|    TIFFDirEntry *dir;
  479|    780|    uint32_t dirsize;
  480|    780|    void *dirmem;
  481|    780|    uint32_t m;
  482|    780|    if (tif->tif_mode == O_RDONLY)
  ------------------
  |  Branch (482:9): [True: 0, False: 780]
  ------------------
  483|      0|        return (1);
  484|       |
  485|    780|    _TIFFFillStriles(tif);
  486|       |
  487|       |    /*
  488|       |     * Clear write state so that subsequent images with
  489|       |     * different characteristics get the right buffers
  490|       |     * setup for them.
  491|       |     */
  492|    780|    if (imagedone)
  ------------------
  |  Branch (492:9): [True: 780, False: 0]
  ------------------
  493|    780|    {
  494|    780|        if (tif->tif_flags & TIFF_POSTENCODE)
  ------------------
  |  |  122|    780|#define TIFF_POSTENCODE 0x01000U  /* need call to postencode routine */
  ------------------
  |  Branch (494:13): [True: 780, False: 0]
  ------------------
  495|    780|        {
  496|    780|            tif->tif_flags &= ~TIFF_POSTENCODE;
  ------------------
  |  |  122|    780|#define TIFF_POSTENCODE 0x01000U  /* need call to postencode routine */
  ------------------
  497|    780|            if (!(*tif->tif_postencode)(tif))
  ------------------
  |  Branch (497:17): [True: 0, False: 780]
  ------------------
  498|      0|            {
  499|      0|                TIFFErrorExtR(tif, module,
  500|      0|                              "Error post-encoding before directory write");
  501|      0|                return (0);
  502|      0|            }
  503|    780|        }
  504|    780|        (*tif->tif_close)(tif); /* shutdown encoder */
  505|       |        /*
  506|       |         * Flush any data that might have been written
  507|       |         * by the compression close+cleanup routines.  But
  508|       |         * be careful not to write stuff if we didn't add data
  509|       |         * in the previous steps as the "rawcc" data may well be
  510|       |         * a previously read tile/strip in mixed read/write mode.
  511|       |         */
  512|    780|        if (tif->tif_rawcc > 0 && (tif->tif_flags & TIFF_BEENWRITING) != 0)
  ------------------
  |  |  116|    780|#define TIFF_BEENWRITING 0x00040U /* written 1+ scanlines to file */
  ------------------
  |  Branch (512:13): [True: 780, False: 0]
  |  Branch (512:35): [True: 780, False: 0]
  ------------------
  513|    780|        {
  514|    780|            if (!TIFFFlushData1(tif))
  ------------------
  |  Branch (514:17): [True: 0, False: 780]
  ------------------
  515|      0|            {
  516|      0|                TIFFErrorExtR(tif, module,
  517|      0|                              "Error flushing data before directory write");
  518|      0|                return (0);
  519|      0|            }
  520|    780|        }
  521|    780|        if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata)
  ------------------
  |  |  119|    780|#define TIFF_MYBUFFER 0x00200U    /* my raw data buffer; free on close */
  ------------------
  |  Branch (521:13): [True: 780, False: 0]
  |  Branch (521:49): [True: 780, False: 0]
  ------------------
  522|    780|        {
  523|    780|            _TIFFfreeExt(tif, tif->tif_rawdata);
  524|    780|            tif->tif_rawdata = NULL;
  525|    780|            tif->tif_rawcc = 0;
  526|    780|            tif->tif_rawdatasize = 0;
  527|    780|            tif->tif_rawdataoff = 0;
  528|    780|            tif->tif_rawdataloaded = 0;
  529|    780|        }
  530|    780|        tif->tif_flags &= ~(TIFF_BEENWRITING | TIFF_BUFFERSETUP);
  ------------------
  |  |  116|    780|#define TIFF_BEENWRITING 0x00040U /* written 1+ scanlines to file */
  ------------------
                      tif->tif_flags &= ~(TIFF_BEENWRITING | TIFF_BUFFERSETUP);
  ------------------
  |  |  114|    780|#define TIFF_BUFFERSETUP 0x00010U /* data buffers setup */
  ------------------
  531|    780|    }
  532|       |
  533|    780|    if (TIFFFieldSet(tif, FIELD_COMPRESSION) &&
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|    780|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|    780|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 780, False: 0]
  |  |  ------------------
  ------------------
  534|    780|        (tif->tif_dir.td_compression == COMPRESSION_DEFLATE))
  ------------------
  |  |  205|    780|#define COMPRESSION_DEFLATE 32946   /* Deflate compression, legacy tag */
  ------------------
  |  Branch (534:9): [True: 0, False: 780]
  ------------------
  535|      0|    {
  536|      0|        TIFFWarningExtR(tif, module,
  537|      0|                        "Creating TIFF with legacy Deflate codec identifier, "
  538|      0|                        "COMPRESSION_ADOBE_DEFLATE is more widely supported");
  539|      0|    }
  540|    780|    dir = NULL;
  541|    780|    dirmem = NULL;
  542|    780|    dirsize = 0;
  543|  1.56k|    while (1)
  ------------------
  |  Branch (543:12): [Folded - Ignored]
  ------------------
  544|  1.56k|    {
  545|  1.56k|        ndir = 0;
  546|  1.56k|        if (isimage)
  ------------------
  |  Branch (546:13): [True: 1.56k, False: 0]
  ------------------
  547|  1.56k|        {
  548|  1.56k|            if (TIFFFieldSet(tif, FIELD_IMAGEDIMENSIONS))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 1.56k, False: 0]
  |  |  ------------------
  ------------------
  549|  1.56k|            {
  550|  1.56k|                if (!TIFFWriteDirectoryTagShortLong(tif, &ndir, dir,
  ------------------
  |  Branch (550:21): [True: 0, False: 1.56k]
  ------------------
  551|  1.56k|                                                    TIFFTAG_IMAGEWIDTH,
  ------------------
  |  |  178|  1.56k|#define TIFFTAG_IMAGEWIDTH 256        /* image width in pixels */
  ------------------
  552|  1.56k|                                                    tif->tif_dir.td_imagewidth))
  553|      0|                    goto bad;
  554|  1.56k|                if (!TIFFWriteDirectoryTagShortLong(
  ------------------
  |  Branch (554:21): [True: 0, False: 1.56k]
  ------------------
  555|  1.56k|                        tif, &ndir, dir, TIFFTAG_IMAGELENGTH,
  ------------------
  |  |  179|  1.56k|#define TIFFTAG_IMAGELENGTH 257       /* image height in pixels */
  ------------------
  556|  1.56k|                        tif->tif_dir.td_imagelength))
  557|      0|                    goto bad;
  558|  1.56k|            }
  559|  1.56k|            if (TIFFFieldSet(tif, FIELD_TILEDIMENSIONS))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  560|      0|            {
  561|      0|                if (!TIFFWriteDirectoryTagShortLong(tif, &ndir, dir,
  ------------------
  |  Branch (561:21): [True: 0, False: 0]
  ------------------
  562|      0|                                                    TIFFTAG_TILEWIDTH,
  ------------------
  |  |  310|      0|#define TIFFTAG_TILEWIDTH 322              /* !tile width in pixels */
  ------------------
  563|      0|                                                    tif->tif_dir.td_tilewidth))
  564|      0|                    goto bad;
  565|      0|                if (!TIFFWriteDirectoryTagShortLong(tif, &ndir, dir,
  ------------------
  |  Branch (565:21): [True: 0, False: 0]
  ------------------
  566|      0|                                                    TIFFTAG_TILELENGTH,
  ------------------
  |  |  311|      0|#define TIFFTAG_TILELENGTH 323             /* !tile height in pixels */
  ------------------
  567|      0|                                                    tif->tif_dir.td_tilelength))
  568|      0|                    goto bad;
  569|      0|            }
  570|  1.56k|            if (TIFFFieldSet(tif, FIELD_RESOLUTION))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  571|      0|            {
  572|      0|                if (!TIFFWriteDirectoryTagRational(tif, &ndir, dir,
  ------------------
  |  Branch (572:21): [True: 0, False: 0]
  ------------------
  573|      0|                                                   TIFFTAG_XRESOLUTION,
  ------------------
  |  |  261|      0|#define TIFFTAG_XRESOLUTION 282            /* pixels/resolution in x */
  ------------------
  574|      0|                                                   tif->tif_dir.td_xresolution))
  575|      0|                    goto bad;
  576|      0|                if (!TIFFWriteDirectoryTagRational(tif, &ndir, dir,
  ------------------
  |  Branch (576:21): [True: 0, False: 0]
  ------------------
  577|      0|                                                   TIFFTAG_YRESOLUTION,
  ------------------
  |  |  262|      0|#define TIFFTAG_YRESOLUTION 283            /* pixels/resolution in y */
  ------------------
  578|      0|                                                   tif->tif_dir.td_yresolution))
  579|      0|                    goto bad;
  580|      0|            }
  581|  1.56k|            if (TIFFFieldSet(tif, FIELD_POSITION))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  582|      0|            {
  583|      0|                if (!TIFFWriteDirectoryTagRational(tif, &ndir, dir,
  ------------------
  |  Branch (583:21): [True: 0, False: 0]
  ------------------
  584|      0|                                                   TIFFTAG_XPOSITION,
  ------------------
  |  |  267|      0|#define TIFFTAG_XPOSITION 286              /* x page offset of image lhs */
  ------------------
  585|      0|                                                   tif->tif_dir.td_xposition))
  586|      0|                    goto bad;
  587|      0|                if (!TIFFWriteDirectoryTagRational(tif, &ndir, dir,
  ------------------
  |  Branch (587:21): [True: 0, False: 0]
  ------------------
  588|      0|                                                   TIFFTAG_YPOSITION,
  ------------------
  |  |  268|      0|#define TIFFTAG_YPOSITION 287              /* y page offset of image lhs */
  ------------------
  589|      0|                                                   tif->tif_dir.td_yposition))
  590|      0|                    goto bad;
  591|      0|            }
  592|  1.56k|            if (TIFFFieldSet(tif, FIELD_SUBFILETYPE))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  593|      0|            {
  594|      0|                if (!TIFFWriteDirectoryTagLong(tif, &ndir, dir,
  ------------------
  |  Branch (594:21): [True: 0, False: 0]
  ------------------
  595|      0|                                               TIFFTAG_SUBFILETYPE,
  ------------------
  |  |  170|      0|#define TIFFTAG_SUBFILETYPE 254       /* subfile data descriptor */
  ------------------
  596|      0|                                               tif->tif_dir.td_subfiletype))
  597|      0|                    goto bad;
  598|      0|            }
  599|  1.56k|            if (TIFFFieldSet(tif, FIELD_BITSPERSAMPLE))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 1.56k, False: 0]
  |  |  ------------------
  ------------------
  600|  1.56k|            {
  601|  1.56k|                if (!TIFFWriteDirectoryTagShortPerSample(
  ------------------
  |  Branch (601:21): [True: 0, False: 1.56k]
  ------------------
  602|  1.56k|                        tif, &ndir, dir, TIFFTAG_BITSPERSAMPLE,
  ------------------
  |  |  180|  1.56k|#define TIFFTAG_BITSPERSAMPLE 258     /* bits per channel (sample) */
  ------------------
  603|  1.56k|                        tif->tif_dir.td_bitspersample))
  604|      0|                    goto bad;
  605|  1.56k|            }
  606|  1.56k|            if (TIFFFieldSet(tif, FIELD_COMPRESSION))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 1.56k, False: 0]
  |  |  ------------------
  ------------------
  607|  1.56k|            {
  608|  1.56k|                if (!TIFFWriteDirectoryTagShort(tif, &ndir, dir,
  ------------------
  |  Branch (608:21): [True: 0, False: 1.56k]
  ------------------
  609|  1.56k|                                                TIFFTAG_COMPRESSION,
  ------------------
  |  |  181|  1.56k|#define TIFFTAG_COMPRESSION 259       /* data compression technique */
  ------------------
  610|  1.56k|                                                tif->tif_dir.td_compression))
  611|      0|                    goto bad;
  612|  1.56k|            }
  613|  1.56k|            if (TIFFFieldSet(tif, FIELD_PHOTOMETRIC))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 1.56k, False: 0]
  |  |  ------------------
  ------------------
  614|  1.56k|            {
  615|  1.56k|                if (!TIFFWriteDirectoryTagShort(tif, &ndir, dir,
  ------------------
  |  Branch (615:21): [True: 0, False: 1.56k]
  ------------------
  616|  1.56k|                                                TIFFTAG_PHOTOMETRIC,
  ------------------
  |  |  219|  1.56k|#define TIFFTAG_PHOTOMETRIC 262            /* photometric interpretation */
  ------------------
  617|  1.56k|                                                tif->tif_dir.td_photometric))
  618|      0|                    goto bad;
  619|  1.56k|            }
  620|  1.56k|            if (TIFFFieldSet(tif, FIELD_THRESHHOLDING))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  621|      0|            {
  622|      0|                if (!TIFFWriteDirectoryTagShort(tif, &ndir, dir,
  ------------------
  |  Branch (622:21): [True: 0, False: 0]
  ------------------
  623|      0|                                                TIFFTAG_THRESHHOLDING,
  ------------------
  |  |  233|      0|#define TIFFTAG_THRESHHOLDING 263          /* +thresholding used on data */
  ------------------
  624|      0|                                                tif->tif_dir.td_threshholding))
  625|      0|                    goto bad;
  626|      0|            }
  627|  1.56k|            if (TIFFFieldSet(tif, FIELD_FILLORDER))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  628|      0|            {
  629|      0|                if (!TIFFWriteDirectoryTagShort(tif, &ndir, dir,
  ------------------
  |  Branch (629:21): [True: 0, False: 0]
  ------------------
  630|      0|                                                TIFFTAG_FILLORDER,
  ------------------
  |  |  239|      0|#define TIFFTAG_FILLORDER 266              /* data order within a byte */
  ------------------
  631|      0|                                                tif->tif_dir.td_fillorder))
  632|      0|                    goto bad;
  633|      0|            }
  634|  1.56k|            if (TIFFFieldSet(tif, FIELD_ORIENTATION))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  635|      0|            {
  636|      0|                if (!TIFFWriteDirectoryTagShort(tif, &ndir, dir,
  ------------------
  |  Branch (636:21): [True: 0, False: 0]
  ------------------
  637|      0|                                                TIFFTAG_ORIENTATION,
  ------------------
  |  |  247|      0|#define TIFFTAG_ORIENTATION 274            /* +image orientation */
  ------------------
  638|      0|                                                tif->tif_dir.td_orientation))
  639|      0|                    goto bad;
  640|      0|            }
  641|  1.56k|            if (TIFFFieldSet(tif, FIELD_SAMPLESPERPIXEL))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 1.56k, False: 0]
  |  |  ------------------
  ------------------
  642|  1.56k|            {
  643|  1.56k|                if (!TIFFWriteDirectoryTagShort(
  ------------------
  |  Branch (643:21): [True: 0, False: 1.56k]
  ------------------
  644|  1.56k|                        tif, &ndir, dir, TIFFTAG_SAMPLESPERPIXEL,
  ------------------
  |  |  256|  1.56k|#define TIFFTAG_SAMPLESPERPIXEL 277        /* samples per pixel */
  ------------------
  645|  1.56k|                        tif->tif_dir.td_samplesperpixel))
  646|      0|                    goto bad;
  647|  1.56k|            }
  648|  1.56k|            if (TIFFFieldSet(tif, FIELD_ROWSPERSTRIP))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 1.56k, False: 0]
  |  |  ------------------
  ------------------
  649|  1.56k|            {
  650|  1.56k|                if (!TIFFWriteDirectoryTagShortLong(
  ------------------
  |  Branch (650:21): [True: 0, False: 1.56k]
  ------------------
  651|  1.56k|                        tif, &ndir, dir, TIFFTAG_ROWSPERSTRIP,
  ------------------
  |  |  257|  1.56k|#define TIFFTAG_ROWSPERSTRIP 278           /* rows per strip of data */
  ------------------
  652|  1.56k|                        tif->tif_dir.td_rowsperstrip))
  653|      0|                    goto bad;
  654|  1.56k|            }
  655|  1.56k|            if (TIFFFieldSet(tif, FIELD_MINSAMPLEVALUE))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  656|      0|            {
  657|      0|                if (!TIFFWriteDirectoryTagShortPerSample(
  ------------------
  |  Branch (657:21): [True: 0, False: 0]
  ------------------
  658|      0|                        tif, &ndir, dir, TIFFTAG_MINSAMPLEVALUE,
  ------------------
  |  |  259|      0|#define TIFFTAG_MINSAMPLEVALUE 280         /* +minimum sample value */
  ------------------
  659|      0|                        tif->tif_dir.td_minsamplevalue))
  660|      0|                    goto bad;
  661|      0|            }
  662|  1.56k|            if (TIFFFieldSet(tif, FIELD_MAXSAMPLEVALUE))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  663|      0|            {
  664|      0|                if (!TIFFWriteDirectoryTagShortPerSample(
  ------------------
  |  Branch (664:21): [True: 0, False: 0]
  ------------------
  665|      0|                        tif, &ndir, dir, TIFFTAG_MAXSAMPLEVALUE,
  ------------------
  |  |  260|      0|#define TIFFTAG_MAXSAMPLEVALUE 281         /* +maximum sample value */
  ------------------
  666|      0|                        tif->tif_dir.td_maxsamplevalue))
  667|      0|                    goto bad;
  668|      0|            }
  669|  1.56k|            if (TIFFFieldSet(tif, FIELD_PLANARCONFIG))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 1.56k, False: 0]
  |  |  ------------------
  ------------------
  670|  1.56k|            {
  671|  1.56k|                if (!TIFFWriteDirectoryTagShort(tif, &ndir, dir,
  ------------------
  |  Branch (671:21): [True: 0, False: 1.56k]
  ------------------
  672|  1.56k|                                                TIFFTAG_PLANARCONFIG,
  ------------------
  |  |  263|  1.56k|#define TIFFTAG_PLANARCONFIG 284           /* storage organization */
  ------------------
  673|  1.56k|                                                tif->tif_dir.td_planarconfig))
  674|      0|                    goto bad;
  675|  1.56k|            }
  676|  1.56k|            if (TIFFFieldSet(tif, FIELD_RESOLUTIONUNIT))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  677|      0|            {
  678|      0|                if (!TIFFWriteDirectoryTagShort(tif, &ndir, dir,
  ------------------
  |  Branch (678:21): [True: 0, False: 0]
  ------------------
  679|      0|                                                TIFFTAG_RESOLUTIONUNIT,
  ------------------
  |  |  286|      0|#define TIFFTAG_RESOLUTIONUNIT 296         /* units of resolutions */
  ------------------
  680|      0|                                                tif->tif_dir.td_resolutionunit))
  681|      0|                    goto bad;
  682|      0|            }
  683|  1.56k|            if (TIFFFieldSet(tif, FIELD_PAGENUMBER))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  684|      0|            {
  685|      0|                if (!TIFFWriteDirectoryTagShortArray(
  ------------------
  |  Branch (685:21): [True: 0, False: 0]
  ------------------
  686|      0|                        tif, &ndir, dir, TIFFTAG_PAGENUMBER, 2,
  ------------------
  |  |  290|      0|#define TIFFTAG_PAGENUMBER 297             /* page numbers of multi-page */
  ------------------
  687|      0|                        &tif->tif_dir.td_pagenumber[0]))
  688|      0|                    goto bad;
  689|      0|            }
  690|  1.56k|            if (TIFFFieldSet(tif, FIELD_STRIPBYTECOUNTS))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 1.56k, False: 0]
  |  |  ------------------
  ------------------
  691|  1.56k|            {
  692|  1.56k|                if (!isTiled(tif))
  ------------------
  |  |  250|  1.56k|#define isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0)
  |  |  ------------------
  |  |  |  |  120|  1.56k|#define TIFF_ISTILED 0x00400U     /* file is tile, not strip- based */
  |  |  ------------------
  ------------------
  |  Branch (692:21): [True: 1.56k, False: 0]
  ------------------
  693|  1.56k|                {
  694|  1.56k|                    if (!TIFFWriteDirectoryTagLongLong8Array(
  ------------------
  |  Branch (694:25): [True: 0, False: 1.56k]
  ------------------
  695|  1.56k|                            tif, &ndir, dir, TIFFTAG_STRIPBYTECOUNTS,
  ------------------
  |  |  258|  1.56k|#define TIFFTAG_STRIPBYTECOUNTS 279        /* bytes counts for strips */
  ------------------
  696|  1.56k|                            tif->tif_dir.td_nstrips,
  697|  1.56k|                            tif->tif_dir.td_stripbytecount_p))
  698|      0|                        goto bad;
  699|  1.56k|                }
  700|      0|                else
  701|      0|                {
  702|      0|                    if (!TIFFWriteDirectoryTagLongLong8Array(
  ------------------
  |  Branch (702:25): [True: 0, False: 0]
  ------------------
  703|      0|                            tif, &ndir, dir, TIFFTAG_TILEBYTECOUNTS,
  ------------------
  |  |  313|      0|#define TIFFTAG_TILEBYTECOUNTS 325         /* !byte counts for tiles */
  ------------------
  704|      0|                            tif->tif_dir.td_nstrips,
  705|      0|                            tif->tif_dir.td_stripbytecount_p))
  706|      0|                        goto bad;
  707|      0|                }
  708|  1.56k|            }
  709|  1.56k|            if (TIFFFieldSet(tif, FIELD_STRIPOFFSETS))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 1.56k, False: 0]
  |  |  ------------------
  ------------------
  710|  1.56k|            {
  711|  1.56k|                if (!isTiled(tif))
  ------------------
  |  |  250|  1.56k|#define isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0)
  |  |  ------------------
  |  |  |  |  120|  1.56k|#define TIFF_ISTILED 0x00400U     /* file is tile, not strip- based */
  |  |  ------------------
  ------------------
  |  Branch (711:21): [True: 1.56k, False: 0]
  ------------------
  712|  1.56k|                {
  713|       |                    /* td_stripoffset_p might be NULL in an odd OJPEG case. See
  714|       |                     *  tif_dirread.c around line 3634.
  715|       |                     * XXX: OJPEG hack.
  716|       |                     * If a) compression is OJPEG, b) it's not a tiled TIFF,
  717|       |                     * and c) the number of strips is 1,
  718|       |                     * then we tolerate the absence of stripoffsets tag,
  719|       |                     * because, presumably, all required data is in the
  720|       |                     * JpegInterchangeFormat stream.
  721|       |                     * We can get here when using tiffset on such a file.
  722|       |                     * See http://bugzilla.maptools.org/show_bug.cgi?id=2500
  723|       |                     */
  724|  1.56k|                    if (tif->tif_dir.td_stripoffset_p != NULL &&
  ------------------
  |  Branch (724:25): [True: 1.56k, False: 0]
  ------------------
  725|  1.56k|                        !TIFFWriteDirectoryTagLongLong8Array(
  ------------------
  |  Branch (725:25): [True: 0, False: 1.56k]
  ------------------
  726|  1.56k|                            tif, &ndir, dir, TIFFTAG_STRIPOFFSETS,
  ------------------
  |  |  246|  1.56k|#define TIFFTAG_STRIPOFFSETS 273           /* offsets to data strips */
  ------------------
  727|  1.56k|                            tif->tif_dir.td_nstrips,
  728|  1.56k|                            tif->tif_dir.td_stripoffset_p))
  729|      0|                        goto bad;
  730|  1.56k|                }
  731|      0|                else
  732|      0|                {
  733|      0|                    if (!TIFFWriteDirectoryTagLongLong8Array(
  ------------------
  |  Branch (733:25): [True: 0, False: 0]
  ------------------
  734|      0|                            tif, &ndir, dir, TIFFTAG_TILEOFFSETS,
  ------------------
  |  |  312|      0|#define TIFFTAG_TILEOFFSETS 324            /* !offsets to data tiles */
  ------------------
  735|      0|                            tif->tif_dir.td_nstrips,
  736|      0|                            tif->tif_dir.td_stripoffset_p))
  737|      0|                        goto bad;
  738|      0|                }
  739|  1.56k|            }
  740|  1.56k|            if (TIFFFieldSet(tif, FIELD_COLORMAP))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  741|      0|            {
  742|      0|                if (!TIFFWriteDirectoryTagColormap(tif, &ndir, dir))
  ------------------
  |  Branch (742:21): [True: 0, False: 0]
  ------------------
  743|      0|                    goto bad;
  744|      0|            }
  745|  1.56k|            if (TIFFFieldSet(tif, FIELD_EXTRASAMPLES))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  746|      0|            {
  747|      0|                if (tif->tif_dir.td_extrasamples)
  ------------------
  |  Branch (747:21): [True: 0, False: 0]
  ------------------
  748|      0|                {
  749|      0|                    uint16_t na;
  750|      0|                    uint16_t *nb;
  751|      0|                    TIFFGetFieldDefaulted(tif, TIFFTAG_EXTRASAMPLES, &na, &nb);
  ------------------
  |  |  328|      0|#define TIFFTAG_EXTRASAMPLES 338           /* !info about extra samples */
  ------------------
  752|      0|                    if (!TIFFWriteDirectoryTagShortArray(
  ------------------
  |  Branch (752:25): [True: 0, False: 0]
  ------------------
  753|      0|                            tif, &ndir, dir, TIFFTAG_EXTRASAMPLES, na, nb))
  ------------------
  |  |  328|      0|#define TIFFTAG_EXTRASAMPLES 338           /* !info about extra samples */
  ------------------
  754|      0|                        goto bad;
  755|      0|                }
  756|      0|            }
  757|  1.56k|            if (TIFFFieldSet(tif, FIELD_SAMPLEFORMAT))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 1.56k, False: 0]
  |  |  ------------------
  ------------------
  758|  1.56k|            {
  759|  1.56k|                if (!TIFFWriteDirectoryTagShortPerSample(
  ------------------
  |  Branch (759:21): [True: 0, False: 1.56k]
  ------------------
  760|  1.56k|                        tif, &ndir, dir, TIFFTAG_SAMPLEFORMAT,
  ------------------
  |  |  332|  1.56k|#define TIFFTAG_SAMPLEFORMAT 339           /* !data sample format */
  ------------------
  761|  1.56k|                        tif->tif_dir.td_sampleformat))
  762|      0|                    goto bad;
  763|  1.56k|            }
  764|  1.56k|            if (TIFFFieldSet(tif, FIELD_SMINSAMPLEVALUE))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  765|      0|            {
  766|      0|                if (!TIFFWriteDirectoryTagSampleformatArray(
  ------------------
  |  Branch (766:21): [True: 0, False: 0]
  ------------------
  767|      0|                        tif, &ndir, dir, TIFFTAG_SMINSAMPLEVALUE,
  ------------------
  |  |  339|      0|#define TIFFTAG_SMINSAMPLEVALUE 340        /* !variable MinSampleValue */
  ------------------
  768|      0|                        tif->tif_dir.td_samplesperpixel,
  769|      0|                        tif->tif_dir.td_sminsamplevalue))
  770|      0|                    goto bad;
  771|      0|            }
  772|  1.56k|            if (TIFFFieldSet(tif, FIELD_SMAXSAMPLEVALUE))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  773|      0|            {
  774|      0|                if (!TIFFWriteDirectoryTagSampleformatArray(
  ------------------
  |  Branch (774:21): [True: 0, False: 0]
  ------------------
  775|      0|                        tif, &ndir, dir, TIFFTAG_SMAXSAMPLEVALUE,
  ------------------
  |  |  340|      0|#define TIFFTAG_SMAXSAMPLEVALUE 341        /* !variable MaxSampleValue */
  ------------------
  776|      0|                        tif->tif_dir.td_samplesperpixel,
  777|      0|                        tif->tif_dir.td_smaxsamplevalue))
  778|      0|                    goto bad;
  779|      0|            }
  780|  1.56k|            if (TIFFFieldSet(tif, FIELD_IMAGEDEPTH))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  781|      0|            {
  782|      0|                if (!TIFFWriteDirectoryTagLong(tif, &ndir, dir,
  ------------------
  |  Branch (782:21): [True: 0, False: 0]
  ------------------
  783|      0|                                               TIFFTAG_IMAGEDEPTH,
  ------------------
  |  |  406|      0|#define TIFFTAG_IMAGEDEPTH 32997 /* z depth of image */
  ------------------
  784|      0|                                               tif->tif_dir.td_imagedepth))
  785|      0|                    goto bad;
  786|      0|            }
  787|  1.56k|            if (TIFFFieldSet(tif, FIELD_TILEDEPTH))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  788|      0|            {
  789|      0|                if (!TIFFWriteDirectoryTagLong(tif, &ndir, dir,
  ------------------
  |  Branch (789:21): [True: 0, False: 0]
  ------------------
  790|      0|                                               TIFFTAG_TILEDEPTH,
  ------------------
  |  |  407|      0|#define TIFFTAG_TILEDEPTH 32998  /* z depth/data tile */
  ------------------
  791|      0|                                               tif->tif_dir.td_tiledepth))
  792|      0|                    goto bad;
  793|      0|            }
  794|  1.56k|            if (TIFFFieldSet(tif, FIELD_HALFTONEHINTS))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  795|      0|            {
  796|      0|                if (!TIFFWriteDirectoryTagShortArray(
  ------------------
  |  Branch (796:21): [True: 0, False: 0]
  ------------------
  797|      0|                        tif, &ndir, dir, TIFFTAG_HALFTONEHINTS, 2,
  ------------------
  |  |  309|      0|#define TIFFTAG_HALFTONEHINTS 321          /* !highlight+shadow info */
  ------------------
  798|      0|                        &tif->tif_dir.td_halftonehints[0]))
  799|      0|                    goto bad;
  800|      0|            }
  801|  1.56k|            if (TIFFFieldSet(tif, FIELD_YCBCRSUBSAMPLING))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  802|      0|            {
  803|      0|                if (!TIFFWriteDirectoryTagShortArray(
  ------------------
  |  Branch (803:21): [True: 0, False: 0]
  ------------------
  804|      0|                        tif, &ndir, dir, TIFFTAG_YCBCRSUBSAMPLING, 2,
  ------------------
  |  |  387|      0|#define TIFFTAG_YCBCRSUBSAMPLING 530       /* !YCbCr subsampling factors */
  ------------------
  805|      0|                        &tif->tif_dir.td_ycbcrsubsampling[0]))
  806|      0|                    goto bad;
  807|      0|            }
  808|  1.56k|            if (TIFFFieldSet(tif, FIELD_YCBCRPOSITIONING))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  809|      0|            {
  810|      0|                if (!TIFFWriteDirectoryTagShort(
  ------------------
  |  Branch (810:21): [True: 0, False: 0]
  ------------------
  811|      0|                        tif, &ndir, dir, TIFFTAG_YCBCRPOSITIONING,
  ------------------
  |  |  388|      0|#define TIFFTAG_YCBCRPOSITIONING 531       /* !subsample positioning */
  ------------------
  812|      0|                        tif->tif_dir.td_ycbcrpositioning))
  813|      0|                    goto bad;
  814|      0|            }
  815|  1.56k|            if (TIFFFieldSet(tif, FIELD_REFBLACKWHITE))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  816|      0|            {
  817|      0|                if (!TIFFWriteDirectoryTagRationalArray(
  ------------------
  |  Branch (817:21): [True: 0, False: 0]
  ------------------
  818|      0|                        tif, &ndir, dir, TIFFTAG_REFERENCEBLACKWHITE, 6,
  ------------------
  |  |  391|      0|#define TIFFTAG_REFERENCEBLACKWHITE 532    /* !colorimetry info */
  ------------------
  819|      0|                        tif->tif_dir.td_refblackwhite))
  820|      0|                    goto bad;
  821|      0|            }
  822|  1.56k|            if (TIFFFieldSet(tif, FIELD_TRANSFERFUNCTION))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  823|      0|            {
  824|      0|                if (!TIFFWriteDirectoryTagTransferfunction(tif, &ndir, dir))
  ------------------
  |  Branch (824:21): [True: 0, False: 0]
  ------------------
  825|      0|                    goto bad;
  826|      0|            }
  827|  1.56k|            if (TIFFFieldSet(tif, FIELD_INKNAMES))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  828|      0|            {
  829|      0|                if (!TIFFWriteDirectoryTagAscii(
  ------------------
  |  Branch (829:21): [True: 0, False: 0]
  ------------------
  830|      0|                        tif, &ndir, dir, TIFFTAG_INKNAMES,
  ------------------
  |  |  324|      0|#define TIFFTAG_INKNAMES 333               /* !ascii names of inks */
  ------------------
  831|      0|                        tif->tif_dir.td_inknameslen, tif->tif_dir.td_inknames))
  832|      0|                    goto bad;
  833|      0|            }
  834|  1.56k|            if (TIFFFieldSet(tif, FIELD_NUMBEROFINKS))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  835|      0|            {
  836|      0|                if (!TIFFWriteDirectoryTagShort(tif, &ndir, dir,
  ------------------
  |  Branch (836:21): [True: 0, False: 0]
  ------------------
  837|      0|                                                TIFFTAG_NUMBEROFINKS,
  ------------------
  |  |  325|      0|#define TIFFTAG_NUMBEROFINKS 334           /* !number of inks */
  ------------------
  838|      0|                                                tif->tif_dir.td_numberofinks))
  839|      0|                    goto bad;
  840|      0|            }
  841|  1.56k|            if (TIFFFieldSet(tif, FIELD_SUBIFD))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  842|      0|            {
  843|      0|                if (!TIFFWriteDirectoryTagSubifd(tif, &ndir, dir))
  ------------------
  |  Branch (843:21): [True: 0, False: 0]
  ------------------
  844|      0|                    goto bad;
  845|      0|            }
  846|  1.56k|            {
  847|  1.56k|                uint32_t n;
  848|   238k|                for (n = 0; n < tif->tif_nfields; n++)
  ------------------
  |  Branch (848:29): [True: 237k, False: 1.56k]
  ------------------
  849|   237k|                {
  850|   237k|                    const TIFFField *o;
  851|   237k|                    o = tif->tif_fields[n];
  852|   237k|                    if ((o->field_bit >= FIELD_CODEC) &&
  ------------------
  |  |  193|   237k|#define FIELD_CODEC 66 /* base of codec-private tags */
  ------------------
  |  Branch (852:25): [True: 1.56k, False: 235k]
  ------------------
  853|   237k|                        (TIFFFieldSet(tif, o->field_bit)))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|  1.56k|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|  1.56k|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  ------------------
  |  Branch (853:25): [True: 1.56k, False: 0]
  ------------------
  854|  1.56k|                    {
  855|  1.56k|                        switch (o->get_field_type)
  856|  1.56k|                        {
  857|      0|                            case TIFF_SETGET_ASCII:
  ------------------
  |  Branch (857:29): [True: 0, False: 1.56k]
  ------------------
  858|      0|                            {
  859|      0|                                uint32_t pa;
  860|      0|                                char *pb;
  861|      0|                                assert(o->field_type == TIFF_ASCII);
  862|      0|                                assert(o->field_readcount == TIFF_VARIABLE);
  863|      0|                                assert(o->field_passcount == 0);
  864|      0|                                TIFFGetField(tif, o->field_tag, &pb);
  865|      0|                                pa = (uint32_t)(strlen(pb));
  866|      0|                                if (!TIFFWriteDirectoryTagAscii(
  ------------------
  |  Branch (866:37): [True: 0, False: 0]
  ------------------
  867|      0|                                        tif, &ndir, dir, (uint16_t)o->field_tag,
  868|      0|                                        pa, pb))
  869|      0|                                    goto bad;
  870|      0|                            }
  871|      0|                            break;
  872|  1.56k|                            case TIFF_SETGET_UINT16:
  ------------------
  |  Branch (872:29): [True: 1.56k, False: 0]
  ------------------
  873|  1.56k|                            {
  874|  1.56k|                                uint16_t p;
  875|  1.56k|                                assert(o->field_type == TIFF_SHORT);
  876|  1.56k|                                assert(o->field_readcount == 1);
  877|  1.56k|                                assert(o->field_passcount == 0);
  878|  1.56k|                                TIFFGetField(tif, o->field_tag, &p);
  879|  1.56k|                                if (!TIFFWriteDirectoryTagShort(
  ------------------
  |  Branch (879:37): [True: 0, False: 1.56k]
  ------------------
  880|  1.56k|                                        tif, &ndir, dir, (uint16_t)o->field_tag,
  881|  1.56k|                                        p))
  882|      0|                                    goto bad;
  883|  1.56k|                            }
  884|  1.56k|                            break;
  885|  1.56k|                            case TIFF_SETGET_UINT32:
  ------------------
  |  Branch (885:29): [True: 0, False: 1.56k]
  ------------------
  886|      0|                            {
  887|      0|                                uint32_t p;
  888|      0|                                assert(o->field_type == TIFF_LONG);
  889|      0|                                assert(o->field_readcount == 1);
  890|      0|                                assert(o->field_passcount == 0);
  891|      0|                                TIFFGetField(tif, o->field_tag, &p);
  892|      0|                                if (!TIFFWriteDirectoryTagLong(
  ------------------
  |  Branch (892:37): [True: 0, False: 0]
  ------------------
  893|      0|                                        tif, &ndir, dir, (uint16_t)o->field_tag,
  894|      0|                                        p))
  895|      0|                                    goto bad;
  896|      0|                            }
  897|      0|                            break;
  898|      0|                            case TIFF_SETGET_C32_UINT8:
  ------------------
  |  Branch (898:29): [True: 0, False: 1.56k]
  ------------------
  899|      0|                            {
  900|      0|                                uint32_t pa;
  901|      0|                                void *pb;
  902|      0|                                assert(o->field_type == TIFF_UNDEFINED);
  903|      0|                                assert(o->field_readcount == TIFF_VARIABLE2);
  904|      0|                                assert(o->field_passcount == 1);
  905|      0|                                TIFFGetField(tif, o->field_tag, &pa, &pb);
  906|      0|                                if (!TIFFWriteDirectoryTagUndefinedArray(
  ------------------
  |  Branch (906:37): [True: 0, False: 0]
  ------------------
  907|      0|                                        tif, &ndir, dir, (uint16_t)o->field_tag,
  908|      0|                                        pa, pb))
  909|      0|                                    goto bad;
  910|      0|                            }
  911|      0|                            break;
  912|      0|                            default:
  ------------------
  |  Branch (912:29): [True: 0, False: 1.56k]
  ------------------
  913|      0|                                TIFFErrorExtR(
  914|      0|                                    tif, module,
  915|      0|                                    "Cannot write tag %" PRIu32 " (%s)",
  916|      0|                                    TIFFFieldTag(o),
  917|      0|                                    o->field_name ? o->field_name : "unknown");
  ------------------
  |  Branch (917:37): [True: 0, False: 0]
  ------------------
  918|      0|                                goto bad;
  919|  1.56k|                        }
  920|  1.56k|                    }
  921|   237k|                }
  922|  1.56k|            }
  923|  1.56k|        }
  924|  1.56k|        for (m = 0; m < (uint32_t)(tif->tif_dir.td_customValueCount); m++)
  ------------------
  |  Branch (924:21): [True: 0, False: 1.56k]
  ------------------
  925|      0|        {
  926|      0|            uint16_t tag =
  927|      0|                (uint16_t)tif->tif_dir.td_customValues[m].info->field_tag;
  928|      0|            uint32_t count = tif->tif_dir.td_customValues[m].count;
  929|      0|            switch (tif->tif_dir.td_customValues[m].info->field_type)
  930|      0|            {
  931|      0|                case TIFF_ASCII:
  ------------------
  |  Branch (931:17): [True: 0, False: 0]
  ------------------
  932|      0|                    if (!TIFFWriteDirectoryTagAscii(
  ------------------
  |  Branch (932:25): [True: 0, False: 0]
  ------------------
  933|      0|                            tif, &ndir, dir, tag, count,
  934|      0|                            tif->tif_dir.td_customValues[m].value))
  935|      0|                        goto bad;
  936|      0|                    break;
  937|      0|                case TIFF_UNDEFINED:
  ------------------
  |  Branch (937:17): [True: 0, False: 0]
  ------------------
  938|      0|                    if (!TIFFWriteDirectoryTagUndefinedArray(
  ------------------
  |  Branch (938:25): [True: 0, False: 0]
  ------------------
  939|      0|                            tif, &ndir, dir, tag, count,
  940|      0|                            tif->tif_dir.td_customValues[m].value))
  941|      0|                        goto bad;
  942|      0|                    break;
  943|      0|                case TIFF_BYTE:
  ------------------
  |  Branch (943:17): [True: 0, False: 0]
  ------------------
  944|      0|                    if (!TIFFWriteDirectoryTagByteArray(
  ------------------
  |  Branch (944:25): [True: 0, False: 0]
  ------------------
  945|      0|                            tif, &ndir, dir, tag, count,
  946|      0|                            tif->tif_dir.td_customValues[m].value))
  947|      0|                        goto bad;
  948|      0|                    break;
  949|      0|                case TIFF_SBYTE:
  ------------------
  |  Branch (949:17): [True: 0, False: 0]
  ------------------
  950|      0|                    if (!TIFFWriteDirectoryTagSbyteArray(
  ------------------
  |  Branch (950:25): [True: 0, False: 0]
  ------------------
  951|      0|                            tif, &ndir, dir, tag, count,
  952|      0|                            tif->tif_dir.td_customValues[m].value))
  953|      0|                        goto bad;
  954|      0|                    break;
  955|      0|                case TIFF_SHORT:
  ------------------
  |  Branch (955:17): [True: 0, False: 0]
  ------------------
  956|      0|                    if (!TIFFWriteDirectoryTagShortArray(
  ------------------
  |  Branch (956:25): [True: 0, False: 0]
  ------------------
  957|      0|                            tif, &ndir, dir, tag, count,
  958|      0|                            tif->tif_dir.td_customValues[m].value))
  959|      0|                        goto bad;
  960|      0|                    break;
  961|      0|                case TIFF_SSHORT:
  ------------------
  |  Branch (961:17): [True: 0, False: 0]
  ------------------
  962|      0|                    if (!TIFFWriteDirectoryTagSshortArray(
  ------------------
  |  Branch (962:25): [True: 0, False: 0]
  ------------------
  963|      0|                            tif, &ndir, dir, tag, count,
  964|      0|                            tif->tif_dir.td_customValues[m].value))
  965|      0|                        goto bad;
  966|      0|                    break;
  967|      0|                case TIFF_LONG:
  ------------------
  |  Branch (967:17): [True: 0, False: 0]
  ------------------
  968|      0|                    if (!TIFFWriteDirectoryTagLongArray(
  ------------------
  |  Branch (968:25): [True: 0, False: 0]
  ------------------
  969|      0|                            tif, &ndir, dir, tag, count,
  970|      0|                            tif->tif_dir.td_customValues[m].value))
  971|      0|                        goto bad;
  972|      0|                    break;
  973|      0|                case TIFF_SLONG:
  ------------------
  |  Branch (973:17): [True: 0, False: 0]
  ------------------
  974|      0|                    if (!TIFFWriteDirectoryTagSlongArray(
  ------------------
  |  Branch (974:25): [True: 0, False: 0]
  ------------------
  975|      0|                            tif, &ndir, dir, tag, count,
  976|      0|                            tif->tif_dir.td_customValues[m].value))
  977|      0|                        goto bad;
  978|      0|                    break;
  979|      0|                case TIFF_LONG8:
  ------------------
  |  Branch (979:17): [True: 0, False: 0]
  ------------------
  980|      0|                    if (!TIFFWriteDirectoryTagLong8Array(
  ------------------
  |  Branch (980:25): [True: 0, False: 0]
  ------------------
  981|      0|                            tif, &ndir, dir, tag, count,
  982|      0|                            tif->tif_dir.td_customValues[m].value))
  983|      0|                        goto bad;
  984|      0|                    break;
  985|      0|                case TIFF_SLONG8:
  ------------------
  |  Branch (985:17): [True: 0, False: 0]
  ------------------
  986|      0|                    if (!TIFFWriteDirectoryTagSlong8Array(
  ------------------
  |  Branch (986:25): [True: 0, False: 0]
  ------------------
  987|      0|                            tif, &ndir, dir, tag, count,
  988|      0|                            tif->tif_dir.td_customValues[m].value))
  989|      0|                        goto bad;
  990|      0|                    break;
  991|      0|                case TIFF_RATIONAL:
  ------------------
  |  Branch (991:17): [True: 0, False: 0]
  ------------------
  992|      0|                {
  993|       |                    /*-- Rational2Double: For Rationals evaluate
  994|       |                     * "set_field_type" to determine internal storage size. */
  995|      0|                    int tv_size;
  996|      0|                    tv_size = TIFFFieldSetGetSize(
  997|      0|                        tif->tif_dir.td_customValues[m].info);
  998|      0|                    if (tv_size == 8)
  ------------------
  |  Branch (998:25): [True: 0, False: 0]
  ------------------
  999|      0|                    {
 1000|      0|                        if (!TIFFWriteDirectoryTagRationalDoubleArray(
  ------------------
  |  Branch (1000:29): [True: 0, False: 0]
  ------------------
 1001|      0|                                tif, &ndir, dir, tag, count,
 1002|      0|                                tif->tif_dir.td_customValues[m].value))
 1003|      0|                            goto bad;
 1004|      0|                    }
 1005|      0|                    else
 1006|      0|                    {
 1007|       |                        /*-- default should be tv_size == 4 */
 1008|      0|                        if (!TIFFWriteDirectoryTagRationalArray(
  ------------------
  |  Branch (1008:29): [True: 0, False: 0]
  ------------------
 1009|      0|                                tif, &ndir, dir, tag, count,
 1010|      0|                                tif->tif_dir.td_customValues[m].value))
 1011|      0|                            goto bad;
 1012|       |                        /*-- ToDo: After Testing, this should be removed and
 1013|       |                         * tv_size==4 should be set as default. */
 1014|      0|                        if (tv_size != 4)
  ------------------
  |  Branch (1014:29): [True: 0, False: 0]
  ------------------
 1015|      0|                        {
 1016|      0|                            TIFFErrorExtR(tif,
 1017|      0|                                          "TIFFLib: _TIFFWriteDirectorySec()",
 1018|      0|                                          "Rational2Double: .set_field_type is "
 1019|      0|                                          "not 4 but %d",
 1020|      0|                                          tv_size);
 1021|      0|                        }
 1022|      0|                    }
 1023|      0|                }
 1024|      0|                break;
 1025|      0|                case TIFF_SRATIONAL:
  ------------------
  |  Branch (1025:17): [True: 0, False: 0]
  ------------------
 1026|      0|                {
 1027|       |                    /*-- Rational2Double: For Rationals evaluate
 1028|       |                     * "set_field_type" to determine internal storage size. */
 1029|      0|                    int tv_size;
 1030|      0|                    tv_size = TIFFFieldSetGetSize(
 1031|      0|                        tif->tif_dir.td_customValues[m].info);
 1032|      0|                    if (tv_size == 8)
  ------------------
  |  Branch (1032:25): [True: 0, False: 0]
  ------------------
 1033|      0|                    {
 1034|      0|                        if (!TIFFWriteDirectoryTagSrationalDoubleArray(
  ------------------
  |  Branch (1034:29): [True: 0, False: 0]
  ------------------
 1035|      0|                                tif, &ndir, dir, tag, count,
 1036|      0|                                tif->tif_dir.td_customValues[m].value))
 1037|      0|                            goto bad;
 1038|      0|                    }
 1039|      0|                    else
 1040|      0|                    {
 1041|       |                        /*-- default should be tv_size == 4 */
 1042|      0|                        if (!TIFFWriteDirectoryTagSrationalArray(
  ------------------
  |  Branch (1042:29): [True: 0, False: 0]
  ------------------
 1043|      0|                                tif, &ndir, dir, tag, count,
 1044|      0|                                tif->tif_dir.td_customValues[m].value))
 1045|      0|                            goto bad;
 1046|       |                        /*-- ToDo: After Testing, this should be removed and
 1047|       |                         * tv_size==4 should be set as default. */
 1048|      0|                        if (tv_size != 4)
  ------------------
  |  Branch (1048:29): [True: 0, False: 0]
  ------------------
 1049|      0|                        {
 1050|      0|                            TIFFErrorExtR(tif,
 1051|      0|                                          "TIFFLib: _TIFFWriteDirectorySec()",
 1052|      0|                                          "Rational2Double: .set_field_type is "
 1053|      0|                                          "not 4 but %d",
 1054|      0|                                          tv_size);
 1055|      0|                        }
 1056|      0|                    }
 1057|      0|                }
 1058|      0|                break;
 1059|      0|                case TIFF_FLOAT:
  ------------------
  |  Branch (1059:17): [True: 0, False: 0]
  ------------------
 1060|      0|                    if (!TIFFWriteDirectoryTagFloatArray(
  ------------------
  |  Branch (1060:25): [True: 0, False: 0]
  ------------------
 1061|      0|                            tif, &ndir, dir, tag, count,
 1062|      0|                            tif->tif_dir.td_customValues[m].value))
 1063|      0|                        goto bad;
 1064|      0|                    break;
 1065|      0|                case TIFF_DOUBLE:
  ------------------
  |  Branch (1065:17): [True: 0, False: 0]
  ------------------
 1066|      0|                    if (!TIFFWriteDirectoryTagDoubleArray(
  ------------------
  |  Branch (1066:25): [True: 0, False: 0]
  ------------------
 1067|      0|                            tif, &ndir, dir, tag, count,
 1068|      0|                            tif->tif_dir.td_customValues[m].value))
 1069|      0|                        goto bad;
 1070|      0|                    break;
 1071|      0|                case TIFF_IFD:
  ------------------
  |  Branch (1071:17): [True: 0, False: 0]
  ------------------
 1072|      0|                    if (!TIFFWriteDirectoryTagIfdArray(
  ------------------
  |  Branch (1072:25): [True: 0, False: 0]
  ------------------
 1073|      0|                            tif, &ndir, dir, tag, count,
 1074|      0|                            tif->tif_dir.td_customValues[m].value))
 1075|      0|                        goto bad;
 1076|      0|                    break;
 1077|      0|                case TIFF_IFD8:
  ------------------
  |  Branch (1077:17): [True: 0, False: 0]
  ------------------
 1078|      0|                    if (!TIFFWriteDirectoryTagIfdIfd8Array(
  ------------------
  |  Branch (1078:25): [True: 0, False: 0]
  ------------------
 1079|      0|                            tif, &ndir, dir, tag, count,
 1080|      0|                            tif->tif_dir.td_customValues[m].value))
 1081|      0|                        goto bad;
 1082|      0|                    break;
 1083|      0|                default:
  ------------------
  |  Branch (1083:17): [True: 0, False: 0]
  ------------------
 1084|      0|                    assert(0); /* we should never get here */
 1085|      0|                    break;
 1086|      0|            }
 1087|      0|        }
 1088|  1.56k|        if (dir != NULL)
  ------------------
  |  Branch (1088:13): [True: 780, False: 780]
  ------------------
 1089|    780|            break;
 1090|    780|        dir = _TIFFmallocExt(tif, ndir * sizeof(TIFFDirEntry));
 1091|    780|        if (dir == NULL)
  ------------------
  |  Branch (1091:13): [True: 0, False: 780]
  ------------------
 1092|      0|        {
 1093|      0|            TIFFErrorExtR(tif, module, "Out of memory");
 1094|      0|            goto bad;
 1095|      0|        }
 1096|    780|        if (isimage)
  ------------------
  |  Branch (1096:13): [True: 780, False: 0]
  ------------------
 1097|    780|        {
 1098|    780|            if ((tif->tif_diroff == 0) && (!TIFFLinkDirectory(tif)))
  ------------------
  |  Branch (1098:17): [True: 780, False: 0]
  |  Branch (1098:43): [True: 0, False: 780]
  ------------------
 1099|      0|                goto bad;
 1100|    780|        }
 1101|      0|        else
 1102|      0|            tif->tif_diroff =
 1103|      0|                (TIFFSeekFile(tif, 0, SEEK_END) + 1) & (~((toff_t)1));
  ------------------
  |  |  259|      0|    ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence)))
  ------------------
 1104|    780|        if (pdiroff != NULL)
  ------------------
  |  Branch (1104:13): [True: 0, False: 780]
  ------------------
 1105|      0|            *pdiroff = tif->tif_diroff;
 1106|    780|        if (!(tif->tif_flags & TIFF_BIGTIFF))
  ------------------
  |  |  131|    780|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (1106:13): [True: 780, False: 0]
  ------------------
 1107|    780|            dirsize = 2 + ndir * 12 + 4;
 1108|      0|        else
 1109|      0|            dirsize = 8 + ndir * 20 + 8;
 1110|    780|        tif->tif_dataoff = tif->tif_diroff + dirsize;
 1111|    780|        if (!(tif->tif_flags & TIFF_BIGTIFF))
  ------------------
  |  |  131|    780|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (1111:13): [True: 780, False: 0]
  ------------------
 1112|    780|            tif->tif_dataoff = (uint32_t)tif->tif_dataoff;
 1113|    780|        if ((tif->tif_dataoff < tif->tif_diroff) ||
  ------------------
  |  Branch (1113:13): [True: 0, False: 780]
  ------------------
 1114|    780|            (tif->tif_dataoff < (uint64_t)dirsize))
  ------------------
  |  Branch (1114:13): [True: 0, False: 780]
  ------------------
 1115|      0|        {
 1116|      0|            TIFFErrorExtR(tif, module, "Maximum TIFF file size exceeded");
 1117|      0|            goto bad;
 1118|      0|        }
 1119|    780|        if (tif->tif_dataoff & 1)
  ------------------
  |  Branch (1119:13): [True: 0, False: 780]
  ------------------
 1120|      0|            tif->tif_dataoff++;
 1121|    780|        if (isimage)
  ------------------
  |  Branch (1121:13): [True: 780, False: 0]
  ------------------
 1122|    780|        {
 1123|    780|            if (tif->tif_curdir == TIFF_NON_EXISTENT_DIR_NUMBER)
  ------------------
  |  |   64|    780|#define TIFF_NON_EXISTENT_DIR_NUMBER UINT_MAX
  ------------------
  |  Branch (1123:17): [True: 780, False: 0]
  ------------------
 1124|    780|                tif->tif_curdir = 0;
 1125|      0|            else
 1126|      0|                tif->tif_curdir++;
 1127|    780|        }
 1128|    780|    }
 1129|    780|    if (isimage)
  ------------------
  |  Branch (1129:9): [True: 780, False: 0]
  ------------------
 1130|    780|    {
 1131|    780|        if (TIFFFieldSet(tif, FIELD_SUBIFD) && (tif->tif_subifdoff == 0))
  ------------------
  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|    780|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|    780|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 780]
  |  |  ------------------
  ------------------
  |  Branch (1131:48): [True: 0, False: 0]
  ------------------
 1132|      0|        {
 1133|      0|            uint32_t na;
 1134|      0|            TIFFDirEntry *nb;
 1135|      0|            for (na = 0, nb = dir;; na++, nb++)
 1136|      0|            {
 1137|      0|                if (na == ndir)
  ------------------
  |  Branch (1137:21): [True: 0, False: 0]
  ------------------
 1138|      0|                {
 1139|      0|                    TIFFErrorExtR(tif, module, "Cannot find SubIFD tag");
 1140|      0|                    goto bad;
 1141|      0|                }
 1142|      0|                if (nb->tdir_tag == TIFFTAG_SUBIFD)
  ------------------
  |  |  320|      0|#define TIFFTAG_SUBIFD 330                 /* subimage descriptors */
  ------------------
  |  Branch (1142:21): [True: 0, False: 0]
  ------------------
 1143|      0|                    break;
 1144|      0|            }
 1145|      0|            if (!(tif->tif_flags & TIFF_BIGTIFF))
  ------------------
  |  |  131|      0|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (1145:17): [True: 0, False: 0]
  ------------------
 1146|      0|                tif->tif_subifdoff = tif->tif_diroff + 2 + na * 12 + 8;
 1147|      0|            else
 1148|      0|                tif->tif_subifdoff = tif->tif_diroff + 8 + na * 20 + 12;
 1149|      0|        }
 1150|    780|    }
 1151|    780|    dirmem = _TIFFmallocExt(tif, dirsize);
 1152|    780|    if (dirmem == NULL)
  ------------------
  |  Branch (1152:9): [True: 0, False: 780]
  ------------------
 1153|      0|    {
 1154|      0|        TIFFErrorExtR(tif, module, "Out of memory");
 1155|      0|        goto bad;
 1156|      0|    }
 1157|    780|    if (!(tif->tif_flags & TIFF_BIGTIFF))
  ------------------
  |  |  131|    780|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (1157:9): [True: 780, False: 0]
  ------------------
 1158|    780|    {
 1159|    780|        uint8_t *n;
 1160|    780|        uint32_t nTmp;
 1161|    780|        TIFFDirEntry *o;
 1162|    780|        n = dirmem;
 1163|    780|        *(uint16_t *)n = (uint16_t)ndir;
 1164|    780|        if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|    780|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (1164:13): [True: 0, False: 780]
  ------------------
 1165|      0|            TIFFSwabShort((uint16_t *)n);
 1166|    780|        n += 2;
 1167|    780|        o = dir;
 1168|  10.1k|        for (m = 0; m < ndir; m++)
  ------------------
  |  Branch (1168:21): [True: 9.36k, False: 780]
  ------------------
 1169|  9.36k|        {
 1170|  9.36k|            *(uint16_t *)n = o->tdir_tag;
 1171|  9.36k|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|  9.36k|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (1171:17): [True: 0, False: 9.36k]
  ------------------
 1172|      0|                TIFFSwabShort((uint16_t *)n);
 1173|  9.36k|            n += 2;
 1174|  9.36k|            *(uint16_t *)n = o->tdir_type;
 1175|  9.36k|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|  9.36k|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (1175:17): [True: 0, False: 9.36k]
  ------------------
 1176|      0|                TIFFSwabShort((uint16_t *)n);
 1177|  9.36k|            n += 2;
 1178|  9.36k|            nTmp = (uint32_t)o->tdir_count;
 1179|  9.36k|            _TIFFmemcpy(n, &nTmp, 4);
 1180|  9.36k|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|  9.36k|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (1180:17): [True: 0, False: 9.36k]
  ------------------
 1181|      0|                TIFFSwabLong((uint32_t *)n);
 1182|  9.36k|            n += 4;
 1183|       |            /* This is correct. The data has been */
 1184|       |            /* swabbed previously in TIFFWriteDirectoryTagData */
 1185|  9.36k|            _TIFFmemcpy(n, &o->tdir_offset, 4);
 1186|  9.36k|            n += 4;
 1187|  9.36k|            o++;
 1188|  9.36k|        }
 1189|    780|        nTmp = (uint32_t)tif->tif_nextdiroff;
 1190|    780|        if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|    780|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (1190:13): [True: 0, False: 780]
  ------------------
 1191|      0|            TIFFSwabLong(&nTmp);
 1192|    780|        _TIFFmemcpy(n, &nTmp, 4);
 1193|    780|    }
 1194|      0|    else
 1195|      0|    {
 1196|      0|        uint8_t *n;
 1197|      0|        TIFFDirEntry *o;
 1198|      0|        n = dirmem;
 1199|      0|        *(uint64_t *)n = ndir;
 1200|      0|        if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (1200:13): [True: 0, False: 0]
  ------------------
 1201|      0|            TIFFSwabLong8((uint64_t *)n);
 1202|      0|        n += 8;
 1203|      0|        o = dir;
 1204|      0|        for (m = 0; m < ndir; m++)
  ------------------
  |  Branch (1204:21): [True: 0, False: 0]
  ------------------
 1205|      0|        {
 1206|      0|            *(uint16_t *)n = o->tdir_tag;
 1207|      0|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (1207:17): [True: 0, False: 0]
  ------------------
 1208|      0|                TIFFSwabShort((uint16_t *)n);
 1209|      0|            n += 2;
 1210|      0|            *(uint16_t *)n = o->tdir_type;
 1211|      0|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (1211:17): [True: 0, False: 0]
  ------------------
 1212|      0|                TIFFSwabShort((uint16_t *)n);
 1213|      0|            n += 2;
 1214|      0|            _TIFFmemcpy(n, &o->tdir_count, 8);
 1215|      0|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (1215:17): [True: 0, False: 0]
  ------------------
 1216|      0|                TIFFSwabLong8((uint64_t *)n);
 1217|      0|            n += 8;
 1218|      0|            _TIFFmemcpy(n, &o->tdir_offset, 8);
 1219|      0|            n += 8;
 1220|      0|            o++;
 1221|      0|        }
 1222|      0|        _TIFFmemcpy(n, &tif->tif_nextdiroff, 8);
 1223|      0|        if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (1223:13): [True: 0, False: 0]
  ------------------
 1224|      0|            TIFFSwabLong8((uint64_t *)n);
 1225|      0|    }
 1226|    780|    _TIFFfreeExt(tif, dir);
 1227|    780|    dir = NULL;
 1228|    780|    if (!SeekOK(tif, tif->tif_diroff))
  ------------------
  |  |  274|    780|#define SeekOK(tif, off) _TIFFSeekOK(tif, off)
  ------------------
  |  Branch (1228:9): [True: 0, False: 780]
  ------------------
 1229|      0|    {
 1230|      0|        TIFFErrorExtR(tif, module, "IO error writing directory");
 1231|      0|        goto bad;
 1232|      0|    }
 1233|    780|    if (!WriteOK(tif, dirmem, (tmsize_t)dirsize))
  ------------------
  |  |  277|    780|#define WriteOK(tif, buf, size) (TIFFWriteFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  257|    780|    ((*(tif)->tif_writeproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (1233:9): [True: 0, False: 780]
  ------------------
 1234|      0|    {
 1235|      0|        TIFFErrorExtR(tif, module, "IO error writing directory");
 1236|      0|        goto bad;
 1237|      0|    }
 1238|    780|    _TIFFfreeExt(tif, dirmem);
 1239|    780|    if (imagedone)
  ------------------
  |  Branch (1239:9): [True: 780, False: 0]
  ------------------
 1240|    780|    {
 1241|    780|        TIFFFreeDirectory(tif);
 1242|    780|        tif->tif_flags &= ~TIFF_DIRTYDIRECT;
  ------------------
  |  |  113|    780|#define TIFF_DIRTYDIRECT 0x00008U /* current directory must be written */
  ------------------
 1243|    780|        tif->tif_flags &= ~TIFF_DIRTYSTRIP;
  ------------------
  |  |  133|    780|#define TIFF_DIRTYSTRIP 0x200000U /* stripoffsets/stripbytecount dirty*/
  ------------------
 1244|    780|        (*tif->tif_cleanup)(tif);
 1245|       |        /*
 1246|       |         * Reset directory-related state for subsequent
 1247|       |         * directories.
 1248|       |         */
 1249|    780|        TIFFCreateDirectory(tif);
 1250|    780|    }
 1251|    780|    return (1);
 1252|      0|bad:
 1253|      0|    if (dir != NULL)
  ------------------
  |  Branch (1253:9): [True: 0, False: 0]
  ------------------
 1254|      0|        _TIFFfreeExt(tif, dir);
 1255|      0|    if (dirmem != NULL)
  ------------------
  |  Branch (1255:9): [True: 0, False: 0]
  ------------------
 1256|      0|        _TIFFfreeExt(tif, dirmem);
 1257|      0|    return (0);
 1258|    780|}
tif_dirwrite.c:TIFFWriteDirectoryTagShortLong:
 1796|  4.68k|{
 1797|  4.68k|    if (dir == NULL)
  ------------------
  |  Branch (1797:9): [True: 2.34k, False: 2.34k]
  ------------------
 1798|  2.34k|    {
 1799|  2.34k|        (*ndir)++;
 1800|  2.34k|        return (1);
 1801|  2.34k|    }
 1802|  2.34k|    if (value <= 0xFFFF)
  ------------------
  |  Branch (1802:9): [True: 2.18k, False: 153]
  ------------------
 1803|  2.18k|        return (TIFFWriteDirectoryTagCheckedShort(tif, ndir, dir, tag,
 1804|  2.18k|                                                  (uint16_t)value));
 1805|    153|    else
 1806|    153|        return (TIFFWriteDirectoryTagCheckedLong(tif, ndir, dir, tag, value));
 1807|  2.34k|}
tif_dirwrite.c:TIFFWriteDirectoryTagCheckedShort:
 2243|  6.08k|{
 2244|  6.08k|    uint16_t m;
 2245|  6.08k|    assert(sizeof(uint16_t) == 2);
 2246|  6.08k|    m = value;
 2247|  6.08k|    if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|  6.08k|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (2247:9): [True: 0, False: 6.08k]
  ------------------
 2248|      0|        TIFFSwabShort(&m);
 2249|  6.08k|    return (
 2250|  6.08k|        TIFFWriteDirectoryTagData(tif, ndir, dir, tag, TIFF_SHORT, 1, 2, &m));
 2251|  6.08k|}
tif_dirwrite.c:TIFFWriteDirectoryTagData:
 2870|  9.36k|{
 2871|  9.36k|    static const char module[] = "TIFFWriteDirectoryTagData";
 2872|  9.36k|    uint32_t m;
 2873|  9.36k|    m = 0;
 2874|  56.1k|    while (m < (*ndir))
  ------------------
  |  Branch (2874:12): [True: 49.1k, False: 7.02k]
  ------------------
 2875|  49.1k|    {
 2876|  49.1k|        assert(dir[m].tdir_tag != tag);
 2877|  49.1k|        if (dir[m].tdir_tag > tag)
  ------------------
  |  Branch (2877:13): [True: 2.34k, False: 46.8k]
  ------------------
 2878|  2.34k|            break;
 2879|  46.8k|        m++;
 2880|  46.8k|    }
 2881|  9.36k|    if (m < (*ndir))
  ------------------
  |  Branch (2881:9): [True: 2.34k, False: 7.02k]
  ------------------
 2882|  2.34k|    {
 2883|  2.34k|        uint32_t n;
 2884|  7.02k|        for (n = *ndir; n > m; n--)
  ------------------
  |  Branch (2884:25): [True: 4.68k, False: 2.34k]
  ------------------
 2885|  4.68k|            dir[n] = dir[n - 1];
 2886|  2.34k|    }
 2887|  9.36k|    dir[m].tdir_tag = tag;
 2888|  9.36k|    dir[m].tdir_type = datatype;
 2889|  9.36k|    dir[m].tdir_count = count;
 2890|  9.36k|    dir[m].tdir_offset.toff_long8 = 0;
 2891|  9.36k|    if (datalength <= ((tif->tif_flags & TIFF_BIGTIFF) ? 0x8U : 0x4U))
  ------------------
  |  |  131|  9.36k|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (2891:9): [True: 9.36k, False: 0]
  |  Branch (2891:24): [True: 0, False: 9.36k]
  ------------------
 2892|  9.36k|    {
 2893|  9.36k|        if (data && datalength)
  ------------------
  |  Branch (2893:13): [True: 9.36k, False: 0]
  |  Branch (2893:21): [True: 9.36k, False: 0]
  ------------------
 2894|  9.36k|        {
 2895|  9.36k|            _TIFFmemcpy(&dir[m].tdir_offset, data, datalength);
 2896|  9.36k|        }
 2897|  9.36k|    }
 2898|      0|    else
 2899|      0|    {
 2900|      0|        uint64_t na, nb;
 2901|      0|        na = tif->tif_dataoff;
 2902|      0|        nb = na + datalength;
 2903|      0|        if (!(tif->tif_flags & TIFF_BIGTIFF))
  ------------------
  |  |  131|      0|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (2903:13): [True: 0, False: 0]
  ------------------
 2904|      0|            nb = (uint32_t)nb;
 2905|      0|        if ((nb < na) || (nb < datalength))
  ------------------
  |  Branch (2905:13): [True: 0, False: 0]
  |  Branch (2905:26): [True: 0, False: 0]
  ------------------
 2906|      0|        {
 2907|      0|            TIFFErrorExtR(tif, module, "Maximum TIFF file size exceeded");
 2908|      0|            return (0);
 2909|      0|        }
 2910|      0|        if (!SeekOK(tif, na))
  ------------------
  |  |  274|      0|#define SeekOK(tif, off) _TIFFSeekOK(tif, off)
  ------------------
  |  Branch (2910:13): [True: 0, False: 0]
  ------------------
 2911|      0|        {
 2912|      0|            TIFFErrorExtR(tif, module, "IO error writing tag data");
 2913|      0|            return (0);
 2914|      0|        }
 2915|      0|        if (datalength >= 0x80000000UL)
  ------------------
  |  Branch (2915:13): [True: 0, False: 0]
  ------------------
 2916|      0|        {
 2917|      0|            TIFFErrorExtR(tif, module,
 2918|      0|                          "libtiff does not allow writing more than 2147483647 "
 2919|      0|                          "bytes in a tag");
 2920|      0|            return (0);
 2921|      0|        }
 2922|      0|        if (!WriteOK(tif, data, (tmsize_t)datalength))
  ------------------
  |  |  277|      0|#define WriteOK(tif, buf, size) (TIFFWriteFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  257|      0|    ((*(tif)->tif_writeproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (2922:13): [True: 0, False: 0]
  ------------------
 2923|      0|        {
 2924|      0|            TIFFErrorExtR(tif, module, "IO error writing tag data");
 2925|      0|            return (0);
 2926|      0|        }
 2927|      0|        tif->tif_dataoff = nb;
 2928|      0|        if (tif->tif_dataoff & 1)
  ------------------
  |  Branch (2928:13): [True: 0, False: 0]
  ------------------
 2929|      0|            tif->tif_dataoff++;
 2930|      0|        if (!(tif->tif_flags & TIFF_BIGTIFF))
  ------------------
  |  |  131|      0|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (2930:13): [True: 0, False: 0]
  ------------------
 2931|      0|        {
 2932|      0|            uint32_t o;
 2933|      0|            o = (uint32_t)na;
 2934|      0|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (2934:17): [True: 0, False: 0]
  ------------------
 2935|      0|                TIFFSwabLong(&o);
 2936|      0|            _TIFFmemcpy(&dir[m].tdir_offset, &o, 4);
 2937|      0|        }
 2938|      0|        else
 2939|      0|        {
 2940|      0|            dir[m].tdir_offset.toff_long8 = na;
 2941|      0|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (2941:17): [True: 0, False: 0]
  ------------------
 2942|      0|                TIFFSwabLong8(&dir[m].tdir_offset.toff_long8);
 2943|      0|        }
 2944|      0|    }
 2945|  9.36k|    (*ndir)++;
 2946|  9.36k|    return (1);
 2947|  9.36k|}
tif_dirwrite.c:TIFFWriteDirectoryTagCheckedLong:
 2282|    153|{
 2283|    153|    uint32_t m;
 2284|    153|    assert(sizeof(uint32_t) == 4);
 2285|    153|    m = value;
 2286|    153|    if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|    153|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (2286:9): [True: 0, False: 153]
  ------------------
 2287|      0|        TIFFSwabLong(&m);
 2288|    153|    return (
 2289|    153|        TIFFWriteDirectoryTagData(tif, ndir, dir, tag, TIFF_LONG, 1, 4, &m));
 2290|    153|}
tif_dirwrite.c:TIFFWriteDirectoryTagShortPerSample:
 1480|  3.12k|{
 1481|  3.12k|    static const char module[] = "TIFFWriteDirectoryTagShortPerSample";
 1482|  3.12k|    uint16_t *m;
 1483|  3.12k|    uint16_t *na;
 1484|  3.12k|    uint16_t nb;
 1485|  3.12k|    int o;
 1486|  3.12k|    if (dir == NULL)
  ------------------
  |  Branch (1486:9): [True: 1.56k, False: 1.56k]
  ------------------
 1487|  1.56k|    {
 1488|  1.56k|        (*ndir)++;
 1489|  1.56k|        return (1);
 1490|  1.56k|    }
 1491|  1.56k|    m = _TIFFmallocExt(tif, tif->tif_dir.td_samplesperpixel * sizeof(uint16_t));
 1492|  1.56k|    if (m == NULL)
  ------------------
  |  Branch (1492:9): [True: 0, False: 1.56k]
  ------------------
 1493|      0|    {
 1494|      0|        TIFFErrorExtR(tif, module, "Out of memory");
 1495|      0|        return (0);
 1496|      0|    }
 1497|  3.12k|    for (na = m, nb = 0; nb < tif->tif_dir.td_samplesperpixel; na++, nb++)
  ------------------
  |  Branch (1497:26): [True: 1.56k, False: 1.56k]
  ------------------
 1498|  1.56k|        *na = value;
 1499|  1.56k|    o = TIFFWriteDirectoryTagCheckedShortArray(
 1500|  1.56k|        tif, ndir, dir, tag, tif->tif_dir.td_samplesperpixel, m);
 1501|  1.56k|    _TIFFfreeExt(tif, m);
 1502|  1.56k|    return (o);
 1503|  1.56k|}
tif_dirwrite.c:TIFFWriteDirectoryTagCheckedShortArray:
 2257|  1.56k|{
 2258|  1.56k|    assert(count < 0x80000000);
 2259|  1.56k|    assert(sizeof(uint16_t) == 2);
 2260|  1.56k|    if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|  1.56k|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (2260:9): [True: 0, False: 1.56k]
  ------------------
 2261|      0|        TIFFSwabArrayOfShort(value, count);
 2262|  1.56k|    return (TIFFWriteDirectoryTagData(tif, ndir, dir, tag, TIFF_SHORT, count,
 2263|  1.56k|                                      count * 2, value));
 2264|  1.56k|}
tif_dirwrite.c:TIFFWriteDirectoryTagShort:
 1455|  7.80k|{
 1456|  7.80k|    if (dir == NULL)
  ------------------
  |  Branch (1456:9): [True: 3.90k, False: 3.90k]
  ------------------
 1457|  3.90k|    {
 1458|  3.90k|        (*ndir)++;
 1459|  3.90k|        return (1);
 1460|  3.90k|    }
 1461|  3.90k|    return (TIFFWriteDirectoryTagCheckedShort(tif, ndir, dir, tag, value));
 1462|  7.80k|}
tif_dirwrite.c:TIFFWriteDirectoryTagLongLong8Array:
 1854|  3.12k|{
 1855|  3.12k|    static const char module[] = "TIFFWriteDirectoryTagLongLong8Array";
 1856|  3.12k|    int o;
 1857|  3.12k|    int write_aslong4;
 1858|       |
 1859|       |    /* is this just a counting pass? */
 1860|  3.12k|    if (dir == NULL)
  ------------------
  |  Branch (1860:9): [True: 1.56k, False: 1.56k]
  ------------------
 1861|  1.56k|    {
 1862|  1.56k|        (*ndir)++;
 1863|  1.56k|        return (1);
 1864|  1.56k|    }
 1865|       |
 1866|  1.56k|    if (tif->tif_dir.td_deferstrilearraywriting)
  ------------------
  |  Branch (1866:9): [True: 0, False: 1.56k]
  ------------------
 1867|      0|    {
 1868|      0|        return TIFFWriteDirectoryTagData(tif, ndir, dir, tag, TIFF_NOTYPE, 0, 0,
 1869|      0|                                         NULL);
 1870|      0|    }
 1871|       |
 1872|  1.56k|    if (tif->tif_flags & TIFF_BIGTIFF)
  ------------------
  |  |  131|  1.56k|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (1872:9): [True: 0, False: 1.56k]
  ------------------
 1873|      0|    {
 1874|      0|        int write_aslong8 = 1;
 1875|       |        /* In the case of ByteCounts array, we may be able to write them on */
 1876|       |        /* LONG if the strip/tilesize is not too big. */
 1877|       |        /* Also do that for count > 1 in the case someone would want to create
 1878|       |         */
 1879|       |        /* a single-strip file with a growing height, in which case using */
 1880|       |        /* LONG8 will be safer. */
 1881|      0|        if (count > 1 && tag == TIFFTAG_STRIPBYTECOUNTS)
  ------------------
  |  |  258|      0|#define TIFFTAG_STRIPBYTECOUNTS 279        /* bytes counts for strips */
  ------------------
  |  Branch (1881:13): [True: 0, False: 0]
  |  Branch (1881:26): [True: 0, False: 0]
  ------------------
 1882|      0|        {
 1883|      0|            write_aslong8 = WriteAsLong8(tif, TIFFStripSize64(tif));
 1884|      0|        }
 1885|      0|        else if (count > 1 && tag == TIFFTAG_TILEBYTECOUNTS)
  ------------------
  |  |  313|      0|#define TIFFTAG_TILEBYTECOUNTS 325         /* !byte counts for tiles */
  ------------------
  |  Branch (1885:18): [True: 0, False: 0]
  |  Branch (1885:31): [True: 0, False: 0]
  ------------------
 1886|      0|        {
 1887|      0|            write_aslong8 = WriteAsLong8(tif, TIFFTileSize64(tif));
 1888|      0|        }
 1889|      0|        if (write_aslong8)
  ------------------
  |  Branch (1889:13): [True: 0, False: 0]
  ------------------
 1890|      0|        {
 1891|      0|            return TIFFWriteDirectoryTagCheckedLong8Array(tif, ndir, dir, tag,
 1892|      0|                                                          count, value);
 1893|      0|        }
 1894|      0|    }
 1895|       |
 1896|  1.56k|    write_aslong4 = 1;
 1897|  1.56k|    if (count > 1 && tag == TIFFTAG_STRIPBYTECOUNTS)
  ------------------
  |  |  258|      0|#define TIFFTAG_STRIPBYTECOUNTS 279        /* bytes counts for strips */
  ------------------
  |  Branch (1897:9): [True: 0, False: 1.56k]
  |  Branch (1897:22): [True: 0, False: 0]
  ------------------
 1898|      0|    {
 1899|      0|        write_aslong4 = WriteAsLong4(tif, TIFFStripSize64(tif));
 1900|      0|    }
 1901|  1.56k|    else if (count > 1 && tag == TIFFTAG_TILEBYTECOUNTS)
  ------------------
  |  |  313|      0|#define TIFFTAG_TILEBYTECOUNTS 325         /* !byte counts for tiles */
  ------------------
  |  Branch (1901:14): [True: 0, False: 1.56k]
  |  Branch (1901:27): [True: 0, False: 0]
  ------------------
 1902|      0|    {
 1903|      0|        write_aslong4 = WriteAsLong4(tif, TIFFTileSize64(tif));
 1904|      0|    }
 1905|  1.56k|    if (write_aslong4)
  ------------------
  |  Branch (1905:9): [True: 1.56k, False: 0]
  ------------------
 1906|  1.56k|    {
 1907|       |        /*
 1908|       |        ** For classic tiff we want to verify everything is in range for LONG
 1909|       |        ** and convert to long format.
 1910|       |        */
 1911|       |
 1912|  1.56k|        uint32_t *p = _TIFFmallocExt(tif, count * sizeof(uint32_t));
 1913|  1.56k|        uint32_t *q;
 1914|  1.56k|        uint64_t *ma;
 1915|  1.56k|        uint32_t mb;
 1916|       |
 1917|  1.56k|        if (p == NULL)
  ------------------
  |  Branch (1917:13): [True: 0, False: 1.56k]
  ------------------
 1918|      0|        {
 1919|      0|            TIFFErrorExtR(tif, module, "Out of memory");
 1920|      0|            return (0);
 1921|      0|        }
 1922|       |
 1923|  3.12k|        for (q = p, ma = value, mb = 0; mb < count; ma++, mb++, q++)
  ------------------
  |  Branch (1923:41): [True: 1.56k, False: 1.56k]
  ------------------
 1924|  1.56k|        {
 1925|  1.56k|            if (*ma > 0xFFFFFFFF)
  ------------------
  |  Branch (1925:17): [True: 0, False: 1.56k]
  ------------------
 1926|      0|            {
 1927|      0|                TIFFErrorExtR(tif, module,
 1928|      0|                              "Attempt to write value larger than 0xFFFFFFFF "
 1929|      0|                              "in LONG array.");
 1930|      0|                _TIFFfreeExt(tif, p);
 1931|      0|                return (0);
 1932|      0|            }
 1933|  1.56k|            *q = (uint32_t)(*ma);
 1934|  1.56k|        }
 1935|       |
 1936|  1.56k|        o = TIFFWriteDirectoryTagCheckedLongArray(tif, ndir, dir, tag, count,
 1937|  1.56k|                                                  p);
 1938|  1.56k|        _TIFFfreeExt(tif, p);
 1939|  1.56k|    }
 1940|      0|    else
 1941|      0|    {
 1942|      0|        uint16_t *p = _TIFFmallocExt(tif, count * sizeof(uint16_t));
 1943|      0|        uint16_t *q;
 1944|      0|        uint64_t *ma;
 1945|      0|        uint32_t mb;
 1946|       |
 1947|      0|        if (p == NULL)
  ------------------
  |  Branch (1947:13): [True: 0, False: 0]
  ------------------
 1948|      0|        {
 1949|      0|            TIFFErrorExtR(tif, module, "Out of memory");
 1950|      0|            return (0);
 1951|      0|        }
 1952|       |
 1953|      0|        for (q = p, ma = value, mb = 0; mb < count; ma++, mb++, q++)
  ------------------
  |  Branch (1953:41): [True: 0, False: 0]
  ------------------
 1954|      0|        {
 1955|      0|            if (*ma > 0xFFFF)
  ------------------
  |  Branch (1955:17): [True: 0, False: 0]
  ------------------
 1956|      0|            {
 1957|       |                /* Should not happen normally given the check we did before */
 1958|      0|                TIFFErrorExtR(tif, module,
 1959|      0|                              "Attempt to write value larger than 0xFFFF in "
 1960|      0|                              "SHORT array.");
 1961|      0|                _TIFFfreeExt(tif, p);
 1962|      0|                return (0);
 1963|      0|            }
 1964|      0|            *q = (uint16_t)(*ma);
 1965|      0|        }
 1966|       |
 1967|      0|        o = TIFFWriteDirectoryTagCheckedShortArray(tif, ndir, dir, tag, count,
 1968|      0|                                                   p);
 1969|      0|        _TIFFfreeExt(tif, p);
 1970|      0|    }
 1971|       |
 1972|  1.56k|    return (o);
 1973|  1.56k|}
tif_dirwrite.c:TIFFWriteDirectoryTagCheckedLongArray:
 2296|  1.56k|{
 2297|  1.56k|    assert(count < 0x40000000);
 2298|  1.56k|    assert(sizeof(uint32_t) == 4);
 2299|  1.56k|    if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|  1.56k|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (2299:9): [True: 0, False: 1.56k]
  ------------------
 2300|      0|        TIFFSwabArrayOfLong(value, count);
 2301|  1.56k|    return (TIFFWriteDirectoryTagData(tif, ndir, dir, tag, TIFF_LONG, count,
 2302|  1.56k|                                      count * 4, value));
 2303|  1.56k|}
tif_dirwrite.c:TIFFLinkDirectory:
 2953|    780|{
 2954|    780|    static const char module[] = "TIFFLinkDirectory";
 2955|       |
 2956|    780|    tif->tif_diroff = (TIFFSeekFile(tif, 0, SEEK_END) + 1) & (~((toff_t)1));
  ------------------
  |  |  259|    780|    ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence)))
  ------------------
 2957|       |
 2958|       |    /*
 2959|       |     * Handle SubIFDs
 2960|       |     */
 2961|    780|    if (tif->tif_flags & TIFF_INSUBIFD)
  ------------------
  |  |  123|    780|#define TIFF_INSUBIFD 0x02000U    /* currently writing a subifd */
  ------------------
  |  Branch (2961:9): [True: 0, False: 780]
  ------------------
 2962|      0|    {
 2963|      0|        if (!(tif->tif_flags & TIFF_BIGTIFF))
  ------------------
  |  |  131|      0|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (2963:13): [True: 0, False: 0]
  ------------------
 2964|      0|        {
 2965|      0|            uint32_t m;
 2966|      0|            m = (uint32_t)tif->tif_diroff;
 2967|      0|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (2967:17): [True: 0, False: 0]
  ------------------
 2968|      0|                TIFFSwabLong(&m);
 2969|      0|            (void)TIFFSeekFile(tif, tif->tif_subifdoff, SEEK_SET);
  ------------------
  |  |  259|      0|    ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence)))
  ------------------
 2970|      0|            if (!WriteOK(tif, &m, 4))
  ------------------
  |  |  277|      0|#define WriteOK(tif, buf, size) (TIFFWriteFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  257|      0|    ((*(tif)->tif_writeproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (2970:17): [True: 0, False: 0]
  ------------------
 2971|      0|            {
 2972|      0|                TIFFErrorExtR(tif, module,
 2973|      0|                              "Error writing SubIFD directory link");
 2974|      0|                return (0);
 2975|      0|            }
 2976|       |            /*
 2977|       |             * Advance to the next SubIFD or, if this is
 2978|       |             * the last one configured, revert back to the
 2979|       |             * normal directory linkage.
 2980|       |             */
 2981|      0|            if (--tif->tif_nsubifd)
  ------------------
  |  Branch (2981:17): [True: 0, False: 0]
  ------------------
 2982|      0|                tif->tif_subifdoff += 4;
 2983|      0|            else
 2984|      0|                tif->tif_flags &= ~TIFF_INSUBIFD;
  ------------------
  |  |  123|      0|#define TIFF_INSUBIFD 0x02000U    /* currently writing a subifd */
  ------------------
 2985|      0|            return (1);
 2986|      0|        }
 2987|      0|        else
 2988|      0|        {
 2989|      0|            uint64_t m;
 2990|      0|            m = tif->tif_diroff;
 2991|      0|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (2991:17): [True: 0, False: 0]
  ------------------
 2992|      0|                TIFFSwabLong8(&m);
 2993|      0|            (void)TIFFSeekFile(tif, tif->tif_subifdoff, SEEK_SET);
  ------------------
  |  |  259|      0|    ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence)))
  ------------------
 2994|      0|            if (!WriteOK(tif, &m, 8))
  ------------------
  |  |  277|      0|#define WriteOK(tif, buf, size) (TIFFWriteFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  257|      0|    ((*(tif)->tif_writeproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (2994:17): [True: 0, False: 0]
  ------------------
 2995|      0|            {
 2996|      0|                TIFFErrorExtR(tif, module,
 2997|      0|                              "Error writing SubIFD directory link");
 2998|      0|                return (0);
 2999|      0|            }
 3000|       |            /*
 3001|       |             * Advance to the next SubIFD or, if this is
 3002|       |             * the last one configured, revert back to the
 3003|       |             * normal directory linkage.
 3004|       |             */
 3005|      0|            if (--tif->tif_nsubifd)
  ------------------
  |  Branch (3005:17): [True: 0, False: 0]
  ------------------
 3006|      0|                tif->tif_subifdoff += 8;
 3007|      0|            else
 3008|      0|                tif->tif_flags &= ~TIFF_INSUBIFD;
  ------------------
  |  |  123|      0|#define TIFF_INSUBIFD 0x02000U    /* currently writing a subifd */
  ------------------
 3009|      0|            return (1);
 3010|      0|        }
 3011|      0|    }
 3012|       |
 3013|    780|    if (!(tif->tif_flags & TIFF_BIGTIFF))
  ------------------
  |  |  131|    780|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (3013:9): [True: 780, False: 0]
  ------------------
 3014|    780|    {
 3015|    780|        uint32_t m;
 3016|    780|        uint32_t nextdir;
 3017|    780|        m = (uint32_t)(tif->tif_diroff);
 3018|    780|        if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|    780|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (3018:13): [True: 0, False: 780]
  ------------------
 3019|      0|            TIFFSwabLong(&m);
 3020|    780|        if (tif->tif_header.classic.tiff_diroff == 0)
  ------------------
  |  Branch (3020:13): [True: 780, False: 0]
  ------------------
 3021|    780|        {
 3022|       |            /*
 3023|       |             * First directory, overwrite offset in header.
 3024|       |             */
 3025|    780|            tif->tif_header.classic.tiff_diroff = (uint32_t)tif->tif_diroff;
 3026|    780|            tif->tif_lastdiroff = tif->tif_diroff;
 3027|    780|            (void)TIFFSeekFile(tif, 4, SEEK_SET);
  ------------------
  |  |  259|    780|    ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence)))
  ------------------
 3028|    780|            if (!WriteOK(tif, &m, 4))
  ------------------
  |  |  277|    780|#define WriteOK(tif, buf, size) (TIFFWriteFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  257|    780|    ((*(tif)->tif_writeproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (3028:17): [True: 0, False: 780]
  ------------------
 3029|      0|            {
 3030|      0|                TIFFErrorExtR(tif, tif->tif_name, "Error writing TIFF header");
 3031|      0|                return (0);
 3032|      0|            }
 3033|    780|            return (1);
 3034|    780|        }
 3035|       |        /*
 3036|       |         * Not the first directory, search to the last and append.
 3037|       |         */
 3038|      0|        if (tif->tif_lastdiroff != 0)
  ------------------
  |  Branch (3038:13): [True: 0, False: 0]
  ------------------
 3039|      0|        {
 3040|      0|            nextdir = (uint32_t)tif->tif_lastdiroff;
 3041|      0|        }
 3042|      0|        else
 3043|      0|        {
 3044|      0|            nextdir = tif->tif_header.classic.tiff_diroff;
 3045|      0|        }
 3046|       |
 3047|      0|        while (1)
  ------------------
  |  Branch (3047:16): [Folded - Ignored]
  ------------------
 3048|      0|        {
 3049|      0|            uint16_t dircount;
 3050|      0|            uint32_t nextnextdir;
 3051|       |
 3052|      0|            if (!SeekOK(tif, nextdir) || !ReadOK(tif, &dircount, 2))
  ------------------
  |  |  274|      0|#define SeekOK(tif, off) _TIFFSeekOK(tif, off)
  ------------------
                          if (!SeekOK(tif, nextdir) || !ReadOK(tif, &dircount, 2))
  ------------------
  |  |  271|      0|#define ReadOK(tif, buf, size) (TIFFReadFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  255|      0|    ((*(tif)->tif_readproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (3052:17): [True: 0, False: 0]
  |  Branch (3052:42): [True: 0, False: 0]
  ------------------
 3053|      0|            {
 3054|      0|                TIFFErrorExtR(tif, module, "Error fetching directory count");
 3055|      0|                return (0);
 3056|      0|            }
 3057|      0|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (3057:17): [True: 0, False: 0]
  ------------------
 3058|      0|                TIFFSwabShort(&dircount);
 3059|      0|            (void)TIFFSeekFile(tif, nextdir + 2 + dircount * 12, SEEK_SET);
  ------------------
  |  |  259|      0|    ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence)))
  ------------------
 3060|      0|            if (!ReadOK(tif, &nextnextdir, 4))
  ------------------
  |  |  271|      0|#define ReadOK(tif, buf, size) (TIFFReadFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  255|      0|    ((*(tif)->tif_readproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (3060:17): [True: 0, False: 0]
  ------------------
 3061|      0|            {
 3062|      0|                TIFFErrorExtR(tif, module, "Error fetching directory link");
 3063|      0|                return (0);
 3064|      0|            }
 3065|      0|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (3065:17): [True: 0, False: 0]
  ------------------
 3066|      0|                TIFFSwabLong(&nextnextdir);
 3067|      0|            if (nextnextdir == 0)
  ------------------
  |  Branch (3067:17): [True: 0, False: 0]
  ------------------
 3068|      0|            {
 3069|      0|                (void)TIFFSeekFile(tif, nextdir + 2 + dircount * 12, SEEK_SET);
  ------------------
  |  |  259|      0|    ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence)))
  ------------------
 3070|      0|                if (!WriteOK(tif, &m, 4))
  ------------------
  |  |  277|      0|#define WriteOK(tif, buf, size) (TIFFWriteFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  257|      0|    ((*(tif)->tif_writeproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (3070:21): [True: 0, False: 0]
  ------------------
 3071|      0|                {
 3072|      0|                    TIFFErrorExtR(tif, module, "Error writing directory link");
 3073|      0|                    return (0);
 3074|      0|                }
 3075|      0|                tif->tif_lastdiroff = tif->tif_diroff;
 3076|      0|                break;
 3077|      0|            }
 3078|      0|            nextdir = nextnextdir;
 3079|      0|        }
 3080|      0|    }
 3081|      0|    else
 3082|      0|    {
 3083|      0|        uint64_t m;
 3084|      0|        uint64_t nextdir;
 3085|      0|        m = tif->tif_diroff;
 3086|      0|        if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (3086:13): [True: 0, False: 0]
  ------------------
 3087|      0|            TIFFSwabLong8(&m);
 3088|      0|        if (tif->tif_header.big.tiff_diroff == 0)
  ------------------
  |  Branch (3088:13): [True: 0, False: 0]
  ------------------
 3089|      0|        {
 3090|       |            /*
 3091|       |             * First directory, overwrite offset in header.
 3092|       |             */
 3093|      0|            tif->tif_header.big.tiff_diroff = tif->tif_diroff;
 3094|      0|            tif->tif_lastdiroff = tif->tif_diroff;
 3095|      0|            (void)TIFFSeekFile(tif, 8, SEEK_SET);
  ------------------
  |  |  259|      0|    ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence)))
  ------------------
 3096|      0|            if (!WriteOK(tif, &m, 8))
  ------------------
  |  |  277|      0|#define WriteOK(tif, buf, size) (TIFFWriteFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  257|      0|    ((*(tif)->tif_writeproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (3096:17): [True: 0, False: 0]
  ------------------
 3097|      0|            {
 3098|      0|                TIFFErrorExtR(tif, tif->tif_name, "Error writing TIFF header");
 3099|      0|                return (0);
 3100|      0|            }
 3101|      0|            return (1);
 3102|      0|        }
 3103|       |        /*
 3104|       |         * Not the first directory, search to the last and append.
 3105|       |         */
 3106|      0|        if (tif->tif_lastdiroff != 0)
  ------------------
  |  Branch (3106:13): [True: 0, False: 0]
  ------------------
 3107|      0|        {
 3108|      0|            nextdir = tif->tif_lastdiroff;
 3109|      0|        }
 3110|      0|        else
 3111|      0|        {
 3112|      0|            nextdir = tif->tif_header.big.tiff_diroff;
 3113|      0|        }
 3114|      0|        while (1)
  ------------------
  |  Branch (3114:16): [Folded - Ignored]
  ------------------
 3115|      0|        {
 3116|      0|            uint64_t dircount64;
 3117|      0|            uint16_t dircount;
 3118|      0|            uint64_t nextnextdir;
 3119|       |
 3120|      0|            if (!SeekOK(tif, nextdir) || !ReadOK(tif, &dircount64, 8))
  ------------------
  |  |  274|      0|#define SeekOK(tif, off) _TIFFSeekOK(tif, off)
  ------------------
                          if (!SeekOK(tif, nextdir) || !ReadOK(tif, &dircount64, 8))
  ------------------
  |  |  271|      0|#define ReadOK(tif, buf, size) (TIFFReadFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  255|      0|    ((*(tif)->tif_readproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (3120:17): [True: 0, False: 0]
  |  Branch (3120:42): [True: 0, False: 0]
  ------------------
 3121|      0|            {
 3122|      0|                TIFFErrorExtR(tif, module, "Error fetching directory count");
 3123|      0|                return (0);
 3124|      0|            }
 3125|      0|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (3125:17): [True: 0, False: 0]
  ------------------
 3126|      0|                TIFFSwabLong8(&dircount64);
 3127|      0|            if (dircount64 > 0xFFFF)
  ------------------
  |  Branch (3127:17): [True: 0, False: 0]
  ------------------
 3128|      0|            {
 3129|      0|                TIFFErrorExtR(
 3130|      0|                    tif, module,
 3131|      0|                    "Sanity check on tag count failed, likely corrupt TIFF");
 3132|      0|                return (0);
 3133|      0|            }
 3134|      0|            dircount = (uint16_t)dircount64;
 3135|      0|            (void)TIFFSeekFile(tif, nextdir + 8 + dircount * 20, SEEK_SET);
  ------------------
  |  |  259|      0|    ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence)))
  ------------------
 3136|      0|            if (!ReadOK(tif, &nextnextdir, 8))
  ------------------
  |  |  271|      0|#define ReadOK(tif, buf, size) (TIFFReadFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  255|      0|    ((*(tif)->tif_readproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (3136:17): [True: 0, False: 0]
  ------------------
 3137|      0|            {
 3138|      0|                TIFFErrorExtR(tif, module, "Error fetching directory link");
 3139|      0|                return (0);
 3140|      0|            }
 3141|      0|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (3141:17): [True: 0, False: 0]
  ------------------
 3142|      0|                TIFFSwabLong8(&nextnextdir);
 3143|      0|            if (nextnextdir == 0)
  ------------------
  |  Branch (3143:17): [True: 0, False: 0]
  ------------------
 3144|      0|            {
 3145|      0|                (void)TIFFSeekFile(tif, nextdir + 8 + dircount * 20, SEEK_SET);
  ------------------
  |  |  259|      0|    ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence)))
  ------------------
 3146|      0|                if (!WriteOK(tif, &m, 8))
  ------------------
  |  |  277|      0|#define WriteOK(tif, buf, size) (TIFFWriteFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  257|      0|    ((*(tif)->tif_writeproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (3146:21): [True: 0, False: 0]
  ------------------
 3147|      0|                {
 3148|      0|                    TIFFErrorExtR(tif, module, "Error writing directory link");
 3149|      0|                    return (0);
 3150|      0|                }
 3151|      0|                tif->tif_lastdiroff = tif->tif_diroff;
 3152|      0|                break;
 3153|      0|            }
 3154|      0|            nextdir = nextnextdir;
 3155|      0|        }
 3156|      0|    }
 3157|      0|    return (1);
 3158|    780|}

TIFFInitDumpMode:
  111|  1.56k|{
  112|  1.56k|    (void)scheme;
  113|  1.56k|    tif->tif_fixuptags = DumpFixupTags;
  114|  1.56k|    tif->tif_decoderow = DumpModeDecode;
  115|  1.56k|    tif->tif_decodestrip = DumpModeDecode;
  116|  1.56k|    tif->tif_decodetile = DumpModeDecode;
  117|  1.56k|    tif->tif_encoderow = DumpModeEncode;
  118|  1.56k|    tif->tif_encodestrip = DumpModeEncode;
  119|  1.56k|    tif->tif_encodetile = DumpModeEncode;
  120|  1.56k|    tif->tif_seek = DumpModeSeek;
  121|  1.56k|    return (1);
  122|  1.56k|}

TIFFSetErrorHandler:
   33|      1|{
   34|      1|    TIFFErrorHandler prev = _TIFFerrorHandler;
   35|      1|    _TIFFerrorHandler = handler;
   36|      1|    return (prev);
   37|      1|}

TIFFFlush:
   31|    780|{
   32|    780|    if (tif->tif_mode == O_RDONLY)
  ------------------
  |  Branch (32:9): [True: 0, False: 780]
  ------------------
   33|      0|        return 1;
   34|       |
   35|    780|    if (!TIFFFlushData(tif))
  ------------------
  |  Branch (35:9): [True: 0, False: 780]
  ------------------
   36|      0|        return (0);
   37|       |
   38|       |    /* In update (r+) mode we try to detect the case where
   39|       |       only the strip/tile map has been altered, and we try to
   40|       |       rewrite only that portion of the directory without
   41|       |       making any other changes */
   42|       |
   43|    780|    if ((tif->tif_flags & TIFF_DIRTYSTRIP) &&
  ------------------
  |  |  133|    780|#define TIFF_DIRTYSTRIP 0x200000U /* stripoffsets/stripbytecount dirty*/
  ------------------
  |  Branch (43:9): [True: 0, False: 780]
  ------------------
   44|    780|        !(tif->tif_flags & TIFF_DIRTYDIRECT) && tif->tif_mode == O_RDWR)
  ------------------
  |  |  113|      0|#define TIFF_DIRTYDIRECT 0x00008U /* current directory must be written */
  ------------------
  |  Branch (44:9): [True: 0, False: 0]
  |  Branch (44:49): [True: 0, False: 0]
  ------------------
   45|      0|    {
   46|      0|        if (TIFFForceStrileArrayWriting(tif))
  ------------------
  |  Branch (46:13): [True: 0, False: 0]
  ------------------
   47|      0|            return 1;
   48|      0|    }
   49|       |
   50|    780|    if ((tif->tif_flags & (TIFF_DIRTYDIRECT | TIFF_DIRTYSTRIP)) &&
  ------------------
  |  |  113|    780|#define TIFF_DIRTYDIRECT 0x00008U /* current directory must be written */
  ------------------
                  if ((tif->tif_flags & (TIFF_DIRTYDIRECT | TIFF_DIRTYSTRIP)) &&
  ------------------
  |  |  133|    780|#define TIFF_DIRTYSTRIP 0x200000U /* stripoffsets/stripbytecount dirty*/
  ------------------
  |  Branch (50:9): [True: 0, False: 780]
  ------------------
   51|    780|        !TIFFRewriteDirectory(tif))
  ------------------
  |  Branch (51:9): [True: 0, False: 0]
  ------------------
   52|      0|        return (0);
   53|       |
   54|    780|    return (1);
   55|    780|}
TIFFFlushData:
  147|  1.56k|{
  148|  1.56k|    if ((tif->tif_flags & TIFF_BEENWRITING) == 0)
  ------------------
  |  |  116|  1.56k|#define TIFF_BEENWRITING 0x00040U /* written 1+ scanlines to file */
  ------------------
  |  Branch (148:9): [True: 780, False: 780]
  ------------------
  149|    780|        return (1);
  150|    780|    if (tif->tif_flags & TIFF_POSTENCODE)
  ------------------
  |  |  122|    780|#define TIFF_POSTENCODE 0x01000U  /* need call to postencode routine */
  ------------------
  |  Branch (150:9): [True: 0, False: 780]
  ------------------
  151|      0|    {
  152|      0|        tif->tif_flags &= ~TIFF_POSTENCODE;
  ------------------
  |  |  122|      0|#define TIFF_POSTENCODE 0x01000U  /* need call to postencode routine */
  ------------------
  153|      0|        if (!(*tif->tif_postencode)(tif))
  ------------------
  |  Branch (153:13): [True: 0, False: 0]
  ------------------
  154|      0|            return (0);
  155|      0|    }
  156|    780|    return (TIFFFlushData1(tif));
  157|    780|}

TIFFInitLZW:
 1397|    780|{
 1398|    780|    static const char module[] = "TIFFInitLZW";
 1399|    780|    (void)scheme;
 1400|    780|    assert(scheme == COMPRESSION_LZW);
 1401|       |    /*
 1402|       |     * Allocate state block so tag methods have storage to record values.
 1403|       |     */
 1404|    780|    tif->tif_data = (uint8_t *)_TIFFmallocExt(tif, sizeof(LZWCodecState));
 1405|    780|    if (tif->tif_data == NULL)
  ------------------
  |  Branch (1405:9): [True: 0, False: 780]
  ------------------
 1406|      0|        goto bad;
 1407|    780|    DecoderState(tif)->dec_codetab = NULL;
  ------------------
  |  |  164|    780|#define DecoderState(tif) ((LZWCodecState *)LZWState(tif))
  |  |  ------------------
  |  |  |  |  163|    780|#define LZWState(tif) ((LZWBaseState *)(tif)->tif_data)
  |  |  ------------------
  ------------------
 1408|    780|    DecoderState(tif)->dec_decode = NULL;
  ------------------
  |  |  164|    780|#define DecoderState(tif) ((LZWCodecState *)LZWState(tif))
  |  |  ------------------
  |  |  |  |  163|    780|#define LZWState(tif) ((LZWBaseState *)(tif)->tif_data)
  |  |  ------------------
  ------------------
 1409|    780|    EncoderState(tif)->enc_hashtab = NULL;
  ------------------
  |  |  165|    780|#define EncoderState(tif) ((LZWCodecState *)LZWState(tif))
  |  |  ------------------
  |  |  |  |  163|    780|#define LZWState(tif) ((LZWBaseState *)(tif)->tif_data)
  |  |  ------------------
  ------------------
 1410|    780|    LZWState(tif)->rw_mode = tif->tif_mode;
  ------------------
  |  |  163|    780|#define LZWState(tif) ((LZWBaseState *)(tif)->tif_data)
  ------------------
 1411|       |
 1412|       |    /*
 1413|       |     * Install codec methods.
 1414|       |     */
 1415|    780|    tif->tif_fixuptags = LZWFixupTags;
 1416|    780|    tif->tif_setupdecode = LZWSetupDecode;
 1417|    780|    tif->tif_predecode = LZWPreDecode;
 1418|    780|    tif->tif_decoderow = LZWDecode;
 1419|    780|    tif->tif_decodestrip = LZWDecode;
 1420|    780|    tif->tif_decodetile = LZWDecode;
 1421|    780|    tif->tif_setupencode = LZWSetupEncode;
 1422|    780|    tif->tif_preencode = LZWPreEncode;
 1423|    780|    tif->tif_postencode = LZWPostEncode;
 1424|    780|    tif->tif_encoderow = LZWEncode;
 1425|    780|    tif->tif_encodestrip = LZWEncode;
 1426|    780|    tif->tif_encodetile = LZWEncode;
 1427|    780|    tif->tif_cleanup = LZWCleanup;
 1428|       |    /*
 1429|       |     * Setup predictor setup.
 1430|       |     */
 1431|    780|    (void)TIFFPredictorInit(tif);
 1432|    780|    return (1);
 1433|      0|bad:
 1434|      0|    TIFFErrorExtR(tif, module, "No space for LZW state block");
 1435|      0|    return (0);
 1436|    780|}
tif_lzw.c:LZWSetupEncode:
 1027|    780|{
 1028|    780|    static const char module[] = "LZWSetupEncode";
 1029|    780|    LZWCodecState *sp = EncoderState(tif);
  ------------------
  |  |  165|    780|#define EncoderState(tif) ((LZWCodecState *)LZWState(tif))
  |  |  ------------------
  |  |  |  |  163|    780|#define LZWState(tif) ((LZWBaseState *)(tif)->tif_data)
  |  |  ------------------
  ------------------
 1030|       |
 1031|    780|    assert(sp != NULL);
 1032|    780|    sp->enc_hashtab = (hash_t *)_TIFFmallocExt(tif, HSIZE * sizeof(hash_t));
  ------------------
  |  |   75|    780|#define HSIZE 9001L /* 91% occupancy */
  ------------------
 1033|    780|    if (sp->enc_hashtab == NULL)
  ------------------
  |  Branch (1033:9): [True: 0, False: 780]
  ------------------
 1034|      0|    {
 1035|      0|        TIFFErrorExtR(tif, module, "No space for LZW hash table");
 1036|      0|        return (0);
 1037|      0|    }
 1038|    780|    return (1);
 1039|    780|}
tif_lzw.c:LZWPreEncode:
 1045|    780|{
 1046|    780|    LZWCodecState *sp = EncoderState(tif);
  ------------------
  |  |  165|    780|#define EncoderState(tif) ((LZWCodecState *)LZWState(tif))
  |  |  ------------------
  |  |  |  |  163|    780|#define LZWState(tif) ((LZWBaseState *)(tif)->tif_data)
  |  |  ------------------
  ------------------
 1047|       |
 1048|    780|    (void)s;
 1049|    780|    assert(sp != NULL);
 1050|       |
 1051|    780|    if (sp->enc_hashtab == NULL)
  ------------------
  |  Branch (1051:9): [True: 0, False: 780]
  ------------------
 1052|      0|    {
 1053|      0|        tif->tif_setupencode(tif);
 1054|      0|    }
 1055|       |
 1056|    780|    sp->lzw_nbits = BITS_MIN;
  ------------------
  |  |  102|    780|#define lzw_nbits base.nbits
  ------------------
                  sp->lzw_nbits = BITS_MIN;
  ------------------
  |  |   68|    780|#define BITS_MIN 9  /* start with 9 bits */
  ------------------
 1057|    780|    sp->lzw_maxcode = MAXCODE(BITS_MIN);
  ------------------
  |  |  103|    780|#define lzw_maxcode base.maxcode
  ------------------
                  sp->lzw_maxcode = MAXCODE(BITS_MIN);
  ------------------
  |  |   63|    780|#define MAXCODE(n) ((1L << (n)) - 1)
  ------------------
 1058|    780|    sp->lzw_free_ent = CODE_FIRST;
  ------------------
  |  |  104|    780|#define lzw_free_ent base.free_ent
  ------------------
                  sp->lzw_free_ent = CODE_FIRST;
  ------------------
  |  |   73|    780|#define CODE_FIRST 258 /* first free code entry */
  ------------------
 1059|    780|    sp->lzw_nextbits = 0;
  ------------------
  |  |  106|    780|#define lzw_nextbits base.nextbits
  ------------------
 1060|    780|    sp->lzw_nextdata = 0;
  ------------------
  |  |  105|    780|#define lzw_nextdata base.nextdata
  ------------------
 1061|    780|    sp->enc_checkpoint = CHECK_GAP;
  ------------------
  |  |  155|    780|#define CHECK_GAP 10000      /* enc_ratio check interval */
  ------------------
 1062|    780|    sp->enc_ratio = 0;
 1063|    780|    sp->enc_incount = 0;
 1064|    780|    sp->enc_outcount = 0;
 1065|       |    /*
 1066|       |     * The 4 here insures there is space for 2 max-sized
 1067|       |     * codes in LZWEncode and LZWPostDecode.
 1068|       |     */
 1069|    780|    sp->enc_rawlimit = tif->tif_rawdata + tif->tif_rawdatasize - 1 - 4;
 1070|    780|    cl_hash(sp);                   /* clear hash table */
 1071|    780|    sp->enc_oldcode = (hcode_t)-1; /* generates CODE_CLEAR in LZWEncode */
 1072|    780|    return (1);
 1073|    780|}
tif_lzw.c:cl_hash:
 1357|  11.1k|{
 1358|  11.1k|    register hash_t *hp = &sp->enc_hashtab[HSIZE - 1];
  ------------------
  |  |   75|  11.1k|#define HSIZE 9001L /* 91% occupancy */
  ------------------
 1359|  11.1k|    register long i = HSIZE - 8;
  ------------------
  |  |   75|  11.1k|#define HSIZE 9001L /* 91% occupancy */
  ------------------
 1360|       |
 1361|  11.1k|    do
 1362|  12.5M|    {
 1363|  12.5M|        i -= 8;
 1364|  12.5M|        hp[-7].hash = -1;
 1365|  12.5M|        hp[-6].hash = -1;
 1366|  12.5M|        hp[-5].hash = -1;
 1367|  12.5M|        hp[-4].hash = -1;
 1368|  12.5M|        hp[-3].hash = -1;
 1369|  12.5M|        hp[-2].hash = -1;
 1370|  12.5M|        hp[-1].hash = -1;
 1371|  12.5M|        hp[0].hash = -1;
 1372|  12.5M|        hp -= 8;
 1373|  12.5M|    } while (i >= 0);
  ------------------
  |  Branch (1373:14): [True: 12.5M, False: 11.1k]
  ------------------
 1374|  22.3k|    for (i += 8; i > 0; i--, hp--)
  ------------------
  |  Branch (1374:18): [True: 11.1k, False: 11.1k]
  ------------------
 1375|  11.1k|        hp->hash = -1;
 1376|  11.1k|}
tif_lzw.c:LZWPostEncode:
 1301|    780|{
 1302|    780|    register LZWCodecState *sp = EncoderState(tif);
  ------------------
  |  |  165|    780|#define EncoderState(tif) ((LZWCodecState *)LZWState(tif))
  |  |  ------------------
  |  |  |  |  163|    780|#define LZWState(tif) ((LZWBaseState *)(tif)->tif_data)
  |  |  ------------------
  ------------------
 1303|    780|    uint8_t *op = tif->tif_rawcp;
 1304|    780|    long nextbits = sp->lzw_nextbits;
  ------------------
  |  |  106|    780|#define lzw_nextbits base.nextbits
  ------------------
 1305|    780|    WordType nextdata = sp->lzw_nextdata;
  ------------------
  |  |  105|    780|#define lzw_nextdata base.nextdata
  ------------------
 1306|    780|    tmsize_t outcount = sp->enc_outcount;
 1307|    780|    int nbits = sp->lzw_nbits;
  ------------------
  |  |  102|    780|#define lzw_nbits base.nbits
  ------------------
 1308|       |
 1309|    780|    if (op > sp->enc_rawlimit)
  ------------------
  |  Branch (1309:9): [True: 16, False: 764]
  ------------------
 1310|     16|    {
 1311|     16|        tif->tif_rawcc = (tmsize_t)(op - tif->tif_rawdata);
 1312|     16|        if (!TIFFFlushData1(tif))
  ------------------
  |  Branch (1312:13): [True: 0, False: 16]
  ------------------
 1313|      0|            return 0;
 1314|     16|        op = tif->tif_rawdata;
 1315|     16|    }
 1316|    780|    if (sp->enc_oldcode != (hcode_t)-1)
  ------------------
  |  Branch (1316:9): [True: 780, False: 0]
  ------------------
 1317|    780|    {
 1318|    780|        int free_ent = sp->lzw_free_ent;
  ------------------
  |  |  104|    780|#define lzw_free_ent base.free_ent
  ------------------
 1319|       |
 1320|    780|        PutNextCode(op, sp->enc_oldcode);
  ------------------
  |  | 1088|    780|    {                                                                          \
  |  | 1089|    780|        nextdata = (nextdata << nbits) | c;                                    \
  |  | 1090|    780|        nextbits += nbits;                                                     \
  |  | 1091|    780|        *op++ = (unsigned char)((nextdata >> (nextbits - 8)) & 0xff);          \
  |  | 1092|    780|        nextbits -= 8;                                                         \
  |  | 1093|    780|        if (nextbits >= 8)                                                     \
  |  |  ------------------
  |  |  |  Branch (1093:13): [True: 218, False: 562]
  |  |  ------------------
  |  | 1094|    780|        {                                                                      \
  |  | 1095|    218|            *op++ = (unsigned char)((nextdata >> (nextbits - 8)) & 0xff);      \
  |  | 1096|    218|            nextbits -= 8;                                                     \
  |  | 1097|    218|        }                                                                      \
  |  | 1098|    780|        outcount += nbits;                                                     \
  |  | 1099|    780|    }
  ------------------
 1321|    780|        sp->enc_oldcode = (hcode_t)-1;
 1322|    780|        free_ent++;
 1323|       |
 1324|    780|        if (free_ent == CODE_MAX - 1)
  ------------------
  |  |   74|    780|#define CODE_MAX MAXCODE(BITS_MAX)
  |  |  ------------------
  |  |  |  |   63|    780|#define MAXCODE(n) ((1L << (n)) - 1)
  |  |  ------------------
  ------------------
  |  Branch (1324:13): [True: 8, False: 772]
  ------------------
 1325|      8|        {
 1326|       |            /* table is full, emit clear code and reset */
 1327|      8|            outcount = 0;
 1328|      8|            PutNextCode(op, CODE_CLEAR);
  ------------------
  |  | 1088|      8|    {                                                                          \
  |  | 1089|      8|        nextdata = (nextdata << nbits) | c;                                    \
  |  | 1090|      8|        nextbits += nbits;                                                     \
  |  | 1091|      8|        *op++ = (unsigned char)((nextdata >> (nextbits - 8)) & 0xff);          \
  |  | 1092|      8|        nextbits -= 8;                                                         \
  |  | 1093|      8|        if (nextbits >= 8)                                                     \
  |  |  ------------------
  |  |  |  Branch (1093:13): [True: 4, False: 4]
  |  |  ------------------
  |  | 1094|      8|        {                                                                      \
  |  | 1095|      4|            *op++ = (unsigned char)((nextdata >> (nextbits - 8)) & 0xff);      \
  |  | 1096|      4|            nextbits -= 8;                                                     \
  |  | 1097|      4|        }                                                                      \
  |  | 1098|      8|        outcount += nbits;                                                     \
  |  | 1099|      8|    }
  ------------------
 1329|      8|            nbits = BITS_MIN;
  ------------------
  |  |   68|      8|#define BITS_MIN 9  /* start with 9 bits */
  ------------------
 1330|      8|        }
 1331|    772|        else
 1332|    772|        {
 1333|       |            /*
 1334|       |             * If the next entry is going to be too big for
 1335|       |             * the code size, then increase it, if possible.
 1336|       |             */
 1337|    772|            if (free_ent > sp->lzw_maxcode)
  ------------------
  |  |  103|    772|#define lzw_maxcode base.maxcode
  ------------------
  |  Branch (1337:17): [True: 2, False: 770]
  ------------------
 1338|      2|            {
 1339|      2|                nbits++;
 1340|      2|                assert(nbits <= BITS_MAX);
 1341|      2|            }
 1342|    772|        }
 1343|    780|    }
 1344|    780|    PutNextCode(op, CODE_EOI);
  ------------------
  |  | 1088|    780|    {                                                                          \
  |  | 1089|    780|        nextdata = (nextdata << nbits) | c;                                    \
  |  | 1090|    780|        nextbits += nbits;                                                     \
  |  | 1091|    780|        *op++ = (unsigned char)((nextdata >> (nextbits - 8)) & 0xff);          \
  |  | 1092|    780|        nextbits -= 8;                                                         \
  |  | 1093|    780|        if (nextbits >= 8)                                                     \
  |  |  ------------------
  |  |  |  Branch (1093:13): [True: 231, False: 549]
  |  |  ------------------
  |  | 1094|    780|        {                                                                      \
  |  | 1095|    231|            *op++ = (unsigned char)((nextdata >> (nextbits - 8)) & 0xff);      \
  |  | 1096|    231|            nextbits -= 8;                                                     \
  |  | 1097|    231|        }                                                                      \
  |  | 1098|    780|        outcount += nbits;                                                     \
  |  | 1099|    780|    }
  ------------------
 1345|       |    /* Explicit 0xff masking to make icc -check=conversions happy */
 1346|    780|    if (nextbits > 0)
  ------------------
  |  Branch (1346:9): [True: 709, False: 71]
  ------------------
 1347|    709|        *op++ = (unsigned char)((nextdata << (8 - nextbits)) & 0xff);
 1348|    780|    tif->tif_rawcc = (tmsize_t)(op - tif->tif_rawdata);
 1349|    780|    (void)outcount;
 1350|    780|    return (1);
 1351|    780|}
tif_lzw.c:LZWEncode:
 1116|    780|{
 1117|    780|    register LZWCodecState *sp = EncoderState(tif);
  ------------------
  |  |  165|    780|#define EncoderState(tif) ((LZWCodecState *)LZWState(tif))
  |  |  ------------------
  |  |  |  |  163|    780|#define LZWState(tif) ((LZWBaseState *)(tif)->tif_data)
  |  |  ------------------
  ------------------
 1118|    780|    register long fcode;
 1119|    780|    register hash_t *hp;
 1120|    780|    register int h, c;
 1121|    780|    hcode_t ent;
 1122|    780|    long disp;
 1123|    780|    tmsize_t incount, outcount, checkpoint;
 1124|    780|    WordType nextdata;
 1125|    780|    long nextbits;
 1126|    780|    int free_ent, maxcode, nbits;
 1127|    780|    uint8_t *op;
 1128|    780|    uint8_t *limit;
 1129|       |
 1130|    780|    (void)s;
 1131|    780|    if (sp == NULL)
  ------------------
  |  Branch (1131:9): [True: 0, False: 780]
  ------------------
 1132|      0|        return (0);
 1133|       |
 1134|    780|    assert(sp->enc_hashtab != NULL);
 1135|       |
 1136|       |    /*
 1137|       |     * Load local state.
 1138|       |     */
 1139|    780|    incount = sp->enc_incount;
 1140|    780|    outcount = sp->enc_outcount;
 1141|    780|    checkpoint = sp->enc_checkpoint;
 1142|    780|    nextdata = sp->lzw_nextdata;
  ------------------
  |  |  105|    780|#define lzw_nextdata base.nextdata
  ------------------
 1143|    780|    nextbits = sp->lzw_nextbits;
  ------------------
  |  |  106|    780|#define lzw_nextbits base.nextbits
  ------------------
 1144|    780|    free_ent = sp->lzw_free_ent;
  ------------------
  |  |  104|    780|#define lzw_free_ent base.free_ent
  ------------------
 1145|    780|    maxcode = sp->lzw_maxcode;
  ------------------
  |  |  103|    780|#define lzw_maxcode base.maxcode
  ------------------
 1146|    780|    nbits = sp->lzw_nbits;
  ------------------
  |  |  102|    780|#define lzw_nbits base.nbits
  ------------------
 1147|    780|    op = tif->tif_rawcp;
 1148|    780|    limit = sp->enc_rawlimit;
 1149|    780|    ent = (hcode_t)sp->enc_oldcode;
 1150|       |
 1151|    780|    if (ent == (hcode_t)-1 && cc > 0)
  ------------------
  |  Branch (1151:9): [True: 780, False: 0]
  |  Branch (1151:31): [True: 780, False: 0]
  ------------------
 1152|    780|    {
 1153|       |        /*
 1154|       |         * NB: This is safe because it can only happen
 1155|       |         *     at the start of a strip where we know there
 1156|       |         *     is space in the data buffer.
 1157|       |         */
 1158|    780|        PutNextCode(op, CODE_CLEAR);
  ------------------
  |  | 1088|    780|    {                                                                          \
  |  | 1089|    780|        nextdata = (nextdata << nbits) | c;                                    \
  |  | 1090|    780|        nextbits += nbits;                                                     \
  |  | 1091|    780|        *op++ = (unsigned char)((nextdata >> (nextbits - 8)) & 0xff);          \
  |  | 1092|    780|        nextbits -= 8;                                                         \
  |  | 1093|    780|        if (nextbits >= 8)                                                     \
  |  |  ------------------
  |  |  |  Branch (1093:13): [True: 0, False: 780]
  |  |  ------------------
  |  | 1094|    780|        {                                                                      \
  |  | 1095|      0|            *op++ = (unsigned char)((nextdata >> (nextbits - 8)) & 0xff);      \
  |  | 1096|      0|            nextbits -= 8;                                                     \
  |  | 1097|      0|        }                                                                      \
  |  | 1098|    780|        outcount += nbits;                                                     \
  |  | 1099|    780|    }
  ------------------
 1159|    780|        ent = *bp++;
 1160|    780|        cc--;
 1161|    780|        incount++;
 1162|    780|    }
 1163|  71.9M|    while (cc > 0)
  ------------------
  |  Branch (1163:12): [True: 71.9M, False: 780]
  ------------------
 1164|  71.9M|    {
 1165|  71.9M|        c = *bp++;
 1166|  71.9M|        cc--;
 1167|  71.9M|        incount++;
 1168|  71.9M|        fcode = ((long)c << BITS_MAX) + ent;
  ------------------
  |  |   69|  71.9M|#define BITS_MAX 12 /* max of 12 bit strings */
  ------------------
 1169|  71.9M|        h = (c << HSHIFT) ^ ent; /* xor hashing */
  ------------------
  |  |   76|  71.9M|#define HSHIFT (13 - 8)
  ------------------
 1170|       |#ifdef _WINDOWS
 1171|       |        /*
 1172|       |         * Check hash index for an overflow.
 1173|       |         */
 1174|       |        if (h >= HSIZE)
 1175|       |            h -= HSIZE;
 1176|       |#endif
 1177|  71.9M|        hp = &sp->enc_hashtab[h];
 1178|  71.9M|        if (hp->hash == fcode)
  ------------------
  |  Branch (1178:13): [True: 29.1M, False: 42.8M]
  ------------------
 1179|  29.1M|        {
 1180|  29.1M|            ent = hp->code;
 1181|  29.1M|            continue;
 1182|  29.1M|        }
 1183|  42.8M|        if (hp->hash >= 0)
  ------------------
  |  Branch (1183:13): [True: 10.8M, False: 32.0M]
  ------------------
 1184|  10.8M|        {
 1185|       |            /*
 1186|       |             * Primary hash failed, check secondary hash.
 1187|       |             */
 1188|  10.8M|            disp = HSIZE - h;
  ------------------
  |  |   75|  10.8M|#define HSIZE 9001L /* 91% occupancy */
  ------------------
 1189|  10.8M|            if (h == 0)
  ------------------
  |  Branch (1189:17): [True: 35.3k, False: 10.7M]
  ------------------
 1190|  35.3k|                disp = 1;
 1191|  10.8M|            do
 1192|  16.5M|            {
 1193|       |                /*
 1194|       |                 * Avoid pointer arithmetic because of
 1195|       |                 * wraparound problems with segments.
 1196|       |                 */
 1197|  16.5M|                if ((h -= disp) < 0)
  ------------------
  |  Branch (1197:21): [True: 10.7M, False: 5.73M]
  ------------------
 1198|  10.7M|                    h += HSIZE;
  ------------------
  |  |   75|  10.7M|#define HSIZE 9001L /* 91% occupancy */
  ------------------
 1199|  16.5M|                hp = &sp->enc_hashtab[h];
 1200|  16.5M|                if (hp->hash == fcode)
  ------------------
  |  Branch (1200:21): [True: 2.37M, False: 14.1M]
  ------------------
 1201|  2.37M|                {
 1202|  2.37M|                    ent = hp->code;
 1203|  2.37M|                    goto hit;
 1204|  2.37M|                }
 1205|  16.5M|            } while (hp->hash >= 0);
  ------------------
  |  Branch (1205:22): [True: 5.70M, False: 8.42M]
  ------------------
 1206|  10.8M|        }
 1207|       |        /*
 1208|       |         * New entry, emit code and add to table.
 1209|       |         */
 1210|       |        /*
 1211|       |         * Verify there is space in the buffer for the code
 1212|       |         * and any potential Clear code that might be emitted
 1213|       |         * below.  The value of limit is setup so that there
 1214|       |         * are at least 4 bytes free--room for 2 codes.
 1215|       |         */
 1216|  40.4M|        if (op > limit)
  ------------------
  |  Branch (1216:13): [True: 193, False: 40.4M]
  ------------------
 1217|    193|        {
 1218|    193|            tif->tif_rawcc = (tmsize_t)(op - tif->tif_rawdata);
 1219|    193|            if (!TIFFFlushData1(tif))
  ------------------
  |  Branch (1219:17): [True: 0, False: 193]
  ------------------
 1220|      0|                return 0;
 1221|    193|            op = tif->tif_rawdata;
 1222|    193|        }
 1223|  40.4M|        PutNextCode(op, ent);
  ------------------
  |  | 1088|  40.4M|    {                                                                          \
  |  | 1089|  40.4M|        nextdata = (nextdata << nbits) | c;                                    \
  |  | 1090|  40.4M|        nextbits += nbits;                                                     \
  |  | 1091|  40.4M|        *op++ = (unsigned char)((nextdata >> (nextbits - 8)) & 0xff);          \
  |  | 1092|  40.4M|        nextbits -= 8;                                                         \
  |  | 1093|  40.4M|        if (nextbits >= 8)                                                     \
  |  |  ------------------
  |  |  |  Branch (1093:13): [True: 16.4M, False: 23.9M]
  |  |  ------------------
  |  | 1094|  40.4M|        {                                                                      \
  |  | 1095|  16.4M|            *op++ = (unsigned char)((nextdata >> (nextbits - 8)) & 0xff);      \
  |  | 1096|  16.4M|            nextbits -= 8;                                                     \
  |  | 1097|  16.4M|        }                                                                      \
  |  | 1098|  40.4M|        outcount += nbits;                                                     \
  |  | 1099|  40.4M|    }
  ------------------
 1224|  40.4M|        ent = (hcode_t)c;
 1225|  40.4M|        hp->code = (hcode_t)(free_ent++);
 1226|  40.4M|        hp->hash = fcode;
 1227|  40.4M|        if (free_ent == CODE_MAX - 1)
  ------------------
  |  |   74|  40.4M|#define CODE_MAX MAXCODE(BITS_MAX)
  |  |  ------------------
  |  |  |  |   63|  40.4M|#define MAXCODE(n) ((1L << (n)) - 1)
  |  |  ------------------
  ------------------
  |  Branch (1227:13): [True: 10.2k, False: 40.4M]
  ------------------
 1228|  10.2k|        {
 1229|       |            /* table is full, emit clear code and reset */
 1230|  10.2k|            cl_hash(sp);
 1231|  10.2k|            sp->enc_ratio = 0;
 1232|  10.2k|            incount = 0;
 1233|  10.2k|            outcount = 0;
 1234|  10.2k|            free_ent = CODE_FIRST;
  ------------------
  |  |   73|  10.2k|#define CODE_FIRST 258 /* first free code entry */
  ------------------
 1235|  10.2k|            PutNextCode(op, CODE_CLEAR);
  ------------------
  |  | 1088|  10.2k|    {                                                                          \
  |  | 1089|  10.2k|        nextdata = (nextdata << nbits) | c;                                    \
  |  | 1090|  10.2k|        nextbits += nbits;                                                     \
  |  | 1091|  10.2k|        *op++ = (unsigned char)((nextdata >> (nextbits - 8)) & 0xff);          \
  |  | 1092|  10.2k|        nextbits -= 8;                                                         \
  |  | 1093|  10.2k|        if (nextbits >= 8)                                                     \
  |  |  ------------------
  |  |  |  Branch (1093:13): [True: 5.14k, False: 5.11k]
  |  |  ------------------
  |  | 1094|  10.2k|        {                                                                      \
  |  | 1095|  5.14k|            *op++ = (unsigned char)((nextdata >> (nextbits - 8)) & 0xff);      \
  |  | 1096|  5.14k|            nextbits -= 8;                                                     \
  |  | 1097|  5.14k|        }                                                                      \
  |  | 1098|  10.2k|        outcount += nbits;                                                     \
  |  | 1099|  10.2k|    }
  ------------------
 1236|  10.2k|            nbits = BITS_MIN;
  ------------------
  |  |   68|  10.2k|#define BITS_MIN 9  /* start with 9 bits */
  ------------------
 1237|  10.2k|            maxcode = MAXCODE(BITS_MIN);
  ------------------
  |  |   63|  10.2k|#define MAXCODE(n) ((1L << (n)) - 1)
  ------------------
 1238|  10.2k|        }
 1239|  40.4M|        else
 1240|  40.4M|        {
 1241|       |            /*
 1242|       |             * If the next entry is going to be too big for
 1243|       |             * the code size, then increase it, if possible.
 1244|       |             */
 1245|  40.4M|            if (free_ent > maxcode)
  ------------------
  |  Branch (1245:17): [True: 32.0k, False: 40.3M]
  ------------------
 1246|  32.0k|            {
 1247|  32.0k|                nbits++;
 1248|  32.0k|                assert(nbits <= BITS_MAX);
 1249|  32.0k|                maxcode = (int)MAXCODE(nbits);
  ------------------
  |  |   63|  32.0k|#define MAXCODE(n) ((1L << (n)) - 1)
  ------------------
 1250|  32.0k|            }
 1251|  40.3M|            else if (incount >= checkpoint)
  ------------------
  |  Branch (1251:22): [True: 1.72k, False: 40.3M]
  ------------------
 1252|  1.72k|            {
 1253|  1.72k|                tmsize_t rat;
 1254|       |                /*
 1255|       |                 * Check compression ratio and, if things seem
 1256|       |                 * to be slipping, clear the hash table and
 1257|       |                 * reset state.  The compression ratio is a
 1258|       |                 * 24+8-bit fractional number.
 1259|       |                 */
 1260|  1.72k|                checkpoint = incount + CHECK_GAP;
  ------------------
  |  |  155|  1.72k|#define CHECK_GAP 10000      /* enc_ratio check interval */
  ------------------
 1261|  1.72k|                CALCRATIO(sp, rat);
  ------------------
  |  | 1076|  1.72k|    {                                                                          \
  |  | 1077|  1.72k|        if (incount > 0x007fffff)                                              \
  |  |  ------------------
  |  |  |  Branch (1077:13): [True: 0, False: 1.72k]
  |  |  ------------------
  |  | 1078|  1.72k|        { /* NB: shift will overflow */                                        \
  |  | 1079|      0|            rat = outcount >> 8;                                               \
  |  | 1080|      0|            rat = (rat == 0 ? 0x7fffffff : incount / rat);                     \
  |  |  ------------------
  |  |  |  Branch (1080:20): [True: 0, False: 0]
  |  |  ------------------
  |  | 1081|      0|        }                                                                      \
  |  | 1082|  1.72k|        else                                                                   \
  |  | 1083|  1.72k|            rat = (incount << 8) / outcount;                                   \
  |  | 1084|  1.72k|    }
  ------------------
 1262|  1.72k|                if (rat <= sp->enc_ratio)
  ------------------
  |  Branch (1262:21): [True: 137, False: 1.58k]
  ------------------
 1263|    137|                {
 1264|    137|                    cl_hash(sp);
 1265|    137|                    sp->enc_ratio = 0;
 1266|    137|                    incount = 0;
 1267|    137|                    outcount = 0;
 1268|    137|                    free_ent = CODE_FIRST;
  ------------------
  |  |   73|    137|#define CODE_FIRST 258 /* first free code entry */
  ------------------
 1269|    137|                    PutNextCode(op, CODE_CLEAR);
  ------------------
  |  | 1088|    137|    {                                                                          \
  |  | 1089|    137|        nextdata = (nextdata << nbits) | c;                                    \
  |  | 1090|    137|        nextbits += nbits;                                                     \
  |  | 1091|    137|        *op++ = (unsigned char)((nextdata >> (nextbits - 8)) & 0xff);          \
  |  | 1092|    137|        nextbits -= 8;                                                         \
  |  | 1093|    137|        if (nextbits >= 8)                                                     \
  |  |  ------------------
  |  |  |  Branch (1093:13): [True: 65, False: 72]
  |  |  ------------------
  |  | 1094|    137|        {                                                                      \
  |  | 1095|     65|            *op++ = (unsigned char)((nextdata >> (nextbits - 8)) & 0xff);      \
  |  | 1096|     65|            nextbits -= 8;                                                     \
  |  | 1097|     65|        }                                                                      \
  |  | 1098|    137|        outcount += nbits;                                                     \
  |  | 1099|    137|    }
  ------------------
 1270|    137|                    nbits = BITS_MIN;
  ------------------
  |  |   68|    137|#define BITS_MIN 9  /* start with 9 bits */
  ------------------
 1271|    137|                    maxcode = MAXCODE(BITS_MIN);
  ------------------
  |  |   63|    137|#define MAXCODE(n) ((1L << (n)) - 1)
  ------------------
 1272|    137|                }
 1273|  1.58k|                else
 1274|  1.58k|                    sp->enc_ratio = rat;
 1275|  1.72k|            }
 1276|  40.4M|        }
 1277|  42.8M|    hit:;
 1278|  42.8M|    }
 1279|       |
 1280|       |    /*
 1281|       |     * Restore global state.
 1282|       |     */
 1283|    780|    sp->enc_incount = incount;
 1284|    780|    sp->enc_outcount = outcount;
 1285|    780|    sp->enc_checkpoint = checkpoint;
 1286|    780|    sp->enc_oldcode = ent;
 1287|    780|    sp->lzw_nextdata = nextdata;
  ------------------
  |  |  105|    780|#define lzw_nextdata base.nextdata
  ------------------
 1288|    780|    sp->lzw_nextbits = nextbits;
  ------------------
  |  |  106|    780|#define lzw_nextbits base.nextbits
  ------------------
 1289|    780|    sp->lzw_free_ent = (unsigned short)free_ent;
  ------------------
  |  |  104|    780|#define lzw_free_ent base.free_ent
  ------------------
 1290|    780|    sp->lzw_maxcode = (unsigned short)maxcode;
  ------------------
  |  |  103|    780|#define lzw_maxcode base.maxcode
  ------------------
 1291|    780|    sp->lzw_nbits = (unsigned short)nbits;
  ------------------
  |  |  102|    780|#define lzw_nbits base.nbits
  ------------------
 1292|    780|    tif->tif_rawcp = op;
 1293|    780|    return (1);
 1294|    780|}
tif_lzw.c:LZWCleanup:
 1379|    780|{
 1380|    780|    (void)TIFFPredictorCleanup(tif);
 1381|       |
 1382|    780|    assert(tif->tif_data != 0);
 1383|       |
 1384|    780|    if (DecoderState(tif)->dec_codetab)
  ------------------
  |  |  164|    780|#define DecoderState(tif) ((LZWCodecState *)LZWState(tif))
  |  |  ------------------
  |  |  |  |  163|    780|#define LZWState(tif) ((LZWBaseState *)(tif)->tif_data)
  |  |  ------------------
  ------------------
  |  Branch (1384:9): [True: 0, False: 780]
  ------------------
 1385|      0|        _TIFFfreeExt(tif, DecoderState(tif)->dec_codetab);
  ------------------
  |  |  164|      0|#define DecoderState(tif) ((LZWCodecState *)LZWState(tif))
  |  |  ------------------
  |  |  |  |  163|      0|#define LZWState(tif) ((LZWBaseState *)(tif)->tif_data)
  |  |  ------------------
  ------------------
 1386|       |
 1387|    780|    if (EncoderState(tif)->enc_hashtab)
  ------------------
  |  |  165|    780|#define EncoderState(tif) ((LZWCodecState *)LZWState(tif))
  |  |  ------------------
  |  |  |  |  163|    780|#define LZWState(tif) ((LZWBaseState *)(tif)->tif_data)
  |  |  ------------------
  ------------------
  |  Branch (1387:9): [True: 780, False: 0]
  ------------------
 1388|    780|        _TIFFfreeExt(tif, EncoderState(tif)->enc_hashtab);
  ------------------
  |  |  165|    780|#define EncoderState(tif) ((LZWCodecState *)LZWState(tif))
  |  |  ------------------
  |  |  |  |  163|    780|#define LZWState(tif) ((LZWBaseState *)(tif)->tif_data)
  |  |  ------------------
  ------------------
 1389|       |
 1390|    780|    _TIFFfreeExt(tif, tif->tif_data);
 1391|    780|    tif->tif_data = NULL;
 1392|       |
 1393|    780|    _TIFFSetDefaultCompressionState(tif);
 1394|    780|}

_TIFFgetMode:
   51|    780|{
   52|    780|    int m = -1;
   53|       |
   54|    780|    switch (mode[0])
   55|    780|    {
   56|      0|        case 'r':
  ------------------
  |  Branch (56:9): [True: 0, False: 780]
  ------------------
   57|      0|            m = O_RDONLY;
   58|      0|            if (mode[1] == '+')
  ------------------
  |  Branch (58:17): [True: 0, False: 0]
  ------------------
   59|      0|                m = O_RDWR;
   60|      0|            break;
   61|    780|        case 'w':
  ------------------
  |  Branch (61:9): [True: 780, False: 0]
  ------------------
   62|    780|        case 'a':
  ------------------
  |  Branch (62:9): [True: 0, False: 780]
  ------------------
   63|    780|            m = O_RDWR | O_CREAT;
   64|    780|            if (mode[0] == 'w')
  ------------------
  |  Branch (64:17): [True: 780, False: 0]
  ------------------
   65|    780|                m |= O_TRUNC;
   66|    780|            break;
   67|      0|        default:
  ------------------
  |  Branch (67:9): [True: 0, False: 780]
  ------------------
   68|      0|            _TIFFErrorEarly(opts, clientdata, module, "\"%s\": Bad mode", mode);
   69|      0|            break;
   70|    780|    }
   71|    780|    return (m);
   72|    780|}
_TIFFmallocExt:
  122|  7.80k|{
  123|  7.80k|    if (tif != NULL && tif->tif_max_single_mem_alloc > 0 &&
  ------------------
  |  Branch (123:9): [True: 7.02k, False: 780]
  |  Branch (123:24): [True: 0, False: 7.02k]
  ------------------
  124|  7.80k|        s > tif->tif_max_single_mem_alloc)
  ------------------
  |  Branch (124:9): [True: 0, False: 0]
  ------------------
  125|      0|    {
  126|      0|        _TIFFEmitErrorAboveMaxSingleMemAlloc(tif, "_TIFFmallocExt", s);
  127|      0|        return NULL;
  128|      0|    }
  129|  7.80k|    return _TIFFmalloc(s);
  130|  7.80k|}
_TIFFreallocExt:
  151|  3.90k|{
  152|  3.90k|    if (tif != NULL && tif->tif_max_single_mem_alloc > 0 &&
  ------------------
  |  Branch (152:9): [True: 3.90k, False: 0]
  |  Branch (152:24): [True: 0, False: 3.90k]
  ------------------
  153|  3.90k|        s > tif->tif_max_single_mem_alloc)
  ------------------
  |  Branch (153:9): [True: 0, False: 0]
  ------------------
  154|      0|    {
  155|      0|        _TIFFEmitErrorAboveMaxSingleMemAlloc(tif, "_TIFFreallocExt", s);
  156|      0|        return NULL;
  157|      0|    }
  158|  3.90k|    return _TIFFrealloc(p, s);
  159|  3.90k|}
_TIFFfreeExt:
  163|  10.9k|{
  164|  10.9k|    (void)tif;
  165|  10.9k|    _TIFFfree(p);
  166|  10.9k|}
TIFFClientOpen:
  173|    780|{
  174|    780|    return TIFFClientOpenExt(name, mode, clientdata, readproc, writeproc,
  175|    780|                             seekproc, closeproc, sizeproc, mapproc, unmapproc,
  176|    780|                             NULL);
  177|    780|}
TIFFClientOpenExt:
  185|    780|{
  186|    780|    static const char module[] = "TIFFClientOpenExt";
  187|    780|    TIFF *tif;
  188|    780|    int m;
  189|    780|    const char *cp;
  190|       |
  191|       |    /* The following are configuration checks. They should be redundant, but
  192|       |     * should not compile to any actual code in an optimised release build
  193|       |     * anyway. If any of them fail, (makefile-based or other) configuration is
  194|       |     * not correct */
  195|    780|    assert(sizeof(uint8_t) == 1);
  196|    780|    assert(sizeof(int8_t) == 1);
  197|    780|    assert(sizeof(uint16_t) == 2);
  198|    780|    assert(sizeof(int16_t) == 2);
  199|    780|    assert(sizeof(uint32_t) == 4);
  200|    780|    assert(sizeof(int32_t) == 4);
  201|    780|    assert(sizeof(uint64_t) == 8);
  202|    780|    assert(sizeof(int64_t) == 8);
  203|    780|    {
  204|    780|        union
  205|    780|        {
  206|    780|            uint8_t a8[2];
  207|    780|            uint16_t a16;
  208|    780|        } n;
  209|    780|        n.a8[0] = 1;
  210|    780|        n.a8[1] = 0;
  211|    780|        (void)n;
  212|       |#ifdef WORDS_BIGENDIAN
  213|       |        assert(n.a16 == 256);
  214|       |#else
  215|    780|        assert(n.a16 == 1);
  216|    780|#endif
  217|    780|    }
  218|       |
  219|    780|    m = _TIFFgetMode(opts, clientdata, mode, module);
  220|    780|    if (m == -1)
  ------------------
  |  Branch (220:9): [True: 0, False: 780]
  ------------------
  221|      0|        goto bad2;
  222|    780|    tmsize_t size_to_alloc = (tmsize_t)(sizeof(TIFF) + strlen(name) + 1);
  223|    780|    if (opts && opts->max_single_mem_alloc > 0 &&
  ------------------
  |  Branch (223:9): [True: 0, False: 780]
  |  Branch (223:17): [True: 0, False: 0]
  ------------------
  224|    780|        size_to_alloc > opts->max_single_mem_alloc)
  ------------------
  |  Branch (224:9): [True: 0, False: 0]
  ------------------
  225|      0|    {
  226|      0|        _TIFFErrorEarly(opts, clientdata, module,
  227|      0|                        "%s: Memory allocation of %" PRIu64
  228|      0|                        " bytes is beyond the %" PRIu64
  229|      0|                        " byte limit defined in open options",
  230|      0|                        name, (uint64_t)size_to_alloc,
  231|      0|                        (uint64_t)opts->max_single_mem_alloc);
  232|      0|        goto bad2;
  233|      0|    }
  234|    780|    tif = (TIFF *)_TIFFmallocExt(NULL, size_to_alloc);
  235|    780|    if (tif == NULL)
  ------------------
  |  Branch (235:9): [True: 0, False: 780]
  ------------------
  236|      0|    {
  237|      0|        _TIFFErrorEarly(opts, clientdata, module,
  238|      0|                        "%s: Out of memory (TIFF structure)", name);
  239|      0|        goto bad2;
  240|      0|    }
  241|    780|    _TIFFmemset(tif, 0, sizeof(*tif));
  242|    780|    tif->tif_name = (char *)tif + sizeof(TIFF);
  243|    780|    strcpy(tif->tif_name, name);
  244|    780|    tif->tif_mode = m & ~(O_CREAT | O_TRUNC);
  245|    780|    tif->tif_curdir = TIFF_NON_EXISTENT_DIR_NUMBER; /* non-existent directory */
  ------------------
  |  |   64|    780|#define TIFF_NON_EXISTENT_DIR_NUMBER UINT_MAX
  ------------------
  246|    780|    tif->tif_curoff = 0;
  247|    780|    tif->tif_curstrip = (uint32_t)-1; /* invalid strip */
  248|    780|    tif->tif_row = (uint32_t)-1;      /* read/write pre-increment */
  249|    780|    tif->tif_clientdata = clientdata;
  250|    780|    tif->tif_readproc = readproc;
  251|    780|    tif->tif_writeproc = writeproc;
  252|    780|    tif->tif_seekproc = seekproc;
  253|    780|    tif->tif_closeproc = closeproc;
  254|    780|    tif->tif_sizeproc = sizeproc;
  255|    780|    tif->tif_mapproc = mapproc ? mapproc : _tiffDummyMapProc;
  ------------------
  |  Branch (255:24): [True: 0, False: 780]
  ------------------
  256|    780|    tif->tif_unmapproc = unmapproc ? unmapproc : _tiffDummyUnmapProc;
  ------------------
  |  Branch (256:26): [True: 0, False: 780]
  ------------------
  257|    780|    if (opts)
  ------------------
  |  Branch (257:9): [True: 0, False: 780]
  ------------------
  258|      0|    {
  259|      0|        tif->tif_errorhandler = opts->errorhandler;
  260|      0|        tif->tif_errorhandler_user_data = opts->errorhandler_user_data;
  261|      0|        tif->tif_warnhandler = opts->warnhandler;
  262|      0|        tif->tif_warnhandler_user_data = opts->warnhandler_user_data;
  263|      0|        tif->tif_max_single_mem_alloc = opts->max_single_mem_alloc;
  264|      0|    }
  265|       |
  266|    780|    if (!readproc || !writeproc || !seekproc || !closeproc || !sizeproc)
  ------------------
  |  Branch (266:9): [True: 0, False: 780]
  |  Branch (266:22): [True: 0, False: 780]
  |  Branch (266:36): [True: 0, False: 780]
  |  Branch (266:49): [True: 0, False: 780]
  |  Branch (266:63): [True: 0, False: 780]
  ------------------
  267|      0|    {
  268|      0|        TIFFErrorExtR(tif, module,
  269|      0|                      "One of the client procedures is NULL pointer.");
  270|      0|        _TIFFfreeExt(NULL, tif);
  271|      0|        goto bad2;
  272|      0|    }
  273|       |
  274|    780|    _TIFFSetDefaultCompressionState(tif); /* setup default state */
  275|       |    /*
  276|       |     * Default is to return data MSB2LSB and enable the
  277|       |     * use of memory-mapped files and strip chopping when
  278|       |     * a file is opened read-only.
  279|       |     */
  280|    780|    tif->tif_flags = FILLORDER_MSB2LSB;
  ------------------
  |  |  240|    780|#define FILLORDER_MSB2LSB 1                /* most significant -> least */
  ------------------
  281|    780|    if (m == O_RDONLY)
  ------------------
  |  Branch (281:9): [True: 0, False: 780]
  ------------------
  282|      0|        tif->tif_flags |= TIFF_MAPPED;
  ------------------
  |  |  121|      0|#define TIFF_MAPPED 0x00800U      /* file is mapped into memory */
  ------------------
  283|       |
  284|       |#ifdef STRIPCHOP_DEFAULT
  285|       |    if (m == O_RDONLY || m == O_RDWR)
  286|       |        tif->tif_flags |= STRIPCHOP_DEFAULT;
  287|       |#endif
  288|       |
  289|       |    /*
  290|       |     * Process library-specific flags in the open mode string.
  291|       |     * The following flags may be used to control intrinsic library
  292|       |     * behavior that may or may not be desirable (usually for
  293|       |     * compatibility with some application that claims to support
  294|       |     * TIFF but only supports some brain dead idea of what the
  295|       |     * vendor thinks TIFF is):
  296|       |     *
  297|       |     * 'l' use little-endian byte order for creating a file
  298|       |     * 'b' use big-endian byte order for creating a file
  299|       |     * 'L' read/write information using LSB2MSB bit order
  300|       |     * 'B' read/write information using MSB2LSB bit order
  301|       |     * 'H' read/write information using host bit order
  302|       |     * 'M' enable use of memory-mapped files when supported
  303|       |     * 'm' disable use of memory-mapped files
  304|       |     * 'C' enable strip chopping support when reading
  305|       |     * 'c' disable strip chopping support
  306|       |     * 'h' read TIFF header only, do not load the first IFD
  307|       |     * '4' ClassicTIFF for creating a file (default)
  308|       |     * '8' BigTIFF for creating a file
  309|       |     * 'D' enable use of deferred strip/tile offset/bytecount array loading.
  310|       |     * 'O' on-demand loading of values instead of whole array loading (implies
  311|       |     * D)
  312|       |     *
  313|       |     * The use of the 'l' and 'b' flags is strongly discouraged.
  314|       |     * These flags are provided solely because numerous vendors,
  315|       |     * typically on the PC, do not correctly support TIFF; they
  316|       |     * only support the Intel little-endian byte order.  This
  317|       |     * support is not configured by default because it supports
  318|       |     * the violation of the TIFF spec that says that readers *MUST*
  319|       |     * support both byte orders.  It is strongly recommended that
  320|       |     * you not use this feature except to deal with busted apps
  321|       |     * that write invalid TIFF.  And even in those cases you should
  322|       |     * bang on the vendors to fix their software.
  323|       |     *
  324|       |     * The 'L', 'B', and 'H' flags are intended for applications
  325|       |     * that can optimize operations on data by using a particular
  326|       |     * bit order.  By default the library returns data in MSB2LSB
  327|       |     * bit order for compatibility with older versions of this
  328|       |     * library.  Returning data in the bit order of the native CPU
  329|       |     * makes the most sense but also requires applications to check
  330|       |     * the value of the FillOrder tag; something they probably do
  331|       |     * not do right now.
  332|       |     *
  333|       |     * The 'M' and 'm' flags are provided because some virtual memory
  334|       |     * systems exhibit poor behavior when large images are mapped.
  335|       |     * These options permit clients to control the use of memory-mapped
  336|       |     * files on a per-file basis.
  337|       |     *
  338|       |     * The 'C' and 'c' flags are provided because the library support
  339|       |     * for chopping up large strips into multiple smaller strips is not
  340|       |     * application-transparent and as such can cause problems.  The 'c'
  341|       |     * option permits applications that only want to look at the tags,
  342|       |     * for example, to get the unadulterated TIFF tag information.
  343|       |     */
  344|  1.56k|    for (cp = mode; *cp; cp++)
  ------------------
  |  Branch (344:21): [True: 780, False: 780]
  ------------------
  345|    780|        switch (*cp)
  ------------------
  |  Branch (345:17): [True: 780, False: 0]
  ------------------
  346|    780|        {
  347|      0|            case 'b':
  ------------------
  |  Branch (347:13): [True: 0, False: 780]
  ------------------
  348|      0|#ifndef WORDS_BIGENDIAN
  349|      0|                if (m & O_CREAT)
  ------------------
  |  Branch (349:21): [True: 0, False: 0]
  ------------------
  350|      0|                    tif->tif_flags |= TIFF_SWAB;
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  351|      0|#endif
  352|      0|                break;
  353|      0|            case 'l':
  ------------------
  |  Branch (353:13): [True: 0, False: 780]
  ------------------
  354|       |#ifdef WORDS_BIGENDIAN
  355|       |                if ((m & O_CREAT))
  356|       |                    tif->tif_flags |= TIFF_SWAB;
  357|       |#endif
  358|      0|                break;
  359|      0|            case 'B':
  ------------------
  |  Branch (359:13): [True: 0, False: 780]
  ------------------
  360|      0|                tif->tif_flags =
  361|      0|                    (tif->tif_flags & ~TIFF_FILLORDER) | FILLORDER_MSB2LSB;
  ------------------
  |  |  111|      0|#define TIFF_FILLORDER 0x00003U   /* natural bit fill order for machine */
  ------------------
                                  (tif->tif_flags & ~TIFF_FILLORDER) | FILLORDER_MSB2LSB;
  ------------------
  |  |  240|      0|#define FILLORDER_MSB2LSB 1                /* most significant -> least */
  ------------------
  362|      0|                break;
  363|      0|            case 'L':
  ------------------
  |  Branch (363:13): [True: 0, False: 780]
  ------------------
  364|      0|                tif->tif_flags =
  365|      0|                    (tif->tif_flags & ~TIFF_FILLORDER) | FILLORDER_LSB2MSB;
  ------------------
  |  |  111|      0|#define TIFF_FILLORDER 0x00003U   /* natural bit fill order for machine */
  ------------------
                                  (tif->tif_flags & ~TIFF_FILLORDER) | FILLORDER_LSB2MSB;
  ------------------
  |  |  241|      0|#define FILLORDER_LSB2MSB 2                /* least significant -> most */
  ------------------
  366|      0|                break;
  367|      0|            case 'H':
  ------------------
  |  Branch (367:13): [True: 0, False: 780]
  ------------------
  368|      0|                TIFFWarningExtR(tif, name,
  369|      0|                                "H(ost) mode is deprecated. Since "
  370|      0|                                "libtiff 4.5.1, it is an alias of 'B' / "
  371|      0|                                "FILLORDER_MSB2LSB.");
  372|      0|                tif->tif_flags =
  373|      0|                    (tif->tif_flags & ~TIFF_FILLORDER) | FILLORDER_MSB2LSB;
  ------------------
  |  |  111|      0|#define TIFF_FILLORDER 0x00003U   /* natural bit fill order for machine */
  ------------------
                                  (tif->tif_flags & ~TIFF_FILLORDER) | FILLORDER_MSB2LSB;
  ------------------
  |  |  240|      0|#define FILLORDER_MSB2LSB 1                /* most significant -> least */
  ------------------
  374|      0|                break;
  375|      0|            case 'M':
  ------------------
  |  Branch (375:13): [True: 0, False: 780]
  ------------------
  376|      0|                if (m == O_RDONLY)
  ------------------
  |  Branch (376:21): [True: 0, False: 0]
  ------------------
  377|      0|                    tif->tif_flags |= TIFF_MAPPED;
  ------------------
  |  |  121|      0|#define TIFF_MAPPED 0x00800U      /* file is mapped into memory */
  ------------------
  378|      0|                break;
  379|      0|            case 'm':
  ------------------
  |  Branch (379:13): [True: 0, False: 780]
  ------------------
  380|      0|                if (m == O_RDONLY)
  ------------------
  |  Branch (380:21): [True: 0, False: 0]
  ------------------
  381|      0|                    tif->tif_flags &= ~TIFF_MAPPED;
  ------------------
  |  |  121|      0|#define TIFF_MAPPED 0x00800U      /* file is mapped into memory */
  ------------------
  382|      0|                break;
  383|      0|            case 'C':
  ------------------
  |  Branch (383:13): [True: 0, False: 780]
  ------------------
  384|      0|                if (m == O_RDONLY)
  ------------------
  |  Branch (384:21): [True: 0, False: 0]
  ------------------
  385|      0|                    tif->tif_flags |= TIFF_STRIPCHOP;
  ------------------
  |  |  125|      0|#define TIFF_STRIPCHOP 0x08000U   /* enable strip chopping support */
  ------------------
  386|      0|                break;
  387|      0|            case 'c':
  ------------------
  |  Branch (387:13): [True: 0, False: 780]
  ------------------
  388|      0|                if (m == O_RDONLY)
  ------------------
  |  Branch (388:21): [True: 0, False: 0]
  ------------------
  389|      0|                    tif->tif_flags &= ~TIFF_STRIPCHOP;
  ------------------
  |  |  125|      0|#define TIFF_STRIPCHOP 0x08000U   /* enable strip chopping support */
  ------------------
  390|      0|                break;
  391|      0|            case 'h':
  ------------------
  |  Branch (391:13): [True: 0, False: 780]
  ------------------
  392|      0|                tif->tif_flags |= TIFF_HEADERONLY;
  ------------------
  |  |  127|      0|    0x10000U /* read header only, do not process the first directory */
  ------------------
  393|      0|                break;
  394|      0|            case '8':
  ------------------
  |  Branch (394:13): [True: 0, False: 780]
  ------------------
  395|      0|                if (m & O_CREAT)
  ------------------
  |  Branch (395:21): [True: 0, False: 0]
  ------------------
  396|      0|                    tif->tif_flags |= TIFF_BIGTIFF;
  ------------------
  |  |  131|      0|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  397|      0|                break;
  398|      0|            case 'D':
  ------------------
  |  Branch (398:13): [True: 0, False: 780]
  ------------------
  399|      0|                tif->tif_flags |= TIFF_DEFERSTRILELOAD;
  ------------------
  |  |  138|      0|    0x1000000U /* defer strip/tile offset/bytecount array loading. */
  ------------------
  400|      0|                break;
  401|      0|            case 'O':
  ------------------
  |  Branch (401:13): [True: 0, False: 780]
  ------------------
  402|      0|                if (m == O_RDONLY)
  ------------------
  |  Branch (402:21): [True: 0, False: 0]
  ------------------
  403|      0|                    tif->tif_flags |=
  404|      0|                        (TIFF_LAZYSTRILELOAD | TIFF_DEFERSTRILELOAD);
  ------------------
  |  |  140|      0|    0x2000000U /* lazy/ondemand loading of strip/tile offset/bytecount values. \
  ------------------
                                      (TIFF_LAZYSTRILELOAD | TIFF_DEFERSTRILELOAD);
  ------------------
  |  |  138|      0|    0x1000000U /* defer strip/tile offset/bytecount array loading. */
  ------------------
  405|      0|                break;
  406|    780|        }
  407|       |
  408|       |#ifdef DEFER_STRILE_LOAD
  409|       |    /* Compatibility with old DEFER_STRILE_LOAD compilation flag */
  410|       |    /* Probably unneeded, since to the best of my knowledge (E. Rouault) */
  411|       |    /* GDAL was the only user of this, and will now use the new 'D' flag */
  412|       |    tif->tif_flags |= TIFF_DEFERSTRILELOAD;
  413|       |#endif
  414|       |
  415|       |    /*
  416|       |     * Read in TIFF header.
  417|       |     */
  418|    780|    if ((m & O_TRUNC) ||
  ------------------
  |  Branch (418:9): [True: 780, False: 0]
  ------------------
  419|    780|        !ReadOK(tif, &tif->tif_header, sizeof(TIFFHeaderClassic)))
  ------------------
  |  |  271|      0|#define ReadOK(tif, buf, size) (TIFFReadFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  255|      0|    ((*(tif)->tif_readproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (419:9): [True: 0, False: 0]
  ------------------
  420|    780|    {
  421|    780|        if (tif->tif_mode == O_RDONLY)
  ------------------
  |  Branch (421:13): [True: 0, False: 780]
  ------------------
  422|      0|        {
  423|      0|            TIFFErrorExtR(tif, name, "Cannot read TIFF header");
  424|      0|            goto bad;
  425|      0|        }
  426|       |/*
  427|       | * Setup header and write.
  428|       | */
  429|       |#ifdef WORDS_BIGENDIAN
  430|       |        tif->tif_header.common.tiff_magic =
  431|       |            (tif->tif_flags & TIFF_SWAB) ? TIFF_LITTLEENDIAN : TIFF_BIGENDIAN;
  432|       |#else
  433|    780|        tif->tif_header.common.tiff_magic =
  434|    780|            (tif->tif_flags & TIFF_SWAB) ? TIFF_BIGENDIAN : TIFF_LITTLEENDIAN;
  ------------------
  |  |  117|    780|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
                          (tif->tif_flags & TIFF_SWAB) ? TIFF_BIGENDIAN : TIFF_LITTLEENDIAN;
  ------------------
  |  |   51|      0|#define TIFF_BIGENDIAN 0x4d4d
  ------------------
                          (tif->tif_flags & TIFF_SWAB) ? TIFF_BIGENDIAN : TIFF_LITTLEENDIAN;
  ------------------
  |  |   52|  1.56k|#define TIFF_LITTLEENDIAN 0x4949
  ------------------
  |  Branch (434:13): [True: 0, False: 780]
  ------------------
  435|    780|#endif
  436|    780|        if (!(tif->tif_flags & TIFF_BIGTIFF))
  ------------------
  |  |  131|    780|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (436:13): [True: 780, False: 0]
  ------------------
  437|    780|        {
  438|    780|            tif->tif_header.common.tiff_version = TIFF_VERSION_CLASSIC;
  ------------------
  |  |   48|    780|#define TIFF_VERSION_CLASSIC 42
  ------------------
  439|    780|            tif->tif_header.classic.tiff_diroff = 0;
  440|    780|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|    780|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (440:17): [True: 0, False: 780]
  ------------------
  441|      0|                TIFFSwabShort(&tif->tif_header.common.tiff_version);
  442|    780|            tif->tif_header_size = sizeof(TIFFHeaderClassic);
  443|    780|        }
  444|      0|        else
  445|      0|        {
  446|      0|            tif->tif_header.common.tiff_version = TIFF_VERSION_BIG;
  ------------------
  |  |   49|      0|#define TIFF_VERSION_BIG 43
  ------------------
  447|      0|            tif->tif_header.big.tiff_offsetsize = 8;
  448|      0|            tif->tif_header.big.tiff_unused = 0;
  449|      0|            tif->tif_header.big.tiff_diroff = 0;
  450|      0|            if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (450:17): [True: 0, False: 0]
  ------------------
  451|      0|            {
  452|      0|                TIFFSwabShort(&tif->tif_header.common.tiff_version);
  453|      0|                TIFFSwabShort(&tif->tif_header.big.tiff_offsetsize);
  454|      0|            }
  455|      0|            tif->tif_header_size = sizeof(TIFFHeaderBig);
  456|      0|        }
  457|       |        /*
  458|       |         * The doc for "fopen" for some STD_C_LIBs says that if you
  459|       |         * open a file for modify ("+"), then you must fseek (or
  460|       |         * fflush?) between any freads and fwrites.  This is not
  461|       |         * necessary on most systems, but has been shown to be needed
  462|       |         * on Solaris.
  463|       |         */
  464|    780|        TIFFSeekFile(tif, 0, SEEK_SET);
  ------------------
  |  |  259|    780|    ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence)))
  ------------------
  465|    780|        if (!WriteOK(tif, &tif->tif_header, (tmsize_t)(tif->tif_header_size)))
  ------------------
  |  |  277|    780|#define WriteOK(tif, buf, size) (TIFFWriteFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  257|    780|    ((*(tif)->tif_writeproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (465:13): [True: 0, False: 780]
  ------------------
  466|      0|        {
  467|      0|            TIFFErrorExtR(tif, name, "Error writing TIFF header");
  468|      0|            goto bad;
  469|      0|        }
  470|       |        /*
  471|       |         * Setup the byte order handling.
  472|       |         */
  473|    780|        if (tif->tif_header.common.tiff_magic == TIFF_BIGENDIAN)
  ------------------
  |  |   51|    780|#define TIFF_BIGENDIAN 0x4d4d
  ------------------
  |  Branch (473:13): [True: 0, False: 780]
  ------------------
  474|      0|        {
  475|      0|#ifndef WORDS_BIGENDIAN
  476|      0|            tif->tif_flags |= TIFF_SWAB;
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  477|      0|#endif
  478|      0|        }
  479|    780|        else
  480|    780|        {
  481|       |#ifdef WORDS_BIGENDIAN
  482|       |            tif->tif_flags |= TIFF_SWAB;
  483|       |#endif
  484|    780|        }
  485|       |        /*
  486|       |         * Setup default directory.
  487|       |         */
  488|    780|        if (!TIFFDefaultDirectory(tif))
  ------------------
  |  Branch (488:13): [True: 0, False: 780]
  ------------------
  489|      0|            goto bad;
  490|    780|        tif->tif_diroff = 0;
  491|    780|        tif->tif_lastdiroff = 0;
  492|    780|        tif->tif_setdirectory_force_absolute = FALSE;
  ------------------
  |  |   71|    780|#define FALSE 0
  ------------------
  493|    780|        return (tif);
  494|    780|    }
  495|       |    /*
  496|       |     * Setup the byte order handling.
  497|       |     */
  498|      0|    if (tif->tif_header.common.tiff_magic != TIFF_BIGENDIAN &&
  ------------------
  |  |   51|      0|#define TIFF_BIGENDIAN 0x4d4d
  ------------------
  |  Branch (498:9): [True: 0, False: 0]
  ------------------
  499|      0|        tif->tif_header.common.tiff_magic != TIFF_LITTLEENDIAN
  ------------------
  |  |   52|      0|#define TIFF_LITTLEENDIAN 0x4949
  ------------------
  |  Branch (499:9): [True: 0, False: 0]
  ------------------
  500|      0|#if MDI_SUPPORT
  501|      0|        &&
  502|       |#if HOST_BIGENDIAN
  503|       |        tif->tif_header.common.tiff_magic != MDI_BIGENDIAN
  504|       |#else
  505|      0|        tif->tif_header.common.tiff_magic != MDI_LITTLEENDIAN
  ------------------
  |  |   53|      0|#define MDI_LITTLEENDIAN 0x5045
  ------------------
  |  Branch (505:9): [True: 0, False: 0]
  ------------------
  506|      0|#endif
  507|      0|    )
  508|      0|    {
  509|      0|        TIFFErrorExtR(tif, name,
  510|      0|                      "Not a TIFF or MDI file, bad magic number %" PRIu16
  511|      0|                      " (0x%" PRIx16 ")",
  512|       |#else
  513|       |    )
  514|       |    {
  515|       |        TIFFErrorExtR(tif, name,
  516|       |                      "Not a TIFF file, bad magic number %" PRIu16
  517|       |                      " (0x%" PRIx16 ")",
  518|       |#endif
  519|      0|                      tif->tif_header.common.tiff_magic,
  520|      0|                      tif->tif_header.common.tiff_magic);
  521|      0|        goto bad;
  522|      0|    }
  523|      0|    if (tif->tif_header.common.tiff_magic == TIFF_BIGENDIAN)
  ------------------
  |  |   51|      0|#define TIFF_BIGENDIAN 0x4d4d
  ------------------
  |  Branch (523:9): [True: 0, False: 0]
  ------------------
  524|      0|    {
  525|      0|#ifndef WORDS_BIGENDIAN
  526|      0|        tif->tif_flags |= TIFF_SWAB;
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  527|      0|#endif
  528|      0|    }
  529|      0|    else
  530|      0|    {
  531|       |#ifdef WORDS_BIGENDIAN
  532|       |        tif->tif_flags |= TIFF_SWAB;
  533|       |#endif
  534|      0|    }
  535|      0|    if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (535:9): [True: 0, False: 0]
  ------------------
  536|      0|        TIFFSwabShort(&tif->tif_header.common.tiff_version);
  537|      0|    if ((tif->tif_header.common.tiff_version != TIFF_VERSION_CLASSIC) &&
  ------------------
  |  |   48|      0|#define TIFF_VERSION_CLASSIC 42
  ------------------
  |  Branch (537:9): [True: 0, False: 0]
  ------------------
  538|      0|        (tif->tif_header.common.tiff_version != TIFF_VERSION_BIG))
  ------------------
  |  |   49|      0|#define TIFF_VERSION_BIG 43
  ------------------
  |  Branch (538:9): [True: 0, False: 0]
  ------------------
  539|      0|    {
  540|      0|        TIFFErrorExtR(tif, name,
  541|      0|                      "Not a TIFF file, bad version number %" PRIu16
  542|      0|                      " (0x%" PRIx16 ")",
  543|      0|                      tif->tif_header.common.tiff_version,
  544|      0|                      tif->tif_header.common.tiff_version);
  545|      0|        goto bad;
  546|      0|    }
  547|      0|    if (tif->tif_header.common.tiff_version == TIFF_VERSION_CLASSIC)
  ------------------
  |  |   48|      0|#define TIFF_VERSION_CLASSIC 42
  ------------------
  |  Branch (547:9): [True: 0, False: 0]
  ------------------
  548|      0|    {
  549|      0|        if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (549:13): [True: 0, False: 0]
  ------------------
  550|      0|            TIFFSwabLong(&tif->tif_header.classic.tiff_diroff);
  551|      0|        tif->tif_header_size = sizeof(TIFFHeaderClassic);
  552|      0|    }
  553|      0|    else
  554|      0|    {
  555|      0|        if (!ReadOK(tif,
  ------------------
  |  |  271|      0|#define ReadOK(tif, buf, size) (TIFFReadFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  255|      0|    ((*(tif)->tif_readproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (555:13): [True: 0, False: 0]
  ------------------
  556|      0|                    ((uint8_t *)(&tif->tif_header) + sizeof(TIFFHeaderClassic)),
  557|      0|                    (sizeof(TIFFHeaderBig) - sizeof(TIFFHeaderClassic))))
  558|      0|        {
  559|      0|            TIFFErrorExtR(tif, name, "Cannot read TIFF header");
  560|      0|            goto bad;
  561|      0|        }
  562|      0|        if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|      0|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (562:13): [True: 0, False: 0]
  ------------------
  563|      0|        {
  564|      0|            TIFFSwabShort(&tif->tif_header.big.tiff_offsetsize);
  565|      0|            TIFFSwabLong8(&tif->tif_header.big.tiff_diroff);
  566|      0|        }
  567|      0|        if (tif->tif_header.big.tiff_offsetsize != 8)
  ------------------
  |  Branch (567:13): [True: 0, False: 0]
  ------------------
  568|      0|        {
  569|      0|            TIFFErrorExtR(tif, name,
  570|      0|                          "Not a TIFF file, bad BigTIFF offsetsize %" PRIu16
  571|      0|                          " (0x%" PRIx16 ")",
  572|      0|                          tif->tif_header.big.tiff_offsetsize,
  573|      0|                          tif->tif_header.big.tiff_offsetsize);
  574|      0|            goto bad;
  575|      0|        }
  576|      0|        if (tif->tif_header.big.tiff_unused != 0)
  ------------------
  |  Branch (576:13): [True: 0, False: 0]
  ------------------
  577|      0|        {
  578|      0|            TIFFErrorExtR(tif, name,
  579|      0|                          "Not a TIFF file, bad BigTIFF unused %" PRIu16
  580|      0|                          " (0x%" PRIx16 ")",
  581|      0|                          tif->tif_header.big.tiff_unused,
  582|      0|                          tif->tif_header.big.tiff_unused);
  583|      0|            goto bad;
  584|      0|        }
  585|      0|        tif->tif_header_size = sizeof(TIFFHeaderBig);
  586|      0|        tif->tif_flags |= TIFF_BIGTIFF;
  ------------------
  |  |  131|      0|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  587|      0|    }
  588|      0|    tif->tif_flags |= TIFF_MYBUFFER;
  ------------------
  |  |  119|      0|#define TIFF_MYBUFFER 0x00200U    /* my raw data buffer; free on close */
  ------------------
  589|      0|    tif->tif_rawcp = tif->tif_rawdata = 0;
  590|      0|    tif->tif_rawdatasize = 0;
  591|      0|    tif->tif_rawdataoff = 0;
  592|      0|    tif->tif_rawdataloaded = 0;
  593|       |
  594|      0|    switch (mode[0])
  ------------------
  |  Branch (594:13): [True: 0, False: 0]
  ------------------
  595|      0|    {
  596|      0|        case 'r':
  ------------------
  |  Branch (596:9): [True: 0, False: 0]
  ------------------
  597|      0|            if (!(tif->tif_flags & TIFF_BIGTIFF))
  ------------------
  |  |  131|      0|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (597:17): [True: 0, False: 0]
  ------------------
  598|      0|                tif->tif_nextdiroff = tif->tif_header.classic.tiff_diroff;
  599|      0|            else
  600|      0|                tif->tif_nextdiroff = tif->tif_header.big.tiff_diroff;
  601|       |            /*
  602|       |             * Try to use a memory-mapped file if the client
  603|       |             * has not explicitly suppressed usage with the
  604|       |             * 'm' flag in the open mode (see above).
  605|       |             */
  606|      0|            if (tif->tif_flags & TIFF_MAPPED)
  ------------------
  |  |  121|      0|#define TIFF_MAPPED 0x00800U      /* file is mapped into memory */
  ------------------
  |  Branch (606:17): [True: 0, False: 0]
  ------------------
  607|      0|            {
  608|      0|                toff_t n;
  609|      0|                if (TIFFMapFileContents(tif, (void **)(&tif->tif_base), &n))
  ------------------
  |  |  263|      0|    ((*(tif)->tif_mapproc)((tif)->tif_clientdata, (paddr), (psize)))
  |  |  ------------------
  |  |  |  Branch (263:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  610|      0|                {
  611|      0|                    tif->tif_size = (tmsize_t)n;
  612|      0|                    assert((toff_t)tif->tif_size == n);
  613|      0|                }
  614|      0|                else
  615|      0|                    tif->tif_flags &= ~TIFF_MAPPED;
  ------------------
  |  |  121|      0|#define TIFF_MAPPED 0x00800U      /* file is mapped into memory */
  ------------------
  616|      0|            }
  617|       |            /*
  618|       |             * Sometimes we do not want to read the first directory (for
  619|       |             * example, it may be broken) and want to proceed to other
  620|       |             * directories. I this case we use the TIFF_HEADERONLY flag to open
  621|       |             * file and return immediately after reading TIFF header.
  622|       |             */
  623|      0|            if (tif->tif_flags & TIFF_HEADERONLY)
  ------------------
  |  |  127|      0|    0x10000U /* read header only, do not process the first directory */
  ------------------
  |  Branch (623:17): [True: 0, False: 0]
  ------------------
  624|      0|                return (tif);
  625|       |
  626|       |            /*
  627|       |             * Setup initial directory.
  628|       |             */
  629|      0|            if (TIFFReadDirectory(tif))
  ------------------
  |  Branch (629:17): [True: 0, False: 0]
  ------------------
  630|      0|            {
  631|      0|                return (tif);
  632|      0|            }
  633|      0|            break;
  634|      0|        case 'a':
  ------------------
  |  Branch (634:9): [True: 0, False: 0]
  ------------------
  635|       |            /*
  636|       |             * New directories are automatically append
  637|       |             * to the end of the directory chain when they
  638|       |             * are written out (see TIFFWriteDirectory).
  639|       |             */
  640|      0|            if (!TIFFDefaultDirectory(tif))
  ------------------
  |  Branch (640:17): [True: 0, False: 0]
  ------------------
  641|      0|                goto bad;
  642|      0|            return (tif);
  643|      0|    }
  644|      0|bad:
  645|      0|    tif->tif_mode = O_RDONLY; /* XXX avoid flush */
  646|      0|    TIFFCleanup(tif);
  647|      0|bad2:
  648|      0|    return ((TIFF *)0);
  649|      0|}

TIFFPredictorInit:
  994|    780|{
  995|    780|    TIFFPredictorState *sp = PredictorState(tif);
  ------------------
  |  |   33|    780|#define PredictorState(tif) ((TIFFPredictorState *)(tif)->tif_data)
  ------------------
  996|       |
  997|    780|    assert(sp != 0);
  998|       |
  999|       |    /*
 1000|       |     * Merge codec-specific tag information.
 1001|       |     */
 1002|    780|    if (!_TIFFMergeFields(tif, predictFields, TIFFArrayCount(predictFields)))
  ------------------
  |  |  309|    780|#define TIFFArrayCount(a) (sizeof(a) / sizeof((a)[0]))
  ------------------
  |  Branch (1002:9): [True: 0, False: 780]
  ------------------
 1003|      0|    {
 1004|      0|        TIFFErrorExtR(tif, "TIFFPredictorInit",
 1005|      0|                      "Merging Predictor codec-specific tags failed");
 1006|      0|        return 0;
 1007|      0|    }
 1008|       |
 1009|       |    /*
 1010|       |     * Override parent get/set field methods.
 1011|       |     */
 1012|    780|    sp->vgetparent = tif->tif_tagmethods.vgetfield;
 1013|    780|    tif->tif_tagmethods.vgetfield =
 1014|    780|        PredictorVGetField; /* hook for predictor tag */
 1015|    780|    sp->vsetparent = tif->tif_tagmethods.vsetfield;
 1016|    780|    tif->tif_tagmethods.vsetfield =
 1017|    780|        PredictorVSetField; /* hook for predictor tag */
 1018|    780|    sp->printdir = tif->tif_tagmethods.printdir;
 1019|    780|    tif->tif_tagmethods.printdir =
 1020|    780|        PredictorPrintDir; /* hook for predictor tag */
 1021|       |
 1022|    780|    sp->setupdecode = tif->tif_setupdecode;
 1023|    780|    tif->tif_setupdecode = PredictorSetupDecode;
 1024|    780|    sp->setupencode = tif->tif_setupencode;
 1025|    780|    tif->tif_setupencode = PredictorSetupEncode;
 1026|       |
 1027|    780|    sp->predictor = 1;      /* default value */
 1028|    780|    sp->encodepfunc = NULL; /* no predictor routine */
 1029|    780|    sp->decodepfunc = NULL; /* no predictor routine */
 1030|    780|    return 1;
 1031|    780|}
TIFFPredictorCleanup:
 1034|    780|{
 1035|    780|    TIFFPredictorState *sp = PredictorState(tif);
  ------------------
  |  |   33|    780|#define PredictorState(tif) ((TIFFPredictorState *)(tif)->tif_data)
  ------------------
 1036|       |
 1037|    780|    assert(sp != 0);
 1038|       |
 1039|    780|    tif->tif_tagmethods.vgetfield = sp->vgetparent;
 1040|    780|    tif->tif_tagmethods.vsetfield = sp->vsetparent;
 1041|    780|    tif->tif_tagmethods.printdir = sp->printdir;
 1042|    780|    tif->tif_setupdecode = sp->setupdecode;
 1043|    780|    tif->tif_setupencode = sp->setupencode;
 1044|       |
 1045|    780|    return 1;
 1046|    780|}
tif_predict.c:PredictorVGetField:
  950|  1.56k|{
  951|  1.56k|    TIFFPredictorState *sp = PredictorState(tif);
  ------------------
  |  |   33|  1.56k|#define PredictorState(tif) ((TIFFPredictorState *)(tif)->tif_data)
  ------------------
  952|       |
  953|  1.56k|    assert(sp != NULL);
  954|  1.56k|    assert(sp->vgetparent != NULL);
  955|       |
  956|  1.56k|    switch (tag)
  957|  1.56k|    {
  958|  1.56k|        case TIFFTAG_PREDICTOR:
  ------------------
  |  |  302|  1.56k|#define TIFFTAG_PREDICTOR 317              /* prediction scheme w/ LZW */
  ------------------
  |  Branch (958:9): [True: 1.56k, False: 0]
  ------------------
  959|  1.56k|            *va_arg(ap, uint16_t *) = (uint16_t)sp->predictor;
  960|  1.56k|            break;
  961|      0|        default:
  ------------------
  |  Branch (961:9): [True: 0, False: 1.56k]
  ------------------
  962|      0|            return (*sp->vgetparent)(tif, tag, ap);
  963|  1.56k|    }
  964|  1.56k|    return 1;
  965|  1.56k|}
tif_predict.c:PredictorVSetField:
  930|  4.68k|{
  931|  4.68k|    TIFFPredictorState *sp = PredictorState(tif);
  ------------------
  |  |   33|  4.68k|#define PredictorState(tif) ((TIFFPredictorState *)(tif)->tif_data)
  ------------------
  932|       |
  933|  4.68k|    assert(sp != NULL);
  934|  4.68k|    assert(sp->vsetparent != NULL);
  935|       |
  936|  4.68k|    switch (tag)
  937|  4.68k|    {
  938|    780|        case TIFFTAG_PREDICTOR:
  ------------------
  |  |  302|    780|#define TIFFTAG_PREDICTOR 317              /* prediction scheme w/ LZW */
  ------------------
  |  Branch (938:9): [True: 780, False: 3.90k]
  ------------------
  939|    780|            sp->predictor = (uint16_t)va_arg(ap, uint16_vap);
  940|    780|            TIFFSetFieldBit(tif, FIELD_PREDICTOR);
  ------------------
  |  |  210|    780|#define TIFFSetFieldBit(tif, field) (BITFIELDn(tif, field) |= BITn(field))
  |  |  ------------------
  |  |  |  |  208|    780|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFSetFieldBit(tif, field) (BITFIELDn(tif, field) |= BITn(field))
  |  |  ------------------
  |  |  |  |  207|    780|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  ------------------
  941|    780|            break;
  942|  3.90k|        default:
  ------------------
  |  Branch (942:9): [True: 3.90k, False: 780]
  ------------------
  943|  3.90k|            return (*sp->vsetparent)(tif, tag, ap);
  944|  4.68k|    }
  945|    780|    tif->tif_flags |= TIFF_DIRTYDIRECT;
  ------------------
  |  |  113|    780|#define TIFF_DIRTYDIRECT 0x00008U /* current directory must be written */
  ------------------
  946|    780|    return 1;
  947|  4.68k|}
tif_predict.c:PredictorSetup:
   60|    780|{
   61|    780|    static const char module[] = "PredictorSetup";
   62|       |
   63|    780|    TIFFPredictorState *sp = PredictorState(tif);
  ------------------
  |  |   33|    780|#define PredictorState(tif) ((TIFFPredictorState *)(tif)->tif_data)
  ------------------
   64|    780|    TIFFDirectory *td = &tif->tif_dir;
   65|       |
   66|    780|    switch (sp->predictor) /* no differencing */
   67|    780|    {
   68|      0|        case PREDICTOR_NONE:
  ------------------
  |  |  303|      0|#define PREDICTOR_NONE 1                   /* no prediction scheme used */
  ------------------
  |  Branch (68:9): [True: 0, False: 780]
  ------------------
   69|      0|            return 1;
   70|    780|        case PREDICTOR_HORIZONTAL:
  ------------------
  |  |  304|    780|#define PREDICTOR_HORIZONTAL 2             /* horizontal differencing */
  ------------------
  |  Branch (70:9): [True: 780, False: 0]
  ------------------
   71|    780|            if (td->td_bitspersample != 8 && td->td_bitspersample != 16 &&
  ------------------
  |  Branch (71:17): [True: 0, False: 780]
  |  Branch (71:46): [True: 0, False: 0]
  ------------------
   72|    780|                td->td_bitspersample != 32 && td->td_bitspersample != 64)
  ------------------
  |  Branch (72:17): [True: 0, False: 0]
  |  Branch (72:47): [True: 0, False: 0]
  ------------------
   73|      0|            {
   74|      0|                TIFFErrorExtR(tif, module,
   75|      0|                              "Horizontal differencing \"Predictor\" not "
   76|      0|                              "supported with %" PRIu16 "-bit samples",
   77|      0|                              td->td_bitspersample);
   78|      0|                return 0;
   79|      0|            }
   80|    780|            break;
   81|    780|        case PREDICTOR_FLOATINGPOINT:
  ------------------
  |  |  305|      0|#define PREDICTOR_FLOATINGPOINT 3          /* floating point predictor */
  ------------------
  |  Branch (81:9): [True: 0, False: 780]
  ------------------
   82|      0|            if (td->td_sampleformat != SAMPLEFORMAT_IEEEFP)
  ------------------
  |  |  335|      0|#define SAMPLEFORMAT_IEEEFP 3              /* !IEEE floating point data */
  ------------------
  |  Branch (82:17): [True: 0, False: 0]
  ------------------
   83|      0|            {
   84|      0|                TIFFErrorExtR(
   85|      0|                    tif, module,
   86|      0|                    "Floating point \"Predictor\" not supported with %" PRIu16
   87|      0|                    " data format",
   88|      0|                    td->td_sampleformat);
   89|      0|                return 0;
   90|      0|            }
   91|      0|            if (td->td_bitspersample != 16 && td->td_bitspersample != 24 &&
  ------------------
  |  Branch (91:17): [True: 0, False: 0]
  |  Branch (91:47): [True: 0, False: 0]
  ------------------
   92|      0|                td->td_bitspersample != 32 && td->td_bitspersample != 64)
  ------------------
  |  Branch (92:17): [True: 0, False: 0]
  |  Branch (92:47): [True: 0, False: 0]
  ------------------
   93|      0|            { /* Should 64 be allowed? */
   94|      0|                TIFFErrorExtR(
   95|      0|                    tif, module,
   96|      0|                    "Floating point \"Predictor\" not supported with %" PRIu16
   97|      0|                    "-bit samples",
   98|      0|                    td->td_bitspersample);
   99|      0|                return 0;
  100|      0|            }
  101|      0|            break;
  102|      0|        default:
  ------------------
  |  Branch (102:9): [True: 0, False: 780]
  ------------------
  103|      0|            TIFFErrorExtR(tif, module, "\"Predictor\" value %d not supported",
  104|      0|                          sp->predictor);
  105|      0|            return 0;
  106|    780|    }
  107|    780|    sp->stride =
  108|    780|        (td->td_planarconfig == PLANARCONFIG_CONTIG ? td->td_samplesperpixel
  ------------------
  |  |  264|    780|#define PLANARCONFIG_CONTIG 1              /* single image plane */
  ------------------
  |  Branch (108:10): [True: 780, False: 0]
  ------------------
  109|    780|                                                    : 1);
  110|       |    /*
  111|       |     * Calculate the scanline/tile-width size in bytes.
  112|       |     */
  113|    780|    if (isTiled(tif))
  ------------------
  |  |  250|    780|#define isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0)
  |  |  ------------------
  |  |  |  |  120|    780|#define TIFF_ISTILED 0x00400U     /* file is tile, not strip- based */
  |  |  ------------------
  |  |  |  Branch (250:22): [True: 0, False: 780]
  |  |  ------------------
  ------------------
  114|      0|        sp->rowsize = TIFFTileRowSize(tif);
  115|    780|    else
  116|    780|        sp->rowsize = TIFFScanlineSize(tif);
  117|    780|    if (sp->rowsize == 0)
  ------------------
  |  Branch (117:9): [True: 0, False: 780]
  ------------------
  118|      0|        return 0;
  119|       |
  120|    780|    return 1;
  121|    780|}
tif_predict.c:PredictorSetupEncode:
  227|    780|{
  228|    780|    TIFFPredictorState *sp = PredictorState(tif);
  ------------------
  |  |   33|    780|#define PredictorState(tif) ((TIFFPredictorState *)(tif)->tif_data)
  ------------------
  229|    780|    TIFFDirectory *td = &tif->tif_dir;
  230|       |
  231|    780|    if (!(*sp->setupencode)(tif) || !PredictorSetup(tif))
  ------------------
  |  Branch (231:9): [True: 0, False: 780]
  |  Branch (231:37): [True: 0, False: 780]
  ------------------
  232|      0|        return 0;
  233|       |
  234|    780|    if (sp->predictor == 2)
  ------------------
  |  Branch (234:9): [True: 780, False: 0]
  ------------------
  235|    780|    {
  236|    780|        switch (td->td_bitspersample)
  ------------------
  |  Branch (236:17): [True: 0, False: 780]
  ------------------
  237|    780|        {
  238|    780|            case 8:
  ------------------
  |  Branch (238:13): [True: 780, False: 0]
  ------------------
  239|    780|                sp->encodepfunc = horDiff8;
  240|    780|                break;
  241|      0|            case 16:
  ------------------
  |  Branch (241:13): [True: 0, False: 780]
  ------------------
  242|      0|                sp->encodepfunc = horDiff16;
  243|      0|                break;
  244|      0|            case 32:
  ------------------
  |  Branch (244:13): [True: 0, False: 780]
  ------------------
  245|      0|                sp->encodepfunc = horDiff32;
  246|      0|                break;
  247|      0|            case 64:
  ------------------
  |  Branch (247:13): [True: 0, False: 780]
  ------------------
  248|      0|                sp->encodepfunc = horDiff64;
  249|      0|                break;
  250|    780|        }
  251|       |        /*
  252|       |         * Override default encoding method with one that does the
  253|       |         * predictor stuff.
  254|       |         */
  255|    780|        if (tif->tif_encoderow != PredictorEncodeRow)
  ------------------
  |  Branch (255:13): [True: 780, False: 0]
  ------------------
  256|    780|        {
  257|    780|            sp->encoderow = tif->tif_encoderow;
  258|    780|            tif->tif_encoderow = PredictorEncodeRow;
  259|    780|            sp->encodestrip = tif->tif_encodestrip;
  260|    780|            tif->tif_encodestrip = PredictorEncodeTile;
  261|    780|            sp->encodetile = tif->tif_encodetile;
  262|    780|            tif->tif_encodetile = PredictorEncodeTile;
  263|    780|        }
  264|       |
  265|       |        /*
  266|       |         * If the data is horizontally differenced 16-bit data that
  267|       |         * requires byte-swapping, then it must be byte swapped after
  268|       |         * the differentiation step.  We do this with a special-purpose
  269|       |         * routine and override the normal post decoding logic that
  270|       |         * the library setup when the directory was read.
  271|       |         */
  272|    780|        if (tif->tif_flags & TIFF_SWAB)
  ------------------
  |  |  117|    780|#define TIFF_SWAB 0x00080U        /* byte swap file information */
  ------------------
  |  Branch (272:13): [True: 0, False: 780]
  ------------------
  273|      0|        {
  274|      0|            if (sp->encodepfunc == horDiff16)
  ------------------
  |  Branch (274:17): [True: 0, False: 0]
  ------------------
  275|      0|            {
  276|      0|                sp->encodepfunc = swabHorDiff16;
  277|      0|                tif->tif_postdecode = _TIFFNoPostDecode;
  278|      0|            }
  279|      0|            else if (sp->encodepfunc == horDiff32)
  ------------------
  |  Branch (279:22): [True: 0, False: 0]
  ------------------
  280|      0|            {
  281|      0|                sp->encodepfunc = swabHorDiff32;
  282|      0|                tif->tif_postdecode = _TIFFNoPostDecode;
  283|      0|            }
  284|      0|            else if (sp->encodepfunc == horDiff64)
  ------------------
  |  Branch (284:22): [True: 0, False: 0]
  ------------------
  285|      0|            {
  286|      0|                sp->encodepfunc = swabHorDiff64;
  287|      0|                tif->tif_postdecode = _TIFFNoPostDecode;
  288|      0|            }
  289|      0|        }
  290|    780|    }
  291|       |
  292|      0|    else if (sp->predictor == 3)
  ------------------
  |  Branch (292:14): [True: 0, False: 0]
  ------------------
  293|      0|    {
  294|      0|        sp->encodepfunc = fpDiff;
  295|       |        /*
  296|       |         * Override default encoding method with one that does the
  297|       |         * predictor stuff.
  298|       |         */
  299|      0|        if (tif->tif_encoderow != PredictorEncodeRow)
  ------------------
  |  Branch (299:13): [True: 0, False: 0]
  ------------------
  300|      0|        {
  301|      0|            sp->encoderow = tif->tif_encoderow;
  302|      0|            tif->tif_encoderow = PredictorEncodeRow;
  303|      0|            sp->encodestrip = tif->tif_encodestrip;
  304|      0|            tif->tif_encodestrip = PredictorEncodeTile;
  305|      0|            sp->encodetile = tif->tif_encodetile;
  306|      0|            tif->tif_encodetile = PredictorEncodeTile;
  307|      0|        }
  308|      0|    }
  309|       |
  310|    780|    return 1;
  311|    780|}
tif_predict.c:horDiff8:
  615|    780|{
  616|    780|    TIFFPredictorState *sp = PredictorState(tif);
  ------------------
  |  |   33|    780|#define PredictorState(tif) ((TIFFPredictorState *)(tif)->tif_data)
  ------------------
  617|    780|    tmsize_t stride = sp->stride;
  618|    780|    unsigned char *cp = (unsigned char *)cp0;
  619|       |
  620|    780|    if ((cc % stride) != 0)
  ------------------
  |  Branch (620:9): [True: 0, False: 780]
  ------------------
  621|      0|    {
  622|      0|        TIFFErrorExtR(tif, "horDiff8", "%s", "(cc%stride)!=0");
  623|      0|        return 0;
  624|      0|    }
  625|       |
  626|    780|    if (cc > stride)
  ------------------
  |  Branch (626:9): [True: 772, False: 8]
  ------------------
  627|    772|    {
  628|    772|        cc -= stride;
  629|       |        /*
  630|       |         * Pipeline the most common cases.
  631|       |         */
  632|    772|        if (stride == 3)
  ------------------
  |  Branch (632:13): [True: 0, False: 772]
  ------------------
  633|      0|        {
  634|      0|            unsigned int r1, g1, b1;
  635|      0|            unsigned int r2 = cp[0];
  636|      0|            unsigned int g2 = cp[1];
  637|      0|            unsigned int b2 = cp[2];
  638|      0|            do
  639|      0|            {
  640|      0|                r1 = cp[3];
  641|      0|                cp[3] = (unsigned char)((r1 - r2) & 0xff);
  642|      0|                r2 = r1;
  643|      0|                g1 = cp[4];
  644|      0|                cp[4] = (unsigned char)((g1 - g2) & 0xff);
  645|      0|                g2 = g1;
  646|      0|                b1 = cp[5];
  647|      0|                cp[5] = (unsigned char)((b1 - b2) & 0xff);
  648|      0|                b2 = b1;
  649|      0|                cp += 3;
  650|      0|            } while ((cc -= 3) > 0);
  ------------------
  |  Branch (650:22): [True: 0, False: 0]
  ------------------
  651|      0|        }
  652|    772|        else if (stride == 4)
  ------------------
  |  Branch (652:18): [True: 0, False: 772]
  ------------------
  653|      0|        {
  654|      0|            unsigned int r1, g1, b1, a1;
  655|      0|            unsigned int r2 = cp[0];
  656|      0|            unsigned int g2 = cp[1];
  657|      0|            unsigned int b2 = cp[2];
  658|      0|            unsigned int a2 = cp[3];
  659|      0|            do
  660|      0|            {
  661|      0|                r1 = cp[4];
  662|      0|                cp[4] = (unsigned char)((r1 - r2) & 0xff);
  663|      0|                r2 = r1;
  664|      0|                g1 = cp[5];
  665|      0|                cp[5] = (unsigned char)((g1 - g2) & 0xff);
  666|      0|                g2 = g1;
  667|      0|                b1 = cp[6];
  668|      0|                cp[6] = (unsigned char)((b1 - b2) & 0xff);
  669|      0|                b2 = b1;
  670|      0|                a1 = cp[7];
  671|      0|                cp[7] = (unsigned char)((a1 - a2) & 0xff);
  672|      0|                a2 = a1;
  673|      0|                cp += 4;
  674|      0|            } while ((cc -= 4) > 0);
  ------------------
  |  Branch (674:22): [True: 0, False: 0]
  ------------------
  675|      0|        }
  676|    772|        else
  677|    772|        {
  678|    772|            cp += cc - 1;
  679|    772|            do
  680|  71.9M|            {
  681|  71.9M|                REPEAT4(stride,
  ------------------
  |  |  314|  71.9M|    switch (n)                                                                 \
  |  |  315|  71.9M|    {                                                                          \
  |  |  316|      0|        default:                                                               \
  |  |  ------------------
  |  |  |  Branch (316:9): [True: 0, False: 71.9M]
  |  |  ------------------
  |  |  317|      0|        {                                                                      \
  |  |  318|      0|            tmsize_t i;                                                        \
  |  |  319|      0|            for (i = n - 4; i > 0; i--)                                        \
  |  |  ------------------
  |  |  |  Branch (319:29): [True: 0, False: 0]
  |  |  ------------------
  |  |  320|      0|            {                                                                  \
  |  |  321|      0|                op;                                                            \
  |  |  322|      0|            }                                                                  \
  |  |  323|      0|        } /*-fallthrough*/                                                     \
  |  |  324|      0|        case 4:                                                                \
  |  |  ------------------
  |  |  |  Branch (324:9): [True: 0, False: 71.9M]
  |  |  ------------------
  |  |  325|      0|            op; /*-fallthrough*/                                               \
  |  |  326|      0|        case 3:                                                                \
  |  |  ------------------
  |  |  |  Branch (326:9): [True: 0, False: 71.9M]
  |  |  ------------------
  |  |  327|      0|            op; /*-fallthrough*/                                               \
  |  |  328|      0|        case 2:                                                                \
  |  |  ------------------
  |  |  |  Branch (328:9): [True: 0, False: 71.9M]
  |  |  ------------------
  |  |  329|      0|            op; /*-fallthrough*/                                               \
  |  |  330|  71.9M|        case 1:                                                                \
  |  |  ------------------
  |  |  |  Branch (330:9): [True: 71.9M, False: 0]
  |  |  ------------------
  |  |  331|  71.9M|            op; /*-fallthrough*/                                               \
  |  |  332|  71.9M|        case 0:;                                                               \
  |  |  ------------------
  |  |  |  Branch (332:9): [True: 0, False: 71.9M]
  |  |  ------------------
  |  |  333|  71.9M|    }
  ------------------
  682|  71.9M|                        cp[stride] =
  683|  71.9M|                            (unsigned char)((cp[stride] - cp[0]) & 0xff);
  684|  71.9M|                        cp--)
  685|  71.9M|            } while ((cc -= stride) > 0);
  ------------------
  |  Branch (685:22): [True: 71.9M, False: 772]
  ------------------
  686|    772|        }
  687|    772|    }
  688|    780|    return 1;
  689|    780|}
tif_predict.c:PredictorEncodeRow:
  859|    780|{
  860|    780|    TIFFPredictorState *sp = PredictorState(tif);
  ------------------
  |  |   33|    780|#define PredictorState(tif) ((TIFFPredictorState *)(tif)->tif_data)
  ------------------
  861|       |
  862|    780|    assert(sp != NULL);
  863|    780|    assert(sp->encodepfunc != NULL);
  864|    780|    assert(sp->encoderow != NULL);
  865|       |
  866|       |    /* XXX horizontal differencing alters user's data XXX */
  867|    780|    if (!(*sp->encodepfunc)(tif, bp, cc))
  ------------------
  |  Branch (867:9): [True: 0, False: 780]
  ------------------
  868|      0|        return 0;
  869|    780|    return (*sp->encoderow)(tif, bp, cc, s);
  870|    780|}

_TIFFNoPostDecode:
 1592|    780|{
 1593|    780|    (void)tif;
 1594|    780|    (void)buf;
 1595|    780|    (void)cc;
 1596|    780|}

TIFFNumberOfStrips:
   60|    780|{
   61|    780|    TIFFDirectory *td = &tif->tif_dir;
   62|    780|    uint32_t nstrips;
   63|       |
   64|    780|    nstrips = (td->td_rowsperstrip == (uint32_t)-1
  ------------------
  |  Branch (64:16): [True: 0, False: 780]
  ------------------
   65|    780|                   ? 1
   66|    780|                   : TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  ------------------
  |  |  282|    780|    (((uint32_t)x < (0xffffffff - (uint32_t)(y - 1)))                          \
  |  |  ------------------
  |  |  |  Branch (282:6): [True: 780, False: 0]
  |  |  ------------------
  |  |  283|    780|         ? ((((uint32_t)(x)) + (((uint32_t)(y)) - 1)) / ((uint32_t)(y)))       \
  |  |  284|    780|         : 0U)
  ------------------
   67|    780|    if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
  ------------------
  |  |  265|    780|#define PLANARCONFIG_SEPARATE 2            /* separate planes of data */
  ------------------
  |  Branch (67:9): [True: 0, False: 780]
  ------------------
   68|      0|        nstrips =
   69|      0|            _TIFFMultiply32(tif, nstrips, (uint32_t)td->td_samplesperpixel,
   70|      0|                            "TIFFNumberOfStrips");
   71|    780|    return (nstrips);
   72|    780|}
TIFFVStripSize64:
   78|    780|{
   79|    780|    static const char module[] = "TIFFVStripSize64";
   80|    780|    TIFFDirectory *td = &tif->tif_dir;
   81|    780|    if (nrows == (uint32_t)(-1))
  ------------------
  |  Branch (81:9): [True: 0, False: 780]
  ------------------
   82|      0|        nrows = td->td_imagelength;
   83|    780|    if ((td->td_planarconfig == PLANARCONFIG_CONTIG) &&
  ------------------
  |  |  264|    780|#define PLANARCONFIG_CONTIG 1              /* single image plane */
  ------------------
  |  Branch (83:9): [True: 780, False: 0]
  ------------------
   84|    780|        (td->td_photometric == PHOTOMETRIC_YCBCR) && (!isUpSampled(tif)))
  ------------------
  |  |  226|    780|#define PHOTOMETRIC_YCBCR 6                /* !CCIR 601 */
  ------------------
                      (td->td_photometric == PHOTOMETRIC_YCBCR) && (!isUpSampled(tif)))
  ------------------
  |  |  253|      0|#define isUpSampled(tif) (((tif)->tif_flags & TIFF_UPSAMPLED) != 0)
  |  |  ------------------
  |  |  |  |  124|      0|#define TIFF_UPSAMPLED 0x04000U   /* library is doing data up-sampling */
  |  |  ------------------
  ------------------
  |  Branch (84:9): [True: 0, False: 780]
  |  Branch (84:54): [True: 0, False: 0]
  ------------------
   85|      0|    {
   86|       |        /*
   87|       |         * Packed YCbCr data contain one Cb+Cr for every
   88|       |         * HorizontalSampling*VerticalSampling Y values.
   89|       |         * Must also roundup width and height when calculating
   90|       |         * since images that are not a multiple of the
   91|       |         * horizontal/vertical subsampling area include
   92|       |         * YCbCr data for the extended image.
   93|       |         */
   94|      0|        uint16_t ycbcrsubsampling[2];
   95|      0|        uint16_t samplingblock_samples;
   96|      0|        uint32_t samplingblocks_hor;
   97|      0|        uint32_t samplingblocks_ver;
   98|      0|        uint64_t samplingrow_samples;
   99|      0|        uint64_t samplingrow_size;
  100|      0|        if (td->td_samplesperpixel != 3)
  ------------------
  |  Branch (100:13): [True: 0, False: 0]
  ------------------
  101|      0|        {
  102|      0|            TIFFErrorExtR(tif, module, "Invalid td_samplesperpixel value");
  103|      0|            return 0;
  104|      0|        }
  105|      0|        TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING,
  ------------------
  |  |  387|      0|#define TIFFTAG_YCBCRSUBSAMPLING 530       /* !YCbCr subsampling factors */
  ------------------
  106|      0|                              ycbcrsubsampling + 0, ycbcrsubsampling + 1);
  107|      0|        if ((ycbcrsubsampling[0] != 1 && ycbcrsubsampling[0] != 2 &&
  ------------------
  |  Branch (107:14): [True: 0, False: 0]
  |  Branch (107:42): [True: 0, False: 0]
  ------------------
  108|      0|             ycbcrsubsampling[0] != 4) ||
  ------------------
  |  Branch (108:14): [True: 0, False: 0]
  ------------------
  109|      0|            (ycbcrsubsampling[1] != 1 && ycbcrsubsampling[1] != 2 &&
  ------------------
  |  Branch (109:14): [True: 0, False: 0]
  |  Branch (109:42): [True: 0, False: 0]
  ------------------
  110|      0|             ycbcrsubsampling[1] != 4))
  ------------------
  |  Branch (110:14): [True: 0, False: 0]
  ------------------
  111|      0|        {
  112|      0|            TIFFErrorExtR(tif, module, "Invalid YCbCr subsampling (%dx%d)",
  113|      0|                          ycbcrsubsampling[0], ycbcrsubsampling[1]);
  114|      0|            return 0;
  115|      0|        }
  116|      0|        samplingblock_samples = ycbcrsubsampling[0] * ycbcrsubsampling[1] + 2;
  117|      0|        samplingblocks_hor =
  118|      0|            TIFFhowmany_32(td->td_imagewidth, ycbcrsubsampling[0]);
  ------------------
  |  |  282|      0|    (((uint32_t)x < (0xffffffff - (uint32_t)(y - 1)))                          \
  |  |  ------------------
  |  |  |  Branch (282:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  283|      0|         ? ((((uint32_t)(x)) + (((uint32_t)(y)) - 1)) / ((uint32_t)(y)))       \
  |  |  284|      0|         : 0U)
  ------------------
  119|      0|        samplingblocks_ver = TIFFhowmany_32(nrows, ycbcrsubsampling[1]);
  ------------------
  |  |  282|      0|    (((uint32_t)x < (0xffffffff - (uint32_t)(y - 1)))                          \
  |  |  ------------------
  |  |  |  Branch (282:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  283|      0|         ? ((((uint32_t)(x)) + (((uint32_t)(y)) - 1)) / ((uint32_t)(y)))       \
  |  |  284|      0|         : 0U)
  ------------------
  120|      0|        samplingrow_samples = _TIFFMultiply64(tif, samplingblocks_hor,
  121|      0|                                              samplingblock_samples, module);
  122|      0|        samplingrow_size = TIFFhowmany8_64(_TIFFMultiply64(
  ------------------
  |  |  296|      0|    (((x)&0x07) ? ((uint64_t)(x) >> 3) + 1 : (uint64_t)(x) >> 3)
  |  |  ------------------
  |  |  |  Branch (296:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  123|      0|            tif, samplingrow_samples, td->td_bitspersample, module));
  124|      0|        return (
  125|      0|            _TIFFMultiply64(tif, samplingrow_size, samplingblocks_ver, module));
  126|      0|    }
  127|    780|    else
  128|    780|        return (_TIFFMultiply64(tif, nrows, TIFFScanlineSize64(tif), module));
  129|    780|}
TIFFStripSize64:
  185|    780|{
  186|    780|    TIFFDirectory *td = &tif->tif_dir;
  187|    780|    uint32_t rps = td->td_rowsperstrip;
  188|    780|    if (rps > td->td_imagelength)
  ------------------
  |  Branch (188:9): [True: 0, False: 780]
  ------------------
  189|      0|        rps = td->td_imagelength;
  190|    780|    return (TIFFVStripSize64(tif, rps));
  191|    780|}
TIFFStripSize:
  193|    780|{
  194|    780|    static const char module[] = "TIFFStripSize";
  195|    780|    uint64_t m;
  196|    780|    m = TIFFStripSize64(tif);
  197|    780|    return _TIFFCastUInt64ToSSize(tif, m, module);
  198|    780|}
TIFFScanlineSize64:
  246|  3.12k|{
  247|  3.12k|    static const char module[] = "TIFFScanlineSize64";
  248|  3.12k|    TIFFDirectory *td = &tif->tif_dir;
  249|  3.12k|    uint64_t scanline_size;
  250|  3.12k|    if (td->td_planarconfig == PLANARCONFIG_CONTIG)
  ------------------
  |  |  264|  3.12k|#define PLANARCONFIG_CONTIG 1              /* single image plane */
  ------------------
  |  Branch (250:9): [True: 3.12k, False: 0]
  ------------------
  251|  3.12k|    {
  252|  3.12k|        if ((td->td_photometric == PHOTOMETRIC_YCBCR) &&
  ------------------
  |  |  226|  3.12k|#define PHOTOMETRIC_YCBCR 6                /* !CCIR 601 */
  ------------------
  |  Branch (252:13): [True: 0, False: 3.12k]
  ------------------
  253|  3.12k|            (td->td_samplesperpixel == 3) && (!isUpSampled(tif)))
  ------------------
  |  |  253|      0|#define isUpSampled(tif) (((tif)->tif_flags & TIFF_UPSAMPLED) != 0)
  |  |  ------------------
  |  |  |  |  124|      0|#define TIFF_UPSAMPLED 0x04000U   /* library is doing data up-sampling */
  |  |  ------------------
  ------------------
  |  Branch (253:13): [True: 0, False: 0]
  |  Branch (253:46): [True: 0, False: 0]
  ------------------
  254|      0|        {
  255|      0|            uint16_t ycbcrsubsampling[2];
  256|      0|            uint16_t samplingblock_samples;
  257|      0|            uint32_t samplingblocks_hor;
  258|      0|            uint64_t samplingrow_samples;
  259|      0|            uint64_t samplingrow_size;
  260|      0|            if (td->td_samplesperpixel != 3)
  ------------------
  |  Branch (260:17): [True: 0, False: 0]
  ------------------
  261|      0|            {
  262|      0|                TIFFErrorExtR(tif, module, "Invalid td_samplesperpixel value");
  263|      0|                return 0;
  264|      0|            }
  265|      0|            TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING,
  ------------------
  |  |  387|      0|#define TIFFTAG_YCBCRSUBSAMPLING 530       /* !YCbCr subsampling factors */
  ------------------
  266|      0|                                  ycbcrsubsampling + 0, ycbcrsubsampling + 1);
  267|      0|            if (((ycbcrsubsampling[0] != 1) && (ycbcrsubsampling[0] != 2) &&
  ------------------
  |  Branch (267:18): [True: 0, False: 0]
  |  Branch (267:48): [True: 0, False: 0]
  ------------------
  268|      0|                 (ycbcrsubsampling[0] != 4)) ||
  ------------------
  |  Branch (268:18): [True: 0, False: 0]
  ------------------
  269|      0|                ((ycbcrsubsampling[1] != 1) && (ycbcrsubsampling[1] != 2) &&
  ------------------
  |  Branch (269:18): [True: 0, False: 0]
  |  Branch (269:48): [True: 0, False: 0]
  ------------------
  270|      0|                 (ycbcrsubsampling[1] != 4)))
  ------------------
  |  Branch (270:18): [True: 0, False: 0]
  ------------------
  271|      0|            {
  272|      0|                TIFFErrorExtR(tif, module, "Invalid YCbCr subsampling");
  273|      0|                return 0;
  274|      0|            }
  275|      0|            samplingblock_samples =
  276|      0|                ycbcrsubsampling[0] * ycbcrsubsampling[1] + 2;
  277|      0|            samplingblocks_hor =
  278|      0|                TIFFhowmany_32(td->td_imagewidth, ycbcrsubsampling[0]);
  ------------------
  |  |  282|      0|    (((uint32_t)x < (0xffffffff - (uint32_t)(y - 1)))                          \
  |  |  ------------------
  |  |  |  Branch (282:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  283|      0|         ? ((((uint32_t)(x)) + (((uint32_t)(y)) - 1)) / ((uint32_t)(y)))       \
  |  |  284|      0|         : 0U)
  ------------------
  279|      0|            samplingrow_samples = _TIFFMultiply64(
  280|      0|                tif, samplingblocks_hor, samplingblock_samples, module);
  281|      0|            samplingrow_size =
  282|      0|                TIFFhowmany_64(_TIFFMultiply64(tif, samplingrow_samples,
  ------------------
  |  |  294|      0|    ((((uint64_t)(x)) + (((uint64_t)(y)) - 1)) / ((uint64_t)(y)))
  ------------------
  283|      0|                                               td->td_bitspersample, module),
  284|      0|                               8);
  285|      0|            scanline_size = (samplingrow_size / ycbcrsubsampling[1]);
  286|      0|        }
  287|  3.12k|        else
  288|  3.12k|        {
  289|  3.12k|            uint64_t scanline_samples;
  290|  3.12k|            scanline_samples = _TIFFMultiply64(tif, td->td_imagewidth,
  291|  3.12k|                                               td->td_samplesperpixel, module);
  292|  3.12k|            scanline_size =
  293|  3.12k|                TIFFhowmany_64(_TIFFMultiply64(tif, scanline_samples,
  ------------------
  |  |  294|  3.12k|    ((((uint64_t)(x)) + (((uint64_t)(y)) - 1)) / ((uint64_t)(y)))
  ------------------
  294|  3.12k|                                               td->td_bitspersample, module),
  295|  3.12k|                               8);
  296|  3.12k|        }
  297|  3.12k|    }
  298|      0|    else
  299|      0|    {
  300|      0|        scanline_size =
  301|      0|            TIFFhowmany_64(_TIFFMultiply64(tif, td->td_imagewidth,
  ------------------
  |  |  294|      0|    ((((uint64_t)(x)) + (((uint64_t)(y)) - 1)) / ((uint64_t)(y)))
  ------------------
  302|      0|                                           td->td_bitspersample, module),
  303|      0|                           8);
  304|      0|    }
  305|  3.12k|    if (scanline_size == 0)
  ------------------
  |  Branch (305:9): [True: 0, False: 3.12k]
  ------------------
  306|      0|    {
  307|      0|        TIFFErrorExtR(tif, module, "Computed scanline size is zero");
  308|      0|        return 0;
  309|      0|    }
  310|  3.12k|    return (scanline_size);
  311|  3.12k|}
TIFFScanlineSize:
  313|  2.34k|{
  314|  2.34k|    static const char module[] = "TIFFScanlineSize";
  315|  2.34k|    uint64_t m;
  316|  2.34k|    m = TIFFScanlineSize64(tif);
  317|  2.34k|    return _TIFFCastUInt64ToSSize(tif, m, module);
  318|  2.34k|}

_TIFFmalloc:
  322|  7.80k|{
  323|  7.80k|    if (s == 0)
  ------------------
  |  Branch (323:9): [True: 0, False: 7.80k]
  ------------------
  324|      0|        return ((void *)NULL);
  325|       |
  326|  7.80k|    return (malloc((size_t)s));
  327|  7.80k|}
_TIFFfree:
  337|  10.9k|void _TIFFfree(void *p) { free(p); }
_TIFFrealloc:
  339|  3.90k|void *_TIFFrealloc(void *p, tmsize_t s) { return (realloc(p, (size_t)s)); }
_TIFFmemset:
  341|  8.58k|void _TIFFmemset(void *p, int v, tmsize_t c) { memset(p, v, (size_t)c); }
_TIFFmemcpy:
  344|  28.8k|{
  345|  28.8k|    memcpy(d, s, (size_t)c);
  346|  28.8k|}

TIFFSetWarningHandler:
   33|      1|{
   34|      1|    TIFFErrorHandler prev = _TIFFwarningHandler;
   35|      1|    _TIFFwarningHandler = handler;
   36|      1|    return (prev);
   37|      1|}

TIFFWriteScanline:
   48|    780|{
   49|    780|    static const char module[] = "TIFFWriteScanline";
   50|    780|    register TIFFDirectory *td;
   51|    780|    int status, imagegrew = 0;
   52|    780|    uint32_t strip;
   53|       |
   54|    780|    if (!WRITECHECKSTRIPS(tif, module))
  ------------------
  |  |   36|    780|    (((tif)->tif_flags & TIFF_BEENWRITING) || TIFFWriteCheck((tif), 0, module))
  |  |  ------------------
  |  |  |  |  116|    780|#define TIFF_BEENWRITING 0x00040U /* written 1+ scanlines to file */
  |  |  ------------------
  |  |  |  Branch (36:6): [True: 0, False: 780]
  |  |  |  Branch (36:47): [True: 780, False: 0]
  |  |  ------------------
  ------------------
   55|      0|        return (-1);
   56|       |    /*
   57|       |     * Handle delayed allocation of data buffer.  This
   58|       |     * permits it to be sized more intelligently (using
   59|       |     * directory information).
   60|       |     */
   61|    780|    if (!BUFFERCHECK(tif))
  ------------------
  |  |   40|    780|    ((((tif)->tif_flags & TIFF_BUFFERSETUP) && tif->tif_rawdata) ||            \
  |  |  ------------------
  |  |  |  |  114|    780|#define TIFF_BUFFERSETUP 0x00010U /* data buffers setup */
  |  |  ------------------
  |  |  |  Branch (40:7): [True: 0, False: 780]
  |  |  |  Branch (40:48): [True: 0, False: 0]
  |  |  ------------------
  |  |   41|    780|     TIFFWriteBufferSetup((tif), NULL, (tmsize_t)-1))
  |  |  ------------------
  |  |  |  Branch (41:6): [True: 780, False: 0]
  |  |  ------------------
  ------------------
   62|      0|        return (-1);
   63|    780|    tif->tif_flags |= TIFF_BUF4WRITE; /* not strictly sure this is right*/
  ------------------
  |  |  132|    780|#define TIFF_BUF4WRITE 0x100000U  /* rawcc bytes are for writing */
  ------------------
   64|       |
   65|    780|    td = &tif->tif_dir;
   66|       |    /*
   67|       |     * Extend image length if needed
   68|       |     * (but only for PlanarConfig=1).
   69|       |     */
   70|    780|    if (row >= td->td_imagelength)
  ------------------
  |  Branch (70:9): [True: 0, False: 780]
  ------------------
   71|      0|    { /* extend image */
   72|      0|        if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
  ------------------
  |  |  265|      0|#define PLANARCONFIG_SEPARATE 2            /* separate planes of data */
  ------------------
  |  Branch (72:13): [True: 0, False: 0]
  ------------------
   73|      0|        {
   74|      0|            TIFFErrorExtR(
   75|      0|                tif, module,
   76|      0|                "Can not change \"ImageLength\" when using separate planes");
   77|      0|            return (-1);
   78|      0|        }
   79|      0|        td->td_imagelength = row + 1;
   80|      0|        imagegrew = 1;
   81|      0|    }
   82|       |    /*
   83|       |     * Calculate strip and check for crossings.
   84|       |     */
   85|    780|    if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
  ------------------
  |  |  265|    780|#define PLANARCONFIG_SEPARATE 2            /* separate planes of data */
  ------------------
  |  Branch (85:9): [True: 0, False: 780]
  ------------------
   86|      0|    {
   87|      0|        if (sample >= td->td_samplesperpixel)
  ------------------
  |  Branch (87:13): [True: 0, False: 0]
  ------------------
   88|      0|        {
   89|      0|            TIFFErrorExtR(tif, module, "%lu: Sample out of range, max %lu",
   90|      0|                          (unsigned long)sample,
   91|      0|                          (unsigned long)td->td_samplesperpixel);
   92|      0|            return (-1);
   93|      0|        }
   94|      0|        strip = sample * td->td_stripsperimage + row / td->td_rowsperstrip;
   95|      0|    }
   96|    780|    else
   97|    780|        strip = row / td->td_rowsperstrip;
   98|       |    /*
   99|       |     * Check strip array to make sure there's space. We don't support
  100|       |     * dynamically growing files that have data organized in separate
  101|       |     * bitplanes because it's too painful.  In that case we require that
  102|       |     * the imagelength be set properly before the first write (so that the
  103|       |     * strips array will be fully allocated above).
  104|       |     */
  105|    780|    if (strip >= td->td_nstrips && !TIFFGrowStrips(tif, 1, module))
  ------------------
  |  Branch (105:9): [True: 0, False: 780]
  |  Branch (105:36): [True: 0, False: 0]
  ------------------
  106|      0|        return (-1);
  107|    780|    if (strip != tif->tif_curstrip)
  ------------------
  |  Branch (107:9): [True: 780, False: 0]
  ------------------
  108|    780|    {
  109|       |        /*
  110|       |         * Changing strips -- flush any data present.
  111|       |         */
  112|    780|        if (!TIFFFlushData(tif))
  ------------------
  |  Branch (112:13): [True: 0, False: 780]
  ------------------
  113|      0|            return (-1);
  114|    780|        tif->tif_curstrip = strip;
  115|       |        /*
  116|       |         * Watch out for a growing image.  The value of strips/image
  117|       |         * will initially be 1 (since it can't be deduced until the
  118|       |         * imagelength is known).
  119|       |         */
  120|    780|        if (strip >= td->td_stripsperimage && imagegrew)
  ------------------
  |  Branch (120:13): [True: 0, False: 780]
  |  Branch (120:47): [True: 0, False: 0]
  ------------------
  121|      0|            td->td_stripsperimage =
  122|      0|                TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip);
  ------------------
  |  |  282|      0|    (((uint32_t)x < (0xffffffff - (uint32_t)(y - 1)))                          \
  |  |  ------------------
  |  |  |  Branch (282:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  283|      0|         ? ((((uint32_t)(x)) + (((uint32_t)(y)) - 1)) / ((uint32_t)(y)))       \
  |  |  284|      0|         : 0U)
  ------------------
  123|    780|        if (td->td_stripsperimage == 0)
  ------------------
  |  Branch (123:13): [True: 0, False: 780]
  ------------------
  124|      0|        {
  125|      0|            TIFFErrorExtR(tif, module, "Zero strips per image");
  126|      0|            return (-1);
  127|      0|        }
  128|    780|        tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip;
  129|    780|        if ((tif->tif_flags & TIFF_CODERSETUP) == 0)
  ------------------
  |  |  115|    780|#define TIFF_CODERSETUP 0x00020U  /* encoder/decoder setup done */
  ------------------
  |  Branch (129:13): [True: 780, False: 0]
  ------------------
  130|    780|        {
  131|    780|            if (!(*tif->tif_setupencode)(tif))
  ------------------
  |  Branch (131:17): [True: 0, False: 780]
  ------------------
  132|      0|                return (-1);
  133|    780|            tif->tif_flags |= TIFF_CODERSETUP;
  ------------------
  |  |  115|    780|#define TIFF_CODERSETUP 0x00020U  /* encoder/decoder setup done */
  ------------------
  134|    780|        }
  135|       |
  136|    780|        tif->tif_rawcc = 0;
  137|    780|        tif->tif_rawcp = tif->tif_rawdata;
  138|       |
  139|       |        /* this informs TIFFAppendToStrip() we have changed strip */
  140|    780|        tif->tif_curoff = 0;
  141|       |
  142|    780|        if (!(*tif->tif_preencode)(tif, sample))
  ------------------
  |  Branch (142:13): [True: 0, False: 780]
  ------------------
  143|      0|            return (-1);
  144|    780|        tif->tif_flags |= TIFF_POSTENCODE;
  ------------------
  |  |  122|    780|#define TIFF_POSTENCODE 0x01000U  /* need call to postencode routine */
  ------------------
  145|    780|    }
  146|       |    /*
  147|       |     * Ensure the write is either sequential or at the
  148|       |     * beginning of a strip (or that we can randomly
  149|       |     * access the data -- i.e. no encoding).
  150|       |     */
  151|    780|    if (row != tif->tif_row)
  ------------------
  |  Branch (151:9): [True: 0, False: 780]
  ------------------
  152|      0|    {
  153|      0|        if (row < tif->tif_row)
  ------------------
  |  Branch (153:13): [True: 0, False: 0]
  ------------------
  154|      0|        {
  155|       |            /*
  156|       |             * Moving backwards within the same strip:
  157|       |             * backup to the start and then decode
  158|       |             * forward (below).
  159|       |             */
  160|      0|            tif->tif_row =
  161|      0|                (strip % td->td_stripsperimage) * td->td_rowsperstrip;
  162|      0|            tif->tif_rawcp = tif->tif_rawdata;
  163|      0|        }
  164|       |        /*
  165|       |         * Seek forward to the desired row.
  166|       |         */
  167|      0|        if (!(*tif->tif_seek)(tif, row - tif->tif_row))
  ------------------
  |  Branch (167:13): [True: 0, False: 0]
  ------------------
  168|      0|            return (-1);
  169|      0|        tif->tif_row = row;
  170|      0|    }
  171|       |
  172|       |    /* swab if needed - note that source buffer will be altered */
  173|    780|    tif->tif_postdecode(tif, (uint8_t *)buf, tif->tif_scanlinesize);
  174|       |
  175|    780|    status = (*tif->tif_encoderow)(tif, (uint8_t *)buf, tif->tif_scanlinesize,
  176|    780|                                   sample);
  177|       |
  178|       |    /* we are now poised at the beginning of the next row */
  179|    780|    tif->tif_row = row + 1;
  180|    780|    return (status);
  181|    780|}
TIFFSetupStrips:
  554|    780|{
  555|    780|    TIFFDirectory *td = &tif->tif_dir;
  556|       |
  557|    780|    if (isTiled(tif))
  ------------------
  |  |  250|    780|#define isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0)
  |  |  ------------------
  |  |  |  |  120|    780|#define TIFF_ISTILED 0x00400U     /* file is tile, not strip- based */
  |  |  ------------------
  |  |  |  Branch (250:22): [True: 0, False: 780]
  |  |  ------------------
  ------------------
  558|      0|        td->td_stripsperimage = isUnspecified(tif, FIELD_TILEDIMENSIONS)
  ------------------
  |  |  551|      0|    (TIFFFieldSet(tif, f) && (tif)->tif_dir.td_imagelength == 0)
  |  |  ------------------
  |  |  |  |  209|      0|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  |  |  ------------------
  |  |  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  |  |  ------------------
  |  |  |  |  |  |  207|      0|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (209:34): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (551:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  559|      0|                                    ? td->td_samplesperpixel
  560|      0|                                    : TIFFNumberOfTiles(tif);
  561|    780|    else
  562|    780|        td->td_stripsperimage = isUnspecified(tif, FIELD_ROWSPERSTRIP)
  ------------------
  |  |  551|    780|    (TIFFFieldSet(tif, f) && (tif)->tif_dir.td_imagelength == 0)
  |  |  ------------------
  |  |  |  |  209|  1.56k|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|    780|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  |  |  ------------------
  |  |  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  |  |  ------------------
  |  |  |  |  |  |  207|    780|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (209:34): [True: 780, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (551:30): [True: 0, False: 780]
  |  |  ------------------
  ------------------
  563|    780|                                    ? td->td_samplesperpixel
  564|    780|                                    : TIFFNumberOfStrips(tif);
  565|    780|    td->td_nstrips = td->td_stripsperimage;
  566|       |    /* TIFFWriteDirectoryTagData has a limitation to 0x80000000U bytes */
  567|    780|    if (td->td_nstrips >=
  ------------------
  |  Branch (567:9): [True: 0, False: 780]
  ------------------
  568|    780|        0x80000000U / ((tif->tif_flags & TIFF_BIGTIFF) ? 0x8U : 0x4U))
  ------------------
  |  |  131|    780|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (568:24): [True: 0, False: 780]
  ------------------
  569|      0|    {
  570|      0|        TIFFErrorExtR(tif, "TIFFSetupStrips",
  571|      0|                      "Too large Strip/Tile Offsets/ByteCounts arrays");
  572|      0|        return 0;
  573|      0|    }
  574|    780|    if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
  ------------------
  |  |  265|    780|#define PLANARCONFIG_SEPARATE 2            /* separate planes of data */
  ------------------
  |  Branch (574:9): [True: 0, False: 780]
  ------------------
  575|      0|        td->td_stripsperimage /= td->td_samplesperpixel;
  576|    780|    td->td_stripoffset_p = (uint64_t *)_TIFFCheckMalloc(
  577|    780|        tif, td->td_nstrips, sizeof(uint64_t), "for \"StripOffsets\" array");
  578|    780|    td->td_stripbytecount_p = (uint64_t *)_TIFFCheckMalloc(
  579|    780|        tif, td->td_nstrips, sizeof(uint64_t), "for \"StripByteCounts\" array");
  580|    780|    if (td->td_stripoffset_p == NULL || td->td_stripbytecount_p == NULL)
  ------------------
  |  Branch (580:9): [True: 0, False: 780]
  |  Branch (580:41): [True: 0, False: 780]
  ------------------
  581|      0|        return (0);
  582|       |    /*
  583|       |     * Place data at the end-of-file
  584|       |     * (by setting offsets to zero).
  585|       |     */
  586|    780|    _TIFFmemset(td->td_stripoffset_p, 0, td->td_nstrips * sizeof(uint64_t));
  587|    780|    _TIFFmemset(td->td_stripbytecount_p, 0, td->td_nstrips * sizeof(uint64_t));
  588|    780|    TIFFSetFieldBit(tif, FIELD_STRIPOFFSETS);
  ------------------
  |  |  210|    780|#define TIFFSetFieldBit(tif, field) (BITFIELDn(tif, field) |= BITn(field))
  |  |  ------------------
  |  |  |  |  208|    780|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFSetFieldBit(tif, field) (BITFIELDn(tif, field) |= BITn(field))
  |  |  ------------------
  |  |  |  |  207|    780|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  ------------------
  589|    780|    TIFFSetFieldBit(tif, FIELD_STRIPBYTECOUNTS);
  ------------------
  |  |  210|    780|#define TIFFSetFieldBit(tif, field) (BITFIELDn(tif, field) |= BITn(field))
  |  |  ------------------
  |  |  |  |  208|    780|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFSetFieldBit(tif, field) (BITFIELDn(tif, field) |= BITn(field))
  |  |  ------------------
  |  |  |  |  207|    780|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  ------------------
  590|    780|    return (1);
  591|    780|}
TIFFWriteCheck:
  601|    780|{
  602|    780|    if (tif->tif_mode == O_RDONLY)
  ------------------
  |  Branch (602:9): [True: 0, False: 780]
  ------------------
  603|      0|    {
  604|      0|        TIFFErrorExtR(tif, module, "File not open for writing");
  605|      0|        return (0);
  606|      0|    }
  607|    780|    if (tiles ^ isTiled(tif))
  ------------------
  |  |  250|    780|#define isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0)
  |  |  ------------------
  |  |  |  |  120|    780|#define TIFF_ISTILED 0x00400U     /* file is tile, not strip- based */
  |  |  ------------------
  ------------------
  |  Branch (607:9): [True: 0, False: 780]
  ------------------
  608|      0|    {
  609|      0|        TIFFErrorExtR(tif, module,
  610|      0|                      tiles ? "Can not write tiles to a striped image"
  ------------------
  |  Branch (610:23): [True: 0, False: 0]
  ------------------
  611|      0|                            : "Can not write scanlines to a tiled image");
  612|      0|        return (0);
  613|      0|    }
  614|       |
  615|    780|    _TIFFFillStriles(tif);
  616|       |
  617|       |    /*
  618|       |     * On the first write verify all the required information
  619|       |     * has been setup and initialize any data structures that
  620|       |     * had to wait until directory information was set.
  621|       |     * Note that a lot of our work is assumed to remain valid
  622|       |     * because we disallow any of the important parameters
  623|       |     * from changing after we start writing (i.e. once
  624|       |     * TIFF_BEENWRITING is set, TIFFSetField will only allow
  625|       |     * the image's length to be changed).
  626|       |     */
  627|    780|    if (!TIFFFieldSet(tif, FIELD_IMAGEDIMENSIONS))
  ------------------
  |  |  209|    780|#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  208|    780|#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n) / 32])
  |  |  ------------------
  |  |               #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
  |  |  ------------------
  |  |  |  |  207|    780|#define BITn(n) (((uint32_t)1L) << ((n)&0x1f))
  |  |  ------------------
  ------------------
  |  Branch (627:9): [True: 0, False: 780]
  ------------------
  628|      0|    {
  629|      0|        TIFFErrorExtR(tif, module,
  630|      0|                      "Must set \"ImageWidth\" before writing data");
  631|      0|        return (0);
  632|      0|    }
  633|    780|    if (tif->tif_dir.td_stripoffset_p == NULL && !TIFFSetupStrips(tif))
  ------------------
  |  Branch (633:9): [True: 780, False: 0]
  |  Branch (633:50): [True: 0, False: 780]
  ------------------
  634|      0|    {
  635|      0|        tif->tif_dir.td_nstrips = 0;
  636|      0|        TIFFErrorExtR(tif, module, "No space for %s arrays",
  637|      0|                      isTiled(tif) ? "tile" : "strip");
  ------------------
  |  |  250|      0|#define isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0)
  |  |  ------------------
  |  |  |  |  120|      0|#define TIFF_ISTILED 0x00400U     /* file is tile, not strip- based */
  |  |  ------------------
  |  |  |  Branch (250:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  638|      0|        return (0);
  639|      0|    }
  640|    780|    if (isTiled(tif))
  ------------------
  |  |  250|    780|#define isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0)
  |  |  ------------------
  |  |  |  |  120|    780|#define TIFF_ISTILED 0x00400U     /* file is tile, not strip- based */
  |  |  ------------------
  |  |  |  Branch (250:22): [True: 0, False: 780]
  |  |  ------------------
  ------------------
  641|      0|    {
  642|      0|        tif->tif_tilesize = TIFFTileSize(tif);
  643|      0|        if (tif->tif_tilesize == 0)
  ------------------
  |  Branch (643:13): [True: 0, False: 0]
  ------------------
  644|      0|            return (0);
  645|      0|    }
  646|    780|    else
  647|    780|        tif->tif_tilesize = (tmsize_t)(-1);
  648|    780|    tif->tif_scanlinesize = TIFFScanlineSize(tif);
  649|    780|    if (tif->tif_scanlinesize == 0)
  ------------------
  |  Branch (649:9): [True: 0, False: 780]
  ------------------
  650|      0|        return (0);
  651|    780|    tif->tif_flags |= TIFF_BEENWRITING;
  ------------------
  |  |  116|    780|#define TIFF_BEENWRITING 0x00040U /* written 1+ scanlines to file */
  ------------------
  652|       |
  653|    780|    if (tif->tif_dir.td_stripoffset_entry.tdir_tag != 0 &&
  ------------------
  |  Branch (653:9): [True: 0, False: 780]
  ------------------
  654|    780|        tif->tif_dir.td_stripoffset_entry.tdir_count == 0 &&
  ------------------
  |  Branch (654:9): [True: 0, False: 0]
  ------------------
  655|    780|        tif->tif_dir.td_stripoffset_entry.tdir_type == 0 &&
  ------------------
  |  Branch (655:9): [True: 0, False: 0]
  ------------------
  656|    780|        tif->tif_dir.td_stripoffset_entry.tdir_offset.toff_long8 == 0 &&
  ------------------
  |  Branch (656:9): [True: 0, False: 0]
  ------------------
  657|    780|        tif->tif_dir.td_stripbytecount_entry.tdir_tag != 0 &&
  ------------------
  |  Branch (657:9): [True: 0, False: 0]
  ------------------
  658|    780|        tif->tif_dir.td_stripbytecount_entry.tdir_count == 0 &&
  ------------------
  |  Branch (658:9): [True: 0, False: 0]
  ------------------
  659|    780|        tif->tif_dir.td_stripbytecount_entry.tdir_type == 0 &&
  ------------------
  |  Branch (659:9): [True: 0, False: 0]
  ------------------
  660|    780|        tif->tif_dir.td_stripbytecount_entry.tdir_offset.toff_long8 == 0 &&
  ------------------
  |  Branch (660:9): [True: 0, False: 0]
  ------------------
  661|    780|        !(tif->tif_flags & TIFF_DIRTYDIRECT))
  ------------------
  |  |  113|      0|#define TIFF_DIRTYDIRECT 0x00008U /* current directory must be written */
  ------------------
  |  Branch (661:9): [True: 0, False: 0]
  ------------------
  662|      0|    {
  663|      0|        TIFFForceStrileArrayWriting(tif);
  664|      0|    }
  665|       |
  666|    780|    return (1);
  667|    780|}
TIFFWriteBufferSetup:
  673|    780|{
  674|    780|    static const char module[] = "TIFFWriteBufferSetup";
  675|       |
  676|    780|    if (tif->tif_rawdata)
  ------------------
  |  Branch (676:9): [True: 0, False: 780]
  ------------------
  677|      0|    {
  678|      0|        if (tif->tif_flags & TIFF_MYBUFFER)
  ------------------
  |  |  119|      0|#define TIFF_MYBUFFER 0x00200U    /* my raw data buffer; free on close */
  ------------------
  |  Branch (678:13): [True: 0, False: 0]
  ------------------
  679|      0|        {
  680|      0|            _TIFFfreeExt(tif, tif->tif_rawdata);
  681|      0|            tif->tif_flags &= ~TIFF_MYBUFFER;
  ------------------
  |  |  119|      0|#define TIFF_MYBUFFER 0x00200U    /* my raw data buffer; free on close */
  ------------------
  682|      0|        }
  683|      0|        tif->tif_rawdata = NULL;
  684|      0|    }
  685|    780|    if (size == (tmsize_t)(-1))
  ------------------
  |  Branch (685:9): [True: 780, False: 0]
  ------------------
  686|    780|    {
  687|    780|        size = (isTiled(tif) ? tif->tif_tilesize : TIFFStripSize(tif));
  ------------------
  |  |  250|    780|#define isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0)
  |  |  ------------------
  |  |  |  |  120|    780|#define TIFF_ISTILED 0x00400U     /* file is tile, not strip- based */
  |  |  ------------------
  |  |  |  Branch (250:22): [True: 0, False: 780]
  |  |  ------------------
  ------------------
  688|       |
  689|       |        /* Adds 10% margin for cases where compression would expand a bit */
  690|    780|        if (size < TIFF_TMSIZE_T_MAX - size / 10)
  ------------------
  |  |   66|    780|#define TIFF_TMSIZE_T_MAX (tmsize_t)(SIZE_MAX >> 1)
  ------------------
  |  Branch (690:13): [True: 780, False: 0]
  ------------------
  691|    780|            size += size / 10;
  692|       |        /*
  693|       |         * Make raw data buffer at least 8K
  694|       |         */
  695|    780|        if (size < 8 * 1024)
  ------------------
  |  Branch (695:13): [True: 443, False: 337]
  ------------------
  696|    443|            size = 8 * 1024;
  697|    780|        bp = NULL; /* NB: force malloc */
  698|    780|    }
  699|    780|    if (bp == NULL)
  ------------------
  |  Branch (699:9): [True: 780, False: 0]
  ------------------
  700|    780|    {
  701|    780|        bp = _TIFFmallocExt(tif, size);
  702|    780|        if (bp == NULL)
  ------------------
  |  Branch (702:13): [True: 0, False: 780]
  ------------------
  703|      0|        {
  704|      0|            TIFFErrorExtR(tif, module, "No space for output buffer");
  705|      0|            return (0);
  706|      0|        }
  707|    780|        tif->tif_flags |= TIFF_MYBUFFER;
  ------------------
  |  |  119|    780|#define TIFF_MYBUFFER 0x00200U    /* my raw data buffer; free on close */
  ------------------
  708|    780|    }
  709|      0|    else
  710|      0|        tif->tif_flags &= ~TIFF_MYBUFFER;
  ------------------
  |  |  119|      0|#define TIFF_MYBUFFER 0x00200U    /* my raw data buffer; free on close */
  ------------------
  711|    780|    tif->tif_rawdata = (uint8_t *)bp;
  712|    780|    tif->tif_rawdatasize = size;
  713|    780|    tif->tif_rawcc = 0;
  714|    780|    tif->tif_rawcp = tif->tif_rawdata;
  715|    780|    tif->tif_flags |= TIFF_BUFFERSETUP;
  ------------------
  |  |  114|    780|#define TIFF_BUFFERSETUP 0x00010U /* data buffers setup */
  ------------------
  716|    780|    return (1);
  717|    780|}
TIFFFlushData1:
  927|  1.76k|{
  928|  1.76k|    if (tif->tif_rawcc > 0 && tif->tif_flags & TIFF_BUF4WRITE)
  ------------------
  |  |  132|    989|#define TIFF_BUF4WRITE 0x100000U  /* rawcc bytes are for writing */
  ------------------
  |  Branch (928:9): [True: 989, False: 780]
  |  Branch (928:31): [True: 989, False: 0]
  ------------------
  929|    989|    {
  930|    989|        if (!isFillOrder(tif, tif->tif_dir.td_fillorder) &&
  ------------------
  |  |  252|  1.97k|#define isFillOrder(tif, o) (((tif)->tif_flags & (o)) != 0)
  ------------------
  |  Branch (930:13): [True: 0, False: 989]
  ------------------
  931|    989|            (tif->tif_flags & TIFF_NOBITREV) == 0)
  ------------------
  |  |  118|      0|#define TIFF_NOBITREV 0x00100U    /* inhibit bit reversal logic */
  ------------------
  |  Branch (931:13): [True: 0, False: 0]
  ------------------
  932|      0|            TIFFReverseBits((uint8_t *)tif->tif_rawdata, tif->tif_rawcc);
  933|    989|        if (!TIFFAppendToStrip(
  ------------------
  |  Branch (933:13): [True: 0, False: 989]
  ------------------
  934|    989|                tif, isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip,
  ------------------
  |  |  250|    989|#define isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0)
  |  |  ------------------
  |  |  |  |  120|    989|#define TIFF_ISTILED 0x00400U     /* file is tile, not strip- based */
  |  |  ------------------
  |  |  |  Branch (250:22): [True: 0, False: 989]
  |  |  ------------------
  ------------------
  935|    989|                tif->tif_rawdata, tif->tif_rawcc))
  936|      0|        {
  937|       |            /* We update those variables even in case of error since there's */
  938|       |            /* code that doesn't really check the return code of this */
  939|       |            /* function */
  940|      0|            tif->tif_rawcc = 0;
  941|      0|            tif->tif_rawcp = tif->tif_rawdata;
  942|      0|            return (0);
  943|      0|        }
  944|    989|        tif->tif_rawcc = 0;
  945|    989|        tif->tif_rawcp = tif->tif_rawdata;
  946|    989|    }
  947|  1.76k|    return (1);
  948|  1.76k|}
tif_write.c:TIFFAppendToStrip:
  761|    989|{
  762|    989|    static const char module[] = "TIFFAppendToStrip";
  763|    989|    TIFFDirectory *td = &tif->tif_dir;
  764|    989|    uint64_t m;
  765|    989|    int64_t old_byte_count = -1;
  766|       |
  767|    989|    if (tif->tif_curoff == 0)
  ------------------
  |  Branch (767:9): [True: 780, False: 209]
  ------------------
  768|    780|        tif->tif_lastvalidoff = 0;
  769|       |
  770|    989|    if (td->td_stripoffset_p[strip] == 0 || tif->tif_curoff == 0)
  ------------------
  |  Branch (770:9): [True: 780, False: 209]
  |  Branch (770:45): [True: 0, False: 209]
  ------------------
  771|    780|    {
  772|    780|        assert(td->td_nstrips > 0);
  773|       |
  774|    780|        if (td->td_stripbytecount_p[strip] != 0 &&
  ------------------
  |  Branch (774:13): [True: 0, False: 780]
  ------------------
  775|    780|            td->td_stripoffset_p[strip] != 0 &&
  ------------------
  |  Branch (775:13): [True: 0, False: 0]
  ------------------
  776|    780|            td->td_stripbytecount_p[strip] >= (uint64_t)cc)
  ------------------
  |  Branch (776:13): [True: 0, False: 0]
  ------------------
  777|      0|        {
  778|       |            /*
  779|       |             * There is already tile data on disk, and the new tile
  780|       |             * data we have will fit in the same space.  The only
  781|       |             * aspect of this that is risky is that there could be
  782|       |             * more data to append to this strip before we are done
  783|       |             * depending on how we are getting called.
  784|       |             */
  785|      0|            if (!SeekOK(tif, td->td_stripoffset_p[strip]))
  ------------------
  |  |  274|      0|#define SeekOK(tif, off) _TIFFSeekOK(tif, off)
  ------------------
  |  Branch (785:17): [True: 0, False: 0]
  ------------------
  786|      0|            {
  787|      0|                TIFFErrorExtR(tif, module, "Seek error at scanline %lu",
  788|      0|                              (unsigned long)tif->tif_row);
  789|      0|                return (0);
  790|      0|            }
  791|       |
  792|      0|            tif->tif_lastvalidoff =
  793|      0|                td->td_stripoffset_p[strip] + td->td_stripbytecount_p[strip];
  794|      0|        }
  795|    780|        else
  796|    780|        {
  797|       |            /*
  798|       |             * Seek to end of file, and set that as our location to
  799|       |             * write this strip.
  800|       |             */
  801|    780|            td->td_stripoffset_p[strip] = TIFFSeekFile(tif, 0, SEEK_END);
  ------------------
  |  |  259|    780|    ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence)))
  ------------------
  802|    780|            tif->tif_flags |= TIFF_DIRTYSTRIP;
  ------------------
  |  |  133|    780|#define TIFF_DIRTYSTRIP 0x200000U /* stripoffsets/stripbytecount dirty*/
  ------------------
  803|    780|        }
  804|       |
  805|    780|        tif->tif_curoff = td->td_stripoffset_p[strip];
  806|       |
  807|       |        /*
  808|       |         * We are starting a fresh strip/tile, so set the size to zero.
  809|       |         */
  810|    780|        old_byte_count = td->td_stripbytecount_p[strip];
  811|    780|        td->td_stripbytecount_p[strip] = 0;
  812|    780|    }
  813|       |
  814|    989|    m = tif->tif_curoff + cc;
  815|    989|    if (!(tif->tif_flags & TIFF_BIGTIFF))
  ------------------
  |  |  131|    989|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (815:9): [True: 989, False: 0]
  ------------------
  816|    989|        m = (uint32_t)m;
  817|    989|    if ((m < tif->tif_curoff) || (m < (uint64_t)cc))
  ------------------
  |  Branch (817:9): [True: 0, False: 989]
  |  Branch (817:34): [True: 0, False: 989]
  ------------------
  818|      0|    {
  819|      0|        TIFFErrorExtR(tif, module, "Maximum TIFF file size exceeded");
  820|      0|        return (0);
  821|      0|    }
  822|       |
  823|    989|    if (tif->tif_lastvalidoff != 0 && m > tif->tif_lastvalidoff &&
  ------------------
  |  Branch (823:9): [True: 0, False: 989]
  |  Branch (823:39): [True: 0, False: 0]
  ------------------
  824|    989|        td->td_stripbytecount_p[strip] > 0)
  ------------------
  |  Branch (824:9): [True: 0, False: 0]
  ------------------
  825|      0|    {
  826|       |        /* Ouch: we have detected that we are rewriting in place a strip/tile */
  827|       |        /* with several calls to TIFFAppendToStrip(). The first call was with */
  828|       |        /* a size smaller than the previous size of the strip/tile, so we */
  829|       |        /* opted to rewrite in place, but a following call causes us to go */
  830|       |        /* outsize of the strip/tile area, so we have to finally go for a */
  831|       |        /* append-at-end-of-file strategy, and start by moving what we already
  832|       |         */
  833|       |        /* wrote. */
  834|      0|        tmsize_t tempSize;
  835|      0|        void *temp;
  836|      0|        uint64_t offsetRead;
  837|      0|        uint64_t offsetWrite;
  838|      0|        uint64_t toCopy = td->td_stripbytecount_p[strip];
  839|       |
  840|      0|        if (toCopy < 1024 * 1024)
  ------------------
  |  Branch (840:13): [True: 0, False: 0]
  ------------------
  841|      0|            tempSize = (tmsize_t)toCopy;
  842|      0|        else
  843|      0|            tempSize = 1024 * 1024;
  844|       |
  845|      0|        offsetRead = td->td_stripoffset_p[strip];
  846|      0|        offsetWrite = TIFFSeekFile(tif, 0, SEEK_END);
  ------------------
  |  |  259|      0|    ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence)))
  ------------------
  847|       |
  848|      0|        m = offsetWrite + toCopy + cc;
  849|      0|        if (!(tif->tif_flags & TIFF_BIGTIFF) && m != (uint32_t)m)
  ------------------
  |  |  131|      0|#define TIFF_BIGTIFF 0x80000U     /* read/write bigtiff */
  ------------------
  |  Branch (849:13): [True: 0, False: 0]
  |  Branch (849:49): [True: 0, False: 0]
  ------------------
  850|      0|        {
  851|      0|            TIFFErrorExtR(tif, module, "Maximum TIFF file size exceeded");
  852|      0|            return (0);
  853|      0|        }
  854|       |
  855|      0|        temp = _TIFFmallocExt(tif, tempSize);
  856|      0|        if (temp == NULL)
  ------------------
  |  Branch (856:13): [True: 0, False: 0]
  ------------------
  857|      0|        {
  858|      0|            TIFFErrorExtR(tif, module, "No space for output buffer");
  859|      0|            return (0);
  860|      0|        }
  861|       |
  862|      0|        tif->tif_flags |= TIFF_DIRTYSTRIP;
  ------------------
  |  |  133|      0|#define TIFF_DIRTYSTRIP 0x200000U /* stripoffsets/stripbytecount dirty*/
  ------------------
  863|       |
  864|      0|        td->td_stripoffset_p[strip] = offsetWrite;
  865|      0|        td->td_stripbytecount_p[strip] = 0;
  866|       |
  867|       |        /* Move data written by previous calls to us at end of file */
  868|      0|        while (toCopy > 0)
  ------------------
  |  Branch (868:16): [True: 0, False: 0]
  ------------------
  869|      0|        {
  870|      0|            if (!SeekOK(tif, offsetRead))
  ------------------
  |  |  274|      0|#define SeekOK(tif, off) _TIFFSeekOK(tif, off)
  ------------------
  |  Branch (870:17): [True: 0, False: 0]
  ------------------
  871|      0|            {
  872|      0|                TIFFErrorExtR(tif, module, "Seek error");
  873|      0|                _TIFFfreeExt(tif, temp);
  874|      0|                return (0);
  875|      0|            }
  876|      0|            if (!ReadOK(tif, temp, tempSize))
  ------------------
  |  |  271|      0|#define ReadOK(tif, buf, size) (TIFFReadFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  255|      0|    ((*(tif)->tif_readproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (876:17): [True: 0, False: 0]
  ------------------
  877|      0|            {
  878|      0|                TIFFErrorExtR(tif, module, "Cannot read");
  879|      0|                _TIFFfreeExt(tif, temp);
  880|      0|                return (0);
  881|      0|            }
  882|      0|            if (!SeekOK(tif, offsetWrite))
  ------------------
  |  |  274|      0|#define SeekOK(tif, off) _TIFFSeekOK(tif, off)
  ------------------
  |  Branch (882:17): [True: 0, False: 0]
  ------------------
  883|      0|            {
  884|      0|                TIFFErrorExtR(tif, module, "Seek error");
  885|      0|                _TIFFfreeExt(tif, temp);
  886|      0|                return (0);
  887|      0|            }
  888|      0|            if (!WriteOK(tif, temp, tempSize))
  ------------------
  |  |  277|      0|#define WriteOK(tif, buf, size) (TIFFWriteFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  257|      0|    ((*(tif)->tif_writeproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (888:17): [True: 0, False: 0]
  ------------------
  889|      0|            {
  890|      0|                TIFFErrorExtR(tif, module, "Cannot write");
  891|      0|                _TIFFfreeExt(tif, temp);
  892|      0|                return (0);
  893|      0|            }
  894|      0|            offsetRead += tempSize;
  895|      0|            offsetWrite += tempSize;
  896|      0|            td->td_stripbytecount_p[strip] += tempSize;
  897|      0|            toCopy -= tempSize;
  898|      0|        }
  899|      0|        _TIFFfreeExt(tif, temp);
  900|       |
  901|       |        /* Append the data of this call */
  902|      0|        offsetWrite += cc;
  903|      0|        m = offsetWrite;
  904|      0|    }
  905|       |
  906|    989|    if (!WriteOK(tif, data, cc))
  ------------------
  |  |  277|    989|#define WriteOK(tif, buf, size) (TIFFWriteFile((tif), (buf), (size)) == (size))
  |  |  ------------------
  |  |  |  |  257|    989|    ((*(tif)->tif_writeproc)((tif)->tif_clientdata, (buf), (size)))
  |  |  ------------------
  ------------------
  |  Branch (906:9): [True: 0, False: 989]
  ------------------
  907|      0|    {
  908|      0|        TIFFErrorExtR(tif, module, "Write error at scanline %lu",
  909|      0|                      (unsigned long)tif->tif_row);
  910|      0|        return (0);
  911|      0|    }
  912|    989|    tif->tif_curoff = m;
  913|    989|    td->td_stripbytecount_p[strip] += cc;
  914|       |
  915|    989|    if ((int64_t)td->td_stripbytecount_p[strip] != old_byte_count)
  ------------------
  |  Branch (915:9): [True: 989, False: 0]
  ------------------
  916|    989|        tif->tif_flags |= TIFF_DIRTYSTRIP;
  ------------------
  |  |  133|    989|#define TIFF_DIRTYSTRIP 0x200000U /* stripoffsets/stripbytecount dirty*/
  ------------------
  917|       |
  918|    989|    return (1);
  919|    989|}

_ZN10Imf_opencv14ChromaticitiesC2ERKN12Imath_opencv4Vec2IfEES5_S5_S5_:
   55|      1|    red (red),
   56|      1|    green (green),
   57|      1|    blue (blue),
   58|      1|    white (white)
   59|      1|{
   60|       |    // empty
   61|      1|}

_ZN12Imath_opencv3BoxINS_4Vec2IiEEEC2Ev:
  404|      1|{
  405|      1|    makeEmpty();
  406|      1|}
_ZN12Imath_opencv3BoxINS_4Vec2IiEEE9makeEmptyEv:
  443|      1|{
  444|      1|    min = Vec2<T>(Vec2<T>::baseTypeMax());
  445|      1|    max = Vec2<T>(Vec2<T>::baseTypeMin());
  446|      1|}

_ZN12Imath_opencv6limitsIiE3minEv:
  191|      1|    static int			min()		{return INT_MIN;}
_ZN12Imath_opencv6limitsIiE3maxEv:
  192|      1|    static int			max()		{return INT_MAX;}

_ZN12Imath_opencv4Vec2IfEC2ERKS1_:
  891|      4|{
  892|      4|    x = v.x;
  893|      4|    y = v.y;
  894|      4|}
_ZN12Imath_opencv4Vec2IiEC2Ev:
  869|      2|{
  870|       |    // empty
  871|      2|}
_ZN12Imath_opencv4Vec2IiE11baseTypeMaxEv:
  248|      1|    static T		baseTypeMax()		{return limits<T>::max();}
_ZN12Imath_opencv4Vec2IiEC2Ei:
  876|      2|{
  877|      2|    x = y = a;
  878|      2|}
_ZN12Imath_opencv4Vec2IiEaSERKS1_:
  908|      2|{
  909|      2|    x = v.x;
  910|      2|    y = v.y;
  911|      2|    return *this;
  912|      2|}
_ZN12Imath_opencv4Vec2IiE11baseTypeMinEv:
  247|      1|    static T		baseTypeMin()		{return limits<T>::min();}
_ZN12Imath_opencv4Vec2IfEC2Eff:
  883|      4|{
  884|      4|    x = a;
  885|      4|    y = b;
  886|      4|}

matrix_wrap.cpp:_ZN2cvanERKiRKNS_11_InputArray8KindFlagE:
  613|  3.12k|static inline EnumType operator&(const Arg1Type& a, const Arg2Type& b)                                \
  614|  3.12k|{                                                                                                     \
  615|  3.12k|    typedef std::underlying_type<EnumType>::type UnderlyingType;                                      \
  616|  3.12k|    return static_cast<EnumType>(static_cast<UnderlyingType>(a) & static_cast<UnderlyingType>(b));    \
  617|  3.12k|}                                                                                                     \

_ZN2cv3PtrINS_16BaseImageDecoderEEC2EOS2_:
   86|     29|    inline Ptr(Ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_10BmpDecoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_10BmpDecoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageDecoderEEC2INS_10BmpDecoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageEncoderEEC2EOS2_:
   86|     31|    inline Ptr(Ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_10BmpEncoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_10BmpEncoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageEncoderEEC2INS_10BmpEncoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_10GifDecoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_10GifDecoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageDecoderEEC2INS_10GifDecoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_10GifEncoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_10GifEncoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageEncoderEEC2INS_10GifEncoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_10HdrDecoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_10HdrDecoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageDecoderEEC2INS_10HdrDecoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_10HdrEncoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_10HdrEncoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageEncoderEEC2INS_10HdrEncoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_11JpegDecoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_11JpegDecoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageDecoderEEC2INS_11JpegDecoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_11JpegEncoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_11JpegEncoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageEncoderEEC2INS_11JpegEncoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_11WebPDecoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_11WebPDecoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageDecoderEEC2INS_11WebPDecoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_11WebPEncoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_11WebPEncoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageEncoderEEC2INS_11WebPEncoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_16SunRasterDecoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_16SunRasterDecoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageDecoderEEC2INS_16SunRasterDecoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_16SunRasterEncoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_16SunRasterEncoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageEncoderEEC2INS_16SunRasterEncoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_10PxMDecoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_10PxMDecoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageDecoderEEC2INS_10PxMDecoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_10PxMEncoderEJNS_7PxMModeEEEENS_3PtrIT_EEDpRKT0_:
  144|      4|{
  145|      4|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      4|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      4|}
_ZN2cv3PtrINS_10PxMEncoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      4|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageEncoderEEC2INS_10PxMEncoderEEEONS0_IT_EE:
   89|      4|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_10PAMDecoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_10PAMDecoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageDecoderEEC2INS_10PAMDecoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_10PAMEncoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_10PAMEncoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageEncoderEEC2INS_10PAMEncoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_10PFMDecoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_10PFMDecoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageDecoderEEC2INS_10PFMDecoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_10PFMEncoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_10PFMEncoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageEncoderEEC2INS_10PFMEncoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_11TiffDecoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_11TiffDecoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageDecoderEEC2INS_11TiffDecoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_11TiffEncoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_11TiffEncoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|    781|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageEncoderEEC2INS_11TiffEncoderEEEONS0_IT_EE:
   89|    781|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_10PngDecoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_10PngDecoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageDecoderEEC2INS_10PngDecoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_10PngEncoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_10PngEncoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageEncoderEEC2INS_10PngEncoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_19Jpeg2KJP2OpjDecoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_19Jpeg2KJP2OpjDecoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageDecoderEEC2INS_19Jpeg2KJP2OpjDecoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_19Jpeg2KJ2KOpjDecoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_19Jpeg2KJ2KOpjDecoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageDecoderEEC2INS_19Jpeg2KJ2KOpjDecoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_16Jpeg2KOpjEncoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_16Jpeg2KOpjEncoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageEncoderEEC2INS_16Jpeg2KOpjEncoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_10ExrDecoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_10ExrDecoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageDecoderEEC2INS_10ExrDecoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
loadsave.cpp:_ZN2cvL7makePtrINS_10ExrEncoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|      1|{
  145|      1|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|      1|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|      1|}
_ZN2cv3PtrINS_10ExrEncoderEEC2EONSt3__110shared_ptrIS1_EE:
   92|      1|    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZN2cv3PtrINS_16BaseImageEncoderEEC2INS_10ExrEncoderEEEONS0_IT_EE:
   89|      1|    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}
_ZNK2cv3PtrINS_16BaseImageEncoderEEptEv:
  124|  14.0k|    T* operator->() const CV_NOEXCEPT { return std::shared_ptr<T>::get();}
_ZN2cv3PtrIvEC2Ev:
   78|      1|    inline Ptr() CV_NOEXCEPT : std::shared_ptr<T>() {}
_ZN2cv3PtrIvE7releaseEv:
  128|      1|    inline void release() { std::shared_ptr<T>::reset(); }
grfmt_tiff.cpp:_ZN2cvL7makePtrINS_11TiffEncoderEJEEENS_3PtrIT_EEDpRKT0_:
  144|    780|{
  145|    780|    static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
  146|    780|    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);
  147|    780|}
_ZN2cv3PtrIvEC2I4tiffPFvPvEEEPT_T0_:
   80|    780|    template<typename Y, typename D> inline Ptr(Y* p, D d) : std::shared_ptr<T>(p, d) {}
_ZN2cv3PtrINS_5utils5trace7details12TraceStorageEEC2Ev:
   78|      2|    inline Ptr() CV_NOEXCEPT : std::shared_ptr<T>() {}
_ZN2cv3PtrINSt3__16vectorINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS8_EEEEEC2Ev:
   78|      4|    inline Ptr() CV_NOEXCEPT : std::shared_ptr<T>() {}

_ZNK2cv11_InputArray6getMatEi:
  181|    780|{
  182|    780|    if( kind() == MAT && i < 0 )
  ------------------
  |  Branch (182:9): [True: 780, False: 0]
  |  Branch (182:26): [True: 780, False: 0]
  ------------------
  183|    780|        return *(const Mat*)obj;
  184|      0|    return getMat_(i);
  185|    780|}
_ZNK2cv11_InputArray11isMatVectorEv:
  189|    780|inline bool _InputArray::isMatVector() const { return kind() == _InputArray::STD_VECTOR_MAT; }
_ZNK2cv11_InputArray12isUMatVectorEv:
  190|    780|inline bool _InputArray::isUMatVector() const  { return kind() == _InputArray::STD_VECTOR_UMAT; }
_ZNK2cv3Mat4typeEv:
  682|  1.56k|{
  683|  1.56k|    return CV_MAT_TYPE(flags);
  ------------------
  |  |  498|  1.56k|#define CV_MAT_TYPE(flags)      ((flags) & CV_MAT_TYPE_MASK)
  |  |  ------------------
  |  |  |  |  497|  1.56k|#define CV_MAT_TYPE_MASK        (CV_DEPTH_MAX*CV_CN_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  1.56k|#define CV_DEPTH_MAX  (1 << CV_CN_SHIFT)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  1.56k|#define CV_CN_SHIFT   3
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define CV_MAT_TYPE_MASK        (CV_DEPTH_MAX*CV_CN_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|  1.56k|#define CV_CN_MAX     512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  684|  1.56k|}
_ZNK2cv3Mat5depthEv:
  688|    780|{
  689|    780|    return CV_MAT_DEPTH(flags);
  ------------------
  |  |   83|    780|#define CV_MAT_DEPTH(flags)     ((flags) & CV_MAT_DEPTH_MASK)
  |  |  ------------------
  |  |  |  |   82|    780|#define CV_MAT_DEPTH_MASK       (CV_DEPTH_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|    780|#define CV_DEPTH_MAX  (1 << CV_CN_SHIFT)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  690|    780|}
_ZNK2cv3Mat8channelsEv:
  694|  1.56k|{
  695|  1.56k|    return CV_MAT_CN(flags);
  ------------------
  |  |  496|  1.56k|#define CV_MAT_CN(flags)        ((((flags) & CV_MAT_CN_MASK) >> CV_CN_SHIFT) + 1)
  |  |  ------------------
  |  |  |  |  495|  1.56k|#define CV_MAT_CN_MASK          ((CV_CN_MAX - 1) << CV_CN_SHIFT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|  1.56k|#define CV_CN_MAX     512
  |  |  |  |  ------------------
  |  |  |  |               #define CV_MAT_CN_MASK          ((CV_CN_MAX - 1) << CV_CN_SHIFT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  1.56k|#define CV_CN_SHIFT   3
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define CV_MAT_CN(flags)        ((((flags) & CV_MAT_CN_MASK) >> CV_CN_SHIFT) + 1)
  |  |  ------------------
  |  |  |  |   70|  1.56k|#define CV_CN_SHIFT   3
  |  |  ------------------
  ------------------
  696|  1.56k|}
_ZNK2cv3Mat3ptrEi:
  707|    780|{
  708|    780|    CV_DbgAssert( y == 0 || (data && dims >= 1 && (unsigned)y < (unsigned)size.p[0]) );
  709|    780|    return data + step.p[0] * y;
  710|    780|}
_ZNK2cv7MatStepixEi:
 1252|  6.24k|{
 1253|  6.24k|    return p[i];
 1254|  6.24k|}
_ZN2cv7MatStepixEi:
 1258|  12.4k|{
 1259|  12.4k|    return p[i];
 1260|  12.4k|}
_ZN2cv11_InputArrayC2Ev:
  101|      2|inline _InputArray::_InputArray() { init(0 + NONE, 0); }
_ZN2cv12_OutputArrayC2Ev:
  200|      2|inline _OutputArray::_OutputArray() { init(+NONE + ACCESS_WRITE, 0); }
_ZN2cv7MatSizeC2EPi:
 1187|  6.25k|    : p(_p) {}
_ZN2cv7MatStepC2Ev:
 1240|  2.34k|{
 1241|  2.34k|    p = buf; p[0] = p[1] = 0;
 1242|  2.34k|}
_ZN2cv7MatStepC2Em:
 1246|  3.91k|{
 1247|  3.91k|    p = buf; p[0] = s; p[1] = 0;
 1248|  3.91k|}
_ZN2cv17_InputOutputArrayC2Ev:
  326|      2|inline _InputOutputArray::_InputOutputArray() { init(0+ACCESS_RW, 0); }

_ZN2cv3VecIdLi4EEC2ERKS1_:
  826|     14|    : Matx<_Tp, cn, 1>(m.val) {}
_ZN2cv4MatxIdLi4ELi1EEC2EPKd:
  280|     14|{
  281|     70|    for( int i = 0; i < channels; i++ ) val[i] = values[i];
  ------------------
  |  Branch (281:21): [True: 56, False: 14]
  ------------------
  282|     14|}
_ZN2cv3VecIdLi4EEC2Ev:
  770|     14|Vec<_Tp, cn>::Vec() {}
_ZN2cv4MatxIdLi4ELi1EEC2Ev:
  149|     14|{
  150|     70|    for(int i = 0; i < channels; i++) val[i] = _Tp(0);
  ------------------
  |  Branch (150:20): [True: 56, False: 14]
  ------------------
  151|     14|}
_ZN2cv3VecIhLi3EEC2Ev:
  770|      1|Vec<_Tp, cn>::Vec() {}
_ZN2cv4MatxIhLi3ELi1EEC2Ev:
  149|      1|{
  150|      4|    for(int i = 0; i < channels; i++) val[i] = _Tp(0);
  ------------------
  |  Branch (150:20): [True: 3, False: 1]
  ------------------
  151|      1|}
_ZN2cv3VecIhLi3EEC2Ehhh:
  782|      1|    : Matx<_Tp, cn, 1>(v0, v1, v2) {}
_ZN2cv4MatxIhLi3ELi1EEC2Ehhh:
  170|      1|{
  171|      1|    CV_StaticAssert(channels >= 3, "Matx should have at least 3 elements.");
  ------------------
  |  |  122|      1|#    define CV_StaticAssert(condition, reason)    static_assert((condition), reason " " #condition)
  ------------------
  172|      1|    val[0] = v0; val[1] = v1; val[2] = v2;
  173|      1|    for(int i = 3; i < channels; i++) val[i] = _Tp(0);
  ------------------
  |  Branch (173:20): [True: 0, False: 1]
  ------------------
  174|      1|}

_ZN2cv10softdouble7fromRawEm:
  243|    132|    static softdouble fromRaw( const uint64_t a ) { softdouble x; x.v = a; return x; }
_ZN2cv10softdouble3oneEv:
  352|      8|    static softdouble  one() { return softdouble::fromRaw( (uint_fast64_t)( 1023) << 52 ); }
_ZNK2cv9softfloatcvfEv:
  124|      2|    operator float() const { Cv32suf s; s.u = v; return s.f; }
_ZN2cv9softfloatC2Ev:
   93|     38|    softfloat() { v = 0; }
_ZN2cv9softfloat7fromRawEj:
  106|     38|    static const softfloat fromRaw( const uint32_t a ) { softfloat x; x.v = a; return x; }
_ZN2cv9softfloatC2ERKS0_:
   95|     24|    softfloat( const softfloat& c) { v = c.v; }
_ZN2cv10softdoubleC2Ev:
  230|    138|    softdouble() : v(0) { }
_ZN2cv10softdoubleaSERKS0_:
  235|     30|    {
  236|     30|        if(&c != this) v = c.v;
  ------------------
  |  Branch (236:12): [True: 30, False: 0]
  ------------------
  237|     30|        return *this;
  238|     30|    }
_ZN2cv9softfloataSERKS0_:
   98|     26|    {
   99|     26|        if(&c != this) v = c.v;
  ------------------
  |  Branch (99:12): [True: 26, False: 0]
  ------------------
  100|     26|        return *this;
  101|     26|    }
_ZN2cv10softdoubleC2ERKS0_:
  232|     36|    softdouble( const softdouble& c) { v = c.v; }
_ZNK2cv10softdouble6setExpEi:
  319|      6|    {
  320|      6|        softdouble x;
  321|      6|        x.v = (v & 0x800FFFFFFFFFFFFF) | ((uint_fast64_t)((e + 1023) & 0x7FF) << 52);
  322|      6|        return x;
  323|      6|    }
_ZN2cv10softdouble2piEv:
  360|      6|    static softdouble   pi() { return softdouble::fromRaw( CV_BIG_INT(0x400921FB54442D18) ); }
  ------------------
  |  |   63|      6|#  define CV_BIG_INT(n)   n##LL
  ------------------

_ZN2cv7Scalar_IdEC2ERKS1_:
 2174|     14|Scalar_<_Tp>::Scalar_(const Scalar_<_Tp>& s) : Vec<_Tp, 4>(s) {
 2175|     14|}
_ZN2cv5Size_IiEC2Eii:
 1697|    780|    : width(_width), height(_height) {}
_ZN2cv7Scalar_IdEC2Ev:
 2160|     14|{
 2161|     14|    this->val[0] = this->val[1] = this->val[2] = this->val[3] = 0;
 2162|     14|}

_ZN2cv10AutoBufferIhLm1032EEC2Ev:
 1044|      7|{
 1045|      7|    ptr = buf;
 1046|      7|    sz = fixed_size;
 1047|      7|}
_ZN2cv10AutoBufferIhLm1032EED2Ev:
 1082|    787|{ deallocate(); }
_ZN2cv10AutoBufferIhLm1032EE10deallocateEv:
 1102|  1.23k|{
 1103|  1.23k|    if( ptr != buf )
  ------------------
  |  Branch (1103:9): [True: 443, False: 787]
  ------------------
 1104|    443|    {
 1105|    443|        delete[] ptr;
 1106|    443|        ptr = buf;
 1107|    443|        sz = fixed_size;
 1108|    443|    }
 1109|  1.23k|}
_ZN2cv10AutoBufferIhLm1032EE8allocateEm:
 1086|    780|{
 1087|    780|    if(_size <= sz)
  ------------------
  |  Branch (1087:8): [True: 337, False: 443]
  ------------------
 1088|    337|    {
 1089|    337|        sz = _size;
 1090|    337|        return;
 1091|    337|    }
 1092|    443|    deallocate();
 1093|    443|    sz = _size;
 1094|    443|    if(_size > fixed_size)
  ------------------
  |  Branch (1094:8): [True: 443, False: 0]
  ------------------
 1095|    443|    {
 1096|    443|        ptr = new _Tp[_size];
 1097|    443|    }
 1098|    443|}
_ZN2cv10AutoBufferIhLm1032EE4dataEv:
  128|    780|    inline _Tp* data() { return ptr; }
_ZN2cv10AutoBufferIhLm1032EEC2Em:
 1051|    780|{
 1052|    780|    ptr = buf;
 1053|    780|    sz = fixed_size;
 1054|    780|    allocate(_size);
 1055|    780|}

_ZN2cv5utils28AllocatorStatisticsInterfaceC2Ev:
   15|      4|    AllocatorStatisticsInterface() {}

ocl.cpp:_ZN2cv5utils12_GLOBAL__N_119AllocatorStatisticsC2Ev:
   58|      2|    AllocatorStatistics() {}
alloc.cpp:_ZN2cv5utils12_GLOBAL__N_119AllocatorStatisticsC2Ev:
   58|      2|    AllocatorStatistics() {}

_ZN2cv5utils7logging6LogTagC2EPKcNS1_8LogLevelE:
   21|      2|        : name(_name)
   22|      2|        , level(_level)
   23|      2|    {}

_ZN2cv18TLSDataAccumulatorINS_5utils5trace7details23TraceManagerThreadLocalEEC2Ev:
   95|      2|    TLSDataAccumulator() : cleanupMode(false) {}
_ZN2cv7TLSDataINS_5utils5trace7details23TraceManagerThreadLocalEEC2Ev:
   66|      2|    inline TLSData() {}

_ZN2cv5utils5trace7details6RegionD2Ev:
   82|    784|    {
   83|    784|        if (implFlags != 0)
  ------------------
  |  Branch (83:13): [True: 0, False: 784]
  ------------------
   84|      0|            destroy();
   85|    784|        CV_DbgAssert(implFlags == 0);
   86|    784|        CV_DbgAssert(pImpl == NULL);
   87|    784|    }

alloc.cpp:_ZN2cvL26isAlignedAllocationEnabledEv:
  111|      2|{
  112|       |    // use construct on first use idiom https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use
  113|       |    // details: https://github.com/opencv/opencv/issues/15691
  114|      2|    static bool useMemalign = readMemoryAlignmentParameter();
  115|      2|    return useMemalign;
  116|      2|}
alloc.cpp:_ZN2cvL28readMemoryAlignmentParameterEv:
   87|      2|{
   88|      2|    bool value = true;
   89|       |#if defined(__GLIBC__) && defined(__linux__) \
   90|       |    && !defined(CV_STATIC_ANALYSIS) \
   91|       |    && !defined(OPENCV_ENABLE_MEMORY_SANITIZER) \
   92|       |    && !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)  /* oss-fuzz */ \
   93|       |    && !defined(_WIN32)  /* MinGW? */
   94|       |    {
   95|       |        // https://github.com/opencv/opencv/issues/15526
   96|       |        value = false;
   97|       |    }
   98|       |#endif
   99|      2|    value = cv::utils::getConfigurationParameterBool("OPENCV_ENABLE_MEMALIGN", value);  // should not call fastMalloc() internally
  100|       |    // TODO add checks for valgrind, ASAN if value == false
  101|      2|    return value;
  102|      2|}

_ZN2cv5utils7logging8internal15getGlobalLogTagEv:
  130|      2|{
  131|      2|    static LogTag* globalLogTagPtr = getGlobalLoggingInitStruct().logTagManager.get("global");
  132|      2|    return globalLogTagPtr;
  133|      2|}
_ZN2cv5utils7logging8internal21GlobalLoggingInitCallC2Ev:
  109|      2|    {
  110|      2|        getGlobalLoggingInitStruct();
  111|      2|        (void)getGlobalLogTag();  // complete initialization of logger structures
  112|      2|    }
logger.cpp:_ZN2cv5utils7logging8internalL26getGlobalLoggingInitStructEv:
   97|      4|{
   98|      4|    CV_SINGLETON_LAZY_INIT_REF(GlobalLoggingInitStruct, new GlobalLoggingInitStruct());
  ------------------
  |  |  404|      4|#define CV_SINGLETON_LAZY_INIT_REF(TYPE, INITIALIZER) CV_SINGLETON_LAZY_INIT_(TYPE, INITIALIZER, *instance)
  |  |  ------------------
  |  |  |  |  400|      4|    static TYPE* const instance = INITIALIZER; \
  |  |  |  |  401|      4|    return RET_VALUE;
  |  |  ------------------
  ------------------
   99|      0|}
_ZN2cv5utils7logging8internal23GlobalLoggingInitStructC2Ev:
   47|      2|        : logTagManager(m_defaultUnconfiguredGlobalLevel)
   48|      2|    {
   49|      2|        (void)getInitializationMutex();  // ensure initialization of global objects
   50|       |
   51|      2|        applyConfigString();
   52|      2|        handleMalformed();
   53|      2|    }
_ZN2cv5utils7logging8internal23GlobalLoggingInitStruct17applyConfigStringEv:
   57|      2|    {
   58|      2|        logTagManager.setConfigString(utils::getConfigurationParameterString("OPENCV_LOG_LEVEL", ""));
   59|      2|    }
_ZN2cv5utils7logging8internal23GlobalLoggingInitStruct15handleMalformedEv:
   62|      2|    {
   63|       |        // need to print warning for malformed log tag config strings?
   64|      2|        if (m_isDebugBuild)
  ------------------
  |  Branch (64:13): [Folded - Ignored]
  ------------------
   65|      0|        {
   66|      0|            const auto& parser = logTagManager.getConfigParser();
   67|      0|            if (parser.hasMalformed())
  ------------------
  |  Branch (67:17): [True: 0, False: 0]
  ------------------
   68|      0|            {
   69|      0|                const auto& malformedList = parser.getMalformed();
   70|      0|                for (const auto& malformed : malformedList)
  ------------------
  |  Branch (70:44): [True: 0, False: 0]
  ------------------
   71|      0|                {
   72|      0|                    std::cout << "Malformed log level config: \"" << malformed << "\"\n";
   73|      0|                }
   74|      0|                std::cout.flush();
   75|      0|            }
   76|      0|        }
   77|      2|    }

_ZN2cv20updateContinuityFlagEiiPKiPKm:
  284|  1.56k|{
  285|  1.56k|    int i, j;
  286|  3.13k|    for( i = 0; i < dims; i++ )
  ------------------
  |  Branch (286:17): [True: 3.12k, False: 16]
  ------------------
  287|  3.12k|    {
  288|  3.12k|        if( size[i] > 1 )
  ------------------
  |  Branch (288:13): [True: 1.54k, False: 1.57k]
  ------------------
  289|  1.54k|            break;
  290|  3.12k|    }
  291|       |
  292|  1.56k|    uint64 t = (uint64)size[std::min(i, dims-1)]*CV_MAT_CN(flags);
  ------------------
  |  |  496|  1.56k|#define CV_MAT_CN(flags)        ((((flags) & CV_MAT_CN_MASK) >> CV_CN_SHIFT) + 1)
  |  |  ------------------
  |  |  |  |  495|  1.56k|#define CV_MAT_CN_MASK          ((CV_CN_MAX - 1) << CV_CN_SHIFT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|  1.56k|#define CV_CN_MAX     512
  |  |  |  |  ------------------
  |  |  |  |               #define CV_MAT_CN_MASK          ((CV_CN_MAX - 1) << CV_CN_SHIFT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  1.56k|#define CV_CN_SHIFT   3
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define CV_MAT_CN(flags)        ((((flags) & CV_MAT_CN_MASK) >> CV_CN_SHIFT) + 1)
  |  |  ------------------
  |  |  |  |   70|  1.56k|#define CV_CN_SHIFT   3
  |  |  ------------------
  ------------------
  293|  1.56k|    for( j = dims-1; j > i; j-- )
  ------------------
  |  Branch (293:22): [True: 0, False: 1.56k]
  ------------------
  294|      0|    {
  295|      0|        t *= size[j];
  296|      0|        if( step[j]*size[j] < step[j-1] )
  ------------------
  |  Branch (296:13): [True: 0, False: 0]
  ------------------
  297|      0|            break;
  298|      0|    }
  299|       |
  300|  1.56k|    if( j <= i && t == (uint64)(int)t )
  ------------------
  |  Branch (300:9): [True: 1.56k, False: 0]
  |  Branch (300:19): [True: 1.56k, False: 0]
  ------------------
  301|  1.56k|        return flags | Mat::CONTINUOUS_FLAG;
  302|      0|    return flags & ~Mat::CONTINUOUS_FLAG;
  303|  1.56k|}
_ZN2cv3Mat20updateContinuityFlagEv:
  306|  1.56k|{
  307|  1.56k|    flags = cv::updateContinuityFlag(flags, dims, size.p, step.p);
  308|  1.56k|}
_ZN2cv3MatC2Ev:
  337|    798|    : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0),
  338|    798|      datalimit(0), allocator(0), u(0), size(&rows), step(0)
  339|    798|{}
_ZN2cv3MatC2ERKS0_:
  402|  3.12k|    : flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), data(m.data),
  403|  3.12k|      datastart(m.datastart), dataend(m.dataend), datalimit(m.datalimit), allocator(m.allocator),
  404|  3.12k|      u(m.u), size(&rows), step(0)
  405|  3.12k|{
  406|  3.12k|    if( u )
  ------------------
  |  Branch (406:9): [True: 0, False: 3.12k]
  ------------------
  407|      0|        CV_XADD(&u->refcount, 1);
  ------------------
  |  |  702|      0|#      define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL)
  ------------------
  408|  3.12k|    if( m.dims <= 2 )
  ------------------
  |  Branch (408:9): [True: 3.12k, False: 0]
  ------------------
  409|  3.12k|    {
  410|  3.12k|        step[0] = m.step[0]; step[1] = m.step[1];
  411|  3.12k|    }
  412|      0|    else
  413|      0|    {
  414|      0|        dims = 0;
  415|      0|        copySize(m);
  416|      0|    }
  417|  3.12k|}
_ZN2cv3MatC2EiiiPvm:
  420|    780|    : flags(MAGIC_VAL + (_type & TYPE_MASK)), dims(2), rows(_rows), cols(_cols),
  421|    780|      data((uchar*)_data), datastart((uchar*)_data), dataend(0), datalimit(0),
  422|    780|      allocator(0), u(0), size(&rows)
  423|    780|{
  424|    780|    CV_Assert(total() == 0 || data != NULL);
  ------------------
  |  |  423|  1.56k|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:38): [True: 0, False: 780]
  |  |  |  Branch (423:38): [True: 780, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
  425|       |
  426|    780|    size_t esz = CV_ELEM_SIZE(_type), esz1 = CV_ELEM_SIZE1(_type);
  ------------------
  |  |  511|    780|#define CV_ELEM_SIZE(type) (CV_MAT_CN(type)*CV_ELEM_SIZE1(type))
  |  |  ------------------
  |  |  |  |  496|    780|#define CV_MAT_CN(flags)        ((((flags) & CV_MAT_CN_MASK) >> CV_CN_SHIFT) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  495|    780|#define CV_MAT_CN_MASK          ((CV_CN_MAX - 1) << CV_CN_SHIFT)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   69|    780|#define CV_CN_MAX     512
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CV_MAT_CN_MASK          ((CV_CN_MAX - 1) << CV_CN_SHIFT)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define CV_MAT_CN(flags)        ((((flags) & CV_MAT_CN_MASK) >> CV_CN_SHIFT) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define CV_ELEM_SIZE(type) (CV_MAT_CN(type)*CV_ELEM_SIZE1(type))
  |  |  ------------------
  |  |  |  |  509|    780|#define CV_ELEM_SIZE1(type) ((0x28442211 >> CV_MAT_DEPTH(type)*4) & 15)
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    780|#define CV_MAT_DEPTH(flags)     ((flags) & CV_MAT_DEPTH_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   82|    780|#define CV_MAT_DEPTH_MASK       (CV_DEPTH_MAX - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   71|    780|#define CV_DEPTH_MAX  (1 << CV_CN_SHIFT)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  size_t esz = CV_ELEM_SIZE(_type), esz1 = CV_ELEM_SIZE1(_type);
  ------------------
  |  |  509|    780|#define CV_ELEM_SIZE1(type) ((0x28442211 >> CV_MAT_DEPTH(type)*4) & 15)
  |  |  ------------------
  |  |  |  |   83|    780|#define CV_MAT_DEPTH(flags)     ((flags) & CV_MAT_DEPTH_MASK)
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|    780|#define CV_MAT_DEPTH_MASK       (CV_DEPTH_MAX - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|    780|#define CV_DEPTH_MAX  (1 << CV_CN_SHIFT)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  427|    780|    size_t minstep = cols * esz;
  428|    780|    if( _step == AUTO_STEP )
  ------------------
  |  Branch (428:9): [True: 780, False: 0]
  ------------------
  429|    780|    {
  430|    780|        _step = minstep;
  431|    780|    }
  432|      0|    else
  433|      0|    {
  434|      0|        CV_Assert( _step >= minstep );
  ------------------
  |  |  423|      0|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:35): [True: 0, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
  435|      0|        if (_step % esz1 != 0)
  ------------------
  |  Branch (435:13): [True: 0, False: 0]
  ------------------
  436|      0|        {
  437|      0|            CV_Error(Error::BadStep, "Step must be a multiple of esz1");
  ------------------
  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  ------------------
  438|      0|        }
  439|      0|    }
  440|    780|    step[0] = _step;
  441|    780|    step[1] = esz;
  442|    780|    datalimit = datastart + _step * rows;
  443|    780|    dataend = datalimit - _step + minstep;
  444|    780|    updateContinuityFlag();
  445|    780|}
_ZN2cv3MatC2ENS_5Size_IiEEiPvm:
  448|    780|    : flags(MAGIC_VAL + (_type & TYPE_MASK)), dims(2), rows(_sz.height), cols(_sz.width),
  449|    780|      data((uchar*)_data), datastart((uchar*)_data), dataend(0), datalimit(0),
  450|    780|      allocator(0), u(0), size(&rows)
  451|    780|{
  452|    780|    CV_Assert(total() == 0 || data != NULL);
  ------------------
  |  |  423|  1.56k|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:38): [True: 0, False: 780]
  |  |  |  Branch (423:38): [True: 780, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
  453|       |
  454|    780|    size_t esz = CV_ELEM_SIZE(_type), esz1 = CV_ELEM_SIZE1(_type);
  ------------------
  |  |  511|    780|#define CV_ELEM_SIZE(type) (CV_MAT_CN(type)*CV_ELEM_SIZE1(type))
  |  |  ------------------
  |  |  |  |  496|    780|#define CV_MAT_CN(flags)        ((((flags) & CV_MAT_CN_MASK) >> CV_CN_SHIFT) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  495|    780|#define CV_MAT_CN_MASK          ((CV_CN_MAX - 1) << CV_CN_SHIFT)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   69|    780|#define CV_CN_MAX     512
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CV_MAT_CN_MASK          ((CV_CN_MAX - 1) << CV_CN_SHIFT)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define CV_MAT_CN(flags)        ((((flags) & CV_MAT_CN_MASK) >> CV_CN_SHIFT) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define CV_ELEM_SIZE(type) (CV_MAT_CN(type)*CV_ELEM_SIZE1(type))
  |  |  ------------------
  |  |  |  |  509|    780|#define CV_ELEM_SIZE1(type) ((0x28442211 >> CV_MAT_DEPTH(type)*4) & 15)
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    780|#define CV_MAT_DEPTH(flags)     ((flags) & CV_MAT_DEPTH_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   82|    780|#define CV_MAT_DEPTH_MASK       (CV_DEPTH_MAX - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   71|    780|#define CV_DEPTH_MAX  (1 << CV_CN_SHIFT)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  size_t esz = CV_ELEM_SIZE(_type), esz1 = CV_ELEM_SIZE1(_type);
  ------------------
  |  |  509|    780|#define CV_ELEM_SIZE1(type) ((0x28442211 >> CV_MAT_DEPTH(type)*4) & 15)
  |  |  ------------------
  |  |  |  |   83|    780|#define CV_MAT_DEPTH(flags)     ((flags) & CV_MAT_DEPTH_MASK)
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|    780|#define CV_MAT_DEPTH_MASK       (CV_DEPTH_MAX - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|    780|#define CV_DEPTH_MAX  (1 << CV_CN_SHIFT)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  455|    780|    size_t minstep = cols*esz;
  456|    780|    if( _step == AUTO_STEP )
  ------------------
  |  Branch (456:9): [True: 0, False: 780]
  ------------------
  457|      0|    {
  458|      0|        _step = minstep;
  459|      0|    }
  460|    780|    else
  461|    780|    {
  462|    780|        CV_CheckGE(_step, minstep, "");
  ------------------
  |  |  122|    780|#define CV_CheckGE(v1, v2, msg)  CV__CHECK(_, GE, auto, v1, v2, #v1, #v2, msg)
  |  |  ------------------
  |  |  |  |   99|    780|#define CV__CHECK(id, op, type, v1, v2, v1_str, v2_str, msg_str) do { \
  |  |  |  |  100|    780|    if(CV__TEST_##op((v1), (v2))) ; else { \
  |  |  |  |  101|      0|        CV__DEFINE_CHECK_CONTEXT(id, msg_str, cv::detail::TEST_ ## op, v1_str, v2_str); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|    static const cv::detail::CheckContext CV__CHECK_LOCATION_VARNAME(id) = \
  |  |  |  |  |  |   66|      0|            { CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|      0|#   define CV__CHECK_FUNCTION __PRETTY_FUNCTION__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                           { CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|      0|# define CV__CHECK_FILENAME __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  102|      0|        cv::detail::check_failed_ ## type((v1), (v2), CV__CHECK_LOCATION_VARNAME(id)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|      0|#define CV__CHECK_LOCATION_VARNAME(id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_check_, id), __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  114|      0|#define CVAUX_CONCAT_EXP(a, b) a##b
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  103|      0|    } \
  |  |  |  |  104|    780|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (104:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|       |
  464|    780|        if (_step % esz1 != 0)
  ------------------
  |  Branch (464:13): [True: 0, False: 780]
  ------------------
  465|      0|        {
  466|      0|            CV_Error(Error::BadStep, "Step must be a multiple of esz1");
  ------------------
  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  ------------------
  467|      0|        }
  468|    780|    }
  469|    780|    step[0] = _step;
  470|    780|    step[1] = esz;
  471|    780|    datalimit = datastart + _step*rows;
  472|    780|    dataend = datalimit - _step + minstep;
  473|    780|    updateContinuityFlag();
  474|    780|}
_ZN2cv3MatD2Ev:
  478|  6.25k|{
  479|  6.25k|    release();
  480|  6.25k|    if( step.p != step.buf )
  ------------------
  |  Branch (480:9): [True: 0, False: 6.25k]
  ------------------
  481|      0|        fastFree(step.p);
  482|  6.25k|}
_ZN2cv3Mat7releaseEv:
  548|  6.25k|{
  549|  6.25k|    if( u && CV_XADD(&u->refcount, -1) == 1 )
  ------------------
  |  |  702|      0|#      define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL)
  ------------------
  |  Branch (549:9): [True: 0, False: 6.25k]
  |  Branch (549:14): [True: 0, False: 0]
  ------------------
  550|      0|        deallocate();
  551|  6.25k|    u = NULL;
  552|  6.25k|    datastart = dataend = datalimit = data = 0;
  553|  15.6k|    for(int i = 0; i < dims; i++)
  ------------------
  |  Branch (553:20): [True: 9.36k, False: 6.25k]
  ------------------
  554|  9.36k|        size.p[i] = 0;
  555|       |#ifdef _DEBUG
  556|       |    flags = MAGIC_VAL;
  557|       |    dims = rows = cols = 0;
  558|       |    if(step.p != step.buf)
  559|       |    {
  560|       |        fastFree(step.p);
  561|       |        step.p = step.buf;
  562|       |        size.p = &rows;
  563|       |    }
  564|       |#endif
  565|  6.25k|}
_ZNK2cv3Mat5emptyEv:
  573|  2.34k|{
  574|  2.34k|    return data == 0 || total() == 0 || dims == 0;
  ------------------
  |  Branch (574:12): [True: 1, False: 2.34k]
  |  Branch (574:25): [True: 0, False: 2.34k]
  |  Branch (574:41): [True: 0, False: 2.34k]
  ------------------
  575|  2.34k|}
_ZNK2cv3Mat5totalEv:
  578|  3.90k|{
  579|  3.90k|    if( dims <= 2 )
  ------------------
  |  Branch (579:9): [True: 3.90k, False: 0]
  ------------------
  580|  3.90k|        return (size_t)rows * cols;
  581|      0|    size_t p = 1;
  582|      0|    for( int i = 0; i < dims; i++ )
  ------------------
  |  Branch (582:21): [True: 0, False: 0]
  ------------------
  583|      0|        p *= size[i];
  584|      0|    return p;
  585|  3.90k|}
_ZN2cv3MatC2EOS0_:
  599|    780|    : flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), data(m.data),
  600|    780|      datastart(m.datastart), dataend(m.dataend), datalimit(m.datalimit), allocator(m.allocator),
  601|    780|      u(m.u), size(&rows)
  602|    780|{
  603|    780|    if (m.dims <= 2)  // move new step/size info
  ------------------
  |  Branch (603:9): [True: 780, False: 0]
  ------------------
  604|    780|    {
  605|    780|        step[0] = m.step[0];
  606|    780|        step[1] = m.step[1];
  607|    780|    }
  608|      0|    else
  609|      0|    {
  610|      0|        CV_Assert(m.step.p != m.step.buf);
  ------------------
  |  |  423|      0|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:35): [True: 0, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
  611|      0|        step.p = m.step.p;
  612|      0|        size.p = m.size.p;
  613|      0|        m.step.p = m.step.buf;
  614|      0|        m.size.p = &m.rows;
  615|      0|    }
  616|    780|    m.flags = MAGIC_VAL; m.dims = m.rows = m.cols = 0;
  617|    780|    m.data = NULL; m.datastart = NULL; m.dataend = NULL; m.datalimit = NULL;
  618|    780|    m.allocator = NULL;
  619|    780|    m.u = NULL;
  620|    780|}

_ZN2cv5MatOpC2Ev:
  218|     16|MatOp::MatOp() {}
_ZN2cv14MatOp_IdentityC2Ev:
   40|      2|    MatOp_Identity() {}
_ZN2cv11MatOp_AddExC2Ev:
   54|      2|    MatOp_AddEx() {}
_ZN2cv9MatOp_BinC2Ev:
   76|      2|    MatOp_Bin() {}
_ZN2cv9MatOp_CmpC2Ev:
   94|      2|    MatOp_Cmp() {}
_ZN2cv10MatOp_GEMMC2Ev:
  109|      2|    MatOp_GEMM() {}
_ZN2cv12MatOp_InvertC2Ev:
  139|      2|    MatOp_Invert() {}
_ZN2cv7MatOp_TC2Ev:
  155|      2|    MatOp_T() {}
_ZN2cv11MatOp_SolveC2Ev:
  172|      2|    MatOp_Solve() {}

_ZNK2cv11_InputArray4kindEv:
  371|  3.12k|{
  372|  3.12k|    KindFlag k = flags & KIND_MASK;
  373|  3.12k|#if CV_VERSION_MAJOR < 5
  374|  3.12k|    CV_DbgAssert(k != EXPR);
  375|  3.12k|    CV_DbgAssert(k != STD_ARRAY);
  376|  3.12k|#endif
  377|  3.12k|    return k;
  378|  3.12k|}
_ZNK2cv11_InputArray5emptyEv:
  845|    780|{
  846|    780|    _InputArray::KindFlag k = kind();
  847|       |
  848|    780|    if( k == MAT )
  ------------------
  |  Branch (848:9): [True: 780, False: 0]
  ------------------
  849|    780|        return ((const Mat*)obj)->empty();
  850|       |
  851|      0|    if( k == UMAT )
  ------------------
  |  Branch (851:9): [True: 0, False: 0]
  ------------------
  852|      0|        return ((const UMat*)obj)->empty();
  853|       |
  854|      0|    if (k == MATX)
  ------------------
  |  Branch (854:9): [True: 0, False: 0]
  ------------------
  855|      0|        return false;
  856|       |
  857|      0|    if( k == STD_VECTOR )
  ------------------
  |  Branch (857:9): [True: 0, False: 0]
  ------------------
  858|      0|    {
  859|      0|        const std::vector<uchar>& v = *(const std::vector<uchar>*)obj;
  860|      0|        return v.empty();
  861|      0|    }
  862|       |
  863|      0|    if( k == STD_BOOL_VECTOR )
  ------------------
  |  Branch (863:9): [True: 0, False: 0]
  ------------------
  864|      0|    {
  865|      0|        const std::vector<bool>& v = *(const std::vector<bool>*)obj;
  866|      0|        return v.empty();
  867|      0|    }
  868|       |
  869|      0|    if( k == NONE )
  ------------------
  |  Branch (869:9): [True: 0, False: 0]
  ------------------
  870|      0|        return true;
  871|       |
  872|      0|    if( k == STD_VECTOR_VECTOR )
  ------------------
  |  Branch (872:9): [True: 0, False: 0]
  ------------------
  873|      0|    {
  874|      0|        const std::vector<std::vector<uchar> >& vv = *(const std::vector<std::vector<uchar> >*)obj;
  875|      0|        return vv.empty();
  876|      0|    }
  877|       |
  878|      0|    if( k == STD_VECTOR_MAT )
  ------------------
  |  Branch (878:9): [True: 0, False: 0]
  ------------------
  879|      0|    {
  880|      0|        const std::vector<Mat>& vv = *(const std::vector<Mat>*)obj;
  881|      0|        return vv.empty();
  882|      0|    }
  883|       |
  884|      0|    if( k == STD_ARRAY_MAT )
  ------------------
  |  Branch (884:9): [True: 0, False: 0]
  ------------------
  885|      0|    {
  886|      0|        return sz.height == 0;
  887|      0|    }
  888|       |
  889|      0|    if( k == STD_VECTOR_UMAT )
  ------------------
  |  Branch (889:9): [True: 0, False: 0]
  ------------------
  890|      0|    {
  891|      0|        const std::vector<UMat>& vv = *(const std::vector<UMat>*)obj;
  892|      0|        return vv.empty();
  893|      0|    }
  894|       |
  895|      0|    if( k == OPENGL_BUFFER )
  ------------------
  |  Branch (895:9): [True: 0, False: 0]
  ------------------
  896|      0|        return ((const ogl::Buffer*)obj)->empty();
  897|       |
  898|      0|    if( k == CUDA_GPU_MAT )
  ------------------
  |  Branch (898:9): [True: 0, False: 0]
  ------------------
  899|      0|        return ((const cuda::GpuMat*)obj)->empty();
  900|       |
  901|      0|    if (k == STD_VECTOR_CUDA_GPU_MAT)
  ------------------
  |  Branch (901:9): [True: 0, False: 0]
  ------------------
  902|      0|    {
  903|      0|        const std::vector<cuda::GpuMat>& vv = *(const std::vector<cuda::GpuMat>*)obj;
  904|      0|        return vv.empty();
  905|      0|    }
  906|       |
  907|      0|    if( k == CUDA_HOST_MEM )
  ------------------
  |  Branch (907:9): [True: 0, False: 0]
  ------------------
  908|      0|        return ((const cuda::HostMem*)obj)->empty();
  909|       |
  910|      0|    CV_Error(Error::StsNotImplemented, "Unknown/unsupported array type");
  ------------------
  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  ------------------
  911|      0|}

_ZN2cv9softfloatC2Ei:
  227|     26|softfloat::softfloat( const  int32_t a ) { *this =  i32_to_f32(a); }
_ZNK2cv9softfloatmiERKS0_:
  233|      4|softfloat softfloat::operator - (const softfloat& a) const { return f32_sub(*this, a); }
_ZNK2cv9softfloatdvERKS0_:
  235|      8|softfloat softfloat::operator / (const softfloat& a) const { return f32_div(*this, a); }
_ZN2cv10softdoubleC2Ei:
  247|     30|softdouble::softdouble( const  int32_t a ) { *this =  i32_to_f64(a); }
_ZNK2cv10softdoublemlERKS0_:
  270|      2|softdouble softdouble::operator * (const softdouble& a) const { return f64_mul(*this, a); }
_ZNK2cv10softdoubledvERKS0_:
  271|     16|softdouble softdouble::operator / (const softdouble& a) const { return f64_div(*this, a); }
softfloat.cpp:_ZN2cvL10raiseFlagsEh:
   97|     20|{
   98|       |    //exceptionFlags |= flags;
   99|     20|}
softfloat.cpp:_ZN2cvL29softfloat_countLeadingZeros32Ej:
  525|     56|{
  526|     56|    uint_fast8_t count = 0;
  527|     56|    if ( a < 0x10000 ) {
  ------------------
  |  Branch (527:10): [True: 52, False: 4]
  ------------------
  528|     52|        count = 16;
  529|     52|        a <<= 16;
  530|     52|    }
  531|     56|    if ( a < 0x1000000 ) {
  ------------------
  |  Branch (531:10): [True: 42, False: 14]
  ------------------
  532|     42|        count += 8;
  533|     42|        a <<= 8;
  534|     42|    }
  535|     56|    count += softfloat_countLeadingZeros8[a>>24];
  536|     56|    return count;
  537|     56|}
softfloat.cpp:_ZN2cvL28softfloat_normRoundPackToF32Eblm:
 2845|     26|{
 2846|     26|    int_fast8_t shiftDist;
 2847|       |
 2848|     26|    shiftDist = softfloat_countLeadingZeros32( sig ) - 1;
 2849|     26|    exp -= shiftDist;
 2850|     26|    if ( (7 <= shiftDist) && ((unsigned int) exp < 0xFD) ) {
  ------------------
  |  Branch (2850:10): [True: 26, False: 0]
  |  Branch (2850:30): [True: 26, False: 0]
  ------------------
 2851|     26|        return float32_t::fromRaw(packToF32UI( sign, sig ? exp : 0, sig<<(shiftDist - 7) ));
  ------------------
  |  |  127|     52|#define packToF32UI( sign, exp, sig ) (((uint32_t) (sign)<<31) + ((uint32_t) (exp)<<23) + (sig))
  |  |  ------------------
  |  |  |  Branch (127:79): [True: 26, False: 0]
  |  |  ------------------
  ------------------
 2852|     26|    } else {
 2853|      0|        return softfloat_roundPackToF32( sign, exp, sig<<shiftDist );
 2854|      0|    }
 2855|     26|}
softfloat.cpp:_ZN2cvL24softfloat_roundPackToF32Eblm:
 2933|     10|{
 2934|     10|    uint_fast8_t roundingMode;
 2935|     10|    bool roundNearEven;
 2936|     10|    uint_fast8_t roundIncrement, roundBits;
 2937|     10|    bool isTiny;
 2938|     10|    uint_fast32_t uiZ;
 2939|       |
 2940|       |    /*------------------------------------------------------------------------
 2941|       |    *------------------------------------------------------------------------*/
 2942|     10|    roundingMode = globalRoundingMode;
 2943|     10|    roundNearEven = (roundingMode == round_near_even);
 2944|     10|    roundIncrement = 0x40;
 2945|     10|    if ( ! roundNearEven && (roundingMode != round_near_maxMag) ) {
  ------------------
  |  Branch (2945:10): [True: 0, False: 10]
  |  Branch (2945:29): [True: 0, False: 0]
  ------------------
 2946|      0|        roundIncrement =
 2947|      0|            (roundingMode
  ------------------
  |  Branch (2947:13): [True: 0, False: 0]
  ------------------
 2948|      0|                 == (sign ? round_min : round_max))
  ------------------
  |  Branch (2948:22): [True: 0, False: 0]
  ------------------
 2949|      0|                ? 0x7F
 2950|      0|                : 0;
 2951|      0|    }
 2952|     10|    roundBits = sig & 0x7F;
 2953|       |    /*------------------------------------------------------------------------
 2954|       |    *------------------------------------------------------------------------*/
 2955|     10|    if ( 0xFD <= (unsigned int) exp ) {
  ------------------
  |  Branch (2955:10): [True: 0, False: 10]
  ------------------
 2956|      0|        if ( exp < 0 ) {
  ------------------
  |  Branch (2956:14): [True: 0, False: 0]
  ------------------
 2957|       |            /*----------------------------------------------------------------
 2958|       |            *----------------------------------------------------------------*/
 2959|      0|            isTiny =
 2960|      0|                (globalDetectTininess == tininess_beforeRounding)
  ------------------
  |  Branch (2960:17): [Folded - Ignored]
  ------------------
 2961|      0|                    || (exp < -1) || (sig + roundIncrement < 0x80000000);
  ------------------
  |  Branch (2961:24): [True: 0, False: 0]
  |  Branch (2961:38): [True: 0, False: 0]
  ------------------
 2962|      0|            sig = softfloat_shiftRightJam32( sig, -exp );
 2963|      0|            exp = 0;
 2964|      0|            roundBits = sig & 0x7F;
 2965|      0|            if ( isTiny && roundBits ) {
  ------------------
  |  Branch (2965:18): [True: 0, False: 0]
  |  Branch (2965:28): [True: 0, False: 0]
  ------------------
 2966|      0|                raiseFlags( flag_underflow );
 2967|      0|            }
 2968|      0|        } else if ( (0xFD < exp) || (0x80000000 <= sig + roundIncrement) ) {
  ------------------
  |  Branch (2968:21): [True: 0, False: 0]
  |  Branch (2968:37): [True: 0, False: 0]
  ------------------
 2969|       |            /*----------------------------------------------------------------
 2970|       |            *----------------------------------------------------------------*/
 2971|      0|            raiseFlags(
 2972|      0|                flag_overflow | flag_inexact );
 2973|      0|            uiZ = packToF32UI( sign, 0xFF, 0 ) - ! roundIncrement;
  ------------------
  |  |  127|      0|#define packToF32UI( sign, exp, sig ) (((uint32_t) (sign)<<31) + ((uint32_t) (exp)<<23) + (sig))
  ------------------
 2974|      0|            goto uiZ;
 2975|      0|        }
 2976|      0|    }
 2977|       |    /*------------------------------------------------------------------------
 2978|       |    *------------------------------------------------------------------------*/
 2979|     10|    sig = (sig + roundIncrement)>>7;
 2980|     10|    if ( roundBits ) {
  ------------------
  |  Branch (2980:10): [True: 8, False: 2]
  ------------------
 2981|      8|        raiseFlags(flag_inexact);
 2982|      8|        if ( roundingMode == round_odd ) {
  ------------------
  |  Branch (2982:14): [True: 0, False: 8]
  ------------------
 2983|      0|            sig |= 1;
 2984|      0|            goto packReturn;
 2985|      0|        }
 2986|      8|    }
 2987|     10|    sig &= ~(uint_fast32_t) (! (roundBits ^ 0x40) & roundNearEven);
 2988|     10|    if ( ! sig ) exp = 0;
  ------------------
  |  Branch (2988:10): [True: 0, False: 10]
  ------------------
 2989|       |    /*------------------------------------------------------------------------
 2990|       |    *------------------------------------------------------------------------*/
 2991|     10| packReturn:
 2992|     10|    uiZ = packToF32UI( sign, exp, sig );
  ------------------
  |  |  127|     10|#define packToF32UI( sign, exp, sig ) (((uint32_t) (sign)<<31) + ((uint32_t) (exp)<<23) + (sig))
  ------------------
 2993|     10| uiZ:
 2994|     10|    return float32_t::fromRaw(uiZ);
 2995|     10|}
softfloat.cpp:_ZN2cvL25softfloat_shiftRightJam32Ejm:
  476|      2|{
  477|       |    //fixed unsigned unary minus: -x == ~x + 1
  478|      2|    return (dist < 31) ? a>>dist | ((uint32_t) (a<<((~dist + 1) & 31)) != 0) : (a != 0);
  ------------------
  |  Branch (478:12): [True: 2, False: 0]
  ------------------
  479|      2|}
softfloat.cpp:_ZN2cvL20softfloat_addMagsF32Emm:
 2181|      4|{
 2182|      4|    int_fast16_t expA;
 2183|      4|    uint_fast32_t sigA;
 2184|      4|    int_fast16_t expB;
 2185|      4|    uint_fast32_t sigB;
 2186|      4|    int_fast16_t expDiff;
 2187|      4|    uint_fast32_t uiZ;
 2188|      4|    bool signZ;
 2189|      4|    int_fast16_t expZ;
 2190|      4|    uint_fast32_t sigZ;
 2191|       |
 2192|       |    /*------------------------------------------------------------------------
 2193|       |    *------------------------------------------------------------------------*/
 2194|      4|    expA = expF32UI( uiA );
  ------------------
  |  |  125|      4|#define expF32UI( a ) ((int_fast16_t) ((a)>>23) & 0xFF)
  ------------------
 2195|      4|    sigA = fracF32UI( uiA );
  ------------------
  |  |  126|      4|#define fracF32UI( a ) ((a) & 0x007FFFFF)
  ------------------
 2196|      4|    expB = expF32UI( uiB );
  ------------------
  |  |  125|      4|#define expF32UI( a ) ((int_fast16_t) ((a)>>23) & 0xFF)
  ------------------
 2197|      4|    sigB = fracF32UI( uiB );
  ------------------
  |  |  126|      4|#define fracF32UI( a ) ((a) & 0x007FFFFF)
  ------------------
 2198|       |    /*------------------------------------------------------------------------
 2199|       |    *------------------------------------------------------------------------*/
 2200|      4|    expDiff = expA - expB;
 2201|      4|    if ( ! expDiff ) {
  ------------------
  |  Branch (2201:10): [True: 2, False: 2]
  ------------------
 2202|       |        /*--------------------------------------------------------------------
 2203|       |        *--------------------------------------------------------------------*/
 2204|      2|        if ( ! expA ) {
  ------------------
  |  Branch (2204:14): [True: 0, False: 2]
  ------------------
 2205|      0|            uiZ = uiA + sigB;
 2206|      0|            goto uiZ;
 2207|      0|        }
 2208|      2|        if ( expA == 0xFF ) {
  ------------------
  |  Branch (2208:14): [True: 0, False: 2]
  ------------------
 2209|      0|            if ( sigA | sigB ) goto propagateNaN;
  ------------------
  |  Branch (2209:18): [True: 0, False: 0]
  ------------------
 2210|      0|            uiZ = uiA;
 2211|      0|            goto uiZ;
 2212|      0|        }
 2213|      2|        signZ = signF32UI( uiA );
  ------------------
  |  |  124|      2|#define signF32UI( a ) (((uint32_t) (a)>>31) != 0)
  ------------------
 2214|      2|        expZ = expA;
 2215|      2|        sigZ = 0x01000000 + sigA + sigB;
 2216|      2|        if ( ! (sigZ & 1) && (expZ < 0xFE) ) {
  ------------------
  |  Branch (2216:14): [True: 2, False: 0]
  |  Branch (2216:30): [True: 2, False: 0]
  ------------------
 2217|      2|            uiZ = packToF32UI( signZ, expZ, sigZ>>1 );
  ------------------
  |  |  127|      2|#define packToF32UI( sign, exp, sig ) (((uint32_t) (sign)<<31) + ((uint32_t) (exp)<<23) + (sig))
  ------------------
 2218|      2|            goto uiZ;
 2219|      2|        }
 2220|      0|        sigZ <<= 6;
 2221|      2|    } else {
 2222|       |        /*--------------------------------------------------------------------
 2223|       |        *--------------------------------------------------------------------*/
 2224|      2|        signZ = signF32UI( uiA );
  ------------------
  |  |  124|      2|#define signF32UI( a ) (((uint32_t) (a)>>31) != 0)
  ------------------
 2225|      2|        sigA <<= 6;
 2226|      2|        sigB <<= 6;
 2227|      2|        if ( expDiff < 0 ) {
  ------------------
  |  Branch (2227:14): [True: 2, False: 0]
  ------------------
 2228|      2|            if ( expB == 0xFF ) {
  ------------------
  |  Branch (2228:18): [True: 0, False: 2]
  ------------------
 2229|      0|                if ( sigB ) goto propagateNaN;
  ------------------
  |  Branch (2229:22): [True: 0, False: 0]
  ------------------
 2230|      0|                uiZ = packToF32UI( signZ, 0xFF, 0 );
  ------------------
  |  |  127|      0|#define packToF32UI( sign, exp, sig ) (((uint32_t) (sign)<<31) + ((uint32_t) (exp)<<23) + (sig))
  ------------------
 2231|      0|                goto uiZ;
 2232|      0|            }
 2233|      2|            expZ = expB;
 2234|      2|            sigA += expA ? 0x20000000 : sigA;
  ------------------
  |  Branch (2234:21): [True: 2, False: 0]
  ------------------
 2235|      2|            sigA = softfloat_shiftRightJam32( sigA, -expDiff );
 2236|      2|        } else {
 2237|      0|            if ( expA == 0xFF ) {
  ------------------
  |  Branch (2237:18): [True: 0, False: 0]
  ------------------
 2238|      0|                if ( sigA ) goto propagateNaN;
  ------------------
  |  Branch (2238:22): [True: 0, False: 0]
  ------------------
 2239|      0|                uiZ = uiA;
 2240|      0|                goto uiZ;
 2241|      0|            }
 2242|      0|            expZ = expA;
 2243|      0|            sigB += expB ? 0x20000000 : sigB;
  ------------------
  |  Branch (2243:21): [True: 0, False: 0]
  ------------------
 2244|      0|            sigB = softfloat_shiftRightJam32( sigB, expDiff );
 2245|      0|        }
 2246|      2|        sigZ = 0x20000000 + sigA + sigB;
 2247|      2|        if ( sigZ < 0x40000000 ) {
  ------------------
  |  Branch (2247:14): [True: 0, False: 2]
  ------------------
 2248|      0|            --expZ;
 2249|      0|            sigZ <<= 1;
 2250|      0|        }
 2251|      2|    }
 2252|      2|    return softfloat_roundPackToF32( signZ, expZ, sigZ );
 2253|       |    /*------------------------------------------------------------------------
 2254|       |    *------------------------------------------------------------------------*/
 2255|      0| propagateNaN:
 2256|      0|    uiZ = softfloat_propagateNaNF32UI( uiA, uiB );
 2257|      2| uiZ:
 2258|      2|    return float32_t::fromRaw(uiZ);
 2259|      0|}
softfloat.cpp:_ZN2cvL7f32_divENS_9softfloatES0_:
  679|      8|{
  680|      8|    uint_fast32_t uiA;
  681|      8|    bool signA;
  682|      8|    int_fast16_t expA;
  683|      8|    uint_fast32_t sigA;
  684|      8|    uint_fast32_t uiB;
  685|      8|    bool signB;
  686|      8|    int_fast16_t expB;
  687|      8|    uint_fast32_t sigB;
  688|      8|    bool signZ;
  689|      8|    struct exp16_sig32 normExpSig;
  690|      8|    int_fast16_t expZ;
  691|      8|    uint_fast64_t sig64A;
  692|      8|    uint_fast32_t sigZ;
  693|      8|    uint_fast32_t uiZ;
  694|       |
  695|       |    /*------------------------------------------------------------------------
  696|       |    *------------------------------------------------------------------------*/
  697|      8|    uiA = a.v;
  698|      8|    signA = signF32UI( uiA );
  ------------------
  |  |  124|      8|#define signF32UI( a ) (((uint32_t) (a)>>31) != 0)
  ------------------
  699|      8|    expA  = expF32UI( uiA );
  ------------------
  |  |  125|      8|#define expF32UI( a ) ((int_fast16_t) ((a)>>23) & 0xFF)
  ------------------
  700|      8|    sigA  = fracF32UI( uiA );
  ------------------
  |  |  126|      8|#define fracF32UI( a ) ((a) & 0x007FFFFF)
  ------------------
  701|      8|    uiB = b.v;
  702|      8|    signB = signF32UI( uiB );
  ------------------
  |  |  124|      8|#define signF32UI( a ) (((uint32_t) (a)>>31) != 0)
  ------------------
  703|      8|    expB  = expF32UI( uiB );
  ------------------
  |  |  125|      8|#define expF32UI( a ) ((int_fast16_t) ((a)>>23) & 0xFF)
  ------------------
  704|      8|    sigB  = fracF32UI( uiB );
  ------------------
  |  |  126|      8|#define fracF32UI( a ) ((a) & 0x007FFFFF)
  ------------------
  705|      8|    signZ = signA ^ signB;
  706|       |    /*------------------------------------------------------------------------
  707|       |    *------------------------------------------------------------------------*/
  708|      8|    if ( expA == 0xFF ) {
  ------------------
  |  Branch (708:10): [True: 0, False: 8]
  ------------------
  709|      0|        if ( sigA ) goto propagateNaN;
  ------------------
  |  Branch (709:14): [True: 0, False: 0]
  ------------------
  710|      0|        if ( expB == 0xFF ) {
  ------------------
  |  Branch (710:14): [True: 0, False: 0]
  ------------------
  711|      0|            if ( sigB ) goto propagateNaN;
  ------------------
  |  Branch (711:18): [True: 0, False: 0]
  ------------------
  712|      0|            goto invalid;
  713|      0|        }
  714|      0|        goto infinity;
  715|      0|    }
  716|      8|    if ( expB == 0xFF ) {
  ------------------
  |  Branch (716:10): [True: 0, False: 8]
  ------------------
  717|      0|        if ( sigB ) goto propagateNaN;
  ------------------
  |  Branch (717:14): [True: 0, False: 0]
  ------------------
  718|      0|        goto zero;
  719|      0|    }
  720|       |    /*------------------------------------------------------------------------
  721|       |    *------------------------------------------------------------------------*/
  722|      8|    if ( ! expB ) {
  ------------------
  |  Branch (722:10): [True: 0, False: 8]
  ------------------
  723|      0|        if ( ! sigB ) {
  ------------------
  |  Branch (723:14): [True: 0, False: 0]
  ------------------
  724|      0|            if ( ! (expA | sigA) ) goto invalid;
  ------------------
  |  Branch (724:18): [True: 0, False: 0]
  ------------------
  725|      0|            raiseFlags( flag_infinite );
  726|      0|            goto infinity;
  727|      0|        }
  728|      0|        normExpSig = softfloat_normSubnormalF32Sig( sigB );
  729|      0|        expB = normExpSig.exp;
  730|      0|        sigB = normExpSig.sig;
  731|      0|    }
  732|      8|    if ( ! expA ) {
  ------------------
  |  Branch (732:10): [True: 0, False: 8]
  ------------------
  733|      0|        if ( ! sigA ) goto zero;
  ------------------
  |  Branch (733:14): [True: 0, False: 0]
  ------------------
  734|      0|        normExpSig = softfloat_normSubnormalF32Sig( sigA );
  735|      0|        expA = normExpSig.exp;
  736|      0|        sigA = normExpSig.sig;
  737|      0|    }
  738|       |    /*------------------------------------------------------------------------
  739|       |    *------------------------------------------------------------------------*/
  740|      8|    expZ = expA - expB + 0x7E;
  741|      8|    sigA |= 0x00800000;
  742|      8|    sigB |= 0x00800000;
  743|      8|    if ( sigA < sigB ) {
  ------------------
  |  Branch (743:10): [True: 6, False: 2]
  ------------------
  744|      6|        --expZ;
  745|      6|        sig64A = (uint_fast64_t) sigA<<31;
  746|      6|    } else {
  747|      2|        sig64A = (uint_fast64_t) sigA<<30;
  748|      2|    }
  749|      8|    sigZ = (uint_fast32_t)(sig64A / sigB); // fixed warning on type cast
  750|      8|    if ( ! (sigZ & 0x3F) ) sigZ |= ((uint_fast64_t) sigB * sigZ != sig64A);
  ------------------
  |  Branch (750:10): [True: 0, False: 8]
  ------------------
  751|      8|    return softfloat_roundPackToF32( signZ, expZ, sigZ );
  752|       |    /*------------------------------------------------------------------------
  753|       |    *------------------------------------------------------------------------*/
  754|      0| propagateNaN:
  755|      0|    uiZ = softfloat_propagateNaNF32UI( uiA, uiB );
  756|      0|    goto uiZ;
  757|       |    /*------------------------------------------------------------------------
  758|       |    *------------------------------------------------------------------------*/
  759|      0| invalid:
  760|      0|    raiseFlags( flag_invalid );
  761|      0|    uiZ = defaultNaNF32UI;
  ------------------
  |  |  339|      0|#define defaultNaNF32UI 0xFFC00000
  ------------------
  762|      0|    goto uiZ;
  763|       |    /*------------------------------------------------------------------------
  764|       |    *------------------------------------------------------------------------*/
  765|      0| infinity:
  766|      0|    uiZ = packToF32UI( signZ, 0xFF, 0 );
  ------------------
  |  |  127|      0|#define packToF32UI( sign, exp, sig ) (((uint32_t) (sign)<<31) + ((uint32_t) (exp)<<23) + (sig))
  ------------------
  767|      0|    goto uiZ;
  768|       |    /*------------------------------------------------------------------------
  769|       |    *------------------------------------------------------------------------*/
  770|      0| zero:
  771|      0|    uiZ = packToF32UI( signZ, 0, 0 );
  ------------------
  |  |  127|      0|#define packToF32UI( sign, exp, sig ) (((uint32_t) (sign)<<31) + ((uint32_t) (exp)<<23) + (sig))
  ------------------
  772|      0| uiZ:
  773|      0|    return float32_t::fromRaw(uiZ);
  774|      0|}
softfloat.cpp:_ZN2cvL7f32_subENS_9softfloatES0_:
 1187|      4|{
 1188|      4|    uint_fast32_t uiA;
 1189|      4|    uint_fast32_t uiB;
 1190|       |
 1191|      4|    uiA = a.v;
 1192|      4|    uiB = b.v;
 1193|      4|    if ( signF32UI( uiA ^ uiB ) ) {
  ------------------
  |  |  124|      4|#define signF32UI( a ) (((uint32_t) (a)>>31) != 0)
  |  |  ------------------
  |  |  |  Branch (124:24): [True: 4, False: 0]
  |  |  ------------------
  ------------------
 1194|      4|        return softfloat_addMagsF32( uiA, uiB );
 1195|      4|    } else {
 1196|      0|        return softfloat_subMagsF32( uiA, uiB );
 1197|      0|    }
 1198|      4|}
softfloat.cpp:_ZN2cvL24softfloat_roundPackToF64Eblm:
 2999|     18|{
 3000|     18|    uint_fast8_t roundingMode;
 3001|     18|    bool roundNearEven;
 3002|     18|    uint_fast16_t roundIncrement, roundBits;
 3003|     18|    bool isTiny;
 3004|     18|    uint_fast64_t uiZ;
 3005|       |
 3006|       |    /*------------------------------------------------------------------------
 3007|       |    *------------------------------------------------------------------------*/
 3008|     18|    roundingMode = globalRoundingMode;
 3009|     18|    roundNearEven = (roundingMode == round_near_even);
 3010|     18|    roundIncrement = 0x200;
 3011|     18|    if ( ! roundNearEven && (roundingMode != round_near_maxMag) ) {
  ------------------
  |  Branch (3011:10): [True: 0, False: 18]
  |  Branch (3011:29): [True: 0, False: 0]
  ------------------
 3012|      0|        roundIncrement =
 3013|      0|            (roundingMode
  ------------------
  |  Branch (3013:13): [True: 0, False: 0]
  ------------------
 3014|      0|                 == (sign ? round_min : round_max))
  ------------------
  |  Branch (3014:22): [True: 0, False: 0]
  ------------------
 3015|      0|                ? 0x3FF
 3016|      0|                : 0;
 3017|      0|    }
 3018|     18|    roundBits = sig & 0x3FF;
 3019|       |    /*------------------------------------------------------------------------
 3020|       |    *------------------------------------------------------------------------*/
 3021|     18|    if ( 0x7FD <= (uint16_t) exp ) {
  ------------------
  |  Branch (3021:10): [True: 0, False: 18]
  ------------------
 3022|      0|        if ( exp < 0 ) {
  ------------------
  |  Branch (3022:14): [True: 0, False: 0]
  ------------------
 3023|       |            /*----------------------------------------------------------------
 3024|       |            *----------------------------------------------------------------*/
 3025|      0|            isTiny =
 3026|      0|                (globalDetectTininess == tininess_beforeRounding)
  ------------------
  |  Branch (3026:17): [Folded - Ignored]
  ------------------
 3027|      0|                    || (exp < -1)
  ------------------
  |  Branch (3027:24): [True: 0, False: 0]
  ------------------
 3028|      0|                    || (sig + roundIncrement < UINT64_C( 0x8000000000000000 ));
  ------------------
  |  Branch (3028:24): [True: 0, False: 0]
  ------------------
 3029|      0|            sig = softfloat_shiftRightJam64( sig, -exp );
 3030|      0|            exp = 0;
 3031|      0|            roundBits = sig & 0x3FF;
 3032|      0|            if ( isTiny && roundBits ) {
  ------------------
  |  Branch (3032:18): [True: 0, False: 0]
  |  Branch (3032:28): [True: 0, False: 0]
  ------------------
 3033|      0|                raiseFlags( flag_underflow );
 3034|      0|            }
 3035|      0|        } else if (
 3036|      0|            (0x7FD < exp)
  ------------------
  |  Branch (3036:13): [True: 0, False: 0]
  ------------------
 3037|      0|                || (UINT64_C( 0x8000000000000000 ) <= sig + roundIncrement)
  ------------------
  |  Branch (3037:20): [True: 0, False: 0]
  ------------------
 3038|      0|        ) {
 3039|       |            /*----------------------------------------------------------------
 3040|       |            *----------------------------------------------------------------*/
 3041|      0|            raiseFlags(
 3042|      0|                flag_overflow | flag_inexact );
 3043|      0|            uiZ = packToF64UI( sign, 0x7FF, 0 ) - ! roundIncrement;
  ------------------
  |  |  137|      0|#define packToF64UI( sign, exp, sig ) ((uint64_t) (((uint_fast64_t) (sign)<<63) + ((uint_fast64_t) (exp)<<52) + (sig)))
  ------------------
 3044|      0|            goto uiZ;
 3045|      0|        }
 3046|      0|    }
 3047|       |    /*------------------------------------------------------------------------
 3048|       |    *------------------------------------------------------------------------*/
 3049|     18|    sig = (sig + roundIncrement)>>10;
 3050|     18|    if ( roundBits ) {
  ------------------
  |  Branch (3050:10): [True: 12, False: 6]
  ------------------
 3051|     12|        raiseFlags(flag_inexact);
 3052|     12|        if ( roundingMode == round_odd ) {
  ------------------
  |  Branch (3052:14): [True: 0, False: 12]
  ------------------
 3053|      0|            sig |= 1;
 3054|      0|            goto packReturn;
 3055|      0|        }
 3056|     12|    }
 3057|     18|    sig &= ~(uint_fast64_t) (! (roundBits ^ 0x200) & roundNearEven);
 3058|     18|    if ( ! sig ) exp = 0;
  ------------------
  |  Branch (3058:10): [True: 0, False: 18]
  ------------------
 3059|       |    /*------------------------------------------------------------------------
 3060|       |    *------------------------------------------------------------------------*/
 3061|     18| packReturn:
 3062|     18|    uiZ = packToF64UI( sign, exp, sig );
  ------------------
  |  |  137|     18|#define packToF64UI( sign, exp, sig ) ((uint64_t) (((uint_fast64_t) (sign)<<63) + ((uint_fast64_t) (exp)<<52) + (sig)))
  ------------------
 3063|     18| uiZ:
 3064|     18|    return float64_t::fromRaw(uiZ);
 3065|     18|}
softfloat.cpp:_ZN2cvL7f64_divENS_10softdoubleES0_:
 1345|     16|{
 1346|     16|    uint_fast64_t uiA;
 1347|     16|    bool signA;
 1348|     16|    int_fast16_t expA;
 1349|     16|    uint_fast64_t sigA;
 1350|     16|    uint_fast64_t uiB;
 1351|     16|    bool signB;
 1352|     16|    int_fast16_t expB;
 1353|     16|    uint_fast64_t sigB;
 1354|     16|    bool signZ;
 1355|     16|    struct exp16_sig64 normExpSig;
 1356|     16|    int_fast16_t expZ;
 1357|     16|    uint32_t recip32, sig32Z, doubleTerm;
 1358|     16|    uint_fast64_t rem;
 1359|     16|    uint32_t q;
 1360|     16|    uint_fast64_t sigZ;
 1361|     16|    uint_fast64_t uiZ;
 1362|       |
 1363|       |    /*------------------------------------------------------------------------
 1364|       |    *------------------------------------------------------------------------*/
 1365|     16|    uiA = a.v;
 1366|     16|    signA = signF64UI( uiA );
  ------------------
  |  |  134|     16|#define signF64UI( a ) (((uint64_t) (a)>>63) != 0)
  ------------------
 1367|     16|    expA  = expF64UI( uiA );
  ------------------
  |  |  135|     16|#define expF64UI( a ) ((int_fast16_t) ((a)>>52) & 0x7FF)
  ------------------
 1368|     16|    sigA  = fracF64UI( uiA );
  ------------------
  |  |  136|     16|#define fracF64UI( a ) ((a) & UINT64_C( 0x000FFFFFFFFFFFFF ))
  ------------------
 1369|     16|    uiB = b.v;
 1370|     16|    signB = signF64UI( uiB );
  ------------------
  |  |  134|     16|#define signF64UI( a ) (((uint64_t) (a)>>63) != 0)
  ------------------
 1371|     16|    expB  = expF64UI( uiB );
  ------------------
  |  |  135|     16|#define expF64UI( a ) ((int_fast16_t) ((a)>>52) & 0x7FF)
  ------------------
 1372|     16|    sigB  = fracF64UI( uiB );
  ------------------
  |  |  136|     16|#define fracF64UI( a ) ((a) & UINT64_C( 0x000FFFFFFFFFFFFF ))
  ------------------
 1373|     16|    signZ = signA ^ signB;
 1374|       |    /*------------------------------------------------------------------------
 1375|       |    *------------------------------------------------------------------------*/
 1376|     16|    if ( expA == 0x7FF ) {
  ------------------
  |  Branch (1376:10): [True: 0, False: 16]
  ------------------
 1377|      0|        if ( sigA ) goto propagateNaN;
  ------------------
  |  Branch (1377:14): [True: 0, False: 0]
  ------------------
 1378|      0|        if ( expB == 0x7FF ) {
  ------------------
  |  Branch (1378:14): [True: 0, False: 0]
  ------------------
 1379|      0|            if ( sigB ) goto propagateNaN;
  ------------------
  |  Branch (1379:18): [True: 0, False: 0]
  ------------------
 1380|      0|            goto invalid;
 1381|      0|        }
 1382|      0|        goto infinity;
 1383|      0|    }
 1384|     16|    if ( expB == 0x7FF ) {
  ------------------
  |  Branch (1384:10): [True: 0, False: 16]
  ------------------
 1385|      0|        if ( sigB ) goto propagateNaN;
  ------------------
  |  Branch (1385:14): [True: 0, False: 0]
  ------------------
 1386|      0|        goto zero;
 1387|      0|    }
 1388|       |    /*------------------------------------------------------------------------
 1389|       |    *------------------------------------------------------------------------*/
 1390|     16|    if ( ! expB ) {
  ------------------
  |  Branch (1390:10): [True: 0, False: 16]
  ------------------
 1391|      0|        if ( ! sigB ) {
  ------------------
  |  Branch (1391:14): [True: 0, False: 0]
  ------------------
 1392|      0|            if ( ! (expA | sigA) ) goto invalid;
  ------------------
  |  Branch (1392:18): [True: 0, False: 0]
  ------------------
 1393|      0|            raiseFlags( flag_infinite );
 1394|      0|            goto infinity;
 1395|      0|        }
 1396|      0|        normExpSig = softfloat_normSubnormalF64Sig( sigB );
 1397|      0|        expB = normExpSig.exp;
 1398|      0|        sigB = normExpSig.sig;
 1399|      0|    }
 1400|     16|    if ( ! expA ) {
  ------------------
  |  Branch (1400:10): [True: 0, False: 16]
  ------------------
 1401|      0|        if ( ! sigA ) goto zero;
  ------------------
  |  Branch (1401:14): [True: 0, False: 0]
  ------------------
 1402|      0|        normExpSig = softfloat_normSubnormalF64Sig( sigA );
 1403|      0|        expA = normExpSig.exp;
 1404|      0|        sigA = normExpSig.sig;
 1405|      0|    }
 1406|       |    /*------------------------------------------------------------------------
 1407|       |    *------------------------------------------------------------------------*/
 1408|     16|    expZ = expA - expB + 0x3FE;
 1409|     16|    sigA |= UINT64_C( 0x0010000000000000 );
 1410|     16|    sigB |= UINT64_C( 0x0010000000000000 );
 1411|     16|    if ( sigA < sigB ) {
  ------------------
  |  Branch (1411:10): [True: 6, False: 10]
  ------------------
 1412|      6|        --expZ;
 1413|      6|        sigA <<= 11;
 1414|     10|    } else {
 1415|     10|        sigA <<= 10;
 1416|     10|    }
 1417|     16|    sigB <<= 11;
 1418|     16|    recip32 = softfloat_approxRecip32_1( sigB>>32 ) - 2;
  ------------------
  |  |  556|     16|#define softfloat_approxRecip32_1( a ) ((uint32_t) (UINT64_C( 0x7FFFFFFFFFFFFFFF ) / (uint32_t) (a)))
  ------------------
 1419|     16|    sig32Z = ((uint32_t) (sigA>>32) * (uint_fast64_t) recip32)>>32;
 1420|     16|    doubleTerm = sig32Z<<1;
 1421|     16|    rem =
 1422|     16|        ((sigA - (uint_fast64_t) doubleTerm * (uint32_t) (sigB>>32))<<28)
 1423|     16|            - (uint_fast64_t) doubleTerm * ((uint32_t) sigB>>4);
 1424|     16|    q = (((uint32_t) (rem>>32) * (uint_fast64_t) recip32)>>32) + 4;
 1425|     16|    sigZ = ((uint_fast64_t) sig32Z<<32) + ((uint_fast64_t) q<<4);
 1426|       |    /*------------------------------------------------------------------------
 1427|       |    *------------------------------------------------------------------------*/
 1428|     16|    if ( (sigZ & 0x1FF) < 4<<4 ) {
  ------------------
  |  Branch (1428:10): [True: 6, False: 10]
  ------------------
 1429|      6|        q &= ~7;
 1430|      6|        sigZ &= ~(uint_fast64_t) 0x7F;
 1431|      6|        doubleTerm = q<<1;
 1432|      6|        rem =
 1433|      6|            ((rem - (uint_fast64_t) doubleTerm * (uint32_t) (sigB>>32))<<28)
 1434|      6|                - (uint_fast64_t) doubleTerm * ((uint32_t) sigB>>4);
 1435|      6|        if ( rem & UINT64_C( 0x8000000000000000 ) ) {
  ------------------
  |  Branch (1435:14): [True: 2, False: 4]
  ------------------
 1436|      2|            sigZ -= 1<<7;
 1437|      4|        } else {
 1438|      4|            if ( rem ) sigZ |= 1;
  ------------------
  |  Branch (1438:18): [True: 0, False: 4]
  ------------------
 1439|      4|        }
 1440|      6|    }
 1441|     16|    return softfloat_roundPackToF64( signZ, expZ, sigZ );
 1442|       |    /*------------------------------------------------------------------------
 1443|       |    *------------------------------------------------------------------------*/
 1444|      0| propagateNaN:
 1445|      0|    uiZ = softfloat_propagateNaNF64UI( uiA, uiB );
 1446|      0|    goto uiZ;
 1447|       |    /*------------------------------------------------------------------------
 1448|       |    *------------------------------------------------------------------------*/
 1449|      0| invalid:
 1450|      0|    raiseFlags( flag_invalid );
 1451|      0|    uiZ = defaultNaNF64UI;
  ------------------
  |  |  373|      0|#define defaultNaNF64UI UINT64_C( 0xFFF8000000000000 )
  ------------------
 1452|      0|    goto uiZ;
 1453|       |    /*------------------------------------------------------------------------
 1454|       |    *------------------------------------------------------------------------*/
 1455|      0| infinity:
 1456|      0|    uiZ = packToF64UI( signZ, 0x7FF, 0 );
  ------------------
  |  |  137|      0|#define packToF64UI( sign, exp, sig ) ((uint64_t) (((uint_fast64_t) (sign)<<63) + ((uint_fast64_t) (exp)<<52) + (sig)))
  ------------------
 1457|      0|    goto uiZ;
 1458|       |    /*------------------------------------------------------------------------
 1459|       |    *------------------------------------------------------------------------*/
 1460|      0| zero:
 1461|      0|    uiZ = packToF64UI( signZ, 0, 0 );
  ------------------
  |  |  137|      0|#define packToF64UI( sign, exp, sig ) ((uint64_t) (((uint_fast64_t) (sign)<<63) + ((uint_fast64_t) (exp)<<52) + (sig)))
  ------------------
 1462|      0| uiZ:
 1463|      0|    return float64_t::fromRaw(uiZ);
 1464|      0|}
softfloat.cpp:_ZN2cvL20softfloat_mul64To128Emm:
 2449|      2|{
 2450|      2|    uint32_t a32, a0, b32, b0;
 2451|      2|    struct uint128 z;
 2452|      2|    uint64_t mid1, mid;
 2453|       |
 2454|      2|    a32 = a>>32;
 2455|      2|    a0 = (uint32_t)a; //fixed warning on type cast
 2456|      2|    b32 = b>>32;
 2457|      2|    b0 = (uint32_t) b; //fixed warning on type cast
 2458|      2|    z.v0 = (uint_fast64_t) a0 * b0;
 2459|      2|    mid1 = (uint_fast64_t) a32 * b0;
 2460|      2|    mid = mid1 + (uint_fast64_t) a0 * b32;
 2461|      2|    z.v64 = (uint_fast64_t) a32 * b32;
 2462|      2|    z.v64 += (uint_fast64_t) (mid < mid1)<<32 | mid>>32;
 2463|      2|    mid <<= 32;
 2464|      2|    z.v0 += mid;
 2465|      2|    z.v64 += (z.v0 < mid);
 2466|      2|    return z;
 2467|      2|}
softfloat.cpp:_ZN2cvL7f64_mulENS_10softdoubleES0_:
 1531|      2|{
 1532|      2|    uint_fast64_t uiA;
 1533|      2|    bool signA;
 1534|      2|    int_fast16_t expA;
 1535|      2|    uint_fast64_t sigA;
 1536|      2|    uint_fast64_t uiB;
 1537|      2|    bool signB;
 1538|      2|    int_fast16_t expB;
 1539|      2|    uint_fast64_t sigB;
 1540|      2|    bool signZ;
 1541|      2|    uint_fast64_t magBits;
 1542|      2|    struct exp16_sig64 normExpSig;
 1543|      2|    int_fast16_t expZ;
 1544|      2|    struct uint128 sig128Z;
 1545|      2|    uint_fast64_t sigZ, uiZ;
 1546|       |
 1547|       |    /*------------------------------------------------------------------------
 1548|       |    *------------------------------------------------------------------------*/
 1549|      2|    uiA = a.v;
 1550|      2|    signA = signF64UI( uiA );
  ------------------
  |  |  134|      2|#define signF64UI( a ) (((uint64_t) (a)>>63) != 0)
  ------------------
 1551|      2|    expA  = expF64UI( uiA );
  ------------------
  |  |  135|      2|#define expF64UI( a ) ((int_fast16_t) ((a)>>52) & 0x7FF)
  ------------------
 1552|      2|    sigA  = fracF64UI( uiA );
  ------------------
  |  |  136|      2|#define fracF64UI( a ) ((a) & UINT64_C( 0x000FFFFFFFFFFFFF ))
  ------------------
 1553|      2|    uiB = b.v;
 1554|      2|    signB = signF64UI( uiB );
  ------------------
  |  |  134|      2|#define signF64UI( a ) (((uint64_t) (a)>>63) != 0)
  ------------------
 1555|      2|    expB  = expF64UI( uiB );
  ------------------
  |  |  135|      2|#define expF64UI( a ) ((int_fast16_t) ((a)>>52) & 0x7FF)
  ------------------
 1556|      2|    sigB  = fracF64UI( uiB );
  ------------------
  |  |  136|      2|#define fracF64UI( a ) ((a) & UINT64_C( 0x000FFFFFFFFFFFFF ))
  ------------------
 1557|      2|    signZ = signA ^ signB;
 1558|       |    /*------------------------------------------------------------------------
 1559|       |    *------------------------------------------------------------------------*/
 1560|      2|    if ( expA == 0x7FF ) {
  ------------------
  |  Branch (1560:10): [True: 0, False: 2]
  ------------------
 1561|      0|        if ( sigA || ((expB == 0x7FF) && sigB) ) goto propagateNaN;
  ------------------
  |  Branch (1561:14): [True: 0, False: 0]
  |  Branch (1561:23): [True: 0, False: 0]
  |  Branch (1561:42): [True: 0, False: 0]
  ------------------
 1562|      0|        magBits = expB | sigB;
 1563|      0|        goto infArg;
 1564|      0|    }
 1565|      2|    if ( expB == 0x7FF ) {
  ------------------
  |  Branch (1565:10): [True: 0, False: 2]
  ------------------
 1566|      0|        if ( sigB ) goto propagateNaN;
  ------------------
  |  Branch (1566:14): [True: 0, False: 0]
  ------------------
 1567|      0|        magBits = expA | sigA;
 1568|      0|        goto infArg;
 1569|      0|    }
 1570|       |    /*------------------------------------------------------------------------
 1571|       |    *------------------------------------------------------------------------*/
 1572|      2|    if ( ! expA ) {
  ------------------
  |  Branch (1572:10): [True: 0, False: 2]
  ------------------
 1573|      0|        if ( ! sigA ) goto zero;
  ------------------
  |  Branch (1573:14): [True: 0, False: 0]
  ------------------
 1574|      0|        normExpSig = softfloat_normSubnormalF64Sig( sigA );
 1575|      0|        expA = normExpSig.exp;
 1576|      0|        sigA = normExpSig.sig;
 1577|      0|    }
 1578|      2|    if ( ! expB ) {
  ------------------
  |  Branch (1578:10): [True: 0, False: 2]
  ------------------
 1579|      0|        if ( ! sigB ) goto zero;
  ------------------
  |  Branch (1579:14): [True: 0, False: 0]
  ------------------
 1580|      0|        normExpSig = softfloat_normSubnormalF64Sig( sigB );
 1581|      0|        expB = normExpSig.exp;
 1582|      0|        sigB = normExpSig.sig;
 1583|      0|    }
 1584|       |    /*------------------------------------------------------------------------
 1585|       |    *------------------------------------------------------------------------*/
 1586|      2|    expZ = expA + expB - 0x3FF;
 1587|      2|    sigA = (sigA | UINT64_C( 0x0010000000000000 ))<<10;
 1588|      2|    sigB = (sigB | UINT64_C( 0x0010000000000000 ))<<11;
 1589|      2|    sig128Z = softfloat_mul64To128( sigA, sigB );
 1590|      2|    sigZ = sig128Z.v64 | (sig128Z.v0 != 0);
 1591|       |
 1592|      2|    if ( sigZ < UINT64_C( 0x4000000000000000 ) ) {
  ------------------
  |  Branch (1592:10): [True: 2, False: 0]
  ------------------
 1593|      2|        --expZ;
 1594|      2|        sigZ <<= 1;
 1595|      2|    }
 1596|      2|    return softfloat_roundPackToF64( signZ, expZ, sigZ );
 1597|       |    /*------------------------------------------------------------------------
 1598|       |    *------------------------------------------------------------------------*/
 1599|      0| propagateNaN:
 1600|      0|    uiZ = softfloat_propagateNaNF64UI( uiA, uiB );
 1601|      0|    goto uiZ;
 1602|       |    /*------------------------------------------------------------------------
 1603|       |    *------------------------------------------------------------------------*/
 1604|      0| infArg:
 1605|      0|    if ( ! magBits ) {
  ------------------
  |  Branch (1605:10): [True: 0, False: 0]
  ------------------
 1606|      0|        raiseFlags( flag_invalid );
 1607|      0|        uiZ = defaultNaNF64UI;
  ------------------
  |  |  373|      0|#define defaultNaNF64UI UINT64_C( 0xFFF8000000000000 )
  ------------------
 1608|      0|    } else {
 1609|      0|        uiZ = packToF64UI( signZ, 0x7FF, 0 );
  ------------------
  |  |  137|      0|#define packToF64UI( sign, exp, sig ) ((uint64_t) (((uint_fast64_t) (sign)<<63) + ((uint_fast64_t) (exp)<<52) + (sig)))
  ------------------
 1610|      0|    }
 1611|      0|    goto uiZ;
 1612|       |    /*------------------------------------------------------------------------
 1613|       |    *------------------------------------------------------------------------*/
 1614|      0| zero:
 1615|      0|    uiZ = packToF64UI( signZ, 0, 0 );
  ------------------
  |  |  137|      0|#define packToF64UI( sign, exp, sig ) ((uint64_t) (((uint_fast64_t) (sign)<<63) + ((uint_fast64_t) (exp)<<52) + (sig)))
  ------------------
 1616|      0| uiZ:
 1617|      0|    return float64_t::fromRaw(uiZ);
 1618|      0|}
softfloat.cpp:_ZN2cvL10i32_to_f32Ei:
 2109|     26|{
 2110|     26|    bool sign;
 2111|     26|    uint_fast32_t absA;
 2112|       |
 2113|     26|    sign = (a < 0);
 2114|     26|    if ( ! (a & 0x7FFFFFFF) ) {
  ------------------
  |  Branch (2114:10): [True: 0, False: 26]
  ------------------
 2115|      0|        return float32_t::fromRaw(sign ? packToF32UI( 1, 0x9E, 0 ) : 0);
  ------------------
  |  |  127|      0|#define packToF32UI( sign, exp, sig ) (((uint32_t) (sign)<<31) + ((uint32_t) (exp)<<23) + (sig))
  ------------------
  |  Branch (2115:35): [True: 0, False: 0]
  ------------------
 2116|      0|    }
 2117|       |    //fixed unsigned unary minus: -x == ~x + 1
 2118|     26|    absA = sign ? (~(uint_fast32_t) a + 1) : (uint_fast32_t) a;
  ------------------
  |  Branch (2118:12): [True: 4, False: 22]
  ------------------
 2119|     26|    return softfloat_normRoundPackToF32( sign, 0x9C, absA );
 2120|     26|}
softfloat.cpp:_ZN2cvL10i32_to_f64Ei:
 2123|     30|{
 2124|     30|    uint_fast64_t uiZ;
 2125|     30|    bool sign;
 2126|     30|    uint_fast32_t absA;
 2127|     30|    int_fast8_t shiftDist;
 2128|       |
 2129|     30|    if ( ! a ) {
  ------------------
  |  Branch (2129:10): [True: 0, False: 30]
  ------------------
 2130|      0|        uiZ = 0;
 2131|     30|    } else {
 2132|     30|        sign = (a < 0);
 2133|       |        //fixed unsigned unary minus: -x == ~x + 1
 2134|     30|        absA = sign ? (~(uint_fast32_t) a + 1) : (uint_fast32_t) a;
  ------------------
  |  Branch (2134:16): [True: 0, False: 30]
  ------------------
 2135|     30|        shiftDist = softfloat_countLeadingZeros32( absA ) + 21;
 2136|     30|        uiZ =
 2137|     30|            packToF64UI(
  ------------------
  |  |  137|     30|#define packToF64UI( sign, exp, sig ) ((uint64_t) (((uint_fast64_t) (sign)<<63) + ((uint_fast64_t) (exp)<<52) + (sig)))
  ------------------
 2138|     30|                sign, 0x432 - shiftDist, (uint_fast64_t) absA<<shiftDist );
 2139|     30|    }
 2140|     30|    return float64_t::fromRaw(uiZ);
 2141|     30|}

_ZN2cv22getInitializationMutexEv:
   87|      6|{
   88|      6|    if (__initialization_mutex == NULL)
  ------------------
  |  Branch (88:9): [True: 2, False: 4]
  ------------------
   89|      2|    {
   90|      2|        (void)_initSystem();
   91|      2|        __initialization_mutex = new Mutex();
   92|      2|    }
   93|      6|    return *__initialization_mutex;
   94|      6|}
_ZN2cv12getTickCountEv:
  909|      4|{
  910|      4|    std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
  911|      4|    return (int64)now.time_since_epoch().count();
  912|      4|}
_ZN2cv16getTickFrequencyEv:
  915|      2|{
  916|      2|    using clock_period_t = std::chrono::steady_clock::duration::period;
  917|      2|    double clock_freq = clock_period_t::den / clock_period_t::num;
  918|      2|    return clock_freq;
  919|      2|}
_ZN2cv14getTimestampNSEv:
 1026|      2|{
 1027|      2|    return internal::Timestamp::getInstance().getTimestamp();
 1028|      2|}
_ZN2cv7details14TlsAbstractionC2Ev:
 1621|      2|    : disposed(false)
 1622|      2|{
 1623|      2|    CV_Assert(pthread_key_create(&tlsKey, opencv_tls_destructor) == 0);
  ------------------
  |  |  423|      2|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:35): [True: 2, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1624|      2|}
_ZN2cv16TLSDataContainerC2Ev:
 2037|      2|{
 2038|      2|    key_ = (int)getTlsStorage().reserveSlot(this); // Reserve key from TLS storage
 2039|      2|}
_ZN2cv5utils29getConfigurationParameterBoolEPKcb:
 2273|     32|{
 2274|     32|    return read<bool>(name, defaultValue);
 2275|     32|}
_ZN2cv5utils30getConfigurationParameterSizeTEPKcm:
 2278|     28|{
 2279|     28|    return read<size_t>(name, defaultValue);
 2280|     28|}
_ZN2cv5utils31getConfigurationParameterStringEPKcRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
 2283|      4|{
 2284|      4|    return read<cv::String>(name, defaultValue);
 2285|      4|}
system.cpp:_ZN2cvL11_initSystemEv:
   74|      2|{
   75|       |#ifdef __ANDROID__
   76|       |    // https://github.com/opencv/opencv/issues/14906
   77|       |    // "ios_base::Init" object is not a part of Android's "iostream" header (in case of clang toolchain, NDK 20).
   78|       |    // Ref1: https://en.cppreference.com/w/cpp/io/ios_base/Init
   79|       |    //       The header <iostream> behaves as if it defines (directly or indirectly) an instance of std::ios_base::Init with static storage duration
   80|       |    // Ref2: https://github.com/gcc-mirror/gcc/blob/gcc-8-branch/libstdc%2B%2B-v3/include/std/iostream#L73-L74
   81|       |    static std::ios_base::Init s_iostream_initializer;
   82|       |#endif
   83|      2|}
_ZN2cv10HWFeaturesC2Eb:
  386|      4|    {
  387|      4|        if (run_initialize)
  ------------------
  |  Branch (387:13): [True: 2, False: 2]
  ------------------
  388|      2|            initialize();
  389|      4|    }
_ZN2cv10HWFeatures10initializeEv:
  452|      2|    {
  453|      2|        if (utils::getConfigurationParameterBool("OPENCV_DUMP_CONFIG"))
  ------------------
  |  Branch (453:13): [True: 0, False: 2]
  ------------------
  454|      0|        {
  455|      0|            fprintf(stderr, "\nOpenCV build configuration is:\n%s\n",
  456|      0|                cv::getBuildInformation().c_str());
  457|      0|        }
  458|       |
  459|      2|        initializeNames();
  460|       |
  461|      2|    #ifdef CV_CPUID_X86
  462|      2|        int cpuid_data[4] = { 0, 0, 0, 0 };
  463|      2|        int cpuid_data_ex[4] = { 0, 0, 0, 0 };
  464|       |
  465|      2|        CV_CPUID_X86(cpuid_data, 1, 0/*unused*/);
  ------------------
  |  |  313|      2|    #define CV_CPUID_X86 cv_cpuid
  ------------------
  466|       |
  467|      2|        int x86_family = (cpuid_data[0] >> 8) & 15;
  468|      2|        if( x86_family >= 6 )
  ------------------
  |  Branch (468:13): [True: 2, False: 0]
  ------------------
  469|      2|        {
  470|      2|            have[CV_CPU_MMX]    = (cpuid_data[3] & (1<<23)) != 0;
  ------------------
  |  |  248|      2|#define CV_CPU_MMX              1
  ------------------
  471|      2|            have[CV_CPU_SSE]    = (cpuid_data[3] & (1<<25)) != 0;
  ------------------
  |  |  249|      2|#define CV_CPU_SSE              2
  ------------------
  472|      2|            have[CV_CPU_SSE2]   = (cpuid_data[3] & (1<<26)) != 0;
  ------------------
  |  |  250|      2|#define CV_CPU_SSE2             3
  ------------------
  473|      2|            have[CV_CPU_SSE3]   = (cpuid_data[2] & (1<<0)) != 0;
  ------------------
  |  |  251|      2|#define CV_CPU_SSE3             4
  ------------------
  474|      2|            have[CV_CPU_SSSE3]  = (cpuid_data[2] & (1<<9)) != 0;
  ------------------
  |  |  252|      2|#define CV_CPU_SSSE3            5
  ------------------
  475|      2|            have[CV_CPU_FMA3]   = (cpuid_data[2] & (1<<12)) != 0;
  ------------------
  |  |  259|      2|#define CV_CPU_FMA3             12
  ------------------
  476|      2|            have[CV_CPU_SSE4_1] = (cpuid_data[2] & (1<<19)) != 0;
  ------------------
  |  |  253|      2|#define CV_CPU_SSE4_1           6
  ------------------
  477|      2|            have[CV_CPU_SSE4_2] = (cpuid_data[2] & (1<<20)) != 0;
  ------------------
  |  |  254|      2|#define CV_CPU_SSE4_2           7
  ------------------
  478|      2|            have[CV_CPU_POPCNT] = (cpuid_data[2] & (1<<23)) != 0;
  ------------------
  |  |  255|      2|#define CV_CPU_POPCNT           8
  ------------------
  479|      2|            have[CV_CPU_AVX]    = (cpuid_data[2] & (1<<28)) != 0;
  ------------------
  |  |  257|      2|#define CV_CPU_AVX              10
  ------------------
  480|      2|            have[CV_CPU_FP16]   = (cpuid_data[2] & (1<<29)) != 0;
  ------------------
  |  |  256|      2|#define CV_CPU_FP16             9
  ------------------
  481|       |
  482|       |            // make the second call to the cpuid command in order to get
  483|       |            // information about extended features like AVX2
  484|      2|            CV_CPUID_X86(cpuid_data_ex, 7, 0);
  ------------------
  |  |  313|      2|    #define CV_CPUID_X86 cv_cpuid
  ------------------
  485|       |
  486|      2|            have[CV_CPU_AVX2]   = (cpuid_data_ex[1] & (1<<5)) != 0;
  ------------------
  |  |  258|      2|#define CV_CPU_AVX2             11
  ------------------
  487|       |
  488|      2|            have[CV_CPU_AVX_512F]         = (cpuid_data_ex[1] & (1<<16)) != 0;
  ------------------
  |  |  261|      2|#define CV_CPU_AVX_512F         13
  ------------------
  489|      2|            have[CV_CPU_AVX_512DQ]        = (cpuid_data_ex[1] & (1<<17)) != 0;
  ------------------
  |  |  264|      2|#define CV_CPU_AVX_512DQ        16
  ------------------
  490|      2|            have[CV_CPU_AVX_512IFMA]      = (cpuid_data_ex[1] & (1<<21)) != 0;
  ------------------
  |  |  267|      2|#define CV_CPU_AVX_512IFMA      18
  ------------------
  491|      2|            have[CV_CPU_AVX_512PF]        = (cpuid_data_ex[1] & (1<<26)) != 0;
  ------------------
  |  |  268|      2|#define CV_CPU_AVX_512PF        19
  ------------------
  492|      2|            have[CV_CPU_AVX_512ER]        = (cpuid_data_ex[1] & (1<<27)) != 0;
  ------------------
  |  |  265|      2|#define CV_CPU_AVX_512ER        17
  ------------------
  493|      2|            have[CV_CPU_AVX_512CD]        = (cpuid_data_ex[1] & (1<<28)) != 0;
  ------------------
  |  |  263|      2|#define CV_CPU_AVX_512CD        15
  ------------------
  494|      2|            have[CV_CPU_AVX_512BW]        = (cpuid_data_ex[1] & (1<<30)) != 0;
  ------------------
  |  |  262|      2|#define CV_CPU_AVX_512BW        14
  ------------------
  495|      2|            have[CV_CPU_AVX_512VL]        = (cpuid_data_ex[1] & (1<<31)) != 0;
  ------------------
  |  |  270|      2|#define CV_CPU_AVX_512VL        21
  ------------------
  496|      2|            have[CV_CPU_AVX_512VBMI]      = (cpuid_data_ex[2] & (1<<1))  != 0;
  ------------------
  |  |  269|      2|#define CV_CPU_AVX_512VBMI      20
  ------------------
  497|      2|            have[CV_CPU_AVX_512VBMI2]     = (cpuid_data_ex[2] & (1<<6))  != 0;
  ------------------
  |  |  271|      2|#define CV_CPU_AVX_512VBMI2     22
  ------------------
  498|      2|            have[CV_CPU_AVX_512VNNI]      = (cpuid_data_ex[2] & (1<<11)) != 0;
  ------------------
  |  |  272|      2|#define CV_CPU_AVX_512VNNI      23
  ------------------
  499|      2|            have[CV_CPU_AVX_512BITALG]    = (cpuid_data_ex[2] & (1<<12)) != 0;
  ------------------
  |  |  273|      2|#define CV_CPU_AVX_512BITALG    24
  ------------------
  500|      2|            have[CV_CPU_AVX_512VPOPCNTDQ] = (cpuid_data_ex[2] & (1<<14)) != 0;
  ------------------
  |  |  274|      2|#define CV_CPU_AVX_512VPOPCNTDQ 25
  ------------------
  501|      2|            have[CV_CPU_AVX_5124VNNIW]    = (cpuid_data_ex[3] & (1<<2))  != 0;
  ------------------
  |  |  275|      2|#define CV_CPU_AVX_5124VNNIW    26
  ------------------
  502|      2|            have[CV_CPU_AVX_5124FMAPS]    = (cpuid_data_ex[3] & (1<<3))  != 0;
  ------------------
  |  |  276|      2|#define CV_CPU_AVX_5124FMAPS    27
  ------------------
  503|       |
  504|      2|            bool have_AVX_OS_support = true;
  505|      2|            bool have_AVX512_OS_support = true;
  506|      2|            if (!(cpuid_data[2] & (1<<27)))
  ------------------
  |  Branch (506:17): [True: 0, False: 2]
  ------------------
  507|      0|                have_AVX_OS_support = false; // OS uses XSAVE_XRSTORE and CPU support AVX
  508|      2|            else
  509|      2|            {
  510|      2|                int xcr0 = 0;
  511|       |            #ifdef _XCR_XFEATURE_ENABLED_MASK // requires immintrin.h
  512|       |                xcr0 = (int)_xgetbv(_XCR_XFEATURE_ENABLED_MASK);
  513|       |            #elif defined __GNUC__ && (defined __i386__ || defined __x86_64__)
  514|       |                __asm__ ("xgetbv\n\t" : "=a" (xcr0) : "c" (0) : "%edx" );
  515|      2|            #endif
  516|      2|                if ((xcr0 & 0x6) != 0x6)
  ------------------
  |  Branch (516:21): [True: 0, False: 2]
  ------------------
  517|      0|                    have_AVX_OS_support = false; // YMM registers
  518|      2|                if ((xcr0 & 0xe6) != 0xe6)
  ------------------
  |  Branch (518:21): [True: 2, False: 0]
  ------------------
  519|      2|                    have_AVX512_OS_support = false; // ZMM registers
  520|      2|            }
  521|       |
  522|      2|            if (!have_AVX_OS_support)
  ------------------
  |  Branch (522:17): [True: 0, False: 2]
  ------------------
  523|      0|            {
  524|      0|                have[CV_CPU_AVX] = false;
  ------------------
  |  |  257|      0|#define CV_CPU_AVX              10
  ------------------
  525|      0|                have[CV_CPU_FP16] = false;
  ------------------
  |  |  256|      0|#define CV_CPU_FP16             9
  ------------------
  526|      0|                have[CV_CPU_AVX2] = false;
  ------------------
  |  |  258|      0|#define CV_CPU_AVX2             11
  ------------------
  527|      0|                have[CV_CPU_FMA3] = false;
  ------------------
  |  |  259|      0|#define CV_CPU_FMA3             12
  ------------------
  528|      0|            }
  529|      2|            if (!have_AVX_OS_support || !have_AVX512_OS_support)
  ------------------
  |  Branch (529:17): [True: 0, False: 2]
  |  Branch (529:41): [True: 2, False: 0]
  ------------------
  530|      2|            {
  531|      2|                have[CV_CPU_AVX_512F] = false;
  ------------------
  |  |  261|      2|#define CV_CPU_AVX_512F         13
  ------------------
  532|      2|                have[CV_CPU_AVX_512BW] = false;
  ------------------
  |  |  262|      2|#define CV_CPU_AVX_512BW        14
  ------------------
  533|      2|                have[CV_CPU_AVX_512CD] = false;
  ------------------
  |  |  263|      2|#define CV_CPU_AVX_512CD        15
  ------------------
  534|      2|                have[CV_CPU_AVX_512DQ] = false;
  ------------------
  |  |  264|      2|#define CV_CPU_AVX_512DQ        16
  ------------------
  535|      2|                have[CV_CPU_AVX_512ER] = false;
  ------------------
  |  |  265|      2|#define CV_CPU_AVX_512ER        17
  ------------------
  536|      2|                have[CV_CPU_AVX_512IFMA] = false;
  ------------------
  |  |  267|      2|#define CV_CPU_AVX_512IFMA      18
  ------------------
  537|      2|                have[CV_CPU_AVX_512PF] = false;
  ------------------
  |  |  268|      2|#define CV_CPU_AVX_512PF        19
  ------------------
  538|      2|                have[CV_CPU_AVX_512VBMI] = false;
  ------------------
  |  |  269|      2|#define CV_CPU_AVX_512VBMI      20
  ------------------
  539|      2|                have[CV_CPU_AVX_512VL] = false;
  ------------------
  |  |  270|      2|#define CV_CPU_AVX_512VL        21
  ------------------
  540|      2|                have[CV_CPU_AVX_512VBMI2] = false;
  ------------------
  |  |  271|      2|#define CV_CPU_AVX_512VBMI2     22
  ------------------
  541|      2|                have[CV_CPU_AVX_512VNNI] = false;
  ------------------
  |  |  272|      2|#define CV_CPU_AVX_512VNNI      23
  ------------------
  542|      2|                have[CV_CPU_AVX_512BITALG] = false;
  ------------------
  |  |  273|      2|#define CV_CPU_AVX_512BITALG    24
  ------------------
  543|      2|                have[CV_CPU_AVX_512VPOPCNTDQ] = false;
  ------------------
  |  |  274|      2|#define CV_CPU_AVX_512VPOPCNTDQ 25
  ------------------
  544|      2|                have[CV_CPU_AVX_5124VNNIW] = false;
  ------------------
  |  |  275|      2|#define CV_CPU_AVX_5124VNNIW    26
  ------------------
  545|      2|                have[CV_CPU_AVX_5124FMAPS] = false;
  ------------------
  |  |  276|      2|#define CV_CPU_AVX_5124FMAPS    27
  ------------------
  546|      2|            }
  547|       |
  548|      2|            have[CV_CPU_AVX512_COMMON] = have[CV_CPU_AVX_512F] && have[CV_CPU_AVX_512CD];
  ------------------
  |  |  297|      2|#define CV_CPU_AVX512_COMMON    257
  ------------------
                          have[CV_CPU_AVX512_COMMON] = have[CV_CPU_AVX_512F] && have[CV_CPU_AVX_512CD];
  ------------------
  |  |  261|      2|#define CV_CPU_AVX_512F         13
  ------------------
                          have[CV_CPU_AVX512_COMMON] = have[CV_CPU_AVX_512F] && have[CV_CPU_AVX_512CD];
  ------------------
  |  |  263|      0|#define CV_CPU_AVX_512CD        15
  ------------------
  |  Branch (548:42): [True: 0, False: 2]
  |  Branch (548:67): [True: 0, False: 0]
  ------------------
  549|      2|            if (have[CV_CPU_AVX512_COMMON])
  ------------------
  |  |  297|      2|#define CV_CPU_AVX512_COMMON    257
  ------------------
  |  Branch (549:17): [True: 0, False: 2]
  ------------------
  550|      0|            {
  551|      0|                have[CV_CPU_AVX512_KNL] = have[CV_CPU_AVX_512ER]  && have[CV_CPU_AVX_512PF];
  ------------------
  |  |  298|      0|#define CV_CPU_AVX512_KNL       258
  ------------------
                              have[CV_CPU_AVX512_KNL] = have[CV_CPU_AVX_512ER]  && have[CV_CPU_AVX_512PF];
  ------------------
  |  |  265|      0|#define CV_CPU_AVX_512ER        17
  ------------------
                              have[CV_CPU_AVX512_KNL] = have[CV_CPU_AVX_512ER]  && have[CV_CPU_AVX_512PF];
  ------------------
  |  |  268|      0|#define CV_CPU_AVX_512PF        19
  ------------------
  |  Branch (551:43): [True: 0, False: 0]
  |  Branch (551:70): [True: 0, False: 0]
  ------------------
  552|      0|                have[CV_CPU_AVX512_KNM] = have[CV_CPU_AVX512_KNL] && have[CV_CPU_AVX_5124FMAPS] &&
  ------------------
  |  |  299|      0|#define CV_CPU_AVX512_KNM       259
  ------------------
                              have[CV_CPU_AVX512_KNM] = have[CV_CPU_AVX512_KNL] && have[CV_CPU_AVX_5124FMAPS] &&
  ------------------
  |  |  298|      0|#define CV_CPU_AVX512_KNL       258
  ------------------
                              have[CV_CPU_AVX512_KNM] = have[CV_CPU_AVX512_KNL] && have[CV_CPU_AVX_5124FMAPS] &&
  ------------------
  |  |  276|      0|#define CV_CPU_AVX_5124FMAPS    27
  ------------------
  |  Branch (552:43): [True: 0, False: 0]
  |  Branch (552:70): [True: 0, False: 0]
  ------------------
  553|      0|                                          have[CV_CPU_AVX_5124VNNIW] && have[CV_CPU_AVX_512VPOPCNTDQ];
  ------------------
  |  |  275|      0|#define CV_CPU_AVX_5124VNNIW    26
  ------------------
                                                        have[CV_CPU_AVX_5124VNNIW] && have[CV_CPU_AVX_512VPOPCNTDQ];
  ------------------
  |  |  274|      0|#define CV_CPU_AVX_512VPOPCNTDQ 25
  ------------------
  |  Branch (553:43): [True: 0, False: 0]
  |  Branch (553:73): [True: 0, False: 0]
  ------------------
  554|      0|                have[CV_CPU_AVX512_SKX] = have[CV_CPU_AVX_512BW] && have[CV_CPU_AVX_512DQ] && have[CV_CPU_AVX_512VL];
  ------------------
  |  |  296|      0|#define CV_CPU_AVX512_SKX       256
  ------------------
                              have[CV_CPU_AVX512_SKX] = have[CV_CPU_AVX_512BW] && have[CV_CPU_AVX_512DQ] && have[CV_CPU_AVX_512VL];
  ------------------
  |  |  262|      0|#define CV_CPU_AVX_512BW        14
  ------------------
                              have[CV_CPU_AVX512_SKX] = have[CV_CPU_AVX_512BW] && have[CV_CPU_AVX_512DQ] && have[CV_CPU_AVX_512VL];
  ------------------
  |  |  264|      0|#define CV_CPU_AVX_512DQ        16
  ------------------
                              have[CV_CPU_AVX512_SKX] = have[CV_CPU_AVX_512BW] && have[CV_CPU_AVX_512DQ] && have[CV_CPU_AVX_512VL];
  ------------------
  |  |  270|      0|#define CV_CPU_AVX_512VL        21
  ------------------
  |  Branch (554:43): [True: 0, False: 0]
  |  Branch (554:69): [True: 0, False: 0]
  |  Branch (554:95): [True: 0, False: 0]
  ------------------
  555|      0|                have[CV_CPU_AVX512_CNL] = have[CV_CPU_AVX512_SKX] && have[CV_CPU_AVX_512IFMA] && have[CV_CPU_AVX_512VBMI];
  ------------------
  |  |  300|      0|#define CV_CPU_AVX512_CNL       260
  ------------------
                              have[CV_CPU_AVX512_CNL] = have[CV_CPU_AVX512_SKX] && have[CV_CPU_AVX_512IFMA] && have[CV_CPU_AVX_512VBMI];
  ------------------
  |  |  296|      0|#define CV_CPU_AVX512_SKX       256
  ------------------
                              have[CV_CPU_AVX512_CNL] = have[CV_CPU_AVX512_SKX] && have[CV_CPU_AVX_512IFMA] && have[CV_CPU_AVX_512VBMI];
  ------------------
  |  |  267|      0|#define CV_CPU_AVX_512IFMA      18
  ------------------
                              have[CV_CPU_AVX512_CNL] = have[CV_CPU_AVX512_SKX] && have[CV_CPU_AVX_512IFMA] && have[CV_CPU_AVX_512VBMI];
  ------------------
  |  |  269|      0|#define CV_CPU_AVX_512VBMI      20
  ------------------
  |  Branch (555:43): [True: 0, False: 0]
  |  Branch (555:70): [True: 0, False: 0]
  |  Branch (555:98): [True: 0, False: 0]
  ------------------
  556|      0|                have[CV_CPU_AVX512_CLX] = have[CV_CPU_AVX512_SKX] && have[CV_CPU_AVX_512VNNI];
  ------------------
  |  |  301|      0|#define CV_CPU_AVX512_CLX       261
  ------------------
                              have[CV_CPU_AVX512_CLX] = have[CV_CPU_AVX512_SKX] && have[CV_CPU_AVX_512VNNI];
  ------------------
  |  |  296|      0|#define CV_CPU_AVX512_SKX       256
  ------------------
                              have[CV_CPU_AVX512_CLX] = have[CV_CPU_AVX512_SKX] && have[CV_CPU_AVX_512VNNI];
  ------------------
  |  |  272|      0|#define CV_CPU_AVX_512VNNI      23
  ------------------
  |  Branch (556:43): [True: 0, False: 0]
  |  Branch (556:70): [True: 0, False: 0]
  ------------------
  557|      0|                have[CV_CPU_AVX512_ICL] = have[CV_CPU_AVX512_SKX] &&
  ------------------
  |  |  302|      0|#define CV_CPU_AVX512_ICL       262
  ------------------
                              have[CV_CPU_AVX512_ICL] = have[CV_CPU_AVX512_SKX] &&
  ------------------
  |  |  296|      0|#define CV_CPU_AVX512_SKX       256
  ------------------
  |  Branch (557:43): [True: 0, False: 0]
  ------------------
  558|      0|                                          have[CV_CPU_AVX_512IFMA] && have[CV_CPU_AVX_512VBMI] &&
  ------------------
  |  |  267|      0|#define CV_CPU_AVX_512IFMA      18
  ------------------
                                                        have[CV_CPU_AVX_512IFMA] && have[CV_CPU_AVX_512VBMI] &&
  ------------------
  |  |  269|      0|#define CV_CPU_AVX_512VBMI      20
  ------------------
  |  Branch (558:43): [True: 0, False: 0]
  |  Branch (558:71): [True: 0, False: 0]
  ------------------
  559|      0|                                          have[CV_CPU_AVX_512VNNI] &&
  ------------------
  |  |  272|      0|#define CV_CPU_AVX_512VNNI      23
  ------------------
  |  Branch (559:43): [True: 0, False: 0]
  ------------------
  560|      0|                                          have[CV_CPU_AVX_512VBMI2] && have[CV_CPU_AVX_512BITALG] && have[CV_CPU_AVX_512VPOPCNTDQ];
  ------------------
  |  |  271|      0|#define CV_CPU_AVX_512VBMI2     22
  ------------------
                                                        have[CV_CPU_AVX_512VBMI2] && have[CV_CPU_AVX_512BITALG] && have[CV_CPU_AVX_512VPOPCNTDQ];
  ------------------
  |  |  273|      0|#define CV_CPU_AVX_512BITALG    24
  ------------------
                                                        have[CV_CPU_AVX_512VBMI2] && have[CV_CPU_AVX_512BITALG] && have[CV_CPU_AVX_512VPOPCNTDQ];
  ------------------
  |  |  274|      0|#define CV_CPU_AVX_512VPOPCNTDQ 25
  ------------------
  |  Branch (560:43): [True: 0, False: 0]
  |  Branch (560:72): [True: 0, False: 0]
  |  Branch (560:102): [True: 0, False: 0]
  ------------------
  561|      0|            }
  562|      2|            else
  563|      2|            {
  564|      2|                have[CV_CPU_AVX512_KNL] = false;
  ------------------
  |  |  298|      2|#define CV_CPU_AVX512_KNL       258
  ------------------
  565|      2|                have[CV_CPU_AVX512_KNM] = false;
  ------------------
  |  |  299|      2|#define CV_CPU_AVX512_KNM       259
  ------------------
  566|      2|                have[CV_CPU_AVX512_SKX] = false;
  ------------------
  |  |  296|      2|#define CV_CPU_AVX512_SKX       256
  ------------------
  567|      2|                have[CV_CPU_AVX512_CNL] = false;
  ------------------
  |  |  300|      2|#define CV_CPU_AVX512_CNL       260
  ------------------
  568|      2|                have[CV_CPU_AVX512_CLX] = false;
  ------------------
  |  |  301|      2|#define CV_CPU_AVX512_CLX       261
  ------------------
  569|      2|                have[CV_CPU_AVX512_ICL] = false;
  ------------------
  |  |  302|      2|#define CV_CPU_AVX512_ICL       262
  ------------------
  570|      2|            }
  571|      2|        }
  572|      2|    #endif // CV_CPUID_X86
  573|       |
  574|      2|    #if defined __ANDROID__ || defined __linux__ || defined __QNX__
  575|       |    #ifdef __aarch64__
  576|       |        have[CV_CPU_NEON] = true;
  577|       |        have[CV_CPU_FP16] = true;
  578|       |        int cpufile = open("/proc/self/auxv", O_RDONLY);
  579|       |
  580|       |        if (cpufile >= 0)
  581|       |        {
  582|       |            Elf64_auxv_t auxv;
  583|       |            const size_t size_auxv_t = sizeof(auxv);
  584|       |
  585|       |            while ((size_t)read(cpufile, &auxv, size_auxv_t) == size_auxv_t)
  586|       |            {
  587|       |                // see https://elixir.bootlin.com/linux/latest/source/arch/arm64/include/uapi/asm/hwcap.h
  588|       |                if (auxv.a_type == AT_HWCAP)
  589|       |                {
  590|       |                    have[CV_CPU_NEON_DOTPROD] = (auxv.a_un.a_val & (1 << 20)) != 0; // HWCAP_ASIMDDP
  591|       |                    have[CV_CPU_NEON_FP16] = (auxv.a_un.a_val & (1 << 10)) != 0; // HWCAP_ASIMDHP
  592|       |                }
  593|       |#if defined(AT_HWCAP2)
  594|       |                else if (auxv.a_type == AT_HWCAP2)
  595|       |                {
  596|       |                    have[CV_CPU_NEON_BF16] = (auxv.a_un.a_val & (1 << 14)) != 0; // HWCAP2_BF16
  597|       |                }
  598|       |#endif
  599|       |            }
  600|       |
  601|       |            close(cpufile);
  602|       |        }
  603|       |    #elif defined __arm__ && defined __ANDROID__
  604|       |      #if defined HAVE_CPUFEATURES
  605|       |        CV_LOG_INFO(NULL, "calling android_getCpuFeatures() ...");
  606|       |        uint64_t features = android_getCpuFeatures();
  607|       |        CV_LOG_INFO(NULL, cv::format("calling android_getCpuFeatures() ... Done (%llx)", (long long)features));
  608|       |        have[CV_CPU_NEON] = (features & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
  609|       |        have[CV_CPU_FP16] = (features & ANDROID_CPU_ARM_FEATURE_VFP_FP16) != 0;
  610|       |      #else
  611|       |        CV_LOG_INFO(NULL, "cpufeatures library is not available for CPU detection");
  612|       |        #if CV_NEON
  613|       |        CV_LOG_INFO(NULL, "- NEON instructions is enabled via build flags");
  614|       |        have[CV_CPU_NEON] = true;
  615|       |        #else
  616|       |        CV_LOG_INFO(NULL, "- NEON instructions is NOT enabled via build flags");
  617|       |        #endif
  618|       |        #if CV_FP16
  619|       |        CV_LOG_INFO(NULL, "- FP16 instructions is enabled via build flags");
  620|       |        have[CV_CPU_FP16] = true;
  621|       |        #else
  622|       |        CV_LOG_INFO(NULL, "- FP16 instructions is NOT enabled via build flags");
  623|       |        #endif
  624|       |      #endif
  625|       |    #elif defined __arm__
  626|       |        int cpufile = open("/proc/self/auxv", O_RDONLY);
  627|       |
  628|       |        if (cpufile >= 0)
  629|       |        {
  630|       |            Elf32_auxv_t auxv;
  631|       |            const size_t size_auxv_t = sizeof(auxv);
  632|       |
  633|       |            while ((size_t)read(cpufile, &auxv, size_auxv_t) == size_auxv_t)
  634|       |            {
  635|       |                if (auxv.a_type == AT_HWCAP)
  636|       |                {
  637|       |                    have[CV_CPU_NEON] = (auxv.a_un.a_val & 4096) != 0;
  638|       |                    have[CV_CPU_FP16] = (auxv.a_un.a_val & 2) != 0;
  639|       |                    break;
  640|       |                }
  641|       |            }
  642|       |
  643|       |            close(cpufile);
  644|       |        }
  645|       |    #endif
  646|       |    #elif (defined __APPLE__)
  647|       |    #if defined __ARM_NEON
  648|       |        have[CV_CPU_NEON] = true;
  649|       |    #endif
  650|       |    #if (defined __ARM_FP  && (((__ARM_FP & 0x2) != 0) && defined __ARM_NEON))
  651|       |        have[CV_CPU_FP16] = have[CV_CPU_NEON_FP16] = true;
  652|       |    #endif
  653|       |    // system.cpp may be compiled w/o special -march=armv8...+dotprod, -march=armv8...+bf16 etc.,
  654|       |    // so we check for the features in any case, no mater what are the compile flags.
  655|       |    // We check the real hardware capabilities here.
  656|       |    int has_feat_dotprod = 0;
  657|       |    size_t has_feat_dotprod_size = sizeof(has_feat_dotprod);
  658|       |    sysctlbyname("hw.optional.arm.FEAT_DotProd", &has_feat_dotprod, &has_feat_dotprod_size, NULL, 0);
  659|       |    if (has_feat_dotprod) {
  660|       |        have[CV_CPU_NEON_DOTPROD] = true;
  661|       |    }
  662|       |    int has_feat_bf16 = 0;
  663|       |    size_t has_feat_bf16_size = sizeof(has_feat_bf16);
  664|       |    sysctlbyname("hw.optional.arm.FEAT_BF16", &has_feat_bf16, &has_feat_bf16_size, NULL, 0);
  665|       |    if (has_feat_bf16) {
  666|       |        have[CV_CPU_NEON_BF16] = true;
  667|       |    }
  668|       |    #elif (defined __clang__)
  669|       |    #if defined __ARM_NEON
  670|       |        have[CV_CPU_NEON] = true;
  671|       |        #if (defined __ARM_FP  && ((__ARM_FP & 0x2) != 0))
  672|       |        have[CV_CPU_FP16] = true;
  673|       |        #endif
  674|       |    #endif
  675|       |    #endif
  676|       |    #if defined _ARM_ && (defined(_WIN32_WCE) && _WIN32_WCE >= 0x800)
  677|       |        have[CV_CPU_NEON] = true;
  678|       |    #endif
  679|       |    #if defined _M_ARM64
  680|       |        have[CV_CPU_NEON] = true;
  681|       |    #endif
  682|       |    #ifdef __riscv_vector
  683|       |        have[CV_CPU_RISCVV] = true;
  684|       |    #endif
  685|       |    #ifdef __mips_msa
  686|       |        have[CV_CPU_MSA] = true;
  687|       |    #endif
  688|       |
  689|       |    #if (defined __ppc64__ || defined __PPC64__) && defined HAVE_GETAUXVAL
  690|       |        unsigned int hwcap = getauxval(AT_HWCAP);
  691|       |        if (hwcap & PPC_FEATURE_HAS_VSX) {
  692|       |            hwcap = getauxval(AT_HWCAP2);
  693|       |            if (hwcap & PPC_FEATURE2_ARCH_3_00) {
  694|       |                have[CV_CPU_VSX] = have[CV_CPU_VSX3] = true;
  695|       |            } else {
  696|       |                have[CV_CPU_VSX] = (hwcap & PPC_FEATURE2_ARCH_2_07) != 0;
  697|       |            }
  698|       |        }
  699|       |    #elif (defined __ppc64__ || defined __PPC64__) && defined HAVE_ELF_AUX_INFO
  700|       |        unsigned long hwcap = 0;
  701|       |        elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap));
  702|       |        if (hwcap & PPC_FEATURE_HAS_VSX) {
  703|       |            elf_aux_info(AT_HWCAP2, &hwcap, sizeof(hwcap));
  704|       |            if (hwcap & PPC_FEATURE2_ARCH_3_00) {
  705|       |                have[CV_CPU_VSX] = have[CV_CPU_VSX3] = true;
  706|       |            } else {
  707|       |                have[CV_CPU_VSX] = (hwcap & PPC_FEATURE2_ARCH_2_07) != 0;
  708|       |            }
  709|       |        }
  710|       |    #else
  711|       |        // TODO: AIX
  712|       |        #if CV_VSX || defined _ARCH_PWR8 || defined __POWER9_VECTOR__
  713|       |            have[CV_CPU_VSX] = true;
  714|       |        #endif
  715|       |        #if CV_VSX3 || defined __POWER9_VECTOR__
  716|       |            have[CV_CPU_VSX3] = true;
  717|       |        #endif
  718|      2|    #endif
  719|       |
  720|       |    #if defined __riscv && defined __riscv_vector
  721|       |        have[CV_CPU_RVV] = true;
  722|       |    #endif
  723|       |
  724|       |    #if defined __loongarch64 && defined __linux__
  725|       |        int flag = (int)getauxval(AT_HWCAP);
  726|       |
  727|       |        have[CV_CPU_LSX] = (flag & LA_HWCAP_LSX) != 0;
  728|       |        have[CV_CPU_LASX] = (flag & LA_HWCAP_LASX) != 0;
  729|       |    #endif
  730|       |
  731|      2|        bool skip_baseline_check = false;
  732|      2|        if (utils::getConfigurationParameterBool("OPENCV_SKIP_CPU_BASELINE_CHECK"))
  ------------------
  |  Branch (732:13): [True: 0, False: 2]
  ------------------
  733|      0|        {
  734|      0|            skip_baseline_check = true;
  735|      0|        }
  736|      2|        int baseline_features[] = { CV_CPU_BASELINE_FEATURES };
  737|      2|        if (!checkFeatures(baseline_features, sizeof(baseline_features) / sizeof(baseline_features[0]))
  ------------------
  |  Branch (737:13): [True: 0, False: 2]
  ------------------
  738|      2|            && !skip_baseline_check)
  ------------------
  |  Branch (738:16): [True: 0, False: 0]
  ------------------
  739|      0|        {
  740|      0|            fprintf(stderr, "\n"
  741|      0|                    "******************************************************************\n"
  742|      0|                    "* FATAL ERROR:                                                   *\n"
  743|      0|                    "* This OpenCV build doesn't support current CPU/HW configuration *\n"
  744|      0|                    "*                                                                *\n"
  745|      0|                    "* Use OPENCV_DUMP_CONFIG=1 environment variable for details      *\n"
  746|      0|                    "******************************************************************\n");
  747|      0|            fprintf(stderr, "\nRequired baseline features:\n");
  748|      0|            checkFeatures(baseline_features, sizeof(baseline_features) / sizeof(baseline_features[0]), true);
  749|      0|            CV_Error(cv::Error::StsAssert, "Missing support for required CPU baseline features. Check OpenCV build configuration and required CPU/HW setup.");
  ------------------
  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  ------------------
  750|      0|        }
  751|       |
  752|      2|        readSettings(baseline_features, sizeof(baseline_features) / sizeof(baseline_features[0]));
  753|      2|    }
_ZN2cv10HWFeatures15initializeNamesEv:
  392|      2|    {
  393|  1.02k|        for (int i = 0; i < CV_HARDWARE_MAX_FEATURE; i++)
  ------------------
  |  |  305|  1.02k|#define CV_HARDWARE_MAX_FEATURE 512
  ------------------
  |  Branch (393:25): [True: 1.02k, False: 2]
  ------------------
  394|  1.02k|        {
  395|  1.02k|            g_hwFeatureNames[i] = 0;
  396|  1.02k|        }
  397|      2|        g_hwFeatureNames[CPU_MMX] = "MMX";
  398|      2|        g_hwFeatureNames[CPU_SSE] = "SSE";
  399|      2|        g_hwFeatureNames[CPU_SSE2] = "SSE2";
  400|      2|        g_hwFeatureNames[CPU_SSE3] = "SSE3";
  401|      2|        g_hwFeatureNames[CPU_SSSE3] = "SSSE3";
  402|      2|        g_hwFeatureNames[CPU_SSE4_1] = "SSE4.1";
  403|      2|        g_hwFeatureNames[CPU_SSE4_2] = "SSE4.2";
  404|      2|        g_hwFeatureNames[CPU_POPCNT] = "POPCNT";
  405|      2|        g_hwFeatureNames[CPU_FP16] = "FP16";
  406|      2|        g_hwFeatureNames[CPU_AVX] = "AVX";
  407|      2|        g_hwFeatureNames[CPU_AVX2] = "AVX2";
  408|      2|        g_hwFeatureNames[CPU_FMA3] = "FMA3";
  409|       |
  410|      2|        g_hwFeatureNames[CPU_AVX_512F] = "AVX512F";
  411|      2|        g_hwFeatureNames[CPU_AVX_512BW] = "AVX512BW";
  412|      2|        g_hwFeatureNames[CPU_AVX_512CD] = "AVX512CD";
  413|      2|        g_hwFeatureNames[CPU_AVX_512DQ] = "AVX512DQ";
  414|      2|        g_hwFeatureNames[CPU_AVX_512ER] = "AVX512ER";
  415|      2|        g_hwFeatureNames[CPU_AVX_512IFMA] = "AVX512IFMA";
  416|      2|        g_hwFeatureNames[CPU_AVX_512PF] = "AVX512PF";
  417|      2|        g_hwFeatureNames[CPU_AVX_512VBMI] = "AVX512VBMI";
  418|      2|        g_hwFeatureNames[CPU_AVX_512VL] = "AVX512VL";
  419|      2|        g_hwFeatureNames[CPU_AVX_512VBMI2] = "AVX512VBMI2";
  420|      2|        g_hwFeatureNames[CPU_AVX_512VNNI] = "AVX512VNNI";
  421|      2|        g_hwFeatureNames[CPU_AVX_512BITALG] = "AVX512BITALG";
  422|      2|        g_hwFeatureNames[CPU_AVX_512VPOPCNTDQ] = "AVX512VPOPCNTDQ";
  423|      2|        g_hwFeatureNames[CPU_AVX_5124VNNIW] = "AVX5124VNNIW";
  424|      2|        g_hwFeatureNames[CPU_AVX_5124FMAPS] = "AVX5124FMAPS";
  425|       |
  426|      2|        g_hwFeatureNames[CPU_NEON] = "NEON";
  427|      2|        g_hwFeatureNames[CPU_NEON_DOTPROD] = "NEON_DOTPROD";
  428|      2|        g_hwFeatureNames[CPU_NEON_FP16] = "NEON_FP16";
  429|      2|        g_hwFeatureNames[CPU_NEON_BF16] = "NEON_BF16";
  430|       |
  431|      2|        g_hwFeatureNames[CPU_VSX] = "VSX";
  432|      2|        g_hwFeatureNames[CPU_VSX3] = "VSX3";
  433|       |
  434|      2|        g_hwFeatureNames[CPU_MSA] = "CPU_MSA";
  435|      2|        g_hwFeatureNames[CPU_RISCVV] = "RISCVV";
  436|       |
  437|      2|        g_hwFeatureNames[CPU_AVX512_COMMON] = "AVX512-COMMON";
  438|      2|        g_hwFeatureNames[CPU_AVX512_SKX] = "AVX512-SKX";
  439|      2|        g_hwFeatureNames[CPU_AVX512_KNL] = "AVX512-KNL";
  440|      2|        g_hwFeatureNames[CPU_AVX512_KNM] = "AVX512-KNM";
  441|      2|        g_hwFeatureNames[CPU_AVX512_CNL] = "AVX512-CNL";
  442|      2|        g_hwFeatureNames[CPU_AVX512_CLX] = "AVX512-CLX";
  443|      2|        g_hwFeatureNames[CPU_AVX512_ICL] = "AVX512-ICL";
  444|       |
  445|      2|        g_hwFeatureNames[CPU_RVV] = "RVV";
  446|       |
  447|      2|        g_hwFeatureNames[CPU_LSX]  = "LSX";
  448|      2|        g_hwFeatureNames[CPU_LASX] = "LASX";
  449|      2|    }
system.cpp:_ZL8cv_cpuidPiii:
  293|      4|    {
  294|      4|        int __eax = reg_eax, __ebx = 0, __ecx = reg_ecx, __edx = 0;
  295|       |// tested with available compilers (-fPIC -O2 -m32/-m64): https://godbolt.org/
  296|      4|#if !defined(__PIC__) \
  297|      4|    || defined(__x86_64__) || __GNUC__ >= 5 \
  298|      4|    || defined(__clang__) || defined(__INTEL_COMPILER)
  299|      4|        __asm__("cpuid\n\t"
  300|      4|                : "+a" (__eax), "=b" (__ebx), "+c" (__ecx), "=d" (__edx)
  301|      4|        );
  302|       |#elif defined(__i386__)  // ebx may be reserved as the PIC register
  303|       |        __asm__("xchg{l}\t{%%}ebx, %1\n\t"
  304|       |                "cpuid\n\t"
  305|       |                "xchg{l}\t{%%}ebx, %1\n\t"
  306|       |                : "+a" (__eax), "=&r" (__ebx), "+c" (__ecx), "=d" (__edx)
  307|       |        );
  308|       |#else
  309|       |#error "Configuration error"
  310|       |#endif
  311|      4|        cpuid_data[0] = __eax; cpuid_data[1] = __ebx; cpuid_data[2] = __ecx; cpuid_data[3] = __edx;
  312|      4|    }
_ZN2cv10HWFeatures13checkFeaturesEPKiib:
  756|      2|    {
  757|      2|        bool result = true;
  758|     10|        for (int i = 0; i < count; i++)
  ------------------
  |  Branch (758:25): [True: 8, False: 2]
  ------------------
  759|      8|        {
  760|      8|            int feature = features[i];
  761|      8|            if (feature)
  ------------------
  |  Branch (761:17): [True: 6, False: 2]
  ------------------
  762|      6|            {
  763|      6|                if (have[feature])
  ------------------
  |  Branch (763:21): [True: 6, False: 0]
  ------------------
  764|      6|                {
  765|      6|                    if (dump) fprintf(stderr, "    ID=%3d (%s) - OK\n", feature, getHWFeatureNameSafe(feature));
  ------------------
  |  Branch (765:25): [True: 0, False: 6]
  ------------------
  766|      6|                }
  767|      0|                else
  768|      0|                {
  769|      0|                    result = false;
  770|      0|                    if (dump) fprintf(stderr, "    ID=%3d (%s) - NOT AVAILABLE\n", feature, getHWFeatureNameSafe(feature));
  ------------------
  |  Branch (770:25): [True: 0, False: 0]
  ------------------
  771|      0|                }
  772|      6|            }
  773|      8|        }
  774|      2|        return result;
  775|      2|    }
_ZN2cv10HWFeatures12readSettingsEPKii:
  783|      2|    {
  784|      2|        bool dump = true;
  785|      2|        std::string disabled_features = utils::getConfigurationParameterString("OPENCV_CPU_DISABLE");
  786|      2|        if (!disabled_features.empty())
  ------------------
  |  Branch (786:13): [True: 0, False: 2]
  ------------------
  787|      0|        {
  788|      0|            const char* start = disabled_features.c_str();
  789|      0|            for (;;)
  790|      0|            {
  791|      0|                while (start[0] != 0 && isSymbolSeparator(start[0]))
  ------------------
  |  Branch (791:24): [True: 0, False: 0]
  |  Branch (791:41): [True: 0, False: 0]
  ------------------
  792|      0|                {
  793|      0|                    start++;
  794|      0|                }
  795|      0|                if (start[0] == 0)
  ------------------
  |  Branch (795:21): [True: 0, False: 0]
  ------------------
  796|      0|                    break;
  797|      0|                const char* end = start;
  798|      0|                while (end[0] != 0 && !isSymbolSeparator(end[0]))
  ------------------
  |  Branch (798:24): [True: 0, False: 0]
  |  Branch (798:39): [True: 0, False: 0]
  ------------------
  799|      0|                {
  800|      0|                    end++;
  801|      0|                }
  802|      0|                if (end == start)
  ------------------
  |  Branch (802:21): [True: 0, False: 0]
  ------------------
  803|      0|                    continue;
  804|      0|                cv::String feature(start, end);
  805|      0|                start = end;
  806|       |
  807|      0|                CV_Assert(feature.size() > 0);
  ------------------
  |  |  423|      0|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:35): [True: 0, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
  808|       |
  809|      0|                bool found = false;
  810|      0|                for (int i = 0; i < CV_HARDWARE_MAX_FEATURE; i++)
  ------------------
  |  |  305|      0|#define CV_HARDWARE_MAX_FEATURE 512
  ------------------
  |  Branch (810:33): [True: 0, False: 0]
  ------------------
  811|      0|                {
  812|      0|                    if (!g_hwFeatureNames[i]) continue;
  ------------------
  |  Branch (812:25): [True: 0, False: 0]
  ------------------
  813|      0|                    size_t len = strlen(g_hwFeatureNames[i]);
  814|      0|                    if (len != feature.size()) continue;
  ------------------
  |  Branch (814:25): [True: 0, False: 0]
  ------------------
  815|      0|                    if (feature.compare(g_hwFeatureNames[i]) == 0)
  ------------------
  |  Branch (815:25): [True: 0, False: 0]
  ------------------
  816|      0|                    {
  817|      0|                        bool isBaseline = false;
  818|      0|                        for (int k = 0; k < baseline_count; k++)
  ------------------
  |  Branch (818:41): [True: 0, False: 0]
  ------------------
  819|      0|                        {
  820|      0|                            if (baseline_features[k] == i)
  ------------------
  |  Branch (820:33): [True: 0, False: 0]
  ------------------
  821|      0|                            {
  822|      0|                                isBaseline = true;
  823|      0|                                break;
  824|      0|                            }
  825|      0|                        }
  826|      0|                        if (isBaseline)
  ------------------
  |  Branch (826:29): [True: 0, False: 0]
  ------------------
  827|      0|                        {
  828|      0|                            if (dump) fprintf(stderr, "OPENCV: Trying to disable baseline CPU feature: '%s'."
  ------------------
  |  Branch (828:33): [True: 0, False: 0]
  ------------------
  829|      0|                                                      "This has very limited effect, because code optimizations for this feature are executed unconditionally "
  830|      0|                                                      "in the most cases.\n", getHWFeatureNameSafe(i));
  831|      0|                        }
  832|      0|                        if (!have[i])
  ------------------
  |  Branch (832:29): [True: 0, False: 0]
  ------------------
  833|      0|                        {
  834|      0|                            if (dump) fprintf(stderr, "OPENCV: Trying to disable unavailable CPU feature on the current platform: '%s'.\n",
  ------------------
  |  Branch (834:33): [True: 0, False: 0]
  ------------------
  835|      0|                                getHWFeatureNameSafe(i));
  836|      0|                        }
  837|      0|                        have[i] = false;
  838|       |
  839|      0|                        found = true;
  840|      0|                        break;
  841|      0|                    }
  842|      0|                }
  843|      0|                if (!found)
  ------------------
  |  Branch (843:21): [True: 0, False: 0]
  ------------------
  844|      0|                {
  845|      0|                    if (dump) fprintf(stderr, "OPENCV: Trying to disable unknown CPU feature: '%s'.\n", feature.c_str());
  ------------------
  |  Branch (845:25): [True: 0, False: 0]
  ------------------
  846|      0|                }
  847|      0|            }
  848|      0|        }
  849|      2|    }
_ZN2cv8internal13InitTimestampC2Ev:
 1017|      2|    InitTimestamp() {
 1018|      2|        Timestamp::getInstance();
 1019|      2|    }
_ZN2cv8internal9Timestamp11getInstanceEv:
 1009|      4|    {
 1010|      4|        static Timestamp g_timestamp;
 1011|      4|        return g_timestamp;
 1012|      4|    }
_ZN2cv8internal9TimestampC2Ev:
  996|      2|        : zeroTickCount(getTickCount())
  997|      2|        , ns_in_ticks(1e9 / getTickFrequency())
  998|      2|    {
  999|       |        // nothing
 1000|      2|    }
_ZN2cv8internal9Timestamp12getTimestampEv:
 1003|      2|    {
 1004|      2|        int64 t = getTickCount();
 1005|      2|        return (int64)((t - zeroTickCount) * ns_in_ticks);
 1006|      2|    }
system.cpp:_ZN2cv7detailsL13getTlsStorageEv:
 1874|      4|{
 1875|      4|    CV_SINGLETON_LAZY_INIT_REF(TlsStorage, new TlsStorage())
  ------------------
  |  |  404|      4|#define CV_SINGLETON_LAZY_INIT_REF(TYPE, INITIALIZER) CV_SINGLETON_LAZY_INIT_(TYPE, INITIALIZER, *instance)
  |  |  ------------------
  |  |  |  |  400|      4|    static TYPE* const instance = INITIALIZER; \
  |  |  |  |  401|      4|    return RET_VALUE;
  |  |  ------------------
  ------------------
 1876|      4|}
_ZN2cv7details10TlsStorageC2Ev:
 1671|      2|        tlsSlotsSize(0)
 1672|      2|    {
 1673|      2|        (void)getTlsAbstraction();  // ensure singeton initialization (for correct order of atexit calls)
 1674|      2|        tlsSlots.reserve(32);
 1675|      2|        threads.reserve(32);
 1676|      2|        g_isTlsStorageInitialized = true;
 1677|      2|    }
system.cpp:_ZN2cv7detailsL17getTlsAbstractionEv:
 1549|      2|{
 1550|      2|    static TlsAbstraction *g_tls = new TlsAbstraction();  // memory leak is intended here to avoid disposing of TLS container
 1551|      2|    static TlsAbstractionReleaseGuard g_tlsReleaseGuard(*g_tls);
 1552|      2|    return g_tls;
 1553|      2|}
_ZN2cv7details26TlsAbstractionReleaseGuardC2ERNS0_14TlsAbstractionE:
 1537|      2|    TlsAbstractionReleaseGuard(TlsAbstraction& tls) : tls_(tls)
 1538|      2|    {
 1539|       |        /* nothing */
 1540|      2|    }
_ZN2cv7details10TlsStorage11reserveSlotEPNS_16TLSDataContainerE:
 1728|      2|    {
 1729|      2|        AutoLock guard(mtxGlobalAccess);
 1730|      2|        CV_Assert(tlsSlotsSize == tlsSlots.size());
  ------------------
  |  |  423|      2|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:35): [True: 2, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1731|       |
 1732|       |        // Find unused slots
 1733|      2|        for(size_t slot = 0; slot < tlsSlotsSize; slot++)
  ------------------
  |  Branch (1733:30): [True: 0, False: 2]
  ------------------
 1734|      0|        {
 1735|      0|            if (tlsSlots[slot].container == NULL)
  ------------------
  |  Branch (1735:17): [True: 0, False: 0]
  ------------------
 1736|      0|            {
 1737|      0|                tlsSlots[slot].container = container;
 1738|      0|                return slot;
 1739|      0|            }
 1740|      0|        }
 1741|       |
 1742|       |        // Create new slot
 1743|      2|        tlsSlots.push_back(TlsSlotInfo(container)); tlsSlotsSize++;
 1744|      2|        return tlsSlotsSize - 1;
 1745|      2|    }
_ZN2cv7details10TlsStorage11TlsSlotInfoC2EPNS_16TLSDataContainerE:
 1865|      2|        TlsSlotInfo(TLSDataContainer* _container) : container(_container) {}
_ZN2cv4readIbEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKS1_:
 2258|     32|{
 2259|     32|    try
 2260|     32|    {
 2261|     32|        const char * res = envRead(k.c_str());
 2262|     32|        if (res)
  ------------------
  |  Branch (2262:13): [True: 0, False: 32]
  ------------------
 2263|      0|            return parseOption<T>(std::string(res));
 2264|     32|    }
 2265|     32|    catch (const ParseError &err)
 2266|     32|    {
 2267|      0|        CV_Error(cv::Error::StsBadArg, err.toString(k));
  ------------------
  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  ------------------
 2268|      0|    }
 2269|     32|    return defaultValue;
 2270|     32|}
system.cpp:_ZN2cvL7envReadEPKc:
 2247|     64|{
 2248|       |#ifdef NO_GETENV
 2249|       |    CV_UNUSED(name);
 2250|       |    return NULL;
 2251|       |#else
 2252|     64|    return getenv(name);
 2253|     64|#endif
 2254|     64|}
_ZN2cv4readImEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKS1_:
 2258|     28|{
 2259|     28|    try
 2260|     28|    {
 2261|     28|        const char * res = envRead(k.c_str());
 2262|     28|        if (res)
  ------------------
  |  Branch (2262:13): [True: 0, False: 28]
  ------------------
 2263|      0|            return parseOption<T>(std::string(res));
 2264|     28|    }
 2265|     28|    catch (const ParseError &err)
 2266|     28|    {
 2267|      0|        CV_Error(cv::Error::StsBadArg, err.toString(k));
  ------------------
  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  ------------------
 2268|      0|    }
 2269|     28|    return defaultValue;
 2270|     28|}
_ZN2cv4readINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEET_RKS7_RKS8_:
 2258|      4|{
 2259|      4|    try
 2260|      4|    {
 2261|      4|        const char * res = envRead(k.c_str());
 2262|      4|        if (res)
  ------------------
  |  Branch (2262:13): [True: 0, False: 4]
  ------------------
 2263|      0|            return parseOption<T>(std::string(res));
 2264|      4|    }
 2265|      4|    catch (const ParseError &err)
 2266|      4|    {
 2267|      0|        CV_Error(cv::Error::StsBadArg, err.toString(k));
  ------------------
  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  ------------------
 2268|      0|    }
 2269|      4|    return defaultValue;
 2270|      4|}

_ZN2cv5utils5trace7details6RegionC2ERKNS3_21LocationStaticStorageE:
  434|    784|    implFlags(0)
  435|    784|{
  436|       |    // Checks:
  437|       |    // - global enable flag
  438|       |    // - parent region is disabled
  439|       |    // - children count threshold
  440|       |    // - region location
  441|       |    // - depth (opencv nested calls)
  442|    784|    if (!TraceManager::isActivated())
  ------------------
  |  Branch (442:9): [True: 784, False: 0]
  ------------------
  443|    784|    {
  444|    784|        CV_LOG("Trace is disabled. Bailout");
  ------------------
  |  |   22|    784|#define CV_LOG(...) {}
  ------------------
  445|    784|        return;
  446|    784|    }
  447|       |
  448|      0|    TraceManagerThreadLocal& ctx = getTraceManager().tls.getRef();
  449|      0|    CV_LOG(_spaces(ctx.getCurrentDepth()*4) << "Region(): " << (void*)this << ": " << location.name);
  ------------------
  |  |   22|      0|#define CV_LOG(...) {}
  ------------------
  450|       |
  451|      0|    Region* parentRegion = ctx.stackTopRegion();
  452|      0|    const Region::LocationStaticStorage* parentLocation = ctx.stackTopLocation();
  453|       |
  454|      0|    if (location.flags & REGION_FLAG_REGION_NEXT)
  ------------------
  |  Branch (454:9): [True: 0, False: 0]
  ------------------
  455|      0|    {
  456|      0|        if (parentRegion && parentRegion->pImpl)
  ------------------
  |  Branch (456:13): [True: 0, False: 0]
  |  Branch (456:29): [True: 0, False: 0]
  ------------------
  457|      0|        {
  458|      0|            CV_DbgAssert((parentRegion->pImpl->location.flags & REGION_FLAG_FUNCTION) == 0);
  459|      0|            parentRegion->destroy(); parentRegion->implFlags = 0;
  460|      0|            parentRegion = ctx.stackTopRegion();
  461|      0|            parentLocation = ctx.stackTopLocation();
  462|      0|        }
  463|      0|    }
  464|       |
  465|      0|    int parentChildren = 0;
  466|      0|    if (parentRegion && parentRegion->pImpl)
  ------------------
  |  Branch (466:9): [True: 0, False: 0]
  |  Branch (466:25): [True: 0, False: 0]
  ------------------
  467|      0|    {
  468|      0|        if (parentLocation == NULL)
  ------------------
  |  Branch (468:13): [True: 0, False: 0]
  ------------------
  469|      0|        {
  470|       |            // parallel_for_body code path
  471|      0|            parentChildren = CV_XADD(&parentRegion->pImpl->directChildrenCount, 1) + 1;
  ------------------
  |  |  702|      0|#      define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL)
  ------------------
  472|      0|        }
  473|      0|        else
  474|      0|        {
  475|      0|            parentChildren = ++parentRegion->pImpl->directChildrenCount;
  476|      0|        }
  477|      0|    }
  478|       |
  479|      0|    int64 beginTimestamp = getTimestampNS();
  480|       |
  481|      0|    int currentDepth = ctx.getCurrentDepth() + 1;
  482|      0|    switch (location.flags & REGION_FLAG_IMPL_MASK)
  483|      0|    {
  484|       |#ifdef HAVE_IPP
  485|       |    case REGION_FLAG_IMPL_IPP:
  486|       |        if (!ctx.stat_status.ignoreDepthImplIPP)
  487|       |            ctx.stat_status.ignoreDepthImplIPP = currentDepth;
  488|       |        break;
  489|       |#endif
  490|      0|#ifdef HAVE_OPENCL
  491|      0|    case REGION_FLAG_IMPL_OPENCL:
  ------------------
  |  Branch (491:5): [True: 0, False: 0]
  ------------------
  492|      0|        if (!ctx.stat_status.ignoreDepthImplOpenCL)
  ------------------
  |  Branch (492:13): [True: 0, False: 0]
  ------------------
  493|      0|            ctx.stat_status.ignoreDepthImplOpenCL = currentDepth;
  494|      0|        break;
  495|      0|#endif
  496|       |#ifdef HAVE_OPENVX
  497|       |    case REGION_FLAG_IMPL_OPENVX:
  498|       |        if (!ctx.stat_status.ignoreDepthImplOpenVX)
  499|       |            ctx.stat_status.ignoreDepthImplOpenVX = currentDepth;
  500|       |        break;
  501|       |#endif
  502|      0|    default:
  ------------------
  |  Branch (502:5): [True: 0, False: 0]
  ------------------
  503|      0|        break;
  504|      0|    }
  505|       |
  506|      0|    ctx.stackPush(this, &location, beginTimestamp);
  507|      0|    implFlags |= REGION_FLAG__NEED_STACK_POP;
  508|       |
  509|      0|    if ((location.flags & REGION_FLAG_REGION_FORCE) == 0)
  ------------------
  |  Branch (509:9): [True: 0, False: 0]
  ------------------
  510|      0|    {
  511|      0|        if (ctx.stat_status._skipDepth >= 0 && currentDepth > ctx.stat_status._skipDepth)
  ------------------
  |  Branch (511:13): [True: 0, False: 0]
  |  Branch (511:48): [True: 0, False: 0]
  ------------------
  512|      0|        {
  513|      0|            CV_LOG(_spaces(ctx.getCurrentDepth()*4) << "Parent region is disabled. Bailout");
  ------------------
  |  |   22|      0|#define CV_LOG(...) {}
  ------------------
  514|      0|            ctx.stat.currentSkippedRegions++;
  515|      0|            return;
  516|      0|        }
  517|       |
  518|      0|        if (param_maxRegionChildrenOpenCV > 0 && (location.flags & REGION_FLAG_APP_CODE) == 0 && parentLocation && (parentLocation->flags & REGION_FLAG_APP_CODE) == 0)
  ------------------
  |  Branch (518:13): [True: 0, False: 0]
  |  Branch (518:50): [True: 0, False: 0]
  |  Branch (518:98): [True: 0, False: 0]
  |  Branch (518:116): [True: 0, False: 0]
  ------------------
  519|      0|        {
  520|      0|            if (parentChildren >= param_maxRegionChildrenOpenCV)
  ------------------
  |  Branch (520:17): [True: 0, False: 0]
  ------------------
  521|      0|            {
  522|      0|                CV_LOG_TRACE_BAILOUT(NULL, _spaces(ctx.getCurrentDepth()*4) << "OpenCV parent region exceeds children count. Bailout");
  ------------------
  |  |   32|      0|#define CV_LOG_TRACE_BAILOUT(tag, ...) CV_LOG_INFO(tag, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  170|      0|#define CV_LOG_INFO(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_INFO, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  523|      0|                ctx.stat_status.enableSkipMode(currentDepth - 1);
  524|      0|                ctx.stat.currentSkippedRegions++;
  525|      0|                DEBUG_ONLY(ctx.dumpStack(std::cout, false));
  ------------------
  |  |   30|      0|#define DEBUG_ONLY(...) (void)0
  ------------------
  526|      0|                return;
  527|      0|            }
  528|      0|        }
  529|      0|        if (param_maxRegionChildren > 0 && parentChildren >= param_maxRegionChildren)
  ------------------
  |  Branch (529:13): [True: 0, False: 0]
  |  Branch (529:44): [True: 0, False: 0]
  ------------------
  530|      0|        {
  531|      0|            CV_LOG_TRACE_BAILOUT(NULL, _spaces(ctx.getCurrentDepth()*4) << "Parent region exceeds children count. Bailout");
  ------------------
  |  |   32|      0|#define CV_LOG_TRACE_BAILOUT(tag, ...) CV_LOG_INFO(tag, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  170|      0|#define CV_LOG_INFO(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_INFO, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  532|      0|            ctx.stat_status.enableSkipMode(currentDepth - 1);
  533|      0|            ctx.stat.currentSkippedRegions++;
  534|      0|            DEBUG_ONLY(ctx.dumpStack(std::cout, false));
  ------------------
  |  |   30|      0|#define DEBUG_ONLY(...) (void)0
  ------------------
  535|      0|            return;
  536|      0|        }
  537|      0|    }
  538|       |
  539|      0|    LocationExtraData::init(location);
  540|       |
  541|      0|    if ((*location.ppExtra)->global_location_id == 0)
  ------------------
  |  Branch (541:9): [True: 0, False: 0]
  ------------------
  542|      0|    {
  543|      0|        CV_LOG_TRACE_BAILOUT(NULL, _spaces(ctx.getCurrentDepth()*4) << "Region location is disabled. Bailout");
  ------------------
  |  |   32|      0|#define CV_LOG_TRACE_BAILOUT(tag, ...) CV_LOG_INFO(tag, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  170|      0|#define CV_LOG_INFO(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_INFO, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  544|      0|        ctx.stat_status.enableSkipMode(currentDepth);
  545|      0|        ctx.stat.currentSkippedRegions++;
  546|      0|        return;
  547|      0|    }
  548|       |
  549|      0|    if (parentLocation && (parentLocation->flags & REGION_FLAG_SKIP_NESTED))
  ------------------
  |  Branch (549:9): [True: 0, False: 0]
  |  Branch (549:27): [True: 0, False: 0]
  ------------------
  550|      0|    {
  551|      0|        CV_LOG(_spaces(ctx.getCurrentDepth()*4) << "Parent region disables inner regions. Bailout");
  ------------------
  |  |   22|      0|#define CV_LOG(...) {}
  ------------------
  552|      0|        ctx.stat_status.enableSkipMode(currentDepth);
  553|      0|        ctx.stat.currentSkippedRegions++;
  554|      0|        return;
  555|      0|    }
  556|       |
  557|      0|    if (param_maxRegionDepthOpenCV)
  ------------------
  |  Branch (557:9): [True: 0, False: 0]
  ------------------
  558|      0|    {
  559|      0|        if ((location.flags & REGION_FLAG_APP_CODE) == 0)
  ------------------
  |  Branch (559:13): [True: 0, False: 0]
  ------------------
  560|      0|        {
  561|      0|            if (ctx.regionDepthOpenCV >= param_maxRegionDepthOpenCV)
  ------------------
  |  Branch (561:17): [True: 0, False: 0]
  ------------------
  562|      0|            {
  563|      0|                CV_LOG(_spaces(ctx.getCurrentDepth()*4) << "OpenCV region depth is exceed = " << ctx.regionDepthOpenCV << ". Bailout");
  ------------------
  |  |   22|      0|#define CV_LOG(...) {}
  ------------------
  564|      0|                if (ctx.stat.currentSkippedRegions == 0)
  ------------------
  |  Branch (564:21): [True: 0, False: 0]
  ------------------
  565|      0|                {
  566|      0|                    DEBUG_ONLY(ctx.dumpStack(std::cout, false));
  ------------------
  |  |   30|      0|#define DEBUG_ONLY(...) (void)0
  ------------------
  567|      0|                }
  568|      0|                ctx.stat_status.enableSkipMode(currentDepth);
  569|      0|                ctx.stat.currentSkippedRegions++;
  570|      0|                return;
  571|      0|            }
  572|      0|        }
  573|      0|    }
  574|       |
  575|      0|    new Impl(ctx, parentRegion, *this, location, beginTimestamp);
  576|      0|    CV_DbgAssert(pImpl != NULL);
  577|      0|    implFlags |= REGION_FLAG__ACTIVE;
  578|       |
  579|       |    // parallel_for path
  580|      0|    if (parentRegion && parentRegion->pImpl)
  ------------------
  |  Branch (580:9): [True: 0, False: 0]
  |  Branch (580:25): [True: 0, False: 0]
  ------------------
  581|      0|    {
  582|      0|        if (parentLocation == NULL)
  ------------------
  |  Branch (582:13): [True: 0, False: 0]
  ------------------
  583|      0|        {
  584|      0|            pImpl->directChildrenCount = parentChildren;
  585|      0|        }
  586|      0|    }
  587|      0|}
_ZN2cv5utils5trace7details12TraceManagerC2Ev:
  837|      2|{
  838|      2|    (void)cv::getTimestampNS();
  839|       |
  840|      2|    isInitialized = true;
  841|      2|    CV_LOG("TraceManager ctor: " << (void*)this);
  ------------------
  |  |   22|      2|#define CV_LOG(...) {}
  ------------------
  842|       |
  843|      2|    CV_LOG("TraceManager configure()");
  ------------------
  |  |   22|      2|#define CV_LOG(...) {}
  ------------------
  844|      2|    activated = getParameterTraceEnable();
  845|       |
  846|      2|    if (activated)
  ------------------
  |  Branch (846:9): [True: 0, False: 2]
  ------------------
  847|      0|        trace_storage.reset(new SyncTraceStorage(std::string(getParameterTraceLocation()) + ".txt"));
  848|       |
  849|      2|#ifdef OPENCV_WITH_ITT
  850|      2|    if (isITTEnabled())
  ------------------
  |  Branch (850:9): [True: 0, False: 2]
  ------------------
  851|      0|    {
  852|      0|        activated = true; // force trace pipeline activation (without OpenCV storage)
  853|      0|        __itt_region_begin(domain, __itt_null, __itt_null, __itt_string_handle_create("OpenCVTrace"));
  ------------------
  |  | 2142|      0|#define __itt_region_begin(d,x,y,z) ITTNOTIFY_VOID_D3(region_begin,d,x,y,z)
  |  |  ------------------
  |  |  |  |  261|      0|#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
  |  |  |  |  ------------------
  |  |  |  |  |  |  253|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  240|      0|    ITT_JOIN(x,              \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  227|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  226|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|    ITT_JOIN(_,              \
  |  |  |  |  |  |  |  |  242|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  |  |  |  |  243|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ITTNOTIFY_VOID_D3(n,d,x,y,z) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
  |  |  |  |  ------------------
  |  |  |  |  |  |  253|      0|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  240|      0|    ITT_JOIN(x,              \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  227|      0|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  226|      0|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|    ITT_JOIN(_,              \
  |  |  |  |  |  |  |  |  242|      0|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  |  |  |  |  243|      0|    ITT_JOIN(_, ITT_MINOR))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 0]
  |  |  |  |  |  Branch (261:62): [True: 0, False: 0]
  |  |  |  |  |  Branch (261:88): [True: 0, False: 0]
  |  |  |  |  |  Branch (261:145): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  854|      0|    }
  855|      2|#endif
  856|      2|}
_ZN2cv5utils5trace7details12TraceManager11isActivatedEv:
  896|    784|{
  897|       |    // Check if process starts shutdown, and set earlyExit to true
  898|       |    // to prevent further instrumentation processing earlier.
  899|    784|    if (cv::__termination)
  ------------------
  |  Branch (899:9): [True: 0, False: 784]
  ------------------
  900|      0|    {
  901|      0|        activated = false;
  902|      0|        return false;
  903|      0|    }
  904|       |
  905|    784|    if (!isInitialized)
  ------------------
  |  Branch (905:9): [True: 2, False: 782]
  ------------------
  906|      2|    {
  907|      2|        TraceManager& m = getTraceManager();
  908|      2|        CV_UNUSED(m); // TODO
  ------------------
  |  |  173|      2|#define CV_UNUSED(name) (void)name
  ------------------
  909|      2|    }
  910|       |
  911|    784|    return activated;
  912|    784|}
_ZN2cv5utils5trace7details15getTraceManagerEv:
  921|      2|{
  922|      2|    CV_SINGLETON_LAZY_INIT_REF(TraceManager, getTraceManagerCallOnce())
  ------------------
  |  |  404|      2|#define CV_SINGLETON_LAZY_INIT_REF(TYPE, INITIALIZER) CV_SINGLETON_LAZY_INIT_(TYPE, INITIALIZER, *instance)
  |  |  ------------------
  |  |  |  |  400|      2|    static TYPE* const instance = INITIALIZER; \
  |  |  |  |  401|      2|    return RET_VALUE;
  |  |  ------------------
  ------------------
  923|      2|}
trace.cpp:_ZN2cv5utils5trace7detailsL12isITTEnabledEv:
  198|      2|{
  199|      2|    static volatile bool isInitialized = false;
  200|      2|    static bool isEnabled = false;
  201|      2|    if (!isInitialized)
  ------------------
  |  Branch (201:9): [True: 2, False: 0]
  ------------------
  202|      2|    {
  203|      2|        cv::AutoLock lock(cv::getInitializationMutex());
  204|      2|        if (!isInitialized)
  ------------------
  |  Branch (204:13): [True: 2, False: 0]
  ------------------
  205|      2|        {
  206|      2|            bool param_traceITTEnable = utils::getConfigurationParameterBool("OPENCV_TRACE_ITT_ENABLE", true);
  207|      2|            if (param_traceITTEnable)
  ------------------
  |  Branch (207:17): [True: 2, False: 0]
  ------------------
  208|      2|            {
  209|      2|                isEnabled = !!(__itt_api_version());
  ------------------
  |  | 4648|      2|#define __itt_api_version     ITTNOTIFY_DATA(api_version)
  |  |  ------------------
  |  |  |  |  256|      2|#define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ?       0 : ITTNOTIFY_NAME(n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  253|      2|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  240|      2|    ITT_JOIN(x,              \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  227|      2|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  226|      2|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      2|    ITT_JOIN(_,              \
  |  |  |  |  |  |  |  |  242|      2|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  |  |  |  |  243|      2|    ITT_JOIN(_, ITT_MINOR))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ?       0 : ITTNOTIFY_NAME(n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  253|      2|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  240|      2|    ITT_JOIN(x,              \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  227|      2|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  226|      2|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      2|    ITT_JOIN(_,              \
  |  |  |  |  |  |  |  |  242|      2|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  |  |  |  |  243|      2|    ITT_JOIN(_, ITT_MINOR))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (256:27): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|      2|                CV_LOG_ITT("ITT is " << (isEnabled ? "enabled" : "disabled"));
  ------------------
  |  |   28|      2|#define CV_LOG_ITT(...) {}
  ------------------
  211|      2|                domain = __itt_domain_create("OpenCVTrace");
  ------------------
  |  | 1858|      2|#define __itt_domain_create     ITTNOTIFY_DATA(domain_create)
  |  |  ------------------
  |  |  |  |  256|      2|#define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ?       0 : ITTNOTIFY_NAME(n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  253|      2|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  240|      2|    ITT_JOIN(x,              \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  227|      2|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  226|      2|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      2|    ITT_JOIN(_,              \
  |  |  |  |  |  |  |  |  242|      2|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  |  |  |  |  243|      2|    ITT_JOIN(_, ITT_MINOR))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ?       0 : ITTNOTIFY_NAME(n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  253|      2|#define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  240|      2|    ITT_JOIN(x,              \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  227|      2|#define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  226|      2|#define ITT_JOIN_AUX(p,n) p##n
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      2|    ITT_JOIN(_,              \
  |  |  |  |  |  |  |  |  242|      2|    ITT_JOIN(ITT_MAJOR,      \
  |  |  |  |  |  |  |  |  243|      2|    ITT_JOIN(_, ITT_MINOR))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (256:27): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  212|      2|            }
  213|      0|            else
  214|      0|            {
  215|      0|                CV_LOG_ITT("ITT is disabled through OpenCV parameter");
  ------------------
  |  |   28|      0|#define CV_LOG_ITT(...) {}
  ------------------
  216|      0|                isEnabled = false;
  217|      0|            }
  218|      2|            isInitialized = true;
  219|      2|        }
  220|      2|    }
  221|      2|    return isEnabled;
  222|      2|}
trace.cpp:_ZN2cv5utils5trace7detailsL23getParameterTraceEnableEv:
   67|      2|{
   68|      2|    static bool param_traceEnable = utils::getConfigurationParameterBool("OPENCV_TRACE", false);
   69|      2|    return param_traceEnable;
   70|      2|}
trace.cpp:_ZN2cv5utils5trace7detailsL23getTraceManagerCallOnceEv:
  916|      2|{
  917|      2|    static TraceManager globalInstance;
  918|      2|    return &globalInstance;
  919|      2|}

_ZN2cv5utils7logging12LogTagConfigC2Ev:
   26|      2|        : namePart()
   27|       |        , level()
   28|       |        , isGlobal()
   29|       |        , hasPrefixWildcard()
   30|       |        , hasSuffixWildcard()
   31|      2|    {
   32|      2|    }

_ZN2cv5utils7logging18LogTagConfigParserC2ENS1_8LogLevelE:
   13|      2|{
   14|      2|    m_parsedGlobal.namePart = "global";
   15|      2|    m_parsedGlobal.isGlobal = true;
   16|      2|    m_parsedGlobal.hasPrefixWildcard = false;
   17|      2|    m_parsedGlobal.hasSuffixWildcard = false;
   18|      2|    m_parsedGlobal.level = defaultUnconfiguredGlobalLevel;
   19|      2|}
_ZN2cv5utils7logging18LogTagConfigParser5parseERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
   31|      2|{
   32|      2|    m_input = input;
   33|      2|    segmentTokens();
   34|      2|    return (m_malformed.empty());
   35|      2|}
_ZNK2cv5utils7logging18LogTagConfigParser12hasMalformedEv:
   38|      2|{
   39|      2|    return !m_malformed.empty();
   40|      2|}
_ZNK2cv5utils7logging18LogTagConfigParser15getGlobalConfigEv:
   43|      2|{
   44|      2|    return m_parsedGlobal;
   45|      2|}
_ZNK2cv5utils7logging18LogTagConfigParser18getFullNameConfigsEv:
   48|      2|{
   49|      2|    return m_parsedFullName;
   50|      2|}
_ZNK2cv5utils7logging18LogTagConfigParser19getFirstPartConfigsEv:
   53|      2|{
   54|      2|    return m_parsedFirstPart;
   55|      2|}
_ZNK2cv5utils7logging18LogTagConfigParser17getAnyPartConfigsEv:
   58|      2|{
   59|      2|    return m_parsedAnyPart;
   60|      2|}
_ZN2cv5utils7logging18LogTagConfigParser13segmentTokensEv:
   68|      2|{
   69|      2|    const size_t len = m_input.length();
   70|      2|    std::vector<std::pair<size_t, size_t>> startStops;
   71|      2|    bool wasSeparator = true;
   72|      2|    for (size_t pos = 0u; pos < len; ++pos)
  ------------------
  |  Branch (72:27): [True: 0, False: 2]
  ------------------
   73|      0|    {
   74|      0|        char c = m_input[pos];
   75|      0|        bool isSeparator = (c == ' ' || c == '\t' || c == ';');
  ------------------
  |  Branch (75:29): [True: 0, False: 0]
  |  Branch (75:41): [True: 0, False: 0]
  |  Branch (75:54): [True: 0, False: 0]
  ------------------
   76|      0|        if (!isSeparator)
  ------------------
  |  Branch (76:13): [True: 0, False: 0]
  ------------------
   77|      0|        {
   78|      0|            if (wasSeparator)
  ------------------
  |  Branch (78:17): [True: 0, False: 0]
  ------------------
   79|      0|            {
   80|      0|                startStops.emplace_back(pos, pos + 1u);
   81|      0|            }
   82|      0|            else
   83|      0|            {
   84|      0|                startStops.back().second = pos + 1u;
   85|      0|            }
   86|      0|        }
   87|      0|        wasSeparator = isSeparator;
   88|      0|    }
   89|      2|    for (const auto& startStop : startStops)
  ------------------
  |  Branch (89:32): [True: 0, False: 2]
  ------------------
   90|      0|    {
   91|      0|        const auto s = m_input.substr(startStop.first, startStop.second - startStop.first);
   92|      0|        parseNameAndLevel(s);
   93|      0|    }
   94|      2|}

_ZN2cv5utils7logging13LogTagManagerC2ENS1_8LogLevelE:
   18|      2|    : m_mutex()
   19|      2|    , m_globalLogTag(new LogTag(m_globalName, defaultUnconfiguredGlobalLevel))
   20|      2|    , m_config(std::make_shared<LogTagConfigParser>(defaultUnconfiguredGlobalLevel))
   21|      2|{
   22|      2|    assign(m_globalName, m_globalLogTag.get());
   23|      2|}
_ZN2cv5utils7logging13LogTagManager15setConfigStringERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEb:
   30|      2|{
   31|      2|    m_config->parse(configString);
   32|      2|    if (m_config->hasMalformed())
  ------------------
  |  Branch (32:9): [True: 0, False: 2]
  ------------------
   33|      0|    {
   34|      0|        return;
   35|      0|    }
   36|      2|    if (!apply)
  ------------------
  |  Branch (36:9): [True: 0, False: 2]
  ------------------
   37|      0|    {
   38|      0|        return;
   39|      0|    }
   40|       |    // The following code is arranged with "priority by overwriting",
   41|       |    // where when the same log tag has multiple matches, the last code
   42|       |    // block has highest priority by literally overwriting the effects
   43|       |    // from the earlier code blocks.
   44|       |    //
   45|       |    // Matching by full name has highest priority.
   46|       |    // Matching by any name part has moderate priority.
   47|       |    // Matching by first name part (prefix) has lowest priority.
   48|       |    //
   49|      2|    const auto& globalConfig = m_config->getGlobalConfig();
   50|      2|    m_globalLogTag->level = globalConfig.level;
   51|      2|    for (const auto& config : m_config->getFirstPartConfigs())
  ------------------
  |  Branch (51:29): [True: 0, False: 2]
  ------------------
   52|      0|    {
   53|      0|        setLevelByFirstPart(config.namePart, config.level);
   54|      0|    }
   55|      2|    for (const auto& config : m_config->getAnyPartConfigs())
  ------------------
  |  Branch (55:29): [True: 0, False: 2]
  ------------------
   56|      0|    {
   57|      0|        setLevelByAnyPart(config.namePart, config.level);
   58|      0|    }
   59|      2|    for (const auto& config : m_config->getFullNameConfigs())
  ------------------
  |  Branch (59:29): [True: 0, False: 2]
  ------------------
   60|      0|    {
   61|      0|        setLevelByFullName(config.namePart, config.level);
   62|      0|    }
   63|      2|}
_ZN2cv5utils7logging13LogTagManager6assignERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEPNS1_6LogTagE:
   71|      2|{
   72|      2|    CV_TRACE_FUNCTION();
  ------------------
  |  |  207|      2|#define CV_TRACE_FUNCTION CV__TRACE_OPENCV_FUNCTION
  |  |  ------------------
  |  |  |  |  151|      2|    CV__TRACE_DEFINE_LOCATION_FN(CV__TRACE_FUNCTION, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      2|#define CV__TRACE_DEFINE_LOCATION_FN(name, flags) CV__TRACE_DEFINE_LOCATION_(fn, name, ((flags) | CV_TRACE_NS::details::REGION_FLAG_FUNCTION))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  143|      2|    static CV_TRACE_NS::details::Region::LocationExtraData* CV__TRACE_LOCATION_EXTRA_VARNAME(loc_id) = 0; \
  |  |  |  |  |  |  |  |  144|      2|    static const CV_TRACE_NS::details::Region::LocationStaticStorage \
  |  |  |  |  |  |  |  |  145|      2|        CV__TRACE_LOCATION_VARNAME(loc_id) = { &(CV__TRACE_LOCATION_EXTRA_VARNAME(loc_id)), name, CV_TRACE_FILENAME, __LINE__, flags};
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  140|      2|#define CV__TRACE_LOCATION_EXTRA_VARNAME(loc_id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_trace_location_extra_, loc_id) , __LINE__)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  115|      2|#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      2|#define CVAUX_CONCAT_EXP(a, b) a##b
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |                       CV__TRACE_LOCATION_VARNAME(loc_id) = { &(CV__TRACE_LOCATION_EXTRA_VARNAME(loc_id)), name, CV_TRACE_FILENAME, __LINE__, flags};
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   53|      2|# define CV_TRACE_FILENAME __FILE__
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  152|      2|    const CV_TRACE_NS::details::Region __region_fn(CV__TRACE_LOCATION_VARNAME(fn));
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|      2|#define CV__TRACE_LOCATION_VARNAME(loc_id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_trace_location_, loc_id), __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      2|#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  114|      2|#define CVAUX_CONCAT_EXP(a, b) a##b
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   73|      2|    LockType lock(m_mutex);
   74|      2|    FullNameLookupResult result(fullName);
   75|      2|    result.m_findCrossReferences = true;
   76|      2|    m_nameTable.addOrLookupFullName(result);
   77|      2|    FullNameInfo& fullNameInfo = *result.m_fullNameInfoPtr;
   78|      2|    const bool isPtrChanged = (fullNameInfo.logTagPtr != ptr);
   79|      2|    if (!isPtrChanged)
  ------------------
  |  Branch (79:9): [True: 0, False: 2]
  ------------------
   80|      0|    {
   81|      0|        return;
   82|      0|    }
   83|      2|    fullNameInfo.logTagPtr = ptr;
   84|      2|    if (!ptr)
  ------------------
  |  Branch (84:9): [True: 0, False: 2]
  ------------------
   85|      0|    {
   86|      0|        return;
   87|      0|    }
   88|      2|    const bool hasAppliedFullNameConfig = internal_applyFullNameConfigToTag(fullNameInfo);
   89|      2|    if (hasAppliedFullNameConfig)
  ------------------
  |  Branch (89:9): [True: 0, False: 2]
  ------------------
   90|      0|    {
   91|      0|        return;
   92|      0|    }
   93|      2|    internal_applyNamePartConfigToSpecificTag(result);
   94|      2|}
_ZN2cv5utils7logging13LogTagManager3getERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  103|      2|{
  104|      2|    CV_TRACE_FUNCTION();
  ------------------
  |  |  207|      2|#define CV_TRACE_FUNCTION CV__TRACE_OPENCV_FUNCTION
  |  |  ------------------
  |  |  |  |  151|      2|    CV__TRACE_DEFINE_LOCATION_FN(CV__TRACE_FUNCTION, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      2|#define CV__TRACE_DEFINE_LOCATION_FN(name, flags) CV__TRACE_DEFINE_LOCATION_(fn, name, ((flags) | CV_TRACE_NS::details::REGION_FLAG_FUNCTION))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  143|      2|    static CV_TRACE_NS::details::Region::LocationExtraData* CV__TRACE_LOCATION_EXTRA_VARNAME(loc_id) = 0; \
  |  |  |  |  |  |  |  |  144|      2|    static const CV_TRACE_NS::details::Region::LocationStaticStorage \
  |  |  |  |  |  |  |  |  145|      2|        CV__TRACE_LOCATION_VARNAME(loc_id) = { &(CV__TRACE_LOCATION_EXTRA_VARNAME(loc_id)), name, CV_TRACE_FILENAME, __LINE__, flags};
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  140|      2|#define CV__TRACE_LOCATION_EXTRA_VARNAME(loc_id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_trace_location_extra_, loc_id) , __LINE__)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  115|      2|#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      2|#define CVAUX_CONCAT_EXP(a, b) a##b
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |                       CV__TRACE_LOCATION_VARNAME(loc_id) = { &(CV__TRACE_LOCATION_EXTRA_VARNAME(loc_id)), name, CV_TRACE_FILENAME, __LINE__, flags};
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   53|      2|# define CV_TRACE_FILENAME __FILE__
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  152|      2|    const CV_TRACE_NS::details::Region __region_fn(CV__TRACE_LOCATION_VARNAME(fn));
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|      2|#define CV__TRACE_LOCATION_VARNAME(loc_id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_trace_location_, loc_id), __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      2|#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  114|      2|#define CVAUX_CONCAT_EXP(a, b) a##b
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  105|      2|    LockType lock(m_mutex);
  106|      2|    FullNameInfo* fullNameInfoPtr = m_nameTable.getFullNameInfo(fullName);
  107|      2|    if (fullNameInfoPtr && fullNameInfoPtr->logTagPtr)
  ------------------
  |  Branch (107:9): [True: 2, False: 0]
  |  Branch (107:28): [True: 2, False: 0]
  ------------------
  108|      2|    {
  109|      2|        return fullNameInfoPtr->logTagPtr;
  110|      2|    }
  111|      0|    return nullptr;
  112|      2|}
_ZN2cv5utils7logging13LogTagManager14splitNamePartsERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  171|      2|{
  172|      2|    const size_t npos = std::string::npos;
  173|      2|    const size_t len = fullName.length();
  174|      2|    std::vector<std::string> nameParts;
  175|      2|    size_t start = 0u;
  176|      4|    while (start < len)
  ------------------
  |  Branch (176:12): [True: 2, False: 2]
  ------------------
  177|      2|    {
  178|      2|        size_t nextPeriod = fullName.find('.', start);
  179|      2|        if (nextPeriod == npos)
  ------------------
  |  Branch (179:13): [True: 2, False: 0]
  ------------------
  180|      2|        {
  181|      2|            nextPeriod = len;
  182|      2|        }
  183|      2|        if (nextPeriod >= start + 1u)
  ------------------
  |  Branch (183:13): [True: 2, False: 0]
  ------------------
  184|      2|        {
  185|      2|            nameParts.emplace_back(fullName.substr(start, nextPeriod - start));
  186|      2|        }
  187|      2|        start = nextPeriod + 1u;
  188|      2|    }
  189|      2|    return nameParts;
  190|      2|}
_ZN2cv5utils7logging13LogTagManager24internal_isNamePartMatchENS2_13MatchingScopeEm:
  193|      2|{
  194|      2|    switch (scope)
  195|      2|    {
  196|      0|    case MatchingScope::FirstNamePart:
  ------------------
  |  Branch (196:5): [True: 0, False: 2]
  ------------------
  197|      0|        return (matchingPos == 0u);
  198|      0|    case MatchingScope::AnyNamePart:
  ------------------
  |  Branch (198:5): [True: 0, False: 2]
  ------------------
  199|      0|        return true;
  200|      2|    case MatchingScope::None:
  ------------------
  |  Branch (200:5): [True: 2, False: 0]
  ------------------
  201|      2|    case MatchingScope::Full:
  ------------------
  |  Branch (201:5): [True: 0, False: 2]
  ------------------
  202|      2|    default:
  ------------------
  |  Branch (202:5): [True: 0, False: 2]
  ------------------
  203|      2|        return false;
  204|      2|    }
  205|      2|}
_ZN2cv5utils7logging13LogTagManager33internal_applyFullNameConfigToTagERNS2_12FullNameInfoE:
  208|      2|{
  209|      2|    if (!fullNameInfo.logTagPtr)
  ------------------
  |  Branch (209:9): [True: 0, False: 2]
  ------------------
  210|      0|    {
  211|      0|        return false;
  212|      0|    }
  213|      2|    if (fullNameInfo.parsedLevel.scope == MatchingScope::Full)
  ------------------
  |  Branch (213:9): [True: 0, False: 2]
  ------------------
  214|      0|    {
  215|      0|        fullNameInfo.logTagPtr->level = fullNameInfo.parsedLevel.level;
  216|      0|        return true;
  217|      0|    }
  218|      2|    return false;
  219|      2|}
_ZN2cv5utils7logging13LogTagManager41internal_applyNamePartConfigToSpecificTagERNS2_20FullNameLookupResultE:
  222|      2|{
  223|      2|    const FullNameInfo& fullNameInfo = *fullNameResult.m_fullNameInfoPtr;
  224|      2|    LogTag* const logTag = fullNameInfo.logTagPtr;
  225|      2|    if (!logTag)
  ------------------
  |  Branch (225:9): [True: 0, False: 2]
  ------------------
  226|      0|    {
  227|      0|        return false;
  228|      0|    }
  229|      2|    CV_Assert(fullNameResult.m_findCrossReferences);
  ------------------
  |  |  423|      2|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:35): [True: 2, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
  230|      2|    const auto& crossReferences = fullNameResult.m_crossReferences;
  231|      2|    const size_t matchingNamePartCount = crossReferences.size();
  232|      4|    for (size_t k = 0u; k < matchingNamePartCount; ++k)
  ------------------
  |  Branch (232:25): [True: 2, False: 2]
  ------------------
  233|      2|    {
  234|      2|        const auto& match = crossReferences.at(k);
  235|      2|        const auto& namePartInfo = *match.m_namePartInfo;
  236|      2|        const auto& parsedLevel = namePartInfo.parsedLevel;
  237|      2|        const auto scope = parsedLevel.scope;
  238|      2|        const LogLevel level = parsedLevel.level;
  239|      2|        const size_t matchingPos = match.m_matchingPos;
  240|      2|        const bool isMatch = internal_isNamePartMatch(scope, matchingPos);
  241|      2|        if (isMatch)
  ------------------
  |  Branch (241:13): [True: 0, False: 2]
  ------------------
  242|      0|        {
  243|      0|            logTag->level = level;
  244|      0|            return true;
  245|      0|        }
  246|      2|    }
  247|      2|    return false;
  248|      2|}
_ZN2cv5utils7logging13LogTagManager9NameTable19addOrLookupFullNameERNS2_20FullNameLookupResultE:
  289|      2|{
  290|      2|    const auto fullNameIdAndFlag = internal_addOrLookupFullName(result.m_fullName);
  291|      2|    result.m_fullNameId = fullNameIdAndFlag.first;
  292|      2|    result.m_nameParts = LogTagManager::splitNameParts(result.m_fullName);
  293|      2|    internal_addOrLookupNameParts(result.m_nameParts, result.m_namePartIds);
  294|      2|    const bool isNew = fullNameIdAndFlag.second;
  295|      2|    if (isNew)
  ------------------
  |  Branch (295:9): [True: 2, False: 0]
  ------------------
  296|      2|    {
  297|      2|        internal_addCrossReference(result.m_fullNameId, result.m_namePartIds);
  298|      2|    }
  299|       |    // ====== IMPORTANT ====== Critical order-of-operation ======
  300|       |    // The gathering of the pointers of FullNameInfo and NamePartInfo are performed
  301|       |    // as the last step of the operation, so that these pointer are not invalidated
  302|       |    // by the vector append operations earlier in this function.
  303|       |    // ======
  304|      2|    result.m_fullNameInfoPtr = internal_getFullNameInfo(result.m_fullNameId);
  305|      2|    if (result.m_findCrossReferences)
  ------------------
  |  Branch (305:9): [True: 2, False: 0]
  ------------------
  306|      2|    {
  307|      2|        internal_findMatchingNamePartsForFullName(result);
  308|      2|    }
  309|      2|}
_ZN2cv5utils7logging13LogTagManager9NameTable28internal_addOrLookupFullNameERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  322|      2|{
  323|      2|    const auto fullNameIdIter = m_fullNameIds.find(fullName);
  324|      2|    if (fullNameIdIter != m_fullNameIds.end())
  ------------------
  |  Branch (324:9): [True: 0, False: 2]
  ------------------
  325|      0|    {
  326|      0|        return std::make_pair(fullNameIdIter->second, false);
  327|      0|    }
  328|      2|    const size_t fullNameId = m_fullNameInfos.size();
  329|      2|    m_fullNameInfos.emplace_back(FullNameInfo{});
  330|      2|    m_fullNameIds.emplace(fullName, fullNameId);
  331|      2|    return std::make_pair(fullNameId, true);
  332|      2|}
_ZN2cv5utils7logging13LogTagManager9NameTable29internal_addOrLookupNamePartsERKNSt3__16vectorINS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS9_ISB_EEEERNS5_ImNS9_ImEEEE:
  336|      2|{
  337|      2|    const size_t namePartCount = nameParts.size();
  338|      2|    namePartIds.resize(namePartCount, ~(size_t)0u);
  339|      4|    for (size_t namePartIndex = 0u; namePartIndex < namePartCount; ++namePartIndex)
  ------------------
  |  Branch (339:37): [True: 2, False: 2]
  ------------------
  340|      2|    {
  341|      2|        const std::string& namePart = nameParts.at(namePartIndex);
  342|      2|        const size_t namePartId = internal_addOrLookupNamePart(namePart);
  343|      2|        namePartIds.at(namePartIndex) = namePartId;
  344|      2|    }
  345|      2|}
_ZN2cv5utils7logging13LogTagManager9NameTable28internal_addOrLookupNamePartERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  348|      2|{
  349|      2|    const auto namePartIter = m_namePartIds.find(namePart);
  350|      2|    if (namePartIter != m_namePartIds.end())
  ------------------
  |  Branch (350:9): [True: 0, False: 2]
  ------------------
  351|      0|    {
  352|      0|        return namePartIter->second;
  353|      0|    }
  354|      2|    const size_t namePartId = m_namePartInfos.size();
  355|      2|    m_namePartInfos.emplace_back(NamePartInfo{});
  356|      2|    m_namePartIds.emplace(namePart, namePartId);
  357|      2|    return namePartId;
  358|      2|}
_ZN2cv5utils7logging13LogTagManager9NameTable26internal_addCrossReferenceEmRKNSt3__16vectorImNS4_9allocatorImEEEE:
  361|      2|{
  362|      2|    const size_t namePartCount = namePartIds.size();
  363|      4|    for (size_t namePartPos = 0u; namePartPos < namePartCount; ++namePartPos)
  ------------------
  |  Branch (363:35): [True: 2, False: 2]
  ------------------
  364|      2|    {
  365|      2|        const size_t namePartId = namePartIds.at(namePartPos);
  366|      2|        m_fullNameToNamePartIds.emplace(fullNameId, std::make_pair(namePartId, namePartPos));
  367|      2|        m_namePartToFullNameIds.emplace(namePartId, std::make_pair(fullNameId, namePartPos));
  368|      2|    }
  369|      2|}
_ZN2cv5utils7logging13LogTagManager9NameTable15getFullNameInfoERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  372|      2|{
  373|      2|    const auto fullNameIdIter = m_fullNameIds.find(fullName);
  374|      2|    if (fullNameIdIter == m_fullNameIds.end())
  ------------------
  |  Branch (374:9): [True: 0, False: 2]
  ------------------
  375|      0|    {
  376|      0|        return nullptr;
  377|      0|    }
  378|      2|    const size_t fullNameId = fullNameIdIter->second;
  379|      2|    return internal_getFullNameInfo(fullNameId);
  380|      2|}
_ZN2cv5utils7logging13LogTagManager9NameTable24internal_getFullNameInfoEm:
  383|      4|{
  384|      4|    return std::addressof(m_fullNameInfos.at(fullNameId));
  385|      4|}
_ZN2cv5utils7logging13LogTagManager9NameTable24internal_getNamePartInfoEm:
  388|      2|{
  389|      2|    return std::addressof(m_namePartInfos.at(namePartId));
  390|      2|}
_ZN2cv5utils7logging13LogTagManager9NameTable41internal_findMatchingNamePartsForFullNameERNS2_20FullNameLookupResultE:
  393|      2|{
  394|      2|    const size_t fullNameId = fullNameResult.m_fullNameId;
  395|      2|    FullNameInfo* fullNameInfo = fullNameResult.m_fullNameInfoPtr;
  396|      2|    const auto& namePartIds = fullNameResult.m_namePartIds;
  397|      2|    const size_t namePartCount = namePartIds.size();
  398|      2|    auto& crossReferences = fullNameResult.m_crossReferences;
  399|      2|    crossReferences.clear();
  400|      2|    crossReferences.reserve(namePartCount);
  401|      4|    for (size_t matchingPos = 0u; matchingPos < namePartCount; ++matchingPos)
  ------------------
  |  Branch (401:35): [True: 2, False: 2]
  ------------------
  402|      2|    {
  403|      2|        const size_t namePartId = namePartIds.at(matchingPos);
  404|      2|        NamePartInfo* namePartInfo = internal_getNamePartInfo(namePartId);
  405|      2|        crossReferences.emplace_back(CrossReference(fullNameId, namePartId, matchingPos, fullNameInfo, namePartInfo));
  406|      2|    }
  407|      2|}

_ZN2cv5utils7logging13LogTagManager11ParsedLevelC2Ev:
   58|      4|            , scope(MatchingScope::None)
   59|      4|        {
   60|      4|        }
_ZN2cv5utils7logging13LogTagManager14CrossReferenceC2EmmmPNS2_12FullNameInfoEPNS2_12NamePartInfoE:
   84|      2|            : m_fullNameId(fullNameId)
   85|      2|            , m_namePartId(namePartId)
   86|      2|            , m_matchingPos(matchingPos)
   87|      2|            , m_fullNameInfo(fullNameInfo)
   88|      2|            , m_namePartInfo(namePartInfo)
   89|      2|        {
   90|      2|        }
_ZN2cv5utils7logging13LogTagManager20FullNameLookupResultC2ERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  120|      2|            : m_fullName(fullName)
  121|      2|            , m_nameParts()
  122|       |            , m_fullNameId()
  123|      2|            , m_namePartIds()
  124|       |            , m_fullNameInfoPtr()
  125|       |            , m_findCrossReferences()
  126|      2|            , m_crossReferences()
  127|      2|        {
  128|      2|        }

_ZN2cv11RBaseStreamC2Ev:
   34|      6|{
   35|      6|    m_start = m_end = m_current = 0;
   36|      6|    m_file = 0;
   37|      6|    m_block_pos = 0;
   38|      6|    m_block_size = BS_DEF_BLOCK_SIZE;
   39|      6|    m_is_opened = false;
   40|      6|    m_allocated = false;
   41|      6|}
_ZN2cv11RBaseStreamD2Ev:
   45|      6|{
   46|      6|    close();    // Close files
   47|      6|    release();  // free  buffers
   48|      6|}
_ZN2cv11RBaseStream5closeEv:
  102|      9|{
  103|      9|    if( m_file )
  ------------------
  |  Branch (103:9): [True: 0, False: 9]
  ------------------
  104|      0|    {
  105|      0|        fclose( m_file );
  106|      0|        m_file = 0;
  107|      0|    }
  108|      9|    m_is_opened = false;
  109|      9|    if( !m_allocated )
  ------------------
  |  Branch (109:9): [True: 9, False: 0]
  ------------------
  110|      9|        m_start = m_end = m_current = 0;
  111|      9|}
_ZN2cv11RBaseStream7releaseEv:
  115|      6|{
  116|      6|    if( m_allocated )
  ------------------
  |  Branch (116:9): [True: 0, False: 6]
  ------------------
  117|      0|        delete[] m_start;
  118|      6|    m_start = m_end = m_current = 0;
  119|      6|    m_allocated = false;
  120|      6|}
_ZN2cv11WBaseStreamC2Ev:
  304|      1|{
  305|      1|    m_start = m_end = m_current = 0;
  306|      1|    m_file = 0;
  307|      1|    m_block_pos = 0;
  308|      1|    m_block_size = BS_DEF_BLOCK_SIZE;
  309|      1|    m_is_opened = false;
  310|      1|    m_buf = 0;
  311|      1|}
_ZN2cv11WBaseStreamD2Ev:
  315|      1|{
  316|      1|    close();
  317|      1|    release();
  318|      1|}
_ZN2cv11WBaseStream8isOpenedEv:
  322|      1|{
  323|      1|    return m_is_opened;
  324|      1|}
_ZN2cv11WBaseStream5closeEv:
  393|      1|{
  394|      1|    if( m_is_opened )
  ------------------
  |  Branch (394:9): [True: 0, False: 1]
  ------------------
  395|      0|        writeBlock();
  396|      1|    if( m_file )
  ------------------
  |  Branch (396:9): [True: 0, False: 1]
  ------------------
  397|      0|    {
  398|      0|        fclose( m_file );
  399|      0|        m_file = 0;
  400|      0|    }
  401|      1|    m_buf = 0;
  402|      1|    m_is_opened = false;
  403|      1|}
_ZN2cv11WBaseStream7releaseEv:
  407|      1|{
  408|      1|    if( m_start )
  ------------------
  |  Branch (408:9): [True: 0, False: 1]
  ------------------
  409|      0|        delete[] m_start;
  410|      1|    m_start = m_end = m_current = 0;
  411|      1|}

_ZN2cv10ExifReaderC2Ev:
   65|     14|ExifReader::ExifReader() : m_format(NONE)
   66|     14|{
   67|     14|}
_ZN2cv10ExifReaderD2Ev:
   73|     14|{
   74|     14|}

_ZN2cv16BaseImageDecoderC2Ev:
   52|     14|{
   53|     14|    m_width = m_height = 0;
   54|     14|    m_type = -1;
   55|     14|    m_buf_supported = false;
   56|     14|    m_scale_denom = 1;
   57|     14|    m_use_rgb = false;
   58|     14|    m_frame_count = 1;
   59|     14|}
_ZN2cv16BaseImageEncoderC2Ev:
  111|    796|{
  112|    796|    m_buf = 0;
  113|    796|    m_buf_supported = false;
  114|    796|}
_ZNK2cv16BaseImageEncoder14getDescriptionEv:
  122|  10.1k|{
  123|  10.1k|    return m_description;
  124|  10.1k|}
_ZN2cv16BaseImageEncoder14setDestinationERNSt3__16vectorIhNS1_9allocatorIhEEEE:
  134|    780|{
  135|    780|    if( !m_buf_supported )
  ------------------
  |  Branch (135:9): [True: 0, False: 780]
  ------------------
  136|      0|        return false;
  137|    780|    m_buf = &buf;
  138|    780|    m_buf->clear();
  139|    780|    m_filename = String();
  140|    780|    return true;
  141|    780|}
_ZNK2cv16BaseImageEncoder12throwOnErrorEv:
  175|    780|{
  176|    780|    if(!m_last_error.empty())
  ------------------
  |  Branch (176:8): [True: 0, False: 780]
  ------------------
  177|      0|    {
  178|      0|        String msg = "Raw image encoder error: " + m_last_error;
  179|      0|        CV_Error( Error::BadImageSize, msg.c_str() );
  ------------------
  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  ------------------
  180|      0|    }
  181|    780|}

_ZN2cv16BaseImageDecoderD2Ev:
   41|     14|    virtual ~BaseImageDecoder() {}
_ZN2cv16BaseImageEncoderD2Ev:
  180|    796|    virtual ~BaseImageEncoder() {}

_ZN2cv10BmpDecoderC2Ev:
   54|      1|{
   55|      1|    m_signature = fmtSignBmp;
   56|      1|    m_offset = -1;
   57|      1|    m_buf_supported = true;
   58|      1|    m_origin = ORIGIN_TL;
   59|      1|    m_bpp = 0;
   60|      1|    m_rle_code = BMP_RGB;
   61|      1|    initMask();
   62|      1|}
_ZN2cv10BmpDecoderD2Ev:
   66|      1|{
   67|      1|}
_ZN2cv10BmpDecoder8initMaskEv:
  561|      1|{
  562|      1|    memset(m_rgba_mask, 0, sizeof(m_rgba_mask));
  563|      1|    memset(m_rgba_bit_offset, -1, sizeof(m_rgba_bit_offset));
  564|      5|    for (size_t i = 0; i < 4; i++) {
  ------------------
  |  Branch (564:24): [True: 4, False: 1]
  ------------------
  565|      4|        m_rgba_scale_factor[i] = 1.0f;
  566|      4|    }
  567|      1|}
_ZN2cv10BmpEncoderC2Ev:
  603|      1|{
  604|      1|    m_description = "Windows bitmap (*.bmp;*.dib)";
  605|      1|    m_buf_supported = true;
  606|      1|}
_ZN2cv10BmpEncoderD2Ev:
  610|      1|{
  611|      1|}

_ZN2cv10ExrDecoderC2Ev:
  110|      1|{
  111|      1|    m_signature = "\x76\x2f\x31\x01";
  112|      1|    m_file = 0;
  113|      1|    m_red = m_green = m_blue = m_alpha = 0;
  114|      1|    m_type = ((Imf::PixelType)0);
  115|      1|    m_iscolor = false;
  116|      1|    m_bit_depth = 0;
  117|      1|    m_isfloat = false;
  118|      1|    m_ischroma = false;
  119|      1|    m_hasalpha = false;
  120|      1|    m_native_depth = false;
  121|       |
  122|      1|}
_ZN2cv10ExrDecoderD2Ev:
  126|      1|{
  127|      1|    close();
  128|      1|}
_ZN2cv10ExrDecoder5closeEv:
  132|      1|{
  133|      1|    if( m_file )
  ------------------
  |  Branch (133:9): [True: 0, False: 1]
  ------------------
  134|      0|    {
  135|      0|        delete m_file;
  136|      0|        m_file = 0;
  137|      0|    }
  138|      1|}
_ZN2cv10ExrEncoderC2Ev:
  703|      1|{
  704|      1|    m_description = "OpenEXR Image files (*.exr)";
  705|      1|}
_ZN2cv10ExrEncoderD2Ev:
  709|      1|{
  710|      1|}

_ZN2cv10GifDecoderC2Ev:
   15|      1|GifDecoder::GifDecoder() {
   16|      1|    m_signature = R"(GIF)";
   17|      1|    m_type = CV_8UC3;
  ------------------
  |  |   90|      1|#define CV_8UC3 CV_MAKETYPE(CV_8U,3)
  |  |  ------------------
  |  |  |  |   85|      1|#define CV_MAKETYPE(depth,cn) (CV_MAT_DEPTH(depth) + (((cn)-1) << CV_CN_SHIFT))
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define CV_MAT_DEPTH(flags)     ((flags) & CV_MAT_DEPTH_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   82|      1|#define CV_MAT_DEPTH_MASK       (CV_DEPTH_MAX - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   71|      1|#define CV_DEPTH_MAX  (1 << CV_CN_SHIFT)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   70|      1|#define CV_CN_SHIFT   3
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define CV_MAKETYPE(depth,cn) (CV_MAT_DEPTH(depth) + (((cn)-1) << CV_CN_SHIFT))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      1|#define CV_CN_SHIFT   3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   18|      1|    bgColor = -1;
   19|      1|    m_buf_supported = true;
   20|      1|    globalColorTableSize = 0;
   21|      1|    localColorTableSize = 0;
   22|      1|    localColorTable.resize(3 * 256); // maximum size of a color table
   23|      1|    lzwMinCodeSize = 0;
   24|      1|    hasRead = false;
   25|      1|    hasTransparentColor = false;
   26|      1|    transparentColor = 0;
   27|      1|    top = 0, left = 0, width = 0, height = 0;
   28|      1|    depth = 8;
   29|      1|    idx = 0;
   30|      1|}
_ZN2cv10GifDecoderD2Ev:
   32|      1|GifDecoder::~GifDecoder() {
   33|      1|    close();
   34|      1|}
_ZN2cv10GifDecoder5closeEv:
  426|      1|void GifDecoder::close() {
  427|      1|    while (!lastImage.empty()) lastImage.release();
  ------------------
  |  Branch (427:12): [True: 0, False: 1]
  ------------------
  428|      1|    m_strm.close();
  429|      1|}
_ZN2cv10GifEncoderC2Ev:
  540|      1|GifEncoder::GifEncoder() {
  541|      1|    m_description = "Graphics Interchange Format 89a(*.gif)";
  542|      1|    m_height = 0, m_width = 0;
  543|      1|    width = 0, height = 0, top = 0, left = 0;
  544|      1|    m_buf_supported = true;
  545|      1|    transparentColor = 0; // index of the transparent color, default 0. currently it is a constant number
  546|      1|    transparentRGB = Vec3b(0, 0, 0); // the transparent color, default black
  547|      1|    lzwMaxCodeSize = 12; // the maximum code size, default 12. currently it is a constant number
  548|       |
  549|       |    // default value of the params
  550|      1|    fast = true;
  551|      1|    criticalTransparency = 1; // critical transparency, default 1, range from 0 to 255, 0 means no transparency
  552|      1|    bitDepth = 8; // the number of bits per pixel, default 8, currently it is a constant number
  553|      1|    lzwMinCodeSize = 8; // the minimum code size, default 8, this changes as the color number changes
  554|      1|    colorNum = 256; // the number of colors in the color table, default 256
  555|      1|    dithering = 0; // the level dithering, default 0
  556|      1|    globalColorTableSize = 256, localColorTableSize = 0;
  557|      1|}
_ZN2cv10GifEncoderD2Ev:
  559|      1|GifEncoder::~GifEncoder() {
  560|      1|    close();
  561|      1|}
_ZN2cv10GifEncoder5closeEv:
 1027|      1|void GifEncoder::close() {
 1028|      1|    if (strm.isOpened()) {
  ------------------
  |  Branch (1028:9): [True: 0, False: 1]
  ------------------
 1029|      0|        strm.close();
 1030|      0|    }
 1031|      1|}
_ZN2cv10GifEncoder16OctreeColorQuant10OctreeNodeC2Ev:
 1037|      2|GifEncoder::OctreeColorQuant::OctreeNode::OctreeNode() {
 1038|      2|    this->isLeaf = false;
 1039|      2|    level = 0;
 1040|      2|    index = 0;
 1041|     16|    for (auto &i: children) {
  ------------------
  |  Branch (1041:17): [True: 16, False: 2]
  ------------------
 1042|     16|        i = nullptr;
 1043|     16|    }
 1044|      2|    leaf = 0, pixelCount = 0;
 1045|      2|    redSum = greenSum = blueSum = 0;
 1046|      2|}
_ZN2cv10GifEncoder16OctreeColorQuantC2Eiih:
 1048|      2|GifEncoder::OctreeColorQuant::OctreeColorQuant(int maxColors, int bitLength, uchar criticalTransparency) {
 1049|      2|    m_maxColors = maxColors;
 1050|      2|    m_bitLength = bitLength;
 1051|      2|    m_leafCount = criticalTransparency ? 1 : 0;
  ------------------
  |  Branch (1051:19): [True: 2, False: 0]
  ------------------
 1052|      2|    m_criticalTransparency = criticalTransparency;
 1053|      2|    root = std::make_shared<OctreeNode>();
 1054|      2|    r = g = b = 0;
 1055|     18|    for (int i = 0; i < bitLength; i++) {
  ------------------
  |  Branch (1055:21): [True: 16, False: 2]
  ------------------
 1056|     16|        m_nodeList[i] = std::vector<std::shared_ptr<OctreeNode>>();
 1057|     16|    }
 1058|      2|}

_ZN2cv10HdrDecoderC2Ev:
   53|      1|{
   54|      1|    m_signature = "#?RGBE";
   55|      1|    m_signature_alt = "#?RADIANCE";
   56|      1|    file = NULL;
   57|      1|    m_type = CV_32FC3;
  ------------------
  |  |  120|      1|#define CV_32FC3 CV_MAKETYPE(CV_32F,3)
  |  |  ------------------
  |  |  |  |   85|      1|#define CV_MAKETYPE(depth,cn) (CV_MAT_DEPTH(depth) + (((cn)-1) << CV_CN_SHIFT))
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define CV_MAT_DEPTH(flags)     ((flags) & CV_MAT_DEPTH_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   82|      1|#define CV_MAT_DEPTH_MASK       (CV_DEPTH_MAX - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   71|      1|#define CV_DEPTH_MAX  (1 << CV_CN_SHIFT)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   70|      1|#define CV_CN_SHIFT   3
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define CV_MAKETYPE(depth,cn) (CV_MAT_DEPTH(depth) + (((cn)-1) << CV_CN_SHIFT))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      1|#define CV_CN_SHIFT   3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   58|      1|}
_ZN2cv10HdrDecoderD2Ev:
   61|      1|{
   62|      1|    if(file) {
  ------------------
  |  Branch (62:8): [True: 0, False: 1]
  ------------------
   63|      0|        fclose(file);
   64|      0|    }
   65|      1|}
_ZN2cv10HdrEncoderC2Ev:
  140|      1|{
  141|      1|    m_description = "Radiance HDR (*.hdr;*.pic)";
  142|      1|}
_ZN2cv10HdrEncoderD2Ev:
  145|      1|{
  146|      1|}

_ZN2cv11JpegDecoderC2Ev:
  181|      1|{
  182|      1|    m_signature = "\xFF\xD8\xFF";
  183|      1|    m_state = 0;
  184|      1|    m_f = 0;
  185|      1|    m_buf_supported = true;
  186|      1|}
_ZN2cv11JpegDecoderD2Ev:
  190|      1|{
  191|      1|    close();
  192|      1|}
_ZN2cv11JpegDecoder5closeEv:
  196|      1|{
  197|      1|    if( m_state )
  ------------------
  |  Branch (197:9): [True: 0, False: 1]
  ------------------
  198|      0|    {
  199|      0|        JpegState* state = (JpegState*)m_state;
  200|      0|        jpeg_destroy_decompress( &state->cinfo );
  201|      0|        delete state;
  202|      0|        m_state = 0;
  203|      0|    }
  204|       |
  205|      1|    if( m_f )
  ------------------
  |  Branch (205:9): [True: 0, False: 1]
  ------------------
  206|      0|    {
  207|      0|        fclose( m_f );
  208|      0|        m_f = 0;
  209|      0|    }
  210|       |
  211|      1|    m_width = m_height = 0;
  212|      1|    m_type = -1;
  213|      1|}
_ZN2cv11JpegEncoderC2Ev:
  600|      1|{
  601|      1|    m_description = "JPEG files (*.jpeg;*.jpg;*.jpe)";
  602|      1|    m_buf_supported = true;
  603|      1|}
_ZN2cv11JpegEncoderD2Ev:
  607|      1|{
  608|      1|}

_ZN2cv6detail20Jpeg2KOpjDecoderBaseC2E12CODEC_FORMAT:
  505|      2|    : format_(format)
  506|      2|{
  507|      2|    m_buf_supported = true;
  508|      2|}
_ZN2cv19Jpeg2KJP2OpjDecoderC2Ev:
  660|      1|    : Jpeg2KOpjDecoderBase(OPJ_CODEC_JP2)
  661|      1|{
  662|      1|    static const unsigned char JP2Signature[] = { 0, 0, 0, 0x0c, 'j', 'P', ' ', ' ', 13, 10, 0x87, 10 };
  663|      1|    m_signature = String((const char*) JP2Signature, sizeof(JP2Signature));
  664|      1|}
_ZN2cv19Jpeg2KJ2KOpjDecoderC2Ev:
  672|      1|    : Jpeg2KOpjDecoderBase(OPJ_CODEC_J2K)
  673|      1|{
  674|      1|    static const unsigned char J2KSignature[] = { 0xff, 0x4f, 0xff, 0x51 };
  675|      1|    m_signature = String((const char*) J2KSignature, sizeof(J2KSignature));
  676|      1|}
_ZN2cv16Jpeg2KOpjEncoderC2Ev:
  686|      1|{
  687|      1|    m_description = "JPEG-2000 files (*.jp2)";
  688|      1|}

_ZN2cv6detail15OpjMemoryBufferC2Ev:
   46|      2|    OpjMemoryBuffer() = default;

_ZN2cv10PAMDecoderC2Ev:
  360|      1|{
  361|      1|    m_offset = -1;
  362|      1|    m_buf_supported = true;
  363|      1|    bit_mode = false;
  364|      1|    selected_fmt = IMWRITE_PAM_FORMAT_NULL;
  365|      1|    m_maxval = 0;
  366|      1|    m_channels = 0;
  367|      1|    m_sampledepth = 0;
  368|      1|}
_ZN2cv10PAMDecoderD2Ev:
  372|      1|{
  373|      1|    m_strm.close();
  374|      1|}
_ZN2cv10PAMEncoderC2Ev:
  657|      1|{
  658|      1|    m_description = "Portable arbitrary format (*.pam)";
  659|      1|    m_buf_supported = true;
  660|      1|}
_ZN2cv10PAMEncoderD2Ev:
  664|      1|{
  665|      1|}

_ZN2cv10PFMDecoderD2Ev:
   79|      1|{
   80|      1|}
_ZN2cv10PFMDecoderC2Ev:
   82|      1|PFMDecoder::PFMDecoder() : m_scale_factor(0), m_swap_byte_order(false)
   83|      1|{
   84|      1|  m_buf_supported = true;
   85|      1|}
_ZN2cv10PFMEncoderC2Ev:
  175|      1|{
  176|      1|  m_description = "Portable image format - float (*.pfm)";
  177|      1|  m_buf_supported = true;
  178|      1|}
_ZN2cv10PFMEncoderD2Ev:
  181|      1|{
  182|      1|}

_ZN2cv9APNGFrameC2Ev:
  139|      3|{
  140|      3|    _pixels = NULL;
  141|      3|    _width = 0;
  142|      3|    _height = 0;
  143|      3|    _colorType = 0;
  144|      3|    _paletteSize = 0;
  145|      3|    _transparencySize = 0;
  146|      3|    _delayNum = 1;
  147|      3|    _delayDen = 1000;
  148|      3|}
_ZN2cv9APNGFrameD2Ev:
  150|      3|APNGFrame::~APNGFrame() {}
_ZN2cv10PngDecoderC2Ev:
  185|      1|{
  186|      1|    m_signature = "\x89\x50\x4e\x47\xd\xa\x1a\xa";
  187|      1|    m_color_type = 0;
  188|      1|    m_f = 0;
  189|      1|    m_buf_supported = true;
  190|      1|    m_buf_pos = 0;
  191|      1|    m_bit_depth = 0;
  192|      1|    m_frame_no = 0;
  193|      1|    w0 = 0;
  194|      1|    h0 = 0;
  195|      1|    x0 = 0;
  196|      1|    y0 = 0;
  197|      1|    delay_num = 0;
  198|      1|    delay_den = 0;
  199|      1|    dop = 0;
  200|      1|    bop = 0;
  201|      1|}
_ZN2cv10PngDecoderD2Ev:
  204|      1|{
  205|      1|    ClearPngPtr();
  206|      1|    if( m_f )
  ------------------
  |  Branch (206:9): [True: 0, False: 1]
  ------------------
  207|      0|    {
  208|      0|        fclose( m_f );
  209|      0|        m_f = nullptr;
  210|      0|    }
  211|      1|}
_ZN2cv10PngDecoder11ClearPngPtrEv:
  225|      1|void PngDecoder::ClearPngPtr() {
  226|      1|    if (m_png_ptr)
  ------------------
  |  Branch (226:9): [True: 0, False: 1]
  ------------------
  227|      0|        png_destroy_read_struct(&m_png_ptr, &m_info_ptr, &m_end_info);
  228|      1|    m_png_ptr = nullptr;
  229|      1|    m_info_ptr = nullptr;
  230|      1|    m_end_info = nullptr;
  231|      1|}
_ZN2cv10PngEncoderC2Ev:
  854|      1|{
  855|      1|    m_description = "Portable Network Graphics files (*.png)";
  856|      1|    m_buf_supported = true;
  857|      1|    op_zstream1.zalloc = NULL;
  858|      1|    op_zstream2.zalloc = NULL;
  859|      1|    next_seq_num = 0;
  860|      1|    trnssize = 0;
  861|      1|    palsize = 0;
  862|      1|    m_compression_level = Z_BEST_SPEED;
  ------------------
  |  |  191|      1|#define Z_BEST_SPEED             1
  ------------------
  863|      1|    m_compression_strategy = IMWRITE_PNG_STRATEGY_RLE; // Default strategy
  864|      1|    m_filter = IMWRITE_PNG_FILTER_SUB; // Default filter
  865|      1|    m_isBilevel = false;
  866|      1|    memset(palette, 0, sizeof(palette));
  867|      1|    memset(trns, 0, sizeof(trns));
  868|      1|    memset(op, 0, sizeof(op));
  869|      1|}
_ZN2cv10PngEncoderD2Ev:
  872|      1|{
  873|      1|}

_ZN2cv10PxMDecoderC2Ev:
  104|      1|{
  105|      1|    m_offset = -1;
  106|      1|    m_buf_supported = true;
  107|      1|    m_bpp = 0;
  108|      1|    m_binary = false;
  109|      1|    m_maxval = 0;
  110|      1|}
_ZN2cv10PxMDecoderD2Ev:
  114|      1|{
  115|      1|    close();
  116|      1|}
_ZN2cv10PxMDecoder5closeEv:
  136|      1|{
  137|      1|    m_strm.close();
  138|      1|}
_ZN2cv10PxMEncoderC2ENS_7PxMModeE:
  380|      4|    mode_(mode)
  381|      4|{
  382|      4|    switch (mode)
  383|      4|    {
  384|      1|    case PXM_TYPE_AUTO: m_description = "Portable image format - auto (*.pnm)"; break;
  ------------------
  |  Branch (384:5): [True: 1, False: 3]
  ------------------
  385|      1|    case PXM_TYPE_PBM: m_description = "Portable image format - monochrome (*.pbm)"; break;
  ------------------
  |  Branch (385:5): [True: 1, False: 3]
  ------------------
  386|      1|    case PXM_TYPE_PGM: m_description = "Portable image format - gray (*.pgm)"; break;
  ------------------
  |  Branch (386:5): [True: 1, False: 3]
  ------------------
  387|      1|    case PXM_TYPE_PPM: m_description = "Portable image format - color (*.ppm)"; break;
  ------------------
  |  Branch (387:5): [True: 1, False: 3]
  ------------------
  388|      0|    default:
  ------------------
  |  Branch (388:5): [True: 0, False: 4]
  ------------------
  389|      0|        CV_Error(Error::StsInternal, "");
  ------------------
  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  ------------------
  390|      4|    }
  391|      4|    m_buf_supported = true;
  392|      4|}
_ZN2cv10PxMEncoderD2Ev:
  395|      4|{
  396|      4|}

_ZN2cv16SunRasterDecoderC2Ev:
   18|      1|{
   19|      1|    m_offset = -1;
   20|      1|    m_signature = fmtSignSunRas;
   21|      1|    m_bpp = 0;
   22|      1|    m_encoding = RAS_STANDARD;
   23|      1|    m_maptype = RMT_NONE;
   24|      1|    m_maplength = 0;
   25|      1|    m_buf_supported = true;
   26|      1|}
_ZN2cv16SunRasterDecoderD2Ev:
   30|      1|{
   31|      1|}
_ZN2cv16SunRasterEncoderC2Ev:
  358|      1|{
  359|      1|    m_description = "Sun raster files (*.sr;*.ras)";
  360|      1|    m_buf_supported = true;
  361|      1|}
_ZN2cv16SunRasterEncoderD2Ev:
  370|      1|{
  371|      1|}

_ZN2cv11TiffDecoderC2Ev:
  113|      1|{
  114|      1|    m_hdr = false;
  115|      1|    m_buf_supported = true;
  116|      1|    m_buf_pos = 0;
  117|      1|}
_ZN2cv11TiffDecoder5closeEv:
  121|      1|{
  122|      1|    m_tif.release();
  123|      1|}
_ZN2cv11TiffDecoderD2Ev:
  126|      1|{
  127|      1|    close();
  128|      1|}
_ZN2cv11TiffEncoderC2Ev:
 1083|    781|{
 1084|    781|    m_description = "TIFF Files (*.tiff;*.tif)";
 1085|    781|    m_buf_supported = true;
 1086|    781|}
_ZN2cv11TiffEncoderD2Ev:
 1089|    781|{
 1090|    781|}
_ZNK2cv11TiffEncoder10newEncoderEv:
 1093|    780|{
 1094|    780|    cv_tiffSetErrorHandler();
 1095|    780|    return makePtr<TiffEncoder>();
 1096|    780|}
_ZNK2cv11TiffEncoder17isFormatSupportedEi:
 1099|    780|{
 1100|    780|    return depth == CV_8U || depth == CV_8S || depth == CV_16U || depth == CV_16S || depth == CV_32S || depth == CV_32F || depth == CV_64F;
  ------------------
  |  |   73|  1.56k|#define CV_8U   0
  ------------------
                  return depth == CV_8U || depth == CV_8S || depth == CV_16U || depth == CV_16S || depth == CV_32S || depth == CV_32F || depth == CV_64F;
  ------------------
  |  |   74|    780|#define CV_8S   1
  ------------------
                  return depth == CV_8U || depth == CV_8S || depth == CV_16U || depth == CV_16S || depth == CV_32S || depth == CV_32F || depth == CV_64F;
  ------------------
  |  |   75|    780|#define CV_16U  2
  ------------------
                  return depth == CV_8U || depth == CV_8S || depth == CV_16U || depth == CV_16S || depth == CV_32S || depth == CV_32F || depth == CV_64F;
  ------------------
  |  |   76|    780|#define CV_16S  3
  ------------------
                  return depth == CV_8U || depth == CV_8S || depth == CV_16U || depth == CV_16S || depth == CV_32S || depth == CV_32F || depth == CV_64F;
  ------------------
  |  |   77|    780|#define CV_32S  4
  ------------------
                  return depth == CV_8U || depth == CV_8S || depth == CV_16U || depth == CV_16S || depth == CV_32S || depth == CV_32F || depth == CV_64F;
  ------------------
  |  |   78|    780|#define CV_32F  5
  ------------------
                  return depth == CV_8U || depth == CV_8S || depth == CV_16U || depth == CV_16S || depth == CV_32S || depth == CV_32F || depth == CV_64F;
  ------------------
  |  |   79|      0|#define CV_64F  6
  ------------------
  |  Branch (1100:12): [True: 780, False: 0]
  |  Branch (1100:30): [True: 0, False: 0]
  |  Branch (1100:48): [True: 0, False: 0]
  |  Branch (1100:67): [True: 0, False: 0]
  |  Branch (1100:86): [True: 0, False: 0]
  |  Branch (1100:105): [True: 0, False: 0]
  |  Branch (1100:124): [True: 0, False: 0]
  ------------------
 1101|    780|}
_ZN2cv11TiffEncoder12writeLibTiffERKNSt3__16vectorINS_3MatENS1_9allocatorIS3_EEEERKNS2_IiNS4_IiEEEE:
 1200|    780|{
 1201|       |    // do NOT put "wb" as the mode, because the b means "big endian" mode, not "binary" mode.
 1202|       |    // http://www.simplesystems.org/libtiff/functions/TIFFOpen.html
 1203|    780|    TIFF* tif = NULL;
 1204|       |
 1205|    780|    TiffEncoderBufHelper buf_helper(m_buf);
 1206|    780|    if ( m_buf )
  ------------------
  |  Branch (1206:10): [True: 780, False: 0]
  ------------------
 1207|    780|    {
 1208|    780|        tif = buf_helper.open();
 1209|    780|    }
 1210|      0|    else
 1211|      0|    {
 1212|      0|        tif = TIFFOpen(m_filename.c_str(), "w");
 1213|      0|    }
 1214|    780|    if (!tif)
  ------------------
  |  Branch (1214:9): [True: 0, False: 780]
  ------------------
 1215|      0|    {
 1216|      0|        return false;
 1217|      0|    }
 1218|    780|    cv::Ptr<void> tif_cleanup(tif, cv_tiffCloseHandle);
 1219|       |
 1220|       |    //Settings that matter to all images
 1221|    780|    int compression = COMPRESSION_LZW;
  ------------------
  |  |  188|    780|#define COMPRESSION_LZW 5             /* Lempel-Ziv  & Welch */
  ------------------
 1222|    780|    int predictor = PREDICTOR_HORIZONTAL;
  ------------------
  |  |  304|    780|#define PREDICTOR_HORIZONTAL 2             /* horizontal differencing */
  ------------------
 1223|    780|    int resUnit = -1, dpiX = -1, dpiY = -1;
 1224|       |
 1225|    780|    readParam(params, IMWRITE_TIFF_COMPRESSION, compression);
 1226|    780|    readParam(params, IMWRITE_TIFF_PREDICTOR, predictor);
 1227|    780|    readParam(params, IMWRITE_TIFF_RESUNIT, resUnit);
 1228|    780|    readParam(params, IMWRITE_TIFF_XDPI, dpiX);
 1229|    780|    readParam(params, IMWRITE_TIFF_YDPI, dpiY);
 1230|       |
 1231|       |    //Iterate through each image in the vector and write them out as Tiff directories
 1232|  1.56k|    for (size_t page = 0; page < img_vec.size(); page++)
  ------------------
  |  Branch (1232:27): [True: 780, False: 780]
  ------------------
 1233|    780|    {
 1234|    780|        const Mat& img = img_vec[page];
 1235|    780|        CV_Assert(!img.empty());
  ------------------
  |  |  423|    780|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:35): [True: 780, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1236|    780|        int channels = img.channels();
 1237|    780|        int width = img.cols, height = img.rows;
 1238|    780|        int type = img.type();
 1239|    780|        int depth = CV_MAT_DEPTH(type);
  ------------------
  |  |   83|    780|#define CV_MAT_DEPTH(flags)     ((flags) & CV_MAT_DEPTH_MASK)
  |  |  ------------------
  |  |  |  |   82|    780|#define CV_MAT_DEPTH_MASK       (CV_DEPTH_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|    780|#define CV_DEPTH_MAX  (1 << CV_CN_SHIFT)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1240|    780|        CV_CheckType(type, depth == CV_8U || depth == CV_8S || depth == CV_16U || depth == CV_16S || depth == CV_32S || depth == CV_32F || depth == CV_64F, "");
  ------------------
  |  |  133|    780|#define CV_CheckType(t, test_expr, msg)  CV__CHECK_CUSTOM_TEST(_, MatType, t, (test_expr), #t, #test_expr, msg)
  |  |  ------------------
  |  |  |  |  106|    780|#define CV__CHECK_CUSTOM_TEST(id, type, v, test_expr, v_str, test_expr_str, msg_str) do { \
  |  |  |  |  107|  4.68k|    if(!!(test_expr)) ; else { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (107:11): [True: 780, False: 0]
  |  |  |  |  |  Branch (107:11): [True: 0, False: 0]
  |  |  |  |  |  Branch (107:11): [True: 0, False: 0]
  |  |  |  |  |  Branch (107:11): [True: 0, False: 0]
  |  |  |  |  |  Branch (107:11): [True: 0, False: 0]
  |  |  |  |  |  Branch (107:11): [True: 0, False: 0]
  |  |  |  |  |  Branch (107:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  108|      0|        CV__DEFINE_CHECK_CONTEXT(id, msg_str, cv::detail::TEST_CUSTOM, v_str, test_expr_str); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|    static const cv::detail::CheckContext CV__CHECK_LOCATION_VARNAME(id) = \
  |  |  |  |  |  |   66|      0|            { CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|      0|#   define CV__CHECK_FUNCTION __PRETTY_FUNCTION__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                           { CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|      0|# define CV__CHECK_FILENAME __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  109|      0|        cv::detail::check_failed_ ## type((v), CV__CHECK_LOCATION_VARNAME(id)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|      0|#define CV__CHECK_LOCATION_VARNAME(id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_check_, id), __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  114|      0|#define CVAUX_CONCAT_EXP(a, b) a##b
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  110|      0|    } \
  |  |  |  |  111|    780|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (111:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1241|    780|        CV_CheckType(type, channels >= 1 && channels <= 4, "");
  ------------------
  |  |  133|    780|#define CV_CheckType(t, test_expr, msg)  CV__CHECK_CUSTOM_TEST(_, MatType, t, (test_expr), #t, #test_expr, msg)
  |  |  ------------------
  |  |  |  |  106|    780|#define CV__CHECK_CUSTOM_TEST(id, type, v, test_expr, v_str, test_expr_str, msg_str) do { \
  |  |  |  |  107|  1.56k|    if(!!(test_expr)) ; else { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (107:11): [True: 780, False: 0]
  |  |  |  |  |  Branch (107:11): [True: 780, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  108|      0|        CV__DEFINE_CHECK_CONTEXT(id, msg_str, cv::detail::TEST_CUSTOM, v_str, test_expr_str); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|    static const cv::detail::CheckContext CV__CHECK_LOCATION_VARNAME(id) = \
  |  |  |  |  |  |   66|      0|            { CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|      0|#   define CV__CHECK_FUNCTION __PRETTY_FUNCTION__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                           { CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|      0|# define CV__CHECK_FILENAME __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  109|      0|        cv::detail::check_failed_ ## type((v), CV__CHECK_LOCATION_VARNAME(id)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|      0|#define CV__CHECK_LOCATION_VARNAME(id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_check_, id), __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  114|      0|#define CVAUX_CONCAT_EXP(a, b) a##b
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  110|      0|    } \
  |  |  |  |  111|    780|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (111:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1242|       |
 1243|    780|        CV_TIFF_CHECK_CALL(TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, width));
  ------------------
  |  |   66|    780|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 780]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1244|    780|        CV_TIFF_CHECK_CALL(TIFFSetField(tif, TIFFTAG_IMAGELENGTH, height));
  ------------------
  |  |   66|    780|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 780]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1245|       |
 1246|    780|        if (img_vec.size() > 1)
  ------------------
  |  Branch (1246:13): [True: 0, False: 780]
  ------------------
 1247|      0|        {
 1248|      0|            CV_TIFF_CHECK_CALL(TIFFSetField(tif, TIFFTAG_SUBFILETYPE, FILETYPE_PAGE));
  ------------------
  |  |   66|      0|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1249|      0|            CV_TIFF_CHECK_CALL(TIFFSetField(tif, TIFFTAG_PAGENUMBER, page, img_vec.size()));
  ------------------
  |  |   66|      0|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1250|      0|        }
 1251|       |
 1252|    780|        int compression_param = -1;  // OPENCV_FUTURE
 1253|    780|        if (type == CV_32FC3 && (!readParam(params, IMWRITE_TIFF_COMPRESSION, compression_param) || compression_param == COMPRESSION_SGILOG))
  ------------------
  |  |  120|    780|#define CV_32FC3 CV_MAKETYPE(CV_32F,3)
  |  |  ------------------
  |  |  |  |   85|  1.56k|#define CV_MAKETYPE(depth,cn) (CV_MAT_DEPTH(depth) + (((cn)-1) << CV_CN_SHIFT))
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    780|#define CV_MAT_DEPTH(flags)     ((flags) & CV_MAT_DEPTH_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   82|    780|#define CV_MAT_DEPTH_MASK       (CV_DEPTH_MAX - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   71|    780|#define CV_DEPTH_MAX  (1 << CV_CN_SHIFT)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define CV_MAKETYPE(depth,cn) (CV_MAT_DEPTH(depth) + (((cn)-1) << CV_CN_SHIFT))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (type == CV_32FC3 && (!readParam(params, IMWRITE_TIFF_COMPRESSION, compression_param) || compression_param == COMPRESSION_SGILOG))
  ------------------
  |  |  210|      0|#define COMPRESSION_SGILOG 34676   /* SGI Log Luminance RLE */
  ------------------
  |  Branch (1253:13): [True: 0, False: 780]
  |  Branch (1253:34): [True: 0, False: 0]
  |  Branch (1253:101): [True: 0, False: 0]
  ------------------
 1254|      0|        {
 1255|      0|            if (!write_32FC3_SGILOG(img, tif))
  ------------------
  |  Branch (1255:17): [True: 0, False: 0]
  ------------------
 1256|      0|                return false;
 1257|      0|            continue;
 1258|      0|        }
 1259|       |
 1260|    780|        int page_compression = compression;
 1261|       |
 1262|    780|        int bitsPerChannel = -1;
 1263|    780|        uint16_t sample_format = SAMPLEFORMAT_INT;
  ------------------
  |  |  334|    780|#define SAMPLEFORMAT_INT 2                 /* !signed integer data */
  ------------------
 1264|    780|        switch (depth)
 1265|    780|        {
 1266|    780|            case CV_8U:
  ------------------
  |  |   73|    780|#define CV_8U   0
  ------------------
  |  Branch (1266:13): [True: 780, False: 0]
  ------------------
 1267|    780|                sample_format = SAMPLEFORMAT_UINT;
  ------------------
  |  |  333|    780|#define SAMPLEFORMAT_UINT 1                /* !unsigned integer data */
  ------------------
 1268|       |                /* FALLTHRU */
 1269|    780|            case CV_8S:
  ------------------
  |  |   74|    780|#define CV_8S   1
  ------------------
  |  Branch (1269:13): [True: 0, False: 780]
  ------------------
 1270|    780|            {
 1271|    780|                bitsPerChannel = 8;
 1272|    780|                break;
 1273|    780|            }
 1274|       |
 1275|      0|            case CV_16U:
  ------------------
  |  |   75|      0|#define CV_16U  2
  ------------------
  |  Branch (1275:13): [True: 0, False: 780]
  ------------------
 1276|      0|                sample_format = SAMPLEFORMAT_UINT;
  ------------------
  |  |  333|      0|#define SAMPLEFORMAT_UINT 1                /* !unsigned integer data */
  ------------------
 1277|       |                /* FALLTHRU */
 1278|      0|            case CV_16S:
  ------------------
  |  |   76|      0|#define CV_16S  3
  ------------------
  |  Branch (1278:13): [True: 0, False: 780]
  ------------------
 1279|      0|            {
 1280|      0|                bitsPerChannel = 16;
 1281|      0|                break;
 1282|      0|            }
 1283|       |
 1284|      0|            case CV_32S:
  ------------------
  |  |   77|      0|#define CV_32S  4
  ------------------
  |  Branch (1284:13): [True: 0, False: 780]
  ------------------
 1285|      0|            {
 1286|      0|                bitsPerChannel = 32;
 1287|      0|                sample_format = SAMPLEFORMAT_INT;
  ------------------
  |  |  334|      0|#define SAMPLEFORMAT_INT 2                 /* !signed integer data */
  ------------------
 1288|      0|                break;
 1289|      0|            }
 1290|      0|            case CV_32F:
  ------------------
  |  |   78|      0|#define CV_32F  5
  ------------------
  |  Branch (1290:13): [True: 0, False: 780]
  ------------------
 1291|      0|            {
 1292|      0|                bitsPerChannel = 32;
 1293|      0|                page_compression = COMPRESSION_NONE;
  ------------------
  |  |  182|      0|#define COMPRESSION_NONE 1            /* dump mode */
  ------------------
 1294|      0|                sample_format = SAMPLEFORMAT_IEEEFP;
  ------------------
  |  |  335|      0|#define SAMPLEFORMAT_IEEEFP 3              /* !IEEE floating point data */
  ------------------
 1295|      0|                break;
 1296|      0|            }
 1297|      0|            case CV_64F:
  ------------------
  |  |   79|      0|#define CV_64F  6
  ------------------
  |  Branch (1297:13): [True: 0, False: 780]
  ------------------
 1298|      0|            {
 1299|      0|                bitsPerChannel = 64;
 1300|      0|                page_compression = COMPRESSION_NONE;
  ------------------
  |  |  182|      0|#define COMPRESSION_NONE 1            /* dump mode */
  ------------------
 1301|      0|                sample_format = SAMPLEFORMAT_IEEEFP;
  ------------------
  |  |  335|      0|#define SAMPLEFORMAT_IEEEFP 3              /* !IEEE floating point data */
  ------------------
 1302|      0|                break;
 1303|      0|            }
 1304|      0|            default:
  ------------------
  |  Branch (1304:13): [True: 0, False: 780]
  ------------------
 1305|      0|            {
 1306|      0|                return false;
 1307|      0|            }
 1308|    780|        }
 1309|       |
 1310|    780|        const int bitsPerByte = 8;
 1311|    780|        size_t fileStep = (width * channels * bitsPerChannel) / bitsPerByte;
 1312|    780|        CV_Assert(fileStep > 0);
  ------------------
  |  |  423|    780|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:35): [True: 780, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1313|       |
 1314|    780|        int rowsPerStrip = (int)((1 << 13) / fileStep);
 1315|    780|        readParam(params, IMWRITE_TIFF_ROWSPERSTRIP, rowsPerStrip);
 1316|    780|        rowsPerStrip = std::max(1, std::min(height, rowsPerStrip));
 1317|       |
 1318|    780|        int colorspace = channels > 1 ? PHOTOMETRIC_RGB : PHOTOMETRIC_MINISBLACK;
  ------------------
  |  |  222|      0|#define PHOTOMETRIC_RGB 2                  /* RGB color model */
  ------------------
                      int colorspace = channels > 1 ? PHOTOMETRIC_RGB : PHOTOMETRIC_MINISBLACK;
  ------------------
  |  |  221|    780|#define PHOTOMETRIC_MINISBLACK 1           /* min value is black */
  ------------------
  |  Branch (1318:26): [True: 0, False: 780]
  ------------------
 1319|       |
 1320|    780|        CV_TIFF_CHECK_CALL(TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bitsPerChannel));
  ------------------
  |  |   66|    780|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 780]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1321|    780|        CV_TIFF_CHECK_CALL(TIFFSetField(tif, TIFFTAG_COMPRESSION, page_compression));
  ------------------
  |  |   66|    780|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 780]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1322|    780|        CV_TIFF_CHECK_CALL(TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, colorspace));
  ------------------
  |  |   66|    780|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 780]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1323|    780|        CV_TIFF_CHECK_CALL(TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, channels));
  ------------------
  |  |   66|    780|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 780]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1324|    780|        CV_TIFF_CHECK_CALL(TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG));
  ------------------
  |  |   66|    780|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 780]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1325|    780|        CV_TIFF_CHECK_CALL(TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsPerStrip));
  ------------------
  |  |   66|    780|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 780]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1326|       |
 1327|    780|        CV_TIFF_CHECK_CALL(TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, sample_format));
  ------------------
  |  |   66|    780|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 780]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1328|       |
 1329|    780|        if (page_compression == COMPRESSION_LZW || page_compression == COMPRESSION_ADOBE_DEFLATE || page_compression == COMPRESSION_DEFLATE)
  ------------------
  |  |  188|  1.56k|#define COMPRESSION_LZW 5             /* Lempel-Ziv  & Welch */
  ------------------
                      if (page_compression == COMPRESSION_LZW || page_compression == COMPRESSION_ADOBE_DEFLATE || page_compression == COMPRESSION_DEFLATE)
  ------------------
  |  |  206|    780|#define COMPRESSION_ADOBE_DEFLATE 8 /* Deflate compression, as recognized by Adobe */
  ------------------
                      if (page_compression == COMPRESSION_LZW || page_compression == COMPRESSION_ADOBE_DEFLATE || page_compression == COMPRESSION_DEFLATE)
  ------------------
  |  |  205|      0|#define COMPRESSION_DEFLATE 32946   /* Deflate compression, legacy tag */
  ------------------
  |  Branch (1329:13): [True: 780, False: 0]
  |  Branch (1329:52): [True: 0, False: 0]
  |  Branch (1329:101): [True: 0, False: 0]
  ------------------
 1330|    780|        {
 1331|    780|            CV_TIFF_CHECK_CALL(TIFFSetField(tif, TIFFTAG_PREDICTOR, predictor));
  ------------------
  |  |   66|    780|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 780]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1332|    780|        }
 1333|       |
 1334|    780|        if (resUnit >= RESUNIT_NONE && resUnit <= RESUNIT_CENTIMETER)
  ------------------
  |  |  287|  1.56k|#define RESUNIT_NONE 1                     /* no meaningful units */
  ------------------
                      if (resUnit >= RESUNIT_NONE && resUnit <= RESUNIT_CENTIMETER)
  ------------------
  |  |  289|      0|#define RESUNIT_CENTIMETER 3               /* metric */
  ------------------
  |  Branch (1334:13): [True: 0, False: 780]
  |  Branch (1334:40): [True: 0, False: 0]
  ------------------
 1335|      0|        {
 1336|      0|            CV_TIFF_CHECK_CALL(TIFFSetField(tif, TIFFTAG_RESOLUTIONUNIT, resUnit));
  ------------------
  |  |   66|      0|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1337|      0|        }
 1338|    780|        if (dpiX >= 0)
  ------------------
  |  Branch (1338:13): [True: 0, False: 780]
  ------------------
 1339|      0|        {
 1340|      0|            CV_TIFF_CHECK_CALL(TIFFSetField(tif, TIFFTAG_XRESOLUTION, (float)dpiX));
  ------------------
  |  |   66|      0|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1341|      0|        }
 1342|    780|        if (dpiY >= 0)
  ------------------
  |  Branch (1342:13): [True: 0, False: 780]
  ------------------
 1343|      0|        {
 1344|      0|            CV_TIFF_CHECK_CALL(TIFFSetField(tif, TIFFTAG_YRESOLUTION, (float)dpiY));
  ------------------
  |  |   66|      0|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1345|      0|        }
 1346|       |
 1347|       |        // row buffer, because TIFFWriteScanline modifies the original data!
 1348|    780|        size_t scanlineSize = TIFFScanlineSize(tif);
 1349|    780|        AutoBuffer<uchar> _buffer(scanlineSize + 32);
 1350|    780|        uchar* buffer = _buffer.data(); CV_DbgAssert(buffer);
 1351|    780|        Mat m_buffer(Size(width, 1), CV_MAKETYPE(depth, channels), buffer, (size_t)scanlineSize);
  ------------------
  |  |   85|    780|#define CV_MAKETYPE(depth,cn) (CV_MAT_DEPTH(depth) + (((cn)-1) << CV_CN_SHIFT))
  |  |  ------------------
  |  |  |  |   83|    780|#define CV_MAT_DEPTH(flags)     ((flags) & CV_MAT_DEPTH_MASK)
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|    780|#define CV_MAT_DEPTH_MASK       (CV_DEPTH_MAX - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|    780|#define CV_DEPTH_MAX  (1 << CV_CN_SHIFT)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define CV_MAKETYPE(depth,cn) (CV_MAT_DEPTH(depth) + (((cn)-1) << CV_CN_SHIFT))
  |  |  ------------------
  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  ------------------
  ------------------
 1352|       |
 1353|  1.56k|        for (int y = 0; y < height; ++y)
  ------------------
  |  Branch (1353:25): [True: 780, False: 780]
  ------------------
 1354|    780|        {
 1355|    780|            switch (channels)
 1356|    780|            {
 1357|    780|                case 1:
  ------------------
  |  Branch (1357:17): [True: 780, False: 0]
  ------------------
 1358|    780|                {
 1359|    780|                    std::memcpy(buffer, img.ptr(y), scanlineSize);
 1360|    780|                    break;
 1361|      0|                }
 1362|       |
 1363|      0|                case 3:
  ------------------
  |  Branch (1363:17): [True: 0, False: 780]
  ------------------
 1364|      0|                {
 1365|      0|                    extend_cvtColor(img(Rect(0, y, width, 1)), (const Mat&)m_buffer, COLOR_BGR2RGB);
 1366|      0|                    break;
 1367|      0|                }
 1368|       |
 1369|      0|                case 4:
  ------------------
  |  Branch (1369:17): [True: 0, False: 780]
  ------------------
 1370|      0|                {
 1371|      0|                    extend_cvtColor(img(Rect(0, y, width, 1)), (const Mat&)m_buffer, COLOR_BGRA2RGBA);
 1372|      0|                    break;
 1373|      0|                }
 1374|       |
 1375|      0|                default:
  ------------------
  |  Branch (1375:17): [True: 0, False: 780]
  ------------------
 1376|      0|                {
 1377|      0|                    CV_Assert(0);
  ------------------
  |  |  423|      0|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:35): [Folded - Ignored]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1378|      0|                }
 1379|    780|            }
 1380|       |
 1381|    780|            CV_TIFF_CHECK_CALL(TIFFWriteScanline(tif, buffer, y, 0) == 1);
  ------------------
  |  |   66|    780|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 780]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1382|    780|        }
 1383|       |
 1384|    780|        CV_TIFF_CHECK_CALL(TIFFWriteDirectory(tif));
  ------------------
  |  |   66|    780|    if (0 == (call)) { \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 0, False: 780]
  |  |  ------------------
  |  |   67|      0|        CV_LOG_WARNING(NULL, "OpenCV TIFF(line " << __LINE__ << "): failed " #call); \
  |  |  ------------------
  |  |  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  |  |  164|      0|        break; \
  |  |  |  |  |  |  165|      0|    }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        CV_Error(Error::StsError, "OpenCV TIFF: failed " #call); \
  |  |  ------------------
  |  |  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      0|    }
  ------------------
 1385|    780|    }
 1386|       |
 1387|    780|    return true;
 1388|    780|}
_ZN2cv11TiffEncoder5writeERKNS_3MatERKNSt3__16vectorIiNS4_9allocatorIiEEEE:
 1422|    780|{
 1423|    780|    int type = img.type();
 1424|    780|    int depth = CV_MAT_DEPTH(type);
  ------------------
  |  |   83|    780|#define CV_MAT_DEPTH(flags)     ((flags) & CV_MAT_DEPTH_MASK)
  |  |  ------------------
  |  |  |  |   82|    780|#define CV_MAT_DEPTH_MASK       (CV_DEPTH_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|    780|#define CV_DEPTH_MAX  (1 << CV_CN_SHIFT)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    780|#define CV_CN_SHIFT   3
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1425|       |
 1426|    780|    CV_CheckType(type, depth == CV_8U || depth == CV_8S || depth == CV_16U || depth == CV_16S || depth == CV_32S || depth == CV_32F || depth == CV_64F, "");
  ------------------
  |  |  133|    780|#define CV_CheckType(t, test_expr, msg)  CV__CHECK_CUSTOM_TEST(_, MatType, t, (test_expr), #t, #test_expr, msg)
  |  |  ------------------
  |  |  |  |  106|    780|#define CV__CHECK_CUSTOM_TEST(id, type, v, test_expr, v_str, test_expr_str, msg_str) do { \
  |  |  |  |  107|  4.68k|    if(!!(test_expr)) ; else { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (107:11): [True: 780, False: 0]
  |  |  |  |  |  Branch (107:11): [True: 0, False: 0]
  |  |  |  |  |  Branch (107:11): [True: 0, False: 0]
  |  |  |  |  |  Branch (107:11): [True: 0, False: 0]
  |  |  |  |  |  Branch (107:11): [True: 0, False: 0]
  |  |  |  |  |  Branch (107:11): [True: 0, False: 0]
  |  |  |  |  |  Branch (107:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  108|      0|        CV__DEFINE_CHECK_CONTEXT(id, msg_str, cv::detail::TEST_CUSTOM, v_str, test_expr_str); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|    static const cv::detail::CheckContext CV__CHECK_LOCATION_VARNAME(id) = \
  |  |  |  |  |  |   66|      0|            { CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|      0|#   define CV__CHECK_FUNCTION __PRETTY_FUNCTION__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                           { CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|      0|# define CV__CHECK_FILENAME __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  109|      0|        cv::detail::check_failed_ ## type((v), CV__CHECK_LOCATION_VARNAME(id)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|      0|#define CV__CHECK_LOCATION_VARNAME(id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_check_, id), __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  114|      0|#define CVAUX_CONCAT_EXP(a, b) a##b
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  110|      0|    } \
  |  |  |  |  111|    780|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (111:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1427|       |
 1428|    780|    std::vector<Mat> img_vec;
 1429|    780|    img_vec.push_back(img);
 1430|    780|    return writeLibTiff(img_vec, params);
 1431|    780|}
grfmt_tiff.cpp:_ZN2cvL22cv_tiffSetErrorHandlerEv:
  102|    780|{
  103|    780|    static bool v = cv_tiffSetErrorHandler_();
  104|    780|    return v;
  105|    780|}
grfmt_tiff.cpp:_ZN2cvL23cv_tiffSetErrorHandler_Ev:
   95|      1|{
   96|      1|    TIFFSetErrorHandler(cv_tiffErrorHandler);
   97|      1|    TIFFSetWarningHandler(cv_tiffErrorHandler);
   98|      1|    return true;
   99|      1|}
grfmt_tiff.cpp:_ZN2cvL18cv_tiffCloseHandleEPv:
   77|    780|{
   78|    780|    TIFFClose((TIFF*)handle);
   79|    780|}
_ZN2cv20TiffEncoderBufHelperC2EPNSt3__16vectorIhNS1_9allocatorIhEEEE:
 1108|    780|            : m_buf(buf), m_buf_pos(0)
 1109|    780|    {}
_ZN2cv20TiffEncoderBufHelper4openEv:
 1112|    780|    {
 1113|       |        // do NOT put "wb" as the mode, because the b means "big endian" mode, not "binary" mode.
 1114|       |        // http://www.simplesystems.org/libtiff/functions/TIFFOpen.html
 1115|    780|        return TIFFClientOpen( "", "w", reinterpret_cast<thandle_t>(this), &TiffEncoderBufHelper::read,
 1116|    780|                               &TiffEncoderBufHelper::write, &TiffEncoderBufHelper::seek,
 1117|    780|                               &TiffEncoderBufHelper::close, &TiffEncoderBufHelper::size,
 1118|    780|                               /*map=*/0, /*unmap=*/0 );
 1119|    780|    }
_ZN2cv20TiffEncoderBufHelper5writeEPvS1_l:
 1134|  3.32k|    {
 1135|  3.32k|        TiffEncoderBufHelper *helper = reinterpret_cast<TiffEncoderBufHelper*>(handle);
 1136|  3.32k|        size_t begin = (size_t)helper->m_buf_pos;
 1137|  3.32k|        size_t end = begin + n;
 1138|  3.32k|        if ( helper->m_buf->size() < end )
  ------------------
  |  Branch (1138:14): [True: 2.54k, False: 780]
  ------------------
 1139|  2.54k|        {
 1140|  2.54k|            helper->m_buf->resize(end);
 1141|  2.54k|        }
 1142|  3.32k|        std::memcpy(&(*helper->m_buf)[begin], buffer, n);
 1143|  3.32k|        helper->m_buf_pos = end;
 1144|  3.32k|        return n;
 1145|  3.32k|    }
_ZN2cv20TiffEncoderBufHelper4seekEPvmi:
 1148|  3.90k|    {
 1149|  3.90k|        TiffEncoderBufHelper *helper = reinterpret_cast<TiffEncoderBufHelper*>(handle);
 1150|  3.90k|        const toff_t size = helper->m_buf->size();
 1151|  3.90k|        toff_t new_pos = helper->m_buf_pos;
 1152|  3.90k|        switch (whence)
  ------------------
  |  Branch (1152:17): [True: 0, False: 3.90k]
  ------------------
 1153|  3.90k|        {
 1154|  2.34k|            case SEEK_SET:
  ------------------
  |  Branch (1154:13): [True: 2.34k, False: 1.56k]
  ------------------
 1155|  2.34k|                new_pos = offset;
 1156|  2.34k|                break;
 1157|      0|            case SEEK_CUR:
  ------------------
  |  Branch (1157:13): [True: 0, False: 3.90k]
  ------------------
 1158|      0|                new_pos += offset;
 1159|      0|                break;
 1160|  1.56k|            case SEEK_END:
  ------------------
  |  Branch (1160:13): [True: 1.56k, False: 2.34k]
  ------------------
 1161|  1.56k|                new_pos = size + offset;
 1162|  1.56k|                break;
 1163|  3.90k|        }
 1164|  3.90k|        helper->m_buf_pos = new_pos;
 1165|  3.90k|        return new_pos;
 1166|  3.90k|    }
_ZN2cv20TiffEncoderBufHelper5closeEPv:
 1175|    780|    {
 1176|       |        // Do nothing.
 1177|    780|        return 0;
 1178|    780|    }
grfmt_tiff.cpp:_ZN2cvL9readParamERKNSt3__16vectorIiNS0_9allocatorIiEEEEiRi:
 1187|  4.68k|{
 1188|  4.68k|    for (size_t i = 0; i + 1 < params.size(); i += 2)
  ------------------
  |  Branch (1188:24): [True: 0, False: 4.68k]
  ------------------
 1189|      0|    {
 1190|      0|        if (params[i] == key)
  ------------------
  |  Branch (1190:13): [True: 0, False: 0]
  ------------------
 1191|      0|        {
 1192|      0|            value = params[i + 1];
 1193|      0|            return true;
 1194|      0|        }
 1195|      0|    }
 1196|  4.68k|    return false;
 1197|  4.68k|}

_ZN2cv11WebPDecoderC2Ev:
   66|      1|{
   67|      1|    m_buf_supported = true;
   68|      1|    fs_size = 0;
   69|      1|    m_has_animation = false;
   70|      1|    m_previous_timestamp = 0;
   71|      1|}
_ZN2cv11WebPDecoderD2Ev:
   73|      1|WebPDecoder::~WebPDecoder() {}
_ZN2cv11WebPEncoderC2Ev:
  289|      1|{
  290|      1|    m_description = "WebP files (*.webp)";
  291|      1|    m_buf_supported = true;
  292|      1|}
_ZN2cv11WebPEncoderD2Ev:
  294|      1|WebPEncoder::~WebPEncoder() { }

_ZN2cv8imencodeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKNS_11_InputArrayERNS0_6vectorIhNS4_IhEEEERKNSC_IiNS4_IiEEEE:
 1449|    780|{
 1450|    780|    CV_TRACE_FUNCTION();
  ------------------
  |  |  207|    780|#define CV_TRACE_FUNCTION CV__TRACE_OPENCV_FUNCTION
  |  |  ------------------
  |  |  |  |  151|    780|    CV__TRACE_DEFINE_LOCATION_FN(CV__TRACE_FUNCTION, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|    780|#define CV__TRACE_DEFINE_LOCATION_FN(name, flags) CV__TRACE_DEFINE_LOCATION_(fn, name, ((flags) | CV_TRACE_NS::details::REGION_FLAG_FUNCTION))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  143|    780|    static CV_TRACE_NS::details::Region::LocationExtraData* CV__TRACE_LOCATION_EXTRA_VARNAME(loc_id) = 0; \
  |  |  |  |  |  |  |  |  144|    780|    static const CV_TRACE_NS::details::Region::LocationStaticStorage \
  |  |  |  |  |  |  |  |  145|    780|        CV__TRACE_LOCATION_VARNAME(loc_id) = { &(CV__TRACE_LOCATION_EXTRA_VARNAME(loc_id)), name, CV_TRACE_FILENAME, __LINE__, flags};
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  140|    780|#define CV__TRACE_LOCATION_EXTRA_VARNAME(loc_id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_trace_location_extra_, loc_id) , __LINE__)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  115|    780|#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    780|#define CVAUX_CONCAT_EXP(a, b) a##b
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |                       CV__TRACE_LOCATION_VARNAME(loc_id) = { &(CV__TRACE_LOCATION_EXTRA_VARNAME(loc_id)), name, CV_TRACE_FILENAME, __LINE__, flags};
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   53|    780|# define CV_TRACE_FILENAME __FILE__
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  152|    780|    const CV_TRACE_NS::details::Region __region_fn(CV__TRACE_LOCATION_VARNAME(fn));
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|    780|#define CV__TRACE_LOCATION_VARNAME(loc_id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_trace_location_, loc_id), __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|    780|#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  114|    780|#define CVAUX_CONCAT_EXP(a, b) a##b
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1451|       |
 1452|    780|    ImageEncoder encoder = findEncoder( ext );
 1453|    780|    if( !encoder )
  ------------------
  |  Branch (1453:9): [True: 0, False: 780]
  ------------------
 1454|      0|        CV_Error( Error::StsError, "could not find encoder for the specified extension" );
  ------------------
  |  |  399|      0|#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  ------------------
 1455|       |
 1456|    780|    std::vector<Mat> img_vec;
 1457|    780|    CV_Assert(!_img.empty());
  ------------------
  |  |  423|    780|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:35): [True: 780, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1458|    780|    if (_img.isMatVector() || _img.isUMatVector())
  ------------------
  |  Branch (1458:9): [True: 0, False: 780]
  |  Branch (1458:31): [True: 0, False: 780]
  ------------------
 1459|      0|        _img.getMatVector(img_vec);
 1460|    780|    else
 1461|    780|        img_vec.push_back(_img.getMat());
 1462|       |
 1463|    780|    CV_Assert(!img_vec.empty());
  ------------------
  |  |  423|    780|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:35): [True: 780, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1464|    780|    const bool isMultiImg = img_vec.size() > 1;
 1465|       |
 1466|    780|    std::vector<Mat> write_vec;
 1467|  1.56k|    for (size_t page = 0; page < img_vec.size(); page++)
  ------------------
  |  Branch (1467:27): [True: 780, False: 780]
  ------------------
 1468|    780|    {
 1469|    780|        Mat image = img_vec[page];
 1470|    780|        CV_Assert(!image.empty());
  ------------------
  |  |  423|    780|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:35): [True: 780, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1471|       |
 1472|    780|        const int channels = image.channels();
 1473|    780|        CV_Assert( channels == 1 || channels == 3 || channels == 4 );
  ------------------
  |  |  423|  1.56k|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:38): [True: 780, False: 0]
  |  |  |  Branch (423:38): [True: 0, False: 0]
  |  |  |  Branch (423:38): [True: 0, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1474|       |
 1475|    780|        Mat temp;
 1476|    780|        if( !encoder->isFormatSupported(image.depth()) )
  ------------------
  |  Branch (1476:13): [True: 0, False: 780]
  ------------------
 1477|      0|        {
 1478|      0|            CV_LOG_ONCE_WARNING(NULL, "Unsupported depth image for selected encoder is fallbacked to CV_8U.");
  ------------------
  |  |  206|      0|#define CV_LOG_ONCE_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, CV__LOG_ONCE_CHECK_PRE, CV__LOG_ONCE_CHECK_POST, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (147:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  ------------------
  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  164|      0|        break; \
  |  |  |  |  165|      0|    }
  |  |  ------------------
  ------------------
 1479|      0|            CV_Assert( encoder->isFormatSupported(CV_8U) );
  ------------------
  |  |  423|      0|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:35): [True: 0, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1480|      0|            image.convertTo( temp, CV_8U );
  ------------------
  |  |   73|      0|#define CV_8U   0
  ------------------
 1481|      0|            image = temp;
 1482|      0|        }
 1483|       |
 1484|    780|        write_vec.push_back(image);
 1485|    780|    }
 1486|       |
 1487|    780|#if CV_VERSION_MAJOR < 5 && defined(HAVE_IMGCODEC_HDR)
 1488|    780|    bool fixed = false;
 1489|    780|    std::vector<int> params_pair(2);
 1490|    780|    if (dynamic_cast<HdrEncoder*>(encoder.get()))
  ------------------
  |  Branch (1490:9): [True: 0, False: 780]
  ------------------
 1491|      0|    {
 1492|      0|        if (params_.size() == 1)
  ------------------
  |  Branch (1492:13): [True: 0, False: 0]
  ------------------
 1493|      0|        {
 1494|      0|            CV_LOG_WARNING(NULL, "imwrite() accepts key-value pair of parameters, but single value is passed. "
  ------------------
  |  |  169|      0|#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  ------------------
  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  164|      0|        break; \
  |  |  |  |  165|      0|    }
  |  |  ------------------
  ------------------
 1495|      0|                                 "HDR encoder behavior has been changed, please use IMWRITE_HDR_COMPRESSION key.");
 1496|      0|            params_pair[0] = IMWRITE_HDR_COMPRESSION;
 1497|      0|            params_pair[1] = params_[0];
 1498|      0|            fixed = true;
 1499|      0|        }
 1500|      0|    }
 1501|    780|    const std::vector<int>& params = fixed ? params_pair : params_;
  ------------------
  |  Branch (1501:38): [True: 0, False: 780]
  ------------------
 1502|       |#else
 1503|       |    const std::vector<int>& params = params_;
 1504|       |#endif
 1505|       |
 1506|    780|    CV_Check(params.size(), (params.size() & 1) == 0, "Encoding 'params' must be key-value pairs");
  ------------------
  |  |  142|    780|#define CV_Check(v, test_expr, msg)  CV__CHECK_CUSTOM_TEST(_, auto, v, (test_expr), #v, #test_expr, msg)
  |  |  ------------------
  |  |  |  |  106|    780|#define CV__CHECK_CUSTOM_TEST(id, type, v, test_expr, v_str, test_expr_str, msg_str) do { \
  |  |  |  |  107|    780|    if(!!(test_expr)) ; else { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (107:8): [True: 780, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  108|      0|        CV__DEFINE_CHECK_CONTEXT(id, msg_str, cv::detail::TEST_CUSTOM, v_str, test_expr_str); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|    static const cv::detail::CheckContext CV__CHECK_LOCATION_VARNAME(id) = \
  |  |  |  |  |  |   66|      0|            { CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|      0|#   define CV__CHECK_FUNCTION __PRETTY_FUNCTION__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                           { CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|      0|# define CV__CHECK_FILENAME __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  109|      0|        cv::detail::check_failed_ ## type((v), CV__CHECK_LOCATION_VARNAME(id)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|      0|#define CV__CHECK_LOCATION_VARNAME(id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_check_, id), __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  114|      0|#define CVAUX_CONCAT_EXP(a, b) a##b
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  110|      0|    } \
  |  |  |  |  111|    780|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (111:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1507|    780|    CV_CheckLE(params.size(), (size_t)(CV_IO_MAX_IMAGE_PARAMS*2), "");
  ------------------
  |  |  120|    780|#define CV_CheckLE(v1, v2, msg)  CV__CHECK(_, LE, auto, v1, v2, #v1, #v2, msg)
  |  |  ------------------
  |  |  |  |   99|    780|#define CV__CHECK(id, op, type, v1, v2, v1_str, v2_str, msg_str) do { \
  |  |  |  |  100|    780|    if(CV__TEST_##op((v1), (v2))) ; else { \
  |  |  |  |  101|      0|        CV__DEFINE_CHECK_CONTEXT(id, msg_str, cv::detail::TEST_ ## op, v1_str, v2_str); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|    static const cv::detail::CheckContext CV__CHECK_LOCATION_VARNAME(id) = \
  |  |  |  |  |  |   66|      0|            { CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|      0|#   define CV__CHECK_FUNCTION __PRETTY_FUNCTION__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                           { CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|      0|# define CV__CHECK_FILENAME __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  102|      0|        cv::detail::check_failed_ ## type((v1), (v2), CV__CHECK_LOCATION_VARNAME(id)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|      0|#define CV__CHECK_LOCATION_VARNAME(id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_check_, id), __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  114|      0|#define CVAUX_CONCAT_EXP(a, b) a##b
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  103|      0|    } \
  |  |  |  |  104|    780|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (104:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1508|       |
 1509|    780|    bool code = false;
 1510|    780|    String filename;
 1511|    780|    if( !encoder->setDestination(buf) )
  ------------------
  |  Branch (1511:9): [True: 0, False: 780]
  ------------------
 1512|      0|    {
 1513|      0|        filename = tempfile();
 1514|      0|        code = encoder->setDestination(filename);
 1515|      0|        CV_Assert( code );
  ------------------
  |  |  423|      0|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:35): [True: 0, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1516|      0|    }
 1517|       |
 1518|    780|    try {
 1519|    780|        if (!isMultiImg)
  ------------------
  |  Branch (1519:13): [True: 780, False: 0]
  ------------------
 1520|    780|            code = encoder->write(write_vec[0], params);
 1521|      0|        else
 1522|      0|            code = encoder->writemulti(write_vec, params);
 1523|       |
 1524|    780|        encoder->throwOnError();
 1525|    780|        CV_Assert( code );
  ------------------
  |  |  423|    780|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:35): [True: 780, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1526|    780|    }
 1527|    780|    catch (const cv::Exception& e)
 1528|    780|    {
 1529|      0|        CV_LOG_ERROR(NULL, "imencode(): can't encode data: " << e.what());
  ------------------
  |  |  168|      0|#define CV_LOG_ERROR(tag, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_ERROR, , , __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  ------------------
  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  164|      0|        break; \
  |  |  |  |  165|      0|    }
  |  |  ------------------
  ------------------
 1530|      0|        code = false;
 1531|      0|    }
 1532|    780|    catch (...)
 1533|    780|    {
 1534|      0|        CV_LOG_ERROR(NULL, "imencode(): can't encode data: unknown exception");
  ------------------
  |  |  168|      0|#define CV_LOG_ERROR(tag, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_ERROR, , , __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  146|      0|    for(;;) { \
  |  |  |  |  147|      0|        extra_check0; \
  |  |  |  |  148|      0|        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \
  |  |  |  |  149|      0|        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|      0|#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   17|      0|#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the "Release" build.
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (149:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |  150|      0|        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  ------------------
  |  |  |  |  151|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (151:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (152:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  153|      0|        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (153:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (153:34): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  154|      0|        extra_check1; \
  |  |  |  |  155|      0|        std::stringstream cv_temp_logstream; \
  |  |  |  |  156|      0|        cv_temp_logstream << __VA_ARGS__; \
  |  |  |  |  157|      0|        cv::utils::logging::internal::writeLogMessageEx( \
  |  |  |  |  158|      0|            cv_temp_msglevel, \
  |  |  |  |  159|      0|            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (159:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  160|      0|            __FILE__, \
  |  |  |  |  161|      0|            __LINE__, \
  |  |  |  |  162|      0|            CV_Func, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  |  |  ------------------
  |  |  |  |  163|      0|            cv_temp_logstream.str().c_str()); \
  |  |  |  |  164|      0|        break; \
  |  |  |  |  165|      0|    }
  |  |  ------------------
  ------------------
 1535|      0|        code = false;
 1536|      0|    }
 1537|       |
 1538|    780|    if( !filename.empty() && code )
  ------------------
  |  Branch (1538:9): [True: 0, False: 780]
  |  Branch (1538:30): [True: 0, False: 0]
  ------------------
 1539|      0|    {
 1540|      0|        FILE* f = fopen( filename.c_str(), "rb" );
 1541|      0|        CV_Assert(f != 0);
  ------------------
  |  |  423|      0|#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
  |  |  ------------------
  |  |  |  |   94|      0|#define CV_Func __func__
  |  |  ------------------
  |  |  |  Branch (423:35): [True: 0, False: 0]
  |  |  |  Branch (423:131): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1542|      0|        fseek( f, 0, SEEK_END );
 1543|      0|        long pos = ftell(f);
 1544|      0|        buf.resize((size_t)pos);
 1545|      0|        fseek( f, 0, SEEK_SET );
 1546|      0|        buf.resize(fread( &buf[0], 1, buf.size(), f ));
 1547|      0|        fclose(f);
 1548|      0|        remove(filename.c_str());
 1549|      0|    }
 1550|    780|    return code;
 1551|    780|}
_ZN2cv9AnimationC2EiNS_7Scalar_IdEE:
 1785|     14|    : loop_count(loopCount), bgcolor(bgColor)
 1786|     14|{
 1787|     14|    if (loopCount < 0 || loopCount > 0xffff)
  ------------------
  |  Branch (1787:9): [True: 0, False: 14]
  |  Branch (1787:26): [True: 0, False: 14]
  ------------------
 1788|      0|        this->loop_count = 0; // loop_count should be non-negative
 1789|     14|}
loadsave.cpp:_ZN2cvL9getCodecsEv:
  246|    780|{
  247|    780|    static ImageCodecInitializer g_codecs;
  248|    780|    return g_codecs;
  249|    780|}
_ZN2cv21ImageCodecInitializerC2Ev:
  160|      1|    {
  161|       |        /// BMP Support
  162|      1|        decoders.push_back( makePtr<BmpDecoder>() );
  163|      1|        encoders.push_back( makePtr<BmpEncoder>() );
  164|       |
  165|      1|    #ifdef HAVE_IMGCODEC_GIF
  166|      1|        decoders.push_back( makePtr<GifDecoder>() );
  167|      1|        encoders.push_back( makePtr<GifEncoder>() );
  168|      1|    #endif
  169|       |    #ifdef HAVE_AVIF
  170|       |        decoders.push_back(makePtr<AvifDecoder>());
  171|       |        encoders.push_back(makePtr<AvifEncoder>());
  172|       |    #endif
  173|      1|    #ifdef HAVE_IMGCODEC_HDR
  174|      1|        decoders.push_back( makePtr<HdrDecoder>() );
  175|      1|        encoders.push_back( makePtr<HdrEncoder>() );
  176|      1|    #endif
  177|      1|    #ifdef HAVE_JPEG
  178|      1|        decoders.push_back( makePtr<JpegDecoder>() );
  179|      1|        encoders.push_back( makePtr<JpegEncoder>() );
  180|      1|    #endif
  181|      1|    #ifdef HAVE_WEBP
  182|      1|        decoders.push_back( makePtr<WebPDecoder>() );
  183|      1|        encoders.push_back( makePtr<WebPEncoder>() );
  184|      1|    #endif
  185|      1|    #ifdef HAVE_IMGCODEC_SUNRASTER
  186|      1|        decoders.push_back( makePtr<SunRasterDecoder>() );
  187|      1|        encoders.push_back( makePtr<SunRasterEncoder>() );
  188|      1|    #endif
  189|      1|    #ifdef HAVE_IMGCODEC_PXM
  190|      1|        decoders.push_back( makePtr<PxMDecoder>() );
  191|      1|        encoders.push_back( makePtr<PxMEncoder>(PXM_TYPE_AUTO) );
  192|      1|        encoders.push_back( makePtr<PxMEncoder>(PXM_TYPE_PBM) );
  193|      1|        encoders.push_back( makePtr<PxMEncoder>(PXM_TYPE_PGM) );
  194|      1|        encoders.push_back( makePtr<PxMEncoder>(PXM_TYPE_PPM) );
  195|      1|        decoders.push_back( makePtr<PAMDecoder>() );
  196|      1|        encoders.push_back( makePtr<PAMEncoder>() );
  197|      1|    #endif
  198|      1|    #ifdef HAVE_IMGCODEC_PFM
  199|      1|        decoders.push_back( makePtr<PFMDecoder>() );
  200|      1|        encoders.push_back( makePtr<PFMEncoder>() );
  201|      1|    #endif
  202|      1|    #ifdef HAVE_TIFF
  203|      1|        decoders.push_back( makePtr<TiffDecoder>() );
  204|      1|        encoders.push_back( makePtr<TiffEncoder>() );
  205|      1|    #endif
  206|       |    #ifdef HAVE_SPNG
  207|       |        decoders.push_back( makePtr<SPngDecoder>() );
  208|       |        encoders.push_back( makePtr<SPngEncoder>() );
  209|       |    #elif defined(HAVE_PNG)
  210|       |        decoders.push_back( makePtr<PngDecoder>() );
  211|      1|        encoders.push_back( makePtr<PngEncoder>() );
  212|      1|    #endif
  213|       |    #ifdef HAVE_GDCM
  214|       |        decoders.push_back( makePtr<DICOMDecoder>() );
  215|       |    #endif
  216|       |    #ifdef HAVE_JASPER
  217|       |        decoders.push_back( makePtr<Jpeg2KDecoder>() );
  218|       |        encoders.push_back( makePtr<Jpeg2KEncoder>() );
  219|       |    #endif
  220|       |    #ifdef HAVE_JPEGXL
  221|       |        decoders.push_back( makePtr<JpegXLDecoder>() );
  222|       |        encoders.push_back( makePtr<JpegXLEncoder>() );
  223|       |    #endif
  224|      1|    #ifdef HAVE_OPENJPEG
  225|      1|        decoders.push_back( makePtr<Jpeg2KJP2OpjDecoder>() );
  226|      1|        decoders.push_back( makePtr<Jpeg2KJ2KOpjDecoder>() );
  227|      1|        encoders.push_back( makePtr<Jpeg2KOpjEncoder>() );
  228|      1|    #endif
  229|      1|    #ifdef HAVE_OPENEXR
  230|      1|        decoders.push_back( makePtr<ExrDecoder>() );
  231|      1|        encoders.push_back( makePtr<ExrEncoder>() );
  232|      1|    #endif
  233|       |
  234|       |    #ifdef HAVE_GDAL
  235|       |        /// Attach the GDAL Decoder
  236|       |        decoders.push_back( makePtr<GdalDecoder>() );
  237|       |    #endif/*HAVE_GDAL*/
  238|      1|    }
loadsave.cpp:_ZN2cvL11findEncoderERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  325|    780|{
  326|    780|    if( _ext.size() <= 1 )
  ------------------
  |  Branch (326:9): [True: 0, False: 780]
  ------------------
  327|      0|        return ImageEncoder();
  328|       |
  329|    780|    const char* ext = strrchr( _ext.c_str(), '.' );
  330|    780|    if( !ext )
  ------------------
  |  Branch (330:9): [True: 0, False: 780]
  ------------------
  331|      0|        return ImageEncoder();
  332|    780|    int len = 0;
  333|  3.90k|    for( ext++; len < 128 && isalnum(ext[len]); len++ )
  ------------------
  |  Branch (333:17): [True: 3.90k, False: 0]
  |  Branch (333:30): [True: 3.12k, False: 780]
  ------------------
  334|  3.12k|        ;
  335|       |
  336|    780|    ImageCodecInitializer& codecs = getCodecs();
  337|  10.1k|    for( size_t i = 0; i < codecs.encoders.size(); i++ )
  ------------------
  |  Branch (337:24): [True: 10.1k, False: 0]
  ------------------
  338|  10.1k|    {
  339|  10.1k|        String description = codecs.encoders[i]->getDescription();
  340|  10.1k|        const char* descr = strchr( description.c_str(), '(' );
  341|       |
  342|  23.4k|        while( descr )
  ------------------
  |  Branch (342:16): [True: 23.4k, False: 0]
  ------------------
  343|  23.4k|        {
  344|  23.4k|            descr = strchr( descr + 1, '.' );
  345|  23.4k|            if( !descr )
  ------------------
  |  Branch (345:17): [True: 9.36k, False: 14.0k]
  ------------------
  346|  9.36k|                break;
  347|  14.0k|            int j = 0;
  348|  17.1k|            for( descr++; j < len && isalnum(descr[j]) ; j++ )
  ------------------
  |  Branch (348:27): [True: 16.3k, False: 780]
  |  Branch (348:38): [True: 16.3k, False: 0]
  ------------------
  349|  16.3k|            {
  350|  16.3k|                int c1 = tolower(ext[j]);
  351|  16.3k|                int c2 = tolower(descr[j]);
  352|  16.3k|                if( c1 != c2 )
  ------------------
  |  Branch (352:21): [True: 13.2k, False: 3.12k]
  ------------------
  353|  13.2k|                    break;
  354|  16.3k|            }
  355|  14.0k|            if( j == len && !isalnum(descr[j]))
  ------------------
  |  Branch (355:17): [True: 780, False: 13.2k]
  |  Branch (355:29): [True: 780, False: 0]
  ------------------
  356|    780|                return codecs.encoders[i]->newEncoder();
  357|  13.2k|            descr += j;
  358|  13.2k|        }
  359|  10.1k|    }
  360|       |
  361|      0|    return ImageEncoder();
  362|    780|}

_ZN2cv11_InputArrayC2ERKNS_3MatE:
  103|    780|inline _InputArray::_InputArray(const Mat& m) { init(+MAT+ACCESS_READ, &m); }
_ZN2cv11_InputArray4initEiPKv:
   92|    786|{ flags = _flags; obj = (void*)_obj; }
_ZN2cv11_InputArrayD2Ev:
  178|    780|inline _InputArray::~_InputArray() {}

_ZN2cv5Size_IiEC2Ev:
 1693|    782|    : width(0), height(0) {}

