//
// DS_Dictionary::getArrayForKey from 0xb46ec8 to 0xb47024 (348 bytes)
//
// 8 xrefs:
// > GameLevelManager::dataLoaded @ 0x739f38
// > GameLevelManager::dataLoaded @ 0x73a51c
// > GJRewardItem::dataLoaded @ 0x7ad6f4
// > LocalLevelManager::dataLoaded @ 0x7e9730
// > LocalLevelManager::dataLoaded @ 0x7e9c40
// > DS_Dictionary::getDictForKey @ 0xb4698c
// > DS_Dictionary::getObjectForKey @ 0xb46d5c
// > ??> @ 0x7cec0
//
// 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 *DS_Dictionary::getArrayForKey(DS_Dictionary *a1, const char *a2, bool a3)
{
DS_Dictionary *v3; // x21
cocos2d::CCArray *v4; // x22
signed int NumKeys; // w23
int i; // w19
cocos2d::CCObject *ObjectForKey; // x1
cocos2d::CCObject *v8; // x2
char *v9; // x0
unsigned int *v10; // x1
int v11; // w2
const char *v13; // [xsp+70h] [xbp+70h] BYREF
v3 = a1;
if ( !a3 )
{
a1 = (DS_Dictionary *)DS_Dictionary::stepIntoSubDictWithKey(a1, a2);
if ( !(_BYTE)a1 )
return cocos2d::CCArray::create((cocos2d::CCArray *)a1);
}
v4 = cocos2d::CCArray::create((cocos2d::CCArray *)a1);
DS_Dictionary::removeKey(v3, "_isArr");
NumKeys = DS_Dictionary::getNumKeys(v3);
if ( NumKeys > 0 )
{
for ( i = 0; i != NumKeys; ++i )
{
DS_Dictionary::getKey((__int64 *)&v13, v3, i);
ObjectForKey = DS_Dictionary::getObjectForKey(v3, v13);
if ( ObjectForKey )
cocos2d::CCArray::addObject(v4, (cocos2d::_ccArray *)ObjectForKey, v8);
v9 = (char *)(v13 - 24);
if ( v13 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v10 = (unsigned int *)(v13 - 8);
do
v11 = __ldaxr(v10);
while ( __stlxr(v11 - 1, v10) );
}
else
{
v11 = *((_DWORD *)v13 - 2);
*((_DWORD *)v13 - 2) = v11 - 1;
}
if ( v11 <= 0 )
operator delete(v9);
}
}
}
DS_Dictionary::stepOutOfSubDict(v3);
return v4;
}