//
// cocos2d::CCDictionary::allKeysForObject from 0xacf568 to 0xacf6b4 (332 bytes)
//
// 2 xrefs:
// > cocos2d::CCTextureCache::removeTexture @ 0xb342e4
// > ??> @ 0x50cd0
//
// 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::CCArray *cocos2d::CCDictionary::allKeysForObject(cocos2d::CCDictionary *a1, cocos2d::CCObject *a2)
{
cocos2d::CCArray *v4; // x0
cocos2d::CCArray *v5; // x22
cocos2d::CCDictionary::CCDictType m_eDictType; // w0
bool v7; // zf
cocos2d::CCArray *result; // x0
cocos2d::CCDictElement *m_pElements; // x1
cocos2d::CCDictElement *next; // x19
cocos2d::CCString *v11; // x21
cocos2d::CCDictElement *v12; // x21
cocos2d::CCDictElement *v13; // x19
cocos2d::CCObject *v14; // x0
std::intptr_t m_iKey; // x21
cocos2d::CCObject *v16; // x23
char *v17; // [xsp+48h] [xbp+48h]
v4 = (cocos2d::CCArray *)cocos2d::CCDictionary::count(a1);
if ( (int)v4 <= 0 )
return nullptr;
v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(v4);
m_eDictType = a1->m_eDictType;
if ( m_eDictType == kCCDictStr )
{
m_pElements = a1->m_pElements;
if ( m_pElements )
{
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
if ( m_pElements->m_pObject == a2 )
goto LABEL_9;
while ( next )
{
while ( 1 )
{
m_pElements = next;
next = (cocos2d::CCDictElement *)next->hh.next;
if ( m_pElements->m_pObject != a2 )
break;
LABEL_9:
v17 = (char *)m_pElements;
v11 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v11, v17);
cocos2d::CCArray::addObject(v5, v11);
cocos2d::CCObject::release(v11);
if ( !next )
return v5;
}
}
}
return v5;
}
v7 = m_eDictType == kCCDictInt;
result = v5;
if ( v7 )
{
v12 = a1->m_pElements;
if ( v12 )
{
v13 = (cocos2d::CCDictElement *)v12->hh.next;
if ( v12->m_pObject == a2 )
goto LABEL_15;
while ( v13 )
{
v12 = v13;
v13 = (cocos2d::CCDictElement *)v13->hh.next;
if ( v12->m_pObject == a2 )
{
LABEL_15:
v14 = (cocos2d::CCObject *)operator new(0x40u);
m_iKey = v12->m_iKey;
v16 = v14;
cocos2d::CCObject::CCObject(v14);
LODWORD(v16[1].__vftable) = m_iKey;
v16->__vftable = (cocos2d::CCObject_vtbl *)&off_1148430;
cocos2d::CCArray::addObject(v5, v16);
cocos2d::CCObject::release(v16);
}
}
return v5;
}
}
return result;
}