_ZN20WMSMiniDriverManagerC2Ev:
   25|      2|    {
   26|      2|    }

LLVMFuzzerInitialize:
   61|      2|{
   62|      2|    const char *exe_path = (*argv)[0];
   63|      2|    if (CPLGetConfigOption("GDAL_DATA", nullptr) == nullptr)
  ------------------
  |  Branch (63:9): [True: 2, False: 0]
  ------------------
   64|      2|    {
   65|      2|        CPLSetConfigOption("GDAL_DATA", CPLGetPathSafe(exe_path).c_str());
   66|      2|    }
   67|      2|    CPLSetConfigOption("CPL_TMPDIR", "/tmp");
   68|      2|    CPLSetConfigOption("DISABLE_OPEN_REAL_NETCDF_FILES", "YES");
   69|      2|    CPLSetConfigOption("GDAL_HTTP_TIMEOUT", "1");
   70|      2|    CPLSetConfigOption("GDAL_HTTP_CONNECTTIMEOUT", "1");
   71|       |    // To avoid timeouts. See https://github.com/OSGeo/gdal/issues/502
   72|      2|    CPLSetConfigOption("DXF_MAX_BSPLINE_CONTROL_POINTS", "100");
   73|      2|    CPLSetConfigOption("NAS_INDICATOR",
   74|      2|                       "NAS-Operationen;AAA-Fachschema;aaa.xsd;aaa-suite");
   75|      2|    CPLSetConfigOption(
   76|      2|        "USERNAME",
   77|      2|        "unknown");  // see GMLASConfiguration::GetBaseCacheDirectory()
   78|       |
   79|       |#ifdef OGR_SKIP
   80|       |    CPLSetConfigOption("OGR_SKIP", OGR_SKIP);
   81|       |#endif
   82|      2|    REGISTER_FUNC();
   83|       |
   84|      2|    return 0;
   85|      2|}
LLVMFuzzerTestOneInput:
   88|  7.31k|{
   89|       |#ifdef USE_FILESYSTEM
   90|       |    char szTempFilename[64];
   91|       |    snprintf(szTempFilename, sizeof(szTempFilename), "/tmp/gdal_fuzzer_%d.%s",
   92|       |             (int)getpid(), EXTENSION);
   93|       |    VSILFILE *fp = VSIFOpenL(szTempFilename, "wb");
   94|       |    if (!fp)
   95|       |    {
   96|       |        fprintf(stderr, "Cannot create %s\n", szTempFilename);
   97|       |        return 1;
   98|       |    }
   99|       |    VSIFWriteL(buf, 1, len, fp);
  100|       |#else
  101|  7.31k|    VSILFILE *fp = VSIFileFromMemBuffer(
  102|  7.31k|        MEM_FILENAME, reinterpret_cast<GByte *>(const_cast<uint8_t *>(buf)),
  ------------------
  |  |   50|  7.31k|#define MEM_FILENAME "/vsimem/test"
  ------------------
  103|  7.31k|        len, FALSE);
  ------------------
  |  | 1039|  7.31k|#define FALSE 0
  ------------------
  104|  7.31k|#endif
  105|  7.31k|    VSIFCloseL(fp);
  106|       |
  107|  7.31k|    CPLPushErrorHandler(CPLQuietErrorHandler);
  108|       |#ifdef USE_FILESYSTEM
  109|       |    OGRDataSourceH hDS = OGROpen(szTempFilename, FALSE, nullptr);
  110|       |#elif defined(FOR_OGR_MIRAMON)
  111|       |    std::string osVsitarPrefix("/vsitar/");
  112|       |    char **papszFiles =
  113|       |        VSIReadDir(std::string(osVsitarPrefix).append(MEM_FILENAME).c_str());
  114|       |    std::string osFileInTar;
  115|       |    for (int i = 0; papszFiles && papszFiles[i]; ++i)
  116|       |    {
  117|       |        if (EQUAL(CPLGetExtension(papszFiles[i]), "pol") ||
  118|       |            EQUAL(CPLGetExtension(papszFiles[i]), "arc") ||
  119|       |            EQUAL(CPLGetExtension(papszFiles[i]), "pnt"))
  120|       |        {
  121|       |            osFileInTar = papszFiles[i];
  122|       |            break;
  123|       |        }
  124|       |    }
  125|       |    CSLDestroy(papszFiles);
  126|       |    OGRDataSourceH hDS = nullptr;
  127|       |    if (!osFileInTar.empty())
  128|       |    {
  129|       |        hDS = OGROpen(std::string(osVsitarPrefix)
  130|       |                          .append(MEM_FILENAME)
  131|       |                          .append("/")
  132|       |                          .append(osFileInTar)
  133|       |                          .c_str(),
  134|       |                      FALSE, nullptr);
  135|       |    }
  136|       |#else
  137|  7.31k|    OGRDataSourceH hDS = OGROpen(GDAL_FILENAME, FALSE, nullptr);
  ------------------
  |  |   54|  7.31k|#define GDAL_FILENAME MEM_FILENAME
  |  |  ------------------
  |  |  |  |   50|  7.31k|#define MEM_FILENAME "/vsimem/test"
  |  |  ------------------
  ------------------
                  OGRDataSourceH hDS = OGROpen(GDAL_FILENAME, FALSE, nullptr);
  ------------------
  |  | 1039|  7.31k|#define FALSE 0
  ------------------
  138|  7.31k|#endif
  139|  7.31k|    if (hDS)
  ------------------
  |  Branch (139:9): [True: 1.52k, False: 5.78k]
  ------------------
  140|  1.52k|    {
  141|  1.52k|        const int nLayers = OGR_DS_GetLayerCount(hDS);
  142|  1.52k|        time_t nStartTime = time(nullptr);
  143|  1.52k|        bool bStop = false;
  144|  2.54k|        for (int i = 0; !bStop && i < 10 && i < nLayers; i++)
  ------------------
  |  Branch (144:25): [True: 2.54k, False: 0]
  |  Branch (144:35): [True: 2.54k, False: 0]
  |  Branch (144:45): [True: 1.02k, False: 1.52k]
  ------------------
  145|  1.02k|        {
  146|  1.02k|            OGRLayerH hLayer = OGR_DS_GetLayer(hDS, i);
  147|  1.02k|            OGR_L_GetSpatialRef(hLayer);
  148|  1.02k|            OGR_L_GetGeomType(hLayer);
  149|  1.02k|            OGR_L_GetFIDColumn(hLayer);
  150|  1.02k|            OGR_L_GetGeometryColumn(hLayer);
  151|  1.02k|            OGRFeatureH hFeature;
  152|  1.02k|            OGRFeatureH hFeaturePrev = nullptr;
  153|  1.02k|            for (int j = 0;
  154|  2.51k|                 j < 1000 && !bStop &&
  ------------------
  |  Branch (154:18): [True: 2.51k, False: 0]
  |  Branch (154:30): [True: 2.51k, False: 0]
  ------------------
  155|  2.51k|                 (hFeature = OGR_L_GetNextFeature(hLayer)) != nullptr;
  ------------------
  |  Branch (155:18): [True: 1.49k, False: 1.02k]
  ------------------
  156|  1.49k|                 j++)
  157|  1.49k|            {
  158|       |                // Limit runtime to 20 seconds if features returned are
  159|       |                // different. Otherwise this may be a sign of a bug in the
  160|       |                // reader and we want the infinite loop to be revealed.
  161|  1.49k|                if (time(nullptr) - nStartTime > 20)
  ------------------
  |  Branch (161:21): [True: 0, False: 1.49k]
  ------------------
  162|      0|                {
  163|      0|                    bool bIsSameAsPrevious =
  164|      0|                        (hFeaturePrev != nullptr &&
  ------------------
  |  Branch (164:26): [True: 0, False: 0]
  ------------------
  165|      0|                         OGR_F_Equal(hFeature, hFeaturePrev));
  ------------------
  |  Branch (165:26): [True: 0, False: 0]
  ------------------
  166|      0|                    if (!bIsSameAsPrevious)
  ------------------
  |  Branch (166:25): [True: 0, False: 0]
  ------------------
  167|      0|                    {
  168|      0|                        bStop = true;
  169|      0|                    }
  170|      0|                }
  171|  1.49k|                if (hFeaturePrev)
  ------------------
  |  Branch (171:21): [True: 577, False: 916]
  ------------------
  172|    577|                    OGR_F_Destroy(hFeaturePrev);
  173|  1.49k|                hFeaturePrev = hFeature;
  174|  1.49k|            }
  175|  1.02k|            if (hFeaturePrev)
  ------------------
  |  Branch (175:17): [True: 916, False: 104]
  ------------------
  176|    916|                OGR_F_Destroy(hFeaturePrev);
  177|  1.02k|        }
  178|  1.52k|        OGR_DS_Destroy(hDS);
  179|  1.52k|    }
  180|  7.31k|    CPLPopErrorHandler();
  181|       |#ifdef USE_FILESYSTEM
  182|       |    VSIUnlink(szTempFilename);
  183|       |#else
  184|  7.31k|    VSIUnlink(MEM_FILENAME);
  ------------------
  |  |   50|  7.31k|#define MEM_FILENAME "/vsimem/test"
  ------------------
  185|  7.31k|#endif
  186|  7.31k|    return 0;
  187|  7.31k|}

_ZNK23GDALMultiDomainMetadata10ComparatorclEPKcS2_:
   96|   257k|        {
   97|   257k|            return STRCASECMP(a, b) < 0;
  ------------------
  |  |  534|   257k|#define STRCASECMP(a, b) (strcasecmp(a, b))
  ------------------
   98|   257k|        }
_ZNK11GDALDataset23IsMarkedSuppressOnCloseEv:
  868|  7.27k|    {
  869|  7.27k|        return bSuppressOnClose;
  870|  7.27k|    }
_ZN11GDALDataset10FromHandleEPv:
  942|  4.07k|    {
  943|  4.07k|        return static_cast<GDALDataset *>(hDS);
  944|  4.07k|    }
_ZN10GDALDriver15GetOpenCallbackEv:
 2312|  7.27k|    {
 2313|  7.27k|        return pfnOpen;
 2314|  7.27k|    }
_ZN10GDALDriver10FromHandleEPv:
 2502|  14.5k|    {
 2503|  14.5k|        return static_cast<GDALDriver *>(hDriver);
 2504|  14.5k|    }
_ZN17GDALDriverManager18GetDriver_unlockedEi:
 2637|  7.31k|    {
 2638|  7.31k|        return (iDriver >= 0 && iDriver < nDrivers) ? papoDrivers[iDriver]
  ------------------
  |  Branch (2638:17): [True: 7.31k, False: 0]
  |  Branch (2638:33): [True: 7.31k, False: 0]
  ------------------
 2639|  7.31k|                                                    : nullptr;
 2640|  7.31k|    }

_Z37GDALGetResponsiblePIDForCurrentThreadv:
  216|  3.05k|{
  217|  3.05k|    GIntBig *pResponsiblePID =
  218|  3.05k|        static_cast<GIntBig *>(CPLGetTLS(CTLS_RESPONSIBLEPID));
  ------------------
  |  |  210|  3.05k|#define CTLS_RESPONSIBLEPID 11          /* gdaldataset.cpp */
  ------------------
  219|  3.05k|    if (pResponsiblePID == nullptr)
  ------------------
  |  Branch (219:9): [True: 3.05k, False: 0]
  ------------------
  220|  3.05k|        return CPLGetPID();
  221|      0|    return *pResponsiblePID;
  222|  3.05k|}
_ZN11GDALDatasetC2Ev:
  248|  7.27k|    : GDALDataset(CPLTestBool(CPLGetConfigOption("GDAL_FORCE_CACHING", "NO")))
  249|  7.27k|{
  250|  7.27k|}
_ZN11GDALDatasetC2Ei:
  253|  7.27k|    : bForceCachedIO(CPL_TO_BOOL(bForceCachedIOIn)),
  254|  7.27k|      m_poPrivate(new(std::nothrow) GDALDataset::Private)
  255|  7.27k|{
  256|  7.27k|}
_ZN11GDALDatasetD2Ev:
  281|  7.27k|{
  282|       |    // we don't want to report destruction of datasets that
  283|       |    // were never really open or meant as internal
  284|  7.27k|    if (!bIsInternal && (nBands != 0 || !EQUAL(GetDescription(), "")))
  ------------------
  |  |  541|  1.52k|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|  1.52k|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  ------------------
  |  Branch (284:9): [True: 1.52k, False: 5.74k]
  |  Branch (284:26): [True: 0, False: 1.52k]
  |  Branch (284:41): [True: 1.52k, False: 0]
  ------------------
  285|  1.52k|    {
  286|  1.52k|        if (CPLGetPID() != GDALGetResponsiblePIDForCurrentThread())
  ------------------
  |  Branch (286:13): [True: 0, False: 1.52k]
  ------------------
  287|      0|            CPLDebug("GDAL",
  288|      0|                     "GDALClose(%s, this=%p) (pid=%d, responsiblePID=%d)",
  289|      0|                     GetDescription(), this, static_cast<int>(CPLGetPID()),
  290|      0|                     static_cast<int>(GDALGetResponsiblePIDForCurrentThread()));
  291|  1.52k|        else
  292|  1.52k|            CPLDebug("GDAL", "GDALClose(%s, this=%p)", GetDescription(), this);
  293|  1.52k|    }
  294|       |
  295|  7.27k|    if (IsMarkedSuppressOnClose())
  ------------------
  |  Branch (295:9): [True: 0, False: 7.27k]
  ------------------
  296|      0|    {
  297|      0|        if (poDriver == nullptr ||
  ------------------
  |  Branch (297:13): [True: 0, False: 0]
  ------------------
  298|       |            // Someone issuing Create("foo.tif") on a
  299|       |            // memory driver doesn't expect files with those names to be deleted
  300|       |            // on a file system...
  301|       |            // This is somewhat messy. Ideally there should be a way for the
  302|       |            // driver to overload the default behavior
  303|      0|            (!EQUAL(poDriver->GetDescription(), "MEM") &&
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  ------------------
  |  Branch (303:14): [True: 0, False: 0]
  ------------------
  304|      0|             !EQUAL(poDriver->GetDescription(), "Memory")))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  ------------------
  |  Branch (304:14): [True: 0, False: 0]
  ------------------
  305|      0|        {
  306|      0|            VSIUnlink(GetDescription());
  307|      0|        }
  308|      0|    }
  309|       |
  310|       |    /* -------------------------------------------------------------------- */
  311|       |    /*      Remove dataset from the "open" dataset list.                    */
  312|       |    /* -------------------------------------------------------------------- */
  313|  7.27k|    if (!bIsInternal)
  ------------------
  |  Branch (313:9): [True: 1.52k, False: 5.74k]
  ------------------
  314|  1.52k|    {
  315|  1.52k|        CPLMutexHolderD(&hDLMutex);
  ------------------
  |  |  122|  1.52k|#define CPLMutexHolderD(x) CPLMutexHolder oHolder(x, 1000.0, __FILE__, __LINE__)
  ------------------
  316|  1.52k|        if (poAllDatasetMap)
  ------------------
  |  Branch (316:13): [True: 1.52k, False: 0]
  ------------------
  317|  1.52k|        {
  318|  1.52k|            std::map<GDALDataset *, GIntBig>::iterator oIter =
  319|  1.52k|                poAllDatasetMap->find(this);
  320|  1.52k|            CPLAssert(oIter != poAllDatasetMap->end());
  ------------------
  |  |  331|  1.52k|    do                                                                         \
  |  |  332|  1.52k|    {                                                                          \
  |  |  333|  1.52k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  321|       |
  322|  1.52k|            UnregisterFromSharedDataset();
  323|       |
  324|  1.52k|            poAllDatasetMap->erase(oIter);
  325|       |
  326|  1.52k|            if (poAllDatasetMap->empty())
  ------------------
  |  Branch (326:17): [True: 1.52k, False: 0]
  ------------------
  327|  1.52k|            {
  328|  1.52k|                delete poAllDatasetMap;
  329|  1.52k|                poAllDatasetMap = nullptr;
  330|  1.52k|                if (phSharedDatasetSet)
  ------------------
  |  Branch (330:21): [True: 0, False: 1.52k]
  ------------------
  331|      0|                {
  332|      0|                    CPLHashSetDestroy(phSharedDatasetSet);
  333|      0|                }
  334|  1.52k|                phSharedDatasetSet = nullptr;
  335|  1.52k|                CPLFree(ppDatasets);
  ------------------
  |  |   86|  1.52k|#define CPLFree VSIFree
  ------------------
  336|  1.52k|                ppDatasets = nullptr;
  337|  1.52k|            }
  338|  1.52k|        }
  339|  1.52k|    }
  340|       |
  341|       |    /* -------------------------------------------------------------------- */
  342|       |    /*      Destroy the raster bands if they exist.                         */
  343|       |    /* -------------------------------------------------------------------- */
  344|  7.27k|    for (int i = 0; i < nBands && papoBands != nullptr; ++i)
  ------------------
  |  Branch (344:21): [True: 0, False: 7.27k]
  |  Branch (344:35): [True: 0, False: 0]
  ------------------
  345|      0|    {
  346|      0|        if (papoBands[i] != nullptr)
  ------------------
  |  Branch (346:13): [True: 0, False: 0]
  ------------------
  347|      0|            delete papoBands[i];
  348|      0|        papoBands[i] = nullptr;
  349|      0|    }
  350|       |
  351|  7.27k|    CPLFree(papoBands);
  ------------------
  |  |   86|  7.27k|#define CPLFree VSIFree
  ------------------
  352|       |
  353|  7.27k|    if (m_poStyleTable)
  ------------------
  |  Branch (353:9): [True: 0, False: 7.27k]
  ------------------
  354|      0|    {
  355|      0|        delete m_poStyleTable;
  356|      0|        m_poStyleTable = nullptr;
  357|      0|    }
  358|       |
  359|  7.27k|    if (m_poPrivate != nullptr)
  ------------------
  |  Branch (359:9): [True: 7.27k, False: 0]
  ------------------
  360|  7.27k|    {
  361|  7.27k|        if (m_poPrivate->hMutex != nullptr)
  ------------------
  |  Branch (361:13): [True: 0, False: 7.27k]
  ------------------
  362|      0|            CPLDestroyMutex(m_poPrivate->hMutex);
  363|       |
  364|       |#if defined(__COVERITY__) || defined(DEBUG)
  365|       |        // Not needed since at destruction there is no risk of concurrent use.
  366|       |        std::lock_guard oLock(m_poPrivate->m_oMutexWKT);
  367|       |#endif
  368|  7.27k|        CPLFree(m_poPrivate->m_pszWKTCached);
  ------------------
  |  |   86|  7.27k|#define CPLFree VSIFree
  ------------------
  369|  7.27k|        if (m_poPrivate->m_poSRSCached)
  ------------------
  |  Branch (369:13): [True: 0, False: 7.27k]
  ------------------
  370|      0|        {
  371|      0|            m_poPrivate->m_poSRSCached->Release();
  372|      0|        }
  373|  7.27k|        CPLFree(m_poPrivate->m_pszWKTGCPCached);
  ------------------
  |  |   86|  7.27k|#define CPLFree VSIFree
  ------------------
  374|  7.27k|        if (m_poPrivate->m_poSRSGCPCached)
  ------------------
  |  Branch (374:13): [True: 0, False: 7.27k]
  ------------------
  375|      0|        {
  376|      0|            m_poPrivate->m_poSRSGCPCached->Release();
  377|      0|        }
  378|  7.27k|    }
  379|       |
  380|  7.27k|    delete m_poPrivate;
  381|       |
  382|  7.27k|    CSLDestroy(papszOpenOptions);
  383|  7.27k|}
_ZN11GDALDataset5CloseEv:
  462|  1.52k|{
  463|       |    // Call UnregisterFromSharedDataset() before altering nOpenFlags
  464|  1.52k|    UnregisterFromSharedDataset();
  465|       |
  466|  1.52k|    nOpenFlags = OPEN_FLAGS_CLOSED;
  467|  1.52k|    return CE_None;
  468|  1.52k|}
_ZN11GDALDataset27UnregisterFromSharedDatasetEv:
  475|  3.05k|{
  476|  3.05k|    if (!(!bIsInternal && bShared && poAllDatasetMap && phSharedDatasetSet))
  ------------------
  |  Branch (476:11): [True: 3.05k, False: 0]
  |  Branch (476:27): [True: 0, False: 3.05k]
  |  Branch (476:38): [True: 0, False: 0]
  |  Branch (476:57): [True: 0, False: 0]
  ------------------
  477|  3.05k|        return;
  478|       |
  479|      0|    CPLMutexHolderD(&hDLMutex);
  ------------------
  |  |  122|      0|#define CPLMutexHolderD(x) CPLMutexHolder oHolder(x, 1000.0, __FILE__, __LINE__)
  ------------------
  480|       |
  481|      0|    std::map<GDALDataset *, GIntBig>::iterator oIter =
  482|      0|        poAllDatasetMap->find(this);
  483|      0|    CPLAssert(oIter != poAllDatasetMap->end());
  ------------------
  |  |  331|      0|    do                                                                         \
  |  |  332|      0|    {                                                                          \
  |  |  333|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  484|      0|    const GIntBig nPIDCreatorForShared = oIter->second;
  485|      0|    bShared = false;
  486|      0|    SharedDatasetCtxt sStruct;
  487|      0|    sStruct.nPID = nPIDCreatorForShared;
  488|      0|    sStruct.nOpenFlags = nOpenFlags & ~GDAL_OF_SHARED;
  ------------------
  |  | 1074|      0|#define GDAL_OF_SHARED 0x20
  ------------------
  489|      0|    sStruct.pszDescription = const_cast<char *>(GetDescription());
  490|      0|    std::string osConcatenatedOpenOptions =
  491|      0|        GDALSharedDatasetConcatenateOpenOptions(papszOpenOptions);
  492|      0|    sStruct.pszConcatenatedOpenOptions = &osConcatenatedOpenOptions[0];
  493|      0|    sStruct.poDS = nullptr;
  494|      0|    SharedDatasetCtxt *psStruct = static_cast<SharedDatasetCtxt *>(
  495|      0|        CPLHashSetLookup(phSharedDatasetSet, &sStruct));
  496|      0|    if (psStruct && psStruct->poDS == this)
  ------------------
  |  Branch (496:9): [True: 0, False: 0]
  |  Branch (496:21): [True: 0, False: 0]
  ------------------
  497|      0|    {
  498|      0|        CPLHashSetRemove(phSharedDatasetSet, psStruct);
  499|      0|    }
  500|      0|    else
  501|      0|    {
  502|      0|        CPLDebug("GDAL",
  503|      0|                 "Should not happen. Cannot find %s, "
  504|      0|                 "this=%p in phSharedDatasetSet",
  505|      0|                 GetDescription(), this);
  506|      0|    }
  507|      0|}
_ZN11GDALDataset20AddToDatasetOpenListEv:
  514|  1.52k|{
  515|       |    /* -------------------------------------------------------------------- */
  516|       |    /*      Add this dataset to the open dataset list.                      */
  517|       |    /* -------------------------------------------------------------------- */
  518|  1.52k|    bIsInternal = false;
  519|       |
  520|  1.52k|    CPLMutexHolderD(&hDLMutex);
  ------------------
  |  |  122|  1.52k|#define CPLMutexHolderD(x) CPLMutexHolder oHolder(x, 1000.0, __FILE__, __LINE__)
  ------------------
  521|       |
  522|  1.52k|    if (poAllDatasetMap == nullptr)
  ------------------
  |  Branch (522:9): [True: 1.52k, False: 0]
  ------------------
  523|  1.52k|        poAllDatasetMap = new std::map<GDALDataset *, GIntBig>;
  524|  1.52k|    (*poAllDatasetMap)[this] = -1;
  525|  1.52k|}
_ZNK11GDALDataset9GetSharedEv:
 1670|  1.52k|{
 1671|  1.52k|    return bShared;
 1672|  1.52k|}
GDALOpenEx:
 3615|  7.31k|{
 3616|  7.31k|    VALIDATE_POINTER1(pszFilename, "GDALOpen", nullptr);
  ------------------
  |  |  471|  7.31k|    do                                                                         \
  |  |  472|  7.31k|    {                                                                          \
  |  |  473|  7.31k|        if (CPL_NULLPTR == ptr)                                                \
  |  |  ------------------
  |  |  |  | 1066|  7.31k|#define CPL_NULLPTR nullptr
  |  |  ------------------
  |  |  |  Branch (473:13): [True: 0, False: 7.31k]
  |  |  ------------------
  |  |  474|  7.31k|        {                                                                      \
  |  |  475|      0|            CPLErr const ret = VALIDATE_POINTER_ERR;                           \
  |  |  ------------------
  |  |  |  |  354|      0|#define VALIDATE_POINTER_ERR CE_Failure
  |  |  ------------------
  |  |  476|      0|            CPLError(ret, CPLE_ObjectNull,                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#define CPLE_ObjectNull 10
  |  |  ------------------
  |  |  477|      0|                     "Pointer \'%s\' is NULL in \'%s\'.\n", #ptr, (func));     \
  |  |  478|      0|            return (rc);                                                       \
  |  |  479|      0|        }                                                                      \
  |  |  480|  7.31k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3617|       |
 3618|       |    // Hack for the ZARR driver. We translate the CACHE_KERCHUNK_JSON
 3619|       |    // into VSIKERCHUNK_USE_CACHE config option
 3620|  7.31k|    std::unique_ptr<CPLConfigOptionSetter> poVSIKERCHUNK_USE_CACHESetter;
 3621|  7.31k|    if (CPLFetchBool(papszOpenOptions, "CACHE_KERCHUNK_JSON", false))
  ------------------
  |  Branch (3621:9): [True: 0, False: 7.31k]
  ------------------
 3622|      0|    {
 3623|      0|        poVSIKERCHUNK_USE_CACHESetter = std::make_unique<CPLConfigOptionSetter>(
 3624|      0|            "VSIKERCHUNK_USE_CACHE", "YES", false);
 3625|      0|    }
 3626|       |
 3627|       |    // Do some sanity checks on incompatible flags with thread-safe mode.
 3628|  7.31k|    if ((nOpenFlags & GDAL_OF_THREAD_SAFE) != 0)
  ------------------
  |  | 1142|  7.31k|#define GDAL_OF_THREAD_SAFE 0x800
  ------------------
  |  Branch (3628:9): [True: 0, False: 7.31k]
  ------------------
 3629|      0|    {
 3630|      0|        const struct
 3631|      0|        {
 3632|      0|            int nFlag;
 3633|      0|            const char *pszFlagName;
 3634|      0|        } asFlags[] = {
 3635|      0|            {GDAL_OF_UPDATE, "GDAL_OF_UPDATE"},
  ------------------
  |  | 1034|      0|#define GDAL_OF_UPDATE 0x01
  ------------------
 3636|      0|            {GDAL_OF_VECTOR, "GDAL_OF_VECTOR"},
  ------------------
  |  | 1052|      0|#define GDAL_OF_VECTOR 0x04
  ------------------
 3637|      0|            {GDAL_OF_MULTIDIM_RASTER, "GDAL_OF_MULTIDIM_RASTER"},
  ------------------
  |  | 1064|      0|#define GDAL_OF_MULTIDIM_RASTER 0x10
  ------------------
 3638|      0|            {GDAL_OF_GNM, "GDAL_OF_GNM"},
  ------------------
  |  | 1058|      0|#define GDAL_OF_GNM 0x08
  ------------------
 3639|      0|        };
 3640|       |
 3641|      0|        for (const auto &asFlag : asFlags)
  ------------------
  |  Branch (3641:33): [True: 0, False: 0]
  ------------------
 3642|      0|        {
 3643|      0|            if ((nOpenFlags & asFlag.nFlag) != 0)
  ------------------
  |  Branch (3643:17): [True: 0, False: 0]
  ------------------
 3644|      0|            {
 3645|      0|                CPLError(CE_Failure, CPLE_IllegalArg,
  ------------------
  |  |   93|      0|#define CPLE_IllegalArg 5
  ------------------
 3646|      0|                         "GDAL_OF_THREAD_SAFE and %s are mutually "
 3647|      0|                         "exclusive",
 3648|      0|                         asFlag.pszFlagName);
 3649|      0|                return nullptr;
 3650|      0|            }
 3651|      0|        }
 3652|      0|    }
 3653|       |
 3654|       |    // If no driver kind is specified, assume all are to be probed.
 3655|  7.31k|    if ((nOpenFlags & GDAL_OF_KIND_MASK) == 0)
  ------------------
  |  | 1067|  7.31k|#define GDAL_OF_KIND_MASK 0x1E
  ------------------
  |  Branch (3655:9): [True: 0, False: 7.31k]
  ------------------
 3656|      0|        nOpenFlags |= GDAL_OF_KIND_MASK & ~GDAL_OF_MULTIDIM_RASTER;
  ------------------
  |  | 1067|      0|#define GDAL_OF_KIND_MASK 0x1E
  ------------------
                      nOpenFlags |= GDAL_OF_KIND_MASK & ~GDAL_OF_MULTIDIM_RASTER;
  ------------------
  |  | 1064|      0|#define GDAL_OF_MULTIDIM_RASTER 0x10
  ------------------
 3657|       |
 3658|       |    /* -------------------------------------------------------------------- */
 3659|       |    /*      In case of shared dataset, first scan the existing list to see  */
 3660|       |    /*      if it could already contain the requested dataset.              */
 3661|       |    /* -------------------------------------------------------------------- */
 3662|  7.31k|    if (nOpenFlags & GDAL_OF_SHARED)
  ------------------
  |  | 1074|  7.31k|#define GDAL_OF_SHARED 0x20
  ------------------
  |  Branch (3662:9): [True: 0, False: 7.31k]
  ------------------
 3663|      0|    {
 3664|      0|        if (nOpenFlags & GDAL_OF_INTERNAL)
  ------------------
  |  | 1088|      0|#define GDAL_OF_INTERNAL 0x80
  ------------------
  |  Branch (3664:13): [True: 0, False: 0]
  ------------------
 3665|      0|        {
 3666|      0|            CPLError(CE_Failure, CPLE_IllegalArg,
  ------------------
  |  |   93|      0|#define CPLE_IllegalArg 5
  ------------------
 3667|      0|                     "GDAL_OF_SHARED and GDAL_OF_INTERNAL are exclusive");
 3668|      0|            return nullptr;
 3669|      0|        }
 3670|       |
 3671|      0|        auto poSharedDS =
 3672|      0|            GetSharedDS(pszFilename, nOpenFlags, papszOpenOptions);
 3673|      0|        if (poSharedDS)
  ------------------
  |  Branch (3673:13): [True: 0, False: 0]
  ------------------
 3674|      0|        {
 3675|      0|            poSharedDS->Reference();
 3676|      0|            return poSharedDS;
 3677|      0|        }
 3678|      0|    }
 3679|       |
 3680|  7.31k|    GDALDriverManager *poDM = GetGDALDriverManager();
 3681|       |    // CPLLocaleC  oLocaleForcer;
 3682|       |
 3683|  7.31k|    CPLErrorReset();
 3684|  7.31k|    VSIErrorReset();
 3685|  7.31k|    CPLAssert(nullptr != poDM);
  ------------------
  |  |  331|  7.31k|    do                                                                         \
  |  |  332|  7.31k|    {                                                                          \
  |  |  333|  7.31k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3686|       |
 3687|       |    // Build GDALOpenInfo just now to avoid useless file stat'ing if a
 3688|       |    // shared dataset was asked before.
 3689|  7.31k|    GDALOpenInfo oOpenInfo(pszFilename, nOpenFlags,
 3690|  7.31k|                           const_cast<char **>(papszSiblingFiles));
 3691|  7.31k|    oOpenInfo.papszAllowedDrivers = papszAllowedDrivers;
 3692|       |
 3693|  7.31k|    GDALAntiRecursionStruct &sAntiRecursion = GetAntiRecursionOpen();
 3694|  7.31k|    if (sAntiRecursion.nRecLevel == 100)
  ------------------
  |  Branch (3694:9): [True: 0, False: 7.31k]
  ------------------
 3695|      0|    {
 3696|      0|        CPLError(CE_Failure, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 3697|      0|                 "GDALOpen() called with too many recursion levels");
 3698|      0|        return nullptr;
 3699|      0|    }
 3700|       |
 3701|  7.31k|    std::string osAllowedDrivers;
 3702|  7.31k|    for (const char *pszDriverName : cpl::Iterate(papszAllowedDrivers))
  ------------------
  |  Branch (3702:36): [True: 0, False: 7.31k]
  ------------------
 3703|      0|        osAllowedDrivers += pszDriverName;
 3704|  7.31k|    auto dsCtxt = GDALAntiRecursionStruct::DatasetContext(
 3705|  7.31k|        std::string(pszFilename), nOpenFlags, osAllowedDrivers);
 3706|  7.31k|    if (cpl::contains(sAntiRecursion.aosDatasetNamesWithFlags, dsCtxt))
  ------------------
  |  Branch (3706:9): [True: 0, False: 7.31k]
  ------------------
 3707|      0|    {
 3708|      0|        CPLError(CE_Failure, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 3709|      0|                 "GDALOpen() called on %s recursively", pszFilename);
 3710|      0|        return nullptr;
 3711|      0|    }
 3712|       |
 3713|       |    // Remove leading @ if present.
 3714|  7.31k|    char **papszOpenOptionsCleaned =
 3715|  7.31k|        CSLDuplicate(const_cast<char **>(papszOpenOptions));
 3716|  7.31k|    for (char **papszIter = papszOpenOptionsCleaned; papszIter && *papszIter;
  ------------------
  |  Branch (3716:54): [True: 0, False: 7.31k]
  |  Branch (3716:67): [True: 0, False: 0]
  ------------------
 3717|  7.31k|         ++papszIter)
 3718|      0|    {
 3719|      0|        char *pszOption = *papszIter;
 3720|      0|        if (pszOption[0] == '@')
  ------------------
  |  Branch (3720:13): [True: 0, False: 0]
  ------------------
 3721|      0|            memmove(pszOption, pszOption + 1, strlen(pszOption + 1) + 1);
 3722|      0|    }
 3723|       |
 3724|  7.31k|    oOpenInfo.papszOpenOptions = papszOpenOptionsCleaned;
 3725|  7.31k|    oOpenInfo.nOpenFlags |= GDAL_OF_FROM_GDALOPEN;
  ------------------
  |  | 1133|  7.31k|#define GDAL_OF_FROM_GDALOPEN 0x400
  ------------------
 3726|       |
 3727|       |#ifdef OGRAPISPY_ENABLED
 3728|       |    const bool bUpdate = (nOpenFlags & GDAL_OF_UPDATE) != 0;
 3729|       |    const int iSnapshot =
 3730|       |        (nOpenFlags & GDAL_OF_VECTOR) != 0 && (nOpenFlags & GDAL_OF_RASTER) == 0
 3731|       |            ? OGRAPISpyOpenTakeSnapshot(pszFilename, bUpdate)
 3732|       |            : INT_MIN;
 3733|       |#endif
 3734|       |
 3735|  7.31k|    const int nDriverCount = poDM->GetDriverCount(/*bIncludeHidden=*/true);
 3736|  7.31k|    GDALDriver *poMissingPluginDriver = nullptr;
 3737|  7.31k|    std::vector<GDALDriver *> apoSecondPassDrivers;
 3738|       |
 3739|       |    // Lookup of matching driver for dataset can involve up to 2 passes:
 3740|       |    // - in the first pass, all drivers that are compabile of the request mode
 3741|       |    //   (raster/vector/etc.) are probed using their Identify() method if it
 3742|       |    //   exists. If the Identify() method returns FALSE, the driver is skipped.
 3743|       |    //   If the Identify() methods returns GDAL_IDENTIFY_UNKNOWN and that the
 3744|       |    //   driver is a deferred-loading plugin, it is added to the
 3745|       |    //   apoSecondPassDrivers list for potential later probing, and execution
 3746|       |    //   continues to the next driver in the list.
 3747|       |    //   Otherwise if Identify() returns non-FALSE, the Open() method is used.
 3748|       |    //   If Open() returns a non-NULL dataset, the loop stops and it is
 3749|       |    //   returned. Otherwise looping over remaining drivers continues.
 3750|       |    // - the second pass is optional, only if at least one driver was added
 3751|       |    //   into apoSecondPassDrivers during the first pass. It is similar
 3752|       |    //   to the first pass except it runs only on apoSecondPassDrivers drivers.
 3753|       |    //   And the Open() method of such drivers is used, causing them to be
 3754|       |    //   loaded for real.
 3755|  7.31k|    int iPass = 1;
 3756|  7.31k|retry:
 3757|  7.31k|    for (int iDriver = 0;
 3758|  13.0k|         iDriver < (iPass == 1 ? nDriverCount
  ------------------
  |  Branch (3758:10): [True: 7.31k, False: 5.78k]
  |  Branch (3758:21): [True: 13.0k, False: 0]
  ------------------
 3759|  13.0k|                               : static_cast<int>(apoSecondPassDrivers.size()));
 3760|  7.31k|         ++iDriver)
 3761|  7.31k|    {
 3762|  7.31k|        GDALDriver *poDriver =
 3763|  7.31k|            iPass == 1 ? poDM->GetDriver(iDriver, /*bIncludeHidden=*/true)
  ------------------
  |  Branch (3763:13): [True: 7.31k, False: 0]
  ------------------
 3764|  7.31k|                       : apoSecondPassDrivers[iDriver];
 3765|  7.31k|        if (papszAllowedDrivers != nullptr &&
  ------------------
  |  Branch (3765:13): [True: 0, False: 7.31k]
  ------------------
 3766|  7.31k|            CSLFindString(papszAllowedDrivers,
  ------------------
  |  Branch (3766:13): [True: 0, False: 0]
  ------------------
 3767|      0|                          GDALGetDriverShortName(poDriver)) == -1)
 3768|      0|        {
 3769|      0|            continue;
 3770|      0|        }
 3771|       |
 3772|  7.31k|        if (poDriver->GetMetadataItem(GDAL_DCAP_OPEN) == nullptr)
  ------------------
  |  |  569|  7.31k|#define GDAL_DCAP_OPEN "DCAP_OPEN"
  ------------------
  |  Branch (3772:13): [True: 0, False: 7.31k]
  ------------------
 3773|      0|            continue;
 3774|       |
 3775|  7.31k|        if ((nOpenFlags & GDAL_OF_RASTER) != 0 &&
  ------------------
  |  | 1046|  7.31k|#define GDAL_OF_RASTER 0x02
  ------------------
  |  Branch (3775:13): [True: 0, False: 7.31k]
  ------------------
 3776|  7.31k|            (nOpenFlags & GDAL_OF_VECTOR) == 0 &&
  ------------------
  |  | 1052|      0|#define GDAL_OF_VECTOR 0x04
  ------------------
  |  Branch (3776:13): [True: 0, False: 0]
  ------------------
 3777|  7.31k|            poDriver->GetMetadataItem(GDAL_DCAP_RASTER) == nullptr)
  ------------------
  |  |  633|      0|#define GDAL_DCAP_RASTER "DCAP_RASTER"
  ------------------
  |  Branch (3777:13): [True: 0, False: 0]
  ------------------
 3778|      0|            continue;
 3779|  7.31k|        if ((nOpenFlags & GDAL_OF_VECTOR) != 0 &&
  ------------------
  |  | 1052|  7.31k|#define GDAL_OF_VECTOR 0x04
  ------------------
  |  Branch (3779:13): [True: 7.31k, False: 0]
  ------------------
 3780|  7.31k|            (nOpenFlags & GDAL_OF_RASTER) == 0 &&
  ------------------
  |  | 1046|  7.31k|#define GDAL_OF_RASTER 0x02
  ------------------
  |  Branch (3780:13): [True: 7.31k, False: 0]
  ------------------
 3781|  7.31k|            poDriver->GetMetadataItem(GDAL_DCAP_VECTOR) == nullptr)
  ------------------
  |  |  638|  7.31k|#define GDAL_DCAP_VECTOR "DCAP_VECTOR"
  ------------------
  |  Branch (3781:13): [True: 0, False: 7.31k]
  ------------------
 3782|      0|            continue;
 3783|  7.31k|        if ((nOpenFlags & GDAL_OF_MULTIDIM_RASTER) != 0 &&
  ------------------
  |  | 1064|  7.31k|#define GDAL_OF_MULTIDIM_RASTER 0x10
  ------------------
  |  Branch (3783:13): [True: 0, False: 7.31k]
  ------------------
 3784|  7.31k|            (nOpenFlags & GDAL_OF_RASTER) == 0 &&
  ------------------
  |  | 1046|      0|#define GDAL_OF_RASTER 0x02
  ------------------
  |  Branch (3784:13): [True: 0, False: 0]
  ------------------
 3785|  7.31k|            poDriver->GetMetadataItem(GDAL_DCAP_MULTIDIM_RASTER) == nullptr)
  ------------------
  |  |  613|      0|#define GDAL_DCAP_MULTIDIM_RASTER "DCAP_MULTIDIM_RASTER"
  ------------------
  |  Branch (3785:13): [True: 0, False: 0]
  ------------------
 3786|      0|            continue;
 3787|       |
 3788|       |        // Remove general OVERVIEW_LEVEL open options from list before passing
 3789|       |        // it to the driver, if it isn't a driver specific option already.
 3790|  7.31k|        char **papszTmpOpenOptions = nullptr;
 3791|  7.31k|        char **papszTmpOpenOptionsToValidate = nullptr;
 3792|  7.31k|        char **papszOptionsToValidate = const_cast<char **>(papszOpenOptions);
 3793|  7.31k|        if (CSLFetchNameValue(papszOpenOptionsCleaned, "OVERVIEW_LEVEL") !=
  ------------------
  |  Branch (3793:13): [True: 0, False: 7.31k]
  ------------------
 3794|  7.31k|                nullptr &&
 3795|  7.31k|            !poDriver->HasOpenOption("OVERVIEW_LEVEL"))
  ------------------
  |  Branch (3795:13): [True: 0, False: 0]
  ------------------
 3796|      0|        {
 3797|      0|            papszTmpOpenOptions = CSLDuplicate(papszOpenOptionsCleaned);
 3798|      0|            papszTmpOpenOptions =
 3799|      0|                CSLSetNameValue(papszTmpOpenOptions, "OVERVIEW_LEVEL", nullptr);
 3800|      0|            oOpenInfo.papszOpenOptions = papszTmpOpenOptions;
 3801|       |
 3802|      0|            papszOptionsToValidate = CSLDuplicate(papszOptionsToValidate);
 3803|      0|            papszOptionsToValidate = CSLSetNameValue(papszOptionsToValidate,
 3804|      0|                                                     "OVERVIEW_LEVEL", nullptr);
 3805|      0|            papszTmpOpenOptionsToValidate = papszOptionsToValidate;
 3806|      0|        }
 3807|       |
 3808|  7.31k|        const int nIdentifyRes =
 3809|  7.31k|            poDriver->pfnIdentifyEx
  ------------------
  |  Branch (3809:13): [True: 0, False: 7.31k]
  ------------------
 3810|  7.31k|                ? poDriver->pfnIdentifyEx(poDriver, &oOpenInfo)
 3811|  7.31k|            : poDriver->pfnIdentify ? poDriver->pfnIdentify(&oOpenInfo)
  ------------------
  |  Branch (3811:15): [True: 7.31k, False: 0]
  ------------------
 3812|  7.31k|                                    : GDAL_IDENTIFY_UNKNOWN;
 3813|  7.31k|        if (nIdentifyRes == FALSE)
  ------------------
  |  | 1039|  7.31k|#define FALSE 0
  ------------------
  |  Branch (3813:13): [True: 38, False: 7.27k]
  ------------------
 3814|     38|        {
 3815|     38|            CSLDestroy(papszTmpOpenOptions);
 3816|     38|            CSLDestroy(papszTmpOpenOptionsToValidate);
 3817|     38|            oOpenInfo.papszOpenOptions = papszOpenOptionsCleaned;
 3818|     38|            continue;
 3819|     38|        }
 3820|  7.27k|        else if (iPass == 1 && nIdentifyRes < 0 &&
  ------------------
  |  Branch (3820:18): [True: 7.27k, False: 0]
  |  Branch (3820:32): [True: 0, False: 7.27k]
  ------------------
 3821|  7.27k|                 poDriver->pfnOpen == nullptr &&
  ------------------
  |  Branch (3821:18): [True: 0, False: 0]
  ------------------
 3822|  7.27k|                 poDriver->GetMetadataItem("IS_NON_LOADED_PLUGIN"))
  ------------------
  |  Branch (3822:18): [True: 0, False: 0]
  ------------------
 3823|      0|        {
 3824|       |            // Not loaded plugin
 3825|      0|            apoSecondPassDrivers.push_back(poDriver);
 3826|      0|            CSLDestroy(papszTmpOpenOptions);
 3827|      0|            CSLDestroy(papszTmpOpenOptionsToValidate);
 3828|      0|            oOpenInfo.papszOpenOptions = papszOpenOptionsCleaned;
 3829|      0|            continue;
 3830|      0|        }
 3831|       |
 3832|  7.27k|        const bool bIdentifyRes = nIdentifyRes == GDAL_IDENTIFY_TRUE;
 3833|  7.27k|        if (bIdentifyRes)
  ------------------
  |  Branch (3833:13): [True: 7.27k, False: 0]
  ------------------
 3834|  7.27k|        {
 3835|  7.27k|            GDALValidateOpenOptions(poDriver, papszOptionsToValidate);
 3836|  7.27k|        }
 3837|       |
 3838|  7.27k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 3839|  7.27k|        const bool bFpAvailableBefore = oOpenInfo.fpL != nullptr;
 3840|  7.27k|        CPLErrorReset();
 3841|  7.27k|#endif
 3842|       |
 3843|  7.27k|        sAntiRecursion.nRecLevel++;
 3844|  7.27k|        sAntiRecursion.aosDatasetNamesWithFlags.insert(dsCtxt);
 3845|       |
 3846|  7.27k|        GDALDataset *poDS = poDriver->Open(&oOpenInfo, false);
 3847|       |
 3848|  7.27k|        sAntiRecursion.nRecLevel--;
 3849|  7.27k|        sAntiRecursion.aosDatasetNamesWithFlags.erase(dsCtxt);
 3850|       |
 3851|  7.27k|        if (poDriver->pfnOpen != nullptr)
  ------------------
  |  Branch (3851:13): [True: 7.27k, False: 0]
  ------------------
 3852|  7.27k|        {
 3853|       |            // If we couldn't determine for sure with Identify() (it returned
 3854|       |            // -1), but Open() managed to open the file, post validate options.
 3855|  7.27k|            if (poDS != nullptr &&
  ------------------
  |  Branch (3855:17): [True: 1.52k, False: 5.74k]
  ------------------
 3856|  7.27k|                (poDriver->pfnIdentify || poDriver->pfnIdentifyEx) &&
  ------------------
  |  Branch (3856:18): [True: 1.52k, False: 0]
  |  Branch (3856:43): [True: 0, False: 0]
  ------------------
 3857|  7.27k|                !bIdentifyRes)
  ------------------
  |  Branch (3857:17): [True: 0, False: 1.52k]
  ------------------
 3858|      0|            {
 3859|      0|                GDALValidateOpenOptions(poDriver, papszOptionsToValidate);
 3860|      0|            }
 3861|  7.27k|        }
 3862|      0|        else if (poDriver->pfnOpenWithDriverArg != nullptr)
  ------------------
  |  Branch (3862:18): [True: 0, False: 0]
  ------------------
 3863|      0|        {
 3864|       |            // do nothing
 3865|      0|        }
 3866|      0|        else if (bIdentifyRes &&
  ------------------
  |  Branch (3866:18): [True: 0, False: 0]
  ------------------
 3867|      0|                 poDriver->GetMetadataItem("MISSING_PLUGIN_FILENAME"))
  ------------------
  |  Branch (3867:18): [True: 0, False: 0]
  ------------------
 3868|      0|        {
 3869|      0|            if (!poMissingPluginDriver)
  ------------------
  |  Branch (3869:17): [True: 0, False: 0]
  ------------------
 3870|      0|            {
 3871|      0|                poMissingPluginDriver = poDriver;
 3872|      0|            }
 3873|      0|        }
 3874|      0|        else
 3875|      0|        {
 3876|       |            // should not happen given the GDAL_DCAP_OPEN check
 3877|      0|            CSLDestroy(papszTmpOpenOptions);
 3878|      0|            CSLDestroy(papszTmpOpenOptionsToValidate);
 3879|      0|            oOpenInfo.papszOpenOptions = papszOpenOptionsCleaned;
 3880|      0|            continue;
 3881|      0|        }
 3882|       |
 3883|  7.27k|        CSLDestroy(papszTmpOpenOptions);
 3884|  7.27k|        CSLDestroy(papszTmpOpenOptionsToValidate);
 3885|  7.27k|        oOpenInfo.papszOpenOptions = papszOpenOptionsCleaned;
 3886|       |
 3887|  7.27k|        if (poDS != nullptr)
  ------------------
  |  Branch (3887:13): [True: 1.52k, False: 5.74k]
  ------------------
 3888|  1.52k|        {
 3889|  1.52k|            if (poDS->papszOpenOptions == nullptr)
  ------------------
  |  Branch (3889:17): [True: 1.52k, False: 0]
  ------------------
 3890|  1.52k|            {
 3891|  1.52k|                poDS->papszOpenOptions = papszOpenOptionsCleaned;
 3892|  1.52k|                papszOpenOptionsCleaned = nullptr;
 3893|  1.52k|            }
 3894|       |
 3895|       |            // Deal with generic OVERVIEW_LEVEL open option, unless it is
 3896|       |            // driver specific.
 3897|  1.52k|            if (CSLFetchNameValue(papszOpenOptions, "OVERVIEW_LEVEL") !=
  ------------------
  |  Branch (3897:17): [True: 0, False: 1.52k]
  ------------------
 3898|  1.52k|                    nullptr &&
 3899|  1.52k|                !poDriver->HasOpenOption("OVERVIEW_LEVEL"))
  ------------------
  |  Branch (3899:17): [True: 0, False: 0]
  ------------------
 3900|      0|            {
 3901|      0|                CPLString osVal(
 3902|      0|                    CSLFetchNameValue(papszOpenOptions, "OVERVIEW_LEVEL"));
 3903|      0|                const int nOvrLevel = EQUAL(osVal, "NONE") ? -1 : atoi(osVal);
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3904|      0|                const bool bThisLevelOnly =
 3905|      0|                    nOvrLevel == -1 || osVal.ifind("only") != std::string::npos;
  ------------------
  |  Branch (3905:21): [True: 0, False: 0]
  |  Branch (3905:40): [True: 0, False: 0]
  ------------------
 3906|      0|                GDALDataset *poOvrDS =
 3907|      0|                    GDALCreateOverviewDataset(poDS, nOvrLevel, bThisLevelOnly);
 3908|      0|                if (poOvrDS && (nOpenFlags & GDAL_OF_SHARED) != 0)
  ------------------
  |  | 1074|      0|#define GDAL_OF_SHARED 0x20
  ------------------
  |  Branch (3908:21): [True: 0, False: 0]
  |  Branch (3908:32): [True: 0, False: 0]
  ------------------
 3909|      0|                {
 3910|      0|                    if (strcmp(pszFilename, poDS->GetDescription()) != 0)
  ------------------
  |  Branch (3910:25): [True: 0, False: 0]
  ------------------
 3911|      0|                    {
 3912|      0|                        CPLError(
 3913|      0|                            CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 3914|      0|                            "A dataset opened by GDALOpenShared should have "
 3915|      0|                            "the same filename (%s) "
 3916|      0|                            "and description (%s)",
 3917|      0|                            pszFilename, poDS->GetDescription());
 3918|      0|                    }
 3919|      0|                    else
 3920|      0|                    {
 3921|      0|                        CSLDestroy(poDS->papszOpenOptions);
 3922|      0|                        poDS->papszOpenOptions = CSLDuplicate(papszOpenOptions);
 3923|      0|                        poDS->papszOpenOptions = CSLSetNameValue(
 3924|      0|                            poDS->papszOpenOptions, "OVERVIEW_LEVEL", nullptr);
 3925|      0|                    }
 3926|      0|                }
 3927|      0|                poDS->ReleaseRef();
 3928|      0|                poDS = poOvrDS;
 3929|      0|                if (poDS == nullptr)
  ------------------
  |  Branch (3929:21): [True: 0, False: 0]
  ------------------
 3930|      0|                {
 3931|      0|                    if (nOpenFlags & GDAL_OF_VERBOSE_ERROR)
  ------------------
  |  | 1080|      0|#define GDAL_OF_VERBOSE_ERROR 0x40
  ------------------
  |  Branch (3931:25): [True: 0, False: 0]
  ------------------
 3932|      0|                    {
 3933|      0|                        CPLError(CE_Failure, CPLE_OpenFailed,
  ------------------
  |  |   91|      0|#define CPLE_OpenFailed 4
  ------------------
 3934|      0|                                 "Cannot open overview level %d of %s",
 3935|      0|                                 nOvrLevel, pszFilename);
 3936|      0|                    }
 3937|      0|                }
 3938|      0|                else
 3939|      0|                {
 3940|       |                    // For thread-safe opening, currently poDS is what will be
 3941|       |                    // the "master" dataset owned by the thread-safe dataset
 3942|       |                    // returned to the user, hence we do not register it as a
 3943|       |                    // visible one in the open dataset list, or mark it as shared.
 3944|      0|                    if (!(nOpenFlags & GDAL_OF_INTERNAL) &&
  ------------------
  |  | 1088|      0|#define GDAL_OF_INTERNAL 0x80
  ------------------
  |  Branch (3944:25): [True: 0, False: 0]
  ------------------
 3945|      0|                        !(nOpenFlags & GDAL_OF_THREAD_SAFE))
  ------------------
  |  | 1142|      0|#define GDAL_OF_THREAD_SAFE 0x800
  ------------------
  |  Branch (3945:25): [True: 0, False: 0]
  ------------------
 3946|      0|                    {
 3947|      0|                        poDS->AddToDatasetOpenList();
 3948|      0|                    }
 3949|      0|                    if (nOpenFlags & GDAL_OF_SHARED)
  ------------------
  |  | 1074|      0|#define GDAL_OF_SHARED 0x20
  ------------------
  |  Branch (3949:25): [True: 0, False: 0]
  ------------------
 3950|      0|                    {
 3951|      0|                        CSLDestroy(poDS->papszOpenOptions);
 3952|      0|                        poDS->papszOpenOptions = CSLDuplicate(papszOpenOptions);
 3953|      0|                        poDS->nOpenFlags = nOpenFlags;
 3954|      0|                        if (!(nOpenFlags & GDAL_OF_THREAD_SAFE))
  ------------------
  |  | 1142|      0|#define GDAL_OF_THREAD_SAFE 0x800
  ------------------
  |  Branch (3954:29): [True: 0, False: 0]
  ------------------
 3955|      0|                            poDS->MarkAsShared();
 3956|      0|                    }
 3957|      0|                }
 3958|      0|            }
 3959|  1.52k|            else if (nOpenFlags & GDAL_OF_SHARED)
  ------------------
  |  | 1074|  1.52k|#define GDAL_OF_SHARED 0x20
  ------------------
  |  Branch (3959:22): [True: 0, False: 1.52k]
  ------------------
 3960|      0|            {
 3961|      0|                if (strcmp(pszFilename, poDS->GetDescription()) != 0)
  ------------------
  |  Branch (3961:21): [True: 0, False: 0]
  ------------------
 3962|      0|                {
 3963|      0|                    CPLError(CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 3964|      0|                             "A dataset opened by GDALOpenShared should have "
 3965|      0|                             "the same filename (%s) "
 3966|      0|                             "and description (%s)",
 3967|      0|                             pszFilename, poDS->GetDescription());
 3968|      0|                }
 3969|      0|                else if (!(nOpenFlags & GDAL_OF_THREAD_SAFE))
  ------------------
  |  | 1142|      0|#define GDAL_OF_THREAD_SAFE 0x800
  ------------------
  |  Branch (3969:26): [True: 0, False: 0]
  ------------------
 3970|      0|                {
 3971|       |                    // For thread-safe opening, currently poDS is what will be
 3972|       |                    // the "master" dataset owned by the thread-safe dataset
 3973|       |                    // returned to the user, hence we do not or mark it as shared.
 3974|      0|                    poDS->MarkAsShared();
 3975|      0|                }
 3976|      0|            }
 3977|       |
 3978|  1.52k|            VSIErrorReset();
 3979|       |
 3980|  1.52k|            CSLDestroy(papszOpenOptionsCleaned);
 3981|       |
 3982|       |#ifdef OGRAPISPY_ENABLED
 3983|       |            if (iSnapshot != INT_MIN)
 3984|       |            {
 3985|       |                GDALDatasetH hDS = GDALDataset::ToHandle(poDS);
 3986|       |                OGRAPISpyOpen(pszFilename, bUpdate, iSnapshot, &hDS);
 3987|       |                poDS = GDALDataset::FromHandle(hDS);
 3988|       |            }
 3989|       |#endif
 3990|       |
 3991|  1.52k|            if (poDS)
  ------------------
  |  Branch (3991:17): [True: 1.52k, False: 0]
  ------------------
 3992|  1.52k|            {
 3993|  1.52k|                poDS->m_bCanBeReopened = true;
 3994|       |
 3995|  1.52k|                if ((nOpenFlags & GDAL_OF_THREAD_SAFE) != 0)
  ------------------
  |  | 1142|  1.52k|#define GDAL_OF_THREAD_SAFE 0x800
  ------------------
  |  Branch (3995:21): [True: 0, False: 1.52k]
  ------------------
 3996|      0|                {
 3997|      0|                    poDS =
 3998|      0|                        GDALGetThreadSafeDataset(
 3999|      0|                            std::unique_ptr<GDALDataset>(poDS), GDAL_OF_RASTER)
  ------------------
  |  | 1046|      0|#define GDAL_OF_RASTER 0x02
  ------------------
 4000|      0|                            .release();
 4001|      0|                    if (poDS)
  ------------------
  |  Branch (4001:25): [True: 0, False: 0]
  ------------------
 4002|      0|                    {
 4003|      0|                        poDS->m_bCanBeReopened = true;
 4004|      0|                        poDS->poDriver = poDriver;
 4005|      0|                        poDS->nOpenFlags = nOpenFlags;
 4006|      0|                        if (!(nOpenFlags & GDAL_OF_INTERNAL))
  ------------------
  |  | 1088|      0|#define GDAL_OF_INTERNAL 0x80
  ------------------
  |  Branch (4006:29): [True: 0, False: 0]
  ------------------
 4007|      0|                            poDS->AddToDatasetOpenList();
 4008|      0|                        if (nOpenFlags & GDAL_OF_SHARED)
  ------------------
  |  | 1074|      0|#define GDAL_OF_SHARED 0x20
  ------------------
  |  Branch (4008:29): [True: 0, False: 0]
  ------------------
 4009|      0|                            poDS->MarkAsShared();
 4010|      0|                    }
 4011|      0|                }
 4012|  1.52k|            }
 4013|       |
 4014|  1.52k|            return poDS;
 4015|  1.52k|        }
 4016|       |
 4017|  5.74k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 4018|  5.74k|        if (bFpAvailableBefore && oOpenInfo.fpL == nullptr)
  ------------------
  |  Branch (4018:13): [True: 5.74k, False: 0]
  |  Branch (4018:35): [True: 0, False: 5.74k]
  ------------------
 4019|      0|        {
 4020|       |            // In case the file descriptor was "consumed" by a driver
 4021|       |            // that ultimately failed, re-open it for next drivers.
 4022|      0|            oOpenInfo.fpL = VSIFOpenL(
 4023|      0|                pszFilename, (oOpenInfo.eAccess == GA_Update) ? "r+b" : "rb");
  ------------------
  |  Branch (4023:30): [True: 0, False: 0]
  ------------------
 4024|      0|        }
 4025|       |#else
 4026|       |        if (CPLGetLastErrorNo() != 0 && CPLGetLastErrorType() > CE_Warning)
 4027|       |        {
 4028|       |            CSLDestroy(papszOpenOptionsCleaned);
 4029|       |
 4030|       |#ifdef OGRAPISPY_ENABLED
 4031|       |            if (iSnapshot != INT_MIN)
 4032|       |            {
 4033|       |                GDALDatasetH hDS = nullptr;
 4034|       |                OGRAPISpyOpen(pszFilename, bUpdate, iSnapshot, &hDS);
 4035|       |            }
 4036|       |#endif
 4037|       |            return nullptr;
 4038|       |        }
 4039|       |#endif
 4040|  5.74k|    }
 4041|       |
 4042|       |    // cppcheck-suppress knownConditionTrueFalse
 4043|  5.78k|    if (iPass == 1 && !apoSecondPassDrivers.empty())
  ------------------
  |  Branch (4043:9): [True: 5.78k, False: 0]
  |  Branch (4043:23): [True: 0, False: 5.78k]
  ------------------
 4044|      0|    {
 4045|      0|        CPLDebugOnly("GDAL", "GDALOpen(): Second pass");
  ------------------
  |  |  313|      0|    do                                                                         \
  |  |  314|      0|    {                                                                          \
  |  |  315|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (315:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4046|      0|        iPass = 2;
 4047|      0|        goto retry;
 4048|      0|    }
 4049|       |
 4050|  5.78k|    CSLDestroy(papszOpenOptionsCleaned);
 4051|       |
 4052|       |#ifdef OGRAPISPY_ENABLED
 4053|       |    if (iSnapshot != INT_MIN)
 4054|       |    {
 4055|       |        GDALDatasetH hDS = nullptr;
 4056|       |        OGRAPISpyOpen(pszFilename, bUpdate, iSnapshot, &hDS);
 4057|       |    }
 4058|       |#endif
 4059|       |
 4060|  5.78k|    if (nOpenFlags & GDAL_OF_VERBOSE_ERROR)
  ------------------
  |  | 1080|  5.78k|#define GDAL_OF_VERBOSE_ERROR 0x40
  ------------------
  |  Branch (4060:9): [True: 0, False: 5.78k]
  ------------------
 4061|      0|    {
 4062|      0|        if (nDriverCount == 0)
  ------------------
  |  Branch (4062:13): [True: 0, False: 0]
  ------------------
 4063|      0|        {
 4064|      0|            CPLError(CE_Failure, CPLE_OpenFailed, "No driver registered.");
  ------------------
  |  |   91|      0|#define CPLE_OpenFailed 4
  ------------------
 4065|      0|        }
 4066|      0|        else if (poMissingPluginDriver)
  ------------------
  |  Branch (4066:18): [True: 0, False: 0]
  ------------------
 4067|      0|        {
 4068|      0|            std::string osMsg("`");
 4069|      0|            osMsg += pszFilename;
 4070|      0|            osMsg += "' not recognized as being in a supported file format. "
 4071|      0|                     "It could have been recognized by driver ";
 4072|      0|            osMsg += poMissingPluginDriver->GetDescription();
 4073|      0|            osMsg += ", but plugin ";
 4074|      0|            osMsg +=
 4075|      0|                GDALGetMessageAboutMissingPluginDriver(poMissingPluginDriver);
 4076|       |
 4077|      0|            CPLError(CE_Failure, CPLE_OpenFailed, "%s", osMsg.c_str());
  ------------------
  |  |   91|      0|#define CPLE_OpenFailed 4
  ------------------
 4078|      0|        }
 4079|       |        // Check to see if there was a filesystem error, and report it if so.
 4080|       |        // If not, return a more generic error.
 4081|      0|        else if (!VSIToCPLError(CE_Failure, CPLE_OpenFailed))
  ------------------
  |  |   91|      0|#define CPLE_OpenFailed 4
  ------------------
  |  Branch (4081:18): [True: 0, False: 0]
  ------------------
 4082|      0|        {
 4083|      0|            if (oOpenInfo.bStatOK)
  ------------------
  |  Branch (4083:17): [True: 0, False: 0]
  ------------------
 4084|      0|            {
 4085|      0|                CPLError(CE_Failure, CPLE_OpenFailed,
  ------------------
  |  |   91|      0|#define CPLE_OpenFailed 4
  ------------------
 4086|      0|                         "`%s' not recognized as being in a supported file "
 4087|      0|                         "format.",
 4088|      0|                         pszFilename);
 4089|      0|            }
 4090|      0|            else
 4091|      0|            {
 4092|       |                // If Stat failed and no VSI error was set, assume it is because
 4093|       |                // the file did not exist on the filesystem.
 4094|      0|                CPLError(CE_Failure, CPLE_OpenFailed,
  ------------------
  |  |   91|      0|#define CPLE_OpenFailed 4
  ------------------
 4095|      0|                         "`%s' does not exist in the file system, "
 4096|      0|                         "and is not recognized as a supported dataset name.",
 4097|      0|                         pszFilename);
 4098|      0|            }
 4099|      0|        }
 4100|      0|    }
 4101|       |
 4102|  5.78k|    return nullptr;
 4103|  5.78k|}
GDALClose:
 4176|  1.52k|{
 4177|  1.52k|    if (!hDS)
  ------------------
  |  Branch (4177:9): [True: 0, False: 1.52k]
  ------------------
 4178|      0|        return CE_None;
 4179|       |
 4180|       |#ifdef OGRAPISPY_ENABLED
 4181|       |    if (bOGRAPISpyEnabled)
 4182|       |        OGRAPISpyPreClose(hDS);
 4183|       |#endif
 4184|       |
 4185|  1.52k|    GDALDataset *poDS = GDALDataset::FromHandle(hDS);
 4186|       |
 4187|  1.52k|    if (poDS->GetShared())
  ------------------
  |  Branch (4187:9): [True: 0, False: 1.52k]
  ------------------
 4188|      0|    {
 4189|       |        /* --------------------------------------------------------------------
 4190|       |         */
 4191|       |        /*      If this file is in the shared dataset list then dereference */
 4192|       |        /*      it, and only delete/remote it if the reference count has */
 4193|       |        /*      dropped to zero. */
 4194|       |        /* --------------------------------------------------------------------
 4195|       |         */
 4196|      0|        if (poDS->Dereference() > 0)
  ------------------
  |  Branch (4196:13): [True: 0, False: 0]
  ------------------
 4197|      0|            return CE_None;
 4198|       |
 4199|      0|        CPLErr eErr = poDS->Close();
 4200|      0|        delete poDS;
 4201|       |
 4202|       |#ifdef OGRAPISPY_ENABLED
 4203|       |        if (bOGRAPISpyEnabled)
 4204|       |            OGRAPISpyPostClose();
 4205|       |#endif
 4206|       |
 4207|      0|        return eErr;
 4208|      0|    }
 4209|       |
 4210|       |    /* -------------------------------------------------------------------- */
 4211|       |    /*      This is not shared dataset, so directly delete it.              */
 4212|       |    /* -------------------------------------------------------------------- */
 4213|  1.52k|    CPLErr eErr = poDS->Close();
 4214|  1.52k|    delete poDS;
 4215|       |
 4216|       |#ifdef OGRAPISPY_ENABLED
 4217|       |    if (bOGRAPISpyEnabled)
 4218|       |        OGRAPISpyPostClose();
 4219|       |#endif
 4220|  1.52k|    return eErr;
 4221|  1.52k|}
_ZN11GDALDataset7PrivateC2Ev:
  117|  7.27k|    Private() = default;
gdaldataset.cpp:_ZL20GetAntiRecursionOpenv:
 3197|  7.31k|{
 3198|  7.31k|    return g_tls_antiRecursion;
 3199|  7.31k|}
_ZN23GDALAntiRecursionStruct14DatasetContextC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiS9_:
 3138|  7.31k|            : osFilename(osFilenameIn), nOpenFlags(nOpenFlagsIn),
 3139|  7.31k|              osAllowedDrivers(osAllowedDriversIn)
 3140|  7.31k|        {
 3141|  7.31k|        }
_ZNK23GDALAntiRecursionStruct21DatasetContextCompareclERKNS_14DatasetContextES3_:
 3148|  14.5k|        {
 3149|  14.5k|            return lhs.osFilename < rhs.osFilename ||
  ------------------
  |  Branch (3149:20): [True: 0, False: 14.5k]
  ------------------
 3150|  14.5k|                   (lhs.osFilename == rhs.osFilename &&
  ------------------
  |  Branch (3150:21): [True: 14.5k, False: 0]
  ------------------
 3151|  14.5k|                    (lhs.nOpenFlags < rhs.nOpenFlags ||
  ------------------
  |  Branch (3151:22): [True: 0, False: 14.5k]
  ------------------
 3152|  14.5k|                     (lhs.nOpenFlags == rhs.nOpenFlags &&
  ------------------
  |  Branch (3152:23): [True: 14.5k, False: 0]
  ------------------
 3153|  14.5k|                      lhs.osAllowedDrivers < rhs.osAllowedDrivers)));
  ------------------
  |  Branch (3153:23): [True: 0, False: 14.5k]
  ------------------
 3154|  14.5k|        }

_ZN20GDALDefaultOverviewsC2Ev:
   40|  7.27k|    : poDS(nullptr), poODS(nullptr), bOvrIsAux(false), bCheckedForMask(false),
   41|  7.27k|      bOwnMaskDS(false), poMaskDS(nullptr), poBaseDS(nullptr),
   42|  7.27k|      bCheckedForOverviews(FALSE), pszInitName(nullptr), bInitNameIsOVR(false),
  ------------------
  |  | 1039|  7.27k|#define FALSE 0
  ------------------
   43|  7.27k|      papszInitSiblingFiles(nullptr)
   44|  7.27k|{
   45|  7.27k|}
_ZN20GDALDefaultOverviewsD2Ev:
   53|  7.27k|{
   54|  7.27k|    CPLFree(pszInitName);
  ------------------
  |  |   86|  7.27k|#define CPLFree VSIFree
  ------------------
   55|  7.27k|    CSLDestroy(papszInitSiblingFiles);
   56|       |
   57|  7.27k|    CloseDependentDatasets();
   58|  7.27k|}
_ZN20GDALDefaultOverviews22CloseDependentDatasetsEv:
   65|  7.27k|{
   66|  7.27k|    bool bHasDroppedRef = false;
   67|  7.27k|    if (poODS != nullptr)
  ------------------
  |  Branch (67:9): [True: 0, False: 7.27k]
  ------------------
   68|      0|    {
   69|      0|        bHasDroppedRef = true;
   70|      0|        poODS->FlushCache(true);
   71|      0|        GDALClose(poODS);
   72|      0|        poODS = nullptr;
   73|      0|    }
   74|       |
   75|  7.27k|    if (poMaskDS != nullptr)
  ------------------
  |  Branch (75:9): [True: 0, False: 7.27k]
  ------------------
   76|      0|    {
   77|      0|        if (bOwnMaskDS)
  ------------------
  |  Branch (77:13): [True: 0, False: 0]
  ------------------
   78|      0|        {
   79|      0|            bHasDroppedRef = true;
   80|      0|            poMaskDS->FlushCache(true);
   81|      0|            GDALClose(poMaskDS);
   82|      0|        }
   83|      0|        poMaskDS = nullptr;
   84|      0|    }
   85|       |
   86|  7.27k|    return bHasDroppedRef;
   87|  7.27k|}

gdaldllmain.cpp:_ZL14GDALInitializev:
  101|      2|{
  102|       |    // nothing to do
  103|       |    // CPLDebug("GDAL", "Library loaded");
  104|       |#ifdef DEBUG
  105|       |    const char *pszLocale = CPLGetConfigOption("GDAL_LOCALE", nullptr);
  106|       |    if (pszLocale)
  107|       |        CPLsetlocale(LC_ALL, pszLocale);
  108|       |#endif
  109|      2|}

_ZN10GDALDriverC2Ev:
   41|      2|GDALDriver::GDALDriver() = default;
_ZN10GDALDriver4OpenEP12GDALOpenInfob:
   97|  7.27k|{
   98|       |
   99|  7.27k|    GDALDataset *poDS = nullptr;
  100|  7.27k|    pfnOpen = GetOpenCallback();
  101|  7.27k|    if (pfnOpen != nullptr)
  ------------------
  |  Branch (101:9): [True: 7.27k, False: 0]
  ------------------
  102|  7.27k|    {
  103|  7.27k|        poDS = pfnOpen(poOpenInfo);
  104|  7.27k|    }
  105|      0|    else if (pfnOpenWithDriverArg != nullptr)
  ------------------
  |  Branch (105:14): [True: 0, False: 0]
  ------------------
  106|      0|    {
  107|      0|        poDS = pfnOpenWithDriverArg(this, poOpenInfo);
  108|      0|    }
  109|       |
  110|  7.27k|    if (poDS)
  ------------------
  |  Branch (110:9): [True: 1.52k, False: 5.74k]
  ------------------
  111|  1.52k|    {
  112|       |        // Only set GDAL_OF_THREAD_SAFE if the driver itself has set it in
  113|       |        // poDS->nOpenFlags
  114|  1.52k|        int nOpenFlags = poOpenInfo->nOpenFlags &
  115|  1.52k|                         ~(GDAL_OF_FROM_GDALOPEN | GDAL_OF_THREAD_SAFE);
  ------------------
  |  | 1133|  1.52k|#define GDAL_OF_FROM_GDALOPEN 0x400
  ------------------
                                       ~(GDAL_OF_FROM_GDALOPEN | GDAL_OF_THREAD_SAFE);
  ------------------
  |  | 1142|  1.52k|#define GDAL_OF_THREAD_SAFE 0x800
  ------------------
  116|  1.52k|        if (poDS->nOpenFlags & GDAL_OF_THREAD_SAFE)
  ------------------
  |  | 1142|  1.52k|#define GDAL_OF_THREAD_SAFE 0x800
  ------------------
  |  Branch (116:13): [True: 0, False: 1.52k]
  ------------------
  117|      0|            nOpenFlags |= GDAL_OF_THREAD_SAFE;
  ------------------
  |  | 1142|      0|#define GDAL_OF_THREAD_SAFE 0x800
  ------------------
  118|  1.52k|        poDS->nOpenFlags = nOpenFlags;
  119|       |
  120|  1.52k|        if (strlen(poDS->GetDescription()) == 0)
  ------------------
  |  Branch (120:13): [True: 0, False: 1.52k]
  ------------------
  121|      0|            poDS->SetDescription(poOpenInfo->pszFilename);
  122|       |
  123|  1.52k|        if (poDS->poDriver == nullptr)
  ------------------
  |  Branch (123:13): [True: 1.52k, False: 0]
  ------------------
  124|  1.52k|            poDS->poDriver = this;
  125|       |
  126|  1.52k|        if (poDS->papszOpenOptions == nullptr && bSetOpenOptions)
  ------------------
  |  Branch (126:13): [True: 1.52k, False: 0]
  |  Branch (126:50): [True: 0, False: 1.52k]
  ------------------
  127|      0|        {
  128|      0|            poDS->papszOpenOptions = CSLDuplicate(poOpenInfo->papszOpenOptions);
  129|      0|        }
  130|       |
  131|  1.52k|        if (!(poOpenInfo->nOpenFlags & GDAL_OF_INTERNAL))
  ------------------
  |  | 1088|  1.52k|#define GDAL_OF_INTERNAL 0x80
  ------------------
  |  Branch (131:13): [True: 1.52k, False: 0]
  ------------------
  132|  1.52k|        {
  133|  1.52k|            if (CPLGetPID() != GDALGetResponsiblePIDForCurrentThread())
  ------------------
  |  Branch (133:17): [True: 0, False: 1.52k]
  ------------------
  134|      0|                CPLDebug(
  135|      0|                    "GDAL",
  136|      0|                    "GDALOpen(%s, this=%p) succeeds as "
  137|      0|                    "%s (pid=%d, responsiblePID=%d).",
  138|      0|                    poOpenInfo->pszFilename, poDS, GetDescription(),
  139|      0|                    static_cast<int>(CPLGetPID()),
  140|      0|                    static_cast<int>(GDALGetResponsiblePIDForCurrentThread()));
  141|  1.52k|            else
  142|  1.52k|                CPLDebug("GDAL", "GDALOpen(%s, this=%p) succeeds as %s.",
  143|  1.52k|                         poOpenInfo->pszFilename, poDS, GetDescription());
  144|       |
  145|  1.52k|            poDS->AddToDatasetOpenList();
  146|  1.52k|        }
  147|  1.52k|    }
  148|       |
  149|  7.27k|    return poDS;
  150|  7.27k|}
_Z23GDALValidateOpenOptionsPvPKPKc:
 2229|  7.27k|{
 2230|  7.27k|    VALIDATE_POINTER1(hDriver, "GDALValidateOpenOptions", FALSE);
  ------------------
  |  |  471|  7.27k|    do                                                                         \
  |  |  472|  7.27k|    {                                                                          \
  |  |  473|  7.27k|        if (CPL_NULLPTR == ptr)                                                \
  |  |  ------------------
  |  |  |  | 1066|  7.27k|#define CPL_NULLPTR nullptr
  |  |  ------------------
  |  |  |  Branch (473:13): [True: 0, False: 7.27k]
  |  |  ------------------
  |  |  474|  7.27k|        {                                                                      \
  |  |  475|      0|            CPLErr const ret = VALIDATE_POINTER_ERR;                           \
  |  |  ------------------
  |  |  |  |  354|      0|#define VALIDATE_POINTER_ERR CE_Failure
  |  |  ------------------
  |  |  476|      0|            CPLError(ret, CPLE_ObjectNull,                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#define CPLE_ObjectNull 10
  |  |  ------------------
  |  |  477|      0|                     "Pointer \'%s\' is NULL in \'%s\'.\n", #ptr, (func));     \
  |  |  478|      0|            return (rc);                                                       \
  |  |  479|      0|        }                                                                      \
  |  |  480|  7.27k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2231|  7.27k|    const char *pszOptionList =
 2232|  7.27k|        GDALDriver::FromHandle(hDriver)->GetMetadataItem(
 2233|  7.27k|            GDAL_DMD_OPENOPTIONLIST);
  ------------------
  |  |  479|  7.27k|#define GDAL_DMD_OPENOPTIONLIST "DMD_OPENOPTIONLIST"
  ------------------
 2234|  7.27k|    CPLString osDriver;
 2235|  7.27k|    osDriver.Printf("driver %s",
 2236|  7.27k|                    GDALDriver::FromHandle(hDriver)->GetDescription());
 2237|  7.27k|    return GDALValidateOptions(pszOptionList, papszOpenOptions, "open option",
 2238|  7.27k|                               osDriver);
 2239|  7.27k|}
_Z19GDALValidateOptionsPKcPKS0_S0_S0_:
 2249|  7.27k|{
 2250|  7.27k|    if (papszOptionsToValidate == nullptr || *papszOptionsToValidate == nullptr)
  ------------------
  |  Branch (2250:9): [True: 7.27k, False: 0]
  |  Branch (2250:46): [True: 0, False: 0]
  ------------------
 2251|  7.27k|        return TRUE;
  ------------------
  |  | 1043|  7.27k|#define TRUE 1
  ------------------
 2252|      0|    if (pszOptionList == nullptr)
  ------------------
  |  Branch (2252:9): [True: 0, False: 0]
  ------------------
 2253|      0|        return TRUE;
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
 2254|       |
 2255|      0|    CPLXMLNode *psNode = CPLParseXMLString(pszOptionList);
 2256|      0|    if (psNode == nullptr)
  ------------------
  |  Branch (2256:9): [True: 0, False: 0]
  ------------------
 2257|      0|    {
 2258|      0|        CPLError(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 2259|      0|                 "Could not parse %s list of %s. Assuming options are valid.",
 2260|      0|                 pszErrorMessageOptionType, pszErrorMessageContainerName);
 2261|      0|        return TRUE;
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
 2262|      0|    }
 2263|       |
 2264|      0|    bool bRet = true;
 2265|      0|    while (*papszOptionsToValidate)
  ------------------
  |  Branch (2265:12): [True: 0, False: 0]
  ------------------
 2266|      0|    {
 2267|      0|        char *pszKey = nullptr;
 2268|      0|        const char *pszValue =
 2269|      0|            CPLParseNameValue(*papszOptionsToValidate, &pszKey);
 2270|      0|        if (pszKey == nullptr)
  ------------------
  |  Branch (2270:13): [True: 0, False: 0]
  ------------------
 2271|      0|        {
 2272|      0|            CPLError(CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 2273|      0|                     "%s '%s' is not formatted with the key=value format",
 2274|      0|                     pszErrorMessageOptionType, *papszOptionsToValidate);
 2275|      0|            bRet = false;
 2276|       |
 2277|      0|            ++papszOptionsToValidate;
 2278|      0|            continue;
 2279|      0|        }
 2280|       |
 2281|      0|        if (EQUAL(pszKey, "VALIDATE_OPEN_OPTIONS"))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2282|      0|        {
 2283|      0|            ++papszOptionsToValidate;
 2284|      0|            CPLFree(pszKey);
  ------------------
  |  |   86|      0|#define CPLFree VSIFree
  ------------------
 2285|      0|            continue;
 2286|      0|        }
 2287|       |
 2288|       |        // Must we be forgiving in case of missing option ?
 2289|      0|        bool bWarnIfMissingKey = true;
 2290|      0|        if (pszKey[0] == '@')
  ------------------
  |  Branch (2290:13): [True: 0, False: 0]
  ------------------
 2291|      0|        {
 2292|      0|            bWarnIfMissingKey = false;
 2293|      0|            memmove(pszKey, pszKey + 1, strlen(pszKey + 1) + 1);
 2294|      0|        }
 2295|       |
 2296|      0|        CPLXMLNode *psChildNode = psNode->psChild;
 2297|      0|        while (psChildNode)
  ------------------
  |  Branch (2297:16): [True: 0, False: 0]
  ------------------
 2298|      0|        {
 2299|      0|            if (EQUAL(psChildNode->pszValue, "OPTION"))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2300|      0|            {
 2301|      0|                const char *pszOptionName =
 2302|      0|                    CPLGetXMLValue(psChildNode, "name", "");
 2303|       |                /* For option names terminated by wildcard (NITF BLOCKA option
 2304|       |                 * names for example) */
 2305|      0|                if (strlen(pszOptionName) > 0 &&
  ------------------
  |  Branch (2305:21): [True: 0, False: 0]
  ------------------
 2306|      0|                    pszOptionName[strlen(pszOptionName) - 1] == '*' &&
  ------------------
  |  Branch (2306:21): [True: 0, False: 0]
  ------------------
 2307|      0|                    EQUALN(pszOptionName, pszKey, strlen(pszOptionName) - 1))
  ------------------
  |  |  539|      0|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  ------------------
  |  |  |  |  536|      0|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  ------------------
  |  |  |  Branch (539:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2308|      0|                {
 2309|      0|                    break;
 2310|      0|                }
 2311|       |
 2312|       |                /* For option names beginning by a wildcard */
 2313|      0|                if (pszOptionName[0] == '*' &&
  ------------------
  |  Branch (2313:21): [True: 0, False: 0]
  ------------------
 2314|      0|                    strlen(pszKey) > strlen(pszOptionName) &&
  ------------------
  |  Branch (2314:21): [True: 0, False: 0]
  ------------------
 2315|      0|                    EQUAL(pszKey + strlen(pszKey) - strlen(pszOptionName + 1),
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2316|      0|                          pszOptionName + 1))
 2317|      0|                {
 2318|      0|                    break;
 2319|      0|                }
 2320|       |
 2321|       |                // For options names with * in the middle
 2322|      0|                const char *pszStarInOptionName = strchr(pszOptionName, '*');
 2323|      0|                if (pszStarInOptionName &&
  ------------------
  |  Branch (2323:21): [True: 0, False: 0]
  ------------------
 2324|      0|                    pszStarInOptionName != pszOptionName &&
  ------------------
  |  Branch (2324:21): [True: 0, False: 0]
  ------------------
 2325|      0|                    pszStarInOptionName !=
  ------------------
  |  Branch (2325:21): [True: 0, False: 0]
  ------------------
 2326|      0|                        pszOptionName + strlen(pszOptionName) - 1 &&
 2327|      0|                    strlen(pszKey) > static_cast<size_t>(pszStarInOptionName -
  ------------------
  |  Branch (2327:21): [True: 0, False: 0]
  ------------------
 2328|      0|                                                         pszOptionName) &&
 2329|      0|                    EQUALN(pszKey, pszOptionName,
  ------------------
  |  |  539|      0|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  ------------------
  |  |  |  |  536|      0|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  ------------------
  |  |  |  Branch (539:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2330|      0|                           static_cast<size_t>(pszStarInOptionName -
 2331|      0|                                               pszOptionName)) &&
 2332|      0|                    EQUAL(pszKey +
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2333|      0|                              static_cast<size_t>(pszStarInOptionName -
 2334|      0|                                                  pszOptionName) +
 2335|      0|                              1,
 2336|      0|                          pszStarInOptionName + 1))
 2337|      0|                {
 2338|      0|                    break;
 2339|      0|                }
 2340|       |
 2341|      0|                if (EQUAL(pszOptionName, pszKey))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2342|      0|                {
 2343|      0|                    break;
 2344|      0|                }
 2345|      0|                const char *pszAlias = CPLGetXMLValue(
 2346|      0|                    psChildNode, "alias",
 2347|      0|                    CPLGetXMLValue(psChildNode, "deprecated_alias", ""));
 2348|      0|                if (EQUAL(pszAlias, pszKey))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2349|      0|                {
 2350|      0|                    CPLDebug("GDAL",
 2351|      0|                             "Using deprecated alias '%s'. New name is '%s'",
 2352|      0|                             pszAlias, pszOptionName);
 2353|      0|                    break;
 2354|      0|                }
 2355|      0|            }
 2356|      0|            psChildNode = psChildNode->psNext;
 2357|      0|        }
 2358|      0|        if (psChildNode == nullptr)
  ------------------
  |  Branch (2358:13): [True: 0, False: 0]
  ------------------
 2359|      0|        {
 2360|      0|            if (bWarnIfMissingKey &&
  ------------------
  |  Branch (2360:17): [True: 0, False: 0]
  ------------------
 2361|      0|                (!EQUAL(pszErrorMessageOptionType, "open option") ||
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  ------------------
  |  Branch (2361:18): [True: 0, False: 0]
  ------------------
 2362|      0|                 CPLFetchBool(papszOptionsToValidate, "VALIDATE_OPEN_OPTIONS",
  ------------------
  |  Branch (2362:18): [True: 0, False: 0]
  ------------------
 2363|      0|                              true)))
 2364|      0|            {
 2365|      0|                CPLError(CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 2366|      0|                         "%s does not support %s %s",
 2367|      0|                         pszErrorMessageContainerName,
 2368|      0|                         pszErrorMessageOptionType, pszKey);
 2369|      0|                bRet = false;
 2370|      0|            }
 2371|       |
 2372|      0|            CPLFree(pszKey);
  ------------------
  |  |   86|      0|#define CPLFree VSIFree
  ------------------
 2373|      0|            ++papszOptionsToValidate;
 2374|      0|            continue;
 2375|      0|        }
 2376|       |
 2377|       |#ifdef DEBUG
 2378|       |        CPLXMLNode *psChildSubNode = psChildNode->psChild;
 2379|       |        while (psChildSubNode)
 2380|       |        {
 2381|       |            if (psChildSubNode->eType == CXT_Attribute)
 2382|       |            {
 2383|       |                if (!(EQUAL(psChildSubNode->pszValue, "name") ||
 2384|       |                      EQUAL(psChildSubNode->pszValue, "alias") ||
 2385|       |                      EQUAL(psChildSubNode->pszValue, "deprecated_alias") ||
 2386|       |                      EQUAL(psChildSubNode->pszValue, "alt_config_option") ||
 2387|       |                      EQUAL(psChildSubNode->pszValue, "description") ||
 2388|       |                      EQUAL(psChildSubNode->pszValue, "type") ||
 2389|       |                      EQUAL(psChildSubNode->pszValue, "min") ||
 2390|       |                      EQUAL(psChildSubNode->pszValue, "max") ||
 2391|       |                      EQUAL(psChildSubNode->pszValue, "default") ||
 2392|       |                      EQUAL(psChildSubNode->pszValue, "maxsize") ||
 2393|       |                      EQUAL(psChildSubNode->pszValue, "required") ||
 2394|       |                      EQUAL(psChildSubNode->pszValue, "scope")))
 2395|       |                {
 2396|       |                    /* Driver error */
 2397|       |                    CPLError(CE_Warning, CPLE_NotSupported,
 2398|       |                             "%s : unhandled attribute '%s' for %s %s.",
 2399|       |                             pszErrorMessageContainerName,
 2400|       |                             psChildSubNode->pszValue, pszKey,
 2401|       |                             pszErrorMessageOptionType);
 2402|       |                }
 2403|       |            }
 2404|       |            psChildSubNode = psChildSubNode->psNext;
 2405|       |        }
 2406|       |#endif
 2407|       |
 2408|      0|        const char *pszType = CPLGetXMLValue(psChildNode, "type", nullptr);
 2409|      0|        const char *pszMin = CPLGetXMLValue(psChildNode, "min", nullptr);
 2410|      0|        const char *pszMax = CPLGetXMLValue(psChildNode, "max", nullptr);
 2411|      0|        if (pszType != nullptr)
  ------------------
  |  Branch (2411:13): [True: 0, False: 0]
  ------------------
 2412|      0|        {
 2413|      0|            if (EQUAL(pszType, "INT") || EQUAL(pszType, "INTEGER"))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                          if (EQUAL(pszType, "INT") || EQUAL(pszType, "INTEGER"))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2414|      0|            {
 2415|      0|                const char *pszValueIter = pszValue;
 2416|      0|                while (*pszValueIter)
  ------------------
  |  Branch (2416:24): [True: 0, False: 0]
  ------------------
 2417|      0|                {
 2418|      0|                    if (!((*pszValueIter >= '0' && *pszValueIter <= '9') ||
  ------------------
  |  Branch (2418:28): [True: 0, False: 0]
  |  Branch (2418:52): [True: 0, False: 0]
  ------------------
 2419|      0|                          *pszValueIter == '+' || *pszValueIter == '-'))
  ------------------
  |  Branch (2419:27): [True: 0, False: 0]
  |  Branch (2419:51): [True: 0, False: 0]
  ------------------
 2420|      0|                    {
 2421|      0|                        CPLError(CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 2422|      0|                                 "'%s' is an unexpected value for %s %s of "
 2423|      0|                                 "type int.",
 2424|      0|                                 pszValue, pszKey, pszErrorMessageOptionType);
 2425|      0|                        bRet = false;
 2426|      0|                        break;
 2427|      0|                    }
 2428|      0|                    ++pszValueIter;
 2429|      0|                }
 2430|      0|                if (*pszValueIter == '\0')
  ------------------
  |  Branch (2430:21): [True: 0, False: 0]
  ------------------
 2431|      0|                {
 2432|      0|                    if (pszMin && atoi(pszValue) < atoi(pszMin))
  ------------------
  |  Branch (2432:25): [True: 0, False: 0]
  |  Branch (2432:35): [True: 0, False: 0]
  ------------------
 2433|      0|                    {
 2434|      0|                        CPLError(CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 2435|      0|                                 "'%s' is an unexpected value for %s %s that "
 2436|      0|                                 "should be >= %s.",
 2437|      0|                                 pszValue, pszKey, pszErrorMessageOptionType,
 2438|      0|                                 pszMin);
 2439|      0|                        bRet = false;
 2440|      0|                    }
 2441|      0|                    if (pszMax && atoi(pszValue) > atoi(pszMax))
  ------------------
  |  Branch (2441:25): [True: 0, False: 0]
  |  Branch (2441:35): [True: 0, False: 0]
  ------------------
 2442|      0|                    {
 2443|      0|                        CPLError(CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 2444|      0|                                 "'%s' is an unexpected value for %s %s that "
 2445|      0|                                 "should be <= %s.",
 2446|      0|                                 pszValue, pszKey, pszErrorMessageOptionType,
 2447|      0|                                 pszMax);
 2448|      0|                        bRet = false;
 2449|      0|                    }
 2450|      0|                }
 2451|      0|            }
 2452|      0|            else if (EQUAL(pszType, "UNSIGNED INT"))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2453|      0|            {
 2454|      0|                const char *pszValueIter = pszValue;
 2455|      0|                while (*pszValueIter)
  ------------------
  |  Branch (2455:24): [True: 0, False: 0]
  ------------------
 2456|      0|                {
 2457|      0|                    if (!((*pszValueIter >= '0' && *pszValueIter <= '9') ||
  ------------------
  |  Branch (2457:28): [True: 0, False: 0]
  |  Branch (2457:52): [True: 0, False: 0]
  ------------------
 2458|      0|                          *pszValueIter == '+'))
  ------------------
  |  Branch (2458:27): [True: 0, False: 0]
  ------------------
 2459|      0|                    {
 2460|      0|                        CPLError(CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 2461|      0|                                 "'%s' is an unexpected value for %s %s of "
 2462|      0|                                 "type unsigned int.",
 2463|      0|                                 pszValue, pszKey, pszErrorMessageOptionType);
 2464|      0|                        bRet = false;
 2465|      0|                        break;
 2466|      0|                    }
 2467|      0|                    ++pszValueIter;
 2468|      0|                }
 2469|      0|                if (*pszValueIter == '\0')
  ------------------
  |  Branch (2469:21): [True: 0, False: 0]
  ------------------
 2470|      0|                {
 2471|      0|                    if (pszMin && atoi(pszValue) < atoi(pszMin))
  ------------------
  |  Branch (2471:25): [True: 0, False: 0]
  |  Branch (2471:35): [True: 0, False: 0]
  ------------------
 2472|      0|                    {
 2473|      0|                        CPLError(CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 2474|      0|                                 "'%s' is an unexpected value for %s %s that "
 2475|      0|                                 "should be >= %s.",
 2476|      0|                                 pszValue, pszKey, pszErrorMessageOptionType,
 2477|      0|                                 pszMin);
 2478|      0|                        bRet = false;
 2479|      0|                    }
 2480|      0|                    if (pszMax && atoi(pszValue) > atoi(pszMax))
  ------------------
  |  Branch (2480:25): [True: 0, False: 0]
  |  Branch (2480:35): [True: 0, False: 0]
  ------------------
 2481|      0|                    {
 2482|      0|                        CPLError(CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 2483|      0|                                 "'%s' is an unexpected value for %s %s that "
 2484|      0|                                 "should be <= %s.",
 2485|      0|                                 pszValue, pszKey, pszErrorMessageOptionType,
 2486|      0|                                 pszMax);
 2487|      0|                        bRet = false;
 2488|      0|                    }
 2489|      0|                }
 2490|      0|            }
 2491|      0|            else if (EQUAL(pszType, "FLOAT"))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2492|      0|            {
 2493|      0|                char *endPtr = nullptr;
 2494|      0|                double dfVal = CPLStrtod(pszValue, &endPtr);
 2495|      0|                if (!(endPtr == nullptr || *endPtr == '\0'))
  ------------------
  |  Branch (2495:23): [True: 0, False: 0]
  |  Branch (2495:44): [True: 0, False: 0]
  ------------------
 2496|      0|                {
 2497|      0|                    CPLError(
 2498|      0|                        CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 2499|      0|                        "'%s' is an unexpected value for %s %s of type float.",
 2500|      0|                        pszValue, pszKey, pszErrorMessageOptionType);
 2501|      0|                    bRet = false;
 2502|      0|                }
 2503|      0|                else
 2504|      0|                {
 2505|      0|                    if (pszMin && dfVal < CPLAtof(pszMin))
  ------------------
  |  Branch (2505:25): [True: 0, False: 0]
  |  Branch (2505:35): [True: 0, False: 0]
  ------------------
 2506|      0|                    {
 2507|      0|                        CPLError(CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 2508|      0|                                 "'%s' is an unexpected value for %s %s that "
 2509|      0|                                 "should be >= %s.",
 2510|      0|                                 pszValue, pszKey, pszErrorMessageOptionType,
 2511|      0|                                 pszMin);
 2512|      0|                        bRet = false;
 2513|      0|                    }
 2514|      0|                    if (pszMax && dfVal > CPLAtof(pszMax))
  ------------------
  |  Branch (2514:25): [True: 0, False: 0]
  |  Branch (2514:35): [True: 0, False: 0]
  ------------------
 2515|      0|                    {
 2516|      0|                        CPLError(CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 2517|      0|                                 "'%s' is an unexpected value for %s %s that "
 2518|      0|                                 "should be <= %s.",
 2519|      0|                                 pszValue, pszKey, pszErrorMessageOptionType,
 2520|      0|                                 pszMax);
 2521|      0|                        bRet = false;
 2522|      0|                    }
 2523|      0|                }
 2524|      0|            }
 2525|      0|            else if (EQUAL(pszType, "BOOLEAN"))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2526|      0|            {
 2527|      0|                if (!(EQUAL(pszValue, "ON") || EQUAL(pszValue, "TRUE") ||
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              if (!(EQUAL(pszValue, "ON") || EQUAL(pszValue, "TRUE") ||
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2528|      0|                      EQUAL(pszValue, "YES") || EQUAL(pszValue, "OFF") ||
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                    EQUAL(pszValue, "YES") || EQUAL(pszValue, "OFF") ||
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2529|      0|                      EQUAL(pszValue, "FALSE") || EQUAL(pszValue, "NO")))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                    EQUAL(pszValue, "FALSE") || EQUAL(pszValue, "NO")))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2530|      0|                {
 2531|      0|                    CPLError(CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 2532|      0|                             "'%s' is an unexpected value for %s %s of type "
 2533|      0|                             "boolean.",
 2534|      0|                             pszValue, pszKey, pszErrorMessageOptionType);
 2535|      0|                    bRet = false;
 2536|      0|                }
 2537|      0|            }
 2538|      0|            else if (EQUAL(pszType, "STRING-SELECT"))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2539|      0|            {
 2540|      0|                bool bMatchFound = false;
 2541|      0|                CPLXMLNode *psStringSelect = psChildNode->psChild;
 2542|      0|                while (psStringSelect)
  ------------------
  |  Branch (2542:24): [True: 0, False: 0]
  ------------------
 2543|      0|                {
 2544|      0|                    if (psStringSelect->eType == CXT_Element &&
  ------------------
  |  Branch (2544:25): [True: 0, False: 0]
  ------------------
 2545|      0|                        EQUAL(psStringSelect->pszValue, "Value"))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2546|      0|                    {
 2547|      0|                        CPLXMLNode *psOptionNode = psStringSelect->psChild;
 2548|      0|                        while (psOptionNode)
  ------------------
  |  Branch (2548:32): [True: 0, False: 0]
  ------------------
 2549|      0|                        {
 2550|      0|                            if (psOptionNode->eType == CXT_Text &&
  ------------------
  |  Branch (2550:33): [True: 0, False: 0]
  ------------------
 2551|      0|                                EQUAL(psOptionNode->pszValue, pszValue))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2552|      0|                            {
 2553|      0|                                bMatchFound = true;
 2554|      0|                                break;
 2555|      0|                            }
 2556|      0|                            if (psOptionNode->eType == CXT_Attribute &&
  ------------------
  |  Branch (2556:33): [True: 0, False: 0]
  ------------------
 2557|      0|                                (EQUAL(psOptionNode->pszValue, "alias") ||
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2558|      0|                                 EQUAL(psOptionNode->pszValue,
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2559|      0|                                       "deprecated_alias")) &&
 2560|      0|                                EQUAL(psOptionNode->psChild->pszValue,
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2561|      0|                                      pszValue))
 2562|      0|                            {
 2563|      0|                                bMatchFound = true;
 2564|      0|                                break;
 2565|      0|                            }
 2566|      0|                            psOptionNode = psOptionNode->psNext;
 2567|      0|                        }
 2568|      0|                        if (bMatchFound)
  ------------------
  |  Branch (2568:29): [True: 0, False: 0]
  ------------------
 2569|      0|                            break;
 2570|      0|                    }
 2571|      0|                    psStringSelect = psStringSelect->psNext;
 2572|      0|                }
 2573|      0|                if (!bMatchFound)
  ------------------
  |  Branch (2573:21): [True: 0, False: 0]
  ------------------
 2574|      0|                {
 2575|      0|                    CPLError(CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 2576|      0|                             "'%s' is an unexpected value for %s %s of type "
 2577|      0|                             "string-select.",
 2578|      0|                             pszValue, pszKey, pszErrorMessageOptionType);
 2579|      0|                    bRet = false;
 2580|      0|                }
 2581|      0|            }
 2582|      0|            else if (EQUAL(pszType, "STRING"))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2583|      0|            {
 2584|      0|                const char *pszMaxSize =
 2585|      0|                    CPLGetXMLValue(psChildNode, "maxsize", nullptr);
 2586|      0|                if (pszMaxSize != nullptr)
  ------------------
  |  Branch (2586:21): [True: 0, False: 0]
  ------------------
 2587|      0|                {
 2588|      0|                    if (static_cast<int>(strlen(pszValue)) > atoi(pszMaxSize))
  ------------------
  |  Branch (2588:25): [True: 0, False: 0]
  ------------------
 2589|      0|                    {
 2590|      0|                        CPLError(CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 2591|      0|                                 "'%s' is of size %d, whereas maximum size for "
 2592|      0|                                 "%s %s is %d.",
 2593|      0|                                 pszValue, static_cast<int>(strlen(pszValue)),
 2594|      0|                                 pszKey, pszErrorMessageOptionType,
 2595|      0|                                 atoi(pszMaxSize));
 2596|      0|                        bRet = false;
 2597|      0|                    }
 2598|      0|                }
 2599|      0|            }
 2600|      0|            else
 2601|      0|            {
 2602|       |                /* Driver error */
 2603|      0|                CPLError(CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 2604|      0|                         "%s : type '%s' for %s %s is not recognized.",
 2605|      0|                         pszErrorMessageContainerName, pszType, pszKey,
 2606|      0|                         pszErrorMessageOptionType);
 2607|      0|            }
 2608|      0|        }
 2609|      0|        else
 2610|      0|        {
 2611|       |            /* Driver error */
 2612|      0|            CPLError(CE_Warning, CPLE_NotSupported, "%s : no type for %s %s.",
  ------------------
  |  |   95|      0|#define CPLE_NotSupported 6
  ------------------
 2613|      0|                     pszErrorMessageContainerName, pszKey,
 2614|      0|                     pszErrorMessageOptionType);
 2615|      0|        }
 2616|      0|        CPLFree(pszKey);
  ------------------
  |  |   86|      0|#define CPLFree VSIFree
  ------------------
 2617|      0|        ++papszOptionsToValidate;
 2618|      0|    }
 2619|       |
 2620|      0|    CPLDestroyXMLNode(psNode);
 2621|      0|    return bRet ? TRUE : FALSE;
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
                  return bRet ? TRUE : FALSE;
  ------------------
  |  | 1039|      0|#define FALSE 0
  ------------------
  |  Branch (2621:12): [True: 0, False: 0]
  ------------------
 2622|      0|}
_ZN10GDALDriver15SetMetadataItemEPKcS1_S1_:
 2855|     38|{
 2856|     38|    if (pszDomain == nullptr || pszDomain[0] == '\0')
  ------------------
  |  Branch (2856:9): [True: 0, False: 38]
  |  Branch (2856:33): [True: 38, False: 0]
  ------------------
 2857|     38|    {
 2858|       |        /* Automatically sets GDAL_DMD_EXTENSIONS from GDAL_DMD_EXTENSION */
 2859|     38|        if (EQUAL(pszName, GDAL_DMD_EXTENSION) &&
  ------------------
  |  |  541|     76|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|     38|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 2, False: 36]
  |  |  ------------------
  ------------------
 2860|     38|            GDALMajorObject::GetMetadataItem(GDAL_DMD_EXTENSIONS) == nullptr)
  ------------------
  |  |  435|      2|#define GDAL_DMD_EXTENSIONS "DMD_EXTENSIONS"
  ------------------
  |  Branch (2860:13): [True: 2, False: 0]
  ------------------
 2861|      2|        {
 2862|      2|            GDALMajorObject::SetMetadataItem(GDAL_DMD_EXTENSIONS, pszValue);
  ------------------
  |  |  435|      2|#define GDAL_DMD_EXTENSIONS "DMD_EXTENSIONS"
  ------------------
 2863|      2|        }
 2864|       |        /* and vice-versa if there is a single extension in GDAL_DMD_EXTENSIONS */
 2865|     36|        else if (EQUAL(pszName, GDAL_DMD_EXTENSIONS) &&
  ------------------
  |  |  541|     72|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|     36|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 36]
  |  |  ------------------
  ------------------
 2866|     36|                 strchr(pszValue, ' ') == nullptr &&
  ------------------
  |  Branch (2866:18): [True: 0, False: 0]
  ------------------
 2867|     36|                 GDALMajorObject::GetMetadataItem(GDAL_DMD_EXTENSION) ==
  ------------------
  |  |  424|      0|#define GDAL_DMD_EXTENSION "DMD_EXTENSION"
  ------------------
  |  Branch (2867:18): [True: 0, False: 0]
  ------------------
 2868|      0|                     nullptr)
 2869|      0|        {
 2870|      0|            GDALMajorObject::SetMetadataItem(GDAL_DMD_EXTENSION, pszValue);
  ------------------
  |  |  424|      0|#define GDAL_DMD_EXTENSION "DMD_EXTENSION"
  ------------------
 2871|      0|        }
 2872|     38|    }
 2873|     38|    return GDALMajorObject::SetMetadataItem(pszName, pszValue, pszDomain);
 2874|     38|}

GetGDALDriverManager:
   88|  7.31k|{
   89|  7.31k|    if (poDM == nullptr)
  ------------------
  |  Branch (89:9): [True: 2, False: 7.31k]
  ------------------
   90|      2|    {
   91|      2|        CPLMutexHolderD(&hDMMutex);
  ------------------
  |  |  122|      2|#define CPLMutexHolderD(x) CPLMutexHolder oHolder(x, 1000.0, __FILE__, __LINE__)
  ------------------
   92|       |        // cppcheck-suppress identicalInnerCondition
   93|      2|        if (poDM == nullptr)
  ------------------
  |  Branch (93:13): [True: 2, False: 0]
  ------------------
   94|      2|            poDM = new GDALDriverManager();
   95|      2|    }
   96|       |
   97|  7.31k|    CPLAssert(nullptr != poDM);
  ------------------
  |  |  331|  7.31k|    do                                                                         \
  |  |  332|  7.31k|    {                                                                          \
  |  |  333|  7.31k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
   98|       |
   99|  7.31k|    return const_cast<GDALDriverManager *>(poDM);
  100|  7.31k|}
_ZN17GDALDriverManagerC2Ev:
  110|      2|{
  111|      2|    CPLAssert(poDM == nullptr);
  ------------------
  |  |  331|      2|    do                                                                         \
  |  |  332|      2|    {                                                                          \
  |  |  333|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  112|       |
  113|      2|    CPLLoadConfigOptionsFromPredefinedFiles();
  114|       |
  115|      2|    CPLHTTPSetDefaultUserAgent(
  116|      2|        "GDAL/" STRINGIFY(GDAL_VERSION_MAJOR) "." STRINGIFY(
  117|      2|            GDAL_VERSION_MINOR) "." STRINGIFY(GDAL_VERSION_REV));
  ------------------
  |  |  107|      2|#define STRINGIFY(x) XSTRINGIFY(x)
  |  |  ------------------
  |  |  |  |  106|      2|#define XSTRINGIFY(x) #x
  |  |  ------------------
  ------------------
  118|       |
  119|       |/* -------------------------------------------------------------------- */
  120|       |/*      We want to push a location to search for data files             */
  121|       |/*      supporting GDAL/OGR such as EPSG csv files, S-57 definition     */
  122|       |/*      files, and so forth.  Use the INST_DATA macro (setup at         */
  123|       |/*      configure time) if available. Otherwise we don't push anything  */
  124|       |/*      and we hope other mechanisms such as environment variables will */
  125|       |/*      have been employed.                                             */
  126|       |/* -------------------------------------------------------------------- */
  127|      2|#ifdef INST_DATA
  128|      2|    if (CPLGetConfigOption("GDAL_DATA", nullptr) != nullptr)
  ------------------
  |  Branch (128:9): [True: 2, False: 0]
  ------------------
  129|      2|    {
  130|       |        // This one is picked up automatically by finder initialization.
  131|      2|    }
  132|      0|    else
  133|      0|    {
  134|      0|        CPLPushFinderLocation(INST_DATA);
  135|      0|    }
  136|      2|#endif
  137|      2|}
_ZNK17GDALDriverManager14GetDriverCountEb:
  352|  7.31k|{
  353|  7.31k|    if (!bIncludeHidden)
  ------------------
  |  Branch (353:9): [True: 0, False: 7.31k]
  ------------------
  354|      0|        return nDrivers;
  355|  7.31k|    return nDrivers + static_cast<int>(m_aoHiddenDrivers.size());
  356|  7.31k|}
_ZN17GDALDriverManager9GetDriverEib:
  439|  7.31k|{
  440|  7.31k|    CPLMutexHolderD(&hDMMutex);
  ------------------
  |  |  122|  7.31k|#define CPLMutexHolderD(x) CPLMutexHolder oHolder(x, 1000.0, __FILE__, __LINE__)
  ------------------
  441|  7.31k|    if (!bIncludeHidden || iDriver < nDrivers)
  ------------------
  |  Branch (441:9): [True: 0, False: 7.31k]
  |  Branch (441:28): [True: 7.31k, False: 0]
  ------------------
  442|  7.31k|        return GetDriver_unlocked(iDriver);
  443|      0|    if (iDriver - nDrivers < static_cast<int>(m_aoHiddenDrivers.size()))
  ------------------
  |  Branch (443:9): [True: 0, False: 0]
  ------------------
  444|      0|        return m_aoHiddenDrivers[iDriver - nDrivers].get();
  445|      0|    return nullptr;
  446|      0|}
_ZN17GDALDriverManager14RegisterDriverEP10GDALDriver:
  490|      2|{
  491|      2|    return RegisterDriver(poDriver, /*bHidden=*/false);
  492|      2|}
_ZN17GDALDriverManager14RegisterDriverEP10GDALDriverb:
  495|      2|{
  496|      2|    CPLMutexHolderD(&hDMMutex);
  ------------------
  |  |  122|      2|#define CPLMutexHolderD(x) CPLMutexHolder oHolder(x, 1000.0, __FILE__, __LINE__)
  ------------------
  497|       |
  498|       |    /* -------------------------------------------------------------------- */
  499|       |    /*      If it is already registered, just return the existing           */
  500|       |    /*      index.                                                          */
  501|       |    /* -------------------------------------------------------------------- */
  502|      2|    if (!m_bInDeferredDriverLoading &&
  ------------------
  |  Branch (502:9): [True: 2, False: 0]
  ------------------
  503|      2|        GetDriverByName_unlocked(poDriver->GetDescription()) != nullptr)
  ------------------
  |  Branch (503:9): [True: 0, False: 2]
  ------------------
  504|      0|    {
  505|      0|        for (int i = 0; i < nDrivers; ++i)
  ------------------
  |  Branch (505:25): [True: 0, False: 0]
  ------------------
  506|      0|        {
  507|      0|            if (papoDrivers[i] == poDriver)
  ------------------
  |  Branch (507:17): [True: 0, False: 0]
  ------------------
  508|      0|            {
  509|      0|                return i;
  510|      0|            }
  511|      0|        }
  512|       |
  513|      0|        CPLAssert(false);
  ------------------
  |  |  331|      0|    do                                                                         \
  |  |  332|      0|    {                                                                          \
  |  |  333|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  514|      0|    }
  515|       |
  516|      2|    if (poDriver->pfnOpen != nullptr ||
  ------------------
  |  Branch (516:9): [True: 2, False: 0]
  ------------------
  517|      2|        poDriver->pfnOpenWithDriverArg != nullptr)
  ------------------
  |  Branch (517:9): [True: 0, False: 0]
  ------------------
  518|      2|        poDriver->SetMetadataItem(GDAL_DCAP_OPEN, "YES");
  ------------------
  |  |  569|      2|#define GDAL_DCAP_OPEN "DCAP_OPEN"
  ------------------
  519|       |
  520|      2|    if (poDriver->pfnCreate != nullptr || poDriver->pfnCreateEx != nullptr)
  ------------------
  |  Branch (520:9): [True: 0, False: 2]
  |  Branch (520:43): [True: 0, False: 2]
  ------------------
  521|      0|        poDriver->SetMetadataItem(GDAL_DCAP_CREATE, "YES");
  ------------------
  |  |  579|      0|#define GDAL_DCAP_CREATE "DCAP_CREATE"
  ------------------
  522|       |
  523|      2|    if (poDriver->pfnCreateCopy != nullptr)
  ------------------
  |  Branch (523:9): [True: 0, False: 2]
  ------------------
  524|      0|        poDriver->SetMetadataItem(GDAL_DCAP_CREATECOPY, "YES");
  ------------------
  |  |  595|      0|#define GDAL_DCAP_CREATECOPY "DCAP_CREATECOPY"
  ------------------
  525|       |
  526|      2|    if (poDriver->pfnCreateMultiDimensional != nullptr)
  ------------------
  |  Branch (526:9): [True: 0, False: 2]
  ------------------
  527|      0|        poDriver->SetMetadataItem(GDAL_DCAP_CREATE_MULTIDIMENSIONAL, "YES");
  ------------------
  |  |  585|      0|#define GDAL_DCAP_CREATE_MULTIDIMENSIONAL "DCAP_CREATE_MULTIDIMENSIONAL"
  ------------------
  528|       |
  529|       |    // Backward compatibility for GDAL raster out-of-tree drivers:
  530|       |    // If a driver hasn't explicitly set a vector capability, assume it is
  531|       |    // a raster-only driver (legacy OGR drivers will have DCAP_VECTOR set before
  532|       |    // calling RegisterDriver()).
  533|      2|    if (poDriver->GetMetadataItem(GDAL_DCAP_RASTER) == nullptr &&
  ------------------
  |  |  633|      2|#define GDAL_DCAP_RASTER "DCAP_RASTER"
  ------------------
  |  Branch (533:9): [True: 0, False: 2]
  ------------------
  534|      2|        poDriver->GetMetadataItem(GDAL_DCAP_VECTOR) == nullptr &&
  ------------------
  |  |  638|      0|#define GDAL_DCAP_VECTOR "DCAP_VECTOR"
  ------------------
  |  Branch (534:9): [True: 0, False: 0]
  ------------------
  535|      2|        poDriver->GetMetadataItem(GDAL_DCAP_GNM) == nullptr)
  ------------------
  |  |  643|      0|#define GDAL_DCAP_GNM "DCAP_GNM"
  ------------------
  |  Branch (535:9): [True: 0, False: 0]
  ------------------
  536|      0|    {
  537|      0|        CPLDebug("GDAL", "Assuming DCAP_RASTER for driver %s. Please fix it.",
  538|      0|                 poDriver->GetDescription());
  539|      0|        poDriver->SetMetadataItem(GDAL_DCAP_RASTER, "YES");
  ------------------
  |  |  633|      0|#define GDAL_DCAP_RASTER "DCAP_RASTER"
  ------------------
  540|      0|    }
  541|       |
  542|      2|    if (poDriver->GetMetadataItem(GDAL_DMD_OPENOPTIONLIST) != nullptr &&
  ------------------
  |  |  479|      2|#define GDAL_DMD_OPENOPTIONLIST "DMD_OPENOPTIONLIST"
  ------------------
  |  Branch (542:9): [True: 2, False: 0]
  ------------------
  543|      2|        poDriver->pfnIdentify == nullptr &&
  ------------------
  |  Branch (543:9): [True: 0, False: 2]
  ------------------
  544|      2|        poDriver->pfnIdentifyEx == nullptr &&
  ------------------
  |  Branch (544:9): [True: 0, False: 0]
  ------------------
  545|      2|        !STARTS_WITH_CI(poDriver->GetDescription(), "Interlis"))
  ------------------
  |  |  552|      0|#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
  |  |  ------------------
  |  |  |  |  539|      0|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (545:9): [True: 0, False: 0]
  ------------------
  546|      0|    {
  547|      0|        CPLDebug("GDAL",
  548|      0|                 "Driver %s that defines GDAL_DMD_OPENOPTIONLIST must also "
  549|      0|                 "implement Identify(), so that it can be used",
  550|      0|                 poDriver->GetDescription());
  551|      0|    }
  552|       |
  553|      2|    if (poDriver->pfnVectorTranslateFrom != nullptr)
  ------------------
  |  Branch (553:9): [True: 0, False: 2]
  ------------------
  554|      0|        poDriver->SetMetadataItem(GDAL_DCAP_VECTOR_TRANSLATE_FROM, "YES");
  ------------------
  |  |  601|      0|#define GDAL_DCAP_VECTOR_TRANSLATE_FROM "DCAP_VECTOR_TRANSLATE_FROM"
  ------------------
  555|       |
  556|      2|    if (m_bInDeferredDriverLoading &&
  ------------------
  |  Branch (556:9): [True: 0, False: 2]
  |  Branch (556:9): [True: 0, False: 2]
  ------------------
  557|      2|        cpl::contains(oMapNameToDrivers,
  ------------------
  |  Branch (557:9): [True: 0, False: 0]
  ------------------
  558|      0|                      CPLString(poDriver->GetDescription()).toupper()))
  559|      0|    {
  560|      0|        if (cpl::contains(m_oMapRealDrivers, poDriver->GetDescription()))
  ------------------
  |  Branch (560:13): [True: 0, False: 0]
  ------------------
  561|      0|        {
  562|      0|            CPLError(
  563|      0|                CE_Failure, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  564|      0|                "RegisterDriver() in m_bInDeferredDriverLoading: %s already "
  565|      0|                "registered!",
  566|      0|                poDriver->GetDescription());
  567|      0|            delete poDriver;
  568|      0|            return -1;
  569|      0|        }
  570|      0|        m_oMapRealDrivers[poDriver->GetDescription()] =
  571|      0|            std::unique_ptr<GDALDriver>(poDriver);
  572|      0|        return -1;
  573|      0|    }
  574|       |
  575|       |    /* -------------------------------------------------------------------- */
  576|       |    /*      Otherwise grow the list to hold the new entry.                  */
  577|       |    /* -------------------------------------------------------------------- */
  578|      2|    if (bHidden)
  ------------------
  |  Branch (578:9): [True: 0, False: 2]
  ------------------
  579|      0|    {
  580|      0|        m_aoHiddenDrivers.push_back(std::unique_ptr<GDALDriver>(poDriver));
  581|      0|        return -1;
  582|      0|    }
  583|       |
  584|      2|    GDALDriver **papoNewDrivers =
  585|      2|        static_cast<GDALDriver **>(VSI_REALLOC_VERBOSE(
  ------------------
  |  |  362|      2|    VSIReallocVerbose(pOldPtr, nNewSize, __FILE__, __LINE__)
  ------------------
  586|      2|            papoDrivers, sizeof(GDALDriver *) * (nDrivers + 1)));
  587|      2|    if (papoNewDrivers == nullptr)
  ------------------
  |  Branch (587:9): [True: 0, False: 2]
  ------------------
  588|      0|        return -1;
  589|      2|    papoDrivers = papoNewDrivers;
  590|       |
  591|      2|    papoDrivers[nDrivers] = poDriver;
  592|      2|    ++nDrivers;
  593|       |
  594|      2|    oMapNameToDrivers[CPLString(poDriver->GetDescription()).toupper()] =
  595|      2|        poDriver;
  596|       |
  597|      2|    if (EQUAL(poDriver->GetDescription(), "MEM") &&
  ------------------
  |  |  541|      4|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      2|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  |  Branch (597:9): [True: 0, False: 2]
  ------------------
  598|      2|        oMapNameToDrivers.find("MEMORY") == oMapNameToDrivers.end())
  ------------------
  |  Branch (598:9): [True: 0, False: 0]
  ------------------
  599|      0|    {
  600|       |        // Instantiate a Memory driver, that is the same as the MEM one,
  601|       |        // for legacy purposes. It can be queried through GetDriverByName()
  602|       |        // but doesn't appear in the driver list.
  603|      0|        auto poMemoryDriver = new GDALDriver();
  604|      0|        poMemoryDriver->SetDescription("Memory");
  605|      0|        poMemoryDriver->SetMetadata(poDriver->GetMetadata());
  606|      0|        poMemoryDriver->pfnOpen = poDriver->pfnOpen;
  607|      0|        poMemoryDriver->pfnIdentify = poDriver->pfnIdentify;
  608|      0|        poMemoryDriver->pfnCreate = poDriver->pfnCreate;
  609|      0|        poMemoryDriver->pfnCreateMultiDimensional =
  610|      0|            poDriver->pfnCreateMultiDimensional;
  611|      0|        poMemoryDriver->pfnDelete = poDriver->pfnDelete;
  612|      0|        oMapNameToDrivers[CPLString(poMemoryDriver->GetDescription())
  613|      0|                              .toupper()] = poMemoryDriver;
  614|      0|    }
  615|       |
  616|      2|    int iResult = nDrivers - 1;
  617|       |
  618|      2|    return iResult;
  619|      2|}
_ZNK17GDALDriverManager24GetDriverByName_unlockedEPKc:
  627|      4|{
  628|      4|    const CPLString osName = CPLString(pszName).toupper();
  629|      4|    if (osName == "MEMORY")
  ------------------
  |  Branch (629:9): [True: 0, False: 4]
  ------------------
  630|      0|    {
  631|      0|        CPLErrorOnce(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |  178|      0|    do                                                                         \
  |  |  179|      0|    {                                                                          \
  |  |  180|      0|        static bool lbCPLErrorOnce = false;                                    \
  |  |  181|      0|        if (!lbCPLErrorOnce)                                                   \
  |  |  ------------------
  |  |  |  Branch (181:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  182|      0|        {                                                                      \
  |  |  183|      0|            lbCPLErrorOnce = true;                                             \
  |  |  184|      0|            const char *lCPLErrorMsg = CPLSPrintf(__VA_ARGS__);                \
  |  |  185|      0|            const size_t lCPLErrorMsgLen = strlen(lCPLErrorMsg);               \
  |  |  186|      0|            const char *lCPLErrorMsgSuffix =                                   \
  |  |  187|      0|                " Further messages of this type will be suppressed.";          \
  |  |  188|      0|            if (lCPLErrorMsgLen && lCPLErrorMsg[lCPLErrorMsgLen - 1] == '.')   \
  |  |  ------------------
  |  |  |  Branch (188:17): [True: 0, False: 0]
  |  |  |  Branch (188:36): [True: 0, False: 0]
  |  |  ------------------
  |  |  189|      0|                CPLError((eErrClass), (err_no), "%s%s", lCPLErrorMsg,          \
  |  |  190|      0|                         lCPLErrorMsgSuffix);                                  \
  |  |  191|      0|            else                                                               \
  |  |  192|      0|                CPLError((eErrClass), (err_no), "%s.%s", lCPLErrorMsg,         \
  |  |  193|      0|                         lCPLErrorMsgSuffix);                                  \
  |  |  194|      0|        }                                                                      \
  |  |  195|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  632|      0|                     "DeprecationWarning: 'Memory' driver is deprecated since "
  633|      0|                     "GDAL 3.11. Use 'MEM' onwards");
  634|      0|    }
  635|      4|    auto oIter = oMapNameToDrivers.find(osName);
  636|      4|    return oIter == oMapNameToDrivers.end() ? nullptr : oIter->second;
  ------------------
  |  Branch (636:12): [True: 4, False: 0]
  ------------------
  637|      4|}
_ZN17GDALDriverManager15GetDriverByNameEPKc:
  732|      2|{
  733|      2|    CPLMutexHolderD(&hDMMutex);
  ------------------
  |  |  122|      2|#define CPLMutexHolderD(x) CPLMutexHolder oHolder(x, 1000.0, __FILE__, __LINE__)
  ------------------
  734|       |
  735|      2|    if (m_bInDeferredDriverLoading)
  ------------------
  |  Branch (735:9): [True: 0, False: 2]
  ------------------
  736|      0|    {
  737|      0|        return nullptr;
  738|      0|    }
  739|       |
  740|       |    // Alias old name to new name
  741|      2|    if (EQUAL(pszName, "CartoDB"))
  ------------------
  |  |  541|      2|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      2|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  742|      0|        pszName = "Carto";
  743|       |
  744|      2|    return GetDriverByName_unlocked(pszName);
  745|      2|}
GDALGetDriverByName:
  759|      2|{
  760|      2|    VALIDATE_POINTER1(pszName, "GDALGetDriverByName", nullptr);
  ------------------
  |  |  471|      2|    do                                                                         \
  |  |  472|      2|    {                                                                          \
  |  |  473|      2|        if (CPL_NULLPTR == ptr)                                                \
  |  |  ------------------
  |  |  |  | 1066|      2|#define CPL_NULLPTR nullptr
  |  |  ------------------
  |  |  |  Branch (473:13): [True: 0, False: 2]
  |  |  ------------------
  |  |  474|      2|        {                                                                      \
  |  |  475|      0|            CPLErr const ret = VALIDATE_POINTER_ERR;                           \
  |  |  ------------------
  |  |  |  |  354|      0|#define VALIDATE_POINTER_ERR CE_Failure
  |  |  ------------------
  |  |  476|      0|            CPLError(ret, CPLE_ObjectNull,                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#define CPLE_ObjectNull 10
  |  |  ------------------
  |  |  477|      0|                     "Pointer \'%s\' is NULL in \'%s\'.\n", #ptr, (func));     \
  |  |  478|      0|            return (rc);                                                       \
  |  |  479|      0|        }                                                                      \
  |  |  480|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  761|       |
  762|      2|    return GetGDALDriverManager()->GetDriverByName(pszName);
  763|      2|}

_ZN15GDALMajorObjectC2Ev:
   28|  8.29k|GDALMajorObject::GDALMajorObject() : nFlags(GMO_VALID)
  ------------------
  |  |   74|  8.29k|#define GMO_VALID 0x0001
  ------------------
   29|  8.29k|{
   30|  8.29k|}
_ZN15GDALMajorObjectD2Ev:
   38|  8.29k|{
   39|  8.29k|    if ((nFlags & GMO_VALID) == 0)
  ------------------
  |  |   74|  8.29k|#define GMO_VALID 0x0001
  ------------------
  |  Branch (39:9): [True: 0, False: 8.29k]
  ------------------
   40|      0|        CPLDebug("GDAL", "In ~GDALMajorObject on invalid object");
   41|       |
   42|  8.29k|    nFlags &= ~GMO_VALID;
  ------------------
  |  |   74|  8.29k|#define GMO_VALID 0x0001
  ------------------
   43|  8.29k|}
_ZNK15GDALMajorObject14GetDescriptionEv:
   63|  13.3k|{
   64|  13.3k|    return sDescription.c_str();
   65|  13.3k|}
_ZN15GDALMajorObject14SetDescriptionEPKc:
  104|  8.29k|{
  105|  8.29k|    sDescription = pszNewDesc;
  106|  8.29k|}
_ZN15GDALMajorObject15GetMetadataItemEPKcS1_:
  328|  21.9k|{
  329|  21.9k|    return oMDMD.GetMetadataItem(pszName, pszDomain);
  330|  21.9k|}
_ZN15GDALMajorObject15SetMetadataItemEPKcS1_S1_:
  373|   108k|{
  374|   108k|    nFlags |= GMO_MD_DIRTY;
  ------------------
  |  |   78|   108k|#define GMO_MD_DIRTY 0x0010
  ------------------
  375|   108k|    return oMDMD.SetMetadataItem(pszName, pszValue, pszDomain);
  376|   108k|}

_ZN23GDALMultiDomainMetadataC2Ev:
   31|  8.29k|GDALMultiDomainMetadata::GDALMultiDomainMetadata() = default;
_ZN23GDALMultiDomainMetadataD2Ev:
   37|  8.29k|GDALMultiDomainMetadata::~GDALMultiDomainMetadata() = default;
_ZN23GDALMultiDomainMetadata15GetMetadataItemEPKcS1_:
  116|  21.9k|{
  117|  21.9k|    const auto oIter = oMetadata.find(SanitizeDomain(pszDomain));
  118|  21.9k|    if (oIter == oMetadata.end())
  ------------------
  |  Branch (118:9): [True: 0, False: 21.9k]
  ------------------
  119|      0|        return nullptr;
  120|  21.9k|    return oIter->second.FetchNameValue(pszName);
  121|  21.9k|}
_ZN23GDALMultiDomainMetadata15SetMetadataItemEPKcS1_S1_:
  131|   108k|{
  132|   108k|    pszDomain = SanitizeDomain(pszDomain);
  133|       |
  134|       |    /* -------------------------------------------------------------------- */
  135|       |    /*      Create the domain if it does not already exist.                 */
  136|       |    /* -------------------------------------------------------------------- */
  137|       |
  138|   108k|    auto oIter = oMetadata.find(pszDomain);
  139|   108k|    if (oIter == oMetadata.end())
  ------------------
  |  Branch (139:9): [True: 1.52k, False: 106k]
  ------------------
  140|  1.52k|    {
  141|  1.52k|        aosDomainList.AddString(pszDomain);
  142|  1.52k|        oIter =
  143|  1.52k|            oMetadata.insert(std::pair(aosDomainList.back(), CPLStringList()))
  144|  1.52k|                .first;
  145|  1.52k|    }
  146|       |
  147|       |    /* -------------------------------------------------------------------- */
  148|       |    /*      Set the value in the domain list.                               */
  149|       |    /* -------------------------------------------------------------------- */
  150|   108k|    oIter->second.SetNameValue(pszName, pszValue);
  151|       |
  152|   108k|    return CE_None;
  153|   108k|}
gdalmultidomainmetadata.cpp:_ZL14SanitizeDomainPKc:
   55|   130k|{
   56|   130k|    return pszDomain ? pszDomain : "";
  ------------------
  |  Branch (56:12): [True: 130k, False: 0]
  ------------------
   57|   130k|}

_ZN12GDALOpenInfoC2EPKciPKS1_:
  154|  7.31k|    : pszFilename(CPLStrdup(pszFilenameIn)),
  155|  7.31k|      osExtension(CPLGetExtensionSafe(pszFilenameIn)),
  156|  7.31k|      eAccess(nOpenFlagsIn & GDAL_OF_UPDATE ? GA_Update : GA_ReadOnly),
  ------------------
  |  | 1034|  7.31k|#define GDAL_OF_UPDATE 0x01
  ------------------
  |  Branch (156:15): [True: 0, False: 7.31k]
  ------------------
  157|  7.31k|      nOpenFlags(nOpenFlagsIn)
  158|  7.31k|{
  159|  7.31k|    if (STARTS_WITH(pszFilename, "MVT:/vsi"))
  ------------------
  |  |  550|  7.31k|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 7.31k]
  |  |  ------------------
  ------------------
  160|      0|        return;
  161|       |
  162|       |/* -------------------------------------------------------------------- */
  163|       |/*      Ensure that C: is treated as C:\ so we can stat it on           */
  164|       |/*      Windows.  Similar to what is done in CPLStat().                 */
  165|       |/* -------------------------------------------------------------------- */
  166|       |#ifdef _WIN32
  167|       |    if (strlen(pszFilenameIn) == 2 && pszFilenameIn[1] == ':')
  168|       |    {
  169|       |        char szAltPath[10];
  170|       |
  171|       |        strcpy(szAltPath, pszFilenameIn);
  172|       |        strcat(szAltPath, "\\");
  173|       |        CPLFree(pszFilename);
  174|       |        pszFilename = CPLStrdup(szAltPath);
  175|       |    }
  176|       |#endif  // WIN32
  177|       |
  178|       |    /* -------------------------------------------------------------------- */
  179|       |    /*      Collect information about the file.                             */
  180|       |    /* -------------------------------------------------------------------- */
  181|       |
  182|  7.31k|#ifdef HAVE_READLINK
  183|  7.31k|    bool bHasRetried = false;
  184|       |
  185|  7.31k|retry:  // TODO(schwehr): Stop using goto.
  186|       |
  187|  7.31k|#endif  // HAVE_READLINK
  188|       |
  189|       |#if !(defined(_WIN32) || defined(__linux__) || defined(__ANDROID__) ||         \
  190|       |      (defined(__MACH__) && defined(__APPLE__)))
  191|       |    /* On BSDs, fread() on a directory returns non zero, so we have to */
  192|       |    /* do a stat() before to check the nature of pszFilename. */
  193|       |    bool bPotentialDirectory = (eAccess == GA_ReadOnly);
  194|       |#else
  195|  7.31k|    bool bPotentialDirectory = false;
  196|  7.31k|#endif
  197|       |
  198|       |    /* Check if the filename might be a directory of a special virtual file
  199|       |     * system */
  200|  7.31k|    if (STARTS_WITH(pszFilename, "/vsizip/") ||
  ------------------
  |  |  550|  14.6k|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 7.31k]
  |  |  ------------------
  ------------------
  201|  7.31k|        STARTS_WITH(pszFilename, "/vsitar/") ||
  ------------------
  |  |  550|  14.6k|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 7.31k]
  |  |  ------------------
  ------------------
  202|  7.31k|        STARTS_WITH(pszFilename, "/vsi7z/") ||
  ------------------
  |  |  550|  14.6k|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 7.31k]
  |  |  ------------------
  ------------------
  203|  7.31k|        STARTS_WITH(pszFilename, "/vsirar/"))
  ------------------
  |  |  550|  7.31k|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 7.31k]
  |  |  ------------------
  ------------------
  204|      0|    {
  205|      0|        const char *pszExt = osExtension.c_str();
  206|      0|        if (EQUAL(pszExt, "zip") || EQUAL(pszExt, "tar") ||
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                      if (EQUAL(pszExt, "zip") || EQUAL(pszExt, "tar") ||
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  207|      0|            EQUAL(pszExt, "gz") || EQUAL(pszExt, "7z") ||
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                          EQUAL(pszExt, "gz") || EQUAL(pszExt, "7z") ||
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  208|      0|            EQUAL(pszExt, "rar") ||
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  209|      0|            pszFilename[strlen(pszFilename) - 1] == '}'
  ------------------
  |  Branch (209:13): [True: 0, False: 0]
  ------------------
  210|       |#ifdef DEBUG
  211|       |            // For AFL, so that .cur_input is detected as the archive filename.
  212|       |            || EQUAL(CPLGetFilename(pszFilename), ".cur_input")
  213|       |#endif  // DEBUG
  214|      0|        )
  215|      0|        {
  216|      0|            bPotentialDirectory = true;
  217|      0|        }
  218|      0|    }
  219|  7.31k|    else if (STARTS_WITH(pszFilename, "/vsicurl/"))
  ------------------
  |  |  550|  7.31k|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 7.31k]
  |  |  ------------------
  ------------------
  220|      0|    {
  221|      0|        bPotentialDirectory = true;
  222|      0|    }
  223|       |
  224|  7.31k|    if (bPotentialDirectory)
  ------------------
  |  Branch (224:9): [True: 0, False: 7.31k]
  ------------------
  225|      0|    {
  226|      0|        int nStatFlags = VSI_STAT_EXISTS_FLAG | VSI_STAT_NATURE_FLAG;
  ------------------
  |  |  194|      0|#define VSI_STAT_EXISTS_FLAG 0x1
  ------------------
                      int nStatFlags = VSI_STAT_EXISTS_FLAG | VSI_STAT_NATURE_FLAG;
  ------------------
  |  |  196|      0|#define VSI_STAT_NATURE_FLAG 0x2
  ------------------
  227|      0|        if (nOpenFlagsIn & GDAL_OF_VERBOSE_ERROR)
  ------------------
  |  | 1080|      0|#define GDAL_OF_VERBOSE_ERROR 0x40
  ------------------
  |  Branch (227:13): [True: 0, False: 0]
  ------------------
  228|      0|            nStatFlags |= VSI_STAT_SET_ERROR_FLAG;
  ------------------
  |  |  200|      0|#define VSI_STAT_SET_ERROR_FLAG 0x8
  ------------------
  229|       |
  230|       |        // For those special files, opening them with VSIFOpenL() might result
  231|       |        // in content, even if they should be considered as directories, so
  232|       |        // use stat.
  233|      0|        VSIStatBufL sStat;
  234|       |
  235|      0|        if (VSIStatExL(pszFilename, &sStat, nStatFlags) == 0)
  ------------------
  |  Branch (235:13): [True: 0, False: 0]
  ------------------
  236|      0|        {
  237|      0|            bStatOK = TRUE;
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
  238|      0|            if (VSI_ISDIR(sStat.st_mode))
  ------------------
  |  |  115|      0|#define VSI_ISDIR(x) S_ISDIR(x)
  ------------------
  239|      0|                bIsDirectory = TRUE;
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
  240|      0|        }
  241|      0|    }
  242|       |
  243|  7.31k|    pabyHeader = GDALOpenInfoGetFileNotToOpen(pszFilename, &nHeaderBytes);
  244|       |
  245|  7.31k|    if (!bIsDirectory && pabyHeader == nullptr)
  ------------------
  |  Branch (245:9): [True: 7.31k, False: 0]
  |  Branch (245:26): [True: 7.31k, False: 0]
  ------------------
  246|  7.31k|    {
  247|  7.31k|        fpL = VSIFOpenExL(pszFilename, (eAccess == GA_Update) ? "r+b" : "rb",
  ------------------
  |  Branch (247:40): [True: 0, False: 7.31k]
  ------------------
  248|  7.31k|                          (nOpenFlagsIn & GDAL_OF_VERBOSE_ERROR) > 0);
  ------------------
  |  | 1080|  7.31k|#define GDAL_OF_VERBOSE_ERROR 0x40
  ------------------
  249|  7.31k|    }
  250|  7.31k|    if (pabyHeader)
  ------------------
  |  Branch (250:9): [True: 0, False: 7.31k]
  ------------------
  251|      0|    {
  252|      0|        bStatOK = TRUE;
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
  253|      0|        nHeaderBytesTried = nHeaderBytes;
  254|      0|    }
  255|  7.31k|    else if (fpL != nullptr)
  ------------------
  |  Branch (255:14): [True: 7.31k, False: 0]
  ------------------
  256|  7.31k|    {
  257|  7.31k|        bStatOK = TRUE;
  ------------------
  |  | 1043|  7.31k|#define TRUE 1
  ------------------
  258|  7.31k|        int nBufSize =
  259|  7.31k|            atoi(CPLGetConfigOption("GDAL_INGESTED_BYTES_AT_OPEN", "1024"));
  260|  7.31k|        if (nBufSize < 1024)
  ------------------
  |  Branch (260:13): [True: 0, False: 7.31k]
  ------------------
  261|      0|            nBufSize = 1024;
  262|  7.31k|        else if (nBufSize > 10 * 1024 * 1024)
  ------------------
  |  Branch (262:18): [True: 0, False: 7.31k]
  ------------------
  263|      0|            nBufSize = 10 * 1024 * 1024;
  264|  7.31k|        pabyHeader = static_cast<GByte *>(CPLCalloc(nBufSize + 1, 1));
  265|  7.31k|        nHeaderBytesTried = nBufSize;
  266|  7.31k|        nHeaderBytes =
  267|  7.31k|            static_cast<int>(VSIFReadL(pabyHeader, 1, nHeaderBytesTried, fpL));
  268|  7.31k|        VSIRewindL(fpL);
  269|       |
  270|       |        /* If we cannot read anything, check if it is not a directory instead */
  271|  7.31k|        VSIStatBufL sStat;
  272|  7.31k|        if (nHeaderBytes == 0 &&
  ------------------
  |  Branch (272:13): [True: 0, False: 7.31k]
  ------------------
  273|  7.31k|            VSIStatExL(pszFilename, &sStat,
  ------------------
  |  Branch (273:13): [True: 0, False: 0]
  ------------------
  274|      0|                       VSI_STAT_EXISTS_FLAG | VSI_STAT_NATURE_FLAG) == 0 &&
  ------------------
  |  |  194|      0|#define VSI_STAT_EXISTS_FLAG 0x1
  ------------------
                                     VSI_STAT_EXISTS_FLAG | VSI_STAT_NATURE_FLAG) == 0 &&
  ------------------
  |  |  196|      0|#define VSI_STAT_NATURE_FLAG 0x2
  ------------------
  275|  7.31k|            VSI_ISDIR(sStat.st_mode))
  ------------------
  |  |  115|  7.31k|#define VSI_ISDIR(x) S_ISDIR(x)
  ------------------
  276|      0|        {
  277|      0|            CPL_IGNORE_RET_VAL(VSIFCloseL(fpL));
  278|      0|            fpL = nullptr;
  279|      0|            CPLFree(pabyHeader);
  ------------------
  |  |   86|      0|#define CPLFree VSIFree
  ------------------
  280|      0|            pabyHeader = nullptr;
  281|      0|            bIsDirectory = TRUE;
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
  282|      0|        }
  283|  7.31k|    }
  284|      0|    else if (!bStatOK)
  ------------------
  |  Branch (284:14): [True: 0, False: 0]
  ------------------
  285|      0|    {
  286|      0|        VSIStatBufL sStat;
  287|      0|        if (!bPotentialDirectory &&
  ------------------
  |  Branch (287:13): [True: 0, False: 0]
  ------------------
  288|      0|            VSIStatExL(pszFilename, &sStat,
  ------------------
  |  Branch (288:13): [True: 0, False: 0]
  ------------------
  289|      0|                       VSI_STAT_EXISTS_FLAG | VSI_STAT_NATURE_FLAG) == 0)
  ------------------
  |  |  194|      0|#define VSI_STAT_EXISTS_FLAG 0x1
  ------------------
                                     VSI_STAT_EXISTS_FLAG | VSI_STAT_NATURE_FLAG) == 0)
  ------------------
  |  |  196|      0|#define VSI_STAT_NATURE_FLAG 0x2
  ------------------
  290|      0|        {
  291|      0|            bStatOK = TRUE;
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
  292|      0|            if (VSI_ISDIR(sStat.st_mode))
  ------------------
  |  |  115|      0|#define VSI_ISDIR(x) S_ISDIR(x)
  ------------------
  293|      0|                bIsDirectory = TRUE;
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
  294|      0|        }
  295|      0|#ifdef HAVE_READLINK
  296|      0|        else if (!bHasRetried && !STARTS_WITH(pszFilename, "/vsi"))
  ------------------
  |  |  550|      0|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  ------------------
  |  Branch (296:18): [True: 0, False: 0]
  |  Branch (296:34): [True: 0, False: 0]
  ------------------
  297|      0|        {
  298|       |            // If someone creates a file with "ln -sf
  299|       |            // /vsicurl/http://download.osgeo.org/gdal/data/gtiff/utm.tif
  300|       |            // my_remote_utm.tif" we will be able to open it by passing
  301|       |            // my_remote_utm.tif.  This helps a lot for GDAL based readers that
  302|       |            // only provide file explorers to open datasets.
  303|      0|            const int nBufSize = 2048;
  304|      0|            std::vector<char> oFilename(nBufSize);
  305|      0|            char *szPointerFilename = &oFilename[0];
  306|      0|            int nBytes = static_cast<int>(
  307|      0|                readlink(pszFilename, szPointerFilename, nBufSize));
  308|      0|            if (nBytes != -1)
  ------------------
  |  Branch (308:17): [True: 0, False: 0]
  ------------------
  309|      0|            {
  310|      0|                szPointerFilename[std::min(nBytes, nBufSize - 1)] = 0;
  311|      0|                CPLFree(pszFilename);
  ------------------
  |  |   86|      0|#define CPLFree VSIFree
  ------------------
  312|      0|                pszFilename = CPLStrdup(szPointerFilename);
  313|      0|                osExtension = CPLGetExtensionSafe(pszFilename);
  314|      0|                papszSiblingsIn = nullptr;
  315|      0|                bHasRetried = true;
  316|      0|                goto retry;
  317|      0|            }
  318|      0|        }
  319|      0|#endif  // HAVE_READLINK
  320|      0|    }
  321|       |
  322|       |    /* -------------------------------------------------------------------- */
  323|       |    /*      Capture sibling list either from passed in values, or by        */
  324|       |    /*      scanning for them only if requested through GetSiblingFiles().  */
  325|       |    /* -------------------------------------------------------------------- */
  326|  7.31k|    if (papszSiblingsIn != nullptr)
  ------------------
  |  Branch (326:9): [True: 0, False: 7.31k]
  ------------------
  327|      0|    {
  328|      0|        papszSiblingFiles = CSLDuplicate(papszSiblingsIn);
  329|      0|        bHasGotSiblingFiles = true;
  330|      0|    }
  331|  7.31k|    else if (bStatOK && !bIsDirectory)
  ------------------
  |  Branch (331:14): [True: 7.31k, False: 0]
  |  Branch (331:25): [True: 7.31k, False: 0]
  ------------------
  332|  7.31k|    {
  333|  7.31k|        papszSiblingFiles = VSISiblingFiles(pszFilename);
  334|  7.31k|        if (papszSiblingFiles != nullptr)
  ------------------
  |  Branch (334:13): [True: 0, False: 7.31k]
  ------------------
  335|      0|        {
  336|      0|            bHasGotSiblingFiles = true;
  337|      0|        }
  338|  7.31k|        else
  339|  7.31k|        {
  340|  7.31k|            const char *pszOptionVal = VSIGetPathSpecificOption(
  341|  7.31k|                pszFilename, "GDAL_DISABLE_READDIR_ON_OPEN", "NO");
  342|  7.31k|            if (EQUAL(pszOptionVal, "EMPTY_DIR"))
  ------------------
  |  |  541|  7.31k|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|  7.31k|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 7.31k]
  |  |  ------------------
  ------------------
  343|      0|            {
  344|      0|                papszSiblingFiles =
  345|      0|                    CSLAddString(nullptr, CPLGetFilename(pszFilename));
  346|      0|                bHasGotSiblingFiles = true;
  347|      0|            }
  348|  7.31k|            else if (CPLTestBool(pszOptionVal))
  ------------------
  |  Branch (348:22): [True: 0, False: 7.31k]
  ------------------
  349|      0|            {
  350|       |                /* skip reading the directory */
  351|      0|                papszSiblingFiles = nullptr;
  352|      0|                bHasGotSiblingFiles = true;
  353|      0|            }
  354|  7.31k|            else
  355|  7.31k|            {
  356|       |                /* will be lazy loaded */
  357|  7.31k|                papszSiblingFiles = nullptr;
  358|  7.31k|                bHasGotSiblingFiles = false;
  359|  7.31k|            }
  360|  7.31k|        }
  361|  7.31k|    }
  362|      0|    else
  363|      0|    {
  364|      0|        papszSiblingFiles = nullptr;
  365|      0|        bHasGotSiblingFiles = true;
  366|      0|    }
  367|  7.31k|}
_ZN12GDALOpenInfoD2Ev:
  375|  7.31k|{
  376|  7.31k|    VSIFree(pabyHeader);
  377|  7.31k|    CPLFree(pszFilename);
  ------------------
  |  |   86|  7.31k|#define CPLFree VSIFree
  ------------------
  378|       |
  379|  7.31k|    if (fpL != nullptr)
  ------------------
  |  Branch (379:9): [True: 7.31k, False: 0]
  ------------------
  380|  7.31k|        CPL_IGNORE_RET_VAL(VSIFCloseL(fpL));
  381|  7.31k|    CSLDestroy(papszSiblingFiles);
  382|  7.31k|}
gdalopeninfo.cpp:_ZL28GDALOpenInfoGetFileNotToOpenPKcPi:
  118|  7.31k|{
  119|  7.31k|    std::lock_guard<std::mutex> oLock(sFNTOMutex);
  120|  7.31k|    *pnHeaderBytes = 0;
  121|  7.31k|    if (pMapFNTO == nullptr)
  ------------------
  |  Branch (121:9): [True: 7.31k, False: 0]
  ------------------
  122|  7.31k|    {
  123|  7.31k|        return nullptr;
  124|  7.31k|    }
  125|      0|    auto oIter = pMapFNTO->find(pszFilename);
  126|      0|    if (oIter == pMapFNTO->end())
  ------------------
  |  Branch (126:9): [True: 0, False: 0]
  ------------------
  127|      0|    {
  128|      0|        return nullptr;
  129|      0|    }
  130|      0|    *pnHeaderBytes = oIter->second.nHeaderBytes;
  131|      0|    GByte *pabyHeader = static_cast<GByte *>(CPLMalloc(*pnHeaderBytes + 1));
  132|      0|    memcpy(pabyHeader, oIter->second.pabyHeader, *pnHeaderBytes);
  133|      0|    pabyHeader[*pnHeaderBytes] = 0;
  134|      0|    return pabyHeader;
  135|      0|}

_ZN2mu10ParserBase14change_dec_sepIcEC2Ecci:
  219|      2|				:std::numpunct<TChar>()
  220|      2|				,m_nGroup(nGroup)
  221|      2|				,m_cDecPoint(cDecSep)
  222|      2|				,m_cThousandsSep(cThousandsSep)
  223|      2|			{}

OGRGetNonLinearGeometriesEnabledFlag:
 2090|     45|{
 2091|     45|    return bNonLinearGeometriesEnabled;
 2092|     45|}

_ZN11OGREnvelopeC2Ev:
   48|  1.02k|            : MinX(std::numeric_limits<double>::infinity()),
   49|  1.02k|              MaxX(-std::numeric_limits<double>::infinity()),
   50|  1.02k|              MinY(std::numeric_limits<double>::infinity()),
   51|  1.02k|              MaxY(-std::numeric_limits<double>::infinity())
   52|  1.02k|        {
   53|  1.02k|        }

_ZNK12OGRFieldDefn10GetNameRefEv:
  109|  22.0k|    {
  110|  22.0k|        return pszName;
  111|  22.0k|    }
_ZNK12OGRFieldDefn21GetAlternativeNameRefEv:
  116|  5.38k|    {
  117|  5.38k|        return pszAlternativeName;
  118|  5.38k|    }
_ZNK12OGRFieldDefn7GetTypeEv:
  121|  17.9k|    {
  122|  17.9k|        return eType;
  123|  17.9k|    }
_ZNK12OGRFieldDefn10GetSubTypeEv:
  130|  5.38k|    {
  131|  5.38k|        return eSubType;
  132|  5.38k|    }
_ZNK12OGRFieldDefn10GetJustifyEv:
  139|  5.38k|    {
  140|  5.38k|        return eJustify;
  141|  5.38k|    }
_ZNK12OGRFieldDefn8GetWidthEv:
  149|  5.38k|    {
  150|  5.38k|        return nWidth;
  151|  5.38k|    }
_ZNK12OGRFieldDefn12GetPrecisionEv:
  156|  5.38k|    {
  157|  5.38k|        return nPrecision;
  158|  5.38k|    }
_ZNK12OGRFieldDefn9GetTZFlagEv:
  163|  5.38k|    {
  164|  5.38k|        return m_nTZFlag;
  165|  5.38k|    }
_ZNK12OGRFieldDefn10IsNullableEv:
  187|  5.38k|    {
  188|  5.38k|        return bNullable;
  189|  5.38k|    }
_ZNK12OGRFieldDefn8IsUniqueEv:
  194|  5.38k|    {
  195|  5.38k|        return bUnique;
  196|  5.38k|    }
_ZNK12OGRFieldDefn11IsGeneratedEv:
  207|  5.38k|    {
  208|  5.38k|        return m_bGenerated;
  209|  5.38k|    }
_ZNK12OGRFieldDefn10GetCommentEv:
  231|  5.38k|    {
  232|  5.38k|        return m_osComment;
  233|  5.38k|    }
_ZNK16OGRGeomFieldDefn10GetNameRefEv:
  365|  1.02k|    {
  366|  1.02k|        return pszName;
  367|  1.02k|    }
_ZNK16OGRGeomFieldDefn7GetTypeEv:
  370|  1.02k|    {
  371|  1.02k|        return eGeomType;
  372|  1.02k|    }
_ZNK14OGRFeatureDefn19GetFieldCountUnsafeEv:
  630|  1.49k|    {
  631|  1.49k|        return static_cast<int>(apoFieldDefn.size());
  632|  1.49k|    }
_ZN14OGRFeatureDefn18GetFieldDefnUnsafeEi:
  636|  7.95k|    {
  637|  7.95k|        if (apoFieldDefn.empty())
  ------------------
  |  Branch (637:13): [True: 0, False: 7.95k]
  ------------------
  638|      0|            GetFieldDefn(i);
  639|  7.95k|        return apoFieldDefn[static_cast<std::size_t>(i)].get();
  640|  7.95k|    }
_ZN14OGRFeatureDefn9ReferenceEv:
  780|  2.51k|    {
  781|  2.51k|        return CPLAtomicInc(&nRefCount);
  ------------------
  |  |   55|  2.51k|#define CPLAtomicInc(ptr) CPLAtomicAdd(ptr, 1)
  ------------------
  782|  2.51k|    }
_ZN14OGRFeatureDefn11DereferenceEv:
  785|  2.51k|    {
  786|  2.51k|        return CPLAtomicDec(&nRefCount);
  ------------------
  |  |   66|  2.51k|#define CPLAtomicDec(ptr) CPLAtomicAdd(ptr, -1)
  ------------------
  787|  2.51k|    }
_ZNK10OGRFeature17GetGeomFieldCountEv:
 1227|  6.54k|    {
 1228|  6.54k|        return poDefn->GetGeomFieldCount();
 1229|  6.54k|    }
_ZNK10OGRFeature13GetFieldIndexEPKc:
 1276|  6.32k|    {
 1277|  6.32k|        return poDefn->GetFieldIndex(pszName);
 1278|  6.32k|    }
_ZNK10OGRFeature16IsFieldSetUnsafeEi:
 1321|  12.7k|    {
 1322|  12.7k|        return !(pauFields[i].Set.nMarker1 == OGRUnsetMarker &&
  ------------------
  |  |  863|  25.5k|#define OGRUnsetMarker -21121
  ------------------
  |  Branch (1322:18): [True: 6.49k, False: 6.29k]
  ------------------
 1323|  12.7k|                 pauFields[i].Set.nMarker2 == OGRUnsetMarker &&
  ------------------
  |  |  863|  19.2k|#define OGRUnsetMarker -21121
  ------------------
  |  Branch (1323:18): [True: 6.46k, False: 27]
  ------------------
 1324|  12.7k|                 pauFields[i].Set.nMarker3 == OGRUnsetMarker);
  ------------------
  |  |  863|  6.46k|#define OGRUnsetMarker -21121
  ------------------
  |  Branch (1324:18): [True: 6.46k, False: 0]
  ------------------
 1325|  12.7k|    }
_ZNK10OGRFeature17IsFieldNullUnsafeEi:
 1328|  6.32k|    {
 1329|  6.32k|        return (pauFields[i].Set.nMarker1 == OGRNullMarker &&
  ------------------
  |  |  871|  12.6k|#define OGRNullMarker -21122
  ------------------
  |  Branch (1329:17): [True: 36, False: 6.28k]
  ------------------
 1330|  6.32k|                pauFields[i].Set.nMarker2 == OGRNullMarker &&
  ------------------
  |  |  871|  6.35k|#define OGRNullMarker -21122
  ------------------
  |  Branch (1330:17): [True: 0, False: 36]
  ------------------
 1331|  6.32k|                pauFields[i].Set.nMarker3 == OGRNullMarker);
  ------------------
  |  |  871|      0|#define OGRNullMarker -21122
  ------------------
  |  Branch (1331:17): [True: 0, False: 0]
  ------------------
 1332|  6.32k|    }
_ZNK10OGRFeature26IsFieldSetAndNotNullUnsafeEi:
 1335|  12.7k|    {
 1336|  12.7k|        return IsFieldSetUnsafe(i) && !IsFieldNullUnsafe(i);
  ------------------
  |  Branch (1336:16): [True: 6.32k, False: 6.46k]
  |  Branch (1336:39): [True: 6.32k, False: 0]
  ------------------
 1337|  12.7k|    }
_ZN10OGRFeature8SetFieldEPKcd:
 1461|  1.49k|    {
 1462|  1.49k|        SetField(GetFieldIndex(pszFName), dfValue);
 1463|  1.49k|    }
_ZN10OGRFeature8SetFieldEPKcS1_:
 1466|  4.83k|    {
 1467|  4.83k|        SetField(GetFieldIndex(pszFName), pszValue);
 1468|  4.83k|    }
_ZN10OGRFeature8ToHandleEPS_:
 1568|  2.51k|    {
 1569|  2.51k|        return reinterpret_cast<OGRFeatureH>(poFeature);
 1570|  2.51k|    }
_ZN10OGRFeature10FromHandleEPv:
 1576|  1.49k|    {
 1577|  1.49k|        return reinterpret_cast<OGRFeature *>(hFeature);
 1578|  1.49k|    }

_ZNK11OGRGeometry4Is3DEv:
  439|  1.90k|    {
  440|  1.90k|        return (flags & OGR_G_3D) != 0;
  441|  1.90k|    }
_ZNK11OGRGeometry10IsMeasuredEv:
  445|  1.11k|    {
  446|  1.11k|        return (flags & OGR_G_MEASURED) != 0;
  447|  1.11k|    }
_ZN11OGRGeometry12toLineStringEv:
  716|  4.21k|    {
  717|  4.21k|        return cpl::down_cast<OGRLineString *>(this);
  718|  4.21k|    }
_ZNK8OGRPoint4getXEv:
 1196|    824|    {
 1197|    824|        return x;
 1198|    824|    }
_ZNK8OGRPoint4getYEv:
 1202|    736|    {
 1203|    736|        return y;
 1204|    736|    }
_ZNK8OGRPoint4getZEv:
 1208|    716|    {
 1209|    716|        return z;
 1210|    716|    }
_ZN8OGRPoint4setXEd:
 1225|    760|    {
 1226|    760|        x = xIn;
 1227|    760|        if (std::isnan(x) || std::isnan(y))
  ------------------
  |  Branch (1227:13): [True: 102, False: 658]
  |  Branch (1227:30): [True: 22, False: 636]
  ------------------
 1228|    124|            flags &= ~OGR_G_NOT_EMPTY_POINT;
 1229|    636|        else
 1230|    636|            flags |= OGR_G_NOT_EMPTY_POINT;
 1231|    760|    }
_ZN8OGRPoint4setYEd:
 1237|    760|    {
 1238|    760|        y = yIn;
 1239|    760|        if (std::isnan(x) || std::isnan(y))
  ------------------
  |  Branch (1239:13): [True: 102, False: 658]
  |  Branch (1239:30): [True: 108, False: 550]
  ------------------
 1240|    210|            flags &= ~OGR_G_NOT_EMPTY_POINT;
 1241|    550|        else
 1242|    550|            flags |= OGR_G_NOT_EMPTY_POINT;
 1243|    760|    }
_ZN8OGRPoint4setZEd:
 1249|    760|    {
 1250|    760|        z = zIn;
 1251|    760|        flags |= OGR_G_3D;
 1252|    760|    }
_ZNK14OGRSimpleCurve12getNumPointsEv:
 1662|  8.50k|    {
 1663|  8.50k|        return nPointCount;
 1664|  8.50k|    }
_ZNK14OGRSimpleCurve4getXEi:
 1669|  37.2M|    {
 1670|  37.2M|        return paoPoints[i].x;
 1671|  37.2M|    }
_ZNK14OGRSimpleCurve4getYEi:
 1674|  37.2M|    {
 1675|  37.2M|        return paoPoints[i].y;
 1676|  37.2M|    }
_ZN18OGRCurveCollection5beginEv:
 2115|    320|    {
 2116|    320|        return papoCurves;
 2117|    320|    }
_ZN18OGRCurveCollection3endEv:
 2121|    320|    {
 2122|    320|        return papoCurves + nCurveCount;
 2123|    320|    }
_ZN10OGRPolygon5beginEv:
 2738|     80|    {
 2739|     80|        return reinterpret_cast<ChildType **>(oCC.begin());
 2740|     80|    }
_ZN10OGRPolygon3endEv:
 2744|     80|    {
 2745|     80|        return reinterpret_cast<ChildType **>(oCC.end());
 2746|     80|    }
_ZN10OGRPolygonC2Ev:
 2717|     80|    OGRPolygon() = default;
_ZN15OGRCurvePolygonC2Ev:
 2504|     80|    OGRCurvePolygon() = default;
_ZN18OGRCurveCollectionC2Ev:
 2100|     80|    OGRCurveCollection() = default;
_ZN13OGRLinearRingC2Ev:
 1900|     80|    OGRLinearRing() = default;
_ZN13OGRLineStringC2Ev:
 1792|  4.77k|    OGRLineString() = default;
_ZN14OGRSimpleCurveC2Ev:
 1542|  4.91k|    OGRSimpleCurve() = default;
_ZN8OGRCurveC2Ev:
 1324|  4.91k|    OGRCurve() = default;
_ZN17OGRCircularStringC2Ev:
 1986|    147|    OGRCircularString() = default;

_ZN18OSRPJContextHolder4initEv:
  145|  2.54k|{
  146|  2.54k|    if (!context)
  ------------------
  |  Branch (146:9): [True: 1, False: 2.54k]
  ------------------
  147|      1|    {
  148|      1|        static std::once_flag flag;
  149|      1|        std::call_once(
  150|      1|            flag,
  151|      1|            []()
  152|      1|            {
  153|       |                // Initialize g_aosSearchpaths from PROJ_DATA/PROJ_LIB configuration
  154|       |                // option.
  155|      1|                std::lock_guard<std::mutex> oLock(g_oSearchPathMutex);
  156|      1|                if (g_searchPathGenerationCounter == 0)
  157|      1|                {
  158|      1|                    const char *pszProjData =
  159|      1|                        CPLGetConfigOption("PROJ_DATA", nullptr);
  160|      1|                    if (pszProjData == nullptr)
  161|      1|                        pszProjData = CPLGetConfigOption("PROJ_LIB", nullptr);
  162|      1|                    if (pszProjData)
  163|      1|                    {
  164|      1|                        const char *pszSep =
  165|       |#ifdef _WIN32
  166|       |                            ";"
  167|       |#else
  168|      1|                            ":"
  169|      1|#endif
  170|      1|                            ;
  171|      1|                        g_aosSearchpaths =
  172|      1|                            CSLTokenizeString2(pszProjData, pszSep, 0);
  173|      1|                        g_searchPathGenerationCounter = 1;
  174|      1|                    }
  175|      1|                }
  176|       |
  177|      1|                OSRInstallSetConfigOptionCallback();
  178|      1|            });
  179|       |
  180|      1|        context = proj_context_create();
  181|      1|        proj_log_func(context, nullptr, osr_proj_logger);
  182|      1|    }
  183|  2.54k|    return context;
  184|  2.54k|}
_ZN18OSRPJContextHolderD2Ev:
  187|      1|{
  188|      1|    deinit();
  189|      1|}
_ZN18OSRPJContextHolder6deinitEv:
  192|      1|{
  193|      1|    searchPathGenerationCounter = 0;
  194|      1|    oCache.clear();
  195|       |
  196|       |    // Destroy context in last
  197|      1|    proj_context_destroy(context);
  198|      1|    context = nullptr;
  199|      1|}
_Z20OSRGetProjTLSContextv:
  269|  2.54k|{
  270|  2.54k|    auto &l_projContext = GetProjTLSContextHolder();
  271|       |    // This .init() must be kept, even if OSRPJContextHolder constructor
  272|       |    // calls it. The reason is that OSRCleanupTLSContext() calls deinit(),
  273|       |    // so if reusing the object, we must re-init again.
  274|  2.54k|    l_projContext.init();
  275|  2.54k|    {
  276|       |        // If OSRSetPROJSearchPaths() has been called since we created the
  277|       |        // context, set the new search paths on the context.
  278|  2.54k|        std::lock_guard<std::mutex> oLock(g_oSearchPathMutex);
  279|  2.54k|        if (l_projContext.searchPathGenerationCounter !=
  ------------------
  |  Branch (279:13): [True: 0, False: 2.54k]
  ------------------
  280|  2.54k|            g_searchPathGenerationCounter)
  281|      0|        {
  282|      0|            l_projContext.searchPathGenerationCounter =
  283|      0|                g_searchPathGenerationCounter;
  284|      0|            proj_context_set_search_paths(l_projContext.context,
  285|      0|                                          g_aosSearchpaths.Count(),
  286|      0|                                          g_aosSearchpaths.List());
  287|      0|        }
  288|  2.54k|        if (l_projContext.auxDbPathsGenerationCounter !=
  ------------------
  |  Branch (288:13): [True: 0, False: 2.54k]
  ------------------
  289|  2.54k|            g_auxDbPathsGenerationCounter)
  290|      0|        {
  291|      0|            l_projContext.auxDbPathsGenerationCounter =
  292|      0|                g_auxDbPathsGenerationCounter;
  293|      0|            std::string oMainPath(
  294|      0|                proj_context_get_database_path(l_projContext.context));
  295|      0|            proj_context_set_database_path(l_projContext.context,
  296|      0|                                           oMainPath.c_str(),
  297|      0|                                           g_aosAuxDbPaths.List(), nullptr);
  298|      0|        }
  299|  2.54k|#if PROJ_VERSION_MAJOR >= 7
  300|  2.54k|        if (l_projContext.projNetworkEnabledGenerationCounter !=
  ------------------
  |  Branch (300:13): [True: 0, False: 2.54k]
  ------------------
  301|  2.54k|            g_projNetworkEnabledGenerationCounter)
  302|      0|        {
  303|      0|            l_projContext.projNetworkEnabledGenerationCounter =
  304|      0|                g_projNetworkEnabledGenerationCounter;
  305|      0|            proj_context_set_enable_network(l_projContext.context,
  306|      0|                                            g_projNetworkEnabled);
  307|      0|        }
  308|  2.54k|#endif
  309|  2.54k|    }
  310|  2.54k|    return l_projContext.context;
  311|  2.54k|}
_ZN15OSRProjTLSCache5clearEv:
  324|      1|{
  325|      1|    m_oCacheEPSG.clear();
  326|      1|    m_oCacheWKT.clear();
  327|      1|    m_tlsContext = nullptr;
  328|      1|}
_ZN18OSRPJContextHolderC2Ev:
   88|      1|        : oCache(init())
   89|       |#if !defined(HAVE_PTHREAD_ATFORK)
   90|       |          ,
   91|       |          curpid(getpid())
   92|       |#endif
   93|      1|    {
   94|      1|#if HAVE_PTHREAD_ATFORK
   95|      1|        static std::once_flag flag;
   96|      1|        std::call_once(
   97|      1|            flag,
   98|      1|            []()
   99|      1|            {
  100|      1|                if (pthread_atfork(nullptr, nullptr, ForkOccurred) != 0)
  101|      1|                {
  102|      1|                    CPLError(CE_Failure, CPLE_OutOfMemory,
  103|      1|                             "pthread_atfork() in ogr_proj_p failed");
  104|      1|                }
  105|      1|            });
  106|      1|#endif
  107|      1|        init();
  108|      1|    }
_ZZN18OSRPJContextHolderC1EvENKUlvE_clEv:
   99|      1|            {
  100|      1|                if (pthread_atfork(nullptr, nullptr, ForkOccurred) != 0)
  ------------------
  |  Branch (100:21): [True: 0, False: 1]
  ------------------
  101|      0|                {
  102|      0|                    CPLError(CE_Failure, CPLE_OutOfMemory,
  ------------------
  |  |   87|      0|#define CPLE_OutOfMemory 2
  ------------------
  103|      0|                             "pthread_atfork() in ogr_proj_p failed");
  104|      0|                }
  105|      1|            });
ogr_proj_p.cpp:_ZL23GetProjTLSContextHolderv:
  236|  2.54k|{
  237|  2.54k|    OSRPJContextHolder &l_projContext = g_tls_projContext;
  238|       |
  239|       |    // Detect if we are now running in a child process created by fork()
  240|       |    // In that situation we must make sure *not* to use the same underlying
  241|       |    // file open descriptor to the sqlite3 database, since seeks&reads in one
  242|       |    // of the parent or child will affect the other end.
  243|  2.54k|#if defined(HAVE_PTHREAD_ATFORK)
  244|  2.54k|    if (g_bForkOccurred)
  ------------------
  |  Branch (244:9): [True: 0, False: 2.54k]
  ------------------
  245|       |#else
  246|       |    const pid_t curpid = getpid();
  247|       |    if (curpid != l_projContext.curpid)
  248|       |#endif
  249|      0|    {
  250|      0|#if defined(HAVE_PTHREAD_ATFORK)
  251|      0|        g_bForkOccurred = false;
  252|       |#else
  253|       |        l_projContext.curpid = curpid;
  254|       |#endif
  255|      0|        const auto osr_proj_logger_none = [](void *, int, const char *) {};
  256|      0|        proj_log_func(l_projContext.context, nullptr, osr_proj_logger_none);
  257|      0|        proj_context_set_autoclose_database(l_projContext.context, true);
  258|       |        // dummy call to cause the database to be closed
  259|      0|        proj_context_get_database_path(l_projContext.context);
  260|      0|        proj_context_set_autoclose_database(l_projContext.context, false);
  261|      0|        proj_log_func(l_projContext.context, nullptr, osr_proj_logger);
  262|      0|    }
  263|       |
  264|  2.54k|    return l_projContext;
  265|  2.54k|}
ogr_proj_p.cpp:_ZL33OSRInstallSetConfigOptionCallbackv:
  137|      1|{
  138|      1|    static std::once_flag flag;
  139|      1|    std::call_once(
  140|      1|        flag,
  141|      1|        []() { CPLSubscribeToSetConfigOption(OSRSetConfigOption, nullptr); });
  142|      1|}
ogr_proj_p.cpp:_ZZL33OSRInstallSetConfigOptionCallbackvENK3$_0clEv:
  141|      1|        []() { CPLSubscribeToSetConfigOption(OSRSetConfigOption, nullptr); });
ogr_proj_p.cpp:_ZZN18OSRPJContextHolder4initEvENK3$_0clEv:
  152|      1|            {
  153|       |                // Initialize g_aosSearchpaths from PROJ_DATA/PROJ_LIB configuration
  154|       |                // option.
  155|      1|                std::lock_guard<std::mutex> oLock(g_oSearchPathMutex);
  156|      1|                if (g_searchPathGenerationCounter == 0)
  ------------------
  |  Branch (156:21): [True: 1, False: 0]
  ------------------
  157|      1|                {
  158|      1|                    const char *pszProjData =
  159|      1|                        CPLGetConfigOption("PROJ_DATA", nullptr);
  160|      1|                    if (pszProjData == nullptr)
  ------------------
  |  Branch (160:25): [True: 1, False: 0]
  ------------------
  161|      1|                        pszProjData = CPLGetConfigOption("PROJ_LIB", nullptr);
  162|      1|                    if (pszProjData)
  ------------------
  |  Branch (162:25): [True: 0, False: 1]
  ------------------
  163|      0|                    {
  164|      0|                        const char *pszSep =
  165|       |#ifdef _WIN32
  166|       |                            ";"
  167|       |#else
  168|      0|                            ":"
  169|      0|#endif
  170|      0|                            ;
  171|      0|                        g_aosSearchpaths =
  172|      0|                            CSLTokenizeString2(pszProjData, pszSep, 0);
  173|      0|                        g_searchPathGenerationCounter = 1;
  174|      0|                    }
  175|      1|                }
  176|       |
  177|      1|                OSRInstallSetConfigOptionCallback();
  178|      1|            });

_ZN15OSRProjTLSCacheC2EP6pj_ctx:
   86|      1|    explicit OSRProjTLSCache(PJ_CONTEXT *tlsContext) : m_tlsContext(tlsContext)
   87|      1|    {
   88|      1|    }

_ZN19OGRSpatialReference8ToHandleEPS_:
  730|  1.02k|    {
  731|  1.02k|        return reinterpret_cast<OGRSpatialReferenceH>(poSRS);
  732|  1.02k|    }

_ZN11OGR_SRSNode8ListenerD2Ev:
   61|  2.54k|OGR_SRSNode::Listener::~Listener() = default;

_ZNK8OGRCurve12get_IsClosedEv:
   62|     80|{
   63|     80|    OGRPoint oStartPoint;
   64|     80|    StartPoint(&oStartPoint);
   65|       |
   66|     80|    OGRPoint oEndPoint;
   67|     80|    EndPoint(&oEndPoint);
   68|       |
   69|     80|    if (oStartPoint.Is3D() && oEndPoint.Is3D())
  ------------------
  |  Branch (69:9): [True: 80, False: 0]
  |  Branch (69:31): [True: 80, False: 0]
  ------------------
   70|     80|    {
   71|       |        // XYZ type
   72|     80|        if (oStartPoint.getX() == oEndPoint.getX() &&
  ------------------
  |  Branch (72:13): [True: 36, False: 44]
  ------------------
   73|     80|            oStartPoint.getY() == oEndPoint.getY() &&
  ------------------
  |  Branch (73:13): [True: 26, False: 10]
  ------------------
   74|     80|            oStartPoint.getZ() == oEndPoint.getZ())
  ------------------
  |  Branch (74:13): [True: 15, False: 11]
  ------------------
   75|     15|        {
   76|     15|            return TRUE;
  ------------------
  |  | 1043|     15|#define TRUE 1
  ------------------
   77|     15|        }
   78|     65|        else
   79|     65|            return FALSE;
  ------------------
  |  | 1039|     65|#define FALSE 0
  ------------------
   80|     80|    }
   81|       |
   82|       |    // one of the points is 3D
   83|      0|    else if (((oStartPoint.Is3D() & oEndPoint.Is3D()) == 0) &&
  ------------------
  |  Branch (83:14): [True: 0, False: 0]
  ------------------
   84|      0|             ((oStartPoint.Is3D() | oEndPoint.Is3D()) == 1))
  ------------------
  |  Branch (84:14): [True: 0, False: 0]
  ------------------
   85|      0|    {
   86|      0|        return FALSE;
  ------------------
  |  | 1039|      0|#define FALSE 0
  ------------------
   87|      0|    }
   88|       |
   89|      0|    else
   90|      0|    {
   91|       |        // XY type
   92|      0|        if (oStartPoint.getX() == oEndPoint.getX() &&
  ------------------
  |  Branch (92:13): [True: 0, False: 0]
  ------------------
   93|      0|            oStartPoint.getY() == oEndPoint.getY())
  ------------------
  |  Branch (93:13): [True: 0, False: 0]
  ------------------
   94|      0|            return TRUE;
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
   95|      0|        else
   96|      0|            return FALSE;
  ------------------
  |  | 1039|      0|#define FALSE 0
  ------------------
   97|      0|    }
   98|     80|}

_ZN18OGRCurveCollectionD2Ev:
   85|     80|{
   86|     80|    empty(nullptr);
   87|     80|}
_ZN18OGRCurveCollection16addCurveDirectlyEP11OGRGeometryP8OGRCurvei:
  170|     80|{
  171|     80|    poGeom->HomogenizeDimensionalityWith(poCurve);
  172|       |
  173|     80|    if (bNeedRealloc)
  ------------------
  |  Branch (173:9): [True: 80, False: 0]
  ------------------
  174|     80|    {
  175|       |#if SIZEOF_VOIDP < 8
  176|       |        if (nCurveCount == std::numeric_limits<int>::max() /
  177|       |                               static_cast<int>(sizeof(OGRCurve *)))
  178|       |        {
  179|       |            CPLError(CE_Failure, CPLE_OutOfMemory, "Too many subgeometries");
  180|       |            return OGRERR_FAILURE;
  181|       |        }
  182|       |#else
  183|     80|        if (nCurveCount == std::numeric_limits<int>::max())
  ------------------
  |  Branch (183:13): [True: 0, False: 80]
  ------------------
  184|      0|        {
  185|      0|            CPLError(CE_Failure, CPLE_AppDefined, "Too many subgeometries");
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  186|      0|            return OGRERR_FAILURE;
  ------------------
  |  |  378|      0|#define OGRERR_FAILURE 6                   /**< Failure */
  ------------------
  187|      0|        }
  188|     80|#endif
  189|       |
  190|     80|        OGRCurve **papoNewCurves = static_cast<OGRCurve **>(VSI_REALLOC_VERBOSE(
  ------------------
  |  |  362|     80|    VSIReallocVerbose(pOldPtr, nNewSize, __FILE__, __LINE__)
  ------------------
  191|     80|            papoCurves, sizeof(OGRCurve *) * (nCurveCount + 1)));
  192|     80|        if (papoNewCurves == nullptr)
  ------------------
  |  Branch (192:13): [True: 0, False: 80]
  ------------------
  193|      0|            return OGRERR_FAILURE;
  ------------------
  |  |  378|      0|#define OGRERR_FAILURE 6                   /**< Failure */
  ------------------
  194|     80|        papoCurves = papoNewCurves;
  195|     80|    }
  196|       |
  197|     80|    papoCurves[nCurveCount] = poCurve;
  198|       |
  199|     80|    nCurveCount++;
  200|       |
  201|     80|    return OGRERR_NONE;
  ------------------
  |  |  372|     80|#define OGRERR_NONE 0              /**< Success */
  ------------------
  202|     80|}
_ZN18OGRCurveCollection5emptyEP11OGRGeometry:
  461|     80|{
  462|     80|    if (papoCurves != nullptr)
  ------------------
  |  Branch (462:9): [True: 80, False: 0]
  ------------------
  463|     80|    {
  464|     80|        for (auto &&poSubGeom : *this)
  ------------------
  |  Branch (464:31): [True: 80, False: 80]
  ------------------
  465|     80|        {
  466|     80|            delete poSubGeom;
  467|     80|        }
  468|     80|        CPLFree(papoCurves);
  ------------------
  |  |   86|     80|#define CPLFree VSIFree
  ------------------
  469|     80|    }
  470|       |
  471|     80|    nCurveCount = 0;
  472|     80|    papoCurves = nullptr;
  473|     80|    if (poGeom)
  ------------------
  |  Branch (473:9): [True: 0, False: 80]
  ------------------
  474|      0|        poGeom->setCoordinateDimension(2);
  475|     80|}
_ZN18OGRCurveCollection5set3DEP11OGRGeometryi:
  574|     80|{
  575|     80|    for (auto &&poSubGeom : *this)
  ------------------
  |  Branch (575:27): [True: 0, False: 80]
  ------------------
  576|      0|    {
  577|      0|        if (!poSubGeom->set3D(bIs3D))
  ------------------
  |  Branch (577:13): [True: 0, False: 0]
  ------------------
  578|      0|            return false;
  579|      0|    }
  580|       |
  581|     80|    return poGeom->OGRGeometry::set3D(bIs3D);
  582|     80|}
_ZN18OGRCurveCollection22assignSpatialReferenceEP11OGRGeometryPK19OGRSpatialReference:
  602|     80|{
  603|     80|    for (auto &&poSubGeom : *this)
  ------------------
  |  Branch (603:27): [True: 80, False: 80]
  ------------------
  604|     80|    {
  605|     80|        poSubGeom->assignSpatialReference(poSR);
  606|     80|    }
  607|     80|    poGeom->OGRGeometry::assignSpatialReference(poSR);
  608|     80|}

_ZN15OGRCurvePolygon15addRingDirectlyEP8OGRCurve:
  406|     80|{
  407|     80|    return addRingDirectlyInternal(poNewRing, TRUE);
  ------------------
  |  | 1043|     80|#define TRUE 1
  ------------------
  408|     80|}
_ZN15OGRCurvePolygon23addRingDirectlyInternalEP8OGRCurvei:
  412|     80|{
  413|     80|    if (!checkRing(poNewRing))
  ------------------
  |  Branch (413:9): [True: 0, False: 80]
  ------------------
  414|      0|        return OGRERR_UNSUPPORTED_GEOMETRY_TYPE;
  ------------------
  |  |  375|      0|#define OGRERR_UNSUPPORTED_GEOMETRY_TYPE 3 /**< Unsupported geometry type */
  ------------------
  415|       |
  416|     80|    HomogenizeDimensionalityWith(poNewRing);
  417|       |
  418|     80|    return oCC.addCurveDirectly(this, poNewRing, bNeedRealloc);
  419|     80|}
_ZN15OGRCurvePolygon5set3DEi:
  770|     80|{
  771|     80|    return oCC.set3D(this, bIs3D);
  772|     80|}
_ZN15OGRCurvePolygon22assignSpatialReferenceEPK19OGRSpatialReference:
  784|     80|{
  785|     80|    oCC.assignSpatialReference(this, poSR);
  786|     80|}

_ZN10OGRFeatureC2EP14OGRFeatureDefn:
   71|  1.49k|    : nFID(OGRNullFID), poDefn(poDefnIn), papoGeometries(nullptr),
  ------------------
  |  |  848|  1.49k|#define OGRNullFID -1
  ------------------
   72|  1.49k|      pauFields(nullptr), m_pszNativeData(nullptr),
   73|  1.49k|      m_pszNativeMediaType(nullptr), m_pszStyleString(nullptr),
   74|  1.49k|      m_poStyleTable(nullptr), m_pszTmpFieldValue(nullptr)
   75|  1.49k|{
   76|  1.49k|    poDefnIn->Reference();
   77|       |
   78|  1.49k|    const int nFieldCount = poDefn->GetFieldCount();
   79|  1.49k|    pauFields = static_cast<OGRField *>(
   80|  1.49k|        VSI_MALLOC_VERBOSE(nFieldCount * sizeof(OGRField)));
  ------------------
  |  |  331|  1.49k|#define VSI_MALLOC_VERBOSE(size) VSIMallocVerbose(size, __FILE__, __LINE__)
  ------------------
   81|       |
   82|  1.49k|    papoGeometries = static_cast<OGRGeometry **>(
   83|  1.49k|        VSI_CALLOC_VERBOSE(poDefn->GetGeomFieldCount(), sizeof(OGRGeometry *)));
  ------------------
  |  |  354|  1.49k|    VSICallocVerbose(nCount, nSize, __FILE__, __LINE__)
  ------------------
   84|       |
   85|       |    // Initialize array to the unset special value.
   86|  1.49k|    if (pauFields != nullptr)
  ------------------
  |  Branch (86:9): [True: 1.49k, False: 0]
  ------------------
   87|  1.49k|    {
   88|  9.45k|        for (int i = 0; i < nFieldCount; i++)
  ------------------
  |  Branch (88:25): [True: 7.95k, False: 1.49k]
  ------------------
   89|  7.95k|        {
   90|  7.95k|            pauFields[i].Set.nMarker1 = OGRUnsetMarker;
  ------------------
  |  |  863|  7.95k|#define OGRUnsetMarker -21121
  ------------------
   91|  7.95k|            pauFields[i].Set.nMarker2 = OGRUnsetMarker;
  ------------------
  |  |  863|  7.95k|#define OGRUnsetMarker -21121
  ------------------
   92|  7.95k|            pauFields[i].Set.nMarker3 = OGRUnsetMarker;
  ------------------
  |  |  863|  7.95k|#define OGRUnsetMarker -21121
  ------------------
   93|  7.95k|        }
   94|  1.49k|    }
   95|  1.49k|}
_ZN10OGRFeatureD2Ev:
  131|  1.49k|{
  132|  1.49k|    if (pauFields != nullptr)
  ------------------
  |  Branch (132:9): [True: 1.49k, False: 0]
  ------------------
  133|  1.49k|    {
  134|       |        // We can call GetFieldCountUnsafe() as the constructor has called
  135|       |        // the regular GetFieldCount()
  136|  1.49k|        const int nFieldcount = poDefn->GetFieldCountUnsafe();
  137|  9.45k|        for (int i = 0; i < nFieldcount; i++)
  ------------------
  |  Branch (137:25): [True: 7.95k, False: 1.49k]
  ------------------
  138|  7.95k|        {
  139|  7.95k|            const OGRFieldDefn *poFDefn = poDefn->GetFieldDefnUnsafe(i);
  140|       |
  141|  7.95k|            if (!IsFieldSetAndNotNullUnsafe(i))
  ------------------
  |  Branch (141:17): [True: 1.72k, False: 6.23k]
  ------------------
  142|  1.72k|                continue;
  143|       |
  144|  6.23k|            switch (poFDefn->GetType())
  145|  6.23k|            {
  146|  4.74k|                case OFTString:
  ------------------
  |  Branch (146:17): [True: 4.74k, False: 1.49k]
  ------------------
  147|  4.74k|                    if (pauFields[i].String != nullptr)
  ------------------
  |  Branch (147:25): [True: 4.74k, False: 0]
  ------------------
  148|  4.74k|                        VSIFree(pauFields[i].String);
  149|  4.74k|                    break;
  150|       |
  151|      0|                case OFTBinary:
  ------------------
  |  Branch (151:17): [True: 0, False: 6.23k]
  ------------------
  152|      0|                    if (pauFields[i].Binary.paData != nullptr)
  ------------------
  |  Branch (152:25): [True: 0, False: 0]
  ------------------
  153|      0|                        VSIFree(pauFields[i].Binary.paData);
  154|      0|                    break;
  155|       |
  156|      0|                case OFTStringList:
  ------------------
  |  Branch (156:17): [True: 0, False: 6.23k]
  ------------------
  157|      0|                    CSLDestroy(pauFields[i].StringList.paList);
  158|      0|                    break;
  159|       |
  160|      0|                case OFTIntegerList:
  ------------------
  |  Branch (160:17): [True: 0, False: 6.23k]
  ------------------
  161|      0|                case OFTInteger64List:
  ------------------
  |  Branch (161:17): [True: 0, False: 6.23k]
  ------------------
  162|      0|                case OFTRealList:
  ------------------
  |  Branch (162:17): [True: 0, False: 6.23k]
  ------------------
  163|      0|                    CPLFree(pauFields[i].IntegerList.paList);
  ------------------
  |  |   86|      0|#define CPLFree VSIFree
  ------------------
  164|      0|                    break;
  165|       |
  166|  1.49k|                default:
  ------------------
  |  Branch (166:17): [True: 1.49k, False: 4.74k]
  ------------------
  167|       |                    // TODO(schwehr): Add support for wide strings.
  168|  1.49k|                    break;
  169|  6.23k|            }
  170|  6.23k|        }
  171|  1.49k|    }
  172|       |
  173|  1.49k|    if (papoGeometries != nullptr)
  ------------------
  |  Branch (173:9): [True: 1.49k, False: 0]
  ------------------
  174|  1.49k|    {
  175|  1.49k|        const int nGeomFieldCount = poDefn->GetGeomFieldCount();
  176|       |
  177|  2.98k|        for (int i = 0; i < nGeomFieldCount; i++)
  ------------------
  |  Branch (177:25): [True: 1.49k, False: 1.49k]
  ------------------
  178|  1.49k|        {
  179|  1.49k|            delete papoGeometries[i];
  180|  1.49k|        }
  181|  1.49k|    }
  182|       |
  183|  1.49k|    if (poDefn)
  ------------------
  |  Branch (183:9): [True: 1.49k, False: 0]
  ------------------
  184|  1.49k|        poDefn->Release();
  185|       |
  186|  1.49k|    CPLFree(pauFields);
  ------------------
  |  |   86|  1.49k|#define CPLFree VSIFree
  ------------------
  187|  1.49k|    CPLFree(papoGeometries);
  ------------------
  |  |   86|  1.49k|#define CPLFree VSIFree
  ------------------
  188|  1.49k|    CPLFree(m_pszStyleString);
  ------------------
  |  |   86|  1.49k|#define CPLFree VSIFree
  ------------------
  189|  1.49k|    CPLFree(m_pszTmpFieldValue);
  ------------------
  |  |   86|  1.49k|#define CPLFree VSIFree
  ------------------
  190|  1.49k|    CPLFree(m_pszNativeData);
  ------------------
  |  |   86|  1.49k|#define CPLFree VSIFree
  ------------------
  191|  1.49k|    CPLFree(m_pszNativeMediaType);
  ------------------
  |  |   86|  1.49k|#define CPLFree VSIFree
  ------------------
  192|  1.49k|}
OGR_F_Destroy:
  213|  1.49k|{
  214|  1.49k|    delete OGRFeature::FromHandle(hFeat);
  215|  1.49k|}
_ZN10OGRFeature19SetGeometryDirectlyEP11OGRGeometry:
  458|  1.30k|{
  459|  1.30k|    if (poGeomIn == GetGeometryRef())
  ------------------
  |  Branch (459:9): [True: 0, False: 1.30k]
  ------------------
  460|      0|    {
  461|      0|        return OGRERR_NONE;
  ------------------
  |  |  372|      0|#define OGRERR_NONE 0              /**< Success */
  ------------------
  462|      0|    }
  463|       |
  464|  1.30k|    return SetGeomField(0, std::unique_ptr<OGRGeometry>(poGeomIn));
  465|  1.30k|}
_ZN10OGRFeature14GetGeometryRefEv:
  741|  2.61k|{
  742|  2.61k|    if (GetGeomFieldCount() > 0)
  ------------------
  |  Branch (742:9): [True: 2.61k, False: 0]
  ------------------
  743|  2.61k|        return GetGeomFieldRef(0);
  744|       |
  745|      0|    return nullptr;
  746|  2.61k|}
_ZN10OGRFeature15GetGeomFieldRefEi:
  826|  2.61k|{
  827|  2.61k|    if (iField < 0 || iField >= GetGeomFieldCount())
  ------------------
  |  Branch (827:9): [True: 0, False: 2.61k]
  |  Branch (827:23): [True: 0, False: 2.61k]
  ------------------
  828|      0|        return nullptr;
  829|  2.61k|    else
  830|  2.61k|        return papoGeometries[iField];
  831|  2.61k|}
_ZN10OGRFeature12SetGeomFieldEiNSt3__110unique_ptrI11OGRGeometryNS0_14default_deleteIS2_EEEE:
 1106|  1.30k|{
 1107|  1.30k|    if (iField < 0 || iField >= GetGeomFieldCount())
  ------------------
  |  Branch (1107:9): [True: 0, False: 1.30k]
  |  Branch (1107:23): [True: 0, False: 1.30k]
  ------------------
 1108|      0|    {
 1109|      0|        return OGRERR_FAILURE;
  ------------------
  |  |  378|      0|#define OGRERR_FAILURE 6                   /**< Failure */
  ------------------
 1110|      0|    }
 1111|       |
 1112|  1.30k|    if (papoGeometries[iField] != poGeomIn.get())
  ------------------
  |  Branch (1112:9): [True: 1.30k, False: 0]
  ------------------
 1113|  1.30k|    {
 1114|  1.30k|        delete papoGeometries[iField];
 1115|  1.30k|        papoGeometries[iField] = poGeomIn.release();
 1116|  1.30k|    }
 1117|       |
 1118|  1.30k|    return OGRERR_NONE;
  ------------------
  |  |  372|  1.30k|#define OGRERR_NONE 0              /**< Success */
  ------------------
 1119|  1.30k|}
_ZN10OGRFeature8SetFieldEid:
 4045|  1.49k|{
 4046|  1.49k|    const OGRFieldDefn *poFDefn = poDefn->GetFieldDefn(iField);
 4047|       |
 4048|  1.49k|    if (poFDefn == nullptr)
  ------------------
  |  Branch (4048:9): [True: 0, False: 1.49k]
  ------------------
 4049|      0|        return;
 4050|       |
 4051|  1.49k|    const OGRFieldType eType = poFDefn->GetType();
 4052|  1.49k|    if (eType == OFTReal)
  ------------------
  |  Branch (4052:9): [True: 1.49k, False: 0]
  ------------------
 4053|  1.49k|    {
 4054|       |        // if( poFDefn->GetSubType() == OFSTFloat32 &&
 4055|       |        //     dfValue != (double)(float)dfValue )
 4056|       |        // {
 4057|       |        //     CPLError(CE_Warning, CPLE_AppDefined,
 4058|       |        //              "Passed value cannot be exactly representing as "
 4059|       |        //              "a single-precision floating point value.");
 4060|       |        //     dfValue = (double)(float)dfValue;
 4061|       |        // }
 4062|  1.49k|        pauFields[iField].Real = dfValue;
 4063|  1.49k|    }
 4064|      0|    else if (eType == OFTInteger)
  ------------------
  |  Branch (4064:14): [True: 0, False: 0]
  ------------------
 4065|      0|    {
 4066|      0|        constexpr int nMin = std::numeric_limits<int>::min();
 4067|      0|        if (std::isnan(dfValue))
  ------------------
  |  Branch (4067:13): [True: 0, False: 0]
  ------------------
 4068|      0|        {
 4069|      0|            pauFields[iField].Integer = nMin;
 4070|      0|            CPLError(
 4071|      0|                CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 4072|      0|                "Field %s.%s: Lossy conversion occurred when trying to set "
 4073|      0|                "32 bit integer field from real value %.17g.",
 4074|      0|                poDefn->GetName(), poFDefn->GetNameRef(), dfValue);
 4075|      0|        }
 4076|      0|        else
 4077|      0|        {
 4078|      0|            constexpr int nMax = std::numeric_limits<int>::max();
 4079|      0|            const int nVal = dfValue < nMin   ? nMin
  ------------------
  |  Branch (4079:30): [True: 0, False: 0]
  ------------------
 4080|      0|                             : dfValue > nMax ? nMax
  ------------------
  |  Branch (4080:32): [True: 0, False: 0]
  ------------------
 4081|      0|                                              : static_cast<int>(dfValue);
 4082|      0|            pauFields[iField].Integer =
 4083|      0|                OGRFeatureGetIntegerValue(poDefn, poFDefn, nVal);
 4084|      0|            if (!(nVal == dfValue))
  ------------------
  |  Branch (4084:17): [True: 0, False: 0]
  ------------------
 4085|      0|            {
 4086|      0|                CPLError(
 4087|      0|                    CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 4088|      0|                    "Field %s.%s: Lossy conversion occurred when trying to set "
 4089|      0|                    "32 bit integer field from real value %.17g.",
 4090|      0|                    poDefn->GetName(), poFDefn->GetNameRef(), dfValue);
 4091|      0|            }
 4092|      0|        }
 4093|      0|        pauFields[iField].Set.nMarker2 = 0;
 4094|      0|        pauFields[iField].Set.nMarker3 = 0;
 4095|      0|    }
 4096|      0|    else if (eType == OFTInteger64)
  ------------------
  |  Branch (4096:14): [True: 0, False: 0]
  ------------------
 4097|      0|    {
 4098|      0|        constexpr auto nMin = std::numeric_limits<GIntBig>::min();
 4099|      0|        if (std::isnan(dfValue))
  ------------------
  |  Branch (4099:13): [True: 0, False: 0]
  ------------------
 4100|      0|        {
 4101|      0|            pauFields[iField].Integer64 = nMin;
 4102|      0|            CPLError(
 4103|      0|                CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 4104|      0|                "Field %s.%s: Lossy conversion occurred when trying to set "
 4105|      0|                "64 bit integer field from real value %.17g.",
 4106|      0|                poDefn->GetName(), poFDefn->GetNameRef(), dfValue);
 4107|      0|        }
 4108|      0|        else
 4109|      0|        {
 4110|      0|            constexpr auto nMax = std::numeric_limits<GIntBig>::max();
 4111|      0|            const auto nVal = dfValue < static_cast<double>(nMin) ? nMin
  ------------------
  |  Branch (4111:31): [True: 0, False: 0]
  ------------------
 4112|      0|                              : dfValue > static_cast<double>(nMax)
  ------------------
  |  Branch (4112:33): [True: 0, False: 0]
  ------------------
 4113|      0|                                  ? nMax
 4114|      0|                                  : static_cast<GIntBig>(dfValue);
 4115|      0|            pauFields[iField].Integer64 = nVal;
 4116|      0|            if (!(static_cast<double>(nVal) == dfValue))
  ------------------
  |  Branch (4116:17): [True: 0, False: 0]
  ------------------
 4117|      0|            {
 4118|      0|                CPLError(
 4119|      0|                    CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 4120|      0|                    "Field %s.%s: Lossy conversion occurred when trying to set "
 4121|      0|                    "64 bit integer field from real value %.17g.",
 4122|      0|                    poDefn->GetName(), poFDefn->GetNameRef(), dfValue);
 4123|      0|            }
 4124|      0|        }
 4125|      0|        pauFields[iField].Set.nMarker3 = 0;
 4126|      0|    }
 4127|      0|    else if (eType == OFTRealList)
  ------------------
  |  Branch (4127:14): [True: 0, False: 0]
  ------------------
 4128|      0|    {
 4129|      0|        SetField(iField, 1, &dfValue);
 4130|      0|    }
 4131|      0|    else if (eType == OFTIntegerList)
  ------------------
  |  Branch (4131:14): [True: 0, False: 0]
  ------------------
 4132|      0|    {
 4133|      0|        int nValue = static_cast<int>(dfValue);
 4134|      0|        SetField(iField, 1, &nValue);
 4135|      0|    }
 4136|      0|    else if (eType == OFTInteger64List)
  ------------------
  |  Branch (4136:14): [True: 0, False: 0]
  ------------------
 4137|      0|    {
 4138|      0|        GIntBig nValue = static_cast<GIntBig>(dfValue);
 4139|      0|        SetField(iField, 1, &nValue);
 4140|      0|    }
 4141|      0|    else if (eType == OFTString)
  ------------------
  |  Branch (4141:14): [True: 0, False: 0]
  ------------------
 4142|      0|    {
 4143|      0|        char szTempBuffer[128] = {};
 4144|       |
 4145|      0|        CPLsnprintf(szTempBuffer, sizeof(szTempBuffer), "%.16g", dfValue);
 4146|       |
 4147|      0|        if (IsFieldSetAndNotNullUnsafe(iField))
  ------------------
  |  Branch (4147:13): [True: 0, False: 0]
  ------------------
 4148|      0|            CPLFree(pauFields[iField].String);
  ------------------
  |  |   86|      0|#define CPLFree VSIFree
  ------------------
 4149|       |
 4150|      0|        pauFields[iField].String = VSI_STRDUP_VERBOSE(szTempBuffer);
  ------------------
  |  |  368|      0|#define VSI_STRDUP_VERBOSE(pszStr) VSIStrdupVerbose(pszStr, __FILE__, __LINE__)
  ------------------
 4151|      0|        if (pauFields[iField].String == nullptr)
  ------------------
  |  Branch (4151:13): [True: 0, False: 0]
  ------------------
 4152|      0|        {
 4153|      0|            OGR_RawField_SetUnset(&pauFields[iField]);
 4154|      0|        }
 4155|      0|    }
 4156|      0|    else if (eType == OFTStringList)
  ------------------
  |  Branch (4156:14): [True: 0, False: 0]
  ------------------
 4157|      0|    {
 4158|      0|        char szTempBuffer[64] = {};
 4159|       |
 4160|      0|        CPLsnprintf(szTempBuffer, sizeof(szTempBuffer), "%.16g", dfValue);
 4161|      0|        char *apszValues[2] = {szTempBuffer, nullptr};
 4162|      0|        SetField(iField, apszValues);
 4163|      0|    }
 4164|      0|    else
 4165|      0|    {
 4166|       |        // Do nothing for other field types.
 4167|      0|    }
 4168|  1.49k|}
_ZN10OGRFeature8SetFieldEiPKc:
 4245|  4.83k|{
 4246|  4.83k|    static int bWarn = -1;
 4247|  4.83k|    if (bWarn < 0)
  ------------------
  |  Branch (4247:9): [True: 1, False: 4.82k]
  ------------------
 4248|      1|        bWarn = CPLTestBool(
 4249|      1|            CPLGetConfigOption("OGR_SETFIELD_NUMERIC_WARNING", "YES"));
 4250|       |
 4251|  4.83k|    const OGRFieldDefn *poFDefn = poDefn->GetFieldDefn(iField);
 4252|  4.83k|    if (poFDefn == nullptr)
  ------------------
  |  Branch (4252:9): [True: 0, False: 4.83k]
  ------------------
 4253|      0|        return;
 4254|       |
 4255|  4.83k|    char *pszLast = nullptr;
 4256|       |
 4257|  4.83k|    OGRFieldType eType = poFDefn->GetType();
 4258|  4.83k|    if (eType == OFTString)
  ------------------
  |  Branch (4258:9): [True: 4.83k, False: 0]
  ------------------
 4259|  4.83k|    {
 4260|  4.83k|        if (IsFieldSetAndNotNullUnsafe(iField))
  ------------------
  |  Branch (4260:13): [True: 87, False: 4.74k]
  ------------------
 4261|     87|            CPLFree(pauFields[iField].String);
  ------------------
  |  |   86|     87|#define CPLFree VSIFree
  ------------------
 4262|       |
 4263|  4.83k|        pauFields[iField].String = VSI_STRDUP_VERBOSE(pszValue ? pszValue : "");
  ------------------
  |  |  368|  9.66k|#define VSI_STRDUP_VERBOSE(pszStr) VSIStrdupVerbose(pszStr, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (368:53): [True: 4.83k, False: 0]
  |  |  ------------------
  ------------------
 4264|  4.83k|        if (pauFields[iField].String == nullptr)
  ------------------
  |  Branch (4264:13): [True: 0, False: 4.83k]
  ------------------
 4265|      0|        {
 4266|      0|            OGR_RawField_SetUnset(&pauFields[iField]);
 4267|      0|        }
 4268|  4.83k|    }
 4269|      0|    else if (eType == OFTInteger)
  ------------------
  |  Branch (4269:14): [True: 0, False: 0]
  ------------------
 4270|      0|    {
 4271|      0|        if (poFDefn->GetSubType() == OFSTBoolean)
  ------------------
  |  Branch (4271:13): [True: 0, False: 0]
  ------------------
 4272|      0|        {
 4273|      0|            constexpr char DIGIT_ZERO = '0';
 4274|      0|            if ((pszValue[0] == '1' && pszValue[1] == '\0') ||
  ------------------
  |  Branch (4274:18): [True: 0, False: 0]
  |  Branch (4274:40): [True: 0, False: 0]
  ------------------
 4275|      0|                EQUAL(pszValue, "true") || EQUAL(pszValue, "on") ||
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              EQUAL(pszValue, "true") || EQUAL(pszValue, "on") ||
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4276|      0|                EQUAL(pszValue, "yes"))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4277|      0|            {
 4278|      0|                pauFields[iField].Integer = 1;
 4279|      0|                pauFields[iField].Set.nMarker2 = 0;
 4280|      0|                pauFields[iField].Set.nMarker3 = 0;
 4281|      0|            }
 4282|      0|            else if ((pszValue[0] == DIGIT_ZERO && pszValue[1] == '\0') ||
  ------------------
  |  Branch (4282:23): [True: 0, False: 0]
  |  Branch (4282:52): [True: 0, False: 0]
  ------------------
 4283|      0|                     EQUAL(pszValue, "false") || EQUAL(pszValue, "off") ||
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                   EQUAL(pszValue, "false") || EQUAL(pszValue, "off") ||
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4284|      0|                     EQUAL(pszValue, "no"))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4285|      0|            {
 4286|      0|                pauFields[iField].Integer = 0;
 4287|      0|                pauFields[iField].Set.nMarker2 = 0;
 4288|      0|                pauFields[iField].Set.nMarker3 = 0;
 4289|      0|            }
 4290|      0|            else
 4291|      0|            {
 4292|      0|                if (CPLGetValueType(pszValue) == CPL_VALUE_STRING)
  ------------------
  |  Branch (4292:21): [True: 0, False: 0]
  ------------------
 4293|      0|                {
 4294|      0|                    CPLError(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 4295|      0|                             "Invalid value '%s' for boolean field %s.%s. "
 4296|      0|                             "Assuming it to be false.",
 4297|      0|                             pszValue, poDefn->GetName(),
 4298|      0|                             poFDefn->GetNameRef());
 4299|      0|                    pauFields[iField].Integer = 0;
 4300|      0|                    pauFields[iField].Set.nMarker2 = 0;
 4301|      0|                    pauFields[iField].Set.nMarker3 = 0;
 4302|      0|                }
 4303|      0|                else
 4304|      0|                {
 4305|      0|                    CPLError(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 4306|      0|                             "Invalid value '%s' for boolean field %s.%s. "
 4307|      0|                             "Assuming it to be true.",
 4308|      0|                             pszValue, poDefn->GetName(),
 4309|      0|                             poFDefn->GetNameRef());
 4310|      0|                    pauFields[iField].Integer = 1;
 4311|      0|                    pauFields[iField].Set.nMarker2 = 0;
 4312|      0|                    pauFields[iField].Set.nMarker3 = 0;
 4313|      0|                }
 4314|      0|            }
 4315|      0|        }
 4316|      0|        else
 4317|      0|        {
 4318|       |            // As allowed by C standard, some systems like MSVC do not reset errno.
 4319|      0|            errno = 0;
 4320|       |
 4321|      0|            long long nVal64 = std::strtoll(pszValue, &pszLast, 10);
 4322|      0|            int nVal32 = nVal64 > INT_MAX   ? INT_MAX
  ------------------
  |  Branch (4322:26): [True: 0, False: 0]
  ------------------
 4323|      0|                         : nVal64 < INT_MIN ? INT_MIN
  ------------------
  |  Branch (4323:28): [True: 0, False: 0]
  ------------------
 4324|      0|                                            : static_cast<int>(nVal64);
 4325|      0|            pauFields[iField].Integer =
 4326|      0|                OGRFeatureGetIntegerValue(poDefn, poFDefn, nVal32);
 4327|      0|            if (bWarn && pauFields[iField].Integer == nVal32 &&
  ------------------
  |  Branch (4327:17): [True: 0, False: 0]
  |  Branch (4327:26): [True: 0, False: 0]
  ------------------
 4328|      0|                (errno == ERANGE || nVal32 != nVal64 || !pszLast || *pszLast))
  ------------------
  |  Branch (4328:18): [True: 0, False: 0]
  |  Branch (4328:37): [True: 0, False: 0]
  |  Branch (4328:57): [True: 0, False: 0]
  |  Branch (4328:69): [True: 0, False: 0]
  ------------------
 4329|      0|                CPLError(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 4330|      0|                         "Value '%s' of field %s.%s parsed incompletely to "
 4331|      0|                         "integer %d.",
 4332|      0|                         pszValue, poDefn->GetName(), poFDefn->GetNameRef(),
 4333|      0|                         pauFields[iField].Integer);
 4334|      0|            pauFields[iField].Set.nMarker2 = 0;
 4335|      0|            pauFields[iField].Set.nMarker3 = 0;
 4336|      0|        }
 4337|      0|    }
 4338|      0|    else if (eType == OFTInteger64)
  ------------------
  |  Branch (4338:14): [True: 0, False: 0]
  ------------------
 4339|      0|    {
 4340|      0|        pauFields[iField].Integer64 = CPLAtoGIntBigEx(pszValue, bWarn, nullptr);
 4341|      0|        pauFields[iField].Set.nMarker3 = 0;
 4342|      0|    }
 4343|      0|    else if (eType == OFTReal)
  ------------------
  |  Branch (4343:14): [True: 0, False: 0]
  ------------------
 4344|      0|    {
 4345|      0|        pauFields[iField].Real = CPLStrtod(pszValue, &pszLast);
 4346|      0|        if (bWarn && (!pszLast || *pszLast))
  ------------------
  |  Branch (4346:13): [True: 0, False: 0]
  |  Branch (4346:23): [True: 0, False: 0]
  |  Branch (4346:35): [True: 0, False: 0]
  ------------------
 4347|      0|            CPLError(
 4348|      0|                CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 4349|      0|                "Value '%s' of field %s.%s parsed incompletely to real %.16g.",
 4350|      0|                pszValue, poDefn->GetName(), poFDefn->GetNameRef(),
 4351|      0|                pauFields[iField].Real);
 4352|      0|    }
 4353|      0|    else if (eType == OFTDate || eType == OFTTime || eType == OFTDateTime)
  ------------------
  |  Branch (4353:14): [True: 0, False: 0]
  |  Branch (4353:34): [True: 0, False: 0]
  |  Branch (4353:54): [True: 0, False: 0]
  ------------------
 4354|      0|    {
 4355|      0|        OGRField sWrkField;
 4356|       |
 4357|      0|        if (OGRParseDate(pszValue, &sWrkField, 0))
  ------------------
  |  Branch (4357:13): [True: 0, False: 0]
  ------------------
 4358|      0|            memcpy(pauFields + iField, &sWrkField, sizeof(sWrkField));
 4359|      0|    }
 4360|      0|    else if (eType == OFTIntegerList || eType == OFTInteger64List ||
  ------------------
  |  Branch (4360:14): [True: 0, False: 0]
  |  Branch (4360:41): [True: 0, False: 0]
  ------------------
 4361|      0|             eType == OFTRealList)
  ------------------
  |  Branch (4361:14): [True: 0, False: 0]
  ------------------
 4362|      0|    {
 4363|      0|        json_object *poJSonObj = nullptr;
 4364|      0|        if (pszValue[0] == '[' && pszValue[strlen(pszValue) - 1] == ']' &&
  ------------------
  |  Branch (4364:13): [True: 0, False: 0]
  |  Branch (4364:35): [True: 0, False: 0]
  ------------------
 4365|      0|            OGRJSonParse(pszValue, &poJSonObj, false))
  ------------------
  |  Branch (4365:13): [True: 0, False: 0]
  ------------------
 4366|      0|        {
 4367|      0|            const auto nLength = json_object_array_length(poJSonObj);
 4368|      0|            if (eType == OFTIntegerList && nLength > 0)
  ------------------
  |  Branch (4368:17): [True: 0, False: 0]
  |  Branch (4368:44): [True: 0, False: 0]
  ------------------
 4369|      0|            {
 4370|      0|                std::vector<int> anValues;
 4371|      0|                for (auto i = decltype(nLength){0}; i < nLength; i++)
  ------------------
  |  Branch (4371:53): [True: 0, False: 0]
  ------------------
 4372|      0|                {
 4373|      0|                    json_object *poItem =
 4374|      0|                        json_object_array_get_idx(poJSonObj, i);
 4375|      0|                    anValues.push_back(json_object_get_int(poItem));
 4376|      0|                }
 4377|      0|                SetField(iField, static_cast<int>(nLength), &(anValues[0]));
 4378|      0|            }
 4379|      0|            else if (eType == OFTInteger64List && nLength > 0)
  ------------------
  |  Branch (4379:22): [True: 0, False: 0]
  |  Branch (4379:51): [True: 0, False: 0]
  ------------------
 4380|      0|            {
 4381|      0|                std::vector<GIntBig> anValues;
 4382|      0|                for (auto i = decltype(nLength){0}; i < nLength; i++)
  ------------------
  |  Branch (4382:53): [True: 0, False: 0]
  ------------------
 4383|      0|                {
 4384|      0|                    json_object *poItem =
 4385|      0|                        json_object_array_get_idx(poJSonObj, i);
 4386|      0|                    anValues.push_back(json_object_get_int64(poItem));
 4387|      0|                }
 4388|      0|                SetField(iField, static_cast<int>(nLength), &(anValues[0]));
 4389|      0|            }
 4390|      0|            else if (eType == OFTRealList && nLength > 0)
  ------------------
  |  Branch (4390:22): [True: 0, False: 0]
  |  Branch (4390:46): [True: 0, False: 0]
  ------------------
 4391|      0|            {
 4392|      0|                std::vector<double> adfValues;
 4393|      0|                for (auto i = decltype(nLength){0}; i < nLength; i++)
  ------------------
  |  Branch (4393:53): [True: 0, False: 0]
  ------------------
 4394|      0|                {
 4395|      0|                    json_object *poItem =
 4396|      0|                        json_object_array_get_idx(poJSonObj, i);
 4397|      0|                    adfValues.push_back(json_object_get_double(poItem));
 4398|      0|                }
 4399|      0|                SetField(iField, static_cast<int>(nLength), &(adfValues[0]));
 4400|      0|            }
 4401|       |
 4402|      0|            json_object_put(poJSonObj);
 4403|      0|        }
 4404|      0|        else
 4405|      0|        {
 4406|      0|            char **papszValueList = nullptr;
 4407|       |
 4408|      0|            if (pszValue[0] == '(' && strchr(pszValue, ':') != nullptr)
  ------------------
  |  Branch (4408:17): [True: 0, False: 0]
  |  Branch (4408:39): [True: 0, False: 0]
  ------------------
 4409|      0|            {
 4410|      0|                papszValueList = CSLTokenizeString2(pszValue, ",:()", 0);
 4411|      0|            }
 4412|       |
 4413|      0|            if (papszValueList == nullptr || *papszValueList == nullptr ||
  ------------------
  |  Branch (4413:17): [True: 0, False: 0]
  |  Branch (4413:46): [True: 0, False: 0]
  ------------------
 4414|      0|                atoi(papszValueList[0]) != CSLCount(papszValueList) - 1)
  ------------------
  |  Branch (4414:17): [True: 0, False: 0]
  ------------------
 4415|      0|            {
 4416|       |                // Do nothing - the count does not match entries.
 4417|      0|            }
 4418|      0|            else if (eType == OFTIntegerList)
  ------------------
  |  Branch (4418:22): [True: 0, False: 0]
  ------------------
 4419|      0|            {
 4420|      0|                const int nCount = atoi(papszValueList[0]);
 4421|      0|                std::vector<int> anValues;
 4422|      0|                if (nCount == CSLCount(papszValueList) - 1)
  ------------------
  |  Branch (4422:21): [True: 0, False: 0]
  ------------------
 4423|      0|                {
 4424|      0|                    for (int i = 0; i < nCount; i++)
  ------------------
  |  Branch (4424:37): [True: 0, False: 0]
  ------------------
 4425|      0|                    {
 4426|       |                        // As allowed by C standard, some systems like
 4427|       |                        // MSVC do not reset errno.
 4428|      0|                        errno = 0;
 4429|      0|                        int nVal = atoi(papszValueList[i + 1]);
 4430|      0|                        if (errno == ERANGE)
  ------------------
  |  Branch (4430:29): [True: 0, False: 0]
  ------------------
 4431|      0|                        {
 4432|      0|                            CPLError(
 4433|      0|                                CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 4434|      0|                                "Field %s.%s: 32 bit integer overflow when "
 4435|      0|                                "converting %s",
 4436|      0|                                poDefn->GetName(), poFDefn->GetNameRef(),
 4437|      0|                                pszValue);
 4438|      0|                        }
 4439|      0|                        anValues.push_back(nVal);
 4440|      0|                    }
 4441|      0|                    if (nCount > 0)
  ------------------
  |  Branch (4441:25): [True: 0, False: 0]
  ------------------
 4442|      0|                        SetField(iField, nCount, &(anValues[0]));
 4443|      0|                }
 4444|      0|            }
 4445|      0|            else if (eType == OFTInteger64List)
  ------------------
  |  Branch (4445:22): [True: 0, False: 0]
  ------------------
 4446|      0|            {
 4447|      0|                const int nCount = atoi(papszValueList[0]);
 4448|      0|                std::vector<GIntBig> anValues;
 4449|      0|                if (nCount == CSLCount(papszValueList) - 1)
  ------------------
  |  Branch (4449:21): [True: 0, False: 0]
  ------------------
 4450|      0|                {
 4451|      0|                    for (int i = 0; i < nCount; i++)
  ------------------
  |  Branch (4451:37): [True: 0, False: 0]
  ------------------
 4452|      0|                    {
 4453|      0|                        const GIntBig nVal = CPLAtoGIntBigEx(
 4454|      0|                            papszValueList[i + 1], TRUE, nullptr);
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
 4455|      0|                        anValues.push_back(nVal);
 4456|      0|                    }
 4457|      0|                    if (nCount > 0)
  ------------------
  |  Branch (4457:25): [True: 0, False: 0]
  ------------------
 4458|      0|                        SetField(iField, nCount, &(anValues[0]));
 4459|      0|                }
 4460|      0|            }
 4461|      0|            else if (eType == OFTRealList)
  ------------------
  |  Branch (4461:22): [True: 0, False: 0]
  ------------------
 4462|      0|            {
 4463|      0|                int nCount = atoi(papszValueList[0]);
 4464|      0|                std::vector<double> adfValues;
 4465|      0|                if (nCount == CSLCount(papszValueList) - 1)
  ------------------
  |  Branch (4465:21): [True: 0, False: 0]
  ------------------
 4466|      0|                {
 4467|      0|                    for (int i = 0; i < nCount; i++)
  ------------------
  |  Branch (4467:37): [True: 0, False: 0]
  ------------------
 4468|      0|                        adfValues.push_back(CPLAtof(papszValueList[i + 1]));
 4469|      0|                    if (nCount > 0)
  ------------------
  |  Branch (4469:25): [True: 0, False: 0]
  ------------------
 4470|      0|                        SetField(iField, nCount, &(adfValues[0]));
 4471|      0|                }
 4472|      0|            }
 4473|       |
 4474|      0|            CSLDestroy(papszValueList);
 4475|      0|        }
 4476|      0|    }
 4477|      0|    else if (eType == OFTStringList)
  ------------------
  |  Branch (4477:14): [True: 0, False: 0]
  ------------------
 4478|      0|    {
 4479|      0|        if (pszValue && *pszValue)
  ------------------
  |  Branch (4479:13): [True: 0, False: 0]
  |  Branch (4479:25): [True: 0, False: 0]
  ------------------
 4480|      0|        {
 4481|      0|            json_object *poJSonObj = nullptr;
 4482|      0|            if (pszValue[0] == '(' && strchr(pszValue, ':') != nullptr &&
  ------------------
  |  Branch (4482:17): [True: 0, False: 0]
  |  Branch (4482:39): [True: 0, False: 0]
  ------------------
 4483|      0|                pszValue[strlen(pszValue) - 1] == ')')
  ------------------
  |  Branch (4483:17): [True: 0, False: 0]
  ------------------
 4484|      0|            {
 4485|      0|                char **papszValueList = CSLTokenizeString2(pszValue, ",:()", 0);
 4486|      0|                const int nCount =
 4487|      0|                    papszValueList[0] == nullptr ? 0 : atoi(papszValueList[0]);
  ------------------
  |  Branch (4487:21): [True: 0, False: 0]
  ------------------
 4488|      0|                std::vector<char *> aosValues;
 4489|      0|                if (nCount == CSLCount(papszValueList) - 1)
  ------------------
  |  Branch (4489:21): [True: 0, False: 0]
  ------------------
 4490|      0|                {
 4491|      0|                    for (int i = 0; i < nCount; i++)
  ------------------
  |  Branch (4491:37): [True: 0, False: 0]
  ------------------
 4492|      0|                        aosValues.push_back(papszValueList[i + 1]);
 4493|      0|                    aosValues.push_back(nullptr);
 4494|      0|                    SetField(iField, &(aosValues[0]));
 4495|      0|                }
 4496|      0|                CSLDestroy(papszValueList);
 4497|      0|            }
 4498|       |            // Is this a JSon array?
 4499|      0|            else if (pszValue[0] == '[' &&
  ------------------
  |  Branch (4499:22): [True: 0, False: 0]
  ------------------
 4500|      0|                     pszValue[strlen(pszValue) - 1] == ']' &&
  ------------------
  |  Branch (4500:22): [True: 0, False: 0]
  ------------------
 4501|      0|                     OGRJSonParse(pszValue, &poJSonObj, false))
  ------------------
  |  Branch (4501:22): [True: 0, False: 0]
  ------------------
 4502|      0|            {
 4503|      0|                CPLStringList aoList;
 4504|      0|                const auto nLength = json_object_array_length(poJSonObj);
 4505|      0|                for (auto i = decltype(nLength){0}; i < nLength; i++)
  ------------------
  |  Branch (4505:53): [True: 0, False: 0]
  ------------------
 4506|      0|                {
 4507|      0|                    json_object *poItem =
 4508|      0|                        json_object_array_get_idx(poJSonObj, i);
 4509|      0|                    if (!poItem)
  ------------------
  |  Branch (4509:25): [True: 0, False: 0]
  ------------------
 4510|      0|                        aoList.AddString("");
 4511|      0|                    else
 4512|      0|                        aoList.AddString(json_object_get_string(poItem));
 4513|      0|                }
 4514|      0|                SetField(iField, aoList.List());
 4515|      0|                json_object_put(poJSonObj);
 4516|      0|            }
 4517|      0|            else
 4518|      0|            {
 4519|      0|                const char *const papszValues[2] = {pszValue, nullptr};
 4520|      0|                SetField(iField, papszValues);
 4521|      0|            }
 4522|      0|        }
 4523|      0|    }
 4524|      0|    else
 4525|      0|    {
 4526|       |        // Do nothing for other field types.
 4527|      0|    }
 4528|  4.83k|}
_ZN10OGRFeature6SetFIDEx:
 5950|  1.49k|{
 5951|  1.49k|    nFID = nFIDIn;
 5952|       |
 5953|  1.49k|    return OGRERR_NONE;
  ------------------
  |  |  372|  1.49k|#define OGRERR_NONE 0              /**< Success */
  ------------------
 5954|  1.49k|}
_ZN10OGRFeature14SetStyleStringEPKc:
 6764|  2.05k|{
 6765|  2.05k|    if (m_pszStyleString)
  ------------------
  |  Branch (6765:9): [True: 559, False: 1.49k]
  ------------------
 6766|    559|    {
 6767|    559|        CPLFree(m_pszStyleString);
  ------------------
  |  |   86|    559|#define CPLFree VSIFree
  ------------------
 6768|    559|        m_pszStyleString = nullptr;
 6769|    559|    }
 6770|       |
 6771|  2.05k|    if (pszString)
  ------------------
  |  Branch (6771:9): [True: 2.05k, False: 0]
  ------------------
 6772|  2.05k|        m_pszStyleString = VSI_STRDUP_VERBOSE(pszString);
  ------------------
  |  |  368|  2.05k|#define VSI_STRDUP_VERBOSE(pszStr) VSIStrdupVerbose(pszStr, __FILE__, __LINE__)
  ------------------
 6773|  2.05k|}
OGR_RawField_SetUnset:
 7574|      2|{
 7575|      2|    puField->Set.nMarker1 = OGRUnsetMarker;
  ------------------
  |  |  863|      2|#define OGRUnsetMarker -21121
  ------------------
 7576|      2|    puField->Set.nMarker2 = OGRUnsetMarker;
  ------------------
  |  |  863|      2|#define OGRUnsetMarker -21121
  ------------------
 7577|      2|    puField->Set.nMarker3 = OGRUnsetMarker;
  ------------------
  |  |  863|      2|#define OGRUnsetMarker -21121
  ------------------
 7578|      2|}

_ZN14OGRFeatureDefnC2EPKc:
   47|  1.02k|{
   48|  1.02k|    pszFeatureClassName = CPLStrdup(pszName);
   49|  1.02k|    apoGeomFieldDefn.emplace_back(
   50|  1.02k|        std::make_unique<OGRGeomFieldDefn>("", wkbUnknown));
   51|  1.02k|}
_ZN14OGRFeatureDefnD2Ev:
   82|  1.02k|{
   83|  1.02k|    if (nRefCount != 0)
  ------------------
  |  Branch (83:9): [True: 0, False: 1.02k]
  ------------------
   84|      0|    {
   85|      0|        CPLDebug("OGRFeatureDefn",
   86|      0|                 "OGRFeatureDefn %s with a ref count of %d deleted!",
   87|      0|                 pszFeatureClassName, nRefCount);
   88|      0|    }
   89|       |
   90|  1.02k|    CPLFree(pszFeatureClassName);
  ------------------
  |  |   86|  1.02k|#define CPLFree VSIFree
  ------------------
   91|  1.02k|}
_ZN14OGRFeatureDefn7ReleaseEv:
  124|  2.51k|{
  125|  2.51k|    if (Dereference() <= 0)
  ------------------
  |  Branch (125:9): [True: 1.02k, False: 1.49k]
  ------------------
  126|  1.02k|        delete this;
  127|  2.51k|}
_ZNK14OGRFeatureDefn7GetNameEv:
  226|  1.02k|{
  227|  1.02k|    return pszFeatureClassName;
  228|  1.02k|}
_ZNK14OGRFeatureDefn13GetFieldCountEv:
  263|  30.7k|{
  264|  30.7k|    return static_cast<int>(apoFieldDefn.size());
  265|  30.7k|}
_ZN14OGRFeatureDefn12GetFieldDefnEi:
  308|  6.32k|{
  309|  6.32k|    if (iField < 0 || iField >= GetFieldCount())
  ------------------
  |  Branch (309:9): [True: 0, False: 6.32k]
  |  Branch (309:23): [True: 0, False: 6.32k]
  ------------------
  310|      0|    {
  311|      0|        CPLError(CE_Failure, CPLE_AppDefined, "Invalid index : %d", iField);
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  312|      0|        return nullptr;
  313|      0|    }
  314|       |
  315|  6.32k|    return apoFieldDefn[iField].get();
  316|  6.32k|}
_ZNK14OGRFeatureDefn12GetFieldDefnEi:
  333|  16.6k|{
  334|  16.6k|    if (iField < 0 || iField >= GetFieldCount())
  ------------------
  |  Branch (334:9): [True: 0, False: 16.6k]
  |  Branch (334:23): [True: 0, False: 16.6k]
  ------------------
  335|      0|    {
  336|      0|        CPLError(CE_Failure, CPLE_AppDefined, "Invalid index : %d", iField);
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  337|      0|        return nullptr;
  338|      0|    }
  339|       |
  340|  16.6k|    return apoFieldDefn[iField].get();
  341|  16.6k|}
_ZN14OGRFeatureDefn12AddFieldDefnEPK12OGRFieldDefn:
  409|  5.38k|{
  410|  5.38k|    if (m_bSealed)
  ------------------
  |  Branch (410:9): [True: 0, False: 5.38k]
  ------------------
  411|      0|    {
  412|      0|        CPLError(
  413|      0|            CE_Failure, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  414|      0|            "OGRFeatureDefn::AddFieldDefn() not allowed on a sealed object");
  415|      0|        return;
  416|      0|    }
  417|  5.38k|    apoFieldDefn.emplace_back(std::make_unique<OGRFieldDefn>(poNewDefn));
  418|  5.38k|}
_ZNK14OGRFeatureDefn17GetGeomFieldCountEv:
  667|  17.6k|{
  668|  17.6k|    return static_cast<int>(apoGeomFieldDefn.size());
  669|  17.6k|}
_ZN14OGRFeatureDefn16GetGeomFieldDefnEi:
  717|  3.06k|{
  718|  3.06k|    if (iGeomField < 0 || iGeomField >= GetGeomFieldCount())
  ------------------
  |  Branch (718:9): [True: 0, False: 3.06k]
  |  Branch (718:27): [True: 0, False: 3.06k]
  ------------------
  719|      0|    {
  720|      0|        CPLError(CE_Failure, CPLE_AppDefined, "Invalid index : %d", iGeomField);
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  721|      0|        return nullptr;
  722|      0|    }
  723|       |
  724|  3.06k|    return apoGeomFieldDefn[iGeomField].get();
  725|  3.06k|}
_ZNK14OGRFeatureDefn16GetGeomFieldDefnEi:
  743|  1.02k|{
  744|  1.02k|    if (iGeomField < 0 || iGeomField >= GetGeomFieldCount())
  ------------------
  |  Branch (744:9): [True: 0, False: 1.02k]
  |  Branch (744:27): [True: 0, False: 1.02k]
  ------------------
  745|      0|    {
  746|      0|        CPLError(CE_Failure, CPLE_AppDefined, "Invalid index : %d", iGeomField);
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  747|      0|        return nullptr;
  748|      0|    }
  749|       |
  750|  1.02k|    return apoGeomFieldDefn[iGeomField].get();
  751|  1.02k|}
_ZNK14OGRFeatureDefn11GetGeomTypeEv:
 1034|  1.02k|{
 1035|  1.02k|    if (GetGeomFieldCount() == 0)
  ------------------
  |  Branch (1035:9): [True: 0, False: 1.02k]
  ------------------
 1036|      0|        return wkbNone;
 1037|  1.02k|    const OGRGeomFieldDefn *poGFldDefn = GetGeomFieldDefn(0);
 1038|  1.02k|    if (poGFldDefn == nullptr)
  ------------------
  |  Branch (1038:9): [True: 0, False: 1.02k]
  ------------------
 1039|      0|        return wkbNone;
 1040|  1.02k|    OGRwkbGeometryType eType = poGFldDefn->GetType();
 1041|  1.02k|    if (eType == (/*wkbUnknown |*/ wkb25DBitInternalUse) &&
  ------------------
  |  |   50|  1.02k|#define wkb25DBitInternalUse 0x80000000
  ------------------
  |  Branch (1041:9): [True: 0, False: 1.02k]
  ------------------
 1042|  1.02k|        CPLTestBool(CPLGetConfigOption("QGIS_HACK", "NO")))
  ------------------
  |  Branch (1042:9): [True: 0, False: 0]
  ------------------
 1043|      0|        eType = wkbUnknown;
 1044|  1.02k|    return eType;
 1045|  1.02k|}
_ZN14OGRFeatureDefn11SetGeomTypeE18OGRwkbGeometryType:
 1098|  1.02k|{
 1099|  1.02k|    if (m_bSealed)
  ------------------
  |  Branch (1099:9): [True: 0, False: 1.02k]
  ------------------
 1100|      0|    {
 1101|      0|        CPLError(
 1102|      0|            CE_Failure, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 1103|      0|            "OGRFeatureDefn::SetGeomType() not allowed on a sealed object");
 1104|      0|        return;
 1105|      0|    }
 1106|  1.02k|    const int nGeomFieldCount = GetGeomFieldCount();
 1107|  1.02k|    if (nGeomFieldCount > 0)
  ------------------
  |  Branch (1107:9): [True: 1.02k, False: 0]
  ------------------
 1108|  1.02k|    {
 1109|  1.02k|        if (nGeomFieldCount == 1 && eNewType == wkbNone)
  ------------------
  |  Branch (1109:13): [True: 1.02k, False: 0]
  |  Branch (1109:37): [True: 0, False: 1.02k]
  ------------------
 1110|      0|            DeleteGeomFieldDefn(0);
 1111|  1.02k|        else
 1112|  1.02k|            GetGeomFieldDefn(0)->SetType(eNewType);
 1113|  1.02k|    }
 1114|      0|    else if (eNewType != wkbNone)
  ------------------
  |  Branch (1114:14): [True: 0, False: 0]
  ------------------
 1115|      0|    {
 1116|      0|        OGRGeomFieldDefn oGeomFieldDefn("", eNewType);
 1117|      0|        AddGeomFieldDefn(&oGeomFieldDefn);
 1118|      0|    }
 1119|  1.02k|}
_ZNK14OGRFeatureDefn13GetFieldIndexEPKc:
 1276|  6.32k|{
 1277|  6.32k|    const int nFieldCount = GetFieldCount();
 1278|  16.6k|    for (int i = 0; i < nFieldCount; i++)
  ------------------
  |  Branch (1278:21): [True: 16.6k, False: 0]
  ------------------
 1279|  16.6k|    {
 1280|  16.6k|        const OGRFieldDefn *poFDefn = GetFieldDefn(i);
 1281|  16.6k|        if (poFDefn != nullptr && EQUAL(pszFieldName, poFDefn->GetNameRef()))
  ------------------
  |  |  541|  16.6k|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|  16.6k|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 6.32k, False: 10.3k]
  |  |  ------------------
  ------------------
  |  Branch (1281:13): [True: 16.6k, False: 0]
  ------------------
 1282|  6.32k|            return i;
 1283|  16.6k|    }
 1284|       |
 1285|      0|    return -1;
 1286|  6.32k|}

_ZN12OGRFieldDefnC2EPKc12OGRFieldType:
   41|  5.38k|    : pszName(CPLStrdup(pszNameIn)), pszAlternativeName(CPLStrdup("")),
   42|  5.38k|      eType(eTypeIn), eJustify(OJUndefined),
   43|       |      // Should nWidth & nPrecision be defined in some particular way for
   44|       |      // numbers?
   45|  5.38k|      nWidth(0), nPrecision(0), pszDefault(nullptr), bIgnore(FALSE),
  ------------------
  |  | 1039|  5.38k|#define FALSE 0
  ------------------
   46|  5.38k|      eSubType(OFSTNone), bNullable(TRUE), bUnique(FALSE)
  ------------------
  |  | 1043|  5.38k|#define TRUE 1
  ------------------
                    eSubType(OFSTNone), bNullable(TRUE), bUnique(FALSE)
  ------------------
  |  | 1039|  5.38k|#define FALSE 0
  ------------------
   47|  5.38k|{
   48|  5.38k|}
_ZN12OGRFieldDefnC2EPKS_:
   63|  5.38k|    : pszName(CPLStrdup(poPrototype->GetNameRef())),
   64|  5.38k|      pszAlternativeName(CPLStrdup(poPrototype->GetAlternativeNameRef())),
   65|  5.38k|      eType(poPrototype->GetType()), eJustify(poPrototype->GetJustify()),
   66|  5.38k|      nWidth(poPrototype->GetWidth()), nPrecision(poPrototype->GetPrecision()),
   67|  5.38k|      pszDefault(nullptr),
   68|  5.38k|      bIgnore(FALSE),  // TODO(schwehr): Can we use IsIgnored()?
  ------------------
  |  | 1039|  5.38k|#define FALSE 0
  ------------------
   69|  5.38k|      eSubType(poPrototype->GetSubType()), bNullable(poPrototype->IsNullable()),
   70|  5.38k|      bUnique(poPrototype->IsUnique()),
   71|  5.38k|      m_bGenerated(poPrototype->IsGenerated()),
   72|  5.38k|      m_osDomainName(poPrototype->m_osDomainName),
   73|  5.38k|      m_osComment(poPrototype->GetComment()),
   74|  5.38k|      m_nTZFlag(poPrototype->GetTZFlag())
   75|  5.38k|{
   76|  5.38k|    SetDefault(poPrototype->GetDefault());
   77|  5.38k|}
_ZN12OGRFieldDefnD2Ev:
  106|  10.7k|{
  107|  10.7k|    CPLFree(pszName);
  ------------------
  |  |   86|  10.7k|#define CPLFree VSIFree
  ------------------
  108|  10.7k|    CPLFree(pszAlternativeName);
  ------------------
  |  |   86|  10.7k|#define CPLFree VSIFree
  ------------------
  109|  10.7k|    CPLFree(pszDefault);
  ------------------
  |  |   86|  10.7k|#define CPLFree VSIFree
  ------------------
  110|  10.7k|}
_ZN12OGRFieldDefn10SetDefaultEPKc:
  677|  5.38k|{
  678|  5.38k|    if (m_bSealed)
  ------------------
  |  Branch (678:9): [True: 0, False: 5.38k]
  ------------------
  679|      0|    {
  680|      0|        CPLError(CE_Failure, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  681|      0|                 "OGRFieldDefn::SetDefault() not allowed on a sealed object");
  682|      0|        return;
  683|      0|    }
  684|  5.38k|    CPLFree(pszDefault);
  ------------------
  |  |   86|  5.38k|#define CPLFree VSIFree
  ------------------
  685|  5.38k|    pszDefault = nullptr;
  686|       |
  687|  5.38k|    if (pszDefaultIn && pszDefaultIn[0] == '\'' &&
  ------------------
  |  Branch (687:9): [True: 0, False: 5.38k]
  |  Branch (687:25): [True: 0, False: 0]
  ------------------
  688|  5.38k|        pszDefaultIn[strlen(pszDefaultIn) - 1] == '\'')
  ------------------
  |  Branch (688:9): [True: 0, False: 0]
  ------------------
  689|      0|    {
  690|      0|        const char *pszPtr = pszDefaultIn + 1;  // Used after for.
  691|      0|        for (; *pszPtr != '\0'; pszPtr++)
  ------------------
  |  Branch (691:16): [True: 0, False: 0]
  ------------------
  692|      0|        {
  693|      0|            if (*pszPtr == '\'')
  ------------------
  |  Branch (693:17): [True: 0, False: 0]
  ------------------
  694|      0|            {
  695|      0|                if (pszPtr[1] == '\0')
  ------------------
  |  Branch (695:21): [True: 0, False: 0]
  ------------------
  696|      0|                    break;
  697|      0|                if (pszPtr[1] != '\'')
  ------------------
  |  Branch (697:21): [True: 0, False: 0]
  ------------------
  698|      0|                {
  699|      0|                    CPLError(CE_Failure, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  700|      0|                             "Incorrectly quoted string literal");
  701|      0|                    return;
  702|      0|                }
  703|      0|                pszPtr++;
  704|      0|            }
  705|      0|        }
  706|      0|        if (*pszPtr == '\0')
  ------------------
  |  Branch (706:13): [True: 0, False: 0]
  ------------------
  707|      0|        {
  708|      0|            CPLError(CE_Failure, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  709|      0|                     "Incorrectly quoted string literal");
  710|      0|            return;
  711|      0|        }
  712|      0|    }
  713|       |
  714|  5.38k|    pszDefault = pszDefaultIn ? CPLStrdup(pszDefaultIn) : nullptr;
  ------------------
  |  Branch (714:18): [True: 0, False: 5.38k]
  ------------------
  715|  5.38k|}
_ZNK12OGRFieldDefn10GetDefaultEv:
  776|  5.38k|{
  777|  5.38k|    return pszDefault;
  778|  5.38k|}

_ZN11OGRGeometryC2Ev:
   90|  6.19k|OGRGeometry::OGRGeometry() = default;
_ZN11OGRGeometryD2Ev:
  134|  6.19k|{
  135|  6.19k|    if (poSRS != nullptr)
  ------------------
  |  Branch (135:9): [True: 1.38k, False: 4.80k]
  ------------------
  136|  1.38k|        const_cast<OGRSpatialReference *>(poSRS)->Release();
  137|  6.19k|}
_ZN11OGRGeometry22assignSpatialReferenceEPK19OGRSpatialReference:
  511|  1.38k|{
  512|       |    // Do in that order to properly handle poSR == poSRS
  513|  1.38k|    if (poSR != nullptr)
  ------------------
  |  Branch (513:9): [True: 1.38k, False: 0]
  ------------------
  514|  1.38k|        const_cast<OGRSpatialReference *>(poSR)->Reference();
  515|  1.38k|    if (poSRS != nullptr)
  ------------------
  |  Branch (515:9): [True: 0, False: 1.38k]
  ------------------
  516|      0|        const_cast<OGRSpatialReference *>(poSRS)->Release();
  517|       |
  518|  1.38k|    poSRS = poSR;
  519|  1.38k|}
_ZN11OGRGeometry5set3DEi:
 1136|     80|{
 1137|     80|    if (bIs3D)
  ------------------
  |  Branch (1137:9): [True: 80, False: 0]
  ------------------
 1138|     80|        flags |= OGR_G_3D;
 1139|      0|    else
 1140|      0|        flags &= ~OGR_G_3D;
 1141|     80|    return true;
 1142|     80|}
OGR_GT_Flatten:
 7605|  1.02k|{
 7606|  1.02k|    eType = static_cast<OGRwkbGeometryType>(eType & (~wkb25DBitInternalUse));
  ------------------
  |  |   50|  1.02k|#define wkb25DBitInternalUse 0x80000000
  ------------------
 7607|  1.02k|    if (eType >= 1000 && eType < 2000)  // ISO Z.
  ------------------
  |  Branch (7607:9): [True: 0, False: 1.02k]
  |  Branch (7607:26): [True: 0, False: 0]
  ------------------
 7608|      0|        return static_cast<OGRwkbGeometryType>(eType - 1000);
 7609|  1.02k|    if (eType >= 2000 && eType < 3000)  // ISO M.
  ------------------
  |  Branch (7609:9): [True: 0, False: 1.02k]
  |  Branch (7609:26): [True: 0, False: 0]
  ------------------
 7610|      0|        return static_cast<OGRwkbGeometryType>(eType - 2000);
 7611|  1.02k|    if (eType >= 3000 && eType < 4000)  // ISO ZM.
  ------------------
  |  Branch (7611:9): [True: 0, False: 1.02k]
  |  Branch (7611:26): [True: 0, False: 0]
  ------------------
 7612|      0|        return static_cast<OGRwkbGeometryType>(eType - 3000);
 7613|  1.02k|    return eType;
 7614|  1.02k|}
OGR_GT_IsNonLinear:
 8068|  1.02k|{
 8069|  1.02k|    OGRwkbGeometryType eFGeomType = wkbFlatten(eGeomType);
  ------------------
  |  |  562|  1.02k|#define wkbFlatten(x) OGR_GT_Flatten(static_cast<OGRwkbGeometryType>(x))
  ------------------
 8070|  1.02k|    return eFGeomType == wkbCurve || eFGeomType == wkbSurface ||
  ------------------
  |  Branch (8070:12): [True: 0, False: 1.02k]
  |  Branch (8070:38): [True: 0, False: 1.02k]
  ------------------
 8071|  1.02k|           eFGeomType == wkbCircularString || eFGeomType == wkbCompoundCurve ||
  ------------------
  |  Branch (8071:12): [True: 45, False: 975]
  |  Branch (8071:47): [True: 0, False: 975]
  ------------------
 8072|  1.02k|           eFGeomType == wkbCurvePolygon || eFGeomType == wkbMultiCurve ||
  ------------------
  |  Branch (8072:12): [True: 0, False: 975]
  |  Branch (8072:45): [True: 0, False: 975]
  ------------------
 8073|  1.02k|           eFGeomType == wkbMultiSurface;
  ------------------
  |  Branch (8073:12): [True: 0, False: 975]
  ------------------
 8074|  1.02k|}
_ZN11OGRGeometry28HomogenizeDimensionalityWithEPS_:
 8676|    160|{
 8677|    160|    if (poOtherGeom->Is3D() && !Is3D())
  ------------------
  |  Branch (8677:9): [True: 160, False: 0]
  |  Branch (8677:32): [True: 80, False: 80]
  ------------------
 8678|     80|        set3D(TRUE);
  ------------------
  |  | 1043|     80|#define TRUE 1
  ------------------
 8679|       |
 8680|    160|    if (poOtherGeom->IsMeasured() && !IsMeasured())
  ------------------
  |  Branch (8680:9): [True: 0, False: 160]
  |  Branch (8680:38): [True: 0, False: 0]
  ------------------
 8681|      0|        setMeasured(TRUE);
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
 8682|       |
 8683|    160|    if (!poOtherGeom->Is3D() && Is3D())
  ------------------
  |  Branch (8683:9): [True: 0, False: 160]
  |  Branch (8683:33): [True: 0, False: 0]
  ------------------
 8684|      0|        poOtherGeom->set3D(TRUE);
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
 8685|       |
 8686|    160|    if (!poOtherGeom->IsMeasured() && IsMeasured())
  ------------------
  |  Branch (8686:9): [True: 160, False: 0]
  |  Branch (8686:39): [True: 0, False: 160]
  ------------------
 8687|      0|        poOtherGeom->setMeasured(TRUE);
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
 8688|    160|}

_ZN18OGRGeometryFactory21GetDefaultArcStepSizeEv:
 4207|  4.29k|{
 4208|  4.29k|    const double dfVal = CPLAtofM(CPLGetConfigOption("OGR_ARC_STEPSIZE", "4"));
 4209|  4.29k|    constexpr double MIN_VAL = 1e-2;
 4210|  4.29k|    if (dfVal < MIN_VAL)
  ------------------
  |  Branch (4210:9): [True: 0, False: 4.29k]
  ------------------
 4211|      0|    {
 4212|      0|        CPLErrorOnce(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |  178|      0|    do                                                                         \
  |  |  179|      0|    {                                                                          \
  |  |  180|      0|        static bool lbCPLErrorOnce = false;                                    \
  |  |  181|      0|        if (!lbCPLErrorOnce)                                                   \
  |  |  ------------------
  |  |  |  Branch (181:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  182|      0|        {                                                                      \
  |  |  183|      0|            lbCPLErrorOnce = true;                                             \
  |  |  184|      0|            const char *lCPLErrorMsg = CPLSPrintf(__VA_ARGS__);                \
  |  |  185|      0|            const size_t lCPLErrorMsgLen = strlen(lCPLErrorMsg);               \
  |  |  186|      0|            const char *lCPLErrorMsgSuffix =                                   \
  |  |  187|      0|                " Further messages of this type will be suppressed.";          \
  |  |  188|      0|            if (lCPLErrorMsgLen && lCPLErrorMsg[lCPLErrorMsgLen - 1] == '.')   \
  |  |  ------------------
  |  |  |  Branch (188:17): [True: 0, False: 0]
  |  |  |  Branch (188:36): [True: 0, False: 0]
  |  |  ------------------
  |  |  189|      0|                CPLError((eErrClass), (err_no), "%s%s", lCPLErrorMsg,          \
  |  |  190|      0|                         lCPLErrorMsgSuffix);                                  \
  |  |  191|      0|            else                                                               \
  |  |  192|      0|                CPLError((eErrClass), (err_no), "%s.%s", lCPLErrorMsg,         \
  |  |  193|      0|                         lCPLErrorMsgSuffix);                                  \
  |  |  194|      0|        }                                                                      \
  |  |  195|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4213|      0|                     "Too small value for OGR_ARC_STEPSIZE. Clamping it to %f",
 4214|      0|                     MIN_VAL);
 4215|      0|        return MIN_VAL;
 4216|      0|    }
 4217|  4.29k|    constexpr double MAX_VAL = 180;
 4218|  4.29k|    if (dfVal > MAX_VAL)
  ------------------
  |  Branch (4218:9): [True: 0, False: 4.29k]
  ------------------
 4219|      0|    {
 4220|      0|        CPLErrorOnce(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |  178|      0|    do                                                                         \
  |  |  179|      0|    {                                                                          \
  |  |  180|      0|        static bool lbCPLErrorOnce = false;                                    \
  |  |  181|      0|        if (!lbCPLErrorOnce)                                                   \
  |  |  ------------------
  |  |  |  Branch (181:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  182|      0|        {                                                                      \
  |  |  183|      0|            lbCPLErrorOnce = true;                                             \
  |  |  184|      0|            const char *lCPLErrorMsg = CPLSPrintf(__VA_ARGS__);                \
  |  |  185|      0|            const size_t lCPLErrorMsgLen = strlen(lCPLErrorMsg);               \
  |  |  186|      0|            const char *lCPLErrorMsgSuffix =                                   \
  |  |  187|      0|                " Further messages of this type will be suppressed.";          \
  |  |  188|      0|            if (lCPLErrorMsgLen && lCPLErrorMsg[lCPLErrorMsgLen - 1] == '.')   \
  |  |  ------------------
  |  |  |  Branch (188:17): [True: 0, False: 0]
  |  |  |  Branch (188:36): [True: 0, False: 0]
  |  |  ------------------
  |  |  189|      0|                CPLError((eErrClass), (err_no), "%s%s", lCPLErrorMsg,          \
  |  |  190|      0|                         lCPLErrorMsgSuffix);                                  \
  |  |  191|      0|            else                                                               \
  |  |  192|      0|                CPLError((eErrClass), (err_no), "%s.%s", lCPLErrorMsg,         \
  |  |  193|      0|                         lCPLErrorMsgSuffix);                                  \
  |  |  194|      0|        }                                                                      \
  |  |  195|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4221|      0|                     "Too large value for OGR_ARC_STEPSIZE. Clamping it to %f",
 4222|      0|                     MAX_VAL);
 4223|      0|        return MAX_VAL;
 4224|      0|    }
 4225|  4.29k|    return dfVal;
 4226|  4.29k|}
_ZN18OGRGeometryFactory20approximateArcAnglesEdddddddddb:
 4281|  4.29k|{
 4282|  4.29k|    OGRLineString *poLine = new OGRLineString();
 4283|  4.29k|    const double dfRotationRadians = dfRotation * M_PI / 180.0;
 4284|       |
 4285|       |    // Support default arc step setting.
 4286|  4.29k|    if (dfMaxAngleStepSizeDegrees < 1e-6)
  ------------------
  |  Branch (4286:9): [True: 4.29k, False: 0]
  ------------------
 4287|  4.29k|    {
 4288|  4.29k|        dfMaxAngleStepSizeDegrees = OGRGeometryFactory::GetDefaultArcStepSize();
 4289|  4.29k|    }
 4290|       |
 4291|       |    // Determine maximum interpolation gap. This is the largest straight-line
 4292|       |    // distance allowed between pairs of interpolated points. Default zero,
 4293|       |    // meaning no gap.
 4294|       |    // coverity[tainted_data]
 4295|  4.29k|    const double dfMaxInterpolationGap =
 4296|  4.29k|        bUseMaxGap ? CPLAtofM(CPLGetConfigOption("OGR_ARC_MAX_GAP", "0")) : 0.0;
  ------------------
  |  Branch (4296:9): [True: 0, False: 4.29k]
  ------------------
 4297|       |
 4298|       |    // Is this a full circle?
 4299|  4.29k|    const bool bIsFullCircle = fabs(dfEndAngle - dfStartAngle) == 360.0;
 4300|       |
 4301|       |    // Switch direction.
 4302|  4.29k|    dfStartAngle *= -1;
 4303|  4.29k|    dfEndAngle *= -1;
 4304|       |
 4305|       |    // Figure out the number of slices to make this into.
 4306|  4.29k|    int nVertexCount =
 4307|  4.29k|        std::max(2, static_cast<int>(ceil(fabs(dfEndAngle - dfStartAngle) /
 4308|  4.29k|                                          dfMaxAngleStepSizeDegrees) +
 4309|  4.29k|                                     1));
 4310|  4.29k|    const double dfSlice = (dfEndAngle - dfStartAngle) / (nVertexCount - 1);
 4311|       |
 4312|       |    // If it is a full circle we will work out the last point separately.
 4313|  4.29k|    if (bIsFullCircle)
  ------------------
  |  Branch (4313:9): [True: 30, False: 4.26k]
  ------------------
 4314|     30|    {
 4315|     30|        nVertexCount--;
 4316|     30|    }
 4317|       |
 4318|       |    /* -------------------------------------------------------------------- */
 4319|       |    /*      Compute the interpolated points.                                */
 4320|       |    /* -------------------------------------------------------------------- */
 4321|  4.29k|    double dfLastX = 0.0;
 4322|  4.29k|    double dfLastY = 0.0;
 4323|  4.29k|    int nTotalAddPoints = 0;
 4324|  37.2M|    for (int iPoint = 0; iPoint < nVertexCount; iPoint++)
  ------------------
  |  Branch (4324:26): [True: 37.2M, False: 4.29k]
  ------------------
 4325|  37.2M|    {
 4326|  37.2M|        const double dfAngleOnEllipse =
 4327|  37.2M|            (dfStartAngle + iPoint * dfSlice) * M_PI / 180.0;
 4328|       |
 4329|       |        // Compute position on the unrotated ellipse.
 4330|  37.2M|        const double dfEllipseX = cos(dfAngleOnEllipse) * dfPrimaryRadius;
 4331|  37.2M|        const double dfEllipseY = sin(dfAngleOnEllipse) * dfSecondaryRadius;
 4332|       |
 4333|       |        // Is this point too far from the previous point?
 4334|  37.2M|        if (iPoint && dfMaxInterpolationGap != 0.0)
  ------------------
  |  Branch (4334:13): [True: 37.2M, False: 4.29k]
  |  Branch (4334:23): [True: 0, False: 37.2M]
  ------------------
 4335|      0|        {
 4336|      0|            const double dfDistFromLast =
 4337|      0|                DISTANCE(dfLastX, dfLastY, dfEllipseX, dfEllipseY);
 4338|       |
 4339|      0|            if (dfDistFromLast > dfMaxInterpolationGap)
  ------------------
  |  Branch (4339:17): [True: 0, False: 0]
  ------------------
 4340|      0|            {
 4341|      0|                const int nAddPoints =
 4342|      0|                    static_cast<int>(dfDistFromLast / dfMaxInterpolationGap);
 4343|      0|                const double dfAddSlice = dfSlice / (nAddPoints + 1);
 4344|       |
 4345|       |                // Interpolate additional points
 4346|      0|                for (int iAddPoint = 0; iAddPoint < nAddPoints; iAddPoint++)
  ------------------
  |  Branch (4346:41): [True: 0, False: 0]
  ------------------
 4347|      0|                {
 4348|      0|                    const double dfAddAngleOnEllipse =
 4349|      0|                        (dfStartAngle + (iPoint - 1) * dfSlice +
 4350|      0|                         (iAddPoint + 1) * dfAddSlice) *
 4351|      0|                        (M_PI / 180.0);
 4352|       |
 4353|      0|                    poLine->setPoint(
 4354|      0|                        iPoint + nTotalAddPoints + iAddPoint,
 4355|      0|                        cos(dfAddAngleOnEllipse) * dfPrimaryRadius,
 4356|      0|                        sin(dfAddAngleOnEllipse) * dfSecondaryRadius, dfZ);
 4357|      0|                }
 4358|       |
 4359|      0|                nTotalAddPoints += nAddPoints;
 4360|      0|            }
 4361|      0|        }
 4362|       |
 4363|  37.2M|        poLine->setPoint(iPoint + nTotalAddPoints, dfEllipseX, dfEllipseY, dfZ);
 4364|  37.2M|        dfLastX = dfEllipseX;
 4365|  37.2M|        dfLastY = dfEllipseY;
 4366|  37.2M|    }
 4367|       |
 4368|       |    /* -------------------------------------------------------------------- */
 4369|       |    /*      Rotate and translate the ellipse.                               */
 4370|       |    /* -------------------------------------------------------------------- */
 4371|  4.29k|    nVertexCount = poLine->getNumPoints();
 4372|  37.2M|    for (int iPoint = 0; iPoint < nVertexCount; iPoint++)
  ------------------
  |  Branch (4372:26): [True: 37.2M, False: 4.29k]
  ------------------
 4373|  37.2M|    {
 4374|  37.2M|        const double dfEllipseX = poLine->getX(iPoint);
 4375|  37.2M|        const double dfEllipseY = poLine->getY(iPoint);
 4376|       |
 4377|       |        // Rotate this position around the center of the ellipse.
 4378|  37.2M|        const double dfArcX = dfCenterX + dfEllipseX * cos(dfRotationRadians) +
 4379|  37.2M|                              dfEllipseY * sin(dfRotationRadians);
 4380|  37.2M|        const double dfArcY = dfCenterY - dfEllipseX * sin(dfRotationRadians) +
 4381|  37.2M|                              dfEllipseY * cos(dfRotationRadians);
 4382|       |
 4383|  37.2M|        poLine->setPoint(iPoint, dfArcX, dfArcY, dfZ);
 4384|  37.2M|    }
 4385|       |
 4386|       |    /* -------------------------------------------------------------------- */
 4387|       |    /*      If we're asked to make a full circle, ensure the start and      */
 4388|       |    /*      end points coincide exactly, in spite of any rounding error.    */
 4389|       |    /* -------------------------------------------------------------------- */
 4390|  4.29k|    if (bIsFullCircle)
  ------------------
  |  Branch (4390:9): [True: 30, False: 4.26k]
  ------------------
 4391|     30|    {
 4392|     30|        OGRPoint oPoint;
 4393|     30|        poLine->getPoint(0, &oPoint);
 4394|     30|        poLine->setPoint(nVertexCount, &oPoint);
 4395|     30|    }
 4396|       |
 4397|  4.29k|    return poLine;
 4398|  4.29k|}

_ZN16OGRGeomFieldDefnC2EPKc18OGRwkbGeometryType:
   43|  1.02k|{
   44|  1.02k|    Initialize(pszNameIn, eGeomTypeIn);
   45|  1.02k|}
_ZN16OGRGeomFieldDefn10InitializeEPKc18OGRwkbGeometryType:
  106|  1.02k|{
  107|  1.02k|    pszName = CPLStrdup(pszNameIn);
  108|  1.02k|    eGeomType = eTypeIn;
  109|  1.02k|}
_ZN16OGRGeomFieldDefnD2Ev:
  119|  1.02k|{
  120|  1.02k|    CPLFree(pszName);
  ------------------
  |  |   86|  1.02k|#define CPLFree VSIFree
  ------------------
  121|       |
  122|  1.02k|    if (nullptr != poSRS)
  ------------------
  |  Branch (122:9): [True: 1.02k, False: 0]
  ------------------
  123|  1.02k|        const_cast<OGRSpatialReference *>(poSRS)->Release();
  124|  1.02k|}
_ZN16OGRGeomFieldDefn7SetTypeE18OGRwkbGeometryType:
  376|  1.02k|{
  377|  1.02k|    if (m_bSealed)
  ------------------
  |  Branch (377:9): [True: 0, False: 1.02k]
  ------------------
  378|      0|    {
  379|      0|        CPLError(CE_Failure, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  380|      0|                 "OGRGeomFieldDefn::SetType() not allowed on a sealed object");
  381|      0|        return;
  382|      0|    }
  383|  1.02k|    eGeomType = eTypeIn;
  384|  1.02k|}
_ZN16OGRGeomFieldDefn13SetSpatialRefEPK19OGRSpatialReference:
  572|  1.02k|{
  573|       |
  574|  1.02k|    if (m_bSealed)
  ------------------
  |  Branch (574:9): [True: 0, False: 1.02k]
  ------------------
  575|      0|    {
  576|      0|        CPLError(
  577|      0|            CE_Failure, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  578|      0|            "OGRGeomFieldDefn::SetSpatialRef() not allowed on a sealed object");
  579|      0|        return;
  580|      0|    }
  581|       |
  582|  1.02k|    if (poSRS == poSRSIn)
  ------------------
  |  Branch (582:9): [True: 0, False: 1.02k]
  ------------------
  583|      0|    {
  584|      0|        return;
  585|      0|    }
  586|       |
  587|  1.02k|    if (poSRS != nullptr)
  ------------------
  |  Branch (587:9): [True: 0, False: 1.02k]
  ------------------
  588|      0|        const_cast<OGRSpatialReference *>(poSRS)->Release();
  589|       |
  590|  1.02k|    poSRS = poSRSIn;
  591|       |
  592|  1.02k|    if (poSRS != nullptr)
  ------------------
  |  Branch (592:9): [True: 1.02k, False: 0]
  ------------------
  593|  1.02k|        const_cast<OGRSpatialReference *>(poSRS)->Reference();
  594|  1.02k|}

_ZNK13OGRLinearRing15getGeometryNameEv:
  100|     80|{
  101|     80|    return "LINEARRING";
  102|     80|}
_ZN13OGRLinearRing10closeRingsEv:
  439|     80|{
  440|     80|    if (nPointCount < 2)
  ------------------
  |  Branch (440:9): [True: 0, False: 80]
  ------------------
  441|      0|        return;
  442|       |
  443|     80|    if (getX(0) != getX(nPointCount - 1) || getY(0) != getY(nPointCount - 1) ||
  ------------------
  |  Branch (443:9): [True: 44, False: 36]
  |  Branch (443:45): [True: 10, False: 26]
  ------------------
  444|     80|        getZ(0) != getZ(nPointCount - 1))
  ------------------
  |  Branch (444:9): [True: 11, False: 15]
  ------------------
  445|     65|    {
  446|     65|        OGRPoint oFirstPoint;
  447|     65|        getPoint(0, &oFirstPoint);
  448|     65|        addPoint(&oFirstPoint);
  449|     65|    }
  450|     80|}

_ZN14OGRSimpleCurveD2Ev:
   94|  4.91k|{
   95|  4.91k|    CPLFree(paoPoints);
  ------------------
  |  |   86|  4.91k|#define CPLFree VSIFree
  ------------------
   96|  4.91k|    CPLFree(padfZ);
  ------------------
  |  |   86|  4.91k|#define CPLFree VSIFree
  ------------------
   97|  4.91k|    CPLFree(padfM);
  ------------------
  |  |   86|  4.91k|#define CPLFree VSIFree
  ------------------
   98|  4.91k|}
_ZN14OGRSimpleCurve6Make3DEv:
  255|  8.84k|{
  256|  8.84k|    if (padfZ == nullptr)
  ------------------
  |  Branch (256:9): [True: 4.68k, False: 4.16k]
  ------------------
  257|  4.68k|    {
  258|  4.68k|        padfZ = static_cast<double *>(
  259|  4.68k|            VSI_CALLOC_VERBOSE(sizeof(double), std::max(1, m_nPointCapacity)));
  ------------------
  |  |  354|  4.68k|    VSICallocVerbose(nCount, nSize, __FILE__, __LINE__)
  ------------------
  260|  4.68k|        if (padfZ == nullptr)
  ------------------
  |  Branch (260:13): [True: 0, False: 4.68k]
  ------------------
  261|      0|        {
  262|      0|            flags &= ~OGR_G_3D;
  263|      0|            CPLError(CE_Failure, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  264|      0|                     "OGRSimpleCurve::Make3D() failed");
  265|      0|            return false;
  266|      0|        }
  267|  4.68k|    }
  268|  8.84k|    flags |= OGR_G_3D;
  269|  8.84k|    return true;
  270|  8.84k|}
_ZNK14OGRSimpleCurve8getPointEiP8OGRPoint:
  327|    255|{
  328|    255|    CPLAssert(i >= 0);
  ------------------
  |  |  331|    255|    do                                                                         \
  |  |  332|    255|    {                                                                          \
  |  |  333|    255|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  329|    255|    CPLAssert(i < nPointCount);
  ------------------
  |  |  331|    255|    do                                                                         \
  |  |  332|    255|    {                                                                          \
  |  |  333|    255|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  330|    255|    CPLAssert(poPoint != nullptr);
  ------------------
  |  |  331|    255|    do                                                                         \
  |  |  332|    255|    {                                                                          \
  |  |  333|    255|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  331|       |
  332|    255|    poPoint->setX(paoPoints[i].x);
  333|    255|    poPoint->setY(paoPoints[i].y);
  334|       |
  335|    255|    if ((flags & OGR_G_3D) && padfZ != nullptr)
  ------------------
  |  Branch (335:9): [True: 255, False: 0]
  |  Branch (335:31): [True: 255, False: 0]
  ------------------
  336|    255|        poPoint->setZ(padfZ[i]);
  337|    255|    if ((flags & OGR_G_MEASURED) && padfM != nullptr)
  ------------------
  |  Branch (337:9): [True: 0, False: 255]
  |  Branch (337:37): [True: 0, False: 0]
  ------------------
  338|      0|        poPoint->setM(padfM[i]);
  339|    255|}
_ZNK14OGRSimpleCurve4getZEi:
  395|     52|{
  396|     52|    if (padfZ != nullptr && iVertex >= 0 && iVertex < nPointCount &&
  ------------------
  |  Branch (396:9): [True: 52, False: 0]
  |  Branch (396:29): [True: 52, False: 0]
  |  Branch (396:45): [True: 52, False: 0]
  ------------------
  397|     52|        (flags & OGR_G_3D))
  ------------------
  |  Branch (397:9): [True: 52, False: 0]
  ------------------
  398|     52|        return (padfZ[iVertex]);
  399|      0|    else
  400|      0|        return 0.0;
  401|     52|}
_ZN14OGRSimpleCurve12setNumPointsEii:
  449|  37.2M|{
  450|  37.2M|    CPLAssert(nNewPointCount >= 0);
  ------------------
  |  |  331|  37.2M|    do                                                                         \
  |  |  332|  37.2M|    {                                                                          \
  |  |  333|  37.2M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  451|       |
  452|  37.2M|    if (nNewPointCount > m_nPointCapacity)
  ------------------
  |  Branch (452:9): [True: 15.4k, False: 37.2M]
  ------------------
  453|  15.4k|    {
  454|       |        // Overflow of sizeof(OGRRawPoint) * nNewPointCount can only occur on
  455|       |        // 32 bit, but we don't really want to allocate 2 billion points even on
  456|       |        // 64 bit...
  457|  15.4k|        if (nNewPointCount > std::numeric_limits<int>::max() /
  ------------------
  |  Branch (457:13): [True: 0, False: 15.4k]
  ------------------
  458|  15.4k|                                 static_cast<int>(sizeof(OGRRawPoint)))
  459|      0|        {
  460|      0|            CPLError(CE_Failure, CPLE_IllegalArg,
  ------------------
  |  |   93|      0|#define CPLE_IllegalArg 5
  ------------------
  461|      0|                     "Too many points on line/curve (%d points exceeds the "
  462|      0|                     "limit of %d points)",
  463|      0|                     nNewPointCount,
  464|      0|                     std::numeric_limits<int>::max() /
  465|      0|                         static_cast<int>(sizeof(OGRRawPoint)));
  466|      0|            return false;
  467|      0|        }
  468|       |
  469|       |        // If first allocation, just aim for nNewPointCount
  470|       |        // Otherwise aim for nNewPointCount + nNewPointCount / 3 to have
  471|       |        // exponential growth.
  472|  15.4k|        const int nNewCapacity =
  473|  15.4k|            (nPointCount == 0 ||
  ------------------
  |  Branch (473:14): [True: 4.68k, False: 10.8k]
  ------------------
  474|  15.4k|             nNewPointCount > std::numeric_limits<int>::max() /
  ------------------
  |  Branch (474:14): [True: 0, False: 10.8k]
  ------------------
  475|  10.8k|                                      static_cast<int>(sizeof(OGRRawPoint)) -
  476|  10.8k|                                  nNewPointCount / 3)
  477|  15.4k|                ? nNewPointCount
  478|  15.4k|                : nNewPointCount + nNewPointCount / 3;
  479|       |
  480|  15.4k|        if (nPointCount == 0 && paoPoints)
  ------------------
  |  Branch (480:13): [True: 4.68k, False: 10.8k]
  |  Branch (480:33): [True: 0, False: 4.68k]
  ------------------
  481|      0|        {
  482|       |            // If there was an allocated array, but the old number of points is
  483|       |            // 0, then free the arrays before allocating them, to avoid
  484|       |            // potential costly recopy of useless data.
  485|      0|            VSIFree(paoPoints);
  486|      0|            paoPoints = nullptr;
  487|      0|            VSIFree(padfZ);
  488|      0|            padfZ = nullptr;
  489|      0|            VSIFree(padfM);
  490|      0|            padfM = nullptr;
  491|      0|            m_nPointCapacity = 0;
  492|      0|        }
  493|       |
  494|  15.4k|        OGRRawPoint *paoNewPoints = static_cast<OGRRawPoint *>(
  495|  15.4k|            VSI_REALLOC_VERBOSE(paoPoints, sizeof(OGRRawPoint) * nNewCapacity));
  ------------------
  |  |  362|  15.4k|    VSIReallocVerbose(pOldPtr, nNewSize, __FILE__, __LINE__)
  ------------------
  496|  15.4k|        if (paoNewPoints == nullptr)
  ------------------
  |  Branch (496:13): [True: 0, False: 15.4k]
  ------------------
  497|      0|        {
  498|      0|            return false;
  499|      0|        }
  500|  15.4k|        paoPoints = paoNewPoints;
  501|       |
  502|  15.4k|        if (flags & OGR_G_3D)
  ------------------
  |  Branch (502:13): [True: 15.4k, False: 53]
  ------------------
  503|  15.4k|        {
  504|  15.4k|            double *padfNewZ = static_cast<double *>(
  505|  15.4k|                VSI_REALLOC_VERBOSE(padfZ, sizeof(double) * nNewCapacity));
  ------------------
  |  |  362|  15.4k|    VSIReallocVerbose(pOldPtr, nNewSize, __FILE__, __LINE__)
  ------------------
  506|  15.4k|            if (padfNewZ == nullptr)
  ------------------
  |  Branch (506:17): [True: 0, False: 15.4k]
  ------------------
  507|      0|            {
  508|      0|                return false;
  509|      0|            }
  510|  15.4k|            padfZ = padfNewZ;
  511|  15.4k|        }
  512|       |
  513|  15.4k|        if (flags & OGR_G_MEASURED)
  ------------------
  |  Branch (513:13): [True: 0, False: 15.4k]
  ------------------
  514|      0|        {
  515|      0|            double *padfNewM = static_cast<double *>(
  516|      0|                VSI_REALLOC_VERBOSE(padfM, sizeof(double) * nNewCapacity));
  ------------------
  |  |  362|      0|    VSIReallocVerbose(pOldPtr, nNewSize, __FILE__, __LINE__)
  ------------------
  517|      0|            if (padfNewM == nullptr)
  ------------------
  |  Branch (517:17): [True: 0, False: 0]
  ------------------
  518|      0|            {
  519|      0|                return false;
  520|      0|            }
  521|      0|            padfM = padfNewM;
  522|      0|        }
  523|       |
  524|  15.4k|        m_nPointCapacity = nNewCapacity;
  525|  15.4k|    }
  526|       |
  527|  37.2M|    if (nNewPointCount > nPointCount && bZeroizeNewContent)
  ------------------
  |  Branch (527:9): [True: 37.2M, False: 0]
  |  Branch (527:41): [True: 37.2M, False: 4.21k]
  ------------------
  528|  37.2M|    {
  529|       |        // gcc 8.0 (dev) complains about -Wclass-memaccess since
  530|       |        // OGRRawPoint() has a constructor. So use a void* pointer.  Doing
  531|       |        // the memset() here is correct since the constructor sets to 0.  We
  532|       |        // could instead use a std::fill(), but at every other place, we
  533|       |        // treat this class as a regular POD (see above use of realloc())
  534|  37.2M|        void *dest = static_cast<void *>(paoPoints + nPointCount);
  535|  37.2M|        memset(dest, 0, sizeof(OGRRawPoint) * (nNewPointCount - nPointCount));
  536|       |
  537|  37.2M|        if ((flags & OGR_G_3D) && padfZ)
  ------------------
  |  Branch (537:13): [True: 37.2M, False: 0]
  |  Branch (537:35): [True: 37.2M, False: 0]
  ------------------
  538|  37.2M|            memset(padfZ + nPointCount, 0,
  539|  37.2M|                   sizeof(double) * (nNewPointCount - nPointCount));
  540|       |
  541|  37.2M|        if ((flags & OGR_G_MEASURED) && padfM)
  ------------------
  |  Branch (541:13): [True: 0, False: 37.2M]
  |  Branch (541:41): [True: 0, False: 0]
  ------------------
  542|      0|            memset(padfM + nPointCount, 0,
  543|      0|                   sizeof(double) * (nNewPointCount - nPointCount));
  544|  37.2M|    }
  545|       |
  546|  37.2M|    nPointCount = nNewPointCount;
  547|  37.2M|    return true;
  548|  37.2M|}
_ZN14OGRSimpleCurve8setPointEiP8OGRPoint:
  570|     30|{
  571|     30|    if ((flags & OGR_G_3D) && (flags & OGR_G_MEASURED))
  ------------------
  |  Branch (571:9): [True: 30, False: 0]
  |  Branch (571:31): [True: 0, False: 30]
  ------------------
  572|      0|        return setPoint(iPoint, poPoint->getX(), poPoint->getY(),
  573|      0|                        poPoint->getZ(), poPoint->getM());
  574|     30|    else if (flags & OGR_G_3D)
  ------------------
  |  Branch (574:14): [True: 30, False: 0]
  ------------------
  575|     30|        return setPoint(iPoint, poPoint->getX(), poPoint->getY(),
  576|     30|                        poPoint->getZ());
  577|      0|    else if (flags & OGR_G_MEASURED)
  ------------------
  |  Branch (577:14): [True: 0, False: 0]
  ------------------
  578|      0|        return setPointM(iPoint, poPoint->getX(), poPoint->getY(),
  579|      0|                         poPoint->getM());
  580|      0|    else
  581|      0|        return setPoint(iPoint, poPoint->getX(), poPoint->getY());
  582|     30|}
_ZN14OGRSimpleCurve8setPointEiddd:
  620|  74.4M|{
  621|  74.4M|    if (!(flags & OGR_G_3D))
  ------------------
  |  Branch (621:9): [True: 4.63k, False: 74.4M]
  ------------------
  622|  4.63k|    {
  623|  4.63k|        if (!Make3D())
  ------------------
  |  Branch (623:13): [True: 0, False: 4.63k]
  ------------------
  624|      0|            return false;
  625|  4.63k|    }
  626|       |
  627|  74.4M|    if (iPoint >= nPointCount)
  ------------------
  |  Branch (627:9): [True: 37.2M, False: 37.2M]
  ------------------
  628|  37.2M|    {
  629|  37.2M|        if (!CheckPointCount(iPoint) || !setNumPoints(iPoint + 1))
  ------------------
  |  Branch (629:13): [True: 0, False: 37.2M]
  |  Branch (629:41): [True: 0, False: 37.2M]
  ------------------
  630|      0|            return false;
  631|  37.2M|    }
  632|       |#ifdef DEBUG
  633|       |    if (paoPoints == nullptr)
  634|       |        return false;
  635|       |#endif
  636|       |
  637|  74.4M|    paoPoints[iPoint].x = xIn;
  638|  74.4M|    paoPoints[iPoint].y = yIn;
  639|       |
  640|  74.4M|    if (padfZ != nullptr)
  ------------------
  |  Branch (640:9): [True: 74.4M, False: 0]
  ------------------
  641|  74.4M|    {
  642|  74.4M|        padfZ[iPoint] = zIn;
  643|  74.4M|    }
  644|  74.4M|    return true;
  645|  74.4M|}
_ZN14OGRSimpleCurve8addPointEPK8OGRPoint:
  869|    634|{
  870|    634|    if (poPoint->Is3D() && poPoint->IsMeasured())
  ------------------
  |  Branch (870:9): [True: 634, False: 0]
  |  Branch (870:28): [True: 0, False: 634]
  ------------------
  871|      0|        return setPoint(nPointCount, poPoint->getX(), poPoint->getY(),
  872|      0|                        poPoint->getZ(), poPoint->getM());
  873|    634|    else if (poPoint->Is3D())
  ------------------
  |  Branch (873:14): [True: 634, False: 0]
  ------------------
  874|    634|        return setPoint(nPointCount, poPoint->getX(), poPoint->getY(),
  875|    634|                        poPoint->getZ());
  876|      0|    else if (poPoint->IsMeasured())
  ------------------
  |  Branch (876:14): [True: 0, False: 0]
  ------------------
  877|      0|        return setPointM(nPointCount, poPoint->getX(), poPoint->getY(),
  878|      0|                         poPoint->getM());
  879|      0|    else
  880|      0|        return setPoint(nPointCount, poPoint->getX(), poPoint->getY());
  881|    634|}
_ZN14OGRSimpleCurve8addPointEddd:
  924|  6.14k|{
  925|  6.14k|    return setPoint(nPointCount, x, y, z);
  926|  6.14k|}
_ZN14OGRSimpleCurve16addSubLineStringEPK13OGRLineStringii:
 1529|  4.21k|{
 1530|  4.21k|    int nOtherLineNumPoints = poOtherLine->getNumPoints();
 1531|  4.21k|    if (nOtherLineNumPoints == 0)
  ------------------
  |  Branch (1531:9): [True: 0, False: 4.21k]
  ------------------
 1532|      0|        return;
 1533|       |
 1534|       |    /* -------------------------------------------------------------------- */
 1535|       |    /*      Do a bit of argument defaulting and validation.                 */
 1536|       |    /* -------------------------------------------------------------------- */
 1537|  4.21k|    if (nEndVertex == -1)
  ------------------
  |  Branch (1537:9): [True: 4.21k, False: 0]
  ------------------
 1538|  4.21k|        nEndVertex = nOtherLineNumPoints - 1;
 1539|       |
 1540|  4.21k|    if (nStartVertex < 0 || nEndVertex < 0 ||
  ------------------
  |  Branch (1540:9): [True: 0, False: 4.21k]
  |  Branch (1540:29): [True: 0, False: 4.21k]
  ------------------
 1541|  4.21k|        nStartVertex >= nOtherLineNumPoints ||
  ------------------
  |  Branch (1541:9): [True: 0, False: 4.21k]
  ------------------
 1542|  4.21k|        nEndVertex >= nOtherLineNumPoints)
  ------------------
  |  Branch (1542:9): [True: 0, False: 4.21k]
  ------------------
 1543|      0|    {
 1544|      0|        CPLAssert(false);
  ------------------
  |  |  331|      0|    do                                                                         \
  |  |  332|      0|    {                                                                          \
  |  |  333|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1545|      0|        return;
 1546|      0|    }
 1547|       |
 1548|       |    /* -------------------------------------------------------------------- */
 1549|       |    /*      Grow this linestring to hold the additional points.             */
 1550|       |    /* -------------------------------------------------------------------- */
 1551|  4.21k|    int nOldPoints = nPointCount;
 1552|  4.21k|    int nPointsToAdd = std::abs(nEndVertex - nStartVertex) + 1;
 1553|       |
 1554|  4.21k|    if (!setNumPoints(nPointsToAdd + nOldPoints, FALSE)
  ------------------
  |  | 1039|  4.21k|#define FALSE 0
  ------------------
  |  Branch (1554:9): [True: 0, False: 4.21k]
  ------------------
 1555|       |#ifdef DEBUG
 1556|       |        || paoPoints == nullptr
 1557|       |#endif
 1558|  4.21k|    )
 1559|      0|        return;
 1560|       |
 1561|       |    /* -------------------------------------------------------------------- */
 1562|       |    /*      Copy the x/y points - forward copies use memcpy.                */
 1563|       |    /* -------------------------------------------------------------------- */
 1564|  4.21k|    if (nEndVertex >= nStartVertex)
  ------------------
  |  Branch (1564:9): [True: 4.21k, False: 0]
  ------------------
 1565|  4.21k|    {
 1566|  4.21k|        memcpy(paoPoints + nOldPoints, poOtherLine->paoPoints + nStartVertex,
 1567|  4.21k|               sizeof(OGRRawPoint) * nPointsToAdd);
 1568|  4.21k|        if (poOtherLine->padfZ != nullptr)
  ------------------
  |  Branch (1568:13): [True: 4.21k, False: 0]
  ------------------
 1569|  4.21k|        {
 1570|  4.21k|            Make3D();
 1571|  4.21k|            if (padfZ != nullptr)
  ------------------
  |  Branch (1571:17): [True: 4.21k, False: 0]
  ------------------
 1572|  4.21k|            {
 1573|  4.21k|                memcpy(padfZ + nOldPoints, poOtherLine->padfZ + nStartVertex,
 1574|  4.21k|                       sizeof(double) * nPointsToAdd);
 1575|  4.21k|            }
 1576|  4.21k|        }
 1577|  4.21k|        if (poOtherLine->padfM != nullptr)
  ------------------
  |  Branch (1577:13): [True: 0, False: 4.21k]
  ------------------
 1578|      0|        {
 1579|      0|            AddM();
 1580|      0|            if (padfM != nullptr)
  ------------------
  |  Branch (1580:17): [True: 0, False: 0]
  ------------------
 1581|      0|            {
 1582|      0|                memcpy(padfM + nOldPoints, poOtherLine->padfM + nStartVertex,
 1583|      0|                       sizeof(double) * nPointsToAdd);
 1584|      0|            }
 1585|      0|        }
 1586|  4.21k|    }
 1587|       |
 1588|       |    /* -------------------------------------------------------------------- */
 1589|       |    /*      Copy the x/y points - reverse copies done double by double.     */
 1590|       |    /* -------------------------------------------------------------------- */
 1591|      0|    else
 1592|      0|    {
 1593|      0|        for (int i = 0; i < nPointsToAdd; i++)
  ------------------
  |  Branch (1593:25): [True: 0, False: 0]
  ------------------
 1594|      0|        {
 1595|      0|            paoPoints[i + nOldPoints].x =
 1596|      0|                poOtherLine->paoPoints[nStartVertex - i].x;
 1597|      0|            paoPoints[i + nOldPoints].y =
 1598|      0|                poOtherLine->paoPoints[nStartVertex - i].y;
 1599|      0|        }
 1600|       |
 1601|      0|        if (poOtherLine->padfZ != nullptr)
  ------------------
  |  Branch (1601:13): [True: 0, False: 0]
  ------------------
 1602|      0|        {
 1603|      0|            Make3D();
 1604|      0|            if (padfZ != nullptr)
  ------------------
  |  Branch (1604:17): [True: 0, False: 0]
  ------------------
 1605|      0|            {
 1606|      0|                for (int i = 0; i < nPointsToAdd; i++)
  ------------------
  |  Branch (1606:33): [True: 0, False: 0]
  ------------------
 1607|      0|                {
 1608|      0|                    padfZ[i + nOldPoints] =
 1609|      0|                        poOtherLine->padfZ[nStartVertex - i];
 1610|      0|                }
 1611|      0|            }
 1612|      0|        }
 1613|      0|        if (poOtherLine->padfM != nullptr)
  ------------------
  |  Branch (1613:13): [True: 0, False: 0]
  ------------------
 1614|      0|        {
 1615|      0|            AddM();
 1616|      0|            if (padfM != nullptr)
  ------------------
  |  Branch (1616:17): [True: 0, False: 0]
  ------------------
 1617|      0|            {
 1618|      0|                for (int i = 0; i < nPointsToAdd; i++)
  ------------------
  |  Branch (1618:33): [True: 0, False: 0]
  ------------------
 1619|      0|                {
 1620|      0|                    padfM[i + nOldPoints] =
 1621|      0|                        poOtherLine->padfM[nStartVertex - i];
 1622|      0|                }
 1623|      0|            }
 1624|      0|        }
 1625|      0|    }
 1626|  4.21k|}
_ZNK14OGRSimpleCurve10StartPointEP8OGRPoint:
 2078|     80|{
 2079|     80|    getPoint(0, poPoint);
 2080|     80|}
_ZNK14OGRSimpleCurve8EndPointEP8OGRPoint:
 2088|     80|{
 2089|     80|    getPoint(nPointCount - 1, poPoint);
 2090|     80|}
_ZNK14OGRSimpleCurve7IsEmptyEv:
 2620|     80|{
 2621|     80|    return (nPointCount == 0);
 2622|     80|}
ogrlinestring.cpp:_ZL15CheckPointCounti:
  589|  37.2M|{
  590|  37.2M|    if (iPoint == std::numeric_limits<int>::max())
  ------------------
  |  Branch (590:9): [True: 0, False: 37.2M]
  ------------------
  591|      0|    {
  592|      0|        CPLError(CE_Failure, CPLE_AppDefined, "Too big point count.");
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  593|      0|        return false;
  594|      0|    }
  595|  37.2M|    return true;
  596|  37.2M|}

_ZN8OGRPointC2Ev:
   48|    594|OGRPoint::OGRPoint() : x(0.0), y(0.0), z(0.0), m(0.0)
   49|       |
   50|    594|{
   51|    594|    flags = 0;
   52|    594|}
_ZN8OGRPointC2Eddd:
   66|    603|    : x(xIn), y(yIn), z(zIn), m(0.0)
   67|    603|{
   68|    603|    flags = GetEmptyNonEmptyFlag(xIn, yIn) | OGR_G_3D;
   69|    603|}
ogrpoint.cpp:_ZL20GetEmptyNonEmptyFlagdd:
   34|    603|{
   35|    603|    if (std::isnan(x) || std::isnan(y))
  ------------------
  |  Branch (35:9): [True: 16, False: 587]
  |  Branch (35:26): [True: 23, False: 564]
  ------------------
   36|     39|        return 0;
   37|    564|    return OGRGeometry::OGR_G_NOT_EMPTY_POINT;
   38|    603|}

_ZNK10OGRPolygon17isRingCorrectTypeEPK8OGRCurve:
  301|     80|{
  302|     80|    return poRing != nullptr && EQUAL(poRing->getGeometryName(), "LINEARRING");
  ------------------
  |  |  541|     80|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|     80|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 80, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (302:12): [True: 80, False: 0]
  ------------------
  303|     80|}
_ZNK10OGRPolygon9checkRingEPK8OGRCurve:
  310|     80|{
  311|     80|    if (!isRingCorrectType(poNewRing))
  ------------------
  |  Branch (311:9): [True: 0, False: 80]
  ------------------
  312|      0|    {
  313|      0|        CPLError(CE_Failure, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  314|      0|                 "Wrong curve type. Expected LINEARRING.");
  315|      0|        return false;
  316|      0|    }
  317|       |
  318|     80|    if (!poNewRing->IsEmpty() && !poNewRing->get_IsClosed())
  ------------------
  |  Branch (318:9): [True: 80, False: 0]
  |  Branch (318:34): [True: 65, False: 15]
  ------------------
  319|     65|    {
  320|       |        // This configuration option name must be the same as in
  321|       |        // OGRCurvePolygon::checkRing()
  322|     65|        const char *pszEnvVar =
  323|     65|            CPLGetConfigOption("OGR_GEOMETRY_ACCEPT_UNCLOSED_RING", nullptr);
  324|     65|        if (pszEnvVar != nullptr && !CPLTestBool(pszEnvVar))
  ------------------
  |  Branch (324:13): [True: 0, False: 65]
  |  Branch (324:37): [True: 0, False: 0]
  ------------------
  325|      0|        {
  326|      0|            CPLError(CE_Failure, CPLE_AppDefined, "Non closed ring detected.");
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  327|      0|            return false;
  328|      0|        }
  329|     65|        else
  330|     65|        {
  331|     65|            CPLError(CE_Warning, CPLE_AppDefined, "Non closed ring detected.%s",
  ------------------
  |  |   85|     65|#define CPLE_AppDefined 1
  ------------------
  332|     65|                     pszEnvVar == nullptr
  ------------------
  |  Branch (332:22): [True: 65, False: 0]
  ------------------
  333|     65|                         ? " To avoid accepting it, set the "
  334|     65|                           "OGR_GEOMETRY_ACCEPT_UNCLOSED_RING configuration "
  335|     65|                           "option to NO"
  336|     65|                         : "");
  337|     65|        }
  338|     65|    }
  339|       |
  340|     80|    return true;
  341|     80|}
_ZN10OGRPolygon10closeRingsEv:
  820|     80|{
  821|     80|    for (auto &&poRing : *this)
  ------------------
  |  Branch (821:24): [True: 80, False: 80]
  ------------------
  822|     80|        poRing->closeRings();
  823|     80|}

_ZN14GDALCADDatasetC2Ev:
   49|  7.27k|    : poCADFile(nullptr), papoLayers(nullptr), nLayers(0), poRasterDS(nullptr),
   50|  7.27k|      poSpatialReference(nullptr)
   51|  7.27k|{
   52|  7.27k|    adfGeoTransform[0] = 0.0;
   53|  7.27k|    adfGeoTransform[1] = 1.0;
   54|  7.27k|    adfGeoTransform[2] = 0.0;
   55|  7.27k|    adfGeoTransform[3] = 0.0;
   56|  7.27k|    adfGeoTransform[4] = 0.0;
   57|  7.27k|    adfGeoTransform[5] = 1.0;
   58|  7.27k|}
_ZN14GDALCADDatasetD2Ev:
   61|  7.27k|{
   62|  7.27k|    if (poRasterDS != nullptr)
  ------------------
  |  Branch (62:9): [True: 0, False: 7.27k]
  ------------------
   63|      0|    {
   64|      0|        GDALClose(poRasterDS);
   65|      0|        poRasterDS = nullptr;
   66|      0|    }
   67|       |
   68|  8.29k|    for (int i = 0; i < nLayers; i++)
  ------------------
  |  Branch (68:21): [True: 1.02k, False: 7.27k]
  ------------------
   69|  1.02k|        delete papoLayers[i];
   70|  7.27k|    CPLFree(papoLayers);
  ------------------
  |  |   86|  7.27k|#define CPLFree VSIFree
  ------------------
   71|       |
   72|  7.27k|    if (poSpatialReference)
  ------------------
  |  Branch (72:9): [True: 1.52k, False: 5.74k]
  ------------------
   73|  1.52k|        poSpatialReference->Release();
   74|       |
   75|  7.27k|    if (poCADFile)
  ------------------
  |  Branch (75:9): [True: 1.52k, False: 5.74k]
  ------------------
   76|  1.52k|        delete poCADFile;
   77|  7.27k|}
_ZN14GDALCADDataset4OpenEP12GDALOpenInfoP9CADFileIOll:
  112|  7.27k|{
  113|  7.27k|    osCADFilename = pFileIO->GetFilePath();
  114|  7.27k|    SetDescription(poOpenInfo->pszFilename);
  115|       |
  116|  7.27k|    const char *papszReadOptions =
  117|  7.27k|        CSLFetchNameValueDef(poOpenInfo->papszOpenOptions, "MODE", "READ_FAST");
  118|  7.27k|    const char *papszReadUnsupportedGeoms = CSLFetchNameValueDef(
  119|  7.27k|        poOpenInfo->papszOpenOptions, "ADD_UNSUPPORTED_GEOMETRIES_DATA", "NO");
  120|       |
  121|  7.27k|    enum CADFile::OpenOptions openOpts = CADFile::READ_FAST;
  122|  7.27k|    bool bReadUnsupportedGeometries = false;
  123|  7.27k|    if (EQUAL(papszReadOptions, "READ_ALL"))
  ------------------
  |  |  541|  7.27k|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|  7.27k|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 7.27k]
  |  |  ------------------
  ------------------
  124|      0|    {
  125|      0|        openOpts = CADFile::READ_ALL;
  126|      0|    }
  127|  7.27k|    else if (EQUAL(papszReadOptions, "READ_FASTEST"))
  ------------------
  |  |  541|  7.27k|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|  7.27k|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 7.27k]
  |  |  ------------------
  ------------------
  128|      0|    {
  129|      0|        openOpts = CADFile::READ_FASTEST;
  130|      0|    }
  131|       |
  132|  7.27k|    if (EQUAL(papszReadUnsupportedGeoms, "YES"))
  ------------------
  |  |  541|  7.27k|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|  7.27k|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 7.27k]
  |  |  ------------------
  ------------------
  133|      0|    {
  134|      0|        bReadUnsupportedGeometries = true;
  135|      0|    }
  136|       |
  137|  7.27k|    poCADFile = OpenCADFile(pFileIO, openOpts, bReadUnsupportedGeometries);
  138|       |
  139|  7.27k|    if (GetLastErrorCode() == CADErrorCodes::UNSUPPORTED_VERSION)
  ------------------
  |  Branch (139:9): [True: 39, False: 7.23k]
  ------------------
  140|     39|    {
  141|     39|        CPLError(CE_Failure, CPLE_NotSupported,
  ------------------
  |  |   95|     39|#define CPLE_NotSupported 6
  ------------------
  142|     39|                 "libopencad %s does not support this version of CAD file.\n"
  143|     39|                 "Supported formats are:\n%s",
  144|     39|                 GetVersionString(), GetCADFormats());
  145|     39|        return FALSE;
  ------------------
  |  | 1039|     39|#define FALSE 0
  ------------------
  146|     39|    }
  147|       |
  148|  7.23k|    if (GetLastErrorCode() != CADErrorCodes::SUCCESS)
  ------------------
  |  Branch (148:9): [True: 5.70k, False: 1.52k]
  ------------------
  149|  5.70k|    {
  150|  5.70k|        CPLError(CE_Failure, CPLE_NotSupported,
  ------------------
  |  |   95|  5.70k|#define CPLE_NotSupported 6
  ------------------
  151|  5.70k|                 "libopencad %s does not support this version of CAD "
  152|  5.70k|                 "file.\nSupported formats: %s",
  153|  5.70k|                 GetVersionString(), GetCADFormats());
  154|  5.70k|        return FALSE;
  ------------------
  |  | 1039|  5.70k|#define FALSE 0
  ------------------
  155|  5.70k|    }
  156|       |
  157|  1.52k|    const OGRSpatialReference *poSpatialRef = GetSpatialRef();
  158|  1.52k|    int nRasters = 1;
  159|       |
  160|  1.52k|    if (nSubRasterLayer != -1 && nSubRasterFID != -1)
  ------------------
  |  Branch (160:9): [True: 0, False: 1.52k]
  |  Branch (160:34): [True: 0, False: 0]
  ------------------
  161|      0|    {
  162|       |        // Indicates that subdataset from CAD layer number nSubRasterLayer and
  163|       |        // FID nSubRasterFID is request
  164|      0|        nRasters = 2;
  165|      0|    }
  166|  1.52k|    else
  167|  1.52k|    {
  168|       |        // Fill metadata
  169|  1.52k|        const CADHeader &header = poCADFile->getHeader();
  170|   109k|        for (size_t i = 0; i < header.getSize(); ++i)
  ------------------
  |  Branch (170:28): [True: 108k, False: 1.52k]
  ------------------
  171|   108k|        {
  172|   108k|            short nCode = header.getCode(static_cast<int>(i));
  173|   108k|            const CADVariant &oVal = header.getValue(nCode);
  174|   108k|            GDALDataset::SetMetadataItem(header.getValueName(nCode),
  175|   108k|                                         oVal.getString().c_str());
  176|   108k|        }
  177|       |
  178|       |        // Reading content of .prj file, or extracting it from CAD if not
  179|       |        // present
  180|  1.52k|        nLayers = 0;
  181|       |        // FIXME: We allocate extra memory, do we need more strict policy here?
  182|  1.52k|        papoLayers = static_cast<OGRCADLayer **>(
  183|  1.52k|            CPLMalloc(sizeof(OGRCADLayer *) * poCADFile->GetLayersCount()));
  184|       |
  185|  1.52k|        int nEncoding = GetCadEncoding();
  186|  17.6k|        for (size_t i = 0; i < poCADFile->GetLayersCount(); ++i)
  ------------------
  |  Branch (186:28): [True: 16.1k, False: 1.52k]
  ------------------
  187|  16.1k|        {
  188|  16.1k|            CADLayer &oLayer = poCADFile->GetLayer(i);
  189|  16.1k|            if (poOpenInfo->nOpenFlags & GDAL_OF_VECTOR &&
  ------------------
  |  | 1052|  32.2k|#define GDAL_OF_VECTOR 0x04
  ------------------
  |  Branch (189:17): [True: 16.1k, False: 0]
  ------------------
  190|  16.1k|                oLayer.getGeometryCount() > 0)
  ------------------
  |  Branch (190:17): [True: 1.02k, False: 15.1k]
  ------------------
  191|  1.02k|            {
  192|  1.02k|                OGRSpatialReference *poSRS =
  193|  1.02k|                    poSpatialRef ? poSpatialRef->Clone() : nullptr;
  ------------------
  |  Branch (193:21): [True: 1.02k, False: 0]
  ------------------
  194|  1.02k|                papoLayers[nLayers++] =
  195|  1.02k|                    new OGRCADLayer(this, oLayer, poSRS, nEncoding);
  196|  1.02k|                if (poSRS)
  ------------------
  |  Branch (196:21): [True: 1.02k, False: 0]
  ------------------
  197|  1.02k|                    poSRS->Release();
  198|  1.02k|            }
  199|       |
  200|  16.1k|            if (poOpenInfo->nOpenFlags & GDAL_OF_RASTER)
  ------------------
  |  | 1046|  16.1k|#define GDAL_OF_RASTER 0x02
  ------------------
  |  Branch (200:17): [True: 0, False: 16.1k]
  ------------------
  201|      0|            {
  202|      0|                for (size_t j = 0; j < oLayer.getImageCount(); ++j)
  ------------------
  |  Branch (202:36): [True: 0, False: 0]
  ------------------
  203|      0|                {
  204|      0|                    nSubRasterLayer = static_cast<long>(i);
  205|      0|                    nSubRasterFID = static_cast<long>(j);
  206|      0|                    GDALDataset::SetMetadataItem(
  207|      0|                        CPLSPrintf("SUBDATASET_%d_NAME", nRasters),
  208|      0|                        CPLSPrintf("CAD:%s:%ld:%ld", osCADFilename.c_str(),
  209|      0|                                   nSubRasterLayer, nSubRasterFID),
  210|      0|                        "SUBDATASETS");
  211|      0|                    GDALDataset::SetMetadataItem(
  212|      0|                        CPLSPrintf("SUBDATASET_%d_DESC", nRasters),
  213|      0|                        CPLSPrintf("%s - %ld", oLayer.getName().c_str(),
  214|      0|                                   nSubRasterFID),
  215|      0|                        "SUBDATASETS");
  216|      0|                    nRasters++;
  217|      0|                }
  218|      0|            }
  219|  16.1k|        }
  220|       |        // If nRasters == 2 we have the only one raster in CAD file
  221|  1.52k|    }
  222|       |
  223|       |    // The only one raster layer in dataset is present or subdataset is request
  224|  1.52k|    if (nRasters == 2)
  ------------------
  |  Branch (224:9): [True: 0, False: 1.52k]
  ------------------
  225|      0|    {
  226|      0|        CADLayer &oLayer = poCADFile->GetLayer(nSubRasterLayer);
  227|      0|        CADImage *pImage = oLayer.getImage(nSubRasterFID);
  228|      0|        if (pImage)
  ------------------
  |  Branch (228:13): [True: 0, False: 0]
  ------------------
  229|      0|        {
  230|       |            // TODO: Add support clipping region in neatline
  231|      0|            CPLString osImgFilename = pImage->getFilePath();
  232|      0|            CPLString osImgPath = CPLGetPathSafe(osImgFilename);
  233|      0|            if (osImgPath.empty())
  ------------------
  |  Branch (233:17): [True: 0, False: 0]
  ------------------
  234|      0|            {
  235|      0|                osImgFilename =
  236|      0|                    CPLFormFilenameSafe(CPLGetPathSafe(osCADFilename).c_str(),
  237|      0|                                        osImgFilename, nullptr);
  238|      0|            }
  239|       |
  240|      0|            if (!CPLCheckForFile(const_cast<char *>(osImgFilename.c_str()),
  ------------------
  |  Branch (240:17): [True: 0, False: 0]
  ------------------
  241|      0|                                 nullptr))
  242|      0|                return poOpenInfo->nOpenFlags & GDAL_OF_VECTOR;
  ------------------
  |  | 1052|      0|#define GDAL_OF_VECTOR 0x04
  ------------------
  243|       |
  244|      0|            poRasterDS = GDALDataset::FromHandle(
  245|      0|                GDALOpen(osImgFilename, poOpenInfo->eAccess));
  246|      0|            if (poRasterDS == nullptr)
  ------------------
  |  Branch (246:17): [True: 0, False: 0]
  ------------------
  247|      0|            {
  248|      0|                delete pImage;
  249|      0|                return poOpenInfo->nOpenFlags & GDAL_OF_VECTOR;
  ------------------
  |  | 1052|      0|#define GDAL_OF_VECTOR 0x04
  ------------------
  250|      0|            }
  251|      0|            if (poRasterDS->GetRasterCount() == 0)
  ------------------
  |  Branch (251:17): [True: 0, False: 0]
  ------------------
  252|      0|            {
  253|      0|                delete pImage;
  254|      0|                GDALClose(poRasterDS);
  255|      0|                return poOpenInfo->nOpenFlags & GDAL_OF_VECTOR;
  ------------------
  |  | 1052|      0|#define GDAL_OF_VECTOR 0x04
  ------------------
  256|      0|            }
  257|       |
  258|      0|            if (poRasterDS->GetGeoTransform(adfGeoTransform) != CE_None)
  ------------------
  |  Branch (258:17): [True: 0, False: 0]
  ------------------
  259|      0|            {
  260|       |                // The external world file have priority
  261|      0|                double dfUnits = 1.0;
  262|      0|                if (nullptr != poSpatialRef)
  ------------------
  |  Branch (262:21): [True: 0, False: 0]
  ------------------
  263|      0|                    dfUnits = poSpatialRef->GetLinearUnits();
  264|      0|                FillTransform(pImage, dfUnits);
  265|      0|            }
  266|      0|            delete pImage;
  267|       |
  268|      0|            nRasterXSize = poRasterDS->GetRasterXSize();
  269|      0|            nRasterYSize = poRasterDS->GetRasterYSize();
  270|      0|            if (!GDALCheckDatasetDimensions(nRasterXSize, nRasterYSize))
  ------------------
  |  Branch (270:17): [True: 0, False: 0]
  ------------------
  271|      0|            {
  272|      0|                GDALClose(poRasterDS);
  273|      0|                return poOpenInfo->nOpenFlags & GDAL_OF_VECTOR;
  ------------------
  |  | 1052|      0|#define GDAL_OF_VECTOR 0x04
  ------------------
  274|      0|            }
  275|       |
  276|      0|            for (int iBand = 1; iBand <= poRasterDS->GetRasterCount(); iBand++)
  ------------------
  |  Branch (276:33): [True: 0, False: 0]
  ------------------
  277|      0|                SetBand(iBand, new CADWrapperRasterBand(
  278|      0|                                   poRasterDS->GetRasterBand(iBand)));
  279|       |
  280|      0|            char **papszDomainList = poRasterDS->GetMetadataDomainList();
  281|      0|            while (papszDomainList)
  ------------------
  |  Branch (281:20): [True: 0, False: 0]
  ------------------
  282|      0|            {
  283|      0|                char **papszMetadata = GetMetadata(*papszDomainList);
  284|      0|                char **papszRasterMetadata =
  285|      0|                    poRasterDS->GetMetadata(*papszDomainList);
  286|      0|                if (nullptr == papszMetadata)
  ------------------
  |  Branch (286:21): [True: 0, False: 0]
  ------------------
  287|      0|                    SetMetadata(papszRasterMetadata, *papszDomainList);
  288|      0|                else
  289|      0|                {
  290|      0|                    char **papszMD = CSLMerge(CSLDuplicate(papszMetadata),
  291|      0|                                              papszRasterMetadata);
  292|      0|                    SetMetadata(papszMD, *papszDomainList);
  293|      0|                    CSLDestroy(papszMD);
  294|      0|                }
  295|      0|                papszDomainList++;
  296|      0|            }
  297|      0|        }
  298|      0|    }
  299|       |
  300|  1.52k|    return TRUE;
  ------------------
  |  | 1043|  1.52k|#define TRUE 1
  ------------------
  301|  1.52k|}
_ZN14GDALCADDataset8GetLayerEi:
  304|  1.02k|{
  305|  1.02k|    if (iLayer < 0 || iLayer >= nLayers)
  ------------------
  |  Branch (305:9): [True: 0, False: 1.02k]
  |  Branch (305:23): [True: 0, False: 1.02k]
  ------------------
  306|      0|        return nullptr;
  307|  1.02k|    else
  308|  1.02k|        return papoLayers[iLayer];
  309|  1.02k|}
_ZNK14GDALCADDataset14GetCadEncodingEv:
  358|  1.52k|{
  359|  1.52k|    if (poCADFile == nullptr)
  ------------------
  |  Branch (359:9): [True: 0, False: 1.52k]
  ------------------
  360|      0|        return 0;
  361|  1.52k|    const CADHeader &header = poCADFile->getHeader();
  362|  1.52k|    return static_cast<int>(
  363|  1.52k|        header.getValue(CADHeader::DWGCODEPAGE, 0).getDecimal());
  364|  1.52k|}
_ZNK14GDALCADDataset13GetSpatialRefEv:
  367|  1.52k|{
  368|  1.52k|    if (poSpatialReference)
  ------------------
  |  Branch (368:9): [True: 0, False: 1.52k]
  ------------------
  369|      0|        return poSpatialReference;
  370|       |
  371|  1.52k|    if (poCADFile != nullptr)
  ------------------
  |  Branch (371:9): [True: 1.52k, False: 0]
  ------------------
  372|  1.52k|    {
  373|  1.52k|        CPLString sESRISpatRef;
  374|  1.52k|        poSpatialReference = new OGRSpatialReference();
  375|  1.52k|        poSpatialReference->SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER);
  376|       |
  377|  1.52k|        CADDictionary oNOD = poCADFile->GetNOD();
  378|  1.52k|        CPLString sESRISpatRefData = oNOD.getRecordByName("ESRI_PRJ");
  379|  1.52k|        if (!sESRISpatRefData.empty())
  ------------------
  |  Branch (379:13): [True: 0, False: 1.52k]
  ------------------
  380|      0|        {
  381|      0|            sESRISpatRef =
  382|      0|                sESRISpatRefData.substr(sESRISpatRefData.find("GEO"));
  383|      0|        }
  384|       |
  385|  1.52k|        if (!sESRISpatRef.empty())
  ------------------
  |  Branch (385:13): [True: 0, False: 1.52k]
  ------------------
  386|      0|        {
  387|      0|            char **papszPRJData = nullptr;
  388|      0|            papszPRJData = CSLAddString(papszPRJData, sESRISpatRef);
  389|      0|            if (poSpatialReference->importFromESRI(papszPRJData) != OGRERR_NONE)
  ------------------
  |  |  372|      0|#define OGRERR_NONE 0              /**< Success */
  ------------------
  |  Branch (389:17): [True: 0, False: 0]
  ------------------
  390|      0|            {
  391|      0|                CPLError(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  392|      0|                         "Failed to parse PRJ section, ignoring.");
  393|      0|                delete poSpatialReference;
  394|      0|                poSpatialReference = nullptr;
  395|      0|            }
  396|       |
  397|      0|            CSLDestroy(papszPRJData);
  398|      0|        }
  399|  1.52k|        else
  400|  1.52k|        {
  401|  1.52k|            const std::string osPRJFilename = GetPrjFilePath();
  402|  1.52k|            if (!osPRJFilename.empty())  // check if path exists
  ------------------
  |  Branch (402:17): [True: 0, False: 1.52k]
  ------------------
  403|      0|            {
  404|      0|                CPLPushErrorHandler(CPLQuietErrorHandler);
  405|      0|                char **papszPRJData = CSLLoad(osPRJFilename.c_str());
  406|      0|                CPLPopErrorHandler();
  407|       |
  408|      0|                if (poSpatialReference->importFromESRI(papszPRJData) !=
  ------------------
  |  Branch (408:21): [True: 0, False: 0]
  ------------------
  409|      0|                    OGRERR_NONE)
  ------------------
  |  |  372|      0|#define OGRERR_NONE 0              /**< Success */
  ------------------
  410|      0|                {
  411|      0|                    CPLError(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  412|      0|                             "Failed to parse PRJ file, ignoring.");
  413|      0|                    delete poSpatialReference;
  414|      0|                    poSpatialReference = nullptr;
  415|      0|                }
  416|       |
  417|      0|                if (papszPRJData)
  ------------------
  |  Branch (417:21): [True: 0, False: 0]
  ------------------
  418|      0|                    CSLDestroy(papszPRJData);
  419|      0|            }
  420|  1.52k|        }
  421|  1.52k|    }
  422|       |
  423|  1.52k|    return poSpatialReference;
  424|  1.52k|}
_ZNK14GDALCADDataset14GetPrjFilePathEv:
  427|  1.52k|{
  428|  1.52k|    std::string osPRJFilename = CPLResetExtensionSafe(osCADFilename, "prj");
  429|  1.52k|    if (CPLCheckForFile(osPRJFilename.data(), nullptr) == TRUE)
  ------------------
  |  | 1043|  1.52k|#define TRUE 1
  ------------------
  |  Branch (429:9): [True: 0, False: 1.52k]
  ------------------
  430|      0|        return osPRJFilename;
  431|       |
  432|  1.52k|    osPRJFilename = CPLResetExtensionSafe(osCADFilename, "PRJ");
  433|  1.52k|    if (CPLCheckForFile(osPRJFilename.data(), nullptr) == TRUE)
  ------------------
  |  | 1043|  1.52k|#define TRUE 1
  ------------------
  |  Branch (433:9): [True: 0, False: 1.52k]
  ------------------
  434|      0|        return osPRJFilename;
  435|       |
  436|  1.52k|    return std::string();
  437|  1.52k|}

_ZN8CADClassC2Ev:
   26|  14.4k|CADClass::CADClass() : sCppClassName(""),
   27|  14.4k|                sApplicationName(""),
   28|  14.4k|                sDXFRecordName(""),
   29|  14.4k|                dProxyCapFlag(0),
   30|  14.4k|                dInstanceCount(0),
   31|  14.4k|                bWasZombie(false),
   32|  14.4k|                bIsEntity(false),
   33|  14.4k|                dClassNum(0),
   34|  14.4k|                dClassVersion(0)
   35|  14.4k|{
   36|  14.4k|}
_ZN10CADClassesC2Ev:
   43|  7.23k|{
   44|  7.23k|}
_ZN10CADClasses8addClassE8CADClass:
   47|  9.82k|{
   48|  9.82k|    classes.push_back( stClass );
   49|       |
   50|  9.82k|    DebugMsg( "CLASS INFO\n"
   51|  9.82k|                      "  Class Number: %d\n"
   52|  9.82k|                      "  Proxy capabilities flag or Version: %d\n"
   53|  9.82k|                      "  App name: %s\n"
   54|  9.82k|                      "  C++ Class Name: %s\n"
   55|  9.82k|                      "  DXF Class name: %s\n"
   56|  9.82k|                      "  Was a zombie? %x\n"
   57|  9.82k|                      "  Is-an-entity flag: %x\n\n", stClass.dClassNum, stClass.dProxyCapFlag,
   58|  9.82k|              stClass.sApplicationName.c_str(), stClass.sCppClassName.c_str(), stClass.sDXFRecordName.c_str(),
   59|  9.82k|              stClass.bWasZombie, stClass.bIsEntity );
   60|  9.82k|}
_ZNK10CADClasses13getClassByNumEs:
   63|  6.47k|{
   64|  6.47k|    for( const CADClass &cadClass : classes )
  ------------------
  |  Branch (64:35): [True: 17.4k, False: 4.64k]
  ------------------
   65|  17.4k|    {
   66|  17.4k|        if( cadClass.dClassNum == num )
  ------------------
  |  Branch (66:13): [True: 1.82k, False: 15.6k]
  ------------------
   67|  1.82k|            return cadClass;
   68|  17.4k|    }
   69|  4.64k|    return CADClass();
   70|  6.47k|}

_Z14getCADACIColors:
  276|  1.73k|{
  277|  1.73k|    if(index < 0 || index > 255)
  ------------------
  |  Branch (277:8): [True: 40, False: 1.69k]
  |  Branch (277:21): [True: 67, False: 1.63k]
  ------------------
  278|    107|        return {255, 255, 255};
  279|  1.63k|    return CADACIColors[index];
  280|  1.73k|}

_ZN19CADDictionaryRecordC2Ev:
   24|  1.60k|    objType(CADObject::UNUSED)
   25|  1.60k|{
   26|  1.60k|}
_ZN19CADDictionaryRecordD2Ev:
   28|  1.60k|CADDictionaryRecord::~CADDictionaryRecord() = default;
_ZN10CADXRecordC2Ev:
   40|     78|{
   41|     78|    objType = CADObject::XRECORD;
   42|     78|}
_ZN10CADXRecordD2Ev:
   44|     78|CADXRecord::~CADXRecord() = default;
_ZN10CADXRecord13setRecordDataERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   52|     78|{
   53|     78|    sRecordData = data;
   54|     78|}
_ZN13CADDictionaryC2Ev:
   61|  1.52k|{
   62|  1.52k|    objType = CADObject::DICTIONARY;
   63|  1.52k|}
_ZN13CADDictionaryD2Ev:
   65|  1.52k|CADDictionary::~CADDictionary() = default;
_ZN13CADDictionary9addRecordENSt3__14pairINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_10shared_ptrI19CADDictionaryRecordEEEE:
   78|     78|{
   79|     78|    astXRecords.emplace_back( record );
   80|     78|}
_ZNK13CADDictionary15getRecordByNameERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   83|  1.52k|{
   84|  1.60k|    for( size_t i = 0; i < astXRecords.size(); ++i )
  ------------------
  |  Branch (84:24): [True: 78, False: 1.52k]
  ------------------
   85|     78|    {
   86|     78|        if( astXRecords[i].first.compare(name) == 0 )
  ------------------
  |  Branch (86:13): [True: 0, False: 78]
  ------------------
   87|      0|        {
   88|      0|            std::shared_ptr<CADDictionaryRecord> XRecordPtr = astXRecords[i].second;
   89|      0|            if(XRecordPtr == nullptr ||
  ------------------
  |  Branch (89:16): [True: 0, False: 0]
  ------------------
   90|      0|               XRecordPtr->getType() != CADObject::XRECORD)
  ------------------
  |  Branch (90:16): [True: 0, False: 0]
  ------------------
   91|      0|                continue;
   92|      0|            CADXRecord * poXRecord = static_cast<CADXRecord*>(XRecordPtr.get() );
   93|      0|            return poXRecord->getRecordData();
   94|      0|        }
   95|     78|    }
   96|  1.52k|    return "";
   97|  1.52k|}

_ZN7CADFileC2EP9CADFileIO:
   21|  7.23k|    pFileIO( poFileIO ),
   22|  7.23k|    bReadingUnsupportedGeometries( false )
   23|  7.23k|{
   24|  7.23k|}
_ZN7CADFileD2Ev:
   27|  7.23k|{
   28|  7.23k|    if( nullptr != pFileIO )
  ------------------
  |  Branch (28:9): [True: 7.23k, False: 0]
  ------------------
   29|  7.23k|    {
   30|  7.23k|        pFileIO->Close();
   31|  7.23k|        delete pFileIO;
   32|  7.23k|    }
   33|  7.23k|}
_ZNK7CADFile9getHeaderEv:
   36|  3.05k|{
   37|  3.05k|    return oHeader;
   38|  3.05k|}
_ZN7CADFile9ParseFileENS_11OpenOptionsEb:
   51|  7.23k|{
   52|  7.23k|    if( nullptr == pFileIO )
  ------------------
  |  Branch (52:9): [True: 0, False: 7.23k]
  ------------------
   53|      0|        return CADErrorCodes::FILE_OPEN_FAILED;
   54|       |
   55|  7.23k|    if( !pFileIO->IsOpened() )
  ------------------
  |  Branch (55:9): [True: 0, False: 7.23k]
  ------------------
   56|      0|    {
   57|      0|        if( !pFileIO->Open( CADFileIO::in | CADFileIO::binary ) )
  ------------------
  |  Branch (57:13): [True: 0, False: 0]
  ------------------
   58|      0|            return CADErrorCodes::FILE_OPEN_FAILED;
   59|      0|    }
   60|       |
   61|       |    // Set flag which will tell CADLayer to skip/not skip unsupported geoms
   62|  7.23k|    bReadingUnsupportedGeometries = bReadUnsupportedGeometries;
   63|       |
   64|  7.23k|    int nResultCode;
   65|  7.23k|    nResultCode = ReadSectionLocators();
   66|  7.23k|    if( nResultCode != CADErrorCodes::SUCCESS )
  ------------------
  |  Branch (66:9): [True: 177, False: 7.05k]
  ------------------
   67|    177|        return nResultCode;
   68|  7.05k|    nResultCode = ReadHeader( eOptions );
   69|  7.05k|    if( nResultCode != CADErrorCodes::SUCCESS )
  ------------------
  |  Branch (69:9): [True: 60, False: 6.99k]
  ------------------
   70|     60|        return nResultCode;
   71|  6.99k|    nResultCode = ReadClasses( eOptions );
   72|  6.99k|    if( nResultCode != CADErrorCodes::SUCCESS )
  ------------------
  |  Branch (72:9): [True: 224, False: 6.77k]
  ------------------
   73|    224|        return nResultCode;
   74|  6.77k|    nResultCode = CreateFileMap();
   75|  6.77k|    if( nResultCode != CADErrorCodes::SUCCESS )
  ------------------
  |  Branch (75:9): [True: 109, False: 6.66k]
  ------------------
   76|    109|        return nResultCode;
   77|  6.66k|    nResultCode = ReadTables( eOptions );
   78|  6.66k|    if( nResultCode != CADErrorCodes::SUCCESS )
  ------------------
  |  Branch (78:9): [True: 5.13k, False: 1.52k]
  ------------------
   79|  5.13k|        return nResultCode;
   80|       |
   81|  1.52k|    return CADErrorCodes::SUCCESS;
   82|  6.66k|}
_ZN7CADFile10ReadTablesENS_11OpenOptionsE:
   85|  6.66k|{
   86|       |    // TODO: read other tables in ALL option mode
   87|       |
   88|  6.66k|    int nResult = oTables.ReadTable( this, CADTables::LayersTable );
   89|  6.66k|    return nResult;
   90|  6.66k|}
_ZNK7CADFile14GetLayersCountEv:
   93|  19.1k|{
   94|  19.1k|    return oTables.GetLayerCount();
   95|  19.1k|}
_ZN7CADFile8GetLayerEm:
   98|  16.7k|{
   99|  16.7k|    return oTables.GetLayer( index );
  100|  16.7k|}
_ZN7CADFile30isReadingUnsupportedGeometriesEv:
  103|  1.74k|{
  104|  1.74k|    return bReadingUnsupportedGeometries;
  105|  1.74k|}

_ZN9CADFileIOC2EPKc:
   18|  7.27k|    m_soFilePath( pszFileName),
   19|  7.27k|    m_bIsOpened (false)
   20|  7.27k|{
   21|  7.27k|}
_ZN9CADFileIOD2Ev:
   24|  7.27k|{
   25|  7.27k|}
_ZNK9CADFileIO8IsOpenedEv:
   28|  36.3k|{
   29|  36.3k|    return m_bIsOpened;
   30|  36.3k|}
_ZNK9CADFileIO11GetFilePathEv:
   39|  7.27k|{
   40|  7.27k|    return m_soFilePath.c_str();
   41|  7.27k|}

_ZN6Matrix9translateERK9CADVector:
   27|    349|{
   28|    349|    double a00 = matrix[0];
   29|    349|    double a01 = matrix[1];
   30|    349|    double a02 = matrix[2];
   31|    349|    double a10 = matrix[3];
   32|    349|    double a11 = matrix[4];
   33|    349|    double a12 = matrix[5];
   34|    349|    double a20 = matrix[6];
   35|    349|    double a21 = matrix[7];
   36|    349|    double a22 = matrix[8];
   37|       |
   38|    349|    matrix[6] = vector.getX() * a00 + vector.getY() * a10 + a20;
   39|    349|    matrix[7] = vector.getX() * a01 + vector.getY() * a11 + a21;
   40|    349|    matrix[8] = vector.getX() * a02 + vector.getY() * a12 + a22;
   41|    349|}
_ZN6Matrix6rotateEd:
   44|    349|{
   45|    349|    const double s = sin( rotation );
   46|    349|    const double c = cos( rotation );
   47|    349|    double a00 = matrix[0];
   48|    349|    double a01 = matrix[1];
   49|    349|    double a02 = matrix[2];
   50|    349|    double a10 = matrix[3];
   51|    349|    double a11 = matrix[4];
   52|    349|    double a12 = matrix[5];
   53|       |
   54|    349|    matrix[0] = c * a00 + s * a10;
   55|    349|    matrix[1] = c * a01 + s * a11;
   56|    349|    matrix[2] = c * a02 + s * a12;
   57|       |
   58|    349|    matrix[3] = c * a10 - s * a00;
   59|    349|    matrix[4] = c * a11 - s * a01;
   60|    349|    matrix[5] = c * a12 - s * a02;
   61|    349|}
_ZN6Matrix5scaleERK9CADVector:
   64|    349|{
   65|    349|    matrix[0] *= vector.getX();
   66|    349|    matrix[1] *= vector.getX();
   67|    349|    matrix[2] *= vector.getX();
   68|    349|    matrix[3] *= vector.getY();
   69|    349|    matrix[4] *= vector.getY();
   70|    349|    matrix[5] *= vector.getY();
   71|    349|}
_ZN11CADGeometryC2Ev:
   87|  2.03k|    geometryType( UNDEFINED ),
   88|  2.03k|    m_thickness( 0 )
   89|  2.03k|{
   90|  2.03k|    geometry_color.R = 0;
   91|  2.03k|    geometry_color.G = 0;
   92|  2.03k|    geometry_color.B = 0;
   93|  2.03k|}
_ZN11CADGeometryD2Ev:
   96|  2.28k|{
   97|       |
   98|  2.28k|}
_ZNK11CADGeometry7getTypeEv:
  101|  1.49k|{
  102|  1.49k|    return geometryType;
  103|  1.49k|}
_ZNK11CADGeometry12getThicknessEv:
  106|  1.49k|{
  107|  1.49k|    return m_thickness;
  108|  1.49k|}
_ZN11CADGeometry12setThicknessEd:
  111|  1.18k|{
  112|  1.18k|    m_thickness = thickness;
  113|  1.18k|}
_ZNK11CADGeometry8getColorEv:
  116|  1.49k|{
  117|  1.49k|    return geometry_color;
  118|  1.49k|}
_ZN11CADGeometry8setColorE8RGBColor:
  121|  1.73k|{
  122|  1.73k|    geometry_color = color;
  123|  1.73k|}
_ZNK11CADGeometry6getEEDEv:
  126|  2.69k|{
  127|  2.69k|    return asEED;
  128|  2.69k|}
_ZN11CADGeometry6setEEDERKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEE:
  131|  1.96k|{
  132|  1.96k|    asEED = eed;
  133|  1.96k|}
_ZNK11CADGeometry18getBlockAttributesEv:
  136|  1.49k|{
  137|  1.49k|    return blockAttributes;
  138|  1.49k|}
_ZN10CADUnknownC2Ev:
  149|     62|{
  150|     62|}
_ZN10CADPoint3DC2Ev:
  166|  1.37k|    xAxisAng( 0.0 )
  167|  1.37k|{
  168|  1.37k|    geometryType = CADGeometry::POINT;
  169|  1.37k|}
_ZN10CADPoint3DC2ERK9CADVectord:
  172|     64|    position( positionIn),
  173|     64|    xAxisAng( 0.0 )
  174|     64|{
  175|     64|    m_thickness = thicknessIn;
  176|     64|    geometryType = CADGeometry::POINT;
  177|     64|}
_ZNK10CADPoint3D11getPositionEv:
  180|  2.12k|{
  181|  2.12k|    return position;
  182|  2.12k|}
_ZN10CADPoint3D11setPositionERK9CADVector:
  185|  1.32k|{
  186|  1.32k|    position = value;
  187|  1.32k|}
_ZN10CADPoint3D12setExtrusionERK9CADVector:
  195|  1.04k|{
  196|  1.04k|    extrusion = value;
  197|  1.04k|}
_ZN10CADPoint3D11setXAxisAngEd:
  205|    104|{
  206|    104|    xAxisAng = value;
  207|    104|}
_ZN7CADLineC2ERK10CADPoint3DS2_:
  232|     32|    start( startIn ),
  233|     32|    end( endIn )
  234|     32|{
  235|     32|    geometryType = CADGeometry::LINE;
  236|     32|}
_ZNK7CADLine8getStartEv:
  239|     93|{
  240|     93|    return start;
  241|     93|}
_ZNK7CADLine6getEndEv:
  249|     93|{
  250|     93|    return end;
  251|     93|}
_ZN9CADCircleC2Ev:
  279|    243|CADCircle::CADCircle() : radius( 0.0f )
  280|    243|{
  281|    243|    geometryType = CADGeometry::CIRCLE;
  282|    243|}
_ZNK9CADCircle9getRadiusEv:
  285|    754|{
  286|    754|    return radius;
  287|    754|}
_ZN9CADCircle9setRadiusEd:
  290|    163|{
  291|    163|    radius = value;
  292|    163|}
_ZN6CADArcC2Ev:
  307|    178|CADArc::CADArc() : CADCircle(),
  308|    178|    startingAngle( 0.0f ),
  309|    178|    endingAngle( 0.0f )
  310|    178|{
  311|    178|    geometryType = CADGeometry::ARC;
  312|    178|}
_ZNK6CADArc16getStartingAngleEv:
  315|    163|{
  316|    163|    return startingAngle;
  317|    163|}
_ZN6CADArc16setStartingAngleEd:
  320|    178|{
  321|    178|    startingAngle = value;
  322|    178|}
_ZNK6CADArc14getEndingAngleEv:
  325|    163|{
  326|    163|    return endingAngle;
  327|    163|}
_ZN6CADArc14setEndingAngleEd:
  330|    178|{
  331|    178|    endingAngle = value;
  332|    178|}
_ZN13CADPolyline3DC2Ev:
  350|    261|{
  351|    261|    geometryType = CADGeometry::POLYLINE3D;
  352|    261|}
_ZN13CADPolyline3D9addVertexERK9CADVector:
  355|  11.0k|{
  356|  11.0k|    vertices.push_back( vertex );
  357|  11.0k|}
_ZNK13CADPolyline3D14getVertexCountEv:
  360|  2.57k|{
  361|  2.57k|    return vertices.size();
  362|  2.57k|}
_ZN13CADPolyline3D9getVertexEm:
  365|  16.6k|{
  366|  16.6k|    return vertices[index];
  367|  16.6k|}
_ZN13CADLWPolylineC2Ev:
  394|    139|    bClosed( false ),
  395|    139|    constWidth( 0.0 ),
  396|    139|    elevation( 0.0 )
  397|    139|{
  398|    139|    geometryType = CADGeometry::LWPOLYLINE;
  399|    139|}
_ZN13CADLWPolyline13setConstWidthEd:
  419|    139|{
  420|    139|    constWidth = value;
  421|    139|}
_ZN13CADLWPolyline12setElevationEd:
  429|    139|{
  430|    139|    elevation = value;
  431|    139|}
_ZN13CADLWPolyline16setVectExtrusionERK9CADVector:
  439|    139|{
  440|    139|    vectExtrusion = value;
  441|    139|}
_ZN13CADLWPolyline9setWidthsERKNSt3__16vectorINS0_4pairIddEENS0_9allocatorIS3_EEEE:
  449|    139|{
  450|    139|    widths = value;
  451|    139|}
_ZNK13CADLWPolyline9getBulgesEv:
  454|    213|{
  455|    213|    return bulges;
  456|    213|}
_ZN13CADLWPolyline9setBulgesERKNSt3__16vectorIdNS0_9allocatorIdEEEE:
  459|    139|{
  460|    139|    bulges = value;
  461|    139|}
_ZNK13CADLWPolyline8isClosedEv:
  464|     87|{
  465|     87|    return bClosed;
  466|     87|}
_ZN13CADLWPolyline9setClosedEb:
  469|    139|{
  470|    139|    bClosed = state;
  471|    139|}
_ZN10CADEllipseC2Ev:
  477|     80|CADEllipse::CADEllipse() : CADArc(),
  478|     80|    axisRatio( 0.0f )
  479|     80|{
  480|     80|    geometryType = CADGeometry::ELLIPSE;
  481|     80|}
_ZNK10CADEllipse12getAxisRatioEv:
  484|     80|{
  485|     80|    return axisRatio;
  486|     80|}
_ZN10CADEllipse12setAxisRatioEd:
  489|     80|{
  490|     80|    axisRatio = value;
  491|     80|}
_ZN10CADEllipse9getSMAxisEv:
  494|     80|{
  495|     80|    return vectSMAxis;
  496|     80|}
_ZN10CADEllipse9setSMAxisERK9CADVector:
  499|     80|{
  500|     80|    vectSMAxis = SMAxisVect;
  501|     80|}
_ZN7CADTextC2Ev:
  517|  1.02k|CADText::CADText() : CADPoint3D(),
  518|  1.02k|    obliqueAngle( 0 ),
  519|  1.02k|    rotationAngle( 0 ),
  520|  1.02k|    height( 0 )
  521|  1.02k|{
  522|  1.02k|    geometryType = CADGeometry::TEXT;
  523|  1.02k|}
_ZNK7CADText12getTextValueEv:
  526|    250|{
  527|    250|    return textValue;
  528|    250|}
_ZN7CADText12setTextValueERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  531|  1.02k|{
  532|  1.02k|    textValue = value;
  533|  1.02k|}
_ZN7CADText9setHeightEd:
  541|  1.02k|{
  542|  1.02k|    height = value;
  543|  1.02k|}
_ZN7CADText16setRotationAngleEd:
  551|    953|{
  552|    953|    rotationAngle = value;
  553|    953|}
_ZN7CADText15setObliqueAngleEd:
  561|    953|{
  562|    953|    obliqueAngle = value;
  563|    953|}
_ZN6CADRayC2Ev:
  577|     20|CADRay::CADRay() : CADPoint3D()
  578|     20|{
  579|     20|    geometryType = CADGeometry::RAY;
  580|     20|}
_ZN6CADRay13setVectVectorERK9CADVector:
  588|     20|{
  589|     20|    extrusion = value;
  590|     20|}
_ZN9CADSplineC2Ev:
  617|    145|    scenario( 0 ),
  618|    145|    rational( false ),
  619|    145|    closed( false ),
  620|    145|    weight( false ),
  621|    145|    fitTolerance( 0.0 ),
  622|    145|    degree( 0 )
  623|    145|{
  624|    145|    geometryType = CADGeometry::SPLINE;
  625|    145|}
_ZNK9CADSpline11getScenarioEv:
  664|    269|{
  665|    269|    return scenario;
  666|    269|}
_ZN9CADSpline11setScenarioEl:
  669|    145|{
  670|    145|    scenario = value;
  671|    145|}
_ZN9CADSpline11setRationalEb:
  679|     24|{
  680|     24|    rational = value;
  681|     24|}
_ZN9CADSpline9setClosedEb:
  689|     24|{
  690|     24|    closed = value;
  691|     24|}
_ZN9CADSpline22addControlPointsWeightEd:
  694|    847|{
  695|    847|    ctrlPointsWeight.push_back( p_weight );
  696|    847|}
_ZN9CADSpline15addControlPointERK9CADVector:
  699|    847|{
  700|    847|    avertCtrlPoints.push_back( point );
  701|    847|}
_ZN9CADSpline11addFitPointERK9CADVector:
  704|    993|{
  705|    993|    averFitPoints.push_back( point );
  706|    993|}
_ZN9CADSpline9setWeightEb:
  714|     24|{
  715|     24|    weight = value;
  716|     24|}
_ZN9CADSpline15setFitToleranceEd:
  724|     21|{
  725|     21|    fitTolerance = value;
  726|     21|}
_ZN9CADSpline9setDegreeEl:
  734|    145|{
  735|    145|    degree = value;
  736|    145|}
_ZN9CADSpline16getControlPointsEv:
  739|  2.26k|{
  740|  2.26k|    return avertCtrlPoints;
  741|  2.26k|}
_ZN8CADSolidC2Ev:
  758|     29|    elevation( 0.0 )
  759|     29|{
  760|     29|    geometryType = CADGeometry::SOLID;
  761|     29|}
_ZN8CADSolid12setElevationEd:
  788|     29|{
  789|     29|    elevation = value;
  790|     29|}
_ZN8CADSolid9addCornerERK9CADVector:
  793|    116|{
  794|    116|    avertCorners.push_back( corner );
  795|    116|}
_ZN8CADSolid10getCornersEv:
  798|     29|{
  799|     29|    return avertCorners;
  800|     29|}
_ZN8CADMTextC2Ev:
  931|     67|    rectWidth( 0.0 ),
  932|     67|    extents( 0.0 ),
  933|     67|    extentsWidth( 0.0 )
  934|     67|{
  935|     67|    geometryType = CADGeometry::MTEXT;
  936|     67|}
_ZN8CADMText12setRectWidthEd:
  944|     67|{
  945|     67|    rectWidth = value;
  946|     67|}
_ZN8CADMText10setExtentsEd:
  954|     67|{
  955|     67|    extents = value;
  956|     67|}
_ZN8CADMText15setExtentsWidthEd:
  964|     67|{
  965|     67|    extentsWidth = value;
  966|     67|}
_ZN9CADFace3DC2Ev:
  982|     52|    invisFlags( 0 )
  983|     52|{
  984|     52|    geometryType = CADGeometry::FACE3D;
  985|     52|}
_ZN9CADFace3D9addCornerERK9CADVector:
  988|    208|{
  989|    208|    avertCorners.push_back( corner );
  990|    208|}
_ZN9CADFace3D9getCornerEm:
  993|    633|{
  994|    633|    return avertCorners[index];
  995|    633|}
_ZN9CADFace3D13setInvisFlagsEs:
 1024|     52|{
 1025|     52|    invisFlags = value;
 1026|     52|}
_ZN16CADPolylinePFaceC2Ev:
 1033|     37|{
 1034|     37|    geometryType = CADGeometry::POLYLINE_PFACE;
 1035|     37|}
_ZN8CADXLineC2Ev:
 1065|     10|{
 1066|     10|    geometryType = CADGeometry::XLINE;
 1067|     10|}
_ZN8CADMLineC2Ev:
 1085|     29|    scale( 0.0 ),
 1086|     29|    opened( false )
 1087|     29|{
 1088|     29|    geometryType = CADGeometry::MLINE;
 1089|     29|}
_ZN8CADMLine8setScaleEd:
 1122|     29|{
 1123|     29|    scale = value;
 1124|     29|}
_ZN8CADMLine9setOpenedEb:
 1132|     29|{
 1133|     29|    opened = value;
 1134|     29|}
_ZN8CADMLine9addVertexERK9CADVector:
 1137|    651|{
 1138|    651|    avertVertices.push_back( vertex );
 1139|    651|}
_ZN9CADAttribC2Ev:
 1146|    753|    dfElevation( 0.0 ),
 1147|    753|    bLockPosition( false )
 1148|    753|{
 1149|    753|    geometryType = CADGeometry::ATTRIB;
 1150|    753|}
_ZN9CADAttrib12setElevationEd:
 1174|    753|{
 1175|    753|    dfElevation = elev;
 1176|    753|}
_ZNK9CADAttrib6getTagEv:
 1179|    651|{
 1180|    651|    return sTag;
 1181|    651|}
_ZN9CADAttrib6setTagERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1184|    753|{
 1185|    753|    sTag = tag;
 1186|    753|}
_ZN9CADAttrib17setAlignmentPointERK9CADVector:
 1194|    753|{
 1195|    753|    vertAlignmentPoint = vect;
 1196|    753|}
_ZN9CADAttrib17setPositionLockedEb:
 1204|    753|{
 1205|    753|    bLockPosition = lock;
 1206|    753|}
_ZN9CADAttdefC2Ev:
 1213|    651|{
 1214|    651|    geometryType = CADGeometry::ATTDEF;
 1215|    651|}
_ZN9CADAttdef9setPromptERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1234|    651|{
 1235|    651|    sPrompt = prompt;
 1236|    651|}

_ZN11CADGeometryC2ERKS_:
   51|    250|    CADGeometry(const CADGeometry&) = default;
_ZN6MatrixC2Ev:
   32|    486|              Matrix() = default;

_ZN9CADHandleC2Eh:
  150|  9.51M|CADHandle::CADHandle( unsigned char codeIn ) : code( codeIn )
  151|  9.51M|{
  152|  9.51M|}
_ZN9CADHandleC2ERKS_:
  155|  17.0M|    code( other.code ),
  156|  17.0M|    handleOrOffset( other.handleOrOffset )
  157|  17.0M|{
  158|  17.0M|}
_ZN9CADHandleaSERKS_:
  161|  1.21M|{
  162|  1.21M|    if( this == & other )
  ------------------
  |  Branch (162:9): [True: 0, False: 1.21M]
  ------------------
  163|      0|        return * this;
  164|  1.21M|    code           = other.code;
  165|  1.21M|    handleOrOffset = other.handleOrOffset;
  166|  1.21M|    return * this;
  167|  1.21M|}
_ZN9CADHandle9addOffsetEh:
  170|  12.8M|{
  171|  12.8M|    handleOrOffset.push_back( val );
  172|  12.8M|}
_ZNK9CADHandle9getAsLongERKS_:
  175|  14.4k|{
  176|       |    // FIXME: Remove GDAL specific code. The library cannot compile as separate project.
  177|  14.4k|    try
  178|  14.4k|    {
  179|  14.4k|        switch( code )
  ------------------
  |  Branch (179:17): [True: 4.88k, False: 9.56k]
  ------------------
  180|  14.4k|        {
  181|  2.23k|            case 0x06:
  ------------------
  |  Branch (181:13): [True: 2.23k, False: 12.2k]
  ------------------
  182|  2.23k|            {
  183|  2.23k|                return static_cast<long>((CPLSM(static_cast<int64_t>(getAsLong(ref_handle.handleOrOffset))) +
  184|  2.23k|                        CPLSM(static_cast<int64_t>(1))).v());
  185|      0|            }
  186|  1.82k|            case 0x08:
  ------------------
  |  Branch (186:13): [True: 1.82k, False: 12.6k]
  ------------------
  187|  1.82k|            {
  188|  1.82k|                return static_cast<long>((CPLSM(static_cast<int64_t>(getAsLong(ref_handle.handleOrOffset))) -
  189|  1.82k|                        CPLSM(static_cast<int64_t>(1))).v());
  190|      0|            }
  191|  3.54k|            case 0x0A:
  ------------------
  |  Branch (191:13): [True: 3.54k, False: 10.9k]
  ------------------
  192|  3.54k|            {
  193|  3.54k|                return static_cast<long>((CPLSM(static_cast<int64_t>(getAsLong(ref_handle.handleOrOffset))) +
  194|  3.54k|                        CPLSM(static_cast<int64_t>(getAsLong(handleOrOffset)))).v());
  195|      0|            }
  196|  1.95k|            case 0x0C:
  ------------------
  |  Branch (196:13): [True: 1.95k, False: 12.4k]
  ------------------
  197|  1.95k|            {
  198|  1.95k|                return static_cast<long>((CPLSM(static_cast<int64_t>(getAsLong(ref_handle.handleOrOffset))) -
  199|  1.95k|                        CPLSM(static_cast<int64_t>(getAsLong(handleOrOffset)))).v());
  200|      0|            }
  201|  14.4k|        }
  202|  14.4k|    }
  203|  14.4k|    catch( const CPLSafeIntOverflow& )
  204|  14.4k|    {
  205|       |        // TODO: handle this differently ?
  206|  3.70k|        return 0;
  207|  3.70k|    }
  208|       |
  209|  4.88k|    return getAsLong(handleOrOffset);
  210|  14.4k|}
_ZNK9CADHandle9getAsLongEv:
  213|   618k|{
  214|   618k|    return getAsLong(handleOrOffset);
  215|   618k|}
_ZN9CADHandle9getAsLongERKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  218|   638k|{
  219|   638k|    unsigned long result = 0;
  220|   638k|    if( handle.empty() )
  ------------------
  |  Branch (220:9): [True: 93.6k, False: 545k]
  ------------------
  221|  93.6k|        return result;
  222|   545k|    size_t copySize = handle.size();
  223|   545k|    if( copySize > sizeof(long) )
  ------------------
  |  Branch (223:9): [True: 126k, False: 418k]
  ------------------
  224|   126k|        copySize = sizeof(long);
  225|  3.06M|    for( size_t i = 0; i < copySize; ++i )
  ------------------
  |  Branch (225:24): [True: 2.52M, False: 545k]
  ------------------
  226|  2.52M|        result = result * 256U + handle[i];
  227|   545k|    return static_cast<long>(result);
  228|   638k|}
_ZNK9CADHandle6isNullEv:
  231|  1.01M|{
  232|  1.01M|    return handleOrOffset.empty() ? true : false;
  ------------------
  |  Branch (232:12): [True: 516k, False: 496k]
  ------------------
  233|  1.01M|}
_ZN10CADVariantC2Ev:
  240|   606k|    type        ( DataType::INVALID ),
  241|   606k|    decimalVal  ( 0 ),
  242|   606k|    xVal        ( 0 ),
  243|   606k|    yVal        ( 0 ),
  244|   606k|    zVal        ( 0 ),
  245|   606k|    dateTimeVal ( 0 )
  246|   606k|{
  247|   606k|}
_ZN10CADVariantC2EPKc:
  250|  14.4k|    type        ( DataType::STRING ),
  251|  14.4k|    decimalVal  ( 0 ),
  252|  14.4k|    xVal        ( 0 ),
  253|  14.4k|    yVal        ( 0 ),
  254|  14.4k|    zVal        ( 0 ),
  255|  14.4k|    stringVal   ( string( val ) ),
  256|  14.4k|    dateTimeVal ( 0 )
  257|  14.4k|{
  258|  14.4k|}
_ZN10CADVariantC2Ei:
  261|  8.76k|    type        ( DataType::DECIMAL ),
  262|  8.76k|    decimalVal  ( val ),
  263|  8.76k|    xVal        ( 0 ),
  264|  8.76k|    yVal        ( 0 ),
  265|  8.76k|    zVal        ( 0 ),
  266|  8.76k|    stringVal   ( to_string( val ) ),
  267|  8.76k|    dateTimeVal ( 0 )
  268|  8.76k|{
  269|  8.76k|}
_ZN10CADVariantC2Es:
  272|  56.2k|    type        ( DataType::DECIMAL ),
  273|  56.2k|    decimalVal  ( val ),
  274|  56.2k|    xVal        ( 0 ),
  275|  56.2k|    yVal        ( 0 ),
  276|  56.2k|    zVal        ( 0 ),
  277|  56.2k|    stringVal   ( to_string( val ) ),
  278|  56.2k|    dateTimeVal ( 0 )
  279|  56.2k|{
  280|  56.2k|}
_ZN10CADVariantC2Ed:
  283|  83.9k|    type        ( DataType::REAL ),
  284|  83.9k|    decimalVal  ( 0 ),
  285|  83.9k|    xVal        ( val ),
  286|  83.9k|    yVal        ( 0 ),
  287|  83.9k|    zVal        ( 0 ),
  288|  83.9k|    stringVal   ( to_string( val ) ),
  289|  83.9k|    dateTimeVal ( 0 )
  290|  83.9k|{
  291|  83.9k|}
_ZN10CADVariantC2Eddd:
  294|   195k|    type        ( DataType::COORDINATES ),
  295|   195k|    decimalVal  ( 0 ),
  296|   195k|    xVal        ( x ),
  297|   195k|    yVal        ( y ),
  298|   195k|    zVal        ( z ),
  299|   195k|    dateTimeVal ( 0 )
  300|   195k|{
  301|   195k|    char str_buff[256];
  302|   195k|    snprintf( str_buff, sizeof(str_buff), "[%.15g,%.15g,%.15g]", x, y, z );
  303|   195k|    str_buff[sizeof(str_buff)-1] = '\0';
  304|   195k|    stringVal = str_buff;
  305|   195k|}
_ZN10CADVariantC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  308|  27.9k|    type        ( DataType::STRING ),
  309|  27.9k|    decimalVal  ( 0 ),
  310|  27.9k|    xVal        ( 0 ),
  311|  27.9k|    yVal        ( 0 ),
  312|  27.9k|    zVal        ( 0 ),
  313|  27.9k|    stringVal   ( val ),
  314|  27.9k|    dateTimeVal ( 0 )
  315|  27.9k|{
  316|  27.9k|}
_ZN10CADVariantC2Ell:
  319|  27.9k|    type        ( DataType::DATETIME ),
  320|  27.9k|    decimalVal  ( 0 ),
  321|  27.9k|    xVal        ( 0 ),
  322|  27.9k|    yVal        ( 0 ),
  323|  27.9k|    zVal        ( 0 )
  324|  27.9k|{
  325|  27.9k|    double dfSeconds = double( milliseconds ) / 1000;
  326|  27.9k|    double dfUnix = 0;
  327|  27.9k|    if(julianday != 0)
  ------------------
  |  Branch (327:8): [True: 2.10k, False: 25.8k]
  ------------------
  328|  2.10k|        dfUnix = ( double( julianday ) - 2440587.5 ) * 86400.0;
  329|  27.9k|    dateTimeVal = static_cast<time_t>( dfUnix + dfSeconds );
  330|       |
  331|  27.9k|    char str_buff[256] = "Invalid date";
  332|  27.9k|#if HAVE_LOCALTIME_R
  333|  27.9k|    struct tm localtime_tm;
  334|  27.9k|    const struct tm *poLocaltime = localtime_r(&dateTimeVal, &localtime_tm);
  335|       |#elif defined(_WIN32)
  336|       |    struct tm localtime_tm;
  337|       |    const struct tm *poLocaltime = localtime_s(&localtime_tm, &dateTimeVal) == 0 ? &localtime_tm : nullptr;
  338|       |#else
  339|       |    const struct tm *poLocaltime = localtime(&dateTimeVal);
  340|       |#endif
  341|  27.9k|    if(poLocaltime)
  ------------------
  |  Branch (341:8): [True: 27.9k, False: 0]
  ------------------
  342|  27.9k|        strftime(str_buff, 255, "%Y-%m-%d %H:%M:%S", poLocaltime);
  343|  27.9k|    stringVal = str_buff;
  344|  27.9k|}
_ZN10CADVariantC2ERK9CADHandle:
  347|  83.9k|    type        ( DataType::HANDLE ),
  348|  83.9k|    decimalVal  ( 0 ),
  349|  83.9k|    xVal        ( 0 ),
  350|  83.9k|    yVal        ( 0 ),
  351|  83.9k|    zVal        ( 0 ),
  352|  83.9k|    stringVal   ( to_string( val.getAsLong() ) ),
  353|  83.9k|    handleVal   ( val ),
  354|  83.9k|    dateTimeVal ( 0 )
  355|  83.9k|{
  356|  83.9k|}
_ZNK10CADVariant10getDecimalEv:
  359|  1.52k|{
  360|  1.52k|    return decimalVal;
  361|  1.52k|}
_ZNK10CADVariant9getStringEv:
  369|   108k|{
  370|   108k|    return stringVal;
  371|   108k|}
_ZN9CADHeaderC2Ev:
  403|  7.23k|{
  404|  7.23k|}
_ZN9CADHeader8addValueEsRK10CADVariant:
  407|   497k|{
  408|   497k|    if( valuesMap.find( code ) != valuesMap.end() )
  ------------------
  |  Branch (408:9): [True: 0, False: 497k]
  ------------------
  409|      0|        return CADErrorCodes::VALUE_EXISTS;
  410|       |
  411|   497k|    valuesMap[code] = val;
  412|   497k|    return CADErrorCodes::SUCCESS;
  413|   497k|}
_ZN9CADHeader8addValueEsPKc:
  416|  14.4k|{
  417|  14.4k|    return addValue( code, CADVariant( val ) );
  418|  14.4k|}
_ZN9CADHeader8addValueEsi:
  426|  7.23k|{
  427|  7.23k|    return addValue( code, CADVariant( val ) );
  428|  7.23k|}
_ZN9CADHeader8addValueEss:
  431|  56.2k|{
  432|  56.2k|    return addValue( code, CADVariant( val ) );
  433|  56.2k|}
_ZN9CADHeader8addValueEsd:
  436|  83.9k|{
  437|  83.9k|    return addValue( code, CADVariant( val ) );
  438|  83.9k|}
_ZN9CADHeader8addValueEsRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  441|  27.9k|{
  442|  27.9k|    return addValue( code, CADVariant( val ) );
  443|  27.9k|}
_ZN9CADHeader8addValueEsddd:
  451|   195k|{
  452|   195k|    return addValue( code, CADVariant( x, y, z ) );
  453|   195k|}
_ZN9CADHeader8addValueEsll:
  456|  27.9k|{
  457|       |    // unix -> julian        return ( unixSecs / 86400.0 ) + 2440587.5;
  458|       |    // julian -> unix        return (julian - 2440587.5) * 86400.0
  459|       |
  460|  27.9k|    return addValue( code, CADVariant( julianday, milliseconds ) );
  461|  27.9k|}
_ZNK9CADHeader8getValueEsRK10CADVariant:
  475|   109k|{
  476|   109k|    auto it = valuesMap.find( code );
  477|   109k|    if( it != valuesMap.end() )
  ------------------
  |  Branch (477:9): [True: 109k, False: 0]
  ------------------
  478|   109k|        return it->second;
  479|      0|    else
  480|      0|        return val;
  481|   109k|}
_ZN9CADHeader12getValueNameEs:
  484|   108k|{
  485|   108k|    for( CADHeaderConstantDetail detail : CADHeaderConstantDetails )
  ------------------
  |  Branch (485:41): [True: 14.3M, False: 1.52k]
  ------------------
  486|  14.3M|    {
  487|  14.3M|        if( detail.nConstant == code )
  ------------------
  |  Branch (487:13): [True: 106k, False: 14.2M]
  ------------------
  488|   106k|            return detail.pszValueName;
  489|  14.3M|    }
  490|  1.52k|    return "Undefined";
  491|   108k|}
_ZNK9CADHeader7getSizeEv:
  504|   109k|{
  505|   109k|    return valuesMap.size();
  506|   109k|}
_ZNK9CADHeader7getCodeEi:
  509|   108k|{
  510|   108k|    auto it = valuesMap.begin();
  511|   108k|    advance( it, index );
  512|   108k|    return it->first;
  513|   108k|}

_ZN8CADLayerC2EP7CADFile:
   23|   496k|    frozen( false ),
   24|   496k|    on( true ),
   25|   496k|    frozenByDefault( false ),
   26|   496k|    locked( false ),
   27|   496k|    plotting( false ),
   28|   496k|    lineWeight( 1 ),
   29|   496k|    color( 0 ),
   30|   496k|    layerId( 0 ),
   31|   496k|    layer_handle( 0 ),
   32|   496k|    pCADFile( file )
   33|   496k|{
   34|   496k|}
_ZNK8CADLayer7getNameEv:
   37|  3.11k|{
   38|  3.11k|    return layerName;
   39|  3.11k|}
_ZN8CADLayer7setNameERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   42|  17.8k|{
   43|  17.8k|    layerName = value;
   44|  17.8k|}
_ZN8CADLayer9setFrozenEb:
   52|  17.8k|{
   53|  17.8k|    frozen = value;
   54|  17.8k|}
_ZN8CADLayer5setOnEb:
   62|  17.8k|{
   63|  17.8k|    on = value;
   64|  17.8k|}
_ZN8CADLayer18setFrozenByDefaultEb:
   72|  17.8k|{
   73|  17.8k|    frozenByDefault = value;
   74|  17.8k|}
_ZN8CADLayer9setLockedEb:
   82|  17.8k|{
   83|  17.8k|    locked = value;
   84|  17.8k|}
_ZN8CADLayer13setLineWeightEs:
  102|  17.8k|{
  103|  17.8k|    lineWeight = value;
  104|  17.8k|}
_ZNK8CADLayer8getColorEv:
  107|    646|{
  108|    646|    return color;
  109|    646|}
_ZN8CADLayer8setColorEs:
  112|  17.8k|{
  113|  17.8k|    color = value;
  114|  17.8k|}
_ZNK8CADLayer5getIdEv:
  117|  2.13k|{
  118|  2.13k|    return layerId;
  119|  2.13k|}
_ZN8CADLayer5setIdERKm:
  122|  17.8k|{
  123|  17.8k|    layerId = value;
  124|  17.8k|}
_ZNK8CADLayer9getHandleEv:
  127|  13.2k|{
  128|  13.2k|    return layer_handle;
  129|  13.2k|}
_ZN8CADLayer9setHandleEl:
  132|  17.8k|{
  133|  17.8k|    layer_handle = value;
  134|  17.8k|}
_ZN8CADLayer9addHandleElN9CADObject10ObjectTypeEl:
  137|  2.28k|{
  138|       |#ifdef _DEBUG
  139|       |    std::cout << "addHandle: " << handle << " type: " << type << "\n";
  140|       |#endif //_DEBUG
  141|  2.28k|    if( type == CADObject::ATTRIB || type == CADObject::ATTDEF )
  ------------------
  |  Branch (141:9): [True: 46, False: 2.24k]
  |  Branch (141:38): [True: 445, False: 1.79k]
  ------------------
  142|    491|    {
  143|    491|        auto pCADGeometryPtr = pCADFile->GetGeometry( getId() - 1, handle );
  144|    491|        std::unique_ptr<CADGeometry> pCADGeometry( pCADGeometryPtr );
  145|    491|        CADAttdef* attdef = dynamic_cast<CADAttdef*>(pCADGeometry.get());
  146|    491|        if(attdef)
  ------------------
  |  Branch (146:12): [True: 342, False: 149]
  ------------------
  147|    342|        {
  148|    342|            attributesNames.insert( attdef->getTag() );
  149|    342|        }
  150|    491|    }
  151|       |
  152|  2.28k|    if( type == CADObject::INSERT )
  ------------------
  |  Branch (152:9): [True: 537, False: 1.75k]
  ------------------
  153|    537|    {
  154|       |        // TODO: transform insert to block of objects (do we need to transform
  155|       |        // coordinates according to insert point)?
  156|    537|        auto insertPtr = pCADFile->GetObject( handle, false );
  157|    537|        std::unique_ptr<CADObject> insert( insertPtr );
  158|    537|        CADInsertObject * pInsert = dynamic_cast<CADInsertObject *>(insert.get());
  159|    537|        if( nullptr != pInsert )
  ------------------
  |  Branch (159:13): [True: 517, False: 20]
  ------------------
  160|    517|        {
  161|    517|            std::unique_ptr<CADObject> blockHeader( pCADFile->GetObject(
  162|    517|                                    pInsert->hBlockHeader.getAsLong(), false ) );
  163|    517|            CADBlockHeaderObject * pBlockHeader =
  164|    517|                          dynamic_cast<CADBlockHeaderObject *>(blockHeader.get());
  165|    517|            if( nullptr != pBlockHeader )
  ------------------
  |  Branch (165:17): [True: 502, False: 15]
  ------------------
  166|    502|            {
  167|       |#ifdef _DEBUG
  168|       |                if( pBlockHeader->bBlkisXRef )
  169|       |                {
  170|       |                    assert( 0 );
  171|       |                }
  172|       |#endif //_DEBUG
  173|    502|                if( pBlockHeader->hEntities.empty() )
  ------------------
  |  Branch (173:21): [True: 0, False: 502]
  ------------------
  174|      0|                {
  175|      0|                    return;
  176|      0|                }
  177|    502|                auto dCurrentEntHandle = pBlockHeader->hEntities[0].getAsLong();
  178|    502|                auto dLastEntHandle    = pBlockHeader->hEntities.back().getAsLong(); // FIXME: in 2000+ entities probably has no links to each other.
  179|       |
  180|    502|                if( dCurrentEntHandle == dLastEntHandle ) // Blocks can be empty (contain no objects)
  ------------------
  |  Branch (180:21): [True: 1, False: 501]
  ------------------
  181|      1|                {
  182|      1|                    return;
  183|      1|                }
  184|       |
  185|    850|                while( true )
  ------------------
  |  Branch (185:24): [Folded - Ignored]
  ------------------
  186|    850|                {
  187|    850|                    std::unique_ptr<CADObject> entity(pCADFile->GetObject(
  188|    850|                                                       dCurrentEntHandle, true ));
  189|    850|                    CADEntityObject* pEntity =
  190|    850|                            dynamic_cast<CADEntityObject *>( entity.get() );
  191|       |
  192|    850|                    if( nullptr == pEntity )
  ------------------
  |  Branch (192:25): [True: 124, False: 726]
  ------------------
  193|    124|                    {
  194|       |                        // shouldn't happen on a valid file, but can happen
  195|       |                        // on broken ones
  196|    124|                        break;
  197|    124|                    }
  198|       |
  199|    726|                    if( dCurrentEntHandle == handle && type == pEntity->getType() )
  ------------------
  |  Branch (199:25): [True: 377, False: 349]
  |  Branch (199:56): [True: 377, False: 0]
  ------------------
  200|    377|                    {
  201|       |                        // If the above condition is true, infinite recursion
  202|       |                        // would occur in the following addHandle() call.
  203|       |                        // Shouldn't happen on a valid file, but can happen
  204|       |                        // on broken ones, such as in https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=46887
  205|    377|                        break;
  206|    377|                    }
  207|       |
  208|    349|                    addHandle( dCurrentEntHandle, pEntity->getType(), handle );
  209|    349|                    Matrix mat;
  210|    349|                    mat.translate( pInsert->vertInsertionPoint );
  211|    349|                    mat.scale( pInsert->vertScales );
  212|    349|                    mat.rotate( pInsert->dfRotation );
  213|    349|                    transformations[dCurrentEntHandle] = mat;
  214|       |
  215|    349|                    if( dCurrentEntHandle == dLastEntHandle )
  ------------------
  |  Branch (215:25): [True: 0, False: 349]
  ------------------
  216|      0|                    {
  217|      0|                        break;
  218|      0|                    }
  219|    349|                    else
  220|    349|                    {
  221|    349|                        if( pEntity->stCed.bNoLinks )
  ------------------
  |  Branch (221:29): [True: 281, False: 68]
  ------------------
  222|    281|                        {
  223|    281|                            ++dCurrentEntHandle;
  224|    281|                        }
  225|     68|                        else
  226|     68|                        {
  227|     68|                            dCurrentEntHandle =
  228|     68|                                pEntity->stChed.hNextEntity.getAsLong(
  229|     68|                                    pEntity->stCed.hObjectHandle );
  230|     68|                        }
  231|    349|                    }
  232|    349|                }
  233|    501|            }
  234|    517|        }
  235|    536|        return;
  236|    537|    }
  237|       |
  238|  1.75k|    if( isCommonEntityType( type ) )
  ------------------
  |  Branch (238:9): [True: 1.75k, False: 0]
  ------------------
  239|  1.75k|    {
  240|  1.75k|        if( type == CADObject::IMAGE )
  ------------------
  |  Branch (240:13): [True: 10, False: 1.74k]
  ------------------
  241|     10|        {
  242|     10|            imageHandles.push_back( handle );
  243|     10|        }
  244|  1.74k|        else
  245|  1.74k|        {
  246|  1.74k|            if( pCADFile->isReadingUnsupportedGeometries() == false )
  ------------------
  |  Branch (246:17): [True: 1.74k, False: 0]
  ------------------
  247|  1.74k|            {
  248|  1.74k|                if( isSupportedGeometryType( type ) )
  ------------------
  |  Branch (248:21): [True: 1.72k, False: 16]
  ------------------
  249|  1.72k|                {
  250|  1.72k|                    if( geometryTypes.empty() )
  ------------------
  |  Branch (250:25): [True: 1.02k, False: 704]
  ------------------
  251|  1.02k|                    {
  252|  1.02k|                        geometryTypes.push_back( type );
  253|  1.02k|                    }
  254|       |
  255|  1.72k|                    if( std::find( geometryTypes.begin(), geometryTypes.end(), type ) ==
  ------------------
  |  Branch (255:25): [True: 237, False: 1.48k]
  ------------------
  256|  1.72k|                        geometryTypes.end() )
  257|    237|                    {
  258|    237|                        geometryTypes.push_back( type );
  259|    237|                    }
  260|  1.72k|                    geometryHandles.push_back(
  261|  1.72k|                                std::make_pair( handle, cadinserthandle ) );
  262|  1.72k|                }
  263|  1.74k|            }
  264|      0|            else
  265|      0|            {
  266|      0|                if( geometryTypes.empty() )
  ------------------
  |  Branch (266:21): [True: 0, False: 0]
  ------------------
  267|      0|                {
  268|      0|                    geometryTypes.push_back( type );
  269|      0|                }
  270|       |
  271|      0|                if( std::find( geometryTypes.begin(), geometryTypes.end(), type ) ==
  ------------------
  |  Branch (271:21): [True: 0, False: 0]
  ------------------
  272|      0|                    geometryTypes.end() )
  273|      0|                {
  274|      0|                    geometryTypes.push_back( type );
  275|      0|                }
  276|      0|                geometryHandles.push_back(
  277|      0|                            std::make_pair( handle, cadinserthandle ) );
  278|      0|            }
  279|  1.74k|        }
  280|  1.75k|    }
  281|  1.75k|}
_ZNK8CADLayer16getGeometryCountEv:
  284|  18.6k|{
  285|  18.6k|    return geometryHandles.size();
  286|  18.6k|}
_ZN8CADLayer11getGeometryEm:
  289|  1.64k|{
  290|  1.64k|    auto handleBlockRefPair = geometryHandles[index];
  291|  1.64k|    CADGeometry * pGeom = pCADFile->GetGeometry( this->getId() - 1,
  292|  1.64k|                        handleBlockRefPair.first, handleBlockRefPair.second );
  293|  1.64k|    if( nullptr == pGeom )
  ------------------
  |  Branch (293:9): [True: 155, False: 1.49k]
  ------------------
  294|    155|        return nullptr;
  295|  1.49k|    auto iter = transformations.find( handleBlockRefPair.first );
  296|  1.49k|    if( iter != transformations.end() )
  ------------------
  |  Branch (296:9): [True: 0, False: 1.49k]
  ------------------
  297|      0|    {
  298|       |        // transform geometry if nHandle is in transformations
  299|      0|        pGeom->transform( iter->second );
  300|      0|    }
  301|  1.49k|    return pGeom;
  302|  1.64k|}
_ZN8CADLayer16getGeometryTypesEv:
  334|  1.02k|{
  335|  1.02k|    return geometryTypes;
  336|  1.02k|}
_ZN8CADLayer17getAttributesTagsEv:
  339|  1.02k|{
  340|  1.02k|    return attributesNames;
  341|  1.02k|}

_ZN9CADObjectD2Ev:
   27|   102k|CADObject::~CADObject() = default;
_ZN15CADEntityObjectD2Ev:
   28|  41.3k|CADEntityObject::~CADEntityObject() = default;
_ZN9CADVectorC2Edd:
   31|  20.8k|    X( x ),
   32|  20.8k|    Y( y ),
   33|  20.8k|    Z( 0.0 ),
   34|  20.8k|    bHasZ( false )
   35|  20.8k|{
   36|       |
   37|  20.8k|}
_ZN9CADVectorC2Eddd:
   40|  95.9k|    X( x ),
   41|  95.9k|    Y( y ),
   42|  95.9k|    Z( z ),
   43|  95.9k|    bHasZ( true )
   44|  95.9k|{
   45|       |
   46|  95.9k|}
_ZN9CADVectorC2ERKS_:
   49|  1.47M|{
   50|  1.47M|    X     = other.X;
   51|  1.47M|    Y     = other.Y;
   52|  1.47M|    Z     = other.Z;
   53|  1.47M|    bHasZ = other.bHasZ;
   54|  1.47M|}
_ZeqRK9CADVectorS1_:
   57|     51|{
   58|     51|    return ( CADVector::fcmp( first.X, second.X ) &&
  ------------------
  |  Branch (58:14): [True: 37, False: 14]
  ------------------
   59|     51|             CADVector::fcmp( first.Y, second.Y ) &&
  ------------------
  |  Branch (59:14): [True: 27, False: 10]
  ------------------
   60|     51|             CADVector::fcmp( first.Z, second.Z ) );
  ------------------
  |  Branch (60:14): [True: 27, False: 0]
  ------------------
   61|     51|}
_ZN9CADVectoraSERKS_:
   64|   104k|{
   65|   104k|    if( &second != this )
  ------------------
  |  Branch (65:9): [True: 104k, False: 0]
  ------------------
   66|   104k|    {
   67|   104k|        X     = second.X;
   68|   104k|        Y     = second.Y;
   69|   104k|        Z     = second.Z;
   70|   104k|        bHasZ = second.bHasZ;
   71|   104k|    }
   72|   104k|    return * this;
   73|   104k|}
_ZNK9CADVector4getZEv:
   91|  24.2k|{
   92|  24.2k|    return Z;
   93|  24.2k|}
_ZN9CADVector4setZEd:
   96|  10.2k|{
   97|  10.2k|    if( !bHasZ )
  ------------------
  |  Branch (97:9): [True: 704, False: 9.57k]
  ------------------
   98|    704|        bHasZ = true;
   99|  10.2k|    Z         = value;
  100|  10.2k|}
_ZNK9CADVector4getYEv:
  103|   711k|{
  104|   711k|    return Y;
  105|   711k|}
_ZN9CADVector4setYEd:
  108|   633k|{
  109|   633k|    Y = value;
  110|   633k|}
_ZNK9CADVector4getXEv:
  113|   703k|{
  114|   703k|    return X;
  115|   703k|}
_ZN9CADVector4setXEd:
  118|   633k|{
  119|   633k|    X = value;
  120|   633k|}
_ZN9CADVectorC2Ev:
  122|   135k|CADVector::CADVector() : X( .0 ), Y( .0 ), Z( .0 ), bHasZ( true )
  123|   135k|{
  124|       |
  125|   135k|}
_ZN13CADTextObjectC2Ev:
  132|  1.67k|    CADEntityObject(TEXT),
  133|  1.67k|    DataFlags(0),
  134|  1.67k|    dfElevation(0.0),
  135|  1.67k|    dfThickness(0.0),
  136|  1.67k|    dfObliqueAng(0.0),
  137|  1.67k|    dfRotationAng(0.0),
  138|  1.67k|    dfHeight(0.0),
  139|  1.67k|    dfWidthFactor(0.0),
  140|  1.67k|    dGeneration(0),
  141|  1.67k|    dHorizAlign(0),
  142|  1.67k|    dVertAlign(0)
  143|  1.67k|{
  144|  1.67k|}
_ZN13CADTextObjectD2Ev:
  146|  1.67k|CADTextObject::~CADTextObject() = default;
_ZN15CADAttribObjectC2EN9CADObject10ObjectTypeE:
  153|  6.42k|    CADEntityObject(typeIn),
  154|  6.42k|    DataFlags( 0 ),
  155|  6.42k|    dfElevation(0.0),
  156|  6.42k|    dfThickness(0.0),
  157|  6.42k|    dfObliqueAng(0.0),
  158|  6.42k|    dfRotationAng(0.0),
  159|  6.42k|    dfHeight(0.0),
  160|  6.42k|    dfWidthFactor(0.0),
  161|  6.42k|    dGeneration(0),
  162|  6.42k|    dHorizAlign(0),
  163|  6.42k|    dVertAlign(0),
  164|  6.42k|    dVersion(0),
  165|  6.42k|    nFieldLength(0),
  166|  6.42k|    nFlags(0),
  167|  6.42k|    bLockPosition(false)
  168|  6.42k|{
  169|  6.42k|}
_ZN15CADAttribObjectD2Ev:
  171|  6.42k|CADAttribObject::~CADAttribObject() = default;
_ZN15CADAttdefObjectC2Ev:
  178|  2.51k|    CADAttribObject(ATTDEF)
  179|  2.51k|{
  180|  2.51k|}
_ZN15CADAttdefObjectD2Ev:
  182|  2.51k|CADAttdefObject::~CADAttdefObject() = default;
_ZN15CADInsertObjectC2EN9CADObject10ObjectTypeE:
  224|  2.14k|    CADEntityObject(typeIn),
  225|  2.14k|    dfRotation( 0.0 ),
  226|  2.14k|    bHasAttribs( false ),
  227|  2.14k|    nObjectsOwned( 0 )
  228|  2.14k|{
  229|  2.14k|}
_ZN15CADInsertObjectD2Ev:
  231|  2.14k|CADInsertObject::~CADInsertObject() = default;
_ZN17CADVertex3DObjectC2Ev:
  272|    509|    CADEntityObject(VERTEX3D)
  273|    509|{
  274|    509|}
_ZN19CADVertexMeshObjectC2Ev:
  283|  1.19k|    CADEntityObject(VERTEX_MESH)
  284|  1.19k|{
  285|  1.19k|}
_ZN20CADVertexPFaceObjectC2Ev:
  294|  1.05k|    CADEntityObject(VERTEX_PFACE)
  295|  1.05k|{
  296|  1.05k|}
_ZN19CADPolyline2DObjectC2Ev:
  320|    864|    CADEntityObject(POLYLINE2D),
  321|    864|    dFlags( 0 ),
  322|    864|    dCurveNSmoothSurfType( 0 ),
  323|    864|    dfStartWidth( 0.0 ),
  324|    864|    dfEndWidth( 0.0 ),
  325|    864|    dfThickness( 0.0 ),
  326|    864|    dfElevation( 0.0 ),
  327|    864|    nObjectsOwned( 0 )
  328|    864|{
  329|    864|}
_ZN19CADPolyline2DObjectD2Ev:
  331|    864|CADPolyline2DObject::~CADPolyline2DObject() = default;
_ZN19CADPolyline3DObjectC2Ev:
  338|    939|    CADEntityObject(POLYLINE3D),
  339|    939|    SplinedFlags( 0 ),
  340|    939|    ClosedFlags( 0 ),
  341|    939|    nObjectsOwned( 0 )
  342|    939|{
  343|    939|}
_ZN19CADPolyline3DObjectD2Ev:
  345|    939|CADPolyline3DObject::~CADPolyline3DObject() = default;
_ZN12CADArcObjectC2Ev:
  352|    931|    CADEntityObject(ARC),
  353|    931|    dfRadius( 0.0 ),
  354|    931|    dfThickness( 0.0 ),
  355|    931|    dfStartAngle( 0.0 ),
  356|    931|    dfEndAngle( 0.0 )
  357|    931|{
  358|    931|}
_ZN15CADCircleObjectC2Ev:
  367|  1.04k|    CADEntityObject(CIRCLE),
  368|  1.04k|    dfRadius( 0.0 ),
  369|  1.04k|    dfThickness( 0.0 )
  370|  1.04k|{
  371|  1.04k|}
_ZN13CADLineObjectC2Ev:
  380|  1.00k|    CADEntityObject(LINE),
  381|  1.00k|    dfThickness( 0.0 )
  382|  1.00k|{
  383|  1.00k|}
_ZN20CADBaseControlObjectC2EN9CADObject10ObjectTypeE:
  392|  60.6k|    CADObject(typeIn),
  393|  60.6k|    nObjectSizeInBits( 0 ),
  394|  60.6k|    nNumReactors( 0 ),
  395|  60.6k|    bNoXDictionaryPresent( false )
  396|  60.6k|{
  397|  60.6k|}
_ZN20CADBaseControlObjectD2Ev:
  399|  60.6k|CADBaseControlObject::~CADBaseControlObject() = default;
_ZN21CADBlockControlObjectC2Ev:
  406|  2.57k|    CADBaseControlObject(BLOCK_CONTROL_OBJ),
  407|  2.57k|    nNumEntries( 0 )
  408|  2.57k|{
  409|  2.57k|}
_ZN21CADBlockControlObjectD2Ev:
  411|  2.57k|CADBlockControlObject::~CADBlockControlObject() = default;
_ZN20CADBlockHeaderObjectC2Ev:
  418|  8.79k|    CADBaseControlObject(BLOCK_HEADER),
  419|  8.79k|    b64Flag( false ),
  420|  8.79k|    dXRefIndex( 0 ),
  421|  8.79k|    bXDep( false ),
  422|  8.79k|    bAnonymous( false ),
  423|  8.79k|    bHasAtts( false ),
  424|  8.79k|    bBlkisXRef( false ),
  425|  8.79k|    bXRefOverlaid( false ),
  426|  8.79k|    bLoadedBit( false ),
  427|  8.79k|    nOwnedObjectsCount( 0 ),
  428|  8.79k|    nSizeOfPreviewData( 0 ),
  429|  8.79k|    nInsertUnits( 0 ),
  430|  8.79k|    bExplodable( false ),
  431|  8.79k|    dBlockScaling( 0 )
  432|  8.79k|{
  433|  8.79k|}
_ZN20CADBlockHeaderObjectD2Ev:
  435|  8.79k|CADBlockHeaderObject::~CADBlockHeaderObject() = default;
_ZN21CADLayerControlObjectC2Ev:
  442|  11.2k|    CADBaseControlObject(LAYER_CONTROL_OBJ),
  443|  11.2k|    nNumEntries( 0 )
  444|  11.2k|{
  445|  11.2k|}
_ZN21CADLayerControlObjectD2Ev:
  447|  11.2k|CADLayerControlObject::~CADLayerControlObject() = default;
_ZN14CADLayerObjectC2Ev:
  454|  18.6k|    CADBaseControlObject(LAYER),
  455|  18.6k|    b64Flag( 0 ),
  456|  18.6k|    dXRefIndex( 0 ),
  457|  18.6k|    bXDep( 0 ),
  458|  18.6k|    bFrozen( false ),
  459|  18.6k|    bOn( false ),
  460|  18.6k|    bFrozenInNewVPORT( false ),
  461|  18.6k|    bLocked( false ),
  462|  18.6k|    bPlottingFlag( false ),
  463|  18.6k|    dLineWeight( 0 ),
  464|  18.6k|    dCMColor( 0 )
  465|  18.6k|{
  466|  18.6k|}
_ZN14CADLayerObjectD2Ev:
  468|  18.6k|CADLayerObject::~CADLayerObject() = default;
_ZN24CADLineTypeControlObjectC2Ev:
  475|  1.73k|    CADBaseControlObject(LTYPE_CONTROL_OBJ),
  476|  1.73k|    nNumEntries( 0 )
  477|  1.73k|{
  478|  1.73k|}
_ZN24CADLineTypeControlObjectD2Ev:
  480|  1.73k|CADLineTypeControlObject::~CADLineTypeControlObject() = default;
_ZN17CADLineTypeObjectC2Ev:
  487|  7.72k|    CADBaseControlObject(LTYPE1),
  488|  7.72k|    b64Flag( false ),
  489|  7.72k|    dXRefIndex( 0 ),
  490|  7.72k|    bXDep( false ),
  491|  7.72k|    dfPatternLen( 0.0 ),
  492|  7.72k|    dAlignment( 0 ),
  493|  7.72k|    nNumDashes( 0 )
  494|  7.72k|{
  495|  7.72k|}
_ZN17CADLineTypeObjectD2Ev:
  497|  7.72k|CADLineTypeObject::~CADLineTypeObject() = default;
_ZN14CADPointObjectC2Ev:
  504|    710|    CADEntityObject(POINT),
  505|    710|    dfThickness( 0.0 ),
  506|    710|    dfXAxisAng( 0.0 )
  507|    710|{
  508|    710|}
_ZN14CADSolidObjectC2Ev:
  517|  1.15k|    CADEntityObject(SOLID),
  518|  1.15k|    dfThickness( 0.0 ),
  519|  1.15k|    dfElevation( 0.0 )
  520|  1.15k|{
  521|  1.15k|    avertCorners.reserve( 4 );
  522|  1.15k|}
_ZN14CADSolidObjectD2Ev:
  524|  1.15k|CADSolidObject::~CADSolidObject() = default;
_ZN16CADEllipseObjectC2Ev:
  531|    594|    CADEntityObject(ELLIPSE),
  532|    594|    dfAxisRatio( 0.0 ),
  533|    594|    dfBegAngle( 0.0 ),
  534|    594|    dfEndAngle( 0.0 )
  535|    594|{
  536|    594|}
_ZN12CADRayObjectC2Ev:
  545|    886|    CADEntityObject(RAY)
  546|    886|{
  547|    886|}
_ZN14CADXLineObjectC2Ev:
  556|    476|    CADEntityObject(XLINE)
  557|    476|{
  558|    476|}
_ZN19CADDictionaryObjectC2Ev:
  567|  3.38k|    CADBaseControlObject(DICTIONARY),
  568|  3.38k|    nNumItems( 0 ),
  569|  3.38k|    dCloningFlag( 0 ),
  570|  3.38k|    dHardOwnerFlag( 0 )
  571|  3.38k|{
  572|  3.38k|}
_ZN19CADDictionaryObjectD2Ev:
  574|  3.38k|CADDictionaryObject::~CADDictionaryObject() = default;
_ZN19CADLWPolylineObjectC2Ev:
  581|  3.52k|    CADEntityObject(LWPOLYLINE),
  582|  3.52k|    bClosed( false ),
  583|  3.52k|    dfConstWidth( 0.0 ),
  584|  3.52k|    dfElevation( 0.0 ),
  585|  3.52k|    dfThickness( 0.0 )
  586|  3.52k|{
  587|  3.52k|}
_ZN19CADLWPolylineObjectD2Ev:
  589|  3.52k|CADLWPolylineObject::~CADLWPolylineObject() = default;
_ZN15CADSplineObjectC2Ev:
  596|  4.02k|    CADEntityObject( SPLINE ),
  597|  4.02k|    dScenario( 0 ),
  598|  4.02k|    dSplineFlags( 0 ),
  599|  4.02k|    dKnotParameter( 0 ),
  600|  4.02k|    dDegree( 0 ),
  601|  4.02k|    dfFitTol( 0.0 ),
  602|  4.02k|    nNumFitPts( 0 ),
  603|  4.02k|    bRational( false ),
  604|  4.02k|    bClosed( false ),
  605|  4.02k|    bPeriodic( false ),
  606|  4.02k|    dfKnotTol( 0.0 ),
  607|  4.02k|    dfCtrlTol( 0.0 ),
  608|  4.02k|    nNumKnots( 0 ),
  609|  4.02k|    nNumCtrlPts( 0 ),
  610|  4.02k|    bWeight( false )
  611|  4.02k|{
  612|  4.02k|}
_ZN15CADSplineObjectD2Ev:
  614|  4.02k|CADSplineObject::~CADSplineObject() = default;
_Z18isCommonEntityTypes:
  640|   456k|{
  641|   456k|    return std::find( CADCommonEntityObjectTypes.begin(),
  642|   456k|                      CADCommonEntityObjectTypes.end(),
  643|   456k|                      nType ) != CADCommonEntityObjectTypes.end();
  644|   456k|}
_Z23isSupportedGeometryTypes:
  647|  1.74k|{
  648|  1.74k|    return std::find( CADSupportedGeometryTypes.begin(),
  649|  1.74k|                      CADSupportedGeometryTypes.end(),
  650|  1.74k|                      nType ) !=  CADSupportedGeometryTypes.end();
  651|  1.74k|}
_Z13getNameByTypeN9CADObject10ObjectTypeE:
  740|  1.93k|{
  741|  1.93k|    auto it = CADObjectNames.find( eType );
  742|  1.93k|    if( it == CADObjectNames.end() )
  ------------------
  |  Branch (742:9): [True: 14, False: 1.92k]
  ------------------
  743|     14|        return "";
  744|       |
  745|  1.92k|    return it->second;
  746|  1.93k|}
_ZNK9CADObject7getTypeEv:
  752|  7.36k|{
  753|  7.36k|    return type;
  754|  7.36k|}
_ZN9CADObject7setSizeEl:
  762|   102k|{
  763|   102k|    size = value;
  764|   102k|}
_ZN9CADObject6setCRCEt:
  772|  85.5k|{
  773|  85.5k|    CRC = value;
  774|  85.5k|}
_ZN14CADImageObjectC2Ev:
  869|  2.01k|    CADEntityObject(IMAGE),
  870|  2.01k|    dClassVersion( 0 ),
  871|  2.01k|    dfSizeX( 0.0 ),
  872|  2.01k|    dfSizeY( 0.0 ),
  873|  2.01k|    dDisplayProps( 0 ),
  874|  2.01k|    bClipping( false ),
  875|  2.01k|    dBrightness( 0 ),
  876|  2.01k|    dContrast( 0 ),
  877|  2.01k|    dFade( 0 ),
  878|  2.01k|    bClipMode( false ),
  879|  2.01k|    dClipBoundaryType( 0 ),
  880|  2.01k|    nNumberVerticesInClipPolygon( 0 )
  881|  2.01k|{
  882|  2.01k|}
_ZN14CADImageObjectD2Ev:
  884|  2.01k|CADImageObject::~CADImageObject() = default;
_ZN17CADImageDefObjectC2Ev:
  891|  2.03k|    CADImageDefReactorObject(IMAGEDEF),
  892|  2.03k|    dfXImageSizeInPx( 0.0 ),
  893|  2.03k|    dfYImageSizeInPx( 0.0 ),
  894|  2.03k|    bIsLoaded( false ),
  895|  2.03k|    dResUnits( 0 ),
  896|  2.03k|    dfXPixelSize( 0.0 ),
  897|  2.03k|    dfYPixelSize( 0.0 )
  898|  2.03k|{
  899|  2.03k|}
_ZN17CADImageDefObjectD2Ev:
  901|  2.03k|CADImageDefObject::~CADImageDefObject() = default;
_ZN24CADImageDefReactorObjectC2EN9CADObject10ObjectTypeE:
  908|  3.58k|    CADBaseControlObject(typeIn),
  909|  3.58k|    dClassVersion( 0 )
  910|  3.58k|{
  911|  3.58k|}
_ZN24CADImageDefReactorObjectD2Ev:
  913|  3.58k|CADImageDefReactorObject::~CADImageDefReactorObject() = default;
_ZN14CADMTextObjectC2Ev:
  920|    598|    CADEntityObject(MTEXT),
  921|    598|    dfRectWidth( 0.0 ),
  922|    598|    dfTextHeight( 0.0 ),
  923|    598|    dAttachment( 0 ),
  924|    598|    dDrawingDir( 0 ),
  925|    598|    dfExtents( 0.0 ),
  926|    598|    dfExtentsWidth( 0.0 ),
  927|    598|    dLineSpacingStyle( 0 ),
  928|    598|    dLineSpacingFactor( 0 ),
  929|    598|    bUnknownBit( false),
  930|    598|    dBackgroundFlags( 0 ),
  931|    598|    dBackgroundScaleFactor( 0 ),
  932|    598|    dBackgroundColor( 0 ),
  933|    598|    dBackgroundTransparency( 0 )
  934|    598|{
  935|    598|}
_ZN14CADMTextObjectD2Ev:
  937|    598|CADMTextObject::~CADMTextObject() = default;
_ZN14CADMLineObjectC2Ev:
  944|  3.35k|    CADEntityObject(MLINE),
  945|  3.35k|    dfScale( 0.0 ),
  946|  3.35k|    dJust( 0 ),
  947|  3.35k|    dOpenClosed( 0 ),
  948|  3.35k|    nLinesInStyle( 0 ),
  949|  3.35k|    nNumVertices( 0 )
  950|  3.35k|{
  951|  3.35k|}
_ZN14CADMLineObjectD2Ev:
  953|  3.35k|CADMLineObject::~CADMLineObject() = default;
_ZN15CAD3DFaceObjectC2Ev:
  960|  1.16k|    CADEntityObject(FACE3D),
  961|  1.16k|    bHasNoFlagInd( false ),
  962|  1.16k|    bZZero( false ),
  963|  1.16k|    dInvisFlags( 0 )
  964|  1.16k|{
  965|  1.16k|}
_ZN15CAD3DFaceObjectD2Ev:
  967|  1.16k|CAD3DFaceObject::~CAD3DFaceObject() = default;
_ZN22CADPolylinePFaceObjectC2Ev:
  974|  1.18k|    CADEntityObject(POLYLINE_PFACE),
  975|  1.18k|    nNumVertices( 0 ),
  976|  1.18k|    nNumFaces( 0 ),
  977|  1.18k|    nObjectsOwned( 0 )
  978|  1.18k|{
  979|  1.18k|}
_ZN22CADPolylinePFaceObjectD2Ev:
  981|  1.18k|CADPolylinePFaceObject::~CADPolylinePFaceObject() = default;
_ZN16CADXRecordObjectC2Ev:
  988|  2.92k|    CADBaseControlObject(XRECORD),
  989|  2.92k|    nNumDataBytes( 0 ),
  990|  2.92k|    dCloningFlag( 0 )
  991|  2.92k|{
  992|  2.92k|}
_ZN16CADXRecordObjectD2Ev:
  994|  2.92k|CADXRecordObject::~CADXRecordObject() = default;
_ZN9CADVector4fcmpEdd:
   76|    115|{
   77|    115|    return fabs( x - y ) < EPSILON ? true : false;
  ------------------
  |  |   25|    115|#define EPSILON std::numeric_limits<double>::epsilon() * 16
  ------------------
  |  Branch (77:12): [True: 91, False: 24]
  ------------------
   78|    115|}

_ZN9CADObjectC2ENS_10ObjectTypeE:
  209|   102k|    explicit CADObject(ObjectType typeIn) : size(0), type(typeIn), CRC(0) {}
_ZN11CADCommonEDC2Ev:
  249|  84.1k|        nObjectSizeInBits(0),
  250|  84.1k|        bGraphicsPresented(false),
  251|  84.1k|        bbEntMode(0),
  252|  84.1k|        nNumReactors(0),
  253|  84.1k|        bNoXDictionaryHandlePresent(false),
  254|  84.1k|        bBinaryDataPresent(false),
  255|  84.1k|        bIsByLayerLT(false),
  256|  84.1k|        bNoLinks(false),
  257|  84.1k|        nCMColor(0),
  258|  84.1k|        dfLTypeScale(0.0),
  259|  84.1k|        bbLTypeFlags(0),
  260|  84.1k|        bbPlotStyleFlags(0),
  261|  84.1k|        bbMaterialFlags(0),
  262|  84.1k|        nShadowFlags(0),
  263|  84.1k|        nInvisibility(0),
  264|  84.1k|        nLineWeight(0)
  265|  84.1k|    {
  266|  84.1k|    }
_ZN15CADEntityObjectC2EN9CADObject10ObjectTypeE:
  299|  41.3k|    explicit CADEntityObject(ObjectType typeIn): CADObject(typeIn) {}

_ZN9CADTablesC2Ev:
   26|  7.23k|{
   27|  7.23k|}
_ZN9CADTables8AddTableENS_9TableTypeERK9CADHandle:
   30|   125k|{
   31|   125k|    mapTables[eType] = hHandle;
   32|   125k|}
_ZN9CADTables9ReadTableEP7CADFileNS_9TableTypeE:
   35|  6.66k|{
   36|  6.66k|    auto iterAskedTable = mapTables.find( eType );
   37|  6.66k|    if( iterAskedTable == mapTables.end() )
  ------------------
  |  Branch (37:9): [True: 0, False: 6.66k]
  ------------------
   38|      0|        return CADErrorCodes::TABLE_READ_FAILED;
   39|       |
   40|       |    // TODO: read different tables
   41|  6.66k|    switch( eType )
   42|  6.66k|    {
   43|  6.66k|        case LayersTable:
  ------------------
  |  Branch (43:9): [True: 6.66k, False: 0]
  ------------------
   44|  6.66k|            return ReadLayersTable( pCADFile, iterAskedTable->second.getAsLong() );
   45|      0|        default:
  ------------------
  |  Branch (45:9): [True: 0, False: 6.66k]
  ------------------
   46|      0|            std::cerr << "Unsupported table.";
   47|      0|            break;
   48|  6.66k|    }
   49|       |
   50|      0|    return CADErrorCodes::SUCCESS;
   51|  6.66k|}
_ZNK9CADTables13GetLayerCountEv:
   54|  19.1k|{
   55|  19.1k|    return aLayers.size();
   56|  19.1k|}
_ZN9CADTables8GetLayerEm:
   59|  16.7k|{
   60|  16.7k|    return aLayers[iIndex];
   61|  16.7k|}
_ZN9CADTables14GetTableHandleENS_9TableTypeE:
   64|  1.52k|{
   65|       |    // FIXME: need to add try/catch to prevent crashes on not found elem.
   66|  1.52k|    return mapTables[eType];
   67|  1.52k|}
_ZN9CADTables15ReadLayersTableEP7CADFilel:
   70|  6.66k|{
   71|       |    // Reading Layer Control obj, and aLayers.
   72|  6.66k|    unique_ptr<CADObject> pCADObject( pCADFile->GetObject( dLayerControlHandle ) );
   73|       |
   74|  6.66k|    CADLayerControlObject* spLayerControl =
   75|  6.66k|            dynamic_cast<CADLayerControlObject *>(pCADObject.get());
   76|  6.66k|    if( !spLayerControl )
  ------------------
  |  Branch (76:9): [True: 2.82k, False: 3.84k]
  ------------------
   77|  2.82k|    {
   78|  2.82k|        return CADErrorCodes::TABLE_READ_FAILED;
   79|  2.82k|    }
   80|       |
   81|  1.01M|    for( size_t i = 0; i < spLayerControl->hLayers.size(); ++i )
  ------------------
  |  Branch (81:24): [True: 1.01M, False: 3.84k]
  ------------------
   82|  1.01M|    {
   83|  1.01M|        if( !spLayerControl->hLayers[i].isNull() )
  ------------------
  |  Branch (83:13): [True: 496k, False: 516k]
  ------------------
   84|   496k|        {
   85|   496k|            CADLayer oCADLayer( pCADFile );
   86|       |
   87|       |            // Init CADLayer from CADLayerObject properties
   88|   496k|            CADObject* pCADLayerObject = pCADFile->GetObject(
   89|   496k|                        spLayerControl->hLayers[i].getAsLong() );
   90|   496k|            unique_ptr<CADLayerObject> oCADLayerObj(
   91|   496k|                    dynamic_cast<CADLayerObject *>( pCADLayerObject ) );
   92|       |
   93|   496k|            if(oCADLayerObj)
  ------------------
  |  Branch (93:16): [True: 17.8k, False: 478k]
  ------------------
   94|  17.8k|            {
   95|  17.8k|                oCADLayer.setName( oCADLayerObj->sLayerName );
   96|  17.8k|                oCADLayer.setFrozen( oCADLayerObj->bFrozen );
   97|  17.8k|                oCADLayer.setOn( oCADLayerObj->bOn );
   98|  17.8k|                oCADLayer.setFrozenByDefault( oCADLayerObj->bFrozenInNewVPORT );
   99|  17.8k|                oCADLayer.setLocked( oCADLayerObj->bLocked );
  100|  17.8k|                oCADLayer.setLineWeight( oCADLayerObj->dLineWeight );
  101|  17.8k|                oCADLayer.setColor( oCADLayerObj->dCMColor );
  102|  17.8k|                oCADLayer.setId( aLayers.size() + 1 );
  103|  17.8k|                oCADLayer.setHandle( oCADLayerObj->hObjectHandle.getAsLong() );
  104|       |
  105|  17.8k|                aLayers.push_back( std::move(oCADLayer) );
  106|  17.8k|            }
  107|   478k|            else
  108|   478k|            {
  109|   478k|                delete pCADLayerObject;
  110|   478k|            }
  111|   496k|        }
  112|  1.01M|    }
  113|       |
  114|  3.84k|    auto iterBlockMS = mapTables.find( BlockRecordModelSpace );
  115|  3.84k|    if( iterBlockMS == mapTables.end() )
  ------------------
  |  Branch (115:9): [True: 0, False: 3.84k]
  ------------------
  116|      0|        return CADErrorCodes::TABLE_READ_FAILED;
  117|       |
  118|  3.84k|    CADObject* pCADBlockObject = pCADFile->GetObject(
  119|  3.84k|                iterBlockMS->second.getAsLong() );
  120|  3.84k|    unique_ptr<CADBlockHeaderObject> spModelSpace(
  121|  3.84k|            dynamic_cast<CADBlockHeaderObject *>( pCADBlockObject ) );
  122|  3.84k|    if(!spModelSpace)
  ------------------
  |  Branch (122:8): [True: 2.31k, False: 1.52k]
  ------------------
  123|  2.31k|    {
  124|  2.31k|        delete pCADBlockObject;
  125|  2.31k|        return CADErrorCodes::TABLE_READ_FAILED;
  126|  2.31k|    }
  127|       |
  128|  1.52k|    if(spModelSpace->hEntities.size() < 2)
  ------------------
  |  Branch (128:8): [True: 1, False: 1.52k]
  ------------------
  129|      1|    {
  130|      1|        return CADErrorCodes::TABLE_READ_FAILED;
  131|      1|    }
  132|       |
  133|  1.52k|    auto dCurrentEntHandle = spModelSpace->hEntities[0].getAsLong();
  134|  1.52k|    auto dLastEntHandle    = spModelSpace->hEntities[1].getAsLong();
  135|       |    // To avoid infinite loops
  136|  1.52k|    std::set<long> oVisitedHandles;
  137|  3.71k|    while( dCurrentEntHandle != 0 &&
  ------------------
  |  Branch (137:12): [True: 3.10k, False: 607]
  |  Branch (137:12): [True: 3.09k, False: 619]
  ------------------
  138|  3.71k|           oVisitedHandles.find(dCurrentEntHandle) == oVisitedHandles.end() )
  ------------------
  |  Branch (138:12): [True: 3.09k, False: 12]
  ------------------
  139|  3.09k|    {
  140|  3.09k|        oVisitedHandles.insert(dCurrentEntHandle);
  141|       |
  142|  3.09k|        CADObject* pCADEntityObject = pCADFile->GetObject( dCurrentEntHandle, true );
  143|  3.09k|        unique_ptr<CADEntityObject> spEntityObj(
  144|  3.09k|                    dynamic_cast<CADEntityObject *>( pCADEntityObject ) );
  145|       |
  146|  3.09k|        if( !spEntityObj )
  ------------------
  |  Branch (146:13): [True: 697, False: 2.39k]
  ------------------
  147|    697|        {
  148|    697|            delete pCADEntityObject;
  149|    697|            DebugMsg( "Entity object is null\n" );
  150|    697|            break;
  151|    697|        }
  152|  2.39k|        else if ( dCurrentEntHandle == dLastEntHandle )
  ------------------
  |  Branch (152:19): [True: 210, False: 2.18k]
  ------------------
  153|    210|        {
  154|    210|            FillLayer( spEntityObj.get() );
  155|    210|            break;
  156|    210|        }
  157|       |
  158|  2.18k|        FillLayer( spEntityObj.get() );
  159|       |
  160|  2.18k|        if( spEntityObj->stCed.bNoLinks )
  ------------------
  |  Branch (160:13): [True: 1.06k, False: 1.11k]
  ------------------
  161|  1.06k|        {
  162|  1.06k|            ++dCurrentEntHandle;
  163|  1.06k|        }
  164|  1.11k|        else
  165|  1.11k|        {
  166|  1.11k|            dCurrentEntHandle = spEntityObj->stChed.hNextEntity.getAsLong( spEntityObj->stCed.hObjectHandle );
  167|  1.11k|        }
  168|  2.18k|    }
  169|       |
  170|  1.52k|    DebugMsg( "Read aLayers using LayerControl object count: %d\n",
  171|  1.52k|              static_cast<int>(aLayers.size()) );
  172|       |
  173|  1.52k|    return CADErrorCodes::SUCCESS;
  174|  1.52k|}
_ZN9CADTables9FillLayerEPK15CADEntityObject:
  177|  2.39k|{
  178|  2.39k|    if(nullptr == pEntityObject)
  ------------------
  |  Branch (178:8): [True: 0, False: 2.39k]
  ------------------
  179|      0|    {
  180|      0|        return;
  181|      0|    }
  182|       |
  183|  2.39k|    for( CADLayer& oLayer : aLayers )
  ------------------
  |  Branch (183:27): [True: 13.2k, False: 456]
  ------------------
  184|  13.2k|    {
  185|  13.2k|        if( pEntityObject->stChed.hLayer.getAsLong(
  ------------------
  |  Branch (185:13): [True: 1.93k, False: 11.3k]
  ------------------
  186|  13.2k|                    pEntityObject->stCed.hObjectHandle ) == oLayer.getHandle() )
  187|  1.93k|        {
  188|  1.93k|            DebugMsg( "Object with type: %s is attached to layer named: %s\n",
  189|  1.93k|                      getNameByType( pEntityObject->getType() ).c_str(),
  190|  1.93k|                      oLayer.getName().c_str() );
  191|       |
  192|  1.93k|            oLayer.addHandle( pEntityObject->stCed.hObjectHandle.getAsLong(),
  193|  1.93k|                              pEntityObject->getType() );
  194|  1.93k|            break;
  195|  1.93k|        }
  196|  13.2k|    }
  197|  2.39k|}

_Z13CalculateCRC8tPKci:
   55|   106k|{
   56|   106k|    unsigned char al;
   57|  75.3M|    while( num-- > 0 )
  ------------------
  |  Branch (57:12): [True: 75.2M, False: 106k]
  ------------------
   58|  75.2M|    {
   59|  75.2M|        al = static_cast<unsigned char>( ( *ptr ) ^
   60|  75.2M|                                         ( static_cast<char>( initialVal & 0xFF ) ) );
   61|  75.2M|        initialVal = ( initialVal >> 8 ) & 0xFF;
   62|  75.2M|        initialVal = static_cast<unsigned short>( initialVal ^ DWGCRC8Table[al & 0xFF] );
   63|  75.2M|        ptr++;
   64|  75.2M|    }
   65|       |
   66|   106k|    return initialVal;
   67|   106k|}
_ZN9CADBufferC2Em:
   73|  1.05M|CADBuffer::CADBuffer(size_t size) : m_nBitOffsetFromStart(0)
   74|  1.05M|{
   75|  1.05M|    m_pBuffer = new char[size];
   76|       |    // zero memory
   77|  1.05M|    memset(m_pBuffer, 0, size);
   78|  1.05M|    m_nSize = size;
   79|  1.05M|}
_ZN9CADBufferD2Ev:
   82|  1.05M|{
   83|  1.05M|    delete [] m_pBuffer;
   84|  1.05M|}
_ZN9CADBuffer8WriteRAWEPKvm:
   87|  21.7k|{
   88|  21.7k|    memcpy(m_pBuffer, data, size);
   89|  21.7k|    m_nBitOffsetFromStart += size * 8;
   90|  21.7k|}
_ZN9CADBuffer6Read2BEv:
   93|  6.25M|{
   94|  6.25M|    unsigned char result           = 0;
   95|  6.25M|    size_t        nByteOffset      = m_nBitOffsetFromStart / 8;
   96|  6.25M|    size_t        nBitOffsetInByte = m_nBitOffsetFromStart % 8;
   97|       |
   98|  6.25M|    if(nByteOffset + 2 > m_nSize)
  ------------------
  |  Branch (98:8): [True: 2.89M, False: 3.36M]
  ------------------
   99|  2.89M|    {
  100|  2.89M|        m_bEOB = true;
  101|  2.89M|        return 0;
  102|  2.89M|    }
  103|       |
  104|  3.36M|    unsigned char a2BBytes[2];
  105|  3.36M|    memcpy( a2BBytes, m_pBuffer + nByteOffset, 2 );
  106|       |
  107|  3.36M|    switch( nBitOffsetInByte )
  108|  3.36M|    {
  109|  57.6k|        case 7:
  ------------------
  |  Branch (109:9): [True: 57.6k, False: 3.30M]
  ------------------
  110|  57.6k|            result  = ( a2BBytes[0] & binary( 00000001 ) ) << 1;
  ------------------
  |  |  112|  57.6k|#define binary( n ) bin<0##n>::value
  ------------------
  111|  57.6k|            result |= ( a2BBytes[1] & binary( 10000000 ) ) >> 7;
  ------------------
  |  |  112|  57.6k|#define binary( n ) bin<0##n>::value
  ------------------
  112|  57.6k|            break;
  113|  3.30M|        default:
  ------------------
  |  Branch (113:9): [True: 3.30M, False: 57.6k]
  ------------------
  114|  3.30M|            result = ( a2BBytes[0] >> ( 6 - nBitOffsetInByte ) );
  115|  3.30M|            break;
  116|  3.36M|    }
  117|       |
  118|  3.36M|    result &= binary( 00000011 );
  ------------------
  |  |  112|  3.36M|#define binary( n ) bin<0##n>::value
  ------------------
  119|  3.36M|    m_nBitOffsetFromStart += 2;
  120|       |
  121|  3.36M|    return result;
  122|  3.36M|}
_ZN9CADBuffer6Read4BEv:
  163|  14.8M|{
  164|  14.8M|    unsigned char result           = 0;
  165|  14.8M|    size_t        nByteOffset      = m_nBitOffsetFromStart / 8;
  166|  14.8M|    size_t        nBitOffsetInByte = m_nBitOffsetFromStart % 8;
  167|       |
  168|  14.8M|    if(nByteOffset + 2 > m_nSize)
  ------------------
  |  Branch (168:8): [True: 4.21M, False: 10.5M]
  ------------------
  169|  4.21M|    {
  170|  4.21M|        m_bEOB = true;
  171|  4.21M|        return 0;
  172|  4.21M|    }
  173|       |
  174|  10.5M|    unsigned char a4BBytes[2];
  175|  10.5M|    memcpy( a4BBytes, m_pBuffer + nByteOffset, 2 );
  176|       |
  177|  10.5M|    switch( nBitOffsetInByte )
  178|  10.5M|    {
  179|   526k|        case 5:
  ------------------
  |  Branch (179:9): [True: 526k, False: 10.0M]
  ------------------
  180|   526k|            result  = ( a4BBytes[0] & binary( 00000111 ) ) << 1;
  ------------------
  |  |  112|   526k|#define binary( n ) bin<0##n>::value
  ------------------
  181|   526k|            result |= ( a4BBytes[1] & binary( 10000000 ) ) >> 7;
  ------------------
  |  |  112|   526k|#define binary( n ) bin<0##n>::value
  ------------------
  182|   526k|            break;
  183|  2.87M|        case 6:
  ------------------
  |  Branch (183:9): [True: 2.87M, False: 7.71M]
  ------------------
  184|  2.87M|            result  = ( a4BBytes[0] & binary( 00000011 ) ) << 2;
  ------------------
  |  |  112|  2.87M|#define binary( n ) bin<0##n>::value
  ------------------
  185|  2.87M|            result |= ( a4BBytes[1] & binary( 11000000 ) ) >> 6;
  ------------------
  |  |  112|  2.87M|#define binary( n ) bin<0##n>::value
  ------------------
  186|  2.87M|            break;
  187|       |
  188|   114k|        case 7:
  ------------------
  |  Branch (188:9): [True: 114k, False: 10.4M]
  ------------------
  189|   114k|            result  = ( a4BBytes[0] & binary( 00000001 ) ) << 3;
  ------------------
  |  |  112|   114k|#define binary( n ) bin<0##n>::value
  ------------------
  190|   114k|            result |= ( a4BBytes[1] & binary( 11100000 ) ) >> 5;
  ------------------
  |  |  112|   114k|#define binary( n ) bin<0##n>::value
  ------------------
  191|   114k|            break;
  192|       |
  193|  7.07M|        default:
  ------------------
  |  Branch (193:9): [True: 7.07M, False: 3.51M]
  ------------------
  194|  7.07M|            result = ( a4BBytes[0] >> ( 4 - nBitOffsetInByte ) );
  195|  7.07M|            break;
  196|  10.5M|    }
  197|       |
  198|  10.5M|    result &= binary( 00001111 );
  ------------------
  |  |  112|  10.5M|#define binary( n ) bin<0##n>::value
  ------------------
  199|  10.5M|    m_nBitOffsetFromStart += 4;
  200|       |
  201|  10.5M|    return result;
  202|  10.5M|}
_ZN9CADBuffer13ReadBITDOUBLEEv:
  206|  2.84M|{
  207|  2.84M|    unsigned char BITCODE = Read2B();
  208|       |
  209|  2.84M|    size_t nByteOffset      = m_nBitOffsetFromStart / 8;
  210|  2.84M|    size_t nBitOffsetInByte = m_nBitOffsetFromStart % 8;
  211|       |
  212|  2.84M|    if(nByteOffset + 9 > m_nSize)
  ------------------
  |  Branch (212:8): [True: 2.09M, False: 753k]
  ------------------
  213|  2.09M|    {
  214|  2.09M|        m_bEOB = true;
  215|  2.09M|        return 0.0;
  216|  2.09M|    }
  217|       |
  218|   753k|    unsigned char aDoubleBytes[9]; // maximum bytes a single double can take.
  219|   753k|    memcpy( aDoubleBytes, m_pBuffer + nByteOffset, 9 );
  220|       |
  221|   753k|    switch( BITCODE )
  ------------------
  |  Branch (221:13): [True: 0, False: 753k]
  ------------------
  222|   753k|    {
  223|   175k|        case BITDOUBLE_NORMAL:
  ------------------
  |  |   36|   175k|#define BITDOUBLE_NORMAL        0x0
  ------------------
  |  Branch (223:9): [True: 175k, False: 578k]
  ------------------
  224|   175k|        {
  225|   175k|            aDoubleBytes[0] <<= nBitOffsetInByte;
  226|   175k|            aDoubleBytes[0] |= ( aDoubleBytes[1] >> ( 8 - nBitOffsetInByte ) );
  227|   175k|            aDoubleBytes[1] <<= nBitOffsetInByte;
  228|   175k|            aDoubleBytes[1] |= ( aDoubleBytes[2] >> ( 8 - nBitOffsetInByte ) );
  229|   175k|            aDoubleBytes[2] <<= nBitOffsetInByte;
  230|   175k|            aDoubleBytes[2] |= ( aDoubleBytes[3] >> ( 8 - nBitOffsetInByte ) );
  231|   175k|            aDoubleBytes[3] <<= nBitOffsetInByte;
  232|   175k|            aDoubleBytes[3] |= ( aDoubleBytes[4] >> ( 8 - nBitOffsetInByte ) );
  233|   175k|            aDoubleBytes[4] <<= nBitOffsetInByte;
  234|   175k|            aDoubleBytes[4] |= ( aDoubleBytes[5] >> ( 8 - nBitOffsetInByte ) );
  235|   175k|            aDoubleBytes[5] <<= nBitOffsetInByte;
  236|   175k|            aDoubleBytes[5] |= ( aDoubleBytes[6] >> ( 8 - nBitOffsetInByte ) );
  237|   175k|            aDoubleBytes[6] <<= nBitOffsetInByte;
  238|   175k|            aDoubleBytes[6] |= ( aDoubleBytes[7] >> ( 8 - nBitOffsetInByte ) );
  239|   175k|            aDoubleBytes[7] <<= nBitOffsetInByte;
  240|   175k|            aDoubleBytes[7] |= ( aDoubleBytes[8] >> ( 8 - nBitOffsetInByte ) );
  241|       |
  242|   175k|            m_nBitOffsetFromStart += 64;
  243|       |
  244|   175k|            double result;
  245|   175k|            memcpy(&result, aDoubleBytes, sizeof(result));
  246|   175k|            FromLSB(result);
  247|   175k|            return result;
  248|      0|        }
  249|       |
  250|   266k|        case BITDOUBLE_ONE_VALUE:
  ------------------
  |  |   37|   266k|#define BITDOUBLE_ONE_VALUE     0x1
  ------------------
  |  Branch (250:9): [True: 266k, False: 487k]
  ------------------
  251|   266k|        {
  252|   266k|            m_nBitOffsetFromStart += 0;
  253|       |
  254|   266k|            return 1.0f;
  255|      0|        }
  256|       |
  257|   119k|        case BITDOUBLE_ZERO_VALUE:
  ------------------
  |  |   38|   119k|#define BITDOUBLE_ZERO_VALUE    0x2
  ------------------
  |  Branch (257:9): [True: 119k, False: 633k]
  ------------------
  258|   119k|        {
  259|   119k|            m_nBitOffsetFromStart += 0;
  260|       |
  261|   119k|            return 0.0f;
  262|      0|        }
  263|       |
  264|   192k|        case BITDOUBLE_NOT_USED:
  ------------------
  |  |   39|   192k|#define BITDOUBLE_NOT_USED      0x3
  ------------------
  |  Branch (264:9): [True: 192k, False: 561k]
  ------------------
  265|   192k|        {
  266|   192k|            m_nBitOffsetFromStart += 0;
  267|       |
  268|   192k|            return 0.0f;
  269|      0|        }
  270|   753k|    }
  271|       |
  272|      0|    return 0.0f;
  273|   753k|}
_ZN9CADBuffer13SkipBITDOUBLEEv:
  276|   237k|{
  277|   237k|    unsigned char BITCODE = Read2B();
  278|   237k|    size_t nByteOffset      = m_nBitOffsetFromStart / 8;
  279|   237k|    if(nByteOffset + 9 > m_nSize)
  ------------------
  |  Branch (279:8): [True: 164k, False: 73.2k]
  ------------------
  280|   164k|    {
  281|   164k|        m_bEOB = true;
  282|   164k|        return;
  283|   164k|    }
  284|       |
  285|  73.2k|    switch( BITCODE )
  ------------------
  |  Branch (285:13): [True: 0, False: 73.2k]
  ------------------
  286|  73.2k|    {
  287|  21.6k|        case BITDOUBLE_NORMAL:
  ------------------
  |  |   36|  21.6k|#define BITDOUBLE_NORMAL        0x0
  ------------------
  |  Branch (287:9): [True: 21.6k, False: 51.5k]
  ------------------
  288|  21.6k|            m_nBitOffsetFromStart += 64;
  289|  21.6k|            break;
  290|  13.8k|        case BITDOUBLE_ONE_VALUE:
  ------------------
  |  |   37|  13.8k|#define BITDOUBLE_ONE_VALUE     0x1
  ------------------
  |  Branch (290:9): [True: 13.8k, False: 59.3k]
  ------------------
  291|  13.8k|            m_nBitOffsetFromStart += 0;
  292|  13.8k|            break;
  293|  17.7k|        case BITDOUBLE_ZERO_VALUE:
  ------------------
  |  |   38|  17.7k|#define BITDOUBLE_ZERO_VALUE    0x2
  ------------------
  |  Branch (293:9): [True: 17.7k, False: 55.4k]
  ------------------
  294|  37.6k|        case BITDOUBLE_NOT_USED:
  ------------------
  |  |   39|  37.6k|#define BITDOUBLE_NOT_USED      0x3
  ------------------
  |  Branch (294:9): [True: 19.9k, False: 53.3k]
  ------------------
  295|  37.6k|            break;
  296|  73.2k|    }
  297|  73.2k|}
_ZN9CADBuffer12ReadRAWSHORTEv:
  300|   109k|{
  301|   109k|    size_t nByteOffset      = m_nBitOffsetFromStart / 8;
  302|   109k|    size_t nBitOffsetInByte = m_nBitOffsetFromStart % 8;
  303|       |
  304|   109k|    if(nByteOffset + 3 > m_nSize)
  ------------------
  |  Branch (304:8): [True: 6.78k, False: 102k]
  ------------------
  305|  6.78k|    {
  306|  6.78k|        m_bEOB = true;
  307|  6.78k|        return 0;
  308|  6.78k|    }
  309|   102k|    unsigned char aShortBytes[3];
  310|   102k|    memcpy( aShortBytes, m_pBuffer + nByteOffset, 3 );
  311|       |
  312|   102k|    switch( nBitOffsetInByte )
  313|   102k|    {
  314|   100k|        case 0:
  ------------------
  |  Branch (314:9): [True: 100k, False: 2.03k]
  ------------------
  315|   100k|            break;
  316|       |
  317|  2.03k|        default:
  ------------------
  |  Branch (317:9): [True: 2.03k, False: 100k]
  ------------------
  318|  2.03k|            aShortBytes[0] <<= nBitOffsetInByte;
  319|  2.03k|            aShortBytes[0] |= ( aShortBytes[1] >> ( 8 - nBitOffsetInByte ) );
  320|  2.03k|            aShortBytes[1] <<= nBitOffsetInByte;
  321|  2.03k|            aShortBytes[1] |= ( aShortBytes[2] >> ( 8 - nBitOffsetInByte ) );
  322|  2.03k|            break;
  323|   102k|    }
  324|       |
  325|   102k|    int16_t result;
  326|   102k|    memcpy(&result, aShortBytes, sizeof(result));
  327|   102k|    FromLSB(result);
  328|       |
  329|   102k|    m_nBitOffsetFromStart += 16;
  330|       |
  331|   102k|    return result;
  332|   102k|}
_ZN9CADBuffer13ReadRAWDOUBLEEv:
  335|   180k|{
  336|   180k|    size_t nByteOffset      = m_nBitOffsetFromStart / 8;
  337|   180k|    size_t nBitOffsetInByte = m_nBitOffsetFromStart % 8;
  338|       |
  339|   180k|    if(nByteOffset + 9 > m_nSize)
  ------------------
  |  Branch (339:8): [True: 86.8k, False: 94.0k]
  ------------------
  340|  86.8k|    {
  341|  86.8k|        m_bEOB = true;
  342|  86.8k|        return 0.0;
  343|  86.8k|    }
  344|       |
  345|  94.0k|    unsigned char aDoubleBytes[9];
  346|  94.0k|    memcpy( aDoubleBytes, m_pBuffer + nByteOffset, 9 );
  347|       |
  348|  94.0k|    switch( nBitOffsetInByte )
  349|  94.0k|    {
  350|  25.0k|        case 0:
  ------------------
  |  Branch (350:9): [True: 25.0k, False: 69.0k]
  ------------------
  351|  25.0k|            break;
  352|       |
  353|  69.0k|        default:
  ------------------
  |  Branch (353:9): [True: 69.0k, False: 25.0k]
  ------------------
  354|  69.0k|            aDoubleBytes[0] <<= nBitOffsetInByte;
  355|  69.0k|            aDoubleBytes[0] |= ( aDoubleBytes[1] >> ( 8 - nBitOffsetInByte ) );
  356|  69.0k|            aDoubleBytes[1] <<= nBitOffsetInByte;
  357|  69.0k|            aDoubleBytes[1] |= ( aDoubleBytes[2] >> ( 8 - nBitOffsetInByte ) );
  358|  69.0k|            aDoubleBytes[2] <<= nBitOffsetInByte;
  359|  69.0k|            aDoubleBytes[2] |= ( aDoubleBytes[3] >> ( 8 - nBitOffsetInByte ) );
  360|  69.0k|            aDoubleBytes[3] <<= nBitOffsetInByte;
  361|  69.0k|            aDoubleBytes[3] |= ( aDoubleBytes[4] >> ( 8 - nBitOffsetInByte ) );
  362|  69.0k|            aDoubleBytes[4] <<= nBitOffsetInByte;
  363|  69.0k|            aDoubleBytes[4] |= ( aDoubleBytes[5] >> ( 8 - nBitOffsetInByte ) );
  364|  69.0k|            aDoubleBytes[5] <<= nBitOffsetInByte;
  365|  69.0k|            aDoubleBytes[5] |= ( aDoubleBytes[6] >> ( 8 - nBitOffsetInByte ) );
  366|  69.0k|            aDoubleBytes[6] <<= nBitOffsetInByte;
  367|  69.0k|            aDoubleBytes[6] |= ( aDoubleBytes[7] >> ( 8 - nBitOffsetInByte ) );
  368|  69.0k|            aDoubleBytes[7] <<= nBitOffsetInByte;
  369|  69.0k|            aDoubleBytes[7] |= ( aDoubleBytes[8] >> ( 8 - nBitOffsetInByte ) );
  370|  69.0k|            break;
  371|  94.0k|    }
  372|       |
  373|  94.0k|    double result;
  374|  94.0k|    memcpy(&result, aDoubleBytes, sizeof(result));
  375|  94.0k|    FromLSB(result);
  376|       |
  377|  94.0k|    m_nBitOffsetFromStart += 64;
  378|       |
  379|  94.0k|    return result;
  380|  94.0k|}
_ZN9CADBuffer11ReadRAWLONGEv:
  383|   112k|{
  384|   112k|    size_t nByteOffset      = m_nBitOffsetFromStart / 8;
  385|   112k|    size_t nBitOffsetInByte = m_nBitOffsetFromStart % 8;
  386|       |
  387|   112k|    if(nByteOffset + 5 > m_nSize)
  ------------------
  |  Branch (387:8): [True: 0, False: 112k]
  ------------------
  388|      0|    {
  389|      0|        m_bEOB = true;
  390|      0|        return 0;
  391|      0|    }
  392|       |
  393|   112k|    unsigned char aLongBytes[5];
  394|   112k|    memcpy( aLongBytes, m_pBuffer + nByteOffset, 5 );
  395|       |
  396|   112k|    switch( nBitOffsetInByte )
  397|   112k|    {
  398|      0|        case 0:
  ------------------
  |  Branch (398:9): [True: 0, False: 112k]
  ------------------
  399|      0|            break;
  400|       |
  401|   112k|        default:
  ------------------
  |  Branch (401:9): [True: 112k, False: 0]
  ------------------
  402|   112k|            aLongBytes[0] <<= nBitOffsetInByte;
  403|   112k|            aLongBytes[0] |= ( aLongBytes[1] >> ( 8 - nBitOffsetInByte ) );
  404|   112k|            aLongBytes[1] <<= nBitOffsetInByte;
  405|   112k|            aLongBytes[1] |= ( aLongBytes[2] >> ( 8 - nBitOffsetInByte ) );
  406|   112k|            aLongBytes[2] <<= nBitOffsetInByte;
  407|   112k|            aLongBytes[2] |= ( aLongBytes[3] >> ( 8 - nBitOffsetInByte ) );
  408|   112k|            aLongBytes[3] <<= nBitOffsetInByte;
  409|   112k|            aLongBytes[3] |= ( aLongBytes[4] >> ( 8 - nBitOffsetInByte ) );
  410|   112k|            break;
  411|   112k|    }
  412|       |
  413|   112k|    int32_t result;
  414|   112k|    memcpy(&result, aLongBytes, sizeof(result));
  415|   112k|    FromLSB(result);
  416|       |
  417|   112k|    m_nBitOffsetFromStart += 32;
  418|       |
  419|   112k|    return result;
  420|   112k|}
_ZN9CADBuffer7ReadBITEv:
  423|   249k|{
  424|   249k|    size_t nByteOffset      = m_nBitOffsetFromStart / 8;
  425|   249k|    size_t nBitOffsetInByte = m_nBitOffsetFromStart % 8;
  426|       |
  427|   249k|    if(nByteOffset >= m_nSize)
  ------------------
  |  Branch (427:8): [True: 2.76k, False: 246k]
  ------------------
  428|  2.76k|    {
  429|  2.76k|        m_bEOB = true;
  430|  2.76k|        return false;
  431|  2.76k|    }
  432|       |
  433|   246k|    unsigned char resultVal = ( m_pBuffer[nByteOffset] >> ( 7 - nBitOffsetInByte ) ) & binary( 00000001 );
  ------------------
  |  |  112|   246k|#define binary( n ) bin<0##n>::value
  ------------------
  434|   246k|    ++m_nBitOffsetFromStart;
  435|       |
  436|   246k|    return resultVal == 0 ? false : true;
  ------------------
  |  Branch (436:12): [True: 184k, False: 62.5k]
  ------------------
  437|   249k|}
_ZN9CADBuffer12ReadBITSHORTEv:
  440|  1.17M|{
  441|  1.17M|    unsigned char BITCODE = Read2B();
  442|       |
  443|  1.17M|    size_t nByteOffset      = m_nBitOffsetFromStart / 8;
  444|  1.17M|    size_t nBitOffsetInByte = m_nBitOffsetFromStart % 8;
  445|       |
  446|  1.17M|    if(nByteOffset + 4 > m_nSize)
  ------------------
  |  Branch (446:8): [True: 248k, False: 925k]
  ------------------
  447|   248k|    {
  448|   248k|        m_bEOB = true;
  449|   248k|        return 0;
  450|   248k|    }
  451|       |
  452|   925k|    unsigned char aShortBytes[4]; // maximum bytes a single short can take.
  453|   925k|    memcpy( aShortBytes, m_pBuffer + nByteOffset, 4 );
  454|       |
  455|   925k|    switch( BITCODE )
  ------------------
  |  Branch (455:13): [True: 0, False: 925k]
  ------------------
  456|   925k|    {
  457|   570k|        case BITSHORT_NORMAL:
  ------------------
  |  |   26|   570k|#define BITSHORT_NORMAL         0x0
  ------------------
  |  Branch (457:9): [True: 570k, False: 355k]
  ------------------
  458|   570k|        {
  459|   570k|            aShortBytes[0] = ( aShortBytes[0] << nBitOffsetInByte );
  460|   570k|            aShortBytes[0] |= ( aShortBytes[1] >> ( 8 - nBitOffsetInByte ) );
  461|   570k|            aShortBytes[1] = ( aShortBytes[1] << nBitOffsetInByte );
  462|   570k|            aShortBytes[1] |= ( aShortBytes[2] >> ( 8 - nBitOffsetInByte ) );
  463|       |
  464|   570k|            m_nBitOffsetFromStart += 16;
  465|       |
  466|   570k|            int16_t result;
  467|   570k|            memcpy(&result, aShortBytes, sizeof(result));
  468|   570k|            FromLSB(result);
  469|       |
  470|   570k|            return result;
  471|      0|        }
  472|       |
  473|   204k|        case BITSHORT_UNSIGNED_CHAR:
  ------------------
  |  |   27|   204k|#define BITSHORT_UNSIGNED_CHAR  0x1
  ------------------
  |  Branch (473:9): [True: 204k, False: 720k]
  ------------------
  474|   204k|        {
  475|   204k|            aShortBytes[0] = ( aShortBytes[0] << nBitOffsetInByte );
  476|   204k|            aShortBytes[0] |= ( aShortBytes[1] >> ( 8 - nBitOffsetInByte ) );
  477|       |
  478|   204k|            m_nBitOffsetFromStart += 8;
  479|       |
  480|   204k|            return static_cast<unsigned char>(aShortBytes[0]);
  481|      0|        }
  482|       |
  483|   103k|        case BITSHORT_ZERO_VALUE:
  ------------------
  |  |   28|   103k|#define BITSHORT_ZERO_VALUE     0x2
  ------------------
  |  Branch (483:9): [True: 103k, False: 821k]
  ------------------
  484|   103k|        {
  485|   103k|            m_nBitOffsetFromStart += 0;
  486|   103k|            return 0;
  487|      0|        }
  488|       |
  489|  46.5k|        case BITSHORT_256:
  ------------------
  |  |   29|  46.5k|#define BITSHORT_256            0x3
  ------------------
  |  Branch (489:9): [True: 46.5k, False: 879k]
  ------------------
  490|  46.5k|        {
  491|  46.5k|            m_nBitOffsetFromStart += 0;
  492|  46.5k|            return 256;
  493|      0|        }
  494|   925k|    }
  495|       |
  496|      0|    return -1;
  497|   925k|}
_ZN9CADBuffer8ReadCHAREv:
  500|   236M|{
  501|   236M|    unsigned char result           = 0;
  502|   236M|    size_t        nByteOffset      = m_nBitOffsetFromStart / 8;
  503|   236M|    size_t        nBitOffsetInByte = m_nBitOffsetFromStart % 8;
  504|       |
  505|   236M|    if(nByteOffset + 2 > m_nSize)
  ------------------
  |  Branch (505:8): [True: 182M, False: 54.2M]
  ------------------
  506|   182M|    {
  507|   182M|        m_bEOB = true;
  508|   182M|        return result;
  509|   182M|    }
  510|       |
  511|  54.2M|    unsigned char aCharBytes[2]; // maximum bytes a single char can take.
  512|  54.2M|    memcpy( aCharBytes, m_pBuffer + nByteOffset, 2 );
  513|       |
  514|  54.2M|    result = ( aCharBytes[0] << nBitOffsetInByte );
  515|  54.2M|    result |= ( aCharBytes[1] >> ( 8 - nBitOffsetInByte ) );
  516|       |
  517|  54.2M|    m_nBitOffsetFromStart += 8;
  518|       |
  519|  54.2M|    return result;
  520|   236M|}
_ZN9CADBuffer6ReadTVEv:
  523|   151k|{
  524|   151k|    short stringLength = ReadBITSHORT();
  525|       |
  526|   151k|    std::string result;
  527|       |
  528|  59.8M|    for( short i = 0; i < stringLength; ++i )
  ------------------
  |  Branch (528:23): [True: 59.7M, False: 151k]
  ------------------
  529|  59.7M|    {
  530|  59.7M|        result += static_cast<char>(ReadCHAR());
  531|  59.7M|    }
  532|       |
  533|   151k|    return result;
  534|   151k|}
_ZN9CADBuffer10ReadUMCHAREv:
  537|   881k|{
  538|   881k|    long result = 0;
  539|   881k|    size_t nByteOffset = m_nBitOffsetFromStart / 8;
  540|       |    // TODO: bit offset is calculated, but function has nothing to do with it.
  541|       |    /*size_t nBitOffsetInByte = m_nBitOffsetFromStart % 8;*/
  542|       |
  543|   881k|    if(nByteOffset + 8 > m_nSize)
  ------------------
  |  Branch (543:8): [True: 0, False: 881k]
  ------------------
  544|      0|    {
  545|      0|        m_bEOB = true;
  546|      0|        return 0;
  547|      0|    }
  548|   881k|    unsigned char aMCharBytes[8]; // 8 bytes is maximum.
  549|       |    //memcpy( aMCharBytes, m_pBuffer + nByteOffset, 8 );
  550|       |
  551|   881k|    unsigned char nMCharBytesCount = 0;
  552|  1.32M|    for( unsigned char i = 0; i < 8; ++i )
  ------------------
  |  Branch (552:31): [True: 1.28M, False: 36.8k]
  ------------------
  553|  1.28M|    {
  554|  1.28M|        aMCharBytes[i] = ReadCHAR();
  555|  1.28M|        ++nMCharBytesCount;
  556|  1.28M|        if ( !( aMCharBytes[i] & binary( 10000000 ) ) )
  ------------------
  |  |  112|  1.28M|#define binary( n ) bin<0##n>::value
  ------------------
  |  Branch (556:14): [True: 844k, False: 443k]
  ------------------
  557|   844k|        {
  558|   844k|            break;
  559|   844k|        }
  560|   443k|        aMCharBytes[i] &= binary( 01111111 );
  ------------------
  |  |  112|   443k|#define binary( n ) bin<0##n>::value
  ------------------
  561|   443k|    }
  562|       |
  563|   881k|    int nOffset = 0;
  564|  2.17M|    for(unsigned char i = 0; i < nMCharBytesCount; ++i)
  ------------------
  |  Branch (564:30): [True: 1.28M, False: 881k]
  ------------------
  565|  1.28M|    {
  566|  1.28M|        unsigned long nVal = aMCharBytes[i];
  567|  1.28M|        result += nVal << nOffset;
  568|  1.28M|        nOffset += 7;
  569|  1.28M|    }
  570|   881k|    return result;
  571|   881k|}
_ZN9CADBuffer9ReadMCHAREv:
  574|   881k|{
  575|   881k|    long   result      = 0;
  576|   881k|    bool   negative    = false;
  577|   881k|    size_t nByteOffset = m_nBitOffsetFromStart / 8;
  578|       |
  579|       |    // TODO: bit offset is calculated, but function has nothing to do with it.
  580|       |    /*size_t nBitOffsetInByte = nBitOffsetFromStart % 8;*/
  581|       |
  582|   881k|    if(nByteOffset + 8 > m_nSize)
  ------------------
  |  Branch (582:8): [True: 0, False: 881k]
  ------------------
  583|      0|    {
  584|      0|        m_bEOB = true;
  585|      0|        return 0;
  586|      0|    }
  587|   881k|    unsigned char aMCharBytes[8]; // 8 bytes is maximum.
  588|       |
  589|   881k|    unsigned char nMCharBytesCount = 0;
  590|  1.42M|    for( unsigned char i = 0; i < 8; ++i )
  ------------------
  |  Branch (590:31): [True: 1.39M, False: 36.9k]
  ------------------
  591|  1.39M|    {
  592|  1.39M|        aMCharBytes[i] = ReadCHAR();
  593|  1.39M|        ++nMCharBytesCount;
  594|  1.39M|        if ( !( aMCharBytes[i] & binary( 10000000 ) ) )
  ------------------
  |  |  112|  1.39M|#define binary( n ) bin<0##n>::value
  ------------------
  |  Branch (594:14): [True: 844k, False: 547k]
  ------------------
  595|   844k|        {
  596|   844k|            break;
  597|   844k|        }
  598|   547k|        aMCharBytes[i] &= binary( 01111111 );
  ------------------
  |  |  112|   547k|#define binary( n ) bin<0##n>::value
  ------------------
  599|   547k|    }
  600|       |
  601|   881k|    if ( ( aMCharBytes[nMCharBytesCount - 1] & binary( 01000000 ) ) == binary( 01000000 ) )
  ------------------
  |  |  112|   881k|#define binary( n ) bin<0##n>::value
  ------------------
                  if ( ( aMCharBytes[nMCharBytesCount - 1] & binary( 01000000 ) ) == binary( 01000000 ) )
  ------------------
  |  |  112|   881k|#define binary( n ) bin<0##n>::value
  ------------------
  |  Branch (601:10): [True: 276k, False: 605k]
  ------------------
  602|   276k|    {
  603|   276k|        aMCharBytes[nMCharBytesCount - 1] &= binary( 10111111 );
  ------------------
  |  |  112|   276k|#define binary( n ) bin<0##n>::value
  ------------------
  604|   276k|        negative = true;
  605|   276k|    }
  606|       |
  607|   881k|    int nOffset = 0;
  608|  2.27M|    for(unsigned char i = 0; i < nMCharBytesCount; ++i)
  ------------------
  |  Branch (608:30): [True: 1.39M, False: 881k]
  ------------------
  609|  1.39M|    {
  610|  1.39M|        unsigned long nVal = aMCharBytes[i];
  611|  1.39M|        result += nVal << nOffset;
  612|  1.39M|        nOffset += 7;
  613|  1.39M|    }
  614|       |
  615|   881k|    if( negative )
  ------------------
  |  Branch (615:9): [True: 276k, False: 605k]
  ------------------
  616|   276k|    {
  617|   276k|        result *= -1;
  618|   276k|    }
  619|       |
  620|   881k|    return result;
  621|   881k|}
_ZN9CADBuffer10ReadMSHORTEv:
  624|   972k|{
  625|   972k|    unsigned char aMShortBytes[8]; // 8 bytes is maximum.
  626|       |
  627|       |    // TODO: this function does not support MSHORTS longer than 4 bytes. ODA says
  628|       |    //       it's impossible, but not sure.
  629|   972k|    size_t MShortBytesCount = 2;
  630|   972k|    aMShortBytes[0] = ReadCHAR();
  631|   972k|    aMShortBytes[1] = ReadCHAR();
  632|   972k|    if ( aMShortBytes[1] & binary( 10000000 ) )
  ------------------
  |  |  112|   972k|#define binary( n ) bin<0##n>::value
  ------------------
  |  Branch (632:10): [True: 5.34k, False: 966k]
  ------------------
  633|  5.34k|    {
  634|  5.34k|        aMShortBytes[2] = ReadCHAR();
  635|  5.34k|        aMShortBytes[3] = ReadCHAR();
  636|  5.34k|        MShortBytesCount = 4;
  637|  5.34k|    }
  638|       |
  639|   972k|    SwapEndianness( aMShortBytes, MShortBytesCount );
  640|       |
  641|   972k|    if( MShortBytesCount == 2 )
  ------------------
  |  Branch (641:9): [True: 966k, False: 5.34k]
  ------------------
  642|   966k|    {
  643|   966k|        aMShortBytes[0] &= binary( 01111111 ); // drop high order flag bit.
  ------------------
  |  |  112|   966k|#define binary( n ) bin<0##n>::value
  ------------------
  644|   966k|    }
  645|  5.34k|    else
  646|  5.34k|    {
  647|  5.34k|        aMShortBytes[0] &= binary( 01111111 );
  ------------------
  |  |  112|  5.34k|#define binary( n ) bin<0##n>::value
  ------------------
  648|  5.34k|        aMShortBytes[2] &= binary( 01111111 );
  ------------------
  |  |  112|  5.34k|#define binary( n ) bin<0##n>::value
  ------------------
  649|       |
  650|  5.34k|        aMShortBytes[2] |= ( aMShortBytes[1] << 7 );
  651|  5.34k|        aMShortBytes[1] = ( aMShortBytes[1] >> 1 );
  652|  5.34k|        aMShortBytes[1] |= ( aMShortBytes[0] << 7 );
  653|  5.34k|        aMShortBytes[0] = ( aMShortBytes[0] >> 1 );
  654|  5.34k|    }
  655|       |
  656|   972k|    unsigned int result;
  657|   972k|    if( MShortBytesCount == 2 )
  ------------------
  |  Branch (657:9): [True: 966k, False: 5.34k]
  ------------------
  658|   966k|    {
  659|   966k|        result = (aMShortBytes[0] << 8) | aMShortBytes[1];
  660|   966k|    }
  661|  5.34k|    else
  662|  5.34k|    {
  663|  5.34k|        result = (static_cast<unsigned>(aMShortBytes[0]) << 24) |
  664|  5.34k|                 (aMShortBytes[1] << 16) | (aMShortBytes[2] << 8) | aMShortBytes[3];
  665|  5.34k|    }
  666|       |
  667|   972k|    return result;
  668|   972k|}
_ZN9CADBuffer15ReadBITDOUBLEWDEd:
  673|  1.23M|{
  674|  1.23M|    unsigned char aDefaultValueBytes[8];
  675|  1.23M|    memcpy( aDefaultValueBytes, & defaultvalue, 8 );
  676|       |
  677|  1.23M|    unsigned char BITCODE = Read2B();
  678|       |
  679|  1.23M|    switch( BITCODE )
  ------------------
  |  Branch (679:13): [True: 0, False: 1.23M]
  ------------------
  680|  1.23M|    {
  681|  1.05M|        case BITDOUBLEWD_DEFAULT_VALUE:
  ------------------
  |  |   41|  1.05M|#define BITDOUBLEWD_DEFAULT_VALUE  0x0
  ------------------
  |  Branch (681:9): [True: 1.05M, False: 187k]
  ------------------
  682|  1.05M|        {
  683|  1.05M|            return defaultvalue;
  684|      0|        }
  685|       |
  686|   106k|        case BITDOUBLEWD_4BYTES_PATCHED:
  ------------------
  |  |   42|   106k|#define BITDOUBLEWD_4BYTES_PATCHED 0x1
  ------------------
  |  Branch (686:9): [True: 106k, False: 1.13M]
  ------------------
  687|   106k|        {
  688|   106k|            aDefaultValueBytes[0] = ReadCHAR();
  689|   106k|            aDefaultValueBytes[1] = ReadCHAR();
  690|   106k|            aDefaultValueBytes[2] = ReadCHAR();
  691|   106k|            aDefaultValueBytes[3] = ReadCHAR();
  692|       |
  693|   106k|            double result;
  694|   106k|            memcpy(&result, aDefaultValueBytes, sizeof(result));
  695|   106k|            FromLSB(result);
  696|   106k|            return result;
  697|      0|        }
  698|       |
  699|  32.2k|        case BITDOUBLEWD_6BYTES_PATCHED:
  ------------------
  |  |   43|  32.2k|#define BITDOUBLEWD_6BYTES_PATCHED 0x2
  ------------------
  |  Branch (699:9): [True: 32.2k, False: 1.20M]
  ------------------
  700|  32.2k|        {
  701|  32.2k|            aDefaultValueBytes[4] = ReadCHAR();
  702|  32.2k|            aDefaultValueBytes[5] = ReadCHAR();
  703|  32.2k|            aDefaultValueBytes[0] = ReadCHAR();
  704|  32.2k|            aDefaultValueBytes[1] = ReadCHAR();
  705|  32.2k|            aDefaultValueBytes[2] = ReadCHAR();
  706|  32.2k|            aDefaultValueBytes[3] = ReadCHAR();
  707|       |
  708|  32.2k|            double result;
  709|  32.2k|            memcpy(&result, aDefaultValueBytes, sizeof(result));
  710|  32.2k|            FromLSB(result);
  711|  32.2k|            return result;
  712|      0|        }
  713|       |
  714|  48.6k|        case BITDOUBLEWD_FULL_RD:
  ------------------
  |  |   44|  48.6k|#define BITDOUBLEWD_FULL_RD        0x3
  ------------------
  |  Branch (714:9): [True: 48.6k, False: 1.18M]
  ------------------
  715|  48.6k|        {
  716|  48.6k|            aDefaultValueBytes[0] = ReadCHAR();
  717|  48.6k|            aDefaultValueBytes[1] = ReadCHAR();
  718|  48.6k|            aDefaultValueBytes[2] = ReadCHAR();
  719|  48.6k|            aDefaultValueBytes[3] = ReadCHAR();
  720|  48.6k|            aDefaultValueBytes[4] = ReadCHAR();
  721|  48.6k|            aDefaultValueBytes[5] = ReadCHAR();
  722|  48.6k|            aDefaultValueBytes[6] = ReadCHAR();
  723|  48.6k|            aDefaultValueBytes[7] = ReadCHAR();
  724|       |
  725|  48.6k|            double result;
  726|  48.6k|            memcpy(&result, aDefaultValueBytes, sizeof(result));
  727|  48.6k|            FromLSB(result);
  728|  48.6k|            return result;
  729|      0|        }
  730|  1.23M|    }
  731|       |
  732|      0|    return 0.0f;
  733|  1.23M|}
_ZN9CADBuffer10ReadHANDLEEv:
  736|  7.34M|{
  737|  7.34M|    CADHandle result( Read4B() );
  738|  7.34M|    unsigned char counter = Read4B();
  739|  20.2M|    for( unsigned char i = 0; i < counter; ++i )
  ------------------
  |  Branch (739:31): [True: 12.8M, False: 7.34M]
  ------------------
  740|  12.8M|    {
  741|  12.8M|        result.addOffset( ReadCHAR() );
  742|  12.8M|    }
  743|       |
  744|  7.34M|    return result;
  745|  7.34M|}
_ZN9CADBuffer10SkipHANDLEEv:
  748|  62.9k|{
  749|  62.9k|    Read4B();
  750|  62.9k|    unsigned char counter = Read4B();
  751|  62.9k|    m_nBitOffsetFromStart += counter * 8;
  752|  62.9k|}
_ZN9CADBuffer11ReadBITLONGEv:
  769|   214k|{
  770|   214k|    unsigned char BITCODE = Read2B();
  771|       |
  772|   214k|    size_t nByteOffset      = m_nBitOffsetFromStart / 8;
  773|   214k|    size_t nBitOffsetInByte = m_nBitOffsetFromStart % 8;
  774|       |
  775|   214k|    if(nByteOffset + 5 > m_nSize)
  ------------------
  |  Branch (775:8): [True: 70.4k, False: 144k]
  ------------------
  776|  70.4k|    {
  777|  70.4k|        m_bEOB = true;
  778|  70.4k|        return 0;
  779|  70.4k|    }
  780|   144k|    unsigned char aLongBytes[5]; // maximum bytes a single short can take.
  781|   144k|    memcpy( aLongBytes, m_pBuffer + nByteOffset, 5 );
  782|       |
  783|   144k|    switch( BITCODE )
  ------------------
  |  Branch (783:13): [True: 0, False: 144k]
  ------------------
  784|   144k|    {
  785|  47.1k|        case BITLONG_NORMAL:
  ------------------
  |  |   31|  47.1k|#define BITLONG_NORMAL          0x0
  ------------------
  |  Branch (785:9): [True: 47.1k, False: 97.0k]
  ------------------
  786|  47.1k|        {
  787|  47.1k|            aLongBytes[0] <<= nBitOffsetInByte;
  788|  47.1k|            aLongBytes[0] |= ( aLongBytes[1] >> ( 8 - nBitOffsetInByte ) );
  789|  47.1k|            aLongBytes[1] <<= nBitOffsetInByte;
  790|  47.1k|            aLongBytes[1] |= ( aLongBytes[2] >> ( 8 - nBitOffsetInByte ) );
  791|  47.1k|            aLongBytes[2] <<= nBitOffsetInByte;
  792|  47.1k|            aLongBytes[2] |= ( aLongBytes[3] >> ( 8 - nBitOffsetInByte ) );
  793|  47.1k|            aLongBytes[3] <<= nBitOffsetInByte;
  794|  47.1k|            aLongBytes[3] |= ( aLongBytes[4] >> ( 8 - nBitOffsetInByte ) );
  795|       |
  796|  47.1k|            m_nBitOffsetFromStart += 32;
  797|       |
  798|  47.1k|            int32_t result;
  799|  47.1k|            memcpy(&result, aLongBytes, sizeof(result));
  800|  47.1k|            FromLSB(result);
  801|  47.1k|            return result;
  802|      0|        }
  803|       |
  804|  49.1k|        case BITLONG_UNSIGNED_CHAR:
  ------------------
  |  |   32|  49.1k|#define BITLONG_UNSIGNED_CHAR   0x1
  ------------------
  |  Branch (804:9): [True: 49.1k, False: 95.1k]
  ------------------
  805|  49.1k|        {
  806|  49.1k|            aLongBytes[0] <<= nBitOffsetInByte;
  807|  49.1k|            aLongBytes[0] |= ( aLongBytes[1] >> ( 8 - nBitOffsetInByte ) );
  808|       |
  809|  49.1k|            m_nBitOffsetFromStart += 8;
  810|       |
  811|  49.1k|            return aLongBytes[0];
  812|      0|        }
  813|       |
  814|  32.1k|        case BITLONG_ZERO_VALUE:
  ------------------
  |  |   33|  32.1k|#define BITLONG_ZERO_VALUE      0x2
  ------------------
  |  Branch (814:9): [True: 32.1k, False: 112k]
  ------------------
  815|  32.1k|        {
  816|  32.1k|            m_nBitOffsetFromStart += 0;
  817|  32.1k|            return 0;
  818|      0|        }
  819|       |
  820|  15.7k|        case BITLONG_NOT_USED:
  ------------------
  |  |   34|  15.7k|#define BITLONG_NOT_USED        0x3
  ------------------
  |  Branch (820:9): [True: 15.7k, False: 128k]
  ------------------
  821|  15.7k|        {
  822|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  823|       |            std::cerr <<
  824|       |            "THAT SHOULD NEVER HAPPENED! BUG. (in file, or reader, or both.) ReadBITLONG(), case BITLONG_NOT_USED\n";
  825|       |#endif
  826|  15.7k|            m_nBitOffsetFromStart += 0;
  827|  15.7k|            return 0;
  828|      0|        }
  829|   144k|    }
  830|       |
  831|      0|    return -1;
  832|   144k|}
_ZN9CADBuffer6SkipTVEv:
  835|  48.9k|{
  836|  48.9k|    short stringLength = ReadBITSHORT();
  837|  48.9k|    if( stringLength < 0 )
  ------------------
  |  Branch (837:9): [True: 2.31k, False: 46.6k]
  ------------------
  838|  2.31k|    {
  839|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  840|       |        std::cerr << "Negative string length" << std::endl;
  841|       |#endif
  842|  2.31k|        return;
  843|  2.31k|    }
  844|  46.6k|    m_nBitOffsetFromStart += size_t( stringLength * 8 );
  845|  46.6k|}
_ZN9CADBuffer11SkipBITLONGEv:
  848|  20.9k|{
  849|  20.9k|    unsigned char BITCODE = Read2B();
  850|  20.9k|    size_t nByteOffset      = m_nBitOffsetFromStart / 8;
  851|  20.9k|    if(nByteOffset + 5 > m_nSize)
  ------------------
  |  Branch (851:8): [True: 16.4k, False: 4.55k]
  ------------------
  852|  16.4k|    {
  853|  16.4k|        m_bEOB = true;
  854|  16.4k|        return;
  855|  16.4k|    }
  856|  4.55k|    switch( BITCODE )
  ------------------
  |  Branch (856:13): [True: 0, False: 4.55k]
  ------------------
  857|  4.55k|    {
  858|  1.80k|        case BITLONG_NORMAL:
  ------------------
  |  |   31|  1.80k|#define BITLONG_NORMAL          0x0
  ------------------
  |  Branch (858:9): [True: 1.80k, False: 2.75k]
  ------------------
  859|  1.80k|            m_nBitOffsetFromStart += 32;
  860|  1.80k|            break;
  861|       |
  862|    386|        case BITLONG_UNSIGNED_CHAR:
  ------------------
  |  |   32|    386|#define BITLONG_UNSIGNED_CHAR   0x1
  ------------------
  |  Branch (862:9): [True: 386, False: 4.17k]
  ------------------
  863|    386|            m_nBitOffsetFromStart += 8;
  864|    386|            break;
  865|       |
  866|  1.38k|        case BITLONG_ZERO_VALUE:
  ------------------
  |  |   33|  1.38k|#define BITLONG_ZERO_VALUE      0x2
  ------------------
  |  Branch (866:9): [True: 1.38k, False: 3.17k]
  ------------------
  867|  2.36k|        case BITLONG_NOT_USED:
  ------------------
  |  |   34|  2.36k|#define BITLONG_NOT_USED        0x3
  ------------------
  |  Branch (867:9): [True: 979, False: 3.57k]
  ------------------
  868|  2.36k|            break;
  869|  4.55k|    }
  870|  4.55k|}
_ZN9CADBuffer12SkipBITSHORTEv:
  873|   391k|{
  874|   391k|    unsigned char BITCODE = Read2B();
  875|   391k|    size_t nByteOffset      = m_nBitOffsetFromStart / 8;
  876|   391k|    if(nByteOffset + 4 > m_nSize)
  ------------------
  |  Branch (876:8): [True: 300k, False: 91.7k]
  ------------------
  877|   300k|    {
  878|   300k|        m_bEOB = true;
  879|   300k|        return;
  880|   300k|    }
  881|  91.7k|    switch( BITCODE )
  ------------------
  |  Branch (881:13): [True: 0, False: 91.7k]
  ------------------
  882|  91.7k|    {
  883|  17.2k|        case BITSHORT_NORMAL:
  ------------------
  |  |   26|  17.2k|#define BITSHORT_NORMAL         0x0
  ------------------
  |  Branch (883:9): [True: 17.2k, False: 74.5k]
  ------------------
  884|  17.2k|            m_nBitOffsetFromStart += 16;
  885|  17.2k|            break;
  886|       |
  887|  22.1k|        case BITSHORT_UNSIGNED_CHAR:
  ------------------
  |  |   27|  22.1k|#define BITSHORT_UNSIGNED_CHAR  0x1
  ------------------
  |  Branch (887:9): [True: 22.1k, False: 69.6k]
  ------------------
  888|  22.1k|            m_nBitOffsetFromStart += 8;
  889|  22.1k|            break;
  890|       |
  891|  23.3k|        case BITSHORT_ZERO_VALUE:
  ------------------
  |  |   28|  23.3k|#define BITSHORT_ZERO_VALUE     0x2
  ------------------
  |  Branch (891:9): [True: 23.3k, False: 68.4k]
  ------------------
  892|  52.3k|        case BITSHORT_256:
  ------------------
  |  |   29|  52.3k|#define BITSHORT_256            0x3
  ------------------
  |  Branch (892:9): [True: 29.0k, False: 62.6k]
  ------------------
  893|  52.3k|            break;
  894|  91.7k|    }
  895|  91.7k|}
_ZN9CADBuffer10ReadVectorEv:
  909|  85.7k|{
  910|  85.7k|    double x, y, z;
  911|  85.7k|    x = ReadBITDOUBLE();
  912|  85.7k|    y = ReadBITDOUBLE();
  913|  85.7k|    z = ReadBITDOUBLE();
  914|       |
  915|  85.7k|    return CADVector( x, y, z );
  916|  85.7k|}
_ZN9CADBuffer13ReadRAWVectorEv:
  919|  15.7k|{
  920|  15.7k|    double x, y;
  921|  15.7k|    x = ReadRAWDOUBLE();
  922|  15.7k|    y = ReadRAWDOUBLE();
  923|       |
  924|  15.7k|    return CADVector( x, y );
  925|  15.7k|}
_ZN9CADBuffer4SeekEmNS_12SeekPositionE:
  928|   254k|{
  929|   254k|    switch (position) {
  930|   203k|    case BEG:
  ------------------
  |  Branch (930:5): [True: 203k, False: 51.2k]
  ------------------
  931|   203k|        m_nBitOffsetFromStart = offset;
  932|   203k|        break;
  933|  51.2k|    case CURRENT:
  ------------------
  |  Branch (933:5): [True: 51.2k, False: 203k]
  ------------------
  934|  51.2k|        m_nBitOffsetFromStart += offset;
  935|  51.2k|        break;
  936|      0|    case END:
  ------------------
  |  Branch (936:5): [True: 0, False: 254k]
  ------------------
  937|      0|        m_nBitOffsetFromStart = m_nSize - offset;
  938|      0|        break;
  939|      0|    default:
  ------------------
  |  Branch (939:5): [True: 0, False: 254k]
  ------------------
  940|      0|        break;
  941|   254k|    }
  942|   254k|}

_ZNK9CADBuffer12GetRawBufferEv:
  136|  1.15M|    void* GetRawBuffer() const { return m_pBuffer + m_nBitOffsetFromStart / 8; }
_ZNK9CADBuffer11PositionBitEv:
  167|  1.46M|    size_t PositionBit() const { return m_nBitOffsetFromStart; }
_ZNK9CADBuffer5IsEOBEv:
  168|  5.38M|    bool IsEOB() const { return m_bEOB; }
_Z7FromLSBIRjEvOT_:
   87|  14.0k|{
   88|  14.0k|}
_Z14SwapEndiannessIRtmEvOT_T0_:
   73|  22.0k|{
   74|  22.0k|    std::reverse( reinterpret_cast<char*>(&object),
   75|  22.0k|                  reinterpret_cast<char*>(&object) + size );
   76|  22.0k|}
_Z7FromLSBIRiEvOT_:
   87|  2.30M|{
   88|  2.30M|}
_Z7FromLSBIRsEvOT_:
   87|   680k|{
   88|   680k|}
_Z7FromLSBIRdEvOT_:
   87|   456k|{
   88|   456k|}
_Z14SwapEndiannessIRA8_hmEvOT_T0_:
   73|   972k|{
   74|   972k|    std::reverse( reinterpret_cast<char*>(&object),
   75|   972k|                  reinterpret_cast<char*>(&object) + size );
   76|   972k|}

_ZN12DWGFileR200010ReadHeaderEN7CADFile11OpenOptionsE:
   61|  7.05k|{
   62|  7.05k|    char bufferPre[255];
   63|  7.05k|    unsigned dHeaderVarsSectionLength = 0;
   64|  7.05k|    constexpr size_t dSizeOfSectionSize = sizeof(dHeaderVarsSectionLength);
   65|       |
   66|  7.05k|    pFileIO->Seek( sectionLocatorRecords[0].dSeeker, CADFileIO::SeekOrigin::BEG );
   67|  7.05k|    size_t readSize = pFileIO->Read( bufferPre, DWGConstants::SentinelLength );
   68|  7.05k|    if(readSize < DWGConstants::SentinelLength)
  ------------------
  |  Branch (68:8): [True: 11, False: 7.04k]
  ------------------
   69|     11|    {
   70|     11|        DebugMsg( "File is corrupted (size is less than sentinel length)" );
   71|       |
   72|     11|        return CADErrorCodes::HEADER_SECTION_READ_FAILED;
   73|     11|    }
   74|       |
   75|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   76|       |    if( memcmp( bufferPre, DWGConstants::HeaderVariablesStart,
   77|       |                           DWGConstants::SentinelLength ) )
   78|       |    {
   79|       |        DebugMsg( "File is corrupted (wrong pointer to HEADER_VARS section,"
   80|       |                          "or HEADERVARS starting sentinel corrupted.)" );
   81|       |
   82|       |        return CADErrorCodes::HEADER_SECTION_READ_FAILED;
   83|       |    }
   84|       |#endif
   85|       |
   86|  7.04k|    readSize = pFileIO->Read( &dHeaderVarsSectionLength, dSizeOfSectionSize );
   87|  7.04k|    const auto dHeaderVarsSectionLengthOriginal = dHeaderVarsSectionLength;
   88|  7.04k|    FromLSB(dHeaderVarsSectionLength);
   89|  7.04k|    DebugMsg( "Header variables section length: %d\n",
   90|  7.04k|              static_cast<int>(dHeaderVarsSectionLength) );
   91|  7.04k|    if(readSize != dSizeOfSectionSize || dHeaderVarsSectionLength > 65536) //NOTE: maybe header section may be bigger
  ------------------
  |  Branch (91:8): [True: 3, False: 7.04k]
  |  Branch (91:42): [True: 23, False: 7.02k]
  ------------------
   92|     26|    {
   93|     26|        DebugMsg( "File is corrupted (HEADER_VARS section length too big)" );
   94|     26|        return CADErrorCodes::HEADER_SECTION_READ_FAILED;
   95|     26|    }
   96|       |
   97|  7.02k|    CADBuffer buffer(dHeaderVarsSectionLength + dSizeOfSectionSize + 10);
   98|  7.02k|    buffer.WriteRAW(&dHeaderVarsSectionLengthOriginal, dSizeOfSectionSize);
   99|  7.02k|    readSize = pFileIO->Read(buffer.GetRawBuffer(), dHeaderVarsSectionLength + 2 );
  100|  7.02k|    if(readSize != dHeaderVarsSectionLength + 2)
  ------------------
  |  Branch (100:8): [True: 23, False: 6.99k]
  ------------------
  101|     23|    {
  102|     23|        DebugMsg( "Failed to read %d byte of file. Read only %d",
  103|     23|                  static_cast<int>(dHeaderVarsSectionLength + 2),
  104|     23|                  static_cast<int>(readSize) );
  105|     23|        return CADErrorCodes::HEADER_SECTION_READ_FAILED;
  106|     23|    }
  107|       |
  108|  6.99k|    if( eOptions == OpenOptions::READ_ALL )
  ------------------
  |  Branch (108:9): [True: 0, False: 6.99k]
  ------------------
  109|      0|    {
  110|      0|        oHeader.addValue( UNKNOWN1, buffer.ReadBITDOUBLE() );
  ------------------
  |  |   42|      0|#define UNKNOWN1 CADHeader::MAX_HEADER_CONSTANT + 1
  ------------------
  111|      0|        oHeader.addValue( UNKNOWN2, buffer.ReadBITDOUBLE() );
  ------------------
  |  |   43|      0|#define UNKNOWN2 CADHeader::MAX_HEADER_CONSTANT + 2
  ------------------
  112|      0|        oHeader.addValue( UNKNOWN3, buffer.ReadBITDOUBLE() );
  ------------------
  |  |   44|      0|#define UNKNOWN3 CADHeader::MAX_HEADER_CONSTANT + 3
  ------------------
  113|      0|        oHeader.addValue( UNKNOWN4, buffer.ReadBITDOUBLE() );
  ------------------
  |  |   45|      0|#define UNKNOWN4 CADHeader::MAX_HEADER_CONSTANT + 4
  ------------------
  114|      0|        oHeader.addValue( UNKNOWN5, buffer.ReadTV() );
  ------------------
  |  |   46|      0|#define UNKNOWN5 CADHeader::MAX_HEADER_CONSTANT + 5
  ------------------
  115|      0|        oHeader.addValue( UNKNOWN6, buffer.ReadTV() );
  ------------------
  |  |   47|      0|#define UNKNOWN6 CADHeader::MAX_HEADER_CONSTANT + 6
  ------------------
  116|      0|        oHeader.addValue( UNKNOWN7, buffer.ReadTV() );
  ------------------
  |  |   48|      0|#define UNKNOWN7 CADHeader::MAX_HEADER_CONSTANT + 7
  ------------------
  117|      0|        oHeader.addValue( UNKNOWN8, buffer.ReadTV() );
  ------------------
  |  |   49|      0|#define UNKNOWN8 CADHeader::MAX_HEADER_CONSTANT + 8
  ------------------
  118|      0|        oHeader.addValue( UNKNOWN9, buffer.ReadBITLONG() );
  ------------------
  |  |   50|      0|#define UNKNOWN9 CADHeader::MAX_HEADER_CONSTANT + 9
  ------------------
  119|      0|        oHeader.addValue( UNKNOWN10, buffer.ReadBITLONG() );
  ------------------
  |  |   51|      0|#define UNKNOWN10 CADHeader::MAX_HEADER_CONSTANT + 10
  ------------------
  120|      0|    }
  121|  6.99k|    else
  122|  6.99k|    {
  123|  6.99k|        buffer.SkipBITDOUBLE();
  124|  6.99k|        buffer.SkipBITDOUBLE();
  125|  6.99k|        buffer.SkipBITDOUBLE();
  126|  6.99k|        buffer.SkipBITDOUBLE();
  127|  6.99k|        buffer.SkipTV();
  128|  6.99k|        buffer.SkipTV();
  129|  6.99k|        buffer.SkipTV();
  130|  6.99k|        buffer.SkipTV();
  131|  6.99k|        buffer.SkipBITLONG();
  132|  6.99k|        buffer.SkipBITLONG();
  133|  6.99k|    }
  134|       |
  135|  6.99k|    CADHandle stCurrentViewportTable = buffer.ReadHANDLE();
  136|  6.99k|    oTables.AddTable( CADTables::CurrentViewportTable, stCurrentViewportTable );
  137|       |
  138|  6.99k|    if( eOptions == OpenOptions::READ_ALL )
  ------------------
  |  Branch (138:9): [True: 0, False: 6.99k]
  ------------------
  139|      0|    {
  140|      0|        oHeader.addValue( CADHeader::DIMASO, buffer.ReadBIT() );     // 1
  141|      0|        oHeader.addValue( CADHeader::DIMSHO, buffer.ReadBIT() );     // 2
  142|      0|        oHeader.addValue( CADHeader::PLINEGEN, buffer.ReadBIT() );   // 3
  143|      0|        oHeader.addValue( CADHeader::ORTHOMODE, buffer.ReadBIT() );  // 4
  144|      0|        oHeader.addValue( CADHeader::REGENMODE, buffer.ReadBIT() );  // 5
  145|      0|        oHeader.addValue( CADHeader::FILLMODE, buffer.ReadBIT() );   // 6
  146|      0|        oHeader.addValue( CADHeader::QTEXTMODE, buffer.ReadBIT() );  // 7
  147|      0|        oHeader.addValue( CADHeader::PSLTSCALE, buffer.ReadBIT() );  // 8
  148|      0|        oHeader.addValue( CADHeader::LIMCHECK, buffer.ReadBIT() );   // 9
  149|      0|        oHeader.addValue( CADHeader::USRTIMER, buffer.ReadBIT() );   // 10
  150|      0|        oHeader.addValue( CADHeader::SKPOLY, buffer.ReadBIT() );     // 11
  151|      0|        oHeader.addValue( CADHeader::ANGDIR, buffer.ReadBIT() );     // 12
  152|      0|        oHeader.addValue( CADHeader::SPLFRAME, buffer.ReadBIT() );   // 13
  153|      0|        oHeader.addValue( CADHeader::MIRRTEXT, buffer.ReadBIT() );   // 14
  154|      0|        oHeader.addValue( CADHeader::WORDLVIEW, buffer.ReadBIT() );  // 15
  155|      0|        oHeader.addValue( CADHeader::TILEMODE, buffer.ReadBIT() );   // 16
  156|      0|        oHeader.addValue( CADHeader::PLIMCHECK, buffer.ReadBIT() );  // 17
  157|      0|        oHeader.addValue( CADHeader::VISRETAIN, buffer.ReadBIT() );  // 18
  158|      0|        oHeader.addValue( CADHeader::DISPSILH, buffer.ReadBIT() );   // 19
  159|      0|        oHeader.addValue( CADHeader::PELLIPSE, buffer.ReadBIT() );   // 20
  160|      0|    }
  161|  6.99k|    else
  162|  6.99k|    {
  163|  6.99k|        buffer.Seek(20);
  164|  6.99k|    }
  165|       |
  166|  6.99k|    if( eOptions == OpenOptions::READ_ALL )
  ------------------
  |  Branch (166:9): [True: 0, False: 6.99k]
  ------------------
  167|      0|    {
  168|      0|        oHeader.addValue( CADHeader::PROXYGRAPHICS, buffer.ReadBITSHORT() ); // 1
  169|      0|        oHeader.addValue( CADHeader::TREEDEPTH, buffer.ReadBITSHORT() );     // 2
  170|      0|        oHeader.addValue( CADHeader::LUNITS, buffer.ReadBITSHORT() );        // 3
  171|      0|        oHeader.addValue( CADHeader::LUPREC, buffer.ReadBITSHORT() );        // 4
  172|      0|        oHeader.addValue( CADHeader::AUNITS, buffer.ReadBITSHORT() );        // 5
  173|      0|        oHeader.addValue( CADHeader::AUPREC, buffer.ReadBITSHORT() );        // 6
  174|      0|    } else
  175|  6.99k|    {
  176|  48.9k|        for( char i = 0; i < 6; ++i )
  ------------------
  |  Branch (176:26): [True: 41.9k, False: 6.99k]
  ------------------
  177|  41.9k|            buffer.SkipBITSHORT();
  178|  6.99k|    }
  179|       |
  180|  6.99k|    oHeader.addValue( CADHeader::ATTMODE, buffer.ReadBITSHORT() );
  181|  6.99k|    oHeader.addValue( CADHeader::PDMODE, buffer.ReadBITSHORT() );
  182|       |
  183|  6.99k|    if( eOptions == OpenOptions::READ_ALL )
  ------------------
  |  Branch (183:9): [True: 0, False: 6.99k]
  ------------------
  184|      0|    {
  185|      0|        oHeader.addValue( CADHeader::USERI1, buffer.ReadBITSHORT() );    // 1
  186|      0|        oHeader.addValue( CADHeader::USERI2, buffer.ReadBITSHORT() );    // 2
  187|      0|        oHeader.addValue( CADHeader::USERI3, buffer.ReadBITSHORT() );    // 3
  188|      0|        oHeader.addValue( CADHeader::USERI4, buffer.ReadBITSHORT() );    // 4
  189|      0|        oHeader.addValue( CADHeader::USERI5, buffer.ReadBITSHORT() );    // 5
  190|      0|        oHeader.addValue( CADHeader::SPLINESEGS, buffer.ReadBITSHORT() );// 6
  191|      0|        oHeader.addValue( CADHeader::SURFU, buffer.ReadBITSHORT() );     // 7
  192|      0|        oHeader.addValue( CADHeader::SURFV, buffer.ReadBITSHORT() );     // 8
  193|      0|        oHeader.addValue( CADHeader::SURFTYPE, buffer.ReadBITSHORT() );  // 9
  194|      0|        oHeader.addValue( CADHeader::SURFTAB1, buffer.ReadBITSHORT() );  // 10
  195|      0|        oHeader.addValue( CADHeader::SURFTAB2, buffer.ReadBITSHORT() );  // 11
  196|      0|        oHeader.addValue( CADHeader::SPLINETYPE, buffer.ReadBITSHORT() );// 12
  197|      0|        oHeader.addValue( CADHeader::SHADEDGE, buffer.ReadBITSHORT() );  // 13
  198|      0|        oHeader.addValue( CADHeader::SHADEDIF, buffer.ReadBITSHORT() );  // 14
  199|      0|        oHeader.addValue( CADHeader::UNITMODE, buffer.ReadBITSHORT() );  // 15
  200|      0|        oHeader.addValue( CADHeader::MAXACTVP, buffer.ReadBITSHORT() );  // 16
  201|      0|        oHeader.addValue( CADHeader::ISOLINES, buffer.ReadBITSHORT() );  // 17
  202|      0|        oHeader.addValue( CADHeader::CMLJUST, buffer.ReadBITSHORT() );   // 18
  203|      0|        oHeader.addValue( CADHeader::TEXTQLTY, buffer.ReadBITSHORT() );  // 19
  204|      0|    }
  205|  6.99k|    else
  206|  6.99k|    {
  207|   139k|        for( char i = 0; i < 19; ++i )
  ------------------
  |  Branch (207:26): [True: 132k, False: 6.99k]
  ------------------
  208|   132k|            buffer.SkipBITSHORT();
  209|  6.99k|    }
  210|       |
  211|  6.99k|    oHeader.addValue( CADHeader::LTSCALE, buffer.ReadBITDOUBLE() );
  212|  6.99k|    oHeader.addValue( CADHeader::TEXTSIZE, buffer.ReadBITDOUBLE() );
  213|  6.99k|    oHeader.addValue( CADHeader::TRACEWID, buffer.ReadBITDOUBLE() );
  214|  6.99k|    oHeader.addValue( CADHeader::SKETCHINC, buffer.ReadBITDOUBLE() );
  215|  6.99k|    oHeader.addValue( CADHeader::FILLETRAD, buffer.ReadBITDOUBLE() );
  216|  6.99k|    oHeader.addValue( CADHeader::THICKNESS, buffer.ReadBITDOUBLE() );
  217|  6.99k|    oHeader.addValue( CADHeader::ANGBASE, buffer.ReadBITDOUBLE() );
  218|  6.99k|    oHeader.addValue( CADHeader::PDSIZE, buffer.ReadBITDOUBLE() );
  219|  6.99k|    oHeader.addValue( CADHeader::PLINEWID, buffer.ReadBITDOUBLE() );
  220|       |
  221|  6.99k|    if( eOptions == OpenOptions::READ_ALL )
  ------------------
  |  Branch (221:9): [True: 0, False: 6.99k]
  ------------------
  222|      0|    {
  223|      0|        oHeader.addValue( CADHeader::USERR1, buffer.ReadBITDOUBLE() );   // 1
  224|      0|        oHeader.addValue( CADHeader::USERR2, buffer.ReadBITDOUBLE() );   // 2
  225|      0|        oHeader.addValue( CADHeader::USERR3, buffer.ReadBITDOUBLE() );   // 3
  226|      0|        oHeader.addValue( CADHeader::USERR4, buffer.ReadBITDOUBLE() );   // 4
  227|      0|        oHeader.addValue( CADHeader::USERR5, buffer.ReadBITDOUBLE() );   // 5
  228|      0|        oHeader.addValue( CADHeader::CHAMFERA, buffer.ReadBITDOUBLE() ); // 6
  229|      0|        oHeader.addValue( CADHeader::CHAMFERB, buffer.ReadBITDOUBLE() ); // 7
  230|      0|        oHeader.addValue( CADHeader::CHAMFERC, buffer.ReadBITDOUBLE() ); // 8
  231|      0|        oHeader.addValue( CADHeader::CHAMFERD, buffer.ReadBITDOUBLE() ); // 9
  232|      0|        oHeader.addValue( CADHeader::FACETRES, buffer.ReadBITDOUBLE() ); // 10
  233|      0|        oHeader.addValue( CADHeader::CMLSCALE, buffer.ReadBITDOUBLE() ); // 11
  234|      0|        oHeader.addValue( CADHeader::CELTSCALE, buffer.ReadBITDOUBLE() );// 12
  235|       |
  236|      0|        oHeader.addValue( CADHeader::MENU, buffer.ReadTV() );
  237|      0|    } else
  238|  6.99k|    {
  239|  90.9k|        for( char i = 0; i < 12; ++i )
  ------------------
  |  Branch (239:26): [True: 83.9k, False: 6.99k]
  ------------------
  240|  83.9k|            buffer.SkipBITDOUBLE();
  241|  6.99k|        buffer.SkipTV();
  242|  6.99k|    }
  243|       |
  244|  6.99k|    long juliandate, millisec;
  245|  6.99k|    juliandate = buffer.ReadBITLONG();
  246|  6.99k|    millisec   = buffer.ReadBITLONG();
  247|  6.99k|    oHeader.addValue( CADHeader::TDCREATE, juliandate, millisec );
  248|  6.99k|    juliandate = buffer.ReadBITLONG();
  249|  6.99k|    millisec   = buffer.ReadBITLONG();
  250|  6.99k|    oHeader.addValue( CADHeader::TDUPDATE, juliandate, millisec );
  251|  6.99k|    juliandate = buffer.ReadBITLONG();
  252|  6.99k|    millisec   = buffer.ReadBITLONG();
  253|  6.99k|    oHeader.addValue( CADHeader::TDINDWG, juliandate, millisec );
  254|  6.99k|    juliandate = buffer.ReadBITLONG();
  255|  6.99k|    millisec   = buffer.ReadBITLONG();
  256|  6.99k|    oHeader.addValue( CADHeader::TDUSRTIMER, juliandate, millisec );
  257|       |
  258|  6.99k|    oHeader.addValue( CADHeader::CECOLOR, buffer.ReadBITSHORT() );
  259|       |
  260|  6.99k|    oHeader.addValue( CADHeader::HANDSEED, buffer.ReadHANDLE() );
  261|       |
  262|  6.99k|    oHeader.addValue( CADHeader::CLAYER, buffer.ReadHANDLE() );
  263|  6.99k|    oHeader.addValue( CADHeader::TEXTSTYLE, buffer.ReadHANDLE() );
  264|  6.99k|    oHeader.addValue( CADHeader::CELTYPE, buffer.ReadHANDLE() );
  265|  6.99k|    oHeader.addValue( CADHeader::DIMSTYLE, buffer.ReadHANDLE() );
  266|  6.99k|    oHeader.addValue( CADHeader::CMLSTYLE, buffer.ReadHANDLE() );
  267|       |
  268|  6.99k|    oHeader.addValue( CADHeader::PSVPSCALE, buffer.ReadBITDOUBLE() );
  269|  6.99k|    double dX, dY, dZ;
  270|  6.99k|    dX = buffer.ReadBITDOUBLE();
  271|  6.99k|    dY = buffer.ReadBITDOUBLE();
  272|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  273|  6.99k|    oHeader.addValue( CADHeader::PINSBASE, dX, dY, dZ );
  274|       |
  275|  6.99k|    dX = buffer.ReadBITDOUBLE();
  276|  6.99k|    dY = buffer.ReadBITDOUBLE();
  277|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  278|  6.99k|    oHeader.addValue( CADHeader::PEXTMIN, dX, dY, dZ );
  279|  6.99k|    dX = buffer.ReadBITDOUBLE();
  280|  6.99k|    dY = buffer.ReadBITDOUBLE();
  281|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  282|  6.99k|    oHeader.addValue( CADHeader::PEXTMAX, dX, dY, dZ );
  283|  6.99k|    dX = buffer.ReadRAWDOUBLE();
  284|  6.99k|    dY = buffer.ReadRAWDOUBLE();
  285|  6.99k|    oHeader.addValue( CADHeader::PLIMMIN, dX, dY );
  286|  6.99k|    dX = buffer.ReadRAWDOUBLE();
  287|  6.99k|    dY = buffer.ReadRAWDOUBLE();
  288|  6.99k|    oHeader.addValue( CADHeader::PLIMMAX, dX, dY );
  289|       |
  290|  6.99k|    oHeader.addValue( CADHeader::PELEVATION, buffer.ReadBITDOUBLE() );
  291|       |
  292|  6.99k|    dX = buffer.ReadBITDOUBLE();
  293|  6.99k|    dY = buffer.ReadBITDOUBLE();
  294|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  295|  6.99k|    oHeader.addValue( CADHeader::PUCSORG, dX, dY, dZ );
  296|  6.99k|    dX = buffer.ReadBITDOUBLE();
  297|  6.99k|    dY = buffer.ReadBITDOUBLE();
  298|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  299|  6.99k|    oHeader.addValue( CADHeader::PUCSXDIR, dX, dY, dZ );
  300|  6.99k|    dX = buffer.ReadBITDOUBLE();
  301|  6.99k|    dY = buffer.ReadBITDOUBLE();
  302|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  303|  6.99k|    oHeader.addValue( CADHeader::PUCSYDIR, dX, dY, dZ );
  304|       |
  305|  6.99k|    oHeader.addValue( CADHeader::PUCSNAME, buffer.ReadHANDLE() );
  306|  6.99k|    oHeader.addValue( CADHeader::PUCSORTHOREF, buffer.ReadHANDLE() );
  307|       |
  308|  6.99k|    oHeader.addValue( CADHeader::PUCSORTHOVIEW, buffer.ReadBITSHORT() );
  309|  6.99k|    oHeader.addValue( CADHeader::PUCSBASE, buffer.ReadHANDLE() );
  310|       |
  311|  6.99k|    dX = buffer.ReadBITDOUBLE();
  312|  6.99k|    dY = buffer.ReadBITDOUBLE();
  313|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  314|  6.99k|    oHeader.addValue( CADHeader::PUCSORGTOP, dX, dY, dZ );
  315|  6.99k|    dX = buffer.ReadBITDOUBLE();
  316|  6.99k|    dY = buffer.ReadBITDOUBLE();
  317|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  318|  6.99k|    oHeader.addValue( CADHeader::PUCSORGBOTTOM, dX, dY, dZ );
  319|  6.99k|    dX = buffer.ReadBITDOUBLE();
  320|  6.99k|    dY = buffer.ReadBITDOUBLE();
  321|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  322|  6.99k|    oHeader.addValue( CADHeader::PUCSORGLEFT, dX, dY, dZ );
  323|  6.99k|    dX = buffer.ReadBITDOUBLE();
  324|  6.99k|    dY = buffer.ReadBITDOUBLE();
  325|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  326|  6.99k|    oHeader.addValue( CADHeader::PUCSORGRIGHT, dX, dY, dZ );
  327|  6.99k|    dX = buffer.ReadBITDOUBLE();
  328|  6.99k|    dY = buffer.ReadBITDOUBLE();
  329|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  330|  6.99k|    oHeader.addValue( CADHeader::PUCSORGFRONT, dX, dY, dZ );
  331|  6.99k|    dX = buffer.ReadBITDOUBLE();
  332|  6.99k|    dY = buffer.ReadBITDOUBLE();
  333|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  334|  6.99k|    oHeader.addValue( CADHeader::PUCSORGBACK, dX, dY, dZ );
  335|       |
  336|  6.99k|    dX = buffer.ReadBITDOUBLE();
  337|  6.99k|    dY = buffer.ReadBITDOUBLE();
  338|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  339|  6.99k|    oHeader.addValue( CADHeader::INSBASE, dX, dY, dZ );
  340|  6.99k|    dX = buffer.ReadBITDOUBLE();
  341|  6.99k|    dY = buffer.ReadBITDOUBLE();
  342|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  343|  6.99k|    oHeader.addValue( CADHeader::EXTMIN, dX, dY, dZ );
  344|  6.99k|    dX = buffer.ReadBITDOUBLE();
  345|  6.99k|    dY = buffer.ReadBITDOUBLE();
  346|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  347|  6.99k|    oHeader.addValue( CADHeader::EXTMAX, dX, dY, dZ );
  348|  6.99k|    dX = buffer.ReadRAWDOUBLE();
  349|  6.99k|    dY = buffer.ReadRAWDOUBLE();
  350|  6.99k|    oHeader.addValue( CADHeader::LIMMIN, dX, dY );
  351|  6.99k|    dX = buffer.ReadRAWDOUBLE();
  352|  6.99k|    dY = buffer.ReadRAWDOUBLE();
  353|  6.99k|    oHeader.addValue( CADHeader::LIMMAX, dX, dY );
  354|       |
  355|  6.99k|    oHeader.addValue( CADHeader::ELEVATION, buffer.ReadBITDOUBLE() );
  356|  6.99k|    dX = buffer.ReadBITDOUBLE();
  357|  6.99k|    dY = buffer.ReadBITDOUBLE();
  358|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  359|  6.99k|    oHeader.addValue( CADHeader::UCSORG, dX, dY, dZ );
  360|  6.99k|    dX = buffer.ReadBITDOUBLE();
  361|  6.99k|    dY = buffer.ReadBITDOUBLE();
  362|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  363|  6.99k|    oHeader.addValue( CADHeader::UCSXDIR, dX, dY, dZ );
  364|  6.99k|    dX = buffer.ReadBITDOUBLE();
  365|  6.99k|    dY = buffer.ReadBITDOUBLE();
  366|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  367|  6.99k|    oHeader.addValue( CADHeader::UCSYDIR, dX, dY, dZ );
  368|       |
  369|  6.99k|    oHeader.addValue( CADHeader::UCSNAME, buffer.ReadHANDLE() );
  370|  6.99k|    oHeader.addValue( CADHeader::UCSORTHOREF, buffer.ReadHANDLE() );
  371|       |
  372|  6.99k|    oHeader.addValue( CADHeader::UCSORTHOVIEW, buffer.ReadBITSHORT() );
  373|       |
  374|  6.99k|    oHeader.addValue( CADHeader::UCSBASE, buffer.ReadHANDLE() );
  375|       |
  376|  6.99k|    dX = buffer.ReadBITDOUBLE();
  377|  6.99k|    dY = buffer.ReadBITDOUBLE();
  378|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  379|  6.99k|    oHeader.addValue( CADHeader::UCSORGTOP, dX, dY, dZ );
  380|  6.99k|    dX = buffer.ReadBITDOUBLE();
  381|  6.99k|    dY = buffer.ReadBITDOUBLE();
  382|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  383|  6.99k|    oHeader.addValue( CADHeader::UCSORGBOTTOM, dX, dY, dZ );
  384|  6.99k|    dX = buffer.ReadBITDOUBLE();
  385|  6.99k|    dY = buffer.ReadBITDOUBLE();
  386|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  387|  6.99k|    oHeader.addValue( CADHeader::UCSORGLEFT, dX, dY, dZ );
  388|  6.99k|    dX = buffer.ReadBITDOUBLE();
  389|  6.99k|    dY = buffer.ReadBITDOUBLE();
  390|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  391|  6.99k|    oHeader.addValue( CADHeader::UCSORGRIGHT, dX, dY, dZ );
  392|  6.99k|    dX = buffer.ReadBITDOUBLE();
  393|  6.99k|    dY = buffer.ReadBITDOUBLE();
  394|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  395|  6.99k|    oHeader.addValue( CADHeader::UCSORGFRONT, dX, dY, dZ );
  396|  6.99k|    dX = buffer.ReadBITDOUBLE();
  397|  6.99k|    dY = buffer.ReadBITDOUBLE();
  398|  6.99k|    dZ = buffer.ReadBITDOUBLE();
  399|  6.99k|    oHeader.addValue( CADHeader::UCSORGBACK, dX, dY, dZ );
  400|       |
  401|  6.99k|    if( eOptions == OpenOptions::READ_ALL )
  ------------------
  |  Branch (401:9): [True: 0, False: 6.99k]
  ------------------
  402|      0|    {
  403|      0|        oHeader.addValue( CADHeader::DIMPOST, buffer.ReadTV() );
  404|      0|        oHeader.addValue( CADHeader::DIMAPOST, buffer.ReadTV() );
  405|       |
  406|      0|        oHeader.addValue( CADHeader::DIMSCALE, buffer.ReadBITDOUBLE() ); // 1
  407|      0|        oHeader.addValue( CADHeader::DIMASZ, buffer.ReadBITDOUBLE() );   // 2
  408|      0|        oHeader.addValue( CADHeader::DIMEXO, buffer.ReadBITDOUBLE() );   // 3
  409|      0|        oHeader.addValue( CADHeader::DIMDLI, buffer.ReadBITDOUBLE() );   // 4
  410|      0|        oHeader.addValue( CADHeader::DIMEXE, buffer.ReadBITDOUBLE() );   // 5
  411|      0|        oHeader.addValue( CADHeader::DIMRND, buffer.ReadBITDOUBLE() );   // 6
  412|      0|        oHeader.addValue( CADHeader::DIMDLE, buffer.ReadBITDOUBLE() );   // 7
  413|      0|        oHeader.addValue( CADHeader::DIMTP, buffer.ReadBITDOUBLE() );    // 8
  414|      0|        oHeader.addValue( CADHeader::DIMTM, buffer.ReadBITDOUBLE() );    // 9
  415|       |
  416|      0|        oHeader.addValue( CADHeader::DIMTOL, buffer.ReadBIT() );
  417|      0|        oHeader.addValue( CADHeader::DIMLIM, buffer.ReadBIT() );
  418|      0|        oHeader.addValue( CADHeader::DIMTIH, buffer.ReadBIT() );
  419|      0|        oHeader.addValue( CADHeader::DIMTOH, buffer.ReadBIT() );
  420|      0|        oHeader.addValue( CADHeader::DIMSE1, buffer.ReadBIT() );
  421|      0|        oHeader.addValue( CADHeader::DIMSE2, buffer.ReadBIT() );
  422|       |
  423|      0|        oHeader.addValue( CADHeader::DIMTAD, buffer.ReadBITSHORT() );
  424|      0|        oHeader.addValue( CADHeader::DIMZIN, buffer.ReadBITSHORT() );
  425|      0|        oHeader.addValue( CADHeader::DIMAZIN, buffer.ReadBITSHORT() );
  426|       |
  427|      0|        oHeader.addValue( CADHeader::DIMTXT, buffer.ReadBITDOUBLE() );   // 1
  428|      0|        oHeader.addValue( CADHeader::DIMCEN, buffer.ReadBITDOUBLE() );   // 2
  429|      0|        oHeader.addValue( CADHeader::DIMTSZ, buffer.ReadBITDOUBLE() );   // 3
  430|      0|        oHeader.addValue( CADHeader::DIMALTF, buffer.ReadBITDOUBLE() );  // 4
  431|      0|        oHeader.addValue( CADHeader::DIMLFAC, buffer.ReadBITDOUBLE() );  // 5
  432|      0|        oHeader.addValue( CADHeader::DIMTVP, buffer.ReadBITDOUBLE() );   // 6
  433|      0|        oHeader.addValue( CADHeader::DIMTFAC, buffer.ReadBITDOUBLE() );  // 7
  434|      0|        oHeader.addValue( CADHeader::DIMGAP, buffer.ReadBITDOUBLE() );   // 8
  435|      0|        oHeader.addValue( CADHeader::DIMALTRND, buffer.ReadBITDOUBLE() );// 9
  436|       |
  437|      0|        oHeader.addValue( CADHeader::DIMALT, buffer.ReadBIT() );
  438|       |
  439|      0|        oHeader.addValue( CADHeader::DIMALTD, buffer.ReadBITSHORT() );
  440|       |
  441|      0|        oHeader.addValue( CADHeader::DIMTOFL, buffer.ReadBIT() );
  442|      0|        oHeader.addValue( CADHeader::DIMSAH, buffer.ReadBIT() );
  443|      0|        oHeader.addValue( CADHeader::DIMTIX, buffer.ReadBIT() );
  444|      0|        oHeader.addValue( CADHeader::DIMSOXD, buffer.ReadBIT() );
  445|       |
  446|      0|        oHeader.addValue( CADHeader::DIMCLRD, buffer.ReadBITSHORT() );   // 1
  447|      0|        oHeader.addValue( CADHeader::DIMCLRE, buffer.ReadBITSHORT() );   // 2
  448|      0|        oHeader.addValue( CADHeader::DIMCLRT, buffer.ReadBITSHORT() );   // 3
  449|      0|        oHeader.addValue( CADHeader::DIMADEC, buffer.ReadBITSHORT() );   // 4
  450|      0|        oHeader.addValue( CADHeader::DIMDEC, buffer.ReadBITSHORT() );    // 5
  451|      0|        oHeader.addValue( CADHeader::DIMTDEC, buffer.ReadBITSHORT() );   // 6
  452|      0|        oHeader.addValue( CADHeader::DIMALTU, buffer.ReadBITSHORT() );   // 7
  453|      0|        oHeader.addValue( CADHeader::DIMALTTD, buffer.ReadBITSHORT() );  // 8
  454|      0|        oHeader.addValue( CADHeader::DIMAUNIT, buffer.ReadBITSHORT() );  // 9
  455|      0|        oHeader.addValue( CADHeader::DIMFRAC, buffer.ReadBITSHORT() );   // 10
  456|      0|        oHeader.addValue( CADHeader::DIMLUNIT, buffer.ReadBITSHORT() );  // 11
  457|      0|        oHeader.addValue( CADHeader::DIMDSEP, buffer.ReadBITSHORT() );   // 12
  458|      0|        oHeader.addValue( CADHeader::DIMTMOVE, buffer.ReadBITSHORT() );  // 13
  459|      0|        oHeader.addValue( CADHeader::DIMJUST, buffer.ReadBITSHORT() );   // 14
  460|       |
  461|      0|        oHeader.addValue( CADHeader::DIMSD1, buffer.ReadBIT() );
  462|      0|        oHeader.addValue( CADHeader::DIMSD2, buffer.ReadBIT() );
  463|       |
  464|      0|        oHeader.addValue( CADHeader::DIMTOLJ, buffer.ReadBITSHORT() );
  465|      0|        oHeader.addValue( CADHeader::DIMTZIN, buffer.ReadBITSHORT() );
  466|      0|        oHeader.addValue( CADHeader::DIMALTZ, buffer.ReadBITSHORT() );
  467|      0|        oHeader.addValue( CADHeader::DIMALTTZ, buffer.ReadBITSHORT() );
  468|       |
  469|      0|        oHeader.addValue( CADHeader::DIMUPT, buffer.ReadBIT() );
  470|       |
  471|      0|        oHeader.addValue( CADHeader::DIMATFIT, buffer.ReadBITSHORT() );
  472|       |
  473|      0|        oHeader.addValue( CADHeader::DIMTXSTY, buffer.ReadHANDLE() );
  474|      0|        oHeader.addValue( CADHeader::DIMLDRBLK, buffer.ReadHANDLE() );
  475|      0|        oHeader.addValue( CADHeader::DIMBLK, buffer.ReadHANDLE() );
  476|      0|        oHeader.addValue( CADHeader::DIMBLK1, buffer.ReadHANDLE() );
  477|      0|        oHeader.addValue( CADHeader::DIMBLK2, buffer.ReadHANDLE() );
  478|       |
  479|      0|        oHeader.addValue( CADHeader::DIMLWD, buffer.ReadBITSHORT() );
  480|      0|        oHeader.addValue( CADHeader::DIMLWE, buffer.ReadBITSHORT() );
  481|      0|    } else
  482|  6.99k|    {
  483|  6.99k|        buffer.SkipTV();
  484|  6.99k|        buffer.SkipTV();
  485|       |
  486|  69.9k|        for( char i = 0; i < 9; ++i )
  ------------------
  |  Branch (486:26): [True: 62.9k, False: 6.99k]
  ------------------
  487|  62.9k|            buffer.SkipBITDOUBLE();
  488|       |
  489|  6.99k|        buffer.Seek(6);
  490|       |
  491|  27.9k|        for( char i = 0; i < 3; ++i )
  ------------------
  |  Branch (491:26): [True: 20.9k, False: 6.99k]
  ------------------
  492|  20.9k|            buffer.SkipBITSHORT();
  493|       |
  494|  69.9k|        for( char i = 0; i < 9; ++i )
  ------------------
  |  Branch (494:26): [True: 62.9k, False: 6.99k]
  ------------------
  495|  62.9k|            buffer.SkipBITDOUBLE();
  496|       |
  497|  6.99k|        buffer.Seek(1);
  498|       |
  499|  6.99k|        buffer.SkipBITSHORT();
  500|       |
  501|  6.99k|        buffer.Seek(4);
  502|       |
  503|   104k|        for( char i = 0; i < 14; ++i )
  ------------------
  |  Branch (503:26): [True: 97.9k, False: 6.99k]
  ------------------
  504|  97.9k|            buffer.SkipBITSHORT();
  505|       |
  506|  6.99k|        buffer.Seek(2);
  507|       |
  508|  34.9k|        for( char i = 0; i < 4; ++i )
  ------------------
  |  Branch (508:26): [True: 27.9k, False: 6.99k]
  ------------------
  509|  27.9k|            buffer.SkipBITSHORT();
  510|       |
  511|  6.99k|        buffer.Seek(1);
  512|  6.99k|        buffer.SkipBITSHORT();
  513|       |
  514|  41.9k|        for( char i = 0; i < 5; ++i )
  ------------------
  |  Branch (514:26): [True: 34.9k, False: 6.99k]
  ------------------
  515|  34.9k|            buffer.SkipHANDLE();
  516|       |
  517|  6.99k|        buffer.SkipBITSHORT();
  518|  6.99k|        buffer.SkipBITSHORT();
  519|  6.99k|    }
  520|       |
  521|  6.99k|    CADHandle stBlocksTable = buffer.ReadHANDLE();
  522|  6.99k|    oTables.AddTable( CADTables::BlocksTable, stBlocksTable );
  523|       |
  524|  6.99k|    CADHandle stLayersTable = buffer.ReadHANDLE();
  525|  6.99k|    oTables.AddTable( CADTables::LayersTable, stLayersTable );
  526|       |
  527|  6.99k|    CADHandle stStyleTable = buffer.ReadHANDLE();
  528|  6.99k|    oTables.AddTable( CADTables::StyleTable, stStyleTable );
  529|       |
  530|  6.99k|    CADHandle stLineTypesTable = buffer.ReadHANDLE();
  531|  6.99k|    oTables.AddTable( CADTables::LineTypesTable, stLineTypesTable );
  532|       |
  533|  6.99k|    CADHandle stViewTable = buffer.ReadHANDLE();
  534|  6.99k|    oTables.AddTable( CADTables::ViewTable, stViewTable );
  535|       |
  536|  6.99k|    CADHandle stUCSTable = buffer.ReadHANDLE();
  537|  6.99k|    oTables.AddTable( CADTables::UCSTable, stUCSTable );
  538|       |
  539|  6.99k|    CADHandle stViewportTable = buffer.ReadHANDLE();
  540|  6.99k|    oTables.AddTable( CADTables::ViewportTable, stViewportTable );
  541|       |
  542|  6.99k|    CADHandle stAPPIDTable = buffer.ReadHANDLE();
  543|  6.99k|    oTables.AddTable( CADTables::APPIDTable, stAPPIDTable );
  544|       |
  545|  6.99k|    if( eOptions == OpenOptions::READ_ALL )
  ------------------
  |  Branch (545:9): [True: 0, False: 6.99k]
  ------------------
  546|      0|    {
  547|      0|        oHeader.addValue( CADHeader::DIMSTYLE, buffer.ReadHANDLE() );
  548|      0|    }
  549|  6.99k|    else
  550|  6.99k|    {
  551|  6.99k|        buffer.SkipHANDLE();
  552|  6.99k|    }
  553|       |
  554|  6.99k|    CADHandle stEntityTable = buffer.ReadHANDLE();
  555|  6.99k|    oTables.AddTable( CADTables::EntityTable, stEntityTable );
  556|       |
  557|  6.99k|    CADHandle stACADGroupDict = buffer.ReadHANDLE();
  558|  6.99k|    oTables.AddTable( CADTables::ACADGroupDict, stACADGroupDict );
  559|       |
  560|  6.99k|    CADHandle stACADMLineStyleDict = buffer.ReadHANDLE();
  561|  6.99k|    oTables.AddTable( CADTables::ACADMLineStyleDict, stACADMLineStyleDict );
  562|       |
  563|  6.99k|    CADHandle stNamedObjectsDict = buffer.ReadHANDLE();
  564|  6.99k|    oTables.AddTable( CADTables::NamedObjectsDict, stNamedObjectsDict );
  565|       |
  566|  6.99k|    if( eOptions == OpenOptions::READ_ALL )
  ------------------
  |  Branch (566:9): [True: 0, False: 6.99k]
  ------------------
  567|      0|    {
  568|      0|        oHeader.addValue( CADHeader::TSTACKALIGN, buffer.ReadBITSHORT() );
  569|      0|        oHeader.addValue( CADHeader::TSTACKSIZE,  buffer.ReadBITSHORT() );
  570|      0|    } else
  571|  6.99k|    {
  572|  6.99k|        buffer.SkipBITSHORT();
  573|  6.99k|        buffer.SkipBITSHORT();
  574|  6.99k|    }
  575|       |
  576|  6.99k|    oHeader.addValue( CADHeader::HYPERLINKBASE, buffer.ReadTV() );
  577|  6.99k|    oHeader.addValue( CADHeader::STYLESHEET, buffer.ReadTV() );
  578|       |
  579|  6.99k|    CADHandle stLayoutsDict = buffer.ReadHANDLE();
  580|  6.99k|    oTables.AddTable( CADTables::LayoutsDict, stLayoutsDict );
  581|       |
  582|  6.99k|    CADHandle stPlotSettingsDict = buffer.ReadHANDLE();
  583|  6.99k|    oTables.AddTable( CADTables::PlotSettingsDict, stPlotSettingsDict );
  584|       |
  585|  6.99k|    CADHandle stPlotStylesDict = buffer.ReadHANDLE();
  586|  6.99k|    oTables.AddTable( CADTables::PlotStylesDict, stPlotStylesDict );
  587|       |
  588|  6.99k|    if( eOptions == OpenOptions::READ_ALL )
  ------------------
  |  Branch (588:9): [True: 0, False: 6.99k]
  ------------------
  589|      0|    {
  590|      0|        int Flags = buffer.ReadBITLONG();
  591|      0|        oHeader.addValue( CADHeader::CELWEIGHT, Flags & 0x001F );
  592|      0|        oHeader.addValue( CADHeader::ENDCAPS, ( Flags & 0x0060 ) != 0 );
  593|      0|        oHeader.addValue( CADHeader::JOINSTYLE, (Flags & 0x0180) != 0);
  594|      0|        oHeader.addValue( CADHeader::LWDISPLAY, ( Flags & 0x0200 ) == 0);
  595|      0|        oHeader.addValue( CADHeader::XEDIT, ( Flags & 0x0400 ) == 0);
  596|      0|        oHeader.addValue( CADHeader::EXTNAMES, ( Flags & 0x0800 ) != 0 );
  597|      0|        oHeader.addValue( CADHeader::PSTYLEMODE, ( Flags & 0x2000 ) != 0 );
  598|      0|        oHeader.addValue( CADHeader::OLESTARTUP, ( Flags & 0x4000 ) != 0);
  599|      0|    }
  600|  6.99k|    else
  601|  6.99k|    {
  602|  6.99k|        buffer.SkipBITLONG();
  603|  6.99k|    }
  604|       |
  605|  6.99k|    oHeader.addValue( CADHeader::INSUNITS, buffer.ReadBITSHORT() );
  606|  6.99k|    short nCEPSNTYPE = buffer.ReadBITSHORT();
  607|  6.99k|    oHeader.addValue( CADHeader::CEPSNTYPE, nCEPSNTYPE );
  608|       |
  609|  6.99k|    if( nCEPSNTYPE == 3 )
  ------------------
  |  Branch (609:9): [True: 3, False: 6.99k]
  ------------------
  610|      3|        oHeader.addValue( CADHeader::CEPSNID, buffer.ReadHANDLE() );
  611|       |
  612|  6.99k|    oHeader.addValue( CADHeader::FINGERPRINTGUID, buffer.ReadTV() );
  613|  6.99k|    oHeader.addValue( CADHeader::VERSIONGUID, buffer.ReadTV() );
  614|       |
  615|  6.99k|    CADHandle stBlockRecordPaperSpace = buffer.ReadHANDLE();
  616|  6.99k|    oTables.AddTable( CADTables::BlockRecordPaperSpace, stBlockRecordPaperSpace );
  617|       |    // TODO: is this part of the header?
  618|  6.99k|    CADHandle stBlockRecordModelSpace = buffer.ReadHANDLE();
  619|  6.99k|    oTables.AddTable( CADTables::BlockRecordModelSpace, stBlockRecordModelSpace );
  620|       |
  621|  6.99k|    if( eOptions == OpenOptions::READ_ALL )
  ------------------
  |  Branch (621:9): [True: 0, False: 6.99k]
  ------------------
  622|      0|    {
  623|       |        // Is this part of the header?
  624|       |
  625|      0|        /*CADHandle LTYPE_BYLAYER = */buffer.ReadHANDLE();
  626|      0|        /*CADHandle LTYPE_BYBLOCK = */buffer.ReadHANDLE();
  627|      0|        /*CADHandle LTYPE_CONTINUOUS = */buffer.ReadHANDLE();
  628|       |
  629|      0|        oHeader.addValue( UNKNOWN11, buffer.ReadBITSHORT() );
  ------------------
  |  |   52|      0|#define UNKNOWN11 CADHeader::MAX_HEADER_CONSTANT + 11
  ------------------
  630|      0|        oHeader.addValue( UNKNOWN12, buffer.ReadBITSHORT() );
  ------------------
  |  |   53|      0|#define UNKNOWN12 CADHeader::MAX_HEADER_CONSTANT + 12
  ------------------
  631|      0|        oHeader.addValue( UNKNOWN13, buffer.ReadBITSHORT() );
  ------------------
  |  |   54|      0|#define UNKNOWN13 CADHeader::MAX_HEADER_CONSTANT + 13
  ------------------
  632|      0|        oHeader.addValue( UNKNOWN14, buffer.ReadBITSHORT() );
  ------------------
  |  |   55|      0|#define UNKNOWN14 CADHeader::MAX_HEADER_CONSTANT + 14
  ------------------
  633|      0|    } else
  634|  6.99k|    {
  635|  6.99k|        buffer.SkipHANDLE();
  636|  6.99k|        buffer.SkipHANDLE();
  637|  6.99k|        buffer.SkipHANDLE();
  638|  6.99k|        buffer.SkipBITSHORT();
  639|  6.99k|        buffer.SkipBITSHORT();
  640|  6.99k|        buffer.SkipBITSHORT();
  641|  6.99k|        buffer.SkipBITSHORT();
  642|  6.99k|    }
  643|       |
  644|  6.99k|    int returnCode = CADErrorCodes::SUCCESS;
  645|  6.99k|    unsigned short dSectionCRC = validateEntityCRC( buffer,
  646|  6.99k|        static_cast<unsigned int>(dHeaderVarsSectionLength + dSizeOfSectionSize), "HEADERVARS" );
  647|  6.99k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  648|  6.99k|    (void)dSectionCRC;
  649|       |#else
  650|       |    if(dSectionCRC == 0)
  651|       |    {
  652|       |        std::cerr << "File is corrupted (HEADERVARS section CRC doesn't match.)\n";
  653|       |        return CADErrorCodes::HEADER_SECTION_READ_FAILED;
  654|       |    }
  655|       |#endif
  656|  6.99k|    pFileIO->Read( bufferPre, DWGConstants::SentinelLength );
  657|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  658|       |    if( memcmp( bufferPre, DWGConstants::HeaderVariablesEnd,
  659|       |                         DWGConstants::SentinelLength ) )
  660|       |    {
  661|       |        std::cerr << "File is corrupted (HEADERVARS section ending sentinel "
  662|       |                          "doesn't match.)\n";
  663|       |        returnCode = CADErrorCodes::HEADER_SECTION_READ_FAILED;
  664|       |    }
  665|       |#endif
  666|  6.99k|    return returnCode;
  667|  7.02k|}
_ZN12DWGFileR200011ReadClassesEN7CADFile11OpenOptionsE:
  670|  6.99k|{
  671|  6.99k|    if( eOptions == OpenOptions::READ_ALL || eOptions == OpenOptions::READ_FAST )
  ------------------
  |  Branch (671:9): [True: 0, False: 6.99k]
  |  Branch (671:46): [True: 6.99k, False: 0]
  ------------------
  672|  6.99k|    {
  673|  6.99k|        char   bufferPre[255];
  674|  6.99k|        unsigned dSectionSize = 0;
  675|  6.99k|        constexpr size_t dSizeOfSectionSize = sizeof(dSectionSize);
  676|       |
  677|  6.99k|        pFileIO->Seek( sectionLocatorRecords[1].dSeeker, CADFileIO::SeekOrigin::BEG );
  678|       |
  679|  6.99k|        pFileIO->Read( bufferPre, DWGConstants::SentinelLength );
  680|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  681|       |        if( memcmp( bufferPre, DWGConstants::DSClassesStart,
  682|       |                               DWGConstants::SentinelLength ) )
  683|       |        {
  684|       |            std::cerr << "File is corrupted (wrong pointer to CLASSES section,"
  685|       |                    "or CLASSES starting sentinel corrupted.)\n";
  686|       |
  687|       |            return CADErrorCodes::CLASSES_SECTION_READ_FAILED;
  688|       |        }
  689|       |#endif
  690|       |
  691|  6.99k|        pFileIO->Read( &dSectionSize, dSizeOfSectionSize );
  692|  6.99k|        const auto dSectionSizeOriginal = dSectionSize;
  693|  6.99k|        FromLSB(dSectionSize);
  694|  6.99k|        DebugMsg("Classes section length: %d\n",
  695|  6.99k|                  static_cast<int>(dSectionSize) );
  696|  6.99k|        if(dSectionSize > 65535) {
  ------------------
  |  Branch (696:12): [True: 24, False: 6.97k]
  ------------------
  697|     24|            DebugMsg("File is corrupted (CLASSES section is too large: %d\n",
  698|     24|                     static_cast<int>(dSectionSize));
  699|       |
  700|     24|            return CADErrorCodes::CLASSES_SECTION_READ_FAILED;
  701|     24|        }
  702|       |
  703|  6.97k|        CADBuffer buffer(dSectionSize + dSizeOfSectionSize + 10);
  704|  6.97k|        buffer.WriteRAW(&dSectionSizeOriginal, dSizeOfSectionSize);
  705|  6.97k|        size_t readSize = pFileIO->Read( buffer.GetRawBuffer(), dSectionSize + 2 );
  706|  6.97k|        if(readSize != dSectionSize + 2)
  ------------------
  |  Branch (706:12): [True: 200, False: 6.77k]
  ------------------
  707|    200|        {
  708|    200|            DebugMsg( "Failed to read %d byte of file. Read only %d",
  709|    200|                      static_cast<int>(dSectionSize + 2),
  710|    200|                      static_cast<int>(readSize) );
  711|    200|            return CADErrorCodes::CLASSES_SECTION_READ_FAILED;
  712|    200|        }
  713|       |
  714|  6.77k|        const size_t dSectionBitSize = (dSectionSize + dSizeOfSectionSize) * 8;
  715|  16.5k|        while( buffer.PositionBit() < dSectionBitSize - 8)
  ------------------
  |  Branch (715:16): [True: 9.82k, False: 6.77k]
  ------------------
  716|  9.82k|        {
  717|  9.82k|            CADClass stClass;
  718|  9.82k|            stClass.dClassNum        = buffer.ReadBITSHORT();
  719|  9.82k|            stClass.dProxyCapFlag    = buffer.ReadBITSHORT();
  720|  9.82k|            stClass.sApplicationName = buffer.ReadTV();
  721|  9.82k|            stClass.sCppClassName    = buffer.ReadTV();
  722|  9.82k|            stClass.sDXFRecordName   = buffer.ReadTV();
  723|  9.82k|            stClass.bWasZombie       = buffer.ReadBIT();
  724|  9.82k|            stClass.bIsEntity        = buffer.ReadBITSHORT() == 0x1F2;
  725|       |
  726|  9.82k|            oClasses.addClass( std::move(stClass) );
  727|  9.82k|        }
  728|       |
  729|  6.77k|        buffer.Seek(dSectionBitSize, CADBuffer::BEG);
  730|  6.77k|        unsigned short dSectionCRC = validateEntityCRC( buffer,
  731|  6.77k|                    static_cast<unsigned int>(dSectionSize + dSizeOfSectionSize),
  732|  6.77k|                                                        "CLASSES" );
  733|  6.77k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  734|  6.77k|        (void)dSectionCRC;
  735|       |#else
  736|       |        if(dSectionCRC == 0)
  737|       |        {
  738|       |            std::cerr << "File is corrupted (CLASSES section CRC doesn't match.)\n";
  739|       |            return CADErrorCodes::CLASSES_SECTION_READ_FAILED;
  740|       |        }
  741|       |#endif
  742|       |
  743|  6.77k|        pFileIO->Read( bufferPre, DWGConstants::SentinelLength );
  744|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  745|       |        if( memcmp( bufferPre, DWGConstants::DSClassesEnd,
  746|       |                               DWGConstants::SentinelLength ) )
  747|       |        {
  748|       |            std::cerr << "File is corrupted (CLASSES section ending sentinel "
  749|       |                    "doesn't match.)\n";
  750|       |            return CADErrorCodes::CLASSES_SECTION_READ_FAILED;
  751|       |        }
  752|       |#endif
  753|  6.77k|    }
  754|  6.77k|    return CADErrorCodes::SUCCESS;
  755|  6.99k|}
_ZN12DWGFileR200013CreateFileMapEv:
  758|  6.77k|{
  759|  6.77k|    size_t nSection = 0;
  760|       |
  761|  6.77k|    typedef pair<long, long> ObjHandleOffset;
  762|  6.77k|    ObjHandleOffset          previousObjHandleOffset;
  763|  6.77k|    ObjHandleOffset          tmpOffset;
  764|       |
  765|  6.77k|    mapObjects.clear();
  766|       |
  767|       |    // Seek to the beginning of the objects map
  768|  6.77k|    pFileIO->Seek( sectionLocatorRecords[2].dSeeker, CADFileIO::SeekOrigin::BEG );
  769|       |
  770|  14.4k|    while( true )
  ------------------
  |  Branch (770:12): [Folded - Ignored]
  ------------------
  771|  14.4k|    {
  772|  14.4k|        unsigned short dSectionSize = 0;
  773|  14.4k|        constexpr size_t dSizeOfSectionSize = sizeof(dSectionSize);
  774|       |
  775|       |        // Read section size
  776|       |
  777|  14.4k|        pFileIO->Read( &dSectionSize, dSizeOfSectionSize );
  778|  14.4k|        const unsigned short dSectionSizeOriginal = dSectionSize;
  779|  14.4k|#if !defined(CAD_MSB)
  780|  14.4k|        SwapEndianness( dSectionSize, sizeof( dSectionSize ) );
  781|  14.4k|#endif
  782|       |
  783|  14.4k|        DebugMsg( "Object map section #%d size: %d\n",
  784|  14.4k|                  static_cast<int>(++nSection), dSectionSize );
  785|       |
  786|  14.4k|        if( dSectionSize <= dSizeOfSectionSize )
  ------------------
  |  Branch (786:13): [True: 6.66k, False: 7.74k]
  ------------------
  787|  6.66k|            break; // Last section is empty.
  788|       |
  789|  7.74k|        CADBuffer buffer(dSectionSize + dSizeOfSectionSize + 10);
  790|  7.74k|        buffer.WriteRAW(&dSectionSizeOriginal, dSizeOfSectionSize);
  791|  7.74k|        size_t nRecordsInSection   = 0;
  792|       |
  793|       |        // Read section datsa
  794|  7.74k|        size_t readSize = pFileIO->Read( buffer.GetRawBuffer(), dSectionSize );
  795|  7.74k|        if(readSize != dSectionSize)
  ------------------
  |  Branch (795:12): [True: 109, False: 7.64k]
  ------------------
  796|    109|        {
  797|    109|            DebugMsg( "Failed to read %d byte of file. Read only %d",
  798|    109|                      static_cast<int>(dSectionSize),
  799|    109|                      static_cast<int>(readSize) );
  800|    109|            return CADErrorCodes::OBJECTS_SECTION_READ_FAILED;
  801|    109|        }
  802|  7.64k|        unsigned int dSectionBitSize = dSectionSize * 8;
  803|       |
  804|   889k|        while( buffer.PositionBit() < dSectionBitSize )
  ------------------
  |  Branch (804:16): [True: 881k, False: 7.64k]
  ------------------
  805|   881k|        {
  806|   881k|            tmpOffset.first  = buffer.ReadUMCHAR(); // 8 + 8*8
  807|   881k|            tmpOffset.second = buffer.ReadMCHAR(); // 8 + 8*8
  808|       |
  809|   881k|            if( 0 == nRecordsInSection )
  ------------------
  |  Branch (809:17): [True: 7.64k, False: 873k]
  ------------------
  810|  7.64k|            {
  811|  7.64k|                previousObjHandleOffset = tmpOffset;
  812|  7.64k|            }
  813|   873k|            else
  814|   873k|            {
  815|   873k|                if( (tmpOffset.first >= 0 &&
  ------------------
  |  Branch (815:22): [True: 873k, False: 0]
  ------------------
  816|   873k|                     std::numeric_limits<long>::max() - tmpOffset.first > previousObjHandleOffset.first) ||
  ------------------
  |  Branch (816:22): [True: 861k, False: 12.2k]
  ------------------
  817|   873k|                    (tmpOffset.first < 0 &&
  ------------------
  |  Branch (817:22): [True: 0, False: 12.2k]
  ------------------
  818|  12.2k|                     std::numeric_limits<long>::min() - tmpOffset.first <= previousObjHandleOffset.first) )
  ------------------
  |  Branch (818:22): [True: 0, False: 0]
  ------------------
  819|   861k|                {
  820|   861k|                    previousObjHandleOffset.first += tmpOffset.first;
  821|   861k|                }
  822|   873k|                if( (tmpOffset.second >= 0 &&
  ------------------
  |  Branch (822:22): [True: 613k, False: 260k]
  ------------------
  823|   873k|                     std::numeric_limits<long>::max() - tmpOffset.second > previousObjHandleOffset.second) ||
  ------------------
  |  Branch (823:22): [True: 612k, False: 1.12k]
  ------------------
  824|   873k|                    (tmpOffset.second < 0 &&
  ------------------
  |  Branch (824:22): [True: 260k, False: 1.12k]
  ------------------
  825|   261k|                     std::numeric_limits<long>::min() - tmpOffset.second <= previousObjHandleOffset.second) )
  ------------------
  |  Branch (825:22): [True: 260k, False: 358]
  ------------------
  826|   872k|                {
  827|   872k|                    previousObjHandleOffset.second += tmpOffset.second;
  828|   872k|                }
  829|   873k|            }
  830|       |#ifdef _DEBUG
  831|       |            assert( mapObjects.find( previousObjHandleOffset.first ) ==
  832|       |                                                                mapObjects.end() );
  833|       |#endif //_DEBUG
  834|   881k|            mapObjects.insert( previousObjHandleOffset );
  835|   881k|            ++nRecordsInSection;
  836|   881k|        }
  837|       |
  838|  7.64k|        unsigned short dSectionCRC = validateEntityCRC( buffer,
  839|  7.64k|                    static_cast<unsigned int>(dSectionSize), "OBJECTMAP", true );
  840|  7.64k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  841|  7.64k|        (void)dSectionCRC;
  842|       |#else
  843|       |        if(dSectionCRC == 0)
  844|       |        {
  845|       |            std::cerr << "File is corrupted (OBJECTMAP section CRC doesn't match.)\n";
  846|       |            return CADErrorCodes::OBJECTS_SECTION_READ_FAILED;
  847|       |        }
  848|       |#endif
  849|  7.64k|    }
  850|       |
  851|  6.66k|    return CADErrorCodes::SUCCESS;
  852|  6.77k|}
_ZN12DWGFileR20009GetObjectElb:
  855|   517k|{
  856|   517k|    CADBuffer buffer(8);
  857|       |
  858|   517k|    pFileIO->Seek( mapObjects[dHandle], CADFileIO::SeekOrigin::BEG );
  859|   517k|    pFileIO->Read( buffer.GetRawBuffer(), 8 );
  860|   517k|    unsigned int dObjectSize = buffer.ReadMSHORT();
  861|       |
  862|       |    // FIXME: Limit object size to 64kB
  863|   517k|    if( dObjectSize > 65536 )
  ------------------
  |  Branch (863:9): [True: 4.79k, False: 512k]
  ------------------
  864|  4.79k|        return nullptr;
  865|       |
  866|       |    // And read whole data chunk into memory for future parsing.
  867|       |    // + nBitOffsetFromStart/8 + 2 is because dObjectSize doesn't cover CRC and itself.
  868|   512k|    dObjectSize += static_cast<unsigned int>(buffer.PositionBit() / 8 + 2);
  869|       |
  870|   512k|    CADBuffer objectBuffer(dObjectSize + 64);
  871|       |
  872|   512k|    pFileIO->Seek( mapObjects[dHandle], CADFileIO::SeekOrigin::BEG );
  873|   512k|    size_t readSize = pFileIO->Read( objectBuffer.GetRawBuffer(),
  874|   512k|                                     static_cast<size_t>(dObjectSize) );
  875|   512k|    if(readSize != static_cast<size_t>(dObjectSize))
  ------------------
  |  Branch (875:8): [True: 58.1k, False: 454k]
  ------------------
  876|  58.1k|    {
  877|  58.1k|        DebugMsg( "Failed to read %d byte of file. Read only %d",
  878|  58.1k|                  static_cast<int>(dObjectSize),
  879|  58.1k|                  static_cast<int>(readSize) );
  880|  58.1k|        return nullptr;
  881|  58.1k|    }
  882|       |
  883|   454k|    /* Unused dObjectSize = */ objectBuffer.ReadMSHORT();
  884|   454k|    short dObjectType = objectBuffer.ReadBITSHORT();
  885|   454k|    if( dObjectType >= 500 )
  ------------------
  |  Branch (885:9): [True: 6.47k, False: 448k]
  ------------------
  886|  6.47k|    {
  887|  6.47k|        CADClass cadClass = oClasses.getClassByNum( dObjectType );
  888|       |        // FIXME: replace strcmp() with C++ analog
  889|  6.47k|        if( !strcmp( cadClass.sCppClassName.c_str(), "AcDbRasterImage" ) )
  ------------------
  |  Branch (889:13): [True: 216, False: 6.25k]
  ------------------
  890|    216|        {
  891|    216|            dObjectType = CADObject::IMAGE;
  892|    216|        }
  893|  6.25k|        else if( !strcmp( cadClass.sCppClassName.c_str(), "AcDbRasterImageDef" ) )
  ------------------
  |  Branch (893:18): [True: 279, False: 5.97k]
  ------------------
  894|    279|        {
  895|    279|            dObjectType = CADObject::IMAGEDEF;
  896|    279|        }
  897|  5.97k|        else if( !strcmp( cadClass.sCppClassName.c_str(), "AcDbRasterImageDefReactor" ) )
  ------------------
  |  Branch (897:18): [True: 73, False: 5.90k]
  ------------------
  898|     73|        {
  899|     73|            dObjectType = CADObject::IMAGEDEFREACTOR;
  900|     73|        }
  901|  5.90k|        else if( !strcmp( cadClass.sCppClassName.c_str(), "AcDbWipeout" ) )
  ------------------
  |  Branch (901:18): [True: 70, False: 5.83k]
  ------------------
  902|     70|        {
  903|     70|            dObjectType = CADObject::WIPEOUT;
  904|     70|        }
  905|  6.47k|    }
  906|       |
  907|       |    // Entities handling
  908|   454k|    if( isCommonEntityType( dObjectType ) )
  ------------------
  |  Branch (908:9): [True: 42.7k, False: 411k]
  ------------------
  909|  42.7k|    {
  910|  42.7k|        struct CADCommonED stCommonEntityData; // Common for all entities
  911|       |
  912|  42.7k|        stCommonEntityData.nObjectSizeInBits = objectBuffer.ReadRAWLONG();
  913|  42.7k|        stCommonEntityData.hObjectHandle     = objectBuffer.ReadHANDLE();
  914|       |
  915|  42.7k|        short  dEEDSize;
  916|  42.7k|        CADEed dwgEed;
  917|  85.1k|        while( ( dEEDSize = objectBuffer.ReadBITSHORT() ) != 0 )
  ------------------
  |  Branch (917:16): [True: 42.8k, False: 42.2k]
  ------------------
  918|  42.8k|        {
  919|  42.8k|            dwgEed.dLength      = dEEDSize;
  920|  42.8k|            dwgEed.hApplication = objectBuffer.ReadHANDLE();
  921|       |
  922|  42.8k|            if(dEEDSize < 0)
  ------------------
  |  Branch (922:16): [True: 490, False: 42.3k]
  ------------------
  923|    490|            {
  924|    490|                return nullptr;
  925|    490|            }
  926|       |
  927|  55.6M|            for( short i = 0; i < dEEDSize; ++i )
  ------------------
  |  Branch (927:31): [True: 55.6M, False: 42.3k]
  ------------------
  928|  55.6M|            {
  929|  55.6M|                dwgEed.acData.push_back( objectBuffer.ReadCHAR() );
  930|  55.6M|            }
  931|       |
  932|  42.3k|            stCommonEntityData.aEED.push_back( dwgEed );
  933|  42.3k|        }
  934|       |
  935|  42.2k|        stCommonEntityData.bGraphicsPresented = objectBuffer.ReadBIT();
  936|  42.2k|        if( stCommonEntityData.bGraphicsPresented )
  ------------------
  |  Branch (936:13): [True: 9.54k, False: 32.7k]
  ------------------
  937|  9.54k|        {
  938|  9.54k|            const auto rawLong = objectBuffer.ReadRAWLONG();
  939|  9.54k|            if( rawLong < 0 )
  ------------------
  |  Branch (939:17): [True: 279, False: 9.26k]
  ------------------
  940|    279|                return nullptr;
  941|  9.26k|            size_t nGraphicsDataSize = static_cast<size_t>(rawLong);
  942|  9.26k|            if( nGraphicsDataSize > std::numeric_limits<size_t>::max() / 8 )
  ------------------
  |  Branch (942:17): [True: 0, False: 9.26k]
  ------------------
  943|      0|                return nullptr;
  944|       |            // Skip read graphics data
  945|  9.26k|            buffer.Seek(nGraphicsDataSize * 8);
  946|  9.26k|        }
  947|  41.9k|        stCommonEntityData.bbEntMode        = objectBuffer.Read2B();
  948|  41.9k|        stCommonEntityData.nNumReactors     = objectBuffer.ReadBITLONG();
  949|  41.9k|        if(stCommonEntityData.nNumReactors < 0 ||
  ------------------
  |  Branch (949:12): [True: 257, False: 41.7k]
  ------------------
  950|  41.9k|           stCommonEntityData.nNumReactors > 5000)
  ------------------
  |  Branch (950:12): [True: 316, False: 41.3k]
  ------------------
  951|    573|        {
  952|    573|            return nullptr;
  953|    573|        }
  954|  41.3k|        stCommonEntityData.bNoLinks         = objectBuffer.ReadBIT();
  955|  41.3k|        stCommonEntityData.nCMColor         = objectBuffer.ReadBITSHORT();
  956|  41.3k|        stCommonEntityData.dfLTypeScale     = objectBuffer.ReadBITDOUBLE();
  957|  41.3k|        stCommonEntityData.bbLTypeFlags     = objectBuffer.Read2B();
  958|  41.3k|        stCommonEntityData.bbPlotStyleFlags = objectBuffer.Read2B();
  959|  41.3k|        stCommonEntityData.nInvisibility    = objectBuffer.ReadBITSHORT();
  960|  41.3k|        stCommonEntityData.nLineWeight      = objectBuffer.ReadCHAR();
  961|       |
  962|       |        // Skip entitity-specific data, we don't need it if bHandlesOnly == true
  963|  41.3k|        if( bHandlesOnly == true )
  ------------------
  |  Branch (963:13): [True: 3.12k, False: 38.2k]
  ------------------
  964|  3.12k|        {
  965|  3.12k|            return getEntity( dObjectType, dObjectSize, stCommonEntityData, objectBuffer);
  966|  3.12k|        }
  967|       |
  968|  38.2k|        switch( dObjectType )
  969|  38.2k|        {
  970|      0|            case CADObject::BLOCK:
  ------------------
  |  Branch (970:13): [True: 0, False: 38.2k]
  ------------------
  971|      0|                return getBlock( dObjectSize, stCommonEntityData, objectBuffer);
  972|       |
  973|    594|            case CADObject::ELLIPSE:
  ------------------
  |  Branch (973:13): [True: 594, False: 37.6k]
  ------------------
  974|    594|                return getEllipse( dObjectSize, stCommonEntityData, objectBuffer);
  975|       |
  976|  3.35k|            case CADObject::MLINE:
  ------------------
  |  Branch (976:13): [True: 3.35k, False: 34.9k]
  ------------------
  977|  3.35k|                return getMLine( dObjectSize, stCommonEntityData, objectBuffer);
  978|       |
  979|  1.15k|            case CADObject::SOLID:
  ------------------
  |  Branch (979:13): [True: 1.15k, False: 37.1k]
  ------------------
  980|  1.15k|                return getSolid( dObjectSize, stCommonEntityData, objectBuffer);
  981|       |
  982|    710|            case CADObject::POINT:
  ------------------
  |  Branch (982:13): [True: 710, False: 37.5k]
  ------------------
  983|    710|                return getPoint( dObjectSize, stCommonEntityData, objectBuffer);
  984|       |
  985|    939|            case CADObject::POLYLINE3D:
  ------------------
  |  Branch (985:13): [True: 939, False: 37.3k]
  ------------------
  986|    939|                return getPolyLine3D( dObjectSize, stCommonEntityData, objectBuffer);
  987|       |
  988|    886|            case CADObject::RAY:
  ------------------
  |  Branch (988:13): [True: 886, False: 37.3k]
  ------------------
  989|    886|                return getRay( dObjectSize, stCommonEntityData, objectBuffer);
  990|       |
  991|    476|            case CADObject::XLINE:
  ------------------
  |  Branch (991:13): [True: 476, False: 37.8k]
  ------------------
  992|    476|                return getXLine( dObjectSize, stCommonEntityData, objectBuffer);
  993|       |
  994|  1.00k|            case CADObject::LINE:
  ------------------
  |  Branch (994:13): [True: 1.00k, False: 37.2k]
  ------------------
  995|  1.00k|                return getLine( dObjectSize, stCommonEntityData, objectBuffer);
  996|       |
  997|  1.67k|            case CADObject::TEXT:
  ------------------
  |  Branch (997:13): [True: 1.67k, False: 36.6k]
  ------------------
  998|  1.67k|                return getText( dObjectSize, stCommonEntityData, objectBuffer);
  999|       |
 1000|    509|            case CADObject::VERTEX3D:
  ------------------
  |  Branch (1000:13): [True: 509, False: 37.7k]
  ------------------
 1001|    509|                return getVertex3D( dObjectSize, stCommonEntityData, objectBuffer);
 1002|       |
 1003|  1.04k|            case CADObject::CIRCLE:
  ------------------
  |  Branch (1003:13): [True: 1.04k, False: 37.2k]
  ------------------
 1004|  1.04k|                return getCircle( dObjectSize, stCommonEntityData, objectBuffer);
 1005|       |
 1006|      0|            case CADObject::ENDBLK:
  ------------------
  |  Branch (1006:13): [True: 0, False: 38.2k]
  ------------------
 1007|      0|                return getEndBlock( dObjectSize, stCommonEntityData, objectBuffer);
 1008|       |
 1009|    864|            case CADObject::POLYLINE2D:
  ------------------
  |  Branch (1009:13): [True: 864, False: 37.4k]
  ------------------
 1010|    864|                return getPolyline2D( dObjectSize, stCommonEntityData, objectBuffer);
 1011|       |
 1012|  3.91k|            case CADObject::ATTRIB:
  ------------------
  |  Branch (1012:13): [True: 3.91k, False: 34.3k]
  ------------------
 1013|  3.91k|                return getAttributes( dObjectSize, stCommonEntityData, objectBuffer);
 1014|       |
 1015|  2.51k|            case CADObject::ATTDEF:
  ------------------
  |  Branch (1015:13): [True: 2.51k, False: 35.7k]
  ------------------
 1016|  2.51k|                return getAttributesDefn( dObjectSize, stCommonEntityData, objectBuffer);
 1017|       |
 1018|  3.52k|            case CADObject::LWPOLYLINE:
  ------------------
  |  Branch (1018:13): [True: 3.52k, False: 34.7k]
  ------------------
 1019|  3.52k|                return getLWPolyLine( dObjectSize, stCommonEntityData, objectBuffer);
 1020|       |
 1021|    931|            case CADObject::ARC:
  ------------------
  |  Branch (1021:13): [True: 931, False: 37.3k]
  ------------------
 1022|    931|                return getArc( dObjectSize, stCommonEntityData, objectBuffer);
 1023|       |
 1024|  4.02k|            case CADObject::SPLINE:
  ------------------
  |  Branch (1024:13): [True: 4.02k, False: 34.2k]
  ------------------
 1025|  4.02k|                return getSpline( dObjectSize, stCommonEntityData, objectBuffer);
 1026|       |
 1027|  1.18k|            case CADObject::POLYLINE_PFACE:
  ------------------
  |  Branch (1027:13): [True: 1.18k, False: 37.0k]
  ------------------
 1028|  1.18k|                return getPolylinePFace( dObjectSize, stCommonEntityData, objectBuffer);
 1029|       |
 1030|  2.01k|            case CADObject::IMAGE:
  ------------------
  |  Branch (1030:13): [True: 2.01k, False: 36.2k]
  ------------------
 1031|  2.01k|                return getImage( dObjectSize, stCommonEntityData, objectBuffer);
 1032|       |
 1033|  1.16k|            case CADObject::FACE3D:
  ------------------
  |  Branch (1033:13): [True: 1.16k, False: 37.1k]
  ------------------
 1034|  1.16k|                return get3DFace( dObjectSize, stCommonEntityData, objectBuffer);
 1035|       |
 1036|  1.19k|            case CADObject::VERTEX_MESH:
  ------------------
  |  Branch (1036:13): [True: 1.19k, False: 37.0k]
  ------------------
 1037|  1.19k|                return getVertexMesh( dObjectSize, stCommonEntityData, objectBuffer);
 1038|       |
 1039|  1.05k|            case CADObject::VERTEX_PFACE:
  ------------------
  |  Branch (1039:13): [True: 1.05k, False: 37.2k]
  ------------------
 1040|  1.05k|                return getVertexPFace( dObjectSize, stCommonEntityData,
 1041|  1.05k|                                       objectBuffer);
 1042|       |
 1043|    598|            case CADObject::MTEXT:
  ------------------
  |  Branch (1043:13): [True: 598, False: 37.6k]
  ------------------
 1044|    598|                return getMText( dObjectSize, stCommonEntityData,
 1045|    598|                                 objectBuffer);
 1046|       |
 1047|      0|            case CADObject::DIMENSION_RADIUS:
  ------------------
  |  Branch (1047:13): [True: 0, False: 38.2k]
  ------------------
 1048|      0|            case CADObject::DIMENSION_DIAMETER:
  ------------------
  |  Branch (1048:13): [True: 0, False: 38.2k]
  ------------------
 1049|      0|            case CADObject::DIMENSION_ALIGNED:
  ------------------
  |  Branch (1049:13): [True: 0, False: 38.2k]
  ------------------
 1050|      0|            case CADObject::DIMENSION_ANG_3PT:
  ------------------
  |  Branch (1050:13): [True: 0, False: 38.2k]
  ------------------
 1051|      0|            case CADObject::DIMENSION_ANG_2LN:
  ------------------
  |  Branch (1051:13): [True: 0, False: 38.2k]
  ------------------
 1052|      0|            case CADObject::DIMENSION_ORDINATE:
  ------------------
  |  Branch (1052:13): [True: 0, False: 38.2k]
  ------------------
 1053|      0|            case CADObject::DIMENSION_LINEAR:
  ------------------
  |  Branch (1053:13): [True: 0, False: 38.2k]
  ------------------
 1054|      0|                return getDimension( dObjectType, dObjectSize, stCommonEntityData,
 1055|      0|                                     objectBuffer);
 1056|       |
 1057|  2.14k|            case CADObject::INSERT:
  ------------------
  |  Branch (1057:13): [True: 2.14k, False: 36.1k]
  ------------------
 1058|  2.14k|                return getInsert( dObjectType, dObjectSize, stCommonEntityData,
 1059|  2.14k|                                  objectBuffer);
 1060|       |
 1061|    809|            default:
  ------------------
  |  Branch (1061:13): [True: 809, False: 37.4k]
  ------------------
 1062|    809|                return getEntity( dObjectType, dObjectSize, stCommonEntityData,
 1063|    809|                                  objectBuffer);
 1064|  38.2k|        }
 1065|  38.2k|    }
 1066|   411k|    else
 1067|   411k|    {
 1068|   411k|        switch( dObjectType )
  ------------------
  |  Branch (1068:17): [True: 351k, False: 60.6k]
  ------------------
 1069|   411k|        {
 1070|  3.38k|            case CADObject::DICTIONARY:
  ------------------
  |  Branch (1070:13): [True: 3.38k, False: 408k]
  ------------------
 1071|  3.38k|                return getDictionary( dObjectSize, objectBuffer);
 1072|       |
 1073|  18.6k|            case CADObject::LAYER:
  ------------------
  |  Branch (1073:13): [True: 18.6k, False: 393k]
  ------------------
 1074|  18.6k|                return getLayerObject( dObjectSize, objectBuffer);
 1075|       |
 1076|  11.2k|            case CADObject::LAYER_CONTROL_OBJ:
  ------------------
  |  Branch (1076:13): [True: 11.2k, False: 400k]
  ------------------
 1077|  11.2k|                return getLayerControl( dObjectSize, objectBuffer);
 1078|       |
 1079|  2.57k|            case CADObject::BLOCK_CONTROL_OBJ:
  ------------------
  |  Branch (1079:13): [True: 2.57k, False: 409k]
  ------------------
 1080|  2.57k|                return getBlockControl( dObjectSize, objectBuffer);
 1081|       |
 1082|  8.79k|            case CADObject::BLOCK_HEADER:
  ------------------
  |  Branch (1082:13): [True: 8.79k, False: 403k]
  ------------------
 1083|  8.79k|                return getBlockHeader( dObjectSize, objectBuffer);
 1084|       |
 1085|  1.73k|            case CADObject::LTYPE_CONTROL_OBJ:
  ------------------
  |  Branch (1085:13): [True: 1.73k, False: 410k]
  ------------------
 1086|  1.73k|                return getLineTypeControl( dObjectSize, objectBuffer);
 1087|       |
 1088|  7.72k|            case CADObject::LTYPE1:
  ------------------
  |  Branch (1088:13): [True: 7.72k, False: 404k]
  ------------------
 1089|  7.72k|                return getLineType1( dObjectSize, objectBuffer);
 1090|       |
 1091|  2.03k|            case CADObject::IMAGEDEF:
  ------------------
  |  Branch (1091:13): [True: 2.03k, False: 409k]
  ------------------
 1092|  2.03k|                return getImageDef( dObjectSize, objectBuffer);
 1093|       |
 1094|  1.55k|            case CADObject::IMAGEDEFREACTOR:
  ------------------
  |  Branch (1094:13): [True: 1.55k, False: 410k]
  ------------------
 1095|  1.55k|                return getImageDefReactor( dObjectSize, objectBuffer);
 1096|       |
 1097|  2.92k|            case CADObject::XRECORD:
  ------------------
  |  Branch (1097:13): [True: 2.92k, False: 408k]
  ------------------
 1098|  2.92k|                return getXRecord( dObjectSize, objectBuffer);
 1099|   411k|        }
 1100|   411k|    }
 1101|       |
 1102|   351k|    return nullptr;
 1103|   454k|}
_ZN12DWGFileR200011GetGeometryEmll:
 1106|  2.13k|{
 1107|  2.13k|    CADGeometry * poGeometry = nullptr;
 1108|  2.13k|    unique_ptr<CADObject> pCADEntityObject( GetObject( dHandle ) );
 1109|  2.13k|    CADEntityObject* readObject =
 1110|  2.13k|                dynamic_cast<CADEntityObject *>( pCADEntityObject.get() );
 1111|       |
 1112|  2.13k|    if( !readObject )
  ------------------
  |  Branch (1112:9): [True: 169, False: 1.97k]
  ------------------
 1113|    169|    {
 1114|    169|        return nullptr;
 1115|    169|    }
 1116|       |
 1117|  1.97k|    switch( readObject->getType() )
 1118|  1.97k|    {
 1119|     98|        case CADObject::ARC:
  ------------------
  |  Branch (1119:9): [True: 98, False: 1.87k]
  ------------------
 1120|     98|        {
 1121|     98|            CADArc * arc = new CADArc();
 1122|     98|            CADArcObject * cadArc = static_cast<CADArcObject *>(
 1123|     98|                    readObject);
 1124|       |
 1125|     98|            arc->setPosition( cadArc->vertPosition );
 1126|     98|            arc->setExtrusion( cadArc->vectExtrusion );
 1127|     98|            arc->setRadius( cadArc->dfRadius );
 1128|     98|            arc->setThickness( cadArc->dfThickness );
 1129|     98|            arc->setStartingAngle( cadArc->dfStartAngle );
 1130|     98|            arc->setEndingAngle( cadArc->dfEndAngle );
 1131|       |
 1132|     98|            poGeometry = arc;
 1133|     98|            break;
 1134|      0|        }
 1135|       |
 1136|     37|        case CADObject::POINT:
  ------------------
  |  Branch (1136:9): [True: 37, False: 1.93k]
  ------------------
 1137|     37|        {
 1138|     37|            CADPoint3D * point = new CADPoint3D();
 1139|     37|            CADPointObject * cadPoint = static_cast<CADPointObject *>(
 1140|     37|                    readObject);
 1141|       |
 1142|     37|            point->setPosition( cadPoint->vertPosition );
 1143|     37|            point->setExtrusion( cadPoint->vectExtrusion );
 1144|     37|            point->setXAxisAng( cadPoint->dfXAxisAng );
 1145|     37|            point->setThickness( cadPoint->dfThickness );
 1146|       |
 1147|     37|            poGeometry = point;
 1148|     37|            break;
 1149|      0|        }
 1150|       |
 1151|    122|        case CADObject::POLYLINE3D:
  ------------------
  |  Branch (1151:9): [True: 122, False: 1.84k]
  ------------------
 1152|    122|        {
 1153|    122|            CADPolyline3D * polyline = new CADPolyline3D();
 1154|    122|            CADPolyline3DObject * cadPolyline3D = static_cast<CADPolyline3DObject *>(
 1155|    122|                    readObject);
 1156|       |
 1157|       |            // TODO: code can be much simplified if CADHandle will be used.
 1158|       |            // to do so, == and ++ operators should be implemented.
 1159|    122|            unique_ptr<CADVertex3DObject> vertex;
 1160|    122|            long currentVertexH = cadPolyline3D->hVertices[0].getAsLong();
 1161|    122|            while( currentVertexH != 0 )
  ------------------
  |  Branch (1161:20): [True: 98, False: 24]
  ------------------
 1162|     98|            {
 1163|     98|                CADObject *poCADVertexObject = GetObject( currentVertexH );
 1164|     98|                vertex.reset( dynamic_cast<CADVertex3DObject *>( poCADVertexObject ) );
 1165|       |
 1166|     98|                if( !vertex )
  ------------------
  |  Branch (1166:21): [True: 98, False: 0]
  ------------------
 1167|     98|                {
 1168|     98|                    delete poCADVertexObject;
 1169|     98|                    break;
 1170|     98|                }
 1171|       |
 1172|      0|                currentVertexH = vertex->stCed.hObjectHandle.getAsLong();
 1173|      0|                polyline->addVertex( vertex->vertPosition );
 1174|      0|                if( vertex->stCed.bNoLinks == true )
  ------------------
  |  Branch (1174:21): [True: 0, False: 0]
  ------------------
 1175|      0|                {
 1176|      0|                    ++currentVertexH;
 1177|      0|                }
 1178|      0|                else
 1179|      0|                {
 1180|      0|                    currentVertexH = vertex->stChed.hNextEntity.getAsLong(
 1181|      0|                                vertex->stCed.hObjectHandle );
 1182|      0|                }
 1183|       |
 1184|       |                // Last vertex is reached. Read it and break reading.
 1185|      0|                if( currentVertexH == cadPolyline3D->hVertices[1].getAsLong() )
  ------------------
  |  Branch (1185:21): [True: 0, False: 0]
  ------------------
 1186|      0|                {
 1187|      0|                    CADObject *poCADVertex3DObject = GetObject( currentVertexH );
 1188|      0|                    vertex.reset( dynamic_cast<CADVertex3DObject *>(
 1189|      0|                                          poCADVertex3DObject) );
 1190|      0|                    if( vertex)
  ------------------
  |  Branch (1190:25): [True: 0, False: 0]
  ------------------
 1191|      0|                    {
 1192|      0|                        polyline->addVertex( vertex->vertPosition );
 1193|      0|                    }
 1194|      0|                    else
 1195|      0|                    {
 1196|      0|                        delete poCADVertex3DObject;
 1197|      0|                    }
 1198|      0|                    break;
 1199|      0|                }
 1200|      0|            }
 1201|       |
 1202|    122|            poGeometry = polyline;
 1203|    122|            break;
 1204|      0|        }
 1205|       |
 1206|    139|        case CADObject::LWPOLYLINE:
  ------------------
  |  Branch (1206:9): [True: 139, False: 1.83k]
  ------------------
 1207|    139|        {
 1208|    139|            CADLWPolyline * lwPolyline = new CADLWPolyline();
 1209|    139|            CADLWPolylineObject * cadlwPolyline = static_cast<CADLWPolylineObject *>(
 1210|    139|                    readObject);
 1211|       |
 1212|    139|            lwPolyline->setBulges( cadlwPolyline->adfBulges );
 1213|    139|            lwPolyline->setClosed( cadlwPolyline->bClosed );
 1214|    139|            lwPolyline->setConstWidth( cadlwPolyline->dfConstWidth );
 1215|    139|            lwPolyline->setElevation( cadlwPolyline->dfElevation );
 1216|    139|            for( const CADVector& vertex : cadlwPolyline->avertVertices )
  ------------------
  |  Branch (1216:42): [True: 11.0k, False: 139]
  ------------------
 1217|  11.0k|                lwPolyline->addVertex( vertex );
 1218|    139|            lwPolyline->setVectExtrusion( cadlwPolyline->vectExtrusion );
 1219|    139|            lwPolyline->setWidths( cadlwPolyline->astWidths );
 1220|       |
 1221|    139|            poGeometry = lwPolyline;
 1222|    139|            break;
 1223|      0|        }
 1224|       |
 1225|     65|        case CADObject::CIRCLE:
  ------------------
  |  Branch (1225:9): [True: 65, False: 1.90k]
  ------------------
 1226|     65|        {
 1227|     65|            CADCircle * circle = new CADCircle();
 1228|     65|            CADCircleObject * cadCircle = static_cast<CADCircleObject *>(
 1229|     65|                    readObject);
 1230|       |
 1231|     65|            circle->setPosition( cadCircle->vertPosition );
 1232|     65|            circle->setExtrusion( cadCircle->vectExtrusion );
 1233|     65|            circle->setRadius( cadCircle->dfRadius );
 1234|     65|            circle->setThickness( cadCircle->dfThickness );
 1235|       |
 1236|     65|            poGeometry = circle;
 1237|     65|            break;
 1238|      0|        }
 1239|       |
 1240|    102|        case CADObject::ATTRIB:
  ------------------
  |  Branch (1240:9): [True: 102, False: 1.86k]
  ------------------
 1241|    102|        {
 1242|    102|            CADAttrib * attrib = new CADAttrib();
 1243|    102|            CADAttribObject * cadAttrib = static_cast<CADAttribObject *>(
 1244|    102|                    readObject );
 1245|       |
 1246|    102|            attrib->setPosition( cadAttrib->vertInsetionPoint );
 1247|    102|            attrib->setExtrusion( cadAttrib->vectExtrusion );
 1248|    102|            attrib->setRotationAngle( cadAttrib->dfRotationAng );
 1249|    102|            attrib->setAlignmentPoint( cadAttrib->vertAlignmentPoint );
 1250|    102|            attrib->setElevation( cadAttrib->dfElevation );
 1251|    102|            attrib->setHeight( cadAttrib->dfHeight );
 1252|    102|            attrib->setObliqueAngle( cadAttrib->dfObliqueAng );
 1253|    102|            attrib->setPositionLocked( cadAttrib->bLockPosition );
 1254|    102|            attrib->setTag( cadAttrib->sTag );
 1255|    102|            attrib->setTextValue( cadAttrib->sTextValue );
 1256|    102|            attrib->setThickness( cadAttrib->dfThickness );
 1257|       |
 1258|    102|            poGeometry = attrib;
 1259|    102|            break;
 1260|      0|        }
 1261|       |
 1262|    651|        case CADObject::ATTDEF:
  ------------------
  |  Branch (1262:9): [True: 651, False: 1.31k]
  ------------------
 1263|    651|        {
 1264|    651|            CADAttdef * attdef = new CADAttdef();
 1265|    651|            CADAttdefObject * cadAttrib = static_cast<CADAttdefObject*>(
 1266|    651|                    readObject );
 1267|       |
 1268|    651|            attdef->setPosition( cadAttrib->vertInsetionPoint );
 1269|    651|            attdef->setExtrusion( cadAttrib->vectExtrusion );
 1270|    651|            attdef->setRotationAngle( cadAttrib->dfRotationAng );
 1271|    651|            attdef->setAlignmentPoint( cadAttrib->vertAlignmentPoint );
 1272|    651|            attdef->setElevation( cadAttrib->dfElevation );
 1273|    651|            attdef->setHeight( cadAttrib->dfHeight );
 1274|    651|            attdef->setObliqueAngle( cadAttrib->dfObliqueAng );
 1275|    651|            attdef->setPositionLocked( cadAttrib->bLockPosition );
 1276|    651|            attdef->setTag( cadAttrib->sTag );
 1277|    651|            attdef->setTextValue( cadAttrib->sTextValue );
 1278|    651|            attdef->setThickness( cadAttrib->dfThickness );
 1279|    651|            attdef->setPrompt( cadAttrib->sPrompt );
 1280|       |
 1281|    651|            poGeometry = attdef;
 1282|    651|            break;
 1283|      0|        }
 1284|       |
 1285|     80|        case CADObject::ELLIPSE:
  ------------------
  |  Branch (1285:9): [True: 80, False: 1.89k]
  ------------------
 1286|     80|        {
 1287|     80|            CADEllipse * ellipse = new CADEllipse();
 1288|     80|            CADEllipseObject * cadEllipse = static_cast<CADEllipseObject *>(
 1289|     80|                    readObject);
 1290|       |
 1291|     80|            ellipse->setPosition( cadEllipse->vertPosition );
 1292|     80|            ellipse->setSMAxis( cadEllipse->vectSMAxis );
 1293|     80|            ellipse->setAxisRatio( cadEllipse->dfAxisRatio );
 1294|     80|            ellipse->setEndingAngle( cadEllipse->dfEndAngle );
 1295|     80|            ellipse->setStartingAngle( cadEllipse->dfBegAngle );
 1296|       |
 1297|     80|            poGeometry = ellipse;
 1298|     80|            break;
 1299|      0|        }
 1300|       |
 1301|     32|        case CADObject::LINE:
  ------------------
  |  Branch (1301:9): [True: 32, False: 1.93k]
  ------------------
 1302|     32|        {
 1303|     32|            CADLineObject * cadLine = static_cast<CADLineObject *>(
 1304|     32|                    readObject);
 1305|       |
 1306|     32|            CADPoint3D ptBeg( cadLine->vertStart, cadLine->dfThickness );
 1307|     32|            CADPoint3D ptEnd( cadLine->vertEnd, cadLine->dfThickness );
 1308|       |
 1309|     32|            CADLine * line = new CADLine( ptBeg, ptEnd );
 1310|       |
 1311|     32|            poGeometry = line;
 1312|     32|            break;
 1313|      0|        }
 1314|       |
 1315|     10|        case CADObject::RAY:
  ------------------
  |  Branch (1315:9): [True: 10, False: 1.96k]
  ------------------
 1316|     10|        {
 1317|     10|            CADRay * ray = new CADRay();
 1318|     10|            CADRayObject * cadRay = static_cast<CADRayObject *>(
 1319|     10|                    readObject);
 1320|       |
 1321|     10|            ray->setVectVector( cadRay->vectVector );
 1322|     10|            ray->setPosition( cadRay->vertPosition );
 1323|       |
 1324|     10|            poGeometry = ray;
 1325|     10|            break;
 1326|      0|        }
 1327|       |
 1328|    145|        case CADObject::SPLINE:
  ------------------
  |  Branch (1328:9): [True: 145, False: 1.82k]
  ------------------
 1329|    145|        {
 1330|    145|            CADSpline * spline = new CADSpline();
 1331|    145|            CADSplineObject * cadSpline = static_cast<CADSplineObject *>(
 1332|    145|                    readObject);
 1333|       |
 1334|    145|            spline->setScenario( cadSpline->dScenario );
 1335|    145|            spline->setDegree( cadSpline->dDegree );
 1336|    145|            if( spline->getScenario() == 2 )
  ------------------
  |  Branch (1336:17): [True: 21, False: 124]
  ------------------
 1337|     21|            {
 1338|     21|                spline->setFitTolerance( cadSpline->dfFitTol );
 1339|     21|            }
 1340|    124|            else if( spline->getScenario() == 1 )
  ------------------
  |  Branch (1340:22): [True: 24, False: 100]
  ------------------
 1341|     24|            {
 1342|     24|                spline->setRational( cadSpline->bRational );
 1343|     24|                spline->setClosed( cadSpline->bClosed );
 1344|     24|                spline->setWeight( cadSpline->bWeight );
 1345|     24|            }
 1346|    145|            for( double weight : cadSpline->adfCtrlPointsWeight )
  ------------------
  |  Branch (1346:32): [True: 847, False: 145]
  ------------------
 1347|    847|                spline->addControlPointsWeight( weight );
 1348|       |
 1349|    145|            for( const CADVector& pt : cadSpline->averFitPoints )
  ------------------
  |  Branch (1349:38): [True: 993, False: 145]
  ------------------
 1350|    993|                spline->addFitPoint( pt );
 1351|       |
 1352|    145|            for( const CADVector& pt : cadSpline->avertCtrlPoints )
  ------------------
  |  Branch (1352:38): [True: 847, False: 145]
  ------------------
 1353|    847|                spline->addControlPoint( pt );
 1354|       |
 1355|    145|            poGeometry = spline;
 1356|    145|            break;
 1357|      0|        }
 1358|       |
 1359|    200|        case CADObject::TEXT:
  ------------------
  |  Branch (1359:9): [True: 200, False: 1.77k]
  ------------------
 1360|    200|        {
 1361|    200|            CADText * text = new CADText();
 1362|    200|            CADTextObject * cadText = static_cast<CADTextObject *>(
 1363|    200|                    readObject);
 1364|       |
 1365|    200|            text->setPosition( cadText->vertInsetionPoint );
 1366|    200|            text->setTextValue( cadText->sTextValue );
 1367|    200|            text->setRotationAngle( cadText->dfRotationAng );
 1368|    200|            text->setObliqueAngle( cadText->dfObliqueAng );
 1369|    200|            text->setThickness( cadText->dfThickness );
 1370|    200|            text->setHeight( cadText->dfElevation );
 1371|       |
 1372|    200|            poGeometry = text;
 1373|    200|            break;
 1374|      0|        }
 1375|       |
 1376|     29|        case CADObject::SOLID:
  ------------------
  |  Branch (1376:9): [True: 29, False: 1.94k]
  ------------------
 1377|     29|        {
 1378|     29|            CADSolid * solid = new CADSolid();
 1379|     29|            CADSolidObject * cadSolid = static_cast<CADSolidObject *>(
 1380|     29|                    readObject);
 1381|       |
 1382|     29|            solid->setElevation( cadSolid->dfElevation );
 1383|     29|            solid->setThickness( cadSolid->dfThickness );
 1384|     29|            for( const CADVector& corner : cadSolid->avertCorners )
  ------------------
  |  Branch (1384:42): [True: 116, False: 29]
  ------------------
 1385|    116|                solid->addCorner( corner );
 1386|     29|            solid->setExtrusion( cadSolid->vectExtrusion );
 1387|       |
 1388|     29|            poGeometry = solid;
 1389|     29|            break;
 1390|      0|        }
 1391|       |
 1392|      3|        case CADObject::IMAGE:
  ------------------
  |  Branch (1392:9): [True: 3, False: 1.96k]
  ------------------
 1393|      3|        {
 1394|      3|            CADImageObject * cadImage = static_cast<CADImageObject *>(
 1395|      3|                    readObject);
 1396|       |
 1397|      3|            CADObject *pCADImageDefObject = GetObject( cadImage->hImageDef.getAsLong() );
 1398|      3|            unique_ptr<CADImageDefObject> cadImageDef(
 1399|      3|                dynamic_cast<CADImageDefObject *>( pCADImageDefObject ) );
 1400|       |
 1401|      3|            if(cadImageDef)
  ------------------
  |  Branch (1401:16): [True: 0, False: 3]
  ------------------
 1402|      0|            {
 1403|      0|                CADImage * image = new CADImage();
 1404|      0|                image->setClippingBoundaryType( cadImage->dClipBoundaryType );
 1405|      0|                image->setFilePath( cadImageDef->sFilePath );
 1406|      0|                image->setVertInsertionPoint( cadImage->vertInsertion );
 1407|      0|                CADVector imageSize( cadImage->dfSizeX, cadImage->dfSizeY );
 1408|      0|                image->setImageSize( imageSize );
 1409|      0|                CADVector imageSizeInPx( cadImageDef->dfXImageSizeInPx, cadImageDef->dfYImageSizeInPx );
 1410|      0|                image->setImageSizeInPx( imageSizeInPx );
 1411|      0|                CADVector pixelSizeInACADUnits( cadImageDef->dfXPixelSize, cadImageDef->dfYPixelSize );
 1412|      0|                image->setPixelSizeInACADUnits( pixelSizeInACADUnits );
 1413|      0|                if( CADImage::IsValidResolutionUnit( cadImageDef->dResUnits ) )
  ------------------
  |  Branch (1413:21): [True: 0, False: 0]
  ------------------
 1414|      0|                {
 1415|      0|                    image->setResolutionUnits(
 1416|      0|                        static_cast<CADImage::ResolutionUnit>( cadImageDef->dResUnits ) );
 1417|      0|                }
 1418|      0|                bool bTransparency = (cadImage->dDisplayProps & 0x08) != 0;
 1419|      0|                image->setOptions( bTransparency,
 1420|      0|                                   cadImage->bClipping,
 1421|      0|                                   cadImage->dBrightness,
 1422|      0|                                   cadImage->dContrast );
 1423|      0|                for( const CADVector& clipPt : cadImage->avertClippingPolygonVertices )
  ------------------
  |  Branch (1423:46): [True: 0, False: 0]
  ------------------
 1424|      0|                {
 1425|      0|                    image->addClippingPoint( clipPt );
 1426|      0|                }
 1427|       |
 1428|      0|                poGeometry = image;
 1429|      0|            }
 1430|      3|            else
 1431|      3|            {
 1432|      3|                delete pCADImageDefObject;
 1433|      3|            }
 1434|      3|            break;
 1435|      0|        }
 1436|       |
 1437|     29|        case CADObject::MLINE:
  ------------------
  |  Branch (1437:9): [True: 29, False: 1.94k]
  ------------------
 1438|     29|        {
 1439|     29|            CADMLine * mline = new CADMLine();
 1440|     29|            CADMLineObject * cadmLine = static_cast<CADMLineObject *>(
 1441|     29|                    readObject);
 1442|       |
 1443|     29|            mline->setScale( cadmLine->dfScale );
 1444|     29|            mline->setOpened( cadmLine->dOpenClosed == 1 ? true : false );
  ------------------
  |  Branch (1444:31): [True: 2, False: 27]
  ------------------
 1445|     29|            for( const CADMLineVertex& vertex : cadmLine->avertVertices )
  ------------------
  |  Branch (1445:47): [True: 651, False: 29]
  ------------------
 1446|    651|                mline->addVertex( vertex.vertPosition );
 1447|       |
 1448|     29|            poGeometry = mline;
 1449|     29|            break;
 1450|      0|        }
 1451|       |
 1452|     67|        case CADObject::MTEXT:
  ------------------
  |  Branch (1452:9): [True: 67, False: 1.90k]
  ------------------
 1453|     67|        {
 1454|     67|            CADMText * mtext = new CADMText();
 1455|     67|            CADMTextObject * cadmText = static_cast<CADMTextObject *>(
 1456|     67|                    readObject);
 1457|       |
 1458|     67|            mtext->setTextValue( cadmText->sTextValue );
 1459|     67|            mtext->setXAxisAng( cadmText->vectXAxisDir.getX() ); //TODO: is this needed?
 1460|       |
 1461|     67|            mtext->setPosition( cadmText->vertInsertionPoint );
 1462|     67|            mtext->setExtrusion( cadmText->vectExtrusion );
 1463|       |
 1464|     67|            mtext->setHeight( cadmText->dfTextHeight );
 1465|     67|            mtext->setRectWidth( cadmText->dfRectWidth );
 1466|     67|            mtext->setExtents( cadmText->dfExtents );
 1467|     67|            mtext->setExtentsWidth( cadmText->dfExtentsWidth );
 1468|       |
 1469|     67|            poGeometry = mtext;
 1470|     67|            break;
 1471|      0|        }
 1472|       |
 1473|     37|        case CADObject::POLYLINE_PFACE:
  ------------------
  |  Branch (1473:9): [True: 37, False: 1.93k]
  ------------------
 1474|     37|        {
 1475|     37|            CADPolylinePFace * polyline = new CADPolylinePFace();
 1476|     37|            CADPolylinePFaceObject * cadpolyPface = static_cast<CADPolylinePFaceObject *>(
 1477|     37|                    readObject);
 1478|       |
 1479|       |            // TODO: code can be much simplified if CADHandle will be used.
 1480|       |            // to do so, == and ++ operators should be implemented.
 1481|     37|            unique_ptr<CADVertexPFaceObject> vertex;
 1482|     37|            auto dCurrentEntHandle = cadpolyPface->hVertices[0].getAsLong();
 1483|     37|            auto dLastEntHandle = cadpolyPface->hVertices[1].getAsLong();
 1484|     37|            while( true )
  ------------------
  |  Branch (1484:20): [Folded - Ignored]
  ------------------
 1485|     37|            {
 1486|     37|                CADObject *pCADVertexPFaceObject = GetObject( dCurrentEntHandle );
 1487|     37|                vertex.reset( dynamic_cast<CADVertexPFaceObject *>(
 1488|     37|                                      pCADVertexPFaceObject ) );
 1489|       |                /* TODO: this check is excessive, but if something goes wrong way -
 1490|       |             * some part of geometries will be parsed. */
 1491|     37|                if( !vertex )
  ------------------
  |  Branch (1491:21): [True: 37, False: 0]
  ------------------
 1492|     37|                {
 1493|     37|                    delete pCADVertexPFaceObject;
 1494|     37|                    break;
 1495|     37|                }
 1496|       |
 1497|      0|                polyline->addVertex( vertex->vertPosition );
 1498|       |
 1499|       |                /* FIXME: somehow one more vertex which isnot presented is read.
 1500|       |             * so, checking the number of added vertices */
 1501|       |                /*TODO: is this needed - check on real data
 1502|       |            if ( polyline->hVertices.size() == cadpolyPface->nNumVertices )
 1503|       |            {
 1504|       |                delete( vertex );
 1505|       |                break;
 1506|       |            }*/
 1507|       |
 1508|      0|                if( vertex->stCed.bNoLinks )
  ------------------
  |  Branch (1508:21): [True: 0, False: 0]
  ------------------
 1509|      0|                    ++dCurrentEntHandle;
 1510|      0|                else
 1511|      0|                    dCurrentEntHandle = vertex->stChed.hNextEntity.getAsLong( vertex->stCed.hObjectHandle );
 1512|       |
 1513|      0|                if( dCurrentEntHandle == dLastEntHandle )
  ------------------
  |  Branch (1513:21): [True: 0, False: 0]
  ------------------
 1514|      0|                {
 1515|      0|                    CADObject *pCADVertexPFaceObjectV = GetObject( dCurrentEntHandle );
 1516|      0|                    vertex.reset( dynamic_cast<CADVertexPFaceObject *>(
 1517|      0|                                          pCADVertexPFaceObjectV) );
 1518|      0|                    if(vertex)
  ------------------
  |  Branch (1518:24): [True: 0, False: 0]
  ------------------
 1519|      0|                    {
 1520|      0|                        polyline->addVertex( vertex->vertPosition );
 1521|      0|                    }
 1522|      0|                    else
 1523|      0|                    {
 1524|      0|                        delete pCADVertexPFaceObjectV;
 1525|      0|                    }
 1526|      0|                    break;
 1527|      0|                }
 1528|      0|            }
 1529|       |
 1530|     37|            poGeometry = polyline;
 1531|     37|            break;
 1532|      0|        }
 1533|       |
 1534|     10|        case CADObject::XLINE:
  ------------------
  |  Branch (1534:9): [True: 10, False: 1.96k]
  ------------------
 1535|     10|        {
 1536|     10|            CADXLine * xline = new CADXLine();
 1537|     10|            CADXLineObject * cadxLine = static_cast<CADXLineObject *>(
 1538|     10|                    readObject);
 1539|       |
 1540|     10|            xline->setVectVector( cadxLine->vectVector );
 1541|     10|            xline->setPosition( cadxLine->vertPosition );
 1542|       |
 1543|     10|            poGeometry = xline;
 1544|     10|            break;
 1545|      0|        }
 1546|       |
 1547|     52|        case CADObject::FACE3D:
  ------------------
  |  Branch (1547:9): [True: 52, False: 1.91k]
  ------------------
 1548|     52|        {
 1549|     52|            CADFace3D * face = new CADFace3D();
 1550|     52|            CAD3DFaceObject * cad3DFace = static_cast<CAD3DFaceObject *>(
 1551|     52|                    readObject);
 1552|       |
 1553|     52|            for( const CADVector& corner : cad3DFace->avertCorners )
  ------------------
  |  Branch (1553:42): [True: 208, False: 52]
  ------------------
 1554|    208|                face->addCorner( corner );
 1555|     52|            face->setInvisFlags( cad3DFace->dInvisFlags );
 1556|       |
 1557|     52|            poGeometry = face;
 1558|     52|            break;
 1559|      0|        }
 1560|       |
 1561|      0|        case CADObject::POLYLINE_MESH:
  ------------------
  |  Branch (1561:9): [True: 0, False: 1.97k]
  ------------------
 1562|     30|        case CADObject::VERTEX_MESH:
  ------------------
  |  Branch (1562:9): [True: 30, False: 1.94k]
  ------------------
 1563|     30|        case CADObject::VERTEX_PFACE_FACE:
  ------------------
  |  Branch (1563:9): [True: 0, False: 1.97k]
  ------------------
 1564|     62|        default:
  ------------------
  |  Branch (1564:9): [True: 32, False: 1.93k]
  ------------------
 1565|     62|            std::cerr << "Asked geometry has unsupported type.\n";
 1566|     62|            poGeometry = new CADUnknown();
 1567|     62|            break;
 1568|  1.97k|    }
 1569|       |
 1570|  1.97k|    if( poGeometry == nullptr )
  ------------------
  |  Branch (1570:9): [True: 3, False: 1.96k]
  ------------------
 1571|      3|        return nullptr;
 1572|       |
 1573|       |    // Applying color
 1574|  1.96k|    if( readObject->stCed.nCMColor == 256 ) // BYLAYER CASE
  ------------------
  |  Branch (1574:9): [True: 646, False: 1.32k]
  ------------------
 1575|    646|    {
 1576|    646|        CADLayer& oCurrentLayer = this->GetLayer( iLayerIndex );
 1577|    646|        poGeometry->setColor( getCADACIColor( oCurrentLayer.getColor() ) );
 1578|    646|    }
 1579|  1.32k|    else if( readObject->stCed.nCMColor <= 255 &&
  ------------------
  |  Branch (1579:14): [True: 1.19k, False: 124]
  ------------------
 1580|  1.32k|             readObject->stCed.nCMColor >= 0 ) // Excessive check until BYBLOCK case will not be implemented
  ------------------
  |  Branch (1580:14): [True: 1.09k, False: 106]
  ------------------
 1581|  1.09k|    {
 1582|  1.09k|        poGeometry->setColor( getCADACIColor( readObject->stCed.nCMColor ) );
 1583|  1.09k|    }
 1584|       |
 1585|       |    // Applying EED
 1586|       |    // Casting object's EED to a vector of strings
 1587|  1.96k|    vector<string> asEED;
 1588|  1.96k|    for( auto citer = readObject->stCed.aEED.cbegin();
 1589|  10.3k|         citer != readObject->stCed.aEED.cend(); ++citer )
  ------------------
  |  Branch (1589:10): [True: 8.36k, False: 1.96k]
  ------------------
 1590|  8.36k|    {
 1591|  8.36k|        string sEED = "";
 1592|       |        // Detect the type of EED entity
 1593|  8.36k|        switch( citer->acData[0] )
 1594|  8.36k|        {
 1595|    735|            case 0: // String
  ------------------
  |  Branch (1595:13): [True: 735, False: 7.62k]
  ------------------
 1596|    735|            {
 1597|    735|                if( citer->acData.size() > 1 )
  ------------------
  |  Branch (1597:21): [True: 729, False: 6]
  ------------------
 1598|    729|                {
 1599|    729|                    unsigned char nStrSize = citer->acData[1];
 1600|       |                    // +2 = skip CodePage, no idea how to use it anyway
 1601|       |
 1602|    729|                    if(nStrSize > 0)
  ------------------
  |  Branch (1602:24): [True: 405, False: 324]
  ------------------
 1603|    405|                    {
 1604|  17.9k|                        for( size_t i = 0; i < nStrSize &&
  ------------------
  |  Branch (1604:44): [True: 17.7k, False: 281]
  ------------------
 1605|  17.9k|                            i + 4 < citer->acData.size(); ++i )
  ------------------
  |  Branch (1605:29): [True: 17.5k, False: 124]
  ------------------
 1606|  17.5k|                        {
 1607|  17.5k|                            sEED += citer->acData[i + 4];
 1608|  17.5k|                        }
 1609|    405|                    }
 1610|    729|                }
 1611|    735|                break;
 1612|      0|            }
 1613|     91|            case 1: // Invalid
  ------------------
  |  Branch (1613:13): [True: 91, False: 8.27k]
  ------------------
 1614|     91|            {
 1615|     91|                DebugMsg( "Error: EED obj type is 1, error in R2000::getGeometry()" );
 1616|     91|                break;
 1617|      0|            }
 1618|    434|            case 2: // { or }
  ------------------
  |  Branch (1618:13): [True: 434, False: 7.93k]
  ------------------
 1619|    434|            {
 1620|    434|                if( citer->acData.size() > 1 )
  ------------------
  |  Branch (1620:21): [True: 431, False: 3]
  ------------------
 1621|    431|                {
 1622|    431|                    sEED += citer->acData[1] == 0 ? '{' : '}';
  ------------------
  |  Branch (1622:29): [True: 18, False: 413]
  ------------------
 1623|    431|                }
 1624|    434|                break;
 1625|      0|            }
 1626|    248|            case 3: // Layer table ref
  ------------------
  |  Branch (1626:13): [True: 248, False: 8.11k]
  ------------------
 1627|    248|            {
 1628|       |                // FIXME: get CADHandle and return getAsLong() result.
 1629|    248|                sEED += "Layer table ref (handle):";
 1630|  2.23k|                for( size_t i = 0; i < 8 && i + 1 < citer->acData.size(); ++i )
  ------------------
  |  Branch (1630:36): [True: 1.98k, False: 248]
  |  Branch (1630:45): [True: 1.98k, False: 0]
  ------------------
 1631|  1.98k|                {
 1632|  1.98k|                    sEED += citer->acData[i + 1];
 1633|  1.98k|                }
 1634|    248|                break;
 1635|      0|            }
 1636|  1.08k|            case 4: // Binary chunk
  ------------------
  |  Branch (1636:13): [True: 1.08k, False: 7.28k]
  ------------------
 1637|  1.08k|            {
 1638|  1.08k|                if( citer->acData.size() > 1 )
  ------------------
  |  Branch (1638:21): [True: 1.07k, False: 6]
  ------------------
 1639|  1.07k|                {
 1640|  1.07k|                    unsigned char nChunkSize = citer->acData[1];
 1641|  1.07k|                    sEED += "Binary chunk (chars):";
 1642|  1.07k|                    if(nChunkSize > 0)
  ------------------
  |  Branch (1642:24): [True: 935, False: 139]
  ------------------
 1643|    935|                    {
 1644|  39.1k|                        for( size_t i = 0; i < nChunkSize &&
  ------------------
  |  Branch (1644:44): [True: 38.1k, False: 933]
  ------------------
 1645|  39.1k|                            i + 2 < citer->acData.size(); ++i )
  ------------------
  |  Branch (1645:29): [True: 38.1k, False: 2]
  ------------------
 1646|  38.1k|                        {
 1647|  38.1k|                            sEED += citer->acData[i + 2];
 1648|  38.1k|                        }
 1649|    935|                    }
 1650|    139|                    else
 1651|    139|                    {
 1652|    139|                        sEED += "?";
 1653|    139|                    }
 1654|  1.07k|                }
 1655|  1.08k|                break;
 1656|      0|            }
 1657|    256|            case 5: // Entity handle ref
  ------------------
  |  Branch (1657:13): [True: 256, False: 8.10k]
  ------------------
 1658|    256|            {
 1659|       |                // FIXME: Get CADHandle and return getAsLong() result.
 1660|    256|                sEED += "Entity handle ref (handle):";
 1661|  2.30k|                for( size_t i = 0; i < 8 && i + 1 < citer->acData.size(); ++i )
  ------------------
  |  Branch (1661:36): [True: 2.04k, False: 256]
  |  Branch (1661:45): [True: 2.04k, False: 0]
  ------------------
 1662|  2.04k|                {
 1663|  2.04k|                    sEED += citer->acData[i + 1];
 1664|  2.04k|                }
 1665|    256|                break;
 1666|      0|            }
 1667|    236|            case 10:
  ------------------
  |  Branch (1667:13): [True: 236, False: 8.12k]
  ------------------
 1668|    480|            case 11:
  ------------------
  |  Branch (1668:13): [True: 244, False: 8.12k]
  ------------------
 1669|    681|            case 12:
  ------------------
  |  Branch (1669:13): [True: 201, False: 8.16k]
  ------------------
 1670|    905|            case 13:
  ------------------
  |  Branch (1670:13): [True: 224, False: 8.14k]
  ------------------
 1671|    905|            {
 1672|    905|                sEED += "Point: {";
 1673|    905|                double dfX = 0, dfY = 0, dfZ = 0;
 1674|    905|                if(citer->acData.size() > 24)
  ------------------
  |  Branch (1674:20): [True: 902, False: 3]
  ------------------
 1675|    902|                {
 1676|    902|                    memcpy( & dfX, citer->acData.data() + 1, 8 );
 1677|    902|                    memcpy( & dfY, citer->acData.data() + 9, 8 );
 1678|    902|                    memcpy( & dfZ, citer->acData.data() + 17, 8 );
 1679|    902|                }
 1680|    905|                sEED += std::to_string( dfX );
 1681|    905|                sEED += ';';
 1682|    905|                sEED += std::to_string( dfY );
 1683|    905|                sEED += ';';
 1684|    905|                sEED += std::to_string( dfZ );
 1685|    905|                sEED += '}';
 1686|    905|                break;
 1687|    681|            }
 1688|     18|            case 40:
  ------------------
  |  Branch (1688:13): [True: 18, False: 8.34k]
  ------------------
 1689|    128|            case 41:
  ------------------
  |  Branch (1689:13): [True: 110, False: 8.25k]
  ------------------
 1690|    768|            case 42:
  ------------------
  |  Branch (1690:13): [True: 640, False: 7.72k]
  ------------------
 1691|    768|            {
 1692|    768|                sEED += "Double:";
 1693|    768|                double dfVal = 0;
 1694|    768|                if(citer->acData.size() > 8)
  ------------------
  |  Branch (1694:20): [True: 768, False: 0]
  ------------------
 1695|    768|                    memcpy( & dfVal, citer->acData.data() + 1, 8 );
 1696|    768|                sEED += std::to_string( dfVal );
 1697|    768|                break;
 1698|    128|            }
 1699|    721|            case 70:
  ------------------
  |  Branch (1699:13): [True: 721, False: 7.64k]
  ------------------
 1700|    721|            {
 1701|    721|                sEED += "Short:";
 1702|    721|                int16_t dVal = 0;
 1703|    721|                if(citer->acData.size() > 2)
  ------------------
  |  Branch (1703:20): [True: 720, False: 1]
  ------------------
 1704|    720|                    memcpy( & dVal, citer->acData.data() + 1, 2 );
 1705|    721|                sEED += std::to_string( dVal );
 1706|    721|                break;
 1707|    128|            }
 1708|    698|            case 71:
  ------------------
  |  Branch (1708:13): [True: 698, False: 7.66k]
  ------------------
 1709|    698|            {
 1710|    698|                sEED += "Long Int:";
 1711|    698|                int32_t dVal = 0;
 1712|    698|                if(citer->acData.size() > 4)
  ------------------
  |  Branch (1712:20): [True: 698, False: 0]
  ------------------
 1713|    698|                    memcpy( & dVal, citer->acData.data() + 1, 4 );
 1714|    698|                sEED += std::to_string( dVal );
 1715|    698|                break;
 1716|    128|            }
 1717|  2.42k|            default:
  ------------------
  |  Branch (1717:13): [True: 2.42k, False: 5.93k]
  ------------------
 1718|  2.42k|            {
 1719|  2.42k|                DebugMsg( "Error in parsing geometry EED: undefined typecode: %d",
 1720|  2.42k|                          static_cast<int>(citer->acData[0]) );
 1721|  2.42k|            }
 1722|  8.36k|        }
 1723|  8.36k|        asEED.emplace_back( sEED );
 1724|  8.36k|    }
 1725|       |
 1726|       |    // Getting block reference attributes.
 1727|  1.96k|    if( dBlockRefHandle != 0 )
  ------------------
  |  Branch (1727:9): [True: 0, False: 1.96k]
  ------------------
 1728|      0|    {
 1729|      0|        vector<CADAttrib>           blockRefAttributes;
 1730|      0|        CADObject *pCADInsertObject = GetObject( dBlockRefHandle );
 1731|      0|        unique_ptr<CADInsertObject> spoBlockRef(
 1732|      0|                    dynamic_cast<CADInsertObject *>( pCADInsertObject ) );
 1733|       |
 1734|      0|        if( spoBlockRef )
  ------------------
  |  Branch (1734:13): [True: 0, False: 0]
  ------------------
 1735|      0|        {
 1736|      0|            if( !spoBlockRef->hAttribs.empty() )
  ------------------
  |  Branch (1736:17): [True: 0, False: 0]
  ------------------
 1737|      0|            {
 1738|      0|                long dCurrentEntHandle = spoBlockRef->hAttribs[0].getAsLong();
 1739|      0|                long dLastEntHandle    = spoBlockRef->hAttribs[0].getAsLong();
 1740|       |
 1741|      0|                while( spoBlockRef->bHasAttribs )
  ------------------
  |  Branch (1741:24): [True: 0, False: 0]
  ------------------
 1742|      0|                {
 1743|      0|                    CADObject *pCADAttDefObj = GetObject( dCurrentEntHandle, true );
 1744|       |
 1745|      0|                    CADEntityObject * attDefObj =
 1746|      0|                            dynamic_cast<CADEntityObject *>( pCADAttDefObj );
 1747|       |
 1748|      0|                    if( dCurrentEntHandle == dLastEntHandle )
  ------------------
  |  Branch (1748:25): [True: 0, False: 0]
  ------------------
 1749|      0|                    {
 1750|      0|                        if( attDefObj == nullptr )
  ------------------
  |  Branch (1750:29): [True: 0, False: 0]
  ------------------
 1751|      0|                        {
 1752|      0|                            delete pCADAttDefObj;
 1753|      0|                            break;
 1754|      0|                        }
 1755|       |
 1756|      0|                        auto geometry = GetGeometry( iLayerIndex, dCurrentEntHandle );
 1757|      0|                        CADAttrib * attrib = dynamic_cast<CADAttrib *>(geometry);
 1758|      0|                        if( attrib )
  ------------------
  |  Branch (1758:29): [True: 0, False: 0]
  ------------------
 1759|      0|                        {
 1760|      0|                            blockRefAttributes.push_back( CADAttrib( * attrib ) );
 1761|      0|                        }
 1762|      0|                        delete geometry;
 1763|      0|                        delete attDefObj;
 1764|      0|                        break;
 1765|      0|                    }
 1766|       |
 1767|      0|                    if( attDefObj != nullptr )
  ------------------
  |  Branch (1767:25): [True: 0, False: 0]
  ------------------
 1768|      0|                    {
 1769|      0|                        if( attDefObj->stCed.bNoLinks )
  ------------------
  |  Branch (1769:29): [True: 0, False: 0]
  ------------------
 1770|      0|                            ++dCurrentEntHandle;
 1771|      0|                        else
 1772|      0|                            dCurrentEntHandle = attDefObj->stChed.hNextEntity.getAsLong( attDefObj->stCed.hObjectHandle );
 1773|       |
 1774|      0|                        auto geometry = GetGeometry( iLayerIndex, dCurrentEntHandle );
 1775|      0|                        CADAttrib * attrib = dynamic_cast<CADAttrib *>(geometry);
 1776|      0|                        if( attrib )
  ------------------
  |  Branch (1776:29): [True: 0, False: 0]
  ------------------
 1777|      0|                        {
 1778|      0|                            blockRefAttributes.push_back( CADAttrib( * attrib ) );
 1779|      0|                        }
 1780|      0|                        delete geometry;
 1781|      0|                        delete attDefObj;
 1782|      0|                    }
 1783|      0|                    else
 1784|      0|                    {
 1785|      0|                        delete pCADAttDefObj;
 1786|      0|                    }
 1787|      0|                }
 1788|      0|                poGeometry->setBlockAttributes( blockRefAttributes );
 1789|      0|            }
 1790|      0|        }
 1791|      0|        else
 1792|      0|        {
 1793|      0|            delete pCADInsertObject;
 1794|      0|        }
 1795|      0|    }
 1796|       |
 1797|  1.96k|    poGeometry->setEED( asEED );
 1798|  1.96k|    return poGeometry;
 1799|  1.96k|}
_ZN12DWGFileR200010getEllipseEjRK11CADCommonEDR9CADBuffer:
 1823|    594|{
 1824|    594|    CADEllipseObject * ellipse = new CADEllipseObject();
 1825|       |
 1826|    594|    ellipse->setSize( dObjectSize );
 1827|    594|    ellipse->stCed = stCommonEntityData;
 1828|       |
 1829|    594|    CADVector vertPosition = buffer.ReadVector();
 1830|       |
 1831|    594|    ellipse->vertPosition = vertPosition;
 1832|       |
 1833|    594|    CADVector vectSMAxis = buffer.ReadVector();
 1834|       |
 1835|    594|    ellipse->vectSMAxis = vectSMAxis;
 1836|       |
 1837|    594|    CADVector vectExtrusion = buffer.ReadVector();
 1838|       |
 1839|    594|    ellipse->vectExtrusion = vectExtrusion;
 1840|       |
 1841|    594|    ellipse->dfAxisRatio = buffer.ReadBITDOUBLE();
 1842|    594|    ellipse->dfBegAngle  = buffer.ReadBITDOUBLE();
 1843|    594|    ellipse->dfEndAngle  = buffer.ReadBITDOUBLE();
 1844|       |
 1845|    594|    fillCommonEntityHandleData(ellipse, buffer);
 1846|       |
 1847|    594|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 1848|    594|    ellipse->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "ELLIPSE" ) );
 1849|       |
 1850|    594|    return ellipse;
 1851|    594|}
_ZN12DWGFileR20008getSolidEjRK11CADCommonEDR9CADBuffer:
 1856|  1.15k|{
 1857|  1.15k|    CADSolidObject * solid = new CADSolidObject();
 1858|       |
 1859|  1.15k|    solid->setSize( dObjectSize );
 1860|  1.15k|    solid->stCed = stCommonEntityData;
 1861|       |
 1862|  1.15k|    solid->dfThickness = buffer.ReadBIT() ? 0.0f : buffer.ReadBITDOUBLE();
  ------------------
  |  Branch (1862:26): [True: 447, False: 706]
  ------------------
 1863|       |
 1864|  1.15k|    solid->dfElevation = buffer.ReadBITDOUBLE();
 1865|       |
 1866|  1.15k|    CADVector   oCorner;
 1867|  5.76k|    for( size_t i = 0; i < 4; ++i )
  ------------------
  |  Branch (1867:24): [True: 4.61k, False: 1.15k]
  ------------------
 1868|  4.61k|    {
 1869|  4.61k|        oCorner.setX( buffer.ReadRAWDOUBLE() );
 1870|  4.61k|        oCorner.setY( buffer.ReadRAWDOUBLE() );
 1871|  4.61k|        solid->avertCorners.push_back( oCorner );
 1872|  4.61k|    }
 1873|       |
 1874|  1.15k|    if( buffer.ReadBIT() )
  ------------------
  |  Branch (1874:9): [True: 361, False: 792]
  ------------------
 1875|    361|    {
 1876|    361|        solid->vectExtrusion = CADVector( 0.0f, 0.0f, 1.0f );
 1877|    361|    }
 1878|    792|    else
 1879|    792|    {
 1880|    792|        CADVector vectExtrusion = buffer.ReadVector();
 1881|    792|        solid->vectExtrusion = vectExtrusion;
 1882|    792|    }
 1883|       |
 1884|       |
 1885|  1.15k|    fillCommonEntityHandleData( solid, buffer);
 1886|       |
 1887|  1.15k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 1888|  1.15k|    solid->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "SOLID" ) );
 1889|       |
 1890|  1.15k|    return solid;
 1891|  1.15k|}
_ZN12DWGFileR20008getPointEjRK11CADCommonEDR9CADBuffer:
 1896|    710|{
 1897|    710|    CADPointObject * point = new CADPointObject();
 1898|       |
 1899|    710|    point->setSize( dObjectSize );
 1900|    710|    point->stCed = stCommonEntityData;
 1901|       |
 1902|    710|    CADVector vertPosition = buffer.ReadVector();
 1903|       |
 1904|    710|    point->vertPosition = vertPosition;
 1905|       |
 1906|    710|    point->dfThickness = buffer.ReadBIT() ? 0.0f : buffer.ReadBITDOUBLE();
  ------------------
  |  Branch (1906:26): [True: 307, False: 403]
  ------------------
 1907|       |
 1908|    710|    if( buffer.ReadBIT() )
  ------------------
  |  Branch (1908:9): [True: 290, False: 420]
  ------------------
 1909|    290|    {
 1910|    290|        point->vectExtrusion = CADVector( 0.0f, 0.0f, 1.0f );
 1911|    290|    }
 1912|    420|    else
 1913|    420|    {
 1914|    420|        CADVector vectExtrusion = buffer.ReadVector();
 1915|    420|        point->vectExtrusion = vectExtrusion;
 1916|    420|    }
 1917|       |
 1918|    710|    point->dfXAxisAng = buffer.ReadBITDOUBLE();
 1919|       |
 1920|    710|    fillCommonEntityHandleData( point, buffer);
 1921|       |
 1922|    710|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 1923|    710|    point->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "POINT" ) );
 1924|       |
 1925|    710|    return point;
 1926|    710|}
_ZN12DWGFileR200013getPolyLine3DEjRK11CADCommonEDR9CADBuffer:
 1931|    939|{
 1932|    939|    CADPolyline3DObject * polyline = new CADPolyline3DObject();
 1933|       |
 1934|    939|    polyline->setSize( dObjectSize );
 1935|    939|    polyline->stCed = stCommonEntityData;
 1936|       |
 1937|    939|    polyline->SplinedFlags = buffer.ReadCHAR();
 1938|    939|    polyline->ClosedFlags  = buffer.ReadCHAR();
 1939|       |
 1940|    939|    fillCommonEntityHandleData( polyline, buffer );
 1941|       |
 1942|    939|    polyline->hVertices.push_back( buffer.ReadHANDLE() ); // 1st vertex
 1943|    939|    polyline->hVertices.push_back( buffer.ReadHANDLE() ); // last vertex
 1944|       |
 1945|    939|    polyline->hSeqend = buffer.ReadHANDLE();
 1946|       |
 1947|    939|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 1948|    939|    polyline->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "POLYLINE" ) );
 1949|       |
 1950|    939|    return polyline;
 1951|    939|}
_ZN12DWGFileR20006getRayEjRK11CADCommonEDR9CADBuffer:
 1956|    886|{
 1957|    886|    CADRayObject * ray = new CADRayObject();
 1958|       |
 1959|    886|    ray->setSize( dObjectSize );
 1960|    886|    ray->stCed = stCommonEntityData;
 1961|       |
 1962|    886|    CADVector vertPosition = buffer.ReadVector();
 1963|       |
 1964|    886|    ray->vertPosition = vertPosition;
 1965|       |
 1966|    886|    CADVector vectVector = buffer.ReadVector();
 1967|    886|    ray->vectVector = vectVector;
 1968|       |
 1969|    886|    fillCommonEntityHandleData( ray, buffer);
 1970|       |
 1971|    886|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 1972|    886|    ray->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "RAY" ) );
 1973|       |
 1974|    886|    return ray;
 1975|    886|}
_ZN12DWGFileR20008getXLineEjRK11CADCommonEDR9CADBuffer:
 1980|    476|{
 1981|    476|    CADXLineObject * xline = new CADXLineObject();
 1982|       |
 1983|    476|    xline->setSize( dObjectSize );
 1984|    476|    xline->stCed = stCommonEntityData;
 1985|       |
 1986|    476|    CADVector vertPosition = buffer.ReadVector();
 1987|       |
 1988|    476|    xline->vertPosition = vertPosition;
 1989|       |
 1990|    476|    CADVector vectVector = buffer.ReadVector();
 1991|    476|    xline->vectVector = vectVector;
 1992|       |
 1993|    476|    fillCommonEntityHandleData( xline, buffer);
 1994|       |
 1995|    476|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 1996|    476|    xline->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "XLINE" ) );
 1997|       |
 1998|    476|    return xline;
 1999|    476|}
_ZN12DWGFileR20007getLineEjRK11CADCommonEDR9CADBuffer:
 2004|  1.00k|{
 2005|  1.00k|    CADLineObject * line = new CADLineObject();
 2006|       |
 2007|  1.00k|    line->setSize( dObjectSize );
 2008|  1.00k|    line->stCed = stCommonEntityData;
 2009|       |
 2010|  1.00k|    bool bZsAreZeros = buffer.ReadBIT();
 2011|       |
 2012|  1.00k|    CADVector vertStart, vertEnd;
 2013|  1.00k|    vertStart.setX( buffer.ReadRAWDOUBLE() );
 2014|  1.00k|    vertEnd.setX( buffer.ReadBITDOUBLEWD(vertStart.getX() ) );
 2015|  1.00k|    vertStart.setY( buffer.ReadRAWDOUBLE() );
 2016|  1.00k|    vertEnd.setY( buffer.ReadBITDOUBLEWD(vertStart.getY() ) );
 2017|       |
 2018|  1.00k|    if( !bZsAreZeros )
  ------------------
  |  Branch (2018:9): [True: 573, False: 436]
  ------------------
 2019|    573|    {
 2020|    573|        vertStart.setZ( buffer.ReadBITDOUBLE() );
 2021|    573|        vertEnd.setZ( buffer.ReadBITDOUBLEWD(vertStart.getZ() ) );
 2022|    573|    }
 2023|       |
 2024|  1.00k|    line->vertStart = vertStart;
 2025|  1.00k|    line->vertEnd   = vertEnd;
 2026|       |
 2027|  1.00k|    line->dfThickness = buffer.ReadBIT() ? 0.0f : buffer.ReadBITDOUBLE();
  ------------------
  |  Branch (2027:25): [True: 369, False: 640]
  ------------------
 2028|       |
 2029|  1.00k|    if( buffer.ReadBIT() )
  ------------------
  |  Branch (2029:9): [True: 220, False: 789]
  ------------------
 2030|    220|    {
 2031|    220|        line->vectExtrusion = CADVector( 0.0f, 0.0f, 1.0f );
 2032|    220|    } else
 2033|    789|    {
 2034|    789|        CADVector vectExtrusion = buffer.ReadVector();
 2035|    789|        line->vectExtrusion = vectExtrusion;
 2036|    789|    }
 2037|       |
 2038|  1.00k|    fillCommonEntityHandleData( line, buffer);
 2039|       |
 2040|  1.00k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2041|  1.00k|    line->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "LINE" ) );
 2042|  1.00k|    return line;
 2043|  1.00k|}
_ZN12DWGFileR20007getTextEjRK11CADCommonEDR9CADBuffer:
 2048|  1.67k|{
 2049|  1.67k|    CADTextObject * text = new CADTextObject();
 2050|       |
 2051|  1.67k|    text->setSize( dObjectSize );
 2052|  1.67k|    text->stCed = stCommonEntityData;
 2053|       |
 2054|  1.67k|    text->DataFlags = buffer.ReadCHAR();
 2055|       |
 2056|  1.67k|    if( !( text->DataFlags & 0x01 ) )
  ------------------
  |  Branch (2056:9): [True: 791, False: 884]
  ------------------
 2057|    791|    {
 2058|    791|        text->dfElevation = buffer.ReadRAWDOUBLE();
 2059|    791|    }
 2060|       |
 2061|  1.67k|    CADVector vertInsetionPoint = buffer.ReadRAWVector();
 2062|       |
 2063|  1.67k|    text->vertInsetionPoint = vertInsetionPoint;
 2064|       |
 2065|  1.67k|    if( !( text->DataFlags & 0x02 ) )
  ------------------
  |  Branch (2065:9): [True: 1.05k, False: 620]
  ------------------
 2066|  1.05k|    {
 2067|  1.05k|        double x, y;
 2068|  1.05k|        x = buffer.ReadBITDOUBLEWD(vertInsetionPoint.getX() );
 2069|  1.05k|        y = buffer.ReadBITDOUBLEWD(vertInsetionPoint.getY() );
 2070|  1.05k|        CADVector vertAlignmentPoint( x, y );
 2071|  1.05k|        text->vertAlignmentPoint = vertAlignmentPoint;
 2072|  1.05k|    }
 2073|       |
 2074|  1.67k|    if( buffer.ReadBIT() )
  ------------------
  |  Branch (2074:9): [True: 493, False: 1.18k]
  ------------------
 2075|    493|    {
 2076|    493|        text->vectExtrusion = CADVector( 0.0f, 0.0f, 1.0f );
 2077|    493|    }
 2078|  1.18k|    else
 2079|  1.18k|    {
 2080|  1.18k|        CADVector vectExtrusion = buffer.ReadVector();
 2081|  1.18k|        text->vectExtrusion = vectExtrusion;
 2082|  1.18k|    }
 2083|       |
 2084|  1.67k|    text->dfThickness = buffer.ReadBIT() ? 0.0f : buffer.ReadBITDOUBLE();
  ------------------
  |  Branch (2084:25): [True: 664, False: 1.01k]
  ------------------
 2085|       |
 2086|  1.67k|    if( !( text->DataFlags & 0x04 ) )
  ------------------
  |  Branch (2086:9): [True: 1.11k, False: 562]
  ------------------
 2087|  1.11k|        text->dfObliqueAng  = buffer.ReadRAWDOUBLE();
 2088|  1.67k|    if( !( text->DataFlags & 0x08 ) )
  ------------------
  |  Branch (2088:9): [True: 1.14k, False: 530]
  ------------------
 2089|  1.14k|        text->dfRotationAng = buffer.ReadRAWDOUBLE();
 2090|       |
 2091|  1.67k|    text->dfHeight = buffer.ReadRAWDOUBLE();
 2092|       |
 2093|  1.67k|    if( !( text->DataFlags & 0x10 ) )
  ------------------
  |  Branch (2093:9): [True: 922, False: 753]
  ------------------
 2094|    922|        text->dfWidthFactor = buffer.ReadRAWDOUBLE();
 2095|       |
 2096|  1.67k|    text->sTextValue = buffer.ReadTV();
 2097|       |
 2098|  1.67k|    if( !( text->DataFlags & 0x20 ) )
  ------------------
  |  Branch (2098:9): [True: 975, False: 700]
  ------------------
 2099|    975|        text->dGeneration = buffer.ReadBITSHORT();
 2100|  1.67k|    if( !( text->DataFlags & 0x40 ) )
  ------------------
  |  Branch (2100:9): [True: 1.00k, False: 669]
  ------------------
 2101|  1.00k|        text->dHorizAlign = buffer.ReadBITSHORT();
 2102|  1.67k|    if( !( text->DataFlags & 0x80 ) )
  ------------------
  |  Branch (2102:9): [True: 996, False: 679]
  ------------------
 2103|    996|        text->dVertAlign  = buffer.ReadBITSHORT();
 2104|       |
 2105|  1.67k|    fillCommonEntityHandleData( text, buffer);
 2106|       |
 2107|  1.67k|    text->hStyle = buffer.ReadHANDLE();
 2108|       |
 2109|  1.67k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2110|  1.67k|    text->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "TEXT" ) );
 2111|       |
 2112|  1.67k|    return text;
 2113|  1.67k|}
_ZN12DWGFileR200011getVertex3DEjRK11CADCommonEDR9CADBuffer:
 2118|    509|{
 2119|    509|    CADVertex3DObject * vertex = new CADVertex3DObject();
 2120|       |
 2121|    509|    vertex->setSize( dObjectSize );
 2122|    509|    vertex->stCed = stCommonEntityData;
 2123|       |
 2124|       |    /*unsigned char Flags = */buffer.ReadCHAR();
 2125|       |
 2126|    509|    CADVector vertPosition = buffer.ReadVector();
 2127|    509|    vertex->vertPosition = vertPosition;
 2128|       |
 2129|    509|    fillCommonEntityHandleData( vertex, buffer);
 2130|       |
 2131|    509|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2132|    509|    vertex->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "VERTEX" ) );
 2133|    509|    return vertex;
 2134|    509|}
_ZN12DWGFileR20009getCircleEjRK11CADCommonEDR9CADBuffer:
 2139|  1.04k|{
 2140|  1.04k|    CADCircleObject * circle = new CADCircleObject();
 2141|       |
 2142|  1.04k|    circle->setSize( dObjectSize );
 2143|  1.04k|    circle->stCed = stCommonEntityData;
 2144|       |
 2145|  1.04k|    CADVector vertPosition = buffer.ReadVector();
 2146|  1.04k|    circle->vertPosition = vertPosition;
 2147|  1.04k|    circle->dfRadius     = buffer.ReadBITDOUBLE();
 2148|  1.04k|    circle->dfThickness  = buffer.ReadBIT() ? 0.0f : buffer.ReadBITDOUBLE();
  ------------------
  |  Branch (2148:28): [True: 237, False: 804]
  ------------------
 2149|       |
 2150|  1.04k|    if( buffer.ReadBIT() )
  ------------------
  |  Branch (2150:9): [True: 700, False: 341]
  ------------------
 2151|    700|    {
 2152|    700|        circle->vectExtrusion = CADVector( 0.0f, 0.0f, 1.0f );
 2153|    700|    }
 2154|    341|    else
 2155|    341|    {
 2156|    341|        CADVector vectExtrusion = buffer.ReadVector();
 2157|    341|        circle->vectExtrusion = vectExtrusion;
 2158|    341|    }
 2159|       |
 2160|  1.04k|    fillCommonEntityHandleData( circle, buffer);
 2161|       |
 2162|  1.04k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2163|  1.04k|    circle->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "CIRCLE" ) );
 2164|  1.04k|    return circle;
 2165|  1.04k|}
_ZN12DWGFileR200013getPolyline2DEjRK11CADCommonEDR9CADBuffer:
 2186|    864|{
 2187|    864|    CADPolyline2DObject * polyline = new CADPolyline2DObject();
 2188|       |
 2189|    864|    polyline->setSize( dObjectSize );
 2190|    864|    polyline->stCed = stCommonEntityData;
 2191|       |
 2192|    864|    polyline->dFlags                = buffer.ReadBITSHORT();
 2193|    864|    polyline->dCurveNSmoothSurfType = buffer.ReadBITSHORT();
 2194|       |
 2195|    864|    polyline->dfStartWidth = buffer.ReadBITDOUBLE();
 2196|    864|    polyline->dfEndWidth   = buffer.ReadBITDOUBLE();
 2197|       |
 2198|    864|    polyline->dfThickness = buffer.ReadBIT() ? 0.0f : buffer.ReadBITDOUBLE();
  ------------------
  |  Branch (2198:29): [True: 482, False: 382]
  ------------------
 2199|       |
 2200|    864|    polyline->dfElevation = buffer.ReadBITDOUBLE();
 2201|       |
 2202|    864|    if( buffer.ReadBIT() )
  ------------------
  |  Branch (2202:9): [True: 347, False: 517]
  ------------------
 2203|    347|    {
 2204|    347|        polyline->vectExtrusion = CADVector( 0.0f, 0.0f, 1.0f );
 2205|    347|    }
 2206|    517|    else
 2207|    517|    {
 2208|    517|        CADVector vectExtrusion = buffer.ReadVector();
 2209|    517|        polyline->vectExtrusion = vectExtrusion;
 2210|    517|    }
 2211|       |
 2212|    864|    fillCommonEntityHandleData( polyline, buffer);
 2213|       |
 2214|    864|    polyline->hVertices.push_back( buffer.ReadHANDLE() ); // 1st vertex
 2215|    864|    polyline->hVertices.push_back( buffer.ReadHANDLE() ); // last vertex
 2216|       |
 2217|    864|    polyline->hSeqend = buffer.ReadHANDLE();
 2218|       |
 2219|    864|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2220|    864|    polyline->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "POLYLINE" ) );
 2221|    864|    return polyline;
 2222|    864|}
_ZN12DWGFileR200013getAttributesEjRK11CADCommonEDR9CADBuffer:
 2227|  3.91k|{
 2228|  3.91k|    CADAttribObject * attrib = new CADAttribObject();
 2229|       |
 2230|  3.91k|    attrib->setSize( dObjectSize );
 2231|  3.91k|    attrib->stCed     = stCommonEntityData;
 2232|  3.91k|    attrib->DataFlags = buffer.ReadCHAR();
 2233|       |
 2234|  3.91k|    if( !( attrib->DataFlags & 0x01 ) )
  ------------------
  |  Branch (2234:9): [True: 855, False: 3.05k]
  ------------------
 2235|    855|        attrib->dfElevation = buffer.ReadRAWDOUBLE();
 2236|       |
 2237|  3.91k|    double x, y;
 2238|       |
 2239|  3.91k|    CADVector vertInsetionPoint = buffer.ReadRAWVector();
 2240|  3.91k|    attrib->vertInsetionPoint = vertInsetionPoint;
 2241|       |
 2242|  3.91k|    if( !( attrib->DataFlags & 0x02 ) )
  ------------------
  |  Branch (2242:9): [True: 2.42k, False: 1.48k]
  ------------------
 2243|  2.42k|    {
 2244|  2.42k|        x = buffer.ReadBITDOUBLEWD( vertInsetionPoint.getX() );
 2245|  2.42k|        y = buffer.ReadBITDOUBLEWD( vertInsetionPoint.getY() );
 2246|  2.42k|        CADVector vertAlignmentPoint( x, y );
 2247|  2.42k|        attrib->vertAlignmentPoint = vertAlignmentPoint;
 2248|  2.42k|    }
 2249|       |
 2250|  3.91k|    if( buffer.ReadBIT() )
  ------------------
  |  Branch (2250:9): [True: 1.11k, False: 2.80k]
  ------------------
 2251|  1.11k|    {
 2252|  1.11k|        attrib->vectExtrusion = CADVector( 0.0f, 0.0f, 1.0f );
 2253|  1.11k|    }
 2254|  2.80k|    else
 2255|  2.80k|    {
 2256|  2.80k|        CADVector vectExtrusion = buffer.ReadVector();
 2257|  2.80k|        attrib->vectExtrusion = vectExtrusion;
 2258|  2.80k|    }
 2259|       |
 2260|  3.91k|    attrib->dfThickness = buffer.ReadBIT() ? 0.0f : buffer.ReadBITDOUBLE();
  ------------------
  |  Branch (2260:27): [True: 2.13k, False: 1.77k]
  ------------------
 2261|       |
 2262|  3.91k|    if( !( attrib->DataFlags & 0x04 ) )
  ------------------
  |  Branch (2262:9): [True: 2.58k, False: 1.33k]
  ------------------
 2263|  2.58k|        attrib->dfObliqueAng  = buffer.ReadRAWDOUBLE();
 2264|  3.91k|    if( !( attrib->DataFlags & 0x08 ) )
  ------------------
  |  Branch (2264:9): [True: 2.62k, False: 1.29k]
  ------------------
 2265|  2.62k|        attrib->dfRotationAng = buffer.ReadRAWDOUBLE();
 2266|  3.91k|    attrib->dfHeight          = buffer.ReadRAWDOUBLE();
 2267|  3.91k|    if( !( attrib->DataFlags & 0x10 ) )
  ------------------
  |  Branch (2267:9): [True: 637, False: 3.27k]
  ------------------
 2268|    637|        attrib->dfWidthFactor = buffer.ReadRAWDOUBLE();
 2269|  3.91k|    attrib->sTextValue        = buffer.ReadTV();
 2270|  3.91k|    if( !( attrib->DataFlags & 0x20 ) )
  ------------------
  |  Branch (2270:9): [True: 813, False: 3.10k]
  ------------------
 2271|    813|        attrib->dGeneration   = buffer.ReadBITSHORT();
 2272|  3.91k|    if( !( attrib->DataFlags & 0x40 ) )
  ------------------
  |  Branch (2272:9): [True: 829, False: 3.08k]
  ------------------
 2273|    829|        attrib->dHorizAlign   = buffer.ReadBITSHORT();
 2274|  3.91k|    if( !( attrib->DataFlags & 0x80 ) )
  ------------------
  |  Branch (2274:9): [True: 1.13k, False: 2.77k]
  ------------------
 2275|  1.13k|        attrib->dVertAlign    = buffer.ReadBITSHORT();
 2276|       |
 2277|  3.91k|    attrib->sTag         = buffer.ReadTV();
 2278|  3.91k|    attrib->nFieldLength = buffer.ReadBITSHORT();
 2279|  3.91k|    attrib->nFlags       = buffer.ReadCHAR();
 2280|       |
 2281|  3.91k|    fillCommonEntityHandleData( attrib, buffer);
 2282|       |
 2283|  3.91k|    attrib->hStyle = buffer.ReadHANDLE();
 2284|       |
 2285|  3.91k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2286|  3.91k|    attrib->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "ATTRIB" ) );
 2287|  3.91k|    return attrib;
 2288|  3.91k|}
_ZN12DWGFileR200017getAttributesDefnEjRK11CADCommonEDR9CADBuffer:
 2293|  2.51k|{
 2294|  2.51k|    CADAttdefObject * attdef = new CADAttdefObject();
 2295|       |
 2296|  2.51k|    attdef->setSize( dObjectSize );
 2297|  2.51k|    attdef->stCed     = stCommonEntityData;
 2298|  2.51k|    attdef->DataFlags = buffer.ReadCHAR();
 2299|       |
 2300|  2.51k|    if( ( attdef->DataFlags & 0x01 ) == 0 )
  ------------------
  |  Branch (2300:9): [True: 1.53k, False: 980]
  ------------------
 2301|  1.53k|        attdef->dfElevation = buffer.ReadRAWDOUBLE();
 2302|       |
 2303|  2.51k|    CADVector vertInsetionPoint = buffer.ReadRAWVector();
 2304|  2.51k|    attdef->vertInsetionPoint = vertInsetionPoint;
 2305|       |
 2306|  2.51k|    if( ( attdef->DataFlags & 0x02 ) == 0 )
  ------------------
  |  Branch (2306:9): [True: 1.57k, False: 940]
  ------------------
 2307|  1.57k|    {
 2308|  1.57k|        double x = buffer.ReadBITDOUBLEWD( vertInsetionPoint.getX() );
 2309|  1.57k|        double y = buffer.ReadBITDOUBLEWD( vertInsetionPoint.getY() );
 2310|  1.57k|        CADVector vertAlignmentPoint( x, y );
 2311|  1.57k|        attdef->vertAlignmentPoint = vertAlignmentPoint;
 2312|  1.57k|    }
 2313|       |
 2314|  2.51k|    if( buffer.ReadBIT() )
  ------------------
  |  Branch (2314:9): [True: 524, False: 1.98k]
  ------------------
 2315|    524|    {
 2316|    524|        attdef->vectExtrusion = CADVector( 0.0f, 0.0f, 1.0f );
 2317|    524|    }
 2318|  1.98k|    else
 2319|  1.98k|    {
 2320|  1.98k|        CADVector vectExtrusion = buffer.ReadVector();
 2321|  1.98k|        attdef->vectExtrusion = vectExtrusion;
 2322|  1.98k|    }
 2323|       |
 2324|  2.51k|    attdef->dfThickness = buffer.ReadBIT() ? 0.0f :
  ------------------
  |  Branch (2324:27): [True: 1.23k, False: 1.27k]
  ------------------
 2325|  2.51k|                          buffer.ReadBITDOUBLE();
 2326|       |
 2327|  2.51k|    if( ( attdef->DataFlags & 0x04 ) == 0 )
  ------------------
  |  Branch (2327:9): [True: 1.46k, False: 1.04k]
  ------------------
 2328|  1.46k|        attdef->dfObliqueAng  = buffer.ReadRAWDOUBLE();
 2329|  2.51k|    if( ( attdef->DataFlags & 0x08 ) == 0 )
  ------------------
  |  Branch (2329:9): [True: 1.51k, False: 995]
  ------------------
 2330|  1.51k|        attdef->dfRotationAng = buffer.ReadRAWDOUBLE();
 2331|  2.51k|    attdef->dfHeight          = buffer.ReadRAWDOUBLE();
 2332|  2.51k|    if( ( attdef->DataFlags & 0x10 ) == 0 )
  ------------------
  |  Branch (2332:9): [True: 828, False: 1.68k]
  ------------------
 2333|    828|        attdef->dfWidthFactor = buffer.ReadRAWDOUBLE();
 2334|  2.51k|    attdef->sTextValue        = buffer.ReadTV();
 2335|  2.51k|    if( ( attdef->DataFlags & 0x20 ) == 0 )
  ------------------
  |  Branch (2335:9): [True: 1.61k, False: 895]
  ------------------
 2336|  1.61k|        attdef->dGeneration   = buffer.ReadBITSHORT();
 2337|  2.51k|    if( ( attdef->DataFlags & 0x40 ) == 0 )
  ------------------
  |  Branch (2337:9): [True: 1.49k, False: 1.02k]
  ------------------
 2338|  1.49k|        attdef->dHorizAlign   = buffer.ReadBITSHORT();
 2339|  2.51k|    if( ( attdef->DataFlags & 0x80 ) == 0 )
  ------------------
  |  Branch (2339:9): [True: 1.80k, False: 708]
  ------------------
 2340|  1.80k|        attdef->dVertAlign    = buffer.ReadBITSHORT();
 2341|       |
 2342|  2.51k|    attdef->sTag         = buffer.ReadTV();
 2343|  2.51k|    attdef->nFieldLength = buffer.ReadBITSHORT();
 2344|  2.51k|    attdef->nFlags       = buffer.ReadCHAR();
 2345|       |
 2346|  2.51k|    attdef->sPrompt = buffer.ReadTV();
 2347|       |
 2348|  2.51k|    fillCommonEntityHandleData( attdef, buffer);
 2349|       |
 2350|  2.51k|    attdef->hStyle = buffer.ReadHANDLE();
 2351|       |
 2352|  2.51k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2353|  2.51k|    attdef->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "ATTRDEF" ) );
 2354|  2.51k|    return attdef;
 2355|  2.51k|}
_ZN12DWGFileR200013getLWPolyLineEjRK11CADCommonEDR9CADBuffer:
 2360|  3.52k|{
 2361|  3.52k|    CADLWPolylineObject * polyline = new CADLWPolylineObject();
 2362|  3.52k|    polyline->setSize( dObjectSize );
 2363|  3.52k|    polyline->stCed = stCommonEntityData;
 2364|       |
 2365|  3.52k|    int    verticesCount = 0, nBulges = 0, nNumWidths = 0;
 2366|  3.52k|    short  dataFlag      = buffer.ReadBITSHORT();
 2367|  3.52k|    if( dataFlag & 4 )
  ------------------
  |  Branch (2367:9): [True: 1.14k, False: 2.38k]
  ------------------
 2368|  1.14k|        polyline->dfConstWidth = buffer.ReadBITDOUBLE();
 2369|  3.52k|    if( dataFlag & 8 )
  ------------------
  |  Branch (2369:9): [True: 773, False: 2.74k]
  ------------------
 2370|    773|        polyline->dfElevation  = buffer.ReadBITDOUBLE();
 2371|  3.52k|    if( dataFlag & 2 )
  ------------------
  |  Branch (2371:9): [True: 837, False: 2.68k]
  ------------------
 2372|    837|        polyline->dfThickness  = buffer.ReadBITDOUBLE();
 2373|  3.52k|    if( dataFlag & 1 )
  ------------------
  |  Branch (2373:9): [True: 1.75k, False: 1.77k]
  ------------------
 2374|  1.75k|    {
 2375|  1.75k|        CADVector vectExtrusion = buffer.ReadVector();
 2376|  1.75k|        polyline->vectExtrusion = vectExtrusion;
 2377|  1.75k|    }
 2378|       |
 2379|  3.52k|    verticesCount = buffer.ReadBITLONG();
 2380|  3.52k|    if(verticesCount < 1)
  ------------------
  |  Branch (2380:8): [True: 250, False: 3.27k]
  ------------------
 2381|    250|    {
 2382|    250|        delete polyline;
 2383|    250|        return nullptr;
 2384|    250|    }
 2385|  3.27k|    if( verticesCount < 100000 )
  ------------------
  |  Branch (2385:9): [True: 2.32k, False: 951]
  ------------------
 2386|  2.32k|    {
 2387|       |        // For some reason reserving huge amounts cause later segfaults
 2388|       |        // whereas an exception would have been expected
 2389|  2.32k|        polyline->avertVertices.reserve( static_cast<size_t>(verticesCount) );
 2390|  2.32k|    }
 2391|       |
 2392|  3.27k|    if( dataFlag & 16 )
  ------------------
  |  Branch (2392:9): [True: 1.85k, False: 1.42k]
  ------------------
 2393|  1.85k|    {
 2394|  1.85k|        nBulges = buffer.ReadBITLONG();
 2395|  1.85k|        if(nBulges < 0)
  ------------------
  |  Branch (2395:12): [True: 223, False: 1.62k]
  ------------------
 2396|    223|        {
 2397|    223|            delete polyline;
 2398|    223|            return nullptr;
 2399|    223|        }
 2400|  1.62k|        if( nBulges < 100000 )
  ------------------
  |  Branch (2400:13): [True: 975, False: 654]
  ------------------
 2401|    975|        {
 2402|    975|            polyline->adfBulges.reserve( static_cast<size_t>(nBulges) );
 2403|    975|        }
 2404|  1.62k|    }
 2405|       |
 2406|       |    // TODO: tell ODA that R2000 contains nNumWidths flag
 2407|  3.04k|    if( dataFlag & 32 )
  ------------------
  |  Branch (2407:9): [True: 1.82k, False: 1.22k]
  ------------------
 2408|  1.82k|    {
 2409|  1.82k|        nNumWidths = buffer.ReadBITLONG();
 2410|  1.82k|        if(nNumWidths < 0)
  ------------------
  |  Branch (2410:12): [True: 227, False: 1.59k]
  ------------------
 2411|    227|        {
 2412|    227|            delete polyline;
 2413|    227|            return nullptr;
 2414|    227|        }
 2415|  1.59k|        if( nNumWidths < 100000 )
  ------------------
  |  Branch (2415:13): [True: 1.22k, False: 370]
  ------------------
 2416|  1.22k|        {
 2417|  1.22k|            polyline->astWidths.reserve( static_cast<size_t>(nNumWidths) );
 2418|  1.22k|        }
 2419|  1.59k|    }
 2420|       |
 2421|  2.82k|    if( dataFlag & 512 )
  ------------------
  |  Branch (2421:9): [True: 470, False: 2.35k]
  ------------------
 2422|    470|    {
 2423|    470|        polyline->bClosed = true;
 2424|    470|    }
 2425|  2.35k|    else
 2426|  2.35k|    {
 2427|  2.35k|        polyline->bClosed = false;
 2428|  2.35k|    }
 2429|       |
 2430|       |    // First of all, read first vertex.
 2431|  2.82k|    CADVector vertex = buffer.ReadRAWVector();
 2432|  2.82k|    polyline->avertVertices.push_back( vertex );
 2433|       |
 2434|       |    // All the others are not raw doubles; bitdoubles with default instead,
 2435|       |    // where default is previous point coords.
 2436|  2.82k|    size_t prev;
 2437|   608k|    for( int i = 1; i < verticesCount; ++i )
  ------------------
  |  Branch (2437:21): [True: 606k, False: 1.86k]
  ------------------
 2438|   606k|    {
 2439|   606k|        prev = size_t( i - 1 );
 2440|   606k|        double x = buffer.ReadBITDOUBLEWD( polyline->avertVertices[prev].getX() );
 2441|   606k|        double y = buffer.ReadBITDOUBLEWD( polyline->avertVertices[prev].getY() );
 2442|   606k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (2442:13): [True: 955, False: 605k]
  ------------------
 2443|    955|        {
 2444|    955|            delete polyline;
 2445|    955|            return nullptr;
 2446|    955|        }
 2447|   605k|        vertex.setX( x );
 2448|   605k|        vertex.setY( y );
 2449|   605k|        polyline->avertVertices.push_back( vertex );
 2450|   605k|    }
 2451|       |
 2452|   136k|    for( int i = 0; i < nBulges; ++i )
  ------------------
  |  Branch (2452:21): [True: 135k, False: 1.39k]
  ------------------
 2453|   135k|    {
 2454|   135k|        double dfBulgeValue = buffer.ReadBITDOUBLE();
 2455|   135k|        polyline->adfBulges.push_back( dfBulgeValue );
 2456|   135k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (2456:13): [True: 477, False: 134k]
  ------------------
 2457|    477|        {
 2458|    477|            delete polyline;
 2459|    477|            return nullptr;
 2460|    477|        }
 2461|   135k|    }
 2462|       |
 2463|  48.8k|    for( int i = 0; i < nNumWidths; ++i )
  ------------------
  |  Branch (2463:21): [True: 47.9k, False: 921]
  ------------------
 2464|  47.9k|    {
 2465|  47.9k|        double dfStartWidth = buffer.ReadBITDOUBLE();
 2466|  47.9k|        double dfEndWidth   = buffer.ReadBITDOUBLE();
 2467|  47.9k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (2467:13): [True: 469, False: 47.4k]
  ------------------
 2468|    469|        {
 2469|    469|            delete polyline;
 2470|    469|            return nullptr;
 2471|    469|        }
 2472|  47.4k|        polyline->astWidths.push_back( make_pair( dfStartWidth, dfEndWidth ) );
 2473|  47.4k|    }
 2474|       |
 2475|    921|    fillCommonEntityHandleData( polyline, buffer);
 2476|       |
 2477|    921|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2478|    921|    polyline->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "WPOLYLINE" ) );
 2479|    921|    return polyline;
 2480|  1.39k|}
_ZN12DWGFileR20006getArcEjRK11CADCommonEDR9CADBuffer:
 2485|    931|{
 2486|    931|    CADArcObject * arc = new CADArcObject();
 2487|       |
 2488|    931|    arc->setSize( dObjectSize );
 2489|    931|    arc->stCed = stCommonEntityData;
 2490|       |
 2491|    931|    CADVector vertPosition = buffer.ReadVector();
 2492|    931|    arc->vertPosition = vertPosition;
 2493|    931|    arc->dfRadius     = buffer.ReadBITDOUBLE();
 2494|    931|    arc->dfThickness  = buffer.ReadBIT() ? 0.0f : buffer.ReadBITDOUBLE();
  ------------------
  |  Branch (2494:25): [True: 398, False: 533]
  ------------------
 2495|       |
 2496|    931|    if( buffer.ReadBIT() )
  ------------------
  |  Branch (2496:9): [True: 458, False: 473]
  ------------------
 2497|    458|    {
 2498|    458|        arc->vectExtrusion = CADVector( 0.0f, 0.0f, 1.0f );
 2499|    458|    }
 2500|    473|    else
 2501|    473|    {
 2502|    473|        CADVector vectExtrusion = buffer.ReadVector();
 2503|    473|        arc->vectExtrusion = vectExtrusion;
 2504|    473|    }
 2505|       |
 2506|    931|    arc->dfStartAngle = buffer.ReadBITDOUBLE();
 2507|    931|    arc->dfEndAngle   = buffer.ReadBITDOUBLE();
 2508|       |
 2509|    931|    fillCommonEntityHandleData( arc, buffer);
 2510|       |
 2511|    931|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2512|    931|    arc->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "ARC" ) );
 2513|    931|    return arc;
 2514|    931|}
_ZN12DWGFileR20009getSplineEjRK11CADCommonEDR9CADBuffer:
 2519|  4.02k|{
 2520|  4.02k|    CADSplineObject * spline = new CADSplineObject();
 2521|  4.02k|    spline->setSize( dObjectSize );
 2522|  4.02k|    spline->stCed     = stCommonEntityData;
 2523|  4.02k|    spline->dScenario = buffer.ReadBITLONG();
 2524|  4.02k|    spline->dDegree   = buffer.ReadBITLONG();
 2525|       |
 2526|  4.02k|    if( spline->dScenario == 2 )
  ------------------
  |  Branch (2526:9): [True: 1.07k, False: 2.95k]
  ------------------
 2527|  1.07k|    {
 2528|  1.07k|        spline->dfFitTol = buffer.ReadBITDOUBLE();
 2529|  1.07k|        CADVector vectBegTangDir = buffer.ReadVector();
 2530|  1.07k|        spline->vectBegTangDir = vectBegTangDir;
 2531|  1.07k|        CADVector vectEndTangDir = buffer.ReadVector();
 2532|  1.07k|        spline->vectEndTangDir = vectEndTangDir;
 2533|       |
 2534|  1.07k|        spline->nNumFitPts = buffer.ReadBITLONG();
 2535|  1.07k|        if(spline->nNumFitPts < 0 || spline->nNumFitPts > 10 * 1024 * 1024)
  ------------------
  |  Branch (2535:12): [True: 228, False: 844]
  |  Branch (2535:38): [True: 202, False: 642]
  ------------------
 2536|    430|        {
 2537|    430|            delete spline;
 2538|    430|            return nullptr;
 2539|    430|        }
 2540|    642|        spline->averFitPoints.reserve( static_cast<size_t>(spline->nNumFitPts) );
 2541|    642|    }
 2542|  2.95k|    else if( spline->dScenario == 1 )
  ------------------
  |  Branch (2542:14): [True: 2.09k, False: 859]
  ------------------
 2543|  2.09k|    {
 2544|  2.09k|        spline->bRational = buffer.ReadBIT();
 2545|  2.09k|        spline->bClosed   = buffer.ReadBIT();
 2546|  2.09k|        spline->bPeriodic = buffer.ReadBIT();
 2547|  2.09k|        spline->dfKnotTol = buffer.ReadBITDOUBLE();
 2548|  2.09k|        spline->dfCtrlTol = buffer.ReadBITDOUBLE();
 2549|       |
 2550|  2.09k|        spline->nNumKnots = buffer.ReadBITLONG();
 2551|  2.09k|        if(spline->nNumKnots < 0 || spline->nNumKnots > 10 * 1024 * 1024)
  ------------------
  |  Branch (2551:12): [True: 233, False: 1.86k]
  |  Branch (2551:37): [True: 206, False: 1.65k]
  ------------------
 2552|    439|        {
 2553|    439|            delete spline;
 2554|    439|            return nullptr;
 2555|    439|        }
 2556|  1.65k|        spline->adfKnots.reserve( static_cast<size_t>(spline->nNumKnots) );
 2557|       |
 2558|  1.65k|        spline->nNumCtrlPts = buffer.ReadBITLONG();
 2559|  1.65k|        if(spline->nNumCtrlPts < 0 || spline->nNumCtrlPts > 10 * 1024 * 1024)
  ------------------
  |  Branch (2559:12): [True: 222, False: 1.43k]
  |  Branch (2559:39): [True: 214, False: 1.22k]
  ------------------
 2560|    436|        {
 2561|    436|            delete spline;
 2562|    436|            return nullptr;
 2563|    436|        }
 2564|  1.22k|        spline->avertCtrlPoints.reserve( static_cast<size_t>(spline->nNumCtrlPts) );
 2565|  1.22k|        if( spline->bWeight )
  ------------------
  |  Branch (2565:13): [True: 0, False: 1.22k]
  ------------------
 2566|      0|            spline->adfCtrlPointsWeight.reserve( static_cast<size_t>(spline->nNumCtrlPts) );
 2567|  1.22k|        spline->bWeight = buffer.ReadBIT();
 2568|  1.22k|    }
 2569|       |#ifdef _DEBUG
 2570|       |    else
 2571|       |    {
 2572|       |        DebugMsg( "Spline scenario != {1,2} read: error." );
 2573|       |    }
 2574|       |#endif
 2575|  7.84k|    for( long i = 0; i < spline->nNumKnots; ++i )
  ------------------
  |  Branch (2575:22): [True: 5.39k, False: 2.45k]
  ------------------
 2576|  5.39k|    {
 2577|  5.39k|        spline->adfKnots.push_back( buffer.ReadBITDOUBLE() );
 2578|  5.39k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (2578:13): [True: 264, False: 5.12k]
  ------------------
 2579|    264|        {
 2580|    264|            delete spline;
 2581|    264|            return nullptr;
 2582|    264|        }
 2583|  5.39k|    }
 2584|       |
 2585|  5.61k|    for( long i = 0; i < spline->nNumCtrlPts; ++i )
  ------------------
  |  Branch (2585:22): [True: 3.47k, False: 2.14k]
  ------------------
 2586|  3.47k|    {
 2587|  3.47k|        CADVector vertex = buffer.ReadVector();
 2588|  3.47k|        spline->avertCtrlPoints.push_back( vertex );
 2589|  3.47k|        if( spline->bWeight )
  ------------------
  |  Branch (2589:13): [True: 2.38k, False: 1.09k]
  ------------------
 2590|  2.38k|            spline->adfCtrlPointsWeight.push_back( buffer.ReadBITDOUBLE() );
 2591|  3.47k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (2591:13): [True: 315, False: 3.16k]
  ------------------
 2592|    315|        {
 2593|    315|            delete spline;
 2594|    315|            return nullptr;
 2595|    315|        }
 2596|  3.47k|    }
 2597|       |
 2598|  5.21k|    for( long i = 0; i < spline->nNumFitPts; ++i )
  ------------------
  |  Branch (2598:22): [True: 3.31k, False: 1.90k]
  ------------------
 2599|  3.31k|    {
 2600|  3.31k|        CADVector vertex = buffer.ReadVector();
 2601|  3.31k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (2601:13): [True: 237, False: 3.07k]
  ------------------
 2602|    237|        {
 2603|    237|            delete spline;
 2604|    237|            return nullptr;
 2605|    237|        }
 2606|  3.07k|        spline->averFitPoints.push_back( vertex );
 2607|  3.07k|    }
 2608|       |
 2609|  1.90k|    fillCommonEntityHandleData( spline, buffer);
 2610|       |
 2611|  1.90k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2612|  1.90k|    spline->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "SPLINE" ) );
 2613|  1.90k|    return spline;
 2614|  2.14k|}
_ZN12DWGFileR20009getEntityEijRK11CADCommonEDR9CADBuffer:
 2620|  3.92k|{
 2621|  3.92k|    CADEntityObject * entity = new CADEntityObject(
 2622|  3.92k|                    static_cast<CADObject::ObjectType>(dObjectType) );
 2623|       |
 2624|  3.92k|    entity->setSize( dObjectSize );
 2625|  3.92k|    entity->stCed = stCommonEntityData;
 2626|       |
 2627|  3.92k|    buffer.Seek(static_cast<size_t>(
 2628|  3.92k|                    entity->stCed.nObjectSizeInBits + 16), CADBuffer::BEG);
 2629|       |
 2630|  3.92k|    fillCommonEntityHandleData( entity, buffer );
 2631|       |
 2632|  3.92k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2633|  3.92k|    entity->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "ENTITY" ) );
 2634|  3.92k|    return entity;
 2635|  3.92k|}
_ZN12DWGFileR20009getInsertEijRK11CADCommonEDR9CADBuffer:
 2641|  2.14k|{
 2642|  2.14k|    CADInsertObject * insert = new CADInsertObject(
 2643|  2.14k|                            static_cast<CADObject::ObjectType>(dObjectType) );
 2644|  2.14k|    insert->setSize( dObjectSize );
 2645|  2.14k|    insert->stCed = stCommonEntityData;
 2646|       |
 2647|  2.14k|    insert->vertInsertionPoint = buffer.ReadVector();
 2648|  2.14k|    unsigned char dataFlags = buffer.Read2B();
 2649|  2.14k|    double        val41     = 1.0;
 2650|  2.14k|    double        val42     = 1.0;
 2651|  2.14k|    double        val43     = 1.0;
 2652|  2.14k|    if( dataFlags == 0 )
  ------------------
  |  Branch (2652:9): [True: 619, False: 1.52k]
  ------------------
 2653|    619|    {
 2654|    619|        val41 = buffer.ReadRAWDOUBLE();
 2655|    619|        val42 = buffer.ReadBITDOUBLEWD( val41 );
 2656|    619|        val43 = buffer.ReadBITDOUBLEWD( val41 );
 2657|    619|    }
 2658|  1.52k|    else if( dataFlags == 1 )
  ------------------
  |  Branch (2658:14): [True: 443, False: 1.08k]
  ------------------
 2659|    443|    {
 2660|    443|        val41 = 1.0;
 2661|    443|        val42 = buffer.ReadBITDOUBLEWD( val41 );
 2662|    443|        val43 = buffer.ReadBITDOUBLEWD( val41 );
 2663|    443|    }
 2664|  1.08k|    else if( dataFlags == 2 )
  ------------------
  |  Branch (2664:14): [True: 484, False: 599]
  ------------------
 2665|    484|    {
 2666|    484|        val41 = buffer.ReadRAWDOUBLE();
 2667|    484|        val42 = val41;
 2668|    484|        val43 = val41;
 2669|    484|    }
 2670|  2.14k|    insert->vertScales    = CADVector( val41, val42, val43 );
 2671|  2.14k|    insert->dfRotation    = buffer.ReadBITDOUBLE();
 2672|  2.14k|    insert->vectExtrusion = buffer.ReadVector();
 2673|  2.14k|    insert->bHasAttribs   = buffer.ReadBIT();
 2674|       |
 2675|  2.14k|    fillCommonEntityHandleData( insert, buffer);
 2676|       |
 2677|  2.14k|    insert->hBlockHeader = buffer.ReadHANDLE();
 2678|  2.14k|    if( insert->bHasAttribs )
  ------------------
  |  Branch (2678:9): [True: 1.10k, False: 1.03k]
  ------------------
 2679|  1.10k|    {
 2680|  1.10k|        insert->hAttribs.push_back( buffer.ReadHANDLE() );
 2681|  1.10k|        insert->hAttribs.push_back( buffer.ReadHANDLE() );
 2682|  1.10k|        insert->hSeqend = buffer.ReadHANDLE();
 2683|  1.10k|    }
 2684|       |
 2685|  2.14k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2686|  2.14k|    insert->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "INSERT" ) );
 2687|       |
 2688|  2.14k|    return insert;
 2689|  2.14k|}
_ZN12DWGFileR200013getDictionaryEjR9CADBuffer:
 2693|  3.38k|{
 2694|       |    /*
 2695|       |     * FIXME: ODA has a lot of mistypes in spec. for this objects,
 2696|       |     * it doesn't work for now (error begins in handles stream).
 2697|       |     * Nonetheless, dictionary->sItemNames is 100% array,
 2698|       |     * not a single obj as pointer by their docs.
 2699|       |     */
 2700|  3.38k|    CADDictionaryObject * dictionary = new CADDictionaryObject();
 2701|       |
 2702|  3.38k|    if(!readBasicData(dictionary, dObjectSize, buffer))
  ------------------
  |  Branch (2702:8): [True: 201, False: 3.18k]
  ------------------
 2703|    201|    {
 2704|    201|        delete dictionary;
 2705|    201|        return nullptr;
 2706|    201|    }
 2707|       |
 2708|  3.18k|    dictionary->nNumItems      = buffer.ReadBITLONG();
 2709|  3.18k|    if(dictionary->nNumItems < 0)
  ------------------
  |  Branch (2709:8): [True: 228, False: 2.95k]
  ------------------
 2710|    228|    {
 2711|    228|        delete dictionary;
 2712|    228|        return nullptr;
 2713|    228|    }
 2714|  2.95k|    dictionary->dCloningFlag   = buffer.ReadBITSHORT();
 2715|  2.95k|    dictionary->dHardOwnerFlag = buffer.ReadCHAR();
 2716|       |
 2717|  18.7k|    for( long i = 0; i < dictionary->nNumItems; ++i )
  ------------------
  |  Branch (2717:22): [True: 16.2k, False: 2.46k]
  ------------------
 2718|  16.2k|    {
 2719|  16.2k|        dictionary->sItemNames.push_back( buffer.ReadTV() );
 2720|  16.2k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (2720:13): [True: 491, False: 15.7k]
  ------------------
 2721|    491|        {
 2722|    491|            delete dictionary;
 2723|    491|            return nullptr;
 2724|    491|        }
 2725|  16.2k|    }
 2726|       |
 2727|  2.46k|    dictionary->hParentHandle = buffer.ReadHANDLE();
 2728|       |
 2729|  72.8k|    for( long i = 0; i < dictionary->nNumReactors; ++i )
  ------------------
  |  Branch (2729:22): [True: 70.6k, False: 2.12k]
  ------------------
 2730|  70.6k|    {
 2731|  70.6k|        dictionary->hReactors.push_back( buffer.ReadHANDLE() );
 2732|  70.6k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (2732:13): [True: 339, False: 70.3k]
  ------------------
 2733|    339|        {
 2734|    339|            delete dictionary;
 2735|    339|            return nullptr;
 2736|    339|        }
 2737|  70.6k|    }
 2738|  2.12k|    dictionary->hXDictionary = buffer.ReadHANDLE();
 2739|  7.83k|    for( long i = 0; i < dictionary->nNumItems; ++i )
  ------------------
  |  Branch (2739:22): [True: 5.98k, False: 1.85k]
  ------------------
 2740|  5.98k|    {
 2741|  5.98k|        dictionary->hItemHandles.push_back( buffer.ReadHANDLE() );
 2742|  5.98k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (2742:13): [True: 277, False: 5.71k]
  ------------------
 2743|    277|        {
 2744|    277|            delete dictionary;
 2745|    277|            return nullptr;
 2746|    277|        }
 2747|  5.98k|    }
 2748|       |
 2749|  1.85k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2750|  1.85k|    dictionary->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "DICT" ) );
 2751|       |
 2752|  1.85k|    return dictionary;
 2753|  2.12k|}
_ZN12DWGFileR200014getLayerObjectEjR9CADBuffer:
 2757|  18.6k|{
 2758|  18.6k|    CADLayerObject * layer = new CADLayerObject();
 2759|       |
 2760|  18.6k|    if(!readBasicData(layer, dObjectSize, buffer))
  ------------------
  |  Branch (2760:8): [True: 325, False: 18.3k]
  ------------------
 2761|    325|    {
 2762|    325|        delete layer;
 2763|    325|        return nullptr;
 2764|    325|    }
 2765|       |
 2766|  18.3k|    layer->sLayerName   = buffer.ReadTV();
 2767|  18.3k|    layer->b64Flag      = buffer.ReadBIT() != 0;
 2768|  18.3k|    layer->dXRefIndex   = buffer.ReadBITSHORT();
 2769|  18.3k|    layer->bXDep        = buffer.ReadBIT() != 0;
 2770|       |
 2771|  18.3k|    short dFlags = buffer.ReadBITSHORT();
 2772|  18.3k|    layer->bFrozen           = (dFlags & 0x01) != 0;
 2773|  18.3k|    layer->bOn               = (dFlags & 0x02) != 0;
 2774|  18.3k|    layer->bFrozenInNewVPORT = (dFlags & 0x04) != 0;
 2775|  18.3k|    layer->bLocked           = (dFlags & 0x08) != 0;
 2776|  18.3k|    layer->bPlottingFlag     = (dFlags & 0x10) != 0;
 2777|  18.3k|    layer->dLineWeight       = dFlags & 0x03E0;
 2778|  18.3k|    layer->dCMColor          = buffer.ReadBITSHORT();
 2779|  18.3k|    layer->hLayerControl     = buffer.ReadHANDLE();
 2780|  46.3k|    for( long i = 0; i < layer->nNumReactors; ++i )
  ------------------
  |  Branch (2780:22): [True: 28.4k, False: 17.8k]
  ------------------
 2781|  28.4k|    {
 2782|  28.4k|        layer->hReactors.push_back( buffer.ReadHANDLE() );
 2783|  28.4k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (2783:13): [True: 436, False: 27.9k]
  ------------------
 2784|    436|        {
 2785|    436|            delete layer;
 2786|    436|            return nullptr;
 2787|    436|        }
 2788|  28.4k|    }
 2789|  17.8k|    layer->hXDictionary            = buffer.ReadHANDLE();
 2790|  17.8k|    layer->hExternalRefBlockHandle = buffer.ReadHANDLE();
 2791|  17.8k|    layer->hPlotStyle              = buffer.ReadHANDLE();
 2792|  17.8k|    layer->hLType                  = buffer.ReadHANDLE();
 2793|       |
 2794|       |    /*
 2795|       |     * FIXME: ODA says that this handle should be null hard pointer. It is not.
 2796|       |     * Also, after reading it dObjectSize is != actual read structure's size.
 2797|       |     * Not used anyway, so no point to read it for now.
 2798|       |     * It also means that CRC cannot be computed correctly.
 2799|       |     */
 2800|       |// layer->hUnknownHandle = ReadHANDLE (pabySectionContent, nBitOffsetFromStart);
 2801|       |
 2802|  17.8k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2803|  17.8k|    layer->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "LAYER" ) );
 2804|  17.8k|    return layer;
 2805|  18.3k|}
_ZN12DWGFileR200015getLayerControlEjR9CADBuffer:
 2809|  11.2k|{
 2810|  11.2k|    CADLayerControlObject * layerControl = new CADLayerControlObject();
 2811|       |
 2812|  11.2k|    if(!readBasicData(layerControl, dObjectSize, buffer))
  ------------------
  |  Branch (2812:8): [True: 325, False: 10.9k]
  ------------------
 2813|    325|    {
 2814|    325|        delete layerControl;
 2815|    325|        return nullptr;
 2816|    325|    }
 2817|       |
 2818|  10.9k|    layerControl->nNumEntries  = buffer.ReadBITLONG();
 2819|  10.9k|    if(layerControl->nNumEntries < 0)
  ------------------
  |  Branch (2819:8): [True: 227, False: 10.7k]
  ------------------
 2820|    227|    {
 2821|    227|        delete layerControl;
 2822|    227|        return nullptr;
 2823|    227|    }
 2824|  10.7k|    layerControl->hNull        = buffer.ReadHANDLE();
 2825|  10.7k|    layerControl->hXDictionary = buffer.ReadHANDLE();
 2826|  3.62M|    for( long i = 0; i < layerControl->nNumEntries; ++i )
  ------------------
  |  Branch (2826:22): [True: 3.61M, False: 10.4k]
  ------------------
 2827|  3.61M|    {
 2828|  3.61M|        layerControl->hLayers.push_back( buffer.ReadHANDLE() );
 2829|  3.61M|        if( buffer.IsEOB() )
  ------------------
  |  Branch (2829:13): [True: 268, False: 3.60M]
  ------------------
 2830|    268|        {
 2831|    268|            delete layerControl;
 2832|    268|            return nullptr;
 2833|    268|        }
 2834|  3.61M|    }
 2835|       |
 2836|  10.4k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2837|  10.4k|    layerControl->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "LAYERCONTROL" ) );
 2838|  10.4k|    return layerControl;
 2839|  10.7k|}
_ZN12DWGFileR200015getBlockControlEjR9CADBuffer:
 2843|  2.57k|{
 2844|  2.57k|    CADBlockControlObject * blockControl = new CADBlockControlObject();
 2845|       |
 2846|  2.57k|    if(!readBasicData(blockControl, dObjectSize, buffer))
  ------------------
  |  Branch (2846:8): [True: 216, False: 2.36k]
  ------------------
 2847|    216|    {
 2848|    216|        delete blockControl;
 2849|    216|        return nullptr;
 2850|    216|    }
 2851|       |
 2852|  2.36k|    blockControl->nNumEntries  = buffer.ReadBITLONG();
 2853|  2.36k|    if(blockControl->nNumEntries < 0)
  ------------------
  |  Branch (2853:8): [True: 232, False: 2.12k]
  ------------------
 2854|    232|    {
 2855|    232|        delete blockControl;
 2856|    232|        return nullptr;
 2857|    232|    }
 2858|       |
 2859|  2.12k|    blockControl->hNull        = buffer.ReadHANDLE();
 2860|  2.12k|    blockControl->hXDictionary = buffer.ReadHANDLE();
 2861|       |
 2862|  22.7k|    for( long i = 0; i < blockControl->nNumEntries + 2; ++i )
  ------------------
  |  Branch (2862:22): [True: 21.0k, False: 1.69k]
  ------------------
 2863|  21.0k|    {
 2864|  21.0k|        blockControl->hBlocks.push_back( buffer.ReadHANDLE() );
 2865|  21.0k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (2865:13): [True: 429, False: 20.6k]
  ------------------
 2866|    429|        {
 2867|    429|            delete blockControl;
 2868|    429|            return nullptr;
 2869|    429|        }
 2870|  21.0k|    }
 2871|       |
 2872|  1.69k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2873|  1.69k|    blockControl->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "BLOCKCONTROL" ) );
 2874|  1.69k|    return blockControl;
 2875|  2.12k|}
_ZN12DWGFileR200014getBlockHeaderEjR9CADBuffer:
 2879|  8.79k|{
 2880|  8.79k|    CADBlockHeaderObject * blockHeader = new CADBlockHeaderObject();
 2881|       |
 2882|  8.79k|    if(!readBasicData(blockHeader, dObjectSize, buffer))
  ------------------
  |  Branch (2882:8): [True: 286, False: 8.51k]
  ------------------
 2883|    286|    {
 2884|    286|        delete blockHeader;
 2885|    286|        return nullptr;
 2886|    286|    }
 2887|       |
 2888|  8.51k|    blockHeader->sEntryName    = buffer.ReadTV();
 2889|  8.51k|    blockHeader->b64Flag       = buffer.ReadBIT();
 2890|  8.51k|    blockHeader->dXRefIndex    = buffer.ReadBITSHORT();
 2891|  8.51k|    blockHeader->bXDep         = buffer.ReadBIT();
 2892|  8.51k|    blockHeader->bAnonymous    = buffer.ReadBIT();
 2893|  8.51k|    blockHeader->bHasAtts      = buffer.ReadBIT();
 2894|  8.51k|    blockHeader->bBlkisXRef    = buffer.ReadBIT();
 2895|  8.51k|    blockHeader->bXRefOverlaid = buffer.ReadBIT();
 2896|  8.51k|    blockHeader->bLoadedBit    = buffer.ReadBIT();
 2897|       |
 2898|  8.51k|    CADVector vertBasePoint = buffer.ReadVector();
 2899|  8.51k|    blockHeader->vertBasePoint = vertBasePoint;
 2900|  8.51k|    blockHeader->sXRefPName    = buffer.ReadTV();
 2901|  8.51k|    unsigned char Tmp;
 2902|  8.51k|    do
 2903|   246k|    {
 2904|   246k|        Tmp = buffer.ReadCHAR();
 2905|   246k|        blockHeader->adInsertCount.push_back( Tmp );
 2906|   246k|    } while( Tmp != 0 );
  ------------------
  |  Branch (2906:14): [True: 238k, False: 8.51k]
  ------------------
 2907|       |
 2908|  8.51k|    blockHeader->sBlockDescription  = buffer.ReadTV();
 2909|  8.51k|    blockHeader->nSizeOfPreviewData = buffer.ReadBITLONG();
 2910|  8.51k|    if(blockHeader->nSizeOfPreviewData < 0)
  ------------------
  |  Branch (2910:8): [True: 226, False: 8.28k]
  ------------------
 2911|    226|    {
 2912|    226|        delete blockHeader;
 2913|    226|        return nullptr;
 2914|    226|    }
 2915|   179k|    for( long i = 0; i < blockHeader->nSizeOfPreviewData; ++i )
  ------------------
  |  Branch (2915:22): [True: 171k, False: 8.05k]
  ------------------
 2916|   171k|    {
 2917|   171k|        blockHeader->abyBinaryPreviewData.push_back( buffer.ReadCHAR() );
 2918|   171k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (2918:13): [True: 229, False: 170k]
  ------------------
 2919|    229|        {
 2920|    229|            delete blockHeader;
 2921|    229|            return nullptr;
 2922|    229|        }
 2923|   171k|    }
 2924|       |
 2925|  8.05k|    blockHeader->hBlockControl = buffer.ReadHANDLE();
 2926|   148k|    for( long i = 0; i < blockHeader->nNumReactors; ++i )
  ------------------
  |  Branch (2926:22): [True: 140k, False: 7.76k]
  ------------------
 2927|   140k|    {
 2928|   140k|        blockHeader->hReactors.push_back( buffer.ReadHANDLE() );
 2929|   140k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (2929:13): [True: 294, False: 140k]
  ------------------
 2930|    294|        {
 2931|    294|            delete blockHeader;
 2932|    294|            return nullptr;
 2933|    294|        }
 2934|   140k|    }
 2935|  7.76k|    blockHeader->hXDictionary = buffer.ReadHANDLE();
 2936|  7.76k|    blockHeader->hNull        = buffer.ReadHANDLE();
 2937|  7.76k|    blockHeader->hBlockEntity = buffer.ReadHANDLE();
 2938|  7.76k|    if( !blockHeader->bBlkisXRef && !blockHeader->bXRefOverlaid )
  ------------------
  |  Branch (2938:9): [True: 7.25k, False: 508]
  |  Branch (2938:37): [True: 6.87k, False: 384]
  ------------------
 2939|  6.87k|    {
 2940|  6.87k|        blockHeader->hEntities.push_back( buffer.ReadHANDLE() ); // first
 2941|  6.87k|        blockHeader->hEntities.push_back( buffer.ReadHANDLE() ); // last
 2942|  6.87k|    }
 2943|       |
 2944|  7.76k|    blockHeader->hEndBlk = buffer.ReadHANDLE();
 2945|   244k|    for( size_t i = 0; i < blockHeader->adInsertCount.size() - 1; ++i )
  ------------------
  |  Branch (2945:24): [True: 236k, False: 7.76k]
  ------------------
 2946|   236k|        blockHeader->hInsertHandles.push_back( buffer.ReadHANDLE() );
 2947|  7.76k|    blockHeader->hLayout = buffer.ReadHANDLE();
 2948|       |
 2949|  7.76k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2950|  7.76k|    blockHeader->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "BLOCKHEADER" ) );
 2951|  7.76k|    return blockHeader;
 2952|  8.05k|}
_ZN12DWGFileR200018getLineTypeControlEjR9CADBuffer:
 2956|  1.73k|{
 2957|  1.73k|    CADLineTypeControlObject * ltypeControl = new CADLineTypeControlObject();
 2958|       |
 2959|  1.73k|    if(!readBasicData(ltypeControl, dObjectSize, buffer))
  ------------------
  |  Branch (2959:8): [True: 221, False: 1.51k]
  ------------------
 2960|    221|    {
 2961|    221|        delete ltypeControl;
 2962|    221|        return nullptr;
 2963|    221|    }
 2964|       |
 2965|  1.51k|    ltypeControl->nNumEntries  = buffer.ReadBITLONG();
 2966|  1.51k|    if(ltypeControl->nNumEntries < 0)
  ------------------
  |  Branch (2966:8): [True: 225, False: 1.29k]
  ------------------
 2967|    225|    {
 2968|    225|        delete ltypeControl;
 2969|    225|        return nullptr;
 2970|    225|    }
 2971|       |
 2972|  1.29k|    ltypeControl->hNull        = buffer.ReadHANDLE();
 2973|  1.29k|    ltypeControl->hXDictionary = buffer.ReadHANDLE();
 2974|       |
 2975|       |    // hLTypes ends with BYLAYER and BYBLOCK
 2976|  21.4k|    for( long i = 0; i < ltypeControl->nNumEntries + 2; ++i )
  ------------------
  |  Branch (2976:22): [True: 20.4k, False: 974]
  ------------------
 2977|  20.4k|    {
 2978|  20.4k|        ltypeControl->hLTypes.push_back( buffer.ReadHANDLE() );
 2979|  20.4k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (2979:13): [True: 317, False: 20.1k]
  ------------------
 2980|    317|        {
 2981|    317|            delete ltypeControl;
 2982|    317|            return nullptr;
 2983|    317|        }
 2984|  20.4k|    }
 2985|       |
 2986|    974|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 2987|    974|    ltypeControl->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "LINETYPECTRL" ) );
 2988|    974|    return ltypeControl;
 2989|  1.29k|}
_ZN12DWGFileR200012getLineType1EjR9CADBuffer:
 2992|  7.72k|{
 2993|  7.72k|    CADLineTypeObject * ltype = new CADLineTypeObject();
 2994|       |
 2995|  7.72k|    if(!readBasicData(ltype, dObjectSize, buffer))
  ------------------
  |  Branch (2995:8): [True: 312, False: 7.41k]
  ------------------
 2996|    312|    {
 2997|    312|        delete ltype;
 2998|    312|        return nullptr;
 2999|    312|    }
 3000|       |
 3001|  7.41k|    ltype->sEntryName   = buffer.ReadTV();
 3002|  7.41k|    ltype->b64Flag      = buffer.ReadBIT();
 3003|  7.41k|    ltype->dXRefIndex   = buffer.ReadBITSHORT();
 3004|  7.41k|    ltype->bXDep        = buffer.ReadBIT();
 3005|  7.41k|    ltype->sDescription = buffer.ReadTV();
 3006|  7.41k|    ltype->dfPatternLen = buffer.ReadBITDOUBLE();
 3007|  7.41k|    ltype->dAlignment   = buffer.ReadCHAR();
 3008|  7.41k|    ltype->nNumDashes   = buffer.ReadCHAR();
 3009|       |
 3010|  7.41k|    CADDash     dash;
 3011|  29.7k|    for( size_t i = 0; i < ltype->nNumDashes; ++i )
  ------------------
  |  Branch (3011:24): [True: 22.3k, False: 7.41k]
  ------------------
 3012|  22.3k|    {
 3013|  22.3k|        dash.dfLength          = buffer.ReadBITDOUBLE();
 3014|  22.3k|        dash.dComplexShapecode = buffer.ReadBITSHORT();
 3015|  22.3k|        dash.dfXOffset         = buffer.ReadRAWDOUBLE();
 3016|  22.3k|        dash.dfYOffset         = buffer.ReadRAWDOUBLE();
 3017|  22.3k|        dash.dfScale           = buffer.ReadBITDOUBLE();
 3018|  22.3k|        dash.dfRotation        = buffer.ReadBITDOUBLE();
 3019|  22.3k|        dash.dShapeflag        = buffer.ReadBITSHORT(); // TODO: what to do with it?
 3020|       |
 3021|  22.3k|        ltype->astDashes.push_back( dash );
 3022|  22.3k|    }
 3023|       |
 3024|  1.90M|    for( short i = 0; i < 256; ++i )
  ------------------
  |  Branch (3024:23): [True: 1.89M, False: 7.41k]
  ------------------
 3025|  1.89M|        ltype->abyTextArea.push_back( buffer.ReadCHAR() );
 3026|       |
 3027|  7.41k|    ltype->hLTControl = buffer.ReadHANDLE();
 3028|       |
 3029|  28.7k|    for( long i = 0; i < ltype->nNumReactors; ++i )
  ------------------
  |  Branch (3029:22): [True: 22.4k, False: 6.35k]
  ------------------
 3030|  22.4k|    {
 3031|  22.4k|        ltype->hReactors.push_back( buffer.ReadHANDLE() );
 3032|  22.4k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (3032:13): [True: 1.06k, False: 21.3k]
  ------------------
 3033|  1.06k|        {
 3034|  1.06k|            delete ltype;
 3035|  1.06k|            return nullptr;
 3036|  1.06k|        }
 3037|  22.4k|    }
 3038|       |
 3039|  6.35k|    ltype->hXDictionary = buffer.ReadHANDLE();
 3040|  6.35k|    ltype->hXRefBlock   = buffer.ReadHANDLE();
 3041|       |
 3042|       |    // TODO: shapefile for dash/shape (1 each). Does it mean that we have nNumDashes * 2 handles, or what?
 3043|       |
 3044|  6.35k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 3045|  6.35k|    ltype->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "LINETYPE" ) );
 3046|  6.35k|    return ltype;
 3047|  7.41k|}
_ZN12DWGFileR20008getMLineEjRK11CADCommonEDR9CADBuffer:
 3052|  3.35k|{
 3053|  3.35k|    CADMLineObject * mline = new CADMLineObject();
 3054|       |
 3055|  3.35k|    mline->setSize( dObjectSize );
 3056|  3.35k|    mline->stCed = stCommonEntityData;
 3057|       |
 3058|  3.35k|    mline->dfScale = buffer.ReadBITDOUBLE();
 3059|  3.35k|    mline->dJust   = buffer.ReadCHAR();
 3060|       |
 3061|  3.35k|    CADVector vertBasePoint = buffer.ReadVector();
 3062|  3.35k|    mline->vertBasePoint = vertBasePoint;
 3063|       |
 3064|  3.35k|    CADVector vectExtrusion = buffer.ReadVector();
 3065|  3.35k|    mline->vectExtrusion = vectExtrusion;
 3066|  3.35k|    mline->dOpenClosed   = buffer.ReadBITSHORT();
 3067|  3.35k|    mline->nLinesInStyle = buffer.ReadCHAR();
 3068|  3.35k|    mline->nNumVertices  = buffer.ReadBITSHORT();
 3069|  3.35k|    if(mline->nNumVertices < 0)
  ------------------
  |  Branch (3069:8): [True: 205, False: 3.14k]
  ------------------
 3070|    205|    {
 3071|    205|        delete mline;
 3072|    205|        return nullptr;
 3073|    205|    }
 3074|       |
 3075|  11.5k|    for( short i = 0; i < mline->nNumVertices; ++i )
  ------------------
  |  Branch (3075:23): [True: 9.50k, False: 2.01k]
  ------------------
 3076|  9.50k|    {
 3077|  9.50k|        CADMLineVertex stVertex;
 3078|       |
 3079|  9.50k|        CADVector vertPosition = buffer.ReadVector();
 3080|  9.50k|        stVertex.vertPosition = vertPosition;
 3081|       |
 3082|  9.50k|        CADVector vectDirection = buffer.ReadVector();
 3083|  9.50k|        stVertex.vectDirection = vectDirection;
 3084|       |
 3085|  9.50k|        CADVector vectMIterDirection = buffer.ReadVector();
 3086|  9.50k|        stVertex.vectMIterDirection = vectMIterDirection;
 3087|  9.50k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (3087:13): [True: 553, False: 8.95k]
  ------------------
 3088|    553|        {
 3089|    553|            delete mline;
 3090|    553|            return nullptr;
 3091|    553|        }
 3092|  17.8k|        for( unsigned char j = 0; j < mline->nLinesInStyle; ++j )
  ------------------
  |  Branch (3092:35): [True: 9.46k, False: 8.37k]
  ------------------
 3093|  9.46k|        {
 3094|  9.46k|            CADLineStyle   stLStyle;
 3095|  9.46k|            stLStyle.nNumSegParams = buffer.ReadBITSHORT();
 3096|  9.46k|            if( stLStyle.nNumSegParams > 0 ) // Or return null here?
  ------------------
  |  Branch (3096:17): [True: 831, False: 8.63k]
  ------------------
 3097|    831|            {
 3098|   883k|                for( short k = 0; k < stLStyle.nNumSegParams; ++k )
  ------------------
  |  Branch (3098:35): [True: 882k, False: 831]
  ------------------
 3099|   882k|                    stLStyle.adfSegparms.push_back( buffer.ReadBITDOUBLE() );
 3100|    831|            }
 3101|  9.46k|            stLStyle.nAreaFillParams = buffer.ReadBITSHORT();
 3102|  9.46k|            if( stLStyle.nAreaFillParams > 0 )
  ------------------
  |  Branch (3102:17): [True: 521, False: 8.94k]
  ------------------
 3103|    521|            {
 3104|   732k|                for( short k = 0; k < stLStyle.nAreaFillParams; ++k )
  ------------------
  |  Branch (3104:35): [True: 732k, False: 521]
  ------------------
 3105|   732k|                    stLStyle.adfAreaFillParameters.push_back( buffer.ReadBITDOUBLE() );
 3106|    521|            }
 3107|       |
 3108|  9.46k|            stVertex.astLStyles.push_back( std::move(stLStyle) );
 3109|  9.46k|            if( buffer.IsEOB() )
  ------------------
  |  Branch (3109:17): [True: 578, False: 8.88k]
  ------------------
 3110|    578|            {
 3111|    578|                delete mline;
 3112|    578|                return nullptr;
 3113|    578|            }
 3114|  9.46k|        }
 3115|  8.37k|        mline->avertVertices.push_back( std::move(stVertex) );
 3116|  8.37k|    }
 3117|       |
 3118|  2.01k|    if( mline->stCed.bbEntMode == 0 )
  ------------------
  |  Branch (3118:9): [True: 848, False: 1.16k]
  ------------------
 3119|    848|        mline->stChed.hOwner = buffer.ReadHANDLE();
 3120|       |
 3121|  79.8k|    for( long i = 0; i < mline->stCed.nNumReactors; ++i )
  ------------------
  |  Branch (3121:22): [True: 77.8k, False: 2.01k]
  ------------------
 3122|  77.8k|        mline->stChed.hReactors.push_back( buffer.ReadHANDLE() );
 3123|       |
 3124|  2.01k|    mline->stChed.hXDictionary = buffer.ReadHANDLE();
 3125|       |
 3126|  2.01k|    if( !mline->stCed.bNoLinks )
  ------------------
  |  Branch (3126:9): [True: 1.58k, False: 429]
  ------------------
 3127|  1.58k|    {
 3128|  1.58k|        mline->stChed.hPrevEntity = buffer.ReadHANDLE();
 3129|  1.58k|        mline->stChed.hNextEntity = buffer.ReadHANDLE();
 3130|  1.58k|    }
 3131|       |
 3132|  2.01k|    mline->stChed.hLayer = buffer.ReadHANDLE();
 3133|       |
 3134|  2.01k|    if( mline->stCed.bbLTypeFlags == 0x03 )
  ------------------
  |  Branch (3134:9): [True: 910, False: 1.10k]
  ------------------
 3135|    910|        mline->stChed.hLType = buffer.ReadHANDLE();
 3136|       |
 3137|  2.01k|    if( mline->stCed.bbPlotStyleFlags == 0x03 )
  ------------------
  |  Branch (3137:9): [True: 965, False: 1.05k]
  ------------------
 3138|    965|        mline->stChed.hPlotStyle = buffer.ReadHANDLE();
 3139|       |
 3140|  2.01k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 3141|  2.01k|    mline->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "MLINE" ) );
 3142|  2.01k|    return mline;
 3143|  3.14k|}
_ZN12DWGFileR200016getPolylinePFaceEjRK11CADCommonEDR9CADBuffer:
 3148|  1.18k|{
 3149|  1.18k|    CADPolylinePFaceObject * polyline = new CADPolylinePFaceObject();
 3150|       |
 3151|  1.18k|    polyline->setSize( dObjectSize );
 3152|  1.18k|    polyline->stCed = stCommonEntityData;
 3153|       |
 3154|  1.18k|    polyline->nNumVertices = buffer.ReadBITSHORT();
 3155|  1.18k|    polyline->nNumFaces    = buffer.ReadBITSHORT();
 3156|       |
 3157|  1.18k|    fillCommonEntityHandleData( polyline, buffer);
 3158|       |
 3159|  1.18k|    polyline->hVertices.push_back( buffer.ReadHANDLE() ); // 1st vertex
 3160|  1.18k|    polyline->hVertices.push_back( buffer.ReadHANDLE() ); // last vertex
 3161|       |
 3162|  1.18k|    polyline->hSeqend = buffer.ReadHANDLE();
 3163|       |
 3164|  1.18k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 3165|  1.18k|    polyline->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "POLYLINEPFACE" ) );
 3166|  1.18k|    return polyline;
 3167|  1.18k|}
_ZN12DWGFileR20008getImageEjRK11CADCommonEDR9CADBuffer:
 3172|  2.01k|{
 3173|  2.01k|    CADImageObject * image = new CADImageObject();
 3174|       |
 3175|  2.01k|    image->setSize( dObjectSize );
 3176|  2.01k|    image->stCed = stCommonEntityData;
 3177|       |
 3178|  2.01k|    image->dClassVersion = buffer.ReadBITLONG();
 3179|       |
 3180|  2.01k|    CADVector vertInsertion = buffer.ReadVector();
 3181|  2.01k|    image->vertInsertion = vertInsertion;
 3182|       |
 3183|  2.01k|    CADVector vectUDirection = buffer.ReadVector();
 3184|  2.01k|    image->vectUDirection = vectUDirection;
 3185|       |
 3186|  2.01k|    CADVector vectVDirection = buffer.ReadVector();
 3187|  2.01k|    image->vectVDirection = vectVDirection;
 3188|       |
 3189|  2.01k|    image->dfSizeX       = buffer.ReadRAWDOUBLE();
 3190|  2.01k|    image->dfSizeY       = buffer.ReadRAWDOUBLE();
 3191|  2.01k|    image->dDisplayProps = buffer.ReadBITSHORT();
 3192|       |
 3193|  2.01k|    image->bClipping         = buffer.ReadBIT();
 3194|  2.01k|    image->dBrightness       = buffer.ReadCHAR();
 3195|  2.01k|    image->dContrast         = buffer.ReadCHAR();
 3196|  2.01k|    image->dFade             = buffer.ReadCHAR();
 3197|  2.01k|    image->dClipBoundaryType = buffer.ReadBITSHORT();
 3198|       |
 3199|  2.01k|    if( image->dClipBoundaryType == 1 )
  ------------------
  |  Branch (3199:9): [True: 194, False: 1.82k]
  ------------------
 3200|    194|    {
 3201|    194|        CADVector vertPoint1 = buffer.ReadRAWVector();
 3202|    194|        image->avertClippingPolygonVertices.push_back( vertPoint1 );
 3203|       |
 3204|    194|        CADVector vertPoint2 = buffer.ReadRAWVector();
 3205|    194|        image->avertClippingPolygonVertices.push_back( vertPoint2 );
 3206|    194|    }
 3207|  1.82k|    else
 3208|  1.82k|    {
 3209|  1.82k|        image->nNumberVerticesInClipPolygon = buffer.ReadBITLONG();
 3210|  1.82k|        if(image->nNumberVerticesInClipPolygon < 0)
  ------------------
  |  Branch (3210:12): [True: 244, False: 1.57k]
  ------------------
 3211|    244|        {
 3212|    244|            delete image;
 3213|    244|            return nullptr;
 3214|    244|        }
 3215|       |
 3216|  4.52k|        for( long i = 0; i < image->nNumberVerticesInClipPolygon; ++i )
  ------------------
  |  Branch (3216:26): [True: 3.27k, False: 1.25k]
  ------------------
 3217|  3.27k|        {
 3218|  3.27k|            CADVector vertPoint = buffer.ReadRAWVector();
 3219|  3.27k|            if( buffer.IsEOB() )
  ------------------
  |  Branch (3219:17): [True: 326, False: 2.94k]
  ------------------
 3220|    326|            {
 3221|    326|                delete image;
 3222|    326|                return nullptr;
 3223|    326|            }
 3224|  2.94k|            image->avertClippingPolygonVertices.push_back( vertPoint );
 3225|  2.94k|        }
 3226|  1.57k|    }
 3227|       |
 3228|  1.44k|    fillCommonEntityHandleData( image, buffer);
 3229|       |
 3230|  1.44k|    image->hImageDef        = buffer.ReadHANDLE();
 3231|  1.44k|    image->hImageDefReactor = buffer.ReadHANDLE();
 3232|       |
 3233|  1.44k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 3234|  1.44k|    image->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "IMAGE" ) );
 3235|       |
 3236|  1.44k|    return image;
 3237|  2.01k|}
_ZN12DWGFileR20009get3DFaceEjRK11CADCommonEDR9CADBuffer:
 3242|  1.16k|{
 3243|  1.16k|    CAD3DFaceObject * face = new CAD3DFaceObject();
 3244|       |
 3245|  1.16k|    face->setSize( dObjectSize );
 3246|  1.16k|    face->stCed = stCommonEntityData;
 3247|       |
 3248|  1.16k|    face->bHasNoFlagInd = buffer.ReadBIT();
 3249|  1.16k|    face->bZZero        = buffer.ReadBIT();
 3250|       |
 3251|  1.16k|    double x, y, z;
 3252|       |
 3253|  1.16k|    CADVector vertex = buffer.ReadRAWVector();
 3254|  1.16k|    if( !face->bZZero )
  ------------------
  |  Branch (3254:9): [True: 704, False: 464]
  ------------------
 3255|    704|    {
 3256|    704|        z = buffer.ReadRAWDOUBLE();
 3257|    704|        vertex.setZ( z );
 3258|    704|    }
 3259|  1.16k|    face->avertCorners.push_back( vertex );
 3260|  4.67k|    for( size_t i = 1; i < 4; ++i )
  ------------------
  |  Branch (3260:24): [True: 3.50k, False: 1.16k]
  ------------------
 3261|  3.50k|    {
 3262|  3.50k|        x = buffer.ReadBITDOUBLEWD( face->avertCorners[i - 1].getX() );
 3263|  3.50k|        y = buffer.ReadBITDOUBLEWD( face->avertCorners[i - 1].getY() );
 3264|  3.50k|        z = buffer.ReadBITDOUBLEWD( face->avertCorners[i - 1].getZ() );
 3265|       |
 3266|  3.50k|        CADVector corner( x, y, z );
 3267|  3.50k|        face->avertCorners.push_back( corner );
 3268|  3.50k|    }
 3269|       |
 3270|  1.16k|    if( !face->bHasNoFlagInd )
  ------------------
  |  Branch (3270:9): [True: 725, False: 443]
  ------------------
 3271|    725|        face->dInvisFlags = buffer.ReadBITSHORT();
 3272|       |
 3273|  1.16k|    fillCommonEntityHandleData( face, buffer);
 3274|       |
 3275|  1.16k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 3276|  1.16k|    face->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "3DFACE" ) );
 3277|  1.16k|    return face;
 3278|  1.16k|}
_ZN12DWGFileR200013getVertexMeshEjRK11CADCommonEDR9CADBuffer:
 3283|  1.19k|{
 3284|  1.19k|    CADVertexMeshObject * vertex = new CADVertexMeshObject();
 3285|       |
 3286|  1.19k|    vertex->setSize( dObjectSize );
 3287|  1.19k|    vertex->stCed = stCommonEntityData;
 3288|       |
 3289|       |    /*unsigned char Flags = */buffer.ReadCHAR();
 3290|  1.19k|    CADVector vertPosition = buffer.ReadVector();
 3291|  1.19k|    vertex->vertPosition = vertPosition;
 3292|       |
 3293|  1.19k|    fillCommonEntityHandleData( vertex, buffer);
 3294|       |
 3295|  1.19k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 3296|  1.19k|    vertex->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "VERTEXMESH" ) );
 3297|  1.19k|    return vertex;
 3298|  1.19k|}
_ZN12DWGFileR200014getVertexPFaceEjRK11CADCommonEDR9CADBuffer:
 3303|  1.05k|{
 3304|  1.05k|    CADVertexPFaceObject * vertex = new CADVertexPFaceObject();
 3305|       |
 3306|  1.05k|    vertex->setSize( dObjectSize );
 3307|  1.05k|    vertex->stCed = stCommonEntityData;
 3308|       |
 3309|       |    /*unsigned char Flags = */buffer.ReadCHAR();
 3310|  1.05k|    CADVector vertPosition = buffer.ReadVector();
 3311|  1.05k|    vertex->vertPosition = vertPosition;
 3312|       |
 3313|  1.05k|    fillCommonEntityHandleData( vertex, buffer);
 3314|       |
 3315|  1.05k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 3316|  1.05k|    vertex->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "VERTEXPFACE" ) );
 3317|  1.05k|    return vertex;
 3318|  1.05k|}
_ZN12DWGFileR20008getMTextEjRK11CADCommonEDR9CADBuffer:
 3323|    598|{
 3324|    598|    CADMTextObject * text = new CADMTextObject();
 3325|       |
 3326|    598|    text->setSize( dObjectSize );
 3327|    598|    text->stCed = stCommonEntityData;
 3328|       |
 3329|    598|    CADVector vertInsertionPoint = buffer.ReadVector();
 3330|    598|    text->vertInsertionPoint = vertInsertionPoint;
 3331|       |
 3332|    598|    CADVector vectExtrusion = buffer.ReadVector();
 3333|    598|    text->vectExtrusion = vectExtrusion;
 3334|       |
 3335|    598|    CADVector vectXAxisDir = buffer.ReadVector();
 3336|    598|    text->vectXAxisDir = vectXAxisDir;
 3337|       |
 3338|    598|    text->dfRectWidth        = buffer.ReadBITDOUBLE();
 3339|    598|    text->dfTextHeight       = buffer.ReadBITDOUBLE();
 3340|    598|    text->dAttachment        = buffer.ReadBITSHORT();
 3341|    598|    text->dDrawingDir        = buffer.ReadBITSHORT();
 3342|    598|    text->dfExtents          = buffer.ReadBITDOUBLE();
 3343|    598|    text->dfExtentsWidth     = buffer.ReadBITDOUBLE();
 3344|    598|    text->sTextValue         = buffer.ReadTV();
 3345|    598|    text->dLineSpacingStyle  = buffer.ReadBITSHORT();
 3346|    598|    text->dLineSpacingFactor = buffer.ReadBITDOUBLE();
 3347|    598|    text->bUnknownBit        = buffer.ReadBIT();
 3348|       |
 3349|    598|    fillCommonEntityHandleData( text, buffer);
 3350|       |
 3351|    598|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 3352|    598|    text->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "MTEXT" ) );
 3353|    598|    return text;
 3354|    598|}
_ZN12DWGFileR200011getImageDefEjR9CADBuffer:
 3599|  2.03k|{
 3600|  2.03k|    CADImageDefObject * imagedef = new CADImageDefObject();
 3601|       |
 3602|  2.03k|    if(!readBasicData(imagedef, dObjectSize, buffer))
  ------------------
  |  Branch (3602:8): [True: 350, False: 1.68k]
  ------------------
 3603|    350|    {
 3604|    350|        delete imagedef;
 3605|    350|        return nullptr;
 3606|    350|    }
 3607|       |
 3608|  1.68k|    imagedef->dClassVersion = buffer.ReadBITLONG();
 3609|       |
 3610|  1.68k|    imagedef->dfXImageSizeInPx = buffer.ReadRAWDOUBLE();
 3611|  1.68k|    imagedef->dfYImageSizeInPx = buffer.ReadRAWDOUBLE();
 3612|       |
 3613|  1.68k|    imagedef->sFilePath = buffer.ReadTV();
 3614|  1.68k|    imagedef->bIsLoaded = buffer.ReadBIT();
 3615|       |
 3616|  1.68k|    imagedef->dResUnits = buffer.ReadCHAR();
 3617|       |
 3618|  1.68k|    imagedef->dfXPixelSize = buffer.ReadRAWDOUBLE();
 3619|  1.68k|    imagedef->dfYPixelSize = buffer.ReadRAWDOUBLE();
 3620|       |
 3621|  1.68k|    imagedef->hParentHandle = buffer.ReadHANDLE();
 3622|       |
 3623|  29.2k|    for( long i = 0; i < imagedef->nNumReactors; ++i )
  ------------------
  |  Branch (3623:22): [True: 28.0k, False: 1.22k]
  ------------------
 3624|  28.0k|    {
 3625|  28.0k|        imagedef->hReactors.push_back( buffer.ReadHANDLE() );
 3626|  28.0k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (3626:13): [True: 461, False: 27.5k]
  ------------------
 3627|    461|        {
 3628|    461|            delete imagedef;
 3629|    461|            return nullptr;
 3630|    461|        }
 3631|  28.0k|    }
 3632|       |
 3633|  1.22k|    imagedef->hXDictionary = buffer.ReadHANDLE();
 3634|       |
 3635|  1.22k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 3636|  1.22k|    imagedef->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "IMAGEDEF" ) );
 3637|       |
 3638|  1.22k|    return imagedef;
 3639|  1.68k|}
_ZN12DWGFileR200018getImageDefReactorEjR9CADBuffer:
 3642|  1.55k|{
 3643|  1.55k|    CADImageDefReactorObject * imagedefreactor = new CADImageDefReactorObject();
 3644|       |
 3645|  1.55k|    if(!readBasicData(imagedefreactor, dObjectSize, buffer))
  ------------------
  |  Branch (3645:8): [True: 248, False: 1.30k]
  ------------------
 3646|    248|    {
 3647|    248|        delete imagedefreactor;
 3648|    248|        return nullptr;
 3649|    248|    }
 3650|       |
 3651|  1.30k|    imagedefreactor->dClassVersion = buffer.ReadBITLONG();
 3652|       |
 3653|  1.30k|    imagedefreactor->hParentHandle =buffer.ReadHANDLE();
 3654|       |
 3655|  34.7k|    for( long i = 0; i < imagedefreactor->nNumReactors; ++i )
  ------------------
  |  Branch (3655:22): [True: 33.6k, False: 1.06k]
  ------------------
 3656|  33.6k|    {
 3657|  33.6k|        imagedefreactor->hReactors.push_back( buffer.ReadHANDLE() );
 3658|  33.6k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (3658:13): [True: 235, False: 33.4k]
  ------------------
 3659|    235|        {
 3660|    235|            delete imagedefreactor;
 3661|    235|            return nullptr;
 3662|    235|        }
 3663|  33.6k|    }
 3664|       |
 3665|  1.06k|    imagedefreactor->hXDictionary = buffer.ReadHANDLE();
 3666|       |
 3667|  1.06k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 3668|  1.06k|    imagedefreactor->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "IMAGEDEFREFACTOR" ) );
 3669|       |
 3670|  1.06k|    return imagedefreactor;
 3671|  1.30k|}
_ZN12DWGFileR200010getXRecordEjR9CADBuffer:
 3674|  2.92k|{
 3675|  2.92k|    CADXRecordObject * xrecord = new CADXRecordObject();
 3676|       |
 3677|  2.92k|    if(!readBasicData(xrecord, dObjectSize, buffer))
  ------------------
  |  Branch (3677:8): [True: 216, False: 2.70k]
  ------------------
 3678|    216|    {
 3679|    216|        delete xrecord;
 3680|    216|        return nullptr;
 3681|    216|    }
 3682|       |
 3683|  2.70k|    xrecord->nNumDataBytes = buffer.ReadBITLONG();
 3684|  2.70k|    if(xrecord->nNumDataBytes < 0)
  ------------------
  |  Branch (3684:8): [True: 227, False: 2.47k]
  ------------------
 3685|    227|    {
 3686|    227|        delete xrecord;
 3687|    227|        return nullptr;
 3688|    227|    }
 3689|   323k|    for( long i = 0; i < xrecord->nNumDataBytes; ++i )
  ------------------
  |  Branch (3689:22): [True: 321k, False: 2.19k]
  ------------------
 3690|   321k|    {
 3691|   321k|        xrecord->abyDataBytes.push_back( buffer.ReadCHAR() );
 3692|   321k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (3692:13): [True: 285, False: 320k]
  ------------------
 3693|    285|        {
 3694|    285|            delete xrecord;
 3695|    285|            return nullptr;
 3696|    285|        }
 3697|   321k|    }
 3698|       |
 3699|  2.19k|    xrecord->dCloningFlag = buffer.ReadBITSHORT();
 3700|       |
 3701|  2.19k|    short dIndicatorNumber = buffer.ReadRAWSHORT();
 3702|  2.19k|    if( dIndicatorNumber == 1 )
  ------------------
  |  Branch (3702:9): [True: 416, False: 1.77k]
  ------------------
 3703|    416|    {
 3704|    416|        unsigned char nStringSize = buffer.ReadCHAR();
 3705|    416|        /* char dCodePage   =  */ buffer.ReadCHAR();
 3706|  4.07k|        for( unsigned char i = 0; i < nStringSize; ++i )
  ------------------
  |  Branch (3706:35): [True: 3.66k, False: 416]
  ------------------
 3707|  3.66k|        {
 3708|  3.66k|            buffer.ReadCHAR();
 3709|  3.66k|        }
 3710|    416|    }
 3711|  1.77k|    else if( dIndicatorNumber == 70 )
  ------------------
  |  Branch (3711:14): [True: 199, False: 1.57k]
  ------------------
 3712|    199|    {
 3713|    199|        buffer.ReadRAWSHORT();
 3714|    199|    }
 3715|  1.57k|    else if( dIndicatorNumber == 10 )
  ------------------
  |  Branch (3715:14): [True: 196, False: 1.38k]
  ------------------
 3716|    196|    {
 3717|    196|        buffer.ReadRAWDOUBLE();
 3718|    196|        buffer.ReadRAWDOUBLE();
 3719|    196|        buffer.ReadRAWDOUBLE();
 3720|    196|    }
 3721|  1.38k|    else if( dIndicatorNumber == 40 )
  ------------------
  |  Branch (3721:14): [True: 195, False: 1.18k]
  ------------------
 3722|    195|    {
 3723|    195|        buffer.ReadRAWDOUBLE();
 3724|    195|    }
 3725|       |
 3726|  2.19k|    xrecord->hParentHandle = buffer.ReadHANDLE();
 3727|       |
 3728|  69.5k|    for( long i = 0; i < xrecord->nNumReactors; ++i )
  ------------------
  |  Branch (3728:22): [True: 68.0k, False: 1.49k]
  ------------------
 3729|  68.0k|    {
 3730|  68.0k|        xrecord->hReactors.push_back( buffer.ReadHANDLE() );
 3731|  68.0k|        if( buffer.IsEOB() )
  ------------------
  |  Branch (3731:13): [True: 698, False: 67.3k]
  ------------------
 3732|    698|        {
 3733|    698|            delete xrecord;
 3734|    698|            return nullptr;
 3735|    698|        }
 3736|  68.0k|    }
 3737|       |
 3738|  1.49k|    xrecord->hXDictionary = buffer.ReadHANDLE();
 3739|       |
 3740|  1.49k|    size_t dObjectSizeBit = (dObjectSize + 4) * 8;
 3741|  47.5k|    while( buffer.PositionBit() < dObjectSizeBit )
  ------------------
  |  Branch (3741:12): [True: 46.0k, False: 1.49k]
  ------------------
 3742|  46.0k|    {
 3743|  46.0k|        xrecord->hObjIdHandles.push_back( buffer.ReadHANDLE() );
 3744|  46.0k|    }
 3745|       |
 3746|  1.49k|    buffer.Seek((dObjectSize - 2) * 8, CADBuffer::BEG);
 3747|  1.49k|    xrecord->setCRC( validateEntityCRC( buffer, dObjectSize - 2, "XRECORD" ) );
 3748|       |
 3749|  1.49k|    return xrecord;
 3750|  2.19k|}
_ZN12DWGFileR200026fillCommonEntityHandleDataEP15CADEntityObjectR9CADBuffer:
 3754|  32.7k|{
 3755|  32.7k|    if( pEnt->stCed.bbEntMode == 0 )
  ------------------
  |  Branch (3755:9): [True: 20.6k, False: 12.0k]
  ------------------
 3756|  20.6k|        pEnt->stChed.hOwner = buffer.ReadHANDLE();
 3757|       |
 3758|       |    // TODO: Need some reasonable nNumReactors limits.
 3759|  32.7k|    if(pEnt->stCed.nNumReactors < 0 || pEnt->stCed.nNumReactors > 5000)
  ------------------
  |  Branch (3759:8): [True: 0, False: 32.7k]
  |  Branch (3759:40): [True: 0, False: 32.7k]
  ------------------
 3760|      0|    {
 3761|       |        // Something wrong occurred
 3762|      0|        return;
 3763|      0|    }
 3764|  2.18M|    for( long i = 0; i < pEnt->stCed.nNumReactors; ++i )
  ------------------
  |  Branch (3764:22): [True: 2.14M, False: 32.7k]
  ------------------
 3765|  2.14M|        pEnt->stChed.hReactors.push_back( buffer.ReadHANDLE() );
 3766|       |
 3767|  32.7k|    pEnt->stChed.hXDictionary = buffer.ReadHANDLE();
 3768|       |
 3769|  32.7k|    if( !pEnt->stCed.bNoLinks )
  ------------------
  |  Branch (3769:9): [True: 25.1k, False: 7.60k]
  ------------------
 3770|  25.1k|    {
 3771|  25.1k|        pEnt->stChed.hPrevEntity = buffer.ReadHANDLE();
 3772|  25.1k|        pEnt->stChed.hNextEntity = buffer.ReadHANDLE();
 3773|  25.1k|    }
 3774|       |
 3775|  32.7k|    pEnt->stChed.hLayer = buffer.ReadHANDLE();
 3776|       |
 3777|  32.7k|    if( pEnt->stCed.bbLTypeFlags == 0x03 )
  ------------------
  |  Branch (3777:9): [True: 5.64k, False: 27.1k]
  ------------------
 3778|  5.64k|        pEnt->stChed.hLType = buffer.ReadHANDLE();
 3779|       |
 3780|  32.7k|    if( pEnt->stCed.bbPlotStyleFlags == 0x03 )
  ------------------
  |  Branch (3780:9): [True: 4.16k, False: 28.5k]
  ------------------
 3781|  4.16k|        pEnt->stChed.hPlotStyle = buffer.ReadHANDLE();
 3782|  32.7k|}
_ZN12DWGFileR2000C2EP9CADFileIO:
 3785|  7.23k|    CADFile( poFileIO ),
 3786|  7.23k|    imageSeeker(0)
 3787|  7.23k|{
 3788|  7.23k|    oHeader.addValue( CADHeader::OPENCADVER, CADVersions::DWG_R2000 );
 3789|  7.23k|}
_ZN12DWGFileR200019ReadSectionLocatorsEv:
 3792|  7.23k|{
 3793|  7.23k|    char  abyBuf[255] = { 0 };
 3794|  7.23k|    int   dImageSeeker = 0, SLRecordsCount = 0;
 3795|  7.23k|    short dCodePage = 0;
 3796|       |
 3797|  7.23k|    pFileIO->Rewind();
 3798|  7.23k|    memset( abyBuf, 0, DWG_VERSION_STR_SIZE + 1 );
  ------------------
  |  |   35|  7.23k|#define DWG_VERSION_STR_SIZE  6
  ------------------
 3799|  7.23k|    pFileIO->Read( abyBuf, DWG_VERSION_STR_SIZE );
  ------------------
  |  |   35|  7.23k|#define DWG_VERSION_STR_SIZE  6
  ------------------
 3800|  7.23k|    oHeader.addValue( CADHeader::ACADVER, abyBuf );
 3801|  7.23k|    memset( abyBuf, 0, 8 );
 3802|  7.23k|    pFileIO->Read( abyBuf, 7 );
 3803|  7.23k|    oHeader.addValue( CADHeader::ACADMAINTVER, abyBuf );
 3804|       |    // TODO: code can be much simplified if CADHandle will be used.
 3805|  7.23k|    pFileIO->Read( & dImageSeeker, 4 );
 3806|  7.23k|    FromLSB(dImageSeeker);
 3807|       |    // to do so, == and ++ operators should be implemented.
 3808|  7.23k|    DebugMsg( "Image seeker read: %d\n", dImageSeeker );
 3809|  7.23k|    imageSeeker = dImageSeeker;
 3810|       |
 3811|  7.23k|    pFileIO->Seek( 2, CADFileIO::SeekOrigin::CUR ); // 19
 3812|  7.23k|    pFileIO->Read( & dCodePage, 2 );
 3813|  7.23k|    FromLSB(dCodePage);
 3814|  7.23k|    oHeader.addValue( CADHeader::DWGCODEPAGE, dCodePage );
 3815|       |
 3816|  7.23k|    DebugMsg( "DWG Code page: %d\n", dCodePage );
 3817|       |
 3818|  7.23k|    pFileIO->Read( & SLRecordsCount, 4 ); // 21
 3819|  7.23k|    FromLSB(SLRecordsCount);
 3820|       |    // Last vertex is reached. read it and break reading.
 3821|  7.23k|    DebugMsg( "Section locator records count: %d\n", SLRecordsCount );
 3822|       |
 3823|  1.07M|    for( size_t i = 0; i < static_cast<size_t>(SLRecordsCount); ++i )
  ------------------
  |  Branch (3823:24): [True: 1.06M, False: 7.07k]
  ------------------
 3824|  1.06M|    {
 3825|  1.06M|        SectionLocatorRecord readRecord;
 3826|  1.06M|        if( pFileIO->Read( & readRecord.byRecordNumber, 1 ) != 1 ||
  ------------------
  |  Branch (3826:13): [True: 145, False: 1.06M]
  ------------------
 3827|  1.06M|            pFileIO->Read( & readRecord.dSeeker, 4 ) != 4 ||
  ------------------
  |  Branch (3827:13): [True: 10, False: 1.06M]
  ------------------
 3828|  1.06M|            pFileIO->Read( & readRecord.dSize, 4 ) != 4 )
  ------------------
  |  Branch (3828:13): [True: 9, False: 1.06M]
  ------------------
 3829|    164|        {
 3830|    164|            return CADErrorCodes::HEADER_SECTION_READ_FAILED;
 3831|    164|        }
 3832|  1.06M|        FromLSB(readRecord.dSeeker);
 3833|  1.06M|        FromLSB(readRecord.dSize);
 3834|       |
 3835|  1.06M|        sectionLocatorRecords.push_back( readRecord );
 3836|  1.06M|        DebugMsg( "  Record #%d : %d %d\n", sectionLocatorRecords[i].byRecordNumber, sectionLocatorRecords[i].dSeeker,
 3837|  1.06M|                  sectionLocatorRecords[i].dSize );
 3838|  1.06M|    }
 3839|  7.07k|    if( sectionLocatorRecords.size() < 3 )
  ------------------
  |  Branch (3839:9): [True: 13, False: 7.05k]
  ------------------
 3840|     13|        return CADErrorCodes::HEADER_SECTION_READ_FAILED;
 3841|       |
 3842|  7.05k|    return CADErrorCodes::SUCCESS;
 3843|  7.07k|}
_ZN12DWGFileR20006GetNODEv:
 3846|  1.52k|{
 3847|  1.52k|    CADDictionary stNOD;
 3848|  1.52k|    unique_ptr<CADObject> pCADDictionaryObject( GetObject( oTables.GetTableHandle(
 3849|  1.52k|                                  CADTables::NamedObjectsDict ).getAsLong() ) );
 3850|       |
 3851|  1.52k|    CADDictionaryObject* spoNamedDictObj =
 3852|  1.52k|            dynamic_cast<CADDictionaryObject*>( pCADDictionaryObject.get() );
 3853|  1.52k|    if( !spoNamedDictObj )
  ------------------
  |  Branch (3853:9): [True: 1.32k, False: 203]
  ------------------
 3854|  1.32k|    {
 3855|  1.32k|        return stNOD;
 3856|  1.32k|    }
 3857|       |
 3858|  2.26k|    for( size_t i = 0; i < spoNamedDictObj->sItemNames.size(); ++i )
  ------------------
  |  Branch (3858:24): [True: 2.06k, False: 203]
  ------------------
 3859|  2.06k|    {
 3860|  2.06k|        unique_ptr<CADObject> spoDictRecord (
 3861|  2.06k|                    GetObject( spoNamedDictObj->hItemHandles[i].getAsLong() ) );
 3862|       |
 3863|  2.06k|        if( spoDictRecord == nullptr )
  ------------------
  |  Branch (3863:13): [True: 1.46k, False: 593]
  ------------------
 3864|  1.46k|            continue; // Skip unread objects
 3865|       |
 3866|    593|        if( spoDictRecord->getType() == CADObject::DICTIONARY )
  ------------------
  |  Branch (3866:13): [True: 397, False: 196]
  ------------------
 3867|    397|        {
 3868|       |            // TODO: add implementation of DICTIONARY reading
 3869|    397|        }
 3870|    196|        else if( spoDictRecord->getType() == CADObject::XRECORD )
  ------------------
  |  Branch (3870:18): [True: 78, False: 118]
  ------------------
 3871|     78|        {
 3872|     78|            CADXRecord * cadxRecord = new CADXRecord();
 3873|     78|            CADXRecordObject * cadxRecordObject =
 3874|     78|                static_cast<CADXRecordObject*>(spoDictRecord.get());
 3875|       |
 3876|     78|            string xRecordData( cadxRecordObject->abyDataBytes.begin(),
 3877|     78|                                cadxRecordObject->abyDataBytes.end() );
 3878|     78|            cadxRecord->setRecordData( xRecordData );
 3879|       |
 3880|     78|            shared_ptr<CADDictionaryRecord> cadxRecordPtr(static_cast<CADDictionaryRecord*>(cadxRecord));
 3881|       |
 3882|     78|            stNOD.addRecord( make_pair( spoNamedDictObj->sItemNames[i], cadxRecordPtr ) );
 3883|     78|        }
 3884|    593|    }
 3885|       |
 3886|    203|    return stNOD;
 3887|  1.52k|}
_ZN12DWGFileR200017validateEntityCRCER9CADBufferjPKcb:
 3893|   106k|{
 3894|   106k|    unsigned short CRC = static_cast<unsigned short>(buffer.ReadRAWSHORT());
 3895|   106k|    if(bSwapEndianness)
  ------------------
  |  Branch (3895:8): [True: 7.64k, False: 99.3k]
  ------------------
 3896|  7.64k|    {
 3897|  7.64k|        SwapEndianness(CRC, sizeof (CRC));
 3898|  7.64k|    }
 3899|       |
 3900|   106k|    buffer.Seek(0, CADBuffer::BEG);
 3901|   106k|    const unsigned short initial = 0xC0C1;
 3902|   106k|    const unsigned short calculated =
 3903|   106k|            CalculateCRC8(initial, static_cast<const char*>(buffer.GetRawBuffer()),
 3904|   106k|                          static_cast<int>(dObjectSize) );
 3905|   106k|    if( CRC != calculated )
  ------------------
  |  Branch (3905:9): [True: 98.0k, False: 8.94k]
  ------------------
 3906|  98.0k|    {
 3907|  98.0k|        DebugMsg( "Invalid CRC for %s object\nCRC read:0x%X calculated:0x%X\n",
 3908|  98.0k|                                                  entityName, CRC, calculated );
 3909|  98.0k|        return 0; // If CRC equal 0 - this is error
 3910|  98.0k|    }
 3911|  8.94k|    return CRC;
 3912|   106k|}
_ZN12DWGFileR200013readBasicDataEP20CADBaseControlObjectjR9CADBuffer:
 3917|  60.6k|{
 3918|  60.6k|    pBaseControlObject->setSize( dObjectSize );
 3919|  60.6k|    pBaseControlObject->nObjectSizeInBits = buffer.ReadRAWLONG();
 3920|  60.6k|    pBaseControlObject->hObjectHandle = buffer.ReadHANDLE();
 3921|  60.6k|    short  dEEDSize = 0;
 3922|  60.6k|    CADEed dwgEed;
 3923|  95.0k|    while( ( dEEDSize = buffer.ReadBITSHORT() ) != 0 )
  ------------------
  |  Branch (3923:12): [True: 34.4k, False: 60.6k]
  ------------------
 3924|  34.4k|    {
 3925|  34.4k|        dwgEed.dLength = dEEDSize;
 3926|  34.4k|        dwgEed.hApplication = buffer.ReadHANDLE();
 3927|       |
 3928|  34.4k|        if(dEEDSize > 0)
  ------------------
  |  Branch (3928:12): [True: 27.6k, False: 6.77k]
  ------------------
 3929|  27.6k|        {
 3930|  99.9M|            for( short i = 0; i < dEEDSize; ++i )
  ------------------
  |  Branch (3930:31): [True: 99.8M, False: 27.6k]
  ------------------
 3931|  99.8M|            {
 3932|  99.8M|                dwgEed.acData.push_back( buffer.ReadCHAR() );
 3933|  99.8M|            }
 3934|  27.6k|        }
 3935|       |
 3936|  34.4k|        pBaseControlObject->aEED.push_back( dwgEed );
 3937|  34.4k|    }
 3938|       |
 3939|  60.6k|    pBaseControlObject->nNumReactors = buffer.ReadBITLONG();
 3940|       |    // TODO: Need reasonable nNumReactors limits.
 3941|  60.6k|    if(pBaseControlObject->nNumReactors < 0 ||
  ------------------
  |  Branch (3941:8): [True: 941, False: 59.7k]
  ------------------
 3942|  60.6k|       pBaseControlObject->nNumReactors > 5000)
  ------------------
  |  Branch (3942:8): [True: 1.75k, False: 57.9k]
  ------------------
 3943|  2.70k|    {
 3944|  2.70k|        return false;
 3945|  2.70k|    }
 3946|  57.9k|    return true;
 3947|  60.6k|}

_ZN12DWGFileR2000D2Ev:
   66|  7.23k|    virtual             ~DWGFileR2000() = default;

_Z11OpenCADFileP9CADFileION7CADFile11OpenOptionsEb:
   78|  7.27k|{
   79|  7.27k|    int nCADFileVersion = CheckCADFile( pCADFileIO );
   80|  7.27k|    CADFile * poCAD = nullptr;
   81|       |
   82|  7.27k|    switch( nCADFileVersion )
   83|  7.27k|    {
   84|  7.23k|        case CADVersions::DWG_R2000:
  ------------------
  |  Branch (84:9): [True: 7.23k, False: 39]
  ------------------
   85|  7.23k|            poCAD = new DWGFileR2000( pCADFileIO );
   86|  7.23k|            break;
   87|     39|        default:
  ------------------
  |  Branch (87:9): [True: 39, False: 7.23k]
  ------------------
   88|     39|            gLastError = CADErrorCodes::UNSUPPORTED_VERSION;
   89|     39|            delete pCADFileIO;
   90|     39|            return nullptr;
   91|  7.27k|    }
   92|       |
   93|  7.23k|    gLastError = poCAD->ParseFile( eOptions, bReadUnsupportedGeometries );
   94|  7.23k|    if( gLastError != CADErrorCodes::SUCCESS )
  ------------------
  |  Branch (94:9): [True: 5.70k, False: 1.52k]
  ------------------
   95|  5.70k|    {
   96|  5.70k|        delete poCAD;
   97|  5.70k|        return nullptr;
   98|  5.70k|    }
   99|       |
  100|  1.52k|    return poCAD;
  101|  7.23k|}
_Z16GetVersionStringv:
  118|  5.74k|{
  119|  5.74k|    return OCAD_VERSION;
  ------------------
  |  |   18|  5.74k|#define OCAD_VERSION    "0.3.4"
  ------------------
  120|  5.74k|}
_Z16GetLastErrorCodev:
  127|  16.1k|{
  128|  16.1k|    return gLastError;
  129|  16.1k|}
_Z15IdentifyCADFileP9CADFileIOb:
  149|  7.27k|{
  150|  7.27k|    int result = CheckCADFile(pCADFileIO);
  151|  7.27k|    if(bOwn)
  ------------------
  |  Branch (151:8): [True: 0, False: 7.27k]
  ------------------
  152|      0|    {
  153|      0|        delete pCADFileIO;
  154|      0|    }
  155|  7.27k|    return result;
  156|  7.27k|}
_Z13GetCADFormatsv:
  163|  5.74k|{
  164|  5.74k|    return "DWG R2000 [ACAD1015]\n";
  165|  5.74k|}
_Z8DebugMsgPKcz:
  183|  1.28M|{
  184|       |#ifdef _DEBUG
  185|       |    va_list argptr;
  186|       |    va_start( argptr, format );
  187|       |    vfprintf( stdout, format, argptr );
  188|       |    va_end( argptr );
  189|       |#endif //_DEBUG
  190|  1.28M|}
opencad.cpp:_ZL12CheckCADFileP9CADFileIO:
   33|  14.5k|{
   34|  14.5k|    if( pCADFileIO == nullptr )
  ------------------
  |  Branch (34:9): [True: 0, False: 14.5k]
  ------------------
   35|      0|        return 0;
   36|       |
   37|       |#if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && !defined(OPENCAD_DISABLE_EXTENSION_CHECK)
   38|       |    const char * pszFilePath = pCADFileIO->GetFilePath();
   39|       |    size_t nPathLen = strlen( pszFilePath );
   40|       |
   41|       |    if( nPathLen > 3 &&
   42|       |        toupper( static_cast<unsigned char>(pszFilePath[nPathLen - 3]) ) == 'D' &&
   43|       |        toupper( static_cast<unsigned char>(pszFilePath[nPathLen - 2]) ) == 'X' &&
   44|       |        toupper( static_cast<unsigned char>(pszFilePath[nPathLen - 1]) ) == 'F' )
   45|       |    {
   46|       |        //TODO: "AutoCAD Binary DXF"
   47|       |        //std::cerr << "DXF ASCII and binary is not supported yet.";
   48|       |        return 0;
   49|       |    }
   50|       |    if( ! ( nPathLen > 3 &&
   51|       |            toupper( static_cast<unsigned char>(pszFilePath[nPathLen - 3]) ) == 'D' &&
   52|       |            toupper( static_cast<unsigned char>(pszFilePath[nPathLen - 2]) ) == 'W' &&
   53|       |            toupper( static_cast<unsigned char>(pszFilePath[nPathLen - 1]) ) == 'G' ) )
   54|       |    {
   55|       |        return 0;
   56|       |    }
   57|       |#endif
   58|       |
   59|  14.5k|    if( !pCADFileIO->IsOpened() )
  ------------------
  |  Branch (59:9): [True: 7.27k, False: 7.27k]
  ------------------
   60|  7.27k|        pCADFileIO->Open( CADFileIO::OpenMode::in | CADFileIO::OpenMode::binary );
   61|  14.5k|    if( !pCADFileIO->IsOpened() )
  ------------------
  |  Branch (61:9): [True: 0, False: 14.5k]
  ------------------
   62|      0|        return 0;
   63|       |
   64|  14.5k|    char pabyDWGVersion[DWG_VERSION_STR_SIZE + 1] = { 0 };
   65|  14.5k|    pCADFileIO->Rewind ();
   66|  14.5k|    pCADFileIO->Read( pabyDWGVersion, DWG_VERSION_STR_SIZE );
  ------------------
  |  |   35|  14.5k|#define DWG_VERSION_STR_SIZE  6
  ------------------
   67|  14.5k|    return atoi( pabyDWGVersion + 2 );
   68|  14.5k|}

_ZN11OGRCADLayer13GetSpatialRefEv:
   47|  1.02k|    {
   48|  1.02k|        return poSpatialRef;
   49|  1.02k|    }
_ZN11OGRCADLayer12GetLayerDefnEv:
   52|  3.06k|    {
   53|  3.06k|        return poFeatureDefn;
   54|  3.06k|    }
_ZN14GDALCADDataset13GetLayerCountEv:
   85|  1.52k|    {
   86|  1.52k|        return nLayers;
   87|  1.52k|    }

RegisterOGRCAD:
   90|      2|{
   91|      2|    if (GDALGetDriverByName(DRIVER_NAME) == nullptr)
  ------------------
  |  Branch (91:9): [True: 2, False: 0]
  ------------------
   92|      2|    {
   93|      2|        auto poDriver = new GDALDriver();
   94|      2|        OGRCADDriverSetCommonMetadata(poDriver);
  ------------------
  |  |   24|      2|    PLUGIN_SYMBOL_NAME(OGRCADDriverSetCommonMetadata)
  |  |  ------------------
  |  |  |  | 4845|      2|#define PLUGIN_SYMBOL_NAME(x) GDAL_driver_##x
  |  |  ------------------
  ------------------
   95|       |
   96|      2|        poDriver->pfnOpen = OGRCADDriverOpen;
   97|       |
   98|      2|        GetGDALDriverManager()->RegisterDriver(poDriver);
   99|      2|    }
  100|      2|}
_Z9CADRecodeRK9CPLStringi:
  103|  1.57k|{
  104|  1.57k|    const char *const apszSource[] = {/* 0 UNDEFINED */ "",
  105|  1.57k|                                      /* 1 ASCII */ "US-ASCII",
  106|  1.57k|                                      /* 2 8859_1 */ "ISO-8859-1",
  107|  1.57k|                                      /* 3 8859_2 */ "ISO-8859-2",
  108|  1.57k|                                      /* 4 UNDEFINED */ "",
  109|  1.57k|                                      /* 5 8859_4 */ "ISO-8859-4",
  110|  1.57k|                                      /* 6 8859_5 */ "ISO-8859-5",
  111|  1.57k|                                      /* 7 8859_6 */ "ISO-8859-6",
  112|  1.57k|                                      /* 8 8859_7 */ "ISO-8859-7",
  113|  1.57k|                                      /* 9 8859_8 */ "ISO-8859-8",
  114|  1.57k|                                      /* 10 8859_9 */ "ISO-8859-9",
  115|  1.57k|                                      /* 11 DOS437 */ "CP437",
  116|  1.57k|                                      /* 12 DOS850 */ "CP850",
  117|  1.57k|                                      /* 13 DOS852 */ "CP852",
  118|  1.57k|                                      /* 14 DOS855 */ "CP855",
  119|  1.57k|                                      /* 15 DOS857 */ "CP857",
  120|  1.57k|                                      /* 16 DOS860 */ "CP860",
  121|  1.57k|                                      /* 17 DOS861 */ "CP861",
  122|  1.57k|                                      /* 18 DOS863 */ "CP863",
  123|  1.57k|                                      /* 19 DOS864 */ "CP864",
  124|  1.57k|                                      /* 20 DOS865 */ "CP865",
  125|  1.57k|                                      /* 21 DOS869 */ "CP869",
  126|  1.57k|                                      /* 22 DOS932 */ "CP932",
  127|  1.57k|                                      /* 23 MACINTOSH */ "MACINTOSH",
  128|  1.57k|                                      /* 24 BIG5 */ "BIG5",
  129|  1.57k|                                      /* 25 KSC5601 */ "CP949",
  130|  1.57k|                                      /* 26 JOHAB */ "JOHAB",
  131|  1.57k|                                      /* 27 DOS866 */ "CP866",
  132|  1.57k|                                      /* 28 ANSI_1250 */ "CP1250",
  133|  1.57k|                                      /* 29 ANSI_1251 */ "CP1251",
  134|  1.57k|                                      /* 30 ANSI_1252 */ "CP1252",
  135|  1.57k|                                      /* 31 GB2312 */ "GB2312",
  136|  1.57k|                                      /* 32 ANSI_1253 */ "CP1253",
  137|  1.57k|                                      /* 33 ANSI_1254 */ "CP1254",
  138|  1.57k|                                      /* 34 ANSI_1255 */ "CP1255",
  139|  1.57k|                                      /* 35 ANSI_1256 */ "CP1256",
  140|  1.57k|                                      /* 36 ANSI_1257 */ "CP1257",
  141|  1.57k|                                      /* 37 ANSI_874 */ "CP874",
  142|  1.57k|                                      /* 38 ANSI_932 */ "CP932",
  143|  1.57k|                                      /* 39 ANSI_936 */ "CP936",
  144|  1.57k|                                      /* 40 ANSI_949 */ "CP949",
  145|  1.57k|                                      /* 41 ANSI_950 */ "CP950",
  146|  1.57k|                                      /* 42 ANSI_1361 */ "CP1361",
  147|  1.57k|                                      /* 43 ANSI_1200 */ "UTF-16",
  148|  1.57k|                                      /* 44 ANSI_1258 */ "CP1258"};
  149|       |
  150|  1.57k|    if (CADEncoding > 0 &&
  ------------------
  |  Branch (150:9): [True: 356, False: 1.22k]
  ------------------
  151|  1.57k|        CADEncoding < static_cast<int>(CPL_ARRAYSIZE(apszSource)) &&
  ------------------
  |  | 1004|    356|    ((sizeof(array) / sizeof(*(array))) /                                      \
  |  | 1005|    356|     static_cast<size_t>(!(sizeof(array) % sizeof(*(array)))))
  ------------------
  |  Branch (151:9): [True: 250, False: 106]
  ------------------
  152|  1.57k|        CADEncoding != 4)
  ------------------
  |  Branch (152:9): [True: 238, False: 12]
  ------------------
  153|    238|    {
  154|    238|        char *pszRecoded =
  155|    238|            CPLRecode(sString, apszSource[CADEncoding], CPL_ENC_UTF8);
  ------------------
  |  |  236|    238|#define CPL_ENC_UTF8 "UTF-8"
  ------------------
  156|    238|        CPLString soRecoded(pszRecoded);
  157|    238|        CPLFree(pszRecoded);
  ------------------
  |  |   86|    238|#define CPLFree VSIFree
  ------------------
  158|    238|        return soRecoded;
  159|    238|    }
  160|  1.34k|    CPLError(CE_Failure, CPLE_NotSupported,
  ------------------
  |  |   95|  1.34k|#define CPLE_NotSupported 6
  ------------------
  161|  1.34k|             "CADRecode() function does not support provided CADEncoding.");
  162|  1.34k|    return CPLString("");
  163|  1.57k|}
ogrcaddriver.cpp:_ZL16OGRCADDriverOpenP12GDALOpenInfo:
   24|  7.27k|{
   25|  7.27k|    long nSubRasterLayer = -1;
   26|  7.27k|    long nSubRasterFID = -1;
   27|       |
   28|  7.27k|    CADFileIO *pFileIO;
   29|  7.27k|    if (STARTS_WITH_CI(poOpenInfo->pszFilename, "CAD:"))
  ------------------
  |  |  552|  7.27k|#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
  |  |  ------------------
  |  |  |  |  539|  7.27k|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|  7.27k|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (539:25): [True: 0, False: 7.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   30|      0|    {
   31|      0|        char **papszTokens =
   32|      0|            CSLTokenizeString2(poOpenInfo->pszFilename, ":", 0);
   33|      0|        int nTokens = CSLCount(papszTokens);
   34|      0|        if (nTokens < 4)
  ------------------
  |  Branch (34:13): [True: 0, False: 0]
  ------------------
   35|      0|        {
   36|      0|            CSLDestroy(papszTokens);
   37|      0|            return nullptr;
   38|      0|        }
   39|       |
   40|      0|        CPLString osFilename;
   41|      0|        for (int i = 1; i < nTokens - 2; ++i)
  ------------------
  |  Branch (41:25): [True: 0, False: 0]
  ------------------
   42|      0|        {
   43|      0|            if (osFilename.empty())
  ------------------
  |  Branch (43:17): [True: 0, False: 0]
  ------------------
   44|      0|                osFilename += ":";
   45|      0|            osFilename += papszTokens[i];
   46|      0|        }
   47|       |
   48|      0|        pFileIO = new VSILFileIO(osFilename);
   49|      0|        nSubRasterLayer = atol(papszTokens[nTokens - 2]);
   50|      0|        nSubRasterFID = atol(papszTokens[nTokens - 1]);
   51|       |
   52|      0|        CSLDestroy(papszTokens);
   53|      0|    }
   54|  7.27k|    else
   55|  7.27k|    {
   56|  7.27k|        pFileIO = new VSILFileIO(poOpenInfo->pszFilename);
   57|  7.27k|    }
   58|       |
   59|  7.27k|    if (IdentifyCADFile(pFileIO, false) == FALSE)
  ------------------
  |  | 1039|  7.27k|#define FALSE 0
  ------------------
  |  Branch (59:9): [True: 1, False: 7.27k]
  ------------------
   60|      1|    {
   61|      1|        delete pFileIO;
   62|      1|        return nullptr;
   63|      1|    }
   64|       |
   65|       |    /* -------------------------------------------------------------------- */
   66|       |    /*      Confirm the requested access is supported.                      */
   67|       |    /* -------------------------------------------------------------------- */
   68|  7.27k|    if (poOpenInfo->eAccess == GA_Update)
  ------------------
  |  Branch (68:9): [True: 0, False: 7.27k]
  ------------------
   69|      0|    {
   70|      0|        GDALDataset::ReportUpdateNotSupportedByDriver("CAD");
   71|      0|        delete pFileIO;
   72|      0|        return nullptr;
   73|      0|    }
   74|       |
   75|  7.27k|    GDALCADDataset *poDS = new GDALCADDataset();
   76|  7.27k|    if (!poDS->Open(poOpenInfo, pFileIO, nSubRasterLayer, nSubRasterFID))
  ------------------
  |  Branch (76:9): [True: 5.74k, False: 1.52k]
  ------------------
   77|  5.74k|    {
   78|  5.74k|        delete poDS;
   79|  5.74k|        return nullptr;
   80|  5.74k|    }
   81|  1.52k|    else
   82|  1.52k|        return poDS;
   83|  7.27k|}

_Z41GDAL_driver_OGRCADDriverSetCommonMetadataP10GDALDriver:
   40|      2|{
   41|      2|    poDriver->SetDescription(DRIVER_NAME);
   42|      2|    poDriver->SetMetadataItem(GDAL_DCAP_RASTER, "YES");
  ------------------
  |  |  633|      2|#define GDAL_DCAP_RASTER "DCAP_RASTER"
  ------------------
   43|      2|    poDriver->SetMetadataItem(GDAL_DCAP_VECTOR, "YES");
  ------------------
  |  |  638|      2|#define GDAL_DCAP_VECTOR "DCAP_VECTOR"
  ------------------
   44|      2|    poDriver->SetMetadataItem(GDAL_DCAP_CREATE_LAYER, "YES");
  ------------------
  |  |  648|      2|#define GDAL_DCAP_CREATE_LAYER "DCAP_CREATE_LAYER"
  ------------------
   45|      2|    poDriver->SetMetadataItem(GDAL_DCAP_DELETE_LAYER, "YES");
  ------------------
  |  |  653|      2|#define GDAL_DCAP_DELETE_LAYER "DCAP_DELETE_LAYER"
  ------------------
   46|      2|    poDriver->SetMetadataItem(GDAL_DMD_SUBDATASETS, "YES");
  ------------------
  |  |  537|      2|#define GDAL_DMD_SUBDATASETS "DMD_SUBDATASETS"
  ------------------
   47|      2|    poDriver->SetMetadataItem(GDAL_DMD_LONGNAME, "AutoCAD Driver");
  ------------------
  |  |  415|      2|#define GDAL_DMD_LONGNAME "DMD_LONGNAME"
  ------------------
   48|      2|    poDriver->SetMetadataItem(GDAL_DMD_EXTENSION, "dwg");
  ------------------
  |  |  424|      2|#define GDAL_DMD_EXTENSION "DMD_EXTENSION"
  ------------------
   49|      2|    poDriver->SetMetadataItem(GDAL_DMD_HELPTOPIC, "drivers/vector/cad.html");
  ------------------
  |  |  418|      2|#define GDAL_DMD_HELPTOPIC "DMD_HELPTOPIC"
  ------------------
   50|      2|    poDriver->SetMetadataItem(GDAL_DCAP_MULTIPLE_VECTOR_LAYERS, "YES");
  ------------------
  |  |  791|      2|#define GDAL_DCAP_MULTIPLE_VECTOR_LAYERS "DCAP_MULTIPLE_VECTOR_LAYERS"
  ------------------
   51|      2|    poDriver->SetMetadataItem(GDAL_DCAP_CURVE_GEOMETRIES, "YES");
  ------------------
  |  |  729|      2|#define GDAL_DCAP_CURVE_GEOMETRIES "DCAP_CURVE_GEOMETRIES"
  ------------------
   52|      2|    poDriver->SetMetadataItem(GDAL_DCAP_MEASURED_GEOMETRIES, "YES");
  ------------------
  |  |  735|      2|#define GDAL_DCAP_MEASURED_GEOMETRIES "DCAP_MEASURED_GEOMETRIES"
  ------------------
   53|      2|    poDriver->SetMetadataItem(GDAL_DCAP_Z_GEOMETRIES, "YES");
  ------------------
  |  |  741|      2|#define GDAL_DCAP_Z_GEOMETRIES "DCAP_Z_GEOMETRIES"
  ------------------
   54|      2|    poDriver->SetMetadataItem(GDAL_DMD_SUPPORTED_SQL_DIALECTS, "OGRSQL SQLITE");
  ------------------
  |  |  935|      2|#define GDAL_DMD_SUPPORTED_SQL_DIALECTS "DMD_SUPPORTED_SQL_DIALECTS"
  ------------------
   55|       |
   56|      2|    poDriver->SetMetadataItem(
   57|      2|        GDAL_DMD_OPENOPTIONLIST,
  ------------------
  |  |  479|      2|#define GDAL_DMD_OPENOPTIONLIST "DMD_OPENOPTIONLIST"
  ------------------
   58|      2|        "<OpenOptionList>"
   59|      2|        "  <Option name='MODE' type='string' description='Open mode. "
   60|      2|        "READ_ALL - read all data (slow), READ_FAST - read main data "
   61|      2|        "(fast), READ_FASTEST - read less data' default='READ_FAST'/>"
   62|      2|        "  <Option name='ADD_UNSUPPORTED_GEOMETRIES_DATA' type='string' "
   63|      2|        "description='Add unsupported geometries data (color, attributes) "
   64|      2|        "to the layer (YES/NO). They will have no geometrical "
   65|      2|        "representation.' default='NO'/>"
   66|      2|        "</OpenOptionList>");
   67|       |
   68|      2|    poDriver->SetMetadataItem(GDAL_DCAP_VIRTUALIO, "YES");
  ------------------
  |  |  628|      2|#define GDAL_DCAP_VIRTUALIO "DCAP_VIRTUALIO"
  ------------------
   69|      2|    poDriver->SetMetadataItem(GDAL_DCAP_FEATURE_STYLES, "YES");
  ------------------
  |  |  765|      2|#define GDAL_DCAP_FEATURE_STYLES "DCAP_FEATURE_STYLES"
  ------------------
   70|      2|    poDriver->SetMetadataItem(GDAL_DCAP_FEATURE_STYLES_READ, "YES");
  ------------------
  |  |  770|      2|#define GDAL_DCAP_FEATURE_STYLES_READ "DCAP_FEATURE_STYLES_READ"
  ------------------
   71|       |
   72|      2|    poDriver->pfnIdentify = OGRCADDriverIdentify;
   73|      2|    poDriver->SetMetadataItem(GDAL_DCAP_OPEN, "YES");
  ------------------
  |  |  569|      2|#define GDAL_DCAP_OPEN "DCAP_OPEN"
  ------------------
   74|      2|}
ogrcaddrivercore.cpp:_ZL20OGRCADDriverIdentifyP12GDALOpenInfo:
   26|  7.31k|{
   27|       |#if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
   28|       |    if (!poOpenInfo->IsExtensionEqualToCI("DWG"))
   29|       |        return FALSE;
   30|       |#endif
   31|  7.31k|    return poOpenInfo->nHeaderBytes >= 6 && poOpenInfo->pabyHeader[0] == 'A' &&
  ------------------
  |  Branch (31:12): [True: 7.30k, False: 6]
  |  Branch (31:45): [True: 7.28k, False: 21]
  ------------------
   32|  7.31k|           poOpenInfo->pabyHeader[1] == 'C';
  ------------------
  |  Branch (32:12): [True: 7.27k, False: 11]
  ------------------
   33|  7.31k|}

_ZN11OGRCADLayerC2EP11GDALDatasetR8CADLayerP19OGRSpatialReferencei:
   33|  1.02k|    : m_poDS(poDS), poSpatialRef(poSR), poCADLayer(poCADLayer_),
   34|  1.02k|      nDWGEncoding(nEncoding)
   35|  1.02k|{
   36|  1.02k|    nNextFID = 0;
   37|       |
   38|  1.02k|    if (poSpatialRef)
  ------------------
  |  Branch (38:9): [True: 1.02k, False: 0]
  ------------------
   39|  1.02k|        poSpatialRef->Reference();
   40|  1.02k|    poFeatureDefn =
   41|  1.02k|        new OGRFeatureDefn(CADRecode(poCADLayer_.getName(), nDWGEncoding));
   42|       |
   43|       |    // Setting up layer geometry type
   44|  1.02k|    OGRwkbGeometryType eGeomType;
   45|  1.02k|    char dLineStringPresented = 0;
   46|  1.02k|    char dCircularStringPresented = 0;
   47|  1.02k|    char dPointPresented = 0;
   48|  1.02k|    char dPolygonPresented = 0;
   49|  1.02k|    std::vector<CADObject::ObjectType> aePresentedGeometryTypes =
   50|  1.02k|        poCADLayer.getGeometryTypes();
   51|  2.27k|    for (size_t i = 0; i < aePresentedGeometryTypes.size(); ++i)
  ------------------
  |  Branch (51:24): [True: 1.25k, False: 1.02k]
  ------------------
   52|  1.25k|    {
   53|  1.25k|        switch (aePresentedGeometryTypes[i])
   54|  1.25k|        {
   55|    302|            case CADObject::ATTDEF:
  ------------------
  |  Branch (55:13): [True: 302, False: 955]
  ------------------
   56|    451|            case CADObject::TEXT:
  ------------------
  |  Branch (56:13): [True: 149, False: 1.10k]
  ------------------
   57|    681|            case CADObject::MTEXT:
  ------------------
  |  Branch (57:13): [True: 230, False: 1.02k]
  ------------------
   58|    710|            case CADObject::POINT:
  ------------------
  |  Branch (58:13): [True: 29, False: 1.22k]
  ------------------
   59|    710|                dPointPresented = 1;
   60|    710|                break;
   61|     45|            case CADObject::CIRCLE:
  ------------------
  |  Branch (61:13): [True: 45, False: 1.21k]
  ------------------
   62|     45|                dCircularStringPresented = 1;
   63|     45|                break;
   64|     87|            case CADObject::SPLINE:
  ------------------
  |  Branch (64:13): [True: 87, False: 1.17k]
  ------------------
   65|    140|            case CADObject::ELLIPSE:
  ------------------
  |  Branch (65:13): [True: 53, False: 1.20k]
  ------------------
   66|    161|            case CADObject::ARC:
  ------------------
  |  Branch (66:13): [True: 21, False: 1.23k]
  ------------------
   67|    307|            case CADObject::POLYLINE3D:
  ------------------
  |  Branch (67:13): [True: 146, False: 1.11k]
  ------------------
   68|    307|            case CADObject::POLYLINE2D:
  ------------------
  |  Branch (68:13): [True: 0, False: 1.25k]
  ------------------
   69|    325|            case CADObject::LWPOLYLINE:
  ------------------
  |  Branch (69:13): [True: 18, False: 1.23k]
  ------------------
   70|    360|            case CADObject::LINE:
  ------------------
  |  Branch (70:13): [True: 35, False: 1.22k]
  ------------------
   71|    360|                dLineStringPresented = 1;
   72|    360|                break;
   73|     70|            case CADObject::FACE3D:
  ------------------
  |  Branch (73:13): [True: 70, False: 1.18k]
  ------------------
   74|     82|            case CADObject::SOLID:
  ------------------
  |  Branch (74:13): [True: 12, False: 1.24k]
  ------------------
   75|     82|                dPolygonPresented = 1;
   76|     82|                break;
   77|     60|            default:
  ------------------
  |  Branch (77:13): [True: 60, False: 1.19k]
  ------------------
   78|     60|                break;
   79|  1.25k|        }
   80|  1.25k|    }
   81|       |
   82|  1.02k|    if ((dLineStringPresented + dCircularStringPresented + dPointPresented +
  ------------------
  |  Branch (82:9): [True: 6, False: 1.01k]
  ------------------
   83|  1.02k|         dPolygonPresented) > 1)
   84|      6|    {
   85|      6|        eGeomType = wkbGeometryCollection;
   86|      6|    }
   87|  1.01k|    else
   88|  1.01k|    {
   89|  1.01k|        if (dLineStringPresented)
  ------------------
  |  Branch (89:13): [True: 354, False: 660]
  ------------------
   90|    354|        {
   91|    354|            eGeomType = wkbLineString;
   92|    354|        }
   93|    660|        else if (dCircularStringPresented)
  ------------------
  |  Branch (93:18): [True: 45, False: 615]
  ------------------
   94|     45|        {
   95|     45|            eGeomType = wkbCircularString;
   96|     45|        }
   97|    615|        else if (dPointPresented)
  ------------------
  |  Branch (97:18): [True: 478, False: 137]
  ------------------
   98|    478|        {
   99|    478|            eGeomType = wkbPoint;
  100|    478|        }
  101|    137|        else if (dPolygonPresented)
  ------------------
  |  Branch (101:18): [True: 78, False: 59]
  ------------------
  102|     78|        {
  103|     78|            eGeomType = wkbPolygon;
  104|     78|        }
  105|     59|        else
  106|     59|        {
  107|     59|            eGeomType = wkbUnknown;
  108|     59|        }
  109|  1.01k|    }
  110|  1.02k|    poFeatureDefn->SetGeomType(eGeomType);
  111|       |
  112|  1.02k|    OGRFieldDefn oClassField(FIELD_NAME_GEOMTYPE, OFTString);
  ------------------
  |  |   22|  1.02k|#define FIELD_NAME_GEOMTYPE "cadgeom_type"
  ------------------
  113|  1.02k|    poFeatureDefn->AddFieldDefn(&oClassField);
  114|       |
  115|  1.02k|    OGRFieldDefn oLinetypeField(FIELD_NAME_THICKNESS, OFTReal);
  ------------------
  |  |   23|  1.02k|#define FIELD_NAME_THICKNESS "thickness"
  ------------------
  116|  1.02k|    poFeatureDefn->AddFieldDefn(&oLinetypeField);
  117|       |
  118|  1.02k|    OGRFieldDefn oColorField(FIELD_NAME_COLOR, OFTString);
  ------------------
  |  |   24|  1.02k|#define FIELD_NAME_COLOR "color"
  ------------------
  119|  1.02k|    poFeatureDefn->AddFieldDefn(&oColorField);
  120|       |
  121|  1.02k|    OGRFieldDefn oExtendedField(FIELD_NAME_EXT_DATA, OFTString);
  ------------------
  |  |   25|  1.02k|#define FIELD_NAME_EXT_DATA "extentity_data"
  ------------------
  122|  1.02k|    poFeatureDefn->AddFieldDefn(&oExtendedField);
  123|       |
  124|  1.02k|    OGRFieldDefn oTextField(FIELD_NAME_TEXT, OFTString);
  ------------------
  |  |   26|  1.02k|#define FIELD_NAME_TEXT "text"
  ------------------
  125|  1.02k|    poFeatureDefn->AddFieldDefn(&oTextField);
  126|       |
  127|  1.02k|    auto oAttrTags = poCADLayer.getAttributesTags();
  128|  1.02k|    for (const std::string &osTag : oAttrTags)
  ------------------
  |  Branch (128:35): [True: 289, False: 1.02k]
  ------------------
  129|    289|    {
  130|    289|        auto ret = asFeaturesAttributes.insert(osTag);
  131|    289|        if (ret.second == true)
  ------------------
  |  Branch (131:13): [True: 289, False: 0]
  ------------------
  132|    289|        {
  133|    289|            OGRFieldDefn oAttrField(osTag.c_str(), OFTString);
  134|    289|            poFeatureDefn->AddFieldDefn(&oAttrField);
  135|    289|        }
  136|    289|    }
  137|       |
  138|       |    // Applying spatial ref info
  139|  1.02k|    if (poFeatureDefn->GetGeomFieldCount() != 0)
  ------------------
  |  Branch (139:9): [True: 1.02k, False: 0]
  ------------------
  140|  1.02k|        poFeatureDefn->GetGeomFieldDefn(0)->SetSpatialRef(poSpatialRef);
  141|       |
  142|  1.02k|    SetDescription(poFeatureDefn->GetName());
  143|  1.02k|    poFeatureDefn->Reference();
  144|  1.02k|}
_ZN11OGRCADLayerD2Ev:
  167|  1.02k|{
  168|  1.02k|    if (poSpatialRef)
  ------------------
  |  Branch (168:9): [True: 1.02k, False: 0]
  ------------------
  169|  1.02k|        poSpatialRef->Release();
  170|  1.02k|    poFeatureDefn->Release();
  171|  1.02k|}
_ZN11OGRCADLayer14GetNextFeatureEv:
  179|  2.51k|{
  180|  2.51k|    OGRFeature *poFeature = GetFeature(nNextFID);
  181|  2.51k|    ++nNextFID;
  182|       |
  183|  2.51k|    if (poFeature == nullptr)
  ------------------
  |  Branch (183:9): [True: 1.02k, False: 1.49k]
  ------------------
  184|  1.02k|        return nullptr;
  185|       |
  186|  1.49k|    if ((m_poFilterGeom == nullptr ||
  ------------------
  |  Branch (186:10): [True: 1.49k, False: 0]
  ------------------
  187|  1.49k|         FilterGeometry(poFeature->GetGeometryRef())) &&
  ------------------
  |  Branch (187:10): [True: 0, False: 0]
  ------------------
  188|  1.49k|        (m_poAttrQuery == nullptr || m_poAttrQuery->Evaluate(poFeature)))
  ------------------
  |  Branch (188:10): [True: 1.49k, False: 0]
  |  Branch (188:38): [True: 0, False: 0]
  ------------------
  189|  1.49k|    {
  190|  1.49k|        return poFeature;
  191|  1.49k|    }
  192|       |
  193|      0|    return nullptr;
  194|  1.49k|}
_ZN11OGRCADLayer10GetFeatureEx:
  197|  2.51k|{
  198|  2.51k|    if (poCADLayer.getGeometryCount() <= static_cast<size_t>(nFID) || nFID < 0)
  ------------------
  |  Branch (198:9): [True: 865, False: 1.64k]
  |  Branch (198:71): [True: 0, False: 1.64k]
  ------------------
  199|    865|    {
  200|    865|        return nullptr;
  201|    865|    }
  202|       |
  203|  1.64k|    OGRFeature *poFeature = nullptr;
  204|  1.64k|    CADGeometry *poCADGeometry =
  205|  1.64k|        poCADLayer.getGeometry(static_cast<size_t>(nFID));
  206|       |
  207|  1.64k|    if (nullptr == poCADGeometry ||
  ------------------
  |  Branch (207:9): [True: 155, False: 1.49k]
  ------------------
  208|  1.64k|        GetLastErrorCode() != CADErrorCodes::SUCCESS)
  ------------------
  |  Branch (208:9): [True: 0, False: 1.49k]
  ------------------
  209|    155|    {
  210|    155|        CPLError(CE_Failure, CPLE_NotSupported,
  ------------------
  |  |   95|    155|#define CPLE_NotSupported 6
  ------------------
  211|    155|                 "Failed to get geometry with ID = " CPL_FRMT_GIB
  212|    155|                 " from layer \"%s\". Libopencad errorcode: %d",
  213|    155|                 nFID, poCADLayer.getName().c_str(), GetLastErrorCode());
  214|    155|        return nullptr;
  215|    155|    }
  216|       |
  217|  1.49k|    poFeature = new OGRFeature(poFeatureDefn);
  218|  1.49k|    poFeature->SetFID(nFID);
  219|  1.49k|    poFeature->SetField(FIELD_NAME_THICKNESS, poCADGeometry->getThickness());
  ------------------
  |  |   23|  1.49k|#define FIELD_NAME_THICKNESS "thickness"
  ------------------
  220|       |
  221|  1.49k|    if (!poCADGeometry->getEED().empty())
  ------------------
  |  Branch (221:9): [True: 1.19k, False: 295]
  ------------------
  222|  1.19k|    {
  223|  1.19k|        std::vector<std::string> asGeometryEED = poCADGeometry->getEED();
  224|  1.19k|        std::string sEEDAsOneString = "";
  225|  1.19k|        for (std::vector<std::string>::const_iterator iter =
  226|  1.19k|                 asGeometryEED.cbegin();
  227|  6.85k|             iter != asGeometryEED.cend(); ++iter)
  ------------------
  |  Branch (227:14): [True: 5.65k, False: 1.19k]
  ------------------
  228|  5.65k|        {
  229|  5.65k|            sEEDAsOneString += *iter;
  230|  5.65k|            sEEDAsOneString += ' ';
  231|  5.65k|        }
  232|       |
  233|  1.19k|        poFeature->SetField(FIELD_NAME_EXT_DATA, sEEDAsOneString.c_str());
  ------------------
  |  |   25|  1.19k|#define FIELD_NAME_EXT_DATA "extentity_data"
  ------------------
  234|  1.19k|    }
  235|       |
  236|  1.49k|    RGBColor stRGB = poCADGeometry->getColor();
  237|  1.49k|    CPLString sHexColor;
  238|  1.49k|    sHexColor.Printf("#%02X%02X%02X%02X", stRGB.R, stRGB.G, stRGB.B, 255);
  239|  1.49k|    poFeature->SetField(FIELD_NAME_COLOR, sHexColor);
  ------------------
  |  |   24|  1.49k|#define FIELD_NAME_COLOR "color"
  ------------------
  240|       |
  241|  1.49k|    CPLString sStyle;
  242|  1.49k|    sStyle.Printf("PEN(c:%s,w:5px)", sHexColor.c_str());
  243|  1.49k|    poFeature->SetStyleString(sStyle);
  244|       |
  245|  1.49k|    std::vector<CADAttrib> oBlockAttrs = poCADGeometry->getBlockAttributes();
  246|  1.49k|    for (const CADAttrib &oAttrib : oBlockAttrs)
  ------------------
  |  Branch (246:35): [True: 0, False: 1.49k]
  ------------------
  247|      0|    {
  248|      0|        CPLString osTag = oAttrib.getTag();
  249|      0|        auto featureAttrIt = asFeaturesAttributes.find(osTag);
  250|      0|        if (featureAttrIt != asFeaturesAttributes.end())
  ------------------
  |  Branch (250:13): [True: 0, False: 0]
  ------------------
  251|      0|        {
  252|      0|            poFeature->SetField(*featureAttrIt, oAttrib.getTextValue().c_str());
  253|      0|        }
  254|      0|    }
  255|       |
  256|  1.49k|    switch (poCADGeometry->getType())
  257|  1.49k|    {
  258|     32|        case CADGeometry::POINT:
  ------------------
  |  Branch (258:9): [True: 32, False: 1.46k]
  ------------------
  259|     32|        {
  260|     32|            CADPoint3D *const poCADPoint =
  261|     32|                cpl::down_cast<CADPoint3D *>(poCADGeometry);
  262|     32|            CADVector stPositionVector = poCADPoint->getPosition();
  263|       |
  264|     32|            poFeature->SetGeometryDirectly(
  265|     32|                new OGRPoint(stPositionVector.getX(), stPositionVector.getY(),
  266|     32|                             stPositionVector.getZ()));
  267|     32|            poFeature->SetField(FIELD_NAME_GEOMTYPE, "CADPoint");
  ------------------
  |  |   22|     32|#define FIELD_NAME_GEOMTYPE "cadgeom_type"
  ------------------
  268|     32|            break;
  269|      0|        }
  270|       |
  271|     31|        case CADGeometry::LINE:
  ------------------
  |  Branch (271:9): [True: 31, False: 1.46k]
  ------------------
  272|     31|        {
  273|     31|            CADLine *const poCADLine = cpl::down_cast<CADLine *>(poCADGeometry);
  274|     31|            OGRLineString *poLS = new OGRLineString();
  275|     31|            poLS->addPoint(poCADLine->getStart().getPosition().getX(),
  276|     31|                           poCADLine->getStart().getPosition().getY(),
  277|     31|                           poCADLine->getStart().getPosition().getZ());
  278|     31|            poLS->addPoint(poCADLine->getEnd().getPosition().getX(),
  279|     31|                           poCADLine->getEnd().getPosition().getY(),
  280|     31|                           poCADLine->getEnd().getPosition().getZ());
  281|       |
  282|     31|            poFeature->SetGeometryDirectly(poLS);
  283|     31|            poFeature->SetField(FIELD_NAME_GEOMTYPE, "CADLine");
  ------------------
  |  |   22|     31|#define FIELD_NAME_GEOMTYPE "cadgeom_type"
  ------------------
  284|     31|            break;
  285|      0|        }
  286|       |
  287|     29|        case CADGeometry::SOLID:
  ------------------
  |  Branch (287:9): [True: 29, False: 1.46k]
  ------------------
  288|     29|        {
  289|     29|            CADSolid *const poCADSolid =
  290|     29|                cpl::down_cast<CADSolid *>(poCADGeometry);
  291|     29|            OGRPolygon *poPoly = new OGRPolygon();
  292|     29|            OGRLinearRing *poLR = new OGRLinearRing();
  293|       |
  294|     29|            std::vector<CADVector> astSolidCorners = poCADSolid->getCorners();
  295|    145|            for (size_t i = 0; i < astSolidCorners.size(); ++i)
  ------------------
  |  Branch (295:32): [True: 116, False: 29]
  ------------------
  296|    116|            {
  297|    116|                poLR->addPoint(astSolidCorners[i].getX(),
  298|    116|                               astSolidCorners[i].getY(),
  299|    116|                               astSolidCorners[i].getZ());
  300|    116|            }
  301|     29|            poPoly->addRingDirectly(poLR);
  302|     29|            poPoly->closeRings();
  303|     29|            poFeature->SetGeometryDirectly(poPoly);
  304|       |
  305|     29|            poFeature->SetField(FIELD_NAME_GEOMTYPE, "CADSolid");
  ------------------
  |  |   22|     29|#define FIELD_NAME_GEOMTYPE "cadgeom_type"
  ------------------
  306|     29|            break;
  307|      0|        }
  308|       |
  309|     64|        case CADGeometry::CIRCLE:
  ------------------
  |  Branch (309:9): [True: 64, False: 1.42k]
  ------------------
  310|     64|        {
  311|     64|            CADCircle *poCADCircle = cpl::down_cast<CADCircle *>(poCADGeometry);
  312|     64|            OGRCircularString *poCircle = new OGRCircularString();
  313|       |
  314|     64|            CADVector stCircleCenter = poCADCircle->getPosition();
  315|     64|            OGRPoint oCirclePoint1;
  316|     64|            oCirclePoint1.setX(stCircleCenter.getX() -
  317|     64|                               poCADCircle->getRadius());
  318|     64|            oCirclePoint1.setY(stCircleCenter.getY());
  319|     64|            oCirclePoint1.setZ(stCircleCenter.getZ());
  320|     64|            poCircle->addPoint(&oCirclePoint1);
  321|       |
  322|     64|            OGRPoint oCirclePoint2;
  323|     64|            oCirclePoint2.setX(stCircleCenter.getX());
  324|     64|            oCirclePoint2.setY(stCircleCenter.getY() +
  325|     64|                               poCADCircle->getRadius());
  326|     64|            oCirclePoint2.setZ(stCircleCenter.getZ());
  327|     64|            poCircle->addPoint(&oCirclePoint2);
  328|       |
  329|     64|            OGRPoint oCirclePoint3;
  330|     64|            oCirclePoint3.setX(stCircleCenter.getX() +
  331|     64|                               poCADCircle->getRadius());
  332|     64|            oCirclePoint3.setY(stCircleCenter.getY());
  333|     64|            oCirclePoint3.setZ(stCircleCenter.getZ());
  334|     64|            poCircle->addPoint(&oCirclePoint3);
  335|       |
  336|     64|            OGRPoint oCirclePoint4;
  337|     64|            oCirclePoint4.setX(stCircleCenter.getX());
  338|     64|            oCirclePoint4.setY(stCircleCenter.getY() -
  339|     64|                               poCADCircle->getRadius());
  340|     64|            oCirclePoint4.setZ(stCircleCenter.getZ());
  341|     64|            poCircle->addPoint(&oCirclePoint4);
  342|       |
  343|       |            // Close the circle
  344|     64|            poCircle->addPoint(&oCirclePoint1);
  345|       |
  346|       |            /*NOTE: The alternative way:
  347|       |                    OGRGeometry *poCircle =
  348|       |               OGRGeometryFactory::approximateArcAngles(
  349|       |                    poCADCircle->getPosition().getX(),
  350|       |                    poCADCircle->getPosition().getY(),
  351|       |                    poCADCircle->getPosition().getZ(),
  352|       |                    poCADCircle->getRadius(), poCADCircle->getRadius(), 0.0,
  353|       |                    0.0, 360.0,
  354|       |                    0.0 );
  355|       |            */
  356|     64|            poFeature->SetGeometryDirectly(poCircle);
  357|       |
  358|     64|            poFeature->SetField(FIELD_NAME_GEOMTYPE, "CADCircle");
  ------------------
  |  |   22|     64|#define FIELD_NAME_GEOMTYPE "cadgeom_type"
  ------------------
  359|     64|            break;
  360|      0|        }
  361|       |
  362|     83|        case CADGeometry::ARC:
  ------------------
  |  Branch (362:9): [True: 83, False: 1.41k]
  ------------------
  363|     83|        {
  364|     83|            CADArc *poCADArc = cpl::down_cast<CADArc *>(poCADGeometry);
  365|     83|            OGRCircularString *poCircle = new OGRCircularString();
  366|       |
  367|       |            // Need at least 3 points in arc
  368|     83|            double dfStartAngle = poCADArc->getStartingAngle() * RAD2DEG;
  369|     83|            double dfEndAngle = poCADArc->getEndingAngle() * RAD2DEG;
  370|     83|            double dfMidAngle = (dfEndAngle + dfStartAngle) / 2;
  371|     83|            CADVector stCircleCenter = poCADArc->getPosition();
  372|       |
  373|     83|            OGRPoint oCirclePoint;
  374|     83|            oCirclePoint.setX(stCircleCenter.getX() +
  375|     83|                              poCADArc->getRadius() * cos(dfStartAngle));
  376|     83|            oCirclePoint.setY(stCircleCenter.getY() +
  377|     83|                              poCADArc->getRadius() * sin(dfStartAngle));
  378|     83|            oCirclePoint.setZ(stCircleCenter.getZ());
  379|     83|            poCircle->addPoint(&oCirclePoint);
  380|       |
  381|     83|            oCirclePoint.setX(stCircleCenter.getX() +
  382|     83|                              poCADArc->getRadius() * cos(dfMidAngle));
  383|     83|            oCirclePoint.setY(stCircleCenter.getY() +
  384|     83|                              poCADArc->getRadius() * sin(dfMidAngle));
  385|     83|            oCirclePoint.setZ(stCircleCenter.getZ());
  386|     83|            poCircle->addPoint(&oCirclePoint);
  387|       |
  388|     83|            oCirclePoint.setX(stCircleCenter.getX() +
  389|     83|                              poCADArc->getRadius() * cos(dfEndAngle));
  390|     83|            oCirclePoint.setY(stCircleCenter.getY() +
  391|     83|                              poCADArc->getRadius() * sin(dfEndAngle));
  392|     83|            oCirclePoint.setZ(stCircleCenter.getZ());
  393|     83|            poCircle->addPoint(&oCirclePoint);
  394|       |
  395|       |            /*NOTE: alternative way:
  396|       |                OGRGeometry * poArc = OGRGeometryFactory::approximateArcAngles(
  397|       |                poCADArc->getPosition().getX(),
  398|       |                poCADArc->getPosition().getY(),
  399|       |                poCADArc->getPosition().getZ(),
  400|       |                poCADArc->getRadius(), poCADArc->getRadius(), 0.0,
  401|       |                dfStartAngle,
  402|       |                dfStartAngle > dfEndAngle ?
  403|       |                    ( dfEndAngle + 360.0f ) :
  404|       |                    dfEndAngle,
  405|       |                0.0 );
  406|       |            */
  407|       |
  408|     83|            poFeature->SetGeometryDirectly(poCircle);
  409|     83|            poFeature->SetField(FIELD_NAME_GEOMTYPE, "CADArc");
  ------------------
  |  |   22|     83|#define FIELD_NAME_GEOMTYPE "cadgeom_type"
  ------------------
  410|       |
  411|     83|            break;
  412|      0|        }
  413|       |
  414|     51|        case CADGeometry::FACE3D:
  ------------------
  |  Branch (414:9): [True: 51, False: 1.44k]
  ------------------
  415|     51|        {
  416|     51|            CADFace3D *const poCADFace =
  417|     51|                cpl::down_cast<CADFace3D *>(poCADGeometry);
  418|     51|            OGRPolygon *poPoly = new OGRPolygon();
  419|     51|            OGRLinearRing *poLR = new OGRLinearRing();
  420|       |
  421|    204|            for (size_t i = 0; i < 3; ++i)
  ------------------
  |  Branch (421:32): [True: 153, False: 51]
  ------------------
  422|    153|            {
  423|    153|                poLR->addPoint(poCADFace->getCorner(i).getX(),
  424|    153|                               poCADFace->getCorner(i).getY(),
  425|    153|                               poCADFace->getCorner(i).getZ());
  426|    153|            }
  427|     51|            if (!(poCADFace->getCorner(2) == poCADFace->getCorner(3)))
  ------------------
  |  Branch (427:17): [True: 24, False: 27]
  ------------------
  428|     24|            {
  429|     24|                poLR->addPoint(poCADFace->getCorner(3).getX(),
  430|     24|                               poCADFace->getCorner(3).getY(),
  431|     24|                               poCADFace->getCorner(3).getZ());
  432|     24|            }
  433|     51|            poPoly->addRingDirectly(poLR);
  434|     51|            poPoly->closeRings();
  435|     51|            poFeature->SetGeometryDirectly(poPoly);
  436|       |
  437|     51|            poFeature->SetField(FIELD_NAME_GEOMTYPE, "CADFace3D");
  ------------------
  |  |   22|     51|#define FIELD_NAME_GEOMTYPE "cadgeom_type"
  ------------------
  438|     51|            break;
  439|      0|        }
  440|       |
  441|    138|        case CADGeometry::LWPOLYLINE:
  ------------------
  |  Branch (441:9): [True: 138, False: 1.35k]
  ------------------
  442|    138|        {
  443|    138|            CADLWPolyline *const poCADLWPolyline =
  444|    138|                cpl::down_cast<CADLWPolyline *>(poCADGeometry);
  445|       |
  446|    138|            poFeature->SetField(FIELD_NAME_GEOMTYPE, "CADLWPolyline");
  ------------------
  |  |   22|    138|#define FIELD_NAME_GEOMTYPE "cadgeom_type"
  ------------------
  447|       |
  448|       |            /*
  449|       |             * Excessive check, like in DXF driver.
  450|       |             * I tried to make a single-point polyline, but couldn't make it.
  451|       |             * Probably this check should be removed.
  452|       |             */
  453|    138|            if (poCADLWPolyline->getVertexCount() == 1)
  ------------------
  |  Branch (453:17): [True: 12, False: 126]
  ------------------
  454|     12|            {
  455|     12|                poFeature->SetGeometryDirectly(
  456|     12|                    new OGRPoint(poCADLWPolyline->getVertex(0).getX(),
  457|     12|                                 poCADLWPolyline->getVertex(0).getY(),
  458|     12|                                 poCADLWPolyline->getVertex(0).getZ()));
  459|       |
  460|     12|                break;
  461|     12|            }
  462|       |
  463|       |            /*
  464|       |             * If polyline has no arcs, handle it in easy way.
  465|       |             */
  466|    126|            OGRLineString *poLS = new OGRLineString();
  467|       |
  468|    126|            if (poCADLWPolyline->getBulges().empty())
  ------------------
  |  Branch (468:17): [True: 39, False: 87]
  ------------------
  469|     39|            {
  470|  2.22k|                for (size_t i = 0; i < poCADLWPolyline->getVertexCount(); ++i)
  ------------------
  |  Branch (470:36): [True: 2.18k, False: 39]
  ------------------
  471|  2.18k|                {
  472|  2.18k|                    CADVector stVertex = poCADLWPolyline->getVertex(i);
  473|  2.18k|                    poLS->addPoint(stVertex.getX(), stVertex.getY(),
  474|  2.18k|                                   stVertex.getZ());
  475|  2.18k|                }
  476|       |
  477|     39|                poFeature->SetGeometryDirectly(poLS);
  478|     39|                break;
  479|     39|            }
  480|       |
  481|       |            /*
  482|       |             * Last case - if polyline has mixed arcs and lines.
  483|       |             */
  484|     87|            bool bLineStringStarted = false;
  485|     87|            std::vector<double> adfBulges = poCADLWPolyline->getBulges();
  486|     87|            const size_t nCount =
  487|     87|                std::min(adfBulges.size(), poCADLWPolyline->getVertexCount());
  488|       |
  489|  7.28k|            for (size_t iCurrentVertex = 0; iCurrentVertex + 1 < nCount;
  ------------------
  |  Branch (489:45): [True: 7.19k, False: 87]
  ------------------
  490|  7.19k|                 iCurrentVertex++)
  491|  7.19k|            {
  492|  7.19k|                CADVector stCurrentVertex =
  493|  7.19k|                    poCADLWPolyline->getVertex(iCurrentVertex);
  494|  7.19k|                CADVector stNextVertex =
  495|  7.19k|                    poCADLWPolyline->getVertex(iCurrentVertex + 1);
  496|       |
  497|  7.19k|                double dfLength =
  498|  7.19k|                    sqrt(pow(stNextVertex.getX() - stCurrentVertex.getX(), 2) +
  499|  7.19k|                         pow(stNextVertex.getY() - stCurrentVertex.getY(), 2));
  500|       |
  501|       |                /*
  502|       |                 * Handling straight polyline segment.
  503|       |                 */
  504|  7.19k|                if ((dfLength == 0) || (adfBulges[iCurrentVertex] == 0))
  ------------------
  |  Branch (504:21): [True: 1.42k, False: 5.76k]
  |  Branch (504:40): [True: 1.55k, False: 4.21k]
  ------------------
  505|  2.98k|                {
  506|  2.98k|                    if (!bLineStringStarted)
  ------------------
  |  Branch (506:25): [True: 82, False: 2.89k]
  ------------------
  507|     82|                    {
  508|     82|                        poLS->addPoint(stCurrentVertex.getX(),
  509|     82|                                       stCurrentVertex.getY(),
  510|     82|                                       stCurrentVertex.getZ());
  511|     82|                        bLineStringStarted = true;
  512|     82|                    }
  513|       |
  514|  2.98k|                    poLS->addPoint(stNextVertex.getX(), stNextVertex.getY(),
  515|  2.98k|                                   stNextVertex.getZ());
  516|  2.98k|                }
  517|  4.21k|                else
  518|  4.21k|                {
  519|  4.21k|                    double dfSegmentBulge = adfBulges[iCurrentVertex];
  520|  4.21k|                    double dfH = (dfSegmentBulge * dfLength) / 2;
  521|  4.21k|                    if (dfH == 0.0)
  ------------------
  |  Branch (521:25): [True: 51, False: 4.16k]
  ------------------
  522|     51|                        dfH = 1.0;  // just to avoid a division by zero
  523|  4.21k|                    double dfRadius =
  524|  4.21k|                        (dfH / 2) + (dfLength * dfLength / (8 * dfH));
  525|  4.21k|                    double dfOgrArcRotation = 0,
  526|  4.21k|                           dfOgrArcRadius = fabs(dfRadius);
  527|       |
  528|       |                    /*
  529|       |                     * Set arc's direction and keep bulge positive.
  530|       |                     */
  531|  4.21k|                    bool bClockwise = (dfSegmentBulge < 0);
  532|  4.21k|                    if (bClockwise)
  ------------------
  |  Branch (532:25): [True: 488, False: 3.72k]
  ------------------
  533|    488|                        dfSegmentBulge *= -1;
  534|       |
  535|       |                    /*
  536|       |                     * Get arc's center point.
  537|       |                     */
  538|  4.21k|                    double dfSaggita = fabs(dfSegmentBulge * (dfLength / 2.0));
  539|  4.21k|                    double dfApo = bClockwise ? -(dfOgrArcRadius - dfSaggita)
  ------------------
  |  Branch (539:36): [True: 488, False: 3.72k]
  ------------------
  540|  4.21k|                                              : -(dfSaggita - dfOgrArcRadius);
  541|       |
  542|  4.21k|                    CADVector stVertex;
  543|  4.21k|                    stVertex.setX(stCurrentVertex.getX() - stNextVertex.getX());
  544|  4.21k|                    stVertex.setY(stCurrentVertex.getY() - stNextVertex.getY());
  545|  4.21k|                    stVertex.setZ(stCurrentVertex.getZ());
  546|       |
  547|  4.21k|                    CADVector stMidPoint;
  548|  4.21k|                    stMidPoint.setX(stNextVertex.getX() +
  549|  4.21k|                                    0.5 * stVertex.getX());
  550|  4.21k|                    stMidPoint.setY(stNextVertex.getY() +
  551|  4.21k|                                    0.5 * stVertex.getY());
  552|  4.21k|                    stMidPoint.setZ(stVertex.getZ());
  553|       |
  554|  4.21k|                    CADVector stPperp;
  555|  4.21k|                    stPperp.setX(stVertex.getY());
  556|  4.21k|                    stPperp.setY(-stVertex.getX());
  557|  4.21k|                    double dfStPperpLength =
  558|  4.21k|                        sqrt(stPperp.getX() * stPperp.getX() +
  559|  4.21k|                             stPperp.getY() * stPperp.getY());
  560|       |                    // TODO: Check that length isnot 0
  561|  4.21k|                    stPperp.setX(stPperp.getX() / dfStPperpLength);
  562|  4.21k|                    stPperp.setY(stPperp.getY() / dfStPperpLength);
  563|       |
  564|  4.21k|                    CADVector stOgrArcCenter;
  565|  4.21k|                    stOgrArcCenter.setX(stMidPoint.getX() +
  566|  4.21k|                                        (stPperp.getX() * dfApo));
  567|  4.21k|                    stOgrArcCenter.setY(stMidPoint.getY() +
  568|  4.21k|                                        (stPperp.getY() * dfApo));
  569|       |
  570|       |                    /*
  571|       |                     * Get the line's general vertical direction ( -1 = down, +1
  572|       |                     * = up ).
  573|       |                     */
  574|  4.21k|                    double dfLineDir =
  575|  4.21k|                        stNextVertex.getY() > stCurrentVertex.getY() ? 1.0f
  ------------------
  |  Branch (575:25): [True: 588, False: 3.62k]
  ------------------
  576|  4.21k|                                                                     : -1.0f;
  577|       |
  578|       |                    /*
  579|       |                     * Get arc's starting angle.
  580|       |                     */
  581|  4.21k|                    double dfA =
  582|  4.21k|                        atan2(
  583|  4.21k|                            (stOgrArcCenter.getY() - stCurrentVertex.getY()),
  584|  4.21k|                            (stOgrArcCenter.getX() - stCurrentVertex.getX())) *
  585|  4.21k|                        RAD2DEG;
  586|  4.21k|                    if (bClockwise && (dfLineDir == 1.0))
  ------------------
  |  Branch (586:25): [True: 488, False: 3.72k]
  |  Branch (586:39): [True: 96, False: 392]
  ------------------
  587|     96|                        dfA += (dfLineDir * 180.0);
  588|       |
  589|  4.21k|                    double dfOgrArcStartAngle =
  590|  4.21k|                        dfA > 0.0 ? -(dfA - 180.0) : -(dfA + 180.0);
  ------------------
  |  Branch (590:25): [True: 348, False: 3.86k]
  ------------------
  591|       |
  592|       |                    /*
  593|       |                     * Get arc's ending angle.
  594|       |                     */
  595|  4.21k|                    dfA = atan2((stOgrArcCenter.getY() - stNextVertex.getY()),
  596|  4.21k|                                (stOgrArcCenter.getX() - stNextVertex.getX())) *
  597|  4.21k|                          RAD2DEG;
  598|  4.21k|                    if (bClockwise && (dfLineDir == 1.0))
  ------------------
  |  Branch (598:25): [True: 488, False: 3.72k]
  |  Branch (598:39): [True: 96, False: 392]
  ------------------
  599|     96|                        dfA += (dfLineDir * 180.0);
  600|       |
  601|  4.21k|                    double dfOgrArcEndAngle =
  602|  4.21k|                        dfA > 0.0 ? -(dfA - 180.0) : -(dfA + 180.0);
  ------------------
  |  Branch (602:25): [True: 347, False: 3.86k]
  ------------------
  603|       |
  604|  4.21k|                    if (!bClockwise && (dfOgrArcStartAngle < dfOgrArcEndAngle))
  ------------------
  |  Branch (604:25): [True: 3.72k, False: 488]
  |  Branch (604:40): [True: 192, False: 3.53k]
  ------------------
  605|    192|                        dfOgrArcEndAngle = -180.0 + (dfLineDir * dfA);
  606|       |
  607|  4.21k|                    if (bClockwise && (dfOgrArcStartAngle > dfOgrArcEndAngle))
  ------------------
  |  Branch (607:25): [True: 488, False: 3.72k]
  |  Branch (607:39): [True: 25, False: 463]
  ------------------
  608|     25|                        dfOgrArcEndAngle += 360.0;
  609|       |
  610|       |                    /*
  611|       |                     * Flip arc's rotation if necessary.
  612|       |                     */
  613|  4.21k|                    if (bClockwise && (dfLineDir == 1.0))
  ------------------
  |  Branch (613:25): [True: 488, False: 3.72k]
  |  Branch (613:39): [True: 96, False: 392]
  ------------------
  614|     96|                        dfOgrArcRotation = dfLineDir * 180.0;
  615|       |
  616|       |                    /*
  617|       |                     * Tessellate the arc segment and append to the linestring.
  618|       |                     */
  619|  4.21k|                    OGRLineString *poArcpoLS =
  620|  4.21k|                        OGRGeometryFactory::approximateArcAngles(
  621|  4.21k|                            stOgrArcCenter.getX(), stOgrArcCenter.getY(),
  622|  4.21k|                            stOgrArcCenter.getZ(), dfOgrArcRadius,
  623|  4.21k|                            dfOgrArcRadius, dfOgrArcRotation,
  624|  4.21k|                            dfOgrArcStartAngle, dfOgrArcEndAngle, 0.0)
  625|  4.21k|                            ->toLineString();
  626|       |
  627|  4.21k|                    poLS->addSubLineString(poArcpoLS);
  628|       |
  629|  4.21k|                    delete (poArcpoLS);
  630|  4.21k|                }
  631|  7.19k|            }
  632|       |
  633|     87|            if (poCADLWPolyline->isClosed())
  ------------------
  |  Branch (633:17): [True: 2, False: 85]
  ------------------
  634|      2|            {
  635|      2|                poLS->addPoint(poCADLWPolyline->getVertex(0).getX(),
  636|      2|                               poCADLWPolyline->getVertex(0).getY(),
  637|      2|                               poCADLWPolyline->getVertex(0).getZ());
  638|      2|            }
  639|       |
  640|     87|            poFeature->SetGeometryDirectly(poLS);
  641|     87|            poFeature->SetField(FIELD_NAME_GEOMTYPE, "CADLWPolyline");
  ------------------
  |  |   22|     87|#define FIELD_NAME_GEOMTYPE "cadgeom_type"
  ------------------
  642|     87|            break;
  643|    126|        }
  644|       |
  645|       |        // TODO: Unsupported smooth lines
  646|    119|        case CADGeometry::POLYLINE3D:
  ------------------
  |  Branch (646:9): [True: 119, False: 1.37k]
  ------------------
  647|    119|        {
  648|    119|            CADPolyline3D *const poCADPolyline3D =
  649|    119|                cpl::down_cast<CADPolyline3D *>(poCADGeometry);
  650|    119|            OGRLineString *poLS = new OGRLineString();
  651|       |
  652|    119|            for (size_t i = 0; i < poCADPolyline3D->getVertexCount(); ++i)
  ------------------
  |  Branch (652:32): [True: 0, False: 119]
  ------------------
  653|      0|            {
  654|      0|                CADVector stVertex = poCADPolyline3D->getVertex(i);
  655|       |
  656|      0|                poLS->addPoint(stVertex.getX(), stVertex.getY(),
  657|      0|                               stVertex.getZ());
  658|      0|            }
  659|       |
  660|    119|            poFeature->SetGeometryDirectly(poLS);
  661|    119|            poFeature->SetField(FIELD_NAME_GEOMTYPE, "CADPolyline3D");
  ------------------
  |  |   22|    119|#define FIELD_NAME_GEOMTYPE "cadgeom_type"
  ------------------
  662|    119|            break;
  663|    126|        }
  664|       |
  665|    191|        case CADGeometry::TEXT:
  ------------------
  |  Branch (665:9): [True: 191, False: 1.30k]
  ------------------
  666|    191|        {
  667|    191|            CADText *const poCADText = cpl::down_cast<CADText *>(poCADGeometry);
  668|    191|            OGRPoint *poPoint = new OGRPoint(poCADText->getPosition().getX(),
  669|    191|                                             poCADText->getPosition().getY(),
  670|    191|                                             poCADText->getPosition().getZ());
  671|    191|            CPLString sTextValue =
  672|    191|                CADRecode(poCADText->getTextValue(), nDWGEncoding);
  673|       |
  674|    191|            poFeature->SetField(FIELD_NAME_TEXT, sTextValue);
  ------------------
  |  |   26|    191|#define FIELD_NAME_TEXT "text"
  ------------------
  675|    191|            poFeature->SetGeometryDirectly(poPoint);
  676|    191|            poFeature->SetField(FIELD_NAME_GEOMTYPE, "CADText");
  ------------------
  |  |   22|    191|#define FIELD_NAME_GEOMTYPE "cadgeom_type"
  ------------------
  677|       |
  678|    191|            sStyle.Printf("LABEL(f:\"Arial\",t:\"%s\",c:%s)",
  679|    191|                          sTextValue.c_str(), sHexColor.c_str());
  680|    191|            poFeature->SetStyleString(sStyle);
  681|    191|            break;
  682|    126|        }
  683|       |
  684|     59|        case CADGeometry::MTEXT:
  ------------------
  |  Branch (684:9): [True: 59, False: 1.43k]
  ------------------
  685|     59|        {
  686|     59|            CADMText *const poCADMText =
  687|     59|                cpl::down_cast<CADMText *>(poCADGeometry);
  688|     59|            OGRPoint *poPoint = new OGRPoint(poCADMText->getPosition().getX(),
  689|     59|                                             poCADMText->getPosition().getY(),
  690|     59|                                             poCADMText->getPosition().getZ());
  691|     59|            CPLString sTextValue =
  692|     59|                CADRecode(poCADMText->getTextValue(), nDWGEncoding);
  693|       |
  694|     59|            poFeature->SetField(FIELD_NAME_TEXT, sTextValue);
  ------------------
  |  |   26|     59|#define FIELD_NAME_TEXT "text"
  ------------------
  695|     59|            poFeature->SetGeometryDirectly(poPoint);
  696|     59|            poFeature->SetField(FIELD_NAME_GEOMTYPE, "CADMText");
  ------------------
  |  |   22|     59|#define FIELD_NAME_GEOMTYPE "cadgeom_type"
  ------------------
  697|       |
  698|     59|            sStyle.Printf("LABEL(f:\"Arial\",t:\"%s\",c:%s)",
  699|     59|                          sTextValue.c_str(), sHexColor.c_str());
  700|     59|            poFeature->SetStyleString(sStyle);
  701|     59|            break;
  702|    126|        }
  703|       |
  704|    122|        case CADGeometry::SPLINE:
  ------------------
  |  Branch (704:9): [True: 122, False: 1.37k]
  ------------------
  705|    122|        {
  706|    122|            CADSpline *const poCADSpline =
  707|    122|                cpl::down_cast<CADSpline *>(poCADGeometry);
  708|    122|            OGRLineString *poLS = new OGRLineString();
  709|       |
  710|       |            // TODO: Interpolate spline as points or curves
  711|    657|            for (size_t i = 0; i < poCADSpline->getControlPoints().size(); ++i)
  ------------------
  |  Branch (711:32): [True: 535, False: 122]
  ------------------
  712|    535|            {
  713|    535|                poLS->addPoint(poCADSpline->getControlPoints()[i].getX(),
  714|    535|                               poCADSpline->getControlPoints()[i].getY(),
  715|    535|                               poCADSpline->getControlPoints()[i].getZ());
  716|    535|            }
  717|       |
  718|    122|            poFeature->SetGeometryDirectly(poLS);
  719|    122|            poFeature->SetField(FIELD_NAME_GEOMTYPE, "CADSpline");
  ------------------
  |  |   22|    122|#define FIELD_NAME_GEOMTYPE "cadgeom_type"
  ------------------
  720|    122|            break;
  721|    126|        }
  722|       |
  723|     80|        case CADGeometry::ELLIPSE:
  ------------------
  |  Branch (723:9): [True: 80, False: 1.41k]
  ------------------
  724|     80|        {
  725|     80|            CADEllipse *poCADEllipse =
  726|     80|                cpl::down_cast<CADEllipse *>(poCADGeometry);
  727|       |
  728|       |            // FIXME: Start/end angles should be swapped to work exactly as DXF
  729|       |            // driver. is it correct?
  730|     80|            double dfStartAngle = poCADEllipse->getStartingAngle() * RAD2DEG;
  731|     80|            double dfEndAngle = poCADEllipse->getEndingAngle() * RAD2DEG;
  732|     80|            if (dfStartAngle > dfEndAngle)
  ------------------
  |  Branch (732:17): [True: 22, False: 58]
  ------------------
  733|     22|            {
  734|     22|                dfEndAngle += 360.0;
  735|     22|            }
  736|     80|            double dfAxisRatio = poCADEllipse->getAxisRatio();
  737|       |
  738|     80|            CADVector stEllipseCenter = poCADEllipse->getPosition();
  739|     80|            CADVector vectSMAxis = poCADEllipse->getSMAxis();
  740|     80|            double dfPrimaryRadius, dfSecondaryRadius;
  741|     80|            double dfRotation;
  742|     80|            dfPrimaryRadius = sqrt(vectSMAxis.getX() * vectSMAxis.getX() +
  743|     80|                                   vectSMAxis.getY() * vectSMAxis.getY() +
  744|     80|                                   vectSMAxis.getZ() * vectSMAxis.getZ());
  745|       |
  746|     80|            dfSecondaryRadius = dfAxisRatio * dfPrimaryRadius;
  747|       |
  748|     80|            dfRotation =
  749|     80|                -1 * atan2(vectSMAxis.getY(), vectSMAxis.getX()) * RAD2DEG;
  750|       |            /* NOTE: alternative way:
  751|       |            OGRCircularString * poEllipse = new OGRCircularString();
  752|       |            OGRPoint  oEllipsePoint1;
  753|       |            oEllipsePoint1.setX( stEllipseCenter.getX() - dfPrimaryRadius *
  754|       |                                                            cos( dfRotation ) );
  755|       |            oEllipsePoint1.setY( stEllipseCenter.getY() + dfPrimaryRadius *
  756|       |                                                            sin( dfRotation ) );
  757|       |            oEllipsePoint1.setZ( stEllipseCenter.getZ() );
  758|       |            poEllipse->addPoint( &oEllipsePoint1 );
  759|       |
  760|       |            OGRPoint  oEllipsePoint2;
  761|       |            oEllipsePoint2.setX( stEllipseCenter.getX() + dfSecondaryRadius *
  762|       |                                                            cos( dfRotation ) );
  763|       |            oEllipsePoint2.setY( stEllipseCenter.getY() + dfSecondaryRadius *
  764|       |                                                            sin( dfRotation ) );
  765|       |            oEllipsePoint2.setZ( stEllipseCenter.getZ() );
  766|       |            poEllipse->addPoint( &oEllipsePoint2 );
  767|       |
  768|       |            OGRPoint  oEllipsePoint3;
  769|       |            oEllipsePoint3.setX( stEllipseCenter.getX() + dfPrimaryRadius *
  770|       |                                                            cos( dfRotation ) );
  771|       |            oEllipsePoint3.setY( stEllipseCenter.getY() - dfPrimaryRadius *
  772|       |                                                            sin( dfRotation ) );
  773|       |            oEllipsePoint3.setZ( stEllipseCenter.getZ() );
  774|       |            poEllipse->addPoint( &oEllipsePoint3 );
  775|       |
  776|       |            OGRPoint  oEllipsePoint4;
  777|       |            oEllipsePoint4.setX( stEllipseCenter.getX() - dfSecondaryRadius *
  778|       |                                                            cos( dfRotation ) );
  779|       |            oEllipsePoint4.setY( stEllipseCenter.getY() - dfSecondaryRadius *
  780|       |                                                            sin( dfRotation ) );
  781|       |            oEllipsePoint4.setZ( stEllipseCenter.getZ() );
  782|       |            poEllipse->addPoint( &oEllipsePoint4 );
  783|       |
  784|       |            // Close the ellipse
  785|       |            poEllipse->addPoint( &oEllipsePoint1 );
  786|       |            */
  787|       |
  788|     80|            CPLDebug("CAD",
  789|     80|                     "Position: %f, %f, %f, radius %f/%f, start angle: %f, end "
  790|     80|                     "angle: %f, rotation: %f",
  791|     80|                     stEllipseCenter.getX(), stEllipseCenter.getY(),
  792|     80|                     stEllipseCenter.getZ(), dfPrimaryRadius, dfSecondaryRadius,
  793|     80|                     dfStartAngle, dfEndAngle, dfRotation);
  794|     80|            OGRGeometry *poEllipse = OGRGeometryFactory::approximateArcAngles(
  795|     80|                stEllipseCenter.getX(), stEllipseCenter.getY(),
  796|     80|                stEllipseCenter.getZ(), dfPrimaryRadius, dfSecondaryRadius,
  797|     80|                dfRotation, dfStartAngle, dfEndAngle, 0.0);
  798|       |
  799|     80|            poFeature->SetGeometryDirectly(poEllipse);
  800|     80|            poFeature->SetField(FIELD_NAME_GEOMTYPE, "CADEllipse");
  ------------------
  |  |   22|     80|#define FIELD_NAME_GEOMTYPE "cadgeom_type"
  ------------------
  801|     80|            break;
  802|    126|        }
  803|       |
  804|    309|        case CADGeometry::ATTDEF:
  ------------------
  |  Branch (804:9): [True: 309, False: 1.18k]
  ------------------
  805|    309|        {
  806|    309|            CADAttdef *const poCADAttdef =
  807|    309|                cpl::down_cast<CADAttdef *>(poCADGeometry);
  808|    309|            OGRPoint *poPoint = new OGRPoint(poCADAttdef->getPosition().getX(),
  809|    309|                                             poCADAttdef->getPosition().getY(),
  810|    309|                                             poCADAttdef->getPosition().getZ());
  811|    309|            CPLString sTextValue =
  812|    309|                CADRecode(poCADAttdef->getTag(), nDWGEncoding);
  813|       |
  814|    309|            poFeature->SetField(FIELD_NAME_TEXT, sTextValue);
  ------------------
  |  |   26|    309|#define FIELD_NAME_TEXT "text"
  ------------------
  815|    309|            poFeature->SetGeometryDirectly(poPoint);
  816|    309|            poFeature->SetField(FIELD_NAME_GEOMTYPE, "CADAttdef");
  ------------------
  |  |   22|    309|#define FIELD_NAME_GEOMTYPE "cadgeom_type"
  ------------------
  817|       |
  818|    309|            sStyle.Printf("LABEL(f:\"Arial\",t:\"%s\",c:%s)",
  819|    309|                          sTextValue.c_str(), sHexColor.c_str());
  820|    309|            poFeature->SetStyleString(sStyle);
  821|    309|            break;
  822|    126|        }
  823|       |
  824|    185|        default:
  ------------------
  |  Branch (824:9): [True: 185, False: 1.30k]
  ------------------
  825|    185|        {
  826|    185|            CPLError(CE_Warning, CPLE_NotSupported,
  ------------------
  |  |   95|    185|#define CPLE_NotSupported 6
  ------------------
  827|    185|                     "Unhandled feature. Skipping it.");
  828|       |
  829|    185|            poFeature->SetField(FIELD_NAME_GEOMTYPE, "CADUnknown");
  ------------------
  |  |   22|    185|#define FIELD_NAME_GEOMTYPE "cadgeom_type"
  ------------------
  830|    185|            delete poCADGeometry;
  831|    185|            return poFeature;
  832|    126|        }
  833|  1.49k|    }
  834|       |
  835|  1.30k|    delete poCADGeometry;
  836|  1.30k|    poFeature->GetGeometryRef()->assignSpatialReference(poSpatialRef);
  837|  1.30k|    return poFeature;
  838|  1.49k|}

_ZN10VSILFileIOC2EPKc:
   18|  7.27k|    : CADFileIO(pszFilePath), m_oFileStream(nullptr)
   19|  7.27k|{
   20|  7.27k|}
_ZN10VSILFileIOD2Ev:
   23|  7.27k|{
   24|  7.27k|    if (m_oFileStream)
  ------------------
  |  Branch (24:9): [True: 40, False: 7.23k]
  ------------------
   25|     40|        VSILFileIO::Close();
   26|  7.27k|}
_ZN10VSILFileIO4OpenEi:
   40|  7.27k|{
   41|       |    // NOTE: now support only read mode
   42|  7.27k|    if (mode & OpenMode::out)
  ------------------
  |  Branch (42:9): [True: 0, False: 7.27k]
  ------------------
   43|      0|        return false;
   44|       |
   45|  7.27k|    std::string sOpenMode = "r";
   46|  7.27k|    if (mode & OpenMode::binary)
  ------------------
  |  Branch (46:9): [True: 7.27k, False: 0]
  ------------------
   47|  7.27k|        sOpenMode = "rb";
   48|       |
   49|  7.27k|    m_oFileStream = VSIFOpenL(m_soFilePath.c_str(), sOpenMode.c_str());
   50|       |
   51|  7.27k|    if (m_oFileStream != nullptr)
  ------------------
  |  Branch (51:9): [True: 7.27k, False: 0]
  ------------------
   52|  7.27k|        m_bIsOpened = true;
   53|       |
   54|  7.27k|    return m_bIsOpened;
   55|  7.27k|}
_ZN10VSILFileIO5CloseEv:
   58|  7.27k|{
   59|  7.27k|    bool bRet = VSIFCloseL(m_oFileStream) == 0 ? true : false;
  ------------------
  |  Branch (59:17): [True: 7.27k, False: 0]
  ------------------
   60|  7.27k|    m_oFileStream = nullptr;
   61|  7.27k|    return bRet;
   62|  7.27k|}
_ZN10VSILFileIO4SeekElN9CADFileIO10SeekOriginE:
   65|  1.05M|{
   66|  1.05M|    int nWhence = 0;
   67|  1.05M|    switch (origin)
  ------------------
  |  Branch (67:13): [True: 0, False: 1.05M]
  ------------------
   68|  1.05M|    {
   69|  7.23k|        case SeekOrigin::CUR:
  ------------------
  |  Branch (69:9): [True: 7.23k, False: 1.05M]
  ------------------
   70|  7.23k|            nWhence = SEEK_CUR;
   71|  7.23k|            break;
   72|      0|        case SeekOrigin::END:
  ------------------
  |  Branch (72:9): [True: 0, False: 1.05M]
  ------------------
   73|      0|            nWhence = SEEK_END;
   74|      0|            break;
   75|  1.05M|        case SeekOrigin::BEG:
  ------------------
  |  Branch (75:9): [True: 1.05M, False: 7.23k]
  ------------------
   76|  1.05M|            nWhence = SEEK_SET;
   77|  1.05M|            break;
   78|  1.05M|    }
   79|       |
   80|  1.05M|    return VSIFSeekL(m_oFileStream, offset, nWhence) == 0 ? 0 : 1;
  ------------------
  |  Branch (80:12): [True: 1.05M, False: 0]
  ------------------
   81|  1.05M|}
_ZN10VSILFileIO4ReadEPvm:
   89|  4.35M|{
   90|  4.35M|    return VSIFReadL(static_cast<char *>(ptr), 1, size, m_oFileStream);
   91|  4.35M|}
_ZN10VSILFileIO6RewindEv:
  100|  21.7k|{
  101|  21.7k|    VSIRewindL(m_oFileStream);
  102|  21.7k|}

OGR_DS_Destroy:
   49|  1.52k|{
   50|  1.52k|    if (hDS == nullptr)
  ------------------
  |  Branch (50:9): [True: 0, False: 1.52k]
  ------------------
   51|      0|        return;
   52|  1.52k|    GDALClose(reinterpret_cast<GDALDatasetH>(hDS));
   53|       |    // VALIDATE_POINTER0( hDS, "OGR_DS_Destroy" );
   54|  1.52k|}
OGR_DS_GetLayerCount:
  253|  1.52k|{
  254|  1.52k|    VALIDATE_POINTER1(hDS, "OGR_DS_GetLayerCount", 0);
  ------------------
  |  |  471|  1.52k|    do                                                                         \
  |  |  472|  1.52k|    {                                                                          \
  |  |  473|  1.52k|        if (CPL_NULLPTR == ptr)                                                \
  |  |  ------------------
  |  |  |  | 1066|  1.52k|#define CPL_NULLPTR nullptr
  |  |  ------------------
  |  |  |  Branch (473:13): [True: 0, False: 1.52k]
  |  |  ------------------
  |  |  474|  1.52k|        {                                                                      \
  |  |  475|      0|            CPLErr const ret = VALIDATE_POINTER_ERR;                           \
  |  |  ------------------
  |  |  |  |  354|      0|#define VALIDATE_POINTER_ERR CE_Failure
  |  |  ------------------
  |  |  476|      0|            CPLError(ret, CPLE_ObjectNull,                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#define CPLE_ObjectNull 10
  |  |  ------------------
  |  |  477|      0|                     "Pointer \'%s\' is NULL in \'%s\'.\n", #ptr, (func));     \
  |  |  478|      0|            return (rc);                                                       \
  |  |  479|      0|        }                                                                      \
  |  |  480|  1.52k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  255|       |
  256|       |#ifdef OGRAPISPY_ENABLED
  257|       |    if (bOGRAPISpyEnabled)
  258|       |        OGRAPISpy_DS_GetLayerCount(reinterpret_cast<GDALDatasetH>(hDS));
  259|       |#endif
  260|       |
  261|  1.52k|    return GDALDataset::FromHandle(hDS)->GetLayerCount();
  262|  1.52k|}
OGR_DS_GetLayer:
  270|  1.02k|{
  271|  1.02k|    VALIDATE_POINTER1(hDS, "OGR_DS_GetLayer", nullptr);
  ------------------
  |  |  471|  1.02k|    do                                                                         \
  |  |  472|  1.02k|    {                                                                          \
  |  |  473|  1.02k|        if (CPL_NULLPTR == ptr)                                                \
  |  |  ------------------
  |  |  |  | 1066|  1.02k|#define CPL_NULLPTR nullptr
  |  |  ------------------
  |  |  |  Branch (473:13): [True: 0, False: 1.02k]
  |  |  ------------------
  |  |  474|  1.02k|        {                                                                      \
  |  |  475|      0|            CPLErr const ret = VALIDATE_POINTER_ERR;                           \
  |  |  ------------------
  |  |  |  |  354|      0|#define VALIDATE_POINTER_ERR CE_Failure
  |  |  ------------------
  |  |  476|      0|            CPLError(ret, CPLE_ObjectNull,                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#define CPLE_ObjectNull 10
  |  |  ------------------
  |  |  477|      0|                     "Pointer \'%s\' is NULL in \'%s\'.\n", #ptr, (func));     \
  |  |  478|      0|            return (rc);                                                       \
  |  |  479|      0|        }                                                                      \
  |  |  480|  1.02k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  272|       |
  273|  1.02k|    OGRLayerH hLayer =
  274|  1.02k|        OGRLayer::ToHandle(GDALDataset::FromHandle(hDS)->GetLayer(iLayer));
  275|       |
  276|       |#ifdef OGRAPISPY_ENABLED
  277|       |    if (bOGRAPISpyEnabled)
  278|       |        OGRAPISpy_DS_GetLayer(reinterpret_cast<GDALDatasetH>(hDS), iLayer,
  279|       |                              hLayer);
  280|       |#endif
  281|       |
  282|  1.02k|    return hLayer;
  283|  1.02k|}

_ZN8OGRLayerC2Ev:
   34|  1.02k|    : m_poPrivate(new Private()), m_bFilterIsEnvelope(FALSE),
  ------------------
  |  | 1039|  1.02k|#define FALSE 0
  ------------------
   35|  1.02k|      m_poFilterGeom(nullptr),
   36|  1.02k|      m_pPreparedFilterGeom(nullptr), m_sFilterEnvelope{},
   37|  1.02k|      m_iGeomFieldFilter(0), m_poStyleTable(nullptr), m_poAttrQuery(nullptr),
   38|  1.02k|      m_pszAttrQueryString(nullptr), m_poAttrIndex(nullptr), m_nRefCount(0),
   39|  1.02k|      m_nFeaturesRead(0)
   40|  1.02k|{
   41|  1.02k|}
_ZN8OGRLayerD2Ev:
   49|  1.02k|{
   50|  1.02k|    if (m_poStyleTable)
  ------------------
  |  Branch (50:9): [True: 0, False: 1.02k]
  ------------------
   51|      0|    {
   52|      0|        delete m_poStyleTable;
   53|      0|        m_poStyleTable = nullptr;
   54|      0|    }
   55|       |
   56|  1.02k|    if (m_poAttrIndex != nullptr)
  ------------------
  |  Branch (56:9): [True: 0, False: 1.02k]
  ------------------
   57|      0|    {
   58|      0|        delete m_poAttrIndex;
   59|      0|        m_poAttrIndex = nullptr;
   60|      0|    }
   61|       |
   62|  1.02k|    if (m_poAttrQuery != nullptr)
  ------------------
  |  Branch (62:9): [True: 0, False: 1.02k]
  ------------------
   63|      0|    {
   64|      0|        delete m_poAttrQuery;
   65|      0|        m_poAttrQuery = nullptr;
   66|      0|    }
   67|       |
   68|  1.02k|    CPLFree(m_pszAttrQueryString);
  ------------------
  |  |   86|  1.02k|#define CPLFree VSIFree
  ------------------
   69|       |
   70|  1.02k|    if (m_poFilterGeom)
  ------------------
  |  Branch (70:9): [True: 0, False: 1.02k]
  ------------------
   71|      0|    {
   72|      0|        delete m_poFilterGeom;
   73|      0|        m_poFilterGeom = nullptr;
   74|      0|    }
   75|       |
   76|  1.02k|    if (m_pPreparedFilterGeom != nullptr)
  ------------------
  |  Branch (76:9): [True: 0, False: 1.02k]
  ------------------
   77|      0|    {
   78|      0|        OGRDestroyPreparedGeometry(m_pPreparedFilterGeom);
   79|      0|        m_pPreparedFilterGeom = nullptr;
   80|      0|    }
   81|       |
   82|  1.02k|    if (m_poSharedArrowArrayStreamPrivateData != nullptr)
  ------------------
  |  Branch (82:9): [True: 0, False: 1.02k]
  ------------------
   83|      0|    {
   84|      0|        m_poSharedArrowArrayStreamPrivateData->m_poLayer = nullptr;
   85|      0|    }
   86|  1.02k|}
OGR_L_GetNextFeature:
  857|  2.51k|{
  858|  2.51k|    VALIDATE_POINTER1(hLayer, "OGR_L_GetNextFeature", nullptr);
  ------------------
  |  |  471|  2.51k|    do                                                                         \
  |  |  472|  2.51k|    {                                                                          \
  |  |  473|  2.51k|        if (CPL_NULLPTR == ptr)                                                \
  |  |  ------------------
  |  |  |  | 1066|  2.51k|#define CPL_NULLPTR nullptr
  |  |  ------------------
  |  |  |  Branch (473:13): [True: 0, False: 2.51k]
  |  |  ------------------
  |  |  474|  2.51k|        {                                                                      \
  |  |  475|      0|            CPLErr const ret = VALIDATE_POINTER_ERR;                           \
  |  |  ------------------
  |  |  |  |  354|      0|#define VALIDATE_POINTER_ERR CE_Failure
  |  |  ------------------
  |  |  476|      0|            CPLError(ret, CPLE_ObjectNull,                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#define CPLE_ObjectNull 10
  |  |  ------------------
  |  |  477|      0|                     "Pointer \'%s\' is NULL in \'%s\'.\n", #ptr, (func));     \
  |  |  478|      0|            return (rc);                                                       \
  |  |  479|      0|        }                                                                      \
  |  |  480|  2.51k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  859|       |
  860|       |#ifdef OGRAPISPY_ENABLED
  861|       |    if (bOGRAPISpyEnabled)
  862|       |        OGRAPISpy_L_GetNextFeature(hLayer);
  863|       |#endif
  864|       |
  865|  2.51k|    return OGRFeature::ToHandle(OGRLayer::FromHandle(hLayer)->GetNextFeature());
  866|  2.51k|}
OGR_L_GetSpatialRef:
 1599|  1.02k|{
 1600|  1.02k|    VALIDATE_POINTER1(hLayer, "OGR_L_GetSpatialRef", nullptr);
  ------------------
  |  |  471|  1.02k|    do                                                                         \
  |  |  472|  1.02k|    {                                                                          \
  |  |  473|  1.02k|        if (CPL_NULLPTR == ptr)                                                \
  |  |  ------------------
  |  |  |  | 1066|  1.02k|#define CPL_NULLPTR nullptr
  |  |  ------------------
  |  |  |  Branch (473:13): [True: 0, False: 1.02k]
  |  |  ------------------
  |  |  474|  1.02k|        {                                                                      \
  |  |  475|      0|            CPLErr const ret = VALIDATE_POINTER_ERR;                           \
  |  |  ------------------
  |  |  |  |  354|      0|#define VALIDATE_POINTER_ERR CE_Failure
  |  |  ------------------
  |  |  476|      0|            CPLError(ret, CPLE_ObjectNull,                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#define CPLE_ObjectNull 10
  |  |  ------------------
  |  |  477|      0|                     "Pointer \'%s\' is NULL in \'%s\'.\n", #ptr, (func));     \
  |  |  478|      0|            return (rc);                                                       \
  |  |  479|      0|        }                                                                      \
  |  |  480|  1.02k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1601|       |
 1602|       |#ifdef OGRAPISPY_ENABLED
 1603|       |    if (bOGRAPISpyEnabled)
 1604|       |        OGRAPISpy_L_GetSpatialRef(hLayer);
 1605|       |#endif
 1606|       |
 1607|  1.02k|    return OGRSpatialReference::ToHandle(
 1608|  1.02k|        OGRLayer::FromHandle(hLayer)->GetSpatialRef());
 1609|  1.02k|}
_ZN8OGRLayer12GetFIDColumnEv:
 2736|  1.02k|{
 2737|  1.02k|    return "";
 2738|  1.02k|}
OGR_L_GetFIDColumn:
 2746|  1.02k|{
 2747|  1.02k|    VALIDATE_POINTER1(hLayer, "OGR_L_GetFIDColumn", nullptr);
  ------------------
  |  |  471|  1.02k|    do                                                                         \
  |  |  472|  1.02k|    {                                                                          \
  |  |  473|  1.02k|        if (CPL_NULLPTR == ptr)                                                \
  |  |  ------------------
  |  |  |  | 1066|  1.02k|#define CPL_NULLPTR nullptr
  |  |  ------------------
  |  |  |  Branch (473:13): [True: 0, False: 1.02k]
  |  |  ------------------
  |  |  474|  1.02k|        {                                                                      \
  |  |  475|      0|            CPLErr const ret = VALIDATE_POINTER_ERR;                           \
  |  |  ------------------
  |  |  |  |  354|      0|#define VALIDATE_POINTER_ERR CE_Failure
  |  |  ------------------
  |  |  476|      0|            CPLError(ret, CPLE_ObjectNull,                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#define CPLE_ObjectNull 10
  |  |  ------------------
  |  |  477|      0|                     "Pointer \'%s\' is NULL in \'%s\'.\n", #ptr, (func));     \
  |  |  478|      0|            return (rc);                                                       \
  |  |  479|      0|        }                                                                      \
  |  |  480|  1.02k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2748|       |
 2749|       |#ifdef OGRAPISPY_ENABLED
 2750|       |    if (bOGRAPISpyEnabled)
 2751|       |        OGRAPISpy_L_GetFIDColumn(hLayer);
 2752|       |#endif
 2753|       |
 2754|  1.02k|    return OGRLayer::FromHandle(hLayer)->GetFIDColumn();
 2755|  1.02k|}
_ZN8OGRLayer17GetGeometryColumnEv:
 2763|  1.02k|{
 2764|  1.02k|    if (GetLayerDefn()->GetGeomFieldCount() > 0)
  ------------------
  |  Branch (2764:9): [True: 1.02k, False: 0]
  ------------------
 2765|  1.02k|        return GetLayerDefn()->GetGeomFieldDefn(0)->GetNameRef();
 2766|      0|    else
 2767|      0|        return "";
 2768|  1.02k|}
OGR_L_GetGeometryColumn:
 2776|  1.02k|{
 2777|  1.02k|    VALIDATE_POINTER1(hLayer, "OGR_L_GetGeometryColumn", nullptr);
  ------------------
  |  |  471|  1.02k|    do                                                                         \
  |  |  472|  1.02k|    {                                                                          \
  |  |  473|  1.02k|        if (CPL_NULLPTR == ptr)                                                \
  |  |  ------------------
  |  |  |  | 1066|  1.02k|#define CPL_NULLPTR nullptr
  |  |  ------------------
  |  |  |  Branch (473:13): [True: 0, False: 1.02k]
  |  |  ------------------
  |  |  474|  1.02k|        {                                                                      \
  |  |  475|      0|            CPLErr const ret = VALIDATE_POINTER_ERR;                           \
  |  |  ------------------
  |  |  |  |  354|      0|#define VALIDATE_POINTER_ERR CE_Failure
  |  |  ------------------
  |  |  476|      0|            CPLError(ret, CPLE_ObjectNull,                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#define CPLE_ObjectNull 10
  |  |  ------------------
  |  |  477|      0|                     "Pointer \'%s\' is NULL in \'%s\'.\n", #ptr, (func));     \
  |  |  478|      0|            return (rc);                                                       \
  |  |  479|      0|        }                                                                      \
  |  |  480|  1.02k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2778|       |
 2779|       |#ifdef OGRAPISPY_ENABLED
 2780|       |    if (bOGRAPISpyEnabled)
 2781|       |        OGRAPISpy_L_GetGeometryColumn(hLayer);
 2782|       |#endif
 2783|       |
 2784|  1.02k|    return OGRLayer::FromHandle(hLayer)->GetGeometryColumn();
 2785|  1.02k|}
_ZN8OGRLayer11GetGeomTypeEv:
 2891|  1.02k|{
 2892|  1.02k|    OGRFeatureDefn *poLayerDefn = GetLayerDefn();
 2893|  1.02k|    if (poLayerDefn == nullptr)
  ------------------
  |  Branch (2893:9): [True: 0, False: 1.02k]
  ------------------
 2894|      0|    {
 2895|      0|        CPLDebug("OGR", "GetLayerType() returns NULL !");
 2896|      0|        return wkbUnknown;
 2897|      0|    }
 2898|  1.02k|    return poLayerDefn->GetGeomType();
 2899|  1.02k|}
OGR_L_GetGeomType:
 2907|  1.02k|{
 2908|  1.02k|    VALIDATE_POINTER1(hLayer, "OGR_L_GetGeomType", wkbUnknown);
  ------------------
  |  |  471|  1.02k|    do                                                                         \
  |  |  472|  1.02k|    {                                                                          \
  |  |  473|  1.02k|        if (CPL_NULLPTR == ptr)                                                \
  |  |  ------------------
  |  |  |  | 1066|  1.02k|#define CPL_NULLPTR nullptr
  |  |  ------------------
  |  |  |  Branch (473:13): [True: 0, False: 1.02k]
  |  |  ------------------
  |  |  474|  1.02k|        {                                                                      \
  |  |  475|      0|            CPLErr const ret = VALIDATE_POINTER_ERR;                           \
  |  |  ------------------
  |  |  |  |  354|      0|#define VALIDATE_POINTER_ERR CE_Failure
  |  |  ------------------
  |  |  476|      0|            CPLError(ret, CPLE_ObjectNull,                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#define CPLE_ObjectNull 10
  |  |  ------------------
  |  |  477|      0|                     "Pointer \'%s\' is NULL in \'%s\'.\n", #ptr, (func));     \
  |  |  478|      0|            return (rc);                                                       \
  |  |  479|      0|        }                                                                      \
  |  |  480|  1.02k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2909|       |
 2910|       |#ifdef OGRAPISPY_ENABLED
 2911|       |    if (bOGRAPISpyEnabled)
 2912|       |        OGRAPISpy_L_GetGeomType(hLayer);
 2913|       |#endif
 2914|       |
 2915|  1.02k|    OGRwkbGeometryType eType = OGRLayer::FromHandle(hLayer)->GetGeomType();
 2916|  1.02k|    if (OGR_GT_IsNonLinear(eType) && !OGRGetNonLinearGeometriesEnabledFlag())
  ------------------
  |  Branch (2916:9): [True: 45, False: 975]
  |  Branch (2916:38): [True: 0, False: 45]
  ------------------
 2917|      0|    {
 2918|      0|        eType = OGR_GT_GetLinear(eType);
 2919|      0|    }
 2920|  1.02k|    return eType;
 2921|  1.02k|}

OGROpen:
   76|  7.31k|{
   77|  7.31k|    VALIDATE_POINTER1(pszName, "OGROpen", nullptr);
  ------------------
  |  |  471|  7.31k|    do                                                                         \
  |  |  472|  7.31k|    {                                                                          \
  |  |  473|  7.31k|        if (CPL_NULLPTR == ptr)                                                \
  |  |  ------------------
  |  |  |  | 1066|  7.31k|#define CPL_NULLPTR nullptr
  |  |  ------------------
  |  |  |  Branch (473:13): [True: 0, False: 7.31k]
  |  |  ------------------
  |  |  474|  7.31k|        {                                                                      \
  |  |  475|      0|            CPLErr const ret = VALIDATE_POINTER_ERR;                           \
  |  |  ------------------
  |  |  |  |  354|      0|#define VALIDATE_POINTER_ERR CE_Failure
  |  |  ------------------
  |  |  476|      0|            CPLError(ret, CPLE_ObjectNull,                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#define CPLE_ObjectNull 10
  |  |  ------------------
  |  |  477|      0|                     "Pointer \'%s\' is NULL in \'%s\'.\n", #ptr, (func));     \
  |  |  478|      0|            return (rc);                                                       \
  |  |  479|      0|        }                                                                      \
  |  |  480|  7.31k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
   78|       |
   79|  7.31k|    GDALDatasetH hDS =
   80|  7.31k|        GDALOpenEx(pszName, GDAL_OF_VECTOR | ((bUpdate) ? GDAL_OF_UPDATE : 0),
  ------------------
  |  | 1052|  7.31k|#define GDAL_OF_VECTOR 0x04
  ------------------
                      GDALOpenEx(pszName, GDAL_OF_VECTOR | ((bUpdate) ? GDAL_OF_UPDATE : 0),
  ------------------
  |  | 1034|      0|#define GDAL_OF_UPDATE 0x01
  ------------------
  |  Branch (80:47): [True: 0, False: 7.31k]
  ------------------
   81|  7.31k|                   nullptr, nullptr, nullptr);
   82|  7.31k|    if (hDS != nullptr && pahDriverList != nullptr)
  ------------------
  |  Branch (82:9): [True: 1.52k, False: 5.78k]
  |  Branch (82:27): [True: 0, False: 1.52k]
  ------------------
   83|      0|        *pahDriverList =
   84|      0|            reinterpret_cast<OGRSFDriverH>(GDALGetDatasetDriver(hDS));
   85|       |
   86|  7.31k|    return reinterpret_cast<OGRDataSourceH>(hDS);
   87|  7.31k|}

json_c_object_sizeof:
  637|      2|{
  638|      2|	return sizeof(struct json_object);
  639|      2|}

_ZN8OGRLayer8ToHandleEPS_:
  378|  1.02k|    {
  379|  1.02k|        return reinterpret_cast<OGRLayerH>(poLayer);
  380|  1.02k|    }
_ZN8OGRLayer10FromHandleEPv:
  386|  6.59k|    {
  387|  6.59k|        return reinterpret_cast<OGRLayer *>(hLayer);
  388|  6.59k|    }

filegdbtable.cpp:_ZN11OpenFileGDBL13GetUnsetFieldEv:
 3024|      2|{
 3025|      2|    OGRField sUnsetField;
 3026|      2|    OGR_RawField_SetUnset(&sUnsetField);
 3027|      2|    return sUnsetField;
 3028|      2|}
filegdbtable.cpp:_ZN11OpenFileGDBL11getESRI_NANEv:
 3107|      2|{
 3108|       |    // Use exact same quiet NaN value as generated by the ESRI SDK, just
 3109|       |    // for the purpose of ensuring binary identical output for some tests.
 3110|       |    // I doubt this matter much which NaN is generated for usage.
 3111|       |    // The reason is that std::numeric_limits<double>::quiet_NaN() on my
 3112|       |    // platform has not the least significant bit set.
 3113|      2|    constexpr uint64_t nNAN = (static_cast<uint64_t>(0x7FF80000U) << 32) | 1;
 3114|      2|    double v;
 3115|      2|    memcpy(&v, &nNAN, sizeof(v));
 3116|      2|    return v;
 3117|      2|}

_ZN19OGRSpatialReference7PrivateC2EPS_:
  225|  2.54k|    : m_poSelf(poSelf),
  226|  2.54k|      m_poListener(std::shared_ptr<Listener>(new Listener(this)))
  227|  2.54k|{
  228|       |    // Get the default value for m_axisMappingStrategy from the
  229|       |    // OSR_DEFAULT_AXIS_MAPPING_STRATEGY configuration option, if set.
  230|  2.54k|    m_axisMappingStrategy = GetDefaultAxisMappingStrategy();
  231|  2.54k|}
_ZN19OGRSpatialReference7PrivateD2Ev:
  234|  2.54k|{
  235|       |    // In case we destroy the object not in the thread that created it,
  236|       |    // we need to reassign the PROJ context. Having the context bundled inside
  237|       |    // PJ* deeply sucks...
  238|  2.54k|    auto ctxt = getPROJContext();
  239|       |
  240|  2.54k|    proj_assign_context(m_pj_crs, ctxt);
  241|  2.54k|    proj_destroy(m_pj_crs);
  242|       |
  243|  2.54k|    proj_assign_context(m_pj_geod_base_crs_temp, ctxt);
  244|  2.54k|    proj_destroy(m_pj_geod_base_crs_temp);
  245|       |
  246|  2.54k|    proj_assign_context(m_pj_proj_crs_cs_temp, ctxt);
  247|  2.54k|    proj_destroy(m_pj_proj_crs_cs_temp);
  248|       |
  249|  2.54k|    proj_assign_context(m_pj_bound_crs_target, ctxt);
  250|  2.54k|    proj_destroy(m_pj_bound_crs_target);
  251|       |
  252|  2.54k|    proj_assign_context(m_pj_bound_crs_co, ctxt);
  253|  2.54k|    proj_destroy(m_pj_bound_crs_co);
  254|       |
  255|  2.54k|    proj_assign_context(m_pj_crs_backup, ctxt);
  256|  2.54k|    proj_destroy(m_pj_crs_backup);
  257|       |
  258|  2.54k|    delete m_poRootBackup;
  259|  2.54k|    delete m_poRoot;
  260|  2.54k|}
_ZN19OGRSpatialReference7Private14refreshProjObjEv:
  342|  1.02k|{
  343|  1.02k|    if (m_bNodesChanged && m_poRoot)
  ------------------
  |  Branch (343:9): [True: 0, False: 1.02k]
  |  Branch (343:28): [True: 0, False: 0]
  ------------------
  344|      0|    {
  345|      0|        char *pszWKT = nullptr;
  346|      0|        m_poRoot->exportToWkt(&pszWKT);
  347|      0|        auto poRootBackup = m_poRoot;
  348|      0|        m_poRoot = nullptr;
  349|      0|        const double dfCoordinateEpochBackup = m_coordinateEpoch;
  350|      0|        clear();
  351|      0|        m_coordinateEpoch = dfCoordinateEpochBackup;
  352|      0|        m_bHasCenterLong = strstr(pszWKT, "CENTER_LONG") != nullptr;
  353|       |
  354|      0|        const char *const options[] = {
  355|      0|            "STRICT=NO",
  356|      0|#if PROJ_AT_LEAST_VERSION(9, 1, 0)
  357|      0|            "UNSET_IDENTIFIERS_IF_INCOMPATIBLE_DEF=NO",
  358|      0|#endif
  359|      0|            nullptr
  360|      0|        };
  361|      0|        PROJ_STRING_LIST warnings = nullptr;
  362|      0|        PROJ_STRING_LIST errors = nullptr;
  363|      0|        setPjCRS(proj_create_from_wkt(getPROJContext(), pszWKT, options,
  364|      0|                                      &warnings, &errors));
  365|      0|        for (auto iter = warnings; iter && *iter; ++iter)
  ------------------
  |  Branch (365:36): [True: 0, False: 0]
  |  Branch (365:44): [True: 0, False: 0]
  ------------------
  366|      0|        {
  367|      0|            m_wktImportWarnings.push_back(*iter);
  368|      0|        }
  369|      0|        for (auto iter = errors; iter && *iter; ++iter)
  ------------------
  |  Branch (369:34): [True: 0, False: 0]
  |  Branch (369:42): [True: 0, False: 0]
  ------------------
  370|      0|        {
  371|      0|            m_wktImportErrors.push_back(*iter);
  372|      0|        }
  373|      0|        proj_string_list_destroy(warnings);
  374|      0|        proj_string_list_destroy(errors);
  375|       |
  376|      0|        CPLFree(pszWKT);
  ------------------
  |  |   86|      0|#define CPLFree VSIFree
  ------------------
  377|       |
  378|      0|        m_poRoot = poRootBackup;
  379|      0|        m_bNodesChanged = false;
  380|      0|    }
  381|  1.02k|}
_ZN19OGRSpatialReference7Private18refreshAxisMappingEv:
  448|  1.52k|{
  449|  1.52k|    if (!m_pj_crs || m_axisMappingStrategy == OAMS_CUSTOM)
  ------------------
  |  Branch (449:9): [True: 1.52k, False: 0]
  |  Branch (449:22): [True: 0, False: 0]
  ------------------
  450|  1.52k|        return;
  451|       |
  452|      0|    bool doUndoDemote = false;
  453|      0|    if (m_pj_crs_backup == nullptr)
  ------------------
  |  Branch (453:9): [True: 0, False: 0]
  ------------------
  454|      0|    {
  455|      0|        doUndoDemote = true;
  456|      0|        demoteFromBoundCRS();
  457|      0|    }
  458|      0|    const auto ctxt = getPROJContext();
  459|      0|    PJ *horizCRS = nullptr;
  460|      0|    int axisCount = 0;
  461|      0|    if (m_pjType == PJ_TYPE_VERTICAL_CRS)
  ------------------
  |  Branch (461:9): [True: 0, False: 0]
  ------------------
  462|      0|    {
  463|      0|        axisCount = 1;
  464|      0|    }
  465|      0|    else if (m_pjType == PJ_TYPE_COMPOUND_CRS)
  ------------------
  |  Branch (465:14): [True: 0, False: 0]
  ------------------
  466|      0|    {
  467|      0|        horizCRS = proj_crs_get_sub_crs(ctxt, m_pj_crs, 0);
  468|      0|        if (horizCRS && proj_get_type(horizCRS) == PJ_TYPE_BOUND_CRS)
  ------------------
  |  Branch (468:13): [True: 0, False: 0]
  |  Branch (468:25): [True: 0, False: 0]
  ------------------
  469|      0|        {
  470|      0|            auto baseCRS = proj_get_source_crs(ctxt, horizCRS);
  471|      0|            if (baseCRS)
  ------------------
  |  Branch (471:17): [True: 0, False: 0]
  ------------------
  472|      0|            {
  473|      0|                proj_destroy(horizCRS);
  474|      0|                horizCRS = baseCRS;
  475|      0|            }
  476|      0|        }
  477|       |
  478|      0|        auto vertCRS = proj_crs_get_sub_crs(ctxt, m_pj_crs, 1);
  479|      0|        if (vertCRS)
  ------------------
  |  Branch (479:13): [True: 0, False: 0]
  ------------------
  480|      0|        {
  481|      0|            if (proj_get_type(vertCRS) == PJ_TYPE_BOUND_CRS)
  ------------------
  |  Branch (481:17): [True: 0, False: 0]
  ------------------
  482|      0|            {
  483|      0|                auto baseCRS = proj_get_source_crs(ctxt, vertCRS);
  484|      0|                if (baseCRS)
  ------------------
  |  Branch (484:21): [True: 0, False: 0]
  ------------------
  485|      0|                {
  486|      0|                    proj_destroy(vertCRS);
  487|      0|                    vertCRS = baseCRS;
  488|      0|                }
  489|      0|            }
  490|       |
  491|      0|            auto cs = proj_crs_get_coordinate_system(ctxt, vertCRS);
  492|      0|            if (cs)
  ------------------
  |  Branch (492:17): [True: 0, False: 0]
  ------------------
  493|      0|            {
  494|      0|                axisCount += proj_cs_get_axis_count(ctxt, cs);
  495|      0|                proj_destroy(cs);
  496|      0|            }
  497|      0|            proj_destroy(vertCRS);
  498|      0|        }
  499|      0|    }
  500|      0|    else
  501|      0|    {
  502|      0|        horizCRS = m_pj_crs;
  503|      0|    }
  504|       |
  505|      0|    bool bSwitchForGisFriendlyOrder = false;
  506|      0|    if (horizCRS)
  ------------------
  |  Branch (506:9): [True: 0, False: 0]
  ------------------
  507|      0|    {
  508|      0|        auto cs = proj_crs_get_coordinate_system(ctxt, horizCRS);
  509|      0|        if (cs)
  ------------------
  |  Branch (509:13): [True: 0, False: 0]
  ------------------
  510|      0|        {
  511|      0|            int nHorizCSAxisCount = proj_cs_get_axis_count(ctxt, cs);
  512|      0|            axisCount += nHorizCSAxisCount;
  513|      0|            if (nHorizCSAxisCount >= 2)
  ------------------
  |  Branch (513:17): [True: 0, False: 0]
  ------------------
  514|      0|            {
  515|      0|                bSwitchForGisFriendlyOrder = isNorthEastAxisOrder(ctxt, cs);
  516|      0|            }
  517|      0|            proj_destroy(cs);
  518|      0|        }
  519|      0|    }
  520|      0|    if (horizCRS != m_pj_crs)
  ------------------
  |  Branch (520:9): [True: 0, False: 0]
  ------------------
  521|      0|    {
  522|      0|        proj_destroy(horizCRS);
  523|      0|    }
  524|      0|    if (doUndoDemote)
  ------------------
  |  Branch (524:9): [True: 0, False: 0]
  ------------------
  525|      0|    {
  526|      0|        undoDemoteFromBoundCRS();
  527|      0|    }
  528|       |
  529|      0|    m_axisMapping.resize(axisCount);
  530|      0|    if (m_axisMappingStrategy == OAMS_AUTHORITY_COMPLIANT ||
  ------------------
  |  Branch (530:9): [True: 0, False: 0]
  ------------------
  531|      0|        !bSwitchForGisFriendlyOrder)
  ------------------
  |  Branch (531:9): [True: 0, False: 0]
  ------------------
  532|      0|    {
  533|      0|        for (int i = 0; i < axisCount; i++)
  ------------------
  |  Branch (533:25): [True: 0, False: 0]
  ------------------
  534|      0|        {
  535|      0|            m_axisMapping[i] = i + 1;
  536|      0|        }
  537|      0|    }
  538|      0|    else
  539|      0|    {
  540|      0|        m_axisMapping[0] = 2;
  541|      0|        m_axisMapping[1] = 1;
  542|      0|        if (axisCount == 3)
  ------------------
  |  Branch (542:13): [True: 0, False: 0]
  ------------------
  543|      0|        {
  544|      0|            m_axisMapping[2] = 3;
  545|      0|        }
  546|      0|    }
  547|      0|}
_ZN19OGRSpatialReferenceC2EPKc:
  818|  2.54k|    : d(new Private(this))
  819|  2.54k|{
  820|  2.54k|    if (pszWKT != nullptr)
  ------------------
  |  Branch (820:9): [True: 0, False: 2.54k]
  ------------------
  821|      0|        importFromWkt(pszWKT);
  822|  2.54k|}
_ZN19OGRSpatialReferenceD2Ev:
  903|  2.54k|{
  904|  2.54k|}
_ZN19OGRSpatialReference9ReferenceEv:
 1058|  3.42k|{
 1059|  3.42k|    return CPLAtomicInc(&d->nRefCount);
  ------------------
  |  |   55|  3.42k|#define CPLAtomicInc(ptr) CPLAtomicAdd(ptr, 1)
  ------------------
 1060|  3.42k|}
_ZN19OGRSpatialReference11DereferenceEv:
 1093|  5.97k|{
 1094|  5.97k|    if (d->nRefCount <= 0)
  ------------------
  |  Branch (1094:9): [True: 0, False: 5.97k]
  ------------------
 1095|      0|        CPLDebug("OSR",
 1096|      0|                 "Dereference() called on an object with refcount %d,"
 1097|      0|                 "likely already destroyed!",
 1098|      0|                 d->nRefCount);
 1099|  5.97k|    return CPLAtomicDec(&d->nRefCount);
  ------------------
  |  |   66|  5.97k|#define CPLAtomicDec(ptr) CPLAtomicAdd(ptr, -1)
  ------------------
 1100|  5.97k|}
_ZN19OGRSpatialReference7ReleaseEv:
 1145|  5.97k|{
 1146|  5.97k|    if (Dereference() <= 0)
  ------------------
  |  Branch (1146:9): [True: 2.54k, False: 3.42k]
  ------------------
 1147|  2.54k|        delete this;
 1148|  5.97k|}
_ZNK19OGRSpatialReference5CloneEv:
 1433|  1.02k|{
 1434|  1.02k|    OGRSpatialReference *poNewRef = new OGRSpatialReference();
 1435|       |
 1436|  1.02k|    TAKE_OPTIONAL_LOCK();
  ------------------
  |  |  201|  1.02k|    auto lock = d->GetOptionalLockGuard();                                     \
  |  |  202|  1.02k|    CPL_IGNORE_RET_VAL(lock)
  ------------------
 1437|       |
 1438|  1.02k|    d->refreshProjObj();
 1439|  1.02k|    if (d->m_pj_crs != nullptr)
  ------------------
  |  Branch (1439:9): [True: 0, False: 1.02k]
  ------------------
 1440|      0|        poNewRef->d->setPjCRS(proj_clone(d->getPROJContext(), d->m_pj_crs));
 1441|  1.02k|    if (d->m_bHasCenterLong && d->m_poRoot)
  ------------------
  |  Branch (1441:9): [True: 0, False: 1.02k]
  |  Branch (1441:32): [True: 0, False: 0]
  ------------------
 1442|      0|    {
 1443|      0|        poNewRef->d->setRoot(d->m_poRoot->Clone());
 1444|      0|    }
 1445|  1.02k|    poNewRef->d->m_axisMapping = d->m_axisMapping;
 1446|  1.02k|    poNewRef->d->m_axisMappingStrategy = d->m_axisMappingStrategy;
 1447|  1.02k|    poNewRef->d->m_coordinateEpoch = d->m_coordinateEpoch;
 1448|  1.02k|    return poNewRef;
 1449|  1.02k|}
_ZN19OGRSpatialReference22SetAxisMappingStrategyE22OSRAxisMappingStrategy:
12571|  1.52k|{
12572|  1.52k|    TAKE_OPTIONAL_LOCK();
  ------------------
  |  |  201|  1.52k|    auto lock = d->GetOptionalLockGuard();                                     \
  |  |  202|  1.52k|    CPL_IGNORE_RET_VAL(lock)
  ------------------
12573|       |
12574|  1.52k|    d->m_axisMappingStrategy = strategy;
12575|  1.52k|    d->refreshAxisMapping();
12576|  1.52k|}
_ZN19OGRSpatialReference7Private8ListenerC2EPS0_:
   68|  2.54k|        explicit Listener(OGRSpatialReference::Private *poObj) : m_poObj(poObj)
   69|  2.54k|        {
   70|  2.54k|        }
ogrspatialreference.cpp:_ZL29GetDefaultAxisMappingStrategyv:
  205|  2.54k|{
  206|  2.54k|    const char *pszDefaultAMS =
  207|  2.54k|        CPLGetConfigOption("OSR_DEFAULT_AXIS_MAPPING_STRATEGY", nullptr);
  208|  2.54k|    if (pszDefaultAMS)
  ------------------
  |  Branch (208:9): [True: 0, False: 2.54k]
  ------------------
  209|      0|    {
  210|      0|        if (EQUAL(pszDefaultAMS, "AUTHORITY_COMPLIANT"))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  211|      0|            return OAMS_AUTHORITY_COMPLIANT;
  212|      0|        else if (EQUAL(pszDefaultAMS, "TRADITIONAL_GIS_ORDER"))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  213|      0|            return OAMS_TRADITIONAL_GIS_ORDER;
  214|      0|        else
  215|      0|        {
  216|      0|            CPLError(CE_Failure, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  217|      0|                     "Illegal value for OSR_DEFAULT_AXIS_MAPPING_STRATEGY = %s",
  218|      0|                     pszDefaultAMS);
  219|      0|        }
  220|      0|    }
  221|  2.54k|    return OAMS_AUTHORITY_COMPLIANT;
  222|  2.54k|}
_ZN19OGRSpatialReference7Private14getPROJContextEv:
  156|  2.54k|    {
  157|  2.54k|        return OSRGetProjTLSContext();
  158|  2.54k|    }
_ZN19OGRSpatialReference7Private20GetOptionalLockGuardEv:
  190|  2.54k|    {
  191|  2.54k|        return OptionalLockGuard(this);
  192|  2.54k|    }
_ZN19OGRSpatialReference7Private17OptionalLockGuardC2EPS0_:
  176|  2.54k|        explicit OptionalLockGuard(Private *p) : m_private(*p)
  177|  2.54k|        {
  178|  2.54k|            if (m_private.m_bIsThreadSafe)
  ------------------
  |  Branch (178:17): [True: 0, False: 2.54k]
  ------------------
  179|      0|                m_private.m_mutex.lock();
  180|  2.54k|        }
_ZN19OGRSpatialReference7Private17OptionalLockGuardD2Ev:
  183|  2.54k|        {
  184|  2.54k|            if (m_private.m_bIsThreadSafe)
  ------------------
  |  Branch (184:17): [True: 0, False: 2.54k]
  ------------------
  185|      0|                m_private.m_mutex.unlock();
  186|  2.54k|        }

CPLAtomicAdd:
   55|  14.4k|{
   56|  14.4k|    int temp = increment;
   57|  14.4k|    __asm__ __volatile__("lock; xaddl %0,%1"
   58|  14.4k|                         : "+r"(temp), "+m"(*ptr)
   59|  14.4k|                         :
   60|  14.4k|                         : "memory");
   61|  14.4k|    return temp + increment;
   62|  14.4k|}

_Z27CPLGetConversionTableToUTF8PKc:
  802|    352|{
  803|    352|    if (EQUAL(pszEncoding, "CP437"))
  ------------------
  |  |  541|    352|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|    352|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 110, False: 242]
  |  |  ------------------
  ------------------
  804|    110|        return &CPL_CP437_to_UTF8;
  805|    242|    if (EQUAL(pszEncoding, "CP1250"))
  ------------------
  |  |  541|    242|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|    242|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 26, False: 216]
  |  |  ------------------
  ------------------
  806|     26|        return &CPL_CP1250_to_UTF8;
  807|    216|    if (EQUAL(pszEncoding, "CP1251"))
  ------------------
  |  |  541|    216|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|    216|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 64, False: 152]
  |  |  ------------------
  ------------------
  808|     64|        return &CPL_CP1251_to_UTF8;
  809|    152|    if (EQUAL(pszEncoding, "CP1252"))
  ------------------
  |  |  541|    152|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|    152|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 16, False: 136]
  |  |  ------------------
  ------------------
  810|     16|        return &CPL_CP1252_to_UTF8;
  811|    136|    if (EQUAL(pszEncoding, "ISO-8859-2"))
  ------------------
  |  |  541|    136|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|    136|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 12, False: 124]
  |  |  ------------------
  ------------------
  812|     12|        return &CPL_ISO_8859_2_to_UTF8;
  813|    124|    if (EQUAL(pszEncoding, "ISO-8859-15"))
  ------------------
  |  |  541|    124|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|    124|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 124]
  |  |  ------------------
  ------------------
  814|      0|        return &CPL_ISO_8859_15_to_UTF8;
  815|    124|    return CPL_NULLPTR;
  ------------------
  |  | 1066|    124|#define CPL_NULLPTR nullptr
  ------------------
  816|    124|}

CPLCalloc:
  152|  7.55k|{
  153|  7.55k|    if (nSize * nCount == 0)
  ------------------
  |  Branch (153:9): [True: 0, False: 7.55k]
  ------------------
  154|      0|        return nullptr;
  155|       |
  156|  7.55k|    void *pReturn = CPLMalloc(nCount * nSize);
  157|  7.55k|    memset(pReturn, 0, nCount * nSize);
  158|  7.55k|    return pReturn;
  159|  7.55k|}
CPLMalloc:
  182|  47.3k|{
  183|  47.3k|    if (nSize == 0)
  ------------------
  |  Branch (183:9): [True: 96, False: 47.2k]
  ------------------
  184|     96|        return nullptr;
  185|       |
  186|  47.2k|    if ((nSize >> (8 * sizeof(nSize) - 1)) != 0)
  ------------------
  |  Branch (186:9): [True: 0, False: 47.2k]
  ------------------
  187|      0|    {
  188|       |        // coverity[dead_error_begin]
  189|      0|        CPLError(CE_Failure, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  190|      0|                 "CPLMalloc(%ld): Silly size requested.",
  191|      0|                 static_cast<long>(nSize));
  192|      0|        return nullptr;
  193|      0|    }
  194|       |
  195|  47.2k|    void *pReturn = VSIMalloc(nSize);
  196|  47.2k|    if (pReturn == nullptr)
  ------------------
  |  Branch (196:9): [True: 0, False: 47.2k]
  ------------------
  197|      0|    {
  198|      0|        if (nSize < 2000)
  ------------------
  |  Branch (198:13): [True: 0, False: 0]
  ------------------
  199|      0|        {
  200|      0|            CPLEmergencyError("CPLMalloc(): Out of memory allocating a small "
  201|      0|                              "number of bytes.");
  202|      0|        }
  203|       |
  204|      0|        CPLError(CE_Fatal, CPLE_OutOfMemory,
  ------------------
  |  |   87|      0|#define CPLE_OutOfMemory 2
  ------------------
  205|      0|                 "CPLMalloc(): Out of memory allocating %ld bytes.",
  206|      0|                 static_cast<long>(nSize));
  207|      0|    }
  208|       |
  209|  47.2k|    return pReturn;
  210|  47.2k|}
CPLRealloc:
  237|      3|{
  238|      3|    if (nNewSize == 0)
  ------------------
  |  Branch (238:9): [True: 0, False: 3]
  ------------------
  239|      0|    {
  240|      0|        VSIFree(pData);
  241|      0|        return nullptr;
  242|      0|    }
  243|       |
  244|      3|    if ((nNewSize >> (8 * sizeof(nNewSize) - 1)) != 0)
  ------------------
  |  Branch (244:9): [True: 0, False: 3]
  ------------------
  245|      0|    {
  246|       |        // coverity[dead_error_begin]
  247|      0|        CPLError(CE_Failure, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  248|      0|                 "CPLRealloc(%ld): Silly size requested.",
  249|      0|                 static_cast<long>(nNewSize));
  250|      0|        return nullptr;
  251|      0|    }
  252|       |
  253|      3|    void *pReturn = nullptr;
  254|       |
  255|      3|    if (pData == nullptr)
  ------------------
  |  Branch (255:9): [True: 0, False: 3]
  ------------------
  256|      0|        pReturn = VSIMalloc(nNewSize);
  257|      3|    else
  258|      3|        pReturn = VSIRealloc(pData, nNewSize);
  259|       |
  260|      3|    if (pReturn == nullptr)
  ------------------
  |  Branch (260:9): [True: 0, False: 3]
  ------------------
  261|      0|    {
  262|      0|        if (nNewSize < 2000)
  ------------------
  |  Branch (262:13): [True: 0, False: 0]
  ------------------
  263|      0|        {
  264|      0|            char szSmallMsg[80] = {};
  265|       |
  266|      0|            snprintf(szSmallMsg, sizeof(szSmallMsg),
  267|      0|                     "CPLRealloc(): Out of memory allocating %ld bytes.",
  268|      0|                     static_cast<long>(nNewSize));
  269|      0|            CPLEmergencyError(szSmallMsg);
  270|      0|        }
  271|      0|        else
  272|      0|        {
  273|      0|            CPLError(CE_Fatal, CPLE_OutOfMemory,
  ------------------
  |  |   87|      0|#define CPLE_OutOfMemory 2
  ------------------
  274|      0|                     "CPLRealloc(): Out of memory allocating %ld bytes.",
  275|      0|                     static_cast<long>(nNewSize));
  276|      0|        }
  277|      0|    }
  278|       |
  279|      3|    return pReturn;
  280|      3|}
CPLStrdup:
  305|  30.9k|{
  306|  30.9k|    if (pszString == nullptr)
  ------------------
  |  Branch (306:9): [True: 0, False: 30.9k]
  ------------------
  307|      0|        pszString = "";
  308|       |
  309|  30.9k|    const size_t nLen = strlen(pszString);
  310|  30.9k|    char *pszReturn = static_cast<char *>(CPLMalloc(nLen + 1));
  311|  30.9k|    memcpy(pszReturn, pszString, nLen + 1);
  312|  30.9k|    return (pszReturn);
  313|  30.9k|}
CPLGetConfigOption:
 1692|  46.9k|{
 1693|  46.9k|    const char *pszResult = CPLGetThreadLocalConfigOption(pszKey, nullptr);
 1694|       |
 1695|  46.9k|    if (pszResult == nullptr)
  ------------------
  |  Branch (1695:9): [True: 46.9k, False: 0]
  ------------------
 1696|  46.9k|    {
 1697|  46.9k|        pszResult = CPLGetGlobalConfigOption(pszKey, nullptr);
 1698|  46.9k|    }
 1699|       |
 1700|  46.9k|    if (gbIgnoreEnvVariables)
  ------------------
  |  Branch (1700:9): [True: 0, False: 46.9k]
  ------------------
 1701|      0|    {
 1702|      0|        const char *pszEnvVar = getenv(pszKey);
 1703|      0|        if (pszEnvVar != nullptr)
  ------------------
  |  Branch (1703:13): [True: 0, False: 0]
  ------------------
 1704|      0|        {
 1705|      0|            CPLDebug("CPL",
 1706|      0|                     "Ignoring environment variable %s=%s because of "
 1707|      0|                     "ignore-env-vars=yes setting in configuration file",
 1708|      0|                     pszKey, pszEnvVar);
 1709|      0|        }
 1710|      0|    }
 1711|  46.9k|    else if (pszResult == nullptr)
  ------------------
  |  Branch (1711:14): [True: 46.9k, False: 2]
  ------------------
 1712|  46.9k|    {
 1713|  46.9k|        pszResult = getenv(pszKey);
 1714|  46.9k|    }
 1715|       |
 1716|  46.9k|    if (pszResult == nullptr)
  ------------------
  |  Branch (1716:9): [True: 46.9k, False: 4]
  ------------------
 1717|  46.9k|        return pszDefault;
 1718|       |
 1719|      4|    return pszResult;
 1720|  46.9k|}
CPLGetThreadLocalConfigOption:
 1780|  46.9k|{
 1781|       |#ifdef DEBUG_CONFIG_OPTIONS
 1782|       |    CPLAccessConfigOption(pszKey, TRUE);
 1783|       |#endif
 1784|       |
 1785|  46.9k|    const char *pszResult = nullptr;
 1786|       |
 1787|  46.9k|    int bMemoryError = FALSE;
  ------------------
  |  | 1039|  46.9k|#define FALSE 0
  ------------------
 1788|  46.9k|    char **papszTLConfigOptions = reinterpret_cast<char **>(
 1789|  46.9k|        CPLGetTLSEx(CTLS_CONFIGOPTIONS, &bMemoryError));
  ------------------
  |  |  213|  46.9k|#define CTLS_CONFIGOPTIONS 14           /* cpl_conv.cpp */
  ------------------
 1790|  46.9k|    if (papszTLConfigOptions != nullptr)
  ------------------
  |  Branch (1790:9): [True: 0, False: 46.9k]
  ------------------
 1791|      0|        pszResult = CSLFetchNameValue(papszTLConfigOptions, pszKey);
 1792|       |
 1793|  46.9k|    if (pszResult == nullptr)
  ------------------
  |  Branch (1793:9): [True: 46.9k, False: 0]
  ------------------
 1794|  46.9k|        return pszDefault;
 1795|       |
 1796|      0|    return pszResult;
 1797|  46.9k|}
CPLGetGlobalConfigOption:
 1810|  46.9k|{
 1811|       |#ifdef DEBUG_CONFIG_OPTIONS
 1812|       |    CPLAccessConfigOption(pszKey, TRUE);
 1813|       |#endif
 1814|       |
 1815|  46.9k|    CPLMutexHolderD(&hConfigMutex);
  ------------------
  |  |  122|  46.9k|#define CPLMutexHolderD(x) CPLMutexHolder oHolder(x, 1000.0, __FILE__, __LINE__)
  ------------------
 1816|       |
 1817|  46.9k|    const char *pszResult =
 1818|  46.9k|        CSLFetchNameValue(const_cast<char **>(g_papszConfigOptions), pszKey);
 1819|       |
 1820|  46.9k|    if (pszResult == nullptr)
  ------------------
  |  Branch (1820:9): [True: 46.9k, False: 2]
  ------------------
 1821|  46.9k|        return pszDefault;
 1822|       |
 1823|      2|    return pszResult;
 1824|  46.9k|}
CPLSubscribeToSetConfigOption:
 1842|      1|{
 1843|      1|    CPLMutexHolderD(&hConfigMutex);
  ------------------
  |  |  122|      1|#define CPLMutexHolderD(x) CPLMutexHolder oHolder(x, 1000.0, __FILE__, __LINE__)
  ------------------
 1844|      1|    for (int nId = 0;
 1845|      1|         nId < static_cast<int>(gSetConfigOptionSubscribers.size()); ++nId)
  ------------------
  |  Branch (1845:10): [True: 0, False: 1]
  ------------------
 1846|      0|    {
 1847|      0|        if (!gSetConfigOptionSubscribers[nId].first)
  ------------------
  |  Branch (1847:13): [True: 0, False: 0]
  ------------------
 1848|      0|        {
 1849|      0|            gSetConfigOptionSubscribers[nId].first = pfnCallback;
 1850|      0|            gSetConfigOptionSubscribers[nId].second = pUserData;
 1851|      0|            return nId;
 1852|      0|        }
 1853|      0|    }
 1854|      1|    int nId = static_cast<int>(gSetConfigOptionSubscribers.size());
 1855|      1|    gSetConfigOptionSubscribers.push_back(
 1856|      1|        std::pair<CPLSetConfigOptionSubscriber, void *>(pfnCallback,
 1857|      1|                                                        pUserData));
 1858|      1|    return nId;
 1859|      1|}
CPLIsDebugEnabled:
 1927|     16|{
 1928|     16|    if (gnDebug < 0)
  ------------------
  |  Branch (1928:9): [True: 2, False: 14]
  ------------------
 1929|      2|    {
 1930|       |        // Check that apszKnownConfigOptions is correctly sorted with
 1931|       |        // STRCASECMP() criterion.
 1932|  2.12k|        for (size_t i = 1; i < CPL_ARRAYSIZE(apszKnownConfigOptions); ++i)
  ------------------
  |  | 1004|  2.12k|    ((sizeof(array) / sizeof(*(array))) /                                      \
  |  | 1005|  2.12k|     static_cast<size_t>(!(sizeof(array) % sizeof(*(array)))))
  ------------------
  |  Branch (1932:28): [True: 2.12k, False: 2]
  ------------------
 1933|  2.12k|        {
 1934|  2.12k|            if (STRCASECMP(apszKnownConfigOptions[i - 1],
  ------------------
  |  |  534|  2.12k|#define STRCASECMP(a, b) (strcasecmp(a, b))
  ------------------
  |  Branch (1934:17): [True: 0, False: 2.12k]
  ------------------
 1935|  2.12k|                           apszKnownConfigOptions[i]) >= 0)
 1936|      0|            {
 1937|      0|                CPLError(CE_Failure, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 1938|      0|                         "ERROR: apszKnownConfigOptions[] isn't correctly "
 1939|      0|                         "sorted: %s >= %s",
 1940|      0|                         apszKnownConfigOptions[i - 1],
 1941|      0|                         apszKnownConfigOptions[i]);
 1942|      0|            }
 1943|  2.12k|        }
 1944|      2|        gnDebug = CPLTestBool(CPLGetConfigOption("CPL_DEBUG", "OFF"));
 1945|      2|    }
 1946|       |
 1947|     16|    return gnDebug != 0;
 1948|     16|}
CPLSetConfigOption:
 2069|     16|{
 2070|       |#ifdef DEBUG_CONFIG_OPTIONS
 2071|       |    CPLAccessConfigOption(pszKey, FALSE);
 2072|       |#endif
 2073|     16|    CPLMutexHolderD(&hConfigMutex);
  ------------------
  |  |  122|     16|#define CPLMutexHolderD(x) CPLMutexHolder oHolder(x, 1000.0, __FILE__, __LINE__)
  ------------------
 2074|       |
 2075|       |#ifdef OGRAPISPY_ENABLED
 2076|       |    OGRAPISPYCPLSetConfigOption(pszKey, pszValue);
 2077|       |#endif
 2078|       |
 2079|     16|    CPLSetConfigOptionDetectUnknownConfigOption(pszKey, pszValue);
 2080|       |
 2081|     16|    g_papszConfigOptions = const_cast<volatile char **>(CSLSetNameValue(
 2082|     16|        const_cast<char **>(g_papszConfigOptions), pszKey, pszValue));
 2083|       |
 2084|     16|    NotifyOtherComponentsConfigOptionChanged(pszKey, pszValue,
 2085|     16|                                             /*bTheadLocal=*/false);
 2086|     16|}
CPLLoadConfigOptionsFromFile:
 2288|      4|{
 2289|      4|    VSILFILE *fp = VSIFOpenL(pszFilename, "rb");
 2290|      4|    if (fp == nullptr)
  ------------------
  |  Branch (2290:9): [True: 4, False: 0]
  ------------------
 2291|      4|        return;
 2292|      0|    CPLDebug("CPL", "Loading configuration from %s", pszFilename);
 2293|      0|    const char *pszLine;
 2294|      0|    enum class Section
 2295|      0|    {
 2296|      0|        NONE,
 2297|      0|        GENERAL,
 2298|      0|        CONFIG_OPTIONS,
 2299|      0|        CREDENTIALS,
 2300|      0|    };
 2301|      0|    Section eCurrentSection = Section::NONE;
 2302|      0|    bool bInSubsection = false;
 2303|      0|    std::string osPath;
 2304|      0|    int nSectionCounter = 0;
 2305|       |
 2306|      0|    const auto IsSpaceOnly = [](const char *pszStr)
 2307|      0|    {
 2308|      0|        for (; *pszStr; ++pszStr)
 2309|      0|        {
 2310|      0|            if (!isspace(static_cast<unsigned char>(*pszStr)))
 2311|      0|                return false;
 2312|      0|        }
 2313|      0|        return true;
 2314|      0|    };
 2315|       |
 2316|      0|    while ((pszLine = CPLReadLine2L(fp, -1, nullptr)) != nullptr)
  ------------------
  |  Branch (2316:12): [True: 0, False: 0]
  ------------------
 2317|      0|    {
 2318|      0|        if (IsSpaceOnly(pszLine))
  ------------------
  |  Branch (2318:13): [True: 0, False: 0]
  ------------------
 2319|      0|        {
 2320|       |            // Blank line
 2321|      0|        }
 2322|      0|        else if (pszLine[0] == '#')
  ------------------
  |  Branch (2322:18): [True: 0, False: 0]
  ------------------
 2323|      0|        {
 2324|       |            // Comment line
 2325|      0|        }
 2326|      0|        else if (strcmp(pszLine, "[configoptions]") == 0)
  ------------------
  |  Branch (2326:18): [True: 0, False: 0]
  ------------------
 2327|      0|        {
 2328|      0|            nSectionCounter++;
 2329|      0|            eCurrentSection = Section::CONFIG_OPTIONS;
 2330|      0|        }
 2331|      0|        else if (strcmp(pszLine, "[credentials]") == 0)
  ------------------
  |  Branch (2331:18): [True: 0, False: 0]
  ------------------
 2332|      0|        {
 2333|      0|            nSectionCounter++;
 2334|      0|            eCurrentSection = Section::CREDENTIALS;
 2335|      0|            bInSubsection = false;
 2336|      0|            osPath.clear();
 2337|      0|        }
 2338|      0|        else if (strcmp(pszLine, "[directives]") == 0)
  ------------------
  |  Branch (2338:18): [True: 0, False: 0]
  ------------------
 2339|      0|        {
 2340|      0|            nSectionCounter++;
 2341|      0|            if (nSectionCounter != 1)
  ------------------
  |  Branch (2341:17): [True: 0, False: 0]
  ------------------
 2342|      0|            {
 2343|      0|                CPLError(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 2344|      0|                         "The [directives] section should be the first one in "
 2345|      0|                         "the file, otherwise some its settings might not be "
 2346|      0|                         "used correctly.");
 2347|      0|            }
 2348|      0|            eCurrentSection = Section::GENERAL;
 2349|      0|        }
 2350|      0|        else if (eCurrentSection == Section::GENERAL)
  ------------------
  |  Branch (2350:18): [True: 0, False: 0]
  ------------------
 2351|      0|        {
 2352|      0|            char *pszKey = nullptr;
 2353|      0|            const char *pszValue = CPLParseNameValue(pszLine, &pszKey);
 2354|      0|            if (pszKey && pszValue)
  ------------------
  |  Branch (2354:17): [True: 0, False: 0]
  |  Branch (2354:27): [True: 0, False: 0]
  ------------------
 2355|      0|            {
 2356|      0|                if (strcmp(pszKey, "ignore-env-vars") == 0)
  ------------------
  |  Branch (2356:21): [True: 0, False: 0]
  ------------------
 2357|      0|                {
 2358|      0|                    gbIgnoreEnvVariables = CPLTestBool(pszValue);
 2359|      0|                }
 2360|      0|                else
 2361|      0|                {
 2362|      0|                    CPLError(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 2363|      0|                             "Ignoring %s line in [directives] section",
 2364|      0|                             pszLine);
 2365|      0|                }
 2366|      0|            }
 2367|      0|            CPLFree(pszKey);
  ------------------
  |  |   86|      0|#define CPLFree VSIFree
  ------------------
 2368|      0|        }
 2369|      0|        else if (eCurrentSection == Section::CREDENTIALS)
  ------------------
  |  Branch (2369:18): [True: 0, False: 0]
  ------------------
 2370|      0|        {
 2371|      0|            if (strncmp(pszLine, "[.", 2) == 0)
  ------------------
  |  Branch (2371:17): [True: 0, False: 0]
  ------------------
 2372|      0|            {
 2373|      0|                bInSubsection = true;
 2374|      0|                osPath.clear();
 2375|      0|            }
 2376|      0|            else if (bInSubsection)
  ------------------
  |  Branch (2376:22): [True: 0, False: 0]
  ------------------
 2377|      0|            {
 2378|      0|                char *pszKey = nullptr;
 2379|      0|                const char *pszValue = CPLParseNameValue(pszLine, &pszKey);
 2380|      0|                if (pszKey && pszValue)
  ------------------
  |  Branch (2380:21): [True: 0, False: 0]
  |  Branch (2380:31): [True: 0, False: 0]
  ------------------
 2381|      0|                {
 2382|      0|                    if (strcmp(pszKey, "path") == 0)
  ------------------
  |  Branch (2382:25): [True: 0, False: 0]
  ------------------
 2383|      0|                    {
 2384|      0|                        if (!osPath.empty())
  ------------------
  |  Branch (2384:29): [True: 0, False: 0]
  ------------------
 2385|      0|                        {
 2386|      0|                            CPLError(
 2387|      0|                                CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 2388|      0|                                "Duplicated 'path' key in the same subsection. "
 2389|      0|                                "Ignoring %s=%s",
 2390|      0|                                pszKey, pszValue);
 2391|      0|                        }
 2392|      0|                        else
 2393|      0|                        {
 2394|      0|                            osPath = pszValue;
 2395|      0|                        }
 2396|      0|                    }
 2397|      0|                    else if (osPath.empty())
  ------------------
  |  Branch (2397:30): [True: 0, False: 0]
  ------------------
 2398|      0|                    {
 2399|      0|                        CPLError(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 2400|      0|                                 "First entry in a credentials subsection "
 2401|      0|                                 "should be 'path'.");
 2402|      0|                    }
 2403|      0|                    else
 2404|      0|                    {
 2405|      0|                        VSISetPathSpecificOption(osPath.c_str(), pszKey,
 2406|      0|                                                 pszValue);
 2407|      0|                    }
 2408|      0|                }
 2409|      0|                CPLFree(pszKey);
  ------------------
  |  |   86|      0|#define CPLFree VSIFree
  ------------------
 2410|      0|            }
 2411|      0|            else if (pszLine[0] == '[')
  ------------------
  |  Branch (2411:22): [True: 0, False: 0]
  ------------------
 2412|      0|            {
 2413|      0|                eCurrentSection = Section::NONE;
 2414|      0|            }
 2415|      0|            else
 2416|      0|            {
 2417|      0|                CPLError(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 2418|      0|                         "Ignoring content in [credential] section that is not "
 2419|      0|                         "in a [.xxxxx] subsection");
 2420|      0|            }
 2421|      0|        }
 2422|      0|        else if (pszLine[0] == '[')
  ------------------
  |  Branch (2422:18): [True: 0, False: 0]
  ------------------
 2423|      0|        {
 2424|      0|            eCurrentSection = Section::NONE;
 2425|      0|        }
 2426|      0|        else if (eCurrentSection == Section::CONFIG_OPTIONS)
  ------------------
  |  Branch (2426:18): [True: 0, False: 0]
  ------------------
 2427|      0|        {
 2428|      0|            char *pszKey = nullptr;
 2429|      0|            const char *pszValue = CPLParseNameValue(pszLine, &pszKey);
 2430|      0|            if (pszKey && pszValue)
  ------------------
  |  Branch (2430:17): [True: 0, False: 0]
  |  Branch (2430:27): [True: 0, False: 0]
  ------------------
 2431|      0|            {
 2432|      0|                if (bOverrideEnvVars || gbIgnoreEnvVariables ||
  ------------------
  |  Branch (2432:21): [True: 0, False: 0]
  |  Branch (2432:41): [True: 0, False: 0]
  ------------------
 2433|      0|                    getenv(pszKey) == nullptr)
  ------------------
  |  Branch (2433:21): [True: 0, False: 0]
  ------------------
 2434|      0|                {
 2435|      0|                    CPLDebugOnly("CPL", "Setting configuration option %s=%s",
  ------------------
  |  |  313|      0|    do                                                                         \
  |  |  314|      0|    {                                                                          \
  |  |  315|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (315:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2436|      0|                                 pszKey, pszValue);
 2437|      0|                    CPLSetConfigOption(pszKey, pszValue);
 2438|      0|                }
 2439|      0|                else
 2440|      0|                {
 2441|      0|                    CPLDebug("CPL",
 2442|      0|                             "Ignoring configuration option %s=%s from "
 2443|      0|                             "configuration file as it is already set "
 2444|      0|                             "as an environment variable",
 2445|      0|                             pszKey, pszValue);
 2446|      0|                }
 2447|      0|            }
 2448|      0|            CPLFree(pszKey);
  ------------------
  |  |   86|      0|#define CPLFree VSIFree
  ------------------
 2449|      0|        }
 2450|      0|    }
 2451|      0|    VSIFCloseL(fp);
 2452|      0|}
CPLLoadConfigOptionsFromPredefinedFiles:
 2484|      2|{
 2485|      2|    const char *pszFile = CPLGetConfigOption("GDAL_CONFIG_FILE", nullptr);
 2486|      2|    if (pszFile != nullptr)
  ------------------
  |  Branch (2486:9): [True: 0, False: 2]
  ------------------
 2487|      0|    {
 2488|      0|        CPLLoadConfigOptionsFromFile(pszFile, false);
 2489|      0|    }
 2490|      2|    else
 2491|      2|    {
 2492|      2|#ifdef SYSCONFDIR
 2493|      2|        CPLLoadConfigOptionsFromFile(
 2494|      2|            CPLFormFilenameSafe(
 2495|      2|                CPLFormFilenameSafe(SYSCONFDIR, "gdal", nullptr).c_str(),
 2496|      2|                "gdalrc", nullptr)
 2497|      2|                .c_str(),
 2498|      2|            false);
 2499|      2|#endif
 2500|       |
 2501|       |#ifdef _WIN32
 2502|       |        const char *pszHome = CPLGetConfigOption("USERPROFILE", nullptr);
 2503|       |#else
 2504|      2|        const char *pszHome = CPLGetConfigOption("HOME", nullptr);
 2505|      2|#endif
 2506|      2|        if (pszHome != nullptr)
  ------------------
  |  Branch (2506:13): [True: 2, False: 0]
  ------------------
 2507|      2|        {
 2508|      2|            CPLLoadConfigOptionsFromFile(
 2509|      2|                CPLFormFilenameSafe(
 2510|      2|                    CPLFormFilenameSafe(pszHome, ".gdal", nullptr).c_str(),
 2511|      2|                    "gdalrc", nullptr)
 2512|      2|                    .c_str(),
 2513|      2|                false);
 2514|      2|        }
 2515|      2|    }
 2516|      2|}
CPLCheckForFile:
 3559|  3.05k|{
 3560|       |    /* -------------------------------------------------------------------- */
 3561|       |    /*      Fallback case if we don't have a sibling file list.             */
 3562|       |    /* -------------------------------------------------------------------- */
 3563|  3.05k|    if (papszSiblingFiles == nullptr)
  ------------------
  |  Branch (3563:9): [True: 3.05k, False: 0]
  ------------------
 3564|  3.05k|    {
 3565|  3.05k|        VSIStatBufL sStatBuf;
 3566|       |
 3567|  3.05k|        return VSIStatExL(pszFilename, &sStatBuf, VSI_STAT_EXISTS_FLAG) == 0;
  ------------------
  |  |  194|  3.05k|#define VSI_STAT_EXISTS_FLAG 0x1
  ------------------
 3568|  3.05k|    }
 3569|       |
 3570|       |    /* -------------------------------------------------------------------- */
 3571|       |    /*      We have sibling files, compare the non-path filename portion    */
 3572|       |    /*      of pszFilename too all entries.                                 */
 3573|       |    /* -------------------------------------------------------------------- */
 3574|      0|    const CPLString osFileOnly = CPLGetFilename(pszFilename);
 3575|       |
 3576|      0|    for (int i = 0; papszSiblingFiles[i] != nullptr; i++)
  ------------------
  |  Branch (3576:21): [True: 0, False: 0]
  ------------------
 3577|      0|    {
 3578|      0|        if (EQUAL(papszSiblingFiles[i], osFileOnly))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3579|      0|        {
 3580|      0|            strcpy(pszFilename + strlen(pszFilename) - osFileOnly.size(),
 3581|      0|                   papszSiblingFiles[i]);
 3582|      0|            return TRUE;
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
 3583|      0|        }
 3584|      0|    }
 3585|       |
 3586|      0|    return FALSE;
  ------------------
  |  | 1039|      0|#define FALSE 0
  ------------------
 3587|      0|}
cpl_conv.cpp:_ZL43CPLSetConfigOptionDetectUnknownConfigOptionPKcS0_:
 1999|     16|{
 2000|     16|    if (EQUAL(pszKey, "CPL_DEBUG"))
  ------------------
  |  |  541|     16|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|     16|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 16]
  |  |  ------------------
  ------------------
 2001|      0|    {
 2002|      0|        gnDebug = pszValue ? CPLTestBool(pszValue) : false;
  ------------------
  |  Branch (2002:19): [True: 0, False: 0]
  ------------------
 2003|      0|    }
 2004|     16|    else if (CPLIsDebugEnabled())
  ------------------
  |  Branch (2004:14): [True: 0, False: 16]
  ------------------
 2005|      0|    {
 2006|      0|        if (!std::binary_search(std::begin(apszKnownConfigOptions),
  ------------------
  |  Branch (2006:13): [True: 0, False: 0]
  ------------------
 2007|      0|                                std::end(apszKnownConfigOptions), pszKey,
 2008|      0|                                [](const char *a, const char *b)
 2009|      0|                                { return STRCASECMP(a, b) < 0; }))
 2010|      0|        {
 2011|      0|            bool bFound;
 2012|      0|            {
 2013|      0|                std::lock_guard oLock(goMutexDeclaredKnownConfigOptions);
 2014|      0|                bFound = cpl::contains(goSetKnownConfigOptions,
 2015|      0|                                       CPLString(pszKey).toupper());
 2016|      0|            }
 2017|      0|            if (!bFound)
  ------------------
  |  Branch (2017:17): [True: 0, False: 0]
  ------------------
 2018|      0|            {
 2019|      0|                const char *pszOldValue = CPLGetConfigOption(pszKey, nullptr);
 2020|      0|                if (!((!pszValue && !pszOldValue) ||
  ------------------
  |  Branch (2020:24): [True: 0, False: 0]
  |  Branch (2020:37): [True: 0, False: 0]
  ------------------
 2021|      0|                      (pszValue && pszOldValue &&
  ------------------
  |  Branch (2021:24): [True: 0, False: 0]
  |  Branch (2021:36): [True: 0, False: 0]
  ------------------
 2022|      0|                       EQUAL(pszValue, pszOldValue))))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2023|      0|                {
 2024|      0|                    CPLError(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 2025|      0|                             "Unknown configuration option '%s'.", pszKey);
 2026|      0|                }
 2027|      0|            }
 2028|      0|        }
 2029|      0|    }
 2030|     16|}
cpl_conv.cpp:_ZL40NotifyOtherComponentsConfigOptionChangedPKcS0_b:
 1894|     16|{
 1895|       |    // When changing authentication parameters of virtual file systems,
 1896|       |    // partially invalidate cached state about file availability.
 1897|     16|    if (STARTS_WITH_CI(pszKey, "AWS_") || STARTS_WITH_CI(pszKey, "GS_") ||
  ------------------
  |  |  552|     16|#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
  |  |  ------------------
  |  |  |  |  539|     32|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|     16|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (539:25): [True: 0, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (STARTS_WITH_CI(pszKey, "AWS_") || STARTS_WITH_CI(pszKey, "GS_") ||
  ------------------
  |  |  552|     16|#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
  |  |  ------------------
  |  |  |  |  539|     32|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|     16|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (539:25): [True: 0, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1898|     16|        STARTS_WITH_CI(pszKey, "GOOGLE_") ||
  ------------------
  |  |  552|     16|#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
  |  |  ------------------
  |  |  |  |  539|     32|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|     16|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (539:25): [True: 0, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1899|     16|        STARTS_WITH_CI(pszKey, "GDAL_HTTP_HEADER_FILE") ||
  ------------------
  |  |  552|     16|#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
  |  |  ------------------
  |  |  |  |  539|     32|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|     16|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (539:25): [True: 0, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1900|     16|        STARTS_WITH_CI(pszKey, "AZURE_") ||
  ------------------
  |  |  552|     16|#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
  |  |  ------------------
  |  |  |  |  539|     32|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|     16|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (539:25): [True: 0, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1901|     16|        (STARTS_WITH_CI(pszKey, "SWIFT_") && !EQUAL(pszKey, "SWIFT_MAX_KEYS")))
  ------------------
  |  |  552|     16|#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
  |  |  ------------------
  |  |  |  |  539|     32|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|     16|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (539:25): [True: 0, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (STARTS_WITH_CI(pszKey, "SWIFT_") && !EQUAL(pszKey, "SWIFT_MAX_KEYS")))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  ------------------
  |  Branch (1901:46): [True: 0, False: 0]
  ------------------
 1902|      0|    {
 1903|      0|        VSICurlAuthParametersChanged();
 1904|      0|    }
 1905|       |
 1906|     16|    if (!gSetConfigOptionSubscribers.empty())
  ------------------
  |  Branch (1906:9): [True: 0, False: 16]
  ------------------
 1907|      0|    {
 1908|      0|        for (const auto &iter : gSetConfigOptionSubscribers)
  ------------------
  |  Branch (1908:31): [True: 0, False: 0]
  ------------------
 1909|      0|        {
 1910|      0|            if (iter.first)
  ------------------
  |  Branch (1910:17): [True: 0, False: 0]
  ------------------
 1911|      0|                iter.first(pszKey, pszValue, bThreadLocal, iter.second);
 1912|      0|        }
 1913|      0|    }
 1914|     16|}

_ZN3cpl9down_castIP13OGRLineString11OGRGeometryEET_PT0_:
  483|  4.21k|    {
  484|  4.21k|        static_assert(
  485|  4.21k|            (std::is_base_of<From,
  486|  4.21k|                             typename std::remove_pointer<To>::type>::value),
  487|  4.21k|            "target type not derived from source type");
  488|  4.21k|        CPLAssert(f == nullptr || dynamic_cast<To>(f) != nullptr);
  ------------------
  |  |  331|  4.21k|    do                                                                         \
  |  |  332|  4.21k|    {                                                                          \
  |  |  333|  4.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|  4.21k|        return static_cast<To>(f);
  490|  4.21k|    }
_ZN3cpl9down_castIP10CADPoint3D11CADGeometryEET_PT0_:
  483|     32|    {
  484|     32|        static_assert(
  485|     32|            (std::is_base_of<From,
  486|     32|                             typename std::remove_pointer<To>::type>::value),
  487|     32|            "target type not derived from source type");
  488|     32|        CPLAssert(f == nullptr || dynamic_cast<To>(f) != nullptr);
  ------------------
  |  |  331|     32|    do                                                                         \
  |  |  332|     32|    {                                                                          \
  |  |  333|     32|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|     32|        return static_cast<To>(f);
  490|     32|    }
_ZN3cpl9down_castIP7CADLine11CADGeometryEET_PT0_:
  483|     31|    {
  484|     31|        static_assert(
  485|     31|            (std::is_base_of<From,
  486|     31|                             typename std::remove_pointer<To>::type>::value),
  487|     31|            "target type not derived from source type");
  488|     31|        CPLAssert(f == nullptr || dynamic_cast<To>(f) != nullptr);
  ------------------
  |  |  331|     31|    do                                                                         \
  |  |  332|     31|    {                                                                          \
  |  |  333|     31|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|     31|        return static_cast<To>(f);
  490|     31|    }
_ZN3cpl9down_castIP8CADSolid11CADGeometryEET_PT0_:
  483|     29|    {
  484|     29|        static_assert(
  485|     29|            (std::is_base_of<From,
  486|     29|                             typename std::remove_pointer<To>::type>::value),
  487|     29|            "target type not derived from source type");
  488|     29|        CPLAssert(f == nullptr || dynamic_cast<To>(f) != nullptr);
  ------------------
  |  |  331|     29|    do                                                                         \
  |  |  332|     29|    {                                                                          \
  |  |  333|     29|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|     29|        return static_cast<To>(f);
  490|     29|    }
_ZN3cpl9down_castIP9CADCircle11CADGeometryEET_PT0_:
  483|     64|    {
  484|     64|        static_assert(
  485|     64|            (std::is_base_of<From,
  486|     64|                             typename std::remove_pointer<To>::type>::value),
  487|     64|            "target type not derived from source type");
  488|     64|        CPLAssert(f == nullptr || dynamic_cast<To>(f) != nullptr);
  ------------------
  |  |  331|     64|    do                                                                         \
  |  |  332|     64|    {                                                                          \
  |  |  333|     64|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|     64|        return static_cast<To>(f);
  490|     64|    }
_ZN3cpl9down_castIP6CADArc11CADGeometryEET_PT0_:
  483|     83|    {
  484|     83|        static_assert(
  485|     83|            (std::is_base_of<From,
  486|     83|                             typename std::remove_pointer<To>::type>::value),
  487|     83|            "target type not derived from source type");
  488|     83|        CPLAssert(f == nullptr || dynamic_cast<To>(f) != nullptr);
  ------------------
  |  |  331|     83|    do                                                                         \
  |  |  332|     83|    {                                                                          \
  |  |  333|     83|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|     83|        return static_cast<To>(f);
  490|     83|    }
_ZN3cpl9down_castIP9CADFace3D11CADGeometryEET_PT0_:
  483|     51|    {
  484|     51|        static_assert(
  485|     51|            (std::is_base_of<From,
  486|     51|                             typename std::remove_pointer<To>::type>::value),
  487|     51|            "target type not derived from source type");
  488|     51|        CPLAssert(f == nullptr || dynamic_cast<To>(f) != nullptr);
  ------------------
  |  |  331|     51|    do                                                                         \
  |  |  332|     51|    {                                                                          \
  |  |  333|     51|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|     51|        return static_cast<To>(f);
  490|     51|    }
_ZN3cpl9down_castIP13CADLWPolyline11CADGeometryEET_PT0_:
  483|    138|    {
  484|    138|        static_assert(
  485|    138|            (std::is_base_of<From,
  486|    138|                             typename std::remove_pointer<To>::type>::value),
  487|    138|            "target type not derived from source type");
  488|    138|        CPLAssert(f == nullptr || dynamic_cast<To>(f) != nullptr);
  ------------------
  |  |  331|    138|    do                                                                         \
  |  |  332|    138|    {                                                                          \
  |  |  333|    138|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|    138|        return static_cast<To>(f);
  490|    138|    }
_ZN3cpl9down_castIP13CADPolyline3D11CADGeometryEET_PT0_:
  483|    119|    {
  484|    119|        static_assert(
  485|    119|            (std::is_base_of<From,
  486|    119|                             typename std::remove_pointer<To>::type>::value),
  487|    119|            "target type not derived from source type");
  488|    119|        CPLAssert(f == nullptr || dynamic_cast<To>(f) != nullptr);
  ------------------
  |  |  331|    119|    do                                                                         \
  |  |  332|    119|    {                                                                          \
  |  |  333|    119|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|    119|        return static_cast<To>(f);
  490|    119|    }
_ZN3cpl9down_castIP7CADText11CADGeometryEET_PT0_:
  483|    191|    {
  484|    191|        static_assert(
  485|    191|            (std::is_base_of<From,
  486|    191|                             typename std::remove_pointer<To>::type>::value),
  487|    191|            "target type not derived from source type");
  488|    191|        CPLAssert(f == nullptr || dynamic_cast<To>(f) != nullptr);
  ------------------
  |  |  331|    191|    do                                                                         \
  |  |  332|    191|    {                                                                          \
  |  |  333|    191|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|    191|        return static_cast<To>(f);
  490|    191|    }
_ZN3cpl9down_castIP8CADMText11CADGeometryEET_PT0_:
  483|     59|    {
  484|     59|        static_assert(
  485|     59|            (std::is_base_of<From,
  486|     59|                             typename std::remove_pointer<To>::type>::value),
  487|     59|            "target type not derived from source type");
  488|     59|        CPLAssert(f == nullptr || dynamic_cast<To>(f) != nullptr);
  ------------------
  |  |  331|     59|    do                                                                         \
  |  |  332|     59|    {                                                                          \
  |  |  333|     59|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|     59|        return static_cast<To>(f);
  490|     59|    }
_ZN3cpl9down_castIP9CADSpline11CADGeometryEET_PT0_:
  483|    122|    {
  484|    122|        static_assert(
  485|    122|            (std::is_base_of<From,
  486|    122|                             typename std::remove_pointer<To>::type>::value),
  487|    122|            "target type not derived from source type");
  488|    122|        CPLAssert(f == nullptr || dynamic_cast<To>(f) != nullptr);
  ------------------
  |  |  331|    122|    do                                                                         \
  |  |  332|    122|    {                                                                          \
  |  |  333|    122|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|    122|        return static_cast<To>(f);
  490|    122|    }
_ZN3cpl9down_castIP10CADEllipse11CADGeometryEET_PT0_:
  483|     80|    {
  484|     80|        static_assert(
  485|     80|            (std::is_base_of<From,
  486|     80|                             typename std::remove_pointer<To>::type>::value),
  487|     80|            "target type not derived from source type");
  488|     80|        CPLAssert(f == nullptr || dynamic_cast<To>(f) != nullptr);
  ------------------
  |  |  331|     80|    do                                                                         \
  |  |  332|     80|    {                                                                          \
  |  |  333|     80|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|     80|        return static_cast<To>(f);
  490|     80|    }
_ZN3cpl9down_castIP9CADAttdef11CADGeometryEET_PT0_:
  483|    309|    {
  484|    309|        static_assert(
  485|    309|            (std::is_base_of<From,
  486|    309|                             typename std::remove_pointer<To>::type>::value),
  487|    309|            "target type not derived from source type");
  488|    309|        CPLAssert(f == nullptr || dynamic_cast<To>(f) != nullptr);
  ------------------
  |  |  331|    309|    do                                                                         \
  |  |  332|    309|    {                                                                          \
  |  |  333|    309|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|    309|        return static_cast<To>(f);
  490|    309|    }

cpl_cpu_features.cpp:_ZL29CPLHaveRuntimeSSSE3Initializev:
   93|      2|{
   94|      2|    bCPLHasSSSE3 = CPLDetectSSSE3();
   95|      2|}
cpl_cpu_features.cpp:_ZL27CPLHaveRuntimeAVXInitializev:
  152|      2|{
  153|      2|    bCPLHasAVX = CPLDetectRuntimeAVX();
  154|      2|}
cpl_cpu_features.cpp:_ZL14CPLDetectSSSE3v:
   82|      2|{
   83|      2|    int cpuinfo[4] = {0, 0, 0, 0};
   84|      2|    CPL_CPUID(1, cpuinfo);
  ------------------
  |  |   51|      2|    GCC_CPUID(level, array[0], array[1], array[2], array[3])
  |  |  ------------------
  |  |  |  |   36|      2|    __asm__("xchgq %%rbx, %q1\n"                                               \
  |  |  |  |   37|      2|            "cpuid\n"                                                          \
  |  |  |  |   38|      2|            "xchgq %%rbx, %q1"                                                 \
  |  |  |  |   39|      2|            : "=a"(a), "=r"(b), "=c"(c), "=d"(d)                               \
  |  |  |  |   40|      2|            : "0"(level))
  |  |  ------------------
  ------------------
   85|      2|    return (cpuinfo[REG_ECX] & (1 << CPUID_SSSE3_ECX_BIT)) != 0;
  ------------------
  |  |   30|      2|#define REG_ECX 2
  ------------------
                  return (cpuinfo[REG_ECX] & (1 << CPUID_SSSE3_ECX_BIT)) != 0;
  ------------------
  |  |   19|      2|#define CPUID_SSSE3_ECX_BIT 9
  ------------------
   86|      2|}
cpl_cpu_features.cpp:_ZL19CPLDetectRuntimeAVXv:
  118|      2|{
  119|      2|    int cpuinfo[4] = {0, 0, 0, 0};
  120|      2|    CPL_CPUID(1, cpuinfo);
  ------------------
  |  |   51|      2|    GCC_CPUID(level, array[0], array[1], array[2], array[3])
  |  |  ------------------
  |  |  |  |   36|      2|    __asm__("xchgq %%rbx, %q1\n"                                               \
  |  |  |  |   37|      2|            "cpuid\n"                                                          \
  |  |  |  |   38|      2|            "xchgq %%rbx, %q1"                                                 \
  |  |  |  |   39|      2|            : "=a"(a), "=r"(b), "=c"(c), "=d"(d)                               \
  |  |  |  |   40|      2|            : "0"(level))
  |  |  ------------------
  ------------------
  121|       |
  122|       |    // Check OSXSAVE feature.
  123|      2|    if ((cpuinfo[REG_ECX] & (1 << CPUID_OSXSAVE_ECX_BIT)) == 0)
  ------------------
  |  |   30|      2|#define REG_ECX 2
  ------------------
                  if ((cpuinfo[REG_ECX] & (1 << CPUID_OSXSAVE_ECX_BIT)) == 0)
  ------------------
  |  |   20|      2|#define CPUID_OSXSAVE_ECX_BIT 27
  ------------------
  |  Branch (123:9): [True: 0, False: 2]
  ------------------
  124|      0|    {
  125|      0|        return false;
  126|      0|    }
  127|       |
  128|       |    // Check AVX feature.
  129|      2|    if ((cpuinfo[REG_ECX] & (1 << CPUID_AVX_ECX_BIT)) == 0)
  ------------------
  |  |   30|      2|#define REG_ECX 2
  ------------------
                  if ((cpuinfo[REG_ECX] & (1 << CPUID_AVX_ECX_BIT)) == 0)
  ------------------
  |  |   21|      2|#define CPUID_AVX_ECX_BIT 28
  ------------------
  |  Branch (129:9): [True: 0, False: 2]
  ------------------
  130|      0|    {
  131|      0|        return false;
  132|      0|    }
  133|       |
  134|       |    // Issue XGETBV and check the XMM and YMM state bit.
  135|      2|    unsigned int nXCRLow;
  136|      2|    unsigned int nXCRHigh;
  137|      2|    __asm__("xgetbv" : "=a"(nXCRLow), "=d"(nXCRHigh) : "c"(0));
  138|      2|    if ((nXCRLow & (BIT_XMM_STATE | BIT_YMM_STATE)) !=
  ------------------
  |  |   25|      2|#define BIT_XMM_STATE (1 << 1)
  ------------------
                  if ((nXCRLow & (BIT_XMM_STATE | BIT_YMM_STATE)) !=
  ------------------
  |  |   26|      2|#define BIT_YMM_STATE (2 << 1)
  ------------------
  |  Branch (138:9): [True: 0, False: 2]
  ------------------
  139|      2|        (BIT_XMM_STATE | BIT_YMM_STATE))
  ------------------
  |  |   25|      2|#define BIT_XMM_STATE (1 << 1)
  ------------------
                      (BIT_XMM_STATE | BIT_YMM_STATE))
  ------------------
  |  |   26|      2|#define BIT_YMM_STATE (2 << 1)
  ------------------
  140|      0|    {
  141|      0|        return false;
  142|      0|    }
  143|      2|    CPL_IGNORE_RET_VAL(nXCRHigh);  // unused
  144|       |
  145|      2|    return true;
  146|      2|}

CPLError:
  312|  7.49k|{
  313|  7.49k|    va_list args;
  314|       |
  315|       |    // Expand the error message.
  316|  7.49k|    va_start(args, fmt);
  317|  7.49k|    CPLErrorV(eErrClass, err_no, fmt, args);
  318|  7.49k|    va_end(args);
  319|  7.49k|}
CPLErrorV:
  328|  7.49k|{
  329|  7.49k|    CPLErrorContext *psCtx = CPLGetErrorContext();
  330|  7.49k|    if (psCtx == nullptr || IS_PREFEFINED_ERROR_CTX(psCtx))
  ------------------
  |  |   85|  7.49k|    (psCtx == &sNoErrorContext || psCtx == &sWarningContext ||                 \
  |  |  ------------------
  |  |  |  Branch (85:6): [True: 0, False: 7.49k]
  |  |  |  Branch (85:35): [True: 0, False: 7.49k]
  |  |  ------------------
  |  |   86|  7.49k|     psCtxt == &sFailureContext)
  |  |  ------------------
  |  |  |  Branch (86:6): [True: 0, False: 7.49k]
  |  |  ------------------
  ------------------
  |  Branch (330:9): [True: 0, False: 7.49k]
  ------------------
  331|      0|    {
  332|      0|        int bMemoryError = FALSE;
  ------------------
  |  | 1039|      0|#define FALSE 0
  ------------------
  333|      0|        if (eErrClass == CE_Warning)
  ------------------
  |  Branch (333:13): [True: 0, False: 0]
  ------------------
  334|      0|        {
  335|      0|            CPLSetTLSWithFreeFuncEx(
  336|      0|                CTLS_ERRORCONTEXT,
  ------------------
  |  |  204|      0|#define CTLS_ERRORCONTEXT 5             /* cpl_error.cpp */
  ------------------
  337|      0|                reinterpret_cast<void *>(
  338|      0|                    const_cast<CPLErrorContext *>(&sWarningContext)),
  339|      0|                nullptr, &bMemoryError);
  340|      0|        }
  341|      0|        else if (eErrClass == CE_Failure)
  ------------------
  |  Branch (341:18): [True: 0, False: 0]
  ------------------
  342|      0|        {
  343|      0|            CPLSetTLSWithFreeFuncEx(
  344|      0|                CTLS_ERRORCONTEXT,
  ------------------
  |  |  204|      0|#define CTLS_ERRORCONTEXT 5             /* cpl_error.cpp */
  ------------------
  345|      0|                reinterpret_cast<void *>(
  346|      0|                    const_cast<CPLErrorContext *>(&sFailureContext)),
  347|      0|                nullptr, &bMemoryError);
  348|      0|        }
  349|       |
  350|       |        // TODO: Is it possible to move the entire szShortMessage under the if
  351|       |        // pfnErrorHandler?
  352|      0|        char szShortMessage[80] = {};
  353|      0|        CPLvsnprintf(szShortMessage, sizeof(szShortMessage), fmt, args);
  354|       |
  355|      0|        CPLMutexHolderD(&hErrorMutex);
  ------------------
  |  |  122|      0|#define CPLMutexHolderD(x) CPLMutexHolder oHolder(x, 1000.0, __FILE__, __LINE__)
  ------------------
  356|      0|        if (pfnErrorHandler != nullptr)
  ------------------
  |  Branch (356:13): [True: 0, False: 0]
  ------------------
  357|      0|            pfnErrorHandler(eErrClass, err_no, szShortMessage);
  358|      0|        return;
  359|      0|    }
  360|       |
  361|  7.49k|    if (psCtx->nFailureIntoWarning > 0 && eErrClass == CE_Failure)
  ------------------
  |  Branch (361:9): [True: 0, False: 7.49k]
  |  Branch (361:43): [True: 0, False: 0]
  ------------------
  362|      0|        eErrClass = CE_Warning;
  363|       |
  364|       |/* -------------------------------------------------------------------- */
  365|       |/*      Expand the error message                                        */
  366|       |/* -------------------------------------------------------------------- */
  367|  7.49k|#if defined(HAVE_VSNPRINTF)
  368|  7.49k|    {
  369|  7.49k|        va_list wrk_args;
  370|       |
  371|  7.49k|#ifdef va_copy
  372|  7.49k|        va_copy(wrk_args, args);
  373|       |#else
  374|       |        wrk_args = args;
  375|       |#endif
  376|       |
  377|       |        /* --------------------------------------------------------------------
  378|       |         */
  379|       |        /*      If CPL_ACCUM_ERROR_MSG=ON accumulate the error messages, */
  380|       |        /*      rather than just replacing the last error message. */
  381|       |        /* --------------------------------------------------------------------
  382|       |         */
  383|  7.49k|        int nPreviousSize = 0;
  384|  7.49k|        if (psCtx->psHandlerStack != nullptr &&
  ------------------
  |  Branch (384:13): [True: 7.49k, False: 0]
  ------------------
  385|  7.49k|            EQUAL(CPLGetConfigOption("CPL_ACCUM_ERROR_MSG", ""), "ON"))
  ------------------
  |  |  541|  7.49k|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|  7.49k|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 7.49k]
  |  |  ------------------
  ------------------
  386|      0|        {
  387|      0|            nPreviousSize = static_cast<int>(strlen(psCtx->szLastErrMsg));
  388|      0|            if (nPreviousSize)
  ------------------
  |  Branch (388:17): [True: 0, False: 0]
  ------------------
  389|      0|            {
  390|      0|                if (nPreviousSize + 1 + 1 >= psCtx->nLastErrMsgMax)
  ------------------
  |  Branch (390:21): [True: 0, False: 0]
  ------------------
  391|      0|                {
  392|      0|                    psCtx->nLastErrMsgMax *= 3;
  393|      0|                    psCtx = static_cast<CPLErrorContext *>(
  394|      0|                        CPLRealloc(psCtx, sizeof(CPLErrorContext) -
  395|      0|                                              DEFAULT_LAST_ERR_MSG_SIZE +
  396|      0|                                              psCtx->nLastErrMsgMax + 1));
  397|      0|                    CPLSetTLS(CTLS_ERRORCONTEXT, psCtx, TRUE);
  ------------------
  |  |  204|      0|#define CTLS_ERRORCONTEXT 5             /* cpl_error.cpp */
  ------------------
                                  CPLSetTLS(CTLS_ERRORCONTEXT, psCtx, TRUE);
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
  398|      0|                }
  399|      0|                char *pszLastErrMsg = CPLErrorContextGetString(psCtx);
  400|      0|                pszLastErrMsg[nPreviousSize] = '\n';
  401|      0|                pszLastErrMsg[nPreviousSize + 1] = '\0';
  402|      0|                nPreviousSize++;
  403|      0|            }
  404|      0|        }
  405|       |
  406|  7.49k|        int nPR = 0;
  407|  7.49k|        while (((nPR = CPLvsnprintf(psCtx->szLastErrMsg + nPreviousSize,
  ------------------
  |  Branch (407:17): [True: 0, False: 7.49k]
  ------------------
  408|  7.49k|                                    psCtx->nLastErrMsgMax - nPreviousSize, fmt,
  409|  7.49k|                                    wrk_args)) == -1 ||
  410|  7.49k|                nPR >= psCtx->nLastErrMsgMax - nPreviousSize - 1) &&
  ------------------
  |  Branch (410:17): [True: 3, False: 7.49k]
  ------------------
  411|  7.49k|               psCtx->nLastErrMsgMax < 1000000)
  ------------------
  |  Branch (411:16): [True: 3, False: 0]
  ------------------
  412|      3|        {
  413|      3|#ifdef va_copy
  414|      3|            va_end(wrk_args);
  415|      3|            va_copy(wrk_args, args);
  416|       |#else
  417|       |            wrk_args = args;
  418|       |#endif
  419|      3|            psCtx->nLastErrMsgMax *= 3;
  420|      3|            psCtx = static_cast<CPLErrorContext *>(CPLRealloc(
  421|      3|                psCtx, sizeof(CPLErrorContext) - DEFAULT_LAST_ERR_MSG_SIZE +
  422|      3|                           psCtx->nLastErrMsgMax + 1));
  423|      3|            CPLSetTLS(CTLS_ERRORCONTEXT, psCtx, TRUE);
  ------------------
  |  |  204|      3|#define CTLS_ERRORCONTEXT 5             /* cpl_error.cpp */
  ------------------
                          CPLSetTLS(CTLS_ERRORCONTEXT, psCtx, TRUE);
  ------------------
  |  | 1043|      3|#define TRUE 1
  ------------------
  424|      3|        }
  425|       |
  426|  7.49k|        va_end(wrk_args);
  427|  7.49k|    }
  428|       |#else
  429|       |    // !HAVE_VSNPRINTF
  430|       |    CPLvsnprintf(psCtx->szLastErrMsg, psCtx->nLastErrMsgMax, fmt, args);
  431|       |#endif
  432|       |
  433|       |    /* -------------------------------------------------------------------- */
  434|       |    /*      Obfuscate any password in error message                         */
  435|       |    /* -------------------------------------------------------------------- */
  436|  7.49k|    char *pszPassword = strstr(psCtx->szLastErrMsg, "password=");
  437|  7.49k|    if (pszPassword != nullptr)
  ------------------
  |  Branch (437:9): [True: 9, False: 7.48k]
  ------------------
  438|      9|    {
  439|      9|        char *pszIter = pszPassword + strlen("password=");
  440|    240|        while (*pszIter != ' ' && *pszIter != '\0')
  ------------------
  |  Branch (440:16): [True: 231, False: 9]
  |  Branch (440:35): [True: 231, False: 0]
  ------------------
  441|    231|        {
  442|    231|            *pszIter = 'X';
  443|    231|            pszIter++;
  444|    231|        }
  445|      9|    }
  446|       |
  447|       |    /* -------------------------------------------------------------------- */
  448|       |    /*      If the user provided an handling function, then                 */
  449|       |    /*      call it, otherwise print the error to stderr and return.        */
  450|       |    /* -------------------------------------------------------------------- */
  451|  7.49k|    psCtx->nLastErrNo = err_no;
  452|  7.49k|    psCtx->eLastErrType = eErrClass;
  453|  7.49k|    if (psCtx->nErrorCounter == ~(0U))
  ------------------
  |  Branch (453:9): [True: 0, False: 7.49k]
  ------------------
  454|      0|        psCtx->nErrorCounter = 0;
  455|  7.49k|    else
  456|  7.49k|        psCtx->nErrorCounter++;
  457|       |
  458|  7.49k|    if (CPLGetConfigOption("CPL_LOG_ERRORS", nullptr) != nullptr)
  ------------------
  |  Branch (458:9): [True: 0, False: 7.49k]
  ------------------
  459|      0|        CPLDebug("CPLError", "%s", psCtx->szLastErrMsg);
  460|       |
  461|       |    /* -------------------------------------------------------------------- */
  462|       |    /*      Invoke the current error handler.                               */
  463|       |    /* -------------------------------------------------------------------- */
  464|  7.49k|    ApplyErrorHandler(psCtx, eErrClass, err_no, psCtx->szLastErrMsg);
  465|       |
  466|  7.49k|    if (eErrClass == CE_Fatal)
  ------------------
  |  Branch (466:9): [True: 0, False: 7.49k]
  ------------------
  467|      0|        abort();
  468|  7.49k|}
CPLDebug:
  737|  3.13k|{
  738|  3.13k|    va_list args;
  739|  3.13k|    va_start(args, pszFormat);
  740|  3.13k|    CPLvDebug(pszCategory, pszFormat, args);
  741|  3.13k|    va_end(args);
  742|  3.13k|}
CPLErrorReset:
  810|  14.5k|{
  811|  14.5k|    CPLErrorContext *psCtx = CPLGetErrorContext();
  812|  14.5k|    if (psCtx == nullptr)
  ------------------
  |  Branch (812:9): [True: 0, False: 14.5k]
  ------------------
  813|      0|        return;
  814|  14.5k|    if (IS_PREFEFINED_ERROR_CTX(psCtx))
  ------------------
  |  |   85|  14.5k|    (psCtx == &sNoErrorContext || psCtx == &sWarningContext ||                 \
  |  |  ------------------
  |  |  |  Branch (85:6): [True: 0, False: 14.5k]
  |  |  |  Branch (85:35): [True: 0, False: 14.5k]
  |  |  ------------------
  |  |   86|  14.5k|     psCtxt == &sFailureContext)
  |  |  ------------------
  |  |  |  Branch (86:6): [True: 0, False: 14.5k]
  |  |  ------------------
  ------------------
  815|      0|    {
  816|      0|        int bMemoryError = FALSE;
  ------------------
  |  | 1039|      0|#define FALSE 0
  ------------------
  817|      0|        CPLSetTLSWithFreeFuncEx(
  818|      0|            CTLS_ERRORCONTEXT,
  ------------------
  |  |  204|      0|#define CTLS_ERRORCONTEXT 5             /* cpl_error.cpp */
  ------------------
  819|      0|            reinterpret_cast<void *>(
  820|      0|                const_cast<CPLErrorContext *>(&sNoErrorContext)),
  821|      0|            nullptr, &bMemoryError);
  822|      0|        return;
  823|      0|    }
  824|       |
  825|  14.5k|    psCtx->nLastErrNo = CPLE_None;
  ------------------
  |  |   83|  14.5k|#define CPLE_None 0
  ------------------
  826|  14.5k|    psCtx->szLastErrMsg[0] = '\0';
  827|  14.5k|    psCtx->eLastErrType = CE_None;
  828|  14.5k|    psCtx->nErrorCounter = 0;
  829|  14.5k|}
CPLQuietErrorHandler:
 1109|  7.49k|{
 1110|  7.49k|    if (eErrClass == CE_Debug)
  ------------------
  |  Branch (1110:9): [True: 0, False: 7.49k]
  ------------------
 1111|      0|        CPLDefaultErrorHandler(eErrClass, nError, pszErrorMsg);
 1112|  7.49k|}
CPLPushErrorHandler:
 1336|  7.31k|{
 1337|  7.31k|    CPLPushErrorHandlerEx(pfnErrorHandlerNew, nullptr);
 1338|  7.31k|}
CPLPushErrorHandlerEx:
 1360|  7.31k|{
 1361|  7.31k|    CPLErrorContext *psCtx = CPLGetErrorContext();
 1362|       |
 1363|  7.31k|    if (psCtx == nullptr || IS_PREFEFINED_ERROR_CTX(psCtx))
  ------------------
  |  |   85|  7.31k|    (psCtx == &sNoErrorContext || psCtx == &sWarningContext ||                 \
  |  |  ------------------
  |  |  |  Branch (85:6): [True: 0, False: 7.31k]
  |  |  |  Branch (85:35): [True: 0, False: 7.31k]
  |  |  ------------------
  |  |   86|  7.31k|     psCtxt == &sFailureContext)
  |  |  ------------------
  |  |  |  Branch (86:6): [True: 0, False: 7.31k]
  |  |  ------------------
  ------------------
  |  Branch (1363:9): [True: 0, False: 7.31k]
  ------------------
 1364|      0|    {
 1365|      0|        fprintf(stderr, "CPLPushErrorHandlerEx() failed.\n");
 1366|      0|        return;
 1367|      0|    }
 1368|       |
 1369|  7.31k|    CPLErrorHandlerNode *psNode = static_cast<CPLErrorHandlerNode *>(
 1370|  7.31k|        CPLMalloc(sizeof(CPLErrorHandlerNode)));
 1371|  7.31k|    psNode->psNext = psCtx->psHandlerStack;
 1372|  7.31k|    psNode->pfnHandler = pfnErrorHandlerNew;
 1373|  7.31k|    psNode->pUserData = pUserData;
 1374|  7.31k|    psNode->bCatchDebug = true;
 1375|  7.31k|    psCtx->psHandlerStack = psNode;
 1376|  7.31k|}
CPLPopErrorHandler:
 1393|  7.31k|{
 1394|  7.31k|    CPLErrorContext *psCtx = CPLGetErrorContext();
 1395|       |
 1396|  7.31k|    if (psCtx == nullptr || IS_PREFEFINED_ERROR_CTX(psCtx))
  ------------------
  |  |   85|  7.31k|    (psCtx == &sNoErrorContext || psCtx == &sWarningContext ||                 \
  |  |  ------------------
  |  |  |  Branch (85:6): [True: 0, False: 7.31k]
  |  |  |  Branch (85:35): [True: 0, False: 7.31k]
  |  |  ------------------
  |  |   86|  7.31k|     psCtxt == &sFailureContext)
  |  |  ------------------
  |  |  |  Branch (86:6): [True: 0, False: 7.31k]
  |  |  ------------------
  ------------------
  |  Branch (1396:9): [True: 0, False: 7.31k]
  ------------------
 1397|      0|    {
 1398|      0|        fprintf(stderr, "CPLPopErrorHandler() failed.\n");
 1399|      0|        return;
 1400|      0|    }
 1401|       |
 1402|  7.31k|    if (psCtx->psHandlerStack != nullptr)
  ------------------
  |  Branch (1402:9): [True: 7.31k, False: 0]
  ------------------
 1403|  7.31k|    {
 1404|  7.31k|        CPLErrorHandlerNode *psNode = psCtx->psHandlerStack;
 1405|       |
 1406|  7.31k|        psCtx->psHandlerStack = psNode->psNext;
 1407|  7.31k|        VSIFree(psNode);
 1408|  7.31k|    }
 1409|  7.31k|}
cpl_error.cpp:_ZL18CPLGetErrorContextv:
  106|  39.8k|{
  107|  39.8k|    int bError = FALSE;
  ------------------
  |  | 1039|  39.8k|#define FALSE 0
  ------------------
  108|  39.8k|    CPLErrorContext *psCtx = reinterpret_cast<CPLErrorContext *>(
  109|  39.8k|        CPLGetTLSEx(CTLS_ERRORCONTEXT, &bError));
  ------------------
  |  |  204|  39.8k|#define CTLS_ERRORCONTEXT 5             /* cpl_error.cpp */
  ------------------
  110|  39.8k|    if (bError)
  ------------------
  |  Branch (110:9): [True: 0, False: 39.8k]
  ------------------
  111|      0|        return nullptr;
  112|       |
  113|  39.8k|    if (psCtx == nullptr)
  ------------------
  |  Branch (113:9): [True: 1, False: 39.8k]
  ------------------
  114|      1|    {
  115|      1|        psCtx = static_cast<CPLErrorContext *>(
  116|      1|            VSICalloc(sizeof(CPLErrorContext), 1));
  117|      1|        if (psCtx == nullptr)
  ------------------
  |  Branch (117:13): [True: 0, False: 1]
  ------------------
  118|      0|        {
  119|      0|            fprintf(stderr, "Out of memory attempting to report error.\n");
  120|      0|            return nullptr;
  121|      0|        }
  122|      1|        psCtx->eLastErrType = CE_None;
  123|      1|        psCtx->nLastErrMsgMax = sizeof(psCtx->szLastErrMsg);
  124|      1|        CPLSetTLS(CTLS_ERRORCONTEXT, psCtx, TRUE);
  ------------------
  |  |  204|      1|#define CTLS_ERRORCONTEXT 5             /* cpl_error.cpp */
  ------------------
                      CPLSetTLS(CTLS_ERRORCONTEXT, psCtx, TRUE);
  ------------------
  |  | 1043|      1|#define TRUE 1
  ------------------
  125|      1|    }
  126|       |
  127|  39.8k|    return psCtx;
  128|  39.8k|}
cpl_error.cpp:_ZL17ApplyErrorHandlerP15CPLErrorContext6CPLErriPKc:
  206|  7.49k|{
  207|  7.49k|    bool bProcessed = false;
  208|       |
  209|  7.49k|    if (psCtx->psHandlerStack != nullptr)
  ------------------
  |  Branch (209:9): [True: 7.49k, False: 0]
  ------------------
  210|  7.49k|    {
  211|       |        // iterate through the threadlocal handler stack
  212|  7.49k|        if ((eErrClass != CE_Debug) || psCtx->psHandlerStack->bCatchDebug)
  ------------------
  |  Branch (212:13): [True: 7.49k, False: 0]
  |  Branch (212:40): [True: 0, False: 0]
  ------------------
  213|  7.49k|        {
  214|       |            // call the error handler
  215|  7.49k|            CPLErrorHandlerNode *psNewCurNode = psCtx->psHandlerStack;
  216|  7.49k|            psCtx->psHandlerStack->pfnHandler(eErrClass, err_no, pszMessage);
  217|  7.49k|            if (psNewCurNode != psCtx->psHandlerStack)
  ------------------
  |  Branch (217:17): [True: 0, False: 7.49k]
  ------------------
  218|      0|            {
  219|      0|                fprintf(stderr, "ApplyErrorHandler() has detected that a "
  220|      0|                                "previous error handler messed up with the "
  221|      0|                                "error stack. Chaos guaranteed!\n");
  222|      0|            }
  223|  7.49k|            bProcessed = true;
  224|  7.49k|        }
  225|      0|        else
  226|      0|        {
  227|       |            // need to iterate to a parent handler for debug messages
  228|      0|            CPLErrorHandlerNode *psNode = psCtx->psHandlerStack->psNext;
  229|      0|            while (psNode != nullptr)
  ------------------
  |  Branch (229:20): [True: 0, False: 0]
  ------------------
  230|      0|            {
  231|      0|                if (psNode->bCatchDebug)
  ------------------
  |  Branch (231:21): [True: 0, False: 0]
  ------------------
  232|      0|                {
  233|      0|                    CPLErrorHandlerNode *psBackupCurNode =
  234|      0|                        psCtx->psHandlerStack;
  235|      0|                    psCtx->psHandlerStack = psNode;
  236|      0|                    CPLErrorHandlerNode *psNewCurNode = psCtx->psHandlerStack;
  237|      0|                    psNode->pfnHandler(eErrClass, err_no, pszMessage);
  238|       |                    // cppcheck-suppress knownConditionTrueFalse
  239|      0|                    if (psNewCurNode != psCtx->psHandlerStack)
  ------------------
  |  Branch (239:25): [True: 0, False: 0]
  ------------------
  240|      0|                    {
  241|      0|                        fprintf(stderr,
  242|      0|                                "ApplyErrorHandler() has detected that a "
  243|      0|                                "previous error handler messed up with the "
  244|      0|                                "error stack. Chaos guaranteed!\n");
  245|      0|                    }
  246|      0|                    psCtx->psHandlerStack = psBackupCurNode;
  247|      0|                    bProcessed = true;
  248|      0|                    break;
  249|      0|                }
  250|      0|                psNode = psNode->psNext;
  251|      0|            }
  252|      0|        }
  253|  7.49k|    }
  254|       |
  255|  7.49k|    if (!bProcessed)
  ------------------
  |  Branch (255:9): [True: 0, False: 7.49k]
  ------------------
  256|      0|    {
  257|       |        // hit the global error handler
  258|      0|        CPLMutexHolderD(&hErrorMutex);
  ------------------
  |  |  122|      0|#define CPLMutexHolderD(x) CPLMutexHolder oHolder(x, 1000.0, __FILE__, __LINE__)
  ------------------
  259|      0|        if ((eErrClass != CE_Debug) || gbCatchDebug)
  ------------------
  |  Branch (259:13): [True: 0, False: 0]
  |  Branch (259:40): [True: 0, False: 0]
  ------------------
  260|      0|        {
  261|      0|            if (pfnErrorHandler != nullptr)
  ------------------
  |  Branch (261:17): [True: 0, False: 0]
  ------------------
  262|      0|            {
  263|      0|                pfnErrorHandler(eErrClass, err_no, pszMessage);
  264|      0|            }
  265|      0|        }
  266|      0|        else /* if( eErrClass == CE_Debug ) */
  267|      0|        {
  268|       |            // for CPLDebug messages we propagate to the default error handler
  269|      0|            CPLDefaultErrorHandler(eErrClass, err_no, pszMessage);
  270|      0|        }
  271|      0|    }
  272|  7.49k|}
cpl_error.cpp:_ZL9CPLvDebugPKcS0_P13__va_list_tag:
  584|  3.13k|{
  585|  3.13k|    CPLErrorContext *psCtx = CPLGetErrorContext();
  586|  3.13k|    if (psCtx == nullptr || IS_PREFEFINED_ERROR_CTX(psCtx))
  ------------------
  |  |   85|  3.13k|    (psCtx == &sNoErrorContext || psCtx == &sWarningContext ||                 \
  |  |  ------------------
  |  |  |  Branch (85:6): [True: 0, False: 3.13k]
  |  |  |  Branch (85:35): [True: 0, False: 3.13k]
  |  |  ------------------
  |  |   86|  3.13k|     psCtxt == &sFailureContext)
  |  |  ------------------
  |  |  |  Branch (86:6): [True: 0, False: 3.13k]
  |  |  ------------------
  ------------------
  |  Branch (586:9): [True: 0, False: 3.13k]
  ------------------
  587|      0|        return;
  588|  3.13k|    const char *pszDebug = CPLGetConfigOption("CPL_DEBUG", nullptr);
  589|       |
  590|       |    /* -------------------------------------------------------------------- */
  591|       |    /*      Does this message pass our current criteria?                    */
  592|       |    /* -------------------------------------------------------------------- */
  593|  3.13k|    if (pszDebug == nullptr || EQUAL(pszDebug, "NO") ||
  ------------------
  |  |  541|  3.13k|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (593:9): [True: 3.13k, False: 0]
  ------------------
  594|  3.13k|        EQUAL(pszDebug, "OFF") || EQUAL(pszDebug, "FALSE") ||
  ------------------
  |  |  541|  3.13k|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                      EQUAL(pszDebug, "OFF") || EQUAL(pszDebug, "FALSE") ||
  ------------------
  |  |  541|  3.13k|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  595|  3.13k|        EQUAL(pszDebug, "0"))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  596|  3.13k|    {
  597|  3.13k|        return;
  598|  3.13k|    }
  599|       |
  600|      0|    if (!EQUAL(pszDebug, "ON") && !EQUAL(pszDebug, "YES") &&
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  ------------------
                  if (!EQUAL(pszDebug, "ON") && !EQUAL(pszDebug, "YES") &&
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  ------------------
  |  Branch (600:9): [True: 0, False: 0]
  |  Branch (600:35): [True: 0, False: 0]
  ------------------
  601|      0|        !EQUAL(pszDebug, "TRUE") && !EQUAL(pszDebug, "1") &&
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  ------------------
                      !EQUAL(pszDebug, "TRUE") && !EQUAL(pszDebug, "1") &&
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  ------------------
  |  Branch (601:9): [True: 0, False: 0]
  |  Branch (601:37): [True: 0, False: 0]
  ------------------
  602|      0|        !EQUAL(pszDebug, ""))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  ------------------
  |  Branch (602:9): [True: 0, False: 0]
  ------------------
  603|      0|    {
  604|       |        // check if value of CPL_DEBUG contains the category
  605|      0|        const size_t nLen = strlen(pszCategory);
  606|       |
  607|      0|        size_t i = 0;
  608|      0|        for (i = 0; pszDebug[i] != '\0'; i++)
  ------------------
  |  Branch (608:21): [True: 0, False: 0]
  ------------------
  609|      0|        {
  610|      0|            if (EQUALN(pszCategory, pszDebug + i, nLen))
  ------------------
  |  |  539|      0|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  ------------------
  |  |  |  |  536|      0|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  ------------------
  |  |  |  Branch (539:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  611|      0|                break;
  612|      0|        }
  613|       |
  614|      0|        if (pszDebug[i] == '\0')
  ------------------
  |  Branch (614:13): [True: 0, False: 0]
  ------------------
  615|      0|            return;
  616|      0|    }
  617|       |
  618|       |    /* -------------------------------------------------------------------- */
  619|       |    /*    Allocate a block for the error.                                   */
  620|       |    /* -------------------------------------------------------------------- */
  621|      0|    const int ERROR_MAX = 25000;
  622|      0|    char *pszMessage = static_cast<char *>(VSIMalloc(ERROR_MAX));
  623|      0|    if (pszMessage == nullptr)
  ------------------
  |  Branch (623:9): [True: 0, False: 0]
  ------------------
  624|      0|        return;
  625|       |
  626|       |    /* -------------------------------------------------------------------- */
  627|       |    /*      Dal -- always log a timestamp as the first part of the line     */
  628|       |    /*      to ensure one is looking at what one should be looking at!      */
  629|       |    /* -------------------------------------------------------------------- */
  630|       |
  631|      0|    pszMessage[0] = '\0';
  632|      0|#ifdef TIMESTAMP_DEBUG
  633|      0|    if (CPLTestBool(CPLGetConfigOption("CPL_TIMESTAMP", "NO")))
  ------------------
  |  Branch (633:9): [True: 0, False: 0]
  ------------------
  634|      0|    {
  635|      0|        static struct CPLTimeVal tvStart;
  636|      0|        static const auto unused = CPLGettimeofday(&tvStart, nullptr);
  ------------------
  |  |  573|      0|#define CPLGettimeofday(t, u) gettimeofday(t, u)
  ------------------
  637|      0|        CPL_IGNORE_RET_VAL(unused);
  638|      0|        struct CPLTimeVal tv;
  639|      0|        CPLGettimeofday(&tv, nullptr);
  ------------------
  |  |  573|      0|#define CPLGettimeofday(t, u) gettimeofday(t, u)
  ------------------
  640|      0|        strcpy(pszMessage, "[");
  641|      0|        strcat(pszMessage, VSICTime(static_cast<unsigned long>(tv.tv_sec)));
  642|       |
  643|       |        // On windows anyway, ctime puts a \n at the end, but I'm not
  644|       |        // convinced this is standard behavior, so we'll get rid of it
  645|       |        // carefully
  646|       |
  647|      0|        if (pszMessage[strlen(pszMessage) - 1] == '\n')
  ------------------
  |  Branch (647:13): [True: 0, False: 0]
  ------------------
  648|      0|        {
  649|      0|            pszMessage[strlen(pszMessage) - 1] = 0;  // blow it out
  650|      0|        }
  651|      0|        CPLsnprintf(pszMessage + strlen(pszMessage),
  652|      0|                    ERROR_MAX - strlen(pszMessage),
  653|      0|                    "].%04d, %03.04f: ", static_cast<int>(tv.tv_usec / 100),
  654|      0|                    tv.tv_sec + tv.tv_usec * 1e-6 -
  655|      0|                        (tvStart.tv_sec + tvStart.tv_usec * 1e-6));
  656|      0|    }
  657|      0|#endif
  658|       |
  659|       |/* -------------------------------------------------------------------- */
  660|       |/*      Add the process memory size.                                    */
  661|       |/* -------------------------------------------------------------------- */
  662|       |#ifdef MEMORY_DEBUG
  663|       |    char szVmSize[32] = {};
  664|       |    CPLsprintf(szVmSize, "[VmSize: %d] ", CPLGetProcessMemorySize());
  665|       |    strcat(pszMessage, szVmSize);
  666|       |#endif
  667|       |
  668|       |    /* -------------------------------------------------------------------- */
  669|       |    /*      Add the category.                                               */
  670|       |    /* -------------------------------------------------------------------- */
  671|      0|    strcat(pszMessage, pszCategory);
  672|      0|    strcat(pszMessage, ": ");
  673|       |
  674|       |    /* -------------------------------------------------------------------- */
  675|       |    /*      Format the application provided portion of the debug message.   */
  676|       |    /* -------------------------------------------------------------------- */
  677|      0|    CPLvsnprintf(pszMessage + strlen(pszMessage),
  678|      0|                 ERROR_MAX - strlen(pszMessage), pszFormat, args);
  679|       |
  680|       |    /* -------------------------------------------------------------------- */
  681|       |    /*      Obfuscate any password in error message                         */
  682|       |    /* -------------------------------------------------------------------- */
  683|       |
  684|      0|    char *pszPassword = strstr(pszMessage, "password=");
  685|      0|    if (pszPassword != nullptr)
  ------------------
  |  Branch (685:9): [True: 0, False: 0]
  ------------------
  686|      0|    {
  687|      0|        char *pszIter = pszPassword + strlen("password=");
  688|      0|        while (*pszIter != ' ' && *pszIter != '\0')
  ------------------
  |  Branch (688:16): [True: 0, False: 0]
  |  Branch (688:35): [True: 0, False: 0]
  ------------------
  689|      0|        {
  690|      0|            *pszIter = 'X';
  691|      0|            pszIter++;
  692|      0|        }
  693|      0|    }
  694|       |
  695|       |    /* -------------------------------------------------------------------- */
  696|       |    /*      Invoke the current error handler.                               */
  697|       |    /* -------------------------------------------------------------------- */
  698|      0|    ApplyErrorHandler(psCtx, CE_Debug, CPLE_None, pszMessage);
  ------------------
  |  |   83|      0|#define CPLE_None 0
  ------------------
  699|       |
  700|      0|    VSIFree(pszMessage);
  701|      0|}

CPLHTTPSetDefaultUserAgent:
  487|      2|{
  488|      2|    gosDefaultUserAgent = pszUserAgent ? pszUserAgent : "";
  ------------------
  |  Branch (488:27): [True: 2, False: 0]
  ------------------
  489|      2|}

_ZN5lru118NullLock4lockEv:
   52|      2|    {
   53|      2|    }
_ZN5lru118NullLock6unlockEv:
   56|      2|    {
   57|      2|    }
_ZN5lru115CacheINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS_8NullLockENS1_13unordered_mapIS7_NS1_15__list_iteratorINS_12KeyValuePairIS7_bEEPvEENS1_4hashIS7_EENS1_8equal_toIS7_EENS5_INS1_4pairIKS7_SE_EEEEEEEC2Emm:
  137|     28|        : maxSize_(maxSize), elasticity_(elasticity)
  138|     28|    {
  139|     28|    }
_ZN5lru115CacheINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEN3cpl13CachedDirListENS_8NullLockENS1_13unordered_mapIS7_NS1_15__list_iteratorINS_12KeyValuePairIS7_S9_EEPvEENS1_4hashIS7_EENS1_8equal_toIS7_EENS5_INS1_4pairIKS7_SG_EEEEEEEC2Emm:
  137|     16|        : maxSize_(maxSize), elasticity_(elasticity)
  138|     16|    {
  139|     16|    }
_ZN5lru115CacheINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_10unique_ptrI8PJconstsN15OSRProjTLSCache12OSRPJDeleterEEENS_8NullLockENS1_13unordered_mapIS7_NS1_15__list_iteratorINS_12KeyValuePairIS7_SC_EEPvEENS1_4hashIS7_EENS1_8equal_toIS7_EENS5_INS1_4pairIKS7_SJ_EEEEEEED2Ev:
  141|      1|    virtual ~Cache() = default;
_ZN5lru115CacheIN15OSRProjTLSCache12EPSGCacheKeyENSt3__110unique_ptrI8PJconstsNS1_12OSRPJDeleterEEENS_8NullLockENS3_13unordered_mapIS2_NS3_15__list_iteratorINS_12KeyValuePairIS2_S7_EEPvEENS1_18EPSGCacheKeyHasherENS3_8equal_toIS2_EENS3_9allocatorINS3_4pairIKS2_SE_EEEEEEED2Ev:
  141|      1|    virtual ~Cache() = default;
_ZN5lru115CacheIN15OSRProjTLSCache12EPSGCacheKeyENSt3__110unique_ptrI8PJconstsNS1_12OSRPJDeleterEEENS_8NullLockENS3_13unordered_mapIS2_NS3_15__list_iteratorINS_12KeyValuePairIS2_S7_EEPvEENS1_18EPSGCacheKeyHasherENS3_8equal_toIS2_EENS3_9allocatorINS3_4pairIKS2_SE_EEEEEEEC2Emm:
  137|      1|        : maxSize_(maxSize), elasticity_(elasticity)
  138|      1|    {
  139|      1|    }
_ZN5lru115CacheINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_10unique_ptrI8PJconstsN15OSRProjTLSCache12OSRPJDeleterEEENS_8NullLockENS1_13unordered_mapIS7_NS1_15__list_iteratorINS_12KeyValuePairIS7_SC_EEPvEENS1_4hashIS7_EENS1_8equal_toIS7_EENS5_INS1_4pairIKS7_SJ_EEEEEEEC2Emm:
  137|      1|        : maxSize_(maxSize), elasticity_(elasticity)
  138|      1|    {
  139|      1|    }
_ZN5lru115CacheIN15OSRProjTLSCache12EPSGCacheKeyENSt3__110unique_ptrI8PJconstsNS1_12OSRPJDeleterEEENS_8NullLockENS3_13unordered_mapIS2_NS3_15__list_iteratorINS_12KeyValuePairIS2_S7_EEPvEENS1_18EPSGCacheKeyHasherENS3_8equal_toIS2_EENS3_9allocatorINS3_4pairIKS2_SE_EEEEEEE5clearEv:
  156|      1|    {
  157|      1|        Guard g(lock_);
  158|      1|        cache_.clear();
  159|      1|        keys_.clear();
  160|      1|    }
_ZN5lru115CacheINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_10unique_ptrI8PJconstsN15OSRProjTLSCache12OSRPJDeleterEEENS_8NullLockENS1_13unordered_mapIS7_NS1_15__list_iteratorINS_12KeyValuePairIS7_SC_EEPvEENS1_4hashIS7_EENS1_8equal_toIS7_EENS5_INS1_4pairIKS7_SJ_EEEEEEE5clearEv:
  156|      1|    {
  157|      1|        Guard g(lock_);
  158|      1|        cache_.clear();
  159|      1|        keys_.clear();
  160|      1|    }
_ZN5lru115CacheINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_4pairINS1_10shared_ptrI22VRTArrayDatasetWrapperEENS1_13unordered_setIPKvNS1_4hashISE_EENS1_8equal_toISE_EENS5_ISE_EEEEEENS_8NullLockENS1_13unordered_mapIS7_NS1_15__list_iteratorINS_12KeyValuePairIS7_SL_EEPvEENSF_IS7_EENSH_IS7_EENS5_INS8_IKS7_SS_EEEEEEEC2Emm:
  137|      2|        : maxSize_(maxSize), elasticity_(elasticity)
  138|      2|    {
  139|      2|    }

_ZN14CPLMutexHolderC2EPP9_CPLMutexdPKcii:
  156|   158k|    : hMutex(nullptr), pszFile(pszFileIn), nLine(nLineIn)
  157|   158k|{
  158|   158k|    if (phMutex == nullptr)
  ------------------
  |  Branch (158:9): [True: 0, False: 158k]
  ------------------
  159|      0|    {
  160|      0|        fprintf(stderr, "CPLMutexHolder: phMutex )) NULL !\n");
  161|      0|        hMutex = nullptr;
  162|      0|        return;
  163|      0|    }
  164|       |
  165|       |#ifdef DEBUG_MUTEX
  166|       |    // There is no way to use CPLDebug() here because it works with
  167|       |    // mutexes itself so we will fall in infinite recursion.
  168|       |    // fprintf() will do the job right.
  169|       |    fprintf(stderr, "CPLMutexHolder: Request %p for pid %ld at %d/%s.\n",
  170|       |            *phMutex, static_cast<long>(CPLGetPID()), nLine, pszFile);
  171|       |#else
  172|       |    // TODO(schwehr): Find a better way to do handle this.
  173|   158k|    (void)pszFile;
  174|   158k|    (void)nLine;
  175|   158k|#endif
  176|       |
  177|   158k|    if (!CPLCreateOrAcquireMutexEx(phMutex, dfWaitInSeconds, nOptions))
  ------------------
  |  Branch (177:9): [True: 0, False: 158k]
  ------------------
  178|      0|    {
  179|      0|        fprintf(stderr, "CPLMutexHolder: Failed to acquire mutex!\n");
  180|      0|        hMutex = nullptr;
  181|      0|    }
  182|   158k|    else
  183|   158k|    {
  184|       |#ifdef DEBUG_MUTEX
  185|       |        fprintf(stderr, "CPLMutexHolder: Acquired %p for pid %ld at %d/%s.\n",
  186|       |                *phMutex, static_cast<long>(CPLGetPID()), nLine, pszFile);
  187|       |#endif
  188|       |
  189|   158k|        hMutex = *phMutex;
  190|   158k|    }
  191|   158k|}
_ZN14CPLMutexHolderD2Ev:
  235|   158k|{
  236|   158k|    if (hMutex != nullptr)
  ------------------
  |  Branch (236:9): [True: 158k, False: 0]
  ------------------
  237|   158k|    {
  238|       |#ifdef DEBUG_MUTEX
  239|       |        fprintf(stderr, "~CPLMutexHolder: Release %p for pid %ld at %d/%s.\n",
  240|       |                hMutex, static_cast<long>(CPLGetPID()), nLine, pszFile);
  241|       |#endif
  242|   158k|        CPLReleaseMutex(hMutex);
  243|   158k|    }
  244|   158k|}
CPLCreateOrAcquireMutexEx:
 1406|   158k|{
 1407|   158k|    pthread_mutex_lock(&global_mutex);
 1408|   158k|    if (*phMutex == nullptr)
  ------------------
  |  Branch (1408:9): [True: 8, False: 158k]
  ------------------
 1409|      8|    {
 1410|      8|        *phMutex = CPLCreateMutexInternal(true, nOptions);
 1411|      8|        const bool bSuccess = *phMutex != nullptr;
 1412|      8|        pthread_mutex_unlock(&global_mutex);
 1413|      8|        if (!bSuccess)
  ------------------
  |  Branch (1413:13): [True: 0, False: 8]
  ------------------
 1414|      0|            return false;
 1415|      8|    }
 1416|   158k|    else
 1417|   158k|    {
 1418|   158k|        pthread_mutex_unlock(&global_mutex);
 1419|   158k|    }
 1420|       |
 1421|   158k|    return CPL_TO_BOOL(CPLAcquireMutex(*phMutex, dfWaitInSeconds));
 1422|   158k|}
CPLCreateMutex:
 1570|     12|{
 1571|     12|    CPLMutex *mutex = CPLCreateMutexInternal(false, CPL_MUTEX_RECURSIVE);
  ------------------
  |  |   50|     12|#define CPL_MUTEX_RECURSIVE 0
  ------------------
 1572|     12|    if (mutex)
  ------------------
  |  Branch (1572:9): [True: 12, False: 0]
  ------------------
 1573|     12|        CPLAcquireMutex(mutex, 0);
 1574|     12|    return mutex;
 1575|     12|}
CPLAcquireMutex:
 1590|   158k|{
 1591|       |    // TODO: Need to add timeout support.
 1592|   158k|    MutexLinkedElt *psItem = reinterpret_cast<MutexLinkedElt *>(hMutexIn);
 1593|   158k|    const int err = pthread_mutex_lock(&(psItem->sMutex));
 1594|       |
 1595|   158k|    if (err != 0)
  ------------------
  |  Branch (1595:9): [True: 0, False: 158k]
  ------------------
 1596|      0|    {
 1597|      0|        if (err == EDEADLK)
  ------------------
  |  Branch (1597:13): [True: 0, False: 0]
  ------------------
 1598|      0|            fprintf(stderr, "CPLAcquireMutex: Error = %d/EDEADLK\n", err);
 1599|      0|        else
 1600|      0|            fprintf(stderr, "CPLAcquireMutex: Error = %d (%s)\n", err,
 1601|      0|                    strerror(err));
 1602|       |
 1603|      0|        return FALSE;
  ------------------
  |  | 1039|      0|#define FALSE 0
  ------------------
 1604|      0|    }
 1605|       |
 1606|   158k|    return TRUE;
  ------------------
  |  | 1043|   158k|#define TRUE 1
  ------------------
 1607|   158k|}
CPLReleaseMutex:
 1615|   158k|{
 1616|   158k|    MutexLinkedElt *psItem = reinterpret_cast<MutexLinkedElt *>(hMutexIn);
 1617|   158k|    const int err = pthread_mutex_unlock(&(psItem->sMutex));
 1618|   158k|    if (err != 0)
  ------------------
  |  Branch (1618:9): [True: 0, False: 158k]
  ------------------
 1619|      0|    {
 1620|      0|        fprintf(stderr, "CPLReleaseMutex: Error = %d (%s)\n", err,
 1621|      0|                strerror(err));
 1622|      0|    }
 1623|   158k|}
CPLGetPID:
 1838|  6.10k|{
 1839|  6.10k|    return reinterpret_cast<GIntBig>(reinterpret_cast<void *>(pthread_self()));
 1840|  6.10k|}
CPLGetTLS:
 2267|  3.05k|{
 2268|  3.05k|    void **l_papTLSList = CPLGetTLSList(nullptr);
 2269|       |
 2270|  3.05k|    CPLAssert(nIndex >= 0 && nIndex < CTLS_MAX);
  ------------------
  |  |  331|  3.05k|    do                                                                         \
  |  |  332|  3.05k|    {                                                                          \
  |  |  333|  3.05k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2271|       |
 2272|  3.05k|    return l_papTLSList[nIndex];
 2273|  3.05k|}
CPLGetTLSEx:
 2281|  95.6k|{
 2282|  95.6k|    void **l_papTLSList = CPLGetTLSList(pbMemoryErrorOccurred);
 2283|  95.6k|    if (l_papTLSList == nullptr)
  ------------------
  |  Branch (2283:9): [True: 0, False: 95.6k]
  ------------------
 2284|      0|        return nullptr;
 2285|       |
 2286|  95.6k|    CPLAssert(nIndex >= 0 && nIndex < CTLS_MAX);
  ------------------
  |  |  331|  95.6k|    do                                                                         \
  |  |  332|  95.6k|    {                                                                          \
  |  |  333|  95.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2287|       |
 2288|  95.6k|    return l_papTLSList[nIndex];
 2289|  95.6k|}
CPLSetTLS:
 2297|      5|{
 2298|      5|    CPLSetTLSWithFreeFunc(nIndex, pData, (bFreeOnExit) ? CPLFree : nullptr);
  ------------------
  |  |   86|      5|#define CPLFree VSIFree
  ------------------
  |  Branch (2298:42): [True: 5, False: 0]
  ------------------
 2299|      5|}
CPLSetTLSWithFreeFunc:
 2309|      5|{
 2310|      5|    void **l_papTLSList = CPLGetTLSList(nullptr);
 2311|       |
 2312|      5|    CPLAssert(nIndex >= 0 && nIndex < CTLS_MAX);
  ------------------
  |  |  331|      5|    do                                                                         \
  |  |  332|      5|    {                                                                          \
  |  |  333|      5|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2313|       |
 2314|      5|    l_papTLSList[nIndex] = pData;
 2315|      5|    l_papTLSList[CTLS_MAX + nIndex] = reinterpret_cast<void *>(pfnFree);
  ------------------
  |  |  221|      5|#define CTLS_MAX 32
  ------------------
 2316|      5|}
cpl_multiproc.cpp:_ZL22CPLCreateMutexInternalbi:
 1544|     20|{
 1545|     20|    MutexLinkedElt *psItem =
 1546|     20|        static_cast<MutexLinkedElt *>(malloc(sizeof(MutexLinkedElt)));
 1547|     20|    if (psItem == nullptr)
  ------------------
  |  Branch (1547:9): [True: 0, False: 20]
  ------------------
 1548|      0|    {
 1549|      0|        fprintf(stderr, "CPLCreateMutexInternal() failed.\n");
 1550|      0|        return nullptr;
 1551|      0|    }
 1552|       |
 1553|     20|    if (!bAlreadyInGlobalLock)
  ------------------
  |  Branch (1553:9): [True: 12, False: 8]
  ------------------
 1554|     12|        pthread_mutex_lock(&global_mutex);
 1555|     20|    psItem->psPrev = nullptr;
 1556|     20|    psItem->psNext = psMutexList;
 1557|     20|    if (psMutexList)
  ------------------
  |  Branch (1557:9): [True: 18, False: 2]
  ------------------
 1558|     18|        psMutexList->psPrev = psItem;
 1559|     20|    psMutexList = psItem;
 1560|     20|    if (!bAlreadyInGlobalLock)
  ------------------
  |  Branch (1560:9): [True: 12, False: 8]
  ------------------
 1561|     12|        pthread_mutex_unlock(&global_mutex);
 1562|       |
 1563|     20|    psItem->nOptions = nOptions;
 1564|     20|    CPLInitMutex(psItem);
 1565|       |
 1566|     20|    return reinterpret_cast<CPLMutex *>(psItem);
 1567|     20|}
cpl_multiproc.cpp:_ZL12CPLInitMutexP15_MutexLinkedElt:
 1488|     20|{
 1489|     20|    if (psItem->nOptions == CPL_MUTEX_REGULAR)
  ------------------
  |  |   52|     20|#define CPL_MUTEX_REGULAR 2
  ------------------
  |  Branch (1489:9): [True: 0, False: 20]
  ------------------
 1490|      0|    {
 1491|      0|#ifdef HAVE_GCC_WARNING_ZERO_AS_NULL_POINTER_CONSTANT
 1492|      0|#pragma GCC diagnostic push
 1493|      0|#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
 1494|      0|#endif
 1495|      0|        pthread_mutex_t tmp_mutex = PTHREAD_MUTEX_INITIALIZER;
 1496|      0|#ifdef HAVE_GCC_WARNING_ZERO_AS_NULL_POINTER_CONSTANT
 1497|      0|#pragma GCC diagnostic pop
 1498|      0|#endif
 1499|      0|        psItem->sMutex = tmp_mutex;
 1500|      0|        return;
 1501|      0|    }
 1502|       |
 1503|       |    // When an adaptive mutex is required, we can safely fallback to regular
 1504|       |    // mutex if we don't have HAVE_PTHREAD_MUTEX_ADAPTIVE_NP.
 1505|     20|    if (psItem->nOptions == CPL_MUTEX_ADAPTIVE)
  ------------------
  |  |   51|     20|#define CPL_MUTEX_ADAPTIVE 1
  ------------------
  |  Branch (1505:9): [True: 0, False: 20]
  ------------------
 1506|      0|    {
 1507|      0|#if defined(HAVE_PTHREAD_MUTEX_ADAPTIVE_NP)
 1508|      0|        pthread_mutexattr_t attr;
 1509|      0|        pthread_mutexattr_init(&attr);
 1510|      0|        pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP);
 1511|      0|        pthread_mutex_init(&(psItem->sMutex), &attr);
 1512|       |#else
 1513|       |        pthread_mutex_t tmp_mutex = PTHREAD_MUTEX_INITIALIZER;
 1514|       |        psItem->sMutex = tmp_mutex;
 1515|       |#endif
 1516|      0|        return;
 1517|      0|    }
 1518|       |
 1519|     20|#if defined(PTHREAD_MUTEX_RECURSIVE) || defined(HAVE_PTHREAD_MUTEX_RECURSIVE)
 1520|     20|    {
 1521|     20|        pthread_mutexattr_t attr;
 1522|     20|        pthread_mutexattr_init(&attr);
 1523|     20|        pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
 1524|     20|        pthread_mutex_init(&(psItem->sMutex), &attr);
 1525|     20|    }
 1526|       |// BSDs have PTHREAD_MUTEX_RECURSIVE as an enum, not a define.
 1527|       |// But they have #define MUTEX_TYPE_COUNTING_FAST PTHREAD_MUTEX_RECURSIVE
 1528|       |#elif defined(MUTEX_TYPE_COUNTING_FAST)
 1529|       |    {
 1530|       |        pthread_mutexattr_t attr;
 1531|       |        pthread_mutexattr_init(&attr);
 1532|       |        pthread_mutexattr_settype(&attr, MUTEX_TYPE_COUNTING_FAST);
 1533|       |        pthread_mutex_init(&(psItem->sMutex), &attr);
 1534|       |    }
 1535|       |#elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
 1536|       |    pthread_mutex_t tmp_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
 1537|       |    psItem->sMutex = tmp_mutex;
 1538|       |#else
 1539|       |#error "Recursive mutexes apparently unsupported, configure --without-threads"
 1540|       |#endif
 1541|     20|}
cpl_multiproc.cpp:_ZL13CPLGetTLSListPi:
 1865|  98.6k|{
 1866|  98.6k|    if (pbMemoryErrorOccurred)
  ------------------
  |  Branch (1866:9): [True: 95.6k, False: 3.05k]
  ------------------
 1867|  95.6k|        *pbMemoryErrorOccurred = FALSE;
  ------------------
  |  | 1039|  95.6k|#define FALSE 0
  ------------------
 1868|       |
 1869|  98.6k|    if (pthread_once(&oTLSKeySetup, CPLMake_key) != 0)
  ------------------
  |  Branch (1869:9): [True: 0, False: 98.6k]
  ------------------
 1870|      0|    {
 1871|      0|        if (pbMemoryErrorOccurred)
  ------------------
  |  Branch (1871:13): [True: 0, False: 0]
  ------------------
 1872|      0|        {
 1873|      0|            fprintf(stderr, "CPLGetTLSList(): pthread_once() failed!\n");
 1874|      0|            *pbMemoryErrorOccurred = TRUE;
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
 1875|      0|            return nullptr;
 1876|      0|        }
 1877|      0|        CPLEmergencyError("CPLGetTLSList(): pthread_once() failed!");
 1878|      0|    }
 1879|       |
 1880|  98.6k|    void **papTLSList = static_cast<void **>(pthread_getspecific(oTLSKey));
 1881|  98.6k|    if (papTLSList == nullptr)
  ------------------
  |  Branch (1881:9): [True: 2, False: 98.6k]
  ------------------
 1882|      2|    {
 1883|      2|        papTLSList =
 1884|      2|            static_cast<void **>(VSICalloc(sizeof(void *), CTLS_MAX * 2));
  ------------------
  |  |  221|      2|#define CTLS_MAX 32
  ------------------
 1885|      2|        if (papTLSList == nullptr)
  ------------------
  |  Branch (1885:13): [True: 0, False: 2]
  ------------------
 1886|      0|        {
 1887|      0|            if (pbMemoryErrorOccurred)
  ------------------
  |  Branch (1887:17): [True: 0, False: 0]
  ------------------
 1888|      0|            {
 1889|      0|                fprintf(stderr,
 1890|      0|                        "CPLGetTLSList() failed to allocate TLS list!\n");
 1891|      0|                *pbMemoryErrorOccurred = TRUE;
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
 1892|      0|                return nullptr;
 1893|      0|            }
 1894|      0|            CPLEmergencyError("CPLGetTLSList() failed to allocate TLS list!");
 1895|      0|        }
 1896|      2|        if (pthread_setspecific(oTLSKey, papTLSList) != 0)
  ------------------
  |  Branch (1896:13): [True: 0, False: 2]
  ------------------
 1897|      0|        {
 1898|      0|            if (pbMemoryErrorOccurred)
  ------------------
  |  Branch (1898:17): [True: 0, False: 0]
  ------------------
 1899|      0|            {
 1900|      0|                fprintf(stderr,
 1901|      0|                        "CPLGetTLSList(): pthread_setspecific() failed!\n");
 1902|      0|                *pbMemoryErrorOccurred = TRUE;
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
 1903|      0|                return nullptr;
 1904|      0|            }
 1905|      0|            CPLEmergencyError("CPLGetTLSList(): pthread_setspecific() failed!");
 1906|      0|        }
 1907|      2|    }
 1908|       |
 1909|  98.6k|    return papTLSList;
 1910|  98.6k|}
cpl_multiproc.cpp:_ZL11CPLMake_keyv:
 1851|      2|{
 1852|      2|    if (pthread_key_create(&oTLSKey, reinterpret_cast<void (*)(void *)>(
  ------------------
  |  Branch (1852:9): [True: 0, False: 2]
  ------------------
 1853|      2|                                         CPLCleanupTLSList)) != 0)
 1854|      0|    {
 1855|      0|        CPLError(CE_Fatal, CPLE_AppDefined, "pthread_key_create() failed!");
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
 1856|      0|    }
 1857|      2|}

_Z14CPLGetPathSafePKc:
  153|  7.31k|{
  154|  7.31k|    size_t nSuffixPos = 0;
  155|  7.31k|    if (STARTS_WITH(pszFilename, "/vsicurl/http"))
  ------------------
  |  |  550|  7.31k|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 7.31k]
  |  |  ------------------
  ------------------
  156|      0|    {
  157|      0|        const char *pszQuestionMark = strchr(pszFilename, '?');
  158|      0|        if (pszQuestionMark)
  ------------------
  |  Branch (158:13): [True: 0, False: 0]
  ------------------
  159|      0|            nSuffixPos = static_cast<size_t>(pszQuestionMark - pszFilename);
  160|      0|    }
  161|  7.31k|    else if (STARTS_WITH(pszFilename, "/vsicurl?") &&
  ------------------
  |  |  550|  14.6k|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 7.31k]
  |  |  ------------------
  ------------------
  162|  7.31k|             strstr(pszFilename, "url="))
  ------------------
  |  Branch (162:14): [True: 0, False: 0]
  ------------------
  163|      0|    {
  164|      0|        std::string osRet;
  165|      0|        const CPLStringList aosTokens(
  166|      0|            CSLTokenizeString2(pszFilename + strlen("/vsicurl?"), "&", 0));
  167|      0|        for (int i = 0; i < aosTokens.size(); i++)
  ------------------
  |  Branch (167:25): [True: 0, False: 0]
  ------------------
  168|      0|        {
  169|      0|            if (osRet.empty())
  ------------------
  |  Branch (169:17): [True: 0, False: 0]
  ------------------
  170|      0|                osRet = "/vsicurl?";
  171|      0|            else
  172|      0|                osRet += '&';
  173|      0|            if (STARTS_WITH(aosTokens[i], "url=") &&
  ------------------
  |  |  550|      0|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  174|      0|                !STARTS_WITH(aosTokens[i], "url=/vsicurl"))
  ------------------
  |  |  550|      0|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  ------------------
  |  Branch (174:17): [True: 0, False: 0]
  ------------------
  175|      0|            {
  176|      0|                char *pszUnescaped =
  177|      0|                    CPLUnescapeString(aosTokens[i], nullptr, CPLES_URL);
  ------------------
  |  |  142|      0|#define CPLES_URL 2
  ------------------
  178|      0|                char *pszPath = CPLEscapeString(
  179|      0|                    CPLGetPathSafe(pszUnescaped + strlen("url=")).c_str(), -1,
  180|      0|                    CPLES_URL);
  ------------------
  |  |  142|      0|#define CPLES_URL 2
  ------------------
  181|      0|                osRet += "url=";
  182|      0|                osRet += pszPath;
  183|      0|                CPLFree(pszPath);
  ------------------
  |  |   86|      0|#define CPLFree VSIFree
  ------------------
  184|      0|                CPLFree(pszUnescaped);
  ------------------
  |  |   86|      0|#define CPLFree VSIFree
  ------------------
  185|      0|            }
  186|      0|            else
  187|      0|            {
  188|      0|                osRet += aosTokens[i];
  189|      0|            }
  190|      0|        }
  191|      0|        return osRet;
  192|      0|    }
  193|       |
  194|  7.31k|    const int iFileStart = CPLFindFilenameStart(pszFilename, nSuffixPos);
  195|  7.31k|    if (iFileStart == 0)
  ------------------
  |  Branch (195:9): [True: 0, False: 7.31k]
  ------------------
  196|      0|    {
  197|      0|        return std::string();
  198|      0|    }
  199|       |
  200|  7.31k|    std::string osRet(pszFilename, iFileStart);
  201|       |
  202|  7.31k|    if (iFileStart > 1 && (osRet.back() == '/' || osRet.back() == '\\'))
  ------------------
  |  Branch (202:9): [True: 7.31k, False: 0]
  |  Branch (202:28): [True: 7.31k, False: 0]
  |  Branch (202:51): [True: 0, False: 0]
  ------------------
  203|  7.31k|        osRet.pop_back();
  204|       |
  205|  7.31k|    if (nSuffixPos)
  ------------------
  |  Branch (205:9): [True: 0, False: 7.31k]
  ------------------
  206|      0|    {
  207|      0|        osRet += (pszFilename + nSuffixPos);
  208|      0|    }
  209|       |
  210|  7.31k|    return osRet;
  211|  7.31k|}
_Z19CPLGetExtensionSafePKc:
  499|  7.31k|{
  500|  7.31k|    if (pszFullFilename[0] == '\0')
  ------------------
  |  Branch (500:9): [True: 0, False: 7.31k]
  ------------------
  501|      0|        return std::string();
  502|       |
  503|  7.31k|    size_t iFileStart =
  504|  7.31k|        static_cast<size_t>(CPLFindFilenameStart(pszFullFilename));
  505|  7.31k|    size_t iExtStart = strlen(pszFullFilename);
  506|  36.5k|    for (; iExtStart > iFileStart && pszFullFilename[iExtStart] != '.';
  ------------------
  |  Branch (506:12): [True: 29.2k, False: 7.31k]
  |  Branch (506:38): [True: 29.2k, False: 0]
  ------------------
  507|  29.2k|         iExtStart--)
  508|  29.2k|    {
  509|  29.2k|    }
  510|       |
  511|  7.31k|    if (iExtStart == iFileStart)
  ------------------
  |  Branch (511:9): [True: 7.31k, False: 0]
  ------------------
  512|  7.31k|        iExtStart = strlen(pszFullFilename) - 1;
  513|       |
  514|       |    // If the extension is too long, it is very much likely not an extension,
  515|       |    // but another component of the path
  516|  7.31k|    const size_t knMaxExtensionSize = 10;
  517|  7.31k|    if (strlen(pszFullFilename + iExtStart + 1) > knMaxExtensionSize)
  ------------------
  |  Branch (517:9): [True: 0, False: 7.31k]
  ------------------
  518|      0|        return "";
  519|       |
  520|  7.31k|    return std::string(pszFullFilename + iExtStart + 1);
  521|  7.31k|}
_Z21CPLResetExtensionSafePKcS0_:
  621|  3.05k|{
  622|  3.05k|    std::string osRet(pszPath);
  623|       |
  624|       |    /* -------------------------------------------------------------------- */
  625|       |    /*      First, try and strip off any existing extension.                */
  626|       |    /* -------------------------------------------------------------------- */
  627|       |
  628|  15.2k|    for (size_t i = osRet.size(); i > 0;)
  ------------------
  |  Branch (628:35): [True: 15.2k, False: 0]
  ------------------
  629|  15.2k|    {
  630|  15.2k|        --i;
  631|  15.2k|        if (osRet[i] == '.')
  ------------------
  |  Branch (631:13): [True: 0, False: 15.2k]
  ------------------
  632|      0|        {
  633|      0|            osRet.resize(i);
  634|      0|            break;
  635|      0|        }
  636|  15.2k|        else if (osRet[i] == '/' || osRet[i] == '\\' || osRet[i] == ':')
  ------------------
  |  Branch (636:18): [True: 3.05k, False: 12.2k]
  |  Branch (636:37): [True: 0, False: 12.2k]
  |  Branch (636:57): [True: 0, False: 12.2k]
  ------------------
  637|  3.05k|        {
  638|  3.05k|            break;
  639|  3.05k|        }
  640|  15.2k|    }
  641|       |
  642|       |    /* -------------------------------------------------------------------- */
  643|       |    /*      Append the new extension.                                       */
  644|       |    /* -------------------------------------------------------------------- */
  645|  3.05k|    osRet += '.';
  646|  3.05k|    osRet += pszExt;
  647|       |
  648|  3.05k|    return osRet;
  649|  3.05k|}
_Z19CPLFormFilenameSafePKcS0_S0_:
  711|      8|{
  712|      8|    if (pszBasename[0] == '.' &&
  ------------------
  |  Branch (712:9): [True: 2, False: 6]
  ------------------
  713|      8|        (pszBasename[1] == '/' || pszBasename[1] == '\\'))
  ------------------
  |  Branch (713:10): [True: 0, False: 2]
  |  Branch (713:35): [True: 0, False: 2]
  ------------------
  714|      0|        pszBasename += 2;
  715|       |
  716|      8|    const char *pszAddedPathSep = "";
  717|      8|    const char *pszAddedExtSep = "";
  718|       |
  719|      8|    if (pszPath == nullptr)
  ------------------
  |  Branch (719:9): [True: 0, False: 8]
  ------------------
  720|      0|        pszPath = "";
  721|      8|    size_t nLenPath = strlen(pszPath);
  722|       |
  723|      8|    const char *pszQuestionMark = nullptr;
  724|      8|    if (STARTS_WITH_CI(pszPath, "/vsicurl/http"))
  ------------------
  |  |  552|      8|#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
  |  |  ------------------
  |  |  |  |  539|      8|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      8|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (539:25): [True: 0, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  725|      0|    {
  726|      0|        pszQuestionMark = strchr(pszPath, '?');
  727|      0|        if (pszQuestionMark)
  ------------------
  |  Branch (727:13): [True: 0, False: 0]
  ------------------
  728|      0|        {
  729|      0|            nLenPath = pszQuestionMark - pszPath;
  730|      0|        }
  731|      0|        pszAddedPathSep = "/";
  732|      0|    }
  733|       |
  734|      8|    if (!CPLIsFilenameRelative(pszPath) && pszBasename[0] == '.' &&
  ------------------
  |  Branch (734:9): [True: 8, False: 0]
  |  Branch (734:44): [True: 2, False: 6]
  ------------------
  735|      8|        pszBasename[1] == '.' &&
  ------------------
  |  Branch (735:9): [True: 0, False: 2]
  ------------------
  736|      8|        (pszBasename[2] == 0 || pszBasename[2] == '\\' ||
  ------------------
  |  Branch (736:10): [True: 0, False: 0]
  |  Branch (736:33): [True: 0, False: 0]
  ------------------
  737|      0|         pszBasename[2] == '/'))
  ------------------
  |  Branch (737:10): [True: 0, False: 0]
  ------------------
  738|      0|    {
  739|       |        // "/a/b/" + "..[/something]" --> "/a[/something]"
  740|       |        // "/a/b" + "..[/something]" --> "/a[/something]"
  741|      0|        if (pszPath[nLenPath - 1] == '\\' || pszPath[nLenPath - 1] == '/')
  ------------------
  |  Branch (741:13): [True: 0, False: 0]
  |  Branch (741:46): [True: 0, False: 0]
  ------------------
  742|      0|            nLenPath--;
  743|      0|        while (true)
  ------------------
  |  Branch (743:16): [Folded - Ignored]
  ------------------
  744|      0|        {
  745|      0|            const char *pszBasenameOri = pszBasename;
  746|      0|            const size_t nLenPathOri = nLenPath;
  747|      0|            while (nLenPath > 0 && pszPath[nLenPath - 1] != '\\' &&
  ------------------
  |  Branch (747:20): [True: 0, False: 0]
  |  Branch (747:36): [True: 0, False: 0]
  ------------------
  748|      0|                   pszPath[nLenPath - 1] != '/')
  ------------------
  |  Branch (748:20): [True: 0, False: 0]
  ------------------
  749|      0|            {
  750|      0|                nLenPath--;
  751|      0|            }
  752|      0|            if (nLenPath == 1 && pszPath[0] == '/')
  ------------------
  |  Branch (752:17): [True: 0, False: 0]
  |  Branch (752:34): [True: 0, False: 0]
  ------------------
  753|      0|            {
  754|      0|                pszBasename += 2;
  755|      0|                if (pszBasename[0] == '/' || pszBasename[0] == '\\')
  ------------------
  |  Branch (755:21): [True: 0, False: 0]
  |  Branch (755:46): [True: 0, False: 0]
  ------------------
  756|      0|                    pszBasename++;
  757|      0|                if (*pszBasename == '.')
  ------------------
  |  Branch (757:21): [True: 0, False: 0]
  ------------------
  758|      0|                {
  759|      0|                    pszBasename = pszBasenameOri;
  760|      0|                    nLenPath = nLenPathOri;
  761|      0|                    if (pszAddedPathSep[0] == 0)
  ------------------
  |  Branch (761:25): [True: 0, False: 0]
  ------------------
  762|      0|                        pszAddedPathSep =
  763|      0|                            pszPath[0] == '/'
  ------------------
  |  Branch (763:29): [True: 0, False: 0]
  ------------------
  764|      0|                                ? "/"
  765|      0|                                : VSIGetDirectorySeparator(pszPath);
  766|      0|                }
  767|      0|                break;
  768|      0|            }
  769|      0|            else if ((nLenPath > 1 && pszPath[0] == '/') ||
  ------------------
  |  Branch (769:23): [True: 0, False: 0]
  |  Branch (769:39): [True: 0, False: 0]
  ------------------
  770|      0|                     (nLenPath > 2 && pszPath[1] == ':') ||
  ------------------
  |  Branch (770:23): [True: 0, False: 0]
  |  Branch (770:39): [True: 0, False: 0]
  ------------------
  771|      0|                     (nLenPath > 6 && strncmp(pszPath, "\\\\$\\", 4) == 0))
  ------------------
  |  Branch (771:23): [True: 0, False: 0]
  |  Branch (771:39): [True: 0, False: 0]
  ------------------
  772|      0|            {
  773|      0|                nLenPath--;
  774|      0|                pszBasename += 2;
  775|      0|                if ((pszBasename[0] == '/' || pszBasename[0] == '\\') &&
  ------------------
  |  Branch (775:22): [True: 0, False: 0]
  |  Branch (775:47): [True: 0, False: 0]
  ------------------
  776|      0|                    pszBasename[1] == '.' && pszBasename[2] == '.')
  ------------------
  |  Branch (776:21): [True: 0, False: 0]
  |  Branch (776:46): [True: 0, False: 0]
  ------------------
  777|      0|                {
  778|      0|                    pszBasename++;
  779|      0|                }
  780|      0|                else
  781|      0|                {
  782|      0|                    break;
  783|      0|                }
  784|      0|            }
  785|      0|            else
  786|      0|            {
  787|       |                // cppcheck-suppress redundantAssignment
  788|      0|                pszBasename = pszBasenameOri;
  789|      0|                nLenPath = nLenPathOri;
  790|      0|                if (pszAddedPathSep[0] == 0)
  ------------------
  |  Branch (790:21): [True: 0, False: 0]
  ------------------
  791|      0|                    pszAddedPathSep = pszPath[0] == '/'
  ------------------
  |  Branch (791:39): [True: 0, False: 0]
  ------------------
  792|      0|                                          ? "/"
  793|      0|                                          : VSIGetDirectorySeparator(pszPath);
  794|      0|                break;
  795|      0|            }
  796|      0|        }
  797|      0|    }
  798|      8|    else if (nLenPath > 0 && pszPath[nLenPath - 1] != '/' &&
  ------------------
  |  Branch (798:14): [True: 8, False: 0]
  |  Branch (798:30): [True: 8, False: 0]
  ------------------
  799|      8|             pszPath[nLenPath - 1] != '\\')
  ------------------
  |  Branch (799:14): [True: 8, False: 0]
  ------------------
  800|      8|    {
  801|      8|        if (pszAddedPathSep[0] == 0)
  ------------------
  |  Branch (801:13): [True: 8, False: 0]
  ------------------
  802|      8|            pszAddedPathSep = VSIGetDirectorySeparator(pszPath);
  803|      8|    }
  804|       |
  805|      8|    if (pszExtension == nullptr)
  ------------------
  |  Branch (805:9): [True: 8, False: 0]
  ------------------
  806|      8|        pszExtension = "";
  807|      0|    else if (pszExtension[0] != '.' && strlen(pszExtension) > 0)
  ------------------
  |  Branch (807:14): [True: 0, False: 0]
  |  Branch (807:40): [True: 0, False: 0]
  ------------------
  808|      0|        pszAddedExtSep = ".";
  809|       |
  810|      8|    std::string osRes;
  811|      8|    osRes.reserve(nLenPath + strlen(pszAddedPathSep) + strlen(pszBasename) +
  812|      8|                  strlen(pszAddedExtSep) + strlen(pszExtension) +
  813|      8|                  (pszQuestionMark ? strlen(pszQuestionMark) : 0));
  ------------------
  |  Branch (813:20): [True: 0, False: 8]
  ------------------
  814|      8|    osRes.assign(pszPath, nLenPath);
  815|      8|    osRes += pszAddedPathSep;
  816|      8|    osRes += pszBasename;
  817|      8|    osRes += pszAddedExtSep;
  818|      8|    osRes += pszExtension;
  819|       |
  820|      8|    if (pszQuestionMark)
  ------------------
  |  Branch (820:9): [True: 0, False: 8]
  ------------------
  821|      0|    {
  822|      0|        osRes += pszQuestionMark;
  823|      0|    }
  824|       |
  825|      8|    return osRes;
  826|      8|}
CPLIsFilenameRelative:
 1117|      8|{
 1118|      8|    if ((pszFilename[0] != '\0' &&
  ------------------
  |  Branch (1118:10): [True: 8, False: 0]
  ------------------
 1119|      8|         (STARTS_WITH(pszFilename + 1, ":\\") ||
  ------------------
  |  |  550|     16|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 8]
  |  |  ------------------
  ------------------
 1120|      8|          STARTS_WITH(pszFilename + 1, ":/") ||
  ------------------
  |  |  550|     16|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 8]
  |  |  ------------------
  ------------------
 1121|      8|          strstr(pszFilename + 1, "://")  // http://, ftp:// etc....
  ------------------
  |  Branch (1121:11): [True: 0, False: 8]
  ------------------
 1122|      8|          )) ||
 1123|      8|        STARTS_WITH(pszFilename, "\\\\?\\")  // Windows extended Length Path.
  ------------------
  |  |  550|     16|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 8]
  |  |  ------------------
  ------------------
 1124|      8|        || pszFilename[0] == '\\' || pszFilename[0] == '/')
  ------------------
  |  Branch (1124:12): [True: 0, False: 8]
  |  Branch (1124:38): [True: 8, False: 0]
  ------------------
 1125|      8|        return FALSE;
  ------------------
  |  | 1039|      8|#define FALSE 0
  ------------------
 1126|       |
 1127|      0|    return TRUE;
  ------------------
  |  | 1043|      0|#define TRUE 1
  ------------------
 1128|      8|}
cpl_path.cpp:_ZL20CPLFindFilenameStartPKcm:
  113|  14.6k|{
  114|  14.6k|    size_t iFileStart = nStart ? nStart : strlen(pszFilename);
  ------------------
  |  Branch (114:25): [True: 0, False: 14.6k]
  ------------------
  115|       |
  116|  73.1k|    for (; iFileStart > 0 && pszFilename[iFileStart - 1] != '/' &&
  ------------------
  |  Branch (116:12): [True: 73.1k, False: 0]
  |  Branch (116:30): [True: 58.5k, False: 14.6k]
  ------------------
  117|  73.1k|           pszFilename[iFileStart - 1] != '\\';
  ------------------
  |  Branch (117:12): [True: 58.5k, False: 0]
  ------------------
  118|  58.5k|         iFileStart--)
  119|  58.5k|    {
  120|  58.5k|    }
  121|       |
  122|  14.6k|    return static_cast<int>(iFileStart);
  123|  14.6k|}

cpl_multiproc.cpp:_ZL11CPL_TO_BOOLi:
 1018|   158k|    {
 1019|   158k|        return x != 0;
 1020|   158k|    }
cpl_vsil.cpp:_ZL11CPL_TO_BOOLi:
 1018|  14.5k|    {
 1019|  14.5k|        return x != 0;
 1020|  14.5k|    }
cpl_vsil.cpp:_ZL18CPL_IGNORE_RET_VALIiEvRKT_:
 1014|  29.0k|    {
 1015|  29.0k|    }
cpl_vsi_mem.cpp:_ZL11CPL_TO_BOOLi:
 1018|  7.31k|    {
 1019|  7.31k|        return x != 0;
 1020|  7.31k|    }
gdaldataset.cpp:_ZL11CPL_TO_BOOLi:
 1018|  7.27k|    {
 1019|  7.27k|        return x != 0;
 1020|  7.27k|    }
_ZN3cpl8containsINSt3__13setIN23GDALAntiRecursionStruct14DatasetContextENS3_21DatasetContextCompareENS1_9allocatorIS4_EEEES4_EEbRKT_RKT0_:
 1088|  7.31k|    {
 1089|  7.31k|        return container.find(value) != container.end();
 1090|  7.31k|    }
cpl_cpu_features.cpp:_ZL18CPL_IGNORE_RET_VALIjEvRKT_:
 1014|      2|    {
 1015|      2|    }
ogrspatialreference.cpp:_ZL18CPL_IGNORE_RET_VALIN19OGRSpatialReference7Private17OptionalLockGuardEEvRKT_:
 1014|  2.54k|    {
 1015|  2.54k|    }
gdalopeninfo.cpp:_ZL18CPL_IGNORE_RET_VALIiEvRKT_:
 1014|  7.31k|    {
 1015|  7.31k|    }

CPLRecode:
   83|    238|{
   84|       |    /* -------------------------------------------------------------------- */
   85|       |    /*      Handle a few common short cuts.                                 */
   86|       |    /* -------------------------------------------------------------------- */
   87|    238|    if (EQUAL(pszSrcEncoding, pszDstEncoding))
  ------------------
  |  |  541|    238|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|    238|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 238]
  |  |  ------------------
  ------------------
   88|      0|        return CPLStrdup(pszSource);
   89|       |
   90|    238|    if (EQUAL(pszSrcEncoding, CPL_ENC_ASCII) &&
  ------------------
  |  |  541|    476|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|    238|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 238]
  |  |  ------------------
  ------------------
   91|    238|        (EQUAL(pszDstEncoding, CPL_ENC_UTF8) ||
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   92|      0|         EQUAL(pszDstEncoding, CPL_ENC_ISO8859_1)))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   93|      0|        return CPLStrdup(pszSource);
   94|       |
   95|       |    // A few hard coded CPxxx/ISO-8859-x to UTF-8 tables
   96|    238|    if (EQUAL(pszDstEncoding, CPL_ENC_UTF8) &&
  ------------------
  |  |  541|    476|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|    238|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 238, False: 0]
  |  |  ------------------
  ------------------
   97|    238|        CPLGetConversionTableToUTF8(pszSrcEncoding))
  ------------------
  |  Branch (97:9): [True: 114, False: 124]
  ------------------
   98|    114|    {
   99|    114|        return CPLRecodeStub(pszSource, pszSrcEncoding, pszDstEncoding);
  100|    114|    }
  101|       |
  102|    124|#ifdef CPL_RECODE_ICONV
  103|       |    /* -------------------------------------------------------------------- */
  104|       |    /*      CPL_ENC_ISO8859_1 -> CPL_ENC_UTF8                               */
  105|       |    /*      and CPL_ENC_UTF8 -> CPL_ENC_ISO8859_1 conversions are handled   */
  106|       |    /*      very well by the stub implementation which is faster than the   */
  107|       |    /*      iconv() route. Use a stub for these two ones and iconv()        */
  108|       |    /*      everything else.                                                */
  109|       |    /* -------------------------------------------------------------------- */
  110|    124|    if ((EQUAL(pszSrcEncoding, CPL_ENC_ISO8859_1) &&
  ------------------
  |  |  541|    248|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|    124|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 35, False: 89]
  |  |  ------------------
  ------------------
  111|    124|         EQUAL(pszDstEncoding, CPL_ENC_UTF8)) ||
  ------------------
  |  |  541|     35|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|     35|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 35, False: 0]
  |  |  ------------------
  ------------------
  112|    124|        (EQUAL(pszSrcEncoding, CPL_ENC_UTF8) &&
  ------------------
  |  |  541|    178|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|     89|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 89]
  |  |  ------------------
  ------------------
  113|     89|         EQUAL(pszDstEncoding, CPL_ENC_ISO8859_1)))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  114|     35|    {
  115|     35|        return CPLRecodeStub(pszSource, pszSrcEncoding, pszDstEncoding);
  116|     35|    }
  117|       |#ifdef _WIN32
  118|       |    else if (((EQUAL(pszSrcEncoding, "CP_ACP") ||
  119|       |               EQUAL(pszSrcEncoding, "CP_OEMCP")) &&
  120|       |              EQUAL(pszDstEncoding, CPL_ENC_UTF8)) ||
  121|       |             (EQUAL(pszSrcEncoding, CPL_ENC_UTF8) &&
  122|       |              (EQUAL(pszDstEncoding, "CP_ACP") ||
  123|       |               EQUAL(pszDstEncoding, "CP_OEMCP"))))
  124|       |    {
  125|       |        return CPLRecodeStub(pszSource, pszSrcEncoding, pszDstEncoding);
  126|       |    }
  127|       |#endif
  128|     89|    else
  129|     89|    {
  130|     89|        return CPLRecodeIconv(pszSource, pszSrcEncoding, pszDstEncoding);
  131|     89|    }
  132|       |#else   // CPL_RECODE_STUB
  133|       |    return CPLRecodeStub(pszSource, pszSrcEncoding, pszDstEncoding);
  134|       |#endif  // CPL_RECODE_ICONV
  135|    124|}

_Z14CPLRecodeIconvPKcS0_S0_:
  105|     89|{
  106|     89|    pszSrcEncoding = CPLFixInputEncoding(
  107|     89|        pszSrcEncoding, static_cast<unsigned char>(pszSource[0]));
  108|       |
  109|     89|    iconv_t sConv;
  110|       |
  111|     89|    sConv = iconv_open(pszDstEncoding, pszSrcEncoding);
  112|       |
  113|     89|#ifdef __GNUC__
  114|     89|#pragma GCC diagnostic push
  115|     89|#pragma GCC diagnostic ignored "-Wold-style-cast"
  116|     89|#endif
  117|       |    // iconv_t might be a integer or a pointer, so we have to fallback to
  118|       |    // C-style cast
  119|     89|    if (sConv == (iconv_t)(-1))
  ------------------
  |  Branch (119:9): [True: 0, False: 89]
  ------------------
  120|      0|#ifdef __GNUC__
  121|      0|#pragma GCC diagnostic pop
  122|      0|#endif
  123|      0|    {
  124|      0|        CPLError(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  125|      0|                 "Recode from %s to %s failed with the error: \"%s\".",
  126|      0|                 pszSrcEncoding, pszDstEncoding, strerror(errno));
  127|       |
  128|      0|        return CPLStrdup(pszSource);
  129|      0|    }
  130|       |
  131|       |    /* -------------------------------------------------------------------- */
  132|       |    /*      XXX: There is a portability issue: iconv() function could be    */
  133|       |    /*      declared differently on different platforms. The second         */
  134|       |    /*      argument could be declared as char** (as POSIX defines) or      */
  135|       |    /*      as a const char**. Handle it with the ICONV_CPP_CONST macro here. */
  136|       |    /* -------------------------------------------------------------------- */
  137|     89|    ICONV_CPP_CONST char *pszSrcBuf =
  138|     89|        const_cast<ICONV_CPP_CONST char *>(pszSource);
  139|     89|    size_t nSrcLen = strlen(pszSource);
  140|     89|    size_t nDstCurLen = std::max(CPL_RECODE_DSTBUF_SIZE, nSrcLen);
  141|     89|    size_t nDstLen = nDstCurLen;
  142|     89|    char *pszDestination =
  143|     89|        static_cast<char *>(CPLCalloc(nDstCurLen + 1, sizeof(char)));
  144|     89|    char *pszDstBuf = pszDestination;
  145|       |
  146|  11.4k|    while (nSrcLen > 0)
  ------------------
  |  Branch (146:12): [True: 11.4k, False: 73]
  ------------------
  147|  11.4k|    {
  148|  11.4k|        size_t nConverted =
  149|  11.4k|            iconv(sConv, &pszSrcBuf, &nSrcLen, &pszDstBuf, &nDstLen);
  150|       |
  151|  11.4k|        if (nConverted == static_cast<size_t>(-1))
  ------------------
  |  Branch (151:13): [True: 11.3k, False: 48]
  ------------------
  152|  11.3k|        {
  153|  11.3k|            if (errno == EILSEQ)
  ------------------
  |  Branch (153:17): [True: 11.3k, False: 16]
  ------------------
  154|  11.3k|            {
  155|       |                // Skip the invalid sequence in the input string.
  156|  11.3k|                if (!bHaveWarned1)
  ------------------
  |  Branch (156:21): [True: 1, False: 11.3k]
  ------------------
  157|      1|                {
  158|      1|                    bHaveWarned1 = true;
  159|      1|                    CPLError(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      1|#define CPLE_AppDefined 1
  ------------------
  160|      1|                             "One or several characters couldn't be converted "
  161|      1|                             "correctly from %s to %s.  "
  162|      1|                             "This warning will not be emitted anymore",
  163|      1|                             pszSrcEncoding, pszDstEncoding);
  164|      1|                }
  165|  11.3k|                if (nSrcLen == 0)
  ------------------
  |  Branch (165:21): [True: 0, False: 11.3k]
  ------------------
  166|      0|                    break;
  167|  11.3k|                nSrcLen--;
  168|  11.3k|                pszSrcBuf++;
  169|  11.3k|                continue;
  170|  11.3k|            }
  171|       |
  172|     16|            else if (errno == E2BIG)
  ------------------
  |  Branch (172:22): [True: 0, False: 16]
  ------------------
  173|      0|            {
  174|       |                // We are running out of the output buffer.
  175|       |                // Dynamically increase the buffer size.
  176|      0|                size_t nTmp = nDstCurLen;
  177|      0|                nDstCurLen *= 2;
  178|      0|                pszDestination = static_cast<char *>(
  179|      0|                    CPLRealloc(pszDestination, nDstCurLen + 1));
  180|      0|                pszDstBuf = pszDestination + nTmp - nDstLen;
  181|      0|                nDstLen += nTmp;
  182|      0|                continue;
  183|      0|            }
  184|       |
  185|     16|            else
  186|     16|                break;
  187|  11.3k|        }
  188|  11.4k|    }
  189|       |
  190|     89|    pszDestination[nDstCurLen - nDstLen] = '\0';
  191|       |
  192|     89|    iconv_close(sConv);
  193|       |
  194|     89|    return pszDestination;
  195|     89|}
cpl_recode_iconv.cpp:_ZL19CPLFixInputEncodingPKci:
   68|     89|{
   69|     89|#if CPL_IS_LSB
   70|       |    // iconv on Alpine Linux seems to assume BE order, when it is not explicit
   71|     89|    if (EQUAL(pszSrcEncoding, CPL_ENC_UCS2))
  ------------------
  |  |  541|     89|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|     89|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 89]
  |  |  ------------------
  ------------------
   72|      0|        pszSrcEncoding = "UCS-2LE";
   73|     89|    else if (EQUAL(pszSrcEncoding, CPL_ENC_UTF16) && nFirstVal != 0xFF &&
  ------------------
  |  |  541|    178|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|     89|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 25, False: 64]
  |  |  ------------------
  ------------------
  |  Branch (73:54): [True: 24, False: 1]
  ------------------
   74|     89|             nFirstVal != 0xFE && nFirstVal != 0xFFFE && nFirstVal != 0xFEFF)
  ------------------
  |  Branch (74:14): [True: 24, False: 0]
  |  Branch (74:35): [True: 24, False: 0]
  |  Branch (74:58): [True: 24, False: 0]
  ------------------
   75|     24|    {
   76|       |        // Only force UTF-16LE if there's no starting endianness marker
   77|     24|        pszSrcEncoding = "UTF-16LE";
   78|     24|    }
   79|       |#else
   80|       |    CPL_IGNORE_RET_VAL(nFirstVal);
   81|       |#endif
   82|     89|    return pszSrcEncoding;
   83|     89|}

_Z13CPLRecodeStubPKcS0_S0_:
  124|    149|{
  125|       |    /* -------------------------------------------------------------------- */
  126|       |    /*      If the source or destination is current locale(), we change     */
  127|       |    /*      it to ISO8859-1 since our stub implementation does not          */
  128|       |    /*      attempt to address locales properly.                            */
  129|       |    /* -------------------------------------------------------------------- */
  130|       |
  131|    149|    if (pszSrcEncoding[0] == '\0')
  ------------------
  |  Branch (131:9): [True: 0, False: 149]
  ------------------
  132|      0|        pszSrcEncoding = CPL_ENC_ISO8859_1;
  ------------------
  |  |  246|      0|#define CPL_ENC_ISO8859_1 "ISO-8859-1"
  ------------------
  133|       |
  134|    149|    if (pszDstEncoding[0] == '\0')
  ------------------
  |  Branch (134:9): [True: 0, False: 149]
  ------------------
  135|      0|        pszDstEncoding = CPL_ENC_ISO8859_1;
  ------------------
  |  |  246|      0|#define CPL_ENC_ISO8859_1 "ISO-8859-1"
  ------------------
  136|       |
  137|       |    /* -------------------------------------------------------------------- */
  138|       |    /*      ISO8859 to UTF8                                                 */
  139|       |    /* -------------------------------------------------------------------- */
  140|    149|    if (strcmp(pszSrcEncoding, CPL_ENC_ISO8859_1) == 0 &&
  ------------------
  |  |  246|    149|#define CPL_ENC_ISO8859_1 "ISO-8859-1"
  ------------------
  |  Branch (140:9): [True: 35, False: 114]
  ------------------
  141|    149|        strcmp(pszDstEncoding, CPL_ENC_UTF8) == 0)
  ------------------
  |  |  236|     35|#define CPL_ENC_UTF8 "UTF-8"
  ------------------
  |  Branch (141:9): [True: 35, False: 0]
  ------------------
  142|     35|    {
  143|     35|        const int nCharCount = static_cast<int>(strlen(pszSource));
  144|     35|        char *pszResult = static_cast<char *>(CPLCalloc(1, nCharCount * 2 + 1));
  145|       |
  146|     35|        utf8froma(pszResult, nCharCount * 2 + 1, pszSource, nCharCount);
  147|       |
  148|     35|        return pszResult;
  149|     35|    }
  150|       |
  151|       |    /* -------------------------------------------------------------------- */
  152|       |    /*      UTF8 to ISO8859                                                 */
  153|       |    /* -------------------------------------------------------------------- */
  154|    114|    if (strcmp(pszSrcEncoding, CPL_ENC_UTF8) == 0 &&
  ------------------
  |  |  236|    114|#define CPL_ENC_UTF8 "UTF-8"
  ------------------
  |  Branch (154:9): [True: 0, False: 114]
  ------------------
  155|    114|        strcmp(pszDstEncoding, CPL_ENC_ISO8859_1) == 0)
  ------------------
  |  |  246|      0|#define CPL_ENC_ISO8859_1 "ISO-8859-1"
  ------------------
  |  Branch (155:9): [True: 0, False: 0]
  ------------------
  156|      0|    {
  157|      0|        int nCharCount = static_cast<int>(strlen(pszSource));
  158|      0|        char *pszResult = static_cast<char *>(CPLCalloc(1, nCharCount + 1));
  159|       |
  160|      0|        utf8toa(pszSource, nCharCount, pszResult, nCharCount + 1);
  161|       |
  162|      0|        return pszResult;
  163|      0|    }
  164|       |
  165|       |    // A few hard coded CPxxx/ISO-8859-x to UTF-8 tables
  166|    114|    if (EQUAL(pszDstEncoding, CPL_ENC_UTF8))
  ------------------
  |  |  541|    114|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|    114|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 114, False: 0]
  |  |  ------------------
  ------------------
  167|    114|    {
  168|    114|        const auto pConvTable = CPLGetConversionTableToUTF8(pszSrcEncoding);
  169|    114|        if (pConvTable)
  ------------------
  |  Branch (169:13): [True: 114, False: 0]
  ------------------
  170|    114|        {
  171|    114|            const auto convTable = *pConvTable;
  172|    114|            const size_t nCharCount = strlen(pszSource);
  173|    114|            char *pszResult =
  174|    114|                static_cast<char *>(CPLCalloc(1, nCharCount * 3 + 1));
  175|    114|            size_t iDst = 0;
  176|    114|            unsigned char *pabyResult =
  177|    114|                reinterpret_cast<unsigned char *>(pszResult);
  178|  51.3k|            for (size_t i = 0; i < nCharCount; ++i)
  ------------------
  |  Branch (178:32): [True: 51.2k, False: 114]
  ------------------
  179|  51.2k|            {
  180|  51.2k|                const unsigned char nChar =
  181|  51.2k|                    static_cast<unsigned char>(pszSource[i]);
  182|  51.2k|                if (nChar <= 127)
  ------------------
  |  Branch (182:21): [True: 12.0k, False: 39.1k]
  ------------------
  183|  12.0k|                {
  184|  12.0k|                    pszResult[iDst] = pszSource[i];
  185|  12.0k|                    ++iDst;
  186|  12.0k|                }
  187|  39.1k|                else
  188|  39.1k|                {
  189|  39.1k|                    const unsigned char nShiftedChar = nChar - 128;
  190|  39.1k|                    if (convTable[nShiftedChar][0])
  ------------------
  |  Branch (190:25): [True: 21.5k, False: 17.6k]
  ------------------
  191|  21.5k|                    {
  192|  21.5k|                        pabyResult[iDst] = convTable[nShiftedChar][0];
  193|  21.5k|                        ++iDst;
  194|  21.5k|                        CPLAssert(convTable[nShiftedChar][1]);
  ------------------
  |  |  331|  21.5k|    do                                                                         \
  |  |  332|  21.5k|    {                                                                          \
  |  |  333|  21.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  195|  21.5k|                        pabyResult[iDst] = convTable[nShiftedChar][1];
  196|  21.5k|                        ++iDst;
  197|  21.5k|                        if (convTable[nShiftedChar][2])
  ------------------
  |  Branch (197:29): [True: 3.20k, False: 18.3k]
  ------------------
  198|  3.20k|                        {
  199|  3.20k|                            pabyResult[iDst] = convTable[nShiftedChar][2];
  200|  3.20k|                            ++iDst;
  201|  3.20k|                        }
  202|  21.5k|                    }
  203|  17.6k|                    else
  204|  17.6k|                    {
  205|       |                        // Skip the invalid sequence in the input string.
  206|  17.6k|                        if (!bHaveWarned2)
  ------------------
  |  Branch (206:29): [True: 1, False: 17.6k]
  ------------------
  207|      1|                        {
  208|      1|                            bHaveWarned2 = true;
  209|      1|                            CPLError(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      1|#define CPLE_AppDefined 1
  ------------------
  210|      1|                                     "One or several characters couldn't be "
  211|      1|                                     "converted correctly from %s to %s. "
  212|      1|                                     "This warning will not be emitted anymore",
  213|      1|                                     pszSrcEncoding, pszDstEncoding);
  214|      1|                        }
  215|  17.6k|                    }
  216|  39.1k|                }
  217|  51.2k|            }
  218|       |
  219|    114|            pszResult[iDst] = 0;
  220|    114|            return pszResult;
  221|    114|        }
  222|    114|    }
  223|       |
  224|       |#ifdef _WIN32
  225|       |    const auto MapEncodingToWindowsCodePage = [](const char *pszEncoding)
  226|       |    {
  227|       |        // Cf https://learn.microsoft.com/fr-fr/windows/win32/intl/code-page-identifiers
  228|       |        if (STARTS_WITH(pszEncoding, "CP"))
  229|       |        {
  230|       |            const int nCode = atoi(pszEncoding + strlen("CP"));
  231|       |            if (nCode > 0)
  232|       |                return nCode;
  233|       |            else if (EQUAL(pszEncoding, "CP_OEMCP"))
  234|       |                return CP_OEMCP;
  235|       |            else if (EQUAL(pszEncoding, "CP_ACP"))
  236|       |                return CP_ACP;
  237|       |        }
  238|       |        else if (STARTS_WITH(pszEncoding, "WINDOWS-"))
  239|       |        {
  240|       |            const int nCode = atoi(pszEncoding + strlen("WINDOWS-"));
  241|       |            if (nCode > 0)
  242|       |                return nCode;
  243|       |        }
  244|       |        else if (STARTS_WITH(pszEncoding, "ISO-8859-"))
  245|       |        {
  246|       |            const int nCode = atoi(pszEncoding + strlen("ISO-8859-"));
  247|       |            if ((nCode >= 1 && nCode <= 9) || nCode == 13 || nCode == 15)
  248|       |                return 28590 + nCode;
  249|       |        }
  250|       |
  251|       |        // Return a negative value, since CP_ACP = 0
  252|       |        return -1;
  253|       |    };
  254|       |
  255|       |    /* ---------------------------------------------------------------------*/
  256|       |    /*     XXX to UTF8                                                      */
  257|       |    /* ---------------------------------------------------------------------*/
  258|       |    if (strcmp(pszDstEncoding, CPL_ENC_UTF8) == 0)
  259|       |    {
  260|       |        const int nCode = MapEncodingToWindowsCodePage(pszSrcEncoding);
  261|       |        if (nCode >= 0)
  262|       |        {
  263|       |            return CPLWin32Recode(pszSource, nCode, CP_UTF8);
  264|       |        }
  265|       |    }
  266|       |
  267|       |    /* ---------------------------------------------------------------------*/
  268|       |    /*      UTF8 to XXX                                                     */
  269|       |    /* ---------------------------------------------------------------------*/
  270|       |    if (strcmp(pszSrcEncoding, CPL_ENC_UTF8) == 0)
  271|       |    {
  272|       |        const int nCode = MapEncodingToWindowsCodePage(pszDstEncoding);
  273|       |        if (nCode >= 0)
  274|       |        {
  275|       |            return CPLWin32Recode(pszSource, CP_UTF8, nCode);
  276|       |        }
  277|       |    }
  278|       |#endif
  279|       |
  280|       |    /* -------------------------------------------------------------------- */
  281|       |    /*      Anything else to UTF-8 is treated as ISO8859-1 to UTF-8 with    */
  282|       |    /*      a one-time warning.                                             */
  283|       |    /* -------------------------------------------------------------------- */
  284|      0|    if (strcmp(pszDstEncoding, CPL_ENC_UTF8) == 0)
  ------------------
  |  |  236|      0|#define CPL_ENC_UTF8 "UTF-8"
  ------------------
  |  Branch (284:9): [True: 0, False: 0]
  ------------------
  285|      0|    {
  286|      0|        const int nCharCount = static_cast<int>(strlen(pszSource));
  287|      0|        char *pszResult = static_cast<char *>(CPLCalloc(1, nCharCount * 2 + 1));
  288|       |
  289|      0|        if (!bHaveWarned1)
  ------------------
  |  Branch (289:13): [True: 0, False: 0]
  ------------------
  290|      0|        {
  291|      0|            bHaveWarned1 = true;
  292|      0|            CPLError(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  293|      0|                     "Recode from %s to UTF-8 not supported, "
  294|      0|                     "treated as ISO-8859-1 to UTF-8.",
  295|      0|                     pszSrcEncoding);
  296|      0|        }
  297|       |
  298|      0|        utf8froma(pszResult, nCharCount * 2 + 1, pszSource, nCharCount);
  299|       |
  300|      0|        return pszResult;
  301|      0|    }
  302|       |
  303|       |    /* -------------------------------------------------------------------- */
  304|       |    /*      Everything else is treated as a no-op with a warning.           */
  305|       |    /* -------------------------------------------------------------------- */
  306|      0|    {
  307|      0|        if (!bHaveWarned3)
  ------------------
  |  Branch (307:13): [True: 0, False: 0]
  ------------------
  308|      0|        {
  309|      0|            bHaveWarned3 = true;
  310|      0|            CPLError(CE_Warning, CPLE_AppDefined,
  ------------------
  |  |   85|      0|#define CPLE_AppDefined 1
  ------------------
  311|      0|                     "Recode from %s to %s not supported, no change applied.",
  312|      0|                     pszSrcEncoding, pszDstEncoding);
  313|      0|        }
  314|       |
  315|      0|        return CPLStrdup(pszSource);
  316|      0|    }
  317|      0|}
cpl_recode_stub.cpp:_ZL9utf8fromaPcjPKcj:
 1063|     35|{
 1064|     35|    const char *p = src;
 1065|     35|    const char *e = src + srclen;
 1066|     35|    unsigned count = 0;
 1067|     35|    if (dstlen)
  ------------------
  |  Branch (1067:9): [True: 35, False: 0]
  ------------------
 1068|   123k|        while (true)
  ------------------
  |  Branch (1068:16): [Folded - Ignored]
  ------------------
 1069|   123k|        {
 1070|   123k|            if (p >= e)
  ------------------
  |  Branch (1070:17): [True: 35, False: 123k]
  ------------------
 1071|     35|            {
 1072|     35|                dst[count] = 0;
 1073|     35|                return count;
 1074|     35|            }
 1075|   123k|            unsigned char ucs = *reinterpret_cast<const unsigned char *>(p);
 1076|   123k|            p++;
 1077|   123k|            if (ucs < 0x80U)
  ------------------
  |  Branch (1077:17): [True: 20.0k, False: 103k]
  ------------------
 1078|  20.0k|            {
 1079|  20.0k|                dst[count++] = ucs;
 1080|  20.0k|                if (count >= dstlen)
  ------------------
  |  Branch (1080:21): [True: 0, False: 20.0k]
  ------------------
 1081|      0|                {
 1082|      0|                    dst[count - 1] = 0;
 1083|      0|                    break;
 1084|      0|                }
 1085|  20.0k|            }
 1086|   103k|            else
 1087|   103k|            {
 1088|       |                // 2 bytes (note that CP1252 translate could make 3 bytes!)
 1089|   103k|                if (count + 2 >= dstlen)
  ------------------
  |  Branch (1089:21): [True: 0, False: 103k]
  ------------------
 1090|      0|                {
 1091|      0|                    dst[count] = 0;
 1092|      0|                    count += 2;
 1093|      0|                    break;
 1094|      0|                }
 1095|   103k|                dst[count++] = 0xc0 | (ucs >> 6);
 1096|   103k|                dst[count++] = 0x80 | (ucs & 0x3F);
 1097|   103k|            }
 1098|   123k|        }
 1099|       |
 1100|       |    // We filled dst, measure the rest:
 1101|      0|    while (p < e)
  ------------------
  |  Branch (1101:12): [True: 0, False: 0]
  ------------------
 1102|      0|    {
 1103|      0|        unsigned char ucs = *reinterpret_cast<const unsigned char *>(p);
 1104|      0|        p++;
 1105|      0|        if (ucs < 0x80U)
  ------------------
  |  Branch (1105:13): [True: 0, False: 0]
  ------------------
 1106|      0|        {
 1107|      0|            count++;
 1108|      0|        }
 1109|      0|        else
 1110|      0|        {
 1111|      0|            count += 2;
 1112|      0|        }
 1113|      0|    }
 1114|       |
 1115|      0|    return count;
 1116|     35|}

_ZN18CPLSafeIntOverflowC2Ev:
   59|  3.70k|    {
   60|  3.70k|    }
_Z5CPLSMl:
   94|  24.9k|{
   95|  24.9k|    return CPLSafeInt<int64_t>(x);
   96|  24.9k|}
_ZplRK10CPLSafeIntIlES2_:
  165|  5.78k|{
  166|  5.78k|#ifdef BUILTIN_OVERFLOW_CHECK_AVAILABLE
  167|  5.78k|    long long res;
  168|  5.78k|    if (__builtin_saddll_overflow(A.v(), B.v(), &res))
  ------------------
  |  Branch (168:9): [True: 2.71k, False: 3.06k]
  ------------------
  169|  2.71k|        throw CPLSafeIntOverflow();
  170|  3.06k|    return CPLSM(static_cast<int64_t>(res));
  171|       |#elif defined(_MSC_VER)
  172|       |    msl::utilities::SafeInt<int64_t, CPLMSVCSafeIntException> A2(A.v());
  173|       |    msl::utilities::SafeInt<int64_t, CPLMSVCSafeIntException> B2(B.v());
  174|       |    return CPLSM(static_cast<int64_t>(A2 + B2));
  175|       |#else
  176|       |    return SafeAddSigned(A, B);
  177|       |#endif
  178|  5.78k|}
_ZmiRK10CPLSafeIntIlES2_:
  266|  3.78k|{
  267|  3.78k|#ifdef BUILTIN_OVERFLOW_CHECK_AVAILABLE
  268|  3.78k|    long long res;
  269|  3.78k|    if (__builtin_ssubll_overflow(A.v(), B.v(), &res))
  ------------------
  |  Branch (269:9): [True: 997, False: 2.78k]
  ------------------
  270|    997|        throw CPLSafeIntOverflow();
  271|  2.78k|    return CPLSM(static_cast<int64_t>(res));
  272|       |#elif defined(_MSC_VER)
  273|       |    msl::utilities::SafeInt<int64_t, CPLMSVCSafeIntException> A2(A.v());
  274|       |    msl::utilities::SafeInt<int64_t, CPLMSVCSafeIntException> B2(B.v());
  275|       |    return CPLSM(static_cast<int64_t>(A2 - B2));
  276|       |#else
  277|       |    return SafeSubSigned(A, B);
  278|       |#endif
  279|  3.78k|}
_ZNK10CPLSafeIntIlE1vEv:
   50|  24.9k|    {
   51|  24.9k|        return val;
   52|  24.9k|    }
_ZN10CPLSafeIntIlEC2El:
   45|  24.9k|    inline explicit CPLSafeInt(T valIn) : val(valIn)
   46|  24.9k|    {
   47|  24.9k|    }

CSLAddString:
   69|     16|{
   70|     16|    char **papszRet = CSLAddStringMayFail(papszStrList, pszNewString);
   71|     16|    if (papszRet == nullptr && pszNewString != nullptr)
  ------------------
  |  Branch (71:9): [True: 0, False: 16]
  |  Branch (71:32): [True: 0, False: 0]
  ------------------
   72|      0|        abort();
   73|     16|    return papszRet;
   74|     16|}
CSLAddStringMayFail:
   78|     16|{
   79|     16|    if (pszNewString == nullptr)
  ------------------
  |  Branch (79:9): [True: 0, False: 16]
  ------------------
   80|      0|        return papszStrList;  // Nothing to do!
   81|       |
   82|     16|    char *pszDup = VSI_STRDUP_VERBOSE(pszNewString);
  ------------------
  |  |  368|     16|#define VSI_STRDUP_VERBOSE(pszStr) VSIStrdupVerbose(pszStr, __FILE__, __LINE__)
  ------------------
   83|     16|    if (pszDup == nullptr)
  ------------------
  |  Branch (83:9): [True: 0, False: 16]
  ------------------
   84|      0|        return nullptr;
   85|       |
   86|       |    // Allocate room for the new string.
   87|     16|    char **papszStrListNew = nullptr;
   88|     16|    int nItems = 0;
   89|       |
   90|     16|    if (papszStrList == nullptr)
  ------------------
  |  Branch (90:9): [True: 2, False: 14]
  ------------------
   91|      2|        papszStrListNew =
   92|      2|            static_cast<char **>(VSI_CALLOC_VERBOSE(2, sizeof(char *)));
  ------------------
  |  |  354|      2|    VSICallocVerbose(nCount, nSize, __FILE__, __LINE__)
  ------------------
   93|     14|    else
   94|     14|    {
   95|     14|        nItems = CSLCount(papszStrList);
   96|     14|        papszStrListNew = static_cast<char **>(
   97|     14|            VSI_REALLOC_VERBOSE(papszStrList, (nItems + 2) * sizeof(char *)));
  ------------------
  |  |  362|     14|    VSIReallocVerbose(pOldPtr, nNewSize, __FILE__, __LINE__)
  ------------------
   98|     14|    }
   99|     16|    if (papszStrListNew == nullptr)
  ------------------
  |  Branch (99:9): [True: 0, False: 16]
  ------------------
  100|      0|    {
  101|      0|        VSIFree(pszDup);
  102|      0|        return nullptr;
  103|      0|    }
  104|       |
  105|       |    // Copy the string in the list.
  106|     16|    papszStrListNew[nItems] = pszDup;
  107|     16|    papszStrListNew[nItems + 1] = nullptr;
  108|       |
  109|     16|    return papszStrListNew;
  110|     16|}
CSLCount:
  133|  7.32k|{
  134|  7.32k|    if (!papszStrList)
  ------------------
  |  Branch (134:9): [True: 7.31k, False: 14]
  ------------------
  135|  7.31k|        return 0;
  136|       |
  137|     14|    int nItems = 0;
  138|       |
  139|     70|    while (*papszStrList != nullptr)
  ------------------
  |  Branch (139:12): [True: 56, False: 14]
  ------------------
  140|     56|    {
  141|     56|        ++nItems;
  142|     56|        ++papszStrList;
  143|     56|    }
  144|       |
  145|     14|    return nItems;
  146|  7.32k|}
CSLDestroy:
  186|  46.8k|{
  187|  46.8k|    if (!papszStrList)
  ------------------
  |  Branch (187:9): [True: 43.7k, False: 3.05k]
  ------------------
  188|  43.7k|        return;
  189|       |
  190|   112k|    for (char **papszPtr = papszStrList; *papszPtr != nullptr; ++papszPtr)
  ------------------
  |  Branch (190:42): [True: 109k, False: 3.05k]
  ------------------
  191|   109k|    {
  192|   109k|        CPLFree(*papszPtr);
  ------------------
  |  |   86|   109k|#define CPLFree VSIFree
  ------------------
  193|   109k|    }
  194|       |
  195|  3.05k|    CPLFree(papszStrList);
  ------------------
  |  |   86|  3.05k|#define CPLFree VSIFree
  ------------------
  196|  3.05k|}
CSLDuplicate:
  214|  7.31k|{
  215|  7.31k|    const int nLines = CSLCount(papszStrList);
  216|       |
  217|  7.31k|    if (nLines == 0)
  ------------------
  |  Branch (217:9): [True: 7.31k, False: 0]
  ------------------
  218|  7.31k|        return nullptr;
  219|       |
  220|      0|    CSLConstList papszSrc = papszStrList;
  221|       |
  222|      0|    char **papszNewList =
  223|      0|        static_cast<char **>(VSI_MALLOC2_VERBOSE(nLines + 1, sizeof(char *)));
  ------------------
  |  |  339|      0|    VSIMalloc2Verbose(nSize1, nSize2, __FILE__, __LINE__)
  ------------------
  224|       |
  225|      0|    char **papszDst = papszNewList;
  226|       |
  227|      0|    for (; *papszSrc != nullptr; ++papszSrc, ++papszDst)
  ------------------
  |  Branch (227:12): [True: 0, False: 0]
  ------------------
  228|      0|    {
  229|      0|        *papszDst = VSI_STRDUP_VERBOSE(*papszSrc);
  ------------------
  |  |  368|      0|#define VSI_STRDUP_VERBOSE(pszStr) VSIStrdupVerbose(pszStr, __FILE__, __LINE__)
  ------------------
  230|      0|        if (*papszDst == nullptr)
  ------------------
  |  Branch (230:13): [True: 0, False: 0]
  ------------------
  231|      0|        {
  232|      0|            CSLDestroy(papszNewList);
  233|      0|            return nullptr;
  234|      0|        }
  235|      0|    }
  236|      0|    *papszDst = nullptr;
  237|       |
  238|      0|    return papszNewList;
  239|      0|}
CSLFindString:
  657|  7.31k|{
  658|  7.31k|    if (papszList == nullptr)
  ------------------
  |  Branch (658:9): [True: 7.31k, False: 0]
  ------------------
  659|  7.31k|        return -1;
  660|       |
  661|      0|    for (int i = 0; papszList[i] != nullptr; ++i)
  ------------------
  |  Branch (661:21): [True: 0, False: 0]
  ------------------
  662|      0|    {
  663|      0|        if (EQUAL(papszList[i], pszTarget))
  ------------------
  |  |  541|      0|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      0|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  664|      0|            return i;
  665|      0|    }
  666|       |
  667|      0|    return -1;
  668|      0|}
CPLvsnprintf:
 1133|  18.3k|{
 1134|  18.3k|    if (size == 0)
  ------------------
  |  Branch (1134:9): [True: 0, False: 18.3k]
  ------------------
 1135|      0|        return vsnprintf(str, size, fmt, args);
 1136|       |
 1137|  18.3k|    va_list wrk_args;
 1138|       |
 1139|  18.3k|#ifdef va_copy
 1140|  18.3k|    va_copy(wrk_args, args);
 1141|       |#else
 1142|       |    wrk_args = args;
 1143|       |#endif
 1144|       |
 1145|  18.3k|    const char *fmt_ori = fmt;
 1146|  18.3k|    size_t offset_out = 0;
 1147|  18.3k|    char ch = '\0';
 1148|  18.3k|    bool bFormatUnknown = false;
 1149|       |
 1150|   655k|    for (; (ch = *fmt) != '\0'; ++fmt)
  ------------------
  |  Branch (1150:12): [True: 636k, False: 18.3k]
  ------------------
 1151|   636k|    {
 1152|   636k|        if (ch == '%')
  ------------------
  |  Branch (1152:13): [True: 27.9k, False: 608k]
  ------------------
 1153|  27.9k|        {
 1154|  27.9k|            if (strncmp(fmt, "%.*f", 4) == 0)
  ------------------
  |  Branch (1154:17): [True: 0, False: 27.9k]
  ------------------
 1155|      0|            {
 1156|      0|                const int precision = va_arg(wrk_args, int);
 1157|      0|                const double val = va_arg(wrk_args, double);
 1158|      0|                const int local_ret =
 1159|      0|                    snprintf(str + offset_out, size - offset_out, "%.*f",
 1160|      0|                             precision, val);
 1161|       |                // MSVC vsnprintf() returns -1.
 1162|      0|                if (local_ret < 0 || offset_out + local_ret >= size)
  ------------------
  |  Branch (1162:21): [True: 0, False: 0]
  |  Branch (1162:38): [True: 0, False: 0]
  ------------------
 1163|      0|                    break;
 1164|      0|                for (int j = 0; j < local_ret; ++j)
  ------------------
  |  Branch (1164:33): [True: 0, False: 0]
  ------------------
 1165|      0|                {
 1166|      0|                    if (str[offset_out + j] == ',')
  ------------------
  |  Branch (1166:25): [True: 0, False: 0]
  ------------------
 1167|      0|                    {
 1168|      0|                        str[offset_out + j] = '.';
 1169|      0|                        break;
 1170|      0|                    }
 1171|      0|                }
 1172|      0|                offset_out += local_ret;
 1173|      0|                fmt += strlen("%.*f") - 1;
 1174|      0|                continue;
 1175|      0|            }
 1176|       |
 1177|  27.9k|            const char *ptrend = CPLvsnprintf_get_end_of_formatting(fmt + 1);
 1178|  27.9k|            if (ptrend == nullptr || ptrend - fmt >= 20)
  ------------------
  |  Branch (1178:17): [True: 0, False: 27.9k]
  |  Branch (1178:38): [True: 0, False: 27.9k]
  ------------------
 1179|      0|            {
 1180|      0|                bFormatUnknown = true;
 1181|      0|                break;
 1182|      0|            }
 1183|  27.9k|            char end = *ptrend;
 1184|  27.9k|            char end_m1 = ptrend[-1];
 1185|       |
 1186|  27.9k|            char localfmt[22] = {};
 1187|  27.9k|            memcpy(localfmt, fmt, ptrend - fmt + 1);
 1188|  27.9k|            localfmt[ptrend - fmt + 1] = '\0';
 1189|       |
 1190|  27.9k|            int local_ret = 0;
 1191|  27.9k|            if (end == '%')
  ------------------
  |  Branch (1191:17): [True: 0, False: 27.9k]
  ------------------
 1192|      0|            {
 1193|      0|                if (offset_out == size - 1)
  ------------------
  |  Branch (1193:21): [True: 0, False: 0]
  ------------------
 1194|      0|                    break;
 1195|      0|                local_ret = 1;
 1196|      0|                str[offset_out] = '%';
 1197|      0|            }
 1198|  27.9k|            else if (end == 'd' || end == 'i' || end == 'c')
  ------------------
  |  Branch (1198:22): [True: 313, False: 27.6k]
  |  Branch (1198:36): [True: 0, False: 27.6k]
  |  Branch (1198:50): [True: 0, False: 27.6k]
  ------------------
 1199|    313|            {
 1200|    313|                if (end_m1 == 'h')
  ------------------
  |  Branch (1200:21): [True: 0, False: 313]
  ------------------
 1201|      0|                    call_native_snprintf(int);
  ------------------
  |  | 1113|      0|    local_ret = snprintf(str + offset_out, size - offset_out, localfmt,        \
  |  | 1114|      0|                         va_arg(wrk_args, type))
  ------------------
 1202|    313|                else if (end_m1 == 'l' && ptrend[-2] != 'l')
  ------------------
  |  Branch (1202:26): [True: 158, False: 155]
  |  Branch (1202:43): [True: 0, False: 158]
  ------------------
 1203|      0|                    call_native_snprintf(long);
  ------------------
  |  | 1113|      0|    local_ret = snprintf(str + offset_out, size - offset_out, localfmt,        \
  |  | 1114|      0|                         va_arg(wrk_args, type))
  ------------------
 1204|    313|                else if (end_m1 == 'l' && ptrend[-2] == 'l')
  ------------------
  |  Branch (1204:26): [True: 158, False: 155]
  |  Branch (1204:43): [True: 158, False: 0]
  ------------------
 1205|    158|                    call_native_snprintf(GIntBig);
  ------------------
  |  | 1113|    158|    local_ret = snprintf(str + offset_out, size - offset_out, localfmt,        \
  |  | 1114|    158|                         va_arg(wrk_args, type))
  ------------------
 1206|    155|                else if (end_m1 == '4' && ptrend[-2] == '6' &&
  ------------------
  |  Branch (1206:26): [True: 0, False: 155]
  |  Branch (1206:43): [True: 0, False: 0]
  ------------------
 1207|    155|                         ptrend[-3] == 'I')
  ------------------
  |  Branch (1207:26): [True: 0, False: 0]
  ------------------
 1208|       |                    // Microsoft I64 modifier.
 1209|      0|                    call_native_snprintf(GIntBig);
  ------------------
  |  | 1113|      0|    local_ret = snprintf(str + offset_out, size - offset_out, localfmt,        \
  |  | 1114|      0|                         va_arg(wrk_args, type))
  ------------------
 1210|    155|                else if (end_m1 == 'z')
  ------------------
  |  Branch (1210:26): [True: 0, False: 155]
  ------------------
 1211|      0|                    call_native_snprintf(size_t);
  ------------------
  |  | 1113|      0|    local_ret = snprintf(str + offset_out, size - offset_out, localfmt,        \
  |  | 1114|      0|                         va_arg(wrk_args, type))
  ------------------
 1212|    155|                else if ((end_m1 >= 'a' && end_m1 <= 'z') ||
  ------------------
  |  Branch (1212:27): [True: 0, False: 155]
  |  Branch (1212:44): [True: 0, False: 0]
  ------------------
 1213|    155|                         (end_m1 >= 'A' && end_m1 <= 'Z'))
  ------------------
  |  Branch (1213:27): [True: 0, False: 155]
  |  Branch (1213:44): [True: 0, False: 0]
  ------------------
 1214|      0|                {
 1215|      0|                    bFormatUnknown = true;
 1216|      0|                    break;
 1217|      0|                }
 1218|    155|                else
 1219|    155|                    call_native_snprintf(int);
  ------------------
  |  | 1113|    155|    local_ret = snprintf(str + offset_out, size - offset_out, localfmt,        \
  |  | 1114|    155|                         va_arg(wrk_args, type))
  ------------------
 1220|    313|            }
 1221|  27.6k|            else if (end == 'o' || end == 'u' || end == 'x' || end == 'X')
  ------------------
  |  Branch (1221:22): [True: 0, False: 27.6k]
  |  Branch (1221:36): [True: 0, False: 27.6k]
  |  Branch (1221:50): [True: 0, False: 27.6k]
  |  Branch (1221:64): [True: 5.97k, False: 21.6k]
  ------------------
 1222|  5.97k|            {
 1223|  5.97k|                if (end_m1 == 'h')
  ------------------
  |  Branch (1223:21): [True: 0, False: 5.97k]
  ------------------
 1224|      0|                    call_native_snprintf(unsigned int);
  ------------------
  |  | 1113|      0|    local_ret = snprintf(str + offset_out, size - offset_out, localfmt,        \
  |  | 1114|      0|                         va_arg(wrk_args, type))
  ------------------
 1225|  5.97k|                else if (end_m1 == 'l' && ptrend[-2] != 'l')
  ------------------
  |  Branch (1225:26): [True: 0, False: 5.97k]
  |  Branch (1225:43): [True: 0, False: 0]
  ------------------
 1226|      0|                    call_native_snprintf(unsigned long);
  ------------------
  |  | 1113|      0|    local_ret = snprintf(str + offset_out, size - offset_out, localfmt,        \
  |  | 1114|      0|                         va_arg(wrk_args, type))
  ------------------
 1227|  5.97k|                else if (end_m1 == 'l' && ptrend[-2] == 'l')
  ------------------
  |  Branch (1227:26): [True: 0, False: 5.97k]
  |  Branch (1227:43): [True: 0, False: 0]
  ------------------
 1228|      0|                    call_native_snprintf(GUIntBig);
  ------------------
  |  | 1113|      0|    local_ret = snprintf(str + offset_out, size - offset_out, localfmt,        \
  |  | 1114|      0|                         va_arg(wrk_args, type))
  ------------------
 1229|  5.97k|                else if (end_m1 == '4' && ptrend[-2] == '6' &&
  ------------------
  |  Branch (1229:26): [True: 0, False: 5.97k]
  |  Branch (1229:43): [True: 0, False: 0]
  ------------------
 1230|  5.97k|                         ptrend[-3] == 'I')
  ------------------
  |  Branch (1230:26): [True: 0, False: 0]
  ------------------
 1231|       |                    // Microsoft I64 modifier.
 1232|      0|                    call_native_snprintf(GUIntBig);
  ------------------
  |  | 1113|      0|    local_ret = snprintf(str + offset_out, size - offset_out, localfmt,        \
  |  | 1114|      0|                         va_arg(wrk_args, type))
  ------------------
 1233|  5.97k|                else if (end_m1 == 'z')
  ------------------
  |  Branch (1233:26): [True: 0, False: 5.97k]
  ------------------
 1234|      0|                    call_native_snprintf(size_t);
  ------------------
  |  | 1113|      0|    local_ret = snprintf(str + offset_out, size - offset_out, localfmt,        \
  |  | 1114|      0|                         va_arg(wrk_args, type))
  ------------------
 1235|  5.97k|                else if ((end_m1 >= 'a' && end_m1 <= 'z') ||
  ------------------
  |  Branch (1235:27): [True: 0, False: 5.97k]
  |  Branch (1235:44): [True: 0, False: 0]
  ------------------
 1236|  5.97k|                         (end_m1 >= 'A' && end_m1 <= 'Z'))
  ------------------
  |  Branch (1236:27): [True: 0, False: 5.97k]
  |  Branch (1236:44): [True: 0, False: 0]
  ------------------
 1237|      0|                {
 1238|      0|                    bFormatUnknown = true;
 1239|      0|                    break;
 1240|      0|                }
 1241|  5.97k|                else
 1242|  5.97k|                    call_native_snprintf(unsigned int);
  ------------------
  |  | 1113|  5.97k|    local_ret = snprintf(str + offset_out, size - offset_out, localfmt,        \
  |  | 1114|  5.97k|                         va_arg(wrk_args, type))
  ------------------
 1243|  5.97k|            }
 1244|  21.6k|            else if (end == 'e' || end == 'E' || end == 'f' || end == 'F' ||
  ------------------
  |  Branch (1244:22): [True: 0, False: 21.6k]
  |  Branch (1244:36): [True: 0, False: 21.6k]
  |  Branch (1244:50): [True: 0, False: 21.6k]
  |  Branch (1244:64): [True: 0, False: 21.6k]
  ------------------
 1245|  21.6k|                     end == 'g' || end == 'G' || end == 'a' || end == 'A')
  ------------------
  |  Branch (1245:22): [True: 0, False: 21.6k]
  |  Branch (1245:36): [True: 0, False: 21.6k]
  |  Branch (1245:50): [True: 0, False: 21.6k]
  |  Branch (1245:64): [True: 0, False: 21.6k]
  ------------------
 1246|      0|            {
 1247|      0|                if (end_m1 == 'L')
  ------------------
  |  Branch (1247:21): [True: 0, False: 0]
  ------------------
 1248|      0|                    call_native_snprintf(long double);
  ------------------
  |  | 1113|      0|    local_ret = snprintf(str + offset_out, size - offset_out, localfmt,        \
  |  | 1114|      0|                         va_arg(wrk_args, type))
  ------------------
 1249|      0|                else
 1250|      0|                    call_native_snprintf(double);
  ------------------
  |  | 1113|      0|    local_ret = snprintf(str + offset_out, size - offset_out, localfmt,        \
  |  | 1114|      0|                         va_arg(wrk_args, type))
  ------------------
 1251|       |                // MSVC vsnprintf() returns -1.
 1252|      0|                if (local_ret < 0 || offset_out + local_ret >= size)
  ------------------
  |  Branch (1252:21): [True: 0, False: 0]
  |  Branch (1252:38): [True: 0, False: 0]
  ------------------
 1253|      0|                    break;
 1254|      0|                for (int j = 0; j < local_ret; ++j)
  ------------------
  |  Branch (1254:33): [True: 0, False: 0]
  ------------------
 1255|      0|                {
 1256|      0|                    if (str[offset_out + j] == ',')
  ------------------
  |  Branch (1256:25): [True: 0, False: 0]
  ------------------
 1257|      0|                    {
 1258|      0|                        str[offset_out + j] = '.';
 1259|      0|                        break;
 1260|      0|                    }
 1261|      0|                }
 1262|      0|            }
 1263|  21.6k|            else if (end == 's')
  ------------------
  |  Branch (1263:22): [True: 21.6k, False: 0]
  ------------------
 1264|  21.6k|            {
 1265|  21.6k|                const char *pszPtr = va_arg(wrk_args, const char *);
 1266|  21.6k|                CPLAssert(pszPtr);
  ------------------
  |  |  331|  21.6k|    do                                                                         \
  |  |  332|  21.6k|    {                                                                          \
  |  |  333|  21.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1267|  21.6k|                local_ret = snprintf(str + offset_out, size - offset_out,
 1268|  21.6k|                                     localfmt, pszPtr);
 1269|  21.6k|            }
 1270|      0|            else if (end == 'p')
  ------------------
  |  Branch (1270:22): [True: 0, False: 0]
  ------------------
 1271|      0|            {
 1272|      0|                call_native_snprintf(void *);
  ------------------
  |  | 1113|      0|    local_ret = snprintf(str + offset_out, size - offset_out, localfmt,        \
  |  | 1114|      0|                         va_arg(wrk_args, type))
  ------------------
 1273|      0|            }
 1274|      0|            else
 1275|      0|            {
 1276|      0|                bFormatUnknown = true;
 1277|      0|                break;
 1278|      0|            }
 1279|       |            // MSVC vsnprintf() returns -1.
 1280|  27.9k|            if (local_ret < 0 || offset_out + local_ret >= size)
  ------------------
  |  Branch (1280:17): [True: 0, False: 27.9k]
  |  Branch (1280:34): [True: 19, False: 27.8k]
  ------------------
 1281|     19|                break;
 1282|  27.8k|            offset_out += local_ret;
 1283|  27.8k|            fmt = ptrend;
 1284|  27.8k|        }
 1285|   608k|        else
 1286|   608k|        {
 1287|   608k|            if (offset_out == size - 1)
  ------------------
  |  Branch (1287:17): [True: 3, False: 608k]
  ------------------
 1288|      3|                break;
 1289|   608k|            str[offset_out++] = *fmt;
 1290|   608k|        }
 1291|   636k|    }
 1292|  18.3k|    if (ch == '\0' && offset_out < size)
  ------------------
  |  Branch (1292:9): [True: 18.3k, False: 22]
  |  Branch (1292:23): [True: 18.3k, False: 0]
  ------------------
 1293|  18.3k|        str[offset_out] = '\0';
 1294|     22|    else
 1295|     22|    {
 1296|     22|        if (bFormatUnknown)
  ------------------
  |  Branch (1296:13): [True: 0, False: 22]
  ------------------
 1297|      0|        {
 1298|      0|            CPLDebug("CPL",
 1299|      0|                     "CPLvsnprintf() called with unsupported "
 1300|      0|                     "formatting string: %s",
 1301|      0|                     fmt_ori);
 1302|      0|        }
 1303|     22|#ifdef va_copy
 1304|     22|        va_end(wrk_args);
 1305|     22|        va_copy(wrk_args, args);
 1306|       |#else
 1307|       |        wrk_args = args;
 1308|       |#endif
 1309|     22|#if defined(HAVE_VSNPRINTF)
 1310|     22|        offset_out = vsnprintf(str, size, fmt_ori, wrk_args);
 1311|       |#else
 1312|       |        offset_out = vsprintf(str, fmt_ori, wrk_args);
 1313|       |#endif
 1314|     22|    }
 1315|       |
 1316|  18.3k|#ifdef va_copy
 1317|  18.3k|    va_end(wrk_args);
 1318|  18.3k|#endif
 1319|       |
 1320|  18.3k|    return static_cast<int>(offset_out);
 1321|  18.3k|}
CPLTestBool:
 1543|  14.5k|{
 1544|  14.5k|    return !(EQUAL(pszValue, "NO") || EQUAL(pszValue, "FALSE") ||
  ------------------
  |  |  541|  29.1k|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|  14.5k|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 14.5k, False: 3]
  |  |  ------------------
  ------------------
                  return !(EQUAL(pszValue, "NO") || EQUAL(pszValue, "FALSE") ||
  ------------------
  |  |  541|  14.5k|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      3|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 3]
  |  |  ------------------
  ------------------
 1545|  14.5k|             EQUAL(pszValue, "OFF") || EQUAL(pszValue, "0"));
  ------------------
  |  |  541|  14.5k|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      3|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 2, False: 1]
  |  |  ------------------
  ------------------
                           EQUAL(pszValue, "OFF") || EQUAL(pszValue, "0"));
  ------------------
  |  |  541|      1|#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
  |  |  ------------------
  |  |  |  |  534|      1|#define STRCASECMP(a, b) (strcasecmp(a, b))
  |  |  ------------------
  |  |  |  Branch (541:21): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 1546|  14.5k|}
CPLFetchBool:
 1616|  7.31k|{
 1617|  7.31k|    if (CSLFindString(papszStrList, pszKey) != -1)
  ------------------
  |  Branch (1617:9): [True: 0, False: 7.31k]
  ------------------
 1618|      0|        return true;
 1619|       |
 1620|  7.31k|    const char *const pszValue = CSLFetchNameValue(papszStrList, pszKey);
 1621|  7.31k|    if (pszValue == nullptr)
  ------------------
  |  Branch (1621:9): [True: 7.31k, False: 0]
  ------------------
 1622|  7.31k|        return bDefault;
 1623|       |
 1624|      0|    return CPLTestBool(pszValue);
 1625|  7.31k|}
CSLFetchNameValueDef:
 1661|  14.5k|{
 1662|  14.5k|    const char *pszResult = CSLFetchNameValue(papszStrList, pszName);
 1663|  14.5k|    if (pszResult != nullptr)
  ------------------
  |  Branch (1663:9): [True: 0, False: 14.5k]
  ------------------
 1664|      0|        return pszResult;
 1665|       |
 1666|  14.5k|    return pszDefault;
 1667|  14.5k|}
CSLFetchNameValue:
 1686|  77.6k|{
 1687|  77.6k|    if (papszStrList == nullptr || pszName == nullptr)
  ------------------
  |  Branch (1687:9): [True: 30.7k, False: 46.9k]
  |  Branch (1687:36): [True: 0, False: 46.9k]
  ------------------
 1688|  30.7k|        return nullptr;
 1689|       |
 1690|  46.9k|    const size_t nLen = strlen(pszName);
 1691|   422k|    while (*papszStrList != nullptr)
  ------------------
  |  Branch (1691:12): [True: 375k, False: 46.9k]
  ------------------
 1692|   375k|    {
 1693|   375k|        if (EQUALN(*papszStrList, pszName, nLen) &&
  ------------------
  |  |  539|   750k|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  ------------------
  |  |  |  |  536|   375k|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  ------------------
  |  |  |  Branch (539:25): [True: 2, False: 375k]
  |  |  ------------------
  ------------------
 1694|   375k|            ((*papszStrList)[nLen] == '=' || (*papszStrList)[nLen] == ':'))
  ------------------
  |  Branch (1694:14): [True: 2, False: 0]
  |  Branch (1694:46): [True: 0, False: 0]
  ------------------
 1695|      2|        {
 1696|      2|            return (*papszStrList) + nLen + 1;
 1697|      2|        }
 1698|   375k|        ++papszStrList;
 1699|   375k|    }
 1700|  46.9k|    return nullptr;
 1701|  46.9k|}
CSLFindName:
 1718|   130k|{
 1719|   130k|    if (papszStrList == nullptr || pszName == nullptr)
  ------------------
  |  Branch (1719:9): [True: 1.52k, False: 128k]
  |  Branch (1719:36): [True: 0, False: 128k]
  ------------------
 1720|  1.52k|        return -1;
 1721|       |
 1722|   128k|    const size_t nLen = strlen(pszName);
 1723|   128k|    int iIndex = 0;
 1724|  4.16M|    while (*papszStrList != nullptr)
  ------------------
  |  Branch (1724:12): [True: 4.05M, False: 106k]
  ------------------
 1725|  4.05M|    {
 1726|  4.05M|        if (EQUALN(*papszStrList, pszName, nLen) &&
  ------------------
  |  |  539|  8.11M|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  ------------------
  |  |  |  |  536|  4.05M|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  ------------------
  |  |  |  Branch (539:25): [True: 21.9k, False: 4.03M]
  |  |  ------------------
  ------------------
 1727|  4.05M|            ((*papszStrList)[nLen] == '=' || (*papszStrList)[nLen] == ':'))
  ------------------
  |  Branch (1727:14): [True: 21.9k, False: 2]
  |  Branch (1727:46): [True: 0, False: 2]
  ------------------
 1728|  21.9k|        {
 1729|  21.9k|            return iIndex;
 1730|  21.9k|        }
 1731|  4.03M|        ++iIndex;
 1732|  4.03M|        ++papszStrList;
 1733|  4.03M|    }
 1734|   106k|    return -1;
 1735|   128k|}
CSLAddNameValue:
 2017|     16|{
 2018|     16|    if (pszName == nullptr || pszValue == nullptr)
  ------------------
  |  Branch (2018:9): [True: 0, False: 16]
  |  Branch (2018:31): [True: 0, False: 16]
  ------------------
 2019|      0|        return papszStrList;
 2020|       |
 2021|     16|    const size_t nLen = strlen(pszName) + strlen(pszValue) + 2;
 2022|     16|    char *pszLine = static_cast<char *>(CPLMalloc(nLen));
 2023|     16|    snprintf(pszLine, nLen, "%s=%s", pszName, pszValue);
 2024|     16|    papszStrList = CSLAddString(papszStrList, pszLine);
 2025|     16|    CPLFree(pszLine);
  ------------------
  |  |   86|     16|#define CPLFree VSIFree
  ------------------
 2026|       |
 2027|     16|    return papszStrList;
 2028|     16|}
CSLSetNameValue:
 2056|     16|{
 2057|     16|    if (pszName == nullptr)
  ------------------
  |  Branch (2057:9): [True: 0, False: 16]
  ------------------
 2058|      0|        return papszList;
 2059|       |
 2060|     16|    size_t nLen = strlen(pszName);
 2061|     16|    while (nLen > 0 && pszName[nLen - 1] == ' ')
  ------------------
  |  Branch (2061:12): [True: 16, False: 0]
  |  Branch (2061:24): [True: 0, False: 16]
  ------------------
 2062|      0|        nLen--;
 2063|     16|    char **papszPtr = papszList;
 2064|     72|    while (papszPtr && *papszPtr != nullptr)
  ------------------
  |  Branch (2064:12): [True: 70, False: 2]
  |  Branch (2064:24): [True: 56, False: 14]
  ------------------
 2065|     56|    {
 2066|     56|        if (EQUALN(*papszPtr, pszName, nLen))
  ------------------
  |  |  539|     56|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  ------------------
  |  |  |  |  536|     56|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  ------------------
  |  |  |  Branch (539:25): [True: 0, False: 56]
  |  |  ------------------
  ------------------
 2067|      0|        {
 2068|      0|            size_t i;
 2069|      0|            for (i = nLen; (*papszPtr)[i] == ' '; ++i)
  ------------------
  |  Branch (2069:28): [True: 0, False: 0]
  ------------------
 2070|      0|            {
 2071|      0|            }
 2072|      0|            if ((*papszPtr)[i] == '=' || (*papszPtr)[i] == ':')
  ------------------
  |  Branch (2072:17): [True: 0, False: 0]
  |  Branch (2072:42): [True: 0, False: 0]
  ------------------
 2073|      0|            {
 2074|       |                // Found it.
 2075|       |                // Change the value... make sure to keep the ':' or '='.
 2076|      0|                const char cSep = (*papszPtr)[i];
 2077|       |
 2078|      0|                CPLFree(*papszPtr);
  ------------------
  |  |   86|      0|#define CPLFree VSIFree
  ------------------
 2079|       |
 2080|       |                // If the value is NULL, remove this entry completely.
 2081|      0|                if (pszValue == nullptr)
  ------------------
  |  Branch (2081:21): [True: 0, False: 0]
  ------------------
 2082|      0|                {
 2083|      0|                    while (papszPtr[1] != nullptr)
  ------------------
  |  Branch (2083:28): [True: 0, False: 0]
  ------------------
 2084|      0|                    {
 2085|      0|                        *papszPtr = papszPtr[1];
 2086|      0|                        ++papszPtr;
 2087|      0|                    }
 2088|      0|                    *papszPtr = nullptr;
 2089|      0|                }
 2090|       |
 2091|       |                // Otherwise replace with new value.
 2092|      0|                else
 2093|      0|                {
 2094|      0|                    const size_t nLen2 = strlen(pszName) + strlen(pszValue) + 2;
 2095|      0|                    *papszPtr = static_cast<char *>(CPLMalloc(nLen2));
 2096|      0|                    snprintf(*papszPtr, nLen2, "%s%c%s", pszName, cSep,
 2097|      0|                             pszValue);
 2098|      0|                }
 2099|      0|                return papszList;
 2100|      0|            }
 2101|      0|        }
 2102|     56|        ++papszPtr;
 2103|     56|    }
 2104|       |
 2105|     16|    if (pszValue == nullptr)
  ------------------
  |  Branch (2105:9): [True: 0, False: 16]
  ------------------
 2106|      0|        return papszList;
 2107|       |
 2108|       |    // The name does not exist yet.  Create a new entry.
 2109|     16|    return CSLAddNameValue(papszList, pszName, pszValue);
 2110|     16|}
CPLStrnlen:
 3116|  14.5k|{
 3117|  14.5k|    size_t nLen = 0;
 3118|   189k|    while (nLen < nMaxLen && *pszStr != '\0')
  ------------------
  |  Branch (3118:12): [True: 189k, False: 0]
  |  Branch (3118:30): [True: 175k, False: 14.5k]
  ------------------
 3119|   175k|    {
 3120|   175k|        ++nLen;
 3121|   175k|        ++pszStr;
 3122|   175k|    }
 3123|  14.5k|    return nLen;
 3124|  14.5k|}
CPLToupper:
 3155|     18|{
 3156|     18|    return (c >= 'a' && c <= 'z') ? (c - 'a' + 'A') : c;
  ------------------
  |  Branch (3156:13): [True: 0, False: 18]
  |  Branch (3156:25): [True: 0, False: 0]
  ------------------
 3157|     18|}
cpl_string.cpp:_ZL34CPLvsnprintf_get_end_of_formattingPKc:
 1057|  27.9k|{
 1058|  27.9k|    char ch = '\0';
 1059|       |    // Flag.
 1060|  33.8k|    for (; (ch = *fmt) != '\0'; ++fmt)
  ------------------
  |  Branch (1060:12): [True: 33.8k, False: 0]
  ------------------
 1061|  33.8k|    {
 1062|  33.8k|        if (ch == '\'')
  ------------------
  |  Branch (1062:13): [True: 0, False: 33.8k]
  ------------------
 1063|      0|            continue;  // Bad idea as this is locale specific.
 1064|  33.8k|        if (ch == '-' || ch == '+' || ch == ' ' || ch == '#' || ch == '0')
  ------------------
  |  Branch (1064:13): [True: 0, False: 33.8k]
  |  Branch (1064:26): [True: 0, False: 33.8k]
  |  Branch (1064:39): [True: 0, False: 33.8k]
  |  Branch (1064:52): [True: 0, False: 33.8k]
  |  Branch (1064:65): [True: 5.97k, False: 27.9k]
  ------------------
 1065|  5.97k|            continue;
 1066|  27.9k|        break;
 1067|  33.8k|    }
 1068|       |
 1069|       |    // Field width.
 1070|  33.8k|    for (; (ch = *fmt) != '\0'; ++fmt)
  ------------------
  |  Branch (1070:12): [True: 33.8k, False: 0]
  ------------------
 1071|  33.8k|    {
 1072|  33.8k|        if (ch == '$')
  ------------------
  |  Branch (1072:13): [True: 0, False: 33.8k]
  ------------------
 1073|      0|            return nullptr;  // Do not support this.
 1074|  33.8k|        if (*fmt >= '0' && *fmt <= '9')
  ------------------
  |  Branch (1074:13): [True: 33.8k, False: 0]
  |  Branch (1074:28): [True: 5.97k, False: 27.9k]
  ------------------
 1075|  5.97k|            continue;
 1076|  27.9k|        break;
 1077|  33.8k|    }
 1078|       |
 1079|       |    // Precision.
 1080|  27.9k|    if (ch == '.')
  ------------------
  |  Branch (1080:9): [True: 0, False: 27.9k]
  ------------------
 1081|      0|    {
 1082|      0|        ++fmt;
 1083|      0|        for (; (ch = *fmt) != '\0'; ++fmt)
  ------------------
  |  Branch (1083:16): [True: 0, False: 0]
  ------------------
 1084|      0|        {
 1085|      0|            if (ch == '$')
  ------------------
  |  Branch (1085:17): [True: 0, False: 0]
  ------------------
 1086|      0|                return nullptr;  // Do not support this.
 1087|      0|            if (*fmt >= '0' && *fmt <= '9')
  ------------------
  |  Branch (1087:17): [True: 0, False: 0]
  |  Branch (1087:32): [True: 0, False: 0]
  ------------------
 1088|      0|                continue;
 1089|      0|            break;
 1090|      0|        }
 1091|      0|    }
 1092|       |
 1093|       |    // Length modifier.
 1094|  28.2k|    for (; (ch = *fmt) != '\0'; ++fmt)
  ------------------
  |  Branch (1094:12): [True: 28.2k, False: 0]
  ------------------
 1095|  28.2k|    {
 1096|  28.2k|        if (ch == 'h' || ch == 'l' || ch == 'j' || ch == 'z' || ch == 't' ||
  ------------------
  |  Branch (1096:13): [True: 0, False: 28.2k]
  |  Branch (1096:26): [True: 316, False: 27.9k]
  |  Branch (1096:39): [True: 0, False: 27.9k]
  |  Branch (1096:52): [True: 0, False: 27.9k]
  |  Branch (1096:65): [True: 0, False: 27.9k]
  ------------------
 1097|  28.2k|            ch == 'L')
  ------------------
  |  Branch (1097:13): [True: 0, False: 27.9k]
  ------------------
 1098|    316|            continue;
 1099|  27.9k|        else if (ch == 'I' && fmt[1] == '6' && fmt[2] == '4')
  ------------------
  |  Branch (1099:18): [True: 0, False: 27.9k]
  |  Branch (1099:31): [True: 0, False: 0]
  |  Branch (1099:48): [True: 0, False: 0]
  ------------------
 1100|      0|            fmt += 2;
 1101|  27.9k|        else
 1102|  27.9k|            return fmt;
 1103|  28.2k|    }
 1104|       |
 1105|      0|    return nullptr;
 1106|  27.9k|}

_ZN9CPLStringC2Ev:
  319|  59.7k|        {
  320|  59.7k|        }
_ZN9CPLStringC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  324|  57.5k|        CPLString(const std::string &oStr) : std::string(oStr)
  325|  57.5k|        {
  326|  57.5k|        }
_ZN9CPLStringC2EPKc:
  330|  35.2k|        CPLString(const char *pszStr) : std::string(pszStr)
  331|  35.2k|        {
  332|  35.2k|        }
_ZNK9CPLStringcvPKcEv:
  341|  30.3k|        {
  342|  30.3k|            return c_str();
  343|  30.3k|        }
_ZN9CPLStringixEm:
  347|     36|        {
  348|     36|            return std::string::operator[](i);
  349|     36|        }
_ZNK13CPLStringList4sizeEv:
  477|  1.52k|        {
  478|  1.52k|            return Count();
  479|  1.52k|        }
_ZNK13CPLStringList4backEv:
  587|  1.52k|        {
  588|  1.52k|            return papszList[size() - 1];
  589|  1.52k|        }
_ZNK13CPLStringList8IsSortedEv:
  621|   238k|        {
  622|   238k|            return bIsSorted;
  623|   238k|        }
_ZNK3cpl11CSLIteratorneERKS0_:
  754|  7.31k|        {
  755|  7.31k|            return !(operator==(other));
  756|  7.31k|        }
_ZN3cpl18CSLIteratorWrapperC2EPKPKc:
  770|  7.31k|            : m_papszList(papszList)
  771|  7.31k|        {
  772|  7.31k|        }
_ZNK3cpl18CSLIteratorWrapper5beginEv:
  776|  7.31k|        {
  777|  7.31k|            return {m_papszList, false};
  778|  7.31k|        }
_ZNK3cpl18CSLIteratorWrapper3endEv:
  782|  7.31k|        {
  783|  7.31k|            return {m_papszList, true};
  784|  7.31k|        }
_ZN3cpl7IterateEPKPKc:
  795|  7.31k|    {
  796|  7.31k|        return CSLIteratorWrapper{papszList};
  797|  7.31k|    }

CPLAtofM:
  129|  4.29k|{
  130|  4.29k|    const int nMaxSearch = 50;
  131|       |
  132|  8.58k|    for (int i = 0; i < nMaxSearch; i++)
  ------------------
  |  Branch (132:21): [True: 8.58k, False: 0]
  ------------------
  133|  8.58k|    {
  134|  8.58k|        if (nptr[i] == ',')
  ------------------
  |  Branch (134:13): [True: 0, False: 8.58k]
  ------------------
  135|      0|            return CPLStrtodDelim(nptr, nullptr, ',');
  136|  8.58k|        if (nptr[i] == '.' || nptr[i] == '\0')
  ------------------
  |  Branch (136:13): [True: 0, False: 8.58k]
  |  Branch (136:31): [True: 4.29k, False: 4.29k]
  ------------------
  137|  4.29k|            return CPLStrtodDelim(nptr, nullptr, '.');
  138|  8.58k|    }
  139|       |
  140|      0|    return CPLStrtodDelim(nptr, nullptr, '.');
  141|  4.29k|}
CPLStrtodDelim:
  219|  4.29k|{
  220|  4.29k|    while (*nptr == ' '
  ------------------
  |  Branch (220:12): [True: 0, False: 4.29k]
  ------------------
  221|  4.29k|#ifdef USE_FAST_FLOAT
  222|       |           // The GSAG driver provides leading end-of-line character
  223|  4.29k|           || *nptr == '\r' || *nptr == '\n' || *nptr == '\t'
  ------------------
  |  Branch (223:15): [True: 0, False: 4.29k]
  |  Branch (223:32): [True: 0, False: 4.29k]
  |  Branch (223:49): [True: 0, False: 4.29k]
  ------------------
  224|  4.29k|#endif
  225|  4.29k|    )
  226|      0|    {
  227|      0|        nptr++;
  228|      0|    }
  229|       |
  230|  4.29k|    if (nptr[0] == '-')
  ------------------
  |  Branch (230:9): [True: 0, False: 4.29k]
  ------------------
  231|      0|    {
  232|      0|        if (STARTS_WITH(nptr, "-1.#QNAN") || STARTS_WITH(nptr, "-1.#IND"))
  ------------------
  |  |  550|      0|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                      if (STARTS_WITH(nptr, "-1.#QNAN") || STARTS_WITH(nptr, "-1.#IND"))
  ------------------
  |  |  550|      0|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  233|      0|        {
  234|      0|            if (endptr)
  ------------------
  |  Branch (234:17): [True: 0, False: 0]
  ------------------
  235|      0|                *endptr = const_cast<char *>(nptr) + strlen(nptr);
  236|       |            // While it is possible on some platforms to flip the sign
  237|       |            // of NAN to negative, this function will always return a positive
  238|       |            // quiet (non-signalling) NaN.
  239|      0|            return std::numeric_limits<double>::quiet_NaN();
  240|      0|        }
  241|      0|        if (
  242|       |#ifndef USE_FAST_FLOAT
  243|       |            strcmp(nptr, "-inf") == 0 ||
  244|       |#endif
  245|      0|            STARTS_WITH_CI(nptr, "-1.#INF"))
  ------------------
  |  |  552|      0|#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
  |  |  ------------------
  |  |  |  |  539|      0|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (539:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  246|      0|        {
  247|      0|            if (endptr)
  ------------------
  |  Branch (247:17): [True: 0, False: 0]
  ------------------
  248|      0|                *endptr = const_cast<char *>(nptr) + strlen(nptr);
  249|      0|            return -std::numeric_limits<double>::infinity();
  250|      0|        }
  251|      0|    }
  252|  4.29k|    else if (nptr[0] == '1')
  ------------------
  |  Branch (252:14): [True: 0, False: 4.29k]
  ------------------
  253|      0|    {
  254|      0|        if (STARTS_WITH(nptr, "1.#QNAN") || STARTS_WITH(nptr, "1.#SNAN"))
  ------------------
  |  |  550|      0|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                      if (STARTS_WITH(nptr, "1.#QNAN") || STARTS_WITH(nptr, "1.#SNAN"))
  ------------------
  |  |  550|      0|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  255|      0|        {
  256|      0|            if (endptr)
  ------------------
  |  Branch (256:17): [True: 0, False: 0]
  ------------------
  257|      0|                *endptr = const_cast<char *>(nptr) + strlen(nptr);
  258|      0|            return std::numeric_limits<double>::quiet_NaN();
  259|      0|        }
  260|      0|        if (STARTS_WITH_CI(nptr, "1.#INF"))
  ------------------
  |  |  552|      0|#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
  |  |  ------------------
  |  |  |  |  539|      0|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (539:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  261|      0|        {
  262|      0|            if (endptr)
  ------------------
  |  Branch (262:17): [True: 0, False: 0]
  ------------------
  263|      0|                *endptr = const_cast<char *>(nptr) + strlen(nptr);
  264|      0|            return std::numeric_limits<double>::infinity();
  265|      0|        }
  266|      0|    }
  267|       |#ifndef USE_FAST_FLOAT
  268|       |    else if (nptr[0] == 'i' && strcmp(nptr, "inf") == 0)
  269|       |    {
  270|       |        if (endptr)
  271|       |            *endptr = const_cast<char *>(nptr) + strlen(nptr);
  272|       |        return std::numeric_limits<double>::infinity();
  273|       |    }
  274|       |    else if (nptr[0] == 'n' && strcmp(nptr, "nan") == 0)
  275|       |    {
  276|       |        if (endptr)
  277|       |            *endptr = const_cast<char *>(nptr) + strlen(nptr);
  278|       |        return std::numeric_limits<double>::quiet_NaN();
  279|       |    }
  280|       |#endif
  281|       |
  282|  4.29k|#ifdef USE_FAST_FLOAT
  283|       |    // Skip leading '+' as non-handled by fast_float
  284|  4.29k|    if (*nptr == '+')
  ------------------
  |  Branch (284:9): [True: 0, False: 4.29k]
  ------------------
  285|      0|        nptr++;
  286|       |
  287|       |    // Find a reasonable position for the end of the string to provide to
  288|       |    // fast_float
  289|  4.29k|    const char *endptrIn = nptr;
  290|  8.58k|    while ((*endptrIn >= '0' && *endptrIn <= '9') || *endptrIn == point ||
  ------------------
  |  Branch (290:13): [True: 4.29k, False: 4.29k]
  |  Branch (290:33): [True: 4.29k, False: 0]
  |  Branch (290:54): [True: 0, False: 4.29k]
  ------------------
  291|  8.58k|           *endptrIn == '+' || *endptrIn == '-' || *endptrIn == 'e' ||
  ------------------
  |  Branch (291:12): [True: 0, False: 4.29k]
  |  Branch (291:32): [True: 0, False: 4.29k]
  |  Branch (291:52): [True: 0, False: 4.29k]
  ------------------
  292|  8.58k|           *endptrIn == 'E')
  ------------------
  |  Branch (292:12): [True: 0, False: 4.29k]
  ------------------
  293|  4.29k|    {
  294|  4.29k|        ++endptrIn;
  295|  4.29k|    }
  296|       |
  297|  4.29k|    double dfValue = 0;
  298|  4.29k|    const fast_float::parse_options options{fast_float::chars_format::general,
  299|  4.29k|                                            point};
  300|  4.29k|    auto answer =
  301|  4.29k|        fast_float::from_chars_advanced(nptr, endptrIn, dfValue, options);
  302|  4.29k|    if (answer.ec != std::errc())
  ------------------
  |  Branch (302:9): [True: 0, False: 4.29k]
  ------------------
  303|      0|    {
  304|      0|        if (
  305|       |            // Triggered by ogr_pg tests
  306|      0|            STARTS_WITH_CI(nptr, "-Infinity"))
  ------------------
  |  |  552|      0|#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
  |  |  ------------------
  |  |  |  |  539|      0|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (539:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  307|      0|        {
  308|      0|            dfValue = -std::numeric_limits<double>::infinity();
  309|      0|            answer.ptr = nptr + strlen("-Infinity");
  310|      0|        }
  311|      0|        else if (STARTS_WITH_CI(nptr, "-inf"))
  ------------------
  |  |  552|      0|#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
  |  |  ------------------
  |  |  |  |  539|      0|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (539:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  312|      0|        {
  313|      0|            dfValue = -std::numeric_limits<double>::infinity();
  314|      0|            answer.ptr = nptr + strlen("-inf");
  315|      0|        }
  316|      0|        else if (
  317|       |            // Triggered by ogr_pg tests
  318|      0|            STARTS_WITH_CI(nptr, "Infinity"))
  ------------------
  |  |  552|      0|#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
  |  |  ------------------
  |  |  |  |  539|      0|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (539:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  319|      0|        {
  320|      0|            dfValue = std::numeric_limits<double>::infinity();
  321|      0|            answer.ptr = nptr + strlen("Infinity");
  322|      0|        }
  323|      0|        else if (STARTS_WITH_CI(nptr, "inf"))
  ------------------
  |  |  552|      0|#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
  |  |  ------------------
  |  |  |  |  539|      0|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (539:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  324|      0|        {
  325|      0|            dfValue = std::numeric_limits<double>::infinity();
  326|      0|            answer.ptr = nptr + strlen("inf");
  327|      0|        }
  328|      0|        else if (STARTS_WITH_CI(nptr, "nan"))
  ------------------
  |  |  552|      0|#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
  |  |  ------------------
  |  |  |  |  539|      0|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (539:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  329|      0|        {
  330|      0|            dfValue = std::numeric_limits<double>::quiet_NaN();
  331|      0|            answer.ptr = nptr + strlen("nan");
  332|      0|        }
  333|      0|        else
  334|      0|        {
  335|      0|            errno = answer.ptr == nptr ? 0 : ERANGE;
  ------------------
  |  Branch (335:21): [True: 0, False: 0]
  ------------------
  336|      0|        }
  337|      0|    }
  338|  4.29k|    if (endptr)
  ------------------
  |  Branch (338:9): [True: 0, False: 4.29k]
  ------------------
  339|      0|    {
  340|      0|        *endptr = const_cast<char *>(answer.ptr);
  341|      0|    }
  342|       |#else
  343|       |    /* -------------------------------------------------------------------- */
  344|       |    /*  We are implementing a simple method here: copy the input string     */
  345|       |    /*  into the temporary buffer, replace the specified decimal delimiter  */
  346|       |    /*  with the one, taken from locale settings and use standard strtod()  */
  347|       |    /*  on that buffer.                                                     */
  348|       |    /* -------------------------------------------------------------------- */
  349|       |    char *pszNewNumberOrNull = CPLReplacePointByLocalePoint(nptr, point);
  350|       |    const char *pszNumber = pszNewNumberOrNull ? pszNewNumberOrNull : nptr;
  351|       |
  352|       |    const double dfValue = strtod(pszNumber, endptr);
  353|       |    const int nError = errno;
  354|       |
  355|       |    if (endptr)
  356|       |        *endptr = const_cast<char *>(nptr) + (*endptr - pszNumber);
  357|       |
  358|       |    if (pszNewNumberOrNull)
  359|       |        CPLFree(pszNewNumberOrNull);
  360|       |
  361|       |    errno = nError;
  362|       |#endif
  363|       |
  364|  4.29k|    return dfValue;
  365|  4.29k|}

VSIErrorReset:
  180|  8.83k|{
  181|  8.83k|    VSIErrorContext *psCtx = VSIGetErrorContext();
  182|  8.83k|    if (psCtx == nullptr)
  ------------------
  |  Branch (182:9): [True: 0, False: 8.83k]
  ------------------
  183|      0|        return;
  184|       |
  185|  8.83k|    psCtx->nLastErrNo = VSIE_None;
  ------------------
  |  |   29|  8.83k|#define VSIE_None 0
  ------------------
  186|  8.83k|    psCtx->szLastErrMsg[0] = '\0';
  187|  8.83k|}
cpl_vsi_error.cpp:_ZL18VSIGetErrorContextv:
   62|  8.83k|{
   63|  8.83k|    int bError = FALSE;
  ------------------
  |  | 1039|  8.83k|#define FALSE 0
  ------------------
   64|  8.83k|    VSIErrorContext *psCtx = reinterpret_cast<VSIErrorContext *>(
   65|  8.83k|        CPLGetTLSEx(CTLS_VSIERRORCONTEXT, &bError));
  ------------------
  |  |  215|  8.83k|#define CTLS_VSIERRORCONTEXT 16         /* cpl_vsi_error.cpp */
  ------------------
   66|  8.83k|    if (bError)
  ------------------
  |  Branch (66:9): [True: 0, False: 8.83k]
  ------------------
   67|      0|        return nullptr;
   68|       |
   69|  8.83k|    if (psCtx == nullptr)
  ------------------
  |  Branch (69:9): [True: 1, False: 8.83k]
  ------------------
   70|      1|    {
   71|      1|        psCtx = static_cast<VSIErrorContext *>(
   72|      1|            VSICalloc(sizeof(VSIErrorContext), 1));
   73|      1|        if (psCtx == nullptr)
  ------------------
  |  Branch (73:13): [True: 0, False: 1]
  ------------------
   74|      0|        {
   75|      0|            fprintf(stderr, /*ok*/
   76|      0|                    "Out of memory attempting to record a VSI error.\n");
   77|      0|            return nullptr;
   78|      0|        }
   79|      1|        psCtx->nLastErrNo = VSIE_None;
  ------------------
  |  |   29|      1|#define VSIE_None 0
  ------------------
   80|      1|        psCtx->nLastErrMsgMax = sizeof(psCtx->szLastErrMsg);
   81|      1|        CPLSetTLS(CTLS_VSIERRORCONTEXT, psCtx, TRUE);
  ------------------
  |  |  215|      1|#define CTLS_VSIERRORCONTEXT 16         /* cpl_vsi_error.cpp */
  ------------------
                      CPLSetTLS(CTLS_VSIERRORCONTEXT, psCtx, TRUE);
  ------------------
  |  | 1043|      1|#define TRUE 1
  ------------------
   82|      1|    }
   83|       |
   84|  8.83k|    return psCtx;
   85|  8.83k|}

_ZN10VSIMemFileC2Ev:
  245|  7.31k|{
  246|  7.31k|    time(&mTime);
  247|  7.31k|}
_ZN10VSIMemFileD2Ev:
  254|  7.31k|{
  255|  7.31k|    if (bOwnData && pabyData)
  ------------------
  |  Branch (255:9): [True: 0, False: 7.31k]
  |  Branch (255:21): [True: 0, False: 0]
  ------------------
  256|      0|        CPLFree(pabyData);
  ------------------
  |  |   86|      0|#define CPLFree VSIFree
  ------------------
  257|  7.31k|}
_ZN12VSIMemHandleD2Ev:
  350|  21.8k|{
  351|  21.8k|    VSIMemHandle::Close();
  352|  21.8k|}
_ZN12VSIMemHandle5CloseEv:
  360|  43.7k|{
  361|  43.7k|    if (poFile)
  ------------------
  |  Branch (361:9): [True: 21.8k, False: 21.8k]
  ------------------
  362|  21.8k|    {
  363|       |#ifdef DEBUG_VERBOSE
  364|       |        CPLDebug("VSIMEM", "Closing handle %p on %s: ref_count=%d (before)",
  365|       |                 this, poFile->osFilename.c_str(),
  366|       |                 static_cast<int>(poFile.use_count()));
  367|       |#endif
  368|  21.8k|        poFile = nullptr;
  369|  21.8k|    }
  370|       |
  371|  43.7k|    return 0;
  372|  43.7k|}
_ZN12VSIMemHandle4SeekEyi:
  380|  1.08M|{
  381|  1.08M|    vsi_l_offset nLength;
  382|  1.08M|    {
  383|  1.08M|        CPL_SHARED_LOCK oLock(poFile->m_oMutex);
  ------------------
  |  |   43|  1.08M|#define CPL_SHARED_LOCK std::shared_lock<std::shared_mutex>
  ------------------
  384|  1.08M|        nLength = poFile->nLength;
  385|  1.08M|    }
  386|       |
  387|  1.08M|    if (nWhence == SEEK_CUR)
  ------------------
  |  Branch (387:9): [True: 7.23k, False: 1.08M]
  ------------------
  388|  7.23k|    {
  389|  7.23k|        if (nOffset > INT_MAX)
  ------------------
  |  Branch (389:13): [True: 0, False: 7.23k]
  ------------------
  390|      0|        {
  391|       |            // printf("likely negative offset intended\n");
  392|      0|        }
  393|  7.23k|        m_nOffset += nOffset;
  394|  7.23k|    }
  395|  1.08M|    else if (nWhence == SEEK_SET)
  ------------------
  |  Branch (395:14): [True: 1.08M, False: 0]
  ------------------
  396|  1.08M|    {
  397|  1.08M|        m_nOffset = nOffset;
  398|  1.08M|    }
  399|      0|    else if (nWhence == SEEK_END)
  ------------------
  |  Branch (399:14): [True: 0, False: 0]
  ------------------
  400|      0|    {
  401|      0|        m_nOffset = nLength + nOffset;
  402|      0|    }
  403|      0|    else
  404|      0|    {
  405|      0|        errno = EINVAL;
  406|      0|        return -1;
  407|      0|    }
  408|       |
  409|  1.08M|    bEOF = false;
  410|       |
  411|  1.08M|    return 0;
  412|  1.08M|}
_ZN12VSIMemHandle4ReadEPvmm:
  430|  4.36M|{
  431|  4.36M|    const vsi_l_offset nOffset = m_nOffset;
  432|       |
  433|  4.36M|    size_t nBytesToRead = nSize * nCount;
  434|  4.36M|    if (nBytesToRead == 0)
  ------------------
  |  Branch (434:9): [True: 0, False: 4.36M]
  ------------------
  435|      0|        return 0;
  436|       |
  437|  4.36M|    if (nCount > 0 && nBytesToRead / nCount != nSize)
  ------------------
  |  Branch (437:9): [True: 4.36M, False: 0]
  |  Branch (437:23): [True: 0, False: 4.36M]
  ------------------
  438|      0|    {
  439|      0|        bEOF = true;
  440|      0|        return 0;
  441|      0|    }
  442|       |
  443|  4.36M|    if (!m_bReadAllowed)
  ------------------
  |  Branch (443:9): [True: 0, False: 4.36M]
  ------------------
  444|      0|    {
  445|      0|        m_bError = true;
  446|      0|        return 0;
  447|      0|    }
  448|       |
  449|  4.36M|    bool bEOFTmp = bEOF;
  450|       |    // Do not access/modify bEOF under the lock to avoid confusing Coverity
  451|       |    // Scan since we access it in other methods outside of the lock.
  452|  4.36M|    const auto DoUnderLock =
  453|  4.36M|        [this, nOffset, pBuffer, nSize, &nBytesToRead, &nCount, &bEOFTmp]
  454|  4.36M|    {
  455|  4.36M|        CPL_SHARED_LOCK oLock(poFile->m_oMutex);
  456|       |
  457|  4.36M|        if (poFile->nLength <= nOffset || nBytesToRead + nOffset < nBytesToRead)
  458|  4.36M|        {
  459|  4.36M|            bEOFTmp = true;
  460|  4.36M|            return false;
  461|  4.36M|        }
  462|  4.36M|        if (nBytesToRead + nOffset > poFile->nLength)
  463|  4.36M|        {
  464|  4.36M|            nBytesToRead = static_cast<size_t>(poFile->nLength - nOffset);
  465|  4.36M|            nCount = nBytesToRead / nSize;
  466|  4.36M|            bEOFTmp = true;
  467|  4.36M|        }
  468|       |
  469|  4.36M|        if (nBytesToRead)
  470|  4.36M|            memcpy(pBuffer, poFile->pabyData + nOffset,
  471|  4.36M|                   static_cast<size_t>(nBytesToRead));
  472|  4.36M|        return true;
  473|  4.36M|    };
  474|       |
  475|  4.36M|    bool bRet = DoUnderLock();
  476|  4.36M|    bEOF = bEOFTmp;
  477|  4.36M|    if (!bRet)
  ------------------
  |  Branch (477:9): [True: 4.29k, False: 4.36M]
  ------------------
  478|  4.29k|        return 0;
  479|       |
  480|  4.36M|    m_nOffset += nBytesToRead;
  481|       |
  482|  4.36M|    return nCount;
  483|  4.36M|}
_ZN23VSIMemFilesystemHandler4OpenEPKcS1_bPKS1_:
  634|  14.5k|{
  635|  14.5k|    CPLMutexHolder oHolder(&hMutex);
  636|  14.5k|    const std::string osFilename = NormalizePath(pszFilename);
  637|  14.5k|    if (osFilename.empty())
  ------------------
  |  Branch (637:9): [True: 0, False: 14.5k]
  ------------------
  638|      0|        return nullptr;
  639|       |
  640|  14.5k|    vsi_l_offset nMaxLength = GUINTBIG_MAX;
  ------------------
  |  |  216|  14.5k|    ((CPL_STATIC_CAST(GUIntBig, 0xFFFFFFFFU) << 32) | 0xFFFFFFFFU)
  |  |  ------------------
  |  |  |  |  191|  14.5k|#define CPL_STATIC_CAST(type, expr) static_cast<type>(expr)
  |  |  ------------------
  ------------------
  641|  14.5k|    const size_t iPos = osFilename.find("||maxlength=");
  642|  14.5k|    if (iPos != std::string::npos)
  ------------------
  |  Branch (642:9): [True: 0, False: 14.5k]
  ------------------
  643|      0|    {
  644|      0|        nMaxLength = static_cast<vsi_l_offset>(CPLAtoGIntBig(
  645|      0|            osFilename.substr(iPos + strlen("||maxlength=")).c_str()));
  646|      0|    }
  647|       |
  648|       |    /* -------------------------------------------------------------------- */
  649|       |    /*      Get the filename we are opening, create if needed.              */
  650|       |    /* -------------------------------------------------------------------- */
  651|  14.5k|    std::shared_ptr<VSIMemFile> poFile = nullptr;
  652|  14.5k|    const auto oIter = oFileList.find(osFilename);
  653|  14.5k|    if (oIter != oFileList.end())
  ------------------
  |  Branch (653:9): [True: 14.5k, False: 0]
  ------------------
  654|  14.5k|    {
  655|  14.5k|        poFile = oIter->second;
  656|  14.5k|    }
  657|       |
  658|       |    // If no file and opening in read, error out.
  659|  14.5k|    if (strstr(pszAccess, "w") == nullptr &&
  ------------------
  |  Branch (659:9): [True: 14.5k, False: 0]
  ------------------
  660|  14.5k|        strstr(pszAccess, "a") == nullptr && poFile == nullptr)
  ------------------
  |  Branch (660:9): [True: 14.5k, False: 0]
  |  Branch (660:46): [True: 0, False: 14.5k]
  ------------------
  661|      0|    {
  662|      0|        if (bSetError)
  ------------------
  |  Branch (662:13): [True: 0, False: 0]
  ------------------
  663|      0|        {
  664|      0|            VSIError(VSIE_FileError, "No such file or directory");
  ------------------
  |  |   30|      0|#define VSIE_FileError 1
  ------------------
  665|      0|        }
  666|      0|        errno = ENOENT;
  667|      0|        return nullptr;
  668|      0|    }
  669|       |
  670|       |    // Create.
  671|  14.5k|    if (poFile == nullptr)
  ------------------
  |  Branch (671:9): [True: 0, False: 14.5k]
  ------------------
  672|      0|    {
  673|      0|        const std::string osFileDir = CPLGetPathSafe(osFilename.c_str());
  674|      0|        if (VSIMkdirRecursive(osFileDir.c_str(), 0755) == -1)
  ------------------
  |  Branch (674:13): [True: 0, False: 0]
  ------------------
  675|      0|        {
  676|      0|            if (bSetError)
  ------------------
  |  Branch (676:17): [True: 0, False: 0]
  ------------------
  677|      0|            {
  678|      0|                VSIError(VSIE_FileError,
  ------------------
  |  |   30|      0|#define VSIE_FileError 1
  ------------------
  679|      0|                         "Could not create directory %s for writing",
  680|      0|                         osFileDir.c_str());
  681|      0|            }
  682|      0|            errno = ENOENT;
  683|      0|            return nullptr;
  684|      0|        }
  685|       |
  686|      0|        poFile = std::make_shared<VSIMemFile>();
  687|      0|        poFile->osFilename = osFilename;
  688|      0|        oFileList[poFile->osFilename] = poFile;
  689|       |#ifdef DEBUG_VERBOSE
  690|       |        CPLDebug("VSIMEM", "Creating file %s: ref_count=%d", pszFilename,
  691|       |                 static_cast<int>(poFile.use_count()));
  692|       |#endif
  693|      0|        poFile->nMaxLength = nMaxLength;
  694|      0|    }
  695|       |    // Overwrite
  696|  14.5k|    else if (strstr(pszAccess, "w"))
  ------------------
  |  Branch (696:14): [True: 0, False: 14.5k]
  ------------------
  697|      0|    {
  698|      0|        CPL_EXCLUSIVE_LOCK oLock(poFile->m_oMutex);
  ------------------
  |  |   44|      0|#define CPL_EXCLUSIVE_LOCK std::unique_lock<std::shared_mutex>
  ------------------
  699|      0|        poFile->SetLength(0);
  700|      0|        poFile->nMaxLength = nMaxLength;
  701|      0|    }
  702|       |
  703|  14.5k|    if (poFile->bIsDirectory)
  ------------------
  |  Branch (703:9): [True: 0, False: 14.5k]
  ------------------
  704|      0|    {
  705|      0|        errno = EISDIR;
  706|      0|        return nullptr;
  707|      0|    }
  708|       |
  709|       |    /* -------------------------------------------------------------------- */
  710|       |    /*      Setup the file handle on this file.                             */
  711|       |    /* -------------------------------------------------------------------- */
  712|  14.5k|    VSIMemHandle *poHandle = new VSIMemHandle;
  713|       |
  714|  14.5k|    poHandle->poFile = poFile;
  715|  14.5k|    poHandle->m_nOffset = 0;
  716|  14.5k|    poHandle->bEOF = false;
  717|  14.5k|    poHandle->bUpdate = strchr(pszAccess, 'w') || strchr(pszAccess, '+') ||
  ------------------
  |  Branch (717:25): [True: 0, False: 14.5k]
  |  Branch (717:51): [True: 0, False: 14.5k]
  ------------------
  718|  14.5k|                        strchr(pszAccess, 'a');
  ------------------
  |  Branch (718:25): [True: 0, False: 14.5k]
  ------------------
  719|  14.5k|    poHandle->m_bReadAllowed = strchr(pszAccess, 'r') || strchr(pszAccess, '+');
  ------------------
  |  Branch (719:32): [True: 14.5k, False: 0]
  |  Branch (719:58): [True: 0, False: 0]
  ------------------
  720|       |
  721|       |#ifdef DEBUG_VERBOSE
  722|       |    CPLDebug("VSIMEM", "Opening handle %p on %s: ref_count=%d", poHandle,
  723|       |             pszFilename, static_cast<int>(poFile.use_count()));
  724|       |#endif
  725|  14.5k|    if (strchr(pszAccess, 'a'))
  ------------------
  |  Branch (725:9): [True: 0, False: 14.5k]
  ------------------
  726|      0|    {
  727|      0|        vsi_l_offset nOffset;
  728|      0|        {
  729|      0|            CPL_SHARED_LOCK oLock(poFile->m_oMutex);
  ------------------
  |  |   43|      0|#define CPL_SHARED_LOCK std::shared_lock<std::shared_mutex>
  ------------------
  730|      0|            nOffset = poFile->nLength;
  731|      0|        }
  732|      0|        poHandle->m_nOffset = nOffset;
  733|      0|    }
  734|       |
  735|  14.5k|    return poHandle;
  736|  14.5k|}
_ZN23VSIMemFilesystemHandler4StatEPKcP6stat64i:
  745|  10.3k|{
  746|  10.3k|    CPLMutexHolder oHolder(&hMutex);
  747|       |
  748|  10.3k|    const std::string osFilename = NormalizePath(pszFilename);
  749|       |
  750|  10.3k|    memset(pStatBuf, 0, sizeof(VSIStatBufL));
  751|       |
  752|  10.3k|    if (osFilename == m_osPrefix || osFilename + '/' == m_osPrefix)
  ------------------
  |  Branch (752:9): [True: 0, False: 10.3k]
  |  Branch (752:9): [True: 7.31k, False: 3.05k]
  |  Branch (752:37): [True: 7.31k, False: 3.05k]
  ------------------
  753|  7.31k|    {
  754|  7.31k|        pStatBuf->st_size = 0;
  755|  7.31k|        pStatBuf->st_mode = S_IFDIR;
  756|  7.31k|        return 0;
  757|  7.31k|    }
  758|       |
  759|  3.05k|    auto oIter = oFileList.find(osFilename);
  760|  3.05k|    if (oIter == oFileList.end())
  ------------------
  |  Branch (760:9): [True: 3.05k, False: 0]
  ------------------
  761|  3.05k|    {
  762|  3.05k|        errno = ENOENT;
  763|  3.05k|        return -1;
  764|  3.05k|    }
  765|       |
  766|      0|    std::shared_ptr<VSIMemFile> poFile = oIter->second;
  767|       |
  768|      0|    memset(pStatBuf, 0, sizeof(VSIStatBufL));
  769|       |
  770|      0|    CPL_SHARED_LOCK oLock(poFile->m_oMutex);
  ------------------
  |  |   43|      0|#define CPL_SHARED_LOCK std::shared_lock<std::shared_mutex>
  ------------------
  771|      0|    if (poFile->bIsDirectory)
  ------------------
  |  Branch (771:9): [True: 0, False: 0]
  ------------------
  772|      0|    {
  773|      0|        pStatBuf->st_size = 0;
  774|      0|        pStatBuf->st_mode = S_IFDIR;
  775|      0|    }
  776|      0|    else
  777|      0|    {
  778|      0|        pStatBuf->st_size = poFile->nLength;
  779|      0|        pStatBuf->st_mode = S_IFREG;
  780|      0|        if (const char *mtime =
  ------------------
  |  Branch (780:25): [True: 0, False: 0]
  ------------------
  781|      0|                CPLGetConfigOption("CPL_VSI_MEM_MTIME", nullptr))
  782|      0|        {
  783|      0|            pStatBuf->st_mtime =
  784|      0|                static_cast<time_t>(std::strtoll(mtime, nullptr, 10));
  785|      0|        }
  786|      0|        else
  787|      0|        {
  788|      0|            pStatBuf->st_mtime = poFile->mTime;
  789|      0|        }
  790|      0|    }
  791|       |
  792|      0|    return 0;
  793|  3.05k|}
_ZN23VSIMemFilesystemHandler6UnlinkEPKc:
  801|  7.31k|{
  802|  7.31k|    CPLMutexHolder oHolder(&hMutex);
  803|  7.31k|    return Unlink_unlocked(pszFilename);
  804|  7.31k|}
_ZN23VSIMemFilesystemHandler15Unlink_unlockedEPKc:
  812|  14.6k|{
  813|  14.6k|    const std::string osFilename = NormalizePath(pszFilename);
  814|       |
  815|  14.6k|    auto oIter = oFileList.find(osFilename);
  816|  14.6k|    if (oIter == oFileList.end())
  ------------------
  |  Branch (816:9): [True: 7.31k, False: 7.31k]
  ------------------
  817|  7.31k|    {
  818|  7.31k|        errno = ENOENT;
  819|  7.31k|        return -1;
  820|  7.31k|    }
  821|       |
  822|       |#ifdef DEBUG_VERBOSE
  823|       |    std::shared_ptr<VSIMemFile> poFile = oIter->second;
  824|       |    CPLDebug("VSIMEM", "Unlink %s: ref_count=%d (before)", pszFilename,
  825|       |             static_cast<int>(poFile.use_count()));
  826|       |#endif
  827|  7.31k|    oFileList.erase(oIter);
  828|       |
  829|  7.31k|    return 0;
  830|  14.6k|}
_ZN23VSIMemFilesystemHandler13NormalizePathERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1099|  46.8k|{
 1100|  46.8k|    CPLString s(in);
 1101|  46.8k|    std::replace(s.begin(), s.end(), '\\', '/');
 1102|  46.8k|    s.replaceAll("//", '/');
 1103|  46.8k|    if (!s.empty() && s.back() == '/')
  ------------------
  |  Branch (1103:9): [True: 46.8k, False: 0]
  |  Branch (1103:23): [True: 0, False: 46.8k]
  ------------------
 1104|      0|        s.pop_back();
 1105|       |#if __GNUC__ >= 13
 1106|       |    // gcc 13 complains about below explicit std::move()
 1107|       |    return s;
 1108|       |#else
 1109|       |    // Android NDK (and probably other compilers) warn about
 1110|       |    // "warning: local variable 's' will be copied despite being returned by name [-Wreturn-std-move]"
 1111|       |    // if not specifying std::move()
 1112|  46.8k|    return std::move(s);
 1113|  46.8k|#endif
 1114|  46.8k|}
VSIInstallMemFileHandler:
 1182|      2|{
 1183|      2|    VSIFileManager::InstallHandler("/vsimem/",
 1184|      2|                                   new VSIMemFilesystemHandler("/vsimem/"));
 1185|      2|}
VSIFileFromMemBuffer:
 1217|  7.31k|{
 1218|  7.31k|    if (VSIFileManager::GetHandler("") ==
  ------------------
  |  Branch (1218:9): [True: 0, False: 7.31k]
  ------------------
 1219|  7.31k|        VSIFileManager::GetHandler("/vsimem/"))
 1220|      0|        VSIInstallMemFileHandler();
 1221|       |
 1222|  7.31k|    VSIMemFilesystemHandler *poHandler = static_cast<VSIMemFilesystemHandler *>(
 1223|  7.31k|        VSIFileManager::GetHandler("/vsimem/"));
 1224|       |
 1225|  7.31k|    const CPLString osFilename =
 1226|  7.31k|        pszFilename ? VSIMemFilesystemHandler::NormalizePath(pszFilename)
  ------------------
  |  Branch (1226:9): [True: 7.31k, False: 0]
  ------------------
 1227|  7.31k|                    : std::string();
 1228|  7.31k|    if (osFilename == "/vsimem/")
  ------------------
  |  Branch (1228:9): [True: 0, False: 7.31k]
  ------------------
 1229|      0|    {
 1230|      0|        CPLDebug("VSIMEM", "VSIFileFromMemBuffer(): illegal filename: %s",
 1231|      0|                 pszFilename);
 1232|      0|        return nullptr;
 1233|      0|    }
 1234|       |
 1235|       |    // Try to create the parent directory, if needed, before taking
 1236|       |    // ownership of pabyData.
 1237|  7.31k|    if (!osFilename.empty())
  ------------------
  |  Branch (1237:9): [True: 7.31k, False: 0]
  ------------------
 1238|  7.31k|    {
 1239|  7.31k|        const std::string osFileDir = CPLGetPathSafe(osFilename.c_str());
 1240|  7.31k|        if (VSIMkdirRecursive(osFileDir.c_str(), 0755) == -1)
  ------------------
  |  Branch (1240:13): [True: 0, False: 7.31k]
  ------------------
 1241|      0|        {
 1242|      0|            VSIError(VSIE_FileError,
  ------------------
  |  |   30|      0|#define VSIE_FileError 1
  ------------------
 1243|      0|                     "Could not create directory %s for writing",
 1244|      0|                     osFileDir.c_str());
 1245|      0|            errno = ENOENT;
 1246|      0|            return nullptr;
 1247|      0|        }
 1248|  7.31k|    }
 1249|       |
 1250|  7.31k|    std::shared_ptr<VSIMemFile> poFile = std::make_shared<VSIMemFile>();
 1251|       |
 1252|  7.31k|    poFile->osFilename = osFilename;
 1253|  7.31k|    poFile->bOwnData = CPL_TO_BOOL(bTakeOwnership);
 1254|  7.31k|    poFile->pabyData = pabyData;
 1255|  7.31k|    poFile->nLength = nDataLength;
 1256|  7.31k|    poFile->nAllocLength = nDataLength;
 1257|       |
 1258|  7.31k|    if (!osFilename.empty())
  ------------------
  |  Branch (1258:9): [True: 7.31k, False: 0]
  ------------------
 1259|  7.31k|    {
 1260|  7.31k|        CPLMutexHolder oHolder(&poHandler->hMutex);
 1261|  7.31k|        poHandler->Unlink_unlocked(osFilename);
 1262|  7.31k|        poHandler->oFileList[poFile->osFilename] = poFile;
 1263|       |#ifdef DEBUG_VERBOSE
 1264|       |        CPLDebug("VSIMEM", "VSIFileFromMemBuffer() %s: ref_count=%d (after)",
 1265|       |                 poFile->osFilename.c_str(),
 1266|       |                 static_cast<int>(poFile.use_count()));
 1267|       |#endif
 1268|  7.31k|    }
 1269|       |
 1270|       |    /* -------------------------------------------------------------------- */
 1271|       |    /*      Setup the file handle on this file.                             */
 1272|       |    /* -------------------------------------------------------------------- */
 1273|  7.31k|    VSIMemHandle *poHandle = new VSIMemHandle;
 1274|       |
 1275|  7.31k|    poHandle->poFile = std::move(poFile);
 1276|  7.31k|    poHandle->bUpdate = true;
 1277|  7.31k|    poHandle->m_bReadAllowed = true;
 1278|  7.31k|    return poHandle;
 1279|  7.31k|}
cpl_vsi_mem.cpp:_ZZN12VSIMemHandle4ReadEPvmmENK3$_0clEv:
  454|  4.36M|    {
  455|  4.36M|        CPL_SHARED_LOCK oLock(poFile->m_oMutex);
  ------------------
  |  |   43|  4.36M|#define CPL_SHARED_LOCK std::shared_lock<std::shared_mutex>
  ------------------
  456|       |
  457|  4.36M|        if (poFile->nLength <= nOffset || nBytesToRead + nOffset < nBytesToRead)
  ------------------
  |  Branch (457:13): [True: 4.29k, False: 4.36M]
  |  Branch (457:43): [True: 0, False: 4.36M]
  ------------------
  458|  4.29k|        {
  459|  4.29k|            bEOFTmp = true;
  460|  4.29k|            return false;
  461|  4.29k|        }
  462|  4.36M|        if (nBytesToRead + nOffset > poFile->nLength)
  ------------------
  |  Branch (462:13): [True: 68.7k, False: 4.29M]
  ------------------
  463|  68.7k|        {
  464|  68.7k|            nBytesToRead = static_cast<size_t>(poFile->nLength - nOffset);
  465|  68.7k|            nCount = nBytesToRead / nSize;
  466|  68.7k|            bEOFTmp = true;
  467|  68.7k|        }
  468|       |
  469|  4.36M|        if (nBytesToRead)
  ------------------
  |  Branch (469:13): [True: 4.36M, False: 0]
  ------------------
  470|  4.36M|            memcpy(pBuffer, poFile->pabyData + nOffset,
  471|  4.36M|                   static_cast<size_t>(nBytesToRead));
  472|  4.36M|        return true;
  473|  4.36M|    };
_ZN12VSIMemHandleC2Ev:
  163|  21.8k|    VSIMemHandle() = default;
_ZN23VSIMemFilesystemHandlerC2EPKc:
  201|      2|        : m_osPrefix(pszPrefix)
  202|      2|    {
  203|      2|    }

_ZN16VSIVirtualHandleD2Ev:
  138|  21.8k|    {
  139|  21.8k|    }
_ZN20VSIFilesystemHandler12SiblingFilesEPKc:
  223|  7.31k|    {
  224|  7.31k|        return nullptr;
  225|  7.31k|    }
_ZN20VSIFilesystemHandler21GetDirectorySeparatorEPKc:
  394|      8|    {
  395|      8|        return "/";
  396|      8|    }

VSISiblingFiles:
  136|  7.31k|{
  137|  7.31k|    VSIFilesystemHandler *poFSHandler = VSIFileManager::GetHandler(pszFilename);
  138|       |
  139|  7.31k|    return poFSHandler->SiblingFiles(pszFilename);
  140|  7.31k|}
VSIGetDirectorySeparator:
  420|      8|{
  421|      8|    if (STARTS_WITH(pszPath, "http://") || STARTS_WITH(pszPath, "https://"))
  ------------------
  |  |  550|     16|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 8]
  |  |  ------------------
  ------------------
                  if (STARTS_WITH(pszPath, "http://") || STARTS_WITH(pszPath, "https://"))
  ------------------
  |  |  550|      8|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 8]
  |  |  ------------------
  ------------------
  422|      0|        return "/";
  423|       |
  424|      8|    VSIFilesystemHandler *poFSHandler = VSIFileManager::GetHandler(pszPath);
  425|      8|    return poFSHandler->GetDirectorySeparator(pszPath);
  426|      8|}
VSIMkdirRecursive:
  649|  7.31k|{
  650|  7.31k|    if (pszPathname == nullptr || pszPathname[0] == '\0' ||
  ------------------
  |  Branch (650:9): [True: 0, False: 7.31k]
  |  Branch (650:35): [True: 0, False: 7.31k]
  ------------------
  651|  7.31k|        strncmp("/", pszPathname, 2) == 0)
  ------------------
  |  Branch (651:9): [True: 0, False: 7.31k]
  ------------------
  652|      0|    {
  653|      0|        return -1;
  654|      0|    }
  655|       |
  656|  7.31k|    const CPLString osPathname(pszPathname);
  657|  7.31k|    VSIStatBufL sStat;
  658|  7.31k|    if (VSIStatL(osPathname, &sStat) == 0)
  ------------------
  |  Branch (658:9): [True: 7.31k, False: 0]
  ------------------
  659|  7.31k|    {
  660|  7.31k|        return VSI_ISDIR(sStat.st_mode) ? 0 : -1;
  ------------------
  |  |  115|  7.31k|#define VSI_ISDIR(x) S_ISDIR(x)
  ------------------
  661|  7.31k|    }
  662|      0|    const std::string osParentPath(CPLGetPathSafe(osPathname));
  663|       |
  664|       |    // Prevent crazy paths from recursing forever.
  665|      0|    if (osParentPath == osPathname ||
  ------------------
  |  Branch (665:9): [True: 0, False: 0]
  ------------------
  666|      0|        osParentPath.length() >= osPathname.length())
  ------------------
  |  Branch (666:9): [True: 0, False: 0]
  ------------------
  667|      0|    {
  668|      0|        return -1;
  669|      0|    }
  670|       |
  671|      0|    if (!osParentPath.empty() && VSIStatL(osParentPath.c_str(), &sStat) != 0)
  ------------------
  |  Branch (671:9): [True: 0, False: 0]
  |  Branch (671:34): [True: 0, False: 0]
  ------------------
  672|      0|    {
  673|      0|        if (VSIMkdirRecursive(osParentPath.c_str(), mode) != 0)
  ------------------
  |  Branch (673:13): [True: 0, False: 0]
  ------------------
  674|      0|            return -1;
  675|      0|    }
  676|       |
  677|      0|    return VSIMkdir(osPathname, mode);
  678|      0|}
VSIUnlink:
  701|  7.31k|{
  702|  7.31k|    VSIFilesystemHandler *poFSHandler = VSIFileManager::GetHandler(pszFilename);
  703|       |
  704|  7.31k|    return poFSHandler->Unlink(pszFilename);
  705|  7.31k|}
VSIStatL:
 1538|  7.31k|{
 1539|  7.31k|    return VSIStatExL(pszFilename, psStatBuf, 0);
 1540|  7.31k|}
VSIStatExL:
 1578|  10.3k|{
 1579|  10.3k|    char szAltPath[4] = {'\0'};
 1580|       |
 1581|       |    // Enable to work on "C:" as if it were "C:\".
 1582|  10.3k|    if (pszFilename[0] != '\0' && pszFilename[1] == ':' &&
  ------------------
  |  Branch (1582:9): [True: 10.3k, False: 0]
  |  Branch (1582:35): [True: 0, False: 10.3k]
  ------------------
 1583|  10.3k|        pszFilename[2] == '\0')
  ------------------
  |  Branch (1583:9): [True: 0, False: 0]
  ------------------
 1584|      0|    {
 1585|      0|        szAltPath[0] = pszFilename[0];
 1586|      0|        szAltPath[1] = pszFilename[1];
 1587|      0|        szAltPath[2] = '\\';
 1588|      0|        szAltPath[3] = '\0';
 1589|       |
 1590|      0|        pszFilename = szAltPath;
 1591|      0|    }
 1592|       |
 1593|  10.3k|    VSIFilesystemHandler *poFSHandler = VSIFileManager::GetHandler(pszFilename);
 1594|       |
 1595|  10.3k|    if (nFlags == 0)
  ------------------
  |  Branch (1595:9): [True: 7.31k, False: 3.05k]
  ------------------
 1596|  7.31k|        nFlags =
 1597|  7.31k|            VSI_STAT_EXISTS_FLAG | VSI_STAT_NATURE_FLAG | VSI_STAT_SIZE_FLAG;
  ------------------
  |  |  194|  7.31k|#define VSI_STAT_EXISTS_FLAG 0x1
  ------------------
                          VSI_STAT_EXISTS_FLAG | VSI_STAT_NATURE_FLAG | VSI_STAT_SIZE_FLAG;
  ------------------
  |  |  196|  7.31k|#define VSI_STAT_NATURE_FLAG 0x2
  ------------------
                          VSI_STAT_EXISTS_FLAG | VSI_STAT_NATURE_FLAG | VSI_STAT_SIZE_FLAG;
  ------------------
  |  |  198|  7.31k|#define VSI_STAT_SIZE_FLAG 0x4
  ------------------
 1598|       |
 1599|  10.3k|    return poFSHandler->Stat(pszFilename, psStatBuf, nFlags);
 1600|  10.3k|}
VSIFOpenL:
 2025|  7.27k|{
 2026|  7.27k|    return VSIFOpenExL(pszFilename, pszAccess, false);
 2027|  7.27k|}
VSIFOpenExL:
 2716|  14.5k|{
 2717|  14.5k|    return VSIFOpenEx2L(pszFilename, pszAccess, bSetError, nullptr);
 2718|  14.5k|}
VSIFOpenEx2L:
 2790|  14.5k|{
 2791|       |    // Too long filenames can cause excessive memory allocation due to
 2792|       |    // recursion in some filesystem handlers
 2793|  14.5k|    constexpr size_t knMaxPath = 8192;
 2794|  14.5k|    if (CPLStrnlen(pszFilename, knMaxPath) == knMaxPath)
  ------------------
  |  Branch (2794:9): [True: 0, False: 14.5k]
  ------------------
 2795|      0|        return nullptr;
 2796|       |
 2797|  14.5k|    VSIFilesystemHandler *poFSHandler = VSIFileManager::GetHandler(pszFilename);
 2798|       |
 2799|  14.5k|    VSILFILE *fp = poFSHandler->Open(pszFilename, pszAccess,
 2800|  14.5k|                                     CPL_TO_BOOL(bSetError), papszOptions);
 2801|       |
 2802|  14.5k|    VSIDebug4("VSIFOpenEx2L(%s,%s,%d) = %p", pszFilename, pszAccess, bSetError,
  ------------------
  |  |  818|  14.5k|    {                                                                          \
  |  |  819|  14.5k|    }
  ------------------
 2803|  14.5k|              fp);
 2804|       |
 2805|  14.5k|    return fp;
 2806|  14.5k|}
VSIFCloseL:
 2844|  21.8k|{
 2845|  21.8k|    VSIDebug1("VSIFCloseL(%p)", fp);
  ------------------
  |  |  827|  21.8k|    {                                                                          \
  |  |  828|  21.8k|    }
  ------------------
 2846|       |
 2847|  21.8k|    const int nResult = fp->Close();
 2848|       |
 2849|  21.8k|    delete fp;
 2850|       |
 2851|  21.8k|    return nResult;
 2852|  21.8k|}
VSIFSeekL:
 2902|  1.08M|{
 2903|  1.08M|    return fp->Seek(nOffset, nWhence);
 2904|  1.08M|}
VSIRewindL:
 2963|  29.0k|{
 2964|  29.0k|    CPL_IGNORE_RET_VAL(VSIFSeekL(fp, 0, SEEK_SET));
 2965|  29.0k|}
VSIFReadL:
 3066|  4.36M|{
 3067|  4.36M|    return fp->Read(pBuffer, nSize, nCount);
 3068|  4.36M|}
VSIGetPathSpecificOption:
 3974|  7.31k|{
 3975|  7.31k|    {
 3976|  7.31k|        std::lock_guard<std::mutex> oLock(oMutexPathSpecificOptions);
 3977|  7.31k|        for (auto it = oMapPathSpecificOptions.rbegin();
 3978|  7.31k|             it != oMapPathSpecificOptions.rend(); ++it)
  ------------------
  |  Branch (3978:14): [True: 0, False: 7.31k]
  ------------------
 3979|      0|        {
 3980|      0|            if (STARTS_WITH(pszPath, it->first.c_str()))
  ------------------
  |  |  550|      0|#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (550:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3981|      0|            {
 3982|      0|                auto oIter = it->second.find(CPLString(pszKey).toupper());
 3983|      0|                if (oIter != it->second.end())
  ------------------
  |  Branch (3983:21): [True: 0, False: 0]
  ------------------
 3984|      0|                    return oIter->second.c_str();
 3985|      0|            }
 3986|      0|        }
 3987|  7.31k|    }
 3988|  7.31k|    return CPLGetConfigOption(pszKey, pszDefault);
 3989|  7.31k|}
_ZN14VSIFileManagerC2Ev:
 4060|      2|VSIFileManager::VSIFileManager() : poDefaultHandler(nullptr)
 4061|      2|{
 4062|      2|}
_ZN14VSIFileManager3GetEv:
 4093|  61.5k|{
 4094|  61.5k|    CPLMutexHolder oHolder(&hVSIFileManagerMutex);
 4095|  61.5k|    if (poManager != nullptr)
  ------------------
  |  Branch (4095:9): [True: 61.5k, False: 2]
  ------------------
 4096|  61.5k|    {
 4097|  61.5k|        return poManager;
 4098|  61.5k|    }
 4099|       |
 4100|      2|    poManager = new VSIFileManager;
 4101|      2|    VSIInstallLargeFileHandler();
 4102|      2|    VSIInstallSubFileHandler();
 4103|      2|    VSIInstallMemFileHandler();
 4104|      2|#ifdef HAVE_LIBZ
 4105|      2|    VSIInstallGZipFileHandler();
 4106|      2|    VSIInstallZipFileHandler();
 4107|      2|#endif
 4108|       |#ifdef HAVE_LIBARCHIVE
 4109|       |    VSIInstall7zFileHandler();
 4110|       |    VSIInstallRarFileHandler();
 4111|       |#endif
 4112|      2|#ifdef HAVE_CURL
 4113|      2|    VSIInstallCurlFileHandler();
 4114|      2|    VSIInstallCurlStreamingFileHandler();
 4115|      2|    VSIInstallS3FileHandler();
 4116|      2|    VSIInstallS3StreamingFileHandler();
 4117|      2|    VSIInstallGSFileHandler();
 4118|      2|    VSIInstallGSStreamingFileHandler();
 4119|      2|    VSIInstallAzureFileHandler();
 4120|      2|    VSIInstallAzureStreamingFileHandler();
 4121|      2|    VSIInstallADLSFileHandler();
 4122|      2|    VSIInstallOSSFileHandler();
 4123|      2|    VSIInstallOSSStreamingFileHandler();
 4124|      2|    VSIInstallSwiftFileHandler();
 4125|      2|    VSIInstallSwiftStreamingFileHandler();
 4126|      2|    VSIInstallWebHdfsHandler();
 4127|      2|#endif
 4128|      2|    VSIInstallStdinHandler();
 4129|      2|    VSIInstallHdfsHandler();
 4130|      2|    VSIInstallStdoutHandler();
 4131|      2|    VSIInstallSparseFileHandler();
 4132|      2|    VSIInstallTarFileHandler();
 4133|      2|    VSIInstallCachedFileHandler();
 4134|      2|    VSIInstallCryptFileHandler();
 4135|       |
 4136|      2|    return poManager;
 4137|  61.5k|}
_ZN14VSIFileManager10GetHandlerEPKc:
 4163|  61.5k|{
 4164|  61.5k|    VSIFileManager *poThis = Get();
 4165|  61.5k|    const size_t nPathLen = strlen(pszPath);
 4166|       |
 4167|  61.5k|    for (std::map<std::string, VSIFilesystemHandler *>::const_iterator iter =
 4168|  61.5k|             poThis->oHandlers.begin();
 4169|   855k|         iter != poThis->oHandlers.end(); ++iter)
  ------------------
  |  Branch (4169:10): [True: 848k, False: 7.32k]
  ------------------
 4170|   848k|    {
 4171|   848k|        const char *pszIterKey = iter->first.c_str();
 4172|   848k|        const size_t nIterKeyLen = iter->first.size();
 4173|   848k|        if (strncmp(pszPath, pszIterKey, nIterKeyLen) == 0)
  ------------------
  |  Branch (4173:13): [True: 46.8k, False: 801k]
  ------------------
 4174|  46.8k|            return iter->second;
 4175|       |
 4176|       |        // "/vsimem\foo" should be handled as "/vsimem/foo".
 4177|   801k|        if (nIterKeyLen && nPathLen > nIterKeyLen &&
  ------------------
  |  Branch (4177:13): [True: 801k, False: 0]
  |  Branch (4177:28): [True: 287k, False: 513k]
  ------------------
 4178|   801k|            pszIterKey[nIterKeyLen - 1] == '/' &&
  ------------------
  |  Branch (4178:13): [True: 223k, False: 64.5k]
  ------------------
 4179|   801k|            pszPath[nIterKeyLen - 1] == '\\' &&
  ------------------
  |  Branch (4179:13): [True: 0, False: 223k]
  ------------------
 4180|   801k|            strncmp(pszPath, pszIterKey, nIterKeyLen - 1) == 0)
  ------------------
  |  Branch (4180:13): [True: 0, False: 0]
  ------------------
 4181|      0|            return iter->second;
 4182|       |
 4183|       |        // /vsimem should be treated as a match for /vsimem/.
 4184|   801k|        if (nPathLen + 1 == nIterKeyLen &&
  ------------------
  |  Branch (4184:13): [True: 71.9k, False: 729k]
  ------------------
 4185|   801k|            strncmp(pszPath, pszIterKey, nPathLen) == 0)
  ------------------
  |  Branch (4185:13): [True: 7.31k, False: 64.6k]
  ------------------
 4186|  7.31k|            return iter->second;
 4187|   801k|    }
 4188|       |
 4189|  7.32k|    return poThis->poDefaultHandler;
 4190|  61.5k|}
_ZN14VSIFileManager14InstallHandlerERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP20VSIFilesystemHandler:
 4199|     56|{
 4200|     56|    if (osPrefix == "")
  ------------------
  |  Branch (4200:9): [True: 2, False: 54]
  ------------------
 4201|      2|        Get()->poDefaultHandler = poHandler;
 4202|     54|    else
 4203|     54|        Get()->oHandlers[osPrefix] = poHandler;
 4204|     56|}

_ZN27VSIArchiveFilesystemHandlerC2Ev:
   75|      4|{
   76|      4|    hMutex = nullptr;
   77|      4|}

VSIInstallADLSFileHandler:
 2200|      2|{
 2201|      2|    VSIFileManager::InstallHandler("/vsiadls/", new cpl::VSIADLSFSHandler);
 2202|      2|}
_ZN3cpl16VSIADLSFSHandlerC2Ev:
  176|      2|    VSIADLSFSHandler() = default;

VSIInstallAzureFileHandler:
 2595|      2|{
 2596|      2|    VSIFileManager::InstallHandler("/vsiaz/",
 2597|      2|                                   new cpl::VSIAzureFSHandler("/vsiaz/"));
 2598|      2|}
_ZN3cpl17VSIAzureFSHandlerC2EPKc:
  491|      2|    explicit VSIAzureFSHandler(const char *pszPrefix) : m_osPrefix(pszPrefix)
  492|      2|    {
  493|      2|    }

VSIInstallCachedFileHandler:
  745|      2|{
  746|      2|    VSIFilesystemHandler *poHandler = new VSICachedFilesystemHandler;
  747|      2|    VSIFileManager::InstallHandler("/vsicached?", poHandler);
  748|      2|}

VSIInstallCryptFileHandler:
 2127|      2|{
 2128|      2|    VSIFileManager::InstallHandler(VSICRYPT_PREFIX,
 2129|      2|                                   new VSIDummyCryptFilesystemHandler);
 2130|      2|}
_ZN30VSIDummyCryptFilesystemHandlerC2Ev:
 2102|      2|    VSIDummyCryptFilesystemHandler() = default;

_ZN3cpl28VSICurlFilesystemHandlerBaseC2Ev:
 3773|     16|    : oCacheFileProp{100 * 1024}, oCacheDirList{1024, 0}
 3774|     16|{
 3775|     16|}
VSIInstallCurlFileHandler:
 6356|      2|{
 6357|      2|    VSIFilesystemHandler *poHandler = new cpl::VSICurlFilesystemHandler;
 6358|      2|    VSIFileManager::InstallHandler("/vsicurl/", poHandler);
 6359|      2|    VSIFileManager::InstallHandler("/vsicurl?", poHandler);
 6360|      2|}

_ZN3cpl23NetworkStatisticsLoggerC2Ev:
 1096|      2|    NetworkStatisticsLogger() = default;
_ZN3cpl24VSICurlFilesystemHandlerC2Ev:
  333|      2|    VSICurlFilesystemHandler() = default;
_ZN3cpl38IVSIS3LikeFSHandlerWithMultipartUploadC2Ev:
  660|     10|    IVSIS3LikeFSHandlerWithMultipartUpload() = default;
_ZN3cpl19IVSIS3LikeFSHandlerC2Ev:
  622|     12|    IVSIS3LikeFSHandler() = default;
_ZN3cpl36VSICurlFilesystemHandlerBaseWritableC2Ev:
  574|     14|    VSICurlFilesystemHandlerBaseWritable() = default;

_ZN3cpl25VSICurlStreamingFSHandlerC2Ev:
 1537|     12|    : oCacheFileProp{100 * 1024}
 1538|     12|{
 1539|     12|    hMutex = CPLCreateMutex();
 1540|     12|    CPLReleaseMutex(hMutex);
 1541|     12|}
VSIInstallCurlStreamingFileHandler:
 2113|      2|{
 2114|      2|    VSIFileManager::InstallHandler("/vsicurl_streaming/",
 2115|      2|                                   new cpl::VSICurlStreamingFSHandler);
 2116|      2|}
VSIInstallS3StreamingFileHandler:
 2133|      2|{
 2134|      2|    VSIFileManager::InstallHandler("/vsis3_streaming/",
 2135|      2|                                   new cpl::VSIS3StreamingFSHandler);
 2136|      2|}
VSIInstallGSStreamingFileHandler:
 2154|      2|{
 2155|      2|    VSIFileManager::InstallHandler("/vsigs_streaming/",
 2156|      2|                                   new cpl::VSIGSStreamingFSHandler);
 2157|      2|}
VSIInstallAzureStreamingFileHandler:
 2175|      2|{
 2176|      2|    VSIFileManager::InstallHandler("/vsiaz_streaming/",
 2177|      2|                                   new cpl::VSIAzureStreamingFSHandler);
 2178|      2|}
VSIInstallOSSStreamingFileHandler:
 2196|      2|{
 2197|      2|    VSIFileManager::InstallHandler("/vsioss_streaming/",
 2198|      2|                                   new cpl::VSIOSSStreamingFSHandler);
 2199|      2|}
VSIInstallSwiftStreamingFileHandler:
 2217|      2|{
 2218|      2|    VSIFileManager::InstallHandler("/vsiswift_streaming/",
 2219|      2|                                   new cpl::VSISwiftStreamingFSHandler);
 2220|      2|}
_ZN3cpl23VSIS3StreamingFSHandlerC2Ev:
 1789|      2|    VSIS3StreamingFSHandler() = default;
_ZN3cpl28IVSIS3LikeStreamingFSHandlerC2Ev:
 1743|     10|    IVSIS3LikeStreamingFSHandler() = default;
_ZN3cpl23VSIGSStreamingFSHandlerC2Ev:
 1923|      2|    {
 1924|      2|    }
_ZN3cpl26VSIAzureStreamingFSHandlerC2Ev:
 1971|      2|    {
 1972|      2|    }
_ZN3cpl24VSIOSSStreamingFSHandlerC2Ev:
 2019|      2|    VSIOSSStreamingFSHandler() = default;
_ZN3cpl26VSISwiftStreamingFSHandlerC2Ev:
 2069|      2|    {
 2070|      2|    }

VSIInstallGSFileHandler:
  943|      2|{
  944|      2|    VSIFileManager::InstallHandler("/vsigs/",
  945|      2|                                   new cpl::VSIGSFSHandler("/vsigs/"));
  946|      2|}
_ZN3cpl14VSIGSFSHandlerC2EPKc:
  100|      2|    explicit VSIGSFSHandler(const char *pszPrefix) : m_osPrefix(pszPrefix)
  101|      2|    {
  102|      2|    }

VSIInstallGZipFileHandler:
 3309|      2|{
 3310|      2|    VSIFileManager::InstallHandler("/vsigzip/", new VSIGZipFilesystemHandler);
 3311|      2|}
VSIInstallZipFileHandler:
 4941|      2|{
 4942|      2|    VSIFileManager::InstallHandler("/vsizip/", new VSIZipFilesystemHandler());
 4943|      2|}
_ZN24VSIGZipFilesystemHandlerC2Ev:
  352|      2|    VSIGZipFilesystemHandler() = default;
_ZN23VSIZipFilesystemHandlerC2Ev:
 3537|      2|    VSIZipFilesystemHandler() = default;

VSIInstallHdfsHandler:
  484|      2|{
  485|       |    // Not supported.
  486|      2|}

VSIInstallOSSFileHandler:
  323|      2|{
  324|      2|    VSIFileManager::InstallHandler("/vsioss/", new cpl::VSIOSSFSHandler);
  325|      2|}
_ZN3cpl15VSIOSSFSHandlerC2Ev:
   78|      2|    VSIOSSFSHandler() = default;

VSIInstallS3FileHandler:
 5212|      2|{
 5213|      2|    VSIFileManager::InstallHandler("/vsis3/",
 5214|      2|                                   new cpl::VSIS3FSHandler("/vsis3/"));
 5215|      2|}
_ZN3cpl14VSIS3FSHandlerC2EPKc:
  679|      2|    explicit VSIS3FSHandler(const char *pszPrefix) : m_osPrefix(pszPrefix)
  680|      2|    {
  681|      2|    }

VSIInstallSparseFileHandler:
  583|      2|{
  584|      2|    VSIFileManager::InstallHandler("/vsisparse/",
  585|      2|                                   new VSISparseFileFilesystemHandler);
  586|      2|}
_ZN30VSISparseFileFilesystemHandlerC2Ev:
   99|      2|    VSISparseFileFilesystemHandler() = default;

_ZN25VSIStdinFilesystemHandlerC2Ev:
  420|      2|{
  421|      2|}
VSIInstallStdinHandler:
  684|      2|{
  685|      2|    auto poHandler = new VSIStdinFilesystemHandler;
  686|      2|    VSIFileManager::InstallHandler("/vsistdin/", poHandler);
  687|      2|    VSIFileManager::InstallHandler("/vsistdin?", poHandler);
  688|      2|}

VSIInstallStdoutHandler:
  454|      2|{
  455|      2|    VSIFileManager::InstallHandler("/vsistdout/",
  456|      2|                                   new VSIStdoutFilesystemHandler);
  457|      2|    VSIFileManager::InstallHandler("/vsistdout_redirect/",
  458|      2|                                   new VSIStdoutRedirectFilesystemHandler);
  459|      2|}
_ZN26VSIStdoutFilesystemHandlerC2Ev:
   65|      2|    VSIStdoutFilesystemHandler() = default;

VSIInstallSubFileHandler:
  516|      2|{
  517|      2|    VSIFileManager::InstallHandler("/vsisubfile/",
  518|      2|                                   new VSISubFileFilesystemHandler);
  519|      2|}
_ZN27VSISubFileFilesystemHandlerC2Ev:
   71|      2|    VSISubFileFilesystemHandler() = default;

VSIInstallSwiftFileHandler:
  726|      2|{
  727|      2|    VSIFileManager::InstallHandler("/vsiswift/",
  728|      2|                                   new cpl::VSISwiftFSHandler("/vsiswift/"));
  729|      2|}
_ZN3cpl17VSISwiftFSHandlerC2EPKc:
  225|      2|    explicit VSISwiftFSHandler(const char *pszPrefix) : m_osPrefix(pszPrefix)
  226|      2|    {
  227|      2|    }

VSIInstallTarFileHandler:
  629|      2|{
  630|      2|    VSIFileManager::InstallHandler("/vsitar/", new VSITarFilesystemHandler());
  631|      2|}

_ZN29VSIUnixStdioFilesystemHandler4OpenEPKcS1_bPKS1_:
  718|      4|{
  719|      4|    FILE *fp = VSI_FOPEN64(pszFilename, pszAccess);
  ------------------
  |  |  164|      4|#define VSI_FOPEN64 fopen64
  ------------------
  720|      4|    const int nError = errno;
  721|       |
  722|      4|    VSIDebug3("VSIUnixStdioFilesystemHandler::Open(\"%s\",\"%s\") = %p",
  ------------------
  |  |  821|      4|    {                                                                          \
  |  |  822|      4|    }
  ------------------
  723|      4|              pszFilename, pszAccess, fp);
  724|       |
  725|      4|    if (fp == nullptr)
  ------------------
  |  Branch (725:9): [True: 4, False: 0]
  ------------------
  726|      4|    {
  727|      4|        if (bSetError)
  ------------------
  |  Branch (727:13): [True: 0, False: 4]
  ------------------
  728|      0|        {
  729|      0|            VSIError(VSIE_FileError, "%s: %s", pszFilename, strerror(nError));
  ------------------
  |  |   30|      0|#define VSIE_FileError 1
  ------------------
  730|      0|        }
  731|      4|        errno = nError;
  732|      4|        return nullptr;
  733|      4|    }
  734|       |
  735|      0|    const bool bReadOnly =
  736|      0|        strcmp(pszAccess, "rb") == 0 || strcmp(pszAccess, "r") == 0;
  ------------------
  |  Branch (736:9): [True: 0, False: 0]
  |  Branch (736:41): [True: 0, False: 0]
  ------------------
  737|      0|    const bool bModeAppendReadWrite =
  738|      0|        strcmp(pszAccess, "a+b") == 0 || strcmp(pszAccess, "a+") == 0;
  ------------------
  |  Branch (738:9): [True: 0, False: 0]
  |  Branch (738:42): [True: 0, False: 0]
  ------------------
  739|      0|    VSIUnixStdioHandle *poHandle = new (std::nothrow)
  740|      0|        VSIUnixStdioHandle(this, fp, bReadOnly, bModeAppendReadWrite);
  741|      0|    if (poHandle == nullptr)
  ------------------
  |  Branch (741:9): [True: 0, False: 0]
  ------------------
  742|      0|    {
  743|      0|        fclose(fp);
  744|      0|        return nullptr;
  745|      0|    }
  746|       |
  747|      0|    errno = nError;
  748|       |
  749|       |    /* -------------------------------------------------------------------- */
  750|       |    /*      If VSI_CACHE is set we want to use a cached reader instead      */
  751|       |    /*      of more direct io on the underlying file.                       */
  752|       |    /* -------------------------------------------------------------------- */
  753|      0|    if (bReadOnly && CPLTestBool(CPLGetConfigOption("VSI_CACHE", "FALSE")))
  ------------------
  |  Branch (753:9): [True: 0, False: 0]
  |  Branch (753:22): [True: 0, False: 0]
  ------------------
  754|      0|    {
  755|      0|        return VSICreateCachedFile(poHandle);
  756|      0|    }
  757|       |
  758|      0|    return poHandle;
  759|      0|}
VSIInstallLargeFileHandler:
 1274|      2|{
 1275|      2|    VSIFileManager::InstallHandler("", new VSIUnixStdioFilesystemHandler());
 1276|      2|}
_ZN29VSIUnixStdioFilesystemHandlerC2Ev:
  158|      2|    VSIUnixStdioFilesystemHandler() = default;

VSIInstallWebHdfsHandler:
 1194|      2|{
 1195|      2|    VSIFileManager::InstallHandler(
 1196|      2|        "/vsiwebhdfs/", new cpl::VSIWebHDFSFSHandler("/vsiwebhdfs/"));
 1197|      2|}
_ZN3cpl19VSIWebHDFSFSHandlerC2EPKc:
   76|      2|    explicit VSIWebHDFSFSHandler(const char *pszPrefix) : m_osPrefix(pszPrefix)
   77|      2|    {
   78|      2|    }

VSICalloc:
  437|  9.24k|{
  438|       |    // cppcheck-suppress invalidFunctionArg
  439|  9.24k|    return calloc(nCount, nSize);
  440|  9.24k|}
VSIMalloc:
  554|   165k|{
  555|   165k|    return malloc(nSize);
  556|   165k|}
VSIRealloc:
  684|  34.0k|{
  685|       |#ifdef DEBUG_VSIMALLOC
  686|       |    if (pData == nullptr)
  687|       |        return VSIMalloc(nNewSize);
  688|       |
  689|       |    char *ptr = ((char *)pData) - 2 * sizeof(void *);
  690|       |    VSICheckMarkerBegin(ptr);
  691|       |
  692|       |    size_t nOldSize = 0;
  693|       |    // cppcheck-suppress pointerSize
  694|       |    memcpy(&nOldSize, ptr + sizeof(void *), sizeof(void *));
  695|       |    VSICheckMarkerEnd(ptr, 2 * sizeof(void *) + nOldSize);
  696|       |
  697|       |    if (nMaxPeakAllocSize < 0)
  698|       |    {
  699|       |        char *pszMaxPeakAllocSize = getenv("CPL_MAX_PEAK_ALLOC_SIZE");
  700|       |        nMaxPeakAllocSize = pszMaxPeakAllocSize ? atoi(pszMaxPeakAllocSize) : 0;
  701|       |    }
  702|       |    if (nMaxPeakAllocSize > 0 &&
  703|       |        static_cast<GIntBig>(nNewSize) > nMaxPeakAllocSize)
  704|       |        return nullptr;
  705|       |#ifdef DEBUG_VSIMALLOC_STATS
  706|       |    if (nMaxCumulAllocSize > 0 && static_cast<GIntBig>(nCurrentTotalAllocs) +
  707|       |                                          static_cast<GIntBig>(nNewSize) -
  708|       |                                          static_cast<GIntBig>(nOldSize) >
  709|       |                                      nMaxCumulAllocSize)
  710|       |        return nullptr;
  711|       |#endif
  712|       |
  713|       |    ptr[2 * sizeof(void *) + nOldSize + 0] = 'I';
  714|       |    ptr[2 * sizeof(void *) + nOldSize + 1] = 'S';
  715|       |    ptr[2 * sizeof(void *) + nOldSize + 2] = 'V';
  716|       |    ptr[2 * sizeof(void *) + nOldSize + 3] = 'E';
  717|       |
  718|       |#ifdef DEBUG_VSIMALLOC_MPROTECT
  719|       |    char *newptr = nullptr;
  720|       |    const size_t nPageSize = getpagesize();
  721|       |    const size_t nRequestedSize =
  722|       |        (nNewSize + 3 * sizeof(void *) + nPageSize - 1) & ~(nPageSize - 1);
  723|       |    if (nRequestedSize < nNewSize)
  724|       |    {
  725|       |        ptr[2 * sizeof(void *) + nOldSize + 0] = 'E';
  726|       |        ptr[2 * sizeof(void *) + nOldSize + 1] = 'V';
  727|       |        ptr[2 * sizeof(void *) + nOldSize + 2] = 'S';
  728|       |        ptr[2 * sizeof(void *) + nOldSize + 3] = 'I';
  729|       |        return nullptr;
  730|       |    }
  731|       |    posix_memalign((void **)&newptr, nPageSize, nRequestedSize);
  732|       |    if (newptr == nullptr)
  733|       |    {
  734|       |        ptr[2 * sizeof(void *) + nOldSize + 0] = 'E';
  735|       |        ptr[2 * sizeof(void *) + nOldSize + 1] = 'V';
  736|       |        ptr[2 * sizeof(void *) + nOldSize + 2] = 'S';
  737|       |        ptr[2 * sizeof(void *) + nOldSize + 3] = 'I';
  738|       |        return nullptr;
  739|       |    }
  740|       |    memcpy(newptr + 2 * sizeof(void *), pData, nOldSize);
  741|       |    ptr[0] = 'M';
  742|       |    ptr[1] = 'I';
  743|       |    ptr[2] = 'S';
  744|       |    ptr[3] = 'V';
  745|       |    free(ptr);
  746|       |    newptr[0] = 'V';
  747|       |    newptr[1] = 'S';
  748|       |    newptr[2] = 'I';
  749|       |    newptr[3] = 'M';
  750|       |#else
  751|       |    const size_t nRequestedSize = 3 * sizeof(void *) + nNewSize;
  752|       |    if (nRequestedSize < nNewSize)
  753|       |    {
  754|       |        ptr[2 * sizeof(void *) + nOldSize + 0] = 'E';
  755|       |        ptr[2 * sizeof(void *) + nOldSize + 1] = 'V';
  756|       |        ptr[2 * sizeof(void *) + nOldSize + 2] = 'S';
  757|       |        ptr[2 * sizeof(void *) + nOldSize + 3] = 'I';
  758|       |        return nullptr;
  759|       |    }
  760|       |    void *newptr = realloc(ptr, nRequestedSize);
  761|       |    if (newptr == nullptr)
  762|       |    {
  763|       |        ptr[2 * sizeof(void *) + nOldSize + 0] = 'E';
  764|       |        ptr[2 * sizeof(void *) + nOldSize + 1] = 'V';
  765|       |        ptr[2 * sizeof(void *) + nOldSize + 2] = 'S';
  766|       |        ptr[2 * sizeof(void *) + nOldSize + 3] = 'I';
  767|       |        return nullptr;
  768|       |    }
  769|       |#endif
  770|       |    ptr = static_cast<char *>(newptr);
  771|       |    // cppcheck-suppress pointerSize
  772|       |    memcpy(ptr + sizeof(void *), &nNewSize, sizeof(void *));
  773|       |    ptr[2 * sizeof(void *) + nNewSize + 0] = 'E';
  774|       |    ptr[2 * sizeof(void *) + nNewSize + 1] = 'V';
  775|       |    ptr[2 * sizeof(void *) + nNewSize + 2] = 'S';
  776|       |    ptr[2 * sizeof(void *) + nNewSize + 3] = 'I';
  777|       |
  778|       |#if defined(DEBUG_VSIMALLOC_STATS) || defined(DEBUG_VSIMALLOC_VERBOSE)
  779|       |    {
  780|       |        CPLMutexHolderD(&hMemStatMutex);
  781|       |#ifdef DEBUG_VSIMALLOC_VERBOSE
  782|       |        if (nNewSize > THRESHOLD_PRINT)
  783|       |        {
  784|       |            fprintf(
  785|       |                stderr,
  786|       |                "Thread[%p] VSIRealloc(%p, %d) = %p" /*ok*/
  787|       |#ifdef DEBUG_VSIMALLOC_STATS
  788|       |                ", current_cumul = " CPL_FRMT_GUIB
  789|       |#ifdef DEBUG_BLOCK_CACHE_USE
  790|       |                ", block_cache_used = " CPL_FRMT_GIB
  791|       |#endif
  792|       |                ", mal+cal-free = %d"
  793|       |#endif
  794|       |                "\n",
  795|       |                (void *)CPLGetPID(), pData, static_cast<int>(nNewSize),
  796|       |                ptr + 2 * sizeof(void *)
  797|       |#ifdef DEBUG_VSIMALLOC_STATS
  798|       |                    ,
  799|       |                static_cast<GUIntBig>(nCurrentTotalAllocs - nOldSize + nNewSize)
  800|       |#ifdef DEBUG_BLOCK_CACHE_USE
  801|       |                    ,
  802|       |                GDALGetCacheUsed64()
  803|       |#endif
  804|       |                    ,
  805|       |                static_cast<int>(nVSIMallocs + nVSICallocs - nVSIFrees)
  806|       |#endif
  807|       |            );
  808|       |        }
  809|       |#endif
  810|       |#ifdef DEBUG_VSIMALLOC_STATS
  811|       |        nVSIReallocs++;
  812|       |        nCurrentTotalAllocs -= nOldSize;
  813|       |        nCurrentTotalAllocs += nNewSize;
  814|       |        if (nCurrentTotalAllocs > nMaxTotalAllocs)
  815|       |            nMaxTotalAllocs = nCurrentTotalAllocs;
  816|       |#endif
  817|       |    }
  818|       |#endif
  819|       |    return ptr + 2 * sizeof(void *);
  820|       |#else
  821|  34.0k|    return realloc(pData, nNewSize);
  822|  34.0k|#endif
  823|  34.0k|}
VSIFree:
  837|   242k|{
  838|       |#ifdef DEBUG_VSIMALLOC
  839|       |    if (pData == nullptr)
  840|       |        return;
  841|       |
  842|       |    char *ptr = ((char *)pData) - 2 * sizeof(void *);
  843|       |    VSICheckMarkerBegin(ptr);
  844|       |    size_t nOldSize = 0;
  845|       |    // cppcheck-suppress pointerSize
  846|       |    memcpy(&nOldSize, ptr + sizeof(void *), sizeof(void *));
  847|       |    VSICheckMarkerEnd(ptr, 2 * sizeof(void *) + nOldSize);
  848|       |    ptr[0] = 'M';
  849|       |    ptr[1] = 'I';
  850|       |    ptr[2] = 'S';
  851|       |    ptr[3] = 'V';
  852|       |    ptr[2 * sizeof(void *) + nOldSize + 0] = 'I';
  853|       |    ptr[2 * sizeof(void *) + nOldSize + 1] = 'S';
  854|       |    ptr[2 * sizeof(void *) + nOldSize + 2] = 'V';
  855|       |    ptr[2 * sizeof(void *) + nOldSize + 3] = 'E';
  856|       |#if defined(DEBUG_VSIMALLOC_STATS) || defined(DEBUG_VSIMALLOC_VERBOSE)
  857|       |    {
  858|       |        CPLMutexHolderD(&hMemStatMutex);
  859|       |#ifdef DEBUG_VSIMALLOC_VERBOSE
  860|       |        if (nOldSize > THRESHOLD_PRINT)
  861|       |        {
  862|       |            fprintf(stderr, "Thread[%p] VSIFree(%p, (%d bytes))\n", /*ok*/
  863|       |                    (void *)CPLGetPID(), pData, static_cast<int>(nOldSize));
  864|       |        }
  865|       |#endif
  866|       |#ifdef DEBUG_VSIMALLOC_STATS
  867|       |        nVSIFrees++;
  868|       |        nCurrentTotalAllocs -= nOldSize;
  869|       |#endif
  870|       |    }
  871|       |#endif
  872|       |
  873|       |#ifdef DEBUG_VSIMALLOC_MPROTECT
  874|       |    mprotect(ptr, nOldSize + 2 * sizeof(void *), PROT_NONE);
  875|       |#else
  876|       |    free(ptr);
  877|       |#endif
  878|       |
  879|       |#else
  880|   242k|    if (pData != nullptr)
  ------------------
  |  Branch (880:9): [True: 179k, False: 63.5k]
  ------------------
  881|   179k|        free(pData);
  882|   242k|#endif
  883|   242k|}
VSIStrdup:
 1008|  8.42k|{
 1009|  8.42k|    const size_t nSize = strlen(pszString) + 1;
 1010|  8.42k|    char *ptr = static_cast<char *>(VSIMalloc(nSize));
 1011|  8.42k|    if (ptr == nullptr)
  ------------------
  |  Branch (1011:9): [True: 0, False: 8.42k]
  ------------------
 1012|      0|        return nullptr;
 1013|  8.42k|    memcpy(ptr, pszString, nSize);
 1014|  8.42k|    return ptr;
 1015|  8.42k|}
VSIMallocVerbose:
 1144|   109k|{
 1145|   109k|    void *pRet = VSIMalloc(nSize);
 1146|   109k|    if (pRet == nullptr && nSize != 0)
  ------------------
  |  Branch (1146:9): [True: 0, False: 109k]
  |  Branch (1146:28): [True: 0, False: 0]
  ------------------
 1147|      0|    {
 1148|      0|        CPLError(CE_Failure, CPLE_OutOfMemory,
  ------------------
  |  |   87|      0|#define CPLE_OutOfMemory 2
  ------------------
 1149|      0|                 "%s, %d: cannot allocate " CPL_FRMT_GUIB " bytes",
 1150|      0|                 pszFile ? pszFile : "(unknown file)", nLine,
  ------------------
  |  Branch (1150:18): [True: 0, False: 0]
  ------------------
 1151|      0|                 static_cast<GUIntBig>(nSize));
 1152|      0|    }
 1153|   109k|    return pRet;
 1154|   109k|}
VSICallocVerbose:
 1211|  9.24k|{
 1212|  9.24k|    void *pRet = VSICalloc(nCount, nSize);
 1213|  9.24k|    if (pRet == nullptr && nCount != 0 && nSize != 0)
  ------------------
  |  Branch (1213:9): [True: 0, False: 9.24k]
  |  Branch (1213:28): [True: 0, False: 0]
  |  Branch (1213:43): [True: 0, False: 0]
  ------------------
 1214|      0|    {
 1215|      0|        CPLError(CE_Failure, CPLE_OutOfMemory,
  ------------------
  |  |   87|      0|#define CPLE_OutOfMemory 2
  ------------------
 1216|      0|                 "%s, %d: cannot allocate " CPL_FRMT_GUIB "x" CPL_FRMT_GUIB
 1217|      0|                 " bytes",
 1218|      0|                 pszFile ? pszFile : "(unknown file)", nLine,
  ------------------
  |  Branch (1218:18): [True: 0, False: 0]
  ------------------
 1219|      0|                 static_cast<GUIntBig>(nCount), static_cast<GUIntBig>(nSize));
 1220|      0|    }
 1221|  9.24k|    return pRet;
 1222|  9.24k|}
VSIReallocVerbose:
 1230|  34.0k|{
 1231|  34.0k|    void *pRet = VSIRealloc(pOldPtr, nNewSize);
 1232|  34.0k|    if (pRet == nullptr && nNewSize != 0)
  ------------------
  |  Branch (1232:9): [True: 0, False: 34.0k]
  |  Branch (1232:28): [True: 0, False: 0]
  ------------------
 1233|      0|    {
 1234|      0|        CPLError(CE_Failure, CPLE_OutOfMemory,
  ------------------
  |  |   87|      0|#define CPLE_OutOfMemory 2
  ------------------
 1235|      0|                 "%s, %d: cannot allocate " CPL_FRMT_GUIB " bytes",
 1236|      0|                 pszFile ? pszFile : "(unknown file)", nLine,
  ------------------
  |  Branch (1236:18): [True: 0, False: 0]
  ------------------
 1237|      0|                 static_cast<GUIntBig>(nNewSize));
 1238|      0|    }
 1239|  34.0k|    return pRet;
 1240|  34.0k|}
VSIStrdupVerbose:
 1247|  8.42k|{
 1248|  8.42k|    char *pRet = VSIStrdup(pszStr);
 1249|  8.42k|    if (pRet == nullptr)
  ------------------
  |  Branch (1249:9): [True: 0, False: 8.42k]
  ------------------
 1250|      0|    {
 1251|      0|        CPLError(CE_Failure, CPLE_OutOfMemory,
  ------------------
  |  |   87|      0|#define CPLE_OutOfMemory 2
  ------------------
 1252|      0|                 "%s, %d: cannot allocate " CPL_FRMT_GUIB " bytes",
 1253|      0|                 pszFile ? pszFile : "(unknown file)", nLine,
  ------------------
  |  Branch (1253:18): [True: 0, False: 0]
  ------------------
 1254|      0|                 static_cast<GUIntBig>(strlen(pszStr) + 1));
 1255|      0|    }
 1256|  8.42k|    return pRet;
 1257|  8.42k|}

_ZN9CPLString6PrintfEPKcz:
   43|  10.8k|{
   44|  10.8k|    va_list args;
   45|       |
   46|  10.8k|    va_start(args, pszFormat);
   47|  10.8k|    vPrintf(pszFormat, args);
   48|  10.8k|    va_end(args);
   49|       |
   50|  10.8k|    return *this;
   51|  10.8k|}
_ZN9CPLString7vPrintfEPKcP13__va_list_tag:
   61|  10.8k|{
   62|       |    /* -------------------------------------------------------------------- */
   63|       |    /*      This implementation for platforms without vsnprintf() will      */
   64|       |    /*      just plain fail if the formatted contents are too large.        */
   65|       |    /* -------------------------------------------------------------------- */
   66|       |
   67|       |#if !defined(HAVE_VSNPRINTF)
   68|       |    char *pszBuffer = static_cast<char *>(CPLMalloc(30000));
   69|       |    if (CPLvsnprintf(pszBuffer, 30000, pszFormat, args) > 29998)
   70|       |    {
   71|       |        CPLError(CE_Fatal, CPLE_AppDefined,
   72|       |                 "CPLString::vPrintf() ... buffer overrun.");
   73|       |    }
   74|       |    *this = pszBuffer;
   75|       |    CPLFree(pszBuffer);
   76|       |
   77|       |/* -------------------------------------------------------------------- */
   78|       |/*      This should grow a big enough buffer to hold any formatted      */
   79|       |/*      result.                                                         */
   80|       |/* -------------------------------------------------------------------- */
   81|       |#else
   82|  10.8k|    va_list wrk_args;
   83|       |
   84|  10.8k|#ifdef va_copy
   85|  10.8k|    va_copy(wrk_args, args);
   86|       |#else
   87|       |    wrk_args = args;
   88|       |#endif
   89|       |
   90|  10.8k|    char szModestBuffer[500] = {};
   91|  10.8k|    szModestBuffer[0] = '\0';
   92|  10.8k|    int nPR = CPLvsnprintf(szModestBuffer, sizeof(szModestBuffer), pszFormat,
   93|  10.8k|                           wrk_args);
   94|  10.8k|    if (nPR == -1 || nPR >= static_cast<int>(sizeof(szModestBuffer)) - 1)
  ------------------
  |  Branch (94:9): [True: 0, False: 10.8k]
  |  Branch (94:22): [True: 19, False: 10.8k]
  ------------------
   95|     19|    {
   96|     19|        int nWorkBufferSize = 2000;
   97|     19|        char *pszWorkBuffer = static_cast<char *>(CPLMalloc(nWorkBufferSize));
   98|       |
   99|     19|#ifdef va_copy
  100|     19|        va_end(wrk_args);
  101|     19|        va_copy(wrk_args, args);
  102|       |#else
  103|       |        wrk_args = args;
  104|       |#endif
  105|     19|        while ((nPR = CPLvsnprintf(pszWorkBuffer, nWorkBufferSize, pszFormat,
  ------------------
  |  Branch (105:16): [True: 0, False: 19]
  ------------------
  106|     19|                                   wrk_args)) >= nWorkBufferSize - 1 ||
  107|     19|               nPR == -1)
  ------------------
  |  Branch (107:16): [True: 0, False: 19]
  ------------------
  108|      0|        {
  109|      0|            nWorkBufferSize *= 4;
  110|      0|            pszWorkBuffer =
  111|      0|                static_cast<char *>(CPLRealloc(pszWorkBuffer, nWorkBufferSize));
  112|      0|#ifdef va_copy
  113|      0|            va_end(wrk_args);
  114|      0|            va_copy(wrk_args, args);
  115|       |#else
  116|       |            wrk_args = args;
  117|       |#endif
  118|      0|        }
  119|     19|        *this = pszWorkBuffer;
  120|     19|        CPLFree(pszWorkBuffer);
  ------------------
  |  |   86|     19|#define CPLFree VSIFree
  ------------------
  121|     19|    }
  122|  10.8k|    else
  123|  10.8k|    {
  124|  10.8k|        *this = szModestBuffer;
  125|  10.8k|    }
  126|  10.8k|#ifdef va_copy
  127|  10.8k|    va_end(wrk_args);
  128|  10.8k|#endif
  129|       |
  130|  10.8k|#endif /* !defined(HAVE_VSNPRINTF) */
  131|       |
  132|  10.8k|    return *this;
  133|  10.8k|}
_ZN9CPLString7toupperEv:
  298|      6|{
  299|     24|    for (size_t i = 0; i < size(); i++)
  ------------------
  |  Branch (299:24): [True: 18, False: 6]
  ------------------
  300|     18|        (*this)[i] = static_cast<char>(CPLToupper((*this)[i]));
  301|       |
  302|      6|    return *this;
  303|      6|}
_ZN9CPLString10replaceAllERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
  331|  46.8k|{
  332|  46.8k|    const size_t nBeforeSize = osBefore.size();
  333|  46.8k|    const size_t nAfterSize = osAfter.size();
  334|  46.8k|    if (nBeforeSize)
  ------------------
  |  Branch (334:9): [True: 46.8k, False: 0]
  ------------------
  335|  46.8k|    {
  336|  46.8k|        size_t nStartPos = 0;
  337|  46.8k|        while ((nStartPos = find(osBefore, nStartPos)) != std::string::npos)
  ------------------
  |  Branch (337:16): [True: 0, False: 46.8k]
  ------------------
  338|      0|        {
  339|      0|            replace(nStartPos, nBeforeSize, osAfter);
  340|      0|            nStartPos += nAfterSize;
  341|      0|        }
  342|  46.8k|    }
  343|  46.8k|    return *this;
  344|  46.8k|}
_ZN9CPLString10replaceAllERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEc:
  358|  46.8k|{
  359|  46.8k|    return replaceAll(osBefore, std::string(&chAfter, 1));
  360|  46.8k|}

_ZN13CPLStringListC2Ev:
   33|  21.1k|CPLStringList::CPLStringList() = default;
_ZN13CPLStringListC2EOS_:
  137|  3.05k|CPLStringList::CPLStringList(CPLStringList &&oOther) : CPLStringList()
  138|       |
  139|  3.05k|{
  140|  3.05k|    operator=(std::move(oOther));
  141|  3.05k|}
_ZN13CPLStringListaSEOS_:
  190|  3.05k|{
  191|  3.05k|    if (this != &oOther)
  ------------------
  |  Branch (191:9): [True: 3.05k, False: 0]
  ------------------
  192|  3.05k|    {
  193|  3.05k|        Clear();
  194|  3.05k|        papszList = oOther.papszList;
  195|  3.05k|        oOther.papszList = nullptr;
  196|  3.05k|        nCount = oOther.nCount;
  197|  3.05k|        oOther.nCount = 0;
  198|  3.05k|        nAllocation = oOther.nAllocation;
  199|  3.05k|        oOther.nAllocation = 0;
  200|  3.05k|        bOwnList = oOther.bOwnList;
  201|  3.05k|        oOther.bOwnList = false;
  202|  3.05k|        bIsSorted = oOther.bIsSorted;
  203|  3.05k|        oOther.bIsSorted = true;
  204|  3.05k|    }
  205|       |
  206|  3.05k|    return *this;
  207|  3.05k|}
_ZN13CPLStringListD2Ev:
  230|  21.1k|{
  231|  21.1k|    Clear();
  232|  21.1k|}
_ZN13CPLStringList5ClearEv:
  243|  24.2k|{
  244|  24.2k|    if (bOwnList)
  ------------------
  |  Branch (244:9): [True: 3.05k, False: 21.1k]
  ------------------
  245|  3.05k|    {
  246|  3.05k|        CSLDestroy(papszList);
  247|  3.05k|        papszList = nullptr;
  248|       |
  249|  3.05k|        bOwnList = FALSE;
  ------------------
  |  | 1039|  3.05k|#define FALSE 0
  ------------------
  250|  3.05k|        nAllocation = 0;
  251|  3.05k|        nCount = 0;
  252|  3.05k|    }
  253|       |
  254|  24.2k|    return *this;
  255|  24.2k|}
_ZNK13CPLStringList5CountEv:
  301|  1.53k|{
  302|  1.53k|    if (nCount == -1)
  ------------------
  |  Branch (302:9): [True: 0, False: 1.53k]
  ------------------
  303|      0|    {
  304|      0|        if (papszList == nullptr)
  ------------------
  |  Branch (304:13): [True: 0, False: 0]
  ------------------
  305|      0|        {
  306|      0|            nCount = 0;
  307|      0|            nAllocation = 0;
  308|      0|        }
  309|      0|        else
  310|      0|        {
  311|      0|            nCount = CSLCount(papszList);
  312|      0|            nAllocation = std::max(nCount + 1, nAllocation);
  313|      0|        }
  314|      0|    }
  315|       |
  316|  1.53k|    return nCount;
  317|  1.53k|}
_ZN13CPLStringList14MakeOurOwnCopyEv:
  328|   111k|{
  329|   111k|    if (bOwnList)
  ------------------
  |  Branch (329:9): [True: 106k, False: 4.58k]
  ------------------
  330|   106k|        return true;
  331|       |
  332|  4.58k|    if (papszList == nullptr)
  ------------------
  |  Branch (332:9): [True: 4.58k, False: 0]
  ------------------
  333|  4.58k|        return true;
  334|       |
  335|      0|    Count();
  336|      0|    char **papszListNew = CSLDuplicate(papszList);
  337|      0|    if (papszListNew == nullptr)
  ------------------
  |  Branch (337:9): [True: 0, False: 0]
  ------------------
  338|      0|    {
  339|      0|        return false;
  340|      0|    }
  341|      0|    papszList = papszListNew;
  342|      0|    bOwnList = true;
  343|      0|    nAllocation = nCount + 1;
  344|      0|    return true;
  345|      0|}
_ZN13CPLStringList16EnsureAllocationEi:
  357|   109k|{
  358|   109k|    if (!bOwnList)
  ------------------
  |  Branch (358:9): [True: 3.05k, False: 106k]
  ------------------
  359|  3.05k|    {
  360|  3.05k|        if (!MakeOurOwnCopy())
  ------------------
  |  Branch (360:13): [True: 0, False: 3.05k]
  ------------------
  361|      0|            return false;
  362|  3.05k|    }
  363|       |
  364|   109k|    if (papszList == nullptr || nAllocation <= nMaxList)
  ------------------
  |  Branch (364:9): [True: 3.05k, False: 106k]
  |  Branch (364:33): [True: 3.05k, False: 103k]
  ------------------
  365|  6.10k|    {
  366|       |        // we need to be able to store nMaxList+1 as an int,
  367|       |        // and allocate (nMaxList+1) * sizeof(char*) bytes
  368|  6.10k|        if (nMaxList < 0 || nMaxList > std::numeric_limits<int>::max() - 1 ||
  ------------------
  |  Branch (368:13): [True: 0, False: 6.10k]
  |  Branch (368:29): [True: 0, False: 6.10k]
  ------------------
  369|  6.10k|            static_cast<size_t>(nMaxList) >
  ------------------
  |  Branch (369:13): [True: 0, False: 6.10k]
  ------------------
  370|  6.10k|                std::numeric_limits<size_t>::max() / sizeof(char *) - 1)
  371|      0|        {
  372|      0|            return false;
  373|      0|        }
  374|  6.10k|        int nNewAllocation = nMaxList + 1;
  375|  6.10k|        if (nNewAllocation <= (std::numeric_limits<int>::max() - 20) / 2 /
  ------------------
  |  Branch (375:13): [True: 6.10k, False: 0]
  ------------------
  376|  6.10k|                                  static_cast<int>(sizeof(char *)))
  377|  6.10k|            nNewAllocation = std::max(nNewAllocation * 2 + 20, nMaxList + 1);
  378|  6.10k|        if (papszList == nullptr)
  ------------------
  |  Branch (378:13): [True: 3.05k, False: 3.05k]
  ------------------
  379|  3.05k|        {
  380|  3.05k|            papszList = static_cast<char **>(
  381|  3.05k|                VSI_CALLOC_VERBOSE(nNewAllocation, sizeof(char *)));
  ------------------
  |  |  354|  3.05k|    VSICallocVerbose(nCount, nSize, __FILE__, __LINE__)
  ------------------
  382|  3.05k|            bOwnList = true;
  383|  3.05k|            nCount = 0;
  384|  3.05k|            if (papszList == nullptr)
  ------------------
  |  Branch (384:17): [True: 0, False: 3.05k]
  ------------------
  385|      0|                return false;
  386|  3.05k|        }
  387|  3.05k|        else
  388|  3.05k|        {
  389|  3.05k|            char **papszListNew = static_cast<char **>(VSI_REALLOC_VERBOSE(
  ------------------
  |  |  362|  3.05k|    VSIReallocVerbose(pOldPtr, nNewSize, __FILE__, __LINE__)
  ------------------
  390|  3.05k|                papszList, nNewAllocation * sizeof(char *)));
  391|  3.05k|            if (papszListNew == nullptr)
  ------------------
  |  Branch (391:17): [True: 0, False: 3.05k]
  ------------------
  392|      0|                return false;
  393|  3.05k|            papszList = papszListNew;
  394|  3.05k|        }
  395|  6.10k|        nAllocation = nNewAllocation;
  396|  6.10k|    }
  397|   109k|    return true;
  398|   109k|}
_ZN13CPLStringList17AddStringDirectlyEPc:
  415|   109k|{
  416|   109k|    if (nCount == -1)
  ------------------
  |  Branch (416:9): [True: 0, False: 109k]
  ------------------
  417|      0|        Count();
  418|       |
  419|   109k|    if (!EnsureAllocation(nCount + 1))
  ------------------
  |  Branch (419:9): [True: 0, False: 109k]
  ------------------
  420|      0|    {
  421|      0|        VSIFree(pszNewString);
  422|      0|        return *this;
  423|      0|    }
  424|       |
  425|   109k|    papszList[nCount++] = pszNewString;
  426|   109k|    papszList[nCount] = nullptr;
  427|       |
  428|   109k|    bIsSorted = false;
  429|       |
  430|   109k|    return *this;
  431|   109k|}
_ZN13CPLStringList9AddStringEPKc:
  447|  1.52k|{
  448|  1.52k|    char *pszDupString = VSI_STRDUP_VERBOSE(pszNewString);
  ------------------
  |  |  368|  1.52k|#define VSI_STRDUP_VERBOSE(pszStr) VSIStrdupVerbose(pszStr, __FILE__, __LINE__)
  ------------------
  449|  1.52k|    if (pszDupString == nullptr)
  ------------------
  |  Branch (449:9): [True: 0, False: 1.52k]
  ------------------
  450|      0|        return *this;
  451|  1.52k|    return AddStringDirectly(pszDupString);
  452|  1.52k|}
_ZN13CPLStringList12AddNameValueEPKcS1_:
  488|   108k|{
  489|   108k|    if (pszKey == nullptr || pszValue == nullptr)
  ------------------
  |  Branch (489:9): [True: 0, False: 108k]
  |  Branch (489:30): [True: 0, False: 108k]
  ------------------
  490|      0|        return *this;
  491|       |
  492|   108k|    if (!MakeOurOwnCopy())
  ------------------
  |  Branch (492:9): [True: 0, False: 108k]
  ------------------
  493|      0|        return *this;
  494|       |
  495|       |    /* -------------------------------------------------------------------- */
  496|       |    /*      Format the line.                                                */
  497|       |    /* -------------------------------------------------------------------- */
  498|   108k|    if (strlen(pszKey) >
  ------------------
  |  Branch (498:9): [True: 0, False: 108k]
  ------------------
  499|   108k|            std::numeric_limits<size_t>::max() - strlen(pszValue) ||
  500|   108k|        strlen(pszKey) + strlen(pszValue) >
  ------------------
  |  Branch (500:9): [True: 0, False: 108k]
  ------------------
  501|   108k|            std::numeric_limits<size_t>::max() - 2)
  502|      0|    {
  503|      0|        CPLError(CE_Failure, CPLE_OutOfMemory,
  ------------------
  |  |   87|      0|#define CPLE_OutOfMemory 2
  ------------------
  504|      0|                 "Too big strings in AddNameValue()");
  505|      0|        return *this;
  506|      0|    }
  507|   108k|    const size_t nLen = strlen(pszKey) + strlen(pszValue) + 2;
  508|   108k|    char *pszLine = static_cast<char *>(VSI_MALLOC_VERBOSE(nLen));
  ------------------
  |  |  331|   108k|#define VSI_MALLOC_VERBOSE(size) VSIMallocVerbose(size, __FILE__, __LINE__)
  ------------------
  509|   108k|    if (pszLine == nullptr)
  ------------------
  |  Branch (509:9): [True: 0, False: 108k]
  ------------------
  510|      0|        return *this;
  511|   108k|    snprintf(pszLine, nLen, "%s=%s", pszKey, pszValue);
  512|       |
  513|       |    /* -------------------------------------------------------------------- */
  514|       |    /*      If we don't need to keep the sort order things are pretty       */
  515|       |    /*      straight forward.                                               */
  516|       |    /* -------------------------------------------------------------------- */
  517|   108k|    if (!IsSorted())
  ------------------
  |  Branch (517:9): [True: 108k, False: 0]
  ------------------
  518|   108k|        return AddStringDirectly(pszLine);
  519|       |
  520|       |    /* -------------------------------------------------------------------- */
  521|       |    /*      Find the proper insertion point.                                */
  522|       |    /* -------------------------------------------------------------------- */
  523|      0|    CPLAssert(IsSorted());
  ------------------
  |  |  331|      0|    do                                                                         \
  |  |  332|      0|    {                                                                          \
  |  |  333|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  524|      0|    const int iKey = FindSortedInsertionPoint(pszLine);
  525|      0|    InsertStringDirectly(iKey, pszLine);
  526|      0|    bIsSorted = true;  // We have actually preserved sort order.
  527|       |
  528|      0|    return *this;
  529|   108k|}
_ZN13CPLStringList12SetNameValueEPKcS1_:
  549|   108k|{
  550|   108k|    int iKey = FindName(pszKey);
  551|       |
  552|   108k|    if (iKey == -1)
  ------------------
  |  Branch (552:9): [True: 108k, False: 2]
  ------------------
  553|   108k|        return AddNameValue(pszKey, pszValue);
  554|       |
  555|      2|    Count();
  556|      2|    if (!MakeOurOwnCopy())
  ------------------
  |  Branch (556:9): [True: 0, False: 2]
  ------------------
  557|      0|        return *this;
  558|       |
  559|      2|    CPLFree(papszList[iKey]);
  ------------------
  |  |   86|      2|#define CPLFree VSIFree
  ------------------
  560|      2|    if (pszValue == nullptr)  // delete entry
  ------------------
  |  Branch (560:9): [True: 0, False: 2]
  ------------------
  561|      0|    {
  562|       |
  563|       |        // shift everything down by one.
  564|      0|        do
  565|      0|        {
  566|      0|            papszList[iKey] = papszList[iKey + 1];
  567|      0|        } while (papszList[iKey++] != nullptr);
  ------------------
  |  Branch (567:18): [True: 0, False: 0]
  ------------------
  568|       |
  569|      0|        nCount--;
  570|      0|    }
  571|      2|    else
  572|      2|    {
  573|      2|        if (strlen(pszKey) >
  ------------------
  |  Branch (573:13): [True: 0, False: 2]
  ------------------
  574|      2|                std::numeric_limits<size_t>::max() - strlen(pszValue) ||
  575|      2|            strlen(pszKey) + strlen(pszValue) >
  ------------------
  |  Branch (575:13): [True: 0, False: 2]
  ------------------
  576|      2|                std::numeric_limits<size_t>::max() - 2)
  577|      0|        {
  578|      0|            CPLError(CE_Failure, CPLE_OutOfMemory,
  ------------------
  |  |   87|      0|#define CPLE_OutOfMemory 2
  ------------------
  579|      0|                     "Too big strings in AddNameValue()");
  580|      0|            return *this;
  581|      0|        }
  582|      2|        const size_t nLen = strlen(pszKey) + strlen(pszValue) + 2;
  583|      2|        char *pszLine = static_cast<char *>(VSI_MALLOC_VERBOSE(nLen));
  ------------------
  |  |  331|      2|#define VSI_MALLOC_VERBOSE(size) VSIMallocVerbose(size, __FILE__, __LINE__)
  ------------------
  584|      2|        if (pszLine == nullptr)
  ------------------
  |  Branch (584:13): [True: 0, False: 2]
  ------------------
  585|      0|            return *this;
  586|      2|        snprintf(pszLine, nLen, "%s=%s", pszKey, pszValue);
  587|       |
  588|      2|        papszList[iKey] = pszLine;
  589|      2|    }
  590|       |
  591|      2|    return *this;
  592|      2|}
_ZNK13CPLStringList8FindNameEPKc:
  742|   130k|{
  743|   130k|    if (!IsSorted())
  ------------------
  |  Branch (743:9): [True: 130k, False: 0]
  ------------------
  744|   130k|        return CSLFindName(papszList, pszKey);
  745|       |
  746|       |    // If we are sorted, we can do an optimized binary search.
  747|      0|    int iStart = 0;
  748|      0|    int iEnd = nCount - 1;
  749|      0|    size_t nKeyLen = strlen(pszKey);
  750|       |
  751|      0|    while (iStart <= iEnd)
  ------------------
  |  Branch (751:12): [True: 0, False: 0]
  ------------------
  752|      0|    {
  753|      0|        const int iMiddle = (iEnd + iStart) / 2;
  754|      0|        const char *pszMiddle = papszList[iMiddle];
  755|       |
  756|      0|        if (EQUALN(pszMiddle, pszKey, nKeyLen) &&
  ------------------
  |  |  539|      0|#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
  |  |  ------------------
  |  |  |  |  536|      0|#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
  |  |  ------------------
  |  |  |  Branch (539:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  757|      0|            (pszMiddle[nKeyLen] == '=' || pszMiddle[nKeyLen] == ':'))
  ------------------
  |  Branch (757:14): [True: 0, False: 0]
  |  Branch (757:43): [True: 0, False: 0]
  ------------------
  758|      0|            return iMiddle;
  759|       |
  760|      0|        if (CPLCompareKeyValueString(pszKey, pszMiddle) < 0)
  ------------------
  |  Branch (760:13): [True: 0, False: 0]
  ------------------
  761|      0|            iEnd = iMiddle - 1;
  762|      0|        else
  763|      0|            iStart = iMiddle + 1;
  764|      0|    }
  765|       |
  766|      0|    return -1;
  767|      0|}
_ZNK13CPLStringList14FetchNameValueEPKc:
  845|  21.9k|{
  846|  21.9k|    const int iKey = FindName(pszName);
  847|       |
  848|  21.9k|    if (iKey == -1)
  ------------------
  |  Branch (848:9): [True: 2, False: 21.9k]
  ------------------
  849|      2|        return nullptr;
  850|       |
  851|  21.9k|    CPLAssert(papszList[iKey][strlen(pszName)] == '=' ||
  ------------------
  |  |  331|  21.9k|    do                                                                         \
  |  |  332|  21.9k|    {                                                                          \
  |  |  333|  21.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (333:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  852|  21.9k|              papszList[iKey][strlen(pszName)] == ':');
  853|       |
  854|  21.9k|    return papszList[iKey] + strlen(pszName) + 1;
  855|  21.9k|}
_ZNK3cpl11CSLIteratoreqERKS0_:
  995|  7.31k|{
  996|  7.31k|    if (!m_bAtEnd && other.m_bAtEnd)
  ------------------
  |  Branch (996:9): [True: 7.31k, False: 0]
  |  Branch (996:22): [True: 7.31k, False: 0]
  ------------------
  997|  7.31k|    {
  998|  7.31k|        return m_papszList == nullptr || *m_papszList == nullptr;
  ------------------
  |  Branch (998:16): [True: 7.31k, False: 0]
  |  Branch (998:42): [True: 0, False: 0]
  ------------------
  999|  7.31k|    }
 1000|      0|    if (!m_bAtEnd && !other.m_bAtEnd)
  ------------------
  |  Branch (1000:9): [True: 0, False: 0]
  |  Branch (1000:22): [True: 0, False: 0]
  ------------------
 1001|      0|    {
 1002|      0|        return m_papszList == other.m_papszList;
 1003|      0|    }
 1004|      0|    if (m_bAtEnd && other.m_bAtEnd)
  ------------------
  |  Branch (1004:9): [True: 0, False: 0]
  |  Branch (1004:21): [True: 0, False: 0]
  ------------------
 1005|      0|    {
 1006|      0|        return true;
 1007|      0|    }
 1008|      0|    return false;
 1009|      0|}

_ZN5osgeo4proj5lru115CacheINS0_17NetworkChunkCache3KeyENSt3__110shared_ptrINS5_6vectorIhNS5_9allocatorIhEEEEEENS5_5mutexENS5_13unordered_mapIS4_NS5_15__list_iteratorINS1_12KeyValuePairIS4_SB_EEPvEENS3_9KeyHasherENS5_8equal_toIS4_EENS8_INS5_4pairIKS4_SI_EEEEEEEC2Emm:
  110|      2|        : maxSize_(maxSize), elasticity_(elasticity) {}
_ZN5osgeo4proj5lru115CacheINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_14FilePropertiesENS3_5mutexENS3_13unordered_mapIS9_NS3_15__list_iteratorINS1_12KeyValuePairIS9_SA_EEPvEENS3_4hashIS9_EENS3_8equal_toIS9_EENS7_INS3_4pairIKS9_SH_EEEEEEEC2Emm:
  110|      2|        : maxSize_(maxSize), elasticity_(elasticity) {}

_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj4util10BaseObjectEEEEC2INS3_INS6_10BoxedValueEEETnNS2_9enable_ifIXsr3std14is_convertibleIT_S8_EE5valueEiE4typeELi0EEERKNS1_ISE_EE:
  160|    136|  nn(const nn<OtherType> &other) : ptr(other.operator const OtherType &()) {}
_ZNKR7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj4util10BoxedValueEEEEcvRKS8_Ev:
  100|    136|  operator const PtrType &() const & { return ptr; }
_ZNKR7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj4util10BaseObjectEEEE11as_nullableEv:
  111|     16|  const PtrType &as_nullable() const & { return ptr; }
_ZN7dropbox6oxygen14nn_make_sharedIN5osgeo4proj4util10BoxedValueEJRKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEENS0_2nnINS6_10shared_ptrIT_EEEEDpOT0_:
  275|     66|nn_shared_ptr<T> nn_make_shared(Args &&... args) {
  276|     66|  return nn_shared_ptr<T>(i_promise_i_checked_for_null,
  277|     66|                          std::make_shared<T>(std::forward<Args>(args)...));
  278|     66|}
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj4util10BoxedValueEEEEC2ENS0_30i_promise_i_checked_for_null_tEOS8_:
  134|    136|      : ptr(std::move(arg)) {
  135|    136|  }
_ZN7dropbox6oxygen14nn_make_sharedIN5osgeo4proj4util10BoxedValueEJRPKcEEENS0_2nnINSt3__110shared_ptrIT_EEEEDpOT0_:
  275|     38|nn_shared_ptr<T> nn_make_shared(Args &&... args) {
  276|     38|  return nn_shared_ptr<T>(i_promise_i_checked_for_null,
  277|     38|                          std::make_shared<T>(std::forward<Args>(args)...));
  278|     38|}
_ZN7dropbox6oxygen14nn_make_sharedIN5osgeo4proj4util10BoxedValueEJRiEEENS0_2nnINSt3__110shared_ptrIT_EEEEDpOT0_:
  275|     32|nn_shared_ptr<T> nn_make_shared(Args &&... args) {
  276|     32|  return nn_shared_ptr<T>(i_promise_i_checked_for_null,
  277|     32|                          std::make_shared<T>(std::forward<Args>(args)...));
  278|     32|}
_ZNK7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj4util10BaseObjectEEEE3getIS8_EEPS7_v:
  206|    136|  template <typename T = PtrType> element_type *get() const {
  207|    136|    return ptr.get();
  208|    136|  }
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj4util9NameSpaceEEEEC2ENS0_30i_promise_i_checked_for_null_tEOS8_:
  134|      2|      : ptr(std::move(arg)) {
  135|      2|  }
_ZNK7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj4util9NameSpaceEEEEptEv:
   97|      2|  element_type *operator->() const { return &*ptr; }
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj8metadata21GeographicBoundingBoxEEEEC2ENS0_30i_promise_i_checked_for_null_tEOS8_:
  134|      2|      : ptr(std::move(arg)) {
  135|      2|  }
_ZNKR7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj8metadata21GeographicBoundingBoxEEEE11as_nullableEv:
  111|      2|  const PtrType &as_nullable() const & { return ptr; }
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj8metadata6ExtentEEEEC2ENS0_30i_promise_i_checked_for_null_tEOS8_:
  134|      2|      : ptr(std::move(arg)) {
  135|      2|  }
_ZNK7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj8metadata6ExtentEEEEptEv:
   97|     10|  element_type *operator->() const { return &*ptr; }
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj4util10BaseObjectEEEEC2INS3_INS5_8metadata6ExtentEEETnNS2_9enable_ifIXsr3std14is_convertibleIT_S8_EE5valueEiE4typeELi0EEERKNS1_ISF_EE:
  160|      2|  nn(const nn<OtherType> &other) : ptr(other.operator const OtherType &()) {}
_ZNKR7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj8metadata6ExtentEEEEcvRKS8_Ev:
  100|      2|  operator const PtrType &() const & { return ptr; }
_ZN7dropbox6oxygen22nn_static_pointer_castIN5osgeo4proj8metadata16GeographicExtentENS4_21GeographicBoundingBoxEEENS0_2nnINSt3__110shared_ptrIT_EEEERKNS7_INS9_IT0_EEEE:
  308|      2|nn_shared_ptr<T> nn_static_pointer_cast(const nn_shared_ptr<U> &org_ptr) {
  309|      2|  auto raw_ptr =
  310|      2|      static_cast<typename nn_shared_ptr<T>::element_type *>(org_ptr.get());
  311|      2|  std::shared_ptr<T> nullable_ptr(org_ptr.as_nullable(), raw_ptr);
  312|      2|  return nn_shared_ptr<T>(i_promise_i_checked_for_null,
  313|      2|                          std::move(nullable_ptr));
  314|      2|}
_ZNK7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj8metadata21GeographicBoundingBoxEEEE3getIS8_EEPS7_v:
  206|      2|  template <typename T = PtrType> element_type *get() const {
  207|      2|    return ptr.get();
  208|      2|  }
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj8metadata16GeographicExtentEEEEC2ENS0_30i_promise_i_checked_for_null_tEOS8_:
  134|      2|      : ptr(std::move(arg)) {
  135|      2|  }
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj8metadata10IdentifierEEEEC2ENS0_30i_promise_i_checked_for_null_tEOS8_:
  134|    184|      : ptr(std::move(arg)) {
  135|    184|  }
_ZNK7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj8metadata10IdentifierEEEEptEv:
   97|     68|  element_type *operator->() const { return &*ptr; }
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj2cs16CoordinateSystemEEEEC2INS3_INS6_11CartesianCSEEETnNS2_9enable_ifIXsr3std14is_convertibleIT_S8_EE5valueEiE4typeELi0EEERKNS1_ISE_EE:
  160|      2|  nn(const nn<OtherType> &other) : ptr(other.operator const OtherType &()) {}
_ZNKR7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj2cs11CartesianCSEEEEcvRKS8_Ev:
  100|      2|  operator const PtrType &() const & { return ptr; }
_ZNKR7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj3crs13GeographicCRSEEEEcvRKS8_Ev:
  100|     12|  operator const PtrType &() const & { return ptr; }
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj2cs11CartesianCSEEEEC2ENS0_30i_promise_i_checked_for_null_tEOS8_:
  134|      2|      : ptr(std::move(arg)) {
  135|      2|  }
_ZN7dropbox6oxygen2nnINSt3__110unique_ptrIN5osgeo4proj2io7WKTNodeENS2_14default_deleteIS7_EEEEEC2ENS0_30i_promise_i_checked_for_null_tEOSA_:
  134|      2|      : ptr(std::move(arg)) {
  135|      2|  }
_ZNK7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj5datum9EllipsoidEEEEptEv:
   97|      8|  element_type *operator->() const { return &*ptr; }
_ZNK7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj5datum22GeodeticReferenceFrameEEEEptEv:
   97|     16|  element_type *operator->() const { return &*ptr; }
_ZNK7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj5datum13PrimeMeridianEEEEptEv:
   97|      6|  element_type *operator->() const { return &*ptr; }
_ZNK7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj3crs11GeodeticCRSEEEEptEv:
   97|      4|  element_type *operator->() const { return &*ptr; }
_ZNK7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj3crs13GeographicCRSEEEEptEv:
   97|     36|  element_type *operator->() const { return &*ptr; }
_ZNK7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj2cs13EllipsoidalCSEEEEptEv:
   97|     12|  element_type *operator->() const { return &*ptr; }
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj3crs11GeodeticCRSEEEEC2ENS0_30i_promise_i_checked_for_null_tEOS8_:
  134|      2|      : ptr(std::move(arg)) {
  135|      2|  }
_ZNK7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj2cs20CoordinateSystemAxisEEEEptEv:
   97|    160|  element_type *operator->() const { return &*ptr; }
_ZNK7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj2cs11CartesianCSEEEEptEv:
   97|      2|  element_type *operator->() const { return &*ptr; }
_ZNKR7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj5datum22GeodeticReferenceFrameEEEE11as_nullableEv:
  111|     14|  const PtrType &as_nullable() const & { return ptr; }
_ZNKR7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj3crs11GeodeticCRSEEEEcvRKS8_Ev:
  100|      2|  operator const PtrType &() const & { return ptr; }
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj5datum22GeodeticReferenceFrameEEEEC2ENS0_30i_promise_i_checked_for_null_tEOS8_:
  134|      8|      : ptr(std::move(arg)) {
  135|      8|  }
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj4util10BaseObjectEEEEC2INS3_INS5_3crs13GeographicCRSEEETnNS2_9enable_ifIXsr3std14is_convertibleIT_S8_EE5valueEiE4typeELi0EEERKNS1_ISF_EE:
  160|     12|  nn(const nn<OtherType> &other) : ptr(other.operator const OtherType &()) {}
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj4util10BaseObjectEEEEC2INS3_INS5_3crs11GeodeticCRSEEETnNS2_9enable_ifIXsr3std14is_convertibleIT_S8_EE5valueEiE4typeELi0EEERKNS1_ISF_EE:
  160|      2|  nn(const nn<OtherType> &other) : ptr(other.operator const OtherType &()) {}
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj2cs16CoordinateSystemEEEEC2INS3_INS6_13EllipsoidalCSEEETnNS2_9enable_ifIXsr3std14is_convertibleIT_S8_EE5valueEiE4typeELi0EEERKNS1_ISE_EE:
  160|     12|  nn(const nn<OtherType> &other) : ptr(other.operator const OtherType &()) {}
_ZNKR7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj2cs13EllipsoidalCSEEEEcvRKS8_Ev:
  100|     12|  operator const PtrType &() const & { return ptr; }
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj3crs13GeographicCRSEEEEC2ENS0_30i_promise_i_checked_for_null_tEOS8_:
  134|     12|      : ptr(std::move(arg)) {
  135|     12|  }
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj5datum13PrimeMeridianEEEEC2ENS0_30i_promise_i_checked_for_null_tEOS8_:
  134|      6|      : ptr(std::move(arg)) {
  135|      6|  }
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj5datum9EllipsoidEEEEC2ENS0_30i_promise_i_checked_for_null_tEOS8_:
  134|      8|      : ptr(std::move(arg)) {
  135|      8|  }
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj2cs20CoordinateSystemAxisEEEEC2ENS0_30i_promise_i_checked_for_null_tEOS8_:
  134|     32|      : ptr(std::move(arg)) {
  135|     32|  }
_ZN7dropbox6oxygen2nnINSt3__110shared_ptrIN5osgeo4proj2cs13EllipsoidalCSEEEEC2ENS0_30i_promise_i_checked_for_null_tEOS8_:
  134|     12|      : ptr(std::move(arg)) {
  135|     12|  }

_ZN5osgeo4proj4util8CodeListC2ERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  719|    136|    explicit CodeList(const std::string &nameIn) : name_(nameIn) {}
_ZN5osgeo4proj4util15BaseObjectNNPtrC2INS1_10BoxedValueEEERKN7dropbox6oxygen2nnINSt3__110shared_ptrIT_EEEE:
  312|    136|        : util::nn<BaseObjectPtr>(x) {}
_ZN5osgeo4proj4util15BaseObjectNNPtrC2ERKS2_:
  323|     96|    BaseObjectNNPtr(const BaseObjectNNPtr &) = default;
_ZN5osgeo4proj4util8optionalINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEaSERKS9_:
  258|    102|    inline optional &operator=(const T &val) {
  259|    102|        hasVal_ = true;
  260|    102|        val_ = val;
  261|    102|        return *this;
  262|    102|    }
_ZN5osgeo4proj4util9LocalName11make_sharedIS2_JRA7_KcEEENSt3__110shared_ptrIT_EEDpOT0_:
  134|      2|    static std::shared_ptr<T> make_shared(Args &&...args) {                    \
  135|      2|        return std::shared_ptr<T>(new T(std::forward<Args>(args)...));         \
  136|      2|    }                                                                          \
_ZN5osgeo4proj4util9NameSpace14nn_make_sharedIS2_JNSt3__110shared_ptrINS1_9LocalNameEEEEEEN7dropbox6oxygen2nnINS5_IT_EEEEDpOT0_:
  138|      2|    static util::nn_shared_ptr<T> nn_make_shared(Args &&...args) {             \
  139|      2|        return util::nn_shared_ptr<T>(                                         \
  140|      2|            util::i_promise_i_checked_for_null,                                \
  141|      2|            std::shared_ptr<T>(new T(std::forward<Args>(args)...)));           \
  142|      2|    }
_ZN5osgeo4proj4util8optionalINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEaSERKSA_:
  268|     10|    inline optional &operator=(const optional &) = default;
_ZN5osgeo4proj8metadata21GeographicBoundingBox14nn_make_sharedIS2_JRdS4_S4_S4_EEEN7dropbox6oxygen2nnINSt3__110shared_ptrIT_EEEEDpOT0_:
  138|      2|    static util::nn_shared_ptr<T> nn_make_shared(Args &&...args) {             \
  139|      2|        return util::nn_shared_ptr<T>(                                         \
  140|      2|            util::i_promise_i_checked_for_null,                                \
  141|      2|            std::shared_ptr<T>(new T(std::forward<Args>(args)...)));           \
  142|      2|    }
_ZN5osgeo4proj8metadata6Extent14nn_make_sharedIS2_JEEEN7dropbox6oxygen2nnINSt3__110shared_ptrIT_EEEEDpOT0_:
  138|      2|    static util::nn_shared_ptr<T> nn_make_shared(Args &&...args) {             \
  139|      2|        return util::nn_shared_ptr<T>(                                         \
  140|      2|            util::i_promise_i_checked_for_null,                                \
  141|      2|            std::shared_ptr<T>(new T(std::forward<Args>(args)...)));           \
  142|      2|    }
_ZN5osgeo4proj4util15BaseObjectNNPtrC2INS0_8metadata6ExtentEEERKN7dropbox6oxygen2nnINSt3__110shared_ptrIT_EEEE:
  312|      2|        : util::nn<BaseObjectPtr>(x) {}
_ZNK5osgeo4proj4util8optionalINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEE9has_valueEv:
  291|     22|    inline bool has_value() const noexcept { return hasVal_; }
_ZN5osgeo4proj4util8optionalINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEC2Ev:
  245|    960|    inline optional() : hasVal_(false) {}
_ZN5osgeo4proj4util8optionalINS0_8metadata8CitationEEC2Ev:
  245|    184|    inline optional() : hasVal_(false) {}
_ZN5osgeo4proj8metadata10Identifier14nn_make_sharedIS2_JRKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERKNS0_4util11PropertyMapEEEEN7dropbox6oxygen2nnINS4_10shared_ptrIT_EEEEDpOT0_:
  138|    116|    static util::nn_shared_ptr<T> nn_make_shared(Args &&...args) {             \
  139|    116|        return util::nn_shared_ptr<T>(                                         \
  140|    116|            util::i_promise_i_checked_for_null,                                \
  141|    116|            std::shared_ptr<T>(new T(std::forward<Args>(args)...)));           \
  142|    116|    }
_ZN5osgeo4proj8metadata10Identifier14nn_make_sharedIS2_JEEEN7dropbox6oxygen2nnINSt3__110shared_ptrIT_EEEEDpOT0_:
  138|     68|    static util::nn_shared_ptr<T> nn_make_shared(Args &&...args) {             \
  139|     68|        return util::nn_shared_ptr<T>(                                         \
  140|     68|            util::i_promise_i_checked_for_null,                                \
  141|     68|            std::shared_ptr<T>(new T(std::forward<Args>(args)...)));           \
  142|     68|    }
_ZN5osgeo4proj4util8optionalINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEC2EOS9_:
  248|      2|        : hasVal_(true), val_(std::forward<T>(val)) {}
_ZN5osgeo4proj4util8optionalINS0_6common7MeasureEEC2Ev:
  245|      8|    inline optional() : hasVal_(false) {}
_ZN5osgeo4proj4util8optionalIdEC2Ev:
  245|     64|    inline optional() : hasVal_(false) {}
_ZN5osgeo4proj4util8optionalINS0_2cs12RangeMeaningEEC2Ev:
  245|     32|    inline optional() : hasVal_(false) {}
_ZN5osgeo4proj3crs3CRS10getPrivateEv:
  123|     12|    PROJ_INTERNAL Private *getPrivate() noexcept { return d.get(); }           \
_ZN5osgeo4proj4util15BaseObjectNNPtrC2INS0_3crs13GeographicCRSEEERKN7dropbox6oxygen2nnINSt3__110shared_ptrIT_EEEE:
  312|     12|        : util::nn<BaseObjectPtr>(x) {}
_ZN5osgeo4proj4util15BaseObjectNNPtrC2INS0_3crs11GeodeticCRSEEERKN7dropbox6oxygen2nnINSt3__110shared_ptrIT_EEEE:
  312|      2|        : util::nn<BaseObjectPtr>(x) {}
_ZN5osgeo4proj3crs11GeodeticCRS14nn_make_sharedIS2_JRKNSt3__110shared_ptrINS0_5datum22GeodeticReferenceFrameEEERKNS5_INS6_13DatumEnsembleEEERKN7dropbox6oxygen2nnINS5_INS0_2cs11CartesianCSEEEEEEEENSH_INS5_IT_EEEEDpOT0_:
  138|      2|    static util::nn_shared_ptr<T> nn_make_shared(Args &&...args) {             \
  139|      2|        return util::nn_shared_ptr<T>(                                         \
  140|      2|            util::i_promise_i_checked_for_null,                                \
  141|      2|            std::shared_ptr<T>(new T(std::forward<Args>(args)...)));           \
  142|      2|    }
_ZN5osgeo4proj3crs13GeographicCRS14nn_make_sharedIS2_JRKNSt3__110shared_ptrINS0_5datum22GeodeticReferenceFrameEEERKNS5_INS6_13DatumEnsembleEEERKN7dropbox6oxygen2nnINS5_INS0_2cs13EllipsoidalCSEEEEEEEENSH_INS5_IT_EEEEDpOT0_:
  138|     12|    static util::nn_shared_ptr<T> nn_make_shared(Args &&...args) {             \
  139|     12|        return util::nn_shared_ptr<T>(                                         \
  140|     12|            util::i_promise_i_checked_for_null,                                \
  141|     12|            std::shared_ptr<T>(new T(std::forward<Args>(args)...)));           \
  142|     12|    }
_ZN5osgeo4proj4util8optionalINS0_6common8DateTimeEEC2Ev:
  245|      8|    inline optional() : hasVal_(false) {}
_ZN5osgeo4proj5datum13PrimeMeridian14nn_make_sharedIS2_JRKNS0_6common5AngleEEEEN7dropbox6oxygen2nnINSt3__110shared_ptrIT_EEEEDpOT0_:
  138|      6|    static util::nn_shared_ptr<T> nn_make_shared(Args &&...args) {             \
  139|      6|        return util::nn_shared_ptr<T>(                                         \
  140|      6|            util::i_promise_i_checked_for_null,                                \
  141|      6|            std::shared_ptr<T>(new T(std::forward<Args>(args)...)));           \
  142|      6|    }
_ZN5osgeo4proj4util8optionalINS0_6common5ScaleEEC2Ev:
  245|      2|    inline optional() : hasVal_(false) {}
_ZN5osgeo4proj4util8optionalINS0_6common6LengthEEC2Ev:
  245|     14|    inline optional() : hasVal_(false) {}
_ZN5osgeo4proj4util8optionalINS0_6common5ScaleEEC2ERKS4_:
  246|      6|    inline explicit optional(const T &val) : hasVal_(true), val_(val) {}
_ZN5osgeo4proj4util8optionalINS0_6common6LengthEEC2ERKS4_:
  246|      2|    inline explicit optional(const T &val) : hasVal_(true), val_(val) {}
_ZN5osgeo4proj5datum9Ellipsoid14nn_make_sharedIS2_JRKNS0_6common6LengthERKNS4_5ScaleERKNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEEEEEN7dropbox6oxygen2nnINSB_10shared_ptrIT_EEEEDpOT0_:
  138|      6|    static util::nn_shared_ptr<T> nn_make_shared(Args &&...args) {             \
  139|      6|        return util::nn_shared_ptr<T>(                                         \
  140|      6|            util::i_promise_i_checked_for_null,                                \
  141|      6|            std::shared_ptr<T>(new T(std::forward<Args>(args)...)));           \
  142|      6|    }
_ZN5osgeo4proj5datum9Ellipsoid14nn_make_sharedIS2_JRKNS0_6common6LengthES7_RKNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEEEEN7dropbox6oxygen2nnINS8_10shared_ptrIT_EEEEDpOT0_:
  138|      2|    static util::nn_shared_ptr<T> nn_make_shared(Args &&...args) {             \
  139|      2|        return util::nn_shared_ptr<T>(                                         \
  140|      2|            util::i_promise_i_checked_for_null,                                \
  141|      2|            std::shared_ptr<T>(new T(std::forward<Args>(args)...)));           \
  142|      2|    }
_ZN5osgeo4proj5datum22GeodeticReferenceFrame14nn_make_sharedIS2_JRKN7dropbox6oxygen2nnINSt3__110shared_ptrINS1_9EllipsoidEEEEERKNS6_INS8_INS1_13PrimeMeridianEEEEEEEENS6_INS8_IT_EEEEDpOT0_:
  138|      8|    static util::nn_shared_ptr<T> nn_make_shared(Args &&...args) {             \
  139|      8|        return util::nn_shared_ptr<T>(                                         \
  140|      8|            util::i_promise_i_checked_for_null,                                \
  141|      8|            std::shared_ptr<T>(new T(std::forward<Args>(args)...)));           \
  142|      8|    }
_ZN5osgeo4proj2cs20CoordinateSystemAxis14nn_make_sharedIS2_JEEEN7dropbox6oxygen2nnINSt3__110shared_ptrIT_EEEEDpOT0_:
  138|     32|    static util::nn_shared_ptr<T> nn_make_shared(Args &&...args) {             \
  139|     32|        return util::nn_shared_ptr<T>(                                         \
  140|     32|            util::i_promise_i_checked_for_null,                                \
  141|     32|            std::shared_ptr<T>(new T(std::forward<Args>(args)...)));           \
  142|     32|    }
_ZN5osgeo4proj2cs13EllipsoidalCS14nn_make_sharedIS2_JRNSt3__16vectorIN7dropbox6oxygen2nnINS4_10shared_ptrINS1_20CoordinateSystemAxisEEEEENS4_9allocatorISC_EEEEEEENS8_INS9_IT_EEEEDpOT0_:
  138|     12|    static util::nn_shared_ptr<T> nn_make_shared(Args &&...args) {             \
  139|     12|        return util::nn_shared_ptr<T>(                                         \
  140|     12|            util::i_promise_i_checked_for_null,                                \
  141|     12|            std::shared_ptr<T>(new T(std::forward<Args>(args)...)));           \
  142|     12|    }
_ZN5osgeo4proj2cs11CartesianCS14nn_make_sharedIS2_JRNSt3__16vectorIN7dropbox6oxygen2nnINS4_10shared_ptrINS1_20CoordinateSystemAxisEEEEENS4_9allocatorISC_EEEEEEENS8_INS9_IT_EEEEDpOT0_:
  138|      2|    static util::nn_shared_ptr<T> nn_make_shared(Args &&...args) {             \
  139|      2|        return util::nn_shared_ptr<T>(                                         \
  140|      2|            util::i_promise_i_checked_for_null,                                \
  141|      2|            std::shared_ptr<T>(new T(std::forward<Args>(args)...)));           \
  142|      2|    }

proj_assign_context:
   68|  15.2k|void proj_assign_context(PJ *pj, PJ_CONTEXT *ctx) {
   69|  15.2k|    if (pj == nullptr)
  ------------------
  |  Branch (69:9): [True: 15.2k, False: 0]
  ------------------
   70|  15.2k|        return;
   71|      0|    pj->ctx = ctx;
   72|      0|    if (pj->reassign_context) {
  ------------------
  |  Branch (72:9): [True: 0, False: 0]
  ------------------
   73|      0|        pj->reassign_context(pj, ctx);
   74|      0|    }
   75|      0|    for (const auto &alt : pj->alternativeCoordinateOperations) {
  ------------------
  |  Branch (75:26): [True: 0, False: 0]
  ------------------
   76|      0|        proj_assign_context(alt.pj, ctx);
   77|      0|    }
   78|      0|}
_ZN6pj_ctx13createDefaultEv:
   84|      1|pj_ctx pj_ctx::createDefault() {
   85|      1|    pj_ctx ctx;
   86|      1|    ctx.debug_level = PJ_LOG_ERROR;
   87|      1|    ctx.logger = pj_stderr_logger;
   88|      1|    NS_PROJ::FileManager::fillDefaultNetworkInterface(&ctx);
  ------------------
  |  |  106|      1|#define NS_PROJ osgeo::proj
  ------------------
   89|       |
   90|      1|    const char *projDebug = getenv("PROJ_DEBUG");
   91|      1|    if (projDebug != nullptr) {
  ------------------
  |  Branch (91:9): [True: 0, False: 1]
  ------------------
   92|      0|        if (NS_PROJ::internal::ci_equal(projDebug, "ON")) {
  ------------------
  |  |  106|      0|#define NS_PROJ osgeo::proj
  ------------------
  |  Branch (92:13): [True: 0, False: 0]
  ------------------
   93|      0|            ctx.debug_level = PJ_LOG_DEBUG;
   94|      0|        } else if (NS_PROJ::internal::ci_equal(projDebug, "OFF")) {
  ------------------
  |  |  106|      0|#define NS_PROJ osgeo::proj
  ------------------
  |  Branch (94:20): [True: 0, False: 0]
  ------------------
   95|      0|            ctx.debug_level = PJ_LOG_ERROR;
   96|      0|        } else if (projDebug[0] == '-' ||
  ------------------
  |  Branch (96:20): [True: 0, False: 0]
  ------------------
   97|      0|                   (projDebug[0] >= '0' && projDebug[0] <= '9')) {
  ------------------
  |  Branch (97:21): [True: 0, False: 0]
  |  Branch (97:44): [True: 0, False: 0]
  ------------------
   98|      0|            const int debugLevel = atoi(projDebug);
   99|       |            // Negative debug levels mean that we first start logging when errno
  100|       |            // is set Cf
  101|       |            // https://github.com/OSGeo/PROJ/commit/1c1d04b45d76366f54e104f9346879fd48bfde8e
  102|       |            // This isn't documented for now. Not totally sure we really want
  103|       |            // that...
  104|      0|            if (debugLevel >= -PJ_LOG_TRACE)
  ------------------
  |  Branch (104:17): [True: 0, False: 0]
  ------------------
  105|      0|                ctx.debug_level = debugLevel;
  106|      0|            else
  107|      0|                ctx.debug_level = PJ_LOG_TRACE;
  108|      0|        } else {
  109|      0|            fprintf(stderr, "Invalid value for PROJ_DEBUG: %s\n", projDebug);
  110|      0|        }
  111|      0|    }
  112|       |
  113|      1|    return ctx;
  114|      1|}
_ZN6pj_ctx16set_search_pathsERKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEE:
  131|      1|void pj_ctx::set_search_paths(const std::vector<std::string> &search_paths_in) {
  132|      1|    lookupedFiles.clear();
  133|      1|    search_paths = search_paths_in;
  134|      1|    delete[] c_compat_paths;
  135|      1|    c_compat_paths = nullptr;
  136|      1|    if (!search_paths.empty()) {
  ------------------
  |  Branch (136:9): [True: 0, False: 1]
  ------------------
  137|      0|        c_compat_paths = new const char *[search_paths.size()];
  138|      0|        for (size_t i = 0; i < search_paths.size(); ++i) {
  ------------------
  |  Branch (138:28): [True: 0, False: 0]
  ------------------
  139|      0|            c_compat_paths[i] = search_paths[i].c_str();
  140|      0|        }
  141|      0|    }
  142|      1|}
_ZN6pj_ctxC2ERKS_:
  157|      1|    : lastFullErrorMessage(std::string()), last_errno(0),
  158|      1|      debug_level(other.debug_level),
  159|       |      errorIfBestTransformationNotAvailableDefault(
  160|      1|          other.errorIfBestTransformationNotAvailableDefault),
  161|       |      warnIfBestTransformationNotAvailableDefault(
  162|      1|          other.warnIfBestTransformationNotAvailableDefault),
  163|      1|      logger(other.logger), logger_app_data(other.logger_app_data),
  164|      1|      cpp_context(other.cpp_context ? other.cpp_context->clone(this) : nullptr),
  ------------------
  |  Branch (164:19): [True: 0, False: 1]
  ------------------
  165|      1|      use_proj4_init_rules(other.use_proj4_init_rules),
  166|      1|      forceOver(other.forceOver), epsg_file_exists(other.epsg_file_exists),
  167|      1|      env_var_proj_data(other.env_var_proj_data),
  168|      1|      file_finder(other.file_finder),
  169|      1|      file_finder_user_data(other.file_finder_user_data),
  170|      1|      defer_grid_opening(false),
  171|      1|      custom_sqlite3_vfs_name(other.custom_sqlite3_vfs_name),
  172|      1|      user_writable_directory(other.user_writable_directory),
  173|       |      // BEGIN ini file settings
  174|      1|      iniFileLoaded(other.iniFileLoaded), endpoint(other.endpoint),
  175|      1|      networking(other.networking), ca_bundle_path(other.ca_bundle_path),
  176|      1|      native_ca(other.native_ca), gridChunkCache(other.gridChunkCache),
  177|      1|      defaultTmercAlgo(other.defaultTmercAlgo),
  178|       |      // END ini file settings
  179|      1|      projStringParserCreateFromPROJStringRecursionCounter(0),
  180|      1|      pipelineInitRecursiongCounter(0) {
  181|      1|    set_search_paths(other.search_paths);
  182|      1|}
_Z18pj_get_default_ctxv:
  190|      2|{
  191|       |    // C++11 rules guarantee a thread-safe instantiation.
  192|      2|    static pj_ctx default_context(pj_ctx::createDefault());
  193|      2|    return &default_context;
  194|      2|}
_ZN6pj_ctxD2Ev:
  200|      2|pj_ctx::~pj_ctx() {
  201|      2|    delete[] c_compat_paths;
  202|      2|    proj_context_delete_cpp_context(cpp_context);
  203|      2|}
proj_context_create:
  305|      1|PJ_CONTEXT *proj_context_create(void) {
  306|      1|    return new (std::nothrow) pj_ctx(*pj_get_default_ctx());
  307|      1|}
proj_context_destroy:
  309|      1|PJ_CONTEXT *proj_context_destroy(PJ_CONTEXT *ctx) {
  310|      1|    if (nullptr == ctx)
  ------------------
  |  Branch (310:9): [True: 0, False: 1]
  ------------------
  311|      0|        return nullptr;
  312|       |
  313|       |    /* Trying to free the default context is a no-op (since it is statically
  314|       |     * allocated) */
  315|      1|    if (pj_get_default_ctx() == ctx)
  ------------------
  |  Branch (315:9): [True: 0, False: 1]
  ------------------
  316|      0|        return nullptr;
  317|       |
  318|      1|    delete ctx;
  319|      1|    return nullptr;
  320|      1|}

_Z31proj_context_delete_cpp_contextP14projCppContext:
  134|      2|void proj_context_delete_cpp_context(struct projCppContext *cppContext) {
  135|      2|    delete cppContext;
  136|      2|}

_ZN5osgeo4proj6common13UnitOfMeasureC2ERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEdNS2_4TypeESB_SB_:
   94|     74|    : d(std::make_unique<Private>(nameIn, toSIIn, typeIn, codeSpaceIn,
   95|     74|                                  codeIn)) {}
_ZN5osgeo4proj6common13UnitOfMeasureC2ERKS2_:
  100|     70|    : d(std::make_unique<Private>(*(other.d))) {}
_ZN5osgeo4proj6common13UnitOfMeasureD2Ev:
  105|     32|UnitOfMeasure::~UnitOfMeasure() = default;
_ZN5osgeo4proj6common13UnitOfMeasureaSERKS2_:
  111|     32|UnitOfMeasure &UnitOfMeasure::operator=(const UnitOfMeasure &other) {
  112|     32|    if (this != &other) {
  ------------------
  |  Branch (112:9): [True: 32, False: 0]
  ------------------
  113|     32|        *d = *(other.d);
  114|     32|    }
  115|     32|    return *this;
  116|     32|}
_ZN5osgeo4proj6common7MeasureC2EdRKNS1_13UnitOfMeasureE:
  379|     48|    : d(std::make_unique<Private>(valueIn, unitIn)) {}
_ZN5osgeo4proj6common7MeasureC2ERKS2_:
  384|     22|    : d(std::make_unique<Private>(*(other.d))) {}
_ZN5osgeo4proj6common7MeasureD2Ev:
  389|     22|Measure::~Measure() = default;
_ZNK5osgeo4proj6common7Measure5valueEv:
  412|      6|double Measure::value() PROJ_PURE_DEFN { return d->value_; }
_ZN5osgeo4proj6common5ScaleC2Ed:
  462|      8|Scale::Scale(double valueIn) : Measure(valueIn, UnitOfMeasure::SCALE_UNITY) {}
_ZN5osgeo4proj6common5ScaleC2ERKS2_:
  477|      6|Scale::Scale(const Scale &) = default;
_ZN5osgeo4proj6common5AngleC2Ed:
  492|      4|Angle::Angle(double valueIn) : Measure(valueIn, UnitOfMeasure::DEGREE) {}
_ZN5osgeo4proj6common5AngleC2EdRKNS1_13UnitOfMeasureE:
  502|      2|    : Measure(valueIn, unitIn) {}
_ZN5osgeo4proj6common5AngleC2ERKS2_:
  507|      6|Angle::Angle(const Angle &) = default;
_ZN5osgeo4proj6common6LengthC2Ed:
  522|     24|Length::Length(double valueIn) : Measure(valueIn, UnitOfMeasure::METRE) {}
_ZN5osgeo4proj6common6LengthC2ERKS2_:
  537|     10|Length::Length(const Length &) = default;
_ZN5osgeo4proj6common8DateTimeC2Ev:
  558|      8|DateTime::DateTime() : d(std::make_unique<Private>(std::string())) {}
_ZN5osgeo4proj6common16IdentifiedObjectC2Ev:
  629|     82|IdentifiedObject::IdentifiedObject() : d(std::make_unique<Private>()) {}
_ZN5osgeo4proj6common16IdentifiedObject7Private7setNameERKNS0_4util11PropertyMapE:
  731|     82|{
  732|     82|    const auto pVal = properties.get(NAME_KEY);
  733|     82|    if (!pVal) {
  ------------------
  |  Branch (733:9): [True: 14, False: 68]
  ------------------
  734|     14|        return;
  735|     14|    }
  736|     68|    if (const auto genVal = dynamic_cast<const BoxedValue *>(pVal->get())) {
  ------------------
  |  Branch (736:20): [True: 68, False: 0]
  ------------------
  737|     68|        if (genVal->type() == BoxedValue::Type::STRING) {
  ------------------
  |  Branch (737:13): [True: 68, False: 0]
  ------------------
  738|     68|            name = Identifier::createFromDescription(genVal->stringValue());
  739|     68|        } else {
  740|      0|            throw InvalidValueTypeException("Invalid value type for " +
  741|      0|                                            NAME_KEY);
  742|      0|        }
  743|     68|    } else {
  744|      0|        if (auto identifier =
  ------------------
  |  Branch (744:18): [True: 0, False: 0]
  ------------------
  745|      0|                util::nn_dynamic_pointer_cast<Identifier>(*pVal)) {
  746|      0|            name = NN_NO_CHECK(identifier);
  ------------------
  |  |  223|      0|    ::dropbox::oxygen::nn<                                                     \
  |  |  224|      0|        typename ::NS_PROJ::util::remove_cvref<decltype(p)>::type>(            \
  |  |  225|      0|        ::dropbox::oxygen::i_promise_i_checked_for_null, (p))
  ------------------
  747|      0|        } else {
  748|      0|            throw InvalidValueTypeException("Invalid value type for " +
  749|      0|                                            NAME_KEY);
  750|      0|        }
  751|      0|    }
  752|     68|}
_ZN5osgeo4proj6common16IdentifiedObject7Private14setIdentifiersERKNS0_4util11PropertyMapE:
  758|     82|{
  759|     82|    auto pVal = properties.get(IDENTIFIERS_KEY);
  760|     82|    if (!pVal) {
  ------------------
  |  Branch (760:9): [True: 82, False: 0]
  ------------------
  761|       |
  762|     82|        pVal = properties.get(Identifier::CODE_KEY);
  763|     82|        if (pVal) {
  ------------------
  |  Branch (763:13): [True: 34, False: 48]
  ------------------
  764|     34|            identifiers.clear();
  765|     34|            identifiers.push_back(
  766|     34|                Identifier::create(std::string(), properties));
  767|     34|        }
  768|     82|        return;
  769|     82|    }
  770|      0|    if (auto identifier = util::nn_dynamic_pointer_cast<Identifier>(*pVal)) {
  ------------------
  |  Branch (770:14): [True: 0, False: 0]
  ------------------
  771|      0|        identifiers.clear();
  772|      0|        identifiers.push_back(NN_NO_CHECK(identifier));
  ------------------
  |  |  223|      0|    ::dropbox::oxygen::nn<                                                     \
  |  |  224|      0|        typename ::NS_PROJ::util::remove_cvref<decltype(p)>::type>(            \
  |  |  225|      0|        ::dropbox::oxygen::i_promise_i_checked_for_null, (p))
  ------------------
  773|      0|    } else {
  774|      0|        if (auto array = dynamic_cast<const ArrayOfBaseObject *>(pVal->get())) {
  ------------------
  |  Branch (774:18): [True: 0, False: 0]
  ------------------
  775|      0|            identifiers.clear();
  776|      0|            for (const auto &val : *array) {
  ------------------
  |  Branch (776:34): [True: 0, False: 0]
  ------------------
  777|      0|                identifier = util::nn_dynamic_pointer_cast<Identifier>(val);
  778|      0|                if (identifier) {
  ------------------
  |  Branch (778:21): [True: 0, False: 0]
  ------------------
  779|      0|                    identifiers.push_back(NN_NO_CHECK(identifier));
  ------------------
  |  |  223|      0|    ::dropbox::oxygen::nn<                                                     \
  |  |  224|      0|        typename ::NS_PROJ::util::remove_cvref<decltype(p)>::type>(            \
  |  |  225|      0|        ::dropbox::oxygen::i_promise_i_checked_for_null, (p))
  ------------------
  780|      0|                } else {
  781|      0|                    throw InvalidValueTypeException("Invalid value type for " +
  782|      0|                                                    IDENTIFIERS_KEY);
  783|      0|                }
  784|      0|            }
  785|      0|        } else {
  786|      0|            throw InvalidValueTypeException("Invalid value type for " +
  787|      0|                                            IDENTIFIERS_KEY);
  788|      0|        }
  789|      0|    }
  790|      0|}
_ZN5osgeo4proj6common16IdentifiedObject7Private10setAliasesERKNS0_4util11PropertyMapE:
  796|     82|{
  797|     82|    const auto pVal = properties.get(ALIAS_KEY);
  798|     82|    if (!pVal) {
  ------------------
  |  Branch (798:9): [True: 82, False: 0]
  ------------------
  799|     82|        return;
  800|     82|    }
  801|      0|    if (auto l_name = util::nn_dynamic_pointer_cast<GenericName>(*pVal)) {
  ------------------
  |  Branch (801:14): [True: 0, False: 0]
  ------------------
  802|      0|        aliases.clear();
  803|      0|        aliases.push_back(NN_NO_CHECK(l_name));
  ------------------
  |  |  223|      0|    ::dropbox::oxygen::nn<                                                     \
  |  |  224|      0|        typename ::NS_PROJ::util::remove_cvref<decltype(p)>::type>(            \
  |  |  225|      0|        ::dropbox::oxygen::i_promise_i_checked_for_null, (p))
  ------------------
  804|      0|    } else {
  805|      0|        if (const auto array =
  ------------------
  |  Branch (805:24): [True: 0, False: 0]
  ------------------
  806|      0|                dynamic_cast<const ArrayOfBaseObject *>(pVal->get())) {
  807|      0|            aliases.clear();
  808|      0|            for (const auto &val : *array) {
  ------------------
  |  Branch (808:34): [True: 0, False: 0]
  ------------------
  809|      0|                l_name = util::nn_dynamic_pointer_cast<GenericName>(val);
  810|      0|                if (l_name) {
  ------------------
  |  Branch (810:21): [True: 0, False: 0]
  ------------------
  811|      0|                    aliases.push_back(NN_NO_CHECK(l_name));
  ------------------
  |  |  223|      0|    ::dropbox::oxygen::nn<                                                     \
  |  |  224|      0|        typename ::NS_PROJ::util::remove_cvref<decltype(p)>::type>(            \
  |  |  225|      0|        ::dropbox::oxygen::i_promise_i_checked_for_null, (p))
  ------------------
  812|      0|                } else {
  813|      0|                    if (auto genVal =
  ------------------
  |  Branch (813:30): [True: 0, False: 0]
  ------------------
  814|      0|                            dynamic_cast<const BoxedValue *>(val.get())) {
  815|      0|                        if (genVal->type() == BoxedValue::Type::STRING) {
  ------------------
  |  Branch (815:29): [True: 0, False: 0]
  ------------------
  816|      0|                            aliases.push_back(NameFactory::createLocalName(
  817|      0|                                nullptr, genVal->stringValue()));
  818|      0|                        } else {
  819|      0|                            throw InvalidValueTypeException(
  820|      0|                                "Invalid value type for " + ALIAS_KEY);
  821|      0|                        }
  822|      0|                    } else {
  823|      0|                        throw InvalidValueTypeException(
  824|      0|                            "Invalid value type for " + ALIAS_KEY);
  825|      0|                    }
  826|      0|                }
  827|      0|            }
  828|      0|        } else {
  829|      0|            std::string temp;
  830|      0|            if (properties.getStringValue(ALIAS_KEY, temp)) {
  ------------------
  |  Branch (830:17): [True: 0, False: 0]
  ------------------
  831|      0|                aliases.clear();
  832|      0|                aliases.push_back(NameFactory::createLocalName(nullptr, temp));
  833|      0|            } else {
  834|      0|                throw InvalidValueTypeException("Invalid value type for " +
  835|      0|                                                ALIAS_KEY);
  836|      0|            }
  837|      0|        }
  838|      0|    }
  839|      0|}
_ZN5osgeo4proj6common16IdentifiedObject13setPropertiesERKNS0_4util11PropertyMapE:
  846|     82|{
  847|     82|    d->setName(properties);
  848|     82|    d->setIdentifiers(properties);
  849|     82|    d->setAliases(properties);
  850|       |
  851|     82|    properties.getStringValue(REMARKS_KEY, d->remarks);
  852|       |
  853|     82|    {
  854|     82|        const auto pVal = properties.get(DEPRECATED_KEY);
  855|     82|        if (pVal) {
  ------------------
  |  Branch (855:13): [True: 0, False: 82]
  ------------------
  856|      0|            if (const auto genVal =
  ------------------
  |  Branch (856:28): [True: 0, False: 0]
  ------------------
  857|      0|                    dynamic_cast<const BoxedValue *>(pVal->get())) {
  858|      0|                if (genVal->type() == BoxedValue::Type::BOOLEAN) {
  ------------------
  |  Branch (858:21): [True: 0, False: 0]
  ------------------
  859|      0|                    d->isDeprecated = genVal->booleanValue();
  860|      0|                } else {
  861|      0|                    throw InvalidValueTypeException("Invalid value type for " +
  862|      0|                                                    DEPRECATED_KEY);
  863|      0|                }
  864|      0|            } else {
  865|      0|                throw InvalidValueTypeException("Invalid value type for " +
  866|      0|                                                DEPRECATED_KEY);
  867|      0|            }
  868|      0|        }
  869|     82|    }
  870|     82|}
_ZN5osgeo4proj6common11ObjectUsageC2Ev:
 1170|     22|ObjectUsage::ObjectUsage() : d(std::make_unique<Private>()) {}
_ZN5osgeo4proj6common11ObjectUsage13setPropertiesERKNS0_4util11PropertyMapE:
 1195|     22|{
 1196|     22|    IdentifiedObject::setProperties(properties);
 1197|       |
 1198|     22|    optional<std::string> scope;
 1199|     22|    properties.getStringValue(SCOPE_KEY, scope);
 1200|       |
 1201|     22|    ExtentPtr domainOfValidity;
 1202|     22|    {
 1203|     22|        const auto pVal = properties.get(DOMAIN_OF_VALIDITY_KEY);
 1204|     22|        if (pVal) {
  ------------------
  |  Branch (1204:13): [True: 0, False: 22]
  ------------------
 1205|      0|            domainOfValidity = util::nn_dynamic_pointer_cast<Extent>(*pVal);
 1206|      0|            if (!domainOfValidity) {
  ------------------
  |  Branch (1206:17): [True: 0, False: 0]
  ------------------
 1207|      0|                throw InvalidValueTypeException("Invalid value type for " +
 1208|      0|                                                DOMAIN_OF_VALIDITY_KEY);
 1209|      0|            }
 1210|      0|        }
 1211|     22|    }
 1212|       |
 1213|     22|    if (scope.has_value() || domainOfValidity) {
  ------------------
  |  Branch (1213:9): [True: 0, False: 22]
  |  Branch (1213:30): [True: 0, False: 22]
  ------------------
 1214|      0|        d->domains_.emplace_back(ObjectDomain::create(scope, domainOfValidity));
 1215|      0|    }
 1216|       |
 1217|     22|    {
 1218|     22|        const auto pVal = properties.get(OBJECT_DOMAIN_KEY);
 1219|     22|        if (pVal) {
  ------------------
  |  Branch (1219:13): [True: 0, False: 22]
  ------------------
 1220|      0|            if (auto objectDomain =
  ------------------
  |  Branch (1220:22): [True: 0, False: 0]
  ------------------
 1221|      0|                    util::nn_dynamic_pointer_cast<ObjectDomain>(*pVal)) {
 1222|      0|                d->domains_.emplace_back(NN_NO_CHECK(objectDomain));
  ------------------
  |  |  223|      0|    ::dropbox::oxygen::nn<                                                     \
  |  |  224|      0|        typename ::NS_PROJ::util::remove_cvref<decltype(p)>::type>(            \
  |  |  225|      0|        ::dropbox::oxygen::i_promise_i_checked_for_null, (p))
  ------------------
 1223|      0|            } else if (const auto array =
  ------------------
  |  Branch (1223:35): [True: 0, False: 0]
  ------------------
 1224|      0|                           dynamic_cast<const ArrayOfBaseObject *>(
 1225|      0|                               pVal->get())) {
 1226|      0|                for (const auto &val : *array) {
  ------------------
  |  Branch (1226:38): [True: 0, False: 0]
  ------------------
 1227|      0|                    objectDomain =
 1228|      0|                        util::nn_dynamic_pointer_cast<ObjectDomain>(val);
 1229|      0|                    if (objectDomain) {
  ------------------
  |  Branch (1229:25): [True: 0, False: 0]
  ------------------
 1230|      0|                        d->domains_.emplace_back(NN_NO_CHECK(objectDomain));
  ------------------
  |  |  223|      0|    ::dropbox::oxygen::nn<                                                     \
  |  |  224|      0|        typename ::NS_PROJ::util::remove_cvref<decltype(p)>::type>(            \
  |  |  225|      0|        ::dropbox::oxygen::i_promise_i_checked_for_null, (p))
  ------------------
 1231|      0|                    } else {
 1232|      0|                        throw InvalidValueTypeException(
 1233|      0|                            "Invalid value type for " + OBJECT_DOMAIN_KEY);
 1234|      0|                    }
 1235|      0|                }
 1236|      0|            } else {
 1237|      0|                throw InvalidValueTypeException("Invalid value type for " +
 1238|      0|                                                OBJECT_DOMAIN_KEY);
 1239|      0|            }
 1240|      0|        }
 1241|     22|    }
 1242|     22|}
_ZN5osgeo4proj6common13UnitOfMeasure7PrivateC2ERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEdNS2_4TypeESC_SC_:
   82|     74|        : name_(nameIn), toSI_(toSIIn), type_(typeIn), codeSpace_(codeSpaceIn),
   83|     74|          code_(codeIn) {}
_ZN5osgeo4proj6common7Measure7PrivateC2EdRKNS1_13UnitOfMeasureE:
  370|     48|        : value_(valueIn), unit_(unitIn) {}
_ZN5osgeo4proj6common8DateTime7PrivateC2ERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  552|      8|    explicit Private(const std::string &str) : str_(str) {}

_ZN5osgeo4proj2cs20CoordinateSystemAxisC2Ev:
  185|     32|CoordinateSystemAxis::CoordinateSystemAxis() : d(std::make_unique<Private>()) {}
_ZN5osgeo4proj2cs20CoordinateSystemAxis6createERKNS0_4util11PropertyMapERKNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEERKNS1_13AxisDirectionERKNS0_6common13UnitOfMeasureERKNS7_10shared_ptrINS1_8MeridianEEE:
  314|     32|    const MeridianPtr &meridianIn) {
  315|     32|    auto csa(CoordinateSystemAxis::nn_make_shared<CoordinateSystemAxis>());
  316|     32|    csa->setProperties(properties);
  317|     32|    csa->d->abbreviation = abbreviationIn;
  318|     32|    csa->d->direction = &directionIn;
  319|     32|    csa->d->unit = unitIn;
  320|     32|    csa->d->meridian = meridianIn;
  321|     32|    return csa;
  322|     32|}
_ZN5osgeo4proj2cs16CoordinateSystemC2ERKNSt3__16vectorIN7dropbox6oxygen2nnINS3_10shared_ptrINS1_20CoordinateSystemAxisEEEEENS3_9allocatorISB_EEEE:
  602|     14|    : d(std::make_unique<Private>(axisIn)) {}
_ZN5osgeo4proj2cs13EllipsoidalCSC2ERKNSt3__16vectorIN7dropbox6oxygen2nnINS3_10shared_ptrINS1_20CoordinateSystemAxisEEEEENS3_9allocatorISB_EEEE:
  817|     12|    : CoordinateSystem(axisIn) {}
_ZN5osgeo4proj2cs13EllipsoidalCS6createERKNS0_4util11PropertyMapERKN7dropbox6oxygen2nnINSt3__110shared_ptrINS1_20CoordinateSystemAxisEEEEESG_:
  837|     10|                      const CoordinateSystemAxisNNPtr &axis2) {
  838|     10|    std::vector<CoordinateSystemAxisNNPtr> axis{axis1, axis2};
  839|     10|    auto cs(EllipsoidalCS::nn_make_shared<EllipsoidalCS>(axis));
  840|     10|    cs->setProperties(properties);
  841|     10|    return cs;
  842|     10|}
_ZN5osgeo4proj2cs13EllipsoidalCS6createERKNS0_4util11PropertyMapERKN7dropbox6oxygen2nnINSt3__110shared_ptrINS1_20CoordinateSystemAxisEEEEESG_SG_:
  858|      2|                      const CoordinateSystemAxisNNPtr &axis3) {
  859|      2|    std::vector<CoordinateSystemAxisNNPtr> axis{axis1, axis2, axis3};
  860|      2|    auto cs(EllipsoidalCS::nn_make_shared<EllipsoidalCS>(axis));
  861|      2|    cs->setProperties(properties);
  862|      2|    return cs;
  863|      2|}
_ZN5osgeo4proj2cs20CoordinateSystemAxis15createLAT_NORTHERKNS0_6common13UnitOfMeasureE:
  869|     12|CoordinateSystemAxis::createLAT_NORTH(const common::UnitOfMeasure &unit) {
  870|     12|    return create(
  871|     12|        util::PropertyMap().set(IdentifiedObject::NAME_KEY, AxisName::Latitude),
  872|     12|        AxisAbbreviation::lat, AxisDirection::NORTH, unit);
  873|     12|}
_ZN5osgeo4proj2cs20CoordinateSystemAxis15createLONG_EASTERKNS0_6common13UnitOfMeasureE:
  876|     12|CoordinateSystemAxis::createLONG_EAST(const common::UnitOfMeasure &unit) {
  877|     12|    return create(util::PropertyMap().set(IdentifiedObject::NAME_KEY,
  878|     12|                                          AxisName::Longitude),
  879|     12|                  AxisAbbreviation::lon, AxisDirection::EAST, unit);
  880|     12|}
_ZN5osgeo4proj2cs13EllipsoidalCS23createLatitudeLongitudeERKNS0_6common13UnitOfMeasureE:
  892|      8|EllipsoidalCS::createLatitudeLongitude(const common::UnitOfMeasure &unit) {
  893|      8|    return EllipsoidalCS::create(util::PropertyMap(),
  894|      8|                                 CoordinateSystemAxis::createLAT_NORTH(unit),
  895|      8|                                 CoordinateSystemAxis::createLONG_EAST(unit));
  896|      8|}
_ZN5osgeo4proj2cs13EllipsoidalCS40createLatitudeLongitudeEllipsoidalHeightERKNS0_6common13UnitOfMeasureES6_:
  909|      2|    const common::UnitOfMeasure &linearUnit) {
  910|      2|    return EllipsoidalCS::create(
  911|      2|        util::PropertyMap(), CoordinateSystemAxis::createLAT_NORTH(angularUnit),
  912|      2|        CoordinateSystemAxis::createLONG_EAST(angularUnit),
  913|      2|        CoordinateSystemAxis::create(
  914|      2|            util::PropertyMap().set(IdentifiedObject::NAME_KEY,
  915|      2|                                    AxisName::Ellipsoidal_height),
  916|      2|            AxisAbbreviation::h, AxisDirection::UP, linearUnit));
  917|      2|}
_ZN5osgeo4proj2cs13EllipsoidalCS23createLongitudeLatitudeERKNS0_6common13UnitOfMeasureE:
  928|      2|EllipsoidalCS::createLongitudeLatitude(const common::UnitOfMeasure &unit) {
  929|      2|    return EllipsoidalCS::create(util::PropertyMap(),
  930|      2|                                 CoordinateSystemAxis::createLONG_EAST(unit),
  931|      2|                                 CoordinateSystemAxis::createLAT_NORTH(unit));
  932|      2|}
_ZN5osgeo4proj2cs11CartesianCSC2ERKNSt3__16vectorIN7dropbox6oxygen2nnINS3_10shared_ptrINS1_20CoordinateSystemAxisEEEEENS3_9allocatorISB_EEEE:
 1089|      2|    : CoordinateSystem(axisIn) {}
_ZN5osgeo4proj2cs11CartesianCS6createERKNS0_4util11PropertyMapERKN7dropbox6oxygen2nnINSt3__110shared_ptrINS1_20CoordinateSystemAxisEEEEESG_SG_:
 1128|      2|                                     const CoordinateSystemAxisNNPtr &axis3) {
 1129|      2|    std::vector<CoordinateSystemAxisNNPtr> axis{axis1, axis2, axis3};
 1130|      2|    auto cs(CartesianCS::nn_make_shared<CartesianCS>(axis));
 1131|      2|    cs->setProperties(properties);
 1132|      2|    return cs;
 1133|      2|}
_ZN5osgeo4proj2cs11CartesianCS16createGeocentricERKNS0_6common13UnitOfMeasureE:
 1254|      2|CartesianCS::createGeocentric(const common::UnitOfMeasure &unit) {
 1255|      2|    return create(util::PropertyMap(),
 1256|      2|                  CoordinateSystemAxis::create(
 1257|      2|                      util::PropertyMap().set(IdentifiedObject::NAME_KEY,
 1258|      2|                                              AxisName::Geocentric_X),
 1259|      2|                      AxisAbbreviation::X, AxisDirection::GEOCENTRIC_X, unit),
 1260|      2|                  CoordinateSystemAxis::create(
 1261|      2|                      util::PropertyMap().set(IdentifiedObject::NAME_KEY,
 1262|      2|                                              AxisName::Geocentric_Y),
 1263|      2|                      AxisAbbreviation::Y, AxisDirection::GEOCENTRIC_Y, unit),
 1264|      2|                  CoordinateSystemAxis::create(
 1265|      2|                      util::PropertyMap().set(IdentifiedObject::NAME_KEY,
 1266|      2|                                              AxisName::Geocentric_Z),
 1267|      2|                      AxisAbbreviation::Z, AxisDirection::GEOCENTRIC_Z, unit));
 1268|      2|}
_ZN5osgeo4proj2cs13AxisDirectionC2ERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
 1425|     80|AxisDirection::AxisDirection(const std::string &nameIn) : CodeList(nameIn) {
 1426|     80|    auto lowerName = tolower(nameIn);
 1427|     80|    assert(registry.find(lowerName) == registry.end());
 1428|     80|    registry[lowerName] = this;
 1429|     80|}
_ZN5osgeo4proj2cs12RangeMeaningC2ERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
 1445|      4|RangeMeaning::RangeMeaning(const std::string &nameIn) : CodeList(nameIn) {
 1446|      4|    auto lowerName = tolower(nameIn);
 1447|      4|    assert(registry.find(lowerName) == registry.end());
 1448|      4|    registry[lowerName] = this;
 1449|      4|}
_ZN5osgeo4proj2cs12RangeMeaningC2Ev:
 1453|     32|RangeMeaning::RangeMeaning() : CodeList(std::string()) {}
_ZN5osgeo4proj2cs17AxisDirectionWKT1C2ERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
 1470|     14|    : CodeList(nameIn) {
 1471|     14|    auto lowerName = tolower(nameIn);
 1472|     14|    assert(registry.find(lowerName) == registry.end());
 1473|     14|    registry[lowerName] = this;
 1474|     14|}
_ZN5osgeo4proj2cs16CoordinateSystem7PrivateC2ERKNSt3__16vectorIN7dropbox6oxygen2nnINS4_10shared_ptrINS1_20CoordinateSystemAxisEEEEENS4_9allocatorISC_EEEE:
  594|     14|        : axisList(axisListIn) {}

_ZN5osgeo4proj3crs3CRSC2Ev:
  145|     14|CRS::CRS() : d(std::make_unique<Private>()) {}
_ZN5osgeo4proj3crs3CRS13setPropertiesERKNS0_4util11PropertyMapE:
  957|     14|{
  958|     14|    std::string l_remarks;
  959|     14|    std::string extensionProj4;
  960|     14|    properties.getStringValue(IdentifiedObject::REMARKS_KEY, l_remarks);
  961|     14|    properties.getStringValue("EXTENSION_PROJ4", extensionProj4);
  962|       |
  963|     14|    const char *PROJ_CRS_STRING_PREFIX = "PROJ CRS string: ";
  964|     14|    const char *PROJ_CRS_STRING_SUFFIX = ". ";
  965|     14|    const auto beginOfProjStringPos = l_remarks.find(PROJ_CRS_STRING_PREFIX);
  966|     14|    if (beginOfProjStringPos == std::string::npos && extensionProj4.empty()) {
  ------------------
  |  Branch (966:9): [True: 14, False: 0]
  |  Branch (966:54): [True: 14, False: 0]
  ------------------
  967|     14|        ObjectUsage::setProperties(properties);
  968|     14|        return;
  969|     14|    }
  970|       |
  971|      0|    util::PropertyMap newProperties(properties);
  972|       |
  973|       |    // Parse remarks and extract EXTENSION_PROJ4 from it
  974|      0|    if (extensionProj4.empty()) {
  ------------------
  |  Branch (974:9): [True: 0, False: 0]
  ------------------
  975|      0|        if (beginOfProjStringPos != std::string::npos) {
  ------------------
  |  Branch (975:13): [True: 0, False: 0]
  ------------------
  976|      0|            const auto endOfProjStringPos =
  977|      0|                l_remarks.find(PROJ_CRS_STRING_SUFFIX, beginOfProjStringPos);
  978|      0|            if (endOfProjStringPos == std::string::npos) {
  ------------------
  |  Branch (978:17): [True: 0, False: 0]
  ------------------
  979|      0|                extensionProj4 = l_remarks.substr(
  980|      0|                    beginOfProjStringPos + strlen(PROJ_CRS_STRING_PREFIX));
  981|      0|            } else {
  982|      0|                extensionProj4 = l_remarks.substr(
  983|      0|                    beginOfProjStringPos + strlen(PROJ_CRS_STRING_PREFIX),
  984|      0|                    endOfProjStringPos - beginOfProjStringPos -
  985|      0|                        strlen(PROJ_CRS_STRING_PREFIX));
  986|      0|            }
  987|      0|        }
  988|      0|    }
  989|       |
  990|      0|    if (!extensionProj4.empty()) {
  ------------------
  |  Branch (990:9): [True: 0, False: 0]
  ------------------
  991|      0|        if (beginOfProjStringPos == std::string::npos) {
  ------------------
  |  Branch (991:13): [True: 0, False: 0]
  ------------------
  992|       |            // Add EXTENSION_PROJ4 to remarks
  993|      0|            l_remarks =
  994|      0|                PROJ_CRS_STRING_PREFIX + extensionProj4 +
  995|      0|                (l_remarks.empty() ? std::string()
  ------------------
  |  Branch (995:18): [True: 0, False: 0]
  ------------------
  996|      0|                                   : PROJ_CRS_STRING_SUFFIX + l_remarks);
  997|      0|        }
  998|      0|    }
  999|       |
 1000|      0|    newProperties.set(IdentifiedObject::REMARKS_KEY, l_remarks);
 1001|       |
 1002|      0|    ObjectUsage::setProperties(newProperties);
 1003|       |
 1004|      0|    d->extensionProj4_ = std::move(extensionProj4);
 1005|      0|}
_ZN5osgeo4proj3crs9SingleCRSC2ERKNSt3__110shared_ptrINS0_5datum5DatumEEERKNS4_INS5_13DatumEnsembleEEERKN7dropbox6oxygen2nnINS4_INS0_2cs16CoordinateSystemEEEEE:
 1577|     14|    : d(std::make_unique<Private>(datumIn, datumEnsembleIn, csIn)) {}
_ZN5osgeo4proj3crs11GeodeticCRSC2ERKNSt3__110shared_ptrINS0_5datum22GeodeticReferenceFrameEEERKNS4_INS5_13DatumEnsembleEEERKN7dropbox6oxygen2nnINS4_INS0_2cs13EllipsoidalCSEEEEE:
 1769|     12|    : SingleCRS(datumIn, checkEnsembleForGeodeticCRS(datumIn, datumEnsembleIn),
 1770|     12|                csIn),
 1771|     12|      d(std::make_unique<Private>(datumIn)) {}
_ZN5osgeo4proj3crs11GeodeticCRSC1ERKNSt3__110shared_ptrINS0_5datum22GeodeticReferenceFrameEEERKNS4_INS5_13DatumEnsembleEEERKN7dropbox6oxygen2nnINS4_INS0_2cs11CartesianCSEEEEE:
 1787|      2|    : SingleCRS(datumIn, checkEnsembleForGeodeticCRS(datumIn, datumEnsembleIn),
 1788|      2|                csIn),
 1789|      2|      d(std::make_unique<Private>(datumIn)) {}
_ZN5osgeo4proj3crs11GeodeticCRS6createERKNS0_4util11PropertyMapERKN7dropbox6oxygen2nnINSt3__110shared_ptrINS0_5datum22GeodeticReferenceFrameEEEEERKNS9_INSB_INS0_2cs11CartesianCSEEEEE:
 1991|      2|                    const cs::CartesianCSNNPtr &cs) {
 1992|      2|    return create(properties, datum.as_nullable(), nullptr, cs);
 1993|      2|}
_ZN5osgeo4proj3crs11GeodeticCRS6createERKNS0_4util11PropertyMapERKNSt3__110shared_ptrINS0_5datum22GeodeticReferenceFrameEEERKNS8_INS9_13DatumEnsembleEEERKN7dropbox6oxygen2nnINS8_INS0_2cs11CartesianCSEEEEE:
 2013|      2|                    const cs::CartesianCSNNPtr &cs) {
 2014|      2|    auto crs(
 2015|      2|        GeodeticCRS::nn_make_shared<GeodeticCRS>(datum, datumEnsemble, cs));
 2016|      2|    crs->assignSelf(crs);
 2017|      2|    crs->setProperties(properties);
 2018|       |
 2019|      2|    return crs;
 2020|      2|}
_ZN5osgeo4proj3crs11GeodeticCRS15createEPSG_4978Ev:
 2601|      2|GeodeticCRSNNPtr GeodeticCRS::createEPSG_4978() {
 2602|      2|    return create(
 2603|      2|        createMapNameEPSGCode("WGS 84", 4978),
 2604|      2|        datum::GeodeticReferenceFrame::EPSG_6326,
 2605|      2|        cs::CartesianCS::createGeocentric(common::UnitOfMeasure::METRE));
 2606|      2|}
_ZN5osgeo4proj3crs13GeographicCRSC1ERKNSt3__110shared_ptrINS0_5datum22GeodeticReferenceFrameEEERKNS4_INS5_13DatumEnsembleEEERKN7dropbox6oxygen2nnINS4_INS0_2cs13EllipsoidalCSEEEEE:
 3027|     12|    : SingleCRS(datumIn, datumEnsembleIn, csIn),
 3028|     12|      GeodeticCRS(datumIn,
 3029|     12|                  checkEnsembleForGeodeticCRS(datumIn, datumEnsembleIn), csIn),
 3030|     12|      d(std::make_unique<Private>(csIn)) {}
_ZN5osgeo4proj3crs13GeographicCRS6createERKNS0_4util11PropertyMapERKN7dropbox6oxygen2nnINSt3__110shared_ptrINS0_5datum22GeodeticReferenceFrameEEEEERKNS9_INSB_INS0_2cs13EllipsoidalCSEEEEE:
 3077|     12|                      const cs::EllipsoidalCSNNPtr &cs) {
 3078|     12|    return create(properties, datum.as_nullable(), nullptr, cs);
 3079|     12|}
_ZN5osgeo4proj3crs13GeographicCRS6createERKNS0_4util11PropertyMapERKNSt3__110shared_ptrINS0_5datum22GeodeticReferenceFrameEEERKNS8_INS9_13DatumEnsembleEEERKN7dropbox6oxygen2nnINS8_INS0_2cs13EllipsoidalCSEEEEE:
 3101|     12|                      const cs::EllipsoidalCSNNPtr &cs) {
 3102|     12|    GeographicCRSNNPtr crs(
 3103|     12|        GeographicCRS::nn_make_shared<GeographicCRS>(datum, datumEnsemble, cs));
 3104|     12|    crs->assignSelf(crs);
 3105|     12|    crs->setProperties(properties);
 3106|     12|    crs->CRS::getPrivate()->setNonStandardProperties(properties);
 3107|     12|    return crs;
 3108|     12|}
_ZN5osgeo4proj3crs13GeographicCRS15createEPSG_4267Ev:
 3220|      2|GeographicCRSNNPtr GeographicCRS::createEPSG_4267() {
 3221|      2|    return create(createMapNameEPSGCode("NAD27", 4267),
 3222|      2|                  datum::GeodeticReferenceFrame::EPSG_6267,
 3223|      2|                  cs::EllipsoidalCS::createLatitudeLongitude(
 3224|      2|                      common::UnitOfMeasure::DEGREE));
 3225|      2|}
_ZN5osgeo4proj3crs13GeographicCRS15createEPSG_4269Ev:
 3229|      2|GeographicCRSNNPtr GeographicCRS::createEPSG_4269() {
 3230|      2|    return create(createMapNameEPSGCode("NAD83", 4269),
 3231|      2|                  datum::GeodeticReferenceFrame::EPSG_6269,
 3232|      2|                  cs::EllipsoidalCS::createLatitudeLongitude(
 3233|      2|                      common::UnitOfMeasure::DEGREE));
 3234|      2|}
_ZN5osgeo4proj3crs13GeographicCRS15createEPSG_4326Ev:
 3238|      2|GeographicCRSNNPtr GeographicCRS::createEPSG_4326() {
 3239|      2|    return create(createMapNameEPSGCode("WGS 84", 4326),
 3240|      2|                  datum::GeodeticReferenceFrame::EPSG_6326,
 3241|      2|                  cs::EllipsoidalCS::createLatitudeLongitude(
 3242|      2|                      common::UnitOfMeasure::DEGREE));
 3243|      2|}
_ZN5osgeo4proj3crs13GeographicCRS15createOGC_CRS84Ev:
 3247|      2|GeographicCRSNNPtr GeographicCRS::createOGC_CRS84() {
 3248|      2|    util::PropertyMap propertiesCRS;
 3249|      2|    propertiesCRS
 3250|      2|        .set(metadata::Identifier::CODESPACE_KEY, metadata::Identifier::OGC)
 3251|      2|        .set(metadata::Identifier::CODE_KEY, "CRS84")
 3252|      2|        .set(common::IdentifiedObject::NAME_KEY, "WGS 84 (CRS84)");
 3253|      2|    return create(propertiesCRS, datum::GeodeticReferenceFrame::EPSG_6326,
 3254|      2|                  cs::EllipsoidalCS::createLongitudeLatitude( // Long Lat !
 3255|      2|                      common::UnitOfMeasure::DEGREE));
 3256|      2|}
_ZN5osgeo4proj3crs13GeographicCRS15createEPSG_4979Ev:
 3260|      2|GeographicCRSNNPtr GeographicCRS::createEPSG_4979() {
 3261|      2|    return create(
 3262|      2|        createMapNameEPSGCode("WGS 84", 4979),
 3263|      2|        datum::GeodeticReferenceFrame::EPSG_6326,
 3264|      2|        cs::EllipsoidalCS::createLatitudeLongitudeEllipsoidalHeight(
 3265|      2|            common::UnitOfMeasure::DEGREE, common::UnitOfMeasure::METRE));
 3266|      2|}
_ZN5osgeo4proj3crs13GeographicCRS15createEPSG_4807Ev:
 3270|      2|GeographicCRSNNPtr GeographicCRS::createEPSG_4807() {
 3271|      2|    auto ellps(datum::Ellipsoid::createFlattenedSphere(
 3272|      2|        createMapNameEPSGCode("Clarke 1880 (IGN)", 7011),
 3273|      2|        common::Length(6378249.2), common::Scale(293.4660212936269)));
 3274|       |
 3275|      2|    auto cs(cs::EllipsoidalCS::createLatitudeLongitude(
 3276|      2|        common::UnitOfMeasure::GRAD));
 3277|       |
 3278|      2|    auto datum(datum::GeodeticReferenceFrame::create(
 3279|      2|        createMapNameEPSGCode("Nouvelle Triangulation Francaise (Paris)", 6807),
 3280|      2|        ellps, util::optional<std::string>(), datum::PrimeMeridian::PARIS));
 3281|       |
 3282|      2|    return create(createMapNameEPSGCode("NTF (Paris)", 4807), datum, cs);
 3283|      2|}
crs.cpp:_ZN5osgeo4proj3crsL27checkEnsembleForGeodeticCRSERKNSt3__110shared_ptrINS0_5datum22GeodeticReferenceFrameEEERKNS3_INS4_13DatumEnsembleEEE:
 1742|     14|                            const datum::DatumEnsemblePtr &ensemble) {
 1743|     14|    const char *msg = "One of Datum or DatumEnsemble should be defined";
 1744|     14|    if (datumIn) {
  ------------------
  |  Branch (1744:9): [True: 14, False: 0]
  ------------------
 1745|     14|        if (!ensemble) {
  ------------------
  |  Branch (1745:13): [True: 14, False: 0]
  ------------------
 1746|     14|            return ensemble;
 1747|     14|        }
 1748|      0|        msg = "Datum and DatumEnsemble should not be defined";
 1749|      0|    } else if (ensemble) {
  ------------------
  |  Branch (1749:16): [True: 0, False: 0]
  ------------------
 1750|      0|        const auto &datums = ensemble->datums();
 1751|      0|        assert(!datums.empty());
 1752|      0|        auto grfFirst =
 1753|      0|            dynamic_cast<datum::GeodeticReferenceFrame *>(datums[0].get());
 1754|      0|        if (grfFirst) {
  ------------------
  |  Branch (1754:13): [True: 0, False: 0]
  ------------------
 1755|      0|            return ensemble;
 1756|      0|        }
 1757|      0|        msg = "Ensemble should contain GeodeticReferenceFrame";
 1758|      0|    }
 1759|      0|    throw util::Exception(msg);
 1760|     14|}
crs.cpp:_ZN5osgeo4proj3crsL21createMapNameEPSGCodeEPKci:
 2591|     16|static util::PropertyMap createMapNameEPSGCode(const char *name, int code) {
 2592|     16|    return util::PropertyMap()
 2593|     16|        .set(common::IdentifiedObject::NAME_KEY, name)
 2594|     16|        .set(metadata::Identifier::CODESPACE_KEY, metadata::Identifier::EPSG)
 2595|     16|        .set(metadata::Identifier::CODE_KEY, code);
 2596|     16|}
_ZN5osgeo4proj3crs3CRS7Private24setNonStandardPropertiesERKNS0_4util11PropertyMapE:
  113|     12|    void setNonStandardProperties(const util::PropertyMap &properties) {
  114|     12|        {
  115|     12|            const auto pVal = properties.get("IMPLICIT_CS");
  116|     12|            if (pVal) {
  ------------------
  |  Branch (116:17): [True: 0, False: 12]
  ------------------
  117|      0|                if (const auto genVal =
  ------------------
  |  Branch (117:32): [True: 0, False: 0]
  ------------------
  118|      0|                        dynamic_cast<const util::BoxedValue *>(pVal->get())) {
  119|      0|                    if (genVal->type() == util::BoxedValue::Type::BOOLEAN &&
  ------------------
  |  Branch (119:25): [True: 0, False: 0]
  ------------------
  120|      0|                        genVal->booleanValue()) {
  ------------------
  |  Branch (120:25): [True: 0, False: 0]
  ------------------
  121|      0|                        implicitCS_ = true;
  122|      0|                    }
  123|      0|                }
  124|      0|            }
  125|     12|        }
  126|       |
  127|     12|        {
  128|     12|            const auto pVal = properties.get("OVER");
  129|     12|            if (pVal) {
  ------------------
  |  Branch (129:17): [True: 0, False: 12]
  ------------------
  130|      0|                if (const auto genVal =
  ------------------
  |  Branch (130:32): [True: 0, False: 0]
  ------------------
  131|      0|                        dynamic_cast<const util::BoxedValue *>(pVal->get())) {
  132|      0|                    if (genVal->type() == util::BoxedValue::Type::BOOLEAN &&
  ------------------
  |  Branch (132:25): [True: 0, False: 0]
  ------------------
  133|      0|                        genVal->booleanValue()) {
  ------------------
  |  Branch (133:25): [True: 0, False: 0]
  ------------------
  134|      0|                        over_ = true;
  135|      0|                    }
  136|      0|                }
  137|      0|            }
  138|     12|        }
  139|     12|    }
_ZN5osgeo4proj3crs9SingleCRS7PrivateC2ERKNSt3__110shared_ptrINS0_5datum5DatumEEERKNS5_INS6_13DatumEnsembleEEERKN7dropbox6oxygen2nnINS5_INS0_2cs16CoordinateSystemEEEEE:
 1563|     14|        : datum(datumIn), datumEnsemble(datumEnsembleIn),
 1564|     14|          coordinateSystem(csIn) {
 1565|     14|        if ((datum ? 1 : 0) + (datumEnsemble ? 1 : 0) != 1) {
  ------------------
  |  Branch (1565:13): [True: 0, False: 14]
  |  Branch (1565:14): [True: 14, False: 0]
  |  Branch (1565:32): [True: 0, False: 14]
  ------------------
 1566|      0|            throw util::Exception("datum or datumEnsemble should be set");
 1567|      0|        }
 1568|     14|    }
_ZN5osgeo4proj3crs11GeodeticCRS7PrivateC2ERKNSt3__110shared_ptrINS0_5datum22GeodeticReferenceFrameEEE:
 1735|     14|        : datum_(datumIn) {}
_ZN5osgeo4proj3crs13GeographicCRS7PrivateC2ERKN7dropbox6oxygen2nnINSt3__110shared_ptrINS0_2cs13EllipsoidalCSEEEEE:
 3018|     12|        : coordinateSystem_(csIn) {}

_ZN5osgeo4proj5datum5DatumC2Ev:
  160|      8|Datum::Datum() : d(std::make_unique<Private>()) {}
_ZN5osgeo4proj5datum5Datum9setAnchorERKNS0_4util8optionalINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEE:
  250|      8|void Datum::setAnchor(const util::optional<std::string> &anchor) {
  251|      8|    d->anchorDefinition = anchor;
  252|      8|}
_ZN5osgeo4proj5datum5Datum13setPropertiesERKNS0_4util11PropertyMapE:
  265|      8|{
  266|      8|    std::string publicationDateResult;
  267|      8|    properties.getStringValue("PUBLICATION_DATE", publicationDateResult);
  268|      8|    if (!publicationDateResult.empty()) {
  ------------------
  |  Branch (268:9): [True: 0, False: 8]
  ------------------
  269|      0|        d->publicationDate = common::DateTime::create(publicationDateResult);
  270|      0|    }
  271|      8|    std::string anchorEpoch;
  272|      8|    properties.getStringValue("ANCHOR_EPOCH", anchorEpoch);
  273|      8|    if (!anchorEpoch.empty()) {
  ------------------
  |  Branch (273:9): [True: 0, False: 8]
  ------------------
  274|      0|        bool success = false;
  275|      0|        const double anchorEpochYear = c_locale_stod(anchorEpoch, success);
  276|      0|        if (success) {
  ------------------
  |  Branch (276:13): [True: 0, False: 0]
  ------------------
  277|      0|            setAnchorEpoch(util::optional<common::Measure>(
  278|      0|                common::Measure(anchorEpochYear, common::UnitOfMeasure::YEAR)));
  279|      0|        }
  280|      0|    }
  281|      8|    ObjectUsage::setProperties(properties);
  282|      8|}
_ZN5osgeo4proj5datum13PrimeMeridianC2ERKNS0_6common5AngleE:
  344|      6|    : d(std::make_unique<Private>(longitudeIn)) {}
_ZN5osgeo4proj5datum13PrimeMeridian6createERKNS0_4util11PropertyMapERKNS0_6common5AngleE:
  383|      6|                                         const common::Angle &longitudeIn) {
  384|      6|    auto pm(PrimeMeridian::nn_make_shared<PrimeMeridian>(longitudeIn));
  385|      6|    pm->setProperties(properties);
  386|      6|    return pm;
  387|      6|}
_ZN5osgeo4proj5datum13PrimeMeridian15createGREENWICHEv:
  391|      2|const PrimeMeridianNNPtr PrimeMeridian::createGREENWICH() {
  392|      2|    return create(createMapNameEPSGCode("Greenwich", 8901), common::Angle(0));
  393|      2|}
_ZN5osgeo4proj5datum13PrimeMeridian24createREFERENCE_MERIDIANEv:
  397|      2|const PrimeMeridianNNPtr PrimeMeridian::createREFERENCE_MERIDIAN() {
  398|      2|    return create(util::PropertyMap().set(IdentifiedObject::NAME_KEY,
  399|      2|                                          "Reference meridian"),
  400|      2|                  common::Angle(0));
  401|      2|}
_ZN5osgeo4proj5datum13PrimeMeridian11createPARISEv:
  405|      2|const PrimeMeridianNNPtr PrimeMeridian::createPARIS() {
  406|      2|    return create(createMapNameEPSGCode("Paris", 8903),
  407|      2|                  common::Angle(2.5969213, common::UnitOfMeasure::GRAD));
  408|      2|}
_ZN5osgeo4proj5datum9EllipsoidC2ERKNS0_6common6LengthERKNS3_5ScaleERKNSt3__112basic_stringIcNSA_11char_traitsIcEENSA_9allocatorIcEEEE:
  607|      6|    : d(std::make_unique<Private>(semiMajorAxisIn, invFlattening,
  608|      6|                                  celestialBodyIn)) {}
_ZN5osgeo4proj5datum9EllipsoidC2ERKNS0_6common6LengthES6_RKNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEE:
  615|      2|    : d(std::make_unique<Private>(semiMajorAxisIn, semiMinorAxisIn,
  616|      2|                                  celestialBodyIn)) {}
_ZN5osgeo4proj5datum9Ellipsoid21createFlattenedSphereERKNS0_4util11PropertyMapERKNS0_6common6LengthERKNS7_5ScaleERKNSt3__112basic_stringIcNSE_11char_traitsIcEENSE_9allocatorIcEEEE:
  819|      6|    const common::Scale &invFlattening, const std::string &celestialBody) {
  820|      6|    if (invFlattening.value() == 0) {
  ------------------
  |  Branch (820:9): [True: 0, False: 6]
  ------------------
  821|      0|        auto ellipsoid(Ellipsoid::nn_make_shared<Ellipsoid>(semiMajorAxisIn,
  822|      0|                                                            celestialBody));
  823|      0|        ellipsoid->setProperties(properties);
  824|      0|        return ellipsoid;
  825|      6|    } else {
  826|      6|        auto ellipsoid(Ellipsoid::nn_make_shared<Ellipsoid>(
  827|      6|            semiMajorAxisIn, invFlattening, celestialBody));
  828|      6|        ellipsoid->setProperties(properties);
  829|      6|        return ellipsoid;
  830|      6|    }
  831|      6|}
_ZN5osgeo4proj5datum9Ellipsoid13createTwoAxisERKNS0_4util11PropertyMapERKNS0_6common6LengthESA_RKNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEE:
  848|      2|                                        const std::string &celestialBody) {
  849|      2|    auto ellipsoid(Ellipsoid::nn_make_shared<Ellipsoid>(
  850|      2|        semiMajorAxisIn, semiMinorAxisIn, celestialBody));
  851|      2|    ellipsoid->setProperties(properties);
  852|      2|    return ellipsoid;
  853|      2|}
_ZN5osgeo4proj5datum9Ellipsoid17createCLARKE_1866Ev:
  857|      2|const EllipsoidNNPtr Ellipsoid::createCLARKE_1866() {
  858|      2|    return createTwoAxis(createMapNameEPSGCode("Clarke 1866", 7008),
  859|      2|                         common::Length(6378206.4), common::Length(6356583.8));
  860|      2|}
_ZN5osgeo4proj5datum9Ellipsoid11createWGS84Ev:
  864|      2|const EllipsoidNNPtr Ellipsoid::createWGS84() {
  865|      2|    return createFlattenedSphere(createMapNameEPSGCode("WGS 84", 7030),
  866|      2|                                 common::Length(6378137),
  867|      2|                                 common::Scale(298.257223563));
  868|      2|}
_ZN5osgeo4proj5datum9Ellipsoid13createGRS1980Ev:
  872|      2|const EllipsoidNNPtr Ellipsoid::createGRS1980() {
  873|      2|    return createFlattenedSphere(createMapNameEPSGCode("GRS 1980", 7019),
  874|      2|                                 common::Length(6378137),
  875|      2|                                 common::Scale(298.257222101));
  876|      2|}
_ZN5osgeo4proj5datum22GeodeticReferenceFrameC2ERKN7dropbox6oxygen2nnINSt3__110shared_ptrINS1_9EllipsoidEEEEERKNS5_INS7_INS1_13PrimeMeridianEEEEE:
 1234|      8|    : d(std::make_unique<Private>(ellipsoidIn, primeMeridianIn)) {}
_ZN5osgeo4proj5datum22GeodeticReferenceFrame6createERKNS0_4util11PropertyMapERKN7dropbox6oxygen2nnINSt3__110shared_ptrINS1_9EllipsoidEEEEERKNS3_8optionalINSA_12basic_stringIcNSA_11char_traitsIcEENSA_9allocatorIcEEEEEERKNS9_INSB_INS1_13PrimeMeridianEEEEE:
 1292|      8|                               const PrimeMeridianNNPtr &primeMeridian) {
 1293|      8|    GeodeticReferenceFrameNNPtr grf(
 1294|      8|        GeodeticReferenceFrame::nn_make_shared<GeodeticReferenceFrame>(
 1295|      8|            ellipsoid, primeMeridian));
 1296|      8|    grf->setAnchor(anchor);
 1297|      8|    grf->setProperties(properties);
 1298|      8|    return grf;
 1299|      8|}
_ZN5osgeo4proj5datum22GeodeticReferenceFrame15createEPSG_6267Ev:
 1330|      2|const GeodeticReferenceFrameNNPtr GeodeticReferenceFrame::createEPSG_6267() {
 1331|      2|    return create(createMapNameEPSGCode("North American Datum 1927", 6267),
 1332|      2|                  Ellipsoid::CLARKE_1866, util::optional<std::string>(),
 1333|      2|                  PrimeMeridian::GREENWICH);
 1334|      2|}
_ZN5osgeo4proj5datum22GeodeticReferenceFrame15createEPSG_6269Ev:
 1338|      2|const GeodeticReferenceFrameNNPtr GeodeticReferenceFrame::createEPSG_6269() {
 1339|      2|    return create(createMapNameEPSGCode("North American Datum 1983", 6269),
 1340|      2|                  Ellipsoid::GRS1980, util::optional<std::string>(),
 1341|      2|                  PrimeMeridian::GREENWICH);
 1342|      2|}
_ZN5osgeo4proj5datum22GeodeticReferenceFrame15createEPSG_6326Ev:
 1346|      2|const GeodeticReferenceFrameNNPtr GeodeticReferenceFrame::createEPSG_6326() {
 1347|      2|    return create(createMapNameEPSGCode("World Geodetic System 1984", 6326),
 1348|      2|                  Ellipsoid::WGS84, util::optional<std::string>(),
 1349|      2|                  PrimeMeridian::GREENWICH);
 1350|      2|}
_ZN5osgeo4proj5datum17RealizationMethodC2ERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
 2091|      6|    : CodeList(nameIn) {}
datum.cpp:_ZN5osgeo4proj5datumL21createMapNameEPSGCodeEPKci:
   80|     16|static util::PropertyMap createMapNameEPSGCode(const char *name, int code) {
   81|     16|    return util::PropertyMap()
   82|     16|        .set(common::IdentifiedObject::NAME_KEY, name)
   83|     16|        .set(metadata::Identifier::CODESPACE_KEY, metadata::Identifier::EPSG)
   84|     16|        .set(metadata::Identifier::CODE_KEY, code);
   85|     16|}
_ZN5osgeo4proj5datum13PrimeMeridian7PrivateC2ERKNS0_6common5AngleE:
  337|      6|    explicit Private(const common::Angle &longitude) : longitude_(longitude) {}
_ZN5osgeo4proj5datum9Ellipsoid7PrivateC2ERKNS0_6common6LengthERKNS4_5ScaleERKNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEE:
  585|      6|        : semiMajorAxis_(semiMajorAxisIn), inverseFlattening_(invFlattening),
  586|      6|          celestialBody_(celestialBody) {}
_ZN5osgeo4proj5datum9Ellipsoid7PrivateC2ERKNS0_6common6LengthES7_RKNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEE:
  591|      2|        : semiMajorAxis_(semiMajorAxisIn), semiMinorAxis_(semiMinorAxisIn),
  592|      2|          celestialBody_(celestialBody) {}
_ZN5osgeo4proj5datum22GeodeticReferenceFrame7PrivateC2ERKN7dropbox6oxygen2nnINSt3__110shared_ptrINS1_9EllipsoidEEEEERKNS6_INS8_INS1_13PrimeMeridianEEEEE:
 1225|      8|        : primeMeridian_(primeMeridianIn), ellipsoid_(ellipsoidIn) {}

_ZN5osgeo4proj8internal7tolowerERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  130|     98|{
  131|     98|    std::string ret(str);
  132|    942|    for (size_t i = 0; i < ret.size(); i++)
  ------------------
  |  Branch (132:24): [True: 844, False: 98]
  ------------------
  133|    844|        ret[i] = static_cast<char>(::tolower(ret[i]));
  134|     98|    return ret;
  135|     98|}
_ZN5osgeo4proj8internal8toStringEi:
  359|     32|std::string toString(int val) {
  360|       |    // use sqlite3 API that is slightly faster than std::ostringstream
  361|       |    // with forcing the C locale. sqlite3_snprintf() emulates a C locale.
  362|     32|    constexpr int BUF_SIZE = 16;
  363|     32|    char szBuffer[BUF_SIZE];
  364|     32|    sqlite3_snprintf(BUF_SIZE, szBuffer, "%d", val);
  365|     32|    return szBuffer;
  366|     32|}

_ZN5osgeo4proj2io14IWKTExportableD2Ev:
  123|     68|IWKTExportable::~IWKTExportable() = default;
_ZN5osgeo4proj2io7WKTNodeC2ERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
 1021|      2|    : d(std::make_unique<Private>(valueIn)) {}
_ZN5osgeo4proj2io15IJSONExportableD2Ev:
12897|     68|IJSONExportable::~IJSONExportable() = default;
_ZN5osgeo4proj2io7WKTNode7PrivateC2ERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  908|      2|    explicit Private(const std::string &valueIn) : value_(valueIn) {}

_ZN5osgeo4proj8metadata8CitationC2Ev:
   81|    184|Citation::Citation() : d(std::make_unique<Private>()) {}
_ZN5osgeo4proj8metadata8CitationD2Ev:
  100|     68|Citation::~Citation() = default;
_ZN5osgeo4proj8metadata16GeographicExtentC2Ev:
  127|      2|GeographicExtent::GeographicExtent() : d(std::make_unique<Private>()) {}
_ZN5osgeo4proj8metadata21GeographicBoundingBoxC2Edddd:
  157|      2|    : GeographicExtent(),
  158|      2|      d(std::make_unique<Private>(west, south, east, north)) {}
_ZN5osgeo4proj8metadata21GeographicBoundingBox6createEdddd:
  235|      2|                                                         double north) {
  236|      2|    if (std::isnan(west) || std::isnan(south) || std::isnan(east) ||
  ------------------
  |  Branch (236:9): [True: 0, False: 2]
  |  Branch (236:29): [True: 0, False: 2]
  |  Branch (236:50): [True: 0, False: 2]
  ------------------
  237|      2|        std::isnan(north)) {
  ------------------
  |  Branch (237:9): [True: 0, False: 2]
  ------------------
  238|      0|        throw InvalidValueTypeException(
  239|      0|            "GeographicBoundingBox::create() does not accept NaN values");
  240|      0|    }
  241|      2|    if (south > north) {
  ------------------
  |  Branch (241:9): [True: 0, False: 2]
  ------------------
  242|      0|        throw InvalidValueTypeException(
  243|      0|            "GeographicBoundingBox::create() does not accept south > north");
  244|      0|    }
  245|       |    // Avoid creating a degenerate bounding box if reduced to a point or a line
  246|      2|    if (west == east) {
  ------------------
  |  Branch (246:9): [True: 0, False: 2]
  ------------------
  247|      0|        if (west > -180)
  ------------------
  |  Branch (247:13): [True: 0, False: 0]
  ------------------
  248|      0|            west =
  249|      0|                std::nextafter(west, -std::numeric_limits<double>::infinity());
  250|      0|        if (east < 180)
  ------------------
  |  Branch (250:13): [True: 0, False: 0]
  ------------------
  251|      0|            east =
  252|      0|                std::nextafter(east, std::numeric_limits<double>::infinity());
  253|      0|    }
  254|      2|    if (south == north) {
  ------------------
  |  Branch (254:9): [True: 0, False: 2]
  ------------------
  255|      0|        if (south > -90)
  ------------------
  |  Branch (255:13): [True: 0, False: 0]
  ------------------
  256|      0|            south =
  257|      0|                std::nextafter(south, -std::numeric_limits<double>::infinity());
  258|      0|        if (north < 90)
  ------------------
  |  Branch (258:13): [True: 0, False: 0]
  ------------------
  259|      0|            north =
  260|      0|                std::nextafter(north, std::numeric_limits<double>::infinity());
  261|      0|    }
  262|      2|    return GeographicBoundingBox::nn_make_shared<GeographicBoundingBox>(
  263|      2|        west, south, east, north);
  264|      2|}
_ZN5osgeo4proj8metadata6ExtentC2Ev:
  687|      2|Extent::Extent() : d(std::make_unique<Private>()) {}
_ZN5osgeo4proj8metadata6Extent6createERKNS0_4util8optionalINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKNS5_6vectorIN7dropbox6oxygen2nnINS5_10shared_ptrINS1_16GeographicExtentEEEEENS9_ISM_EEEERKNSF_INSI_INSJ_INS1_14VerticalExtentEEEEENS9_IST_EEEERKNSF_INSI_INSJ_INS1_14TemporalExtentEEEEENS9_IS10_EEEE:
  755|      2|               const std::vector<TemporalExtentNNPtr> &temporalElementsIn) {
  756|      2|    auto extent = Extent::nn_make_shared<Extent>();
  757|      2|    extent->assignSelf(extent);
  758|      2|    extent->d->description_ = descriptionIn;
  759|      2|    extent->d->geographicElements_ = geographicElementsIn;
  760|      2|    extent->d->verticalElements_ = verticalElementsIn;
  761|      2|    extent->d->temporalElements_ = temporalElementsIn;
  762|      2|    return extent;
  763|      2|}
_ZN5osgeo4proj8metadata6Extent14createFromBBOXEddddRKNS0_4util8optionalINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEE:
  782|      2|                       const util::optional<std::string> &descriptionIn) {
  783|      2|    return create(
  784|      2|        descriptionIn,
  785|      2|        std::vector<GeographicExtentNNPtr>{
  786|      2|            nn_static_pointer_cast<GeographicExtent>(
  787|      2|                GeographicBoundingBox::create(west, south, east, north))},
  788|      2|        std::vector<VerticalExtentNNPtr>(), std::vector<TemporalExtentNNPtr>());
  789|      2|}
_ZN5osgeo4proj8metadata10Identifier7Private13setPropertiesERKNS0_4util11PropertyMapE:
  939|    116|{
  940|    116|    {
  941|    116|        const auto pVal = properties.get(AUTHORITY_KEY);
  942|    116|        if (pVal) {
  ------------------
  |  Branch (942:13): [True: 0, False: 116]
  ------------------
  943|      0|            if (auto genVal = dynamic_cast<const BoxedValue *>(pVal->get())) {
  ------------------
  |  Branch (943:22): [True: 0, False: 0]
  ------------------
  944|      0|                if (genVal->type() == BoxedValue::Type::STRING) {
  ------------------
  |  Branch (944:21): [True: 0, False: 0]
  ------------------
  945|      0|                    authority_ = Citation(genVal->stringValue());
  946|      0|                } else {
  947|      0|                    throw InvalidValueTypeException("Invalid value type for " +
  948|      0|                                                    AUTHORITY_KEY);
  949|      0|                }
  950|      0|            } else {
  951|      0|                auto citation = dynamic_cast<const Citation *>(pVal->get());
  952|      0|                if (citation) {
  ------------------
  |  Branch (952:21): [True: 0, False: 0]
  ------------------
  953|      0|                    authority_ = *citation;
  954|      0|                } else {
  955|      0|                    throw InvalidValueTypeException("Invalid value type for " +
  956|      0|                                                    AUTHORITY_KEY);
  957|      0|                }
  958|      0|            }
  959|      0|        }
  960|    116|    }
  961|       |
  962|    116|    {
  963|    116|        const auto pVal = properties.get(CODE_KEY);
  964|    116|        if (pVal) {
  ------------------
  |  Branch (964:13): [True: 34, False: 82]
  ------------------
  965|     34|            if (auto genVal = dynamic_cast<const BoxedValue *>(pVal->get())) {
  ------------------
  |  Branch (965:22): [True: 34, False: 0]
  ------------------
  966|     34|                if (genVal->type() == BoxedValue::Type::INTEGER) {
  ------------------
  |  Branch (966:21): [True: 32, False: 2]
  ------------------
  967|     32|                    code_ = toString(genVal->integerValue());
  968|     32|                } else if (genVal->type() == BoxedValue::Type::STRING) {
  ------------------
  |  Branch (968:28): [True: 2, False: 0]
  ------------------
  969|      2|                    code_ = genVal->stringValue();
  970|      2|                } else {
  971|      0|                    throw InvalidValueTypeException("Invalid value type for " +
  972|      0|                                                    CODE_KEY);
  973|      0|                }
  974|     34|            } else {
  975|      0|                throw InvalidValueTypeException("Invalid value type for " +
  976|      0|                                                CODE_KEY);
  977|      0|            }
  978|     34|        }
  979|    116|    }
  980|       |
  981|    116|    properties.getStringValue(CODESPACE_KEY, codeSpace_);
  982|    116|    properties.getStringValue(VERSION_KEY, version_);
  983|    116|    properties.getStringValue(DESCRIPTION_KEY, description_);
  984|    116|    properties.getStringValue(URI_KEY, uri_);
  985|    116|}
_ZN5osgeo4proj8metadata10IdentifierC2ERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKNS0_4util11PropertyMapE:
  993|    116|    : d(std::make_unique<Private>(codeIn, properties)) {}
_ZN5osgeo4proj8metadata10IdentifierC2Ev:
 1001|     68|Identifier::Identifier() : d(std::make_unique<Private>()) {}
_ZN5osgeo4proj8metadata10IdentifierD2Ev:
 1010|     68|Identifier::~Identifier() = default;
_ZN5osgeo4proj8metadata10Identifier6createERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKNS0_4util11PropertyMapE:
 1023|    116|                                   const PropertyMap &properties) {
 1024|    116|    return Identifier::nn_make_shared<Identifier>(codeIn, properties);
 1025|    116|}
_ZN5osgeo4proj8metadata10Identifier21createFromDescriptionERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
 1031|     68|Identifier::createFromDescription(const std::string &descriptionIn) {
 1032|     68|    auto id = Identifier::nn_make_shared<Identifier>();
 1033|     68|    id->d->description_ = descriptionIn;
 1034|     68|    return id;
 1035|     68|}
_ZN5osgeo4proj8metadata21GeographicBoundingBox7PrivateC2Edddd:
  145|      2|        : west_(west), south_(south), east_(east), north_(north) {}
_ZN5osgeo4proj8metadata10Identifier7PrivateC2ERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERKNS0_4util11PropertyMapE:
  926|    116|        : code_(codeIn) {
  927|    116|        setProperties(properties);
  928|    116|    }
_ZN5osgeo4proj8metadata10Identifier7PrivateC2Ev:
  923|     68|    Private() = default;

_ZN5osgeo4proj2io12WKTConstants26createAndAddToConstantListEPKc:
  192|    210|const char *WKTConstants::createAndAddToConstantList(const char *text) {
  193|    210|    WKTConstants::constants_.push_back(text);
  194|    210|    return text;
  195|    210|}

_ZN5osgeo4proj4util10BaseObjectC2Ev:
   70|    806|BaseObject::BaseObject() : d(std::make_unique<Private>()) {}
_ZN5osgeo4proj4util10BaseObjectD2Ev:
   75|    326|BaseObject::~BaseObject() = default;
_ZN5osgeo4proj4util15BaseObjectNNPtrD2Ev:
   79|    248|BaseObjectNNPtr::~BaseObjectNNPtr() = default;
_ZN5osgeo4proj4util10BaseObject10assignSelfERKNS1_15BaseObjectNNPtrE:
   98|     16|void BaseObject::assignSelf(const BaseObjectNNPtr &self) {
   99|     16|    assert(self.get() == this);
  100|     16|    d->self_ = self.as_nullable();
  101|     16|}
_ZN5osgeo4proj4util10BoxedValueC2EPKc:
  143|     38|    : d(std::make_unique<Private>(
  144|     38|          std::string(stringValueIn ? stringValueIn : ""))) {}
  ------------------
  |  Branch (144:23): [True: 38, False: 0]
  ------------------
_ZN5osgeo4proj4util10BoxedValueC2ERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  151|     66|    : d(std::make_unique<Private>(stringValueIn)) {}
_ZN5osgeo4proj4util10BoxedValueC2Ei:
  158|     32|    : d(std::make_unique<Private>(integerValueIn)) {}
_ZN5osgeo4proj4util10BoxedValueD2Ev:
  175|    136|BoxedValue::~BoxedValue() = default;
_ZNK5osgeo4proj4util10BoxedValue4typeEv:
  179|    138|const BoxedValue::Type &BoxedValue::type() const { return d->type_; }
_ZNK5osgeo4proj4util10BoxedValue11stringValueEv:
  183|    104|const std::string &BoxedValue::stringValue() const { return d->stringValue_; }
_ZNK5osgeo4proj4util10BoxedValue12integerValueEv:
  187|     32|int BoxedValue::integerValue() const { return d->integerValue_; }
_ZN5osgeo4proj4util11PropertyMapC2Ev:
  270|    166|PropertyMap::PropertyMap() : d(std::make_unique<Private>()) {}
_ZN5osgeo4proj4util11PropertyMapC2ERKS2_:
  276|     32|    : d(std::make_unique<Private>(*(other.d))) {}
_ZN5osgeo4proj4util11PropertyMapD2Ev:
  282|    196|PropertyMap::~PropertyMap() = default;
_ZNK5osgeo4proj4util11PropertyMap3getERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  288|    710|const BaseObjectNNPtr *PropertyMap::get(const std::string &key) const {
  289|  1.02k|    for (const auto &pair : d->list_) {
  ------------------
  |  Branch (289:27): [True: 1.02k, False: 574]
  ------------------
  290|  1.02k|        if (pair.first == key) {
  ------------------
  |  Branch (290:13): [True: 136, False: 884]
  ------------------
  291|    136|            return &(pair.second);
  292|    136|        }
  293|  1.02k|    }
  294|    574|    return nullptr;
  295|    710|}
_ZN5osgeo4proj4util11PropertyMap3setERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESB_:
  330|     66|PropertyMap &PropertyMap::set(const std::string &key, const std::string &val) {
  331|     66|    d->set(key, util::nn_make_shared<BoxedValue>(val));
  332|     66|    return *this;
  333|     66|}
_ZN5osgeo4proj4util11PropertyMap3setERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEPKc:
  338|     38|PropertyMap &PropertyMap::set(const std::string &key, const char *val) {
  339|     38|    d->set(key, util::nn_make_shared<BoxedValue>(val));
  340|     38|    return *this;
  341|     38|}
_ZN5osgeo4proj4util11PropertyMap3setERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEi:
  346|     32|PropertyMap &PropertyMap::set(const std::string &key, int val) {
  347|     32|    d->set(key, util::nn_make_shared<BoxedValue>(val));
  348|     32|    return *this;
  349|     32|}
_ZNK5osgeo4proj4util11PropertyMap14getStringValueERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERS9_:
  377|    126|{
  378|    268|    for (const auto &pair : d->list_) {
  ------------------
  |  Branch (378:27): [True: 268, False: 126]
  ------------------
  379|    268|        if (pair.first == key) {
  ------------------
  |  Branch (379:13): [True: 0, False: 268]
  ------------------
  380|      0|            auto genVal = dynamic_cast<const BoxedValue *>(pair.second.get());
  381|      0|            if (genVal && genVal->type() == BoxedValue::Type::STRING) {
  ------------------
  |  Branch (381:17): [True: 0, False: 0]
  |  Branch (381:27): [True: 0, False: 0]
  ------------------
  382|      0|                outVal = genVal->stringValue();
  383|      0|                return true;
  384|      0|            }
  385|      0|            throw InvalidValueTypeException("Invalid value type for " + key);
  386|      0|        }
  387|    268|    }
  388|    126|    return false;
  389|    126|}
_ZNK5osgeo4proj4util11PropertyMap14getStringValueERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERNS1_8optionalIS9_EE:
  398|    486|{
  399|    486|    for (const auto &pair : d->list_) {
  ------------------
  |  Branch (399:27): [True: 438, False: 452]
  ------------------
  400|    438|        if (pair.first == key) {
  ------------------
  |  Branch (400:13): [True: 34, False: 404]
  ------------------
  401|     34|            auto genVal = dynamic_cast<const BoxedValue *>(pair.second.get());
  402|     34|            if (genVal && genVal->type() == BoxedValue::Type::STRING) {
  ------------------
  |  Branch (402:17): [True: 34, False: 0]
  |  Branch (402:27): [True: 34, False: 0]
  ------------------
  403|     34|                outVal = genVal->stringValue();
  404|     34|                return true;
  405|     34|            }
  406|      0|            throw InvalidValueTypeException("Invalid value type for " + key);
  407|     34|        }
  408|    438|    }
  409|    452|    return false;
  410|    486|}
_ZN5osgeo4proj4util11GenericNameC2Ev:
  421|      2|GenericName::GenericName() : d(std::make_unique<Private>()) {}
_ZN5osgeo4proj4util9NameSpaceC2ERKNSt3__110shared_ptrINS1_11GenericNameEEE:
  448|      2|    : d(std::make_unique<Private>()) {
  449|      2|    d->name = nameIn;
  450|      2|}
_ZN5osgeo4proj4util9NameSpace12createGLOBALEv:
  488|      2|NameSpaceNNPtr NameSpace::createGLOBAL() {
  489|      2|    NameSpaceNNPtr ns(NameSpace::nn_make_shared<NameSpace>(
  490|      2|        LocalName::make_shared<LocalName>("global")));
  491|      2|    ns->d->isGlobal = true;
  492|      2|    return ns;
  493|      2|}
_ZN5osgeo4proj4util9LocalNameC2ERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  506|      2|LocalName::LocalName(const std::string &name) : d(std::make_unique<Private>()) {
  507|      2|    d->name = name;
  508|      2|}
_ZN5osgeo4proj4util11PropertyMap7Private3setERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERKN7dropbox6oxygen2nnINS4_10shared_ptrINS1_10BoxedValueEEEEE:
  256|    136|    void set(const std::string &key, const BoxedValueNNPtr &val) {
  257|    136|        for (auto &pair : list_) {
  ------------------
  |  Branch (257:25): [True: 102, False: 136]
  ------------------
  258|    102|            if (pair.first == key) {
  ------------------
  |  Branch (258:17): [True: 0, False: 102]
  ------------------
  259|      0|                pair.second = val;
  260|      0|                return;
  261|      0|            }
  262|    102|        }
  263|    136|        list_.emplace_back(key, val);
  264|    136|    }
_ZN5osgeo4proj4util10BoxedValue7PrivateC2ERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  124|    104|        : type_(BoxedValue::Type::STRING), stringValue_(stringValueIn) {}
_ZN5osgeo4proj4util10BoxedValue7PrivateC2Ei:
  127|     32|        : type_(BoxedValue::Type::INTEGER), integerValue_(integerValueIn) {}

proj_log_func:
  180|      1|void proj_log_func(PJ_CONTEXT *ctx, void *app_data, PJ_LOG_FUNCTION logf) {
  181|       |    /******************************************************************************
  182|       |        Put a new logging function into P's context. The opaque object app_data
  183|       |    is passed as first arg at each call to the logger
  184|       |    ******************************************************************************/
  185|      1|    if (nullptr == ctx)
  ------------------
  |  Branch (185:9): [True: 0, False: 1]
  ------------------
  186|      0|        ctx = pj_get_default_ctx();
  187|      1|    ctx->logger_app_data = app_data;
  188|      1|    if (nullptr != logf)
  ------------------
  |  Branch (188:9): [True: 1, False: 0]
  ------------------
  189|      1|        ctx->logger = logf;
  190|      1|}

proj_destroy:
  100|  15.2k|PJ *proj_destroy(PJ *P) {
  101|  15.2k|    if (nullptr == P || !P->destructor)
  ------------------
  |  Branch (101:9): [True: 15.2k, False: 0]
  |  Branch (101:25): [True: 0, False: 0]
  ------------------
  102|  15.2k|        return nullptr;
  103|       |    /* free projection parameters - all the hard work is done by */
  104|       |    /* pj_default_destructor, which is supposed */
  105|       |    /* to be called as the last step of the local destructor     */
  106|       |    /* pointed to by P->destructor. In most cases,               */
  107|       |    /* pj_default_destructor actually *is* what is pointed to    */
  108|      0|    P->destructor(P, proj_errno(P));
  109|      0|    return nullptr;
  110|  15.2k|}

_ZN5osgeo4proj11FileManager27fillDefaultNetworkInterfaceEP6pj_ctx:
 1953|      1|void FileManager::fillDefaultNetworkInterface(PJ_CONTEXT *ctx) {
 1954|      1|#ifdef CURL_ENABLED
 1955|      1|    ctx->networking.open = CurlFileHandle::open;
 1956|      1|    ctx->networking.close = pj_curl_close;
 1957|      1|    ctx->networking.read_range = pj_curl_read_range;
 1958|      1|    ctx->networking.get_header_value = pj_curl_get_header_value;
 1959|       |#else
 1960|       |    ctx->networking.open = no_op_network_open;
 1961|       |    ctx->networking.close = no_op_network_close;
 1962|       |#endif
 1963|      1|}

_ZN6pj_ctxC2Ev:
  850|      1|    pj_ctx() = default;

isea.cpp:_ZN12_GLOBAL__N_120ISEAPlanarProjectionC2ERKNS_8GeoPointE:
 1099|      4|        : orientation(value), cosOrientationLat(cos(value.lat)),
 1100|      4|          sinOrientationLat(sin(value.lat)) {}

