_ZNK4Ogre3Any4typeEv:
  115|  5.37k|        {
  116|  5.37k|            return mContent ? mContent->getType() : typeid(void);
  ------------------
  |  Branch (116:20): [True: 5.37k, False: 0]
  ------------------
  117|  5.37k|        }
_ZN4Ogre8any_castIPNS_5ImageEEET_RKNS_3AnyE:
  241|  5.37k|    {
  242|  5.37k|        const ValueType * result = any_cast<ValueType>(&operand);
  243|  5.37k|        if(!result)
  ------------------
  |  Branch (243:12): [True: 0, False: 5.37k]
  ------------------
  244|      0|        {
  245|      0|            throw std::bad_cast();
  246|      0|        }
  247|  5.37k|        return *result;
  248|  5.37k|    }
_ZN4Ogre8any_castIPNS_5ImageEEEPKT_PKNS_3AnyE:
  235|  5.37k|    {
  236|  5.37k|        return any_cast<ValueType>(const_cast<Any *>(operand));
  237|  5.37k|    }
_ZN4Ogre8any_castIPNS_5ImageEEEPT_PNS_3AnyE:
  222|  5.37k|    {
  223|  5.37k|        return operand &&
  ------------------
  |  Branch (223:16): [True: 5.37k, False: 0]
  ------------------
  224|       |#if (OGRE_COMPILER == OGRE_COMPILER_GNUC && OGRE_COMP_VER < 450) || OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS
  225|       |                (std::strcmp(operand->type().name(), typeid(ValueType).name()) == 0)
  226|       |#else
  227|  5.37k|                (operand->type() == typeid(ValueType))
  ------------------
  |  Branch (227:17): [True: 5.37k, False: 0]
  ------------------
  228|  5.37k|#endif
  229|  5.37k|                    ? &static_cast<Any::holder<ValueType> *>(operand->mContent)->held
  230|  5.37k|                    : 0;
  231|  5.37k|    }

_ZN4Ogre5Codec15unregisterCodecEPS0_:
   80|  51.6k|        {
   81|  51.6k|            msMapCodecs.erase(pCodec->getType());
   82|  51.6k|        }

_ZNK4Ogre10DataStream4sizeEv:
  186|    677|        size_t size(void) const { return mSize; }
_ZN4Ogre16MemoryDataStream6getPtrEv:
  318|    677|        uchar* getPtr(void) { return mData; }

_ZN4Ogre17GpuProgramFactoryD2Ev:
   51|      2|        virtual ~GpuProgramFactory() {}

_ZNK4Ogre5Image8getWidthEv:
  365|  1.81k|        uint32 getWidth(void) const { return mWidth; }
_ZNK4Ogre5Image9getHeightEv:
  369|  1.58k|        uint32 getHeight(void) const { return mHeight; }
_ZN4Ogre5Image7getDataEjjj:
  326|    677|        {
  327|       |            assert((!mBuffer && (x + y + z) == 0) || (x < mWidth && y < mHeight && z < mDepth));
  328|    677|            return mBuffer + mPixelSize * (z * mWidth * mHeight + mWidth * y + x);
  329|    677|        }
_ZNK4Ogre5Image10getRowSpanEv:
  382|    677|        size_t getRowSpan(void) const { return mWidth * mPixelSize; }
_ZNK4Ogre5Image9getFormatEv:
  386|    677|        PixelFormat getFormat() const { return mFormat; }

_ZNK4Ogre11LodStrategy7getNameEv:
  103|      8|        const String& getName() const { return mName; }

_ZN4Ogre13OptimisedUtilC2Ev:
   64|      2|        OptimisedUtil(void) {}

_ZN4Ogre34RenderSystemCapabilitiesSerializer22addCapabilitiesMappingERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_12CapabilitiesE:
  100|     43|        {
  101|     43|            mCapabilitiesMap.emplace(name, cap);
  102|     43|        }
_ZN4Ogre34RenderSystemCapabilitiesSerializer14addKeywordTypeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS0_21CapabilityKeywordTypeE:
  117|     31|        {
  118|     31|            mKeywordTypeMap.emplace(keyword, type);
  119|     31|        }
_ZN4Ogre34RenderSystemCapabilitiesSerializer18addSetStringMethodERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEMNS_24RenderSystemCapabilitiesEFvS9_E:
  132|      4|        {
  133|      4|            mSetStringMethodDispatchTable.emplace(keyword, method);
  134|      4|        }
_ZN4Ogre34RenderSystemCapabilitiesSerializer15addSetIntMethodERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEMNS_24RenderSystemCapabilitiesEFvtE:
  152|     10|        {
  153|     10|            mSetIntMethodDispatchTable.emplace(keyword, method);
  154|     10|        }
_ZN4Ogre34RenderSystemCapabilitiesSerializer16addSetBoolMethodERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEMNS_24RenderSystemCapabilitiesEFvbE:
  172|      1|        {
  173|      1|            mSetBoolMethodDispatchTable.emplace(keyword, method);
  174|      1|        }
_ZN4Ogre34RenderSystemCapabilitiesSerializer16addSetRealMethodERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEMNS_24RenderSystemCapabilitiesEFvfE:
  192|      1|        {
  193|      1|            mSetRealMethodDispatchTable.emplace(keyword, method);
  194|      1|        }

_ZN4Ogre16ScriptTranslatorD2Ev:
   60|     15|        virtual ~ScriptTranslator() {}
_ZN4Ogre23ScriptTranslatorManagerD2Ev:
  127|      1|        virtual ~ScriptTranslatorManager() {}

_ZN4Ogre9SharedPtrINS_10DataStreamEEC2INS_20FileStreamDataStreamEEEPT_:
   50|  4.69k|        explicit SharedPtr(Y* ptr) : shared_ptr<T>(ptr) {}
_ZN4Ogre9SharedPtrINS_10DataStreamEEC2INS_16MemoryDataStreamEEEPT_:
   50|    677|        explicit SharedPtr(Y* ptr) : shared_ptr<T>(ptr) {}
_ZN4Ogre9SharedPtrINS_16MemoryDataStreamEEC2IS1_EERKNSt3__110shared_ptrIT_EE:
   59|    677|        SharedPtr(const shared_ptr<Y>& r) : shared_ptr<T>(r) {}
_ZNK4Ogre9SharedPtrINS_16MemoryDataStreamEEptEv:
   63|  1.35k|        T* operator->() const { return shared_ptr<T>::operator->(); }
_ZNK4Ogre9SharedPtrINS_10DataStreamEEptEv:
   63|  4.69k|        T* operator->() const { return shared_ptr<T>::operator->(); }

_ZN4Ogre9ASTCCodec7startupEv:
  165|      1|	{
  166|      1|		if (!msInstance)
  ------------------
  |  Branch (166:7): [True: 1, False: 0]
  ------------------
  167|      1|		{
  168|      1|			msInstance = OGRE_NEW ASTCCodec();
  169|      1|			Codec::registerCodec(msInstance);
  170|      1|		}
  171|       |
  172|      1|        LogManager::getSingleton().logMessage(LML_NORMAL,
  173|      1|                                              "ASTC codec registering");
  174|      1|	}
_ZN4Ogre9ASTCCodec8shutdownEv:
  177|      1|	{
  178|      1|		if(msInstance)
  ------------------
  |  Branch (178:6): [True: 1, False: 0]
  ------------------
  179|      1|		{
  180|      1|			Codec::unregisterCodec(msInstance);
  181|       |			OGRE_DELETE msInstance;
  182|      1|			msInstance = 0;
  183|      1|		}
  184|      1|	}
_ZN4Ogre9ASTCCodecC2Ev:
  187|      1|        mType("astc")
  188|      1|    { 
  189|      1|    }
_ZNK4Ogre9ASTCCodec7getTypeEv:
  273|      2|    {
  274|      2|        return mType;
  275|      2|    }

_ZN4Ogre9ASTCCodecD2Ev:
   56|      1|        virtual ~ASTCCodec() { }

_ZN4Ogre14ArchiveManager12getSingletonEv:
   40|      3|    {  
   41|       |        assert( msSingleton );  return ( *msSingleton );  
   42|      3|    }
_ZN4Ogre14ArchiveManagerC2Ev:
   45|      1|    {
   46|      1|    }
_ZN4Ogre14ArchiveManagerD2Ev:
  105|      1|    {
  106|       |        // Thanks to http://www.viva64.com/en/examples/V509/ for finding the error for us!
  107|       |        // (originally, it detected we were throwing using OGRE_EXCEPT in the destructor)
  108|       |        // We now raise an assert.
  109|       |
  110|       |        // Unload & delete resources in turn
  111|      1|        for (auto& a : mArchives)
  ------------------
  |  Branch (111:22): [True: 0, False: 1]
  ------------------
  112|      0|        {
  113|       |            // Unload
  114|      0|            a.second->unload();
  115|       |            // Find factory to destroy. An archive factory created this file, it should still be there!
  116|      0|            ArchiveFactoryMap::iterator fit = mArchFactories.find(a.second->getType());
  117|      0|            assert( fit != mArchFactories.end() && "Cannot find an ArchiveFactory "
  118|      0|                    "to deal with archive this type" );
  119|      0|            fit->second->destroyInstance(a.second);
  120|      0|        }
  121|       |        // Empty the list
  122|      1|        mArchives.clear();
  123|      1|    }
_ZN4Ogre14ArchiveManager17addArchiveFactoryEPNS_14ArchiveFactoryE:
  126|      3|    {
  127|      3|        mArchFactories.emplace(factory->getType(), factory);
  128|      3|        LogManager::getSingleton().logMessage("ArchiveFactory for type '" + factory->getType() + "' registered");
  129|      3|    }

_ZNK4Ogre21BillboardChainFactory7getTypeEv:
  710|      3|    {
  711|      3|        return MOT_BILLBOARD_CHAIN;
  712|      3|    }

_ZNK4Ogre19BillboardSetFactory7getTypeEv:
 1139|      3|    {
 1140|      3|        return MOT_BILLBOARD_SET;
 1141|      3|    }

_ZN4Ogre5CodecD2Ev:
   34|  51.6k|    Codec::~Codec() {
   35|  51.6k|    }
_ZN4Ogre5Codec13registerCodecEPS0_:
   62|  51.6k|    {
   63|  51.6k|        auto ret = msMapCodecs.emplace(pCodec->getType(), pCodec);
   64|  51.6k|        if (!ret.second)
  ------------------
  |  Branch (64:13): [True: 1, False: 51.6k]
  ------------------
   65|       |            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, pCodec->getType() + " already has a registered codec");
   66|  51.6k|    }
_ZN4Ogre5Codec8getCodecERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   69|  5.37k|    {
   70|  5.37k|        String lwrcase = extension;
   71|  5.37k|        StringUtil::toLowerCase(lwrcase);
   72|  5.37k|        CodecList::const_iterator i = msMapCodecs.find(lwrcase);
   73|  5.37k|        if (i == msMapCodecs.end())
  ------------------
  |  Branch (73:13): [True: 0, False: 5.37k]
  ------------------
   74|      0|        {
   75|      0|            String formats_str;
   76|      0|            if(msMapCodecs.empty())
  ------------------
  |  Branch (76:16): [True: 0, False: 0]
  ------------------
   77|      0|                formats_str = "There are no formats supported (no codecs registered).";
   78|      0|            else
   79|      0|                formats_str = "Supported formats are: " + StringConverter::toString(getExtensions()) + ".";
   80|       |
   81|      0|            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
   82|      0|                        "Can not find codec for '" + extension + "' format.\n" + formats_str);
   83|      0|        }
   84|       |
   85|  5.37k|        return i->second;
   86|  5.37k|    }

_ZN4Ogre17CompositorManagerC2Ev:
   48|      1|    mRectangle(0)
   49|      1|{
   50|       |    // Loading order (just after materials)
   51|      1|    mLoadOrder = 110.0f;
   52|       |
   53|       |    // Resource type
   54|      1|    mResourceType = "Compositor";
   55|       |
   56|       |    // Register with resource group manager
   57|      1|    ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
   58|       |
   59|      1|}
_ZN4Ogre17CompositorManagerD2Ev:
   62|      1|{
   63|      1|    freeChains();
   64|      1|    freePooledTextures(false);
   65|      1|    OGRE_DELETE mRectangle;
   66|       |
   67|       |    // Resources cleared by superclass
   68|       |    // Unregister with resource group manager
   69|      1|    ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType);
   70|      1|    ResourceGroupManager::getSingleton()._unregisterScriptLoader(this);
   71|      1|}
_ZN4Ogre17CompositorManager9removeAllEv:
  123|      1|{
  124|      1|    freeChains();
  125|      1|    ResourceManager::removeAll();
  126|      1|}
_ZN4Ogre17CompositorManager10freeChainsEv:
  129|      2|{
  130|      2|    for(auto& c : mChains)
  ------------------
  |  Branch (130:17): [True: 0, False: 2]
  ------------------
  131|      0|    {
  132|       |        OGRE_DELETE  c.second;
  133|      0|    }
  134|      2|    mChains.clear();
  135|      2|}
_ZN4Ogre17CompositorManager18freePooledTexturesEb:
  383|      1|{
  384|      1|    if (onlyIfUnreferenced)
  ------------------
  |  Branch (384:9): [True: 0, False: 1]
  ------------------
  385|      0|    {
  386|      0|        for (auto & i : mTexturesByDef)
  ------------------
  |  Branch (386:23): [True: 0, False: 0]
  ------------------
  387|      0|        {
  388|      0|            TextureList& texList = i.second;
  389|      0|            for (auto j = texList.begin(); j != texList.end();)
  ------------------
  |  Branch (389:44): [True: 0, False: 0]
  ------------------
  390|      0|            {
  391|       |                // if the resource system, plus this class, are the only ones to have a reference..
  392|       |                // NOTE: any material references will stop this texture getting freed (e.g. compositor demo)
  393|       |                // until this routine is called again after the material no longer references the texture
  394|      0|                if (j->use_count() == ResourceGroupManager::RESOURCE_SYSTEM_NUM_REFERENCE_COUNTS + 1)
  ------------------
  |  Branch (394:21): [True: 0, False: 0]
  ------------------
  395|      0|                {
  396|      0|                    TextureManager::getSingleton().remove((*j)->getHandle());
  397|      0|                    j = texList.erase(j);
  398|      0|                }
  399|      0|                else
  400|      0|                    ++j;
  401|      0|            }
  402|      0|        }
  403|      0|        for (auto & i : mChainTexturesByDef)
  ------------------
  |  Branch (403:23): [True: 0, False: 0]
  ------------------
  404|      0|        {
  405|      0|            TextureDefMap& texMap = i.second;
  406|      0|            for (TextureDefMap::iterator j = texMap.begin(); j != texMap.end();) 
  ------------------
  |  Branch (406:62): [True: 0, False: 0]
  ------------------
  407|      0|            {
  408|      0|                const TexturePtr& tex = j->second;
  409|      0|                if (tex.use_count() == ResourceGroupManager::RESOURCE_SYSTEM_NUM_REFERENCE_COUNTS + 1)
  ------------------
  |  Branch (409:21): [True: 0, False: 0]
  ------------------
  410|      0|                {
  411|      0|                    TextureManager::getSingleton().remove(tex->getHandle());
  412|      0|                    texMap.erase(j++);
  413|      0|                }
  414|      0|                else
  415|      0|                    ++j;
  416|      0|            }
  417|      0|        }
  418|      0|    }
  419|      1|    else
  420|      1|    {
  421|       |        // destroy all
  422|      1|        mTexturesByDef.clear();
  423|      1|        mChainTexturesByDef.clear();
  424|      1|    }
  425|       |
  426|      1|}

_ZN4Ogre10ConfigFileC2Ev:
   38|  4.69k|    {
   39|  4.69k|    }
_ZN4Ogre10ConfigFile5clearEv:
   42|  4.69k|    {
   43|  4.69k|        mSettings.clear();
   44|  4.69k|        mSettingsPtr.clear();
   45|  4.69k|    }
_ZN4Ogre10ConfigFile4loadERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_b:
   48|  4.69k|    {
   49|  4.69k|        loadDirect(filename, separators, trimWhitespace);
   50|  4.69k|    }
_ZN4Ogre10ConfigFile10loadDirectERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_b:
   60|  4.69k|    {
   61|  4.69k|        load(_openFileStream(filename, std::ios::in | std::ios::binary), separators, trimWhitespace);
   62|  4.69k|    }
_ZN4Ogre10ConfigFile4loadERKNS_9SharedPtrINS_10DataStreamEEERKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEb:
   74|  4.69k|    {
   75|       |        /* Clear current settings map */
   76|  4.69k|        clear();
   77|       |
   78|  4.69k|        String currentSection = BLANKSTRING;
   79|  4.69k|        SettingsMultiMap* currentSettings = &mSettings[currentSection];
   80|  4.69k|        mSettingsPtr[currentSection] = currentSettings;
   81|       |
   82|       |
   83|       |        /* Process the file line for line */
   84|  4.69k|        String line, optName, optVal;
   85|  9.38k|        while (!stream->eof())
  ------------------
  |  Branch (85:16): [True: 4.69k, False: 4.69k]
  ------------------
   86|  4.69k|        {
   87|  4.69k|            line = stream->getLine();
   88|       |            /* Ignore comments & blanks */
   89|  4.69k|            if (line.length() > 0 && line.at(0) != '#' && line.at(0) != '@')
  ------------------
  |  Branch (89:17): [True: 0, False: 4.69k]
  |  Branch (89:38): [True: 0, False: 0]
  |  Branch (89:59): [True: 0, False: 0]
  ------------------
   90|      0|            {
   91|      0|                if (line.at(0) == '[' && line.at(line.length()-1) == ']')
  ------------------
  |  Branch (91:21): [True: 0, False: 0]
  |  Branch (91:42): [True: 0, False: 0]
  ------------------
   92|      0|                {
   93|       |                    // Section
   94|      0|                    currentSection = line.substr(1, line.length() - 2);
   95|      0|                    currentSettings = &mSettings[currentSection];
   96|      0|                    mSettingsPtr[currentSection] = currentSettings;
   97|      0|                }
   98|      0|                else
   99|      0|                {
  100|       |                    /* Find the first separator character and split the string there */
  101|      0|                    Ogre::String::size_type separator_pos = line.find_first_of(separators, 0);
  102|      0|                    if (separator_pos != Ogre::String::npos)
  ------------------
  |  Branch (102:25): [True: 0, False: 0]
  ------------------
  103|      0|                    {
  104|      0|                        optName = line.substr(0, separator_pos);
  105|       |                        /* Find the first non-separator character following the name */
  106|      0|                        Ogre::String::size_type nonseparator_pos = line.find_first_not_of(separators, separator_pos);
  107|       |                        /* ... and extract the value */
  108|       |                        /* Make sure we don't crash on an empty setting (it might be a valid value) */
  109|      0|                        optVal = (nonseparator_pos == Ogre::String::npos) ? "" : line.substr(nonseparator_pos);
  ------------------
  |  Branch (109:34): [True: 0, False: 0]
  ------------------
  110|      0|                        if (trimWhitespace)
  ------------------
  |  Branch (110:29): [True: 0, False: 0]
  ------------------
  111|      0|                        {
  112|      0|                            StringUtil::trim(optVal);
  113|      0|                            StringUtil::trim(optName);
  114|      0|                        }
  115|      0|                        currentSettings->emplace(optName, optVal);
  116|      0|                    }
  117|      0|                }
  118|      0|            }
  119|  4.69k|        }
  120|  4.69k|    }

_ZN4Ogre10ConvexBody12_destroyPoolEv:
   60|      1|    {
   61|      1|        OGRE_LOCK_MUTEX(msFreePolygonsMutex);
   62|       |        
   63|      1|        for (auto *p : msFreePolygons)
  ------------------
  |  Branch (63:22): [True: 0, False: 1]
  ------------------
   64|      0|        {
   65|       |            OGRE_DELETE_T(p, Polygon, MEMCATEGORY_SCENE_CONTROL);
   66|      0|        }
   67|      1|        msFreePolygons.clear();
   68|      1|    }

_ZN4Ogre8DDSCodec7startupEv:
  168|      1|    {
  169|      1|        if (!msInstance)
  ------------------
  |  Branch (169:13): [True: 1, False: 0]
  ------------------
  170|      1|        {
  171|       |
  172|      1|            LogManager::getSingleton().logMessage(
  173|      1|                LML_NORMAL,
  174|      1|                "DDS codec registering");
  175|       |
  176|      1|            msInstance = OGRE_NEW DDSCodec();
  177|      1|            Codec::registerCodec(msInstance);
  178|      1|        }
  179|       |
  180|      1|    }
_ZN4Ogre8DDSCodec8shutdownEv:
  183|      1|    {
  184|      1|        if(msInstance)
  ------------------
  |  Branch (184:12): [True: 1, False: 0]
  ------------------
  185|      1|        {
  186|      1|            Codec::unregisterCodec(msInstance);
  187|      1|            OGRE_DELETE msInstance;
  188|      1|            msInstance = 0;
  189|      1|        }
  190|       |
  191|      1|    }
_ZN4Ogre8DDSCodecC2Ev:
  194|      1|        mType("dds"),
  195|      1|        mDecodeEnforce(false)
  196|      1|    { 
  197|      1|    }
_ZNK4Ogre8DDSCodec7getTypeEv:
 1056|      2|    {
 1057|      2|        return mType;
 1058|      2|    }

_ZN4Ogre8DDSCodecD2Ev:
   75|      1|        virtual ~DDSCodec() { }

_ZN4Ogre10DataStream7getLineEb:
   41|  4.69k|    {
   42|  4.69k|        char tmpBuf[OGRE_STREAM_TEMP_SIZE];
   43|  4.69k|        String retString;
   44|  4.69k|        size_t readCount;
   45|       |        // Keep looping while not hitting delimiter
   46|  9.38k|        while ((readCount = read(tmpBuf, OGRE_STREAM_TEMP_SIZE-1)) != 0)
  ------------------
  |  Branch (46:16): [True: 4.69k, False: 4.69k]
  ------------------
   47|  4.69k|        {
   48|       |            // Terminate string
   49|  4.69k|            tmpBuf[readCount] = '\0';
   50|       |
   51|  4.69k|            char* p = strchr(tmpBuf, '\n');
   52|  4.69k|            if (p != 0)
  ------------------
  |  Branch (52:17): [True: 0, False: 4.69k]
  ------------------
   53|      0|            {
   54|       |                // Reposition backwards
   55|      0|                skip((long)(p + 1 - tmpBuf - readCount));
   56|      0|                *p = '\0';
   57|      0|            }
   58|       |
   59|  4.69k|            retString += tmpBuf;
   60|       |
   61|  4.69k|            if (p != 0)
  ------------------
  |  Branch (61:17): [True: 0, False: 4.69k]
  ------------------
   62|      0|            {
   63|       |                // Trim off trailing CR if this was a CR/LF entry
   64|      0|                if (retString.length() && retString[retString.length()-1] == '\r')
  ------------------
  |  Branch (64:21): [True: 0, False: 0]
  |  Branch (64:43): [True: 0, False: 0]
  ------------------
   65|      0|                {
   66|      0|                    retString.erase(retString.length()-1, 1);
   67|      0|                }
   68|       |
   69|       |                // Found terminator, break out
   70|      0|                break;
   71|      0|            }
   72|  4.69k|        }
   73|       |
   74|  4.69k|        if (trimAfter)
  ------------------
  |  Branch (74:13): [True: 4.69k, False: 0]
  ------------------
   75|  4.69k|        {
   76|  4.69k|            StringUtil::trim(retString);
   77|  4.69k|        }
   78|       |
   79|  4.69k|        return retString;
   80|  4.69k|    }
_ZN4Ogre10DataStream11getAsStringEv:
  171|  4.69k|    {
  172|       |        // Read the entire buffer - ideally in one read, but if the size of
  173|       |        // the buffer is unknown, do multiple fixed size reads.
  174|  4.69k|        size_t bufSize = (mSize > 0 ? mSize : 4096);
  ------------------
  |  Branch (174:27): [True: 4.69k, False: 0]
  ------------------
  175|  4.69k|        char* pBuf = OGRE_ALLOC_T(char, bufSize, MEMCATEGORY_GENERAL);
  176|       |        // Ensure read from begin of stream
  177|  4.69k|        seek(0);
  178|  4.69k|        String result;
  179|  14.0k|        while (!eof())
  ------------------
  |  Branch (179:16): [True: 9.38k, False: 4.69k]
  ------------------
  180|  9.38k|        {
  181|  9.38k|            size_t nr = read(pBuf, bufSize);
  182|  9.38k|            result.append(pBuf, nr);
  183|  9.38k|        }
  184|       |        OGRE_FREE(pBuf, MEMCATEGORY_GENERAL);
  185|  4.69k|        return result;
  186|  4.69k|    }
_ZN4Ogre16MemoryDataStreamC2EPvmbb:
  190|    677|        : DataStream(static_cast<uint16>(readOnly ? READ : (READ | WRITE)))
  ------------------
  |  Branch (190:42): [True: 0, False: 677]
  ------------------
  191|    677|    {
  192|    677|        mData = mPos = static_cast<uchar*>(pMem);
  193|    677|        mSize = inSize;
  194|    677|        mEnd = mData + mSize;
  195|    677|        mFreeOnClose = freeOnClose;
  196|       |        assert(mEnd >= mPos);
  197|    677|    }
_ZN4Ogre16MemoryDataStreamD2Ev:
  338|    677|    {
  339|    677|        close();
  340|    677|    }
_ZN4Ogre16MemoryDataStream5closeEv:
  461|    677|    {
  462|    677|        mAccess = 0;
  463|    677|        if (mFreeOnClose && mData)
  ------------------
  |  Branch (463:13): [True: 677, False: 0]
  |  Branch (463:29): [True: 677, False: 0]
  ------------------
  464|    677|        {
  465|       |            OGRE_FREE(mData, MEMCATEGORY_GENERAL);
  466|    677|            mData = 0;
  467|    677|        }
  468|    677|    }
_ZN4Ogre20FileStreamDataStreamC2EPNSt3__114basic_ifstreamIcNS1_11char_traitsIcEEEEb:
  472|  4.69k|        : DataStream(), mInStream(s), mFStreamRO(s), mFStream(0), mFreeOnClose(freeOnClose)
  473|  4.69k|    {
  474|       |        // calculate the size
  475|  4.69k|        mInStream->seekg(0, std::ios_base::end);
  476|  4.69k|        mSize = (size_t)mInStream->tellg();
  477|  4.69k|        mInStream->seekg(0, std::ios_base::beg);
  478|  4.69k|        determineAccess();
  479|  4.69k|    }
_ZN4Ogre20FileStreamDataStreamC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPNS1_14basic_ifstreamIcS4_EEmb:
  494|  4.69k|        : DataStream(name), mInStream(s), mFStreamRO(s), mFStream(0), mFreeOnClose(freeOnClose)
  495|  4.69k|    {
  496|       |        // Size is passed in
  497|  4.69k|        mSize = inSize;
  498|  4.69k|        determineAccess();
  499|  4.69k|    }
_ZN4Ogre20FileStreamDataStream15determineAccessEv:
  536|  9.38k|    {
  537|  9.38k|        mAccess = 0;
  538|  9.38k|        if (mInStream)
  ------------------
  |  Branch (538:13): [True: 9.38k, False: 0]
  ------------------
  539|  9.38k|            mAccess |= READ;
  540|  9.38k|        if (mFStream)
  ------------------
  |  Branch (540:13): [True: 0, False: 9.38k]
  ------------------
  541|      0|            mAccess |= WRITE;
  542|  9.38k|    }
_ZN4Ogre20FileStreamDataStreamD2Ev:
  545|  9.38k|    {
  546|  9.38k|        close();
  547|  9.38k|    }
_ZN4Ogre20FileStreamDataStream4readEPvm:
  550|  18.7k|    {
  551|  18.7k|        mInStream->read(static_cast<char*>(buf), static_cast<std::streamsize>(count));
  552|  18.7k|        return (size_t)mInStream->gcount();
  553|  18.7k|    }
_ZN4Ogre20FileStreamDataStream4seekEm:
  653|  4.69k|    {
  654|  4.69k|        mInStream->clear(); //Clear fail status in case eof was set
  655|  4.69k|        mInStream->seekg(static_cast<std::streamoff>(pos), std::ios::beg);
  656|  4.69k|    }
_ZNK4Ogre20FileStreamDataStream3eofEv:
  665|  23.4k|    {
  666|  23.4k|        return mInStream->eof();
  667|  23.4k|    }
_ZN4Ogre20FileStreamDataStream5closeEv:
  670|  9.38k|    {
  671|  9.38k|        mAccess = 0;
  672|  9.38k|        if (mInStream)
  ------------------
  |  Branch (672:13): [True: 9.38k, False: 0]
  ------------------
  673|  9.38k|        {
  674|       |            // Unfortunately, there is no file-specific shared class hierarchy between fstream and ifstream (!!)
  675|  9.38k|            if (mFStreamRO)
  ------------------
  |  Branch (675:17): [True: 9.38k, False: 0]
  ------------------
  676|  9.38k|                mFStreamRO->close();
  677|  9.38k|            if (mFStream)
  ------------------
  |  Branch (677:17): [True: 0, False: 9.38k]
  ------------------
  678|      0|            {
  679|      0|                mFStream->flush();
  680|      0|                mFStream->close();
  681|      0|            }
  682|       |
  683|  9.38k|            if (mFreeOnClose)
  ------------------
  |  Branch (683:17): [True: 4.69k, False: 4.69k]
  ------------------
  684|  4.69k|            {
  685|       |                // delete the stream too
  686|  4.69k|                OGRE_DELETE_T(mFStreamRO, basic_ifstream, MEMCATEGORY_GENERAL);
  687|  4.69k|                OGRE_DELETE_T(mFStream, basic_fstream, MEMCATEGORY_GENERAL);
  688|  4.69k|            }
  689|       |
  690|  9.38k|            mInStream = 0;
  691|  9.38k|            mFStreamRO = 0; 
  692|  9.38k|            mFStream = 0; 
  693|  9.38k|        }
  694|  9.38k|    }

_ZN4Ogre16DefaultWorkQueueC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   34|      1|    : DefaultWorkQueueBase(name), mNumThreadsRegisteredWithRS(0)
   35|      1|    {
   36|      1|    }
_ZN4Ogre16DefaultWorkQueueD2Ev:
   39|      1|    {
   40|      1|        shutdown();
   41|      1|    }
_ZN4Ogre16DefaultWorkQueue8shutdownEv:
   98|      2|    {
   99|      2|        if( !mIsRunning )
  ------------------
  |  Branch (99:13): [True: 2, False: 0]
  ------------------
  100|      2|            return;
  101|       |
  102|      0|        LogManager::getSingleton().stream() <<
  103|      0|            "DefaultWorkQueue('" << mName << "') shutting down on thread " <<
  104|      0|            OGRE_THREAD_CURRENT_ID
  105|      0|            << ".";
  106|       |
  107|      0|        mShuttingDown = true;
  108|       |
  109|      0|#if OGRE_THREAD_SUPPORT
  110|       |        // wake all threads (they should check shutting down as first thing after wait)
  111|      0|        OGRE_THREAD_NOTIFY_ALL(mRequestCondition);
  112|       |
  113|       |        // all our threads should have been woken now, so join
  114|      0|        for (WorkerThreadList::iterator i = mWorkers.begin(); i != mWorkers.end(); ++i)
  ------------------
  |  Branch (114:63): [True: 0, False: 0]
  ------------------
  115|      0|        {
  116|      0|            (*i)->join();
  117|      0|            OGRE_THREAD_DESTROY(*i);
  118|      0|        }
  119|      0|        mWorkers.clear();
  120|      0|#endif
  121|       |
  122|      0|        mIsRunning = false;
  123|      0|    }

_ZN4Ogre23DistanceLodStrategyBaseC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   37|      2|        : LodStrategy(name)
   38|      2|        , mReferenceViewEnabled(false)
   39|      2|        , mReferenceViewValue(-1)
   40|      2|    { }
_ZN4Ogre25DistanceLodSphereStrategyC2Ev:
  161|      1|        : DistanceLodStrategyBase("distance_sphere")
  162|      1|    { }
_ZN4Ogre22DistanceLodBoxStrategyC2Ev:
  192|      1|        : DistanceLodStrategyBase("distance_box")
  193|      1|    { }

_ZN4Ogre13DynLibManagerC2Ev:
   48|      1|    {
   49|      1|    }
_ZN4Ogre13DynLibManagerD2Ev:
   79|      1|    {
   80|       |        // Unload & delete resources in turn
   81|      1|        for(auto & it : mLibList)
  ------------------
  |  Branch (81:23): [True: 0, False: 1]
  ------------------
   82|      0|        {
   83|      0|            it.second->unload();
   84|      0|            OGRE_DELETE it.second;
   85|      0|        }
   86|       |
   87|       |        // Empty the list
   88|      1|        mLibList.clear();
   89|      1|    }

_ZN4Ogre8ETCCodec7startupEv:
   93|      1|    {
   94|      1|        if (!msPKMInstance)
  ------------------
  |  Branch (94:13): [True: 1, False: 0]
  ------------------
   95|      1|        {
   96|      1|            msPKMInstance = OGRE_NEW ETCCodec("pkm");
   97|      1|            Codec::registerCodec(msPKMInstance);
   98|      1|        }
   99|       |
  100|      1|        if (!msKTXInstance)
  ------------------
  |  Branch (100:13): [True: 1, False: 0]
  ------------------
  101|      1|        {
  102|      1|            msKTXInstance = OGRE_NEW ETCCodec("ktx");
  103|      1|            Codec::registerCodec(msKTXInstance);
  104|      1|        }
  105|       |
  106|      1|        LogManager::getSingleton().logMessage(LML_NORMAL,
  107|      1|                                              "ETC codec registering");
  108|      1|    }
_ZN4Ogre8ETCCodec8shutdownEv:
  111|      1|    {
  112|      1|        if(msPKMInstance)
  ------------------
  |  Branch (112:12): [True: 1, False: 0]
  ------------------
  113|      1|        {
  114|      1|            Codec::unregisterCodec(msPKMInstance);
  115|      1|            OGRE_DELETE msPKMInstance;
  116|      1|            msPKMInstance = 0;
  117|      1|        }
  118|       |
  119|      1|        if(msKTXInstance)
  ------------------
  |  Branch (119:12): [True: 1, False: 0]
  ------------------
  120|      1|        {
  121|      1|            Codec::unregisterCodec(msKTXInstance);
  122|       |            OGRE_DELETE msKTXInstance;
  123|      1|            msKTXInstance = 0;
  124|      1|        }
  125|      1|    }
_ZN4Ogre8ETCCodecC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  128|      2|        mType(type)
  129|      2|    {
  130|      2|    }
_ZNK4Ogre8ETCCodec7getTypeEv:
  140|      4|    {
  141|      4|        return mType;
  142|      4|    }

_ZN4Ogre8ETCCodecD2Ev:
   57|      2|        virtual ~ETCCodec() { }

_ZNK4Ogre13EntityFactory7getTypeEv:
 2240|      3|    {
 2241|      3|        return MOT_ENTITY;
 2242|      3|    }

_ZN4Ogre9ExceptionC2EiRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_PKcSB_l:
   43|  3.55k|        line( lin ),
   44|  3.55k|        typeName(typ),
   45|  3.55k|        description( desc ),
   46|  3.55k|        source( src ),
   47|  3.55k|        file( fil )
   48|  3.55k|    {
   49|  3.55k|        StringStream ss;
   50|       |
   51|  3.55k|        ss << typeName << ": "
   52|  3.55k|           << description
   53|  3.55k|           << " in " << source;
   54|       |
   55|  3.55k|        if( line > 0 )
  ------------------
  |  Branch (55:13): [True: 3.55k, False: 0]
  ------------------
   56|  3.55k|        {
   57|  3.55k|            ss << " at " << file << " (line " << line << ")";
   58|  3.55k|        }
   59|       |
   60|  3.55k|        fullDesc = ss.str();
   61|  3.55k|    }

_ZN4Ogre28ExternalTextureSourceManagerC2Ev:
   58|      1|    {
   59|      1|        mCurrExternalTextureSource = 0;
   60|      1|    }
_ZN4Ogre28ExternalTextureSourceManagerD2Ev:
   64|      1|    {
   65|      1|        mTextureSystems.clear();
   66|      1|    }

_ZN4Ogre15_openFileStreamERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEjS8_:
  345|  4.69k|    {
  346|       |        // Use filesystem to determine size 
  347|       |        // (quicker than streaming to the end and back)
  348|       |#ifdef _OGRE_FILESYSTEM_ARCHIVE_UNICODE
  349|       |		struct _stat64i32 tagStat;
  350|       |		int ret = _wstat(to_wpath(full_path).c_str(), &tagStat);
  351|       |#else
  352|  4.69k|        struct stat tagStat;
  353|  4.69k|        int ret = stat(full_path.c_str(), &tagStat);
  354|  4.69k|#endif
  355|  4.69k|        size_t st_size = ret == 0 ? tagStat.st_size : 0;
  ------------------
  |  Branch (355:26): [True: 4.69k, False: 0]
  ------------------
  356|       |
  357|  4.69k|        std::istream* baseStream = 0;
  358|  4.69k|        std::ifstream* roStream = 0;
  359|  4.69k|        std::fstream* rwStream = 0;
  360|       |
  361|  4.69k|        if (mode & std::ios::out)
  ------------------
  |  Branch (361:13): [True: 0, False: 4.69k]
  ------------------
  362|      0|        {
  363|      0|            rwStream = OGRE_NEW_T(std::fstream, MEMCATEGORY_GENERAL)();
  364|       |#ifdef _OGRE_FILESYSTEM_ARCHIVE_UNICODE
  365|       |			rwStream->open(to_wpath(full_path).c_str(), mode);
  366|       |#else
  367|      0|            rwStream->open(full_path.c_str(), mode);
  368|      0|#endif
  369|      0|            baseStream = rwStream;
  370|      0|        }
  371|  4.69k|        else
  372|  4.69k|        {
  373|  4.69k|            roStream = OGRE_NEW_T(std::ifstream, MEMCATEGORY_GENERAL)();
  374|       |#ifdef _OGRE_FILESYSTEM_ARCHIVE_UNICODE
  375|       |			roStream->open(to_wpath(full_path).c_str(), mode);
  376|       |#else
  377|  4.69k|            roStream->open(full_path.c_str(), mode);
  378|  4.69k|#endif
  379|  4.69k|            baseStream = roStream;
  380|  4.69k|        }
  381|       |
  382|       |
  383|       |        // Should check ensure open succeeded, in case fail for some reason.
  384|  4.69k|        if (baseStream->fail())
  ------------------
  |  Branch (384:13): [True: 0, False: 4.69k]
  ------------------
  385|      0|        {
  386|      0|            OGRE_DELETE_T(roStream, basic_ifstream, MEMCATEGORY_GENERAL);
  387|      0|            OGRE_DELETE_T(rwStream, basic_fstream, MEMCATEGORY_GENERAL);
  388|      0|            OGRE_EXCEPT(Exception::ERR_FILE_NOT_FOUND, "Cannot open file: " + full_path);
  389|      0|        }
  390|       |
  391|       |        /// Construct return stream, tell it to delete on destroy
  392|  4.69k|        FileStreamDataStream* stream = 0;
  393|  4.69k|        const String& streamname = name.empty() ? full_path : name;
  ------------------
  |  Branch (393:36): [True: 4.69k, False: 0]
  ------------------
  394|  4.69k|        if (rwStream)
  ------------------
  |  Branch (394:13): [True: 0, False: 4.69k]
  ------------------
  395|      0|        {
  396|       |            // use the writeable stream
  397|      0|            stream = OGRE_NEW FileStreamDataStream(streamname, rwStream, st_size);
  398|      0|        }
  399|  4.69k|        else
  400|  4.69k|        {
  401|  4.69k|            OgreAssertDbg(ret == 0, "Problem getting file size");
  402|       |            // read-only stream
  403|       |            stream = OGRE_NEW FileStreamDataStream(streamname, roStream, st_size);
  404|  4.69k|        }
  405|  4.69k|        return DataStreamPtr(stream);
  406|  4.69k|    }
_ZNK4Ogre24FileSystemArchiveFactory7getTypeEv:
  553|      2|    {
  554|      2|        static String name = "FileSystem";
  555|      2|        return name;
  556|      2|    }

_ZN4Ogre17GpuProgramManagerC2Ev:
  128|      1|    {
  129|       |        // Loading order
  130|      1|        mLoadOrder = 50.0f;
  131|       |        // Resource type
  132|      1|        mResourceType = "GpuProgram";
  133|      1|        mSaveMicrocodesToCache = false;
  134|      1|        mCacheDirty = false;
  135|       |
  136|      1|        mNullFactory = std::make_unique<NullProgramFactory>();
  137|      1|        addFactory(mNullFactory.get());
  138|      1|        mUnifiedFactory = std::make_unique<UnifiedHighLevelGpuProgramFactory>();
  139|      1|        addFactory(mUnifiedFactory.get());
  140|       |
  141|      1|        ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
  142|      1|    }
_ZN4Ogre17GpuProgramManagerD2Ev:
  145|      1|    {
  146|      1|        ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType);
  147|      1|    }
_ZN4Ogre17GpuProgramManager10addFactoryEPNS_17GpuProgramFactoryE:
  430|      2|    {
  431|       |        // deliberately allow later plugins to override earlier ones
  432|      2|        mFactories[factory->getLanguage()] = factory;
  433|      2|    }
OgreGpuProgramManager.cpp:_ZN4Ogre12_GLOBAL__N_118NullProgramFactoryC2Ev:
   73|      1|        NullProgramFactory() {}
OgreGpuProgramManager.cpp:_ZNK4Ogre12_GLOBAL__N_118NullProgramFactory11getLanguageEv:
   77|      1|        {
   78|      1|            return sNullLang;
   79|      1|        }

_ZN4Ogre5ImageC2ENS_11PixelFormatEjjjPhb:
   36|  4.69k|        : mWidth(0),
   37|  4.69k|        mHeight(0),
   38|  4.69k|        mDepth(0),
   39|  4.69k|        mNumMipmaps(0),
   40|  4.69k|        mBufSize(0),
   41|  4.69k|        mFlags(0),
   42|  4.69k|        mFormat(format),
   43|  4.69k|        mBuffer( NULL ),
   44|  4.69k|        mAutoDelete( true )
   45|  4.69k|    {
   46|  4.69k|        if (format == PF_UNKNOWN)
  ------------------
  |  Branch (46:13): [True: 4.69k, False: 0]
  ------------------
   47|  4.69k|            return;
   48|       |
   49|      0|        size_t size = calculateSize(0, 1,  width, height, depth, mFormat);
   50|       |
   51|      0|        if (size == 0)
  ------------------
  |  Branch (51:13): [True: 0, False: 0]
  ------------------
   52|      0|            return;
   53|       |
   54|      0|        if (!buffer)
  ------------------
  |  Branch (54:13): [True: 0, False: 0]
  ------------------
   55|      0|            buffer = (uchar*)malloc(size);
   56|      0|        loadDynamicImage(buffer, width, height, depth, format, autoDelete);
   57|      0|    }
_ZN4Ogre5ImageD2Ev:
   85|  4.69k|    {
   86|  4.69k|        freeMemory();
   87|  4.69k|    }
_ZN4Ogre5Image10freeMemoryEv:
   90|  10.5k|    {
   91|       |        //Only delete if this was not a dynamic image (meaning app holds & destroys buffer)
   92|  10.5k|        if( mBuffer && mAutoDelete )
  ------------------
  |  Branch (92:13): [True: 1.14k, False: 9.38k]
  |  Branch (92:24): [True: 1.14k, False: 0]
  ------------------
   93|  1.14k|        {
   94|  1.14k|            free(mBuffer);
   95|  1.14k|            mBuffer = NULL;
   96|  1.14k|        }
   97|       |
   98|  10.5k|    }
_ZN4Ogre5Image16loadDynamicImageEPhjjjNS_11PixelFormatEbjj:
  202|  1.14k|    {
  203|       |
  204|  1.14k|        freeMemory();
  205|       |        // Set image metadata
  206|  1.14k|        mWidth = uWidth;
  207|  1.14k|        mHeight = uHeight;
  208|  1.14k|        mDepth = depth;
  209|  1.14k|        mFormat = eFormat;
  210|  1.14k|        mPixelSize = static_cast<uchar>(PixelUtil::getNumElemBytes( mFormat ));
  211|  1.14k|        mNumMipmaps = numMipMaps;
  212|  1.14k|        mFlags = 0;
  213|       |        // Set flags
  214|  1.14k|        if (PixelUtil::isCompressed(eFormat))
  ------------------
  |  Branch (214:13): [True: 0, False: 1.14k]
  ------------------
  215|      0|            mFlags |= IF_COMPRESSED;
  216|  1.14k|        if (mDepth != 1)
  ------------------
  |  Branch (216:13): [True: 0, False: 1.14k]
  ------------------
  217|      0|            mFlags |= IF_3D_TEXTURE;
  218|  1.14k|        if(numFaces == 6)
  ------------------
  |  Branch (218:12): [True: 0, False: 1.14k]
  ------------------
  219|      0|            mFlags |= IF_CUBEMAP;
  220|  1.14k|        OgreAssert(numFaces == 6 || numFaces == 1, "Invalid number of faces");
  ------------------
  |  Branch (220:9): [True: 0, False: 1.14k]
  |  Branch (220:9): [True: 1.14k, False: 0]
  ------------------
  221|       |
  222|  1.14k|        mBufSize = calculateSize(numMipMaps, numFaces, uWidth, uHeight, depth, eFormat);
  223|  1.14k|        mBuffer = pData;
  224|  1.14k|        mAutoDelete = autoDelete;
  225|       |
  226|  1.14k|        return *this;
  227|  1.14k|    }
_ZN4Ogre5Image4saveERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  263|    677|    {
  264|    677|        OgreAssert(mBuffer, "No image data loaded");
  ------------------
  |  Branch (264:9): [True: 0, False: 677]
  ------------------
  265|       |
  266|    677|        String base, ext;
  267|    677|        StringUtil::splitBaseFilename(filename, base, ext);
  268|       |
  269|       |        // getCodec throws when no codec is found
  270|    677|        Codec::getCodec(ext)->encodeToFile(this, filename);
  271|    677|    }
_ZN4Ogre5Image4loadERKNS_9SharedPtrINS_10DataStreamEEENSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEE:
  281|  4.69k|    {
  282|  4.69k|        freeMemory();
  283|       |
  284|  4.69k|        if (type.empty())
  ------------------
  |  Branch (284:13): [True: 0, False: 4.69k]
  ------------------
  285|      0|        {
  286|      0|            String base, ext;
  287|      0|            StringUtil::splitBaseFilename(stream->getName(), base, ext);
  288|      0|            if (!ext.empty())
  ------------------
  |  Branch (288:17): [True: 0, False: 0]
  ------------------
  289|      0|                type = ext;
  290|      0|        }
  291|       |
  292|  4.69k|        Codec * pCodec = 0;
  293|  4.69k|        if (!type.empty())
  ------------------
  |  Branch (293:13): [True: 4.69k, False: 0]
  ------------------
  294|  4.69k|        {
  295|       |            // use named codec
  296|  4.69k|            pCodec = Codec::getCodec(type);
  297|  4.69k|        }
  298|      0|        else
  299|      0|        {
  300|       |            // derive from magic number
  301|       |            // read the first 32 bytes or file size, if less
  302|      0|            size_t magicLen = std::min(stream->size(), (size_t)32);
  303|      0|            char magicBuf[32];
  304|      0|            stream->read(magicBuf, magicLen);
  305|       |            // return to start
  306|      0|            stream->seek(0);
  307|      0|            pCodec = Codec::getCodec(magicBuf, magicLen);
  308|       |
  309|      0|            if (!pCodec)
  ------------------
  |  Branch (309:17): [True: 0, False: 0]
  ------------------
  310|      0|                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
  311|      0|                            "Unable to load image: Image format is unknown. Unable to identify codec. "
  312|      0|                            "Check it or specify format explicitly.");
  313|      0|        }
  314|       |
  315|  4.69k|        pCodec->decode(stream, this);
  316|       |
  317|       |        // compute the pixel size
  318|  4.69k|        mPixelSize = static_cast<uchar>(PixelUtil::getNumElemBytes( mFormat ));
  319|       |        // make sure we delete
  320|  4.69k|        mAutoDelete = true;
  321|       |
  322|  4.69k|        return *this;
  323|  4.69k|    }
_ZN4Ogre5Image13calculateSizeEjjjjjNS_11PixelFormatE:
  542|  1.14k|    {
  543|  1.14k|        size_t size = 0;
  544|  2.28k|        for(uint32 mip=0; mip<=mipmaps; ++mip)
  ------------------
  |  Branch (544:27): [True: 1.14k, False: 1.14k]
  ------------------
  545|  1.14k|        {
  546|  1.14k|            size += PixelUtil::getMemorySize(width, height, depth, format)*faces; 
  547|  1.14k|            if(width!=1) width /= 2;
  ------------------
  |  Branch (547:16): [True: 1.07k, False: 66]
  ------------------
  548|  1.14k|            if(height!=1) height /= 2;
  ------------------
  |  Branch (548:16): [True: 1.01k, False: 128]
  ------------------
  549|  1.14k|            if(depth!=1) depth /= 2;
  ------------------
  |  Branch (549:16): [True: 0, False: 1.14k]
  ------------------
  550|  1.14k|        }
  551|  1.14k|        return size;
  552|  1.14k|    }

_ZNK4Ogre12LightFactory7getTypeEv:
  874|      3|    {
  875|      3|        return MOT_LIGHT;
  876|      3|    }

_ZN4Ogre11LodStrategyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   35|      4|        : mName(name)
   36|      4|    { }
_ZN4Ogre11LodStrategyD2Ev:
   39|      4|    { }

_ZN4Ogre18LodStrategyManagerC2Ev:
   48|      1|    {
   49|       |        // Add distance strategies for bounding box and bounding sphere
   50|      1|        LodStrategy *strategy = OGRE_NEW DistanceLodBoxStrategy();
   51|      1|        addStrategy(strategy);
   52|      1|        strategy = OGRE_NEW DistanceLodSphereStrategy();
   53|      1|        addStrategy(strategy);
   54|       |
   55|       |        // Set the default strategy to distance_sphere
   56|      1|        setDefaultStrategy(strategy);
   57|       |
   58|       |        // Add pixel-count strategies (internally based on bounding sphere)
   59|      1|        strategy = OGRE_NEW AbsolutePixelCountLodStrategy();
   60|      1|        addStrategy(strategy);
   61|       |        strategy = OGRE_NEW ScreenRatioPixelCountLodStrategy();
   62|      1|        addStrategy(strategy);
   63|      1|    }
_ZN4Ogre18LodStrategyManagerD2Ev:
   66|      1|    {
   67|       |        // Destroy all strategies and clear the map
   68|      1|        removeAllStrategies();
   69|      1|    }
_ZN4Ogre18LodStrategyManager11addStrategyEPNS_11LodStrategyE:
   72|      4|    {
   73|       |        // Check for invalid strategy name
   74|      4|        if (strategy->getName() == "default")
  ------------------
  |  Branch (74:13): [True: 0, False: 4]
  ------------------
   75|      4|            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Lod strategy name must not be \"default\".", "LodStrategyManager::addStrategy");
   76|       |
   77|       |        // Insert the strategy into the map with its name as the key
   78|      4|        mStrategies.insert(std::make_pair(strategy->getName(), strategy));
   79|      4|    }
_ZN4Ogre18LodStrategyManager19removeAllStrategiesEv:
  100|      1|    {
  101|       |        // Get beginning iterator
  102|      1|        for (auto & s : mStrategies)
  ------------------
  |  Branch (102:23): [True: 4, False: 1]
  ------------------
  103|      4|        {
  104|       |            OGRE_DELETE s.second;
  105|      4|        }
  106|      1|        mStrategies.clear();
  107|      1|    }
_ZN4Ogre18LodStrategyManager18setDefaultStrategyEPNS_11LodStrategyE:
  131|      1|    {
  132|      1|        mDefaultStrategy = strategy;
  133|      1|    }

_ZN4Ogre3LogC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbb:
   52|      1|        mLogLevel(LML_NORMAL), mDebugOut(debuggerOutput),
   53|      1|        mSuppressFile(suppressFile), mTimeStamp(true), mLogName(name), mTermHasColours(false)
   54|      1|    {
   55|      1|        if (!mSuppressFile)
  ------------------
  |  Branch (55:13): [True: 1, False: 0]
  ------------------
   56|      1|        {
   57|      1|            mLog.open(name.c_str());
   58|       |
   59|       |#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WINRT) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
   60|       |            // Register log file to be collected by Windows Error Reporting
   61|       |            const int utf16Length = ::MultiByteToWideChar(CP_ACP, 0, name.c_str(), (int)name.size(), NULL, 0);
   62|       |            if(utf16Length > 0)
   63|       |            {
   64|       |                std::wstring wname;
   65|       |                wname.resize(utf16Length);
   66|       |                if (0 != ::MultiByteToWideChar(CP_ACP, 0, name.c_str(), (int)name.size(), &wname[0], (int)wname.size()))
   67|       |                    WerRegisterFile(wname.c_str(), WerRegFileTypeOther, WER_FILE_ANONYMOUS_DATA);
   68|       |            }
   69|       |#endif
   70|      1|        }
   71|       |
   72|      1|#if OGRE_PLATFORM != OGRE_PLATFORM_WINRT
   73|      1|        char* val = getenv("OGRE_MIN_LOGLEVEL");
   74|      1|        int min_lml;
   75|      1|        if(val && StringConverter::parse(val, min_lml))
  ------------------
  |  Branch (75:12): [True: 0, False: 1]
  |  Branch (75:12): [True: 0, False: 1]
  |  Branch (75:19): [True: 0, False: 0]
  ------------------
   76|      0|            setMinLogLevel(LogMessageLevel(min_lml));
   77|       |
   78|      1|        if(mDebugOut)
  ------------------
  |  Branch (78:12): [True: 0, False: 1]
  ------------------
   79|      0|        {
   80|      0|            val = getenv("TERM");
   81|      0|            mTermHasColours = val && String(val).find("xterm") != String::npos;
  ------------------
  |  Branch (81:31): [True: 0, False: 0]
  |  Branch (81:38): [True: 0, False: 0]
  ------------------
   82|      0|        }
   83|      1|#endif
   84|      1|    }
_ZN4Ogre3Log10logMessageERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_15LogMessageLevelEb:
   97|  23.5k|    {
   98|  23.5k|        OGRE_LOCK_AUTO_MUTEX;
   99|  23.5k|        if (lml >= mLogLevel)
  ------------------
  |  Branch (99:13): [True: 23.5k, False: 0]
  ------------------
  100|  23.5k|        {
  101|  23.5k|            bool skipThisMessage = false;
  102|  23.5k|            for(auto & l : mListeners)
  ------------------
  |  Branch (102:26): [True: 0, False: 23.5k]
  ------------------
  103|      0|                l->messageLogged( message, lml, maskDebug, mLogName, skipThisMessage);
  104|       |            
  105|  23.5k|            if (!skipThisMessage)
  ------------------
  |  Branch (105:17): [True: 23.5k, False: 0]
  ------------------
  106|  23.5k|            {
  107|  23.5k|                if (mDebugOut && !maskDebug)
  ------------------
  |  Branch (107:21): [True: 0, False: 23.5k]
  |  Branch (107:34): [True: 0, False: 0]
  ------------------
  108|      0|                {
  109|       |#    if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WINRT) && OGRE_DEBUG_MODE
  110|       |                    OutputDebugStringA("Ogre: ");
  111|       |                    OutputDebugStringA(message.c_str());
  112|       |                    OutputDebugStringA("\n");
  113|       |#    endif
  114|       |
  115|      0|                    std::ostream& os = int(lml) >= int(LML_WARNING) ? std::cerr : std::cout;
  ------------------
  |  Branch (115:40): [True: 0, False: 0]
  ------------------
  116|       |
  117|      0|                    if(mTermHasColours) {
  ------------------
  |  Branch (117:24): [True: 0, False: 0]
  ------------------
  118|      0|                        if(lml == LML_WARNING)
  ------------------
  |  Branch (118:28): [True: 0, False: 0]
  ------------------
  119|      0|                            os << YELLOW;
  120|      0|                        if(lml == LML_CRITICAL)
  ------------------
  |  Branch (120:28): [True: 0, False: 0]
  ------------------
  121|      0|                            os << RED;
  122|      0|                    }
  123|       |
  124|      0|                    os << message;
  125|       |
  126|      0|                    if(mTermHasColours) {
  ------------------
  |  Branch (126:24): [True: 0, False: 0]
  ------------------
  127|      0|                        os << RESET;
  128|      0|                    }
  129|       |
  130|      0|                    os << std::endl;
  131|      0|                }
  132|       |
  133|       |                // Write time into log
  134|  23.5k|                if (!mSuppressFile)
  ------------------
  |  Branch (134:21): [True: 23.5k, False: 0]
  ------------------
  135|  23.5k|                {
  136|  23.5k|                    if (mTimeStamp)
  ------------------
  |  Branch (136:25): [True: 23.5k, False: 0]
  ------------------
  137|  23.5k|                    {
  138|  23.5k|                        auto t = std::time(nullptr);
  139|  23.5k|                        auto pTime = std::localtime(&t);
  140|  23.5k|                        mLog << std::put_time(pTime, "%H:%M:%S: ");
  141|  23.5k|                    }
  142|  23.5k|                    mLog << message << std::endl;
  143|       |
  144|       |                    // Flush stcmdream to ensure it is written (incase of a crash, we need log to be up to date)
  145|  23.5k|                    mLog.flush();
  146|  23.5k|                }
  147|  23.5k|            }
  148|  23.5k|        }
  149|  23.5k|    }
_ZN4Ogre3Log14setMinLogLevelENS_15LogMessageLevelE:
  173|      1|    {
  174|      1|        OGRE_LOCK_AUTO_MUTEX;
  175|      1|        mLogLevel = lml;
  176|      1|    }

_ZN4Ogre10LogManager15getSingletonPtrEv:
   35|      1|    {
   36|      1|        return msSingleton;
   37|      1|    }
_ZN4Ogre10LogManager12getSingletonEv:
   39|  23.5k|    {  
   40|       |        assert( msSingleton );  return ( *msSingleton );  
   41|  23.5k|    }
_ZN4Ogre10LogManagerC2Ev:
   44|      1|    {
   45|       |        mDefaultLog = NULL;
   46|      1|    }
_ZN4Ogre10LogManager9createLogERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbbb:
   61|      1|    {
   62|      1|        OGRE_LOCK_AUTO_MUTEX;
   63|       |
   64|      1|        Log* newLog = OGRE_NEW Log(name, debuggerOutput, suppressFileOutput);
   65|       |
   66|      1|        if( !mDefaultLog || defaultLog )
  ------------------
  |  Branch (66:13): [True: 1, False: 0]
  |  Branch (66:29): [True: 0, False: 0]
  ------------------
   67|      1|        {
   68|      1|            mDefaultLog = newLog;
   69|      1|        }
   70|       |
   71|      1|        mLogs.emplace(name, newLog);
   72|       |
   73|      1|        return newLog;
   74|      1|    }
_ZN4Ogre10LogManager10logMessageERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_15LogMessageLevelEb:
  125|  23.5k|    {
  126|  23.5k|        OGRE_LOCK_AUTO_MUTEX;
  127|  23.5k|        if (mDefaultLog)
  ------------------
  |  Branch (127:13): [True: 23.5k, False: 0]
  ------------------
  128|  23.5k|        {
  129|  23.5k|            mDefaultLog->logMessage(message, lml, maskDebug);
  130|  23.5k|        }
  131|  23.5k|    }
_ZN4Ogre10LogManager14setMinLogLevelENS_15LogMessageLevelE:
  155|      1|    {
  156|      1|        OGRE_LOCK_AUTO_MUTEX;
  157|      1|        if (mDefaultLog)
  ------------------
  |  Branch (157:13): [True: 1, False: 0]
  ------------------
  158|      1|        {
  159|      1|            mDefaultLog->setMinLogLevel(lml);
  160|      1|        }
  161|      1|    }

_ZNK4Ogre19ManualObjectFactory7getTypeEv:
  723|      3|    {
  724|      3|        return MOT_MANUAL_OBJECT;
  725|      3|    }

_ZN4Ogre15MaterialManagerC2Ev:
   50|      1|    {
   51|       |        // Loading order
   52|      1|        mLoadOrder = 100.0f;
   53|       |        // Scripting is supported by this manager
   54|       |
   55|       |        // Resource type
   56|      1|        mResourceType = "Material";
   57|       |
   58|       |        // Register with resource group manager
   59|      1|        ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
   60|       |
   61|       |        // Default scheme
   62|      1|        mActiveSchemeIndex = 0;
   63|      1|        mActiveSchemeName = MSN_DEFAULT;
   64|      1|        mSchemes[mActiveSchemeName] = 0;
   65|       |
   66|      1|    }
_ZN4Ogre15MaterialManagerD2Ev:
   69|      1|    {
   70|      1|        mDefaultSettings.reset();
   71|       |
   72|      1|        Pass::processPendingPassUpdates(); // make sure pass graveyard is cleaned
   73|       |
   74|       |        // Resources cleared by superclass
   75|       |        // Unregister with resource group manager
   76|      1|        ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType);
   77|      1|        ResourceGroupManager::getSingleton()._unregisterScriptLoader(this);
   78|      1|    }

_ZN4Ogre11MeshManagerC2Ev:
   63|      1|    mBoundsPaddingFactor(0.01), mListener(0)
   64|      1|    {
   65|      1|        mBlendWeightsBaseElementType = VET_FLOAT1;
   66|      1|        mPrepAllMeshesForShadowVolumes = false;
   67|       |
   68|      1|        mLoadOrder = 350.0f;
   69|      1|        mResourceType = "Mesh";
   70|       |
   71|      1|        mMeshCodec = std::make_unique<MeshCodec>();
   72|      1|        Codec::registerCodec(mMeshCodec.get());
   73|       |
   74|      1|        ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
   75|       |
   76|      1|        mPrefabLoader = std::make_unique<PrefabFactory>();
   77|      1|    }
_ZN4Ogre11MeshManagerD2Ev:
   80|      1|    {
   81|      1|        Codec::unregisterCodec(mMeshCodec.get());
   82|      1|        ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType);
   83|      1|    }
_ZNK4Ogre9MeshCodec7getTypeEv:
   39|      2|        String getType() const override { return "mesh"; }

_ZN4Ogre13OptimisedUtil21_detectImplementationEv:
  326|      2|    {
  327|       |        //
  328|       |        // Some speed test results (averaged number of CPU timestamp (RDTSC) per-function call):
  329|       |        //
  330|       |        //   Dagon SkeletonAnimation sample - softwareVertexSkinning:
  331|       |        //
  332|       |        //                                      Pentium 4 3.0G HT       Athlon XP 2500+     Athlon 64 X2 Dual Core 3800+
  333|       |        //
  334|       |        //      Shared Buffers, General C       763677                  462903              473038
  335|       |        //      Shared Buffers, Unrolled SSE    210030 *best*           369762              228328 *best*
  336|       |        //      Shared Buffers, General SSE     286202                  352412 *best*       302796
  337|       |        //
  338|       |        //      Separated Buffers, General C    762640                  464840              478740
  339|       |        //      Separated Buffers, Unrolled SSE 219222 *best*           287992 *best*       238770 *best*
  340|       |        //      Separated Buffers, General SSE  290129                  341614              307262
  341|       |        //
  342|       |        //      PosOnly, General C              388663                  257350              262831
  343|       |        //      PosOnly, Unrolled SSE           139814 *best*           200323 *best*       168995 *best*
  344|       |        //      PosOnly, General SSE            172693                  213704              175447
  345|       |        //
  346|       |        //   Another my own test scene - softwareVertexSkinning:
  347|       |        //
  348|       |        //                                      Pentium P4 3.0G HT      Athlon XP 2500+
  349|       |        //
  350|       |        //      Shared Buffers, General C       74527                   -
  351|       |        //      Shared Buffers, Unrolled SSE    22743 *best*            -
  352|       |        //      Shared Buffers, General SSE     28527                   -
  353|       |        //
  354|       |        //
  355|       |        // Note that speed test appears unaligned load/store instruction version
  356|       |        // loss performance 5%-10% than aligned load/store version, even if both
  357|       |        // of them access to aligned data. Thus, we should use aligned load/store
  358|       |        // as soon as possible.
  359|       |        //
  360|       |        //
  361|       |        // We are pick up the implementation based on test results above.
  362|       |        //
  363|       |#ifdef __DO_PROFILE__
  364|       |        {
  365|       |            static OptimisedUtilProfiler msOptimisedUtilProfiler;
  366|       |            return &msOptimisedUtilProfiler;
  367|       |        }
  368|       |
  369|       |#else   // !__DO_PROFILE__
  370|       |
  371|      2|#if __OGRE_HAVE_SSE
  372|      2|        if (PlatformInformation::getCpuFeatures() & PlatformInformation::CPU_FEATURE_SSE)
  ------------------
  |  Branch (372:13): [True: 2, False: 0]
  ------------------
  373|      2|        {
  374|      2|            return _getOptimisedUtilSSE();
  375|      2|        }
  376|      0|        else
  377|       |#elif __OGRE_HAVE_NEON
  378|       |        if (PlatformInformation::getCpuFeatures() & PlatformInformation::CPU_FEATURE_NEON)
  379|       |        {
  380|       |            return _getOptimisedUtilSSE();
  381|       |        }
  382|       |        else
  383|       |#endif  // __OGRE_HAVE_SSE
  384|      0|        {
  385|      0|            return _getOptimisedUtilGeneral();
  386|      0|        }
  387|       |
  388|      2|#endif  // __DO_PROFILE__
  389|      2|    }

_ZN4Ogre16OptimisedUtilSSEC2Ev:
 1040|      2|        : mPreferGeneralVersionForSharedBuffers(false)
 1041|      2|    {
 1042|       |        // For AMD Athlon XP (but not that for Althon 64), it's prefer to never use
 1043|       |        // unrolled version for shared buffers at all, I guess because that version
 1044|       |        // run out of usable CPU registers, or L1/L2 cache related problem, causing
 1045|       |        // slight performance loss than general version.
 1046|       |        //
 1047|      2|#if __OGRE_HAVE_NEON == 0
 1048|      2|        if (PlatformInformation::getCpuIdentifier().find("AuthenticAMD") != String::npos)
  ------------------
  |  Branch (1048:13): [True: 0, False: 2]
  ------------------
 1049|      0|        {
 1050|       |            // How can I check it's an Athlon XP but not Althon 64?
 1051|       |            // Ok, just test whether supports SSE2/SSE3 or not, if not,
 1052|       |            // assume general version faster than unrolled version :)
 1053|       |            //
 1054|      0|            if (!(PlatformInformation::getCpuFeatures() &
  ------------------
  |  Branch (1054:17): [True: 0, False: 0]
  ------------------
 1055|      0|                (PlatformInformation::CPU_FEATURE_SSE2 | PlatformInformation::CPU_FEATURE_SSE3)))
 1056|      0|            {
 1057|      0|                mPreferGeneralVersionForSharedBuffers = true;
 1058|      0|            }
 1059|      0|        }
 1060|      2|#endif
 1061|      2|    }
_ZN4Ogre20_getOptimisedUtilSSEEv:
 2141|      2|    {
 2142|      2|        static OptimisedUtilSSE msOptimisedUtilSSE;
 2143|       |#if defined(__OGRE_SIMD_ALIGN_STACK)
 2144|       |        static OptimisedUtilWithStackAlign msOptimisedUtilWithStackAlign(&msOptimisedUtilSSE);
 2145|       |        return &msOptimisedUtilWithStackAlign;
 2146|       |#else
 2147|      2|        return &msOptimisedUtilSSE;
 2148|      2|#endif
 2149|      2|    }

_ZN4Ogre21ParticleSystemManagerC2Ev:
   52|      1|    {
   53|      1|        OGRE_LOCK_AUTO_MUTEX;
   54|       |        mFactory = OGRE_NEW ParticleSystemFactory();
   55|      1|        Root::getSingleton().addMovableObjectFactory(mFactory);
   56|      1|    }
_ZN4Ogre21ParticleSystemManagerD2Ev:
   59|      1|    {
   60|      1|        removeAllTemplates(true); // Destroy all templates
   61|      1|        OGRE_LOCK_AUTO_MUTEX;
   62|       |        // delete billboard factory
   63|      1|        if (mBillboardRendererFactory)
  ------------------
  |  Branch (63:13): [True: 0, False: 1]
  ------------------
   64|      0|        {
   65|      0|            OGRE_DELETE mBillboardRendererFactory;
   66|      0|            mBillboardRendererFactory = 0;
   67|      0|        }
   68|       |
   69|      1|        if (mFactory)
  ------------------
  |  Branch (69:13): [True: 1, False: 0]
  ------------------
   70|      1|        {
   71|       |            // delete particle system factory
   72|      1|            Root::getSingleton().removeMovableObjectFactory(mFactory);
   73|      1|            OGRE_DELETE mFactory;
   74|      1|            mFactory = 0;
   75|      1|        }
   76|       |
   77|      1|    }
_ZN4Ogre21ParticleSystemManager18removeAllTemplatesEb:
  133|      1|    {
  134|      1|        OGRE_LOCK_AUTO_MUTEX;
  135|      1|        if (deleteTemplate)
  ------------------
  |  Branch (135:13): [True: 1, False: 0]
  ------------------
  136|      1|        {
  137|      1|            ParticleTemplateMap::iterator itr;
  138|      1|            for (itr = mSystemTemplates.begin(); itr != mSystemTemplates.end(); ++itr)
  ------------------
  |  Branch (138:50): [True: 0, False: 1]
  ------------------
  139|      1|                OGRE_DELETE itr->second;
  140|      1|        }
  141|       |
  142|      1|        mSystemTemplates.clear();
  143|      1|    }
_ZNK4Ogre21ParticleSystemFactory7getTypeEv:
  397|      4|    {
  398|      4|        return MOT_PARTICLE_SYSTEM;
  399|      4|    }

_ZN4Ogre4Pass25processPendingPassUpdatesEv:
  934|      1|    {
  935|      1|        {
  936|      1|            OGRE_LOCK_MUTEX(msPassGraveyardMutex);
  937|       |            // Delete items in the graveyard
  938|      1|            for (auto& i : msPassGraveyard)
  ------------------
  |  Branch (938:26): [True: 0, False: 1]
  ------------------
  939|      0|            {
  940|      0|                OGRE_DELETE i;
  941|      0|            }
  942|      1|            msPassGraveyard.clear();
  943|      1|        }
  944|      1|        PassSet tempDirtyHashList;
  945|      1|        {
  946|      1|            OGRE_LOCK_MUTEX(msDirtyHashListMutex);
  947|       |            // The dirty ones will have been removed from the groups above using the old hash now
  948|      1|            tempDirtyHashList.swap(msDirtyHashList);
  949|      1|        }
  950|      1|        for (auto *p : tempDirtyHashList)
  ------------------
  |  Branch (950:22): [True: 0, False: 1]
  ------------------
  951|      0|        {
  952|      0|            p->_recalculateHash();
  953|      0|        }
  954|      1|    }

_ZN4Ogre25PixelCountLodStrategyBaseC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   37|      2|        : LodStrategy(name)
   38|      2|    { }
_ZN4Ogre29AbsolutePixelCountLodStrategyC2Ev:
   92|      1|        : PixelCountLodStrategyBase("pixel_count")
   93|      1|    { }
_ZN4Ogre29AbsolutePixelCountLodStrategyD2Ev:
   94|      1|    AbsolutePixelCountLodStrategy::~AbsolutePixelCountLodStrategy() {}
_ZN4Ogre32ScreenRatioPixelCountLodStrategyC2Ev:
  172|      1|        : PixelCountLodStrategyBase("screen_ratio_pixel_count")
  173|      1|    { }
_ZN4Ogre32ScreenRatioPixelCountLodStrategyD2Ev:
  174|      1|    ScreenRatioPixelCountLodStrategy::~ScreenRatioPixelCountLodStrategy() {}

_ZN4Ogre9PixelUtil15getNumElemBytesENS_11PixelFormatE:
   96|  3.42k|    {
   97|  3.42k|        return getDescriptionFor(format).elemBytes;
   98|  3.42k|    }
_ZN4Ogre9PixelUtil13getMemorySizeEjjjNS_11PixelFormatE:
  106|  1.14k|    {
  107|  1.14k|        if(isCompressed(format))
  ------------------
  |  Branch (107:12): [True: 0, False: 1.14k]
  ------------------
  108|      0|        {
  109|      0|            switch(format)
  110|      0|            {
  111|       |                // DXT formats work by dividing the image into 4x4 blocks, then encoding each
  112|       |                // 4x4 block with a certain number of bytes. 
  113|      0|                case PF_DXT1:
  ------------------
  |  Branch (113:17): [True: 0, False: 0]
  ------------------
  114|      0|                    return ((width+3)/4)*((height+3)/4)*8 * depth;
  115|      0|                case PF_DXT2:
  ------------------
  |  Branch (115:17): [True: 0, False: 0]
  ------------------
  116|      0|                case PF_DXT3:
  ------------------
  |  Branch (116:17): [True: 0, False: 0]
  ------------------
  117|      0|                case PF_DXT4:
  ------------------
  |  Branch (117:17): [True: 0, False: 0]
  ------------------
  118|      0|                case PF_DXT5:
  ------------------
  |  Branch (118:17): [True: 0, False: 0]
  ------------------
  119|      0|                    return ((width+3)/4)*((height+3)/4)*16 * depth;
  120|      0|                case PF_BC4_SNORM:
  ------------------
  |  Branch (120:17): [True: 0, False: 0]
  ------------------
  121|      0|                case PF_BC4_UNORM:
  ------------------
  |  Branch (121:17): [True: 0, False: 0]
  ------------------
  122|      0|                    return ((width+3)/4)*((height+3)/4)*8 * depth;
  123|      0|                case PF_BC5_SNORM:
  ------------------
  |  Branch (123:17): [True: 0, False: 0]
  ------------------
  124|      0|                case PF_BC5_UNORM:
  ------------------
  |  Branch (124:17): [True: 0, False: 0]
  ------------------
  125|      0|                case PF_BC6H_SF16:
  ------------------
  |  Branch (125:17): [True: 0, False: 0]
  ------------------
  126|      0|                case PF_BC6H_UF16:
  ------------------
  |  Branch (126:17): [True: 0, False: 0]
  ------------------
  127|      0|                case PF_BC7_UNORM:
  ------------------
  |  Branch (127:17): [True: 0, False: 0]
  ------------------
  128|      0|                    return ((width+3)/4)*((height+3)/4)*16 * depth;
  129|       |
  130|       |                // Size calculations from the PVRTC OpenGL extension spec
  131|       |                // http://www.khronos.org/registry/gles/extensions/IMG/IMG_texture_compression_pvrtc.txt
  132|       |                // Basically, 32 bytes is the minimum texture size.  Smaller textures are padded up to 32 bytes
  133|      0|                case PF_PVRTC_RGB2:
  ------------------
  |  Branch (133:17): [True: 0, False: 0]
  ------------------
  134|      0|                case PF_PVRTC_RGBA2:
  ------------------
  |  Branch (134:17): [True: 0, False: 0]
  ------------------
  135|      0|                case PF_PVRTC2_2BPP:
  ------------------
  |  Branch (135:17): [True: 0, False: 0]
  ------------------
  136|      0|                    return (std::max((int)width, 16) * std::max((int)height, 8) * 2 + 7) / 8;
  137|      0|                case PF_PVRTC_RGB4:
  ------------------
  |  Branch (137:17): [True: 0, False: 0]
  ------------------
  138|      0|                case PF_PVRTC_RGBA4:
  ------------------
  |  Branch (138:17): [True: 0, False: 0]
  ------------------
  139|      0|                case PF_PVRTC2_4BPP:
  ------------------
  |  Branch (139:17): [True: 0, False: 0]
  ------------------
  140|      0|                    return (std::max((int)width, 8) * std::max((int)height, 8) * 4 + 7) / 8;
  141|       |
  142|       |                // see https://registry.khronos.org/OpenGL-Refpages/es3/html/glCompressedTexImage2D.xhtml
  143|      0|                case PF_ETC1_RGB8:
  ------------------
  |  Branch (143:17): [True: 0, False: 0]
  ------------------
  144|      0|                case PF_ETC2_RGB8:
  ------------------
  |  Branch (144:17): [True: 0, False: 0]
  ------------------
  145|      0|                case PF_ETC2_RGB8A1:
  ------------------
  |  Branch (145:17): [True: 0, False: 0]
  ------------------
  146|      0|                case PF_ATC_RGB:
  ------------------
  |  Branch (146:17): [True: 0, False: 0]
  ------------------
  147|      0|                    return ((width + 3) / 4) * ((height + 3) / 4) * 8;
  148|      0|                case PF_ETC2_RGBA8:
  ------------------
  |  Branch (148:17): [True: 0, False: 0]
  ------------------
  149|      0|                case PF_ATC_RGBA_EXPLICIT_ALPHA:
  ------------------
  |  Branch (149:17): [True: 0, False: 0]
  ------------------
  150|      0|                case PF_ATC_RGBA_INTERPOLATED_ALPHA:
  ------------------
  |  Branch (150:17): [True: 0, False: 0]
  ------------------
  151|      0|                    return ((width + 3) / 4) * ((height + 3) / 4) * 16;
  152|       |
  153|      0|                case PF_ASTC_RGBA_4X4_LDR:
  ------------------
  |  Branch (153:17): [True: 0, False: 0]
  ------------------
  154|      0|                    return astc_slice_size(width, height, 4, 4) * depth;
  155|      0|                case PF_ASTC_RGBA_5X4_LDR:
  ------------------
  |  Branch (155:17): [True: 0, False: 0]
  ------------------
  156|      0|                    return astc_slice_size(width, height, 5, 4) * depth;
  157|      0|                case PF_ASTC_RGBA_5X5_LDR:
  ------------------
  |  Branch (157:17): [True: 0, False: 0]
  ------------------
  158|      0|                    return astc_slice_size(width, height, 5, 5) * depth;
  159|      0|                case PF_ASTC_RGBA_6X5_LDR:
  ------------------
  |  Branch (159:17): [True: 0, False: 0]
  ------------------
  160|      0|                    return astc_slice_size(width, height, 6, 5) * depth;
  161|      0|                case PF_ASTC_RGBA_6X6_LDR:
  ------------------
  |  Branch (161:17): [True: 0, False: 0]
  ------------------
  162|      0|                    return astc_slice_size(width, height, 6, 6) * depth;
  163|      0|                case PF_ASTC_RGBA_8X5_LDR:
  ------------------
  |  Branch (163:17): [True: 0, False: 0]
  ------------------
  164|      0|                    return astc_slice_size(width, height, 8, 5) * depth;
  165|      0|                case PF_ASTC_RGBA_8X6_LDR:
  ------------------
  |  Branch (165:17): [True: 0, False: 0]
  ------------------
  166|      0|                    return astc_slice_size(width, height, 8, 6) * depth;
  167|      0|                case PF_ASTC_RGBA_8X8_LDR:
  ------------------
  |  Branch (167:17): [True: 0, False: 0]
  ------------------
  168|      0|                    return astc_slice_size(width, height, 8, 8) * depth;
  169|      0|                case PF_ASTC_RGBA_10X5_LDR:
  ------------------
  |  Branch (169:17): [True: 0, False: 0]
  ------------------
  170|      0|                    return astc_slice_size(width, height, 10, 5) * depth;
  171|      0|                case PF_ASTC_RGBA_10X6_LDR:
  ------------------
  |  Branch (171:17): [True: 0, False: 0]
  ------------------
  172|      0|                    return astc_slice_size(width, height, 10, 6) * depth;
  173|      0|                case PF_ASTC_RGBA_10X8_LDR:
  ------------------
  |  Branch (173:17): [True: 0, False: 0]
  ------------------
  174|      0|                    return astc_slice_size(width, height, 10, 8) * depth;
  175|      0|                case PF_ASTC_RGBA_10X10_LDR:
  ------------------
  |  Branch (175:17): [True: 0, False: 0]
  ------------------
  176|      0|                    return astc_slice_size(width, height, 10, 10) * depth;
  177|      0|                case PF_ASTC_RGBA_12X10_LDR:
  ------------------
  |  Branch (177:17): [True: 0, False: 0]
  ------------------
  178|      0|                    return astc_slice_size(width, height, 12, 10) * depth;
  179|      0|                case PF_ASTC_RGBA_12X12_LDR:
  ------------------
  |  Branch (179:17): [True: 0, False: 0]
  ------------------
  180|      0|                    return astc_slice_size(width, height, 12, 12) * depth;
  181|      0|                default:
  ------------------
  |  Branch (181:17): [True: 0, False: 0]
  ------------------
  182|      0|                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Invalid compressed pixel format",
  183|      0|                    "PixelUtil::getMemorySize");
  184|      0|            }
  185|      0|        }
  186|  1.14k|        else
  187|  1.14k|        {
  188|  1.14k|            return size_t(width)*height*depth*getNumElemBytes(format);
  189|  1.14k|        }
  190|  1.14k|    }
_ZN4Ogre9PixelUtil8getFlagsENS_11PixelFormatE:
  198|  2.28k|    {
  199|  2.28k|        return getDescriptionFor(format).flags;
  200|  2.28k|    }
_ZN4Ogre9PixelUtil12isCompressedENS_11PixelFormatE:
  218|  2.28k|    {
  219|  2.28k|        return (PixelUtil::getFlags(format) & PFF_COMPRESSED) > 0;
  220|  2.28k|    }
_ZN4Ogre9PixelUtil17getComponentCountENS_11PixelFormatE:
  281|    677|    {
  282|    677|        const PixelFormatDescription &des = getDescriptionFor(fmt);
  283|    677|        return des.componentCount;
  284|    677|    }
OgrePixelFormat.cpp:_ZN4OgreL17getDescriptionForENS_11PixelFormatE:
   88|  6.37k|    {
   89|  6.37k|        const int ord = (int)fmt;
   90|  6.37k|        assert(ord>=0 && ord<PF_COUNT);
   91|       |
   92|  6.37k|        return _pixelFormats[ord];
   93|  6.37k|    }

_ZN4Ogre19PlatformInformation16getCpuIdentifierEv:
  655|      2|    {
  656|      2|        static const String sIdentifier = _detectCpuIdentifier();
  657|      2|        return sIdentifier;
  658|      2|    }
_ZN4Ogre19PlatformInformation14getCpuFeaturesEv:
  661|      2|    {
  662|      2|        static const uint sFeatures = _detectCpuFeatures();
  663|      2|        return sFeatures;
  664|      2|    }
OgrePlatformInformation.cpp:_ZN4OgreL20_detectCpuIdentifierEv:
  427|      2|    {
  428|       |        // Supports CPUID instruction ?
  429|      2|        if (_isSupportCpuid())
  ------------------
  |  Branch (429:13): [True: 2, False: 0]
  ------------------
  430|      2|        {
  431|      2|            CpuidResult result;
  432|      2|            uint nExIds;
  433|      2|            char CPUString[0x20];
  434|      2|            char CPUBrandString[0x40];
  435|       |
  436|      2|            StringStream detailedIdentStr;
  437|       |
  438|       |
  439|       |            // Has standard feature ?
  440|      2|            if (_performCpuid(0, result))
  ------------------
  |  Branch (440:17): [True: 2, False: 0]
  ------------------
  441|      2|            {
  442|      2|                memset(CPUString, 0, sizeof(CPUString));
  443|      2|                memset(CPUBrandString, 0, sizeof(CPUBrandString));
  444|       |
  445|       |                //*((int*)CPUString) = result._ebx;
  446|       |                //*((int*)(CPUString+4)) = result._edx;
  447|       |                //*((int*)(CPUString+8)) = result._ecx;
  448|      2|                memcpy(CPUString, &result._ebx, sizeof(int));
  449|      2|                memcpy(CPUString+4, &result._edx, sizeof(int));
  450|      2|                memcpy(CPUString+8, &result._ecx, sizeof(int));
  451|       |
  452|      2|                detailedIdentStr << CPUString;
  453|       |
  454|       |                // Calling _performCpuid with 0x80000000 as the query argument
  455|       |                // gets the number of valid extended IDs.
  456|      2|                nExIds = _performCpuid(0x80000000, result);
  457|       |
  458|     20|                for (uint i=0x80000000; i<=nExIds; ++i)
  ------------------
  |  Branch (458:41): [True: 18, False: 2]
  ------------------
  459|     18|                {
  460|     18|                    _performCpuid(i, result);
  461|       |
  462|       |                    // Interpret CPU brand string and cache information.
  463|     18|                    if  (i == 0x80000002)
  ------------------
  |  Branch (463:26): [True: 2, False: 16]
  ------------------
  464|      2|                    {
  465|      2|                        memcpy(CPUBrandString + 0, &result._eax, sizeof(result._eax));
  466|      2|                        memcpy(CPUBrandString + 4, &result._ebx, sizeof(result._ebx));
  467|      2|                        memcpy(CPUBrandString + 8, &result._ecx, sizeof(result._ecx));
  468|      2|                        memcpy(CPUBrandString + 12, &result._edx, sizeof(result._edx));
  469|      2|                    }
  470|     16|                    else if  (i == 0x80000003)
  ------------------
  |  Branch (470:31): [True: 2, False: 14]
  ------------------
  471|      2|                    {
  472|      2|                        memcpy(CPUBrandString + 16 + 0, &result._eax, sizeof(result._eax));
  473|      2|                        memcpy(CPUBrandString + 16 + 4, &result._ebx, sizeof(result._ebx));
  474|      2|                        memcpy(CPUBrandString + 16 + 8, &result._ecx, sizeof(result._ecx));
  475|      2|                        memcpy(CPUBrandString + 16 + 12, &result._edx, sizeof(result._edx));
  476|      2|                    }
  477|     14|                    else if  (i == 0x80000004)
  ------------------
  |  Branch (477:31): [True: 2, False: 12]
  ------------------
  478|      2|                    {
  479|      2|                        memcpy(CPUBrandString + 32 + 0, &result._eax, sizeof(result._eax));
  480|      2|                        memcpy(CPUBrandString + 32 + 4, &result._ebx, sizeof(result._ebx));
  481|      2|                        memcpy(CPUBrandString + 32 + 8, &result._ecx, sizeof(result._ecx));
  482|      2|                        memcpy(CPUBrandString + 32 + 12, &result._edx, sizeof(result._edx));
  483|      2|                    }
  484|     18|                }
  485|       |
  486|      2|                String brand(CPUBrandString);
  487|      2|                StringUtil::trim(brand);
  488|      2|                if (!brand.empty())
  ------------------
  |  Branch (488:21): [True: 2, False: 0]
  ------------------
  489|      2|                    detailedIdentStr << ": " << brand;
  490|       |
  491|      2|                return detailedIdentStr.str();
  492|      2|            }
  493|      2|        }
  494|       |
  495|      0|        return "X86";
  496|      2|    }
OgrePlatformInformation.cpp:_ZN4OgreL13_performCpuidEiRNS_11CpuidResultE:
  151|     30|    {
  152|       |#if OGRE_COMPILER == OGRE_COMPILER_MSVC
  153|       |        int CPUInfo[4];
  154|       |        __cpuid(CPUInfo, query);
  155|       |        result._eax = CPUInfo[0];
  156|       |        result._ebx = CPUInfo[1];
  157|       |        result._ecx = CPUInfo[2];
  158|       |        result._edx = CPUInfo[3];
  159|       |        return result._eax;
  160|       |#elif (OGRE_COMPILER == OGRE_COMPILER_GNUC || OGRE_COMPILER == OGRE_COMPILER_CLANG) && OGRE_PLATFORM != OGRE_PLATFORM_EMSCRIPTEN
  161|       |        #if OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_64
  162|     30|        __asm__
  163|     30|        (
  164|     30|            "cpuid": "=a" (result._eax), "=b" (result._ebx), "=c" (result._ecx), "=d" (result._edx) : "a" (query)
  165|     30|        );
  166|       |        #else
  167|       |        __asm__
  168|       |        (
  169|       |            "pushl  %%ebx           \n\t"
  170|       |            "cpuid                  \n\t"
  171|       |            "movl   %%ebx, %%edi    \n\t"
  172|       |            "popl   %%ebx           \n\t"
  173|       |            : "=a" (result._eax), "=D" (result._ebx), "=c" (result._ecx), "=d" (result._edx)
  174|       |            : "a" (query)
  175|       |        );
  176|       |       #endif // OGRE_ARCHITECTURE_64
  177|     30|        return result._eax;
  178|       |
  179|       |#else
  180|       |        // TODO: Supports other compiler
  181|       |        return 0;
  182|       |#endif
  183|     30|    }
OgrePlatformInformation.cpp:_ZN4OgreL18_detectCpuFeaturesEv:
  408|      2|    {
  409|      2|        uint features = queryCpuFeatures();
  410|       |
  411|      2|        const uint sse_features = 0
  412|      2|            | PlatformInformation::CPU_FEATURE_SSE
  413|      2|            | PlatformInformation::CPU_FEATURE_SSE2
  414|      2|            | PlatformInformation::CPU_FEATURE_SSE3
  415|      2|            | PlatformInformation::CPU_FEATURE_SSE41
  416|      2|            | PlatformInformation::CPU_FEATURE_SSE42;
  417|       |
  418|      2|        if ((features & sse_features) && !_checkOperatingSystemSupportSSE())
  ------------------
  |  Branch (418:13): [True: 2, False: 0]
  |  Branch (418:42): [True: 0, False: 2]
  ------------------
  419|      0|        {
  420|      0|            features &= ~sse_features;
  421|      0|        }
  422|       |
  423|      2|        return features;
  424|      2|    }
OgrePlatformInformation.cpp:_ZN4OgreL16queryCpuFeaturesEv:
  266|      2|    {
  267|       |
  268|      2|#define CPUID_FUNC_VENDOR_ID                 0x0
  269|      2|#define CPUID_FUNC_STANDARD_FEATURES         0x1
  270|      2|#define CPUID_FUNC_EXTENSION_QUERY           0x80000000
  271|      2|#define CPUID_FUNC_EXTENDED_FEATURES         0x80000001
  272|      2|#define CPUID_FUNC_ADVANCED_POWER_MANAGEMENT 0x80000007
  273|       |
  274|      2|#define CPUID_STD_FPU               (1<<0)
  275|      2|#define CPUID_STD_TSC               (1<<4)
  276|      2|#define CPUID_STD_CMOV              (1<<15)
  277|      2|#define CPUID_STD_MMX               (1<<23)
  278|      2|#define CPUID_STD_SSE               (1<<25)
  279|      2|#define CPUID_STD_SSE2              (1<<26)
  280|      2|#define CPUID_STD_HTT               (1<<28)     // EDX[28] - Bit 28 set indicates  Hyper-Threading Technology is supported in hardware.
  281|       |
  282|      2|#define CPUID_STD_SSE3              (1<<0)      // ECX[0]  - Bit 0 of standard function 1 indicate SSE3 supported
  283|      2|#define CPUID_STD_SSE41             (1<<19)     // ECX[19] - Bit 0 of standard function 1 indicate SSE41 supported
  284|      2|#define CPUID_STD_SSE42             (1<<20)     // ECX[20] - Bit 0 of standard function 1 indicate SSE42 supported
  285|       |
  286|      2|#define CPUID_FAMILY_ID_MASK        0x0F00      // EAX[11:8] - Bit 11 thru 8 contains family  processor id
  287|      2|#define CPUID_EXT_FAMILY_ID_MASK    0x0F00000   // EAX[23:20] - Bit 23 thru 20 contains extended family processor id
  288|      2|#define CPUID_PENTIUM4_ID           0x0F00      // Pentium 4 family processor id
  289|       |
  290|      2|#define CPUID_EXT_3DNOW             (1<<31)
  291|      2|#define CPUID_EXT_AMD_3DNOWEXT      (1<<30)
  292|      2|#define CPUID_EXT_AMD_MMXEXT        (1<<22)
  293|       |
  294|       |
  295|      2|#define CPUID_APM_INVARIANT_TSC     (1<<8)      // EDX[8] - Bit 8 of function 0x80000007 indicates support for invariant TSC.
  296|       |
  297|      2|        uint features = 0;
  298|       |
  299|       |        // Supports CPUID instruction ?
  300|      2|        if (_isSupportCpuid())
  ------------------
  |  Branch (300:13): [True: 2, False: 0]
  ------------------
  301|      2|        {
  302|      2|            CpuidResult result;
  303|       |
  304|       |            // Has standard feature ?
  305|      2|            if (_performCpuid(CPUID_FUNC_VENDOR_ID, result))
  ------------------
  |  |  268|      2|#define CPUID_FUNC_VENDOR_ID                 0x0
  ------------------
  |  Branch (305:17): [True: 2, False: 0]
  ------------------
  306|      2|            {
  307|       |                // Check vendor strings
  308|      2|                if (memcmp(&result._ebx, "GenuineIntel", 12) == 0)
  ------------------
  |  Branch (308:21): [True: 2, False: 0]
  ------------------
  309|      2|                {
  310|      2|                    if (result._eax > 2)
  ------------------
  |  Branch (310:25): [True: 2, False: 0]
  ------------------
  311|      2|                        features |= PlatformInformation::CPU_FEATURE_PRO;
  312|       |
  313|       |                    // Check standard feature
  314|      2|                    _performCpuid(CPUID_FUNC_STANDARD_FEATURES, result);
  ------------------
  |  |  269|      2|#define CPUID_FUNC_STANDARD_FEATURES         0x1
  ------------------
  315|       |
  316|      2|                    if (result._edx & CPUID_STD_FPU)
  ------------------
  |  |  274|      2|#define CPUID_STD_FPU               (1<<0)
  ------------------
  |  Branch (316:25): [True: 2, False: 0]
  ------------------
  317|      2|                        features |= PlatformInformation::CPU_FEATURE_FPU;
  318|      2|                    if (result._edx & CPUID_STD_TSC)
  ------------------
  |  |  275|      2|#define CPUID_STD_TSC               (1<<4)
  ------------------
  |  Branch (318:25): [True: 2, False: 0]
  ------------------
  319|      2|                        features |= PlatformInformation::CPU_FEATURE_TSC;
  320|      2|                    if (result._edx & CPUID_STD_CMOV)
  ------------------
  |  |  276|      2|#define CPUID_STD_CMOV              (1<<15)
  ------------------
  |  Branch (320:25): [True: 2, False: 0]
  ------------------
  321|      2|                        features |= PlatformInformation::CPU_FEATURE_CMOV;
  322|      2|                    if (result._edx & CPUID_STD_MMX)
  ------------------
  |  |  277|      2|#define CPUID_STD_MMX               (1<<23)
  ------------------
  |  Branch (322:25): [True: 2, False: 0]
  ------------------
  323|      2|                        features |= PlatformInformation::CPU_FEATURE_MMX;
  324|      2|                    if (result._edx & CPUID_STD_SSE)
  ------------------
  |  |  278|      2|#define CPUID_STD_SSE               (1<<25)
  ------------------
  |  Branch (324:25): [True: 2, False: 0]
  ------------------
  325|      2|                        features |= PlatformInformation::CPU_FEATURE_MMXEXT | PlatformInformation::CPU_FEATURE_SSE;
  326|      2|                    if (result._edx & CPUID_STD_SSE2)
  ------------------
  |  |  279|      2|#define CPUID_STD_SSE2              (1<<26)
  ------------------
  |  Branch (326:25): [True: 2, False: 0]
  ------------------
  327|      2|                        features |= PlatformInformation::CPU_FEATURE_SSE2;
  328|      2|                    if (result._ecx & CPUID_STD_SSE3)
  ------------------
  |  |  282|      2|#define CPUID_STD_SSE3              (1<<0)      // ECX[0]  - Bit 0 of standard function 1 indicate SSE3 supported
  ------------------
  |  Branch (328:25): [True: 2, False: 0]
  ------------------
  329|      2|                        features |= PlatformInformation::CPU_FEATURE_SSE3;
  330|      2|                    if (result._ecx & CPUID_STD_SSE41)
  ------------------
  |  |  283|      2|#define CPUID_STD_SSE41             (1<<19)     // ECX[19] - Bit 0 of standard function 1 indicate SSE41 supported
  ------------------
  |  Branch (330:25): [True: 2, False: 0]
  ------------------
  331|      2|                        features |= PlatformInformation::CPU_FEATURE_SSE41;
  332|      2|                    if (result._ecx & CPUID_STD_SSE42)
  ------------------
  |  |  284|      2|#define CPUID_STD_SSE42             (1<<20)     // ECX[20] - Bit 0 of standard function 1 indicate SSE42 supported
  ------------------
  |  Branch (332:25): [True: 2, False: 0]
  ------------------
  333|      2|                        features |= PlatformInformation::CPU_FEATURE_SSE42;
  334|       |
  335|       |                    // Check to see if this is a Pentium 4 or later processor
  336|      2|                    if ((result._eax & CPUID_EXT_FAMILY_ID_MASK) ||
  ------------------
  |  |  287|      2|#define CPUID_EXT_FAMILY_ID_MASK    0x0F00000   // EAX[23:20] - Bit 23 thru 20 contains extended family processor id
  ------------------
  |  Branch (336:25): [True: 0, False: 2]
  ------------------
  337|      2|                        (result._eax & CPUID_FAMILY_ID_MASK) == CPUID_PENTIUM4_ID)
  ------------------
  |  |  286|      2|#define CPUID_FAMILY_ID_MASK        0x0F00      // EAX[11:8] - Bit 11 thru 8 contains family  processor id
  ------------------
                                      (result._eax & CPUID_FAMILY_ID_MASK) == CPUID_PENTIUM4_ID)
  ------------------
  |  |  288|      2|#define CPUID_PENTIUM4_ID           0x0F00      // Pentium 4 family processor id
  ------------------
  |  Branch (337:25): [True: 0, False: 2]
  ------------------
  338|      0|                    {
  339|       |                        // Check hyper-threading technology
  340|      0|                        if (result._edx & CPUID_STD_HTT)
  ------------------
  |  |  280|      0|#define CPUID_STD_HTT               (1<<28)     // EDX[28] - Bit 28 set indicates  Hyper-Threading Technology is supported in hardware.
  ------------------
  |  Branch (340:29): [True: 0, False: 0]
  ------------------
  341|      0|                            features |= PlatformInformation::CPU_FEATURE_HTT;
  342|      0|                    }
  343|       |
  344|       |
  345|      2|                    const uint maxExtensionFunctionSupport = _performCpuid(CPUID_FUNC_EXTENSION_QUERY, result);
  ------------------
  |  |  270|      2|#define CPUID_FUNC_EXTENSION_QUERY           0x80000000
  ------------------
  346|      2|                    if (maxExtensionFunctionSupport >= CPUID_FUNC_ADVANCED_POWER_MANAGEMENT)
  ------------------
  |  |  272|      2|#define CPUID_FUNC_ADVANCED_POWER_MANAGEMENT 0x80000007
  ------------------
  |  Branch (346:25): [True: 2, False: 0]
  ------------------
  347|      2|                    {
  348|      2|                        _performCpuid(CPUID_FUNC_ADVANCED_POWER_MANAGEMENT, result);
  ------------------
  |  |  272|      2|#define CPUID_FUNC_ADVANCED_POWER_MANAGEMENT 0x80000007
  ------------------
  349|       |
  350|      2|                        if (result._edx & CPUID_APM_INVARIANT_TSC)
  ------------------
  |  |  295|      2|#define CPUID_APM_INVARIANT_TSC     (1<<8)      // EDX[8] - Bit 8 of function 0x80000007 indicates support for invariant TSC.
  ------------------
  |  Branch (350:29): [True: 2, False: 0]
  ------------------
  351|      2|                            features |= PlatformInformation::CPU_FEATURE_INVARIANT_TSC;
  352|      2|                    }
  353|      2|                }
  354|      0|                else if (memcmp(&result._ebx, "AuthenticAMD", 12) == 0)
  ------------------
  |  Branch (354:26): [True: 0, False: 0]
  ------------------
  355|      0|                {
  356|      0|                    features |= PlatformInformation::CPU_FEATURE_PRO;
  357|       |
  358|       |                    // Check standard feature
  359|      0|                    _performCpuid(CPUID_FUNC_STANDARD_FEATURES, result);
  ------------------
  |  |  269|      0|#define CPUID_FUNC_STANDARD_FEATURES         0x1
  ------------------
  360|       |
  361|      0|                    if (result._edx & CPUID_STD_FPU)
  ------------------
  |  |  274|      0|#define CPUID_STD_FPU               (1<<0)
  ------------------
  |  Branch (361:25): [True: 0, False: 0]
  ------------------
  362|      0|                        features |= PlatformInformation::CPU_FEATURE_FPU;
  363|      0|                    if (result._edx & CPUID_STD_TSC)
  ------------------
  |  |  275|      0|#define CPUID_STD_TSC               (1<<4)
  ------------------
  |  Branch (363:25): [True: 0, False: 0]
  ------------------
  364|      0|                        features |= PlatformInformation::CPU_FEATURE_TSC;
  365|      0|                    if (result._edx & CPUID_STD_CMOV)
  ------------------
  |  |  276|      0|#define CPUID_STD_CMOV              (1<<15)
  ------------------
  |  Branch (365:25): [True: 0, False: 0]
  ------------------
  366|      0|                        features |= PlatformInformation::CPU_FEATURE_CMOV;
  367|      0|                    if (result._edx & CPUID_STD_MMX)
  ------------------
  |  |  277|      0|#define CPUID_STD_MMX               (1<<23)
  ------------------
  |  Branch (367:25): [True: 0, False: 0]
  ------------------
  368|      0|                        features |= PlatformInformation::CPU_FEATURE_MMX;
  369|      0|                    if (result._edx & CPUID_STD_SSE)
  ------------------
  |  |  278|      0|#define CPUID_STD_SSE               (1<<25)
  ------------------
  |  Branch (369:25): [True: 0, False: 0]
  ------------------
  370|      0|                        features |= PlatformInformation::CPU_FEATURE_SSE;
  371|      0|                    if (result._edx & CPUID_STD_SSE2)
  ------------------
  |  |  279|      0|#define CPUID_STD_SSE2              (1<<26)
  ------------------
  |  Branch (371:25): [True: 0, False: 0]
  ------------------
  372|      0|                        features |= PlatformInformation::CPU_FEATURE_SSE2;
  373|       |
  374|      0|                    if (result._ecx & CPUID_STD_SSE3)
  ------------------
  |  |  282|      0|#define CPUID_STD_SSE3              (1<<0)      // ECX[0]  - Bit 0 of standard function 1 indicate SSE3 supported
  ------------------
  |  Branch (374:25): [True: 0, False: 0]
  ------------------
  375|      0|                        features |= PlatformInformation::CPU_FEATURE_SSE3;
  376|       |
  377|       |                    // Has extended feature ?
  378|      0|                    const uint maxExtensionFunctionSupport = _performCpuid(CPUID_FUNC_EXTENSION_QUERY, result);
  ------------------
  |  |  270|      0|#define CPUID_FUNC_EXTENSION_QUERY           0x80000000
  ------------------
  379|      0|                    if (maxExtensionFunctionSupport >= CPUID_FUNC_EXTENDED_FEATURES)
  ------------------
  |  |  271|      0|#define CPUID_FUNC_EXTENDED_FEATURES         0x80000001
  ------------------
  |  Branch (379:25): [True: 0, False: 0]
  ------------------
  380|      0|                    {
  381|       |                        // Check extended feature
  382|      0|                        _performCpuid(CPUID_FUNC_EXTENDED_FEATURES, result);
  ------------------
  |  |  271|      0|#define CPUID_FUNC_EXTENDED_FEATURES         0x80000001
  ------------------
  383|       |
  384|      0|                        if (result._edx & CPUID_EXT_3DNOW)
  ------------------
  |  |  290|      0|#define CPUID_EXT_3DNOW             (1<<31)
  ------------------
  |  Branch (384:29): [True: 0, False: 0]
  ------------------
  385|      0|                            features |= PlatformInformation::CPU_FEATURE_3DNOW;
  386|      0|                        if (result._edx & CPUID_EXT_AMD_3DNOWEXT)
  ------------------
  |  |  291|      0|#define CPUID_EXT_AMD_3DNOWEXT      (1<<30)
  ------------------
  |  Branch (386:29): [True: 0, False: 0]
  ------------------
  387|      0|                            features |= PlatformInformation::CPU_FEATURE_3DNOWEXT;
  388|      0|                        if (result._edx & CPUID_EXT_AMD_MMXEXT)
  ------------------
  |  |  292|      0|#define CPUID_EXT_AMD_MMXEXT        (1<<22)
  ------------------
  |  Branch (388:29): [True: 0, False: 0]
  ------------------
  389|      0|                            features |= PlatformInformation::CPU_FEATURE_MMXEXT;
  390|      0|                    }
  391|       |
  392|       |
  393|      0|                    if (maxExtensionFunctionSupport >= CPUID_FUNC_ADVANCED_POWER_MANAGEMENT)
  ------------------
  |  |  272|      0|#define CPUID_FUNC_ADVANCED_POWER_MANAGEMENT 0x80000007
  ------------------
  |  Branch (393:25): [True: 0, False: 0]
  ------------------
  394|      0|                    {
  395|      0|                        _performCpuid(CPUID_FUNC_ADVANCED_POWER_MANAGEMENT, result);
  ------------------
  |  |  272|      0|#define CPUID_FUNC_ADVANCED_POWER_MANAGEMENT 0x80000007
  ------------------
  396|       |
  397|      0|                        if (result._edx & CPUID_APM_INVARIANT_TSC)
  ------------------
  |  |  295|      0|#define CPUID_APM_INVARIANT_TSC     (1<<8)      // EDX[8] - Bit 8 of function 0x80000007 indicates support for invariant TSC.
  ------------------
  |  Branch (397:29): [True: 0, False: 0]
  ------------------
  398|      0|                            features |= PlatformInformation::CPU_FEATURE_INVARIANT_TSC;
  399|      0|                    }
  400|      0|                }
  401|      2|            }
  402|      2|        }
  403|       |
  404|      2|        return features;
  405|      2|    }
OgrePlatformInformation.cpp:_ZN4OgreL31_checkOperatingSystemSupportSSEEv:
  202|      2|    {
  203|       |#if OGRE_COMPILER == OGRE_COMPILER_MSVC
  204|       |        /*
  205|       |            The FP part of SSE introduces a new architectural state and therefore
  206|       |            requires support from the operating system. So even if CPUID indicates
  207|       |            support for SSE FP, the application might not be able to use it. If
  208|       |            CPUID indicates support for SSE FP, check here whether it is also
  209|       |            supported by the OS, and turn off the SSE FP feature bit if there
  210|       |            is no OS support for SSE FP.
  211|       |
  212|       |            Operating systems that do not support SSE FP return an illegal
  213|       |            instruction exception if execution of an SSE FP instruction is performed.
  214|       |            Here, a sample SSE FP instruction is executed, and is checked for an
  215|       |            exception using the (non-standard) __try/__except mechanism
  216|       |            of Microsoft Visual C/C++.
  217|       |        */
  218|       |        // Visual Studio 2005, Both AMD and Intel x64 support SSE
  219|       |        // note that even though this is a build rather than runtime setting, all
  220|       |        // 64-bit CPUs support this so since binary is 64-bit only we're ok
  221|       |    #if _MSC_VER >= 1400 && defined(_M_X64)
  222|       |            return true;
  223|       |    #else
  224|       |        __try
  225|       |        {
  226|       |            __asm orps  xmm0, xmm0
  227|       |            return true;
  228|       |        }
  229|       |        __except(EXCEPTION_EXECUTE_HANDLER)
  230|       |        {
  231|       |            return false;
  232|       |        }
  233|       |    #endif
  234|       |#elif (OGRE_COMPILER == OGRE_COMPILER_GNUC || OGRE_COMPILER == OGRE_COMPILER_CLANG) && OGRE_PLATFORM != OGRE_PLATFORM_EMSCRIPTEN
  235|       |        #if OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_64 
  236|      2|            return true;
  237|       |        #else
  238|       |        // Does gcc have __try/__except similar mechanism?
  239|       |        // Use signal, setjmp/longjmp instead.
  240|       |        void (*oldHandler)(int);
  241|       |        oldHandler = signal(SIGILL, _illegalHandler);
  242|       |
  243|       |        if (setjmp(sIllegalJmpBuf))
  244|       |        {
  245|       |            signal(SIGILL, oldHandler);
  246|       |            return false;
  247|       |        }
  248|       |        else
  249|       |        {
  250|       |            __asm__ __volatile__ ("orps %xmm0, %xmm0");
  251|       |            signal(SIGILL, oldHandler);
  252|       |            return true;
  253|       |        }
  254|       |       #endif
  255|       |#else
  256|       |        // TODO: Supports other compiler, assumed is supported by default
  257|       |        return true;
  258|       |#endif
  259|      2|    }
OgrePlatformInformation.cpp:_ZN4OgreL15_isSupportCpuidEv:
   83|      4|    {
   84|       |#if OGRE_COMPILER == OGRE_COMPILER_MSVC
   85|       |        // Visual Studio 2005 & 64-bit compilers always supports __cpuid intrinsic
   86|       |        // note that even though this is a build rather than runtime setting, all
   87|       |        // 64-bit CPUs support this so since binary is 64-bit only we're ok
   88|       |    #if _MSC_VER >= 1400 && defined(_M_X64)
   89|       |        return true;
   90|       |    #else
   91|       |        // If we can modify flag register bit 21, the cpu is supports CPUID instruction
   92|       |        __asm
   93|       |        {
   94|       |            // Read EFLAG
   95|       |            pushfd
   96|       |            pop     eax
   97|       |            mov     ecx, eax
   98|       |
   99|       |            // Modify bit 21
  100|       |            xor     eax, 0x200000
  101|       |            push    eax
  102|       |            popfd
  103|       |
  104|       |            // Read back EFLAG
  105|       |            pushfd
  106|       |            pop     eax
  107|       |
  108|       |            // Restore EFLAG
  109|       |            push    ecx
  110|       |            popfd
  111|       |
  112|       |            // Check bit 21 modifiable
  113|       |            xor     eax, ecx
  114|       |            neg     eax
  115|       |            sbb     eax, eax
  116|       |
  117|       |            // Return values in eax, no return statement requirement here for VC.
  118|       |        }
  119|       |    #endif
  120|       |#elif (OGRE_COMPILER == OGRE_COMPILER_GNUC || OGRE_COMPILER == OGRE_COMPILER_CLANG) && OGRE_PLATFORM != OGRE_PLATFORM_EMSCRIPTEN
  121|       |        #if OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_64
  122|      4|           return true;
  123|       |       #else
  124|       |        unsigned oldFlags, newFlags;
  125|       |        __asm__
  126|       |        (
  127|       |            "pushfl         \n\t"
  128|       |            "pop    %0      \n\t"
  129|       |            "mov    %0, %1  \n\t"
  130|       |            "xor    %2, %0  \n\t"
  131|       |            "push   %0      \n\t"
  132|       |            "popfl          \n\t"
  133|       |            "pushfl         \n\t"
  134|       |            "pop    %0      \n\t"
  135|       |            "push   %1      \n\t"
  136|       |            "popfl          \n\t"
  137|       |            : "=r" (oldFlags), "=r" (newFlags)
  138|       |            : "n" (0x200000)
  139|       |        );
  140|       |        return oldFlags != newFlags;
  141|       |       #endif // 64
  142|       |#else
  143|       |        // TODO: Supports other compiler
  144|       |        return false;
  145|       |#endif
  146|      4|    }

_ZN4Ogre31RenderSystemCapabilitiesManagerC2Ev:
   49|      1|    RenderSystemCapabilitiesManager::RenderSystemCapabilitiesManager() : mSerializer(0), mScriptPattern("*.rendercaps")
   50|      1|    {
   51|       |        mSerializer = OGRE_NEW RenderSystemCapabilitiesSerializer();
   52|      1|    }
_ZN4Ogre31RenderSystemCapabilitiesManagerD2Ev:
   55|      1|    {
   56|      1|        for (auto& cm : mCapabilitiesMap)
  ------------------
  |  Branch (56:23): [True: 0, False: 1]
  ------------------
   57|      0|        {
   58|       |        // free memory in RenderSystemCapabilities*
   59|      0|            OGRE_DELETE cm.second;
   60|      0|        }
   61|       |
   62|       |        OGRE_DELETE mSerializer;
   63|      1|    }

_ZN4Ogre34RenderSystemCapabilitiesSerializerC2Ev:
   37|      1|    RenderSystemCapabilitiesSerializer::RenderSystemCapabilitiesSerializer() : mCurrentLineNumber(0), mCurrentLine(0),
   38|      1|        mCurrentCapabilities(0)
   39|      1|    {
   40|      1|        initialiaseDispatchTables();
   41|      1|    }
_ZN4Ogre34RenderSystemCapabilitiesSerializer25initialiaseDispatchTablesEv:
  264|      1|    {
  265|       |        // set up driver version parsing
  266|      1|        addKeywordType("driver_version", SET_STRING_METHOD);
  267|       |        // set up the setters for driver versions
  268|      1|        addSetStringMethod("driver_version", &RenderSystemCapabilities::parseDriverVersionFromString);
  269|       |        
  270|       |        // set up device name parsing
  271|      1|        addKeywordType("device_name", SET_STRING_METHOD);
  272|       |        // set up the setters for device names
  273|      1|        addSetStringMethod("device_name", &RenderSystemCapabilities::setDeviceName);
  274|       |        
  275|       |        // set up render system name parsing
  276|      1|        addKeywordType("render_system_name", SET_STRING_METHOD);
  277|       |        // set up the setters 
  278|      1|        addSetStringMethod("render_system_name", &RenderSystemCapabilities::setRenderSystemName);
  279|       |
  280|       |        // set up vendor parsing
  281|      1|        addKeywordType("vendor", SET_STRING_METHOD);
  282|       |        // set up the setters for driver versions
  283|      1|        addSetStringMethod("vendor", &RenderSystemCapabilities::parseVendorFromString);
  284|       |
  285|       |        // initialize int types
  286|      1|        addKeywordType("num_world_matrices", SET_INT_METHOD);
  287|      1|        addKeywordType("num_texture_units", SET_INT_METHOD);
  288|      1|        addKeywordType("stencil_buffer_bit_depth", SET_INT_METHOD);
  289|      1|        addKeywordType("num_vertex_blend_matrices", SET_INT_METHOD);
  290|      1|        addKeywordType("num_multi_render_targets", SET_INT_METHOD);
  291|      1|        addKeywordType("vertex_program_constant_float_count", SET_INT_METHOD);
  292|      1|        addKeywordType("vertex_program_constant_int_count", SET_INT_METHOD);
  293|      1|        addKeywordType("vertex_program_constant_bool_count", SET_INT_METHOD);
  294|      1|        addKeywordType("fragment_program_constant_float_count", SET_INT_METHOD);
  295|      1|        addKeywordType("fragment_program_constant_int_count", SET_INT_METHOD);
  296|      1|        addKeywordType("fragment_program_constant_bool_count", SET_INT_METHOD);
  297|      1|        addKeywordType("geometry_program_constant_float_count", SET_INT_METHOD);
  298|      1|        addKeywordType("geometry_program_constant_int_count", SET_INT_METHOD);
  299|      1|        addKeywordType("geometry_program_constant_bool_count", SET_INT_METHOD);
  300|      1|        addKeywordType("tessellation_hull_program_constant_float_count", SET_INT_METHOD);
  301|      1|        addKeywordType("tessellation_hull_program_constant_int_count", SET_INT_METHOD);
  302|      1|        addKeywordType("tessellation_hull_program_constant_bool_count", SET_INT_METHOD);
  303|      1|        addKeywordType("tessellation_domain_program_constant_float_count", SET_INT_METHOD);
  304|      1|        addKeywordType("tessellation_domain_program_constant_int_count", SET_INT_METHOD);
  305|      1|        addKeywordType("tessellation_domain_program_constant_bool_count", SET_INT_METHOD);
  306|      1|        addKeywordType("compute_program_constant_float_count", SET_INT_METHOD);
  307|      1|        addKeywordType("compute_program_constant_int_count", SET_INT_METHOD);
  308|      1|        addKeywordType("compute_program_constant_bool_count", SET_INT_METHOD);
  309|      1|        addKeywordType("num_vertex_texture_units", SET_INT_METHOD);
  310|       |
  311|       |        // initialize int setters
  312|      1|        addSetIntMethod("num_texture_units", &RenderSystemCapabilities::setNumTextureUnits);
  313|      1|        addSetIntMethod("stencil_buffer_bit_depth", &RenderSystemCapabilities::setStencilBufferBitDepth);
  314|      1|        addSetIntMethod("num_multi_render_targets", &RenderSystemCapabilities::setNumMultiRenderTargets);
  315|      1|        addSetIntMethod("vertex_program_constant_float_count", &RenderSystemCapabilities::setVertexProgramConstantFloatCount);
  316|      1|        addSetIntMethod("fragment_program_constant_float_count", &RenderSystemCapabilities::setFragmentProgramConstantFloatCount);
  317|      1|        addSetIntMethod("geometry_program_constant_float_count", &RenderSystemCapabilities::setGeometryProgramConstantFloatCount);
  318|      1|        addSetIntMethod("tessellation_hull_program_constant_float_count", &RenderSystemCapabilities::setTessellationHullProgramConstantFloatCount);
  319|      1|        addSetIntMethod("tessellation_domain_program_constant_float_count", &RenderSystemCapabilities::setTessellationDomainProgramConstantFloatCount);
  320|      1|        addSetIntMethod("compute_program_constant_float_count", &RenderSystemCapabilities::setComputeProgramConstantFloatCount);
  321|      1|        addSetIntMethod("num_vertex_texture_units", &RenderSystemCapabilities::setNumVertexTextureUnits);
  322|       |
  323|       |        // initialize bool types
  324|      1|        addKeywordType("non_pow2_textures_limited", SET_BOOL_METHOD);
  325|       |
  326|       |        // initialize bool setters
  327|      1|        addSetBoolMethod("non_pow2_textures_limited", &RenderSystemCapabilities::setNonPOW2TexturesLimited);
  328|       |
  329|       |        // initialize Real types
  330|      1|        addKeywordType("max_point_size", SET_REAL_METHOD);
  331|       |
  332|       |        // initialize Real setters
  333|      1|        addSetRealMethod("max_point_size", &RenderSystemCapabilities::setMaxPointSize);
  334|       |
  335|       |        // there is no dispatch table for shader profiles, just the type
  336|      1|        addKeywordType("shader_profile", ADD_SHADER_PROFILE_STRING);
  337|       |
  338|      1|        addCapabilitiesMapping("fixed_function", RSC_FIXED_FUNCTION);
  339|      1|        addCapabilitiesMapping("anisotropy", RSC_ANISOTROPY);
  340|      1|        addCapabilitiesMapping("hwstencil", RSC_HWSTENCIL);
  341|      1|        addCapabilitiesMapping("32bit_index", RSC_32BIT_INDEX);
  342|      1|        addCapabilitiesMapping("vertex_program", RSC_VERTEX_PROGRAM);
  343|      1|        addCapabilitiesMapping("geometry_program", RSC_GEOMETRY_PROGRAM);
  344|      1|        addCapabilitiesMapping("tessellation_hull_program", RSC_TESSELLATION_HULL_PROGRAM);
  345|      1|        addCapabilitiesMapping("tessellation_domain_program", RSC_TESSELLATION_DOMAIN_PROGRAM);
  346|      1|        addCapabilitiesMapping("compute_program", RSC_COMPUTE_PROGRAM);
  347|      1|        addCapabilitiesMapping("two_sided_stencil", RSC_TWO_SIDED_STENCIL);
  348|      1|        addCapabilitiesMapping("stencil_wrap", RSC_STENCIL_WRAP);
  349|      1|        addCapabilitiesMapping("hwocclusion", RSC_HWOCCLUSION);
  350|      1|        addCapabilitiesMapping("user_clip_planes", RSC_USER_CLIP_PLANES);
  351|      1|        addCapabilitiesMapping("hwrender_to_texture", RSC_HWRENDER_TO_TEXTURE);
  352|      1|        addCapabilitiesMapping("texture_float", RSC_TEXTURE_FLOAT);
  353|      1|        addCapabilitiesMapping("non_power_of_2_textures", RSC_NON_POWER_OF_2_TEXTURES);
  354|      1|        addCapabilitiesMapping("texture_3d", RSC_TEXTURE_3D);
  355|      1|        addCapabilitiesMapping("texture_2d_array", RSC_TEXTURE_3D);
  356|      1|        addCapabilitiesMapping("texture_1d", RSC_TEXTURE_1D);
  357|      1|        addCapabilitiesMapping("point_sprites", RSC_POINT_SPRITES);
  358|      1|        addCapabilitiesMapping("wide_lines", RSC_WIDE_LINES);
  359|      1|        addCapabilitiesMapping("vertex_texture_fetch", RSC_VERTEX_TEXTURE_FETCH);
  360|      1|        addCapabilitiesMapping("mipmap_lod_bias", RSC_MIPMAP_LOD_BIAS);
  361|      1|        addCapabilitiesMapping("atomic_counters", RSC_READ_WRITE_BUFFERS);
  362|      1|        addCapabilitiesMapping("texture_compression", RSC_TEXTURE_COMPRESSION);
  363|      1|        addCapabilitiesMapping("texture_compression_dxt", RSC_TEXTURE_COMPRESSION_DXT);
  364|      1|        addCapabilitiesMapping("texture_compression_vtc", RSC_TEXTURE_COMPRESSION_VTC);
  365|      1|        addCapabilitiesMapping("texture_compression_pvrtc", RSC_TEXTURE_COMPRESSION_PVRTC);
  366|      1|        addCapabilitiesMapping("texture_compression_atc", RSC_TEXTURE_COMPRESSION_ATC);
  367|      1|        addCapabilitiesMapping("texture_compression_etc1", RSC_TEXTURE_COMPRESSION_ETC1);
  368|      1|        addCapabilitiesMapping("texture_compression_etc2", RSC_TEXTURE_COMPRESSION_ETC2);
  369|      1|        addCapabilitiesMapping("texture_compression_bc4_bc5", RSC_TEXTURE_COMPRESSION_BC4_BC5);
  370|      1|        addCapabilitiesMapping("texture_compression_bc6h_bc7", RSC_TEXTURE_COMPRESSION_BC6H_BC7);
  371|      1|        addCapabilitiesMapping("texture_compression_astc", RSC_TEXTURE_COMPRESSION_ASTC);
  372|      1|        addCapabilitiesMapping("hwrender_to_vertex_buffer", RSC_HWRENDER_TO_VERTEX_BUFFER);
  373|       |
  374|      1|        addCapabilitiesMapping("pbuffer", RSC_PBUFFER);
  375|      1|        addCapabilitiesMapping("perstageconstant", RSC_PERSTAGECONSTANT);
  376|      1|        addCapabilitiesMapping("vao", RSC_VAO);
  377|      1|        addCapabilitiesMapping("separate_shader_objects", RSC_SEPARATE_SHADER_OBJECTS);
  378|      1|        addCapabilitiesMapping("glsl_sso_redeclare", RSC_GLSL_SSO_REDECLARE);
  379|      1|        addCapabilitiesMapping("debug", RSC_DEBUG);
  380|      1|        addCapabilitiesMapping("mapbuffer", RSC_MAPBUFFER);
  381|      1|        addCapabilitiesMapping("automipmap_compressed", RSC_AUTOMIPMAP_COMPRESSED);
  382|      1|    }

_ZN4Ogre23ResourceBackgroundQueueC2Ev:
   47|      1|    ResourceBackgroundQueue::ResourceBackgroundQueue() {}
_ZN4Ogre23ResourceBackgroundQueueD2Ev:
   48|      1|    ResourceBackgroundQueue::~ResourceBackgroundQueue() {}

_ZN4Ogre20ResourceGroupManager12getSingletonEv:
   40|     24|    {  
   41|       |        assert( msSingleton );  return ( *msSingleton );  
   42|     24|    }
_ZN4Ogre20ResourceGroupManagerC2Ev:
   58|  4.69k|        : mLoadingListener(0), mCurrentGroup(0)
   59|  4.69k|    {
   60|       |        // Create the 'General' group
   61|  4.69k|        createResourceGroup(DEFAULT_RESOURCE_GROUP_NAME, true); // the "General" group is synonymous to global pool
   62|       |        // Create the 'Internal' group
   63|  4.69k|        createResourceGroup(INTERNAL_RESOURCE_GROUP_NAME, true);
   64|       |        // Create the 'Autodetect' group (only used for temp storage)
   65|  4.69k|        createResourceGroup(AUTODETECT_RESOURCE_GROUP_NAME, true); // autodetect includes the global pool
   66|       |        // default world group to the default group
   67|  4.69k|        mWorldGroupName = DEFAULT_RESOURCE_GROUP_NAME;
   68|  4.69k|    }
_ZN4Ogre20ResourceGroupManagerD2Ev:
   71|  4.69k|    {
   72|       |        // delete all resource groups
   73|  4.69k|        ResourceGroupMap::iterator i, iend;
   74|  4.69k|        iend = mResourceGroupMap.end();
   75|  4.69k|        for (auto& g : mResourceGroupMap)
  ------------------
  |  Branch (75:22): [True: 14.0k, False: 4.69k]
  ------------------
   76|  14.0k|        {
   77|  14.0k|            deleteGroup(g.second);
   78|  14.0k|        }
   79|  4.69k|        mResourceGroupMap.clear();
   80|  4.69k|    }
_ZN4Ogre20ResourceGroupManager19createResourceGroupERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
   83|  14.0k|    {
   84|  14.0k|        LogManager::getSingleton().logMessage("Creating resource group " + name);
   85|  14.0k|        if (getResourceGroup(name))
  ------------------
  |  Branch (85:13): [True: 0, False: 14.0k]
  ------------------
   86|      0|        {
   87|      0|            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, 
   88|      0|                "Resource group with name '" + name + "' already exists!", 
   89|      0|                "ResourceGroupManager::createResourceGroup");
   90|      0|        }
   91|  14.0k|        ResourceGroup* grp = OGRE_NEW_T(ResourceGroup, MEMCATEGORY_RESOURCE)();
   92|  14.0k|        grp->groupStatus = ResourceGroup::UNINITIALSED;
   93|  14.0k|        grp->name = name;
   94|  14.0k|        grp->inGlobalPool = inGlobalPool;
   95|  14.0k|        grp->customStageCount = 0;
   96|       |
   97|  14.0k|        OGRE_LOCK_AUTO_MUTEX;
   98|  14.0k|        mResourceGroupMap.emplace(name, grp);
   99|  14.0k|    }
_ZN4Ogre20ResourceGroupManager24_registerResourceManagerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPNS_15ResourceManagerE:
  702|      5|    {
  703|      5|        OGRE_LOCK_AUTO_MUTEX;
  704|       |
  705|      5|        LogManager::getSingleton().logMessage(
  706|      5|            "Registering ResourceManager for type " + resourceType);
  707|      5|        mResourceManagerMap[resourceType] = rm;
  708|      5|    }
_ZN4Ogre20ResourceGroupManager26_unregisterResourceManagerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  712|      5|    {
  713|      5|        OGRE_LOCK_AUTO_MUTEX;
  714|       |
  715|      5|        LogManager::getSingleton().logMessage(
  716|      5|            "Unregistering ResourceManager for type " + resourceType);
  717|       |        
  718|      5|        ResourceManagerMap::iterator i = mResourceManagerMap.find(resourceType);
  719|      5|        if (i != mResourceManagerMap.end())
  ------------------
  |  Branch (719:13): [True: 5, False: 0]
  ------------------
  720|      5|        {
  721|      5|            mResourceManagerMap.erase(i);
  722|      5|        }
  723|      5|    }
_ZN4Ogre20ResourceGroupManager21_registerScriptLoaderEPNS_12ScriptLoaderE:
  726|      1|    {
  727|      1|            OGRE_LOCK_AUTO_MUTEX;
  728|       |
  729|      1|        mScriptLoaderOrderMap.emplace(su->getLoadingOrder(), su);
  730|      1|    }
_ZN4Ogre20ResourceGroupManager23_unregisterScriptLoaderEPNS_12ScriptLoaderE:
  733|      2|    {
  734|      2|            OGRE_LOCK_AUTO_MUTEX;
  735|       |
  736|      2|        Real order = su->getLoadingOrder();
  737|      2|        ScriptLoaderOrderMap::iterator oi = mScriptLoaderOrderMap.find(order);
  738|      2|        while (oi != mScriptLoaderOrderMap.end() && oi->first == order)
  ------------------
  |  Branch (738:16): [True: 0, False: 2]
  |  Branch (738:16): [True: 0, False: 2]
  |  Branch (738:53): [True: 0, False: 0]
  ------------------
  739|      0|        {
  740|      0|            if (oi->second == su)
  ------------------
  |  Branch (740:17): [True: 0, False: 0]
  ------------------
  741|      0|            {
  742|       |                // erase does not invalidate on multimap, except current
  743|      0|                ScriptLoaderOrderMap::iterator del = oi++;
  744|      0|                mScriptLoaderOrderMap.erase(del);
  745|      0|            }
  746|      0|            else
  747|      0|            {
  748|      0|                ++oi;
  749|      0|            }
  750|      0|        }
  751|      2|    }
_ZNK4Ogre20ResourceGroupManager26_notifyAllResourcesRemovedEPNS_15ResourceManagerE:
  964|     10|    {
  965|     10|            OGRE_LOCK_AUTO_MUTEX;
  966|       |
  967|       |        // Iterate over all groups
  968|     10|        for (const auto & grpi : mResourceGroupMap)
  ------------------
  |  Branch (968:32): [True: 30, False: 10]
  ------------------
  969|     30|        {
  970|     30|                    OGRE_LOCK_MUTEX(grpi.second->OGRE_AUTO_MUTEX_NAME);
  971|       |            // Iterate over all priorities
  972|     30|            for (auto & oi : grpi.second->loadResourceOrderMap)
  ------------------
  |  Branch (972:28): [True: 0, False: 30]
  ------------------
  973|      0|            {
  974|       |                // Iterate over all resources and collect which should be removed
  975|      0|                std::vector<ResourcePtr> arDel;
  976|      0|                arDel.reserve(oi.second.size());
  977|      0|                for (const auto& iter : oi.second) {
  ------------------
  |  Branch (977:39): [True: 0, False: 0]
  ------------------
  978|      0|                    if (iter->getCreator() == manager)
  ------------------
  |  Branch (978:25): [True: 0, False: 0]
  ------------------
  979|      0|                        arDel.emplace_back(iter);
  980|      0|                }
  981|       |
  982|       |                // Remove the items here (not above) because during the erase the item destructor
  983|       |                // can unload some resources which can call _notifyResourceRemoved that removes
  984|       |                // the corresponding items from our container - this invalidates the iterator and we crash.
  985|      0|                for (const auto& iter : arDel)
  ------------------
  |  Branch (985:39): [True: 0, False: 0]
  ------------------
  986|      0|                {
  987|      0|                    auto iFind = std::find(oi.second.begin(), oi.second.end(), iter);
  988|      0|                    if (iFind != oi.second.end())
  ------------------
  |  Branch (988:25): [True: 0, False: 0]
  ------------------
  989|      0|                        oi.second.erase(iFind);
  990|      0|                }
  991|      0|            }
  992|     30|        }
  993|     10|    }
_ZNK4Ogre20ResourceGroupManager16getResourceGroupERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
 1009|  14.0k|    {
 1010|  14.0k|        OGRE_LOCK_AUTO_MUTEX;
 1011|  14.0k|        ResourceGroupMap::const_iterator i = mResourceGroupMap.find(name);
 1012|       |
 1013|  14.0k|        if (i == mResourceGroupMap.end())
  ------------------
  |  Branch (1013:13): [True: 14.0k, False: 0]
  ------------------
 1014|  14.0k|        {
 1015|  14.0k|            if (throwOnFailure)
  ------------------
  |  Branch (1015:17): [True: 0, False: 14.0k]
  ------------------
 1016|  14.0k|                OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Cannot locate a resource group called '" + name + "'");
 1017|       |
 1018|  14.0k|            return nullptr;
 1019|  14.0k|        }
 1020|       |
 1021|      0|        return i->second;
 1022|  14.0k|    }
_ZN4Ogre20ResourceGroupManager11deleteGroupEPNS0_13ResourceGroupE:
 1068|  14.0k|    {
 1069|  14.0k|        {
 1070|  14.0k|            OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME);
 1071|       |            // delete all the load list entries
 1072|  14.0k|            grp->loadResourceOrderMap.clear();
 1073|  14.0k|        }
 1074|       |
 1075|       |        // delete ResourceGroup
 1076|       |        OGRE_DELETE_T(grp, ResourceGroup, MEMCATEGORY_RESOURCE);
 1077|  14.0k|    }
_ZN4Ogre20ResourceGroupManager11shutdownAllEv:
 1227|      1|    {
 1228|      1|        OGRE_LOCK_AUTO_MUTEX;
 1229|       |
 1230|      1|        ResourceManagerMap::iterator i, iend;
 1231|      1|        iend = mResourceManagerMap.end();
 1232|      6|        for (i = mResourceManagerMap.begin(); i != iend; ++i)
  ------------------
  |  Branch (1232:47): [True: 5, False: 1]
  ------------------
 1233|      5|        {
 1234|      5|            i->second->removeAll();
 1235|      5|        }
 1236|      1|    }

_ZN4Ogre15ResourceManagerC2Ev:
   35|      5|        : mNextHandle(1), mMemoryUsage(0), mVerbose(true), mLoadOrder(0)
   36|      5|    {
   37|       |        // Init memory limit & usage
   38|      5|        mMemoryBudget = std::numeric_limits<unsigned long>::max();
   39|      5|    }
_ZN4Ogre15ResourceManagerD2Ev:
   42|      5|    {
   43|      5|        destroyAllResourcePools();
   44|      5|        removeAll();
   45|      5|    }
_ZN4Ogre15ResourceManager9removeAllEv:
  333|     10|    {
  334|     10|        OGRE_LOCK_AUTO_MUTEX;
  335|       |
  336|     10|        mResources.clear();
  337|     10|        mResourcesWithGroup.clear();
  338|     10|        mResourcesByHandle.clear();
  339|       |        // Notify resource group manager
  340|     10|        ResourceGroupManager::getSingleton()._notifyAllResourcesRemoved(this);
  341|     10|    }
_ZN4Ogre15ResourceManager23destroyAllResourcePoolsEv:
  518|      5|    {
  519|      5|        OGRE_LOCK_AUTO_MUTEX;
  520|       |
  521|      5|        for (auto & i : mResourcePoolMap)
  ------------------
  |  Branch (521:23): [True: 0, False: 5]
  ------------------
  522|      5|            OGRE_DELETE i.second;
  523|       |
  524|      5|        mResourcePoolMap.clear();
  525|      5|    }

_ZNK4Ogre18RibbonTrailFactory7getTypeEv:
  433|      3|    {
  434|      3|        return MOT_RIBBON_TRAIL;
  435|      3|    }

_ZN4Ogre4Root12getSingletonEv:
   90|      2|    {
   91|       |        assert( msSingleton );  return ( *msSingleton );
   92|      2|    }
_ZN4Ogre4RootC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_S9_:
  100|      1|      : mQueuedEnd(false)
  101|      1|      , mCurrentSceneManager(NULL)
  102|      1|      , mNextFrame(0)
  103|      1|      , mFrameSmoothingTime(0.0f)
  104|      1|      , mRemoveQueueStructuresOnClear(false)
  105|      1|      , mDefaultMinPixelSize(0)
  106|      1|      , mNextMovableObjectTypeFlag(1)
  107|      1|      , mIsInitialised(false)
  108|      1|      , mIsBlendIndicesGpuRedundant(true)
  109|      1|      , mIsBlendWeightsGpuRedundant(true)
  110|      1|    {
  111|       |        // superclass will do singleton checking
  112|       |
  113|       |        // Init
  114|      1|        mActiveRenderer = 0;
  115|      1|        mVersion = StringConverter::toString(OGRE_VERSION_MAJOR) + "." +
  116|      1|            StringConverter::toString(OGRE_VERSION_MINOR) + "." +
  117|      1|            StringConverter::toString(OGRE_VERSION_PATCH) +
  118|      1|            OGRE_VERSION_SUFFIX + " " +
  119|      1|            "(" + OGRE_VERSION_NAME + ")";
  120|      1|        mConfigFileName = configFileName;
  121|       |
  122|       |        // Create log manager and default log file if there is no log manager yet
  123|      1|        if(!LogManager::getSingletonPtr())
  ------------------
  |  Branch (123:12): [True: 0, False: 1]
  ------------------
  124|      0|        {
  125|      0|            mLogManager = std::make_unique<LogManager>();
  126|       |
  127|       |#if OGRE_PLATFORM == OGRE_PLATFORM_EMSCRIPTEN
  128|       |            // suppress writing log to Emscripten virtual FS, improves performance
  129|       |            mLogManager->createLog(logFileName, true, true, true);
  130|       |#else
  131|      0|            mLogManager->createLog(logFileName, true, true);
  132|      0|#endif
  133|       |
  134|       |#if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
  135|       |            mAndroidLogger.reset(new AndroidLogListener());
  136|       |            mLogManager->getDefaultLog()->addListener(mAndroidLogger.get());
  137|       |#endif
  138|      0|        }
  139|       |
  140|      1|        mDynLibManager = std::make_unique<DynLibManager>();
  141|      1|        mArchiveManager = std::make_unique<ArchiveManager>();
  142|      1|        mResourceGroupManager = std::make_unique<ResourceGroupManager>();
  143|       |
  144|       |        // WorkQueue (note: users can replace this if they want)
  145|      1|        DefaultWorkQueue* defaultQ = OGRE_NEW DefaultWorkQueue("Root");
  146|       |        // match threads to hardware
  147|      1|        int threadCount = OGRE_THREAD_HARDWARE_CONCURRENCY;
  148|       |        // but clamp it at 2 by default - we dont scale much beyond that currently
  149|       |        // yet it helps on android where it needlessly burns CPU
  150|      1|        threadCount = Math::Clamp(threadCount, 1, 2);
  151|      1|        defaultQ->setWorkerThreadCount(threadCount);
  152|       |
  153|       |        // only allow workers to access rendersystem if threadsupport is 1
  154|      1|        defaultQ->setWorkersCanAccessRenderSystem(OGRE_THREAD_SUPPORT == 1);
  155|      1|        mWorkQueue.reset(defaultQ);
  156|       |
  157|       |        // ResourceBackgroundQueue
  158|      1|        mResourceBackgroundQueue = std::make_unique<ResourceBackgroundQueue>();
  159|       |
  160|       |        // Create SceneManager enumerator (note - will be managed by singleton)
  161|      1|        mSceneManagerEnum = std::make_unique<SceneManagerEnumerator>();
  162|      1|        mShadowTextureManager = std::make_unique<ShadowTextureManager>();
  163|      1|        mRenderSystemCapabilitiesManager = std::make_unique<RenderSystemCapabilitiesManager>();
  164|      1|        mMaterialManager = std::make_unique<MaterialManager>();
  165|      1|        mMeshManager = std::make_unique<MeshManager>();
  166|      1|        mSkeletonManager = std::make_unique<SkeletonManager>();
  167|      1|        mParticleManager = std::make_unique<ParticleSystemManager>();
  168|      1|        mTimer = std::make_unique<Timer>();
  169|      1|        mLodStrategyManager = std::make_unique<LodStrategyManager>();
  170|       |
  171|       |#if OGRE_PROFILING
  172|       |        // Profiler
  173|       |        mProfiler.reset(new Profiler());
  174|       |        Profiler::getSingleton().setTimer(mTimer.get());
  175|       |#endif
  176|       |
  177|       |
  178|      1|        mFileSystemArchiveFactory = std::make_unique<FileSystemArchiveFactory>();
  179|      1|        ArchiveManager::getSingleton().addArchiveFactory( mFileSystemArchiveFactory.get() );
  180|      1|#   if OGRE_NO_ZIP_ARCHIVE == 0
  181|      1|        mZipArchiveFactory = std::make_unique<ZipArchiveFactory>();
  182|      1|        ArchiveManager::getSingleton().addArchiveFactory( mZipArchiveFactory.get() );
  183|      1|        mEmbeddedZipArchiveFactory = std::make_unique<EmbeddedZipArchiveFactory>();
  184|      1|        ArchiveManager::getSingleton().addArchiveFactory( mEmbeddedZipArchiveFactory.get() );
  185|      1|#   endif
  186|       |
  187|      1|#if OGRE_NO_DDS_CODEC == 0
  188|       |        // Register image codecs
  189|      1|        DDSCodec::startup();
  190|      1|#endif
  191|       |#if OGRE_NO_PVRTC_CODEC == 0
  192|       |        PVRTCCodec::startup();
  193|       |#endif
  194|      1|#if OGRE_NO_ETC_CODEC == 0
  195|      1|        ETCCodec::startup();
  196|      1|#endif
  197|      1|#if OGRE_NO_ASTC_CODEC == 0
  198|      1|        ASTCCodec::startup();
  199|      1|#endif
  200|       |
  201|      1|        mGpuProgramManager = std::make_unique<GpuProgramManager>();
  202|      1|        mExternalTextureSourceManager = std::make_unique<ExternalTextureSourceManager>();
  203|      1|        mCompositorManager = std::make_unique<CompositorManager>();
  204|      1|        mCompilerManager = std::make_unique<ScriptCompilerManager>();
  205|       |
  206|       |        // Auto window
  207|      1|        mAutoWindow = 0;
  208|       |
  209|       |        // instantiate and register base movable factories
  210|      1|        mEntityFactory = std::make_unique<EntityFactory>();
  211|      1|        addMovableObjectFactory(mEntityFactory.get());
  212|      1|        mLightFactory = std::make_unique<LightFactory>();
  213|      1|        addMovableObjectFactory(mLightFactory.get());
  214|      1|        mBillboardSetFactory = std::make_unique<BillboardSetFactory>();
  215|      1|        addMovableObjectFactory(mBillboardSetFactory.get());
  216|      1|        mManualObjectFactory = std::make_unique<ManualObjectFactory>();
  217|      1|        addMovableObjectFactory(mManualObjectFactory.get());
  218|      1|        mBillboardChainFactory = std::make_unique<BillboardChainFactory>();
  219|      1|        addMovableObjectFactory(mBillboardChainFactory.get());
  220|      1|        mRibbonTrailFactory = std::make_unique<RibbonTrailFactory>();
  221|      1|        addMovableObjectFactory(mRibbonTrailFactory.get());
  222|      1|        mStaticGeometryFactory = std::make_unique<StaticGeometryFactory>();
  223|      1|        addMovableObjectFactory(mStaticGeometryFactory.get());
  224|      1|        mRectangle2DFactory = std::make_unique<Rectangle2DFactory>();
  225|      1|        addMovableObjectFactory(mRectangle2DFactory.get());
  226|       |
  227|       |        // Load plugins
  228|      1|        if (!pluginFileName.empty())
  ------------------
  |  Branch (228:13): [True: 0, False: 1]
  ------------------
  229|      0|            loadPlugins(pluginFileName);
  230|       |
  231|      1|        LogManager::getSingleton().logMessage("*-*-* OGRE Initialising");
  232|      1|        LogManager::getSingleton().logMessage("*-*-* Version " + mVersion);
  233|       |
  234|       |        // Can't create managers until initialised
  235|      1|        mControllerManager = 0;
  236|       |
  237|      1|        mFirstTimePostWindowInit = false;
  238|      1|    }
_ZN4Ogre4RootD2Ev:
  242|      1|    {
  243|      1|        shutdown();
  244|       |
  245|      1|#if OGRE_NO_DDS_CODEC == 0
  246|      1|        DDSCodec::shutdown();
  247|      1|#endif
  248|       |#if OGRE_NO_PVRTC_CODEC == 0
  249|       |        PVRTCCodec::shutdown();
  250|       |#endif
  251|      1|#if OGRE_NO_ETC_CODEC == 0
  252|      1|        ETCCodec::shutdown();
  253|      1|#endif
  254|      1|#if OGRE_NO_ASTC_CODEC == 0
  255|      1|        ASTCCodec::shutdown();
  256|      1|#endif
  257|      1|		mCompositorManager.reset(); // needs rendersystem
  258|      1|        mParticleManager.reset(); // may use plugins
  259|      1|        mMaterialManager.reset(); // may use GPU program manager
  260|      1|        mGpuProgramManager.reset(); // may use plugins
  261|      1|        unloadPlugins();
  262|       |
  263|      1|        mAutoWindow = 0;
  264|       |
  265|      1|        StringInterface::cleanupDictionary();
  266|       |
  267|       |#if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
  268|       |	if(mAndroidLogger)
  269|       |	{
  270|       |            mLogManager->getDefaultLog()->removeListener(mAndroidLogger.get());
  271|       |	}
  272|       |#endif
  273|      1|    }
_ZN4Ogre4Root8shutdownEv:
  816|      1|    {
  817|      1|        if(mActiveRenderer)
  ------------------
  |  Branch (817:12): [True: 0, False: 1]
  ------------------
  818|      0|            mActiveRenderer->_setViewport(NULL);
  819|       |
  820|       |        // Since background thread might be access resources,
  821|       |        // ensure shutdown before destroying resource manager.
  822|      1|        mWorkQueue->shutdown();
  823|       |
  824|      1|        if(mSceneManagerEnum)
  ------------------
  |  Branch (824:12): [True: 1, False: 0]
  ------------------
  825|      1|            mSceneManagerEnum->shutdownAll();
  826|      1|        if(mFirstTimePostWindowInit)
  ------------------
  |  Branch (826:12): [True: 0, False: 1]
  ------------------
  827|      0|        {
  828|      0|            shutdownPlugins();
  829|      0|            mParticleManager->removeAllTemplates(true);
  830|      0|            mFirstTimePostWindowInit = false;
  831|      0|        }
  832|      1|        mSceneManagerEnum.reset();
  833|      1|        mShadowTextureManager.reset();
  834|       |
  835|      1|        ShadowVolumeExtrudeProgram::shutdown();
  836|      1|        ResourceGroupManager::getSingleton().shutdownAll();
  837|       |
  838|       |        // Destroy pools
  839|      1|        ConvexBody::_destroyPool();
  840|       |
  841|       |
  842|      1|        mIsInitialised = false;
  843|       |
  844|      1|        LogManager::getSingleton().logMessage("*-*-* OGRE Shutdown");
  845|      1|    }
_ZN4Ogre4Root13unloadPluginsEv:
  916|      1|    {
  917|      1|#if OGRE_PLATFORM != OGRE_PLATFORM_EMSCRIPTEN
  918|       |        // unload dynamic libs first
  919|      1|        for (PluginLibList::reverse_iterator i = mPluginLibs.rbegin(); i != mPluginLibs.rend(); ++i)
  ------------------
  |  Branch (919:72): [True: 0, False: 1]
  ------------------
  920|      0|        {
  921|       |            // Call plugin shutdown
  922|      0|            #ifdef __GNUC__
  923|      0|            __extension__
  924|      0|            #endif
  925|      0|            DLL_STOP_PLUGIN pFunc = reinterpret_cast<DLL_STOP_PLUGIN>((*i)->getSymbol("dllStopPlugin"));
  926|       |            // this will call uninstallPlugin
  927|      0|            pFunc();
  928|       |            // Unload library & destroy
  929|      0|            DynLibManager::getSingleton().unload(*i);
  930|       |
  931|      0|        }
  932|      1|        mPluginLibs.clear();
  933|       |
  934|       |        // now deal with any remaining plugins that were registered through other means
  935|      1|        for (PluginInstanceList::reverse_iterator i = mPlugins.rbegin(); i != mPlugins.rend(); ++i)
  ------------------
  |  Branch (935:74): [True: 0, False: 1]
  ------------------
  936|      0|        {
  937|       |            // Note this does NOT call uninstallPlugin - this shutdown is for the
  938|       |            // detail objects
  939|      0|            (*i)->uninstall();
  940|      0|        }
  941|      1|        mPlugins.clear();
  942|      1|#endif
  943|      1|    }
_ZN4Ogre4Root23addMovableObjectFactoryEPNS_20MovableObjectFactoryEb:
 1196|      9|    {
 1197|      9|        MovableObjectFactoryMap::iterator facti = mMovableObjectFactoryMap.find(
 1198|      9|            fact->getType());
 1199|      9|        if (!overrideExisting && facti != mMovableObjectFactoryMap.end())
  ------------------
  |  Branch (1199:13): [True: 9, False: 0]
  |  Branch (1199:13): [True: 0, False: 9]
  |  Branch (1199:34): [True: 0, False: 9]
  ------------------
 1200|      0|        {
 1201|      0|            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM,
 1202|      0|                "A factory of type '" + fact->getType() + "' already exists.",
 1203|      0|                "Root::addMovableObjectFactory");
 1204|      0|        }
 1205|       |
 1206|      9|        if (fact->requestTypeFlags())
  ------------------
  |  Branch (1206:13): [True: 0, False: 9]
  ------------------
 1207|      0|        {
 1208|      0|            if (facti != mMovableObjectFactoryMap.end() && facti->second->requestTypeFlags())
  ------------------
  |  Branch (1208:17): [True: 0, False: 0]
  |  Branch (1208:17): [True: 0, False: 0]
  |  Branch (1208:60): [True: 0, False: 0]
  ------------------
 1209|      0|            {
 1210|       |                // Copy type flags from the factory we're replacing
 1211|      0|                fact->_notifyTypeFlags(facti->second->getTypeFlags());
 1212|      0|            }
 1213|      0|            else
 1214|      0|            {
 1215|       |                // Allocate new
 1216|      0|                fact->_notifyTypeFlags(_allocateNextMovableObjectTypeFlag());
 1217|      0|            }
 1218|      0|        }
 1219|       |
 1220|       |        // Save
 1221|      9|        mMovableObjectFactoryMap[fact->getType()] = fact;
 1222|       |
 1223|      9|        LogManager::getSingleton().logMessage("MovableObjectFactory for type '" +
 1224|      9|            fact->getType() + "' registered.");
 1225|       |
 1226|      9|    }
_ZN4Ogre4Root26removeMovableObjectFactoryEPNS_20MovableObjectFactoryE:
 1263|      1|    {
 1264|      1|        MovableObjectFactoryMap::iterator i = mMovableObjectFactoryMap.find(
 1265|      1|            fact->getType());
 1266|      1|        if (i != mMovableObjectFactoryMap.end())
  ------------------
  |  Branch (1266:13): [True: 1, False: 0]
  ------------------
 1267|      1|        {
 1268|      1|            mMovableObjectFactoryMap.erase(i);
 1269|      1|        }
 1270|       |
 1271|      1|    }

_ZN4Ogre22SceneManagerEnumeratorC2Ev:
   47|      1|        : mInstanceCreateCount(0), mCurrentRenderSystem(0)
   48|      1|    {
   49|      1|        addFactory(&mDefaultFactory);
   50|       |
   51|      1|    }
_ZN4Ogre22SceneManagerEnumeratorD2Ev:
   54|      1|    {
   55|       |        // Destroy all remaining instances
   56|       |        // Really should have shutdown and unregistered by now, but catch here in case
   57|      1|        Instances instancesCopy = mInstances;
   58|      1|        for (auto& i : instancesCopy)
  ------------------
  |  Branch (58:22): [True: 0, False: 1]
  ------------------
   59|      0|        {
   60|       |            // destroy instances
   61|      0|            for(auto& fp : mFactories)
  ------------------
  |  Branch (61:26): [True: 0, False: 0]
  ------------------
   62|      0|            {
   63|      0|                if (fp.first == i.second->getTypeName())
  ------------------
  |  Branch (63:21): [True: 0, False: 0]
  ------------------
   64|      0|                {
   65|      0|                    fp.second->destroyInstance(i.second);
   66|      0|                    mInstances.erase(i.first);
   67|      0|                    break;
   68|      0|                }
   69|      0|            }
   70|      0|        }
   71|      1|        mInstances.clear();
   72|      1|    }
_ZN4Ogre22SceneManagerEnumerator10addFactoryEPNS_19SceneManagerFactoryE:
   75|      1|    {
   76|      1|        mFactories[fact->getTypeName()] = fact;
   77|       |        // add to metadata
   78|      1|        mMetaDataList.push_back(fact->getTypeName());
   79|       |        // Log
   80|      1|        LogManager::getSingleton().logMessage("SceneManagerFactory for type '" + fact->getTypeName() + "' registered.");
   81|      1|    }
_ZN4Ogre22SceneManagerEnumerator11shutdownAllEv:
  204|      1|    {
  205|      1|        for (auto& i : mInstances)
  ------------------
  |  Branch (205:22): [True: 0, False: 1]
  ------------------
  206|      0|        {
  207|       |            // shutdown instances (clear scene)
  208|      0|            i.second->clearScene();
  209|      0|        }
  210|      1|    }

_ZN4Ogre26DefaultSceneManagerFactoryC2Ev:
   49|      1|        DefaultSceneManagerFactory() {}
_ZNK4Ogre26DefaultSceneManagerFactory11getTypeNameEv:
   52|      3|        const String& getTypeName(void) const override { return SMT_DEFAULT; }

_ZN4Ogre14ScriptCompilerC2Ev:
  260|      1|        :mListener(0)
  261|      1|    {
  262|      1|        initWordMap();
  263|      1|    }
_ZN4Ogre14ScriptCompiler11initWordMapEv:
  912|      1|    {
  913|      1|        mIds["on"] = ID_ON;
  914|      1|        mIds["off"] = ID_OFF;
  915|      1|        mIds["true"] = ID_TRUE;
  916|      1|        mIds["false"] = ID_FALSE;
  917|      1|        mIds["yes"] = ID_YES;
  918|      1|        mIds["no"] = ID_NO;
  919|       |
  920|       |        // Material ids
  921|      1|        mIds["material"] = ID_MATERIAL;
  922|      1|        mIds["vertex_program"] = ID_VERTEX_PROGRAM;
  923|      1|        mIds["geometry_program"] = ID_GEOMETRY_PROGRAM;
  924|      1|        mIds["fragment_program"] = ID_FRAGMENT_PROGRAM;
  925|      1|        mIds["tessellation_hull_program"] = ID_TESSELLATION_HULL_PROGRAM;
  926|      1|        mIds["tessellation_domain_program"] = ID_TESSELLATION_DOMAIN_PROGRAM;
  927|      1|        mIds["compute_program"] = ID_COMPUTE_PROGRAM;
  928|      1|        mIds["mesh_program"] = ID_MESH_PROGRAM;
  929|      1|        mIds["task_program"] = ID_TASK_PROGRAM;
  930|      1|        mIds["technique"] = ID_TECHNIQUE;
  931|      1|        mIds["pass"] = ID_PASS;
  932|      1|        mIds["texture_unit"] = ID_TEXTURE_UNIT;
  933|      1|        mIds["vertex_program_ref"] = ID_VERTEX_PROGRAM_REF;
  934|      1|        mIds["geometry_program_ref"] = ID_GEOMETRY_PROGRAM_REF;
  935|      1|        mIds["fragment_program_ref"] = ID_FRAGMENT_PROGRAM_REF;
  936|      1|        mIds["tessellation_hull_program_ref"] = ID_TESSELLATION_HULL_PROGRAM_REF;
  937|      1|        mIds["tessellation_domain_program_ref"] = ID_TESSELLATION_DOMAIN_PROGRAM_REF;
  938|      1|        mIds["compute_program_ref"] = ID_COMPUTE_PROGRAM_REF;
  939|      1|        mIds["mesh_program_ref"] = ID_MESH_PROGRAM_REF;
  940|      1|        mIds["task_program_ref"] = ID_TASK_PROGRAM_REF;
  941|      1|        mIds["shadow_caster_vertex_program_ref"] = ID_SHADOW_CASTER_VERTEX_PROGRAM_REF;
  942|      1|        mIds["shadow_caster_fragment_program_ref"] = ID_SHADOW_CASTER_FRAGMENT_PROGRAM_REF;
  943|      1|        mIds["shadow_receiver_vertex_program_ref"] = ID_SHADOW_RECEIVER_VERTEX_PROGRAM_REF;
  944|      1|        mIds["shadow_receiver_fragment_program_ref"] = ID_SHADOW_RECEIVER_FRAGMENT_PROGRAM_REF;
  945|       |
  946|      1|        mIds["lod_values"] = ID_LOD_VALUES;
  947|      1|        mIds["lod_strategy"] = ID_LOD_STRATEGY;
  948|      1|        mIds["lod_distances"] = ID_LOD_DISTANCES;
  949|      1|        mIds["receive_shadows"] = ID_RECEIVE_SHADOWS;
  950|      1|        mIds["transparency_casts_shadows"] = ID_TRANSPARENCY_CASTS_SHADOWS;
  951|      1|        mIds["set_texture_alias"] = ID_SET_TEXTURE_ALIAS;
  952|       |
  953|      1|        mIds["source"] = ID_SOURCE;
  954|      1|        mIds["syntax"] = ID_SYNTAX;
  955|      1|        mIds["default_params"] = ID_DEFAULT_PARAMS;
  956|      1|        mIds["param_indexed"] = ID_PARAM_INDEXED;
  957|      1|        mIds["param_named"] = ID_PARAM_NAMED;
  958|      1|        mIds["param_indexed_auto"] = ID_PARAM_INDEXED_AUTO;
  959|      1|        mIds["param_named_auto"] = ID_PARAM_NAMED_AUTO;
  960|       |
  961|      1|        mIds["scheme"] = ID_SCHEME;
  962|      1|        mIds["lod_index"] = ID_LOD_INDEX;
  963|      1|        mIds["shadow_caster_material"] = ID_SHADOW_CASTER_MATERIAL;
  964|      1|        mIds["shadow_receiver_material"] = ID_SHADOW_RECEIVER_MATERIAL;
  965|      1|        mIds["gpu_vendor_rule"] = ID_GPU_VENDOR_RULE;
  966|      1|        mIds["gpu_device_rule"] = ID_GPU_DEVICE_RULE;
  967|      1|        mIds["include"] = ID_INCLUDE;
  968|      1|        mIds["exclude"] = ID_EXCLUDE;
  969|       |
  970|      1|        mIds["ambient"] = ID_AMBIENT;
  971|      1|        mIds["diffuse"] = ID_DIFFUSE;
  972|      1|        mIds["specular"] = ID_SPECULAR;
  973|      1|        mIds["emissive"] = ID_EMISSIVE;
  974|      1|        mIds["vertexcolour"] = ID_VERTEXCOLOUR;
  975|      1|        mIds["scene_blend"] = ID_SCENE_BLEND;
  976|      1|        mIds["colour_blend"] = ID_COLOUR_BLEND;
  977|      1|        mIds["one"] = ID_ONE;
  978|      1|        mIds["zero"] = ID_ZERO;
  979|      1|        mIds["dest_colour"] = ID_DEST_COLOUR;
  980|      1|        mIds["src_colour"] = ID_SRC_COLOUR;
  981|      1|        mIds["one_minus_src_colour"] = ID_ONE_MINUS_SRC_COLOUR;
  982|      1|        mIds["one_minus_dest_colour"] = ID_ONE_MINUS_DEST_COLOUR;
  983|      1|        mIds["dest_alpha"] = ID_DEST_ALPHA;
  984|      1|        mIds["src_alpha"] = ID_SRC_ALPHA;
  985|      1|        mIds["one_minus_dest_alpha"] = ID_ONE_MINUS_DEST_ALPHA;
  986|      1|        mIds["one_minus_src_alpha"] = ID_ONE_MINUS_SRC_ALPHA;
  987|      1|        mIds["separate_scene_blend"] = ID_SEPARATE_SCENE_BLEND;
  988|      1|        mIds["scene_blend_op"] = ID_SCENE_BLEND_OP;
  989|      1|        mIds["reverse_subtract"] = ID_REVERSE_SUBTRACT;
  990|      1|        mIds["min"] = ID_MIN;
  991|      1|        mIds["max"] = ID_MAX;
  992|      1|        mIds["separate_scene_blend_op"] = ID_SEPARATE_SCENE_BLEND_OP;
  993|      1|        mIds["depth_check"] = ID_DEPTH_CHECK;
  994|      1|        mIds["depth_write"] = ID_DEPTH_WRITE;
  995|      1|        mIds["depth_func"] = ID_DEPTH_FUNC;
  996|      1|        mIds["depth_bias"] = ID_DEPTH_BIAS;
  997|      1|        mIds["iteration_depth_bias"] = ID_ITERATION_DEPTH_BIAS;
  998|      1|        mIds["always_fail"] = ID_ALWAYS_FAIL;
  999|      1|        mIds["always_pass"] = ID_ALWAYS_PASS;
 1000|      1|        mIds["less_equal"] = ID_LESS_EQUAL;
 1001|      1|        mIds["less"] = ID_LESS;
 1002|      1|        mIds["equal"] = ID_EQUAL;
 1003|      1|        mIds["not_equal"] = ID_NOT_EQUAL;
 1004|      1|        mIds["greater_equal"] = ID_GREATER_EQUAL;
 1005|      1|        mIds["greater"] = ID_GREATER;
 1006|      1|        mIds["alpha_rejection"] = ID_ALPHA_REJECTION;
 1007|      1|        mIds["alpha_to_coverage"] = ID_ALPHA_TO_COVERAGE;
 1008|      1|        mIds["light_scissor"] = ID_LIGHT_SCISSOR;
 1009|      1|        mIds["light_clip_planes"] = ID_LIGHT_CLIP_PLANES;
 1010|      1|        mIds["transparent_sorting"] = ID_TRANSPARENT_SORTING;
 1011|      1|        mIds["illumination_stage"] = ID_ILLUMINATION_STAGE;
 1012|      1|        mIds["decal"] = ID_DECAL;
 1013|      1|        mIds["cull_hardware"] = ID_CULL_HARDWARE;
 1014|      1|        mIds["clockwise"] = ID_CLOCKWISE;
 1015|      1|        mIds["anticlockwise"] = ID_ANTICLOCKWISE;
 1016|      1|        mIds["cull_software"] = ID_CULL_SOFTWARE;
 1017|      1|        mIds["back"] = ID_BACK;
 1018|      1|        mIds["front"] = ID_FRONT;
 1019|      1|        mIds["lighting"] = ID_LIGHTING;
 1020|      1|        mIds["shading"] = ID_SHADING;
 1021|      1|        mIds["flat"] = ID_FLAT;
 1022|      1|        mIds["gouraud"] = ID_GOURAUD;
 1023|      1|        mIds["phong"] = ID_PHONG;
 1024|      1|        mIds["polygon_mode"] = ID_POLYGON_MODE;
 1025|      1|        mIds["solid"] = ID_SOLID;
 1026|      1|        mIds["wireframe"] = ID_WIREFRAME;
 1027|      1|        mIds["points"] = ID_POINTS;
 1028|      1|        mIds["polygon_mode_overrideable"] = ID_POLYGON_MODE_OVERRIDEABLE;
 1029|      1|        mIds["fog_override"] = ID_FOG_OVERRIDE;
 1030|      1|        mIds["none"] = ID_NONE;
 1031|      1|        mIds["linear"] = ID_LINEAR;
 1032|      1|        mIds["exp"] = ID_EXP;
 1033|      1|        mIds["exp2"] = ID_EXP2;
 1034|      1|        mIds["colour_write"] = ID_COLOUR_WRITE;
 1035|      1|        mIds["max_lights"] = ID_MAX_LIGHTS;
 1036|      1|        mIds["start_light"] = ID_START_LIGHT;
 1037|      1|        mIds["iteration"] = ID_ITERATION;
 1038|      1|        mIds["once"] = ID_ONCE;
 1039|      1|        mIds["once_per_light"] = ID_ONCE_PER_LIGHT;
 1040|      1|        mIds["per_n_lights"] = ID_PER_N_LIGHTS;
 1041|      1|        mIds["per_light"] = ID_PER_LIGHT;
 1042|      1|        mIds["point"] = ID_POINT;
 1043|      1|        mIds["spot"] = ID_SPOT;
 1044|      1|        mIds["directional"] = ID_DIRECTIONAL;
 1045|      1|        mIds["light_mask"] = ID_LIGHT_MASK;
 1046|      1|        mIds["point_size"] = ID_POINT_SIZE;
 1047|      1|        mIds["point_sprites"] = ID_POINT_SPRITES;
 1048|      1|        mIds["point_size_min"] = ID_POINT_SIZE_MIN;
 1049|      1|        mIds["point_size_max"] = ID_POINT_SIZE_MAX;
 1050|      1|        mIds["point_size_attenuation"] = ID_POINT_SIZE_ATTENUATION;
 1051|       |
 1052|      1|        mIds["texture_alias"] = ID_TEXTURE_ALIAS;
 1053|      1|        mIds["texture"] = ID_TEXTURE;
 1054|      1|        mIds["1d"] = ID_1D;
 1055|      1|        mIds["2d"] = ID_2D;
 1056|      1|        mIds["3d"] = ID_3D;
 1057|      1|        mIds["cubic"] = ID_CUBIC;
 1058|      1|        mIds["unlimited"] = ID_UNLIMITED;
 1059|      1|        mIds["2darray"] = ID_2DARRAY; // deprecated and undocumented
 1060|      1|        mIds["2d_array"] = ID_2DARRAY;
 1061|      1|        mIds["2d_ms"] = ID_2DMS;
 1062|      1|        mIds["alpha"] = ID_ALPHA;
 1063|      1|        mIds["gamma"] = ID_GAMMA;
 1064|      1|        mIds["anim_texture"] = ID_ANIM_TEXTURE;
 1065|      1|        mIds["cubic_texture"] = ID_CUBIC_TEXTURE;
 1066|      1|        mIds["separateUV"] = ID_SEPARATE_UV;
 1067|      1|        mIds["combinedUVW"] = ID_COMBINED_UVW;
 1068|      1|        mIds["tex_coord_set"] = ID_TEX_COORD_SET;
 1069|      1|        mIds["tex_address_mode"] = ID_TEX_ADDRESS_MODE;
 1070|      1|        mIds["wrap"] = ID_WRAP;
 1071|      1|        mIds["clamp"] = ID_CLAMP;
 1072|      1|        mIds["mirror"] = ID_MIRROR;
 1073|      1|        mIds["border"] = ID_BORDER;
 1074|      1|        mIds["tex_border_colour"] = ID_TEX_BORDER_COLOUR;
 1075|      1|        mIds["filtering"] = ID_FILTERING;
 1076|      1|        mIds["bilinear"] = ID_BILINEAR;
 1077|      1|        mIds["trilinear"] = ID_TRILINEAR;
 1078|      1|        mIds["anisotropic"] = ID_ANISOTROPIC;
 1079|      1|        mIds["compare_test"] = ID_CMPTEST;
 1080|      1|        mIds["compare_func"] = ID_CMPFUNC;
 1081|      1|        mIds["max_anisotropy"] = ID_MAX_ANISOTROPY;
 1082|      1|        mIds["mipmap_bias"] = ID_MIPMAP_BIAS;
 1083|      1|        mIds["colour_op"] = ID_COLOUR_OP;
 1084|      1|        mIds["replace"] = ID_REPLACE;
 1085|      1|        mIds["add"] = ID_ADD;
 1086|      1|        mIds["modulate"] = ID_MODULATE;
 1087|      1|        mIds["alpha_blend"] = ID_ALPHA_BLEND;
 1088|      1|        mIds["colour_op_ex"] = ID_COLOUR_OP_EX;
 1089|      1|        mIds["source1"] = ID_SOURCE1;
 1090|      1|        mIds["source2"] = ID_SOURCE2;
 1091|      1|        mIds["modulate"] = ID_MODULATE;
 1092|      1|        mIds["modulate_x2"] = ID_MODULATE_X2;
 1093|      1|        mIds["modulate_x4"] = ID_MODULATE_X4;
 1094|      1|        mIds["add"] = ID_ADD;
 1095|      1|        mIds["add_signed"] = ID_ADD_SIGNED;
 1096|      1|        mIds["add_smooth"] = ID_ADD_SMOOTH;
 1097|      1|        mIds["subtract"] = ID_SUBTRACT;
 1098|      1|        mIds["blend_diffuse_alpha"] = ID_BLEND_DIFFUSE_ALPHA;
 1099|      1|        mIds["blend_texture_alpha"] = ID_BLEND_TEXTURE_ALPHA;
 1100|      1|        mIds["blend_current_alpha"] = ID_BLEND_CURRENT_ALPHA;
 1101|      1|        mIds["blend_manual"] = ID_BLEND_MANUAL;
 1102|      1|        mIds["dotproduct"] = ID_DOT_PRODUCT;
 1103|      1|        mIds["blend_diffuse_colour"] = ID_BLEND_DIFFUSE_COLOUR;
 1104|      1|        mIds["src_current"] = ID_SRC_CURRENT;
 1105|      1|        mIds["src_texture"] = ID_SRC_TEXTURE;
 1106|      1|        mIds["src_diffuse"] = ID_SRC_DIFFUSE;
 1107|      1|        mIds["src_specular"] = ID_SRC_SPECULAR;
 1108|      1|        mIds["src_manual"] = ID_SRC_MANUAL;
 1109|      1|        mIds["colour_op_multipass_fallback"] = ID_COLOUR_OP_MULTIPASS_FALLBACK;
 1110|      1|        mIds["alpha_op_ex"] = ID_ALPHA_OP_EX;
 1111|      1|        mIds["env_map"] = ID_ENV_MAP;
 1112|      1|        mIds["spherical"] = ID_SPHERICAL;
 1113|      1|        mIds["planar"] = ID_PLANAR;
 1114|      1|        mIds["cubic_reflection"] = ID_CUBIC_REFLECTION;
 1115|      1|        mIds["cubic_normal"] = ID_CUBIC_NORMAL;
 1116|      1|        mIds["scroll"] = ID_SCROLL;
 1117|      1|        mIds["scroll_anim"] = ID_SCROLL_ANIM;
 1118|      1|        mIds["rotate"] = ID_ROTATE;
 1119|      1|        mIds["rotate_anim"] = ID_ROTATE_ANIM;
 1120|      1|        mIds["scale"] = ID_SCALE;
 1121|      1|        mIds["wave_xform"] = ID_WAVE_XFORM;
 1122|      1|        mIds["scroll_x"] = ID_SCROLL_X;
 1123|      1|        mIds["scroll_y"] = ID_SCROLL_Y;
 1124|      1|        mIds["scale_x"] = ID_SCALE_X;
 1125|      1|        mIds["scale_y"] = ID_SCALE_Y;
 1126|      1|        mIds["sine"] = ID_SINE;
 1127|      1|        mIds["triangle"] = ID_TRIANGLE;
 1128|      1|        mIds["sawtooth"] = ID_SAWTOOTH;
 1129|      1|        mIds["square"] = ID_SQUARE;
 1130|      1|        mIds["inverse_sawtooth"] = ID_INVERSE_SAWTOOTH;
 1131|      1|        mIds["transform"] = ID_TRANSFORM;
 1132|      1|        mIds["geometry"] = ID_GEOMETRY;
 1133|      1|        mIds["tessellation_hull"] = ID_TESSELLATION_HULL;
 1134|      1|        mIds["tessellation_domain"] = ID_TESSELLATION_DOMAIN;
 1135|      1|        mIds["compute"] = ID_COMPUTE;
 1136|      1|        mIds["content_type"] = ID_CONTENT_TYPE;
 1137|      1|        mIds["named"] = ID_NAMED;
 1138|      1|        mIds["shadow"] = ID_SHADOW;
 1139|      1|        mIds["texture_source"] = ID_TEXTURE_SOURCE;
 1140|      1|        mIds["shared_params"] = ID_SHARED_PARAMS;
 1141|      1|        mIds["shared_param_named"] = ID_SHARED_PARAM_NAMED;
 1142|      1|        mIds["shared_params_ref"] = ID_SHARED_PARAMS_REF;
 1143|      1|        mIds["use_linear_colours"] = ID_USE_LINEAR_COLOURS;
 1144|       |
 1145|       |        // Particle system
 1146|      1|        mIds["particle_system"] = ID_PARTICLE_SYSTEM;
 1147|      1|        mIds["emitter"] = ID_EMITTER;
 1148|      1|        mIds["affector"] = ID_AFFECTOR;
 1149|       |
 1150|       |        // Compositor
 1151|      1|        mIds["compositor"] = ID_COMPOSITOR;
 1152|      1|        mIds["target"] = ID_TARGET;
 1153|      1|        mIds["target_output"] = ID_TARGET_OUTPUT;
 1154|       |
 1155|      1|        mIds["input"] = ID_INPUT;
 1156|       |        //mIds["none"] = ID_NONE; - already registered
 1157|      1|        mIds["previous"] = ID_PREVIOUS;
 1158|      1|        mIds["target_width"] = ID_TARGET_WIDTH;
 1159|      1|        mIds["target_height"] = ID_TARGET_HEIGHT;
 1160|      1|        mIds["target_width_scaled"] = ID_TARGET_WIDTH_SCALED;
 1161|      1|        mIds["target_height_scaled"] = ID_TARGET_HEIGHT_SCALED;
 1162|      1|        mIds["pooled"] = ID_POOLED;
 1163|       |        //mIds["gamma"] = ID_GAMMA; - already registered
 1164|      1|        mIds["no_fsaa"] = ID_NO_FSAA;
 1165|      1|        mIds["fsaa"] = ID_FSAA;
 1166|      1|        mIds["depth_pool"] = ID_DEPTH_POOL;
 1167|       |
 1168|      1|        mIds["texture_ref"] = ID_TEXTURE_REF;
 1169|      1|        mIds["local_scope"] = ID_SCOPE_LOCAL;
 1170|      1|        mIds["chain_scope"] = ID_SCOPE_CHAIN;
 1171|      1|        mIds["global_scope"] = ID_SCOPE_GLOBAL;
 1172|      1|        mIds["compositor_logic"] = ID_COMPOSITOR_LOGIC;
 1173|       |
 1174|      1|        mIds["only_initial"] = ID_ONLY_INITIAL;
 1175|      1|        mIds["visibility_mask"] = ID_VISIBILITY_MASK;
 1176|      1|        mIds["lod_bias"] = ID_LOD_BIAS;
 1177|      1|        mIds["material_scheme"] = ID_MATERIAL_SCHEME;
 1178|      1|        mIds["shadows"] = ID_SHADOWS_ENABLED;
 1179|       |
 1180|      1|        mIds["clear"] = ID_CLEAR;
 1181|      1|        mIds["stencil"] = ID_STENCIL;
 1182|      1|        mIds["render_scene"] = ID_RENDER_SCENE;
 1183|      1|        mIds["render_quad"] = ID_RENDER_QUAD;
 1184|      1|        mIds["identifier"] = ID_IDENTIFIER;
 1185|      1|        mIds["first_render_queue"] = ID_FIRST_RENDER_QUEUE;
 1186|      1|        mIds["last_render_queue"] = ID_LAST_RENDER_QUEUE;
 1187|      1|        mIds["quad_normals"] = ID_QUAD_NORMALS;
 1188|      1|        mIds["camera_far_corners_view_space"] = ID_CAMERA_FAR_CORNERS_VIEW_SPACE;
 1189|      1|        mIds["camera_far_corners_world_space"] = ID_CAMERA_FAR_CORNERS_WORLD_SPACE;
 1190|       |
 1191|      1|        mIds["buffers"] = ID_BUFFERS;
 1192|      1|        mIds["colour"] = ID_COLOUR;
 1193|      1|        mIds["depth"] = ID_DEPTH;
 1194|      1|        mIds["colour_value"] = ID_COLOUR_VALUE;
 1195|      1|        mIds["depth_value"] = ID_DEPTH_VALUE;
 1196|      1|        mIds["stencil_value"] = ID_STENCIL_VALUE;
 1197|       |
 1198|      1|        mIds["check"] = ID_CHECK;
 1199|      1|        mIds["comp_func"] = ID_COMP_FUNC;
 1200|      1|        mIds["ref_value"] = ID_REF_VALUE;
 1201|      1|        mIds["mask"] = ID_MASK;
 1202|      1|        mIds["fail_op"] = ID_FAIL_OP;
 1203|      1|        mIds["keep"] = ID_KEEP;
 1204|      1|        mIds["increment"] = ID_INCREMENT;
 1205|      1|        mIds["decrement"] = ID_DECREMENT;
 1206|      1|        mIds["increment_wrap"] = ID_INCREMENT_WRAP;
 1207|      1|        mIds["decrement_wrap"] = ID_DECREMENT_WRAP;
 1208|      1|        mIds["invert"] = ID_INVERT;
 1209|      1|        mIds["depth_fail_op"] = ID_DEPTH_FAIL_OP;
 1210|      1|        mIds["pass_op"] = ID_PASS_OP;
 1211|      1|        mIds["two_sided"] = ID_TWO_SIDED;
 1212|       |
 1213|      1|        mIds["line_width"] = ID_LINE_WIDTH;
 1214|      1|        mIds["sampler"] = ID_SAMPLER;
 1215|      1|        mIds["sampler_ref"] = ID_SAMPLER_REF;
 1216|      1|        mIds["thread_groups"] = ID_THREAD_GROUPS;
 1217|      1|        mIds["render_custom"] = ID_RENDER_CUSTOM;
 1218|      1|        mIds["auto"] = ID_AUTO;
 1219|      1|        mIds["camera"] = ID_CAMERA;
 1220|      1|        mIds["align_to_face"] = ID_ALIGN_TO_FACE;
 1221|      1|        mIds["unordered_access_mip"] = ID_UNORDERED_ACCESS_MIP;
 1222|       |
 1223|      1|		mLargestRegisteredWordId = ID_END_BUILTIN_IDS;
 1224|      1|	}
_ZN4Ogre21ScriptCompilerManagerC2Ev:
 1537|      1|    {
 1538|      1|            OGRE_LOCK_AUTO_MUTEX;
 1539|      1|        mScriptPatterns.push_back("*.program");
 1540|      1|        mScriptPatterns.push_back("*.material");
 1541|      1|        mScriptPatterns.push_back("*.particle");
 1542|      1|        mScriptPatterns.push_back("*.compositor");
 1543|      1|        mScriptPatterns.push_back("*.os");
 1544|      1|        ResourceGroupManager::getSingleton()._registerScriptLoader(this);
 1545|       |
 1546|       |        mBuiltinTranslatorManager = OGRE_NEW BuiltinScriptTranslatorManager();
 1547|      1|        mManagers.push_back(mBuiltinTranslatorManager);
 1548|      1|    }
_ZN4Ogre21ScriptCompilerManagerD2Ev:
 1551|      1|    {
 1552|       |        OGRE_DELETE mBuiltinTranslatorManager;
 1553|      1|    }
_ZNK4Ogre21ScriptCompilerManager15getLoadingOrderEv:
 1624|      1|    {
 1625|       |        /// Load relatively early, before most script loaders run
 1626|      1|        return 90.0f;
 1627|      1|    }

_ZN4Ogre18MaterialTranslatorC2Ev:
 1016|      1|    {
 1017|      1|    }
_ZN4Ogre19TechniqueTranslatorC2Ev:
 1157|      1|        :mTechnique(0)
 1158|      1|    {
 1159|      1|    }
_ZN4Ogre14PassTranslatorC2Ev:
 1335|      1|        :mPass(0)
 1336|      1|    {
 1337|      1|    }
_ZN4Ogre21TextureUnitTranslatorC2Ev:
 2312|      1|        :mUnit(0)
 2313|      1|    {
 2314|      1|    }
_ZN4Ogre23TextureSourceTranslatorC2Ev:
 3320|      1|    {
 3321|      1|    }
_ZN4Ogre20GpuProgramTranslatorC2Ev:
 3406|      1|    {
 3407|      1|    }
_ZN4Ogre22SharedParamsTranslatorC2Ev:
 4090|      1|    {
 4091|      1|    }
_ZN4Ogre24ParticleSystemTranslatorC2Ev:
 4260|      1|        :mSystem(0)
 4261|      1|    {
 4262|      1|    }
_ZN4Ogre25ParticleEmitterTranslatorC2Ev:
 4359|      1|        :mEmitter(0)
 4360|      1|    {
 4361|      1|    }
_ZN4Ogre26ParticleAffectorTranslatorC2Ev:
 4426|      1|        :mAffector(0)
 4427|      1|    {
 4428|      1|    }
_ZN4Ogre20CompositorTranslatorC2Ev:
 4492|      1|        :mCompositor(0)
 4493|      1|    {
 4494|      1|    }
_ZN4Ogre30CompositionTechniqueTranslatorC2Ev:
 4543|      1|        :mTechnique(0)
 4544|      1|    {
 4545|      1|    }
_ZN4Ogre31CompositionTargetPassTranslatorC2Ev:
 4824|      1|        :mTarget(0)
 4825|      1|    {
 4826|      1|    }
_ZN4Ogre25CompositionPassTranslatorC2Ev:
 4914|      1|        :mPass(0)
 4915|      1|    {
 4916|      1|    }
_ZN4Ogre30BuiltinScriptTranslatorManagerC2Ev:
 5213|      1|    {
 5214|      1|    }

_ZN4Ogre20ShadowTextureManagerC2Ev:
   64|      1|        : mCount(0)
   65|      1|    {
   66|       |
   67|      1|    }
_ZN4Ogre20ShadowTextureManagerD2Ev:
   70|      1|    {
   71|      1|        clear();
   72|      1|    }
_ZN4Ogre20ShadowTextureManager5clearEv:
  193|      1|    {
  194|      1|        for (auto & i : mTextureList)
  ------------------
  |  Branch (194:23): [True: 0, False: 1]
  ------------------
  195|      0|        {
  196|      0|            TextureManager::getSingleton().remove(i->getHandle());
  197|      0|        }
  198|      1|        mTextureList.clear();
  199|       |
  200|      1|    }

_ZN4Ogre26ShadowVolumeExtrudeProgram8shutdownEv:
   78|      1|    {
   79|      1|        mPrograms.clear();
   80|      1|    }

_ZN4Ogre15SkeletonManagerC2Ev:
   45|      1|    {
   46|      1|        mLoadOrder = 300.0f;
   47|      1|        mResourceType = "Skeleton";
   48|       |
   49|      1|        ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
   50|      1|    }
_ZN4Ogre15SkeletonManagerD2Ev:
   65|      1|    {
   66|      1|        ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType);
   67|      1|    }

_ZN4Ogre16StreamSerialiser14makeIdentifierERA5_Kc:
  146|      2|    {
  147|      2|        uint32 ret = 0;
  148|     10|        for (size_t i = 0; i < 4; ++i)
  ------------------
  |  Branch (148:28): [True: 8, False: 2]
  ------------------
  149|      8|        {
  150|      8|            ret += (code[i] << (i * 8));
  151|      8|        }
  152|      2|        return ret;
  153|       |
  154|      2|    }

_ZN4Ogre10StringUtil4trimERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbb:
   42|  4.69k|    {
   43|       |        /*
   44|       |        size_t lspaces, rspaces, len = length(), i;
   45|       |
   46|       |        lspaces = rspaces = 0;
   47|       |
   48|       |        if( left )
   49|       |        {
   50|       |            // Find spaces / tabs on the left
   51|       |            for( i = 0;
   52|       |                i < len && ( at(i) == ' ' || at(i) == '\t' || at(i) == '\r');
   53|       |                ++lspaces, ++i );
   54|       |        }
   55|       |        
   56|       |        if( right && lspaces < len )
   57|       |        {
   58|       |            // Find spaces / tabs on the right
   59|       |            for( i = len - 1;
   60|       |                i >= 0 && ( at(i) == ' ' || at(i) == '\t' || at(i) == '\r');
   61|       |                rspaces++, i-- );
   62|       |        }
   63|       |
   64|       |        *this = substr(lspaces, len-lspaces-rspaces);
   65|       |        */
   66|  4.69k|        static const String delims = " \t\r\n";
   67|  4.69k|        if(right)
  ------------------
  |  Branch (67:12): [True: 4.69k, False: 0]
  ------------------
   68|  4.69k|            str.erase(str.find_last_not_of(delims)+1); // trim right
   69|  4.69k|        if(left)
  ------------------
  |  Branch (69:12): [True: 4.69k, False: 0]
  ------------------
   70|  4.69k|            str.erase(0, str.find_first_not_of(delims)); // trim left
   71|  4.69k|    }
_ZN4Ogre10StringUtil5splitERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_jb:
   75|  4.69k|    {
   76|  4.69k|        StringVector ret;
   77|       |        // Pre-allocate some space for performance
   78|  4.69k|        ret.reserve(maxSplits ? maxSplits+1 : 10);    // 10 is guessed capacity for most case
  ------------------
  |  Branch (78:21): [True: 0, False: 4.69k]
  ------------------
   79|       |
   80|  4.69k|        unsigned int numSplits = 0;
   81|       |
   82|       |        // Use STL methods 
   83|  4.69k|        size_t start, pos;
   84|  4.69k|        start = 0;
   85|  4.69k|        do 
   86|  51.6k|        {
   87|  51.6k|            pos = str.find_first_of(delims, start);
   88|  51.6k|            if (pos == start)
  ------------------
  |  Branch (88:17): [True: 0, False: 51.6k]
  ------------------
   89|      0|            {
   90|       |                // Do nothing
   91|      0|                start = pos + 1;
   92|      0|            }
   93|  51.6k|            else if (pos == String::npos || (maxSplits && numSplits == maxSplits))
  ------------------
  |  Branch (93:22): [True: 4.69k, False: 46.9k]
  |  Branch (93:46): [True: 0, False: 46.9k]
  |  Branch (93:59): [True: 0, False: 0]
  ------------------
   94|  4.69k|            {
   95|       |                // Copy the rest of the string
   96|  4.69k|                ret.push_back( str.substr(start) );
   97|  4.69k|                break;
   98|  4.69k|            }
   99|  46.9k|            else
  100|  46.9k|            {
  101|       |                // Copy up to delimiter
  102|  46.9k|                ret.push_back( str.substr(start, pos - start) );
  103|       |
  104|  46.9k|                if(preserveDelims)
  ------------------
  |  Branch (104:20): [True: 0, False: 46.9k]
  ------------------
  105|      0|                {
  106|       |                    // Sometimes there could be more than one delimiter in a row.
  107|       |                    // Loop until we don't find any more delims
  108|      0|                    size_t delimStart = pos, delimPos;
  109|      0|                    delimPos = str.find_first_not_of(delims, delimStart);
  110|      0|                    if (delimPos == String::npos)
  ------------------
  |  Branch (110:25): [True: 0, False: 0]
  ------------------
  111|      0|                    {
  112|       |                        // Copy the rest of the string
  113|      0|                        ret.push_back( str.substr(delimStart) );
  114|      0|                    }
  115|      0|                    else
  116|      0|                    {
  117|      0|                        ret.push_back( str.substr(delimStart, delimPos - delimStart) );
  118|      0|                    }
  119|      0|                }
  120|       |
  121|  46.9k|                start = pos + 1;
  122|  46.9k|            }
  123|       |            // parse up to next real data
  124|  46.9k|            start = str.find_first_not_of(delims, start);
  125|  46.9k|            ++numSplits;
  126|       |
  127|  46.9k|        } while (pos != String::npos);
  ------------------
  |  Branch (127:18): [True: 46.9k, False: 0]
  ------------------
  128|       |
  129|       |
  130|       |
  131|  4.69k|        return ret;
  132|  4.69k|    }
_ZN4Ogre10StringUtil11toLowerCaseERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  203|  5.37k|    {
  204|  5.37k|        std::transform(
  205|  5.37k|            str.begin(),
  206|  5.37k|            str.end(),
  207|  5.37k|            str.begin(),
  208|  5.37k|            tolower);
  209|  5.37k|    }
_ZN4Ogre10StringUtil17splitBaseFilenameERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERS7_SA_:
  382|    677|    {
  383|    677|        size_t i = fullName.find_last_of('.');
  384|    677|        if (i == Ogre::String::npos)
  ------------------
  |  Branch (384:13): [True: 0, False: 677]
  ------------------
  385|      0|        {
  386|      0|            outExtention.clear();
  387|      0|            outBasename = fullName;
  388|      0|        }
  389|    677|        else
  390|    677|        {
  391|    677|            outExtention = fullName.substr(i+1);
  392|    677|            outBasename = fullName.substr(0, i);
  393|    677|        }
  394|    677|    }

_ZN4Ogre15StringInterface17cleanupDictionaryEv:
  167|      1|    {
  168|      1|            OGRE_LOCK_MUTEX( msDictionaryMutex );
  169|       |
  170|      1|        msDictionary.clear();
  171|      1|    }

_ZN4Ogre7SamplerC2Ev:
   40|      2|        : mBorderColour(ColourValue::Black)
   41|      2|        , mMaxAniso(1)
   42|      2|        , mMipmapBias(0)
   43|      2|        , mMinFilter(FO_LINEAR)
   44|      2|        , mMagFilter(FO_LINEAR)
   45|      2|        , mMipFilter(FO_POINT)
   46|      2|        , mCompareFunc(CMPF_GREATER_EQUAL)
   47|      2|        , mCompareEnabled(false)
   48|      2|        , mDirty(true)
   49|      2|    {
   50|      2|        setAddressingMode(TAM_WRAP);
   51|      2|    }
_ZN4Ogre7Sampler17setAddressingModeERKNS0_17UVWAddressingModeE:
   55|      2|    {
   56|      2|        mAddressMode = uvw;
   57|      2|        mDirty = true;
   58|      2|    }

_ZN4Ogre5TimerC2Ev:
   36|      1|{
   37|      1|    reset();
   38|      1|}
_ZN4Ogre5Timer5resetEv:
   42|      1|{
   43|      1|    zeroClock = clock();
   44|      1|    start = steady_clock::now();
   45|      1|}

_ZN4Ogre33UnifiedHighLevelGpuProgramFactoryC2Ev:
  408|      1|    {
  409|      1|    }
_ZN4Ogre33UnifiedHighLevelGpuProgramFactoryD2Ev:
  412|      1|    {
  413|      1|    }
_ZNK4Ogre33UnifiedHighLevelGpuProgramFactory11getLanguageEv:
  416|      1|    {
  417|      1|        return sLanguage;
  418|      1|    }

_ZN4Ogre20DefaultWorkQueueBaseC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   65|      1|        : mName(name)
   66|      1|        , mWorkerThreadCount(1)
   67|      1|        , mWorkerRenderSystemAccess(false)
   68|      1|        , mIsRunning(false)
   69|      1|        , mResposeTimeLimitMS(10)
   70|      1|        , mPaused(false)
   71|      1|        , mAcceptRequests(true)
   72|      1|        , mShuttingDown(false)
   73|      1|    {
   74|      1|    }
_ZN4Ogre20DefaultWorkQueueBase31setWorkersCanAccessRenderSystemEb:
   87|      1|    {
   88|      1|        mWorkerRenderSystemAccess = access;
   89|      1|    }
_ZN4Ogre20DefaultWorkQueueBaseD2Ev:
   92|      1|    {
   93|       |        //shutdown(); // can't call here; abstract function
   94|      1|    }

_ZNK4Ogre17ZipArchiveFactory7getTypeEv:
  329|      2|    {
  330|      2|        static String name = "Zip";
  331|      2|        return name;
  332|      2|    }
_ZN4Ogre25EmbeddedZipArchiveFactoryC2Ev:
  356|      1|    EmbeddedZipArchiveFactory::EmbeddedZipArchiveFactory() {}
_ZN4Ogre25EmbeddedZipArchiveFactoryD2Ev:
  357|      1|    EmbeddedZipArchiveFactory::~EmbeddedZipArchiveFactory() {}
_ZNK4Ogre25EmbeddedZipArchiveFactory7getTypeEv:
  376|      2|    {
  377|      2|        static String name = "EmbeddedZip";
  378|      2|        return name;
  379|      2|    }

_ZN4Ogre14STBIImageCodecD2Ev:
   57|  51.6k|        virtual ~STBIImageCodec() { }

_ZN4Ogre14STBIImageCodec7startupEv:
   76|  4.69k|    {
   77|  4.69k|        stbi_convert_iphone_png_to_rgb(1);
   78|  4.69k|        stbi_set_unpremultiply_on_load(1);
   79|       |
   80|  4.69k|        LogManager::getSingleton().logMessage("stb_image - v2.30 - public domain image loader");
   81|       |        
   82|       |        // Register codecs
   83|  4.69k|        String exts = "jpeg,jpg,png,bmp,psd,tga,gif,pic,ppm,pgm,hdr";
   84|  4.69k|        StringVector extsVector = StringUtil::split(exts, ",");
   85|  4.69k|        for (auto & v : extsVector)
  ------------------
  |  Branch (85:23): [True: 51.6k, False: 4.69k]
  ------------------
   86|  51.6k|        {
   87|  51.6k|            ImageCodec* codec = OGRE_NEW STBIImageCodec(v);
  ------------------
  |  |  201|  51.6k|#   define OGRE_NEW new 
  ------------------
   88|  51.6k|            msCodecList.push_back(codec);
   89|  51.6k|            Codec::registerCodec(codec);
   90|  51.6k|        }
   91|       |
   92|  4.69k|        LogManager::getSingleton().logMessage("Supported formats: " + exts);
   93|  4.69k|    }
_ZN4Ogre14STBIImageCodec8shutdownEv:
   96|  4.69k|    {
   97|  4.69k|        for (auto & i : msCodecList)
  ------------------
  |  Branch (97:23): [True: 51.6k, False: 4.69k]
  ------------------
   98|  51.6k|        {
   99|  51.6k|            Codec::unregisterCodec(i);
  100|  51.6k|            OGRE_DELETE i;
  ------------------
  |  |  202|  51.6k|#   define OGRE_DELETE delete
  ------------------
  101|  51.6k|        }
  102|  4.69k|        msCodecList.clear();
  103|  4.69k|    }
_ZN4Ogre14STBIImageCodecC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  106|  51.6k|        mType(type)
  107|  51.6k|    { 
  108|  51.6k|    }
_ZNK4Ogre14STBIImageCodec6encodeERKNS_3AnyE:
  111|    677|    {
  112|    677|        if(mType != "png") {
  ------------------
  |  Branch (112:12): [True: 0, False: 677]
  ------------------
  113|      0|            OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED,
  ------------------
  |  |  291|      0|#define OGRE_EXCEPT(...) OGRE_EXPAND(OGRE_EXCEPT_CHOOSER(__VA_ARGS__, OGRE_EXCEPT_3, OGRE_EXCEPT_2)(__VA_ARGS__))
  |  |  ------------------
  |  |  |  |  290|      0|#define OGRE_EXPAND(x) x // MSVC workaround
  |  |  ------------------
  ------------------
  114|      0|                        "currently only encoding to PNG supported",
  115|      0|                        "STBIImageCodec::encode" ) ;
  116|      0|        }
  117|       |
  118|    677|        Image* image = any_cast<Image*>(input);
  119|    677|        PixelFormat format = image->getFormat();
  120|    677|        uchar* inputData = image->getData();
  121|       |
  122|       |        // Convert image data to ABGR format for STBI (unless it's already compatible)
  123|    677|        uchar* tempData = 0;
  124|    677|        if(format != Ogre::PF_A8B8G8R8 && format != PF_B8G8R8 && format != PF_BYTE_LA && 
  ------------------
  |  Branch (124:12): [True: 534, False: 143]
  |  Branch (124:43): [True: 224, False: 310]
  |  Branch (124:66): [True: 216, False: 8]
  ------------------
  125|    216|            format != PF_L8 && format != PF_R8)
  ------------------
  |  Branch (125:13): [True: 0, False: 216]
  |  Branch (125:32): [True: 0, False: 0]
  ------------------
  126|      0|        {   
  127|      0|            format = Ogre::PF_A8B8G8R8;
  128|      0|            size_t tempDataSize = PixelUtil::getMemorySize(image->getWidth(), image->getHeight(), 1, format);
  129|      0|            tempData = OGRE_ALLOC_T(unsigned char, tempDataSize, Ogre::MEMCATEGORY_GENERAL);
  ------------------
  |  |  181|      0|#   define OGRE_ALLOC_T(T, count, category) (T*)new char[(count) * sizeof(T)]
  ------------------
  130|      0|            Ogre::PixelBox pbOut(image->getPixelBox(), format, tempData);
  131|      0|            PixelUtil::bulkPixelConversion(image->getPixelBox(), pbOut);
  132|       |
  133|      0|            inputData = tempData;
  134|      0|        }
  135|       |
  136|       |        // Save to PNG
  137|    677|        int channels = PixelUtil::getComponentCount(format);
  138|    677|        int len;
  139|    677|        uchar* data = stbi_write_png_to_mem(inputData, image->getRowSpan(), image->getWidth(), image->getHeight(), channels, &len);
  140|       |
  141|    677|        if(tempData)
  ------------------
  |  Branch (141:12): [True: 0, False: 677]
  ------------------
  142|      0|        {
  143|      0|            OGRE_FREE(tempData, MEMCATEGORY_GENERAL);
  ------------------
  |  |  183|      0|#   define OGRE_FREE(ptr, category) delete[] (char*)ptr
  ------------------
  144|      0|        }
  145|       |
  146|    677|        if (!data) {
  ------------------
  |  Branch (146:13): [True: 0, False: 677]
  ------------------
  147|      0|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,
  ------------------
  |  |  291|      0|#define OGRE_EXCEPT(...) OGRE_EXPAND(OGRE_EXCEPT_CHOOSER(__VA_ARGS__, OGRE_EXCEPT_3, OGRE_EXCEPT_2)(__VA_ARGS__))
  |  |  ------------------
  |  |  |  |  290|      0|#define OGRE_EXPAND(x) x // MSVC workaround
  |  |  ------------------
  ------------------
  148|      0|                "Error encoding image: " + String(stbi_failure_reason()),
  149|      0|                "STBIImageCodec::encode");
  150|      0|        }
  151|       |
  152|    677|        return DataStreamPtr(new MemoryDataStream(data, len, true));
  153|    677|    }
_ZNK4Ogre14STBIImageCodec12encodeToFileERKNS_3AnyERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  156|    677|    {
  157|    677|#if OGRE_PLATFORM != OGRE_PLATFORM_EMSCRIPTEN
  158|    677|        MemoryDataStreamPtr data = static_pointer_cast<MemoryDataStream>(encode(input));
  159|    677|        std::ofstream f(outFileName.c_str(), std::ios::out | std::ios::binary);
  160|       |
  161|    677|        if (!f.is_open())
  ------------------
  |  Branch (161:13): [True: 0, False: 677]
  ------------------
  162|      0|        {
  163|      0|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "could not open file " + outFileName);
  ------------------
  |  |  291|      0|#define OGRE_EXCEPT(...) OGRE_EXPAND(OGRE_EXCEPT_CHOOSER(__VA_ARGS__, OGRE_EXCEPT_3, OGRE_EXCEPT_2)(__VA_ARGS__))
  |  |  ------------------
  |  |  |  |  290|      0|#define OGRE_EXPAND(x) x // MSVC workaround
  |  |  ------------------
  ------------------
  164|      0|        }
  165|       |
  166|    677|        f.write((char*)data->getPtr(), data->size());
  167|    677|#endif
  168|    677|    }
_ZNK4Ogre14STBIImageCodec6decodeERKNS_9SharedPtrINS_10DataStreamEEERKNS_3AnyE:
  171|  4.69k|    {
  172|  4.69k|        auto image = any_cast<Image*>(output);
  173|  4.69k|        String contents = input->getAsString();
  174|       |
  175|  4.69k|        int width, height, components;
  176|  4.69k|        stbi_uc* pixelData = stbi_load_from_memory((const uchar*)contents.data(),
  177|  4.69k|                static_cast<int>(contents.size()), &width, &height, &components, 0);
  178|       |
  179|  4.69k|        if (!pixelData)
  ------------------
  |  Branch (179:13): [True: 3.55k, False: 1.14k]
  ------------------
  180|  3.55k|        {
  181|  3.55k|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
  ------------------
  |  |  291|  3.55k|#define OGRE_EXCEPT(...) OGRE_EXPAND(OGRE_EXCEPT_CHOOSER(__VA_ARGS__, OGRE_EXCEPT_3, OGRE_EXCEPT_2)(__VA_ARGS__))
  |  |  ------------------
  |  |  |  |  290|  3.55k|#define OGRE_EXPAND(x) x // MSVC workaround
  |  |  ------------------
  ------------------
  182|  3.55k|                "Error decoding image: " + String(stbi_failure_reason()),
  183|  3.55k|                "STBIImageCodec::decode");
  184|  3.55k|        }
  185|       |
  186|  1.14k|        if (width <= 0 || height <= 0)
  ------------------
  |  Branch (186:13): [True: 0, False: 1.14k]
  |  Branch (186:27): [True: 0, False: 1.14k]
  ------------------
  187|      0|        {
  188|      0|            stbi_image_free(pixelData);
  189|      0|            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
  ------------------
  |  |  291|      0|#define OGRE_EXCEPT(...) OGRE_EXPAND(OGRE_EXCEPT_CHOOSER(__VA_ARGS__, OGRE_EXCEPT_3, OGRE_EXCEPT_2)(__VA_ARGS__))
  |  |  ------------------
  |  |  |  |  290|      0|#define OGRE_EXPAND(x) x // MSVC workaround
  |  |  ------------------
  ------------------
  190|      0|                        StringUtil::format("Image has invalid dimensions: %dx%d", width, height));
  191|      0|        }
  192|       |
  193|  1.14k|        PixelFormat format = PF_UNKNOWN;
  194|  1.14k|        switch( components )
  195|  1.14k|        {
  196|    316|            case 1:
  ------------------
  |  Branch (196:13): [True: 316, False: 824]
  ------------------
  197|    316|                format = PF_BYTE_L;
  198|    316|                break;
  199|      9|            case 2:
  ------------------
  |  Branch (199:13): [True: 9, False: 1.13k]
  ------------------
  200|      9|                format = PF_BYTE_LA;
  201|      9|                break;
  202|    552|            case 3:
  ------------------
  |  Branch (202:13): [True: 552, False: 588]
  ------------------
  203|    552|                format = PF_BYTE_RGB;
  204|    552|                break;
  205|    263|            case 4:
  ------------------
  |  Branch (205:13): [True: 263, False: 877]
  ------------------
  206|    263|                format = PF_BYTE_RGBA;
  207|    263|                break;
  208|      0|            default:
  ------------------
  |  Branch (208:13): [True: 0, False: 1.14k]
  ------------------
  209|      0|                stbi_image_free(pixelData);
  210|      0|                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Only 1..4 channels supported");
  ------------------
  |  |  291|      0|#define OGRE_EXCEPT(...) OGRE_EXPAND(OGRE_EXCEPT_CHOOSER(__VA_ARGS__, OGRE_EXCEPT_3, OGRE_EXCEPT_2)(__VA_ARGS__))
  |  |  ------------------
  |  |  |  |  290|      0|#define OGRE_EXPAND(x) x // MSVC workaround
  |  |  ------------------
  ------------------
  211|      0|                break;
  212|  1.14k|        }
  213|       |        
  214|  1.14k|        image->loadDynamicImage(pixelData, width, height, 1, format, true);
  215|  1.14k|    }
_ZNK4Ogre14STBIImageCodec7getTypeEv:
  218|   103k|    {
  219|   103k|        return mType;
  220|   103k|    }

OgreSTBICodec.cpp:_ZL30stbi_convert_iphone_png_to_rgbi:
 5002|  4.69k|{
 5003|  4.69k|   stbi__de_iphone_flag_global = flag_true_if_should_convert;
 5004|  4.69k|}
OgreSTBICodec.cpp:_ZL30stbi_set_unpremultiply_on_loadi:
 4997|  4.69k|{
 4998|  4.69k|   stbi__unpremultiply_on_load_global = flag_true_if_should_unpremultiply;
 4999|  4.69k|}
OgreSTBICodec.cpp:_ZL19stbi_failure_reasonv:
  973|  3.55k|{
  974|  3.55k|   return stbi__g_failure_reason;
  975|  3.55k|}
OgreSTBICodec.cpp:_ZL21stbi_load_from_memoryPKhiPiS1_S1_i:
 1430|  4.69k|{
 1431|  4.69k|   stbi__context s;
 1432|  4.69k|   stbi__start_mem(&s,buffer,len);
 1433|  4.69k|   return stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp);
 1434|  4.69k|}
OgreSTBICodec.cpp:_ZL15stbi__start_memP13stbi__contextPKhi:
  827|  4.69k|{
  828|       |   s->io.read = NULL;
  829|  4.69k|   s->read_from_callbacks = 0;
  830|  4.69k|   s->callback_already_read = 0;
  831|  4.69k|   s->img_buffer = s->img_buffer_original = (stbi_uc *) buffer;
  832|  4.69k|   s->img_buffer_end = s->img_buffer_original_end = (stbi_uc *) buffer+len;
  833|  4.69k|}
OgreSTBICodec.cpp:_ZL31stbi__load_and_postprocess_8bitP13stbi__contextPiS1_S1_i:
 1261|  4.69k|{
 1262|  4.69k|   stbi__result_info ri;
 1263|  4.69k|   void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 8);
 1264|       |
 1265|  4.69k|   if (result == NULL)
  ------------------
  |  Branch (1265:8): [True: 3.55k, False: 1.14k]
  ------------------
 1266|  3.55k|      return NULL;
 1267|       |
 1268|       |   // it is the responsibility of the loaders to make sure we get either 8 or 16 bit.
 1269|  1.14k|   STBI_ASSERT(ri.bits_per_channel == 8 || ri.bits_per_channel == 16);
  ------------------
  |  |  603|  1.14k|#define STBI_ASSERT(x) assert(x)
  ------------------
 1270|       |
 1271|  1.14k|   if (ri.bits_per_channel != 8) {
  ------------------
  |  Branch (1271:8): [True: 55, False: 1.08k]
  ------------------
 1272|     55|      result = stbi__convert_16_to_8((stbi__uint16 *) result, *x, *y, req_comp == 0 ? *comp : req_comp);
  ------------------
  |  Branch (1272:71): [True: 55, False: 0]
  ------------------
 1273|     55|      ri.bits_per_channel = 8;
 1274|     55|   }
 1275|       |
 1276|       |   // @TODO: move stbi__convert_format to here
 1277|       |
 1278|  1.14k|   if (stbi__vertically_flip_on_load) {
  ------------------
  |  | 1132|  1.14k|#define stbi__vertically_flip_on_load  (stbi__vertically_flip_on_load_set       \
  |  |  ------------------
  |  |  |  Branch (1132:40): [True: 0, False: 1.14k]
  |  |  |  Branch (1132:41): [True: 0, False: 1.14k]
  |  |  ------------------
  |  | 1133|  1.14k|                                         ? stbi__vertically_flip_on_load_local  \
  |  | 1134|  1.14k|                                         : stbi__vertically_flip_on_load_global)
  ------------------
 1279|      0|      int channels = req_comp ? req_comp : *comp;
  ------------------
  |  Branch (1279:22): [True: 0, False: 0]
  ------------------
 1280|      0|      stbi__vertical_flip(result, *x, *y, channels * sizeof(stbi_uc));
 1281|      0|   }
 1282|       |
 1283|  1.14k|   return (unsigned char *) result;
 1284|  4.69k|}
OgreSTBICodec.cpp:_ZL15stbi__load_mainP13stbi__contextPiS1_S1_iP17stbi__result_infoi:
 1138|  4.69k|{
 1139|  4.69k|   memset(ri, 0, sizeof(*ri)); // make sure it's initialized if we add new fields
 1140|  4.69k|   ri->bits_per_channel = 8; // default is 8 so most paths don't have to be changed
 1141|  4.69k|   ri->channel_order = STBI_ORDER_RGB; // all current input & output are this, but this is here so we can add BGR order
 1142|  4.69k|   ri->num_channels = 0;
 1143|       |
 1144|       |   // test the formats with a very explicit header first (at least a FOURCC
 1145|       |   // or distinctive magic number first)
 1146|  4.69k|   #ifndef STBI_NO_PNG
 1147|  4.69k|   if (stbi__png_test(s))  return stbi__png_load(s,x,y,comp,req_comp, ri);
  ------------------
  |  Branch (1147:8): [True: 981, False: 3.71k]
  ------------------
 1148|  3.71k|   #endif
 1149|  3.71k|   #ifndef STBI_NO_BMP
 1150|  3.71k|   if (stbi__bmp_test(s))  return stbi__bmp_load(s,x,y,comp,req_comp, ri);
  ------------------
  |  Branch (1150:8): [True: 533, False: 3.18k]
  ------------------
 1151|  3.18k|   #endif
 1152|  3.18k|   #ifndef STBI_NO_GIF
 1153|  3.18k|   if (stbi__gif_test(s))  return stbi__gif_load(s,x,y,comp,req_comp, ri);
  ------------------
  |  Branch (1153:8): [True: 252, False: 2.92k]
  ------------------
 1154|  2.92k|   #endif
 1155|  2.92k|   #ifndef STBI_NO_PSD
 1156|  2.92k|   if (stbi__psd_test(s))  return stbi__psd_load(s,x,y,comp,req_comp, ri, bpc);
  ------------------
  |  Branch (1156:8): [True: 260, False: 2.66k]
  ------------------
 1157|       |   #else
 1158|       |   STBI_NOTUSED(bpc);
 1159|       |   #endif
 1160|  2.66k|   #ifndef STBI_NO_PIC
 1161|  2.66k|   if (stbi__pic_test(s))  return stbi__pic_load(s,x,y,comp,req_comp, ri);
  ------------------
  |  Branch (1161:8): [True: 150, False: 2.51k]
  ------------------
 1162|  2.51k|   #endif
 1163|       |
 1164|       |   // then the formats that can end up attempting to load with just 1 or 2
 1165|       |   // bytes matching expectations; these are prone to false positives, so
 1166|       |   // try them later
 1167|  2.51k|   #ifndef STBI_NO_JPEG
 1168|  2.51k|   if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp, ri);
  ------------------
  |  Branch (1168:8): [True: 1.37k, False: 1.14k]
  ------------------
 1169|  1.14k|   #endif
 1170|  1.14k|   #ifndef STBI_NO_PNM
 1171|  1.14k|   if (stbi__pnm_test(s))  return stbi__pnm_load(s,x,y,comp,req_comp, ri);
  ------------------
  |  Branch (1171:8): [True: 350, False: 790]
  ------------------
 1172|    790|   #endif
 1173|       |
 1174|    790|   #ifndef STBI_NO_HDR
 1175|    790|   if (stbi__hdr_test(s)) {
  ------------------
  |  Branch (1175:8): [True: 296, False: 494]
  ------------------
 1176|    296|      float *hdr = stbi__hdr_load(s, x,y,comp,req_comp, ri);
 1177|    296|      return stbi__hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp);
  ------------------
  |  Branch (1177:44): [True: 0, False: 296]
  ------------------
 1178|    296|   }
 1179|    494|   #endif
 1180|       |
 1181|    494|   #ifndef STBI_NO_TGA
 1182|       |   // test tga last because it's a crappy test!
 1183|    494|   if (stbi__tga_test(s))
  ------------------
  |  Branch (1183:8): [True: 184, False: 310]
  ------------------
 1184|    184|      return stbi__tga_load(s,x,y,comp,req_comp, ri);
 1185|    310|   #endif
 1186|       |
 1187|    310|   return stbi__errpuc("unknown image type", "Image not of any known type, or corrupt");
  ------------------
  |  | 1099|    310|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|    310|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 310]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1188|    494|}
OgreSTBICodec.cpp:_ZL14stbi__png_testP13stbi__context:
 5303|  4.69k|{
 5304|  4.69k|   int r;
 5305|  4.69k|   r = stbi__check_png_header(s);
 5306|  4.69k|   stbi__rewind(s);
 5307|  4.69k|   return r;
 5308|  4.69k|}
OgreSTBICodec.cpp:_ZL22stbi__check_png_headerP13stbi__context:
 4622|  5.67k|{
 4623|  5.67k|   static const stbi_uc png_sig[8] = { 137,80,78,71,13,10,26,10 };
 4624|  5.67k|   int i;
 4625|  21.3k|   for (i=0; i < 8; ++i)
  ------------------
  |  Branch (4625:14): [True: 19.4k, False: 1.96k]
  ------------------
 4626|  19.4k|      if (stbi__get8(s) != png_sig[i]) return stbi__err("bad png sig","Not a PNG");
  ------------------
  |  | 1095|  3.71k|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4626:11): [True: 3.71k, False: 15.7k]
  ------------------
 4627|  1.96k|   return 1;
 4628|  5.67k|}
OgreSTBICodec.cpp:_ZL10stbi__get8P13stbi__context:
 1615|   326M|{
 1616|   326M|   if (s->img_buffer < s->img_buffer_end)
  ------------------
  |  Branch (1616:8): [True: 1.33M, False: 325M]
  ------------------
 1617|  1.33M|      return *s->img_buffer++;
 1618|   325M|   if (s->read_from_callbacks) {
  ------------------
  |  Branch (1618:8): [True: 0, False: 325M]
  ------------------
 1619|      0|      stbi__refill_buffer(s);
 1620|      0|      return *s->img_buffer++;
 1621|      0|   }
 1622|   325M|   return 0;
 1623|   325M|}
OgreSTBICodec.cpp:_ZL12stbi__rewindP13stbi__context:
  887|  23.2k|{
  888|       |   // conceptually rewind SHOULD rewind to the beginning of the stream,
  889|       |   // but we just rewind to the beginning of the initial buffer, because
  890|       |   // we only use it after doing 'test', which only ever looks at at most 92 bytes
  891|  23.2k|   s->img_buffer = s->img_buffer_original;
  892|  23.2k|   s->img_buffer_end = s->img_buffer_original_end;
  893|  23.2k|}
OgreSTBICodec.cpp:_ZL14stbi__png_loadP13stbi__contextPiS1_S1_iP17stbi__result_info:
 5296|    981|{
 5297|    981|   stbi__png p;
 5298|    981|   p.s = s;
 5299|    981|   return stbi__do_png(&p, x,y,comp,req_comp, ri);
 5300|    981|}
OgreSTBICodec.cpp:_ZL12stbi__do_pngP9stbi__pngPiS1_S1_iP17stbi__result_info:
 5264|    981|{
 5265|    981|   void *result=NULL;
 5266|    981|   if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5266:8): [True: 0, False: 981]
  |  Branch (5266:24): [True: 0, False: 981]
  ------------------
 5267|    981|   if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) {
  ------------------
  |  Branch (5267:8): [True: 122, False: 859]
  ------------------
 5268|    122|      if (p->depth <= 8)
  ------------------
  |  Branch (5268:11): [True: 74, False: 48]
  ------------------
 5269|     74|         ri->bits_per_channel = 8;
 5270|     48|      else if (p->depth == 16)
  ------------------
  |  Branch (5270:16): [True: 48, False: 0]
  ------------------
 5271|     48|         ri->bits_per_channel = 16;
 5272|      0|      else
 5273|      0|         return stbi__errpuc("bad bits_per_channel", "PNG not supported: unsupported color depth");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5274|    122|      result = p->out;
 5275|    122|      p->out = NULL;
 5276|    122|      if (req_comp && req_comp != p->s->img_out_n) {
  ------------------
  |  Branch (5276:11): [True: 0, False: 122]
  |  Branch (5276:23): [True: 0, False: 0]
  ------------------
 5277|      0|         if (ri->bits_per_channel == 8)
  ------------------
  |  Branch (5277:14): [True: 0, False: 0]
  ------------------
 5278|      0|            result = stbi__convert_format((unsigned char *) result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y);
 5279|      0|         else
 5280|      0|            result = stbi__convert_format16((stbi__uint16 *) result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y);
 5281|      0|         p->s->img_out_n = req_comp;
 5282|      0|         if (result == NULL) return result;
  ------------------
  |  Branch (5282:14): [True: 0, False: 0]
  ------------------
 5283|      0|      }
 5284|    122|      *x = p->s->img_x;
 5285|    122|      *y = p->s->img_y;
 5286|    122|      if (n) *n = p->s->img_n;
  ------------------
  |  Branch (5286:11): [True: 122, False: 0]
  ------------------
 5287|    122|   }
 5288|    981|   STBI_FREE(p->out);      p->out      = NULL;
  ------------------
  |  |  684|    981|#define STBI_FREE(p)              free(p)
  ------------------
 5289|    981|   STBI_FREE(p->expanded); p->expanded = NULL;
  ------------------
  |  |  684|    981|#define STBI_FREE(p)              free(p)
  ------------------
 5290|    981|   STBI_FREE(p->idata);    p->idata    = NULL;
  ------------------
  |  |  684|    981|#define STBI_FREE(p)              free(p)
  ------------------
 5291|       |
 5292|    981|   return result;
 5293|    981|}
OgreSTBICodec.cpp:_ZL20stbi__parse_png_fileP9stbi__pngii:
 5079|    981|{
 5080|    981|   stbi_uc palette[1024], pal_img_n=0;
 5081|    981|   stbi_uc has_trans=0, tc[3]={0};
 5082|    981|   stbi__uint16 tc16[3];
 5083|    981|   stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0;
 5084|    981|   int first=1,k,interlace=0, color=0, is_iphone=0;
 5085|    981|   stbi__context *s = z->s;
 5086|       |
 5087|    981|   z->expanded = NULL;
 5088|    981|   z->idata = NULL;
 5089|    981|   z->out = NULL;
 5090|       |
 5091|    981|   if (!stbi__check_png_header(s)) return 0;
  ------------------
  |  Branch (5091:8): [True: 0, False: 981]
  ------------------
 5092|       |
 5093|    981|   if (scan == STBI__SCAN_type) return 1;
  ------------------
  |  Branch (5093:8): [True: 0, False: 981]
  ------------------
 5094|       |
 5095|  4.81k|   for (;;) {
 5096|  4.81k|      stbi__pngchunk c = stbi__get_chunk_header(s);
 5097|  4.81k|      switch (c.type) {
 5098|    102|         case STBI__PNG_TYPE('C','g','B','I'):
  ------------------
  |  | 5076|    102|#define STBI__PNG_TYPE(a,b,c,d)  (((unsigned) (a) << 24) + ((unsigned) (b) << 16) + ((unsigned) (c) << 8) + (unsigned) (d))
  ------------------
  |  Branch (5098:10): [True: 102, False: 4.71k]
  ------------------
 5099|    102|            is_iphone = 1;
 5100|    102|            stbi__skip(s, c.length);
 5101|    102|            break;
 5102|    836|         case STBI__PNG_TYPE('I','H','D','R'): {
  ------------------
  |  | 5076|    836|#define STBI__PNG_TYPE(a,b,c,d)  (((unsigned) (a) << 24) + ((unsigned) (b) << 16) + ((unsigned) (c) << 8) + (unsigned) (d))
  ------------------
  |  Branch (5102:10): [True: 836, False: 3.97k]
  ------------------
 5103|    836|            int comp,filter;
 5104|    836|            if (!first) return stbi__err("multiple IHDR","Corrupt PNG");
  ------------------
  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5104:17): [True: 2, False: 834]
  ------------------
 5105|    834|            first = 0;
 5106|    834|            if (c.length != 13) return stbi__err("bad IHDR len","Corrupt PNG");
  ------------------
  |  | 1095|     26|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5106:17): [True: 26, False: 808]
  ------------------
 5107|    808|            s->img_x = stbi__get32be(s);
 5108|    808|            s->img_y = stbi__get32be(s);
 5109|    808|            if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    808|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                          if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
  ------------------
  |  | 1095|    155|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5109:17): [True: 155, False: 653]
  ------------------
 5110|    653|            if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    653|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                          if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
  ------------------
  |  | 1095|    100|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5110:17): [True: 100, False: 553]
  ------------------
 5111|    553|            z->depth = stbi__get8(s);  if (z->depth != 1 && z->depth != 2 && z->depth != 4 && z->depth != 8 && z->depth != 16)  return stbi__err("1/2/4/8/16-bit only","PNG not supported: 1/2/4/8/16-bit only");
  ------------------
  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5111:44): [True: 431, False: 122]
  |  Branch (5111:61): [True: 404, False: 27]
  |  Branch (5111:78): [True: 369, False: 35]
  |  Branch (5111:95): [True: 171, False: 198]
  |  Branch (5111:112): [True: 2, False: 169]
  ------------------
 5112|    551|            color = stbi__get8(s);  if (color > 6)         return stbi__err("bad ctype","Corrupt PNG");
  ------------------
  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5112:41): [True: 2, False: 549]
  ------------------
 5113|    549|            if (color == 3 && z->depth == 16)                  return stbi__err("bad ctype","Corrupt PNG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5113:17): [True: 105, False: 444]
  |  Branch (5113:31): [True: 0, False: 105]
  ------------------
 5114|    549|            if (color == 3) pal_img_n = 3; else if (color & 1) return stbi__err("bad ctype","Corrupt PNG");
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5114:17): [True: 105, False: 444]
  |  Branch (5114:53): [True: 1, False: 443]
  ------------------
 5115|    548|            comp  = stbi__get8(s);  if (comp) return stbi__err("bad comp method","Corrupt PNG");
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5115:41): [True: 1, False: 547]
  ------------------
 5116|    547|            filter= stbi__get8(s);  if (filter) return stbi__err("bad filter method","Corrupt PNG");
  ------------------
  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5116:41): [True: 2, False: 545]
  ------------------
 5117|    545|            interlace = stbi__get8(s); if (interlace>1) return stbi__err("bad interlace method","Corrupt PNG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5117:44): [True: 0, False: 545]
  ------------------
 5118|    545|            if (!s->img_x || !s->img_y) return stbi__err("0-pixel image","Corrupt PNG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5118:17): [True: 0, False: 545]
  |  Branch (5118:30): [True: 0, False: 545]
  ------------------
 5119|    545|            if (!pal_img_n) {
  ------------------
  |  Branch (5119:17): [True: 440, False: 105]
  ------------------
 5120|    440|               s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0);
  ------------------
  |  Branch (5120:28): [True: 237, False: 203]
  |  Branch (5120:50): [True: 48, False: 392]
  ------------------
 5121|    440|               if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5121:20): [True: 0, False: 440]
  ------------------
 5122|    440|            } else {
 5123|       |               // if paletted, then pal_n is our final components, and
 5124|       |               // img_n is # components to decompress/filter.
 5125|    105|               s->img_n = 1;
 5126|    105|               if ((1 << 30) / s->img_x / 4 < s->img_y) return stbi__err("too large","Corrupt PNG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5126:20): [True: 0, False: 105]
  ------------------
 5127|    105|            }
 5128|       |            // even with SCAN_header, have to scan to see if we have a tRNS
 5129|    545|            break;
 5130|    545|         }
 5131|       |
 5132|    545|         case STBI__PNG_TYPE('P','L','T','E'):  {
  ------------------
  |  | 5076|    371|#define STBI__PNG_TYPE(a,b,c,d)  (((unsigned) (a) << 24) + ((unsigned) (b) << 16) + ((unsigned) (c) << 8) + (unsigned) (d))
  ------------------
  |  Branch (5132:10): [True: 371, False: 4.44k]
  ------------------
 5133|    371|            if (first) return stbi__err("first not IHDR", "Corrupt PNG");
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5133:17): [True: 1, False: 370]
  ------------------
 5134|    370|            if (c.length > 256*3) return stbi__err("invalid PLTE","Corrupt PNG");
  ------------------
  |  | 1095|      3|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5134:17): [True: 3, False: 367]
  ------------------
 5135|    367|            pal_len = c.length / 3;
 5136|    367|            if (pal_len * 3 != c.length) return stbi__err("invalid PLTE","Corrupt PNG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5136:17): [True: 0, False: 367]
  ------------------
 5137|  5.76k|            for (i=0; i < pal_len; ++i) {
  ------------------
  |  Branch (5137:23): [True: 5.40k, False: 367]
  ------------------
 5138|  5.40k|               palette[i*4+0] = stbi__get8(s);
 5139|  5.40k|               palette[i*4+1] = stbi__get8(s);
 5140|  5.40k|               palette[i*4+2] = stbi__get8(s);
 5141|  5.40k|               palette[i*4+3] = 255;
 5142|  5.40k|            }
 5143|    367|            break;
 5144|    367|         }
 5145|       |
 5146|    220|         case STBI__PNG_TYPE('t','R','N','S'): {
  ------------------
  |  | 5076|    220|#define STBI__PNG_TYPE(a,b,c,d)  (((unsigned) (a) << 24) + ((unsigned) (b) << 16) + ((unsigned) (c) << 8) + (unsigned) (d))
  ------------------
  |  Branch (5146:10): [True: 220, False: 4.59k]
  ------------------
 5147|    220|            if (first) return stbi__err("first not IHDR", "Corrupt PNG");
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5147:17): [True: 1, False: 219]
  ------------------
 5148|    219|            if (z->idata) return stbi__err("tRNS after IDAT","Corrupt PNG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5148:17): [True: 0, False: 219]
  ------------------
 5149|    219|            if (pal_img_n) {
  ------------------
  |  Branch (5149:17): [True: 100, False: 119]
  ------------------
 5150|    100|               if (scan == STBI__SCAN_header) { s->img_n = 4; return 1; }
  ------------------
  |  Branch (5150:20): [True: 0, False: 100]
  ------------------
 5151|    100|               if (pal_len == 0) return stbi__err("tRNS before PLTE","Corrupt PNG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5151:20): [True: 0, False: 100]
  ------------------
 5152|    100|               if (c.length > pal_len) return stbi__err("bad tRNS len","Corrupt PNG");
  ------------------
  |  | 1095|      4|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5152:20): [True: 4, False: 96]
  ------------------
 5153|     96|               pal_img_n = 4;
 5154|    444|               for (i=0; i < c.length; ++i)
  ------------------
  |  Branch (5154:26): [True: 348, False: 96]
  ------------------
 5155|    348|                  palette[i*4+3] = stbi__get8(s);
 5156|    119|            } else {
 5157|    119|               if (!(s->img_n & 1)) return stbi__err("tRNS with alpha","Corrupt PNG");
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5157:20): [True: 1, False: 118]
  ------------------
 5158|    118|               if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG");
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5158:20): [True: 1, False: 117]
  ------------------
 5159|    117|               has_trans = 1;
 5160|       |               // non-paletted with tRNS = constant alpha. if header-scanning, we can stop now.
 5161|    117|               if (scan == STBI__SCAN_header) { ++s->img_n; return 1; }
  ------------------
  |  Branch (5161:20): [True: 0, False: 117]
  ------------------
 5162|    117|               if (z->depth == 16) {
  ------------------
  |  Branch (5162:20): [True: 48, False: 69]
  ------------------
 5163|    174|                  for (k = 0; k < s->img_n && k < 3; ++k) // extra loop test to suppress false GCC warning
  ------------------
  |  Branch (5163:31): [True: 126, False: 48]
  |  Branch (5163:47): [True: 126, False: 0]
  ------------------
 5164|    126|                     tc16[k] = (stbi__uint16)stbi__get16be(s); // copy the values as-is
 5165|     69|               } else {
 5166|    252|                  for (k = 0; k < s->img_n && k < 3; ++k)
  ------------------
  |  Branch (5166:31): [True: 183, False: 69]
  |  Branch (5166:47): [True: 183, False: 0]
  ------------------
 5167|    183|                     tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger
 5168|     69|               }
 5169|    117|            }
 5170|    213|            break;
 5171|    219|         }
 5172|       |
 5173|  2.24k|         case STBI__PNG_TYPE('I','D','A','T'): {
  ------------------
  |  | 5076|  2.24k|#define STBI__PNG_TYPE(a,b,c,d)  (((unsigned) (a) << 24) + ((unsigned) (b) << 16) + ((unsigned) (c) << 8) + (unsigned) (d))
  ------------------
  |  Branch (5173:10): [True: 2.24k, False: 2.57k]
  ------------------
 5174|  2.24k|            if (first) return stbi__err("first not IHDR", "Corrupt PNG");
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5174:17): [True: 1, False: 2.24k]
  ------------------
 5175|  2.24k|            if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG");
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5175:17): [True: 150, False: 2.09k]
  |  Branch (5175:30): [True: 1, False: 149]
  ------------------
 5176|  2.23k|            if (scan == STBI__SCAN_header) {
  ------------------
  |  Branch (5176:17): [True: 0, False: 2.23k]
  ------------------
 5177|       |               // header scan definitely stops at first IDAT
 5178|      0|               if (pal_img_n)
  ------------------
  |  Branch (5178:20): [True: 0, False: 0]
  ------------------
 5179|      0|                  s->img_n = pal_img_n;
 5180|      0|               return 1;
 5181|      0|            }
 5182|  2.23k|            if (c.length > (1u << 30)) return stbi__err("IDAT size limit", "IDAT section larger than 2^30 bytes");
  ------------------
  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5182:17): [True: 2, False: 2.23k]
  ------------------
 5183|  2.23k|            if ((int)(ioff + c.length) < (int)ioff) return 0;
  ------------------
  |  Branch (5183:17): [True: 0, False: 2.23k]
  ------------------
 5184|  2.23k|            if (ioff + c.length > idata_limit) {
  ------------------
  |  Branch (5184:17): [True: 484, False: 1.75k]
  ------------------
 5185|    484|               stbi__uint32 idata_limit_old = idata_limit;
 5186|    484|               stbi_uc *p;
 5187|    484|               if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096;
  ------------------
  |  Branch (5187:20): [True: 435, False: 49]
  |  Branch (5187:52): [True: 31, False: 404]
  ------------------
 5188|    603|               while (ioff + c.length > idata_limit)
  ------------------
  |  Branch (5188:23): [True: 119, False: 484]
  ------------------
 5189|    119|                  idata_limit *= 2;
 5190|    484|               STBI_NOTUSED(idata_limit_old);
  ------------------
  |  |  660|    484|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 5191|    484|               p = (stbi_uc *) STBI_REALLOC_SIZED(z->idata, idata_limit_old, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory");
  ------------------
  |  |  688|    484|#define STBI_REALLOC_SIZED(p,oldsz,newsz) STBI_REALLOC(p,newsz)
  |  |  ------------------
  |  |  |  |  683|    484|#define STBI_REALLOC(p,newsz)     realloc(p,newsz)
  |  |  ------------------
  ------------------
                             p = (stbi_uc *) STBI_REALLOC_SIZED(z->idata, idata_limit_old, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5191:96): [True: 0, False: 484]
  ------------------
 5192|    484|               z->idata = p;
 5193|    484|            }
 5194|  2.23k|            if (!stbi__getn(s, z->idata+ioff,c.length)) return stbi__err("outofdata","Corrupt PNG");
  ------------------
  |  | 1095|     30|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5194:17): [True: 30, False: 2.20k]
  ------------------
 5195|  2.20k|            ioff += c.length;
 5196|  2.20k|            break;
 5197|  2.23k|         }
 5198|       |
 5199|    369|         case STBI__PNG_TYPE('I','E','N','D'): {
  ------------------
  |  | 5076|    369|#define STBI__PNG_TYPE(a,b,c,d)  (((unsigned) (a) << 24) + ((unsigned) (b) << 16) + ((unsigned) (c) << 8) + (unsigned) (d))
  ------------------
  |  Branch (5199:10): [True: 369, False: 4.44k]
  ------------------
 5200|    369|            stbi__uint32 raw_len, bpl;
 5201|    369|            if (first) return stbi__err("first not IHDR", "Corrupt PNG");
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5201:17): [True: 1, False: 368]
  ------------------
 5202|    368|            if (scan != STBI__SCAN_load) return 1;
  ------------------
  |  Branch (5202:17): [True: 0, False: 368]
  ------------------
 5203|    368|            if (z->idata == NULL) return stbi__err("no IDAT","Corrupt PNG");
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5203:17): [True: 1, False: 367]
  ------------------
 5204|       |            // initial guess for decoded data size to avoid unnecessary reallocs
 5205|    367|            bpl = (s->img_x * z->depth + 7) / 8; // bytes per line, per component
 5206|    367|            raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */;
 5207|    367|            z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone);
 5208|    367|            if (z->expanded == NULL) return 0; // zlib should set error
  ------------------
  |  Branch (5208:17): [True: 133, False: 234]
  ------------------
 5209|    234|            STBI_FREE(z->idata); z->idata = NULL;
  ------------------
  |  |  684|    234|#define STBI_FREE(p)              free(p)
  ------------------
 5210|    234|            if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans)
  ------------------
  |  Branch (5210:18): [True: 0, False: 234]
  |  Branch (5210:44): [True: 0, False: 0]
  |  Branch (5210:61): [True: 0, False: 0]
  |  Branch (5210:76): [True: 71, False: 163]
  ------------------
 5211|     71|               s->img_out_n = s->img_n+1;
 5212|    163|            else
 5213|    163|               s->img_out_n = s->img_n;
 5214|    234|            if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n, z->depth, color, interlace)) return 0;
  ------------------
  |  Branch (5214:17): [True: 112, False: 122]
  ------------------
 5215|    122|            if (has_trans) {
  ------------------
  |  Branch (5215:17): [True: 55, False: 67]
  ------------------
 5216|     55|               if (z->depth == 16) {
  ------------------
  |  Branch (5216:20): [True: 28, False: 27]
  ------------------
 5217|     28|                  if (!stbi__compute_transparency16(z, tc16, s->img_out_n)) return 0;
  ------------------
  |  Branch (5217:23): [True: 0, False: 28]
  ------------------
 5218|     28|               } else {
 5219|     27|                  if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0;
  ------------------
  |  Branch (5219:23): [True: 0, False: 27]
  ------------------
 5220|     27|               }
 5221|     55|            }
 5222|    122|            if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2)
  ------------------
  |  | 5028|    122|#define stbi__de_iphone_flag  (stbi__de_iphone_flag_set                         \
  |  |  ------------------
  |  |  |  Branch (5028:31): [True: 0, False: 0]
  |  |  |  Branch (5028:32): [True: 0, False: 0]
  |  |  ------------------
  |  | 5029|    122|                                ? stbi__de_iphone_flag_local                    \
  |  | 5030|    122|                                : stbi__de_iphone_flag_global)
  ------------------
  |  Branch (5222:17): [True: 0, False: 122]
  |  Branch (5222:54): [True: 0, False: 0]
  ------------------
 5223|      0|               stbi__de_iphone(z);
 5224|    122|            if (pal_img_n) {
  ------------------
  |  Branch (5224:17): [True: 14, False: 108]
  ------------------
 5225|       |               // pal_img_n == 3 or 4
 5226|     14|               s->img_n = pal_img_n; // record the actual colors we had
 5227|     14|               s->img_out_n = pal_img_n;
 5228|     14|               if (req_comp >= 3) s->img_out_n = req_comp;
  ------------------
  |  Branch (5228:20): [True: 0, False: 14]
  ------------------
 5229|     14|               if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n))
  ------------------
  |  Branch (5229:20): [True: 0, False: 14]
  ------------------
 5230|      0|                  return 0;
 5231|    108|            } else if (has_trans) {
  ------------------
  |  Branch (5231:24): [True: 55, False: 53]
  ------------------
 5232|       |               // non-paletted image with tRNS -> source image has (constant) alpha
 5233|     55|               ++s->img_n;
 5234|     55|            }
 5235|    122|            STBI_FREE(z->expanded); z->expanded = NULL;
  ------------------
  |  |  684|    122|#define STBI_FREE(p)              free(p)
  ------------------
 5236|       |            // end of PNG chunk, read and skip CRC
 5237|    122|            stbi__get32be(s);
 5238|    122|            return 1;
 5239|    122|         }
 5240|       |
 5241|    673|         default:
  ------------------
  |  Branch (5241:10): [True: 673, False: 4.13k]
  ------------------
 5242|       |            // if critical, fail
 5243|    673|            if (first) return stbi__err("first not IHDR", "Corrupt PNG");
  ------------------
  |  | 1095|    143|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (5243:17): [True: 143, False: 530]
  ------------------
 5244|    530|            if ((c.type & (1 << 29)) == 0) {
  ------------------
  |  Branch (5244:17): [True: 133, False: 397]
  ------------------
 5245|    133|               #ifndef STBI_NO_FAILURE_STRINGS
 5246|       |               // not threadsafe
 5247|    133|               static char invalid_chunk[] = "XXXX PNG chunk not known";
 5248|    133|               invalid_chunk[0] = STBI__BYTECAST(c.type >> 24);
  ------------------
  |  | 1730|    133|#define STBI__BYTECAST(x)  ((stbi_uc) ((x) & 255))  // truncate int to byte without warnings
  ------------------
 5249|    133|               invalid_chunk[1] = STBI__BYTECAST(c.type >> 16);
  ------------------
  |  | 1730|    133|#define STBI__BYTECAST(x)  ((stbi_uc) ((x) & 255))  // truncate int to byte without warnings
  ------------------
 5250|    133|               invalid_chunk[2] = STBI__BYTECAST(c.type >>  8);
  ------------------
  |  | 1730|    133|#define STBI__BYTECAST(x)  ((stbi_uc) ((x) & 255))  // truncate int to byte without warnings
  ------------------
 5251|    133|               invalid_chunk[3] = STBI__BYTECAST(c.type >>  0);
  ------------------
  |  | 1730|    133|#define STBI__BYTECAST(x)  ((stbi_uc) ((x) & 255))  // truncate int to byte without warnings
  ------------------
 5252|    133|               #endif
 5253|    133|               return stbi__err(invalid_chunk, "PNG not supported: unknown PNG chunk type");
  ------------------
  |  | 1095|    133|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 5254|    133|            }
 5255|    397|            stbi__skip(s, c.length);
 5256|    397|            break;
 5257|  4.81k|      }
 5258|       |      // end of PNG chunk, read and skip CRC
 5259|  3.83k|      stbi__get32be(s);
 5260|  3.83k|   }
 5261|    981|}
OgreSTBICodec.cpp:_ZL22stbi__get_chunk_headerP13stbi__context:
 4614|  4.81k|{
 4615|  4.81k|   stbi__pngchunk c;
 4616|  4.81k|   c.length = stbi__get32be(s);
 4617|  4.81k|   c.type   = stbi__get32be(s);
 4618|  4.81k|   return c;
 4619|  4.81k|}
OgreSTBICodec.cpp:_ZL10stbi__skipP13stbi__contexti:
 1645|   135k|{
 1646|   135k|   if (n == 0) return;  // already there!
  ------------------
  |  Branch (1646:8): [True: 33.9k, False: 101k]
  ------------------
 1647|   101k|   if (n < 0) {
  ------------------
  |  Branch (1647:8): [True: 66, False: 101k]
  ------------------
 1648|     66|      s->img_buffer = s->img_buffer_end;
 1649|     66|      return;
 1650|     66|   }
 1651|   101k|   if (s->io.read) {
  ------------------
  |  Branch (1651:8): [True: 0, False: 101k]
  ------------------
 1652|      0|      int blen = (int) (s->img_buffer_end - s->img_buffer);
 1653|      0|      if (blen < n) {
  ------------------
  |  Branch (1653:11): [True: 0, False: 0]
  ------------------
 1654|      0|         s->img_buffer = s->img_buffer_end;
 1655|      0|         (s->io.skip)(s->io_user_data, n - blen);
 1656|      0|         return;
 1657|      0|      }
 1658|      0|   }
 1659|   101k|   s->img_buffer += n;
 1660|   101k|}
OgreSTBICodec.cpp:_ZL13stbi__get32beP13stbi__context:
 1705|  19.1k|{
 1706|  19.1k|   stbi__uint32 z = stbi__get16be(s);
 1707|  19.1k|   return (z << 16) + stbi__get16be(s);
 1708|  19.1k|}
OgreSTBICodec.cpp:_ZL13stbi__get16beP13stbi__context:
 1695|   812k|{
 1696|   812k|   int z = stbi__get8(s);
 1697|   812k|   return (z << 8) + stbi__get8(s);
 1698|   812k|}
OgreSTBICodec.cpp:_ZL10stbi__getnP13stbi__contextPhi:
 1667|  2.99M|{
 1668|  2.99M|   if (s->io.read) {
  ------------------
  |  Branch (1668:8): [True: 0, False: 2.99M]
  ------------------
 1669|      0|      int blen = (int) (s->img_buffer_end - s->img_buffer);
 1670|      0|      if (blen < n) {
  ------------------
  |  Branch (1670:11): [True: 0, False: 0]
  ------------------
 1671|      0|         int res, count;
 1672|       |
 1673|      0|         memcpy(buffer, s->img_buffer, blen);
 1674|       |
 1675|      0|         count = (s->io.read)(s->io_user_data, (char*) buffer + blen, n - blen);
 1676|      0|         res = (count == (n-blen));
 1677|      0|         s->img_buffer = s->img_buffer_end;
 1678|      0|         return res;
 1679|      0|      }
 1680|      0|   }
 1681|       |
 1682|  2.99M|   if (s->img_buffer+n <= s->img_buffer_end) {
  ------------------
  |  Branch (1682:8): [True: 2.55k, False: 2.99M]
  ------------------
 1683|  2.55k|      memcpy(buffer, s->img_buffer, n);
 1684|  2.55k|      s->img_buffer += n;
 1685|  2.55k|      return 1;
 1686|  2.55k|   } else
 1687|  2.99M|      return 0;
 1688|  2.99M|}
OgreSTBICodec.cpp:_ZL44stbi_zlib_decode_malloc_guesssize_headerflagPKciiPii:
 4542|    367|{
 4543|    367|   stbi__zbuf a;
 4544|    367|   char *p = (char *) stbi__malloc(initial_size);
 4545|    367|   if (p == NULL) return NULL;
  ------------------
  |  Branch (4545:8): [True: 0, False: 367]
  ------------------
 4546|    367|   a.zbuffer = (stbi_uc *) buffer;
 4547|    367|   a.zbuffer_end = (stbi_uc *) buffer + len;
 4548|    367|   if (stbi__do_zlib(&a, p, initial_size, 1, parse_header)) {
  ------------------
  |  Branch (4548:8): [True: 234, False: 133]
  ------------------
 4549|    234|      if (outlen) *outlen = (int) (a.zout - a.zout_start);
  ------------------
  |  Branch (4549:11): [True: 234, False: 0]
  ------------------
 4550|    234|      return a.zout_start;
 4551|    234|   } else {
 4552|    133|      STBI_FREE(a.zout_start);
  ------------------
  |  |  684|    133|#define STBI_FREE(p)              free(p)
  ------------------
 4553|       |      return NULL;
 4554|    133|   }
 4555|    367|}
OgreSTBICodec.cpp:_ZL12stbi__mallocm:
  986|  12.3k|{
  987|  12.3k|    return STBI_MALLOC(size);
  ------------------
  |  |  682|  12.3k|#define STBI_MALLOC(sz)           malloc(sz)
  ------------------
  988|  12.3k|}
OgreSTBICodec.cpp:_ZL13stbi__do_zlibP10stbi__zbufPciii:
 4511|    367|{
 4512|    367|   a->zout_start = obuf;
 4513|    367|   a->zout       = obuf;
 4514|    367|   a->zout_end   = obuf + olen;
 4515|    367|   a->z_expandable = exp;
 4516|       |
 4517|    367|   return stbi__parse_zlib(a, parse_header);
 4518|    367|}
OgreSTBICodec.cpp:_ZL16stbi__parse_zlibP10stbi__zbufi:
 4482|    367|{
 4483|    367|   int final, type;
 4484|    367|   if (parse_header)
  ------------------
  |  Branch (4484:8): [True: 367, False: 0]
  ------------------
 4485|    367|      if (!stbi__parse_zlib_header(a)) return 0;
  ------------------
  |  Branch (4485:11): [True: 4, False: 363]
  ------------------
 4486|    363|   a->num_bits = 0;
 4487|    363|   a->code_buffer = 0;
 4488|    363|   a->hit_zeof_once = 0;
 4489|  2.16k|   do {
 4490|  2.16k|      final = stbi__zreceive(a,1);
 4491|  2.16k|      type = stbi__zreceive(a,2);
 4492|  2.16k|      if (type == 0) {
  ------------------
  |  Branch (4492:11): [True: 37, False: 2.12k]
  ------------------
 4493|     37|         if (!stbi__parse_uncompressed_block(a)) return 0;
  ------------------
  |  Branch (4493:14): [True: 16, False: 21]
  ------------------
 4494|  2.12k|      } else if (type == 3) {
  ------------------
  |  Branch (4494:18): [True: 4, False: 2.12k]
  ------------------
 4495|      4|         return 0;
 4496|  2.12k|      } else {
 4497|  2.12k|         if (type == 1) {
  ------------------
  |  Branch (4497:14): [True: 86, False: 2.03k]
  ------------------
 4498|       |            // use fixed code lengths
 4499|     86|            if (!stbi__zbuild_huffman(&a->z_length  , stbi__zdefault_length  , STBI__ZNSYMS)) return 0;
  ------------------
  |  | 4093|     86|#define STBI__ZNSYMS 288 // number of symbols in literal/length alphabet
  ------------------
  |  Branch (4499:17): [True: 0, False: 86]
  ------------------
 4500|     86|            if (!stbi__zbuild_huffman(&a->z_distance, stbi__zdefault_distance,  32)) return 0;
  ------------------
  |  Branch (4500:17): [True: 0, False: 86]
  ------------------
 4501|  2.03k|         } else {
 4502|  2.03k|            if (!stbi__compute_huffman_codes(a)) return 0;
  ------------------
  |  Branch (4502:17): [True: 61, False: 1.97k]
  ------------------
 4503|  2.03k|         }
 4504|  2.06k|         if (!stbi__parse_huffman_block(a)) return 0;
  ------------------
  |  Branch (4504:14): [True: 48, False: 2.01k]
  ------------------
 4505|  2.06k|      }
 4506|  2.16k|   } while (!final);
  ------------------
  |  Branch (4506:13): [True: 1.80k, False: 234]
  ------------------
 4507|    234|   return 1;
 4508|    363|}
OgreSTBICodec.cpp:_ZL23stbi__parse_zlib_headerP10stbi__zbuf:
 4439|    367|{
 4440|    367|   int cmf   = stbi__zget8(a);
 4441|    367|   int cm    = cmf & 15;
 4442|       |   /* int cinfo = cmf >> 4; */
 4443|    367|   int flg   = stbi__zget8(a);
 4444|    367|   if (stbi__zeof(a)) return stbi__err("bad zlib header","Corrupt PNG"); // zlib spec
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4444:8): [True: 0, False: 367]
  ------------------
 4445|    367|   if ((cmf*256+flg) % 31 != 0) return stbi__err("bad zlib header","Corrupt PNG"); // zlib spec
  ------------------
  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4445:8): [True: 2, False: 365]
  ------------------
 4446|    365|   if (flg & 32) return stbi__err("no preset dict","Corrupt PNG"); // preset dictionary not allowed in png
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4446:8): [True: 1, False: 364]
  ------------------
 4447|    364|   if (cm != 8) return stbi__err("bad compression","Corrupt PNG"); // DEFLATE required for png
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4447:8): [True: 1, False: 363]
  ------------------
 4448|       |   // window = 1 << (8 + cinfo)... but who cares, we fully buffer output
 4449|    363|   return 1;
 4450|    364|}
OgreSTBICodec.cpp:_ZL11stbi__zget8P10stbi__zbuf:
 4198|  1.60M|{
 4199|  1.60M|   return stbi__zeof(z) ? 0 : *z->zbuffer++;
  ------------------
  |  Branch (4199:11): [True: 119, False: 1.60M]
  ------------------
 4200|  1.60M|}
OgreSTBICodec.cpp:_ZL10stbi__zeofP10stbi__zbuf:
 4193|  2.35M|{
 4194|  2.35M|   return (z->zbuffer >= z->zbuffer_end);
 4195|  2.35M|}
OgreSTBICodec.cpp:_ZL14stbi__zreceiveP10stbi__zbufi:
 4215|   272k|{
 4216|   272k|   unsigned int k;
 4217|   272k|   if (z->num_bits < n) stbi__fill_bits(z);
  ------------------
  |  Branch (4217:8): [True: 6.55k, False: 266k]
  ------------------
 4218|   272k|   k = z->code_buffer & ((1 << n) - 1);
 4219|   272k|   z->code_buffer >>= n;
 4220|   272k|   z->num_bits -= n;
 4221|   272k|   return k;
 4222|   272k|}
OgreSTBICodec.cpp:_ZL15stbi__fill_bitsP10stbi__zbuf:
 4203|   748k|{
 4204|  1.60M|   do {
 4205|  1.60M|      if (z->code_buffer >= (1U << z->num_bits)) {
  ------------------
  |  Branch (4205:11): [True: 0, False: 1.60M]
  ------------------
 4206|      0|        z->zbuffer = z->zbuffer_end;  /* treat this as EOF so we fail. */
 4207|      0|        return;
 4208|      0|      }
 4209|  1.60M|      z->code_buffer |= (unsigned int) stbi__zget8(z) << z->num_bits;
 4210|  1.60M|      z->num_bits += 8;
 4211|  1.60M|   } while (z->num_bits <= 24);
  ------------------
  |  Branch (4211:13): [True: 858k, False: 748k]
  ------------------
 4212|   748k|}
OgreSTBICodec.cpp:_ZL30stbi__parse_uncompressed_blockP10stbi__zbuf:
 4410|     37|{
 4411|     37|   stbi_uc header[4];
 4412|     37|   int len,nlen,k;
 4413|     37|   if (a->num_bits & 7)
  ------------------
  |  Branch (4413:8): [True: 34, False: 3]
  ------------------
 4414|     34|      stbi__zreceive(a, a->num_bits & 7); // discard
 4415|       |   // drain the bit-packed data into header
 4416|     37|   k = 0;
 4417|     77|   while (a->num_bits > 0) {
  ------------------
  |  Branch (4417:11): [True: 40, False: 37]
  ------------------
 4418|     40|      header[k++] = (stbi_uc) (a->code_buffer & 255); // suppress MSVC run-time check
 4419|     40|      a->code_buffer >>= 8;
 4420|     40|      a->num_bits -= 8;
 4421|     40|   }
 4422|     37|   if (a->num_bits < 0) return stbi__err("zlib corrupt","Corrupt PNG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4422:8): [True: 0, False: 37]
  ------------------
 4423|       |   // now fill header the normal way
 4424|    145|   while (k < 4)
  ------------------
  |  Branch (4424:11): [True: 108, False: 37]
  ------------------
 4425|    108|      header[k++] = stbi__zget8(a);
 4426|     37|   len  = header[1] * 256 + header[0];
 4427|     37|   nlen = header[3] * 256 + header[2];
 4428|     37|   if (nlen != (len ^ 0xffff)) return stbi__err("zlib corrupt","Corrupt PNG");
  ------------------
  |  | 1095|     16|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4428:8): [True: 16, False: 21]
  ------------------
 4429|     21|   if (a->zbuffer + len > a->zbuffer_end) return stbi__err("read past buffer","Corrupt PNG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4429:8): [True: 0, False: 21]
  ------------------
 4430|     21|   if (a->zout + len > a->zout_end)
  ------------------
  |  Branch (4430:8): [True: 8, False: 13]
  ------------------
 4431|      8|      if (!stbi__zexpand(a, a->zout, len)) return 0;
  ------------------
  |  Branch (4431:11): [True: 0, False: 8]
  ------------------
 4432|     21|   memcpy(a->zout, a->zbuffer, len);
 4433|     21|   a->zbuffer += len;
 4434|     21|   a->zout += len;
 4435|     21|   return 1;
 4436|     21|}
OgreSTBICodec.cpp:_ZL13stbi__zexpandP10stbi__zbufPci:
 4274|    357|{
 4275|    357|   char *q;
 4276|    357|   unsigned int cur, limit, old_limit;
 4277|    357|   z->zout = zout;
 4278|    357|   if (!z->z_expandable) return stbi__err("output buffer limit","Corrupt PNG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4278:8): [True: 0, False: 357]
  ------------------
 4279|    357|   cur   = (unsigned int) (z->zout - z->zout_start);
 4280|    357|   limit = old_limit = (unsigned) (z->zout_end - z->zout_start);
 4281|    357|   if (UINT_MAX - cur < (unsigned) n) return stbi__err("outofmem", "Out of memory");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4281:8): [True: 0, False: 357]
  ------------------
 4282|    776|   while (cur + n > limit) {
  ------------------
  |  Branch (4282:11): [True: 419, False: 357]
  ------------------
 4283|    419|      if(limit > UINT_MAX / 2) return stbi__err("outofmem", "Out of memory");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4283:10): [True: 0, False: 419]
  ------------------
 4284|    419|      limit *= 2;
 4285|    419|   }
 4286|    357|   q = (char *) STBI_REALLOC_SIZED(z->zout_start, old_limit, limit);
  ------------------
  |  |  688|    357|#define STBI_REALLOC_SIZED(p,oldsz,newsz) STBI_REALLOC(p,newsz)
  |  |  ------------------
  |  |  |  |  683|    357|#define STBI_REALLOC(p,newsz)     realloc(p,newsz)
  |  |  ------------------
  ------------------
 4287|    357|   STBI_NOTUSED(old_limit);
  ------------------
  |  |  660|    357|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 4288|    357|   if (q == NULL) return stbi__err("outofmem", "Out of memory");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4288:8): [True: 0, False: 357]
  ------------------
 4289|    357|   z->zout_start = q;
 4290|    357|   z->zout       = q + cur;
 4291|    357|   z->zout_end   = q + limit;
 4292|    357|   return 1;
 4293|    357|}
OgreSTBICodec.cpp:_ZL20stbi__zbuild_huffmanP14stbi__zhuffmanPKhi:
 4125|  6.18k|{
 4126|  6.18k|   int i,k=0;
 4127|  6.18k|   int code, next_code[16], sizes[17];
 4128|       |
 4129|       |   // DEFLATE spec for generating codes
 4130|  6.18k|   memset(sizes, 0, sizeof(sizes));
 4131|  6.18k|   memset(z->fast, 0, sizeof(z->fast));
 4132|   642k|   for (i=0; i < num; ++i)
  ------------------
  |  Branch (4132:14): [True: 636k, False: 6.18k]
  ------------------
 4133|   636k|      ++sizes[sizelist[i]];
 4134|  6.18k|   sizes[0] = 0;
 4135|  98.8k|   for (i=1; i < 16; ++i)
  ------------------
  |  Branch (4135:14): [True: 92.6k, False: 6.17k]
  ------------------
 4136|  92.6k|      if (sizes[i] > (1 << i))
  ------------------
  |  Branch (4136:11): [True: 9, False: 92.6k]
  ------------------
 4137|      9|         return stbi__err("bad sizes", "Corrupt PNG");
  ------------------
  |  | 1095|      9|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 4138|  6.17k|   code = 0;
 4139|  98.5k|   for (i=1; i < 16; ++i) {
  ------------------
  |  Branch (4139:14): [True: 92.4k, False: 6.15k]
  ------------------
 4140|  92.4k|      next_code[i] = code;
 4141|  92.4k|      z->firstcode[i] = (stbi__uint16) code;
 4142|  92.4k|      z->firstsymbol[i] = (stbi__uint16) k;
 4143|  92.4k|      code = (code + sizes[i]);
 4144|  92.4k|      if (sizes[i])
  ------------------
  |  Branch (4144:11): [True: 30.1k, False: 62.2k]
  ------------------
 4145|  30.1k|         if (code-1 >= (1 << i)) return stbi__err("bad codelengths","Corrupt PNG");
  ------------------
  |  | 1095|     18|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4145:14): [True: 18, False: 30.1k]
  ------------------
 4146|  92.4k|      z->maxcode[i] = code << (16-i); // preshift for inner loop
 4147|  92.4k|      code <<= 1;
 4148|  92.4k|      k += sizes[i];
 4149|  92.4k|   }
 4150|  6.15k|   z->maxcode[16] = 0x10000; // sentinel
 4151|   638k|   for (i=0; i < num; ++i) {
  ------------------
  |  Branch (4151:14): [True: 632k, False: 6.15k]
  ------------------
 4152|   632k|      int s = sizelist[i];
 4153|   632k|      if (s) {
  ------------------
  |  Branch (4153:11): [True: 294k, False: 337k]
  ------------------
 4154|   294k|         int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s];
 4155|   294k|         stbi__uint16 fastv = (stbi__uint16) ((s << 9) | i);
 4156|   294k|         z->size [c] = (stbi_uc     ) s;
 4157|   294k|         z->value[c] = (stbi__uint16) i;
 4158|   294k|         if (s <= STBI__ZFAST_BITS) {
  ------------------
  |  | 4091|   294k|#define STBI__ZFAST_BITS  9 // accelerate all cases in default tables
  ------------------
  |  Branch (4158:14): [True: 202k, False: 92.5k]
  ------------------
 4159|   202k|            int j = stbi__bit_reverse(next_code[s],s);
 4160|  2.47M|            while (j < (1 << STBI__ZFAST_BITS)) {
  ------------------
  |  | 4091|  2.47M|#define STBI__ZFAST_BITS  9 // accelerate all cases in default tables
  ------------------
  |  Branch (4160:20): [True: 2.27M, False: 202k]
  ------------------
 4161|  2.27M|               z->fast[j] = fastv;
 4162|  2.27M|               j += (1 << s);
 4163|  2.27M|            }
 4164|   202k|         }
 4165|   294k|         ++next_code[s];
 4166|   294k|      }
 4167|   632k|   }
 4168|  6.15k|   return 1;
 4169|  6.17k|}
OgreSTBICodec.cpp:_ZL17stbi__bit_reverseii:
 4117|   287k|{
 4118|   287k|   STBI_ASSERT(bits <= 16);
  ------------------
  |  |  603|   287k|#define STBI_ASSERT(x) assert(x)
  ------------------
 4119|       |   // to bit reverse n bits, reverse 16 and shift
 4120|       |   // e.g. 11 bits, bit reverse and shift away 5
 4121|   287k|   return stbi__bitreverse16(v) >> (16-bits);
 4122|   287k|}
OgreSTBICodec.cpp:_ZL18stbi__bitreverse16i:
 4108|   287k|{
 4109|   287k|  n = ((n & 0xAAAA) >>  1) | ((n & 0x5555) << 1);
 4110|   287k|  n = ((n & 0xCCCC) >>  2) | ((n & 0x3333) << 2);
 4111|   287k|  n = ((n & 0xF0F0) >>  4) | ((n & 0x0F0F) << 4);
 4112|   287k|  n = ((n & 0xFF00) >>  8) | ((n & 0x00FF) << 8);
 4113|   287k|  return n;
 4114|   287k|}
OgreSTBICodec.cpp:_ZL27stbi__compute_huffman_codesP10stbi__zbuf:
 4360|  2.03k|{
 4361|  2.03k|   static const stbi_uc length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 };
 4362|  2.03k|   stbi__zhuffman z_codelength;
 4363|  2.03k|   stbi_uc lencodes[286+32+137];//padding for maximum single op
 4364|  2.03k|   stbi_uc codelength_sizes[19];
 4365|  2.03k|   int i,n;
 4366|       |
 4367|  2.03k|   int hlit  = stbi__zreceive(a,5) + 257;
 4368|  2.03k|   int hdist = stbi__zreceive(a,5) + 1;
 4369|  2.03k|   int hclen = stbi__zreceive(a,4) + 4;
 4370|  2.03k|   int ntot  = hlit + hdist;
 4371|       |
 4372|  2.03k|   memset(codelength_sizes, 0, sizeof(codelength_sizes));
 4373|  32.0k|   for (i=0; i < hclen; ++i) {
  ------------------
  |  Branch (4373:14): [True: 30.0k, False: 2.03k]
  ------------------
 4374|  30.0k|      int s = stbi__zreceive(a,3);
 4375|  30.0k|      codelength_sizes[length_dezigzag[i]] = (stbi_uc) s;
 4376|  30.0k|   }
 4377|  2.03k|   if (!stbi__zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0;
  ------------------
  |  Branch (4377:8): [True: 12, False: 2.02k]
  ------------------
 4378|       |
 4379|  2.02k|   n = 0;
 4380|   240k|   while (n < ntot) {
  ------------------
  |  Branch (4380:11): [True: 238k, False: 1.99k]
  ------------------
 4381|   238k|      int c = stbi__zhuffman_decode(a, &z_codelength);
 4382|   238k|      if (c < 0 || c >= 19) return stbi__err("bad codelengths", "Corrupt PNG");
  ------------------
  |  | 1095|     22|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4382:11): [True: 22, False: 238k]
  |  Branch (4382:20): [True: 0, False: 238k]
  ------------------
 4383|   238k|      if (c < 16)
  ------------------
  |  Branch (4383:11): [True: 213k, False: 25.4k]
  ------------------
 4384|   213k|         lencodes[n++] = (stbi_uc) c;
 4385|  25.4k|      else {
 4386|  25.4k|         stbi_uc fill = 0;
 4387|  25.4k|         if (c == 16) {
  ------------------
  |  Branch (4387:14): [True: 12.2k, False: 13.2k]
  ------------------
 4388|  12.2k|            c = stbi__zreceive(a,2)+3;
 4389|  12.2k|            if (n == 0) return stbi__err("bad codelengths", "Corrupt PNG");
  ------------------
  |  | 1095|      3|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4389:17): [True: 3, False: 12.2k]
  ------------------
 4390|  12.2k|            fill = lencodes[n-1];
 4391|  13.2k|         } else if (c == 17) {
  ------------------
  |  Branch (4391:21): [True: 9.65k, False: 3.56k]
  ------------------
 4392|  9.65k|            c = stbi__zreceive(a,3)+3;
 4393|  9.65k|         } else if (c == 18) {
  ------------------
  |  Branch (4393:21): [True: 3.56k, False: 0]
  ------------------
 4394|  3.56k|            c = stbi__zreceive(a,7)+11;
 4395|  3.56k|         } else {
 4396|      0|            return stbi__err("bad codelengths", "Corrupt PNG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 4397|      0|         }
 4398|  25.4k|         if (ntot - n < c) return stbi__err("bad codelengths", "Corrupt PNG");
  ------------------
  |  | 1095|      9|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4398:14): [True: 9, False: 25.4k]
  ------------------
 4399|  25.4k|         memset(lencodes+n, fill, c);
 4400|  25.4k|         n += c;
 4401|  25.4k|      }
 4402|   238k|   }
 4403|  1.99k|   if (n != ntot) return stbi__err("bad codelengths","Corrupt PNG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4403:8): [True: 0, False: 1.99k]
  ------------------
 4404|  1.99k|   if (!stbi__zbuild_huffman(&a->z_length, lencodes, hlit)) return 0;
  ------------------
  |  Branch (4404:8): [True: 14, False: 1.97k]
  ------------------
 4405|  1.97k|   if (!stbi__zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0;
  ------------------
  |  Branch (4405:8): [True: 1, False: 1.97k]
  ------------------
 4406|  1.97k|   return 1;
 4407|  1.97k|}
OgreSTBICodec.cpp:_ZL21stbi__zhuffman_decodeP10stbi__zbufP14stbi__zhuffman:
 4244|  2.35M|{
 4245|  2.35M|   int b,s;
 4246|  2.35M|   if (a->num_bits < 16) {
  ------------------
  |  Branch (4246:8): [True: 741k, False: 1.61M]
  ------------------
 4247|   741k|      if (stbi__zeof(a)) {
  ------------------
  |  Branch (4247:11): [True: 64, False: 741k]
  ------------------
 4248|     64|         if (!a->hit_zeof_once) {
  ------------------
  |  Branch (4248:14): [True: 48, False: 16]
  ------------------
 4249|       |            // This is the first time we hit eof, insert 16 extra padding btis
 4250|       |            // to allow us to keep going; if we actually consume any of them
 4251|       |            // though, that is invalid data. This is caught later.
 4252|     48|            a->hit_zeof_once = 1;
 4253|     48|            a->num_bits += 16; // add 16 implicit zero bits
 4254|     48|         } else {
 4255|       |            // We already inserted our extra 16 padding bits and are again
 4256|       |            // out, this stream is actually prematurely terminated.
 4257|     16|            return -1;
 4258|     16|         }
 4259|   741k|      } else {
 4260|   741k|         stbi__fill_bits(a);
 4261|   741k|      }
 4262|   741k|   }
 4263|  2.35M|   b = z->fast[a->code_buffer & STBI__ZFAST_MASK];
  ------------------
  |  | 4092|  2.35M|#define STBI__ZFAST_MASK  ((1 << STBI__ZFAST_BITS) - 1)
  |  |  ------------------
  |  |  |  | 4091|  2.35M|#define STBI__ZFAST_BITS  9 // accelerate all cases in default tables
  |  |  ------------------
  ------------------
 4264|  2.35M|   if (b) {
  ------------------
  |  Branch (4264:8): [True: 2.26M, False: 85.5k]
  ------------------
 4265|  2.26M|      s = b >> 9;
 4266|  2.26M|      a->code_buffer >>= s;
 4267|  2.26M|      a->num_bits -= s;
 4268|  2.26M|      return b & 511;
 4269|  2.26M|   }
 4270|  85.5k|   return stbi__zhuffman_decode_slowpath(a, z);
 4271|  2.35M|}
OgreSTBICodec.cpp:_ZL30stbi__zhuffman_decode_slowpathP10stbi__zbufP14stbi__zhuffman:
 4225|  85.5k|{
 4226|  85.5k|   int b,s,k;
 4227|       |   // not resolved by fast table, so compute it the slow way
 4228|       |   // use jpeg approach, which requires MSbits at top
 4229|  85.5k|   k = stbi__bit_reverse(a->code_buffer, 16);
 4230|  85.5k|   for (s=STBI__ZFAST_BITS+1; ; ++s)
  ------------------
  |  | 4091|  85.5k|#define STBI__ZFAST_BITS  9 // accelerate all cases in default tables
  ------------------
 4231|   129k|      if (k < z->maxcode[s])
  ------------------
  |  Branch (4231:11): [True: 85.5k, False: 44.2k]
  ------------------
 4232|  85.5k|         break;
 4233|  85.5k|   if (s >= 16) return -1; // invalid code!
  ------------------
  |  Branch (4233:8): [True: 38, False: 85.5k]
  ------------------
 4234|       |   // code size is s, so:
 4235|  85.5k|   b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s];
 4236|  85.5k|   if (b >= STBI__ZNSYMS) return -1; // some data was corrupt somewhere!
  ------------------
  |  | 4093|  85.5k|#define STBI__ZNSYMS 288 // number of symbols in literal/length alphabet
  ------------------
  |  Branch (4236:8): [True: 0, False: 85.5k]
  ------------------
 4237|  85.5k|   if (z->size[b] != s) return -1;  // was originally an assert, but report failure instead.
  ------------------
  |  Branch (4237:8): [True: 0, False: 85.5k]
  ------------------
 4238|  85.5k|   a->code_buffer >>= s;
 4239|  85.5k|   a->num_bits -= s;
 4240|  85.5k|   return z->value[b];
 4241|  85.5k|}
OgreSTBICodec.cpp:_ZL25stbi__parse_huffman_blockP10stbi__zbuf:
 4310|  2.06k|{
 4311|  2.06k|   char *zout = a->zout;
 4312|  1.69M|   for(;;) {
 4313|  1.69M|      int z = stbi__zhuffman_decode(a, &a->z_length);
 4314|  1.69M|      if (z < 256) {
  ------------------
  |  Branch (4314:11): [True: 1.26M, False: 426k]
  ------------------
 4315|  1.26M|         if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); // error in huffman codes
  ------------------
  |  | 1095|     24|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4315:14): [True: 24, False: 1.26M]
  ------------------
 4316|  1.26M|         if (zout >= a->zout_end) {
  ------------------
  |  Branch (4316:14): [True: 92, False: 1.26M]
  ------------------
 4317|     92|            if (!stbi__zexpand(a, zout, 1)) return 0;
  ------------------
  |  Branch (4317:17): [True: 0, False: 92]
  ------------------
 4318|     92|            zout = a->zout;
 4319|     92|         }
 4320|  1.26M|         *zout++ = (char) z;
 4321|  1.26M|      } else {
 4322|   426k|         stbi_uc *p;
 4323|   426k|         int len,dist;
 4324|   426k|         if (z == 256) {
  ------------------
  |  Branch (4324:14): [True: 2.01k, False: 424k]
  ------------------
 4325|  2.01k|            a->zout = zout;
 4326|  2.01k|            if (a->hit_zeof_once && a->num_bits < 16) {
  ------------------
  |  Branch (4326:17): [True: 30, False: 1.98k]
  |  Branch (4326:37): [True: 3, False: 27]
  ------------------
 4327|       |               // The first time we hit zeof, we inserted 16 extra zero bits into our bit
 4328|       |               // buffer so the decoder can just do its speculative decoding. But if we
 4329|       |               // actually consumed any of those bits (which is the case when num_bits < 16),
 4330|       |               // the stream actually read past the end so it is malformed.
 4331|      3|               return stbi__err("unexpected end","Corrupt PNG");
  ------------------
  |  | 1095|      3|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 4332|      3|            }
 4333|  2.01k|            return 1;
 4334|  2.01k|         }
 4335|   424k|         if (z >= 286) return stbi__err("bad huffman code","Corrupt PNG"); // per DEFLATE, length codes 286 and 287 must not appear in compressed data
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4335:14): [True: 1, False: 424k]
  ------------------
 4336|   424k|         z -= 257;
 4337|   424k|         len = stbi__zlength_base[z];
 4338|   424k|         if (stbi__zlength_extra[z]) len += stbi__zreceive(a, stbi__zlength_extra[z]);
  ------------------
  |  Branch (4338:14): [True: 31.6k, False: 393k]
  ------------------
 4339|   424k|         z = stbi__zhuffman_decode(a, &a->z_distance);
 4340|   424k|         if (z < 0 || z >= 30) return stbi__err("bad huffman code","Corrupt PNG"); // per DEFLATE, distance codes 30 and 31 must not appear in compressed data
  ------------------
  |  | 1095|     10|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4340:14): [True: 8, False: 424k]
  |  Branch (4340:23): [True: 2, False: 424k]
  ------------------
 4341|   424k|         dist = stbi__zdist_base[z];
 4342|   424k|         if (stbi__zdist_extra[z]) dist += stbi__zreceive(a, stbi__zdist_extra[z]);
  ------------------
  |  Branch (4342:14): [True: 175k, False: 249k]
  ------------------
 4343|   424k|         if (zout - a->zout_start < dist) return stbi__err("bad dist","Corrupt PNG");
  ------------------
  |  | 1095|     10|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4343:14): [True: 10, False: 424k]
  ------------------
 4344|   424k|         if (len > a->zout_end - zout) {
  ------------------
  |  Branch (4344:14): [True: 257, False: 424k]
  ------------------
 4345|    257|            if (!stbi__zexpand(a, zout, len)) return 0;
  ------------------
  |  Branch (4345:17): [True: 0, False: 257]
  ------------------
 4346|    257|            zout = a->zout;
 4347|    257|         }
 4348|   424k|         p = (stbi_uc *) (zout - dist);
 4349|   424k|         if (dist == 1) { // run of one byte; common in images.
  ------------------
  |  Branch (4349:14): [True: 226k, False: 198k]
  ------------------
 4350|   226k|            stbi_uc v = *p;
 4351|  57.4M|            if (len) { do *zout++ = v; while (--len); }
  ------------------
  |  Branch (4351:17): [True: 226k, False: 0]
  |  Branch (4351:47): [True: 57.2M, False: 226k]
  ------------------
 4352|   226k|         } else {
 4353|  9.00M|            if (len) { do *zout++ = *p++; while (--len); }
  ------------------
  |  Branch (4353:17): [True: 198k, False: 0]
  |  Branch (4353:50): [True: 8.80M, False: 198k]
  ------------------
 4354|   198k|         }
 4355|   424k|      }
 4356|  1.69M|   }
 4357|  2.06k|}
OgreSTBICodec.cpp:_ZL22stbi__create_png_imageP9stbi__pngPhjiiii:
 4862|    234|{
 4863|    234|   int bytes = (depth == 16 ? 2 : 1);
  ------------------
  |  Branch (4863:17): [True: 93, False: 141]
  ------------------
 4864|    234|   int out_bytes = out_n * bytes;
 4865|    234|   stbi_uc *final;
 4866|    234|   int p;
 4867|    234|   if (!interlaced)
  ------------------
  |  Branch (4867:8): [True: 51, False: 183]
  ------------------
 4868|     51|      return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color);
 4869|       |
 4870|       |   // de-interlacing
 4871|    183|   final = (stbi_uc *) stbi__malloc_mad3(a->s->img_x, a->s->img_y, out_bytes, 0);
 4872|    183|   if (!final) return stbi__err("outofmem", "Out of memory");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4872:8): [True: 0, False: 183]
  ------------------
 4873|  1.12k|   for (p=0; p < 7; ++p) {
  ------------------
  |  Branch (4873:14): [True: 1.04k, False: 84]
  ------------------
 4874|  1.04k|      int xorig[] = { 0,4,0,2,0,1,0 };
 4875|  1.04k|      int yorig[] = { 0,0,4,0,2,0,1 };
 4876|  1.04k|      int xspc[]  = { 8,8,4,4,2,2,1 };
 4877|  1.04k|      int yspc[]  = { 8,8,8,4,4,2,2 };
 4878|  1.04k|      int i,j,x,y;
 4879|       |      // pass1_x[4] = 0, pass1_x[5] = 1, pass1_x[12] = 1
 4880|  1.04k|      x = (a->s->img_x - xorig[p] + xspc[p]-1) / xspc[p];
 4881|  1.04k|      y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p];
 4882|  1.04k|      if (x && y) {
  ------------------
  |  Branch (4882:11): [True: 1.01k, False: 27]
  |  Branch (4882:16): [True: 998, False: 18]
  ------------------
 4883|    998|         stbi__uint32 img_len = ((((a->s->img_n * x * depth) + 7) >> 3) + 1) * y;
 4884|    998|         if (!stbi__create_png_image_raw(a, image_data, image_data_len, out_n, x, y, depth, color)) {
  ------------------
  |  Branch (4884:14): [True: 99, False: 899]
  ------------------
 4885|     99|            STBI_FREE(final);
  ------------------
  |  |  684|     99|#define STBI_FREE(p)              free(p)
  ------------------
 4886|     99|            return 0;
 4887|     99|         }
 4888|   104k|         for (j=0; j < y; ++j) {
  ------------------
  |  Branch (4888:20): [True: 103k, False: 899]
  ------------------
 4889|  1.84M|            for (i=0; i < x; ++i) {
  ------------------
  |  Branch (4889:23): [True: 1.74M, False: 103k]
  ------------------
 4890|  1.74M|               int out_y = j*yspc[p]+yorig[p];
 4891|  1.74M|               int out_x = i*xspc[p]+xorig[p];
 4892|  1.74M|               memcpy(final + out_y*a->s->img_x*out_bytes + out_x*out_bytes,
 4893|  1.74M|                      a->out + (j*x+i)*out_bytes, out_bytes);
 4894|  1.74M|            }
 4895|   103k|         }
 4896|    899|         STBI_FREE(a->out);
  ------------------
  |  |  684|    899|#define STBI_FREE(p)              free(p)
  ------------------
 4897|    899|         image_data += img_len;
 4898|    899|         image_data_len -= img_len;
 4899|    899|      }
 4900|  1.04k|   }
 4901|     84|   a->out = final;
 4902|       |
 4903|     84|   return 1;
 4904|    183|}
OgreSTBICodec.cpp:_ZL26stbi__create_png_image_rawP9stbi__pngPhjijjii:
 4697|  1.04k|{
 4698|  1.04k|   int bytes = (depth == 16 ? 2 : 1);
  ------------------
  |  Branch (4698:17): [True: 452, False: 597]
  ------------------
 4699|  1.04k|   stbi__context *s = a->s;
 4700|  1.04k|   stbi__uint32 i,j,stride = x*out_n*bytes;
 4701|  1.04k|   stbi__uint32 img_len, img_width_bytes;
 4702|  1.04k|   stbi_uc *filter_buf;
 4703|  1.04k|   int all_ok = 1;
 4704|  1.04k|   int k;
 4705|  1.04k|   int img_n = s->img_n; // copy it into a local for later
 4706|       |
 4707|  1.04k|   int output_bytes = out_n*bytes;
 4708|  1.04k|   int filter_bytes = img_n*bytes;
 4709|  1.04k|   int width = x;
 4710|       |
 4711|  1.04k|   STBI_ASSERT(out_n == s->img_n || out_n == s->img_n+1);
  ------------------
  |  |  603|  1.04k|#define STBI_ASSERT(x) assert(x)
  ------------------
 4712|  1.04k|   a->out = (stbi_uc *) stbi__malloc_mad3(x, y, output_bytes, 0); // extra bytes to write off the end into
 4713|  1.04k|   if (!a->out) return stbi__err("outofmem", "Out of memory");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4713:8): [True: 0, False: 1.04k]
  ------------------
 4714|       |
 4715|       |   // note: error exits here don't need to clean up a->out individually,
 4716|       |   // stbi__do_png always does on error.
 4717|  1.04k|   if (!stbi__mad3sizes_valid(img_n, x, depth, 7)) return stbi__err("too large", "Corrupt PNG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4717:8): [True: 0, False: 1.04k]
  ------------------
 4718|  1.04k|   img_width_bytes = (((img_n * x * depth) + 7) >> 3);
 4719|  1.04k|   if (!stbi__mad2sizes_valid(img_width_bytes, y, img_width_bytes)) return stbi__err("too large", "Corrupt PNG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4719:8): [True: 0, False: 1.04k]
  ------------------
 4720|  1.04k|   img_len = (img_width_bytes + 1) * y;
 4721|       |
 4722|       |   // we used to check for exact match between raw_len and img_len on non-interlaced PNGs,
 4723|       |   // but issue #276 reported a PNG in the wild that had extra data at the end (all zeros),
 4724|       |   // so just check for raw_len < img_len always.
 4725|  1.04k|   if (raw_len < img_len) return stbi__err("not enough pixels","Corrupt PNG");
  ------------------
  |  | 1095|     85|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4725:8): [True: 85, False: 964]
  ------------------
 4726|       |
 4727|       |   // Allocate two scan lines worth of filter workspace buffer.
 4728|    964|   filter_buf = (stbi_uc *) stbi__malloc_mad2(img_width_bytes, 2, 0);
 4729|    964|   if (!filter_buf) return stbi__err("outofmem", "Out of memory");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4729:8): [True: 0, False: 964]
  ------------------
 4730|       |
 4731|       |   // Filtering for low-bit-depth images
 4732|    964|   if (depth < 8) {
  ------------------
  |  Branch (4732:8): [True: 188, False: 776]
  ------------------
 4733|    188|      filter_bytes = 1;
 4734|    188|      width = img_width_bytes;
 4735|    188|   }
 4736|       |
 4737|   130k|   for (j=0; j < y; ++j) {
  ------------------
  |  Branch (4737:14): [True: 129k, False: 937]
  ------------------
 4738|       |      // cur/prior filter buffers alternate
 4739|   129k|      stbi_uc *cur = filter_buf + (j & 1)*img_width_bytes;
 4740|   129k|      stbi_uc *prior = filter_buf + (~j & 1)*img_width_bytes;
 4741|   129k|      stbi_uc *dest = a->out + stride*j;
 4742|   129k|      int nk = width * filter_bytes;
 4743|   129k|      int filter = *raw++;
 4744|       |
 4745|       |      // check filter type
 4746|   129k|      if (filter > 4) {
  ------------------
  |  Branch (4746:11): [True: 27, False: 129k]
  ------------------
 4747|     27|         all_ok = stbi__err("invalid filter","Corrupt PNG");
  ------------------
  |  | 1095|     27|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 4748|     27|         break;
 4749|     27|      }
 4750|       |
 4751|       |      // if first row, use special filter that doesn't sample previous row
 4752|   129k|      if (j == 0) filter = first_row_filter[filter];
  ------------------
  |  Branch (4752:11): [True: 964, False: 128k]
  ------------------
 4753|       |
 4754|       |      // perform actual filtering
 4755|   129k|      switch (filter) {
  ------------------
  |  Branch (4755:15): [True: 129k, False: 0]
  ------------------
 4756|  49.0k|      case STBI__F_none:
  ------------------
  |  Branch (4756:7): [True: 49.0k, False: 80.8k]
  ------------------
 4757|  49.0k|         memcpy(cur, raw, nk);
 4758|  49.0k|         break;
 4759|  23.1k|      case STBI__F_sub:
  ------------------
  |  Branch (4759:7): [True: 23.1k, False: 106k]
  ------------------
 4760|  23.1k|         memcpy(cur, raw, filter_bytes);
 4761|   485k|         for (k = filter_bytes; k < nk; ++k)
  ------------------
  |  Branch (4761:33): [True: 462k, False: 23.1k]
  ------------------
 4762|   462k|            cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]);
  ------------------
  |  | 1730|   485k|#define STBI__BYTECAST(x)  ((stbi_uc) ((x) & 255))  // truncate int to byte without warnings
  ------------------
 4763|  23.1k|         break;
 4764|  24.8k|      case STBI__F_up:
  ------------------
  |  Branch (4764:7): [True: 24.8k, False: 105k]
  ------------------
 4765|   539k|         for (k = 0; k < nk; ++k)
  ------------------
  |  Branch (4765:22): [True: 515k, False: 24.8k]
  ------------------
 4766|   515k|            cur[k] = STBI__BYTECAST(raw[k] + prior[k]);
  ------------------
  |  | 1730|   539k|#define STBI__BYTECAST(x)  ((stbi_uc) ((x) & 255))  // truncate int to byte without warnings
  ------------------
 4767|  24.8k|         break;
 4768|  13.1k|      case STBI__F_avg:
  ------------------
  |  Branch (4768:7): [True: 13.1k, False: 116k]
  ------------------
 4769|  39.9k|         for (k = 0; k < filter_bytes; ++k)
  ------------------
  |  Branch (4769:22): [True: 26.7k, False: 13.1k]
  ------------------
 4770|  26.7k|            cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1));
  ------------------
  |  | 1730|  39.9k|#define STBI__BYTECAST(x)  ((stbi_uc) ((x) & 255))  // truncate int to byte without warnings
  ------------------
 4771|   297k|         for (k = filter_bytes; k < nk; ++k)
  ------------------
  |  Branch (4771:33): [True: 283k, False: 13.1k]
  ------------------
 4772|   283k|            cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1));
  ------------------
  |  | 1730|   297k|#define STBI__BYTECAST(x)  ((stbi_uc) ((x) & 255))  // truncate int to byte without warnings
  ------------------
 4773|  13.1k|         break;
 4774|  19.5k|      case STBI__F_paeth:
  ------------------
  |  Branch (4774:7): [True: 19.5k, False: 110k]
  ------------------
 4775|  57.9k|         for (k = 0; k < filter_bytes; ++k)
  ------------------
  |  Branch (4775:22): [True: 38.3k, False: 19.5k]
  ------------------
 4776|  38.3k|            cur[k] = STBI__BYTECAST(raw[k] + prior[k]); // prior[k] == stbi__paeth(0,prior[k],0)
  ------------------
  |  | 1730|  57.9k|#define STBI__BYTECAST(x)  ((stbi_uc) ((x) & 255))  // truncate int to byte without warnings
  ------------------
 4777|   424k|         for (k = filter_bytes; k < nk; ++k)
  ------------------
  |  Branch (4777:33): [True: 404k, False: 19.5k]
  ------------------
 4778|   404k|            cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes], prior[k], prior[k-filter_bytes]));
  ------------------
  |  | 1730|   424k|#define STBI__BYTECAST(x)  ((stbi_uc) ((x) & 255))  // truncate int to byte without warnings
  ------------------
 4779|  19.5k|         break;
 4780|     87|      case STBI__F_avg_first:
  ------------------
  |  Branch (4780:7): [True: 87, False: 129k]
  ------------------
 4781|     87|         memcpy(cur, raw, filter_bytes);
 4782|  8.39k|         for (k = filter_bytes; k < nk; ++k)
  ------------------
  |  Branch (4782:33): [True: 8.30k, False: 87]
  ------------------
 4783|  8.30k|            cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1));
  ------------------
  |  | 1730|  8.39k|#define STBI__BYTECAST(x)  ((stbi_uc) ((x) & 255))  // truncate int to byte without warnings
  ------------------
 4784|     87|         break;
 4785|   129k|      }
 4786|       |
 4787|   129k|      raw += nk;
 4788|       |
 4789|       |      // expand decoded bits in cur to dest, also adding an extra alpha channel if desired
 4790|   129k|      if (depth < 8) {
  ------------------
  |  Branch (4790:11): [True: 44.8k, False: 85.0k]
  ------------------
 4791|  44.8k|         stbi_uc scale = (color == 0) ? stbi__depth_scale_table[depth] : 1; // scale grayscale values to 0..255 range
  ------------------
  |  Branch (4791:26): [True: 38.3k, False: 6.53k]
  ------------------
 4792|  44.8k|         stbi_uc *in = cur;
 4793|  44.8k|         stbi_uc *out = dest;
 4794|  44.8k|         stbi_uc inb = 0;
 4795|  44.8k|         stbi__uint32 nsmp = x*img_n;
 4796|       |
 4797|       |         // expand bits to bytes first
 4798|  44.8k|         if (depth == 4) {
  ------------------
  |  Branch (4798:14): [True: 8.07k, False: 36.8k]
  ------------------
 4799|   169k|            for (i=0; i < nsmp; ++i) {
  ------------------
  |  Branch (4799:23): [True: 161k, False: 8.07k]
  ------------------
 4800|   161k|               if ((i & 1) == 0) inb = *in++;
  ------------------
  |  Branch (4800:20): [True: 82.7k, False: 78.9k]
  ------------------
 4801|   161k|               *out++ = scale * (inb >> 4);
 4802|   161k|               inb <<= 4;
 4803|   161k|            }
 4804|  36.8k|         } else if (depth == 2) {
  ------------------
  |  Branch (4804:21): [True: 9.87k, False: 26.9k]
  ------------------
 4805|   182k|            for (i=0; i < nsmp; ++i) {
  ------------------
  |  Branch (4805:23): [True: 172k, False: 9.87k]
  ------------------
 4806|   172k|               if ((i & 3) == 0) inb = *in++;
  ------------------
  |  Branch (4806:20): [True: 46.8k, False: 125k]
  ------------------
 4807|   172k|               *out++ = scale * (inb >> 6);
 4808|   172k|               inb <<= 2;
 4809|   172k|            }
 4810|  26.9k|         } else {
 4811|  26.9k|            STBI_ASSERT(depth == 1);
  ------------------
  |  |  603|  26.9k|#define STBI_ASSERT(x) assert(x)
  ------------------
 4812|  1.81M|            for (i=0; i < nsmp; ++i) {
  ------------------
  |  Branch (4812:23): [True: 1.78M, False: 26.9k]
  ------------------
 4813|  1.78M|               if ((i & 7) == 0) inb = *in++;
  ------------------
  |  Branch (4813:20): [True: 244k, False: 1.54M]
  ------------------
 4814|  1.78M|               *out++ = scale * (inb >> 7);
 4815|  1.78M|               inb <<= 1;
 4816|  1.78M|            }
 4817|  26.9k|         }
 4818|       |
 4819|       |         // insert alpha=255 values if desired
 4820|  44.8k|         if (img_n != out_n)
  ------------------
  |  Branch (4820:14): [True: 1.88k, False: 42.9k]
  ------------------
 4821|  1.88k|            stbi__create_png_alpha_expand8(dest, dest, x, img_n);
 4822|  85.0k|      } else if (depth == 8) {
  ------------------
  |  Branch (4822:18): [True: 45.4k, False: 39.5k]
  ------------------
 4823|  45.4k|         if (img_n == out_n)
  ------------------
  |  Branch (4823:14): [True: 40.6k, False: 4.77k]
  ------------------
 4824|  40.6k|            memcpy(dest, cur, x*img_n);
 4825|  4.77k|         else
 4826|  4.77k|            stbi__create_png_alpha_expand8(dest, cur, x, img_n);
 4827|  45.4k|      } else if (depth == 16) {
  ------------------
  |  Branch (4827:18): [True: 39.5k, False: 0]
  ------------------
 4828|       |         // convert the image data from big-endian to platform-native
 4829|  39.5k|         stbi__uint16 *dest16 = (stbi__uint16*)dest;
 4830|  39.5k|         stbi__uint32 nsmp = x*img_n;
 4831|       |
 4832|  39.5k|         if (img_n == out_n) {
  ------------------
  |  Branch (4832:14): [True: 33.5k, False: 6.06k]
  ------------------
 4833|   349k|            for (i = 0; i < nsmp; ++i, ++dest16, cur += 2)
  ------------------
  |  Branch (4833:25): [True: 316k, False: 33.5k]
  ------------------
 4834|   316k|               *dest16 = (cur[0] << 8) | cur[1];
 4835|  33.5k|         } else {
 4836|  6.06k|            STBI_ASSERT(img_n+1 == out_n);
  ------------------
  |  |  603|  6.06k|#define STBI_ASSERT(x) assert(x)
  ------------------
 4837|  6.06k|            if (img_n == 1) {
  ------------------
  |  Branch (4837:17): [True: 741, False: 5.32k]
  ------------------
 4838|  2.96k|               for (i = 0; i < x; ++i, dest16 += 2, cur += 2) {
  ------------------
  |  Branch (4838:28): [True: 2.22k, False: 741]
  ------------------
 4839|  2.22k|                  dest16[0] = (cur[0] << 8) | cur[1];
 4840|  2.22k|                  dest16[1] = 0xffff;
 4841|  2.22k|               }
 4842|  5.32k|            } else {
 4843|  5.32k|               STBI_ASSERT(img_n == 3);
  ------------------
  |  |  603|  5.32k|#define STBI_ASSERT(x) assert(x)
  ------------------
 4844|   115k|               for (i = 0; i < x; ++i, dest16 += 4, cur += 6) {
  ------------------
  |  Branch (4844:28): [True: 110k, False: 5.32k]
  ------------------
 4845|   110k|                  dest16[0] = (cur[0] << 8) | cur[1];
 4846|   110k|                  dest16[1] = (cur[2] << 8) | cur[3];
 4847|   110k|                  dest16[2] = (cur[4] << 8) | cur[5];
 4848|   110k|                  dest16[3] = 0xffff;
 4849|   110k|               }
 4850|  5.32k|            }
 4851|  6.06k|         }
 4852|  39.5k|      }
 4853|   129k|   }
 4854|       |
 4855|    964|   STBI_FREE(filter_buf);
  ------------------
  |  |  684|    964|#define STBI_FREE(p)              free(p)
  ------------------
 4856|    964|   if (!all_ok) return 0;
  ------------------
  |  Branch (4856:8): [True: 27, False: 937]
  ------------------
 4857|       |
 4858|    937|   return 1;
 4859|    964|}
OgreSTBICodec.cpp:_ZL21stbi__mad3sizes_validiiii:
 1032|  5.50k|{
 1033|  5.50k|   return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a*b, c) &&
  ------------------
  |  Branch (1033:11): [True: 5.49k, False: 6]
  |  Branch (1033:42): [True: 5.49k, False: 4]
  ------------------
 1034|  5.49k|      stbi__addsizes_valid(a*b*c, add);
  ------------------
  |  Branch (1034:7): [True: 5.49k, False: 0]
  ------------------
 1035|  5.50k|}
OgreSTBICodec.cpp:_ZL21stbi__mul2sizes_validii:
 1015|  16.4k|{
 1016|  16.4k|   if (a < 0 || b < 0) return 0;
  ------------------
  |  Branch (1016:8): [True: 10, False: 16.4k]
  |  Branch (1016:17): [True: 14, False: 16.4k]
  ------------------
 1017|  16.4k|   if (b == 0) return 1; // mul-by-0 is always safe
  ------------------
  |  Branch (1017:8): [True: 48, False: 16.3k]
  ------------------
 1018|       |   // portable way to check for no overflows in a*b
 1019|  16.3k|   return a <= INT_MAX/b;
 1020|  16.4k|}
OgreSTBICodec.cpp:_ZL20stbi__addsizes_validii:
 1003|  9.87k|{
 1004|  9.87k|   if (b < 0) return 0;
  ------------------
  |  Branch (1004:8): [True: 0, False: 9.87k]
  ------------------
 1005|       |   // now 0 <= b <= INT_MAX, hence also
 1006|       |   // 0 <= INT_MAX - b <= INTMAX.
 1007|       |   // And "a + b <= INT_MAX" (which might overflow) is the
 1008|       |   // same as a <= INT_MAX - b (no overflow)
 1009|  9.87k|   return a <= INT_MAX - b;
 1010|  9.87k|}
OgreSTBICodec.cpp:_ZL21stbi__mad2sizes_validiii:
 1025|  3.84k|{
 1026|  3.84k|   return stbi__mul2sizes_valid(a, b) && stbi__addsizes_valid(a*b, add);
  ------------------
  |  Branch (1026:11): [True: 3.84k, False: 0]
  |  Branch (1026:42): [True: 3.84k, False: 0]
  ------------------
 1027|  3.84k|}
OgreSTBICodec.cpp:_ZL17stbi__malloc_mad2iii:
 1049|  2.80k|{
 1050|  2.80k|   if (!stbi__mad2sizes_valid(a, b, add)) return NULL;
  ------------------
  |  Branch (1050:8): [True: 0, False: 2.80k]
  ------------------
 1051|  2.80k|   return stbi__malloc(a*b + add);
 1052|  2.80k|}
OgreSTBICodec.cpp:_ZL11stbi__paethiii:
 4658|   404k|{
 4659|       |   // This formulation looks very different from the reference in the PNG spec, but is
 4660|       |   // actually equivalent and has favorable data dependencies and admits straightforward
 4661|       |   // generation of branch-free code, which helps performance significantly.
 4662|   404k|   int thresh = c*3 - (a + b);
 4663|   404k|   int lo = a < b ? a : b;
  ------------------
  |  Branch (4663:13): [True: 42.3k, False: 362k]
  ------------------
 4664|   404k|   int hi = a < b ? b : a;
  ------------------
  |  Branch (4664:13): [True: 42.3k, False: 362k]
  ------------------
 4665|   404k|   int t0 = (hi <= thresh) ? lo : c;
  ------------------
  |  Branch (4665:13): [True: 74.6k, False: 329k]
  ------------------
 4666|   404k|   int t1 = (thresh <= lo) ? hi : t0;
  ------------------
  |  Branch (4666:13): [True: 389k, False: 15.3k]
  ------------------
 4667|   404k|   return t1;
 4668|   404k|}
OgreSTBICodec.cpp:_ZL30stbi__create_png_alpha_expand8PhS_ji:
 4676|  6.65k|{
 4677|  6.65k|   int i;
 4678|       |   // must process data backwards since we allow dest==src
 4679|  6.65k|   if (img_n == 1) {
  ------------------
  |  Branch (4679:8): [True: 11, False: 6.64k]
  ------------------
 4680|     31|      for (i=x-1; i >= 0; --i) {
  ------------------
  |  Branch (4680:19): [True: 20, False: 11]
  ------------------
 4681|     20|         dest[i*2+1] = 255;
 4682|     20|         dest[i*2+0] = src[i];
 4683|     20|      }
 4684|  6.64k|   } else {
 4685|  6.64k|      STBI_ASSERT(img_n == 3);
  ------------------
  |  |  603|  6.64k|#define STBI_ASSERT(x) assert(x)
  ------------------
 4686|   600k|      for (i=x-1; i >= 0; --i) {
  ------------------
  |  Branch (4686:19): [True: 593k, False: 6.64k]
  ------------------
 4687|   593k|         dest[i*4+3] = 255;
 4688|   593k|         dest[i*4+2] = src[i*3+2];
 4689|   593k|         dest[i*4+1] = src[i*3+1];
 4690|   593k|         dest[i*4+0] = src[i*3+0];
 4691|   593k|      }
 4692|  6.64k|   }
 4693|  6.65k|}
OgreSTBICodec.cpp:_ZL17stbi__malloc_mad3iiii:
 1056|  3.19k|{
 1057|  3.19k|   if (!stbi__mad3sizes_valid(a, b, c, add)) return NULL;
  ------------------
  |  Branch (1057:8): [True: 2, False: 3.19k]
  ------------------
 1058|  3.19k|   return stbi__malloc(a*b*c + add);
 1059|  3.19k|}
OgreSTBICodec.cpp:_ZL28stbi__compute_transparency16P9stbi__pngPti:
 4932|     28|{
 4933|     28|   stbi__context *s = z->s;
 4934|     28|   stbi__uint32 i, pixel_count = s->img_x * s->img_y;
 4935|     28|   stbi__uint16 *p = (stbi__uint16*) z->out;
 4936|       |
 4937|       |   // compute color-based transparency, assuming we've
 4938|       |   // already got 65535 as the alpha value in the output
 4939|     28|   STBI_ASSERT(out_n == 2 || out_n == 4);
  ------------------
  |  |  603|     28|#define STBI_ASSERT(x) assert(x)
  ------------------
 4940|       |
 4941|     28|   if (out_n == 2) {
  ------------------
  |  Branch (4941:8): [True: 4, False: 24]
  ------------------
 4942|  1.57k|      for (i = 0; i < pixel_count; ++i) {
  ------------------
  |  Branch (4942:19): [True: 1.56k, False: 4]
  ------------------
 4943|  1.56k|         p[1] = (p[0] == tc[0] ? 0 : 65535);
  ------------------
  |  Branch (4943:18): [True: 453, False: 1.11k]
  ------------------
 4944|  1.56k|         p += 2;
 4945|  1.56k|      }
 4946|     24|   } else {
 4947|   101k|      for (i = 0; i < pixel_count; ++i) {
  ------------------
  |  Branch (4947:19): [True: 101k, False: 24]
  ------------------
 4948|   101k|         if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2])
  ------------------
  |  Branch (4948:14): [True: 35.1k, False: 66.0k]
  |  Branch (4948:31): [True: 25.8k, False: 9.36k]
  |  Branch (4948:48): [True: 11.3k, False: 14.4k]
  ------------------
 4949|  11.3k|            p[3] = 0;
 4950|   101k|         p += 4;
 4951|   101k|      }
 4952|     24|   }
 4953|     28|   return 1;
 4954|     28|}
OgreSTBICodec.cpp:_ZL26stbi__compute_transparencyP9stbi__pngPhi:
 4907|     27|{
 4908|     27|   stbi__context *s = z->s;
 4909|     27|   stbi__uint32 i, pixel_count = s->img_x * s->img_y;
 4910|     27|   stbi_uc *p = z->out;
 4911|       |
 4912|       |   // compute color-based transparency, assuming we've
 4913|       |   // already got 255 as the alpha value in the output
 4914|     27|   STBI_ASSERT(out_n == 2 || out_n == 4);
  ------------------
  |  |  603|     27|#define STBI_ASSERT(x) assert(x)
  ------------------
 4915|       |
 4916|     27|   if (out_n == 2) {
  ------------------
  |  Branch (4916:8): [True: 3, False: 24]
  ------------------
 4917|     17|      for (i=0; i < pixel_count; ++i) {
  ------------------
  |  Branch (4917:17): [True: 14, False: 3]
  ------------------
 4918|     14|         p[1] = (p[0] == tc[0] ? 0 : 255);
  ------------------
  |  Branch (4918:18): [True: 0, False: 14]
  ------------------
 4919|     14|         p += 2;
 4920|     14|      }
 4921|     24|   } else {
 4922|   388k|      for (i=0; i < pixel_count; ++i) {
  ------------------
  |  Branch (4922:17): [True: 388k, False: 24]
  ------------------
 4923|   388k|         if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2])
  ------------------
  |  Branch (4923:14): [True: 61.9k, False: 326k]
  |  Branch (4923:31): [True: 31.4k, False: 30.5k]
  |  Branch (4923:48): [True: 10.7k, False: 20.6k]
  ------------------
 4924|  10.7k|            p[3] = 0;
 4925|   388k|         p += 4;
 4926|   388k|      }
 4927|     24|   }
 4928|     27|   return 1;
 4929|     27|}
OgreSTBICodec.cpp:_ZL24stbi__expand_png_paletteP9stbi__pngPhii:
 4957|     14|{
 4958|     14|   stbi__uint32 i, pixel_count = a->s->img_x * a->s->img_y;
 4959|     14|   stbi_uc *p, *temp_out, *orig = a->out;
 4960|       |
 4961|     14|   p = (stbi_uc *) stbi__malloc_mad2(pixel_count, pal_img_n, 0);
 4962|     14|   if (p == NULL) return stbi__err("outofmem", "Out of memory");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4962:8): [True: 0, False: 14]
  ------------------
 4963|       |
 4964|       |   // between here and free(out) below, exitting would leak
 4965|     14|   temp_out = p;
 4966|       |
 4967|     14|   if (pal_img_n == 3) {
  ------------------
  |  Branch (4967:8): [True: 9, False: 5]
  ------------------
 4968|  20.9k|      for (i=0; i < pixel_count; ++i) {
  ------------------
  |  Branch (4968:17): [True: 20.9k, False: 9]
  ------------------
 4969|  20.9k|         int n = orig[i]*4;
 4970|  20.9k|         p[0] = palette[n  ];
 4971|  20.9k|         p[1] = palette[n+1];
 4972|  20.9k|         p[2] = palette[n+2];
 4973|  20.9k|         p += 3;
 4974|  20.9k|      }
 4975|      9|   } else {
 4976|  1.98k|      for (i=0; i < pixel_count; ++i) {
  ------------------
  |  Branch (4976:17): [True: 1.97k, False: 5]
  ------------------
 4977|  1.97k|         int n = orig[i]*4;
 4978|  1.97k|         p[0] = palette[n  ];
 4979|  1.97k|         p[1] = palette[n+1];
 4980|  1.97k|         p[2] = palette[n+2];
 4981|  1.97k|         p[3] = palette[n+3];
 4982|  1.97k|         p += 4;
 4983|  1.97k|      }
 4984|      5|   }
 4985|     14|   STBI_FREE(a->out);
  ------------------
  |  |  684|     14|#define STBI_FREE(p)              free(p)
  ------------------
 4986|     14|   a->out = temp_out;
 4987|       |
 4988|     14|   STBI_NOTUSED(len);
  ------------------
  |  |  660|     14|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 4989|       |
 4990|     14|   return 1;
 4991|     14|}
OgreSTBICodec.cpp:_ZL20stbi__convert_formatPhiijj:
 1756|     30|{
 1757|     30|   int i,j;
 1758|     30|   unsigned char *good;
 1759|       |
 1760|     30|   if (req_comp == img_n) return data;
  ------------------
  |  Branch (1760:8): [True: 24, False: 6]
  ------------------
 1761|      6|   STBI_ASSERT(req_comp >= 1 && req_comp <= 4);
  ------------------
  |  |  603|      6|#define STBI_ASSERT(x) assert(x)
  ------------------
 1762|       |
 1763|      6|   good = (unsigned char *) stbi__malloc_mad3(req_comp, x, y, 0);
 1764|      6|   if (good == NULL) {
  ------------------
  |  Branch (1764:8): [True: 2, False: 4]
  ------------------
 1765|      2|      STBI_FREE(data);
  ------------------
  |  |  684|      2|#define STBI_FREE(p)              free(p)
  ------------------
 1766|      2|      return stbi__errpuc("outofmem", "Out of memory");
  ------------------
  |  | 1099|      2|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1767|      2|   }
 1768|       |
 1769|  7.62k|   for (j=0; j < (int) y; ++j) {
  ------------------
  |  Branch (1769:14): [True: 7.62k, False: 2]
  ------------------
 1770|  7.62k|      unsigned char *src  = data + j * x * img_n   ;
 1771|  7.62k|      unsigned char *dest = good + j * x * req_comp;
 1772|       |
 1773|  7.62k|      #define STBI__COMBO(a,b)  ((a)*8+(b))
 1774|  7.62k|      #define STBI__CASE(a,b)   case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
 1775|       |      // convert source image with img_n components to one with req_comp components;
 1776|       |      // avoid switch per pixel, so use switch per scanline and massive macros
 1777|  7.62k|      switch (STBI__COMBO(img_n, req_comp)) {
  ------------------
  |  | 1773|  7.62k|      #define STBI__COMBO(a,b)  ((a)*8+(b))
  ------------------
 1778|      0|         STBI__CASE(1,2) { dest[0]=src[0]; dest[1]=255;                                     } break;
  ------------------
  |  | 1774|      0|      #define STBI__CASE(a,b)   case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
  |  |  ------------------
  |  |  |  | 1773|      0|      #define STBI__COMBO(a,b)  ((a)*8+(b))
  |  |  ------------------
  |  |  |  Branch (1774:33): [True: 0, False: 7.62k]
  |  |  |  Branch (1774:67): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1779|      0|         STBI__CASE(1,3) { dest[0]=dest[1]=dest[2]=src[0];                                  } break;
  ------------------
  |  | 1774|      0|      #define STBI__CASE(a,b)   case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
  |  |  ------------------
  |  |  |  | 1773|      0|      #define STBI__COMBO(a,b)  ((a)*8+(b))
  |  |  ------------------
  |  |  |  Branch (1774:33): [True: 0, False: 7.62k]
  |  |  |  Branch (1774:67): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1780|      0|         STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0]; dest[3]=255;                     } break;
  ------------------
  |  | 1774|      0|      #define STBI__CASE(a,b)   case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
  |  |  ------------------
  |  |  |  | 1773|      0|      #define STBI__COMBO(a,b)  ((a)*8+(b))
  |  |  ------------------
  |  |  |  Branch (1774:33): [True: 0, False: 7.62k]
  |  |  |  Branch (1774:67): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1781|      0|         STBI__CASE(2,1) { dest[0]=src[0];                                                  } break;
  ------------------
  |  | 1774|      0|      #define STBI__CASE(a,b)   case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
  |  |  ------------------
  |  |  |  | 1773|      0|      #define STBI__COMBO(a,b)  ((a)*8+(b))
  |  |  ------------------
  |  |  |  Branch (1774:33): [True: 0, False: 7.62k]
  |  |  |  Branch (1774:67): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1782|      0|         STBI__CASE(2,3) { dest[0]=dest[1]=dest[2]=src[0];                                  } break;
  ------------------
  |  | 1774|      0|      #define STBI__CASE(a,b)   case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
  |  |  ------------------
  |  |  |  | 1773|      0|      #define STBI__COMBO(a,b)  ((a)*8+(b))
  |  |  ------------------
  |  |  |  Branch (1774:33): [True: 0, False: 7.62k]
  |  |  |  Branch (1774:67): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1783|      0|         STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0]; dest[3]=src[1];                  } break;
  ------------------
  |  | 1774|      0|      #define STBI__CASE(a,b)   case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
  |  |  ------------------
  |  |  |  | 1773|      0|      #define STBI__COMBO(a,b)  ((a)*8+(b))
  |  |  ------------------
  |  |  |  Branch (1774:33): [True: 0, False: 7.62k]
  |  |  |  Branch (1774:67): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1784|      0|         STBI__CASE(3,4) { dest[0]=src[0];dest[1]=src[1];dest[2]=src[2];dest[3]=255;        } break;
  ------------------
  |  | 1774|      0|      #define STBI__CASE(a,b)   case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
  |  |  ------------------
  |  |  |  | 1773|      0|      #define STBI__COMBO(a,b)  ((a)*8+(b))
  |  |  ------------------
  |  |  |  Branch (1774:33): [True: 0, False: 7.62k]
  |  |  |  Branch (1774:67): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1785|      0|         STBI__CASE(3,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]);                   } break;
  ------------------
  |  | 1774|      0|      #define STBI__CASE(a,b)   case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
  |  |  ------------------
  |  |  |  | 1773|      0|      #define STBI__COMBO(a,b)  ((a)*8+(b))
  |  |  ------------------
  |  |  |  Branch (1774:33): [True: 0, False: 7.62k]
  |  |  |  Branch (1774:67): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1786|      0|         STBI__CASE(3,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); dest[1] = 255;    } break;
  ------------------
  |  | 1774|      0|      #define STBI__CASE(a,b)   case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
  |  |  ------------------
  |  |  |  | 1773|      0|      #define STBI__COMBO(a,b)  ((a)*8+(b))
  |  |  ------------------
  |  |  |  Branch (1774:33): [True: 0, False: 7.62k]
  |  |  |  Branch (1774:67): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1787|      0|         STBI__CASE(4,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]);                   } break;
  ------------------
  |  | 1774|      0|      #define STBI__CASE(a,b)   case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
  |  |  ------------------
  |  |  |  | 1773|      0|      #define STBI__COMBO(a,b)  ((a)*8+(b))
  |  |  ------------------
  |  |  |  Branch (1774:33): [True: 0, False: 7.62k]
  |  |  |  Branch (1774:67): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1788|      0|         STBI__CASE(4,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); dest[1] = src[3]; } break;
  ------------------
  |  | 1774|      0|      #define STBI__CASE(a,b)   case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
  |  |  ------------------
  |  |  |  | 1773|      0|      #define STBI__COMBO(a,b)  ((a)*8+(b))
  |  |  ------------------
  |  |  |  Branch (1774:33): [True: 0, False: 7.62k]
  |  |  |  Branch (1774:67): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1789|  2.08M|         STBI__CASE(4,3) { dest[0]=src[0];dest[1]=src[1];dest[2]=src[2];                    } break;
  ------------------
  |  | 1774|  2.09M|      #define STBI__CASE(a,b)   case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
  |  |  ------------------
  |  |  |  | 1773|  7.62k|      #define STBI__COMBO(a,b)  ((a)*8+(b))
  |  |  ------------------
  |  |  |  Branch (1774:33): [True: 7.62k, False: 2]
  |  |  |  Branch (1774:67): [True: 2.08M, False: 7.62k]
  |  |  ------------------
  ------------------
 1790|      2|         default: STBI_ASSERT(0); STBI_FREE(data); STBI_FREE(good); return stbi__errpuc("unsupported", "Unsupported format conversion");
  ------------------
  |  |  603|      2|#define STBI_ASSERT(x) assert(x)
  ------------------
                       default: STBI_ASSERT(0); STBI_FREE(data); STBI_FREE(good); return stbi__errpuc("unsupported", "Unsupported format conversion");
  ------------------
  |  |  684|      2|#define STBI_FREE(p)              free(p)
  ------------------
                       default: STBI_ASSERT(0); STBI_FREE(data); STBI_FREE(good); return stbi__errpuc("unsupported", "Unsupported format conversion");
  ------------------
  |  |  684|      2|#define STBI_FREE(p)              free(p)
  ------------------
                       default: STBI_ASSERT(0); STBI_FREE(data); STBI_FREE(good); return stbi__errpuc("unsupported", "Unsupported format conversion");
  ------------------
  |  | 1099|      2|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1790:10): [True: 2, False: 7.62k]
  ------------------
 1791|  7.62k|      }
 1792|  7.62k|      #undef STBI__CASE
 1793|  7.62k|   }
 1794|       |
 1795|      2|   STBI_FREE(data);
  ------------------
  |  |  684|      2|#define STBI_FREE(p)              free(p)
  ------------------
 1796|      2|   return good;
 1797|      4|}
OgreSTBICodec.cpp:_ZL14stbi__bmp_testP13stbi__context:
 5362|  3.71k|{
 5363|  3.71k|   int r = stbi__bmp_test_raw(s);
 5364|  3.71k|   stbi__rewind(s);
 5365|  3.71k|   return r;
 5366|  3.71k|}
OgreSTBICodec.cpp:_ZL18stbi__bmp_test_rawP13stbi__context:
 5347|  3.71k|{
 5348|  3.71k|   int r;
 5349|  3.71k|   int sz;
 5350|  3.71k|   if (stbi__get8(s) != 'B') return 0;
  ------------------
  |  Branch (5350:8): [True: 3.10k, False: 604]
  ------------------
 5351|    604|   if (stbi__get8(s) != 'M') return 0;
  ------------------
  |  Branch (5351:8): [True: 11, False: 593]
  ------------------
 5352|    593|   stbi__get32le(s); // discard filesize
 5353|    593|   stbi__get16le(s); // discard reserved
 5354|    593|   stbi__get16le(s); // discard reserved
 5355|    593|   stbi__get32le(s); // discard data offset
 5356|    593|   sz = stbi__get32le(s);
 5357|    593|   r = (sz == 12 || sz == 40 || sz == 56 || sz == 108 || sz == 124);
  ------------------
  |  Branch (5357:9): [True: 125, False: 468]
  |  Branch (5357:21): [True: 113, False: 355]
  |  Branch (5357:33): [True: 9, False: 346]
  |  Branch (5357:45): [True: 4, False: 342]
  |  Branch (5357:58): [True: 282, False: 60]
  ------------------
 5358|    593|   return r;
 5359|    604|}
OgreSTBICodec.cpp:_ZL13stbi__get32leP13stbi__context:
 1723|   519k|{
 1724|   519k|   stbi__uint32 z = stbi__get16le(s);
 1725|   519k|   z += (stbi__uint32)stbi__get16le(s) << 16;
 1726|   519k|   return z;
 1727|   519k|}
OgreSTBICodec.cpp:_ZL13stbi__get16leP13stbi__context:
 1715|  13.0M|{
 1716|  13.0M|   int z = stbi__get8(s);
 1717|  13.0M|   return z + (stbi__get8(s) << 8);
 1718|  13.0M|}
OgreSTBICodec.cpp:_ZL14stbi__bmp_loadP13stbi__contextPiS1_S1_iP17stbi__result_info:
 5532|    533|{
 5533|    533|   stbi_uc *out;
 5534|    533|   unsigned int mr=0,mg=0,mb=0,ma=0, all_a;
 5535|    533|   stbi_uc pal[256][4];
 5536|    533|   int psize=0,i,j,width;
 5537|    533|   int flip_vertically, pad, target;
 5538|    533|   stbi__bmp_data info;
 5539|    533|   STBI_NOTUSED(ri);
  ------------------
  |  |  660|    533|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 5540|       |
 5541|    533|   info.all_a = 255;
 5542|    533|   if (stbi__bmp_parse_header(s, &info) == NULL)
  ------------------
  |  Branch (5542:8): [True: 61, False: 472]
  ------------------
 5543|     61|      return NULL; // error code already set
 5544|       |
 5545|    472|   flip_vertically = ((int) s->img_y) > 0;
 5546|    472|   s->img_y = abs((int) s->img_y);
 5547|       |
 5548|    472|   if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    472|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                 if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  | 1099|    139|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|    139|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 139]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5548:8): [True: 139, False: 333]
  ------------------
 5549|    333|   if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    333|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                 if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  | 1099|    165|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|    165|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 165]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5549:8): [True: 165, False: 168]
  ------------------
 5550|       |
 5551|    168|   mr = info.mr;
 5552|    168|   mg = info.mg;
 5553|    168|   mb = info.mb;
 5554|    168|   ma = info.ma;
 5555|    168|   all_a = info.all_a;
 5556|       |
 5557|    168|   if (info.hsz == 12) {
  ------------------
  |  Branch (5557:8): [True: 76, False: 92]
  ------------------
 5558|     76|      if (info.bpp < 24)
  ------------------
  |  Branch (5558:11): [True: 57, False: 19]
  ------------------
 5559|     57|         psize = (info.offset - info.extra_read - 24) / 3;
 5560|     92|   } else {
 5561|     92|      if (info.bpp < 16)
  ------------------
  |  Branch (5561:11): [True: 6, False: 86]
  ------------------
 5562|      6|         psize = (info.offset - info.extra_read - info.hsz) >> 2;
 5563|     92|   }
 5564|    168|   if (psize == 0) {
  ------------------
  |  Branch (5564:8): [True: 105, False: 63]
  ------------------
 5565|       |      // accept some number of extra bytes after the header, but if the offset points either to before
 5566|       |      // the header ends or implies a large amount of extra data, reject the file as malformed
 5567|    105|      int bytes_read_so_far = s->callback_already_read + (int)(s->img_buffer - s->img_buffer_original);
 5568|    105|      int header_limit = 1024; // max we actually read is below 256 bytes currently.
 5569|    105|      int extra_data_limit = 256*4; // what ordinarily goes here is a palette; 256 entries*4 bytes is its max size.
 5570|    105|      if (bytes_read_so_far <= 0 || bytes_read_so_far > header_limit) {
  ------------------
  |  Branch (5570:11): [True: 0, False: 105]
  |  Branch (5570:37): [True: 0, False: 105]
  ------------------
 5571|      0|         return stbi__errpuc("bad header", "Corrupt BMP");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5572|      0|      }
 5573|       |      // we established that bytes_read_so_far is positive and sensible.
 5574|       |      // the first half of this test rejects offsets that are either too small positives, or
 5575|       |      // negative, and guarantees that info.offset >= bytes_read_so_far > 0. this in turn
 5576|       |      // ensures the number computed in the second half of the test can't overflow.
 5577|    105|      if (info.offset < bytes_read_so_far || info.offset - bytes_read_so_far > extra_data_limit) {
  ------------------
  |  Branch (5577:11): [True: 2, False: 103]
  |  Branch (5577:46): [True: 15, False: 88]
  ------------------
 5578|     17|         return stbi__errpuc("bad offset", "Corrupt BMP");
  ------------------
  |  | 1099|     17|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     17|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5579|     88|      } else {
 5580|     88|         stbi__skip(s, info.offset - bytes_read_so_far);
 5581|     88|      }
 5582|    105|   }
 5583|       |
 5584|    151|   if (info.bpp == 24 && ma == 0xff000000)
  ------------------
  |  Branch (5584:8): [True: 35, False: 116]
  |  Branch (5584:26): [True: 0, False: 35]
  ------------------
 5585|      0|      s->img_n = 3;
 5586|    151|   else
 5587|    151|      s->img_n = ma ? 4 : 3;
  ------------------
  |  Branch (5587:18): [True: 45, False: 106]
  ------------------
 5588|    151|   if (req_comp && req_comp >= 3) // we can directly decode 3 or 4
  ------------------
  |  Branch (5588:8): [True: 0, False: 151]
  |  Branch (5588:20): [True: 0, False: 0]
  ------------------
 5589|      0|      target = req_comp;
 5590|    151|   else
 5591|    151|      target = s->img_n; // if they want monochrome, we'll post-convert
 5592|       |
 5593|       |   // sanity-check size
 5594|    151|   if (!stbi__mad3sizes_valid(target, s->img_x, s->img_y, 0))
  ------------------
  |  Branch (5594:8): [True: 0, False: 151]
  ------------------
 5595|      0|      return stbi__errpuc("too large", "Corrupt BMP");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5596|       |
 5597|    151|   out = (stbi_uc *) stbi__malloc_mad3(target, s->img_x, s->img_y, 0);
 5598|    151|   if (!out) return stbi__errpuc("outofmem", "Out of memory");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5598:8): [True: 0, False: 151]
  ------------------
 5599|    151|   if (info.bpp < 16) {
  ------------------
  |  Branch (5599:8): [True: 63, False: 88]
  ------------------
 5600|     63|      int z=0;
 5601|     63|      if (psize == 0 || psize > 256) { STBI_FREE(out); return stbi__errpuc("invalid", "Corrupt BMP"); }
  ------------------
  |  |  684|      4|#define STBI_FREE(p)              free(p)
  ------------------
                    if (psize == 0 || psize > 256) { STBI_FREE(out); return stbi__errpuc("invalid", "Corrupt BMP"); }
  ------------------
  |  | 1099|      4|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      4|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5601:11): [True: 0, False: 63]
  |  Branch (5601:25): [True: 4, False: 59]
  ------------------
 5602|    962|      for (i=0; i < psize; ++i) {
  ------------------
  |  Branch (5602:17): [True: 903, False: 59]
  ------------------
 5603|    903|         pal[i][2] = stbi__get8(s);
 5604|    903|         pal[i][1] = stbi__get8(s);
 5605|    903|         pal[i][0] = stbi__get8(s);
 5606|    903|         if (info.hsz != 12) stbi__get8(s);
  ------------------
  |  Branch (5606:14): [True: 50, False: 853]
  ------------------
 5607|    903|         pal[i][3] = 255;
 5608|    903|      }
 5609|     59|      stbi__skip(s, info.offset - info.extra_read - info.hsz - psize * (info.hsz == 12 ? 3 : 4));
  ------------------
  |  Branch (5609:73): [True: 54, False: 5]
  ------------------
 5610|     59|      if (info.bpp == 1) width = (s->img_x + 7) >> 3;
  ------------------
  |  Branch (5610:11): [True: 29, False: 30]
  ------------------
 5611|     30|      else if (info.bpp == 4) width = (s->img_x + 1) >> 1;
  ------------------
  |  Branch (5611:16): [True: 0, False: 30]
  ------------------
 5612|     30|      else if (info.bpp == 8) width = s->img_x;
  ------------------
  |  Branch (5612:16): [True: 22, False: 8]
  ------------------
 5613|      8|      else { STBI_FREE(out); return stbi__errpuc("bad bpp", "Corrupt BMP"); }
  ------------------
  |  |  684|      8|#define STBI_FREE(p)              free(p)
  ------------------
                    else { STBI_FREE(out); return stbi__errpuc("bad bpp", "Corrupt BMP"); }
  ------------------
  |  | 1099|      8|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      8|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5614|     51|      pad = (-width)&3;
 5615|     51|      if (info.bpp == 1) {
  ------------------
  |  Branch (5615:11): [True: 29, False: 22]
  ------------------
 5616|  21.9k|         for (j=0; j < (int) s->img_y; ++j) {
  ------------------
  |  Branch (5616:20): [True: 21.8k, False: 29]
  ------------------
 5617|  21.8k|            int bit_offset = 7, v = stbi__get8(s);
 5618|   963k|            for (i=0; i < (int) s->img_x; ++i) {
  ------------------
  |  Branch (5618:23): [True: 963k, False: 0]
  ------------------
 5619|   963k|               int color = (v>>bit_offset)&0x1;
 5620|   963k|               out[z++] = pal[color][0];
 5621|   963k|               out[z++] = pal[color][1];
 5622|   963k|               out[z++] = pal[color][2];
 5623|   963k|               if (target == 4) out[z++] = 255;
  ------------------
  |  Branch (5623:20): [True: 0, False: 963k]
  ------------------
 5624|   963k|               if (i+1 == (int) s->img_x) break;
  ------------------
  |  Branch (5624:20): [True: 21.8k, False: 942k]
  ------------------
 5625|   942k|               if((--bit_offset) < 0) {
  ------------------
  |  Branch (5625:19): [True: 108k, False: 833k]
  ------------------
 5626|   108k|                  bit_offset = 7;
 5627|   108k|                  v = stbi__get8(s);
 5628|   108k|               }
 5629|   942k|            }
 5630|  21.8k|            stbi__skip(s, pad);
 5631|  21.8k|         }
 5632|     29|      } else {
 5633|  88.6k|         for (j=0; j < (int) s->img_y; ++j) {
  ------------------
  |  Branch (5633:20): [True: 88.6k, False: 22]
  ------------------
 5634|  3.93M|            for (i=0; i < (int) s->img_x; i += 2) {
  ------------------
  |  Branch (5634:23): [True: 3.87M, False: 59.7k]
  ------------------
 5635|  3.87M|               int v=stbi__get8(s),v2=0;
 5636|  3.87M|               if (info.bpp == 4) {
  ------------------
  |  Branch (5636:20): [True: 0, False: 3.87M]
  ------------------
 5637|      0|                  v2 = v & 15;
 5638|      0|                  v >>= 4;
 5639|      0|               }
 5640|  3.87M|               out[z++] = pal[v][0];
 5641|  3.87M|               out[z++] = pal[v][1];
 5642|  3.87M|               out[z++] = pal[v][2];
 5643|  3.87M|               if (target == 4) out[z++] = 255;
  ------------------
  |  Branch (5643:20): [True: 0, False: 3.87M]
  ------------------
 5644|  3.87M|               if (i+1 == (int) s->img_x) break;
  ------------------
  |  Branch (5644:20): [True: 28.9k, False: 3.84M]
  ------------------
 5645|  3.84M|               v = (info.bpp == 8) ? stbi__get8(s) : v2;
  ------------------
  |  Branch (5645:20): [True: 3.84M, False: 0]
  ------------------
 5646|  3.84M|               out[z++] = pal[v][0];
 5647|  3.84M|               out[z++] = pal[v][1];
 5648|  3.84M|               out[z++] = pal[v][2];
 5649|  3.84M|               if (target == 4) out[z++] = 255;
  ------------------
  |  Branch (5649:20): [True: 0, False: 3.84M]
  ------------------
 5650|  3.84M|            }
 5651|  88.6k|            stbi__skip(s, pad);
 5652|  88.6k|         }
 5653|     22|      }
 5654|     88|   } else {
 5655|     88|      int rshift=0,gshift=0,bshift=0,ashift=0,rcount=0,gcount=0,bcount=0,acount=0;
 5656|     88|      int z = 0;
 5657|     88|      int easy=0;
 5658|     88|      stbi__skip(s, info.offset - info.extra_read - info.hsz);
 5659|     88|      if (info.bpp == 24) width = 3 * s->img_x;
  ------------------
  |  Branch (5659:11): [True: 35, False: 53]
  ------------------
 5660|     53|      else if (info.bpp == 16) width = 2*s->img_x;
  ------------------
  |  Branch (5660:16): [True: 1, False: 52]
  ------------------
 5661|     52|      else /* bpp = 32 and pad = 0 */ width=0;
 5662|     88|      pad = (-width) & 3;
 5663|     88|      if (info.bpp == 24) {
  ------------------
  |  Branch (5663:11): [True: 35, False: 53]
  ------------------
 5664|     35|         easy = 1;
 5665|     53|      } else if (info.bpp == 32) {
  ------------------
  |  Branch (5665:18): [True: 7, False: 46]
  ------------------
 5666|      7|         if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000)
  ------------------
  |  Branch (5666:14): [True: 1, False: 6]
  |  Branch (5666:28): [True: 1, False: 0]
  |  Branch (5666:44): [True: 1, False: 0]
  |  Branch (5666:64): [True: 1, False: 0]
  ------------------
 5667|      1|            easy = 2;
 5668|      7|      }
 5669|     88|      if (!easy) {
  ------------------
  |  Branch (5669:11): [True: 52, False: 36]
  ------------------
 5670|     52|         if (!mr || !mg || !mb) { STBI_FREE(out); return stbi__errpuc("bad masks", "Corrupt BMP"); }
  ------------------
  |  |  684|     15|#define STBI_FREE(p)              free(p)
  ------------------
                       if (!mr || !mg || !mb) { STBI_FREE(out); return stbi__errpuc("bad masks", "Corrupt BMP"); }
  ------------------
  |  | 1099|     15|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     15|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 15]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5670:14): [True: 12, False: 40]
  |  Branch (5670:21): [True: 1, False: 39]
  |  Branch (5670:28): [True: 2, False: 37]
  ------------------
 5671|       |         // right shift amt to put high bit in position #7
 5672|     37|         rshift = stbi__high_bit(mr)-7; rcount = stbi__bitcount(mr);
 5673|     37|         gshift = stbi__high_bit(mg)-7; gcount = stbi__bitcount(mg);
 5674|     37|         bshift = stbi__high_bit(mb)-7; bcount = stbi__bitcount(mb);
 5675|     37|         ashift = stbi__high_bit(ma)-7; acount = stbi__bitcount(ma);
 5676|     37|         if (rcount > 8 || gcount > 8 || bcount > 8 || acount > 8) { STBI_FREE(out); return stbi__errpuc("bad masks", "Corrupt BMP"); }
  ------------------
  |  |  684|     31|#define STBI_FREE(p)              free(p)
  ------------------
                       if (rcount > 8 || gcount > 8 || bcount > 8 || acount > 8) { STBI_FREE(out); return stbi__errpuc("bad masks", "Corrupt BMP"); }
  ------------------
  |  | 1099|     31|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     31|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 31]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5676:14): [True: 23, False: 14]
  |  Branch (5676:28): [True: 3, False: 11]
  |  Branch (5676:42): [True: 4, False: 7]
  |  Branch (5676:56): [True: 1, False: 6]
  ------------------
 5677|     37|      }
 5678|  20.4k|      for (j=0; j < (int) s->img_y; ++j) {
  ------------------
  |  Branch (5678:17): [True: 20.4k, False: 42]
  ------------------
 5679|  20.4k|         if (easy) {
  ------------------
  |  Branch (5679:14): [True: 18.7k, False: 1.71k]
  ------------------
 5680|  13.7M|            for (i=0; i < (int) s->img_x; ++i) {
  ------------------
  |  Branch (5680:23): [True: 13.7M, False: 18.7k]
  ------------------
 5681|  13.7M|               unsigned char a;
 5682|  13.7M|               out[z+2] = stbi__get8(s);
 5683|  13.7M|               out[z+1] = stbi__get8(s);
 5684|  13.7M|               out[z+0] = stbi__get8(s);
 5685|  13.7M|               z += 3;
 5686|  13.7M|               a = (easy == 2 ? stbi__get8(s) : 255);
  ------------------
  |  Branch (5686:21): [True: 286k, False: 13.4M]
  ------------------
 5687|  13.7M|               all_a |= a;
 5688|  13.7M|               if (target == 4) out[z++] = a;
  ------------------
  |  Branch (5688:20): [True: 5.77M, False: 7.93M]
  ------------------
 5689|  13.7M|            }
 5690|  18.7k|         } else {
 5691|  1.71k|            int bpp = info.bpp;
 5692|   629k|            for (i=0; i < (int) s->img_x; ++i) {
  ------------------
  |  Branch (5692:23): [True: 627k, False: 1.71k]
  ------------------
 5693|   627k|               stbi__uint32 v = (bpp == 16 ? (stbi__uint32) stbi__get16le(s) : stbi__get32le(s));
  ------------------
  |  Branch (5693:34): [True: 120k, False: 506k]
  ------------------
 5694|   627k|               unsigned int a;
 5695|   627k|               out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mr, rshift, rcount));
  ------------------
  |  | 1730|   627k|#define STBI__BYTECAST(x)  ((stbi_uc) ((x) & 255))  // truncate int to byte without warnings
  ------------------
 5696|   627k|               out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mg, gshift, gcount));
  ------------------
  |  | 1730|   627k|#define STBI__BYTECAST(x)  ((stbi_uc) ((x) & 255))  // truncate int to byte without warnings
  ------------------
 5697|   627k|               out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mb, bshift, bcount));
  ------------------
  |  | 1730|   627k|#define STBI__BYTECAST(x)  ((stbi_uc) ((x) & 255))  // truncate int to byte without warnings
  ------------------
 5698|   627k|               a = (ma ? stbi__shiftsigned(v & ma, ashift, acount) : 255);
  ------------------
  |  Branch (5698:21): [True: 108k, False: 518k]
  ------------------
 5699|   627k|               all_a |= a;
 5700|   627k|               if (target == 4) out[z++] = STBI__BYTECAST(a);
  ------------------
  |  | 1730|   108k|#define STBI__BYTECAST(x)  ((stbi_uc) ((x) & 255))  // truncate int to byte without warnings
  ------------------
  |  Branch (5700:20): [True: 108k, False: 518k]
  ------------------
 5701|   627k|            }
 5702|  1.71k|         }
 5703|  20.4k|         stbi__skip(s, pad);
 5704|  20.4k|      }
 5705|     42|   }
 5706|       |
 5707|       |   // if alpha channel is all 0s, replace with all 255s
 5708|     93|   if (target == 4 && all_a == 0)
  ------------------
  |  Branch (5708:8): [True: 25, False: 68]
  |  Branch (5708:23): [True: 1, False: 24]
  ------------------
 5709|   286k|      for (i=4*s->img_x*s->img_y-1; i >= 0; i -= 4)
  ------------------
  |  Branch (5709:37): [True: 286k, False: 1]
  ------------------
 5710|   286k|         out[i] = 255;
 5711|       |
 5712|     93|   if (flip_vertically) {
  ------------------
  |  Branch (5712:8): [True: 93, False: 0]
  ------------------
 5713|     93|      stbi_uc t;
 5714|  65.5k|      for (j=0; j < (int) s->img_y>>1; ++j) {
  ------------------
  |  Branch (5714:17): [True: 65.4k, False: 93]
  ------------------
 5715|  65.4k|         stbi_uc *p1 = out +      j     *s->img_x*target;
 5716|  65.4k|         stbi_uc *p2 = out + (s->img_y-1-j)*s->img_x*target;
 5717|  37.4M|         for (i=0; i < (int) s->img_x*target; ++i) {
  ------------------
  |  Branch (5717:20): [True: 37.3M, False: 65.4k]
  ------------------
 5718|  37.3M|            t = p1[i]; p1[i] = p2[i]; p2[i] = t;
 5719|  37.3M|         }
 5720|  65.4k|      }
 5721|     93|   }
 5722|       |
 5723|     93|   if (req_comp && req_comp != target) {
  ------------------
  |  Branch (5723:8): [True: 0, False: 93]
  |  Branch (5723:20): [True: 0, False: 0]
  ------------------
 5724|      0|      out = stbi__convert_format(out, target, req_comp, s->img_x, s->img_y);
 5725|      0|      if (out == NULL) return out; // stbi__convert_format frees input on failure
  ------------------
  |  Branch (5725:11): [True: 0, False: 0]
  ------------------
 5726|      0|   }
 5727|       |
 5728|     93|   *x = s->img_x;
 5729|     93|   *y = s->img_y;
 5730|     93|   if (comp) *comp = s->img_n;
  ------------------
  |  Branch (5730:8): [True: 93, False: 0]
  ------------------
 5731|     93|   return out;
 5732|     93|}
OgreSTBICodec.cpp:_ZL22stbi__bmp_parse_headerP13stbi__contextP14stbi__bmp_data:
 5449|    533|{
 5450|    533|   int hsz;
 5451|    533|   if (stbi__get8(s) != 'B' || stbi__get8(s) != 'M') return stbi__errpuc("not BMP", "Corrupt BMP");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5451:8): [True: 0, False: 533]
  |  Branch (5451:32): [True: 0, False: 533]
  ------------------
 5452|    533|   stbi__get32le(s); // discard filesize
 5453|    533|   stbi__get16le(s); // discard reserved
 5454|    533|   stbi__get16le(s); // discard reserved
 5455|    533|   info->offset = stbi__get32le(s);
 5456|    533|   info->hsz = hsz = stbi__get32le(s);
 5457|    533|   info->mr = info->mg = info->mb = info->ma = 0;
 5458|    533|   info->extra_read = 14;
 5459|       |
 5460|    533|   if (info->offset < 0) return stbi__errpuc("bad BMP", "bad BMP");
  ------------------
  |  | 1099|     12|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     12|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5460:8): [True: 12, False: 521]
  ------------------
 5461|       |
 5462|    521|   if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) return stbi__errpuc("unknown BMP", "BMP type not supported: unknown");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5462:8): [True: 400, False: 121]
  |  Branch (5462:21): [True: 287, False: 113]
  |  Branch (5462:34): [True: 279, False: 8]
  |  Branch (5462:47): [True: 276, False: 3]
  |  Branch (5462:61): [True: 0, False: 276]
  ------------------
 5463|    521|   if (hsz == 12) {
  ------------------
  |  Branch (5463:8): [True: 121, False: 400]
  ------------------
 5464|    121|      s->img_x = stbi__get16le(s);
 5465|    121|      s->img_y = stbi__get16le(s);
 5466|    400|   } else {
 5467|    400|      s->img_x = stbi__get32le(s);
 5468|    400|      s->img_y = stbi__get32le(s);
 5469|    400|   }
 5470|    521|   if (stbi__get16le(s) != 1) return stbi__errpuc("bad BMP", "bad BMP");
  ------------------
  |  | 1099|     14|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     14|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 14]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5470:8): [True: 14, False: 507]
  ------------------
 5471|    507|   info->bpp = stbi__get16le(s);
 5472|    507|   if (hsz != 12) {
  ------------------
  |  Branch (5472:8): [True: 391, False: 116]
  ------------------
 5473|    391|      int compress = stbi__get32le(s);
 5474|    391|      if (compress == 1 || compress == 2) return stbi__errpuc("BMP RLE", "BMP type not supported: RLE");
  ------------------
  |  | 1099|      1|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5474:11): [True: 1, False: 390]
  |  Branch (5474:28): [True: 0, False: 390]
  ------------------
 5475|    390|      if (compress >= 4) return stbi__errpuc("BMP JPEG/PNG", "BMP type not supported: unsupported compression"); // this includes PNG/JPEG modes
  ------------------
  |  | 1099|     11|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     11|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5475:11): [True: 11, False: 379]
  ------------------
 5476|    379|      if (compress == 3 && info->bpp != 16 && info->bpp != 32) return stbi__errpuc("bad BMP", "bad BMP"); // bitfields requires 16 or 32 bits/pixel
  ------------------
  |  | 1099|      5|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      5|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5476:11): [True: 37, False: 342]
  |  Branch (5476:28): [True: 14, False: 23]
  |  Branch (5476:47): [True: 5, False: 9]
  ------------------
 5477|    374|      stbi__get32le(s); // discard sizeof
 5478|    374|      stbi__get32le(s); // discard hres
 5479|    374|      stbi__get32le(s); // discard vres
 5480|    374|      stbi__get32le(s); // discard colorsused
 5481|    374|      stbi__get32le(s); // discard max important
 5482|    374|      if (hsz == 40 || hsz == 56) {
  ------------------
  |  Branch (5482:11): [True: 103, False: 271]
  |  Branch (5482:24): [True: 5, False: 266]
  ------------------
 5483|    108|         if (hsz == 56) {
  ------------------
  |  Branch (5483:14): [True: 5, False: 103]
  ------------------
 5484|      5|            stbi__get32le(s);
 5485|      5|            stbi__get32le(s);
 5486|      5|            stbi__get32le(s);
 5487|      5|            stbi__get32le(s);
 5488|      5|         }
 5489|    108|         if (info->bpp == 16 || info->bpp == 32) {
  ------------------
  |  Branch (5489:14): [True: 34, False: 74]
  |  Branch (5489:33): [True: 34, False: 40]
  ------------------
 5490|     68|            if (compress == 0) {
  ------------------
  |  Branch (5490:17): [True: 20, False: 48]
  ------------------
 5491|     20|               stbi__bmp_set_mask_defaults(info, compress);
 5492|     48|            } else if (compress == 3) {
  ------------------
  |  Branch (5492:24): [True: 32, False: 16]
  ------------------
 5493|     32|               info->mr = stbi__get32le(s);
 5494|     32|               info->mg = stbi__get32le(s);
 5495|     32|               info->mb = stbi__get32le(s);
 5496|     32|               info->extra_read += 12;
 5497|       |               // not documented, but generated by photoshop and handled by mspaint
 5498|     32|               if (info->mr == info->mg && info->mg == info->mb) {
  ------------------
  |  Branch (5498:20): [True: 5, False: 27]
  |  Branch (5498:44): [True: 2, False: 3]
  ------------------
 5499|       |                  // ?!?!?
 5500|      2|                  return stbi__errpuc("bad BMP", "bad BMP");
  ------------------
  |  | 1099|      2|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5501|      2|               }
 5502|     32|            } else
 5503|     16|               return stbi__errpuc("bad BMP", "bad BMP");
  ------------------
  |  | 1099|     16|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     16|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5504|     68|         }
 5505|    266|      } else {
 5506|       |         // V4/V5 header
 5507|    266|         int i;
 5508|    266|         if (hsz != 108 && hsz != 124)
  ------------------
  |  Branch (5508:14): [True: 265, False: 1]
  |  Branch (5508:28): [True: 0, False: 265]
  ------------------
 5509|      0|            return stbi__errpuc("bad BMP", "bad BMP");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5510|    266|         info->mr = stbi__get32le(s);
 5511|    266|         info->mg = stbi__get32le(s);
 5512|    266|         info->mb = stbi__get32le(s);
 5513|    266|         info->ma = stbi__get32le(s);
 5514|    266|         if (compress != 3) // override mr/mg/mb unless in BI_BITFIELDS mode, as per docs
  ------------------
  |  Branch (5514:14): [True: 266, False: 0]
  ------------------
 5515|    266|            stbi__bmp_set_mask_defaults(info, compress);
 5516|    266|         stbi__get32le(s); // discard color space
 5517|  3.45k|         for (i=0; i < 12; ++i)
  ------------------
  |  Branch (5517:20): [True: 3.19k, False: 266]
  ------------------
 5518|  3.19k|            stbi__get32le(s); // discard color space parameters
 5519|    266|         if (hsz == 124) {
  ------------------
  |  Branch (5519:14): [True: 265, False: 1]
  ------------------
 5520|    265|            stbi__get32le(s); // discard rendering intent
 5521|    265|            stbi__get32le(s); // discard offset of profile data
 5522|    265|            stbi__get32le(s); // discard size of profile data
 5523|    265|            stbi__get32le(s); // discard reserved
 5524|    265|         }
 5525|    266|      }
 5526|    374|   }
 5527|    472|   return (void *) 1;
 5528|    507|}
OgreSTBICodec.cpp:_ZL27stbi__bmp_set_mask_defaultsP14stbi__bmp_datai:
 5423|    286|{
 5424|       |   // BI_BITFIELDS specifies masks explicitly, don't override
 5425|    286|   if (compress == 3)
  ------------------
  |  Branch (5425:8): [True: 0, False: 286]
  ------------------
 5426|      0|      return 1;
 5427|       |
 5428|    286|   if (compress == 0) {
  ------------------
  |  Branch (5428:8): [True: 44, False: 242]
  ------------------
 5429|     44|      if (info->bpp == 16) {
  ------------------
  |  Branch (5429:11): [True: 4, False: 40]
  ------------------
 5430|      4|         info->mr = 31u << 10;
 5431|      4|         info->mg = 31u <<  5;
 5432|      4|         info->mb = 31u <<  0;
 5433|     40|      } else if (info->bpp == 32) {
  ------------------
  |  Branch (5433:18): [True: 25, False: 15]
  ------------------
 5434|     25|         info->mr = 0xffu << 16;
 5435|     25|         info->mg = 0xffu <<  8;
 5436|     25|         info->mb = 0xffu <<  0;
 5437|     25|         info->ma = 0xffu << 24;
 5438|     25|         info->all_a = 0; // if all_a is 0 at end, then we loaded alpha channel but it was all 0
 5439|     25|      } else {
 5440|       |         // otherwise, use defaults, which is all-0
 5441|     15|         info->mr = info->mg = info->mb = info->ma = 0;
 5442|     15|      }
 5443|     44|      return 1;
 5444|     44|   }
 5445|    242|   return 0; // error
 5446|    286|}
OgreSTBICodec.cpp:_ZL14stbi__high_bitj:
 5371|    148|{
 5372|    148|   int n=0;
 5373|    148|   if (z == 0) return -1;
  ------------------
  |  Branch (5373:8): [True: 15, False: 133]
  ------------------
 5374|    133|   if (z >= 0x10000) { n += 16; z >>= 16; }
  ------------------
  |  Branch (5374:8): [True: 91, False: 42]
  ------------------
 5375|    133|   if (z >= 0x00100) { n +=  8; z >>=  8; }
  ------------------
  |  Branch (5375:8): [True: 99, False: 34]
  ------------------
 5376|    133|   if (z >= 0x00010) { n +=  4; z >>=  4; }
  ------------------
  |  Branch (5376:8): [True: 115, False: 18]
  ------------------
 5377|    133|   if (z >= 0x00004) { n +=  2; z >>=  2; }
  ------------------
  |  Branch (5377:8): [True: 112, False: 21]
  ------------------
 5378|    133|   if (z >= 0x00002) { n +=  1;/* >>=  1;*/ }
  ------------------
  |  Branch (5378:8): [True: 91, False: 42]
  ------------------
 5379|    133|   return n;
 5380|    148|}
OgreSTBICodec.cpp:_ZL14stbi__bitcountj:
 5383|    148|{
 5384|    148|   a = (a & 0x55555555) + ((a >>  1) & 0x55555555); // max 2
 5385|    148|   a = (a & 0x33333333) + ((a >>  2) & 0x33333333); // max 4
 5386|    148|   a = (a + (a >> 4)) & 0x0f0f0f0f; // max 8 per 4, now 8 bits
 5387|    148|   a = (a + (a >> 8)); // max 16 per 8 bits
 5388|    148|   a = (a + (a >> 16)); // max 32 per 8 bits
 5389|    148|   return a & 0xff;
 5390|    148|}
OgreSTBICodec.cpp:_ZL17stbi__shiftsignedjii:
 5396|  1.99M|{
 5397|  1.99M|   static unsigned int mul_table[9] = {
 5398|  1.99M|      0,
 5399|  1.99M|      0xff/*0b11111111*/, 0x55/*0b01010101*/, 0x49/*0b01001001*/, 0x11/*0b00010001*/,
 5400|  1.99M|      0x21/*0b00100001*/, 0x41/*0b01000001*/, 0x81/*0b10000001*/, 0x01/*0b00000001*/,
 5401|  1.99M|   };
 5402|  1.99M|   static unsigned int shift_table[9] = {
 5403|  1.99M|      0, 0,0,1,0,2,4,6,0,
 5404|  1.99M|   };
 5405|  1.99M|   if (shift < 0)
  ------------------
  |  Branch (5405:8): [True: 338k, False: 1.65M]
  ------------------
 5406|   338k|      v <<= -shift;
 5407|  1.65M|   else
 5408|  1.65M|      v >>= shift;
 5409|  1.99M|   STBI_ASSERT(v < 256);
  ------------------
  |  |  603|  1.99M|#define STBI_ASSERT(x) assert(x)
  ------------------
 5410|  1.99M|   v >>= (8-bits);
 5411|       |   STBI_ASSERT(bits >= 0 && bits <= 8);
  ------------------
  |  |  603|  1.99M|#define STBI_ASSERT(x) assert(x)
  ------------------
 5412|  1.99M|   return (int) ((unsigned) v * mul_table[bits]) >> shift_table[bits];
 5413|  1.99M|}
OgreSTBICodec.cpp:_ZL14stbi__gif_testP13stbi__context:
 6591|  3.18k|{
 6592|  3.18k|   int r = stbi__gif_test_raw(s);
 6593|  3.18k|   stbi__rewind(s);
 6594|  3.18k|   return r;
 6595|  3.18k|}
OgreSTBICodec.cpp:_ZL18stbi__gif_test_rawP13stbi__context:
 6581|  3.18k|{
 6582|  3.18k|   int sz;
 6583|  3.18k|   if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') return 0;
  ------------------
  |  Branch (6583:8): [True: 2.87k, False: 308]
  |  Branch (6583:32): [True: 19, False: 289]
  |  Branch (6583:56): [True: 10, False: 279]
  |  Branch (6583:80): [True: 11, False: 268]
  ------------------
 6584|    268|   sz = stbi__get8(s);
 6585|    268|   if (sz != '9' && sz != '7') return 0;
  ------------------
  |  Branch (6585:8): [True: 38, False: 230]
  |  Branch (6585:21): [True: 12, False: 26]
  ------------------
 6586|    256|   if (stbi__get8(s) != 'a') return 0;
  ------------------
  |  Branch (6586:8): [True: 4, False: 252]
  ------------------
 6587|    252|   return 1;
 6588|    256|}
OgreSTBICodec.cpp:_ZL14stbi__gif_loadP13stbi__contextPiS1_S1_iP17stbi__result_info:
 7049|    252|{
 7050|    252|   stbi_uc *u = 0;
 7051|    252|   stbi__gif g;
 7052|    252|   memset(&g, 0, sizeof(g));
 7053|    252|   STBI_NOTUSED(ri);
  ------------------
  |  |  660|    252|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 7054|       |
 7055|    252|   u = stbi__gif_load_next(s, &g, comp, req_comp, 0);
 7056|    252|   if (u == (stbi_uc *) s) u = 0;  // end of animated gif marker
  ------------------
  |  Branch (7056:8): [True: 0, False: 252]
  ------------------
 7057|    252|   if (u) {
  ------------------
  |  Branch (7057:8): [True: 75, False: 177]
  ------------------
 7058|     75|      *x = g.w;
 7059|     75|      *y = g.h;
 7060|       |
 7061|       |      // moved conversion to after successful load so that the same
 7062|       |      // can be done for multiple frames.
 7063|     75|      if (req_comp && req_comp != 4)
  ------------------
  |  Branch (7063:11): [True: 0, False: 75]
  |  Branch (7063:23): [True: 0, False: 0]
  ------------------
 7064|      0|         u = stbi__convert_format(u, 4, req_comp, g.w, g.h);
 7065|    177|   } else if (g.out) {
  ------------------
  |  Branch (7065:15): [True: 87, False: 90]
  ------------------
 7066|       |      // if there was an error and we allocated an image buffer, free it!
 7067|     87|      STBI_FREE(g.out);
  ------------------
  |  |  684|     87|#define STBI_FREE(p)              free(p)
  ------------------
 7068|     87|   }
 7069|       |
 7070|       |   // free buffers needed for multiple frame loading;
 7071|    252|   STBI_FREE(g.history);
  ------------------
  |  |  684|    252|#define STBI_FREE(p)              free(p)
  ------------------
 7072|    252|   STBI_FREE(g.background);
  ------------------
  |  |  684|    252|#define STBI_FREE(p)              free(p)
  ------------------
 7073|       |
 7074|    252|   return u;
 7075|    252|}
OgreSTBICodec.cpp:_ZL19stbi__gif_load_nextP13stbi__contextP9stbi__gifPiiPh:
 6779|    252|{
 6780|    252|   int dispose;
 6781|    252|   int first_frame;
 6782|    252|   int pi;
 6783|    252|   int pcount;
 6784|    252|   STBI_NOTUSED(req_comp);
  ------------------
  |  |  660|    252|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 6785|       |
 6786|       |   // on first frame, any non-written pixels get the background colour (non-transparent)
 6787|    252|   first_frame = 0;
 6788|    252|   if (g->out == 0) {
  ------------------
  |  Branch (6788:8): [True: 252, False: 0]
  ------------------
 6789|    252|      if (!stbi__gif_header(s, g, comp,0)) return 0; // stbi__g_failure_reason set by stbi__gif_header
  ------------------
  |  Branch (6789:11): [True: 90, False: 162]
  ------------------
 6790|    162|      if (!stbi__mad3sizes_valid(4, g->w, g->h, 0))
  ------------------
  |  Branch (6790:11): [True: 0, False: 162]
  ------------------
 6791|      0|         return stbi__errpuc("too large", "GIF image is too large");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6792|    162|      pcount = g->w * g->h;
 6793|    162|      g->out = (stbi_uc *) stbi__malloc(4 * pcount);
 6794|    162|      g->background = (stbi_uc *) stbi__malloc(4 * pcount);
 6795|    162|      g->history = (stbi_uc *) stbi__malloc(pcount);
 6796|    162|      if (!g->out || !g->background || !g->history)
  ------------------
  |  Branch (6796:11): [True: 0, False: 162]
  |  Branch (6796:22): [True: 0, False: 162]
  |  Branch (6796:40): [True: 0, False: 162]
  ------------------
 6797|      0|         return stbi__errpuc("outofmem", "Out of memory");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6798|       |
 6799|       |      // image is treated as "transparent" at the start - ie, nothing overwrites the current background;
 6800|       |      // background colour is only used for pixels that are not rendered first frame, after that "background"
 6801|       |      // color refers to the color that was there the previous frame.
 6802|    162|      memset(g->out, 0x00, 4 * pcount);
 6803|    162|      memset(g->background, 0x00, 4 * pcount); // state of the background (starts transparent)
 6804|    162|      memset(g->history, 0x00, pcount);        // pixels that were affected previous frame
 6805|    162|      first_frame = 1;
 6806|    162|   } else {
 6807|       |      // second frame - how do we dispose of the previous one?
 6808|      0|      dispose = (g->eflags & 0x1C) >> 2;
 6809|      0|      pcount = g->w * g->h;
 6810|       |
 6811|      0|      if ((dispose == 3) && (two_back == 0)) {
  ------------------
  |  Branch (6811:11): [True: 0, False: 0]
  |  Branch (6811:29): [True: 0, False: 0]
  ------------------
 6812|      0|         dispose = 2; // if I don't have an image to revert back to, default to the old background
 6813|      0|      }
 6814|       |
 6815|      0|      if (dispose == 3) { // use previous graphic
  ------------------
  |  Branch (6815:11): [True: 0, False: 0]
  ------------------
 6816|      0|         for (pi = 0; pi < pcount; ++pi) {
  ------------------
  |  Branch (6816:23): [True: 0, False: 0]
  ------------------
 6817|      0|            if (g->history[pi]) {
  ------------------
  |  Branch (6817:17): [True: 0, False: 0]
  ------------------
 6818|      0|               memcpy( &g->out[pi * 4], &two_back[pi * 4], 4 );
 6819|      0|            }
 6820|      0|         }
 6821|      0|      } else if (dispose == 2) {
  ------------------
  |  Branch (6821:18): [True: 0, False: 0]
  ------------------
 6822|       |         // restore what was changed last frame to background before that frame;
 6823|      0|         for (pi = 0; pi < pcount; ++pi) {
  ------------------
  |  Branch (6823:23): [True: 0, False: 0]
  ------------------
 6824|      0|            if (g->history[pi]) {
  ------------------
  |  Branch (6824:17): [True: 0, False: 0]
  ------------------
 6825|      0|               memcpy( &g->out[pi * 4], &g->background[pi * 4], 4 );
 6826|      0|            }
 6827|      0|         }
 6828|      0|      } else {
 6829|       |         // This is a non-disposal case eithe way, so just
 6830|       |         // leave the pixels as is, and they will become the new background
 6831|       |         // 1: do not dispose
 6832|       |         // 0:  not specified.
 6833|      0|      }
 6834|       |
 6835|       |      // background is what out is after the undoing of the previou frame;
 6836|      0|      memcpy( g->background, g->out, 4 * g->w * g->h );
 6837|      0|   }
 6838|       |
 6839|       |   // clear my history;
 6840|    162|   memset( g->history, 0x00, g->w * g->h );        // pixels that were affected previous frame
 6841|       |
 6842|    272|   for (;;) {
 6843|    272|      int tag = stbi__get8(s);
 6844|    272|      switch (tag) {
 6845|    122|         case 0x2C: /* Image Descriptor */
  ------------------
  |  Branch (6845:10): [True: 122, False: 150]
  ------------------
 6846|    122|         {
 6847|    122|            stbi__int32 x, y, w, h;
 6848|    122|            stbi_uc *o;
 6849|       |
 6850|    122|            x = stbi__get16le(s);
 6851|    122|            y = stbi__get16le(s);
 6852|    122|            w = stbi__get16le(s);
 6853|    122|            h = stbi__get16le(s);
 6854|    122|            if (((x + w) > (g->w)) || ((y + h) > (g->h)))
  ------------------
  |  Branch (6854:17): [True: 9, False: 113]
  |  Branch (6854:39): [True: 8, False: 105]
  ------------------
 6855|     17|               return stbi__errpuc("bad Image Descriptor", "Corrupt GIF");
  ------------------
  |  | 1099|     17|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     17|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6856|       |
 6857|    105|            g->line_size = g->w * 4;
 6858|    105|            g->start_x = x * 4;
 6859|    105|            g->start_y = y * g->line_size;
 6860|    105|            g->max_x   = g->start_x + w * 4;
 6861|    105|            g->max_y   = g->start_y + h * g->line_size;
 6862|    105|            g->cur_x   = g->start_x;
 6863|    105|            g->cur_y   = g->start_y;
 6864|       |
 6865|       |            // if the width of the specified rectangle is 0, that means
 6866|       |            // we may not see *any* pixels or the image is malformed;
 6867|       |            // to make sure this is caught, move the current y down to
 6868|       |            // max_y (which is what out_gif_code checks).
 6869|    105|            if (w == 0)
  ------------------
  |  Branch (6869:17): [True: 13, False: 92]
  ------------------
 6870|     13|               g->cur_y = g->max_y;
 6871|       |
 6872|    105|            g->lflags = stbi__get8(s);
 6873|       |
 6874|    105|            if (g->lflags & 0x40) {
  ------------------
  |  Branch (6874:17): [True: 69, False: 36]
  ------------------
 6875|     69|               g->step = 8 * g->line_size; // first interlaced spacing
 6876|     69|               g->parse = 3;
 6877|     69|            } else {
 6878|     36|               g->step = g->line_size;
 6879|     36|               g->parse = 0;
 6880|     36|            }
 6881|       |
 6882|    105|            if (g->lflags & 0x80) {
  ------------------
  |  Branch (6882:17): [True: 68, False: 37]
  ------------------
 6883|     68|               stbi__gif_parse_colortable(s,g->lpal, 2 << (g->lflags & 7), g->eflags & 0x01 ? g->transparent : -1);
  ------------------
  |  Branch (6883:76): [True: 0, False: 68]
  ------------------
 6884|     68|               g->color_table = (stbi_uc *) g->lpal;
 6885|     68|            } else if (g->flags & 0x80) {
  ------------------
  |  Branch (6885:24): [True: 35, False: 2]
  ------------------
 6886|     35|               g->color_table = (stbi_uc *) g->pal;
 6887|     35|            } else
 6888|      2|               return stbi__errpuc("missing color table", "Corrupt GIF");
  ------------------
  |  | 1099|      2|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6889|       |
 6890|    103|            o = stbi__process_gif_raster(s, g);
 6891|    103|            if (!o) return NULL;
  ------------------
  |  Branch (6891:17): [True: 28, False: 75]
  ------------------
 6892|       |
 6893|       |            // if this was the first frame,
 6894|     75|            pcount = g->w * g->h;
 6895|     75|            if (first_frame && (g->bgindex > 0)) {
  ------------------
  |  Branch (6895:17): [True: 75, False: 0]
  |  Branch (6895:32): [True: 74, False: 1]
  ------------------
 6896|       |               // if first frame, any pixel not drawn to gets the background color
 6897|   363M|               for (pi = 0; pi < pcount; ++pi) {
  ------------------
  |  Branch (6897:29): [True: 363M, False: 74]
  ------------------
 6898|   363M|                  if (g->history[pi] == 0) {
  ------------------
  |  Branch (6898:23): [True: 363M, False: 196k]
  ------------------
 6899|   363M|                     g->pal[g->bgindex][3] = 255; // just in case it was made transparent, undo that; It will be reset next frame if need be;
 6900|   363M|                     memcpy( &g->out[pi * 4], &g->pal[g->bgindex], 4 );
 6901|   363M|                  }
 6902|   363M|               }
 6903|     74|            }
 6904|       |
 6905|     75|            return o;
 6906|    103|         }
 6907|       |
 6908|    110|         case 0x21: // Comment Extension.
  ------------------
  |  Branch (6908:10): [True: 110, False: 162]
  ------------------
 6909|    110|         {
 6910|    110|            int len;
 6911|    110|            int ext = stbi__get8(s);
 6912|    110|            if (ext == 0xF9) { // Graphic Control Extension.
  ------------------
  |  Branch (6912:17): [True: 15, False: 95]
  ------------------
 6913|     15|               len = stbi__get8(s);
 6914|     15|               if (len == 4) {
  ------------------
  |  Branch (6914:20): [True: 13, False: 2]
  ------------------
 6915|     13|                  g->eflags = stbi__get8(s);
 6916|     13|                  g->delay = 10 * stbi__get16le(s); // delay - 1/100th of a second, saving as 1/1000ths.
 6917|       |
 6918|       |                  // unset old transparent
 6919|     13|                  if (g->transparent >= 0) {
  ------------------
  |  Branch (6919:23): [True: 0, False: 13]
  ------------------
 6920|      0|                     g->pal[g->transparent][3] = 255;
 6921|      0|                  }
 6922|     13|                  if (g->eflags & 0x01) {
  ------------------
  |  Branch (6922:23): [True: 4, False: 9]
  ------------------
 6923|      4|                     g->transparent = stbi__get8(s);
 6924|      4|                     if (g->transparent >= 0) {
  ------------------
  |  Branch (6924:26): [True: 4, False: 0]
  ------------------
 6925|      4|                        g->pal[g->transparent][3] = 0;
 6926|      4|                     }
 6927|      9|                  } else {
 6928|       |                     // don't need transparent
 6929|      9|                     stbi__skip(s, 1);
 6930|      9|                     g->transparent = -1;
 6931|      9|                  }
 6932|     13|               } else {
 6933|      2|                  stbi__skip(s, len);
 6934|      2|                  break;
 6935|      2|               }
 6936|     15|            }
 6937|    207|            while ((len = stbi__get8(s)) != 0) {
  ------------------
  |  Branch (6937:20): [True: 99, False: 108]
  ------------------
 6938|     99|               stbi__skip(s, len);
 6939|     99|            }
 6940|    108|            break;
 6941|    110|         }
 6942|       |
 6943|      0|         case 0x3B: // gif stream termination code
  ------------------
  |  Branch (6943:10): [True: 0, False: 272]
  ------------------
 6944|      0|            return (stbi_uc *) s; // using '1' causes warning on some compilers
 6945|       |
 6946|     40|         default:
  ------------------
  |  Branch (6946:10): [True: 40, False: 232]
  ------------------
 6947|       |            return stbi__errpuc("unknown code", "Corrupt GIF");
  ------------------
  |  | 1099|     40|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     40|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 40]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6948|    272|      }
 6949|    272|   }
 6950|    162|}
OgreSTBICodec.cpp:_ZL16stbi__gif_headerP13stbi__contextP9stbi__gifPii:
 6609|    252|{
 6610|    252|   stbi_uc version;
 6611|    252|   if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8')
  ------------------
  |  Branch (6611:8): [True: 0, False: 252]
  |  Branch (6611:32): [True: 0, False: 252]
  |  Branch (6611:56): [True: 0, False: 252]
  |  Branch (6611:80): [True: 0, False: 252]
  ------------------
 6612|      0|      return stbi__err("not GIF", "Corrupt GIF");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 6613|       |
 6614|    252|   version = stbi__get8(s);
 6615|    252|   if (version != '7' && version != '9')    return stbi__err("not GIF", "Corrupt GIF");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (6615:8): [True: 227, False: 25]
  |  Branch (6615:26): [True: 0, False: 227]
  ------------------
 6616|    252|   if (stbi__get8(s) != 'a')                return stbi__err("not GIF", "Corrupt GIF");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (6616:8): [True: 0, False: 252]
  ------------------
 6617|       |
 6618|    252|   stbi__g_failure_reason = "";
 6619|    252|   g->w = stbi__get16le(s);
 6620|    252|   g->h = stbi__get16le(s);
 6621|    252|   g->flags = stbi__get8(s);
 6622|    252|   g->bgindex = stbi__get8(s);
 6623|    252|   g->ratio = stbi__get8(s);
 6624|    252|   g->transparent = -1;
 6625|       |
 6626|    252|   if (g->w > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    252|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                 if (g->w > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
  ------------------
  |  | 1095|     35|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (6626:8): [True: 35, False: 217]
  ------------------
 6627|    217|   if (g->h > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    217|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                 if (g->h > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
  ------------------
  |  | 1095|     55|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (6627:8): [True: 55, False: 162]
  ------------------
 6628|       |
 6629|    162|   if (comp != 0) *comp = 4;  // can't actually tell whether it's 3 or 4 until we parse the comments
  ------------------
  |  Branch (6629:8): [True: 162, False: 0]
  ------------------
 6630|       |
 6631|    162|   if (is_info) return 1;
  ------------------
  |  Branch (6631:8): [True: 0, False: 162]
  ------------------
 6632|       |
 6633|    162|   if (g->flags & 0x80)
  ------------------
  |  Branch (6633:8): [True: 50, False: 112]
  ------------------
 6634|     50|      stbi__gif_parse_colortable(s,g->pal, 2 << (g->flags & 7), -1);
 6635|       |
 6636|    162|   return 1;
 6637|    162|}
OgreSTBICodec.cpp:_ZL26stbi__gif_parse_colortableP13stbi__contextPA4_hii:
 6598|    118|{
 6599|    118|   int i;
 6600|  1.52k|   for (i=0; i < num_entries; ++i) {
  ------------------
  |  Branch (6600:14): [True: 1.40k, False: 118]
  ------------------
 6601|  1.40k|      pal[i][2] = stbi__get8(s);
 6602|  1.40k|      pal[i][1] = stbi__get8(s);
 6603|  1.40k|      pal[i][0] = stbi__get8(s);
 6604|  1.40k|      pal[i][3] = transp == i ? 0 : 255;
  ------------------
  |  Branch (6604:19): [True: 0, False: 1.40k]
  ------------------
 6605|  1.40k|   }
 6606|    118|}
OgreSTBICodec.cpp:_ZL24stbi__process_gif_rasterP13stbi__contextP9stbi__gif:
 6692|    103|{
 6693|    103|   stbi_uc lzw_cs;
 6694|    103|   stbi__int32 len, init_code;
 6695|    103|   stbi__uint32 first;
 6696|    103|   stbi__int32 codesize, codemask, avail, oldcode, bits, valid_bits, clear;
 6697|    103|   stbi__gif_lzw *p;
 6698|       |
 6699|    103|   lzw_cs = stbi__get8(s);
 6700|    103|   if (lzw_cs > 12) return NULL;
  ------------------
  |  Branch (6700:8): [True: 4, False: 99]
  ------------------
 6701|     99|   clear = 1 << lzw_cs;
 6702|     99|   first = 1;
 6703|     99|   codesize = lzw_cs + 1;
 6704|     99|   codemask = (1 << codesize) - 1;
 6705|     99|   bits = 0;
 6706|     99|   valid_bits = 0;
 6707|  6.17k|   for (init_code = 0; init_code < clear; init_code++) {
  ------------------
  |  Branch (6707:24): [True: 6.08k, False: 99]
  ------------------
 6708|  6.08k|      g->codes[init_code].prefix = -1;
 6709|  6.08k|      g->codes[init_code].first = (stbi_uc) init_code;
 6710|  6.08k|      g->codes[init_code].suffix = (stbi_uc) init_code;
 6711|  6.08k|   }
 6712|       |
 6713|       |   // support no starting clear code
 6714|     99|   avail = clear+2;
 6715|     99|   oldcode = -1;
 6716|       |
 6717|     99|   len = 0;
 6718|   120k|   for(;;) {
 6719|   120k|      if (valid_bits < codesize) {
  ------------------
  |  Branch (6719:11): [True: 63.3k, False: 56.9k]
  ------------------
 6720|  63.3k|         if (len == 0) {
  ------------------
  |  Branch (6720:14): [True: 798, False: 62.5k]
  ------------------
 6721|    798|            len = stbi__get8(s); // start new block
 6722|    798|            if (len == 0)
  ------------------
  |  Branch (6722:17): [True: 48, False: 750]
  ------------------
 6723|     48|               return g->out;
 6724|    798|         }
 6725|  63.2k|         --len;
 6726|  63.2k|         bits |= (stbi__int32) stbi__get8(s) << valid_bits;
 6727|  63.2k|         valid_bits += 8;
 6728|  63.2k|      } else {
 6729|  56.9k|         stbi__int32 code = bits & codemask;
 6730|  56.9k|         bits >>= codesize;
 6731|  56.9k|         valid_bits -= codesize;
 6732|       |         // @OPTIMIZE: is there some way we can accelerate the non-clear path?
 6733|  56.9k|         if (code == clear) {  // clear code
  ------------------
  |  Branch (6733:14): [True: 1.50k, False: 55.4k]
  ------------------
 6734|  1.50k|            codesize = lzw_cs + 1;
 6735|  1.50k|            codemask = (1 << codesize) - 1;
 6736|  1.50k|            avail = clear + 2;
 6737|  1.50k|            oldcode = -1;
 6738|  1.50k|            first = 0;
 6739|  55.4k|         } else if (code == clear + 1) { // end of stream code
  ------------------
  |  Branch (6739:21): [True: 27, False: 55.4k]
  ------------------
 6740|     27|            stbi__skip(s, len);
 6741|    107|            while ((len = stbi__get8(s)) > 0)
  ------------------
  |  Branch (6741:20): [True: 80, False: 27]
  ------------------
 6742|     80|               stbi__skip(s,len);
 6743|     27|            return g->out;
 6744|  55.4k|         } else if (code <= avail) {
  ------------------
  |  Branch (6744:21): [True: 55.4k, False: 18]
  ------------------
 6745|  55.4k|            if (first) {
  ------------------
  |  Branch (6745:17): [True: 3, False: 55.4k]
  ------------------
 6746|      3|               return stbi__errpuc("no clear code", "Corrupt GIF");
  ------------------
  |  | 1099|      3|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      3|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6747|      3|            }
 6748|       |
 6749|  55.4k|            if (oldcode >= 0) {
  ------------------
  |  Branch (6749:17): [True: 54.9k, False: 498]
  ------------------
 6750|  54.9k|               p = &g->codes[avail++];
 6751|  54.9k|               if (avail > 8192) {
  ------------------
  |  Branch (6751:20): [True: 1, False: 54.9k]
  ------------------
 6752|      1|                  return stbi__errpuc("too many codes", "Corrupt GIF");
  ------------------
  |  | 1099|      1|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6753|      1|               }
 6754|       |
 6755|  54.9k|               p->prefix = (stbi__int16) oldcode;
 6756|  54.9k|               p->first = g->codes[oldcode].first;
 6757|  54.9k|               p->suffix = (code == avail) ? p->first : g->codes[code].first;
  ------------------
  |  Branch (6757:28): [True: 0, False: 54.9k]
  ------------------
 6758|  54.9k|            } else if (code == avail)
  ------------------
  |  Branch (6758:24): [True: 2, False: 496]
  ------------------
 6759|      2|               return stbi__errpuc("illegal code in raster", "Corrupt GIF");
  ------------------
  |  | 1099|      2|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6760|       |
 6761|  55.4k|            stbi__out_gif_code(g, (stbi__uint16) code);
 6762|       |
 6763|  55.4k|            if ((avail & codemask) == 0 && avail <= 0x0FFF) {
  ------------------
  |  Branch (6763:17): [True: 861, False: 54.5k]
  |  Branch (6763:44): [True: 852, False: 9]
  ------------------
 6764|    852|               codesize++;
 6765|    852|               codemask = (1 << codesize) - 1;
 6766|    852|            }
 6767|       |
 6768|  55.4k|            oldcode = code;
 6769|  55.4k|         } else {
 6770|       |            return stbi__errpuc("illegal code in raster", "Corrupt GIF");
  ------------------
  |  | 1099|     18|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     18|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6771|     18|         }
 6772|  56.9k|      }
 6773|   120k|   }
 6774|     99|}
OgreSTBICodec.cpp:_ZL18stbi__out_gif_codeP9stbi__gift:
 6655|   257k|{
 6656|   257k|   stbi_uc *p, *c;
 6657|   257k|   int idx;
 6658|       |
 6659|       |   // recurse to decode the prefixes, since the linked-list is backwards,
 6660|       |   // and working backwards through an interleaved image would be nasty
 6661|   257k|   if (g->codes[code].prefix >= 0)
  ------------------
  |  Branch (6661:8): [True: 201k, False: 55.4k]
  ------------------
 6662|   201k|      stbi__out_gif_code(g, g->codes[code].prefix);
 6663|       |
 6664|   257k|   if (g->cur_y >= g->max_y) return;
  ------------------
  |  Branch (6664:8): [True: 3.36k, False: 253k]
  ------------------
 6665|       |
 6666|   253k|   idx = g->cur_x + g->cur_y;
 6667|   253k|   p = &g->out[idx];
 6668|   253k|   g->history[idx / 4] = 1;
 6669|       |
 6670|   253k|   c = &g->color_table[g->codes[code].suffix * 4];
 6671|   253k|   if (c[3] > 128) { // don't render transparent pixels;
  ------------------
  |  Branch (6671:8): [True: 251k, False: 2.10k]
  ------------------
 6672|   251k|      p[0] = c[2];
 6673|   251k|      p[1] = c[1];
 6674|   251k|      p[2] = c[0];
 6675|   251k|      p[3] = c[3];
 6676|   251k|   }
 6677|   253k|   g->cur_x += 4;
 6678|       |
 6679|   253k|   if (g->cur_x >= g->max_x) {
  ------------------
  |  Branch (6679:8): [True: 4.97k, False: 248k]
  ------------------
 6680|  4.97k|      g->cur_x = g->start_x;
 6681|  4.97k|      g->cur_y += g->step;
 6682|       |
 6683|  5.00k|      while (g->cur_y >= g->max_y && g->parse > 0) {
  ------------------
  |  Branch (6683:14): [True: 38, False: 4.97k]
  |  Branch (6683:38): [True: 33, False: 5]
  ------------------
 6684|     33|         g->step = (1 << g->parse) * g->line_size;
 6685|     33|         g->cur_y = g->start_y + (g->step >> 1);
 6686|     33|         --g->parse;
 6687|     33|      }
 6688|  4.97k|   }
 6689|   253k|}
OgreSTBICodec.cpp:_ZL14stbi__psd_testP13stbi__context:
 6082|  2.92k|{
 6083|  2.92k|   int r = (stbi__get32be(s) == 0x38425053);
 6084|  2.92k|   stbi__rewind(s);
 6085|  2.92k|   return r;
 6086|  2.92k|}
OgreSTBICodec.cpp:_ZL14stbi__psd_loadP13stbi__contextPiS1_S1_iP17stbi__result_infoi:
 6127|    260|{
 6128|    260|   int pixelCount;
 6129|    260|   int channelCount, compression;
 6130|    260|   int channel, i;
 6131|    260|   int bitdepth;
 6132|    260|   int w,h;
 6133|    260|   stbi_uc *out;
 6134|    260|   STBI_NOTUSED(ri);
  ------------------
  |  |  660|    260|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 6135|       |
 6136|       |   // Check identifier
 6137|    260|   if (stbi__get32be(s) != 0x38425053)   // "8BPS"
  ------------------
  |  Branch (6137:8): [True: 0, False: 260]
  ------------------
 6138|      0|      return stbi__errpuc("not PSD", "Corrupt PSD image");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6139|       |
 6140|       |   // Check file type version.
 6141|    260|   if (stbi__get16be(s) != 1)
  ------------------
  |  Branch (6141:8): [True: 10, False: 250]
  ------------------
 6142|     10|      return stbi__errpuc("wrong version", "Unsupported version of PSD image");
  ------------------
  |  | 1099|     10|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     10|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6143|       |
 6144|       |   // Skip 6 reserved bytes.
 6145|    250|   stbi__skip(s, 6 );
 6146|       |
 6147|       |   // Read the number of channels (R, G, B, A, etc).
 6148|    250|   channelCount = stbi__get16be(s);
 6149|    250|   if (channelCount < 0 || channelCount > 16)
  ------------------
  |  Branch (6149:8): [True: 0, False: 250]
  |  Branch (6149:28): [True: 11, False: 239]
  ------------------
 6150|     11|      return stbi__errpuc("wrong channel count", "Unsupported number of channels in PSD image");
  ------------------
  |  | 1099|     11|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     11|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6151|       |
 6152|       |   // Read the rows and columns of the image.
 6153|    239|   h = stbi__get32be(s);
 6154|    239|   w = stbi__get32be(s);
 6155|       |
 6156|    239|   if (h > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    239|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                 if (h > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  | 1099|     52|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     52|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 52]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6156:8): [True: 52, False: 187]
  ------------------
 6157|    187|   if (w > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    187|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                 if (w > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  | 1099|     64|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     64|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 64]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6157:8): [True: 64, False: 123]
  ------------------
 6158|       |
 6159|       |   // Make sure the depth is 8 bits.
 6160|    123|   bitdepth = stbi__get16be(s);
 6161|    123|   if (bitdepth != 8 && bitdepth != 16)
  ------------------
  |  Branch (6161:8): [True: 103, False: 20]
  |  Branch (6161:25): [True: 20, False: 83]
  ------------------
 6162|     20|      return stbi__errpuc("unsupported bit depth", "PSD bit depth is not 8 or 16 bit");
  ------------------
  |  | 1099|     20|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     20|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6163|       |
 6164|       |   // Make sure the color mode is RGB.
 6165|       |   // Valid options are:
 6166|       |   //   0: Bitmap
 6167|       |   //   1: Grayscale
 6168|       |   //   2: Indexed color
 6169|       |   //   3: RGB color
 6170|       |   //   4: CMYK color
 6171|       |   //   7: Multichannel
 6172|       |   //   8: Duotone
 6173|       |   //   9: Lab color
 6174|    103|   if (stbi__get16be(s) != 3)
  ------------------
  |  Branch (6174:8): [True: 1, False: 102]
  ------------------
 6175|      1|      return stbi__errpuc("wrong color format", "PSD is not in RGB color format");
  ------------------
  |  | 1099|      1|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6176|       |
 6177|       |   // Skip the Mode Data.  (It's the palette for indexed color; other info for other modes.)
 6178|    102|   stbi__skip(s,stbi__get32be(s) );
 6179|       |
 6180|       |   // Skip the image resources.  (resolution, pen tool paths, etc)
 6181|    102|   stbi__skip(s, stbi__get32be(s) );
 6182|       |
 6183|       |   // Skip the reserved data.
 6184|    102|   stbi__skip(s, stbi__get32be(s) );
 6185|       |
 6186|       |   // Find out if the data is compressed.
 6187|       |   // Known values:
 6188|       |   //   0: no compression
 6189|       |   //   1: RLE compressed
 6190|    102|   compression = stbi__get16be(s);
 6191|    102|   if (compression > 1)
  ------------------
  |  Branch (6191:8): [True: 1, False: 101]
  ------------------
 6192|      1|      return stbi__errpuc("bad compression", "PSD has an unknown compression format");
  ------------------
  |  | 1099|      1|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6193|       |
 6194|       |   // Check size
 6195|    101|   if (!stbi__mad3sizes_valid(4, w, h, 0))
  ------------------
  |  Branch (6195:8): [True: 8, False: 93]
  ------------------
 6196|      8|      return stbi__errpuc("too large", "Corrupt PSD");
  ------------------
  |  | 1099|      8|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      8|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6197|       |
 6198|       |   // Create the destination image.
 6199|       |
 6200|     93|   if (!compression && bitdepth == 16 && bpc == 16) {
  ------------------
  |  Branch (6200:8): [True: 45, False: 48]
  |  Branch (6200:24): [True: 38, False: 7]
  |  Branch (6200:42): [True: 0, False: 38]
  ------------------
 6201|      0|      out = (stbi_uc *) stbi__malloc_mad3(8, w, h, 0);
 6202|      0|      ri->bits_per_channel = 16;
 6203|      0|   } else
 6204|     93|      out = (stbi_uc *) stbi__malloc(4 * w*h);
 6205|       |
 6206|     93|   if (!out) return stbi__errpuc("outofmem", "Out of memory");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6206:8): [True: 0, False: 93]
  ------------------
 6207|     93|   pixelCount = w*h;
 6208|       |
 6209|       |   // Initialize the data to zero.
 6210|       |   //memset( out, 0, pixelCount * 4 );
 6211|       |
 6212|       |   // Finally, the image data.
 6213|     93|   if (compression) {
  ------------------
  |  Branch (6213:8): [True: 48, False: 45]
  ------------------
 6214|       |      // RLE as used by .PSD and .TIFF
 6215|       |      // Loop until you get the number of unpacked bytes you are expecting:
 6216|       |      //     Read the next source byte into n.
 6217|       |      //     If n is between 0 and 127 inclusive, copy the next n+1 bytes literally.
 6218|       |      //     Else if n is between -127 and -1 inclusive, copy the next byte -n+1 times.
 6219|       |      //     Else if n is 128, noop.
 6220|       |      // Endloop
 6221|       |
 6222|       |      // The RLE-compressed data is preceded by a 2-byte data count for each row in the data,
 6223|       |      // which we're going to just skip.
 6224|     48|      stbi__skip(s, h * channelCount * 2 );
 6225|       |
 6226|       |      // Read the RLE data by channel.
 6227|    216|      for (channel = 0; channel < 4; channel++) {
  ------------------
  |  Branch (6227:25): [True: 175, False: 41]
  ------------------
 6228|    175|         stbi_uc *p;
 6229|       |
 6230|    175|         p = out+channel;
 6231|    175|         if (channel >= channelCount) {
  ------------------
  |  Branch (6231:14): [True: 97, False: 78]
  ------------------
 6232|       |            // Fill this channel with default data.
 6233|  4.34M|            for (i = 0; i < pixelCount; i++, p += 4)
  ------------------
  |  Branch (6233:25): [True: 4.34M, False: 97]
  ------------------
 6234|  4.34M|               *p = (channel == 3 ? 255 : 0);
  ------------------
  |  Branch (6234:22): [True: 1.53M, False: 2.81M]
  ------------------
 6235|     97|         } else {
 6236|       |            // Read the RLE data.
 6237|     78|            if (!stbi__psd_decode_rle(s, p, pixelCount)) {
  ------------------
  |  Branch (6237:17): [True: 7, False: 71]
  ------------------
 6238|      7|               STBI_FREE(out);
  ------------------
  |  |  684|      7|#define STBI_FREE(p)              free(p)
  ------------------
 6239|      7|               return stbi__errpuc("corrupt", "bad RLE data");
  ------------------
  |  | 1099|      7|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      7|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6240|      7|            }
 6241|     78|         }
 6242|    175|      }
 6243|       |
 6244|     48|   } else {
 6245|       |      // We're at the raw image data.  It's each channel in order (Red, Green, Blue, Alpha, ...)
 6246|       |      // where each channel consists of an 8-bit (or 16-bit) value for each pixel in the image.
 6247|       |
 6248|       |      // Read the data by channel.
 6249|    225|      for (channel = 0; channel < 4; channel++) {
  ------------------
  |  Branch (6249:25): [True: 180, False: 45]
  ------------------
 6250|    180|         if (channel >= channelCount) {
  ------------------
  |  Branch (6250:14): [True: 52, False: 128]
  ------------------
 6251|       |            // Fill this channel with default data.
 6252|     52|            if (bitdepth == 16 && bpc == 16) {
  ------------------
  |  Branch (6252:17): [True: 34, False: 18]
  |  Branch (6252:35): [True: 0, False: 34]
  ------------------
 6253|      0|               stbi__uint16 *q = ((stbi__uint16 *) out) + channel;
 6254|      0|               stbi__uint16 val = channel == 3 ? 65535 : 0;
  ------------------
  |  Branch (6254:35): [True: 0, False: 0]
  ------------------
 6255|      0|               for (i = 0; i < pixelCount; i++, q += 4)
  ------------------
  |  Branch (6255:28): [True: 0, False: 0]
  ------------------
 6256|      0|                  *q = val;
 6257|     52|            } else {
 6258|     52|               stbi_uc *p = out+channel;
 6259|     52|               stbi_uc val = channel == 3 ? 255 : 0;
  ------------------
  |  Branch (6259:30): [True: 19, False: 33]
  ------------------
 6260|  31.9M|               for (i = 0; i < pixelCount; i++, p += 4)
  ------------------
  |  Branch (6260:28): [True: 31.9M, False: 52]
  ------------------
 6261|  31.9M|                  *p = val;
 6262|     52|            }
 6263|    128|         } else {
 6264|    128|            if (ri->bits_per_channel == 16) {    // output bpc
  ------------------
  |  Branch (6264:17): [True: 0, False: 128]
  ------------------
 6265|      0|               stbi__uint16 *q = ((stbi__uint16 *) out) + channel;
 6266|      0|               for (i = 0; i < pixelCount; i++, q += 4)
  ------------------
  |  Branch (6266:28): [True: 0, False: 0]
  ------------------
 6267|      0|                  *q = (stbi__uint16) stbi__get16be(s);
 6268|    128|            } else {
 6269|    128|               stbi_uc *p = out+channel;
 6270|    128|               if (bitdepth == 16) {  // input bpc
  ------------------
  |  Branch (6270:20): [True: 118, False: 10]
  ------------------
 6271|   752k|                  for (i = 0; i < pixelCount; i++, p += 4)
  ------------------
  |  Branch (6271:31): [True: 752k, False: 118]
  ------------------
 6272|   752k|                     *p = (stbi_uc) (stbi__get16be(s) >> 8);
 6273|    118|               } else {
 6274|  64.9k|                  for (i = 0; i < pixelCount; i++, p += 4)
  ------------------
  |  Branch (6274:31): [True: 64.9k, False: 10]
  ------------------
 6275|  64.9k|                     *p = stbi__get8(s);
 6276|     10|               }
 6277|    128|            }
 6278|    128|         }
 6279|    180|      }
 6280|     45|   }
 6281|       |
 6282|       |   // remove weird white matte from PSD
 6283|     86|   if (channelCount >= 4) {
  ------------------
  |  Branch (6283:8): [True: 31, False: 55]
  ------------------
 6284|     31|      if (ri->bits_per_channel == 16) {
  ------------------
  |  Branch (6284:11): [True: 0, False: 31]
  ------------------
 6285|      0|         for (i=0; i < w*h; ++i) {
  ------------------
  |  Branch (6285:20): [True: 0, False: 0]
  ------------------
 6286|      0|            stbi__uint16 *pixel = (stbi__uint16 *) out + 4*i;
 6287|      0|            if (pixel[3] != 0 && pixel[3] != 65535) {
  ------------------
  |  Branch (6287:17): [True: 0, False: 0]
  |  Branch (6287:34): [True: 0, False: 0]
  ------------------
 6288|      0|               float a = pixel[3] / 65535.0f;
 6289|      0|               float ra = 1.0f / a;
 6290|      0|               float inv_a = 65535.0f * (1 - ra);
 6291|      0|               pixel[0] = (stbi__uint16) (pixel[0]*ra + inv_a);
 6292|      0|               pixel[1] = (stbi__uint16) (pixel[1]*ra + inv_a);
 6293|      0|               pixel[2] = (stbi__uint16) (pixel[2]*ra + inv_a);
 6294|      0|            }
 6295|      0|         }
 6296|     31|      } else {
 6297|   132k|         for (i=0; i < w*h; ++i) {
  ------------------
  |  Branch (6297:20): [True: 132k, False: 31]
  ------------------
 6298|   132k|            unsigned char *pixel = out + 4*i;
 6299|   132k|            if (pixel[3] != 0 && pixel[3] != 255) {
  ------------------
  |  Branch (6299:17): [True: 404, False: 132k]
  |  Branch (6299:34): [True: 154, False: 250]
  ------------------
 6300|    154|               float a = pixel[3] / 255.0f;
 6301|    154|               float ra = 1.0f / a;
 6302|    154|               float inv_a = 255.0f * (1 - ra);
 6303|    154|               pixel[0] = (unsigned char) (pixel[0]*ra + inv_a);
 6304|    154|               pixel[1] = (unsigned char) (pixel[1]*ra + inv_a);
 6305|    154|               pixel[2] = (unsigned char) (pixel[2]*ra + inv_a);
 6306|    154|            }
 6307|   132k|         }
 6308|     31|      }
 6309|     31|   }
 6310|       |
 6311|       |   // convert to desired output format
 6312|     86|   if (req_comp && req_comp != 4) {
  ------------------
  |  Branch (6312:8): [True: 0, False: 86]
  |  Branch (6312:20): [True: 0, False: 0]
  ------------------
 6313|      0|      if (ri->bits_per_channel == 16)
  ------------------
  |  Branch (6313:11): [True: 0, False: 0]
  ------------------
 6314|      0|         out = (stbi_uc *) stbi__convert_format16((stbi__uint16 *) out, 4, req_comp, w, h);
 6315|      0|      else
 6316|      0|         out = stbi__convert_format(out, 4, req_comp, w, h);
 6317|      0|      if (out == NULL) return out; // stbi__convert_format frees input on failure
  ------------------
  |  Branch (6317:11): [True: 0, False: 0]
  ------------------
 6318|      0|   }
 6319|       |
 6320|     86|   if (comp) *comp = 4;
  ------------------
  |  Branch (6320:8): [True: 86, False: 0]
  ------------------
 6321|     86|   *y = h;
 6322|     86|   *x = w;
 6323|       |
 6324|     86|   return out;
 6325|     86|}
OgreSTBICodec.cpp:_ZL20stbi__psd_decode_rleP13stbi__contextPhi:
 6089|     78|{
 6090|     78|   int count, nleft, len;
 6091|       |
 6092|     78|   count = 0;
 6093|  1.83M|   while ((nleft = pixelCount - count) > 0) {
  ------------------
  |  Branch (6093:11): [True: 1.83M, False: 71]
  ------------------
 6094|  1.83M|      len = stbi__get8(s);
 6095|  1.83M|      if (len == 128) {
  ------------------
  |  Branch (6095:11): [True: 486, False: 1.83M]
  ------------------
 6096|       |         // No-op.
 6097|  1.83M|      } else if (len < 128) {
  ------------------
  |  Branch (6097:18): [True: 1.83M, False: 800]
  ------------------
 6098|       |         // Copy next len+1 bytes literally.
 6099|  1.83M|         len++;
 6100|  1.83M|         if (len > nleft) return 0; // corrupt data
  ------------------
  |  Branch (6100:14): [True: 3, False: 1.83M]
  ------------------
 6101|  1.83M|         count += len;
 6102|  3.67M|         while (len) {
  ------------------
  |  Branch (6102:17): [True: 1.84M, False: 1.83M]
  ------------------
 6103|  1.84M|            *p = stbi__get8(s);
 6104|  1.84M|            p += 4;
 6105|  1.84M|            len--;
 6106|  1.84M|         }
 6107|  1.83M|      } else if (len > 128) {
  ------------------
  |  Branch (6107:18): [True: 800, False: 0]
  ------------------
 6108|    800|         stbi_uc   val;
 6109|       |         // Next -len+1 bytes in the dest are replicated from next source byte.
 6110|       |         // (Interpret len as a negative 8-bit int.)
 6111|    800|         len = 257 - len;
 6112|    800|         if (len > nleft) return 0; // corrupt data
  ------------------
  |  Branch (6112:14): [True: 4, False: 796]
  ------------------
 6113|    796|         val = stbi__get8(s);
 6114|    796|         count += len;
 6115|  39.9k|         while (len) {
  ------------------
  |  Branch (6115:17): [True: 39.1k, False: 796]
  ------------------
 6116|  39.1k|            *p = val;
 6117|  39.1k|            p += 4;
 6118|  39.1k|            len--;
 6119|  39.1k|         }
 6120|    796|      }
 6121|  1.83M|   }
 6122|       |
 6123|     71|   return 1;
 6124|     78|}
OgreSTBICodec.cpp:_ZL14stbi__pic_testP13stbi__context:
 6542|  2.66k|{
 6543|  2.66k|   int r = stbi__pic_test_core(s);
 6544|  2.66k|   stbi__rewind(s);
 6545|  2.66k|   return r;
 6546|  2.66k|}
OgreSTBICodec.cpp:_ZL19stbi__pic_test_coreP13stbi__context:
 6347|  2.66k|{
 6348|  2.66k|   int i;
 6349|       |
 6350|  2.66k|   if (!stbi__pic_is4(s,"\x53\x80\xF6\x34"))
  ------------------
  |  Branch (6350:8): [True: 2.50k, False: 164]
  ------------------
 6351|  2.50k|      return 0;
 6352|       |
 6353|  13.9k|   for(i=0;i<84;++i)
  ------------------
  |  Branch (6353:12): [True: 13.7k, False: 164]
  ------------------
 6354|  13.7k|      stbi__get8(s);
 6355|       |
 6356|    164|   if (!stbi__pic_is4(s,"PICT"))
  ------------------
  |  Branch (6356:8): [True: 14, False: 150]
  ------------------
 6357|     14|      return 0;
 6358|       |
 6359|    150|   return 1;
 6360|    164|}
OgreSTBICodec.cpp:_ZL13stbi__pic_is4P13stbi__contextPKc:
 6337|  2.83k|{
 6338|  2.83k|   int i;
 6339|  4.09k|   for (i=0; i<4; ++i)
  ------------------
  |  Branch (6339:14): [True: 3.78k, False: 314]
  ------------------
 6340|  3.78k|      if (stbi__get8(s) != (stbi_uc)str[i])
  ------------------
  |  Branch (6340:11): [True: 2.51k, False: 1.26k]
  ------------------
 6341|  2.51k|         return 0;
 6342|       |
 6343|    314|   return 1;
 6344|  2.83k|}
OgreSTBICodec.cpp:_ZL14stbi__pic_loadP13stbi__contextPiS1_S1_iP17stbi__result_info:
 6501|    150|{
 6502|    150|   stbi_uc *result;
 6503|    150|   int i, x,y, internal_comp;
 6504|    150|   STBI_NOTUSED(ri);
  ------------------
  |  |  660|    150|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 6505|       |
 6506|    150|   if (!comp) comp = &internal_comp;
  ------------------
  |  Branch (6506:8): [True: 0, False: 150]
  ------------------
 6507|       |
 6508|  13.9k|   for (i=0; i<92; ++i)
  ------------------
  |  Branch (6508:14): [True: 13.8k, False: 150]
  ------------------
 6509|  13.8k|      stbi__get8(s);
 6510|       |
 6511|    150|   x = stbi__get16be(s);
 6512|    150|   y = stbi__get16be(s);
 6513|       |
 6514|    150|   if (y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    150|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                 if (y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  | 1099|     28|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     28|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 28]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6514:8): [True: 28, False: 122]
  ------------------
 6515|    122|   if (x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    122|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                 if (x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  | 1099|     91|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     91|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 91]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6515:8): [True: 91, False: 31]
  ------------------
 6516|       |
 6517|     31|   if (stbi__at_eof(s))  return stbi__errpuc("bad file","file too short (pic header)");
  ------------------
  |  | 1099|      1|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6517:8): [True: 1, False: 30]
  ------------------
 6518|     30|   if (!stbi__mad3sizes_valid(x, y, 4, 0)) return stbi__errpuc("too large", "PIC image too large to decode");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6518:8): [True: 0, False: 30]
  ------------------
 6519|       |
 6520|     30|   stbi__get32be(s); //skip `ratio'
 6521|     30|   stbi__get16be(s); //skip `fields'
 6522|     30|   stbi__get16be(s); //skip `pad'
 6523|       |
 6524|       |   // intermediate buffer is RGBA
 6525|     30|   result = (stbi_uc *) stbi__malloc_mad3(x, y, 4, 0);
 6526|     30|   if (!result) return stbi__errpuc("outofmem", "Out of memory");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6526:8): [True: 0, False: 30]
  ------------------
 6527|     30|   memset(result, 0xff, x*y*4);
 6528|       |
 6529|     30|   if (!stbi__pic_load_core(s,x,y,comp, result)) {
  ------------------
  |  Branch (6529:8): [True: 28, False: 2]
  ------------------
 6530|     28|      STBI_FREE(result);
  ------------------
  |  |  684|     28|#define STBI_FREE(p)              free(p)
  ------------------
 6531|     28|      result=0;
 6532|     28|   }
 6533|     30|   *px = x;
 6534|     30|   *py = y;
 6535|     30|   if (req_comp == 0) req_comp = *comp;
  ------------------
  |  Branch (6535:8): [True: 30, False: 0]
  ------------------
 6536|     30|   result=stbi__convert_format(result,4,req_comp,x,y);
 6537|       |
 6538|     30|   return result;
 6539|     30|}
OgreSTBICodec.cpp:_ZL12stbi__at_eofP13stbi__context:
 1629|   289k|{
 1630|   289k|   if (s->io.read) {
  ------------------
  |  Branch (1630:8): [True: 0, False: 289k]
  ------------------
 1631|      0|      if (!(s->io.eof)(s->io_user_data)) return 0;
  ------------------
  |  Branch (1631:11): [True: 0, False: 0]
  ------------------
 1632|       |      // if feof() is true, check if buffer = end
 1633|       |      // special case: we've only got the special 0 character at the end
 1634|      0|      if (s->read_from_callbacks == 0) return 1;
  ------------------
  |  Branch (1634:11): [True: 0, False: 0]
  ------------------
 1635|      0|   }
 1636|       |
 1637|   289k|   return s->img_buffer >= s->img_buffer_end;
 1638|   289k|}
OgreSTBICodec.cpp:_ZL19stbi__pic_load_coreP13stbi__contextiiPiPh:
 6391|     30|{
 6392|     30|   int act_comp=0,num_packets=0,y,chained;
 6393|     30|   stbi__pic_packet packets[10];
 6394|       |
 6395|       |   // this will (should...) cater for even some bizarre stuff like having data
 6396|       |    // for the same channel in multiple packets.
 6397|     30|   do {
 6398|     30|      stbi__pic_packet *packet;
 6399|       |
 6400|     30|      if (num_packets==sizeof(packets)/sizeof(packets[0]))
  ------------------
  |  Branch (6400:11): [True: 0, False: 30]
  ------------------
 6401|      0|         return stbi__errpuc("bad format","too many packets");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6402|       |
 6403|     30|      packet = &packets[num_packets++];
 6404|       |
 6405|     30|      chained = stbi__get8(s);
 6406|     30|      packet->size    = stbi__get8(s);
 6407|     30|      packet->type    = stbi__get8(s);
 6408|     30|      packet->channel = stbi__get8(s);
 6409|       |
 6410|     30|      act_comp |= packet->channel;
 6411|       |
 6412|     30|      if (stbi__at_eof(s))          return stbi__errpuc("bad file","file too short (reading packets)");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6412:11): [True: 0, False: 30]
  ------------------
 6413|     30|      if (packet->size != 8)  return stbi__errpuc("bad format","packet isn't 8bpp");
  ------------------
  |  | 1099|      4|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      4|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6413:11): [True: 4, False: 26]
  ------------------
 6414|     30|   } while (chained);
  ------------------
  |  Branch (6414:13): [True: 0, False: 26]
  ------------------
 6415|       |
 6416|     26|   *comp = (act_comp & 0x10 ? 4 : 3); // has alpha channel?
  ------------------
  |  Branch (6416:13): [True: 24, False: 2]
  ------------------
 6417|       |
 6418|  7.84k|   for(y=0; y<height; ++y) {
  ------------------
  |  Branch (6418:13): [True: 7.84k, False: 2]
  ------------------
 6419|  7.84k|      int packet_idx;
 6420|       |
 6421|  15.6k|      for(packet_idx=0; packet_idx < num_packets; ++packet_idx) {
  ------------------
  |  Branch (6421:25): [True: 7.84k, False: 7.82k]
  ------------------
 6422|  7.84k|         stbi__pic_packet *packet = &packets[packet_idx];
 6423|  7.84k|         stbi_uc *dest = result+y*width*4;
 6424|       |
 6425|  7.84k|         switch (packet->type) {
 6426|      0|            default:
  ------------------
  |  Branch (6426:13): [True: 0, False: 7.84k]
  ------------------
 6427|      0|               return stbi__errpuc("bad format","packet has bad compression type");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6428|       |
 6429|  7.62k|            case 0: {//uncompressed
  ------------------
  |  Branch (6429:13): [True: 7.62k, False: 223]
  ------------------
 6430|  7.62k|               int x;
 6431|       |
 6432|  2.09M|               for(x=0;x<width;++x, dest+=4)
  ------------------
  |  Branch (6432:24): [True: 2.08M, False: 7.62k]
  ------------------
 6433|  2.08M|                  if (!stbi__readval(s,packet->channel,dest))
  ------------------
  |  Branch (6433:23): [True: 0, False: 2.08M]
  ------------------
 6434|      0|                     return 0;
 6435|  7.62k|               break;
 6436|  7.62k|            }
 6437|       |
 6438|  7.62k|            case 1://Pure RLE
  ------------------
  |  Branch (6438:13): [True: 221, False: 7.62k]
  ------------------
 6439|    221|               {
 6440|    221|                  int left=width, i;
 6441|       |
 6442|  2.81k|                  while (left>0) {
  ------------------
  |  Branch (6442:26): [True: 2.61k, False: 199]
  ------------------
 6443|  2.61k|                     stbi_uc count,value[4];
 6444|       |
 6445|  2.61k|                     count=stbi__get8(s);
 6446|  2.61k|                     if (stbi__at_eof(s))   return stbi__errpuc("bad file","file too short (pure read count)");
  ------------------
  |  | 1099|     18|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     18|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6446:26): [True: 18, False: 2.59k]
  ------------------
 6447|       |
 6448|  2.59k|                     if (count > left)
  ------------------
  |  Branch (6448:26): [True: 162, False: 2.43k]
  ------------------
 6449|    162|                        count = (stbi_uc) left;
 6450|       |
 6451|  2.59k|                     if (!stbi__readval(s,packet->channel,value))  return 0;
  ------------------
  |  Branch (6451:26): [True: 4, False: 2.59k]
  ------------------
 6452|       |
 6453|   216k|                     for(i=0; i<count; ++i,dest+=4)
  ------------------
  |  Branch (6453:31): [True: 213k, False: 2.59k]
  ------------------
 6454|   213k|                        stbi__copyval(packet->channel,dest,value);
 6455|  2.59k|                     left -= count;
 6456|  2.59k|                  }
 6457|    221|               }
 6458|    199|               break;
 6459|       |
 6460|    199|            case 2: {//Mixed RLE
  ------------------
  |  Branch (6460:13): [True: 2, False: 7.84k]
  ------------------
 6461|      2|               int left=width;
 6462|      8|               while (left>0) {
  ------------------
  |  Branch (6462:23): [True: 8, False: 0]
  ------------------
 6463|      8|                  int count = stbi__get8(s), i;
 6464|      8|                  if (stbi__at_eof(s))  return stbi__errpuc("bad file","file too short (mixed read count)");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6464:23): [True: 0, False: 8]
  ------------------
 6465|       |
 6466|      8|                  if (count >= 128) { // Repeated
  ------------------
  |  Branch (6466:23): [True: 5, False: 3]
  ------------------
 6467|      5|                     stbi_uc value[4];
 6468|       |
 6469|      5|                     if (count==128)
  ------------------
  |  Branch (6469:26): [True: 0, False: 5]
  ------------------
 6470|      0|                        count = stbi__get16be(s);
 6471|      5|                     else
 6472|      5|                        count -= 127;
 6473|      5|                     if (count > left)
  ------------------
  |  Branch (6473:26): [True: 0, False: 5]
  ------------------
 6474|      0|                        return stbi__errpuc("bad file","scanline overrun");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6475|       |
 6476|      5|                     if (!stbi__readval(s,packet->channel,value))
  ------------------
  |  Branch (6476:26): [True: 0, False: 5]
  ------------------
 6477|      0|                        return 0;
 6478|       |
 6479|    537|                     for(i=0;i<count;++i, dest += 4)
  ------------------
  |  Branch (6479:30): [True: 532, False: 5]
  ------------------
 6480|    532|                        stbi__copyval(packet->channel,dest,value);
 6481|      5|                  } else { // Raw
 6482|      3|                     ++count;
 6483|      3|                     if (count>left) return stbi__errpuc("bad file","scanline overrun");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6483:26): [True: 0, False: 3]
  ------------------
 6484|       |
 6485|    156|                     for(i=0;i<count;++i, dest+=4)
  ------------------
  |  Branch (6485:30): [True: 155, False: 1]
  ------------------
 6486|    155|                        if (!stbi__readval(s,packet->channel,dest))
  ------------------
  |  Branch (6486:29): [True: 2, False: 153]
  ------------------
 6487|      2|                           return 0;
 6488|      3|                  }
 6489|      6|                  left-=count;
 6490|      6|               }
 6491|      0|               break;
 6492|      2|            }
 6493|  7.84k|         }
 6494|  7.84k|      }
 6495|  7.84k|   }
 6496|       |
 6497|      2|   return result;
 6498|     26|}
OgreSTBICodec.cpp:_ZL13stbi__readvalP13stbi__contextiPh:
 6368|  2.08M|{
 6369|  2.08M|   int mask=0x80, i;
 6370|       |
 6371|  10.4M|   for (i=0; i<4; ++i, mask>>=1) {
  ------------------
  |  Branch (6371:14): [True: 8.34M, False: 2.08M]
  ------------------
 6372|  8.34M|      if (channel & mask) {
  ------------------
  |  Branch (6372:11): [True: 2.95k, False: 8.33M]
  ------------------
 6373|  2.95k|         if (stbi__at_eof(s)) return stbi__errpuc("bad file","PIC file too short");
  ------------------
  |  | 1099|      6|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      6|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6373:14): [True: 6, False: 2.95k]
  ------------------
 6374|  2.95k|         dest[i]=stbi__get8(s);
 6375|  2.95k|      }
 6376|  8.34M|   }
 6377|       |
 6378|  2.08M|   return dest;
 6379|  2.08M|}
OgreSTBICodec.cpp:_ZL13stbi__copyvaliPhPKh:
 6382|   213k|{
 6383|   213k|   int mask=0x80,i;
 6384|       |
 6385|  1.06M|   for (i=0;i<4; ++i, mask>>=1)
  ------------------
  |  Branch (6385:13): [True: 855k, False: 213k]
  ------------------
 6386|   855k|      if (channel&mask)
  ------------------
  |  Branch (6386:11): [True: 233k, False: 622k]
  ------------------
 6387|   233k|         dest[i]=src[i];
 6388|   213k|}
OgreSTBICodec.cpp:_ZL15stbi__jpeg_testP13stbi__context:
 4043|  2.51k|{
 4044|  2.51k|   int r;
 4045|  2.51k|   stbi__jpeg* j = (stbi__jpeg*)stbi__malloc(sizeof(stbi__jpeg));
 4046|  2.51k|   if (!j) return stbi__err("outofmem", "Out of memory");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (4046:8): [True: 0, False: 2.51k]
  ------------------
 4047|  2.51k|   memset(j, 0, sizeof(stbi__jpeg));
 4048|  2.51k|   j->s = s;
 4049|  2.51k|   stbi__setup_jpeg(j);
 4050|  2.51k|   r = stbi__decode_jpeg_header(j, STBI__SCAN_type);
 4051|  2.51k|   stbi__rewind(s);
 4052|  2.51k|   STBI_FREE(j);
  ------------------
  |  |  684|  2.51k|#define STBI_FREE(p)              free(p)
  ------------------
 4053|  2.51k|   return r;
 4054|  2.51k|}
OgreSTBICodec.cpp:_ZL16stbi__setup_jpegP10stbi__jpeg:
 3822|  3.89k|{
 3823|  3.89k|   j->idct_block_kernel = stbi__idct_block;
 3824|  3.89k|   j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_row;
 3825|  3.89k|   j->resample_row_hv_2_kernel = stbi__resample_row_hv_2;
 3826|       |
 3827|  3.89k|#ifdef STBI_SSE2
 3828|  3.89k|   if (stbi__sse2_available()) {
  ------------------
  |  Branch (3828:8): [True: 3.89k, False: 0]
  ------------------
 3829|  3.89k|      j->idct_block_kernel = stbi__idct_simd;
 3830|  3.89k|      j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd;
 3831|  3.89k|      j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd;
 3832|  3.89k|   }
 3833|  3.89k|#endif
 3834|       |
 3835|       |#ifdef STBI_NEON
 3836|       |   j->idct_block_kernel = stbi__idct_simd;
 3837|       |   j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd;
 3838|       |   j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd;
 3839|       |#endif
 3840|  3.89k|}
OgreSTBICodec.cpp:_ZL20stbi__sse2_availablev:
  766|  3.89k|{
  767|       |   // If we're even attempting to compile this on GCC/Clang, that means
  768|       |   // -msse2 is on, which means the compiler is allowed to use SSE2
  769|       |   // instructions at will, and so are we.
  770|  3.89k|   return 1;
  771|  3.89k|}
OgreSTBICodec.cpp:_ZL15stbi__idct_simdPhiPs:
 2531|  3.85M|{
 2532|       |   // This is constructed to match our regular (generic) integer IDCT exactly.
 2533|  3.85M|   __m128i row0, row1, row2, row3, row4, row5, row6, row7;
 2534|  3.85M|   __m128i tmp;
 2535|       |
 2536|       |   // dot product constant: even elems=x, odd elems=y
 2537|  3.85M|   #define dct_const(x,y)  _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y))
 2538|       |
 2539|       |   // out(0) = c0[even]*x + c0[odd]*y   (c0, x, y 16-bit, out 32-bit)
 2540|       |   // out(1) = c1[even]*x + c1[odd]*y
 2541|  3.85M|   #define dct_rot(out0,out1, x,y,c0,c1) \
 2542|  3.85M|      __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \
 2543|  3.85M|      __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \
 2544|  3.85M|      __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \
 2545|  3.85M|      __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \
 2546|  3.85M|      __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \
 2547|  3.85M|      __m128i out1##_h = _mm_madd_epi16(c0##hi, c1)
 2548|       |
 2549|       |   // out = in << 12  (in 16-bit, out 32-bit)
 2550|  3.85M|   #define dct_widen(out, in) \
 2551|  3.85M|      __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \
 2552|  3.85M|      __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4)
 2553|       |
 2554|       |   // wide add
 2555|  3.85M|   #define dct_wadd(out, a, b) \
 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
 2558|       |
 2559|       |   // wide sub
 2560|  3.85M|   #define dct_wsub(out, a, b) \
 2561|  3.85M|      __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
 2562|  3.85M|      __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
 2563|       |
 2564|       |   // butterfly a/b, add bias, then shift by "s" and pack
 2565|  3.85M|   #define dct_bfly32o(out0, out1, a,b,bias,s) \
 2566|  3.85M|      { \
 2567|  3.85M|         __m128i abiased_l = _mm_add_epi32(a##_l, bias); \
 2568|  3.85M|         __m128i abiased_h = _mm_add_epi32(a##_h, bias); \
 2569|  3.85M|         dct_wadd(sum, abiased, b); \
 2570|  3.85M|         dct_wsub(dif, abiased, b); \
 2571|  3.85M|         out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \
 2572|  3.85M|         out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \
 2573|  3.85M|      }
 2574|       |
 2575|       |   // 8-bit interleave step (for transposes)
 2576|  3.85M|   #define dct_interleave8(a, b) \
 2577|  3.85M|      tmp = a; \
 2578|  3.85M|      a = _mm_unpacklo_epi8(a, b); \
 2579|  3.85M|      b = _mm_unpackhi_epi8(tmp, b)
 2580|       |
 2581|       |   // 16-bit interleave step (for transposes)
 2582|  3.85M|   #define dct_interleave16(a, b) \
 2583|  3.85M|      tmp = a; \
 2584|  3.85M|      a = _mm_unpacklo_epi16(a, b); \
 2585|  3.85M|      b = _mm_unpackhi_epi16(tmp, b)
 2586|       |
 2587|  3.85M|   #define dct_pass(bias,shift) \
 2588|  3.85M|      { \
 2589|       |         /* even part */ \
 2590|  3.85M|         dct_rot(t2e,t3e, row2,row6, rot0_0,rot0_1); \
 2591|  3.85M|         __m128i sum04 = _mm_add_epi16(row0, row4); \
 2592|  3.85M|         __m128i dif04 = _mm_sub_epi16(row0, row4); \
 2593|  3.85M|         dct_widen(t0e, sum04); \
 2594|  3.85M|         dct_widen(t1e, dif04); \
 2595|  3.85M|         dct_wadd(x0, t0e, t3e); \
 2596|  3.85M|         dct_wsub(x3, t0e, t3e); \
 2597|  3.85M|         dct_wadd(x1, t1e, t2e); \
 2598|  3.85M|         dct_wsub(x2, t1e, t2e); \
 2599|       |         /* odd part */ \
 2600|  3.85M|         dct_rot(y0o,y2o, row7,row3, rot2_0,rot2_1); \
 2601|  3.85M|         dct_rot(y1o,y3o, row5,row1, rot3_0,rot3_1); \
 2602|  3.85M|         __m128i sum17 = _mm_add_epi16(row1, row7); \
 2603|  3.85M|         __m128i sum35 = _mm_add_epi16(row3, row5); \
 2604|  3.85M|         dct_rot(y4o,y5o, sum17,sum35, rot1_0,rot1_1); \
 2605|  3.85M|         dct_wadd(x4, y0o, y4o); \
 2606|  3.85M|         dct_wadd(x5, y1o, y5o); \
 2607|  3.85M|         dct_wadd(x6, y2o, y5o); \
 2608|  3.85M|         dct_wadd(x7, y3o, y4o); \
 2609|  3.85M|         dct_bfly32o(row0,row7, x0,x7,bias,shift); \
 2610|  3.85M|         dct_bfly32o(row1,row6, x1,x6,bias,shift); \
 2611|  3.85M|         dct_bfly32o(row2,row5, x2,x5,bias,shift); \
 2612|  3.85M|         dct_bfly32o(row3,row4, x3,x4,bias,shift); \
 2613|  3.85M|      }
 2614|       |
 2615|  3.85M|   __m128i rot0_0 = dct_const(stbi__f2f(0.5411961f), stbi__f2f(0.5411961f) + stbi__f2f(-1.847759065f));
  ------------------
  |  | 2537|  3.85M|   #define dct_const(x,y)  _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y))
  ------------------
 2616|  3.85M|   __m128i rot0_1 = dct_const(stbi__f2f(0.5411961f) + stbi__f2f( 0.765366865f), stbi__f2f(0.5411961f));
  ------------------
  |  | 2537|  3.85M|   #define dct_const(x,y)  _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y))
  ------------------
 2617|  3.85M|   __m128i rot1_0 = dct_const(stbi__f2f(1.175875602f) + stbi__f2f(-0.899976223f), stbi__f2f(1.175875602f));
  ------------------
  |  | 2537|  3.85M|   #define dct_const(x,y)  _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y))
  ------------------
 2618|  3.85M|   __m128i rot1_1 = dct_const(stbi__f2f(1.175875602f), stbi__f2f(1.175875602f) + stbi__f2f(-2.562915447f));
  ------------------
  |  | 2537|  3.85M|   #define dct_const(x,y)  _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y))
  ------------------
 2619|  3.85M|   __m128i rot2_0 = dct_const(stbi__f2f(-1.961570560f) + stbi__f2f( 0.298631336f), stbi__f2f(-1.961570560f));
  ------------------
  |  | 2537|  3.85M|   #define dct_const(x,y)  _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y))
  ------------------
 2620|  3.85M|   __m128i rot2_1 = dct_const(stbi__f2f(-1.961570560f), stbi__f2f(-1.961570560f) + stbi__f2f( 3.072711026f));
  ------------------
  |  | 2537|  3.85M|   #define dct_const(x,y)  _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y))
  ------------------
 2621|  3.85M|   __m128i rot3_0 = dct_const(stbi__f2f(-0.390180644f) + stbi__f2f( 2.053119869f), stbi__f2f(-0.390180644f));
  ------------------
  |  | 2537|  3.85M|   #define dct_const(x,y)  _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y))
  ------------------
 2622|  3.85M|   __m128i rot3_1 = dct_const(stbi__f2f(-0.390180644f), stbi__f2f(-0.390180644f) + stbi__f2f( 1.501321110f));
  ------------------
  |  | 2537|  3.85M|   #define dct_const(x,y)  _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y))
  ------------------
 2623|       |
 2624|       |   // rounding biases in column/row passes, see stbi__idct_block for explanation.
 2625|  3.85M|   __m128i bias_0 = _mm_set1_epi32(512);
 2626|  3.85M|   __m128i bias_1 = _mm_set1_epi32(65536 + (128<<17));
 2627|       |
 2628|       |   // load
 2629|  3.85M|   row0 = _mm_load_si128((const __m128i *) (data + 0*8));
 2630|  3.85M|   row1 = _mm_load_si128((const __m128i *) (data + 1*8));
 2631|  3.85M|   row2 = _mm_load_si128((const __m128i *) (data + 2*8));
 2632|  3.85M|   row3 = _mm_load_si128((const __m128i *) (data + 3*8));
 2633|  3.85M|   row4 = _mm_load_si128((const __m128i *) (data + 4*8));
 2634|  3.85M|   row5 = _mm_load_si128((const __m128i *) (data + 5*8));
 2635|  3.85M|   row6 = _mm_load_si128((const __m128i *) (data + 6*8));
 2636|  3.85M|   row7 = _mm_load_si128((const __m128i *) (data + 7*8));
 2637|       |
 2638|       |   // column pass
 2639|  3.85M|   dct_pass(bias_0, 10);
  ------------------
  |  | 2588|  3.85M|      { \
  |  | 2589|  3.85M|         /* even part */ \
  |  | 2590|  3.85M|         dct_rot(t2e,t3e, row2,row6, rot0_0,rot0_1); \
  |  |  ------------------
  |  |  |  | 2542|  3.85M|      __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \
  |  |  |  | 2543|  3.85M|      __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \
  |  |  |  | 2544|  3.85M|      __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \
  |  |  |  | 2545|  3.85M|      __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \
  |  |  |  | 2546|  3.85M|      __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \
  |  |  |  | 2547|  3.85M|      __m128i out1##_h = _mm_madd_epi16(c0##hi, c1)
  |  |  ------------------
  |  | 2591|  3.85M|         __m128i sum04 = _mm_add_epi16(row0, row4); \
  |  | 2592|  3.85M|         __m128i dif04 = _mm_sub_epi16(row0, row4); \
  |  | 2593|  3.85M|         dct_widen(t0e, sum04); \
  |  |  ------------------
  |  |  |  | 2551|  3.85M|      __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \
  |  |  |  | 2552|  3.85M|      __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4)
  |  |  ------------------
  |  | 2594|  3.85M|         dct_widen(t1e, dif04); \
  |  |  ------------------
  |  |  |  | 2551|  3.85M|      __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \
  |  |  |  | 2552|  3.85M|      __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4)
  |  |  ------------------
  |  | 2595|  3.85M|         dct_wadd(x0, t0e, t3e); \
  |  |  ------------------
  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  ------------------
  |  | 2596|  3.85M|         dct_wsub(x3, t0e, t3e); \
  |  |  ------------------
  |  |  |  | 2561|  3.85M|      __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
  |  |  |  | 2562|  3.85M|      __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
  |  |  ------------------
  |  | 2597|  3.85M|         dct_wadd(x1, t1e, t2e); \
  |  |  ------------------
  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  ------------------
  |  | 2598|  3.85M|         dct_wsub(x2, t1e, t2e); \
  |  |  ------------------
  |  |  |  | 2561|  3.85M|      __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
  |  |  |  | 2562|  3.85M|      __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
  |  |  ------------------
  |  | 2599|  3.85M|         /* odd part */ \
  |  | 2600|  3.85M|         dct_rot(y0o,y2o, row7,row3, rot2_0,rot2_1); \
  |  |  ------------------
  |  |  |  | 2542|  3.85M|      __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \
  |  |  |  | 2543|  3.85M|      __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \
  |  |  |  | 2544|  3.85M|      __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \
  |  |  |  | 2545|  3.85M|      __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \
  |  |  |  | 2546|  3.85M|      __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \
  |  |  |  | 2547|  3.85M|      __m128i out1##_h = _mm_madd_epi16(c0##hi, c1)
  |  |  ------------------
  |  | 2601|  3.85M|         dct_rot(y1o,y3o, row5,row1, rot3_0,rot3_1); \
  |  |  ------------------
  |  |  |  | 2542|  3.85M|      __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \
  |  |  |  | 2543|  3.85M|      __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \
  |  |  |  | 2544|  3.85M|      __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \
  |  |  |  | 2545|  3.85M|      __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \
  |  |  |  | 2546|  3.85M|      __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \
  |  |  |  | 2547|  3.85M|      __m128i out1##_h = _mm_madd_epi16(c0##hi, c1)
  |  |  ------------------
  |  | 2602|  3.85M|         __m128i sum17 = _mm_add_epi16(row1, row7); \
  |  | 2603|  3.85M|         __m128i sum35 = _mm_add_epi16(row3, row5); \
  |  | 2604|  3.85M|         dct_rot(y4o,y5o, sum17,sum35, rot1_0,rot1_1); \
  |  |  ------------------
  |  |  |  | 2542|  3.85M|      __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \
  |  |  |  | 2543|  3.85M|      __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \
  |  |  |  | 2544|  3.85M|      __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \
  |  |  |  | 2545|  3.85M|      __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \
  |  |  |  | 2546|  3.85M|      __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \
  |  |  |  | 2547|  3.85M|      __m128i out1##_h = _mm_madd_epi16(c0##hi, c1)
  |  |  ------------------
  |  | 2605|  3.85M|         dct_wadd(x4, y0o, y4o); \
  |  |  ------------------
  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  ------------------
  |  | 2606|  3.85M|         dct_wadd(x5, y1o, y5o); \
  |  |  ------------------
  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  ------------------
  |  | 2607|  3.85M|         dct_wadd(x6, y2o, y5o); \
  |  |  ------------------
  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  ------------------
  |  | 2608|  3.85M|         dct_wadd(x7, y3o, y4o); \
  |  |  ------------------
  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  ------------------
  |  | 2609|  3.85M|         dct_bfly32o(row0,row7, x0,x7,bias,shift); \
  |  |  ------------------
  |  |  |  | 2566|  3.85M|      { \
  |  |  |  | 2567|  3.85M|         __m128i abiased_l = _mm_add_epi32(a##_l, bias); \
  |  |  |  | 2568|  3.85M|         __m128i abiased_h = _mm_add_epi32(a##_h, bias); \
  |  |  |  | 2569|  3.85M|         dct_wadd(sum, abiased, b); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  |  |  ------------------
  |  |  |  | 2570|  3.85M|         dct_wsub(dif, abiased, b); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2561|  3.85M|      __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
  |  |  |  |  |  | 2562|  3.85M|      __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
  |  |  |  |  ------------------
  |  |  |  | 2571|  3.85M|         out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \
  |  |  |  | 2572|  3.85M|         out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \
  |  |  |  | 2573|  3.85M|      }
  |  |  ------------------
  |  | 2610|  3.85M|         dct_bfly32o(row1,row6, x1,x6,bias,shift); \
  |  |  ------------------
  |  |  |  | 2566|  3.85M|      { \
  |  |  |  | 2567|  3.85M|         __m128i abiased_l = _mm_add_epi32(a##_l, bias); \
  |  |  |  | 2568|  3.85M|         __m128i abiased_h = _mm_add_epi32(a##_h, bias); \
  |  |  |  | 2569|  3.85M|         dct_wadd(sum, abiased, b); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  |  |  ------------------
  |  |  |  | 2570|  3.85M|         dct_wsub(dif, abiased, b); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2561|  3.85M|      __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
  |  |  |  |  |  | 2562|  3.85M|      __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
  |  |  |  |  ------------------
  |  |  |  | 2571|  3.85M|         out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \
  |  |  |  | 2572|  3.85M|         out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \
  |  |  |  | 2573|  3.85M|      }
  |  |  ------------------
  |  | 2611|  3.85M|         dct_bfly32o(row2,row5, x2,x5,bias,shift); \
  |  |  ------------------
  |  |  |  | 2566|  3.85M|      { \
  |  |  |  | 2567|  3.85M|         __m128i abiased_l = _mm_add_epi32(a##_l, bias); \
  |  |  |  | 2568|  3.85M|         __m128i abiased_h = _mm_add_epi32(a##_h, bias); \
  |  |  |  | 2569|  3.85M|         dct_wadd(sum, abiased, b); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  |  |  ------------------
  |  |  |  | 2570|  3.85M|         dct_wsub(dif, abiased, b); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2561|  3.85M|      __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
  |  |  |  |  |  | 2562|  3.85M|      __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
  |  |  |  |  ------------------
  |  |  |  | 2571|  3.85M|         out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \
  |  |  |  | 2572|  3.85M|         out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \
  |  |  |  | 2573|  3.85M|      }
  |  |  ------------------
  |  | 2612|  3.85M|         dct_bfly32o(row3,row4, x3,x4,bias,shift); \
  |  |  ------------------
  |  |  |  | 2566|  3.85M|      { \
  |  |  |  | 2567|  3.85M|         __m128i abiased_l = _mm_add_epi32(a##_l, bias); \
  |  |  |  | 2568|  3.85M|         __m128i abiased_h = _mm_add_epi32(a##_h, bias); \
  |  |  |  | 2569|  3.85M|         dct_wadd(sum, abiased, b); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  |  |  ------------------
  |  |  |  | 2570|  3.85M|         dct_wsub(dif, abiased, b); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2561|  3.85M|      __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
  |  |  |  |  |  | 2562|  3.85M|      __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
  |  |  |  |  ------------------
  |  |  |  | 2571|  3.85M|         out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \
  |  |  |  | 2572|  3.85M|         out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \
  |  |  |  | 2573|  3.85M|      }
  |  |  ------------------
  |  | 2613|  3.85M|      }
  ------------------
 2640|       |
 2641|  3.85M|   {
 2642|       |      // 16bit 8x8 transpose pass 1
 2643|  3.85M|      dct_interleave16(row0, row4);
  ------------------
  |  | 2583|  3.85M|      tmp = a; \
  |  | 2584|  3.85M|      a = _mm_unpacklo_epi16(a, b); \
  |  | 2585|  3.85M|      b = _mm_unpackhi_epi16(tmp, b)
  ------------------
 2644|  3.85M|      dct_interleave16(row1, row5);
  ------------------
  |  | 2583|  3.85M|      tmp = a; \
  |  | 2584|  3.85M|      a = _mm_unpacklo_epi16(a, b); \
  |  | 2585|  3.85M|      b = _mm_unpackhi_epi16(tmp, b)
  ------------------
 2645|  3.85M|      dct_interleave16(row2, row6);
  ------------------
  |  | 2583|  3.85M|      tmp = a; \
  |  | 2584|  3.85M|      a = _mm_unpacklo_epi16(a, b); \
  |  | 2585|  3.85M|      b = _mm_unpackhi_epi16(tmp, b)
  ------------------
 2646|  3.85M|      dct_interleave16(row3, row7);
  ------------------
  |  | 2583|  3.85M|      tmp = a; \
  |  | 2584|  3.85M|      a = _mm_unpacklo_epi16(a, b); \
  |  | 2585|  3.85M|      b = _mm_unpackhi_epi16(tmp, b)
  ------------------
 2647|       |
 2648|       |      // transpose pass 2
 2649|  3.85M|      dct_interleave16(row0, row2);
  ------------------
  |  | 2583|  3.85M|      tmp = a; \
  |  | 2584|  3.85M|      a = _mm_unpacklo_epi16(a, b); \
  |  | 2585|  3.85M|      b = _mm_unpackhi_epi16(tmp, b)
  ------------------
 2650|  3.85M|      dct_interleave16(row1, row3);
  ------------------
  |  | 2583|  3.85M|      tmp = a; \
  |  | 2584|  3.85M|      a = _mm_unpacklo_epi16(a, b); \
  |  | 2585|  3.85M|      b = _mm_unpackhi_epi16(tmp, b)
  ------------------
 2651|  3.85M|      dct_interleave16(row4, row6);
  ------------------
  |  | 2583|  3.85M|      tmp = a; \
  |  | 2584|  3.85M|      a = _mm_unpacklo_epi16(a, b); \
  |  | 2585|  3.85M|      b = _mm_unpackhi_epi16(tmp, b)
  ------------------
 2652|  3.85M|      dct_interleave16(row5, row7);
  ------------------
  |  | 2583|  3.85M|      tmp = a; \
  |  | 2584|  3.85M|      a = _mm_unpacklo_epi16(a, b); \
  |  | 2585|  3.85M|      b = _mm_unpackhi_epi16(tmp, b)
  ------------------
 2653|       |
 2654|       |      // transpose pass 3
 2655|  3.85M|      dct_interleave16(row0, row1);
  ------------------
  |  | 2583|  3.85M|      tmp = a; \
  |  | 2584|  3.85M|      a = _mm_unpacklo_epi16(a, b); \
  |  | 2585|  3.85M|      b = _mm_unpackhi_epi16(tmp, b)
  ------------------
 2656|  3.85M|      dct_interleave16(row2, row3);
  ------------------
  |  | 2583|  3.85M|      tmp = a; \
  |  | 2584|  3.85M|      a = _mm_unpacklo_epi16(a, b); \
  |  | 2585|  3.85M|      b = _mm_unpackhi_epi16(tmp, b)
  ------------------
 2657|  3.85M|      dct_interleave16(row4, row5);
  ------------------
  |  | 2583|  3.85M|      tmp = a; \
  |  | 2584|  3.85M|      a = _mm_unpacklo_epi16(a, b); \
  |  | 2585|  3.85M|      b = _mm_unpackhi_epi16(tmp, b)
  ------------------
 2658|  3.85M|      dct_interleave16(row6, row7);
  ------------------
  |  | 2583|  3.85M|      tmp = a; \
  |  | 2584|  3.85M|      a = _mm_unpacklo_epi16(a, b); \
  |  | 2585|  3.85M|      b = _mm_unpackhi_epi16(tmp, b)
  ------------------
 2659|  3.85M|   }
 2660|       |
 2661|       |   // row pass
 2662|  3.85M|   dct_pass(bias_1, 17);
  ------------------
  |  | 2588|  3.85M|      { \
  |  | 2589|  3.85M|         /* even part */ \
  |  | 2590|  3.85M|         dct_rot(t2e,t3e, row2,row6, rot0_0,rot0_1); \
  |  |  ------------------
  |  |  |  | 2542|  3.85M|      __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \
  |  |  |  | 2543|  3.85M|      __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \
  |  |  |  | 2544|  3.85M|      __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \
  |  |  |  | 2545|  3.85M|      __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \
  |  |  |  | 2546|  3.85M|      __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \
  |  |  |  | 2547|  3.85M|      __m128i out1##_h = _mm_madd_epi16(c0##hi, c1)
  |  |  ------------------
  |  | 2591|  3.85M|         __m128i sum04 = _mm_add_epi16(row0, row4); \
  |  | 2592|  3.85M|         __m128i dif04 = _mm_sub_epi16(row0, row4); \
  |  | 2593|  3.85M|         dct_widen(t0e, sum04); \
  |  |  ------------------
  |  |  |  | 2551|  3.85M|      __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \
  |  |  |  | 2552|  3.85M|      __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4)
  |  |  ------------------
  |  | 2594|  3.85M|         dct_widen(t1e, dif04); \
  |  |  ------------------
  |  |  |  | 2551|  3.85M|      __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \
  |  |  |  | 2552|  3.85M|      __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4)
  |  |  ------------------
  |  | 2595|  3.85M|         dct_wadd(x0, t0e, t3e); \
  |  |  ------------------
  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  ------------------
  |  | 2596|  3.85M|         dct_wsub(x3, t0e, t3e); \
  |  |  ------------------
  |  |  |  | 2561|  3.85M|      __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
  |  |  |  | 2562|  3.85M|      __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
  |  |  ------------------
  |  | 2597|  3.85M|         dct_wadd(x1, t1e, t2e); \
  |  |  ------------------
  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  ------------------
  |  | 2598|  3.85M|         dct_wsub(x2, t1e, t2e); \
  |  |  ------------------
  |  |  |  | 2561|  3.85M|      __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
  |  |  |  | 2562|  3.85M|      __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
  |  |  ------------------
  |  | 2599|  3.85M|         /* odd part */ \
  |  | 2600|  3.85M|         dct_rot(y0o,y2o, row7,row3, rot2_0,rot2_1); \
  |  |  ------------------
  |  |  |  | 2542|  3.85M|      __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \
  |  |  |  | 2543|  3.85M|      __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \
  |  |  |  | 2544|  3.85M|      __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \
  |  |  |  | 2545|  3.85M|      __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \
  |  |  |  | 2546|  3.85M|      __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \
  |  |  |  | 2547|  3.85M|      __m128i out1##_h = _mm_madd_epi16(c0##hi, c1)
  |  |  ------------------
  |  | 2601|  3.85M|         dct_rot(y1o,y3o, row5,row1, rot3_0,rot3_1); \
  |  |  ------------------
  |  |  |  | 2542|  3.85M|      __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \
  |  |  |  | 2543|  3.85M|      __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \
  |  |  |  | 2544|  3.85M|      __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \
  |  |  |  | 2545|  3.85M|      __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \
  |  |  |  | 2546|  3.85M|      __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \
  |  |  |  | 2547|  3.85M|      __m128i out1##_h = _mm_madd_epi16(c0##hi, c1)
  |  |  ------------------
  |  | 2602|  3.85M|         __m128i sum17 = _mm_add_epi16(row1, row7); \
  |  | 2603|  3.85M|         __m128i sum35 = _mm_add_epi16(row3, row5); \
  |  | 2604|  3.85M|         dct_rot(y4o,y5o, sum17,sum35, rot1_0,rot1_1); \
  |  |  ------------------
  |  |  |  | 2542|  3.85M|      __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \
  |  |  |  | 2543|  3.85M|      __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \
  |  |  |  | 2544|  3.85M|      __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \
  |  |  |  | 2545|  3.85M|      __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \
  |  |  |  | 2546|  3.85M|      __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \
  |  |  |  | 2547|  3.85M|      __m128i out1##_h = _mm_madd_epi16(c0##hi, c1)
  |  |  ------------------
  |  | 2605|  3.85M|         dct_wadd(x4, y0o, y4o); \
  |  |  ------------------
  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  ------------------
  |  | 2606|  3.85M|         dct_wadd(x5, y1o, y5o); \
  |  |  ------------------
  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  ------------------
  |  | 2607|  3.85M|         dct_wadd(x6, y2o, y5o); \
  |  |  ------------------
  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  ------------------
  |  | 2608|  3.85M|         dct_wadd(x7, y3o, y4o); \
  |  |  ------------------
  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  ------------------
  |  | 2609|  3.85M|         dct_bfly32o(row0,row7, x0,x7,bias,shift); \
  |  |  ------------------
  |  |  |  | 2566|  3.85M|      { \
  |  |  |  | 2567|  3.85M|         __m128i abiased_l = _mm_add_epi32(a##_l, bias); \
  |  |  |  | 2568|  3.85M|         __m128i abiased_h = _mm_add_epi32(a##_h, bias); \
  |  |  |  | 2569|  3.85M|         dct_wadd(sum, abiased, b); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  |  |  ------------------
  |  |  |  | 2570|  3.85M|         dct_wsub(dif, abiased, b); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2561|  3.85M|      __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
  |  |  |  |  |  | 2562|  3.85M|      __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
  |  |  |  |  ------------------
  |  |  |  | 2571|  3.85M|         out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \
  |  |  |  | 2572|  3.85M|         out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \
  |  |  |  | 2573|  3.85M|      }
  |  |  ------------------
  |  | 2610|  3.85M|         dct_bfly32o(row1,row6, x1,x6,bias,shift); \
  |  |  ------------------
  |  |  |  | 2566|  3.85M|      { \
  |  |  |  | 2567|  3.85M|         __m128i abiased_l = _mm_add_epi32(a##_l, bias); \
  |  |  |  | 2568|  3.85M|         __m128i abiased_h = _mm_add_epi32(a##_h, bias); \
  |  |  |  | 2569|  3.85M|         dct_wadd(sum, abiased, b); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  |  |  ------------------
  |  |  |  | 2570|  3.85M|         dct_wsub(dif, abiased, b); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2561|  3.85M|      __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
  |  |  |  |  |  | 2562|  3.85M|      __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
  |  |  |  |  ------------------
  |  |  |  | 2571|  3.85M|         out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \
  |  |  |  | 2572|  3.85M|         out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \
  |  |  |  | 2573|  3.85M|      }
  |  |  ------------------
  |  | 2611|  3.85M|         dct_bfly32o(row2,row5, x2,x5,bias,shift); \
  |  |  ------------------
  |  |  |  | 2566|  3.85M|      { \
  |  |  |  | 2567|  3.85M|         __m128i abiased_l = _mm_add_epi32(a##_l, bias); \
  |  |  |  | 2568|  3.85M|         __m128i abiased_h = _mm_add_epi32(a##_h, bias); \
  |  |  |  | 2569|  3.85M|         dct_wadd(sum, abiased, b); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  |  |  ------------------
  |  |  |  | 2570|  3.85M|         dct_wsub(dif, abiased, b); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2561|  3.85M|      __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
  |  |  |  |  |  | 2562|  3.85M|      __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
  |  |  |  |  ------------------
  |  |  |  | 2571|  3.85M|         out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \
  |  |  |  | 2572|  3.85M|         out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \
  |  |  |  | 2573|  3.85M|      }
  |  |  ------------------
  |  | 2612|  3.85M|         dct_bfly32o(row3,row4, x3,x4,bias,shift); \
  |  |  ------------------
  |  |  |  | 2566|  3.85M|      { \
  |  |  |  | 2567|  3.85M|         __m128i abiased_l = _mm_add_epi32(a##_l, bias); \
  |  |  |  | 2568|  3.85M|         __m128i abiased_h = _mm_add_epi32(a##_h, bias); \
  |  |  |  | 2569|  3.85M|         dct_wadd(sum, abiased, b); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2556|  3.85M|      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
  |  |  |  |  |  | 2557|  3.85M|      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
  |  |  |  |  ------------------
  |  |  |  | 2570|  3.85M|         dct_wsub(dif, abiased, b); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2561|  3.85M|      __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
  |  |  |  |  |  | 2562|  3.85M|      __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
  |  |  |  |  ------------------
  |  |  |  | 2571|  3.85M|         out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \
  |  |  |  | 2572|  3.85M|         out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \
  |  |  |  | 2573|  3.85M|      }
  |  |  ------------------
  |  | 2613|  3.85M|      }
  ------------------
 2663|       |
 2664|  3.85M|   {
 2665|       |      // pack
 2666|  3.85M|      __m128i p0 = _mm_packus_epi16(row0, row1); // a0a1a2a3...a7b0b1b2b3...b7
 2667|  3.85M|      __m128i p1 = _mm_packus_epi16(row2, row3);
 2668|  3.85M|      __m128i p2 = _mm_packus_epi16(row4, row5);
 2669|  3.85M|      __m128i p3 = _mm_packus_epi16(row6, row7);
 2670|       |
 2671|       |      // 8bit 8x8 transpose pass 1
 2672|  3.85M|      dct_interleave8(p0, p2); // a0e0a1e1...
  ------------------
  |  | 2577|  3.85M|      tmp = a; \
  |  | 2578|  3.85M|      a = _mm_unpacklo_epi8(a, b); \
  |  | 2579|  3.85M|      b = _mm_unpackhi_epi8(tmp, b)
  ------------------
 2673|  3.85M|      dct_interleave8(p1, p3); // c0g0c1g1...
  ------------------
  |  | 2577|  3.85M|      tmp = a; \
  |  | 2578|  3.85M|      a = _mm_unpacklo_epi8(a, b); \
  |  | 2579|  3.85M|      b = _mm_unpackhi_epi8(tmp, b)
  ------------------
 2674|       |
 2675|       |      // transpose pass 2
 2676|  3.85M|      dct_interleave8(p0, p1); // a0c0e0g0...
  ------------------
  |  | 2577|  3.85M|      tmp = a; \
  |  | 2578|  3.85M|      a = _mm_unpacklo_epi8(a, b); \
  |  | 2579|  3.85M|      b = _mm_unpackhi_epi8(tmp, b)
  ------------------
 2677|  3.85M|      dct_interleave8(p2, p3); // b0d0f0h0...
  ------------------
  |  | 2577|  3.85M|      tmp = a; \
  |  | 2578|  3.85M|      a = _mm_unpacklo_epi8(a, b); \
  |  | 2579|  3.85M|      b = _mm_unpackhi_epi8(tmp, b)
  ------------------
 2678|       |
 2679|       |      // transpose pass 3
 2680|  3.85M|      dct_interleave8(p0, p2); // a0b0c0d0...
  ------------------
  |  | 2577|  3.85M|      tmp = a; \
  |  | 2578|  3.85M|      a = _mm_unpacklo_epi8(a, b); \
  |  | 2579|  3.85M|      b = _mm_unpackhi_epi8(tmp, b)
  ------------------
 2681|  3.85M|      dct_interleave8(p1, p3); // a4b4c4d4...
  ------------------
  |  | 2577|  3.85M|      tmp = a; \
  |  | 2578|  3.85M|      a = _mm_unpacklo_epi8(a, b); \
  |  | 2579|  3.85M|      b = _mm_unpackhi_epi8(tmp, b)
  ------------------
 2682|       |
 2683|       |      // store
 2684|  3.85M|      _mm_storel_epi64((__m128i *) out, p0); out += out_stride;
 2685|  3.85M|      _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p0, 0x4e)); out += out_stride;
 2686|  3.85M|      _mm_storel_epi64((__m128i *) out, p2); out += out_stride;
 2687|  3.85M|      _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p2, 0x4e)); out += out_stride;
 2688|  3.85M|      _mm_storel_epi64((__m128i *) out, p1); out += out_stride;
 2689|  3.85M|      _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p1, 0x4e)); out += out_stride;
 2690|  3.85M|      _mm_storel_epi64((__m128i *) out, p3); out += out_stride;
 2691|  3.85M|      _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p3, 0x4e));
 2692|  3.85M|   }
 2693|       |
 2694|  3.85M|#undef dct_const
 2695|  3.85M|#undef dct_rot
 2696|  3.85M|#undef dct_widen
 2697|  3.85M|#undef dct_wadd
 2698|  3.85M|#undef dct_wsub
 2699|  3.85M|#undef dct_bfly32o
 2700|  3.85M|#undef dct_interleave8
 2701|  3.85M|#undef dct_interleave16
 2702|  3.85M|#undef dct_pass
 2703|  3.85M|}
OgreSTBICodec.cpp:_ZL23stbi__YCbCr_to_RGB_simdPhPKhS1_S1_ii:
 3687|   866k|{
 3688|   866k|   int i = 0;
 3689|       |
 3690|   866k|#ifdef STBI_SSE2
 3691|       |   // step == 3 is pretty ugly on the final interleave, and i'm not convinced
 3692|       |   // it's useful in practice (you wouldn't use it for textures, for example).
 3693|       |   // so just accelerate step == 4 case.
 3694|   866k|   if (step == 4) {
  ------------------
  |  Branch (3694:8): [True: 0, False: 866k]
  ------------------
 3695|       |      // this is a fairly straightforward implementation and not super-optimized.
 3696|      0|      __m128i signflip  = _mm_set1_epi8(-0x80);
 3697|      0|      __m128i cr_const0 = _mm_set1_epi16(   (short) ( 1.40200f*4096.0f+0.5f));
 3698|      0|      __m128i cr_const1 = _mm_set1_epi16( - (short) ( 0.71414f*4096.0f+0.5f));
 3699|      0|      __m128i cb_const0 = _mm_set1_epi16( - (short) ( 0.34414f*4096.0f+0.5f));
 3700|      0|      __m128i cb_const1 = _mm_set1_epi16(   (short) ( 1.77200f*4096.0f+0.5f));
 3701|      0|      __m128i y_bias = _mm_set1_epi8((char) (unsigned char) 128);
 3702|      0|      __m128i xw = _mm_set1_epi16(255); // alpha channel
 3703|       |
 3704|      0|      for (; i+7 < count; i += 8) {
  ------------------
  |  Branch (3704:14): [True: 0, False: 0]
  ------------------
 3705|       |         // load
 3706|      0|         __m128i y_bytes = _mm_loadl_epi64((__m128i *) (y+i));
 3707|      0|         __m128i cr_bytes = _mm_loadl_epi64((__m128i *) (pcr+i));
 3708|      0|         __m128i cb_bytes = _mm_loadl_epi64((__m128i *) (pcb+i));
 3709|      0|         __m128i cr_biased = _mm_xor_si128(cr_bytes, signflip); // -128
 3710|      0|         __m128i cb_biased = _mm_xor_si128(cb_bytes, signflip); // -128
 3711|       |
 3712|       |         // unpack to short (and left-shift cr, cb by 8)
 3713|      0|         __m128i yw  = _mm_unpacklo_epi8(y_bias, y_bytes);
 3714|      0|         __m128i crw = _mm_unpacklo_epi8(_mm_setzero_si128(), cr_biased);
 3715|      0|         __m128i cbw = _mm_unpacklo_epi8(_mm_setzero_si128(), cb_biased);
 3716|       |
 3717|       |         // color transform
 3718|      0|         __m128i yws = _mm_srli_epi16(yw, 4);
 3719|      0|         __m128i cr0 = _mm_mulhi_epi16(cr_const0, crw);
 3720|      0|         __m128i cb0 = _mm_mulhi_epi16(cb_const0, cbw);
 3721|      0|         __m128i cb1 = _mm_mulhi_epi16(cbw, cb_const1);
 3722|      0|         __m128i cr1 = _mm_mulhi_epi16(crw, cr_const1);
 3723|      0|         __m128i rws = _mm_add_epi16(cr0, yws);
 3724|      0|         __m128i gwt = _mm_add_epi16(cb0, yws);
 3725|      0|         __m128i bws = _mm_add_epi16(yws, cb1);
 3726|      0|         __m128i gws = _mm_add_epi16(gwt, cr1);
 3727|       |
 3728|       |         // descale
 3729|      0|         __m128i rw = _mm_srai_epi16(rws, 4);
 3730|      0|         __m128i bw = _mm_srai_epi16(bws, 4);
 3731|      0|         __m128i gw = _mm_srai_epi16(gws, 4);
 3732|       |
 3733|       |         // back to byte, set up for transpose
 3734|      0|         __m128i brb = _mm_packus_epi16(rw, bw);
 3735|      0|         __m128i gxb = _mm_packus_epi16(gw, xw);
 3736|       |
 3737|       |         // transpose to interleave channels
 3738|      0|         __m128i t0 = _mm_unpacklo_epi8(brb, gxb);
 3739|      0|         __m128i t1 = _mm_unpackhi_epi8(brb, gxb);
 3740|      0|         __m128i o0 = _mm_unpacklo_epi16(t0, t1);
 3741|      0|         __m128i o1 = _mm_unpackhi_epi16(t0, t1);
 3742|       |
 3743|       |         // store
 3744|      0|         _mm_storeu_si128((__m128i *) (out + 0), o0);
 3745|      0|         _mm_storeu_si128((__m128i *) (out + 16), o1);
 3746|      0|         out += 32;
 3747|      0|      }
 3748|      0|   }
 3749|   866k|#endif
 3750|       |
 3751|       |#ifdef STBI_NEON
 3752|       |   // in this version, step=3 support would be easy to add. but is there demand?
 3753|       |   if (step == 4) {
 3754|       |      // this is a fairly straightforward implementation and not super-optimized.
 3755|       |      uint8x8_t signflip = vdup_n_u8(0x80);
 3756|       |      int16x8_t cr_const0 = vdupq_n_s16(   (short) ( 1.40200f*4096.0f+0.5f));
 3757|       |      int16x8_t cr_const1 = vdupq_n_s16( - (short) ( 0.71414f*4096.0f+0.5f));
 3758|       |      int16x8_t cb_const0 = vdupq_n_s16( - (short) ( 0.34414f*4096.0f+0.5f));
 3759|       |      int16x8_t cb_const1 = vdupq_n_s16(   (short) ( 1.77200f*4096.0f+0.5f));
 3760|       |
 3761|       |      for (; i+7 < count; i += 8) {
 3762|       |         // load
 3763|       |         uint8x8_t y_bytes  = vld1_u8(y + i);
 3764|       |         uint8x8_t cr_bytes = vld1_u8(pcr + i);
 3765|       |         uint8x8_t cb_bytes = vld1_u8(pcb + i);
 3766|       |         int8x8_t cr_biased = vreinterpret_s8_u8(vsub_u8(cr_bytes, signflip));
 3767|       |         int8x8_t cb_biased = vreinterpret_s8_u8(vsub_u8(cb_bytes, signflip));
 3768|       |
 3769|       |         // expand to s16
 3770|       |         int16x8_t yws = vreinterpretq_s16_u16(vshll_n_u8(y_bytes, 4));
 3771|       |         int16x8_t crw = vshll_n_s8(cr_biased, 7);
 3772|       |         int16x8_t cbw = vshll_n_s8(cb_biased, 7);
 3773|       |
 3774|       |         // color transform
 3775|       |         int16x8_t cr0 = vqdmulhq_s16(crw, cr_const0);
 3776|       |         int16x8_t cb0 = vqdmulhq_s16(cbw, cb_const0);
 3777|       |         int16x8_t cr1 = vqdmulhq_s16(crw, cr_const1);
 3778|       |         int16x8_t cb1 = vqdmulhq_s16(cbw, cb_const1);
 3779|       |         int16x8_t rws = vaddq_s16(yws, cr0);
 3780|       |         int16x8_t gws = vaddq_s16(vaddq_s16(yws, cb0), cr1);
 3781|       |         int16x8_t bws = vaddq_s16(yws, cb1);
 3782|       |
 3783|       |         // undo scaling, round, convert to byte
 3784|       |         uint8x8x4_t o;
 3785|       |         o.val[0] = vqrshrun_n_s16(rws, 4);
 3786|       |         o.val[1] = vqrshrun_n_s16(gws, 4);
 3787|       |         o.val[2] = vqrshrun_n_s16(bws, 4);
 3788|       |         o.val[3] = vdup_n_u8(255);
 3789|       |
 3790|       |         // store, interleaving r/g/b/a
 3791|       |         vst4_u8(out, o);
 3792|       |         out += 8*4;
 3793|       |      }
 3794|       |   }
 3795|       |#endif
 3796|       |
 3797|   199M|   for (; i < count; ++i) {
  ------------------
  |  Branch (3797:11): [True: 198M, False: 866k]
  ------------------
 3798|   198M|      int y_fixed = (y[i] << 20) + (1<<19); // rounding
 3799|   198M|      int r,g,b;
 3800|   198M|      int cr = pcr[i] - 128;
 3801|   198M|      int cb = pcb[i] - 128;
 3802|   198M|      r = y_fixed + cr* stbi__float2fixed(1.40200f);
  ------------------
  |  | 3659|   198M|#define stbi__float2fixed(x)  (((int) ((x) * 4096.0f + 0.5f)) << 8)
  ------------------
 3803|   198M|      g = y_fixed + cr*-stbi__float2fixed(0.71414f) + ((cb*-stbi__float2fixed(0.34414f)) & 0xffff0000);
  ------------------
  |  | 3659|   198M|#define stbi__float2fixed(x)  (((int) ((x) * 4096.0f + 0.5f)) << 8)
  ------------------
                    g = y_fixed + cr*-stbi__float2fixed(0.71414f) + ((cb*-stbi__float2fixed(0.34414f)) & 0xffff0000);
  ------------------
  |  | 3659|   198M|#define stbi__float2fixed(x)  (((int) ((x) * 4096.0f + 0.5f)) << 8)
  ------------------
 3804|   198M|      b = y_fixed                                   +   cb* stbi__float2fixed(1.77200f);
  ------------------
  |  | 3659|   198M|#define stbi__float2fixed(x)  (((int) ((x) * 4096.0f + 0.5f)) << 8)
  ------------------
 3805|   198M|      r >>= 20;
 3806|   198M|      g >>= 20;
 3807|   198M|      b >>= 20;
 3808|   198M|      if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }
  ------------------
  |  Branch (3808:11): [True: 109M, False: 88.9M]
  |  Branch (3808:37): [True: 94.5M, False: 14.8M]
  ------------------
 3809|   198M|      if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }
  ------------------
  |  Branch (3809:11): [True: 25.9M, False: 172M]
  |  Branch (3809:37): [True: 7.21M, False: 18.7M]
  ------------------
 3810|   198M|      if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }
  ------------------
  |  Branch (3810:11): [True: 95.5M, False: 102M]
  |  Branch (3810:37): [True: 81.9M, False: 13.6M]
  ------------------
 3811|   198M|      out[0] = (stbi_uc)r;
 3812|   198M|      out[1] = (stbi_uc)g;
 3813|   198M|      out[2] = (stbi_uc)b;
 3814|   198M|      out[3] = 255;
 3815|   198M|      out += step;
 3816|   198M|   }
 3817|   866k|}
OgreSTBICodec.cpp:_ZL28stbi__resample_row_hv_2_simdPhS_S_ii:
 3531|  76.0k|{
 3532|       |   // need to generate 2x2 samples for every one in input
 3533|  76.0k|   int i=0,t0,t1;
 3534|       |
 3535|  76.0k|   if (w == 1) {
  ------------------
  |  Branch (3535:8): [True: 0, False: 76.0k]
  ------------------
 3536|      0|      out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2);
  ------------------
  |  | 3454|      0|#define stbi__div4(x) ((stbi_uc) ((x) >> 2))
  ------------------
 3537|      0|      return out;
 3538|      0|   }
 3539|       |
 3540|  76.0k|   t1 = 3*in_near[0] + in_far[0];
 3541|       |   // process groups of 8 pixels for as long as we can.
 3542|       |   // note we can't handle the last pixel in a row in this loop
 3543|       |   // because we need to handle the filter boundary conditions.
 3544|  7.34M|   for (; i < ((w-1) & ~7); i += 8) {
  ------------------
  |  Branch (3544:11): [True: 7.26M, False: 76.0k]
  ------------------
 3545|  7.26M|#if defined(STBI_SSE2)
 3546|       |      // load and perform the vertical filtering pass
 3547|       |      // this uses 3*x + y = 4*x + (y - x)
 3548|  7.26M|      __m128i zero  = _mm_setzero_si128();
 3549|  7.26M|      __m128i farb  = _mm_loadl_epi64((__m128i *) (in_far + i));
 3550|  7.26M|      __m128i nearb = _mm_loadl_epi64((__m128i *) (in_near + i));
 3551|  7.26M|      __m128i farw  = _mm_unpacklo_epi8(farb, zero);
 3552|  7.26M|      __m128i nearw = _mm_unpacklo_epi8(nearb, zero);
 3553|  7.26M|      __m128i diff  = _mm_sub_epi16(farw, nearw);
 3554|  7.26M|      __m128i nears = _mm_slli_epi16(nearw, 2);
 3555|  7.26M|      __m128i curr  = _mm_add_epi16(nears, diff); // current row
 3556|       |
 3557|       |      // horizontal filter works the same based on shifted vers of current
 3558|       |      // row. "prev" is current row shifted right by 1 pixel; we need to
 3559|       |      // insert the previous pixel value (from t1).
 3560|       |      // "next" is current row shifted left by 1 pixel, with first pixel
 3561|       |      // of next block of 8 pixels added in.
 3562|  7.26M|      __m128i prv0 = _mm_slli_si128(curr, 2);
 3563|  7.26M|      __m128i nxt0 = _mm_srli_si128(curr, 2);
 3564|  7.26M|      __m128i prev = _mm_insert_epi16(prv0, t1, 0);
 3565|  7.26M|      __m128i next = _mm_insert_epi16(nxt0, 3*in_near[i+8] + in_far[i+8], 7);
 3566|       |
 3567|       |      // horizontal filter, polyphase implementation since it's convenient:
 3568|       |      // even pixels = 3*cur + prev = cur*4 + (prev - cur)
 3569|       |      // odd  pixels = 3*cur + next = cur*4 + (next - cur)
 3570|       |      // note the shared term.
 3571|  7.26M|      __m128i bias  = _mm_set1_epi16(8);
 3572|  7.26M|      __m128i curs = _mm_slli_epi16(curr, 2);
 3573|  7.26M|      __m128i prvd = _mm_sub_epi16(prev, curr);
 3574|  7.26M|      __m128i nxtd = _mm_sub_epi16(next, curr);
 3575|  7.26M|      __m128i curb = _mm_add_epi16(curs, bias);
 3576|  7.26M|      __m128i even = _mm_add_epi16(prvd, curb);
 3577|  7.26M|      __m128i odd  = _mm_add_epi16(nxtd, curb);
 3578|       |
 3579|       |      // interleave even and odd pixels, then undo scaling.
 3580|  7.26M|      __m128i int0 = _mm_unpacklo_epi16(even, odd);
 3581|  7.26M|      __m128i int1 = _mm_unpackhi_epi16(even, odd);
 3582|  7.26M|      __m128i de0  = _mm_srli_epi16(int0, 4);
 3583|  7.26M|      __m128i de1  = _mm_srli_epi16(int1, 4);
 3584|       |
 3585|       |      // pack and write output
 3586|  7.26M|      __m128i outv = _mm_packus_epi16(de0, de1);
 3587|  7.26M|      _mm_storeu_si128((__m128i *) (out + i*2), outv);
 3588|       |#elif defined(STBI_NEON)
 3589|       |      // load and perform the vertical filtering pass
 3590|       |      // this uses 3*x + y = 4*x + (y - x)
 3591|       |      uint8x8_t farb  = vld1_u8(in_far + i);
 3592|       |      uint8x8_t nearb = vld1_u8(in_near + i);
 3593|       |      int16x8_t diff  = vreinterpretq_s16_u16(vsubl_u8(farb, nearb));
 3594|       |      int16x8_t nears = vreinterpretq_s16_u16(vshll_n_u8(nearb, 2));
 3595|       |      int16x8_t curr  = vaddq_s16(nears, diff); // current row
 3596|       |
 3597|       |      // horizontal filter works the same based on shifted vers of current
 3598|       |      // row. "prev" is current row shifted right by 1 pixel; we need to
 3599|       |      // insert the previous pixel value (from t1).
 3600|       |      // "next" is current row shifted left by 1 pixel, with first pixel
 3601|       |      // of next block of 8 pixels added in.
 3602|       |      int16x8_t prv0 = vextq_s16(curr, curr, 7);
 3603|       |      int16x8_t nxt0 = vextq_s16(curr, curr, 1);
 3604|       |      int16x8_t prev = vsetq_lane_s16(t1, prv0, 0);
 3605|       |      int16x8_t next = vsetq_lane_s16(3*in_near[i+8] + in_far[i+8], nxt0, 7);
 3606|       |
 3607|       |      // horizontal filter, polyphase implementation since it's convenient:
 3608|       |      // even pixels = 3*cur + prev = cur*4 + (prev - cur)
 3609|       |      // odd  pixels = 3*cur + next = cur*4 + (next - cur)
 3610|       |      // note the shared term.
 3611|       |      int16x8_t curs = vshlq_n_s16(curr, 2);
 3612|       |      int16x8_t prvd = vsubq_s16(prev, curr);
 3613|       |      int16x8_t nxtd = vsubq_s16(next, curr);
 3614|       |      int16x8_t even = vaddq_s16(curs, prvd);
 3615|       |      int16x8_t odd  = vaddq_s16(curs, nxtd);
 3616|       |
 3617|       |      // undo scaling and round, then store with even/odd phases interleaved
 3618|       |      uint8x8x2_t o;
 3619|       |      o.val[0] = vqrshrun_n_s16(even, 4);
 3620|       |      o.val[1] = vqrshrun_n_s16(odd,  4);
 3621|       |      vst2_u8(out + i*2, o);
 3622|       |#endif
 3623|       |
 3624|       |      // "previous" value for next iter
 3625|  7.26M|      t1 = 3*in_near[i+7] + in_far[i+7];
 3626|  7.26M|   }
 3627|       |
 3628|  76.0k|   t0 = t1;
 3629|  76.0k|   t1 = 3*in_near[i] + in_far[i];
 3630|  76.0k|   out[i*2] = stbi__div16(3*t1 + t0 + 8);
  ------------------
  |  | 3503|  76.0k|#define stbi__div16(x) ((stbi_uc) ((x) >> 4))
  ------------------
 3631|       |
 3632|   382k|   for (++i; i < w; ++i) {
  ------------------
  |  Branch (3632:14): [True: 306k, False: 76.0k]
  ------------------
 3633|   306k|      t0 = t1;
 3634|   306k|      t1 = 3*in_near[i]+in_far[i];
 3635|   306k|      out[i*2-1] = stbi__div16(3*t0 + t1 + 8);
  ------------------
  |  | 3503|   306k|#define stbi__div16(x) ((stbi_uc) ((x) >> 4))
  ------------------
 3636|   306k|      out[i*2  ] = stbi__div16(3*t1 + t0 + 8);
  ------------------
  |  | 3503|   306k|#define stbi__div16(x) ((stbi_uc) ((x) >> 4))
  ------------------
 3637|   306k|   }
 3638|  76.0k|   out[w*2-1] = stbi__div4(t1+2);
  ------------------
  |  | 3454|  76.0k|#define stbi__div4(x) ((stbi_uc) ((x) >> 2))
  ------------------
 3639|       |
 3640|  76.0k|   STBI_NOTUSED(hs);
  ------------------
  |  |  660|  76.0k|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 3641|       |
 3642|  76.0k|   return out;
 3643|  76.0k|}
OgreSTBICodec.cpp:_ZL24stbi__decode_jpeg_headerP10stbi__jpegi:
 3366|  3.89k|{
 3367|  3.89k|   int m;
 3368|  3.89k|   z->jfif = 0;
 3369|  3.89k|   z->app14_color_transform = -1; // valid values are 0,1,2
 3370|  3.89k|   z->marker = STBI__MARKER_none; // initialize cached marker to empty
  ------------------
  |  | 2915|  3.89k|#define STBI__MARKER_none  0xff
  ------------------
 3371|  3.89k|   m = stbi__get_marker(z);
 3372|  3.89k|   if (!stbi__SOI(m)) return stbi__err("no SOI","Corrupt JPEG");
  ------------------
  |  | 3358|  3.89k|#define stbi__SOI(x)         ((x) == 0xd8)
  ------------------
                 if (!stbi__SOI(m)) return stbi__err("no SOI","Corrupt JPEG");
  ------------------
  |  | 1095|  1.14k|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3372:8): [True: 1.14k, False: 2.75k]
  ------------------
 3373|  2.75k|   if (scan == STBI__SCAN_type) return 1;
  ------------------
  |  Branch (3373:8): [True: 1.37k, False: 1.37k]
  ------------------
 3374|  1.37k|   m = stbi__get_marker(z);
 3375|  4.37k|   while (!stbi__SOF(m)) {
  ------------------
  |  | 3360|  4.37k|#define stbi__SOF(x)         ((x) == 0xc0 || (x) == 0xc1 || (x) == 0xc2)
  |  |  ------------------
  |  |  |  Branch (3360:31): [True: 193, False: 4.18k]
  |  |  |  Branch (3360:46): [True: 123, False: 4.06k]
  |  |  |  Branch (3360:61): [True: 708, False: 3.35k]
  |  |  ------------------
  ------------------
 3376|  3.35k|      if (!stbi__process_marker(z,m)) return 0;
  ------------------
  |  Branch (3376:11): [True: 224, False: 3.12k]
  ------------------
 3377|  3.12k|      m = stbi__get_marker(z);
 3378|  20.8k|      while (m == STBI__MARKER_none) {
  ------------------
  |  | 2915|  20.8k|#define STBI__MARKER_none  0xff
  ------------------
  |  Branch (3378:14): [True: 17.8k, False: 2.99k]
  ------------------
 3379|       |         // some files have extra padding after their blocks, so ok, we'll scan
 3380|  17.8k|         if (stbi__at_eof(z->s)) return stbi__err("no SOF", "Corrupt JPEG");
  ------------------
  |  | 1095|    130|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3380:14): [True: 130, False: 17.7k]
  ------------------
 3381|  17.7k|         m = stbi__get_marker(z);
 3382|  17.7k|      }
 3383|  3.12k|   }
 3384|  1.02k|   z->progressive = stbi__SOF_progressive(m);
  ------------------
  |  | 3363|  1.02k|#define stbi__SOF_progressive(x)   ((x) == 0xc2)
  ------------------
 3385|  1.02k|   if (!stbi__process_frame_header(z, scan)) return 0;
  ------------------
  |  Branch (3385:8): [True: 324, False: 700]
  ------------------
 3386|    700|   return 1;
 3387|  1.02k|}
OgreSTBICodec.cpp:_ZL16stbi__get_markerP10stbi__jpeg:
 2920|  38.2k|{
 2921|  38.2k|   stbi_uc x;
 2922|  38.2k|   if (j->marker != STBI__MARKER_none) { x = j->marker; j->marker = STBI__MARKER_none; return x; }
  ------------------
  |  | 2915|  38.2k|#define STBI__MARKER_none  0xff
  ------------------
                 if (j->marker != STBI__MARKER_none) { x = j->marker; j->marker = STBI__MARKER_none; return x; }
  ------------------
  |  | 2915|  8.01k|#define STBI__MARKER_none  0xff
  ------------------
  |  Branch (2922:8): [True: 8.01k, False: 30.2k]
  ------------------
 2923|  30.2k|   x = stbi__get8(j->s);
 2924|  30.2k|   if (x != 0xff) return STBI__MARKER_none;
  ------------------
  |  | 2915|  19.3k|#define STBI__MARKER_none  0xff
  ------------------
  |  Branch (2924:8): [True: 19.3k, False: 10.8k]
  ------------------
 2925|  23.1k|   while (x == 0xff)
  ------------------
  |  Branch (2925:11): [True: 12.2k, False: 10.8k]
  ------------------
 2926|  12.2k|      x = stbi__get8(j->s); // consume repeated 0xff fill bytes
 2927|  10.8k|   return x;
 2928|  30.2k|}
OgreSTBICodec.cpp:_ZL20stbi__process_markerP10stbi__jpegi:
 3100|  6.51k|{
 3101|  6.51k|   int L;
 3102|  6.51k|   switch (m) {
  ------------------
  |  Branch (3102:12): [True: 4.04k, False: 2.47k]
  ------------------
 3103|    322|      case STBI__MARKER_none: // no marker found
  ------------------
  |  | 2915|    322|#define STBI__MARKER_none  0xff
  ------------------
  |  Branch (3103:7): [True: 322, False: 6.19k]
  ------------------
 3104|    322|         return stbi__err("expected marker","Corrupt JPEG");
  ------------------
  |  | 1095|    322|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 3105|       |
 3106|    580|      case 0xDD: // DRI - specify restart interval
  ------------------
  |  Branch (3106:7): [True: 580, False: 5.93k]
  ------------------
 3107|    580|         if (stbi__get16be(z->s) != 4) return stbi__err("bad DRI len","Corrupt JPEG");
  ------------------
  |  | 1095|     10|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3107:14): [True: 10, False: 570]
  ------------------
 3108|    570|         z->restart_interval = stbi__get16be(z->s);
 3109|    570|         return 1;
 3110|       |
 3111|    429|      case 0xDB: // DQT - define quantization table
  ------------------
  |  Branch (3111:7): [True: 429, False: 6.08k]
  ------------------
 3112|    429|         L = stbi__get16be(z->s)-2;
 3113|  15.6k|         while (L > 0) {
  ------------------
  |  Branch (3113:17): [True: 15.2k, False: 420]
  ------------------
 3114|  15.2k|            int q = stbi__get8(z->s);
 3115|  15.2k|            int p = q >> 4, sixteen = (p != 0);
 3116|  15.2k|            int t = q & 15,i;
 3117|  15.2k|            if (p != 0 && p != 1) return stbi__err("bad DQT type","Corrupt JPEG");
  ------------------
  |  | 1095|      6|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3117:17): [True: 24, False: 15.2k]
  |  Branch (3117:27): [True: 6, False: 18]
  ------------------
 3118|  15.2k|            if (t > 3) return stbi__err("bad DQT table","Corrupt JPEG");
  ------------------
  |  | 1095|      3|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3118:17): [True: 3, False: 15.2k]
  ------------------
 3119|       |
 3120|   992k|            for (i=0; i < 64; ++i)
  ------------------
  |  Branch (3120:23): [True: 976k, False: 15.2k]
  ------------------
 3121|   976k|               z->dequant[t][stbi__jpeg_dezigzag[i]] = (stbi__uint16)(sixteen ? stbi__get16be(z->s) : stbi__get8(z->s));
  ------------------
  |  Branch (3121:71): [True: 1.15k, False: 975k]
  ------------------
 3122|  15.2k|            L -= (sixteen ? 129 : 65);
  ------------------
  |  Branch (3122:19): [True: 18, False: 15.2k]
  ------------------
 3123|  15.2k|         }
 3124|    420|         return L==0;
 3125|       |
 3126|  2.71k|      case 0xC4: // DHT - define huffman table
  ------------------
  |  Branch (3126:7): [True: 2.71k, False: 3.80k]
  ------------------
 3127|  2.71k|         L = stbi__get16be(z->s)-2;
 3128|   103k|         while (L > 0) {
  ------------------
  |  Branch (3128:17): [True: 101k, False: 2.64k]
  ------------------
 3129|   101k|            stbi_uc *v;
 3130|   101k|            int sizes[16],i,n=0;
 3131|   101k|            int q = stbi__get8(z->s);
 3132|   101k|            int tc = q >> 4;
 3133|   101k|            int th = q & 15;
 3134|   101k|            if (tc > 1 || th > 3) return stbi__err("bad DHT header","Corrupt JPEG");
  ------------------
  |  | 1095|     15|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3134:17): [True: 8, False: 101k]
  |  Branch (3134:27): [True: 7, False: 101k]
  ------------------
 3135|  1.71M|            for (i=0; i < 16; ++i) {
  ------------------
  |  Branch (3135:23): [True: 1.61M, False: 101k]
  ------------------
 3136|  1.61M|               sizes[i] = stbi__get8(z->s);
 3137|  1.61M|               n += sizes[i];
 3138|  1.61M|            }
 3139|   101k|            if(n > 256) return stbi__err("bad DHT header","Corrupt JPEG"); // Loop over i < n would write past end of values!
  ------------------
  |  | 1095|     21|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3139:16): [True: 21, False: 101k]
  ------------------
 3140|   101k|            L -= 17;
 3141|   101k|            if (tc == 0) {
  ------------------
  |  Branch (3141:17): [True: 98.4k, False: 2.61k]
  ------------------
 3142|  98.4k|               if (!stbi__build_huffman(z->huff_dc+th, sizes)) return 0;
  ------------------
  |  Branch (3142:20): [True: 17, False: 98.4k]
  ------------------
 3143|  98.4k|               v = z->huff_dc[th].values;
 3144|  98.4k|            } else {
 3145|  2.61k|               if (!stbi__build_huffman(z->huff_ac+th, sizes)) return 0;
  ------------------
  |  Branch (3145:20): [True: 13, False: 2.59k]
  ------------------
 3146|  2.59k|               v = z->huff_ac[th].values;
 3147|  2.59k|            }
 3148|   148k|            for (i=0; i < n; ++i)
  ------------------
  |  Branch (3148:23): [True: 47.3k, False: 101k]
  ------------------
 3149|  47.3k|               v[i] = stbi__get8(z->s);
 3150|   101k|            if (tc != 0)
  ------------------
  |  Branch (3150:17): [True: 2.59k, False: 98.4k]
  ------------------
 3151|  2.59k|               stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th);
 3152|   101k|            L -= n;
 3153|   101k|         }
 3154|  2.64k|         return L==0;
 3155|  6.51k|   }
 3156|       |
 3157|       |   // check for comment block or APP blocks
 3158|  2.47k|   if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) {
  ------------------
  |  Branch (3158:9): [True: 2.35k, False: 127]
  |  Branch (3158:22): [True: 1.62k, False: 723]
  |  Branch (3158:36): [True: 706, False: 144]
  ------------------
 3159|  2.33k|      L = stbi__get16be(z->s);
 3160|  2.33k|      if (L < 2) {
  ------------------
  |  Branch (3160:11): [True: 23, False: 2.31k]
  ------------------
 3161|     23|         if (m == 0xFE)
  ------------------
  |  Branch (3161:14): [True: 14, False: 9]
  ------------------
 3162|     14|            return stbi__err("bad COM len","Corrupt JPEG");
  ------------------
  |  | 1095|     14|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 3163|      9|         else
 3164|      9|            return stbi__err("bad APP len","Corrupt JPEG");
  ------------------
  |  | 1095|      9|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 3165|     23|      }
 3166|  2.31k|      L -= 2;
 3167|       |
 3168|  2.31k|      if (m == 0xE0 && L >= 5) { // JFIF APP0 segment
  ------------------
  |  Branch (3168:11): [True: 636, False: 1.67k]
  |  Branch (3168:24): [True: 506, False: 130]
  ------------------
 3169|    506|         static const unsigned char tag[5] = {'J','F','I','F','\0'};
 3170|    506|         int ok = 1;
 3171|    506|         int i;
 3172|  3.03k|         for (i=0; i < 5; ++i)
  ------------------
  |  Branch (3172:20): [True: 2.53k, False: 506]
  ------------------
 3173|  2.53k|            if (stbi__get8(z->s) != tag[i])
  ------------------
  |  Branch (3173:17): [True: 1.07k, False: 1.45k]
  ------------------
 3174|  1.07k|               ok = 0;
 3175|    506|         L -= 5;
 3176|    506|         if (ok)
  ------------------
  |  Branch (3176:14): [True: 96, False: 410]
  ------------------
 3177|     96|            z->jfif = 1;
 3178|  1.80k|      } else if (m == 0xEE && L >= 12) { // Adobe APP14 segment
  ------------------
  |  Branch (3178:18): [True: 951, False: 853]
  |  Branch (3178:31): [True: 753, False: 198]
  ------------------
 3179|    753|         static const unsigned char tag[6] = {'A','d','o','b','e','\0'};
 3180|    753|         int ok = 1;
 3181|    753|         int i;
 3182|  5.27k|         for (i=0; i < 6; ++i)
  ------------------
  |  Branch (3182:20): [True: 4.51k, False: 753]
  ------------------
 3183|  4.51k|            if (stbi__get8(z->s) != tag[i])
  ------------------
  |  Branch (3183:17): [True: 1.27k, False: 3.24k]
  ------------------
 3184|  1.27k|               ok = 0;
 3185|    753|         L -= 6;
 3186|    753|         if (ok) {
  ------------------
  |  Branch (3186:14): [True: 332, False: 421]
  ------------------
 3187|    332|            stbi__get8(z->s); // version
 3188|    332|            stbi__get16be(z->s); // flags0
 3189|    332|            stbi__get16be(z->s); // flags1
 3190|    332|            z->app14_color_transform = stbi__get8(z->s); // color transform
 3191|    332|            L -= 6;
 3192|    332|         }
 3193|    753|      }
 3194|       |
 3195|  2.31k|      stbi__skip(z->s, L);
 3196|  2.31k|      return 1;
 3197|  2.33k|   }
 3198|       |
 3199|    144|   return stbi__err("unknown marker","Corrupt JPEG");
  ------------------
  |  | 1095|    144|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 3200|  2.47k|}
OgreSTBICodec.cpp:_ZL19stbi__build_huffmanP13stbi__huffmanPi:
 2004|   101k|{
 2005|   101k|   int i,j,k=0;
 2006|   101k|   unsigned int code;
 2007|       |   // build size list for each symbol (from JPEG spec)
 2008|  1.71M|   for (i=0; i < 16; ++i) {
  ------------------
  |  Branch (2008:14): [True: 1.61M, False: 101k]
  ------------------
 2009|  1.66M|      for (j=0; j < count[i]; ++j) {
  ------------------
  |  Branch (2009:17): [True: 50.5k, False: 1.61M]
  ------------------
 2010|  50.5k|         h->size[k++] = (stbi_uc) (i+1);
 2011|  50.5k|         if(k >= 257) return stbi__err("bad size list","Corrupt JPEG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (2011:13): [True: 0, False: 50.5k]
  ------------------
 2012|  50.5k|      }
 2013|  1.61M|   }
 2014|   101k|   h->size[k] = 0;
 2015|       |
 2016|       |   // compute actual symbols (from jpeg spec)
 2017|   101k|   code = 0;
 2018|   101k|   k = 0;
 2019|  1.71M|   for(j=1; j <= 16; ++j) {
  ------------------
  |  Branch (2019:13): [True: 1.61M, False: 101k]
  ------------------
 2020|       |      // compute delta to add to code to compute symbol id
 2021|  1.61M|      h->delta[j] = k - code;
 2022|  1.61M|      if (h->size[k] == j) {
  ------------------
  |  Branch (2022:11): [True: 13.9k, False: 1.60M]
  ------------------
 2023|  63.9k|         while (h->size[k] == j)
  ------------------
  |  Branch (2023:17): [True: 49.9k, False: 13.9k]
  ------------------
 2024|  49.9k|            h->code[k++] = (stbi__uint16) (code++);
 2025|  13.9k|         if (code-1 >= (1u << j)) return stbi__err("bad code lengths","Corrupt JPEG");
  ------------------
  |  | 1095|     30|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (2025:14): [True: 30, False: 13.9k]
  ------------------
 2026|  13.9k|      }
 2027|       |      // compute largest code + 1 for this size, preshifted as needed later
 2028|  1.61M|      h->maxcode[j] = code << (16-j);
 2029|  1.61M|      code <<= 1;
 2030|  1.61M|   }
 2031|   101k|   h->maxcode[j] = 0xffffffff;
 2032|       |
 2033|       |   // build non-spec acceleration table; 255 is flag for not-accelerated
 2034|   101k|   memset(h->fast, 255, 1 << FAST_BITS);
  ------------------
  |  | 1936|   101k|#define FAST_BITS   9  // larger handles more cases; smaller stomps less cache
  ------------------
 2035|   148k|   for (i=0; i < k; ++i) {
  ------------------
  |  Branch (2035:14): [True: 47.3k, False: 101k]
  ------------------
 2036|  47.3k|      int s = h->size[i];
 2037|  47.3k|      if (s <= FAST_BITS) {
  ------------------
  |  | 1936|  47.3k|#define FAST_BITS   9  // larger handles more cases; smaller stomps less cache
  ------------------
  |  Branch (2037:11): [True: 27.2k, False: 20.1k]
  ------------------
 2038|  27.2k|         int c = h->code[i] << (FAST_BITS-s);
  ------------------
  |  | 1936|  27.2k|#define FAST_BITS   9  // larger handles more cases; smaller stomps less cache
  ------------------
 2039|  27.2k|         int m = 1 << (FAST_BITS-s);
  ------------------
  |  | 1936|  27.2k|#define FAST_BITS   9  // larger handles more cases; smaller stomps less cache
  ------------------
 2040|  1.17M|         for (j=0; j < m; ++j) {
  ------------------
  |  Branch (2040:20): [True: 1.14M, False: 27.2k]
  ------------------
 2041|  1.14M|            h->fast[c+j] = (stbi_uc) i;
 2042|  1.14M|         }
 2043|  27.2k|      }
 2044|  47.3k|   }
 2045|   101k|   return 1;
 2046|   101k|}
OgreSTBICodec.cpp:_ZL19stbi__build_fast_acPsP13stbi__huffman:
 2051|  2.59k|{
 2052|  2.59k|   int i;
 2053|  1.33M|   for (i=0; i < (1 << FAST_BITS); ++i) {
  ------------------
  |  | 1936|  1.33M|#define FAST_BITS   9  // larger handles more cases; smaller stomps less cache
  ------------------
  |  Branch (2053:14): [True: 1.33M, False: 2.59k]
  ------------------
 2054|  1.33M|      stbi_uc fast = h->fast[i];
 2055|  1.33M|      fast_ac[i] = 0;
 2056|  1.33M|      if (fast < 255) {
  ------------------
  |  Branch (2056:11): [True: 545k, False: 785k]
  ------------------
 2057|   545k|         int rs = h->values[fast];
 2058|   545k|         int run = (rs >> 4) & 15;
 2059|   545k|         int magbits = rs & 15;
 2060|   545k|         int len = h->size[fast];
 2061|       |
 2062|   545k|         if (magbits && len + magbits <= FAST_BITS) {
  ------------------
  |  | 1936|   449k|#define FAST_BITS   9  // larger handles more cases; smaller stomps less cache
  ------------------
  |  Branch (2062:14): [True: 449k, False: 95.8k]
  |  Branch (2062:25): [True: 397k, False: 52.4k]
  ------------------
 2063|       |            // magnitude code followed by receive_extend code
 2064|   397k|            int k = ((i << len) & ((1 << FAST_BITS) - 1)) >> (FAST_BITS - magbits);
  ------------------
  |  | 1936|   397k|#define FAST_BITS   9  // larger handles more cases; smaller stomps less cache
  ------------------
                          int k = ((i << len) & ((1 << FAST_BITS) - 1)) >> (FAST_BITS - magbits);
  ------------------
  |  | 1936|   397k|#define FAST_BITS   9  // larger handles more cases; smaller stomps less cache
  ------------------
 2065|   397k|            int m = 1 << (magbits - 1);
 2066|   397k|            if (k < m) k += (~0U << magbits) + 1;
  ------------------
  |  Branch (2066:17): [True: 198k, False: 198k]
  ------------------
 2067|       |            // if the result is small enough, we can fit it in fast_ac table
 2068|   397k|            if (k >= -128 && k <= 127)
  ------------------
  |  Branch (2068:17): [True: 396k, False: 381]
  |  Branch (2068:30): [True: 396k, False: 384]
  ------------------
 2069|   396k|               fast_ac[i] = (stbi__int16) ((k * 256) + (run * 16) + (len + magbits));
 2070|   397k|         }
 2071|   545k|      }
 2072|  1.33M|   }
 2073|  2.59k|}
OgreSTBICodec.cpp:_ZL26stbi__process_frame_headerP10stbi__jpegi:
 3265|  1.02k|{
 3266|  1.02k|   stbi__context *s = z->s;
 3267|  1.02k|   int Lf,p,i,q, h_max=1,v_max=1,c;
 3268|  1.02k|   Lf = stbi__get16be(s);         if (Lf < 11) return stbi__err("bad SOF len","Corrupt JPEG"); // JPEG
  ------------------
  |  | 1095|      6|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3268:39): [True: 6, False: 1.01k]
  ------------------
 3269|  1.01k|   p  = stbi__get8(s);            if (p != 8) return stbi__err("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline
  ------------------
  |  | 1095|     15|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3269:39): [True: 15, False: 1.00k]
  ------------------
 3270|  1.00k|   s->img_y = stbi__get16be(s);   if (s->img_y == 0) return stbi__err("no header height", "JPEG format not supported: delayed height"); // Legal, but we don't handle it--but neither does IJG
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3270:39): [True: 1, False: 1.00k]
  ------------------
 3271|  1.00k|   s->img_x = stbi__get16be(s);   if (s->img_x == 0) return stbi__err("0 width","Corrupt JPEG"); // JPEG requires
  ------------------
  |  | 1095|      7|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3271:39): [True: 7, False: 995]
  ------------------
 3272|    995|   if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    995|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                 if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
  ------------------
  |  | 1095|    124|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3272:8): [True: 124, False: 871]
  ------------------
 3273|    871|   if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    871|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                 if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
  ------------------
  |  | 1095|    146|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3273:8): [True: 146, False: 725]
  ------------------
 3274|    725|   c = stbi__get8(s);
 3275|    725|   if (c != 3 && c != 1 && c != 4) return stbi__err("bad component count","Corrupt JPEG");
  ------------------
  |  | 1095|      4|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3275:8): [True: 203, False: 522]
  |  Branch (3275:18): [True: 8, False: 195]
  |  Branch (3275:28): [True: 4, False: 4]
  ------------------
 3276|    721|   s->img_n = c;
 3277|  2.49k|   for (i=0; i < c; ++i) {
  ------------------
  |  Branch (3277:14): [True: 1.77k, False: 721]
  ------------------
 3278|  1.77k|      z->img_comp[i].data = NULL;
 3279|  1.77k|      z->img_comp[i].linebuf = NULL;
 3280|  1.77k|   }
 3281|       |
 3282|    721|   if (Lf != 8+3*s->img_n) return stbi__err("bad SOF len","Corrupt JPEG");
  ------------------
  |  | 1095|      4|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3282:8): [True: 4, False: 717]
  ------------------
 3283|       |
 3284|    717|   z->rgb = 0;
 3285|  2.45k|   for (i=0; i < s->img_n; ++i) {
  ------------------
  |  Branch (3285:14): [True: 1.75k, False: 702]
  ------------------
 3286|  1.75k|      static const unsigned char rgb[3] = { 'R', 'G', 'B' };
 3287|  1.75k|      z->img_comp[i].id = stbi__get8(s);
 3288|  1.75k|      if (s->img_n == 3 && z->img_comp[i].id == rgb[i])
  ------------------
  |  Branch (3288:11): [True: 1.54k, False: 205]
  |  Branch (3288:28): [True: 12, False: 1.53k]
  ------------------
 3289|     12|         ++z->rgb;
 3290|  1.75k|      q = stbi__get8(s);
 3291|  1.75k|      z->img_comp[i].h = (q >> 4);  if (!z->img_comp[i].h || z->img_comp[i].h > 4) return stbi__err("bad H","Corrupt JPEG");
  ------------------
  |  | 1095|     12|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3291:41): [True: 10, False: 1.74k]
  |  Branch (3291:62): [True: 2, False: 1.73k]
  ------------------
 3292|  1.73k|      z->img_comp[i].v = q & 15;    if (!z->img_comp[i].v || z->img_comp[i].v > 4) return stbi__err("bad V","Corrupt JPEG");
  ------------------
  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3292:41): [True: 0, False: 1.73k]
  |  Branch (3292:62): [True: 2, False: 1.73k]
  ------------------
 3293|  1.73k|      z->img_comp[i].tq = stbi__get8(s);  if (z->img_comp[i].tq > 3) return stbi__err("bad TQ","Corrupt JPEG");
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3293:47): [True: 1, False: 1.73k]
  ------------------
 3294|  1.73k|   }
 3295|       |
 3296|    702|   if (scan != STBI__SCAN_load) return 1;
  ------------------
  |  Branch (3296:8): [True: 0, False: 702]
  ------------------
 3297|       |
 3298|    702|   if (!stbi__mad3sizes_valid(s->img_x, s->img_y, s->img_n, 0)) return stbi__err("too large", "Image too large to decode");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3298:8): [True: 0, False: 702]
  ------------------
 3299|       |
 3300|  2.42k|   for (i=0; i < s->img_n; ++i) {
  ------------------
  |  Branch (3300:14): [True: 1.72k, False: 702]
  ------------------
 3301|  1.72k|      if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h;
  ------------------
  |  Branch (3301:11): [True: 457, False: 1.26k]
  ------------------
 3302|  1.72k|      if (z->img_comp[i].v > v_max) v_max = z->img_comp[i].v;
  ------------------
  |  Branch (3302:11): [True: 553, False: 1.17k]
  ------------------
 3303|  1.72k|   }
 3304|       |
 3305|       |   // check that plane subsampling factors are integer ratios; our resamplers can't deal with fractional ratios
 3306|       |   // and I've never seen a non-corrupted JPEG file actually use them
 3307|  2.42k|   for (i=0; i < s->img_n; ++i) {
  ------------------
  |  Branch (3307:14): [True: 1.72k, False: 700]
  ------------------
 3308|  1.72k|      if (h_max % z->img_comp[i].h != 0) return stbi__err("bad H","Corrupt JPEG");
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3308:11): [True: 1, False: 1.72k]
  ------------------
 3309|  1.72k|      if (v_max % z->img_comp[i].v != 0) return stbi__err("bad V","Corrupt JPEG");
  ------------------
  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3309:11): [True: 1, False: 1.72k]
  ------------------
 3310|  1.72k|   }
 3311|       |
 3312|       |   // compute interleaved mcu info
 3313|    700|   z->img_h_max = h_max;
 3314|    700|   z->img_v_max = v_max;
 3315|    700|   z->img_mcu_w = h_max * 8;
 3316|    700|   z->img_mcu_h = v_max * 8;
 3317|       |   // these sizes can't be more than 17 bits
 3318|    700|   z->img_mcu_x = (s->img_x + z->img_mcu_w-1) / z->img_mcu_w;
 3319|    700|   z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h;
 3320|       |
 3321|  2.41k|   for (i=0; i < s->img_n; ++i) {
  ------------------
  |  Branch (3321:14): [True: 1.71k, False: 700]
  ------------------
 3322|       |      // number of effective pixels (e.g. for non-interleaved MCU)
 3323|  1.71k|      z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max-1) / h_max;
 3324|  1.71k|      z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max-1) / v_max;
 3325|       |      // to simplify generation, we'll allocate enough memory to decode
 3326|       |      // the bogus oversized data from using interleaved MCUs and their
 3327|       |      // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't
 3328|       |      // discard the extra data until colorspace conversion
 3329|       |      //
 3330|       |      // img_mcu_x, img_mcu_y: <=17 bits; comp[i].h and .v are <=4 (checked earlier)
 3331|       |      // so these muls can't overflow with 32-bit ints (which we require)
 3332|  1.71k|      z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8;
 3333|  1.71k|      z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8;
 3334|  1.71k|      z->img_comp[i].coeff = 0;
 3335|  1.71k|      z->img_comp[i].raw_coeff = 0;
 3336|  1.71k|      z->img_comp[i].linebuf = NULL;
 3337|  1.71k|      z->img_comp[i].raw_data = stbi__malloc_mad2(z->img_comp[i].w2, z->img_comp[i].h2, 15);
 3338|  1.71k|      if (z->img_comp[i].raw_data == NULL)
  ------------------
  |  Branch (3338:11): [True: 0, False: 1.71k]
  ------------------
 3339|      0|         return stbi__free_jpeg_components(z, i+1, stbi__err("outofmem", "Out of memory"));
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 3340|       |      // align blocks for idct using mmx/sse
 3341|  1.71k|      z->img_comp[i].data = (stbi_uc*) (((size_t) z->img_comp[i].raw_data + 15) & ~15);
 3342|  1.71k|      if (z->progressive) {
  ------------------
  |  Branch (3342:11): [True: 1.11k, False: 605]
  ------------------
 3343|       |         // w2, h2 are multiples of 8 (see above)
 3344|  1.11k|         z->img_comp[i].coeff_w = z->img_comp[i].w2 / 8;
 3345|  1.11k|         z->img_comp[i].coeff_h = z->img_comp[i].h2 / 8;
 3346|  1.11k|         z->img_comp[i].raw_coeff = stbi__malloc_mad3(z->img_comp[i].w2, z->img_comp[i].h2, sizeof(short), 15);
 3347|  1.11k|         if (z->img_comp[i].raw_coeff == NULL)
  ------------------
  |  Branch (3347:14): [True: 0, False: 1.11k]
  ------------------
 3348|      0|            return stbi__free_jpeg_components(z, i+1, stbi__err("outofmem", "Out of memory"));
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 3349|  1.11k|         z->img_comp[i].coeff = (short*) (((size_t) z->img_comp[i].raw_coeff + 15) & ~15);
 3350|  1.11k|      }
 3351|  1.71k|   }
 3352|       |
 3353|    700|   return 1;
 3354|    700|}
OgreSTBICodec.cpp:_ZL26stbi__free_jpeg_componentsP10stbi__jpegii:
 3243|  1.37k|{
 3244|  1.37k|   int i;
 3245|  3.15k|   for (i=0; i < ncomp; ++i) {
  ------------------
  |  Branch (3245:14): [True: 1.77k, False: 1.37k]
  ------------------
 3246|  1.77k|      if (z->img_comp[i].raw_data) {
  ------------------
  |  Branch (3246:11): [True: 1.71k, False: 58]
  ------------------
 3247|  1.71k|         STBI_FREE(z->img_comp[i].raw_data);
  ------------------
  |  |  684|  1.71k|#define STBI_FREE(p)              free(p)
  ------------------
 3248|  1.71k|         z->img_comp[i].raw_data = NULL;
 3249|  1.71k|         z->img_comp[i].data = NULL;
 3250|  1.71k|      }
 3251|  1.77k|      if (z->img_comp[i].raw_coeff) {
  ------------------
  |  Branch (3251:11): [True: 1.11k, False: 663]
  ------------------
 3252|  1.11k|         STBI_FREE(z->img_comp[i].raw_coeff);
  ------------------
  |  |  684|  1.11k|#define STBI_FREE(p)              free(p)
  ------------------
 3253|  1.11k|         z->img_comp[i].raw_coeff = 0;
 3254|  1.11k|         z->img_comp[i].coeff = 0;
 3255|  1.11k|      }
 3256|  1.77k|      if (z->img_comp[i].linebuf) {
  ------------------
  |  Branch (3256:11): [True: 1.19k, False: 587]
  ------------------
 3257|  1.19k|         STBI_FREE(z->img_comp[i].linebuf);
  ------------------
  |  |  684|  1.19k|#define STBI_FREE(p)              free(p)
  ------------------
 3258|       |         z->img_comp[i].linebuf = NULL;
 3259|  1.19k|      }
 3260|  1.77k|   }
 3261|  1.37k|   return why;
 3262|  1.37k|}
OgreSTBICodec.cpp:_ZL15stbi__jpeg_loadP13stbi__contextPiS1_S1_iP17stbi__result_info:
 4029|  1.37k|{
 4030|  1.37k|   unsigned char* result;
 4031|  1.37k|   stbi__jpeg* j = (stbi__jpeg*) stbi__malloc(sizeof(stbi__jpeg));
 4032|  1.37k|   if (!j) return stbi__errpuc("outofmem", "Out of memory");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4032:8): [True: 0, False: 1.37k]
  ------------------
 4033|  1.37k|   memset(j, 0, sizeof(stbi__jpeg));
 4034|  1.37k|   STBI_NOTUSED(ri);
  ------------------
  |  |  660|  1.37k|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 4035|  1.37k|   j->s = s;
 4036|  1.37k|   stbi__setup_jpeg(j);
 4037|  1.37k|   result = load_jpeg_image(j, x,y,comp,req_comp);
 4038|  1.37k|   STBI_FREE(j);
  ------------------
  |  |  684|  1.37k|#define STBI_FREE(p)              free(p)
  ------------------
 4039|  1.37k|   return result;
 4040|  1.37k|}
OgreSTBICodec.cpp:_ZL15load_jpeg_imageP10stbi__jpegPiS1_S1_i:
 3866|  1.37k|{
 3867|  1.37k|   int n, decode_n, is_rgb;
 3868|  1.37k|   z->s->img_n = 0; // make stbi__cleanup_jpeg safe
 3869|       |
 3870|       |   // validate req_comp
 3871|  1.37k|   if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3871:8): [True: 0, False: 1.37k]
  |  Branch (3871:24): [True: 0, False: 1.37k]
  ------------------
 3872|       |
 3873|       |   // load a jpeg image from whichever source, but leave in YCbCr format
 3874|  1.37k|   if (!stbi__decode_jpeg_image(z)) { stbi__cleanup_jpeg(z); return NULL; }
  ------------------
  |  Branch (3874:8): [True: 893, False: 485]
  ------------------
 3875|       |
 3876|       |   // determine actual number of components to generate
 3877|    485|   n = req_comp ? req_comp : z->s->img_n >= 3 ? 3 : 1;
  ------------------
  |  Branch (3877:8): [True: 0, False: 485]
  |  Branch (3877:30): [True: 352, False: 133]
  ------------------
 3878|       |
 3879|    485|   is_rgb = z->s->img_n == 3 && (z->rgb == 3 || (z->app14_color_transform == 0 && !z->jfif));
  ------------------
  |  Branch (3879:13): [True: 351, False: 134]
  |  Branch (3879:34): [True: 3, False: 348]
  |  Branch (3879:50): [True: 2, False: 346]
  |  Branch (3879:83): [True: 2, False: 0]
  ------------------
 3880|       |
 3881|    485|   if (z->s->img_n == 3 && n < 3 && !is_rgb)
  ------------------
  |  Branch (3881:8): [True: 351, False: 134]
  |  Branch (3881:28): [True: 0, False: 351]
  |  Branch (3881:37): [True: 0, False: 0]
  ------------------
 3882|      0|      decode_n = 1;
 3883|    485|   else
 3884|    485|      decode_n = z->s->img_n;
 3885|       |
 3886|       |   // nothing to do if no components requested; check this now to avoid
 3887|       |   // accessing uninitialized coutput[0] later
 3888|    485|   if (decode_n <= 0) { stbi__cleanup_jpeg(z); return NULL; }
  ------------------
  |  Branch (3888:8): [True: 0, False: 485]
  ------------------
 3889|       |
 3890|       |   // resample and color-convert
 3891|    485|   {
 3892|    485|      int k;
 3893|    485|      unsigned int i,j;
 3894|    485|      stbi_uc *output;
 3895|    485|      stbi_uc *coutput[4] = { NULL, NULL, NULL, NULL };
 3896|       |
 3897|    485|      stbi__resample res_comp[4];
 3898|       |
 3899|  1.67k|      for (k=0; k < decode_n; ++k) {
  ------------------
  |  Branch (3899:17): [True: 1.19k, False: 485]
  ------------------
 3900|  1.19k|         stbi__resample *r = &res_comp[k];
 3901|       |
 3902|       |         // allocate line buffer big enough for upsampling off the edges
 3903|       |         // with upsample factor of 4
 3904|  1.19k|         z->img_comp[k].linebuf = (stbi_uc *) stbi__malloc(z->s->img_x + 3);
 3905|  1.19k|         if (!z->img_comp[k].linebuf) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); }
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3905:14): [True: 0, False: 1.19k]
  ------------------
 3906|       |
 3907|  1.19k|         r->hs      = z->img_h_max / z->img_comp[k].h;
 3908|  1.19k|         r->vs      = z->img_v_max / z->img_comp[k].v;
 3909|  1.19k|         r->ystep   = r->vs >> 1;
 3910|  1.19k|         r->w_lores = (z->s->img_x + r->hs-1) / r->hs;
 3911|  1.19k|         r->ypos    = 0;
 3912|  1.19k|         r->line0   = r->line1 = z->img_comp[k].data;
 3913|       |
 3914|  1.19k|         if      (r->hs == 1 && r->vs == 1) r->resample = resample_row_1;
  ------------------
  |  Branch (3914:19): [True: 763, False: 427]
  |  Branch (3914:33): [True: 563, False: 200]
  ------------------
 3915|    627|         else if (r->hs == 1 && r->vs == 2) r->resample = stbi__resample_row_v_2;
  ------------------
  |  Branch (3915:19): [True: 200, False: 427]
  |  Branch (3915:33): [True: 167, False: 33]
  ------------------
 3916|    460|         else if (r->hs == 2 && r->vs == 1) r->resample = stbi__resample_row_h_2;
  ------------------
  |  Branch (3916:19): [True: 269, False: 191]
  |  Branch (3916:33): [True: 34, False: 235]
  ------------------
 3917|    426|         else if (r->hs == 2 && r->vs == 2) r->resample = z->resample_row_hv_2_kernel;
  ------------------
  |  Branch (3917:19): [True: 235, False: 191]
  |  Branch (3917:33): [True: 219, False: 16]
  ------------------
 3918|    207|         else                               r->resample = stbi__resample_row_generic;
 3919|  1.19k|      }
 3920|       |
 3921|       |      // can't error after this so, this is safe
 3922|    485|      output = (stbi_uc *) stbi__malloc_mad3(n, z->s->img_x, z->s->img_y, 1);
 3923|    485|      if (!output) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); }
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3923:11): [True: 0, False: 485]
  ------------------
 3924|       |
 3925|       |      // now go ahead and resample
 3926|  1.05M|      for (j=0; j < z->s->img_y; ++j) {
  ------------------
  |  Branch (3926:17): [True: 1.05M, False: 485]
  ------------------
 3927|  1.05M|         stbi_uc *out = output + n * z->s->img_x * j;
 3928|  3.85M|         for (k=0; k < decode_n; ++k) {
  ------------------
  |  Branch (3928:20): [True: 2.80M, False: 1.05M]
  ------------------
 3929|  2.80M|            stbi__resample *r = &res_comp[k];
 3930|  2.80M|            int y_bot = r->ystep >= (r->vs >> 1);
 3931|  2.80M|            coutput[k] = r->resample(z->img_comp[k].linebuf,
 3932|  2.80M|                                     y_bot ? r->line1 : r->line0,
  ------------------
  |  Branch (3932:38): [True: 2.05M, False: 745k]
  ------------------
 3933|  2.80M|                                     y_bot ? r->line0 : r->line1,
  ------------------
  |  Branch (3933:38): [True: 2.05M, False: 745k]
  ------------------
 3934|  2.80M|                                     r->w_lores, r->hs);
 3935|  2.80M|            if (++r->ystep >= r->vs) {
  ------------------
  |  Branch (3935:17): [True: 2.00M, False: 801k]
  ------------------
 3936|  2.00M|               r->ystep = 0;
 3937|  2.00M|               r->line0 = r->line1;
 3938|  2.00M|               if (++r->ypos < z->img_comp[k].y)
  ------------------
  |  Branch (3938:20): [True: 2.00M, False: 1.15k]
  ------------------
 3939|  2.00M|                  r->line1 += z->img_comp[k].w2;
 3940|  2.00M|            }
 3941|  2.80M|         }
 3942|  1.05M|         if (n >= 3) {
  ------------------
  |  Branch (3942:14): [True: 875k, False: 176k]
  ------------------
 3943|   875k|            stbi_uc *y = coutput[0];
 3944|   875k|            if (z->s->img_n == 3) {
  ------------------
  |  Branch (3944:17): [True: 873k, False: 1.82k]
  ------------------
 3945|   873k|               if (is_rgb) {
  ------------------
  |  Branch (3945:20): [True: 8.50k, False: 864k]
  ------------------
 3946|  28.3k|                  for (i=0; i < z->s->img_x; ++i) {
  ------------------
  |  Branch (3946:29): [True: 19.8k, False: 8.50k]
  ------------------
 3947|  19.8k|                     out[0] = y[i];
 3948|  19.8k|                     out[1] = coutput[1][i];
 3949|  19.8k|                     out[2] = coutput[2][i];
 3950|  19.8k|                     out[3] = 255;
 3951|  19.8k|                     out += n;
 3952|  19.8k|                  }
 3953|   864k|               } else {
 3954|   864k|                  z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n);
 3955|   864k|               }
 3956|   873k|            } else if (z->s->img_n == 4) {
  ------------------
  |  Branch (3956:24): [True: 1.82k, False: 0]
  ------------------
 3957|  1.82k|               if (z->app14_color_transform == 0) { // CMYK
  ------------------
  |  Branch (3957:20): [True: 0, False: 1.82k]
  ------------------
 3958|      0|                  for (i=0; i < z->s->img_x; ++i) {
  ------------------
  |  Branch (3958:29): [True: 0, False: 0]
  ------------------
 3959|      0|                     stbi_uc m = coutput[3][i];
 3960|      0|                     out[0] = stbi__blinn_8x8(coutput[0][i], m);
 3961|      0|                     out[1] = stbi__blinn_8x8(coutput[1][i], m);
 3962|      0|                     out[2] = stbi__blinn_8x8(coutput[2][i], m);
 3963|      0|                     out[3] = 255;
 3964|      0|                     out += n;
 3965|      0|                  }
 3966|  1.82k|               } else if (z->app14_color_transform == 2) { // YCCK
  ------------------
  |  Branch (3966:27): [True: 0, False: 1.82k]
  ------------------
 3967|      0|                  z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n);
 3968|      0|                  for (i=0; i < z->s->img_x; ++i) {
  ------------------
  |  Branch (3968:29): [True: 0, False: 0]
  ------------------
 3969|      0|                     stbi_uc m = coutput[3][i];
 3970|      0|                     out[0] = stbi__blinn_8x8(255 - out[0], m);
 3971|      0|                     out[1] = stbi__blinn_8x8(255 - out[1], m);
 3972|      0|                     out[2] = stbi__blinn_8x8(255 - out[2], m);
 3973|      0|                     out += n;
 3974|      0|                  }
 3975|  1.82k|               } else { // YCbCr + alpha?  Ignore the fourth channel for now
 3976|  1.82k|                  z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n);
 3977|  1.82k|               }
 3978|  1.82k|            } else
 3979|      0|               for (i=0; i < z->s->img_x; ++i) {
  ------------------
  |  Branch (3979:26): [True: 0, False: 0]
  ------------------
 3980|      0|                  out[0] = out[1] = out[2] = y[i];
 3981|      0|                  out[3] = 255; // not used if n==3
 3982|      0|                  out += n;
 3983|      0|               }
 3984|   875k|         } else {
 3985|   176k|            if (is_rgb) {
  ------------------
  |  Branch (3985:17): [True: 0, False: 176k]
  ------------------
 3986|      0|               if (n == 1)
  ------------------
  |  Branch (3986:20): [True: 0, False: 0]
  ------------------
 3987|      0|                  for (i=0; i < z->s->img_x; ++i)
  ------------------
  |  Branch (3987:29): [True: 0, False: 0]
  ------------------
 3988|      0|                     *out++ = stbi__compute_y(coutput[0][i], coutput[1][i], coutput[2][i]);
 3989|      0|               else {
 3990|      0|                  for (i=0; i < z->s->img_x; ++i, out += 2) {
  ------------------
  |  Branch (3990:29): [True: 0, False: 0]
  ------------------
 3991|      0|                     out[0] = stbi__compute_y(coutput[0][i], coutput[1][i], coutput[2][i]);
 3992|      0|                     out[1] = 255;
 3993|      0|                  }
 3994|      0|               }
 3995|   176k|            } else if (z->s->img_n == 4 && z->app14_color_transform == 0) {
  ------------------
  |  Branch (3995:24): [True: 0, False: 176k]
  |  Branch (3995:44): [True: 0, False: 0]
  ------------------
 3996|      0|               for (i=0; i < z->s->img_x; ++i) {
  ------------------
  |  Branch (3996:26): [True: 0, False: 0]
  ------------------
 3997|      0|                  stbi_uc m = coutput[3][i];
 3998|      0|                  stbi_uc r = stbi__blinn_8x8(coutput[0][i], m);
 3999|      0|                  stbi_uc g = stbi__blinn_8x8(coutput[1][i], m);
 4000|      0|                  stbi_uc b = stbi__blinn_8x8(coutput[2][i], m);
 4001|      0|                  out[0] = stbi__compute_y(r, g, b);
 4002|      0|                  out[1] = 255;
 4003|      0|                  out += n;
 4004|      0|               }
 4005|   176k|            } else if (z->s->img_n == 4 && z->app14_color_transform == 2) {
  ------------------
  |  Branch (4005:24): [True: 0, False: 176k]
  |  Branch (4005:44): [True: 0, False: 0]
  ------------------
 4006|      0|               for (i=0; i < z->s->img_x; ++i) {
  ------------------
  |  Branch (4006:26): [True: 0, False: 0]
  ------------------
 4007|      0|                  out[0] = stbi__blinn_8x8(255 - coutput[0][i], coutput[3][i]);
 4008|      0|                  out[1] = 255;
 4009|      0|                  out += n;
 4010|      0|               }
 4011|   176k|            } else {
 4012|   176k|               stbi_uc *y = coutput[0];
 4013|   176k|               if (n == 1)
  ------------------
  |  Branch (4013:20): [True: 176k, False: 0]
  ------------------
 4014|   177M|                  for (i=0; i < z->s->img_x; ++i) out[i] = y[i];
  ------------------
  |  Branch (4014:29): [True: 177M, False: 176k]
  ------------------
 4015|      0|               else
 4016|      0|                  for (i=0; i < z->s->img_x; ++i) { *out++ = y[i]; *out++ = 255; }
  ------------------
  |  Branch (4016:29): [True: 0, False: 0]
  ------------------
 4017|   176k|            }
 4018|   176k|         }
 4019|  1.05M|      }
 4020|    485|      stbi__cleanup_jpeg(z);
 4021|    485|      *out_x = z->s->img_x;
 4022|    485|      *out_y = z->s->img_y;
 4023|    485|      if (comp) *comp = z->s->img_n >= 3 ? 3 : 1; // report original components, not output
  ------------------
  |  Branch (4023:11): [True: 485, False: 0]
  |  Branch (4023:25): [True: 352, False: 133]
  ------------------
 4024|    485|      return output;
 4025|    485|   }
 4026|    485|}
OgreSTBICodec.cpp:_ZL23stbi__decode_jpeg_imageP10stbi__jpeg:
 3413|  1.37k|{
 3414|  1.37k|   int m;
 3415|  6.89k|   for (m = 0; m < 4; m++) {
  ------------------
  |  Branch (3415:16): [True: 5.51k, False: 1.37k]
  ------------------
 3416|  5.51k|      j->img_comp[m].raw_data = NULL;
 3417|  5.51k|      j->img_comp[m].raw_coeff = NULL;
 3418|  5.51k|   }
 3419|  1.37k|   j->restart_interval = 0;
 3420|  1.37k|   if (!stbi__decode_jpeg_header(j, STBI__SCAN_load)) return 0;
  ------------------
  |  Branch (3420:8): [True: 678, False: 700]
  ------------------
 3421|    700|   m = stbi__get_marker(j);
 3422|  11.6k|   while (!stbi__EOI(m)) {
  ------------------
  |  | 3359|  11.6k|#define stbi__EOI(x)         ((x) == 0xd9)
  ------------------
  |  Branch (3422:11): [True: 11.6k, False: 10]
  ------------------
 3423|  11.6k|      if (stbi__SOS(m)) {
  ------------------
  |  | 3361|  11.6k|#define stbi__SOS(x)         ((x) == 0xda)
  |  |  ------------------
  |  |  |  Branch (3361:30): [True: 8.49k, False: 3.16k]
  |  |  ------------------
  ------------------
 3424|  8.49k|         if (!stbi__process_scan_header(j)) return 0;
  ------------------
  |  Branch (3424:14): [True: 96, False: 8.39k]
  ------------------
 3425|  8.39k|         if (!stbi__parse_entropy_coded_data(j)) return 0;
  ------------------
  |  Branch (3425:14): [True: 117, False: 8.27k]
  ------------------
 3426|  8.27k|         if (j->marker == STBI__MARKER_none ) {
  ------------------
  |  | 2915|  8.27k|#define STBI__MARKER_none  0xff
  ------------------
  |  Branch (3426:14): [True: 1.65k, False: 6.62k]
  ------------------
 3427|  1.65k|         j->marker = stbi__skip_jpeg_junk_at_end(j);
 3428|       |            // if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0
 3429|  1.65k|         }
 3430|  8.27k|         m = stbi__get_marker(j);
 3431|  8.27k|         if (STBI__RESTART(m))
  ------------------
  |  | 2932|  8.27k|#define STBI__RESTART(x)     ((x) >= 0xd0 && (x) <= 0xd7)
  |  |  ------------------
  |  |  |  Branch (2932:31): [True: 6.43k, False: 1.84k]
  |  |  |  Branch (2932:46): [True: 404, False: 6.02k]
  |  |  ------------------
  ------------------
 3432|    404|            m = stbi__get_marker(j);
 3433|  8.27k|      } else if (stbi__DNL(m)) {
  ------------------
  |  | 3357|  3.16k|#define stbi__DNL(x)         ((x) == 0xdc)
  |  |  ------------------
  |  |  |  Branch (3357:30): [True: 2, False: 3.16k]
  |  |  ------------------
  ------------------
 3434|      2|         int Ld = stbi__get16be(j->s);
 3435|      2|         stbi__uint32 NL = stbi__get16be(j->s);
 3436|      2|         if (Ld != 4) return stbi__err("bad DNL len", "Corrupt JPEG");
  ------------------
  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3436:14): [True: 2, False: 0]
  ------------------
 3437|      0|         if (NL != j->s->img_y) return stbi__err("bad DNL height", "Corrupt JPEG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3437:14): [True: 0, False: 0]
  ------------------
 3438|      0|         m = stbi__get_marker(j);
 3439|  3.16k|      } else {
 3440|  3.16k|         if (!stbi__process_marker(j, m)) return 1;
  ------------------
  |  Branch (3440:14): [True: 475, False: 2.69k]
  ------------------
 3441|  2.69k|         m = stbi__get_marker(j);
 3442|  2.69k|      }
 3443|  11.6k|   }
 3444|     10|   if (j->progressive)
  ------------------
  |  Branch (3444:8): [True: 8, False: 2]
  ------------------
 3445|      8|      stbi__jpeg_finish(j);
 3446|     10|   return 1;
 3447|    700|}
OgreSTBICodec.cpp:_ZL25stbi__process_scan_headerP10stbi__jpeg:
 3204|  8.49k|{
 3205|  8.49k|   int i;
 3206|  8.49k|   int Ls = stbi__get16be(z->s);
 3207|  8.49k|   z->scan_n = stbi__get8(z->s);
 3208|  8.49k|   if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return stbi__err("bad SOS component count","Corrupt JPEG");
  ------------------
  |  | 1095|     37|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3208:8): [True: 21, False: 8.46k]
  |  Branch (3208:25): [True: 12, False: 8.45k]
  |  Branch (3208:42): [True: 4, False: 8.45k]
  ------------------
 3209|  8.45k|   if (Ls != 6+2*z->scan_n) return stbi__err("bad SOS len","Corrupt JPEG");
  ------------------
  |  | 1095|     15|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3209:8): [True: 15, False: 8.43k]
  ------------------
 3210|  22.8k|   for (i=0; i < z->scan_n; ++i) {
  ------------------
  |  Branch (3210:14): [True: 14.4k, False: 8.42k]
  ------------------
 3211|  14.4k|      int id = stbi__get8(z->s), which;
 3212|  14.4k|      int q = stbi__get8(z->s);
 3213|  33.8k|      for (which = 0; which < z->s->img_n; ++which)
  ------------------
  |  Branch (3213:23): [True: 33.8k, False: 10]
  ------------------
 3214|  33.8k|         if (z->img_comp[which].id == id)
  ------------------
  |  Branch (3214:14): [True: 14.4k, False: 19.4k]
  ------------------
 3215|  14.4k|            break;
 3216|  14.4k|      if (which == z->s->img_n) return 0; // no match
  ------------------
  |  Branch (3216:11): [True: 10, False: 14.4k]
  ------------------
 3217|  14.4k|      z->img_comp[which].hd = q >> 4;   if (z->img_comp[which].hd > 3) return stbi__err("bad DC huff","Corrupt JPEG");
  ------------------
  |  | 1095|      4|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3217:45): [True: 4, False: 14.4k]
  ------------------
 3218|  14.4k|      z->img_comp[which].ha = q & 15;   if (z->img_comp[which].ha > 3) return stbi__err("bad AC huff","Corrupt JPEG");
  ------------------
  |  | 1095|      3|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3218:45): [True: 3, False: 14.4k]
  ------------------
 3219|  14.4k|      z->order[i] = which;
 3220|  14.4k|   }
 3221|       |
 3222|  8.42k|   {
 3223|  8.42k|      int aa;
 3224|  8.42k|      z->spec_start = stbi__get8(z->s);
 3225|  8.42k|      z->spec_end   = stbi__get8(z->s); // should be 63, but might be 0
 3226|  8.42k|      aa = stbi__get8(z->s);
 3227|  8.42k|      z->succ_high = (aa >> 4);
 3228|  8.42k|      z->succ_low  = (aa & 15);
 3229|  8.42k|      if (z->progressive) {
  ------------------
  |  Branch (3229:11): [True: 4.69k, False: 3.72k]
  ------------------
 3230|  4.69k|         if (z->spec_start > 63 || z->spec_end > 63  || z->spec_start > z->spec_end || z->succ_high > 13 || z->succ_low > 13)
  ------------------
  |  Branch (3230:14): [True: 2, False: 4.69k]
  |  Branch (3230:36): [True: 1, False: 4.69k]
  |  Branch (3230:57): [True: 11, False: 4.68k]
  |  Branch (3230:88): [True: 4, False: 4.67k]
  |  Branch (3230:109): [True: 1, False: 4.67k]
  ------------------
 3231|     19|            return stbi__err("bad SOS", "Corrupt JPEG");
  ------------------
  |  | 1095|     19|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 3232|  4.69k|      } else {
 3233|  3.72k|         if (z->spec_start != 0) return stbi__err("bad SOS","Corrupt JPEG");
  ------------------
  |  | 1095|      5|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3233:14): [True: 5, False: 3.72k]
  ------------------
 3234|  3.72k|         if (z->succ_high != 0 || z->succ_low != 0) return stbi__err("bad SOS","Corrupt JPEG");
  ------------------
  |  | 1095|      3|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (3234:14): [True: 3, False: 3.71k]
  |  Branch (3234:35): [True: 0, False: 3.71k]
  ------------------
 3235|  3.71k|         z->spec_end = 63;
 3236|  3.71k|      }
 3237|  8.42k|   }
 3238|       |
 3239|  8.39k|   return 1;
 3240|  8.42k|}
OgreSTBICodec.cpp:_ZL30stbi__parse_entropy_coded_dataP10stbi__jpeg:
 2950|  8.39k|{
 2951|  8.39k|   stbi__jpeg_reset(z);
 2952|  8.39k|   if (!z->progressive) {
  ------------------
  |  Branch (2952:8): [True: 3.71k, False: 4.67k]
  ------------------
 2953|  3.71k|      if (z->scan_n == 1) {
  ------------------
  |  Branch (2953:11): [True: 1.49k, False: 2.22k]
  ------------------
 2954|  1.49k|         int i,j;
 2955|  1.49k|         STBI_SIMD_ALIGN(short, data[64]);
  ------------------
  |  |  762|  1.49k|#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16)))
  ------------------
 2956|  1.49k|         int n = z->order[0];
 2957|       |         // non-interleaved data, we just need to process one block at a time,
 2958|       |         // in trivial scanline order
 2959|       |         // number of blocks to do just depends on how many actual "pixels" this
 2960|       |         // component has, independent of interleaved MCU blocking and such
 2961|  1.49k|         int w = (z->img_comp[n].x+7) >> 3;
 2962|  1.49k|         int h = (z->img_comp[n].y+7) >> 3;
 2963|  15.0k|         for (j=0; j < h; ++j) {
  ------------------
  |  Branch (2963:20): [True: 14.3k, False: 687]
  ------------------
 2964|  1.12M|            for (i=0; i < w; ++i) {
  ------------------
  |  Branch (2964:23): [True: 1.11M, False: 13.5k]
  ------------------
 2965|  1.11M|               int ha = z->img_comp[n].ha;
 2966|  1.11M|               if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0;
  ------------------
  |  Branch (2966:20): [True: 26, False: 1.11M]
  ------------------
 2967|  1.11M|               z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data);
 2968|       |               // every data block is an MCU, so countdown the restart interval
 2969|  1.11M|               if (--z->todo <= 0) {
  ------------------
  |  Branch (2969:20): [True: 784, False: 1.11M]
  ------------------
 2970|    784|                  if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
  ------------------
  |  Branch (2970:23): [True: 349, False: 435]
  ------------------
 2971|       |                  // if it's NOT a restart, then just bail, so we get corrupt data
 2972|       |                  // rather than no data
 2973|    784|                  if (!STBI__RESTART(z->marker)) return 1;
  ------------------
  |  | 2932|    784|#define STBI__RESTART(x)     ((x) >= 0xd0 && (x) <= 0xd7)
  |  |  ------------------
  |  |  |  Branch (2932:31): [True: 101, False: 683]
  |  |  |  Branch (2932:46): [True: 3, False: 98]
  |  |  ------------------
  ------------------
 2974|      3|                  stbi__jpeg_reset(z);
 2975|      3|               }
 2976|  1.11M|            }
 2977|  14.3k|         }
 2978|    687|         return 1;
 2979|  2.22k|      } else { // interleaved
 2980|  2.22k|         int i,j,k,x,y;
 2981|  2.22k|         STBI_SIMD_ALIGN(short, data[64]);
  ------------------
  |  |  762|  2.22k|#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16)))
  ------------------
 2982|  25.9k|         for (j=0; j < z->img_mcu_y; ++j) {
  ------------------
  |  Branch (2982:20): [True: 25.2k, False: 689]
  ------------------
 2983|   581k|            for (i=0; i < z->img_mcu_x; ++i) {
  ------------------
  |  Branch (2983:23): [True: 557k, False: 23.7k]
  ------------------
 2984|       |               // scan an interleaved mcu... process scan_n components in order
 2985|  2.18M|               for (k=0; k < z->scan_n; ++k) {
  ------------------
  |  Branch (2985:26): [True: 1.63M, False: 557k]
  ------------------
 2986|  1.63M|                  int n = z->order[k];
 2987|       |                  // scan out an mcu's worth of this component; that's just determined
 2988|       |                  // by the basic H and V specified for the component
 2989|  3.77M|                  for (y=0; y < z->img_comp[n].v; ++y) {
  ------------------
  |  Branch (2989:29): [True: 2.14M, False: 1.63M]
  ------------------
 2990|  4.85M|                     for (x=0; x < z->img_comp[n].h; ++x) {
  ------------------
  |  Branch (2990:32): [True: 2.71M, False: 2.14M]
  ------------------
 2991|  2.71M|                        int x2 = (i*z->img_comp[n].h + x)*8;
 2992|  2.71M|                        int y2 = (j*z->img_comp[n].v + y)*8;
 2993|  2.71M|                        int ha = z->img_comp[n].ha;
 2994|  2.71M|                        if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0;
  ------------------
  |  Branch (2994:29): [True: 14, False: 2.71M]
  ------------------
 2995|  2.71M|                        z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data);
 2996|  2.71M|                     }
 2997|  2.14M|                  }
 2998|  1.63M|               }
 2999|       |               // after all interleaved components, that's an interleaved MCU,
 3000|       |               // so now count down the restart interval
 3001|   557k|               if (--z->todo <= 0) {
  ------------------
  |  Branch (3001:20): [True: 2.74k, False: 555k]
  ------------------
 3002|  2.74k|                  if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
  ------------------
  |  Branch (3002:23): [True: 646, False: 2.09k]
  ------------------
 3003|  2.74k|                  if (!STBI__RESTART(z->marker)) return 1;
  ------------------
  |  | 2932|  2.74k|#define STBI__RESTART(x)     ((x) >= 0xd0 && (x) <= 0xd7)
  |  |  ------------------
  |  |  |  Branch (2932:31): [True: 2.74k, False: 0]
  |  |  |  Branch (2932:46): [True: 1.22k, False: 1.52k]
  |  |  ------------------
  ------------------
 3004|  1.22k|                  stbi__jpeg_reset(z);
 3005|  1.22k|               }
 3006|   557k|            }
 3007|  25.2k|         }
 3008|    689|         return 1;
 3009|  2.22k|      }
 3010|  4.67k|   } else {
 3011|  4.67k|      if (z->scan_n == 1) {
  ------------------
  |  Branch (3011:11): [True: 2.05k, False: 2.62k]
  ------------------
 3012|  2.05k|         int i,j;
 3013|  2.05k|         int n = z->order[0];
 3014|       |         // non-interleaved data, we just need to process one block at a time,
 3015|       |         // in trivial scanline order
 3016|       |         // number of blocks to do just depends on how many actual "pixels" this
 3017|       |         // component has, independent of interleaved MCU blocking and such
 3018|  2.05k|         int w = (z->img_comp[n].x+7) >> 3;
 3019|  2.05k|         int h = (z->img_comp[n].y+7) >> 3;
 3020|  77.0k|         for (j=0; j < h; ++j) {
  ------------------
  |  Branch (3020:20): [True: 75.8k, False: 1.18k]
  ------------------
 3021|  3.65M|            for (i=0; i < w; ++i) {
  ------------------
  |  Branch (3021:23): [True: 3.58M, False: 75.0k]
  ------------------
 3022|  3.58M|               short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w);
 3023|  3.58M|               if (z->spec_start == 0) {
  ------------------
  |  Branch (3023:20): [True: 2.14M, False: 1.43M]
  ------------------
 3024|  2.14M|                  if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n))
  ------------------
  |  Branch (3024:23): [True: 12, False: 2.14M]
  ------------------
 3025|     12|                     return 0;
 3026|  2.14M|               } else {
 3027|  1.43M|                  int ha = z->img_comp[n].ha;
 3028|  1.43M|                  if (!stbi__jpeg_decode_block_prog_ac(z, data, &z->huff_ac[ha], z->fast_ac[ha]))
  ------------------
  |  Branch (3028:23): [True: 46, False: 1.43M]
  ------------------
 3029|     46|                     return 0;
 3030|  1.43M|               }
 3031|       |               // every data block is an MCU, so countdown the restart interval
 3032|  3.58M|               if (--z->todo <= 0) {
  ------------------
  |  Branch (3032:20): [True: 2.14k, False: 3.57M]
  ------------------
 3033|  2.14k|                  if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
  ------------------
  |  Branch (3033:23): [True: 1.36k, False: 774]
  ------------------
 3034|  2.14k|                  if (!STBI__RESTART(z->marker)) return 1;
  ------------------
  |  | 2932|  2.14k|#define STBI__RESTART(x)     ((x) >= 0xd0 && (x) <= 0xd7)
  |  |  ------------------
  |  |  |  Branch (2932:31): [True: 1.94k, False: 195]
  |  |  |  Branch (2932:46): [True: 1.33k, False: 612]
  |  |  ------------------
  ------------------
 3035|  1.33k|                  stbi__jpeg_reset(z);
 3036|  1.33k|               }
 3037|  3.58M|            }
 3038|  75.8k|         }
 3039|  1.18k|         return 1;
 3040|  2.62k|      } else { // interleaved
 3041|  2.62k|         int i,j,k,x,y;
 3042|   917k|         for (j=0; j < z->img_mcu_y; ++j) {
  ------------------
  |  Branch (3042:20): [True: 916k, False: 1.05k]
  ------------------
 3043|  2.22M|            for (i=0; i < z->img_mcu_x; ++i) {
  ------------------
  |  Branch (3043:23): [True: 1.30M, False: 914k]
  ------------------
 3044|       |               // scan an interleaved mcu... process scan_n components in order
 3045|  4.02M|               for (k=0; k < z->scan_n; ++k) {
  ------------------
  |  Branch (3045:26): [True: 2.71M, False: 1.30M]
  ------------------
 3046|  2.71M|                  int n = z->order[k];
 3047|       |                  // scan out an mcu's worth of this component; that's just determined
 3048|       |                  // by the basic H and V specified for the component
 3049|  5.59M|                  for (y=0; y < z->img_comp[n].v; ++y) {
  ------------------
  |  Branch (3049:29): [True: 2.88M, False: 2.71M]
  ------------------
 3050|  8.32M|                     for (x=0; x < z->img_comp[n].h; ++x) {
  ------------------
  |  Branch (3050:32): [True: 5.44M, False: 2.88M]
  ------------------
 3051|  5.44M|                        int x2 = (i*z->img_comp[n].h + x);
 3052|  5.44M|                        int y2 = (j*z->img_comp[n].v + y);
 3053|  5.44M|                        short *data = z->img_comp[n].coeff + 64 * (x2 + y2 * z->img_comp[n].coeff_w);
 3054|  5.44M|                        if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n))
  ------------------
  |  Branch (3054:29): [True: 19, False: 5.44M]
  ------------------
 3055|     19|                           return 0;
 3056|  5.44M|                     }
 3057|  2.88M|                  }
 3058|  2.71M|               }
 3059|       |               // after all interleaved components, that's an interleaved MCU,
 3060|       |               // so now count down the restart interval
 3061|  1.30M|               if (--z->todo <= 0) {
  ------------------
  |  Branch (3061:20): [True: 3.61k, False: 1.30M]
  ------------------
 3062|  3.61k|                  if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
  ------------------
  |  Branch (3062:23): [True: 875, False: 2.74k]
  ------------------
 3063|  3.61k|                  if (!STBI__RESTART(z->marker)) return 1;
  ------------------
  |  | 2932|  3.61k|#define STBI__RESTART(x)     ((x) >= 0xd0 && (x) <= 0xd7)
  |  |  ------------------
  |  |  |  Branch (2932:31): [True: 3.52k, False: 93]
  |  |  |  Branch (2932:46): [True: 2.06k, False: 1.46k]
  |  |  ------------------
  ------------------
 3064|  2.06k|                  stbi__jpeg_reset(z);
 3065|  2.06k|               }
 3066|  1.30M|            }
 3067|   916k|         }
 3068|  1.05k|         return 1;
 3069|  2.62k|      }
 3070|  4.67k|   }
 3071|  8.39k|}
OgreSTBICodec.cpp:_ZL16stbi__jpeg_resetP10stbi__jpeg:
 2937|  13.0k|{
 2938|  13.0k|   j->code_bits = 0;
 2939|  13.0k|   j->code_buffer = 0;
 2940|  13.0k|   j->nomore = 0;
 2941|  13.0k|   j->img_comp[0].dc_pred = j->img_comp[1].dc_pred = j->img_comp[2].dc_pred = j->img_comp[3].dc_pred = 0;
 2942|  13.0k|   j->marker = STBI__MARKER_none;
  ------------------
  |  | 2915|  13.0k|#define STBI__MARKER_none  0xff
  ------------------
 2943|  13.0k|   j->todo = j->restart_interval ? j->restart_interval : 0x7fffffff;
  ------------------
  |  Branch (2943:14): [True: 10.0k, False: 2.98k]
  ------------------
 2944|  13.0k|   j->eob_run = 0;
 2945|       |   // no more than 1<<31 MCUs if no restart_interal? that's plenty safe,
 2946|       |   // since we don't even allow 1<<30 pixels
 2947|  13.0k|}
OgreSTBICodec.cpp:_ZL23stbi__jpeg_decode_blockP10stbi__jpegPsP13stbi__huffmanS3_S1_iPt:
 2211|  3.82M|{
 2212|  3.82M|   int diff,dc,k;
 2213|  3.82M|   int t;
 2214|       |
 2215|  3.82M|   if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
  ------------------
  |  Branch (2215:8): [True: 444k, False: 3.38M]
  ------------------
 2216|  3.82M|   t = stbi__jpeg_huff_decode(j, hdc);
 2217|  3.82M|   if (t < 0 || t > 15) return stbi__err("bad huffman code","Corrupt JPEG");
  ------------------
  |  | 1095|     12|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (2217:8): [True: 6, False: 3.82M]
  |  Branch (2217:17): [True: 6, False: 3.82M]
  ------------------
 2218|       |
 2219|       |   // 0 all the ac values now so we can do it 32-bits at a time
 2220|  3.82M|   memset(data,0,64*sizeof(data[0]));
 2221|       |
 2222|  3.82M|   diff = t ? stbi__extend_receive(j, t) : 0;
  ------------------
  |  Branch (2222:11): [True: 1.08M, False: 2.74M]
  ------------------
 2223|  3.82M|   if (!stbi__addints_valid(j->img_comp[b].dc_pred, diff)) return stbi__err("bad delta","Corrupt JPEG");
  ------------------
  |  | 1095|     11|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (2223:8): [True: 11, False: 3.82M]
  ------------------
 2224|  3.82M|   dc = j->img_comp[b].dc_pred + diff;
 2225|  3.82M|   j->img_comp[b].dc_pred = dc;
 2226|  3.82M|   if (!stbi__mul2shorts_valid(dc, dequant[0])) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
  ------------------
  |  | 1095|      4|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (2226:8): [True: 4, False: 3.82M]
  ------------------
 2227|  3.82M|   data[0] = (short) (dc * dequant[0]);
 2228|       |
 2229|       |   // decode AC components, see JPEG spec
 2230|  3.82M|   k = 1;
 2231|   102M|   do {
 2232|   102M|      unsigned int zig;
 2233|   102M|      int c,r,s;
 2234|   102M|      if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
  ------------------
  |  Branch (2234:11): [True: 19.4M, False: 83.4M]
  ------------------
 2235|   102M|      c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
  ------------------
  |  | 1936|   102M|#define FAST_BITS   9  // larger handles more cases; smaller stomps less cache
  ------------------
                    c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
  ------------------
  |  | 1936|   102M|#define FAST_BITS   9  // larger handles more cases; smaller stomps less cache
  ------------------
 2236|   102M|      r = fac[c];
 2237|   102M|      if (r) { // fast-AC path
  ------------------
  |  Branch (2237:11): [True: 100M, False: 2.31M]
  ------------------
 2238|   100M|         k += (r >> 4) & 15; // run
 2239|   100M|         s = r & 15; // combined length
 2240|   100M|         if (s > j->code_bits) return stbi__err("bad huffman code", "Combined length longer than code bits available");
  ------------------
  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (2240:14): [True: 2, False: 100M]
  ------------------
 2241|   100M|         j->code_buffer <<= s;
 2242|   100M|         j->code_bits -= s;
 2243|       |         // decode into unzigzag'd location
 2244|   100M|         zig = stbi__jpeg_dezigzag[k++];
 2245|   100M|         data[zig] = (short) ((r >> 8) * dequant[zig]);
 2246|   100M|      } else {
 2247|  2.31M|         int rs = stbi__jpeg_huff_decode(j, hac);
 2248|  2.31M|         if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
  ------------------
  |  | 1095|     11|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (2248:14): [True: 11, False: 2.31M]
  ------------------
 2249|  2.31M|         s = rs & 15;
 2250|  2.31M|         r = rs >> 4;
 2251|  2.31M|         if (s == 0) {
  ------------------
  |  Branch (2251:14): [True: 2.22M, False: 81.3k]
  ------------------
 2252|  2.22M|            if (rs != 0xf0) break; // end block
  ------------------
  |  Branch (2252:17): [True: 2.22M, False: 406]
  ------------------
 2253|    406|            k += 16;
 2254|  81.3k|         } else {
 2255|  81.3k|            k += r;
 2256|       |            // decode into unzigzag'd location
 2257|  81.3k|            zig = stbi__jpeg_dezigzag[k++];
 2258|  81.3k|            data[zig] = (short) (stbi__extend_receive(j,s) * dequant[zig]);
 2259|  81.3k|         }
 2260|  2.31M|      }
 2261|   102M|   } while (k < 64);
  ------------------
  |  Branch (2261:13): [True: 99.0M, False: 1.59M]
  ------------------
 2262|  3.82M|   return 1;
 2263|  3.82M|}
OgreSTBICodec.cpp:_ZL22stbi__jpeg_huff_decodeP10stbi__jpegP13stbi__huffman:
 2098|  15.4M|{
 2099|  15.4M|   unsigned int temp;
 2100|  15.4M|   int c,k;
 2101|       |
 2102|  15.4M|   if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
  ------------------
  |  Branch (2102:8): [True: 884k, False: 14.5M]
  ------------------
 2103|       |
 2104|       |   // look at the top FAST_BITS and determine what symbol ID it is,
 2105|       |   // if the code is <= FAST_BITS
 2106|  15.4M|   c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
  ------------------
  |  | 1936|  15.4M|#define FAST_BITS   9  // larger handles more cases; smaller stomps less cache
  ------------------
                 c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
  ------------------
  |  | 1936|  15.4M|#define FAST_BITS   9  // larger handles more cases; smaller stomps less cache
  ------------------
 2107|  15.4M|   k = h->fast[c];
 2108|  15.4M|   if (k < 255) {
  ------------------
  |  Branch (2108:8): [True: 14.7M, False: 664k]
  ------------------
 2109|  14.7M|      int s = h->size[k];
 2110|  14.7M|      if (s > j->code_bits)
  ------------------
  |  Branch (2110:11): [True: 2, False: 14.7M]
  ------------------
 2111|      2|         return -1;
 2112|  14.7M|      j->code_buffer <<= s;
 2113|  14.7M|      j->code_bits -= s;
 2114|  14.7M|      return h->values[k];
 2115|  14.7M|   }
 2116|       |
 2117|       |   // naive test is to shift the code_buffer down so k bits are
 2118|       |   // valid, then test against maxcode. To speed this up, we've
 2119|       |   // preshifted maxcode left so that it has (16-k) 0s at the
 2120|       |   // end; in other words, regardless of the number of bits, it
 2121|       |   // wants to be compared against something shifted to have 16;
 2122|       |   // that way we don't need to shift inside the loop.
 2123|   664k|   temp = j->code_buffer >> 16;
 2124|  3.66M|   for (k=FAST_BITS+1 ; ; ++k)
  ------------------
  |  | 1936|   664k|#define FAST_BITS   9  // larger handles more cases; smaller stomps less cache
  ------------------
 2125|  4.32M|      if (temp < h->maxcode[k])
  ------------------
  |  Branch (2125:11): [True: 664k, False: 3.66M]
  ------------------
 2126|   664k|         break;
 2127|   664k|   if (k == 17) {
  ------------------
  |  Branch (2127:8): [True: 45, False: 664k]
  ------------------
 2128|       |      // error! code not found
 2129|     45|      j->code_bits -= 16;
 2130|     45|      return -1;
 2131|     45|   }
 2132|       |
 2133|   664k|   if (k > j->code_bits)
  ------------------
  |  Branch (2133:8): [True: 0, False: 664k]
  ------------------
 2134|      0|      return -1;
 2135|       |
 2136|       |   // convert the huffman code to the symbol id
 2137|   664k|   c = ((j->code_buffer >> (32 - k)) & stbi__bmask[k]) + h->delta[k];
 2138|   664k|   if(c < 0 || c >= 256) // symbol id out of bounds!
  ------------------
  |  Branch (2138:7): [True: 0, False: 664k]
  |  Branch (2138:16): [True: 0, False: 664k]
  ------------------
 2139|      0|       return -1;
 2140|   664k|   STBI_ASSERT((((j->code_buffer) >> (32 - h->size[c])) & stbi__bmask[h->size[c]]) == h->code[c]);
  ------------------
  |  |  603|   664k|#define STBI_ASSERT(x) assert(x)
  ------------------
 2141|       |
 2142|       |   // convert the id to a symbol
 2143|   664k|   j->code_bits -= k;
 2144|   664k|   j->code_buffer <<= k;
 2145|   664k|   return h->values[c];
 2146|   664k|}
OgreSTBICodec.cpp:_ZL20stbi__extend_receiveP10stbi__jpegi:
 2154|  4.26M|{
 2155|  4.26M|   unsigned int k;
 2156|  4.26M|   int sgn;
 2157|  4.26M|   if (j->code_bits < n) stbi__grow_buffer_unsafe(j);
  ------------------
  |  Branch (2157:8): [True: 1.67k, False: 4.26M]
  ------------------
 2158|  4.26M|   if (j->code_bits < n) return 0; // ran out of bits from stream, return 0s intead of continuing
  ------------------
  |  Branch (2158:8): [True: 179, False: 4.26M]
  ------------------
 2159|       |
 2160|  4.26M|   sgn = j->code_buffer >> 31; // sign bit always in MSB; 0 if MSB clear (positive), 1 if MSB set (negative)
 2161|  4.26M|   k = stbi_lrot(j->code_buffer, n);
  ------------------
  |  |  670|  4.26M|   #define stbi_lrot(x,y)  (((x) << (y)) | ((x) >> (-(y) & 31)))
  ------------------
 2162|  4.26M|   j->code_buffer = k & ~stbi__bmask[n];
 2163|  4.26M|   k &= stbi__bmask[n];
 2164|  4.26M|   j->code_bits -= n;
 2165|  4.26M|   return k + (stbi__jbias[n] & (sgn - 1));
 2166|  4.26M|}
OgreSTBICodec.cpp:_ZL19stbi__addints_validii:
 1071|  7.22M|{
 1072|  7.22M|   if ((a >= 0) != (b >= 0)) return 1; // a and b have different signs, so no overflow
  ------------------
  |  Branch (1072:8): [True: 1.41M, False: 5.80M]
  ------------------
 1073|  5.80M|   if (a < 0 && b < 0) return a >= INT_MIN - b; // same as a + b >= INT_MIN; INT_MIN - b cannot overflow since b < 0.
  ------------------
  |  Branch (1073:8): [True: 1.17M, False: 4.62M]
  |  Branch (1073:17): [True: 1.17M, False: 0]
  ------------------
 1074|  4.62M|   return a <= INT_MAX - b;
 1075|  5.80M|}
OgreSTBICodec.cpp:_ZL22stbi__mul2shorts_validii:
 1079|  7.22M|{
 1080|  7.22M|   if (b == 0 || b == -1) return 1; // multiplication by 0 is always 0; check for -1 so SHRT_MIN/b doesn't overflow
  ------------------
  |  Branch (1080:8): [True: 1.92M, False: 5.29M]
  |  Branch (1080:18): [True: 0, False: 5.29M]
  ------------------
 1081|  5.29M|   if ((a >= 0) == (b >= 0)) return a <= SHRT_MAX/b; // product is positive, so similar to mul2sizes_valid
  ------------------
  |  Branch (1081:8): [True: 3.83M, False: 1.45M]
  ------------------
 1082|  1.45M|   if (b < 0) return a <= SHRT_MIN / b; // same as a * b >= SHRT_MIN
  ------------------
  |  Branch (1082:8): [True: 0, False: 1.45M]
  ------------------
 1083|  1.45M|   return a >= SHRT_MIN / b;
 1084|  1.45M|}
OgreSTBICodec.cpp:_ZL24stbi__grow_buffer_unsafeP10stbi__jpeg:
 2076|  24.1M|{
 2077|  51.1M|   do {
 2078|  51.1M|      unsigned int b = j->nomore ? 0 : stbi__get8(j->s);
  ------------------
  |  Branch (2078:24): [True: 13.2M, False: 37.9M]
  ------------------
 2079|  51.1M|      if (b == 0xff) {
  ------------------
  |  Branch (2079:11): [True: 13.3k, False: 51.1M]
  ------------------
 2080|  13.3k|         int c = stbi__get8(j->s);
 2081|  15.2k|         while (c == 0xff) c = stbi__get8(j->s); // consume fill bytes
  ------------------
  |  Branch (2081:17): [True: 1.93k, False: 13.3k]
  ------------------
 2082|  13.3k|         if (c != 0) {
  ------------------
  |  Branch (2082:14): [True: 11.2k, False: 2.09k]
  ------------------
 2083|  11.2k|            j->marker = (unsigned char) c;
 2084|  11.2k|            j->nomore = 1;
 2085|  11.2k|            return;
 2086|  11.2k|         }
 2087|  13.3k|      }
 2088|  51.1M|      j->code_buffer |= b << (24 - j->code_bits);
 2089|  51.1M|      j->code_bits += 8;
 2090|  51.1M|   } while (j->code_bits <= 24);
  ------------------
  |  Branch (2090:13): [True: 27.0M, False: 24.1M]
  ------------------
 2091|  24.1M|}
OgreSTBICodec.cpp:_ZL31stbi__jpeg_decode_block_prog_dcP10stbi__jpegPsP13stbi__huffmani:
 2266|  7.59M|{
 2267|  7.59M|   int diff,dc;
 2268|  7.59M|   int t;
 2269|  7.59M|   if (j->spec_end != 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
  ------------------
  |  | 1095|      7|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (2269:8): [True: 7, False: 7.59M]
  ------------------
 2270|       |
 2271|  7.59M|   if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
  ------------------
  |  Branch (2271:8): [True: 349k, False: 7.24M]
  ------------------
 2272|       |
 2273|  7.59M|   if (j->succ_high == 0) {
  ------------------
  |  Branch (2273:8): [True: 3.39M, False: 4.19M]
  ------------------
 2274|       |      // first scan for DC coefficient, must be first
 2275|  3.39M|      memset(data,0,64*sizeof(data[0])); // 0 all the ac values now
 2276|  3.39M|      t = stbi__jpeg_huff_decode(j, hdc);
 2277|  3.39M|      if (t < 0 || t > 15) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
  ------------------
  |  | 1095|     13|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (2277:11): [True: 9, False: 3.39M]
  |  Branch (2277:20): [True: 4, False: 3.39M]
  ------------------
 2278|  3.39M|      diff = t ? stbi__extend_receive(j, t) : 0;
  ------------------
  |  Branch (2278:14): [True: 115k, False: 3.28M]
  ------------------
 2279|       |
 2280|  3.39M|      if (!stbi__addints_valid(j->img_comp[b].dc_pred, diff)) return stbi__err("bad delta", "Corrupt JPEG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (2280:11): [True: 0, False: 3.39M]
  ------------------
 2281|  3.39M|      dc = j->img_comp[b].dc_pred + diff;
 2282|  3.39M|      j->img_comp[b].dc_pred = dc;
 2283|  3.39M|      if (!stbi__mul2shorts_valid(dc, 1 << j->succ_low)) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
  ------------------
  |  | 1095|     11|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (2283:11): [True: 11, False: 3.39M]
  ------------------
 2284|  3.39M|      data[0] = (short) (dc * (1 << j->succ_low));
 2285|  4.19M|   } else {
 2286|       |      // refinement scan for DC coefficient
 2287|  4.19M|      if (stbi__jpeg_get_bit(j))
  ------------------
  |  Branch (2287:11): [True: 22.4k, False: 4.17M]
  ------------------
 2288|  22.4k|         data[0] += (short) (1 << j->succ_low);
 2289|  4.19M|   }
 2290|  7.59M|   return 1;
 2291|  7.59M|}
OgreSTBICodec.cpp:_ZL18stbi__jpeg_get_bitP10stbi__jpeg:
 2182|  25.1M|{
 2183|  25.1M|   unsigned int k;
 2184|  25.1M|   if (j->code_bits < 1) stbi__grow_buffer_unsafe(j);
  ------------------
  |  Branch (2184:8): [True: 580k, False: 24.5M]
  ------------------
 2185|  25.1M|   if (j->code_bits < 1) return 0; // ran out of bits from stream, return 0s intead of continuing
  ------------------
  |  Branch (2185:8): [True: 64, False: 25.1M]
  ------------------
 2186|  25.1M|   k = j->code_buffer;
 2187|  25.1M|   j->code_buffer <<= 1;
 2188|  25.1M|   --j->code_bits;
 2189|  25.1M|   return k & 0x80000000;
 2190|  25.1M|}
OgreSTBICodec.cpp:_ZL31stbi__jpeg_decode_block_prog_acP10stbi__jpegPsP13stbi__huffmanS1_:
 2296|  1.43M|{
 2297|  1.43M|   int k;
 2298|  1.43M|   if (j->spec_start == 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
  ------------------
  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (2298:8): [True: 0, False: 1.43M]
  ------------------
 2299|       |
 2300|  1.43M|   if (j->succ_high == 0) {
  ------------------
  |  Branch (2300:8): [True: 418k, False: 1.01M]
  ------------------
 2301|   418k|      int shift = j->succ_low;
 2302|       |
 2303|   418k|      if (j->eob_run) {
  ------------------
  |  Branch (2303:11): [True: 100k, False: 318k]
  ------------------
 2304|   100k|         --j->eob_run;
 2305|   100k|         return 1;
 2306|   100k|      }
 2307|       |
 2308|   318k|      k = j->spec_start;
 2309|  4.08M|      do {
 2310|  4.08M|         unsigned int zig;
 2311|  4.08M|         int c,r,s;
 2312|  4.08M|         if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
  ------------------
  |  Branch (2312:14): [True: 2.45M, False: 1.62M]
  ------------------
 2313|  4.08M|         c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
  ------------------
  |  | 1936|  4.08M|#define FAST_BITS   9  // larger handles more cases; smaller stomps less cache
  ------------------
                       c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
  ------------------
  |  | 1936|  4.08M|#define FAST_BITS   9  // larger handles more cases; smaller stomps less cache
  ------------------
 2314|  4.08M|         r = fac[c];
 2315|  4.08M|         if (r) { // fast-AC path
  ------------------
  |  Branch (2315:14): [True: 994k, False: 3.08M]
  ------------------
 2316|   994k|            k += (r >> 4) & 15; // run
 2317|   994k|            s = r & 15; // combined length
 2318|   994k|            if (s > j->code_bits) return stbi__err("bad huffman code", "Combined length longer than code bits available");
  ------------------
  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (2318:17): [True: 2, False: 994k]
  ------------------
 2319|   994k|            j->code_buffer <<= s;
 2320|   994k|            j->code_bits -= s;
 2321|   994k|            zig = stbi__jpeg_dezigzag[k++];
 2322|   994k|            data[zig] = (short) ((r >> 8) * (1 << shift));
 2323|  3.08M|         } else {
 2324|  3.08M|            int rs = stbi__jpeg_huff_decode(j, hac);
 2325|  3.08M|            if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
  ------------------
  |  | 1095|      4|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (2325:17): [True: 4, False: 3.08M]
  ------------------
 2326|  3.08M|            s = rs & 15;
 2327|  3.08M|            r = rs >> 4;
 2328|  3.08M|            if (s == 0) {
  ------------------
  |  Branch (2328:17): [True: 97.7k, False: 2.98M]
  ------------------
 2329|  97.7k|               if (r < 15) {
  ------------------
  |  Branch (2329:20): [True: 96.9k, False: 827]
  ------------------
 2330|  96.9k|                  j->eob_run = (1 << r);
 2331|  96.9k|                  if (r)
  ------------------
  |  Branch (2331:23): [True: 843, False: 96.0k]
  ------------------
 2332|    843|                     j->eob_run += stbi__jpeg_get_bits(j, r);
 2333|  96.9k|                  --j->eob_run;
 2334|  96.9k|                  break;
 2335|  96.9k|               }
 2336|    827|               k += 16;
 2337|  2.98M|            } else {
 2338|  2.98M|               k += r;
 2339|  2.98M|               zig = stbi__jpeg_dezigzag[k++];
 2340|  2.98M|               data[zig] = (short) (stbi__extend_receive(j,s) * (1 << shift));
 2341|  2.98M|            }
 2342|  3.08M|         }
 2343|  4.08M|      } while (k <= j->spec_end);
  ------------------
  |  Branch (2343:16): [True: 3.76M, False: 221k]
  ------------------
 2344|  1.01M|   } else {
 2345|       |      // refinement scan for these AC coefficients
 2346|       |
 2347|  1.01M|      short bit = (short) (1 << j->succ_low);
 2348|       |
 2349|  1.01M|      if (j->eob_run) {
  ------------------
  |  Branch (2349:11): [True: 104k, False: 908k]
  ------------------
 2350|   104k|         --j->eob_run;
 2351|  2.97M|         for (k = j->spec_start; k <= j->spec_end; ++k) {
  ------------------
  |  Branch (2351:34): [True: 2.86M, False: 104k]
  ------------------
 2352|  2.86M|            short *p = &data[stbi__jpeg_dezigzag[k]];
 2353|  2.86M|            if (*p != 0)
  ------------------
  |  Branch (2353:17): [True: 934k, False: 1.93M]
  ------------------
 2354|   934k|               if (stbi__jpeg_get_bit(j))
  ------------------
  |  Branch (2354:20): [True: 85.9k, False: 848k]
  ------------------
 2355|  85.9k|                  if ((*p & bit)==0) {
  ------------------
  |  Branch (2355:23): [True: 8.46k, False: 77.4k]
  ------------------
 2356|  8.46k|                     if (*p > 0)
  ------------------
  |  Branch (2356:26): [True: 4.12k, False: 4.33k]
  ------------------
 2357|  4.12k|                        *p += bit;
 2358|  4.33k|                     else
 2359|  4.33k|                        *p -= bit;
 2360|  8.46k|                  }
 2361|  2.86M|         }
 2362|   908k|      } else {
 2363|   908k|         k = j->spec_start;
 2364|  2.79M|         do {
 2365|  2.79M|            int r,s;
 2366|  2.79M|            int rs = stbi__jpeg_huff_decode(j, hac); // @OPTIMIZE see if we can use the fast path here, advance-by-r is so slow, eh
 2367|  2.79M|            if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
  ------------------
  |  | 1095|     17|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (2367:17): [True: 17, False: 2.79M]
  ------------------
 2368|  2.79M|            s = rs & 15;
 2369|  2.79M|            r = rs >> 4;
 2370|  2.79M|            if (s == 0) {
  ------------------
  |  Branch (2370:17): [True: 67.3k, False: 2.72M]
  ------------------
 2371|  67.3k|               if (r < 15) {
  ------------------
  |  Branch (2371:20): [True: 66.9k, False: 470]
  ------------------
 2372|  66.9k|                  j->eob_run = (1 << r) - 1;
 2373|  66.9k|                  if (r)
  ------------------
  |  Branch (2373:23): [True: 3.63k, False: 63.2k]
  ------------------
 2374|  3.63k|                     j->eob_run += stbi__jpeg_get_bits(j, r);
 2375|  66.9k|                  r = 64; // force end of block
 2376|  66.9k|               } else {
 2377|       |                  // r=15 s=0 should write 16 0s, so we just do
 2378|       |                  // a run of 15 0s and then write s (which is 0),
 2379|       |                  // so we don't have to do anything special here
 2380|    470|               }
 2381|  2.72M|            } else {
 2382|  2.72M|               if (s != 1) return stbi__err("bad huffman code", "Corrupt JPEG");
  ------------------
  |  | 1095|     23|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
  |  Branch (2382:20): [True: 23, False: 2.72M]
  ------------------
 2383|       |               // sign bit
 2384|  2.72M|               if (stbi__jpeg_get_bit(j))
  ------------------
  |  Branch (2384:20): [True: 37.8k, False: 2.69M]
  ------------------
 2385|  37.8k|                  s = bit;
 2386|  2.69M|               else
 2387|  2.69M|                  s = -bit;
 2388|  2.72M|            }
 2389|       |
 2390|       |            // advance by r
 2391|  21.4M|            while (k <= j->spec_end) {
  ------------------
  |  Branch (2391:20): [True: 20.6M, False: 830k]
  ------------------
 2392|  20.6M|               short *p = &data[stbi__jpeg_dezigzag[k++]];
 2393|  20.6M|               if (*p != 0) {
  ------------------
  |  Branch (2393:20): [True: 17.2M, False: 3.33M]
  ------------------
 2394|  17.2M|                  if (stbi__jpeg_get_bit(j))
  ------------------
  |  Branch (2394:23): [True: 25.6k, False: 17.2M]
  ------------------
 2395|  25.6k|                     if ((*p & bit)==0) {
  ------------------
  |  Branch (2395:26): [True: 3.07k, False: 22.5k]
  ------------------
 2396|  3.07k|                        if (*p > 0)
  ------------------
  |  Branch (2396:29): [True: 1.29k, False: 1.77k]
  ------------------
 2397|  1.29k|                           *p += bit;
 2398|  1.77k|                        else
 2399|  1.77k|                           *p -= bit;
 2400|  3.07k|                     }
 2401|  17.2M|               } else {
 2402|  3.33M|                  if (r == 0) {
  ------------------
  |  Branch (2402:23): [True: 1.96M, False: 1.37M]
  ------------------
 2403|  1.96M|                     *p = (short) s;
 2404|  1.96M|                     break;
 2405|  1.96M|                  }
 2406|  1.37M|                  --r;
 2407|  1.37M|               }
 2408|  20.6M|            }
 2409|  2.79M|         } while (k <= j->spec_end);
  ------------------
  |  Branch (2409:19): [True: 1.88M, False: 908k]
  ------------------
 2410|   908k|      }
 2411|  1.01M|   }
 2412|  1.33M|   return 1;
 2413|  1.43M|}
OgreSTBICodec.cpp:_ZL19stbi__jpeg_get_bitsP10stbi__jpegi:
 2170|  4.47k|{
 2171|  4.47k|   unsigned int k;
 2172|  4.47k|   if (j->code_bits < n) stbi__grow_buffer_unsafe(j);
  ------------------
  |  Branch (2172:8): [True: 43, False: 4.43k]
  ------------------
 2173|  4.47k|   if (j->code_bits < n) return 0; // ran out of bits from stream, return 0s intead of continuing
  ------------------
  |  Branch (2173:8): [True: 41, False: 4.43k]
  ------------------
 2174|  4.43k|   k = stbi_lrot(j->code_buffer, n);
  ------------------
  |  |  670|  4.43k|   #define stbi_lrot(x,y)  (((x) << (y)) | ((x) >> (-(y) & 31)))
  ------------------
 2175|  4.43k|   j->code_buffer = k & ~stbi__bmask[n];
 2176|  4.43k|   k &= stbi__bmask[n];
 2177|  4.43k|   j->code_bits -= n;
 2178|  4.43k|   return k;
 2179|  4.47k|}
OgreSTBICodec.cpp:_ZL27stbi__skip_jpeg_junk_at_endP10stbi__jpeg:
 3390|  1.65k|{
 3391|       |   // some JPEGs have junk at end, skip over it but if we find what looks
 3392|       |   // like a valid marker, resume there
 3393|  17.0k|   while (!stbi__at_eof(j->s)) {
  ------------------
  |  Branch (3393:11): [True: 16.7k, False: 249]
  ------------------
 3394|  16.7k|      stbi_uc x = stbi__get8(j->s);
 3395|  17.8k|      while (x == 0xff) { // might be a marker
  ------------------
  |  Branch (3395:14): [True: 2.50k, False: 15.3k]
  ------------------
 3396|  2.50k|         if (stbi__at_eof(j->s)) return STBI__MARKER_none;
  ------------------
  |  | 2915|     10|#define STBI__MARKER_none  0xff
  ------------------
  |  Branch (3396:14): [True: 10, False: 2.49k]
  ------------------
 3397|  2.49k|         x = stbi__get8(j->s);
 3398|  2.49k|         if (x != 0x00 && x != 0xff) {
  ------------------
  |  Branch (3398:14): [True: 2.33k, False: 158]
  |  Branch (3398:27): [True: 1.39k, False: 940]
  ------------------
 3399|       |            // not a stuffed zero or lead-in to another marker, looks
 3400|       |            // like an actual marker, return it
 3401|  1.39k|            return x;
 3402|  1.39k|         }
 3403|       |         // stuffed zero has x=0 now which ends the loop, meaning we go
 3404|       |         // back to regular scan loop.
 3405|       |         // repeated 0xff keeps trying to read the next byte of the marker.
 3406|  2.49k|      }
 3407|  16.7k|   }
 3408|    249|   return STBI__MARKER_none;
  ------------------
  |  | 2915|    249|#define STBI__MARKER_none  0xff
  ------------------
 3409|  1.65k|}
OgreSTBICodec.cpp:_ZL17stbi__jpeg_finishP10stbi__jpeg:
 3081|      8|{
 3082|      8|   if (z->progressive) {
  ------------------
  |  Branch (3082:8): [True: 8, False: 0]
  ------------------
 3083|       |      // dequantize and idct the data
 3084|      8|      int i,j,n;
 3085|     22|      for (n=0; n < z->s->img_n; ++n) {
  ------------------
  |  Branch (3085:17): [True: 14, False: 8]
  ------------------
 3086|     14|         int w = (z->img_comp[n].x+7) >> 3;
 3087|     14|         int h = (z->img_comp[n].y+7) >> 3;
 3088|  2.98k|         for (j=0; j < h; ++j) {
  ------------------
  |  Branch (3088:20): [True: 2.97k, False: 14]
  ------------------
 3089|  30.8k|            for (i=0; i < w; ++i) {
  ------------------
  |  Branch (3089:23): [True: 27.8k, False: 2.97k]
  ------------------
 3090|  27.8k|               short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w);
 3091|  27.8k|               stbi__jpeg_dequantize(data, z->dequant[z->img_comp[n].tq]);
 3092|  27.8k|               z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data);
 3093|  27.8k|            }
 3094|  2.97k|         }
 3095|     14|      }
 3096|      8|   }
 3097|      8|}
OgreSTBICodec.cpp:_ZL21stbi__jpeg_dequantizePsPt:
 3074|  27.8k|{
 3075|  27.8k|   int i;
 3076|  1.81M|   for (i=0; i < 64; ++i)
  ------------------
  |  Branch (3076:14): [True: 1.78M, False: 27.8k]
  ------------------
 3077|  1.78M|      data[i] *= dequant[i];
 3078|  27.8k|}
OgreSTBICodec.cpp:_ZL18stbi__cleanup_jpegP10stbi__jpeg:
 3844|  1.37k|{
 3845|  1.37k|   stbi__free_jpeg_components(j, j->s->img_n, 0);
 3846|  1.37k|}
OgreSTBICodec.cpp:_ZL14resample_row_1PhS_S_ii:
 3457|  1.07M|{
 3458|  1.07M|   STBI_NOTUSED(out);
  ------------------
  |  |  660|  1.07M|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 3459|  1.07M|   STBI_NOTUSED(in_far);
  ------------------
  |  |  660|  1.07M|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 3460|  1.07M|   STBI_NOTUSED(w);
  ------------------
  |  |  660|  1.07M|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 3461|  1.07M|   STBI_NOTUSED(hs);
  ------------------
  |  |  660|  1.07M|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 3462|  1.07M|   return in_near;
 3463|  1.07M|}
OgreSTBICodec.cpp:_ZL22stbi__resample_row_v_2PhS_S_ii:
 3466|  1.24M|{
 3467|       |   // need to generate two samples vertically for every one in input
 3468|  1.24M|   int i;
 3469|  1.24M|   STBI_NOTUSED(hs);
  ------------------
  |  |  660|  1.24M|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 3470|   145M|   for (i=0; i < w; ++i)
  ------------------
  |  Branch (3470:14): [True: 143M, False: 1.24M]
  ------------------
 3471|   143M|      out[i] = stbi__div4(3*in_near[i] + in_far[i] + 2);
  ------------------
  |  | 3454|   143M|#define stbi__div4(x) ((stbi_uc) ((x) >> 2))
  ------------------
 3472|  1.24M|   return out;
 3473|  1.24M|}
OgreSTBICodec.cpp:_ZL22stbi__resample_row_h_2PhS_S_ii:
 3476|   104k|{
 3477|       |   // need to generate two samples horizontally for every one in input
 3478|   104k|   int i;
 3479|   104k|   stbi_uc *input = in_near;
 3480|       |
 3481|   104k|   if (w == 1) {
  ------------------
  |  Branch (3481:8): [True: 8.51k, False: 96.0k]
  ------------------
 3482|       |      // if only one sample, can't do any interpolation
 3483|  8.51k|      out[0] = out[1] = input[0];
 3484|  8.51k|      return out;
 3485|  8.51k|   }
 3486|       |
 3487|  96.0k|   out[0] = input[0];
 3488|  96.0k|   out[1] = stbi__div4(input[0]*3 + input[1] + 2);
  ------------------
  |  | 3454|  96.0k|#define stbi__div4(x) ((stbi_uc) ((x) >> 2))
  ------------------
 3489|  13.3M|   for (i=1; i < w-1; ++i) {
  ------------------
  |  Branch (3489:14): [True: 13.2M, False: 96.0k]
  ------------------
 3490|  13.2M|      int n = 3*input[i]+2;
 3491|  13.2M|      out[i*2+0] = stbi__div4(n+input[i-1]);
  ------------------
  |  | 3454|  13.2M|#define stbi__div4(x) ((stbi_uc) ((x) >> 2))
  ------------------
 3492|  13.2M|      out[i*2+1] = stbi__div4(n+input[i+1]);
  ------------------
  |  | 3454|  13.2M|#define stbi__div4(x) ((stbi_uc) ((x) >> 2))
  ------------------
 3493|  13.2M|   }
 3494|  96.0k|   out[i*2+0] = stbi__div4(input[w-2]*3 + input[w-1] + 2);
  ------------------
  |  | 3454|  96.0k|#define stbi__div4(x) ((stbi_uc) ((x) >> 2))
  ------------------
 3495|  96.0k|   out[i*2+1] = input[w-1];
 3496|       |
 3497|  96.0k|   STBI_NOTUSED(in_far);
  ------------------
  |  |  660|  96.0k|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 3498|  96.0k|   STBI_NOTUSED(hs);
  ------------------
  |  |  660|  96.0k|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 3499|       |
 3500|  96.0k|   return out;
 3501|   104k|}
OgreSTBICodec.cpp:_ZL26stbi__resample_row_genericPhS_S_ii:
 3647|   303k|{
 3648|       |   // resample with nearest-neighbor
 3649|   303k|   int i,j;
 3650|   303k|   STBI_NOTUSED(in_far);
  ------------------
  |  |  660|   303k|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 3651|  47.1M|   for (i=0; i < w; ++i)
  ------------------
  |  Branch (3651:14): [True: 46.8M, False: 303k]
  ------------------
 3652|   143M|      for (j=0; j < hs; ++j)
  ------------------
  |  Branch (3652:17): [True: 96.1M, False: 46.8M]
  ------------------
 3653|  96.1M|         out[i*hs+j] = in_near[i];
 3654|   303k|   return out;
 3655|   303k|}
OgreSTBICodec.cpp:_ZL14stbi__pnm_testP13stbi__context:
 7495|  1.14k|{
 7496|  1.14k|   char p, t;
 7497|  1.14k|   p = (char) stbi__get8(s);
 7498|  1.14k|   t = (char) stbi__get8(s);
 7499|  1.14k|   if (p != 'P' || (t != '5' && t != '6')) {
  ------------------
  |  Branch (7499:8): [True: 777, False: 363]
  |  Branch (7499:21): [True: 147, False: 216]
  |  Branch (7499:33): [True: 13, False: 134]
  ------------------
 7500|    790|       stbi__rewind( s );
 7501|    790|       return 0;
 7502|    790|   }
 7503|    350|   return 1;
 7504|  1.14k|}
OgreSTBICodec.cpp:_ZL14stbi__pnm_loadP13stbi__contextPiS1_S1_iP17stbi__result_info:
 7507|    350|{
 7508|    350|   stbi_uc *out;
 7509|    350|   STBI_NOTUSED(ri);
  ------------------
  |  |  660|    350|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 7510|       |
 7511|    350|   ri->bits_per_channel = stbi__pnm_info(s, (int *)&s->img_x, (int *)&s->img_y, (int *)&s->img_n);
 7512|    350|   if (ri->bits_per_channel == 0)
  ------------------
  |  Branch (7512:8): [True: 130, False: 220]
  ------------------
 7513|    130|      return 0;
 7514|       |
 7515|    220|   if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    220|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                 if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  | 1099|     32|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     32|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 32]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7515:8): [True: 32, False: 188]
  ------------------
 7516|    188|   if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    188|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                 if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  | 1099|     23|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     23|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 23]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7516:8): [True: 23, False: 165]
  ------------------
 7517|       |
 7518|    165|   *x = s->img_x;
 7519|    165|   *y = s->img_y;
 7520|    165|   if (comp) *comp = s->img_n;
  ------------------
  |  Branch (7520:8): [True: 165, False: 0]
  ------------------
 7521|       |
 7522|    165|   if (!stbi__mad4sizes_valid(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0))
  ------------------
  |  Branch (7522:8): [True: 0, False: 165]
  ------------------
 7523|      0|      return stbi__errpuc("too large", "PNM too large");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7524|       |
 7525|    165|   out = (stbi_uc *) stbi__malloc_mad4(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0);
 7526|    165|   if (!out) return stbi__errpuc("outofmem", "Out of memory");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7526:8): [True: 0, False: 165]
  ------------------
 7527|    165|   if (!stbi__getn(s, out, s->img_n * s->img_x * s->img_y * (ri->bits_per_channel / 8))) {
  ------------------
  |  Branch (7527:8): [True: 60, False: 105]
  ------------------
 7528|     60|      STBI_FREE(out);
  ------------------
  |  |  684|     60|#define STBI_FREE(p)              free(p)
  ------------------
 7529|     60|      return stbi__errpuc("bad PNM", "PNM file truncated");
  ------------------
  |  | 1099|     60|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     60|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7530|     60|   }
 7531|       |
 7532|    105|   if (req_comp && req_comp != s->img_n) {
  ------------------
  |  Branch (7532:8): [True: 0, False: 105]
  |  Branch (7532:20): [True: 0, False: 0]
  ------------------
 7533|      0|      if (ri->bits_per_channel == 16) {
  ------------------
  |  Branch (7533:11): [True: 0, False: 0]
  ------------------
 7534|      0|         out = (stbi_uc *) stbi__convert_format16((stbi__uint16 *) out, s->img_n, req_comp, s->img_x, s->img_y);
 7535|      0|      } else {
 7536|      0|         out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y);
 7537|      0|      }
 7538|      0|      if (out == NULL) return out; // stbi__convert_format frees input on failure
  ------------------
  |  Branch (7538:11): [True: 0, False: 0]
  ------------------
 7539|      0|   }
 7540|    105|   return out;
 7541|    105|}
OgreSTBICodec.cpp:_ZL14stbi__pnm_infoP13stbi__contextPiS1_S1_:
 7582|    350|{
 7583|    350|   int maxv, dummy;
 7584|    350|   char c, p, t;
 7585|       |
 7586|    350|   if (!x) x = &dummy;
  ------------------
  |  Branch (7586:8): [True: 0, False: 350]
  ------------------
 7587|    350|   if (!y) y = &dummy;
  ------------------
  |  Branch (7587:8): [True: 0, False: 350]
  ------------------
 7588|    350|   if (!comp) comp = &dummy;
  ------------------
  |  Branch (7588:8): [True: 0, False: 350]
  ------------------
 7589|       |
 7590|    350|   stbi__rewind(s);
 7591|       |
 7592|       |   // Get identifier
 7593|    350|   p = (char) stbi__get8(s);
 7594|    350|   t = (char) stbi__get8(s);
 7595|    350|   if (p != 'P' || (t != '5' && t != '6')) {
  ------------------
  |  Branch (7595:8): [True: 0, False: 350]
  |  Branch (7595:21): [True: 134, False: 216]
  |  Branch (7595:33): [True: 0, False: 134]
  ------------------
 7596|      0|       stbi__rewind(s);
 7597|      0|       return 0;
 7598|      0|   }
 7599|       |
 7600|    350|   *comp = (t == '6') ? 3 : 1;  // '5' is 1-component .pgm; '6' is 3-component .ppm
  ------------------
  |  Branch (7600:12): [True: 134, False: 216]
  ------------------
 7601|       |
 7602|    350|   c = (char) stbi__get8(s);
 7603|    350|   stbi__pnm_skip_whitespace(s, &c);
 7604|       |
 7605|    350|   *x = stbi__pnm_getinteger(s, &c); // read width
 7606|    350|   if(*x == 0)
  ------------------
  |  Branch (7606:7): [True: 77, False: 273]
  ------------------
 7607|     77|       return stbi__err("invalid width", "PPM image header had zero or overflowing width");
  ------------------
  |  | 1095|     77|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 7608|    273|   stbi__pnm_skip_whitespace(s, &c);
 7609|       |
 7610|    273|   *y = stbi__pnm_getinteger(s, &c); // read height
 7611|    273|   if (*y == 0)
  ------------------
  |  Branch (7611:8): [True: 51, False: 222]
  ------------------
 7612|     51|       return stbi__err("invalid width", "PPM image header had zero or overflowing width");
  ------------------
  |  | 1095|     51|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 7613|    222|   stbi__pnm_skip_whitespace(s, &c);
 7614|       |
 7615|    222|   maxv = stbi__pnm_getinteger(s, &c);  // read max value
 7616|    222|   if (maxv > 65535)
  ------------------
  |  Branch (7616:8): [True: 2, False: 220]
  ------------------
 7617|      2|      return stbi__err("max value > 65535", "PPM image supports only 8-bit and 16-bit images");
  ------------------
  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 7618|    220|   else if (maxv > 255)
  ------------------
  |  Branch (7618:13): [True: 20, False: 200]
  ------------------
 7619|     20|      return 16;
 7620|    200|   else
 7621|    200|      return 8;
 7622|    222|}
OgreSTBICodec.cpp:_ZL25stbi__pnm_skip_whitespaceP13stbi__contextPc:
 7549|    845|{
 7550|  1.87k|   for (;;) {
 7551|  7.01k|      while (!stbi__at_eof(s) && stbi__pnm_isspace(*c))
  ------------------
  |  Branch (7551:14): [True: 6.83k, False: 177]
  |  Branch (7551:34): [True: 5.14k, False: 1.69k]
  ------------------
 7552|  5.14k|         *c = (char) stbi__get8(s);
 7553|       |
 7554|  1.87k|      if (stbi__at_eof(s) || *c != '#')
  ------------------
  |  Branch (7554:11): [True: 177, False: 1.69k]
  |  Branch (7554:30): [True: 668, False: 1.03k]
  ------------------
 7555|    845|         break;
 7556|       |
 7557|  2.16k|      while (!stbi__at_eof(s) && *c != '\n' && *c != '\r' )
  ------------------
  |  Branch (7557:14): [True: 2.13k, False: 26]
  |  Branch (7557:34): [True: 1.74k, False: 391]
  |  Branch (7557:48): [True: 1.13k, False: 613]
  ------------------
 7558|  1.13k|         *c = (char) stbi__get8(s);
 7559|  1.03k|   }
 7560|    845|}
OgreSTBICodec.cpp:_ZL17stbi__pnm_isspacec:
 7544|  6.83k|{
 7545|  6.83k|   return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r';
  ------------------
  |  Branch (7545:11): [True: 3.50k, False: 3.32k]
  |  Branch (7545:23): [True: 188, False: 3.14k]
  |  Branch (7545:36): [True: 552, False: 2.58k]
  |  Branch (7545:49): [True: 78, False: 2.51k]
  |  Branch (7545:62): [True: 169, False: 2.34k]
  |  Branch (7545:75): [True: 644, False: 1.69k]
  ------------------
 7546|  6.83k|}
OgreSTBICodec.cpp:_ZL20stbi__pnm_getintegerP13stbi__contextPc:
 7568|    845|{
 7569|    845|   int value = 0;
 7570|       |
 7571|  2.12k|   while (!stbi__at_eof(s) && stbi__pnm_isdigit(*c)) {
  ------------------
  |  Branch (7571:11): [True: 1.82k, False: 306]
  |  Branch (7571:31): [True: 1.28k, False: 533]
  ------------------
 7572|  1.28k|      value = value*10 + (*c - '0');
 7573|  1.28k|      *c = (char) stbi__get8(s);
 7574|  1.28k|      if((value > 214748364) || (value == 214748364 && *c > '7'))
  ------------------
  |  Branch (7574:10): [True: 4, False: 1.28k]
  |  Branch (7574:34): [True: 4, False: 1.28k]
  |  Branch (7574:56): [True: 2, False: 2]
  ------------------
 7575|      6|          return stbi__err("integer parse overflow", "Parsing an integer in the PPM header overflowed a 32-bit int");
  ------------------
  |  | 1095|      6|   #define stbi__err(x,y)  stbi__err(x)
  ------------------
 7576|  1.28k|   }
 7577|       |
 7578|    839|   return value;
 7579|    845|}
OgreSTBICodec.cpp:_ZL17stbi__pnm_isdigitc:
 7563|  1.82k|{
 7564|  1.82k|   return c >= '0' && c <= '9';
  ------------------
  |  Branch (7564:11): [True: 1.38k, False: 433]
  |  Branch (7564:23): [True: 1.28k, False: 100]
  ------------------
 7565|  1.82k|}
OgreSTBICodec.cpp:_ZL21stbi__mad4sizes_validiiiii:
 1040|    546|{
 1041|    546|   return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a*b, c) &&
  ------------------
  |  Branch (1041:11): [True: 530, False: 16]
  |  Branch (1041:42): [True: 530, False: 0]
  ------------------
 1042|    530|      stbi__mul2sizes_valid(a*b*c, d) && stbi__addsizes_valid(a*b*c*d, add);
  ------------------
  |  Branch (1042:7): [True: 530, False: 0]
  |  Branch (1042:42): [True: 530, False: 0]
  ------------------
 1043|    546|}
OgreSTBICodec.cpp:_ZL17stbi__malloc_mad4iiiii:
 1063|    265|{
 1064|    265|   if (!stbi__mad4sizes_valid(a, b, c, d, add)) return NULL;
  ------------------
  |  Branch (1064:8): [True: 0, False: 265]
  ------------------
 1065|    265|   return stbi__malloc(a*b*c*d + add);
 1066|    265|}
OgreSTBICodec.cpp:_ZL14stbi__hdr_testP13stbi__context:
 7098|    790|{
 7099|    790|   int r = stbi__hdr_test_core(s, "#?RADIANCE\n");
 7100|    790|   stbi__rewind(s);
 7101|    790|   if(!r) {
  ------------------
  |  Branch (7101:7): [True: 787, False: 3]
  ------------------
 7102|    787|       r = stbi__hdr_test_core(s, "#?RGBE\n");
 7103|    787|       stbi__rewind(s);
 7104|    787|   }
 7105|    790|   return r;
 7106|    790|}
OgreSTBICodec.cpp:_ZL19stbi__hdr_test_coreP13stbi__contextPKc:
 7088|  1.57k|{
 7089|  1.57k|   int i;
 7090|  4.58k|   for (i=0; signature[i]; ++i)
  ------------------
  |  Branch (7090:14): [True: 4.28k, False: 296]
  ------------------
 7091|  4.28k|      if (stbi__get8(s) != signature[i])
  ------------------
  |  Branch (7091:11): [True: 1.28k, False: 3.00k]
  ------------------
 7092|  1.28k|          return 0;
 7093|    296|   stbi__rewind(s);
 7094|    296|   return 1;
 7095|  1.57k|}
OgreSTBICodec.cpp:_ZL14stbi__hdr_loadP13stbi__contextPiS1_S1_iP17stbi__result_info:
 7159|    296|{
 7160|    296|   char buffer[STBI__HDR_BUFLEN];
 7161|    296|   char *token;
 7162|    296|   int valid = 0;
 7163|    296|   int width, height;
 7164|    296|   stbi_uc *scanline;
 7165|    296|   float *hdr_data;
 7166|    296|   int len;
 7167|    296|   unsigned char count, value;
 7168|    296|   int i, j, k, c1,c2, z;
 7169|    296|   const char *headerToken;
 7170|    296|   STBI_NOTUSED(ri);
  ------------------
  |  |  660|    296|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 7171|       |
 7172|       |   // Check identifier
 7173|    296|   headerToken = stbi__hdr_gettoken(s,buffer);
 7174|    296|   if (strcmp(headerToken, "#?RADIANCE") != 0 && strcmp(headerToken, "#?RGBE") != 0)
  ------------------
  |  Branch (7174:8): [True: 293, False: 3]
  |  Branch (7174:50): [True: 0, False: 293]
  ------------------
 7175|      0|      return stbi__errpf("not HDR", "Corrupt HDR image");
  ------------------
  |  | 1098|      0|#define stbi__errpf(x,y)   ((float *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7176|       |
 7177|       |   // Parse header
 7178|  3.10k|   for(;;) {
 7179|  3.10k|      token = stbi__hdr_gettoken(s,buffer);
 7180|  3.10k|      if (token[0] == 0) break;
  ------------------
  |  Branch (7180:11): [True: 296, False: 2.80k]
  ------------------
 7181|  2.80k|      if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1;
  ------------------
  |  Branch (7181:11): [True: 1.40k, False: 1.40k]
  ------------------
 7182|  2.80k|   }
 7183|       |
 7184|    296|   if (!valid)    return stbi__errpf("unsupported format", "Unsupported HDR format");
  ------------------
  |  | 1098|    106|#define stbi__errpf(x,y)   ((float *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|    106|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 106]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7184:8): [True: 106, False: 190]
  ------------------
 7185|       |
 7186|       |   // Parse width and height
 7187|       |   // can't use sscanf() if we're not using stdio!
 7188|    190|   token = stbi__hdr_gettoken(s,buffer);
 7189|    190|   if (strncmp(token, "-Y ", 3))  return stbi__errpf("unsupported data layout", "Unsupported HDR format");
  ------------------
  |  | 1098|     35|#define stbi__errpf(x,y)   ((float *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     35|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7189:8): [True: 35, False: 155]
  ------------------
 7190|    155|   token += 3;
 7191|    155|   height = (int) strtol(token, &token, 10);
 7192|    158|   while (*token == ' ') ++token;
  ------------------
  |  Branch (7192:11): [True: 3, False: 155]
  ------------------
 7193|    155|   if (strncmp(token, "+X ", 3))  return stbi__errpf("unsupported data layout", "Unsupported HDR format");
  ------------------
  |  | 1098|     12|#define stbi__errpf(x,y)   ((float *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     12|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7193:8): [True: 12, False: 143]
  ------------------
 7194|    143|   token += 3;
 7195|    143|   width = (int) strtol(token, NULL, 10);
 7196|       |
 7197|    143|   if (height > STBI_MAX_DIMENSIONS) return stbi__errpf("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    143|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                 if (height > STBI_MAX_DIMENSIONS) return stbi__errpf("too large","Very large image (corrupt?)");
  ------------------
  |  | 1098|     18|#define stbi__errpf(x,y)   ((float *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     18|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7197:8): [True: 18, False: 125]
  ------------------
 7198|    125|   if (width > STBI_MAX_DIMENSIONS) return stbi__errpf("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    125|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                 if (width > STBI_MAX_DIMENSIONS) return stbi__errpf("too large","Very large image (corrupt?)");
  ------------------
  |  | 1098|      9|#define stbi__errpf(x,y)   ((float *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      9|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7198:8): [True: 9, False: 116]
  ------------------
 7199|       |
 7200|    116|   *x = width;
 7201|    116|   *y = height;
 7202|       |
 7203|    116|   if (comp) *comp = 3;
  ------------------
  |  Branch (7203:8): [True: 116, False: 0]
  ------------------
 7204|    116|   if (req_comp == 0) req_comp = 3;
  ------------------
  |  Branch (7204:8): [True: 116, False: 0]
  ------------------
 7205|       |
 7206|    116|   if (!stbi__mad4sizes_valid(width, height, req_comp, sizeof(float), 0))
  ------------------
  |  Branch (7206:8): [True: 16, False: 100]
  ------------------
 7207|     16|      return stbi__errpf("too large", "HDR image is too large");
  ------------------
  |  | 1098|     16|#define stbi__errpf(x,y)   ((float *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     16|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7208|       |
 7209|       |   // Read data
 7210|    100|   hdr_data = (float *) stbi__malloc_mad4(width, height, req_comp, sizeof(float), 0);
 7211|    100|   if (!hdr_data)
  ------------------
  |  Branch (7211:8): [True: 0, False: 100]
  ------------------
 7212|      0|      return stbi__errpf("outofmem", "Out of memory");
  ------------------
  |  | 1098|      0|#define stbi__errpf(x,y)   ((float *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7213|       |
 7214|       |   // Load image data
 7215|       |   // image data is stored as some number of sca
 7216|    100|   if ( width < 8 || width >= 32768) {
  ------------------
  |  Branch (7216:9): [True: 16, False: 84]
  |  Branch (7216:22): [True: 0, False: 84]
  ------------------
 7217|       |      // Read flat data
 7218|  10.7k|      for (j=0; j < height; ++j) {
  ------------------
  |  Branch (7218:17): [True: 10.7k, False: 55]
  ------------------
 7219|  2.98M|         for (i=0; i < width; ++i) {
  ------------------
  |  Branch (7219:20): [True: 2.97M, False: 10.7k]
  ------------------
 7220|  2.97M|            stbi_uc rgbe[4];
 7221|  2.97M|           main_decode_loop:
 7222|  2.97M|            stbi__getn(s, rgbe, 4);
 7223|  2.97M|            stbi__hdr_convert(hdr_data + j * width * req_comp + i * req_comp, rgbe, req_comp);
 7224|  2.97M|         }
 7225|  10.7k|      }
 7226|     84|   } else {
 7227|       |      // Read RLE-encoded data
 7228|     84|      scanline = NULL;
 7229|       |
 7230|    263|      for (j = 0; j < height; ++j) {
  ------------------
  |  Branch (7230:19): [True: 257, False: 6]
  ------------------
 7231|    257|         c1 = stbi__get8(s);
 7232|    257|         c2 = stbi__get8(s);
 7233|    257|         len = stbi__get8(s);
 7234|    257|         if (c1 != 2 || c2 != 2 || (len & 0x80)) {
  ------------------
  |  Branch (7234:14): [True: 26, False: 231]
  |  Branch (7234:25): [True: 7, False: 224]
  |  Branch (7234:36): [True: 6, False: 218]
  ------------------
 7235|       |            // not run-length encoded, so we have to actually use THIS data as a decoded
 7236|       |            // pixel (note this can't be a valid pixel--one of RGB must be >= 128)
 7237|     39|            stbi_uc rgbe[4];
 7238|     39|            rgbe[0] = (stbi_uc) c1;
 7239|     39|            rgbe[1] = (stbi_uc) c2;
 7240|     39|            rgbe[2] = (stbi_uc) len;
 7241|     39|            rgbe[3] = (stbi_uc) stbi__get8(s);
 7242|     39|            stbi__hdr_convert(hdr_data, rgbe, req_comp);
 7243|     39|            i = 1;
 7244|     39|            j = 0;
 7245|     39|            STBI_FREE(scanline);
  ------------------
  |  |  684|     39|#define STBI_FREE(p)              free(p)
  ------------------
 7246|     39|            goto main_decode_loop; // yes, this makes no sense
 7247|     39|         }
 7248|    218|         len <<= 8;
 7249|    218|         len |= stbi__get8(s);
 7250|    218|         if (len != width) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("invalid decoded scanline length", "corrupt HDR"); }
  ------------------
  |  |  684|      6|#define STBI_FREE(p)              free(p)
  ------------------
                       if (len != width) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("invalid decoded scanline length", "corrupt HDR"); }
  ------------------
  |  |  684|      6|#define STBI_FREE(p)              free(p)
  ------------------
                       if (len != width) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("invalid decoded scanline length", "corrupt HDR"); }
  ------------------
  |  | 1098|      6|#define stbi__errpf(x,y)   ((float *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      6|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7250:14): [True: 6, False: 212]
  ------------------
 7251|    212|         if (scanline == NULL) {
  ------------------
  |  Branch (7251:14): [True: 57, False: 155]
  ------------------
 7252|     57|            scanline = (stbi_uc *) stbi__malloc_mad2(width, 4, 0);
 7253|     57|            if (!scanline) {
  ------------------
  |  Branch (7253:17): [True: 0, False: 57]
  ------------------
 7254|      0|               STBI_FREE(hdr_data);
  ------------------
  |  |  684|      0|#define STBI_FREE(p)              free(p)
  ------------------
 7255|      0|               return stbi__errpf("outofmem", "Out of memory");
  ------------------
  |  | 1098|      0|#define stbi__errpf(x,y)   ((float *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7256|      0|            }
 7257|     57|         }
 7258|       |
 7259|    954|         for (k = 0; k < 4; ++k) {
  ------------------
  |  Branch (7259:22): [True: 775, False: 179]
  ------------------
 7260|    775|            int nleft;
 7261|    775|            i = 0;
 7262|  1.83k|            while ((nleft = width - i) > 0) {
  ------------------
  |  Branch (7262:20): [True: 1.09k, False: 742]
  ------------------
 7263|  1.09k|               count = stbi__get8(s);
 7264|  1.09k|               if (count > 128) {
  ------------------
  |  Branch (7264:20): [True: 873, False: 217]
  ------------------
 7265|       |                  // Run
 7266|    873|                  value = stbi__get8(s);
 7267|    873|                  count -= 128;
 7268|    873|                  if ((count == 0) || (count > nleft)) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); }
  ------------------
  |  |  684|      2|#define STBI_FREE(p)              free(p)
  ------------------
                                if ((count == 0) || (count > nleft)) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); }
  ------------------
  |  |  684|      2|#define STBI_FREE(p)              free(p)
  ------------------
                                if ((count == 0) || (count > nleft)) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); }
  ------------------
  |  | 1098|      2|#define stbi__errpf(x,y)   ((float *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      2|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7268:23): [True: 0, False: 873]
  |  Branch (7268:39): [True: 2, False: 871]
  ------------------
 7269|  62.5k|                  for (z = 0; z < count; ++z)
  ------------------
  |  Branch (7269:31): [True: 61.6k, False: 871]
  ------------------
 7270|  61.6k|                     scanline[i++ * 4 + k] = value;
 7271|    871|               } else {
 7272|       |                  // Dump
 7273|    217|                  if ((count == 0) || (count > nleft)) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); }
  ------------------
  |  |  684|     31|#define STBI_FREE(p)              free(p)
  ------------------
                                if ((count == 0) || (count > nleft)) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); }
  ------------------
  |  |  684|     31|#define STBI_FREE(p)              free(p)
  ------------------
                                if ((count == 0) || (count > nleft)) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); }
  ------------------
  |  | 1098|     31|#define stbi__errpf(x,y)   ((float *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     31|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 31]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7273:23): [True: 24, False: 193]
  |  Branch (7273:39): [True: 7, False: 186]
  ------------------
 7274|  3.89k|                  for (z = 0; z < count; ++z)
  ------------------
  |  Branch (7274:31): [True: 3.71k, False: 186]
  ------------------
 7275|  3.71k|                     scanline[i++ * 4 + k] = stbi__get8(s);
 7276|    186|               }
 7277|  1.09k|            }
 7278|    775|         }
 7279|  14.1k|         for (i=0; i < width; ++i)
  ------------------
  |  Branch (7279:20): [True: 13.9k, False: 179]
  ------------------
 7280|  13.9k|            stbi__hdr_convert(hdr_data+(j*width + i)*req_comp, scanline + i*4, req_comp);
 7281|    179|      }
 7282|      6|      if (scanline)
  ------------------
  |  Branch (7282:11): [True: 6, False: 0]
  ------------------
 7283|      6|         STBI_FREE(scanline);
  ------------------
  |  |  684|      6|#define STBI_FREE(p)              free(p)
  ------------------
 7284|      6|   }
 7285|       |
 7286|     61|   return hdr_data;
 7287|    100|}
OgreSTBICodec.cpp:_ZL18stbi__hdr_gettokenP13stbi__contextPc:
 7110|  3.58k|{
 7111|  3.58k|   int len=0;
 7112|  3.58k|   char c = '\0';
 7113|       |
 7114|  3.58k|   c = (char) stbi__get8(z);
 7115|       |
 7116|   187k|   while (!stbi__at_eof(z) && c != '\n') {
  ------------------
  |  Branch (7116:11): [True: 187k, False: 260]
  |  Branch (7116:31): [True: 184k, False: 3.23k]
  ------------------
 7117|   184k|      buffer[len++] = c;
 7118|   184k|      if (len == STBI__HDR_BUFLEN-1) {
  ------------------
  |  | 7108|   184k|#define STBI__HDR_BUFLEN  1024
  ------------------
  |  Branch (7118:11): [True: 89, False: 184k]
  ------------------
 7119|       |         // flush to end of line
 7120|  46.1k|         while (!stbi__at_eof(z) && stbi__get8(z) != '\n')
  ------------------
  |  Branch (7120:17): [True: 46.1k, False: 7]
  |  Branch (7120:37): [True: 46.0k, False: 82]
  ------------------
 7121|  46.0k|            ;
 7122|     89|         break;
 7123|     89|      }
 7124|   184k|      c = (char) stbi__get8(z);
 7125|   184k|   }
 7126|       |
 7127|  3.58k|   buffer[len] = 0;
 7128|  3.58k|   return buffer;
 7129|  3.58k|}
OgreSTBICodec.cpp:_ZL17stbi__hdr_convertPfPhi:
 7132|  2.98M|{
 7133|  2.98M|   if ( input[3] != 0 ) {
  ------------------
  |  Branch (7133:9): [True: 140k, False: 2.84M]
  ------------------
 7134|   140k|      float f1;
 7135|       |      // Exponent
 7136|   140k|      f1 = (float) ldexp(1.0f, input[3] - (int)(128 + 8));
 7137|   140k|      if (req_comp <= 2)
  ------------------
  |  Branch (7137:11): [True: 0, False: 140k]
  ------------------
 7138|      0|         output[0] = (input[0] + input[1] + input[2]) * f1 / 3;
 7139|   140k|      else {
 7140|   140k|         output[0] = input[0] * f1;
 7141|   140k|         output[1] = input[1] * f1;
 7142|   140k|         output[2] = input[2] * f1;
 7143|   140k|      }
 7144|   140k|      if (req_comp == 2) output[1] = 1;
  ------------------
  |  Branch (7144:11): [True: 0, False: 140k]
  ------------------
 7145|   140k|      if (req_comp == 4) output[3] = 1;
  ------------------
  |  Branch (7145:11): [True: 0, False: 140k]
  ------------------
 7146|  2.84M|   } else {
 7147|  2.84M|      switch (req_comp) {
  ------------------
  |  Branch (7147:15): [True: 2.84M, False: 0]
  ------------------
 7148|      0|         case 4: output[3] = 1; /* fallthrough */
  ------------------
  |  Branch (7148:10): [True: 0, False: 2.84M]
  ------------------
 7149|  2.84M|         case 3: output[0] = output[1] = output[2] = 0;
  ------------------
  |  Branch (7149:10): [True: 2.84M, False: 0]
  ------------------
 7150|  2.84M|                 break;
 7151|      0|         case 2: output[1] = 1; /* fallthrough */
  ------------------
  |  Branch (7151:10): [True: 0, False: 2.84M]
  ------------------
 7152|      0|         case 1: output[0] = 0;
  ------------------
  |  Branch (7152:10): [True: 0, False: 2.84M]
  ------------------
 7153|      0|                 break;
 7154|  2.84M|      }
 7155|  2.84M|   }
 7156|  2.98M|}
OgreSTBICodec.cpp:_ZL16stbi__hdr_to_ldrPfiii:
 1885|    296|{
 1886|    296|   int i,k,n;
 1887|    296|   stbi_uc *output;
 1888|    296|   if (!data) return NULL;
  ------------------
  |  Branch (1888:8): [True: 235, False: 61]
  ------------------
 1889|     61|   output = (stbi_uc *) stbi__malloc_mad3(x, y, comp, 0);
 1890|     61|   if (output == NULL) { STBI_FREE(data); return stbi__errpuc("outofmem", "Out of memory"); }
  ------------------
  |  |  684|      0|#define STBI_FREE(p)              free(p)
  ------------------
                 if (output == NULL) { STBI_FREE(data); return stbi__errpuc("outofmem", "Out of memory"); }
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1890:8): [True: 0, False: 61]
  ------------------
 1891|       |   // compute number of non-alpha components
 1892|     61|   if (comp & 1) n = comp; else n = comp-1;
  ------------------
  |  Branch (1892:8): [True: 61, False: 0]
  ------------------
 1893|  2.97M|   for (i=0; i < x*y; ++i) {
  ------------------
  |  Branch (1893:14): [True: 2.97M, False: 61]
  ------------------
 1894|  11.8M|      for (k=0; k < n; ++k) {
  ------------------
  |  Branch (1894:17): [True: 8.92M, False: 2.97M]
  ------------------
 1895|  8.92M|         float z = (float) pow(data[i*comp+k]*stbi__h2l_scale_i, stbi__h2l_gamma_i) * 255 + 0.5f;
 1896|  8.92M|         if (z < 0) z = 0;
  ------------------
  |  Branch (1896:14): [True: 0, False: 8.92M]
  ------------------
 1897|  8.92M|         if (z > 255) z = 255;
  ------------------
  |  Branch (1897:14): [True: 265k, False: 8.65M]
  ------------------
 1898|  8.92M|         output[i*comp + k] = (stbi_uc) stbi__float2int(z);
  ------------------
  |  | 1883|  8.92M|#define stbi__float2int(x)   ((int) (x))
  ------------------
 1899|  8.92M|      }
 1900|  2.97M|      if (k < comp) {
  ------------------
  |  Branch (1900:11): [True: 0, False: 2.97M]
  ------------------
 1901|      0|         float z = data[i*comp+k] * 255 + 0.5f;
 1902|      0|         if (z < 0) z = 0;
  ------------------
  |  Branch (1902:14): [True: 0, False: 0]
  ------------------
 1903|      0|         if (z > 255) z = 255;
  ------------------
  |  Branch (1903:14): [True: 0, False: 0]
  ------------------
 1904|      0|         output[i*comp + k] = (stbi_uc) stbi__float2int(z);
  ------------------
  |  | 1883|      0|#define stbi__float2int(x)   ((int) (x))
  ------------------
 1905|      0|      }
 1906|  2.97M|   }
 1907|     61|   STBI_FREE(data);
  ------------------
  |  |  684|     61|#define STBI_FREE(p)              free(p)
  ------------------
 1908|     61|   return output;
 1909|     61|}
OgreSTBICodec.cpp:_ZL14stbi__tga_testP13stbi__context:
 5821|    494|{
 5822|    494|   int res = 0;
 5823|    494|   int sz, tga_color_type;
 5824|    494|   stbi__get8(s);      //   discard Offset
 5825|    494|   tga_color_type = stbi__get8(s);   //   color type
 5826|    494|   if ( tga_color_type > 1 ) goto errorEnd;   //   only RGB or indexed allowed
  ------------------
  |  Branch (5826:9): [True: 193, False: 301]
  ------------------
 5827|    301|   sz = stbi__get8(s);   //   image type
 5828|    301|   if ( tga_color_type == 1 ) { // colormapped (paletted) image
  ------------------
  |  Branch (5828:9): [True: 113, False: 188]
  ------------------
 5829|    113|      if (sz != 1 && sz != 9) goto errorEnd; // colortype 1 demands image type 1 or 9
  ------------------
  |  Branch (5829:11): [True: 65, False: 48]
  |  Branch (5829:22): [True: 9, False: 56]
  ------------------
 5830|    104|      stbi__skip(s,4);       // skip index of first colormap entry and number of entries
 5831|    104|      sz = stbi__get8(s);    //   check bits per palette color entry
 5832|    104|      if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd;
  ------------------
  |  Branch (5832:12): [True: 64, False: 40]
  |  Branch (5832:25): [True: 60, False: 4]
  |  Branch (5832:39): [True: 27, False: 33]
  |  Branch (5832:53): [True: 22, False: 5]
  |  Branch (5832:67): [True: 21, False: 1]
  ------------------
 5833|     83|      stbi__skip(s,4);       // skip image x and y origin
 5834|    188|   } else { // "normal" image w/o colormap
 5835|    188|      if ( (sz != 2) && (sz != 3) && (sz != 10) && (sz != 11) ) goto errorEnd; // only RGB or grey allowed, +/- RLE
  ------------------
  |  Branch (5835:12): [True: 153, False: 35]
  |  Branch (5835:25): [True: 132, False: 21]
  |  Branch (5835:38): [True: 66, False: 66]
  |  Branch (5835:52): [True: 44, False: 22]
  ------------------
 5836|    144|      stbi__skip(s,9); // skip colormap specification and image x/y origin
 5837|    144|   }
 5838|    227|   if ( stbi__get16le(s) < 1 ) goto errorEnd;      //   test width
  ------------------
  |  Branch (5838:9): [True: 9, False: 218]
  ------------------
 5839|    218|   if ( stbi__get16le(s) < 1 ) goto errorEnd;      //   test height
  ------------------
  |  Branch (5839:9): [True: 8, False: 210]
  ------------------
 5840|    210|   sz = stbi__get8(s);   //   bits per pixel
 5841|    210|   if ( (tga_color_type == 1) && (sz != 8) && (sz != 16) ) goto errorEnd; // for colormapped images, bpp is size of an index
  ------------------
  |  Branch (5841:9): [True: 77, False: 133]
  |  Branch (5841:34): [True: 37, False: 40]
  |  Branch (5841:47): [True: 8, False: 29]
  ------------------
 5842|    202|   if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd;
  ------------------
  |  Branch (5842:9): [True: 106, False: 96]
  |  Branch (5842:22): [True: 101, False: 5]
  |  Branch (5842:36): [True: 57, False: 44]
  |  Branch (5842:50): [True: 53, False: 4]
  |  Branch (5842:64): [True: 18, False: 35]
  ------------------
 5843|       |
 5844|    184|   res = 1; // if we got this far, everything's good and we can return 1 instead of 0
 5845|       |
 5846|    494|errorEnd:
 5847|    494|   stbi__rewind(s);
 5848|    494|   return res;
 5849|    184|}
OgreSTBICodec.cpp:_ZL14stbi__tga_loadP13stbi__contextPiS1_S1_iP17stbi__result_info:
 5872|    184|{
 5873|       |   //   read in the TGA header stuff
 5874|    184|   int tga_offset = stbi__get8(s);
 5875|    184|   int tga_indexed = stbi__get8(s);
 5876|    184|   int tga_image_type = stbi__get8(s);
 5877|    184|   int tga_is_RLE = 0;
 5878|    184|   int tga_palette_start = stbi__get16le(s);
 5879|    184|   int tga_palette_len = stbi__get16le(s);
 5880|    184|   int tga_palette_bits = stbi__get8(s);
 5881|    184|   int tga_x_origin = stbi__get16le(s);
 5882|    184|   int tga_y_origin = stbi__get16le(s);
 5883|    184|   int tga_width = stbi__get16le(s);
 5884|    184|   int tga_height = stbi__get16le(s);
 5885|    184|   int tga_bits_per_pixel = stbi__get8(s);
 5886|    184|   int tga_comp, tga_rgb16=0;
 5887|    184|   int tga_inverted = stbi__get8(s);
 5888|       |   // int tga_alpha_bits = tga_inverted & 15; // the 4 lowest bits - unused (useless?)
 5889|       |   //   image data
 5890|    184|   unsigned char *tga_data;
 5891|    184|   unsigned char *tga_palette = NULL;
 5892|    184|   int i, j;
 5893|    184|   unsigned char raw_data[4] = {0};
 5894|    184|   int RLE_count = 0;
 5895|    184|   int RLE_repeating = 0;
 5896|    184|   int read_next_pixel = 1;
 5897|    184|   STBI_NOTUSED(ri);
  ------------------
  |  |  660|    184|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 5898|    184|   STBI_NOTUSED(tga_x_origin); // @TODO
  ------------------
  |  |  660|    184|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 5899|    184|   STBI_NOTUSED(tga_y_origin); // @TODO
  ------------------
  |  |  660|    184|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 5900|       |
 5901|    184|   if (tga_height > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    184|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                 if (tga_height > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  | 1099|     36|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     36|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 36]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5901:8): [True: 36, False: 148]
  ------------------
 5902|    148|   if (tga_width > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  |   45|    148|#define STBI_MAX_DIMENSIONS 16384
  ------------------
                 if (tga_width > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
  ------------------
  |  | 1099|     33|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|     33|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 33]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5902:8): [True: 33, False: 115]
  ------------------
 5903|       |
 5904|       |   //   do a tiny bit of precessing
 5905|    115|   if ( tga_image_type >= 8 )
  ------------------
  |  Branch (5905:9): [True: 79, False: 36]
  ------------------
 5906|     79|   {
 5907|     79|      tga_image_type -= 8;
 5908|     79|      tga_is_RLE = 1;
 5909|     79|   }
 5910|    115|   tga_inverted = 1 - ((tga_inverted >> 5) & 1);
 5911|       |
 5912|       |   //   If I'm paletted, then I'll use the number of bits from the palette
 5913|    115|   if ( tga_indexed ) tga_comp = stbi__tga_get_comp(tga_palette_bits, 0, &tga_rgb16);
  ------------------
  |  Branch (5913:9): [True: 47, False: 68]
  ------------------
 5914|     68|   else tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3), &tga_rgb16);
 5915|       |
 5916|    115|   if(!tga_comp) // shouldn't really happen, stbi__tga_test() should have ensured basic consistency
  ------------------
  |  Branch (5916:7): [True: 0, False: 115]
  ------------------
 5917|      0|      return stbi__errpuc("bad format", "Can't find out TGA pixelformat");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5918|       |
 5919|       |   //   tga info
 5920|    115|   *x = tga_width;
 5921|    115|   *y = tga_height;
 5922|    115|   if (comp) *comp = tga_comp;
  ------------------
  |  Branch (5922:8): [True: 115, False: 0]
  ------------------
 5923|       |
 5924|    115|   if (!stbi__mad3sizes_valid(tga_width, tga_height, tga_comp, 0))
  ------------------
  |  Branch (5924:8): [True: 0, False: 115]
  ------------------
 5925|      0|      return stbi__errpuc("too large", "Corrupt TGA");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5926|       |
 5927|    115|   tga_data = (unsigned char*)stbi__malloc_mad3(tga_width, tga_height, tga_comp, 0);
 5928|    115|   if (!tga_data) return stbi__errpuc("outofmem", "Out of memory");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5928:8): [True: 0, False: 115]
  ------------------
 5929|       |
 5930|       |   // skip to the data's starting position (offset usually = 0)
 5931|    115|   stbi__skip(s, tga_offset );
 5932|       |
 5933|    115|   if ( !tga_indexed && !tga_is_RLE && !tga_rgb16 ) {
  ------------------
  |  Branch (5933:9): [True: 68, False: 47]
  |  Branch (5933:25): [True: 17, False: 51]
  |  Branch (5933:40): [True: 14, False: 3]
  ------------------
 5934|  21.5k|      for (i=0; i < tga_height; ++i) {
  ------------------
  |  Branch (5934:17): [True: 21.5k, False: 14]
  ------------------
 5935|  21.5k|         int row = tga_inverted ? tga_height -i - 1 : i;
  ------------------
  |  Branch (5935:20): [True: 14.9k, False: 6.60k]
  ------------------
 5936|  21.5k|         stbi_uc *tga_row = tga_data + row*tga_width*tga_comp;
 5937|  21.5k|         stbi__getn(s, tga_row, tga_width * tga_comp);
 5938|  21.5k|      }
 5939|    101|   } else  {
 5940|       |      //   do I need to load a palette?
 5941|    101|      if ( tga_indexed)
  ------------------
  |  Branch (5941:12): [True: 47, False: 54]
  ------------------
 5942|     47|      {
 5943|     47|         if (tga_palette_len == 0) {  /* you have to have at least one entry! */
  ------------------
  |  Branch (5943:14): [True: 1, False: 46]
  ------------------
 5944|      1|            STBI_FREE(tga_data);
  ------------------
  |  |  684|      1|#define STBI_FREE(p)              free(p)
  ------------------
 5945|      1|            return stbi__errpuc("bad palette", "Corrupt TGA");
  ------------------
  |  | 1099|      1|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      1|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5946|      1|         }
 5947|       |
 5948|       |         //   any data to skip? (offset usually = 0)
 5949|     46|         stbi__skip(s, tga_palette_start );
 5950|       |         //   load the palette
 5951|     46|         tga_palette = (unsigned char*)stbi__malloc_mad2(tga_palette_len, tga_comp, 0);
 5952|     46|         if (!tga_palette) {
  ------------------
  |  Branch (5952:14): [True: 0, False: 46]
  ------------------
 5953|      0|            STBI_FREE(tga_data);
  ------------------
  |  |  684|      0|#define STBI_FREE(p)              free(p)
  ------------------
 5954|      0|            return stbi__errpuc("outofmem", "Out of memory");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5955|      0|         }
 5956|     46|         if (tga_rgb16) {
  ------------------
  |  Branch (5956:14): [True: 22, False: 24]
  ------------------
 5957|     22|            stbi_uc *pal_entry = tga_palette;
 5958|     22|            STBI_ASSERT(tga_comp == STBI_rgb);
  ------------------
  |  |  603|     22|#define STBI_ASSERT(x) assert(x)
  ------------------
 5959|   154k|            for (i=0; i < tga_palette_len; ++i) {
  ------------------
  |  Branch (5959:23): [True: 154k, False: 22]
  ------------------
 5960|   154k|               stbi__tga_read_rgb16(s, pal_entry);
 5961|   154k|               pal_entry += tga_comp;
 5962|   154k|            }
 5963|     24|         } else if (!stbi__getn(s, tga_palette, tga_palette_len * tga_comp)) {
  ------------------
  |  Branch (5963:21): [True: 3, False: 21]
  ------------------
 5964|      3|               STBI_FREE(tga_data);
  ------------------
  |  |  684|      3|#define STBI_FREE(p)              free(p)
  ------------------
 5965|      3|               STBI_FREE(tga_palette);
  ------------------
  |  |  684|      3|#define STBI_FREE(p)              free(p)
  ------------------
 5966|      3|               return stbi__errpuc("bad palette", "Corrupt TGA");
  ------------------
  |  | 1099|      3|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      3|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5967|      3|         }
 5968|     46|      }
 5969|       |      //   load the data
 5970|  85.6M|      for (i=0; i < tga_width * tga_height; ++i)
  ------------------
  |  Branch (5970:17): [True: 85.6M, False: 97]
  ------------------
 5971|  85.6M|      {
 5972|       |         //   if I'm in RLE mode, do I need to get a RLE stbi__pngchunk?
 5973|  85.6M|         if ( tga_is_RLE )
  ------------------
  |  Branch (5973:15): [True: 83.6M, False: 1.97M]
  ------------------
 5974|  83.6M|         {
 5975|  83.6M|            if ( RLE_count == 0 )
  ------------------
  |  Branch (5975:18): [True: 83.6M, False: 14.7k]
  ------------------
 5976|  83.6M|            {
 5977|       |               //   yep, get the next byte as a RLE command
 5978|  83.6M|               int RLE_cmd = stbi__get8(s);
 5979|  83.6M|               RLE_count = 1 + (RLE_cmd & 127);
 5980|  83.6M|               RLE_repeating = RLE_cmd >> 7;
 5981|  83.6M|               read_next_pixel = 1;
 5982|  83.6M|            } else if ( !RLE_repeating )
  ------------------
  |  Branch (5982:25): [True: 2.95k, False: 11.7k]
  ------------------
 5983|  2.95k|            {
 5984|  2.95k|               read_next_pixel = 1;
 5985|  2.95k|            }
 5986|  83.6M|         } else
 5987|  1.97M|         {
 5988|  1.97M|            read_next_pixel = 1;
 5989|  1.97M|         }
 5990|       |         //   OK, if I need to read a pixel, do it now
 5991|  85.6M|         if ( read_next_pixel )
  ------------------
  |  Branch (5991:15): [True: 85.5M, False: 11.7k]
  ------------------
 5992|  85.5M|         {
 5993|       |            //   load however much data we did have
 5994|  85.5M|            if ( tga_indexed )
  ------------------
  |  Branch (5994:18): [True: 8.90M, False: 76.6M]
  ------------------
 5995|  8.90M|            {
 5996|       |               // read in index, then perform the lookup
 5997|  8.90M|               int pal_idx = (tga_bits_per_pixel == 8) ? stbi__get8(s) : stbi__get16le(s);
  ------------------
  |  Branch (5997:30): [True: 8.36M, False: 536k]
  ------------------
 5998|  8.90M|               if ( pal_idx >= tga_palette_len ) {
  ------------------
  |  Branch (5998:21): [True: 885, False: 8.90M]
  ------------------
 5999|       |                  // invalid index
 6000|    885|                  pal_idx = 0;
 6001|    885|               }
 6002|  8.90M|               pal_idx *= tga_comp;
 6003|  18.9M|               for (j = 0; j < tga_comp; ++j) {
  ------------------
  |  Branch (6003:28): [True: 10.0M, False: 8.90M]
  ------------------
 6004|  10.0M|                  raw_data[j] = tga_palette[pal_idx+j];
 6005|  10.0M|               }
 6006|  76.6M|            } else if(tga_rgb16) {
  ------------------
  |  Branch (6006:23): [True: 11.1M, False: 65.5M]
  ------------------
 6007|  11.1M|               STBI_ASSERT(tga_comp == STBI_rgb);
  ------------------
  |  |  603|  11.1M|#define STBI_ASSERT(x) assert(x)
  ------------------
 6008|  11.1M|               stbi__tga_read_rgb16(s, raw_data);
 6009|  65.5M|            } else {
 6010|       |               //   read in the data raw
 6011|   178M|               for (j = 0; j < tga_comp; ++j) {
  ------------------
  |  Branch (6011:28): [True: 112M, False: 65.5M]
  ------------------
 6012|   112M|                  raw_data[j] = stbi__get8(s);
 6013|   112M|               }
 6014|  65.5M|            }
 6015|       |            //   clear the reading flag for the next pixel
 6016|  85.5M|            read_next_pixel = 0;
 6017|  85.5M|         } // end of reading a pixel
 6018|       |
 6019|       |         // copy data
 6020|   241M|         for (j = 0; j < tga_comp; ++j)
  ------------------
  |  Branch (6020:22): [True: 156M, False: 85.6M]
  ------------------
 6021|   156M|           tga_data[i*tga_comp+j] = raw_data[j];
 6022|       |
 6023|       |         //   in case we're in RLE mode, keep counting down
 6024|  85.6M|         --RLE_count;
 6025|  85.6M|      }
 6026|       |      //   do I need to invert the image?
 6027|     97|      if ( tga_inverted )
  ------------------
  |  Branch (6027:12): [True: 81, False: 16]
  ------------------
 6028|     81|      {
 6029|  31.2k|         for (j = 0; j*2 < tga_height; ++j)
  ------------------
  |  Branch (6029:22): [True: 31.1k, False: 81]
  ------------------
 6030|  31.1k|         {
 6031|  31.1k|            int index1 = j * tga_width * tga_comp;
 6032|  31.1k|            int index2 = (tga_height - 1 - j) * tga_width * tga_comp;
 6033|  61.5M|            for (i = tga_width * tga_comp; i > 0; --i)
  ------------------
  |  Branch (6033:44): [True: 61.5M, False: 31.1k]
  ------------------
 6034|  61.5M|            {
 6035|  61.5M|               unsigned char temp = tga_data[index1];
 6036|  61.5M|               tga_data[index1] = tga_data[index2];
 6037|  61.5M|               tga_data[index2] = temp;
 6038|  61.5M|               ++index1;
 6039|  61.5M|               ++index2;
 6040|  61.5M|            }
 6041|  31.1k|         }
 6042|     81|      }
 6043|       |      //   clear my palette, if I had one
 6044|     97|      if ( tga_palette != NULL )
  ------------------
  |  Branch (6044:12): [True: 43, False: 54]
  ------------------
 6045|     43|      {
 6046|     43|         STBI_FREE( tga_palette );
  ------------------
  |  |  684|     43|#define STBI_FREE(p)              free(p)
  ------------------
 6047|     43|      }
 6048|     97|   }
 6049|       |
 6050|       |   // swap RGB - if the source data was RGB16, it already is in the right order
 6051|    111|   if (tga_comp >= 3 && !tga_rgb16)
  ------------------
  |  Branch (6051:8): [True: 58, False: 53]
  |  Branch (6051:25): [True: 24, False: 34]
  ------------------
 6052|     24|   {
 6053|     24|      unsigned char* tga_pixel = tga_data;
 6054|  19.9M|      for (i=0; i < tga_width * tga_height; ++i)
  ------------------
  |  Branch (6054:17): [True: 19.9M, False: 24]
  ------------------
 6055|  19.9M|      {
 6056|  19.9M|         unsigned char temp = tga_pixel[0];
 6057|  19.9M|         tga_pixel[0] = tga_pixel[2];
 6058|  19.9M|         tga_pixel[2] = temp;
 6059|  19.9M|         tga_pixel += tga_comp;
 6060|  19.9M|      }
 6061|     24|   }
 6062|       |
 6063|       |   // convert to target component count
 6064|    111|   if (req_comp && req_comp != tga_comp)
  ------------------
  |  Branch (6064:8): [True: 0, False: 111]
  |  Branch (6064:20): [True: 0, False: 0]
  ------------------
 6065|      0|      tga_data = stbi__convert_format(tga_data, tga_comp, req_comp, tga_width, tga_height);
 6066|       |
 6067|       |   //   the things I do to get rid of an error message, and yet keep
 6068|       |   //   Microsoft's C compilers happy... [8^(
 6069|    111|   tga_palette_start = tga_palette_len = tga_palette_bits =
 6070|    111|         tga_x_origin = tga_y_origin = 0;
 6071|    111|   STBI_NOTUSED(tga_palette_start);
  ------------------
  |  |  660|    111|#define STBI_NOTUSED(v)  (void)sizeof(v)
  ------------------
 6072|       |   //   OK, done
 6073|    111|   return tga_data;
 6074|    115|}
OgreSTBICodec.cpp:_ZL18stbi__tga_get_compiiPi:
 5740|    115|{
 5741|       |   // only RGB or RGBA (incl. 16bit) or grey allowed
 5742|    115|   if (is_rgb16) *is_rgb16 = 0;
  ------------------
  |  Branch (5742:8): [True: 115, False: 0]
  ------------------
 5743|    115|   switch(bits_per_pixel) {
 5744|     56|      case 8:  return STBI_grey;
  ------------------
  |  Branch (5744:7): [True: 56, False: 59]
  ------------------
 5745|     30|      case 16: if(is_grey) return STBI_grey_alpha;
  ------------------
  |  Branch (5745:7): [True: 30, False: 85]
  |  Branch (5745:19): [True: 1, False: 29]
  ------------------
 5746|       |               // fallthrough
 5747|     34|      case 15: if(is_rgb16) *is_rgb16 = 1;
  ------------------
  |  Branch (5747:7): [True: 5, False: 110]
  |  Branch (5747:19): [True: 34, False: 0]
  ------------------
 5748|     34|               return STBI_rgb;
 5749|      3|      case 24: // fallthrough
  ------------------
  |  Branch (5749:7): [True: 3, False: 112]
  ------------------
 5750|     24|      case 32: return bits_per_pixel/8;
  ------------------
  |  Branch (5750:7): [True: 21, False: 94]
  ------------------
 5751|      0|      default: return 0;
  ------------------
  |  Branch (5751:7): [True: 0, False: 115]
  ------------------
 5752|    115|   }
 5753|    115|}
OgreSTBICodec.cpp:_ZL20stbi__tga_read_rgb16P13stbi__contextPh:
 5853|  11.3M|{
 5854|  11.3M|   stbi__uint16 px = (stbi__uint16)stbi__get16le(s);
 5855|  11.3M|   stbi__uint16 fiveBitMask = 31;
 5856|       |   // we have 3 channels with 5bits each
 5857|  11.3M|   int r = (px >> 10) & fiveBitMask;
 5858|  11.3M|   int g = (px >> 5) & fiveBitMask;
 5859|  11.3M|   int b = px & fiveBitMask;
 5860|       |   // Note that this saves the data in RGB(A) order, so it doesn't need to be swapped later
 5861|  11.3M|   out[0] = (stbi_uc)((r * 255)/31);
 5862|  11.3M|   out[1] = (stbi_uc)((g * 255)/31);
 5863|  11.3M|   out[2] = (stbi_uc)((b * 255)/31);
 5864|       |
 5865|       |   // some people claim that the most significant bit might be used for alpha
 5866|       |   // (possibly if an alpha-bit is set in the "image descriptor byte")
 5867|       |   // but that only made 16bit test images completely translucent..
 5868|       |   // so let's treat all 15 and 16bit TGAs as RGB with no alpha.
 5869|  11.3M|}
OgreSTBICodec.cpp:_ZL9stbi__errPKc:
  979|  8.74k|{
  980|  8.74k|   stbi__g_failure_reason = str;
  981|  8.74k|   return 0;
  982|  8.74k|}
OgreSTBICodec.cpp:_ZL21stbi__convert_16_to_8Ptiii:
 1191|     55|{
 1192|     55|   int i;
 1193|     55|   int img_len = w * h * channels;
 1194|     55|   stbi_uc *reduced;
 1195|       |
 1196|     55|   reduced = (stbi_uc *) stbi__malloc(img_len);
 1197|     55|   if (reduced == NULL) return stbi__errpuc("outofmem", "Out of memory");
  ------------------
  |  | 1099|      0|#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
  |  |  ------------------
  |  |  |  | 1095|      0|   #define stbi__err(x,y)  stbi__err(x)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1197:8): [True: 0, False: 55]
  ------------------
 1198|       |
 1199|   540k|   for (i = 0; i < img_len; ++i)
  ------------------
  |  Branch (1199:16): [True: 540k, False: 55]
  ------------------
 1200|   540k|      reduced[i] = (stbi_uc)((orig[i] >> 8) & 0xFF); // top half of each byte is sufficient approx of 16->8 bit scaling
 1201|       |
 1202|     55|   STBI_FREE(orig);
  ------------------
  |  |  684|     55|#define STBI_FREE(p)              free(p)
  ------------------
 1203|     55|   return reduced;
 1204|     55|}

stbi_zlib_compress:
  896|    677|{
  897|       |#ifdef STBIW_ZLIB_COMPRESS
  898|       |   // user provided a zlib compress implementation, use that
  899|       |   return STBIW_ZLIB_COMPRESS(data, data_len, out_len, quality);
  900|       |#else // use builtin
  901|    677|   static unsigned short lengthc[] = { 3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258, 259 };
  902|    677|   static unsigned char  lengtheb[]= { 0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4,  4,  5,  5,  5,  5,  0 };
  903|    677|   static unsigned short distc[]   = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 32768 };
  904|    677|   static unsigned char  disteb[]  = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13 };
  905|    677|   unsigned int bitbuf=0;
  906|    677|   int i,j, bitcount=0;
  907|    677|   unsigned char *out = NULL;
  908|    677|   unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(unsigned char**));
  ------------------
  |  |  228|    677|#define STBIW_MALLOC(sz)        malloc(sz)
  ------------------
  909|    677|   if (hash_table == NULL)
  ------------------
  |  Branch (909:8): [True: 0, False: 677]
  ------------------
  910|      0|      return NULL;
  911|    677|   if (quality < 5) quality = 5;
  ------------------
  |  Branch (911:8): [True: 0, False: 677]
  ------------------
  912|       |
  913|    677|   stbiw__sbpush(out, 0x78);   // DEFLATE 32K window
  ------------------
  |  |  822|    677|#define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  819|    677|#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  818|    677|#define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  816|      0|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|      0|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  815|      0|#define stbiw__sbm(a)   stbiw__sbraw(a)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|      0|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (818:34): [True: 677, False: 0]
  |  |  |  |  |  |  |  Branch (818:44): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  820|    677|#define stbiw__sbgrow(a,n)  stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  816|    677|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  914|    677|   stbiw__sbpush(out, 0x5e);   // FLEVEL = 1
  ------------------
  |  |  822|    677|#define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  819|    677|#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  818|    677|#define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  816|    677|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  815|    677|#define stbiw__sbm(a)   stbiw__sbraw(a)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (818:34): [True: 0, False: 677]
  |  |  |  |  |  |  |  Branch (818:44): [True: 677, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  820|    677|#define stbiw__sbgrow(a,n)  stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  816|    677|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  915|    677|   stbiw__zlib_add(1,1);  // BFINAL = 1
  ------------------
  |  |  881|    677|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  ------------------
  |  |  |  |  879|    677|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  ------------------
  ------------------
  916|    677|   stbiw__zlib_add(1,2);  // BTYPE = 1 -- fixed huffman
  ------------------
  |  |  881|    677|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  ------------------
  |  |  |  |  879|    677|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  ------------------
  ------------------
  917|       |
  918|  11.0M|   for (i=0; i < stbiw__ZHASH; ++i)
  ------------------
  |  |  891|  11.0M|#define stbiw__ZHASH   16384
  ------------------
  |  Branch (918:14): [True: 11.0M, False: 677]
  ------------------
  919|  11.0M|      hash_table[i] = NULL;
  920|       |
  921|    677|   i=0;
  922|  3.26M|   while (i < data_len-3) {
  ------------------
  |  Branch (922:11): [True: 3.26M, False: 677]
  ------------------
  923|       |      // hash next 3 bytes of data to be compressed
  924|  3.26M|      int h = stbiw__zhash(data+i)&(stbiw__ZHASH-1), best=3;
  ------------------
  |  |  891|  3.26M|#define stbiw__ZHASH   16384
  ------------------
  925|  3.26M|      unsigned char *bestloc = 0;
  926|  3.26M|      unsigned char **hlist = hash_table[h];
  927|  3.26M|      int n = stbiw__sbcount(hlist);
  ------------------
  |  |  823|  3.26M|#define stbiw__sbcount(a)        ((a) ? stbiw__sbn(a) : 0)
  |  |  ------------------
  |  |  |  |  816|  2.29M|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  814|  2.29M|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (823:35): [True: 2.29M, False: 969k]
  |  |  ------------------
  ------------------
  928|  18.8M|      for (j=0; j < n; ++j) {
  ------------------
  |  Branch (928:17): [True: 15.5M, False: 3.26M]
  ------------------
  929|  15.5M|         if (hlist[j]-data > i-32768) { // if entry lies within window
  ------------------
  |  Branch (929:14): [True: 10.7M, False: 4.83M]
  ------------------
  930|  10.7M|            int d = stbiw__zlib_countm(hlist[j], data+i, data_len-i);
  931|  10.7M|            if (d >= best) { best=d; bestloc=hlist[j]; }
  ------------------
  |  Branch (931:17): [True: 6.93M, False: 3.76M]
  ------------------
  932|  10.7M|         }
  933|  15.5M|      }
  934|       |      // when hash table entry is too long, delete half the entries
  935|  3.26M|      if (hash_table[h] && stbiw__sbn(hash_table[h]) == 2*quality) {
  ------------------
  |  |  816|  2.29M|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  ------------------
  |  |  |  |  814|  2.29M|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  ------------------
  ------------------
  |  Branch (935:11): [True: 2.29M, False: 969k]
  |  Branch (935:28): [True: 99.8k, False: 2.19M]
  ------------------
  936|  99.8k|         STBIW_MEMMOVE(hash_table[h], hash_table[h]+quality, sizeof(hash_table[h][0])*quality);
  ------------------
  |  |  239|  99.8k|#define STBIW_MEMMOVE(a,b,sz) memmove(a,b,sz)
  ------------------
  937|  99.8k|         stbiw__sbn(hash_table[h]) = quality;
  ------------------
  |  |  816|  99.8k|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  ------------------
  |  |  |  |  814|  99.8k|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  ------------------
  ------------------
  938|  99.8k|      }
  939|  3.26M|      stbiw__sbpush(hash_table[h],data+i);
  ------------------
  |  |  822|  3.26M|#define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  819|  3.26M|#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  818|  3.26M|#define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  816|  2.29M|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|  2.29M|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  815|  2.29M|#define stbiw__sbm(a)   stbiw__sbraw(a)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|  2.29M|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (818:34): [True: 969k, False: 2.29M]
  |  |  |  |  |  |  |  Branch (818:44): [True: 638k, False: 1.66M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  820|  1.60M|#define stbiw__sbgrow(a,n)  stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  816|  3.26M|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  814|  3.26M|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  940|       |
  941|  3.26M|      if (bestloc) {
  ------------------
  |  Branch (941:11): [True: 1.35M, False: 1.91M]
  ------------------
  942|       |         // "lazy matching" - check match at *next* byte, and if it's better, do cur byte as literal
  943|  1.35M|         h = stbiw__zhash(data+i+1)&(stbiw__ZHASH-1);
  ------------------
  |  |  891|  1.35M|#define stbiw__ZHASH   16384
  ------------------
  944|  1.35M|         hlist = hash_table[h];
  945|  1.35M|         n = stbiw__sbcount(hlist);
  ------------------
  |  |  823|  1.35M|#define stbiw__sbcount(a)        ((a) ? stbiw__sbn(a) : 0)
  |  |  ------------------
  |  |  |  |  816|  1.21M|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  814|  1.21M|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (823:35): [True: 1.21M, False: 134k]
  |  |  ------------------
  ------------------
  946|  11.3M|         for (j=0; j < n; ++j) {
  ------------------
  |  Branch (946:20): [True: 10.2M, False: 1.15M]
  ------------------
  947|  10.2M|            if (hlist[j]-data > i-32767) {
  ------------------
  |  Branch (947:17): [True: 8.75M, False: 1.46M]
  ------------------
  948|  8.75M|               int e = stbiw__zlib_countm(hlist[j], data+i+1, data_len-i-1);
  949|  8.75M|               if (e > best) { // if next match is better, bail on current match
  ------------------
  |  Branch (949:20): [True: 193k, False: 8.56M]
  ------------------
  950|   193k|                  bestloc = NULL;
  951|   193k|                  break;
  952|   193k|               }
  953|  8.75M|            }
  954|  10.2M|         }
  955|  1.35M|      }
  956|       |
  957|  3.26M|      if (bestloc) {
  ------------------
  |  Branch (957:11): [True: 1.15M, False: 2.10M]
  ------------------
  958|  1.15M|         int d = (int) (data+i - bestloc); // distance back
  959|  1.15M|         STBIW_ASSERT(d <= 32767 && best <= 258);
  ------------------
  |  |  245|  1.15M|#define STBIW_ASSERT(x) assert(x)
  ------------------
  960|  9.43M|         for (j=0; best > lengthc[j+1]-1; ++j);
  ------------------
  |  Branch (960:20): [True: 8.27M, False: 1.15M]
  ------------------
  961|  1.15M|         stbiw__zlib_huff(j+257);
  ------------------
  |  |  888|  1.15M|#define stbiw__zlib_huff(n)  ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n))
  |  |  ------------------
  |  |  |  |  884|  1.15M|#define stbiw__zlib_huff1(n)  stbiw__zlib_huffa(0x30 + (n), 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  882|      0|#define stbiw__zlib_huffa(b,c)  stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  881|      0|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  879|      0|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__zlib_huff(n)  ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n))
  |  |  ------------------
  |  |  |  |  885|  1.15M|#define stbiw__zlib_huff2(n)  stbiw__zlib_huffa(0x190 + (n)-144, 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  882|      0|#define stbiw__zlib_huffa(b,c)  stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  881|      0|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  879|      0|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__zlib_huff(n)  ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n))
  |  |  ------------------
  |  |  |  |  886|  1.15M|#define stbiw__zlib_huff3(n)  stbiw__zlib_huffa(0 + (n)-256,7)
  |  |  |  |  ------------------
  |  |  |  |  |  |  882|  1.00M|#define stbiw__zlib_huffa(b,c)  stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  881|  1.00M|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  879|  1.00M|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__zlib_huff(n)  ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n))
  |  |  ------------------
  |  |  |  |  887|   155k|#define stbiw__zlib_huff4(n)  stbiw__zlib_huffa(0xc0 + (n)-280,8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  882|   155k|#define stbiw__zlib_huffa(b,c)  stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  881|   155k|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  879|   155k|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (888:31): [True: 0, False: 1.15M]
  |  |  |  Branch (888:67): [True: 0, False: 1.15M]
  |  |  |  Branch (888:103): [True: 1.00M, False: 155k]
  |  |  ------------------
  ------------------
  962|  1.15M|         if (lengtheb[j]) stbiw__zlib_add(best - lengthc[j], lengtheb[j]);
  ------------------
  |  |  881|   254k|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  ------------------
  |  |  |  |  879|   254k|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  ------------------
  ------------------
  |  Branch (962:14): [True: 254k, False: 905k]
  ------------------
  963|  24.9M|         for (j=0; d > distc[j+1]-1; ++j);
  ------------------
  |  Branch (963:20): [True: 23.8M, False: 1.15M]
  ------------------
  964|  1.15M|         stbiw__zlib_add(stbiw__zlib_bitrev(j,5),5);
  ------------------
  |  |  881|  1.15M|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  ------------------
  |  |  |  |  879|  1.15M|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  ------------------
  ------------------
  965|  1.15M|         if (disteb[j]) stbiw__zlib_add(d - distc[j], disteb[j]);
  ------------------
  |  |  881|  1.14M|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  ------------------
  |  |  |  |  879|  1.14M|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  ------------------
  ------------------
  |  Branch (965:14): [True: 1.14M, False: 12.0k]
  ------------------
  966|  1.15M|         i += best;
  967|  2.10M|      } else {
  968|  2.10M|         stbiw__zlib_huffb(data[i]);
  ------------------
  |  |  889|  2.10M|#define stbiw__zlib_huffb(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : stbiw__zlib_huff2(n))
  |  |  ------------------
  |  |  |  |  884|  2.10M|#define stbiw__zlib_huff1(n)  stbiw__zlib_huffa(0x30 + (n), 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  882|  1.31M|#define stbiw__zlib_huffa(b,c)  stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  881|  1.31M|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  879|  1.31M|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__zlib_huffb(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : stbiw__zlib_huff2(n))
  |  |  ------------------
  |  |  |  |  885|  2.10M|#define stbiw__zlib_huff2(n)  stbiw__zlib_huffa(0x190 + (n)-144, 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  882|   794k|#define stbiw__zlib_huffa(b,c)  stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  881|   794k|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  879|   794k|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (889:31): [True: 1.31M, False: 794k]
  |  |  ------------------
  ------------------
  969|  2.10M|         ++i;
  970|  2.10M|      }
  971|  3.26M|   }
  972|       |   // write out final bytes
  973|  1.39k|   for (;i < data_len; ++i)
  ------------------
  |  Branch (973:10): [True: 716, False: 677]
  ------------------
  974|    716|      stbiw__zlib_huffb(data[i]);
  ------------------
  |  |  889|  1.39k|#define stbiw__zlib_huffb(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : stbiw__zlib_huff2(n))
  |  |  ------------------
  |  |  |  |  884|    716|#define stbiw__zlib_huff1(n)  stbiw__zlib_huffa(0x30 + (n), 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  882|    470|#define stbiw__zlib_huffa(b,c)  stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  881|    470|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  879|    470|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__zlib_huffb(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : stbiw__zlib_huff2(n))
  |  |  ------------------
  |  |  |  |  885|    716|#define stbiw__zlib_huff2(n)  stbiw__zlib_huffa(0x190 + (n)-144, 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  882|    246|#define stbiw__zlib_huffa(b,c)  stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  881|    246|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  879|    246|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (889:31): [True: 470, False: 246]
  |  |  ------------------
  ------------------
  975|    677|   stbiw__zlib_huff(256); // end of block
  ------------------
  |  |  888|    677|#define stbiw__zlib_huff(n)  ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n))
  |  |  ------------------
  |  |  |  |  884|    677|#define stbiw__zlib_huff1(n)  stbiw__zlib_huffa(0x30 + (n), 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  882|      0|#define stbiw__zlib_huffa(b,c)  stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  881|      0|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  879|      0|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__zlib_huff(n)  ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n))
  |  |  ------------------
  |  |  |  |  885|    677|#define stbiw__zlib_huff2(n)  stbiw__zlib_huffa(0x190 + (n)-144, 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  882|      0|#define stbiw__zlib_huffa(b,c)  stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  881|      0|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  879|      0|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__zlib_huff(n)  ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n))
  |  |  ------------------
  |  |  |  |  886|    677|#define stbiw__zlib_huff3(n)  stbiw__zlib_huffa(0 + (n)-256,7)
  |  |  |  |  ------------------
  |  |  |  |  |  |  882|    677|#define stbiw__zlib_huffa(b,c)  stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  881|    677|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  879|    677|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__zlib_huff(n)  ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n))
  |  |  ------------------
  |  |  |  |  887|      0|#define stbiw__zlib_huff4(n)  stbiw__zlib_huffa(0xc0 + (n)-280,8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  882|      0|#define stbiw__zlib_huffa(b,c)  stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  881|      0|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  879|      0|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (888:31): [Folded, False: 677]
  |  |  |  Branch (888:67): [Folded, False: 677]
  |  |  |  Branch (888:103): [True: 677, Folded]
  |  |  ------------------
  ------------------
  976|       |   // pad with 0 bits to byte boundary
  977|  3.02k|   while (bitcount)
  ------------------
  |  Branch (977:11): [True: 2.35k, False: 677]
  ------------------
  978|  2.35k|      stbiw__zlib_add(0,1);
  ------------------
  |  |  881|  3.02k|      (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
  |  |  ------------------
  |  |  |  |  879|  2.35k|#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
  |  |  ------------------
  ------------------
  979|       |
  980|  11.0M|   for (i=0; i < stbiw__ZHASH; ++i)
  ------------------
  |  |  891|  11.0M|#define stbiw__ZHASH   16384
  ------------------
  |  Branch (980:14): [True: 11.0M, False: 677]
  ------------------
  981|  11.0M|      (void) stbiw__sbfree(hash_table[i]);
  ------------------
  |  |  824|  11.0M|#define stbiw__sbfree(a)         ((a) ? STBIW_FREE(stbiw__sbraw(a)),0 : 0)
  |  |  ------------------
  |  |  |  |  230|   969k|#define STBIW_FREE(p)           free(p)
  |  |  ------------------
  |  |  |  Branch (824:35): [True: 969k, False: 10.1M]
  |  |  ------------------
  ------------------
  982|    677|   STBIW_FREE(hash_table);
  ------------------
  |  |  230|    677|#define STBIW_FREE(p)           free(p)
  ------------------
  983|       |
  984|       |   // store uncompressed instead if compression was worse
  985|    677|   if (stbiw__sbn(out) > data_len + 2 + ((data_len+32766)/32767)*5) {
  ------------------
  |  |  816|    677|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  ------------------
  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  ------------------
  ------------------
  |  Branch (985:8): [True: 9, False: 668]
  ------------------
  986|      9|      stbiw__sbn(out) = 2;  // truncate to DEFLATE 32K window and FLEVEL = 1
  ------------------
  |  |  816|      9|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  ------------------
  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  ------------------
  ------------------
  987|     18|      for (j = 0; j < data_len;) {
  ------------------
  |  Branch (987:19): [True: 9, False: 9]
  ------------------
  988|      9|         int blocklen = data_len - j;
  989|      9|         if (blocklen > 32767) blocklen = 32767;
  ------------------
  |  Branch (989:14): [True: 0, False: 9]
  ------------------
  990|      9|         stbiw__sbpush(out, data_len - j == blocklen); // BFINAL = ?, BTYPE = 0 -- no compression
  ------------------
  |  |  822|      9|#define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  819|      9|#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  818|      9|#define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  816|      9|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  815|      9|#define stbiw__sbm(a)   stbiw__sbraw(a)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (818:34): [True: 0, False: 9]
  |  |  |  |  |  |  |  Branch (818:44): [True: 0, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  820|      0|#define stbiw__sbgrow(a,n)  stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  816|      9|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  991|      9|         stbiw__sbpush(out, STBIW_UCHAR(blocklen)); // LEN
  ------------------
  |  |  822|      9|#define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  819|      9|#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  818|      9|#define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  816|      9|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  815|      9|#define stbiw__sbm(a)   stbiw__sbraw(a)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (818:34): [True: 0, False: 9]
  |  |  |  |  |  |  |  Branch (818:44): [True: 0, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  820|      0|#define stbiw__sbgrow(a,n)  stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  816|      9|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  992|      9|         stbiw__sbpush(out, STBIW_UCHAR(blocklen >> 8));
  ------------------
  |  |  822|      9|#define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  819|      9|#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  818|      9|#define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  816|      9|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  815|      9|#define stbiw__sbm(a)   stbiw__sbraw(a)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (818:34): [True: 0, False: 9]
  |  |  |  |  |  |  |  Branch (818:44): [True: 0, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  820|      0|#define stbiw__sbgrow(a,n)  stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  816|      9|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  993|      9|         stbiw__sbpush(out, STBIW_UCHAR(~blocklen)); // NLEN
  ------------------
  |  |  822|      9|#define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  819|      9|#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  818|      9|#define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  816|      9|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  815|      9|#define stbiw__sbm(a)   stbiw__sbraw(a)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (818:34): [True: 0, False: 9]
  |  |  |  |  |  |  |  Branch (818:44): [True: 0, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  820|      0|#define stbiw__sbgrow(a,n)  stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  816|      9|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  994|      9|         stbiw__sbpush(out, STBIW_UCHAR(~blocklen >> 8));
  ------------------
  |  |  822|      9|#define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  819|      9|#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  818|      9|#define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  816|      9|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  815|      9|#define stbiw__sbm(a)   stbiw__sbraw(a)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (818:34): [True: 0, False: 9]
  |  |  |  |  |  |  |  Branch (818:44): [True: 0, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  820|      0|#define stbiw__sbgrow(a,n)  stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  816|      9|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  995|      9|         memcpy(out+stbiw__sbn(out), data+j, blocklen);
  ------------------
  |  |  816|      9|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  ------------------
  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  ------------------
  ------------------
  996|      9|         stbiw__sbn(out) += blocklen;
  ------------------
  |  |  816|      9|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  ------------------
  |  |  |  |  814|      9|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  ------------------
  ------------------
  997|      9|         j += blocklen;
  998|      9|      }
  999|      9|   }
 1000|       |
 1001|    677|   {
 1002|       |      // compute adler32 on input
 1003|    677|      unsigned int s1=1, s2=0;
 1004|    677|      int blocklen = (int) (data_len % 5552);
 1005|    677|      j=0;
 1006|  10.2k|      while (j < data_len) {
  ------------------
  |  Branch (1006:14): [True: 9.57k, False: 677]
  ------------------
 1007|  50.5M|         for (i=0; i < blocklen; ++i) { s1 += data[j+i]; s2 += s1; }
  ------------------
  |  Branch (1007:20): [True: 50.4M, False: 9.57k]
  ------------------
 1008|  9.57k|         s1 %= 65521; s2 %= 65521;
 1009|  9.57k|         j += blocklen;
 1010|  9.57k|         blocklen = 5552;
 1011|  9.57k|      }
 1012|    677|      stbiw__sbpush(out, STBIW_UCHAR(s2 >> 8));
  ------------------
  |  |  822|    677|#define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  819|    677|#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  818|    677|#define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  816|    677|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  815|    677|#define stbiw__sbm(a)   stbiw__sbraw(a)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (818:34): [True: 0, False: 677]
  |  |  |  |  |  |  |  Branch (818:44): [True: 28, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  820|     28|#define stbiw__sbgrow(a,n)  stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  816|    677|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1013|    677|      stbiw__sbpush(out, STBIW_UCHAR(s2));
  ------------------
  |  |  822|    677|#define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  819|    677|#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  818|    677|#define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  816|    677|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  815|    677|#define stbiw__sbm(a)   stbiw__sbraw(a)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (818:34): [True: 0, False: 677]
  |  |  |  |  |  |  |  Branch (818:44): [True: 29, False: 648]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  820|     29|#define stbiw__sbgrow(a,n)  stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  816|    677|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1014|    677|      stbiw__sbpush(out, STBIW_UCHAR(s1 >> 8));
  ------------------
  |  |  822|    677|#define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  819|    677|#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  818|    677|#define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  816|    677|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  815|    677|#define stbiw__sbm(a)   stbiw__sbraw(a)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (818:34): [True: 0, False: 677]
  |  |  |  |  |  |  |  Branch (818:44): [True: 29, False: 648]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  820|     29|#define stbiw__sbgrow(a,n)  stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  816|    677|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1015|    677|      stbiw__sbpush(out, STBIW_UCHAR(s1));
  ------------------
  |  |  822|    677|#define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  819|    677|#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  818|    677|#define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  816|    677|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  815|    677|#define stbiw__sbm(a)   stbiw__sbraw(a)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (818:34): [True: 0, False: 677]
  |  |  |  |  |  |  |  Branch (818:44): [True: 26, False: 651]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  820|     26|#define stbiw__sbgrow(a,n)  stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  816|    677|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1016|    677|   }
 1017|    677|   *out_len = stbiw__sbn(out);
  ------------------
  |  |  816|    677|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  ------------------
  |  |  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  ------------------
  ------------------
 1018|       |   // make returned pointer freeable
 1019|    677|   STBIW_MEMMOVE(stbiw__sbraw(out), out, *out_len);
  ------------------
  |  |  239|    677|#define STBIW_MEMMOVE(a,b,sz) memmove(a,b,sz)
  ------------------
 1020|    677|   return (unsigned char *) stbiw__sbraw(out);
  ------------------
  |  |  814|    677|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  ------------------
 1021|    677|#endif // STBIW_ZLIB_COMPRESS
 1022|    677|}
stbi_write_png_to_mem:
 1129|    677|{
 1130|    677|   int force_filter = stbi_write_force_png_filter;
 1131|    677|   int ctype[5] = { -1, 0, 4, 2, 6 };
 1132|    677|   unsigned char sig[8] = { 137,80,78,71,13,10,26,10 };
 1133|    677|   unsigned char *out,*o, *filt, *zlib;
 1134|    677|   signed char *line_buffer;
 1135|    677|   int j,zlen;
 1136|       |
 1137|    677|   if (stride_bytes == 0)
  ------------------
  |  Branch (1137:8): [True: 0, False: 677]
  ------------------
 1138|      0|      stride_bytes = x * n;
 1139|       |
 1140|    677|   if (force_filter >= 5) {
  ------------------
  |  Branch (1140:8): [True: 0, False: 677]
  ------------------
 1141|      0|      force_filter = -1;
 1142|      0|   }
 1143|       |
 1144|    677|   filt = (unsigned char *) STBIW_MALLOC((x*n+1) * y); if (!filt) return 0;
  ------------------
  |  |  228|    677|#define STBIW_MALLOC(sz)        malloc(sz)
  ------------------
  |  Branch (1144:60): [True: 0, False: 677]
  ------------------
 1145|    677|   line_buffer = (signed char *) STBIW_MALLOC(x * n); if (!line_buffer) { STBIW_FREE(filt); return 0; }
  ------------------
  |  |  228|    677|#define STBIW_MALLOC(sz)        malloc(sz)
  ------------------
                 line_buffer = (signed char *) STBIW_MALLOC(x * n); if (!line_buffer) { STBIW_FREE(filt); return 0; }
  ------------------
  |  |  230|      0|#define STBIW_FREE(p)           free(p)
  ------------------
  |  Branch (1145:59): [True: 0, False: 677]
  ------------------
 1146|  88.5k|   for (j=0; j < y; ++j) {
  ------------------
  |  Branch (1146:14): [True: 87.8k, False: 677]
  ------------------
 1147|  87.8k|      int filter_type;
 1148|  87.8k|      if (force_filter > -1) {
  ------------------
  |  Branch (1148:11): [True: 0, False: 87.8k]
  ------------------
 1149|      0|         filter_type = force_filter;
 1150|      0|         stbiw__encode_png_line((unsigned char*)(pixels), stride_bytes, x, y, j, n, force_filter, line_buffer);
 1151|  87.8k|      } else { // Estimate the best filter by running through all of them:
 1152|  87.8k|         int best_filter = 0, best_filter_val = 0x7fffffff, est, i;
 1153|   527k|         for (filter_type = 0; filter_type < 5; filter_type++) {
  ------------------
  |  Branch (1153:32): [True: 439k, False: 87.8k]
  ------------------
 1154|   439k|            stbiw__encode_png_line((unsigned char*)(pixels), stride_bytes, x, y, j, n, filter_type, line_buffer);
 1155|       |
 1156|       |            // Estimate the entropy of the line using this filter; the less, the better.
 1157|   439k|            est = 0;
 1158|   252M|            for (i = 0; i < x*n; ++i) {
  ------------------
  |  Branch (1158:25): [True: 252M, False: 439k]
  ------------------
 1159|   252M|               est += abs((signed char) line_buffer[i]);
 1160|   252M|            }
 1161|   439k|            if (est < best_filter_val) {
  ------------------
  |  Branch (1161:17): [True: 192k, False: 246k]
  ------------------
 1162|   192k|               best_filter_val = est;
 1163|   192k|               best_filter = filter_type;
 1164|   192k|            }
 1165|   439k|         }
 1166|  87.8k|         if (filter_type != best_filter) {  // If the last iteration already got us the best filter, don't redo it
  ------------------
  |  Branch (1166:14): [True: 87.8k, False: 0]
  ------------------
 1167|  87.8k|            stbiw__encode_png_line((unsigned char*)(pixels), stride_bytes, x, y, j, n, best_filter, line_buffer);
 1168|  87.8k|            filter_type = best_filter;
 1169|  87.8k|         }
 1170|  87.8k|      }
 1171|       |      // when we get here, filter_type contains the filter type, and line_buffer contains the data
 1172|  87.8k|      filt[j*(x*n+1)] = (unsigned char) filter_type;
 1173|  87.8k|      STBIW_MEMMOVE(filt+j*(x*n+1)+1, line_buffer, x*n);
  ------------------
  |  |  239|  87.8k|#define STBIW_MEMMOVE(a,b,sz) memmove(a,b,sz)
  ------------------
 1174|  87.8k|   }
 1175|    677|   STBIW_FREE(line_buffer);
  ------------------
  |  |  230|    677|#define STBIW_FREE(p)           free(p)
  ------------------
 1176|    677|   zlib = stbi_zlib_compress(filt, y*( x*n+1), &zlen, stbi_write_png_compression_level);
 1177|    677|   STBIW_FREE(filt);
  ------------------
  |  |  230|    677|#define STBIW_FREE(p)           free(p)
  ------------------
 1178|    677|   if (!zlib) return 0;
  ------------------
  |  Branch (1178:8): [True: 0, False: 677]
  ------------------
 1179|       |
 1180|       |   // each tag requires 12 bytes of overhead
 1181|    677|   out = (unsigned char *) STBIW_MALLOC(8 + 12+13 + 12+zlen + 12);
  ------------------
  |  |  228|    677|#define STBIW_MALLOC(sz)        malloc(sz)
  ------------------
 1182|    677|   if (!out) return 0;
  ------------------
  |  Branch (1182:8): [True: 0, False: 677]
  ------------------
 1183|    677|   *out_len = 8 + 12+13 + 12+zlen + 12;
 1184|       |
 1185|    677|   o=out;
 1186|    677|   STBIW_MEMMOVE(o,sig,8); o+= 8;
  ------------------
  |  |  239|    677|#define STBIW_MEMMOVE(a,b,sz) memmove(a,b,sz)
  ------------------
 1187|    677|   stbiw__wp32(o, 13); // header length
  ------------------
  |  | 1074|    677|#define stbiw__wp32(data,v) stbiw__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v));
  |  |  ------------------
  |  |  |  | 1073|    677|#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1188|    677|   stbiw__wptag(o, "IHDR");
  ------------------
  |  | 1075|    677|#define stbiw__wptag(data,s) stbiw__wpng4(data, s[0],s[1],s[2],s[3])
  |  |  ------------------
  |  |  |  | 1073|    677|#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1189|    677|   stbiw__wp32(o, x);
  ------------------
  |  | 1074|    677|#define stbiw__wp32(data,v) stbiw__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v));
  |  |  ------------------
  |  |  |  | 1073|    677|#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1190|    677|   stbiw__wp32(o, y);
  ------------------
  |  | 1074|    677|#define stbiw__wp32(data,v) stbiw__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v));
  |  |  ------------------
  |  |  |  | 1073|    677|#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1191|    677|   *o++ = 8;
 1192|    677|   *o++ = STBIW_UCHAR(ctype[n]);
  ------------------
  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  ------------------
 1193|    677|   *o++ = 0;
 1194|    677|   *o++ = 0;
 1195|    677|   *o++ = 0;
 1196|    677|   stbiw__wpcrc(&o,13);
 1197|       |
 1198|    677|   stbiw__wp32(o, zlen);
  ------------------
  |  | 1074|    677|#define stbiw__wp32(data,v) stbiw__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v));
  |  |  ------------------
  |  |  |  | 1073|    677|#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1199|    677|   stbiw__wptag(o, "IDAT");
  ------------------
  |  | 1075|    677|#define stbiw__wptag(data,s) stbiw__wpng4(data, s[0],s[1],s[2],s[3])
  |  |  ------------------
  |  |  |  | 1073|    677|#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1200|    677|   STBIW_MEMMOVE(o, zlib, zlen);
  ------------------
  |  |  239|    677|#define STBIW_MEMMOVE(a,b,sz) memmove(a,b,sz)
  ------------------
 1201|    677|   o += zlen;
 1202|    677|   STBIW_FREE(zlib);
  ------------------
  |  |  230|    677|#define STBIW_FREE(p)           free(p)
  ------------------
 1203|    677|   stbiw__wpcrc(&o, zlen);
 1204|       |
 1205|    677|   stbiw__wp32(o,0);
  ------------------
  |  | 1074|    677|#define stbiw__wp32(data,v) stbiw__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v));
  |  |  ------------------
  |  |  |  | 1073|    677|#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1206|    677|   stbiw__wptag(o, "IEND");
  ------------------
  |  | 1075|    677|#define stbiw__wptag(data,s) stbiw__wpng4(data, s[0],s[1],s[2],s[3])
  |  |  ------------------
  |  |  |  | 1073|    677|#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|    677|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1207|    677|   stbiw__wpcrc(&o,0);
 1208|       |
 1209|    677|   STBIW_ASSERT(o == out + *out_len);
  ------------------
  |  |  245|    677|#define STBIW_ASSERT(x) assert(x)
  ------------------
 1210|       |
 1211|    677|   return out;
 1212|    677|}
OgreSTBICodec.cpp:_ZL14stbiw__sbgrowfPPvii:
  827|  1.61M|{
  828|  1.61M|   int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1;
  ------------------
  |  |  815|   643k|#define stbiw__sbm(a)   stbiw__sbraw(a)[0]
  |  |  ------------------
  |  |  |  |  814|   643k|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  ------------------
  ------------------
  |  Branch (828:12): [True: 643k, False: 970k]
  ------------------
  829|  1.61M|   void *p = STBIW_REALLOC_SIZED(*arr ? stbiw__sbraw(*arr) : 0, *arr ? (stbiw__sbm(*arr)*itemsize + sizeof(int)*2) : 0, itemsize * m + sizeof(int)*2);
  ------------------
  |  |  234|  1.61M|#define STBIW_REALLOC_SIZED(p,oldsz,newsz) STBIW_REALLOC(p,newsz)
  |  |  ------------------
  |  |  |  |  229|  3.22M|#define STBIW_REALLOC(p,newsz)  realloc(p,newsz)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (229:41): [True: 643k, False: 970k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  830|  1.61M|   STBIW_ASSERT(p);
  ------------------
  |  |  245|  1.61M|#define STBIW_ASSERT(x) assert(x)
  ------------------
  831|  1.61M|   if (p) {
  ------------------
  |  Branch (831:8): [True: 1.61M, False: 0]
  ------------------
  832|  1.61M|      if (!*arr) ((int *) p)[1] = 0;
  ------------------
  |  Branch (832:11): [True: 970k, False: 643k]
  ------------------
  833|  1.61M|      *arr = (void *) ((int *) p + 2);
  834|  1.61M|      stbiw__sbm(*arr) = m;
  ------------------
  |  |  815|  1.61M|#define stbiw__sbm(a)   stbiw__sbraw(a)[0]
  |  |  ------------------
  |  |  |  |  814|  1.61M|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  ------------------
  ------------------
  835|  1.61M|   }
  836|  1.61M|   return *arr;
  837|  1.61M|}
OgreSTBICodec.cpp:_ZL18stbiw__zlib_flushfPhPjPi:
  840|  5.83M|{
  841|  11.1M|   while (*bitcount >= 8) {
  ------------------
  |  Branch (841:11): [True: 5.34M, False: 5.83M]
  ------------------
  842|  5.34M|      stbiw__sbpush(data, STBIW_UCHAR(*bitbuffer));
  ------------------
  |  |  822|  5.34M|#define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  819|  5.34M|#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  818|  5.34M|#define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  816|  5.34M|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|  5.34M|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define stbiw__sbneedgrow(a,n)  ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  815|  5.34M|#define stbiw__sbm(a)   stbiw__sbraw(a)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  814|  5.34M|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (818:34): [True: 0, False: 5.34M]
  |  |  |  |  |  |  |  Branch (818:44): [True: 4.23k, False: 5.33M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  820|  4.23k|#define stbiw__sbgrow(a,n)  stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define stbiw__sbpush(a, v)      (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
  |  |  ------------------
  |  |  |  |  816|  5.34M|#define stbiw__sbn(a)   stbiw__sbraw(a)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  814|  5.34M|#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  843|  5.34M|      *bitbuffer >>= 8;
  844|  5.34M|      *bitcount -= 8;
  845|  5.34M|   }
  846|  5.83M|   return data;
  847|  5.83M|}
OgreSTBICodec.cpp:_ZL12stbiw__zhashPh:
  868|  4.62M|{
  869|  4.62M|   stbiw_uint32 hash = data[0] + (data[1] << 8) + (data[2] << 16);
  870|  4.62M|   hash ^= hash << 3;
  871|  4.62M|   hash += hash >> 5;
  872|  4.62M|   hash ^= hash << 4;
  873|  4.62M|   hash += hash >> 17;
  874|  4.62M|   hash ^= hash << 25;
  875|  4.62M|   hash += hash >> 6;
  876|  4.62M|   return hash;
  877|  4.62M|}
OgreSTBICodec.cpp:_ZL18stbiw__zlib_countmPhS_i:
  860|  19.4M|{
  861|  19.4M|   int i;
  862|   880M|   for (i=0; i < limit && i < 258; ++i)
  ------------------
  |  Branch (862:14): [True: 880M, False: 4.07k]
  |  Branch (862:27): [True: 877M, False: 2.63M]
  ------------------
  863|   877M|      if (a[i] != b[i]) break;
  ------------------
  |  Branch (863:11): [True: 16.8M, False: 861M]
  ------------------
  864|  19.4M|   return i;
  865|  19.4M|}
OgreSTBICodec.cpp:_ZL18stbiw__zlib_bitrevii:
  850|  4.42M|{
  851|  4.42M|   int res=0;
  852|  36.1M|   while (codebits--) {
  ------------------
  |  Branch (852:11): [True: 31.7M, False: 4.42M]
  ------------------
  853|  31.7M|      res = (res << 1) | (code & 1);
  854|  31.7M|      code >>= 1;
  855|  31.7M|   }
  856|  4.42M|   return res;
  857|  4.42M|}
OgreSTBICodec.cpp:_ZL22stbiw__encode_png_linePhiiiiiiPa:
 1093|   527k|{
 1094|   527k|   static int mapping[] = { 0,1,2,3,4 };
 1095|   527k|   static int firstmap[] = { 0,1,0,5,6 };
 1096|   527k|   int *mymap = (y != 0) ? mapping : firstmap;
  ------------------
  |  Branch (1096:17): [True: 523k, False: 4.06k]
  ------------------
 1097|   527k|   int i;
 1098|   527k|   int type = mymap[filter_type];
 1099|   527k|   unsigned char *z = pixels + stride_bytes * (stbi__flip_vertically_on_write ? height-1-y : y);
  ------------------
  |  Branch (1099:48): [True: 0, False: 527k]
  ------------------
 1100|   527k|   int signed_stride = stbi__flip_vertically_on_write ? -stride_bytes : stride_bytes;
  ------------------
  |  Branch (1100:24): [True: 0, False: 527k]
  ------------------
 1101|       |
 1102|   527k|   if (type==0) {
  ------------------
  |  Branch (1102:8): [True: 119k, False: 407k]
  ------------------
 1103|   119k|      memcpy(line_buffer, z, width*n);
 1104|   119k|      return;
 1105|   119k|   }
 1106|       |
 1107|       |   // first loop isn't optimized since it's just one pixel
 1108|  1.53M|   for (i = 0; i < n; ++i) {
  ------------------
  |  Branch (1108:16): [True: 1.12M, False: 407k]
  ------------------
 1109|  1.12M|      switch (type) {
  ------------------
  |  Branch (1109:15): [True: 1.12M, False: 0]
  ------------------
 1110|   264k|         case 1: line_buffer[i] = z[i]; break;
  ------------------
  |  Branch (1110:10): [True: 264k, False: 860k]
  ------------------
 1111|   348k|         case 2: line_buffer[i] = z[i] - z[i-signed_stride]; break;
  ------------------
  |  Branch (1111:10): [True: 348k, False: 776k]
  ------------------
 1112|   240k|         case 3: line_buffer[i] = z[i] - (z[i-signed_stride]>>1); break;
  ------------------
  |  Branch (1112:10): [True: 240k, False: 884k]
  ------------------
 1113|   267k|         case 4: line_buffer[i] = (signed char) (z[i] - stbiw__paeth(0,z[i-signed_stride],0)); break;
  ------------------
  |  Branch (1113:10): [True: 267k, False: 857k]
  ------------------
 1114|  1.83k|         case 5: line_buffer[i] = z[i]; break;
  ------------------
  |  Branch (1114:10): [True: 1.83k, False: 1.12M]
  ------------------
 1115|  1.73k|         case 6: line_buffer[i] = z[i]; break;
  ------------------
  |  Branch (1115:10): [True: 1.73k, False: 1.12M]
  ------------------
 1116|  1.12M|      }
 1117|  1.12M|   }
 1118|   407k|   switch (type) {
  ------------------
  |  Branch (1118:12): [True: 407k, False: 0]
  ------------------
 1119|  53.4M|      case 1: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - z[i-n]; break;
  ------------------
  |  Branch (1119:7): [True: 96.8k, False: 310k]
  |  Branch (1119:25): [True: 53.3M, False: 96.8k]
  ------------------
 1120|  73.2M|      case 2: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - z[i-signed_stride]; break;
  ------------------
  |  Branch (1120:7): [True: 124k, False: 283k]
  |  Branch (1120:25): [True: 73.1M, False: 124k]
  ------------------
 1121|  50.2M|      case 3: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - ((z[i-n] + z[i-signed_stride])>>1); break;
  ------------------
  |  Branch (1121:7): [True: 88.1k, False: 319k]
  |  Branch (1121:25): [True: 50.1M, False: 88.1k]
  ------------------
 1122|  57.2M|      case 4: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - stbiw__paeth(z[i-n], z[i-signed_stride], z[i-signed_stride-n]); break;
  ------------------
  |  Branch (1122:7): [True: 96.9k, False: 310k]
  |  Branch (1122:25): [True: 57.1M, False: 96.9k]
  ------------------
 1123|   222k|      case 5: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - (z[i-n]>>1); break;
  ------------------
  |  Branch (1123:7): [True: 741, False: 406k]
  |  Branch (1123:25): [True: 222k, False: 741]
  ------------------
 1124|   215k|      case 6: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break;
  ------------------
  |  Branch (1124:7): [True: 677, False: 407k]
  |  Branch (1124:25): [True: 214k, False: 677]
  ------------------
 1125|   407k|   }
 1126|   407k|}
OgreSTBICodec.cpp:_ZL12stbiw__paethiii:
 1084|  57.6M|{
 1085|  57.6M|   int p = a + b - c, pa = abs(p-a), pb = abs(p-b), pc = abs(p-c);
 1086|  57.6M|   if (pa <= pb && pa <= pc) return STBIW_UCHAR(a);
  ------------------
  |  |  248|  49.7M|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  ------------------
  |  Branch (1086:8): [True: 50.0M, False: 7.56M]
  |  Branch (1086:20): [True: 49.7M, False: 326k]
  ------------------
 1087|  7.89M|   if (pb <= pc) return STBIW_UCHAR(b);
  ------------------
  |  |  248|  7.24M|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  ------------------
  |  Branch (1087:8): [True: 7.24M, False: 644k]
  ------------------
 1088|   644k|   return STBIW_UCHAR(c);
  ------------------
  |  |  248|   644k|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  ------------------
 1089|  7.89M|}
OgreSTBICodec.cpp:_ZL12stbiw__wpcrcPPhi:
 1078|  2.03k|{
 1079|  2.03k|   unsigned int crc = stbiw__crc32(*data - len - 4, len+4);
 1080|  2.03k|   stbiw__wp32(*data, crc);
  ------------------
  |  | 1074|  2.03k|#define stbiw__wp32(data,v) stbiw__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v));
  |  |  ------------------
  |  |  |  | 1073|  2.03k|#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|  2.03k|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|  2.03k|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|  2.03k|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  |  |               #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  248|  2.03k|#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1081|  2.03k|}
OgreSTBICodec.cpp:_ZL12stbiw__crc32Phi:
 1025|  2.03k|{
 1026|       |#ifdef STBIW_CRC32
 1027|       |    return STBIW_CRC32(buffer, len);
 1028|       |#else
 1029|  2.03k|   static unsigned int crc_table[256] =
 1030|  2.03k|   {
 1031|  2.03k|      0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
 1032|  2.03k|      0x0eDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
 1033|  2.03k|      0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
 1034|  2.03k|      0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
 1035|  2.03k|      0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
 1036|  2.03k|      0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
 1037|  2.03k|      0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
 1038|  2.03k|      0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
 1039|  2.03k|      0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
 1040|  2.03k|      0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
 1041|  2.03k|      0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
 1042|  2.03k|      0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
 1043|  2.03k|      0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
 1044|  2.03k|      0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
 1045|  2.03k|      0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
 1046|  2.03k|      0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
 1047|  2.03k|      0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
 1048|  2.03k|      0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
 1049|  2.03k|      0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
 1050|  2.03k|      0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
 1051|  2.03k|      0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
 1052|  2.03k|      0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
 1053|  2.03k|      0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
 1054|  2.03k|      0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
 1055|  2.03k|      0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
 1056|  2.03k|      0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
 1057|  2.03k|      0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
 1058|  2.03k|      0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
 1059|  2.03k|      0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
 1060|  2.03k|      0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
 1061|  2.03k|      0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
 1062|  2.03k|      0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
 1063|  2.03k|   };
 1064|       |
 1065|  2.03k|   unsigned int crc = ~0u;
 1066|  2.03k|   int i;
 1067|  5.36M|   for (i=0; i < len; ++i)
  ------------------
  |  Branch (1067:14): [True: 5.36M, False: 2.03k]
  ------------------
 1068|  5.36M|      crc = (crc >> 8) ^ crc_table[buffer[i] ^ (crc & 0xff)];
 1069|  2.03k|   return ~crc;
 1070|  2.03k|#endif
 1071|  2.03k|}

LLVMFuzzerTestOneInput:
   32|  4.69k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   33|  4.69k|  static int initialized = 0;
   34|  4.69k|  if (initialized == 0) {
  ------------------
  |  Branch (34:7): [True: 1, False: 4.69k]
  ------------------
   35|      1|    Ogre::LogManager *logMgr = new Ogre::LogManager();
   36|      1|    logMgr->createLog("OgreTest.log", true, false);
   37|      1|    logMgr->setMinLogLevel(Ogre::LML_TRIVIAL);
   38|      1|    initialized = 1;
   39|       |
   40|      1|    Ogre::Root root("");
   41|      1|    Ogre::STBIImageCodec::startup();
   42|      1|  }
   43|       |
   44|  4.69k|  char filename[256];
   45|  4.69k|  sprintf(filename, "/tmp/libfuzzer-%d.png", getpid());
   46|  4.69k|  FILE *fp = fopen(filename, "wb");
   47|  4.69k|  if (!fp) {
  ------------------
  |  Branch (47:7): [True: 0, False: 4.69k]
  ------------------
   48|      0|    return 0;
   49|      0|  }
   50|  4.69k|  fwrite(data, size, 1, fp);
   51|  4.69k|  fclose(fp);
   52|       |
   53|       |  // Write an empty config file.
   54|  4.69k|  char file_to_load[256];
   55|  4.69k|  char file_to_save[256];
   56|  4.69k|  sprintf(file_to_load, "/tmp/config-%d.cfg", getpid());
   57|  4.69k|  sprintf(file_to_save, "/tmp/ftosave-%d.png", getpid());
   58|  4.69k|  FILE *fp2 = fopen(file_to_load, "wb");
   59|  4.69k|  if (!fp2) {
  ------------------
  |  Branch (59:7): [True: 0, False: 4.69k]
  ------------------
   60|      0|    return 0;
   61|      0|  }
   62|  4.69k|  fwrite(" ", 1, 1, fp2);
   63|  4.69k|  fclose(fp2);
   64|       |
   65|  4.69k|  Ogre::ResourceGroupManager mgr;
   66|  4.69k|  try {
   67|  4.69k|    Ogre::STBIImageCodec::startup();
   68|  4.69k|    Ogre::ConfigFile cf;
   69|  4.69k|    cf.load(file_to_load);
   70|  4.69k|    std::ifstream file1(filename, std::ios::in | std::ios::binary);
   71|  4.69k|    Ogre::DataStreamPtr data1 =
   72|  4.69k|        Ogre::DataStreamPtr(OGRE_NEW Ogre::FileStreamDataStream(&file1, false));
  ------------------
  |  |  201|  4.69k|#   define OGRE_NEW new 
  ------------------
   73|  4.69k|    Ogre::Image img;
   74|  4.69k|    img.load(data1, "png");
   75|       |    // Limit re-encoding to reasonably-sized images to avoid fuzzer timeouts
   76|       |    // during PNG compression of very large bitmaps.
   77|  4.69k|    if (img.getWidth() <= 1024 && img.getHeight() <= 1024)
  ------------------
  |  Branch (77:9): [True: 910, False: 3.78k]
  |  Branch (77:35): [True: 677, False: 233]
  ------------------
   78|    677|      img.save(file_to_save);
   79|  4.69k|  } catch (Ogre::Exception&) {
   80|  3.55k|  }
   81|       |
   82|  4.69k|  Ogre::STBIImageCodec::shutdown();
   83|  4.69k|  unlink(filename);
   84|  4.69k|  unlink(file_to_load);
   85|  4.69k|  return 0;
   86|  4.69k|}

