//
// cocos2d::CCTextureCache::snapshotTextures from 0x1005ecb20 to 0x1005ecc68 (328 bytes)
//
// 0 xrefs:
//
// 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 *__fastcall cocos2d::CCTextureCache::snapshotTextures(cocos2d::CCTextureCache *a1)
{
double v1; // xmm0_8
cocos2d::CCDictionary *v2; // r15
cocos2d::CCDictionary *m_pTextures; // rax
cocos2d::CCDictElement *m_pElements; // r14
cocos2d::CCDictElement *next; // rbx
size_t v6; // rax
size_t v7; // r13
cocos2d::CCDictElement *v8; // r12
char *v9; // rbx
size_t v10; // r15
cocos2d::CCDictionary *v12; // [rsp+0h] [rbp-50h]
cocos2d::CCObject *m_pObject; // [rsp+8h] [rbp-48h]
_QWORD __dst[2]; // [rsp+10h] [rbp-40h] BYREF
void *__p; // [rsp+20h] [rbp-30h]
v2 = (cocos2d::CCDictionary *)operator new(0x48u);
cocos2d::CCDictionary::CCDictionary((__int64)v2);
m_pTextures = a1->m_pTextures;
if ( m_pTextures )
{
m_pElements = m_pTextures->m_pElements;
if ( m_pElements )
{
m_pObject = m_pElements->m_pObject;
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
v6 = strlen(m_pElements->m_szKey);
if ( v6 > 0xFFFFFFFFFFFFFFF7LL )
LABEL_16:
sub_100006BF0(v1);
v7 = v6;
v12 = v2;
while ( 1 )
{
v8 = next;
if ( v7 >= 0x17 )
break;
LOBYTE(__dst[0]) = 2 * v7;
v9 = (char *)__dst + 1;
if ( v7 )
goto LABEL_11;
LABEL_12:
v9[v7] = 0;
cocos2d::CCDictionary::setObject_1((__int64)v2, m_pObject, (char *)__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
if ( !v8 )
goto LABEL_17;
m_pObject = v8->m_pObject;
next = (cocos2d::CCDictElement *)v8->hh.next;
v7 = strlen(v8->m_szKey);
m_pElements = v8;
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_16;
}
v10 = (v7 | 7) + 1;
if ( (v7 | 7) == 0x17 )
v10 = 26;
v9 = (char *)operator new(v10);
__p = v9;
__dst[0] = v10 + 1;
v2 = v12;
__dst[1] = v7;
LABEL_11:
memmove(v9, m_pElements, v7);
goto LABEL_12;
}
}
LABEL_17:
cocos2d::CCObject::autorelease(v2);
return v2;
}