//
// cocos2d::CCTextureCache::snapshotTextures from 0xb33e38 to 0xb33f64 (300 bytes)
//
// 1 xrefs:
// > ??> @ 0xa8720
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
cocos2d::CCDictionary *cocos2d::CCTextureCache::snapshotTextures(cocos2d::CCTextureCache *a1)
{
cocos2d::CCDictionary *v2; // x21
cocos2d::CCDictionary *m_pTextures; // x0
cocos2d::CCDictElement *m_pElements; // x1
cocos2d::CCDictElement *i; // x19
cocos2d::CCObject *m_pObject; // x27
char *v7; // x0
unsigned int *v8; // x1
int v9; // w2
const char *v11; // [xsp+70h] [xbp+70h] BYREF
v2 = (cocos2d::CCDictionary *)operator new(0x48u);
cocos2d::CCDictionary::CCDictionary(v2);
m_pTextures = a1->m_pTextures;
if ( m_pTextures )
{
m_pElements = m_pTextures->m_pElements;
if ( m_pElements )
{
for ( i = (cocos2d::CCDictElement *)m_pElements->hh.next; ; i = (cocos2d::CCDictElement *)i->hh.next )
{
m_pObject = m_pElements->m_pObject;
sub_D153B8((int)&v11, (char *)m_pElements);
cocos2d::CCDictionary::setObject((__int64)v2, m_pObject, &v11);
v7 = (char *)(v11 - 24);
if ( v11 - 24 == (const char *)&qword_124B6B0 )
goto LABEL_5;
if ( &pthread_create )
{
v8 = (unsigned int *)(v11 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *((_DWORD *)v11 - 2);
*((_DWORD *)v11 - 2) = v9 - 1;
}
if ( v9 > 0 )
{
LABEL_5:
if ( !i )
break;
}
else
{
operator delete(v7);
if ( !i )
break;
}
m_pElements = i;
}
}
}
cocos2d::CCObject::autorelease(v2);
return v2;
}