//
// DS_Dictionary::setObjectForKey from 0xb464d8 to 0xb466fc (548 bytes)
//
// 3 xrefs:
// > DS_Dictionary::setArrayForKey @ 0xb46498
// > DS_Dictionary::setDictForKey @ 0xb467b8
// > ??> @ 0x57c18
//
// 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
//
void DS_Dictionary::setObjectForKey(DS_Dictionary *a1, const char *a2, cocos2d::CCObject *a3)
{
char *CString; // x0
char *v7; // x0
char *v8; // x23
unsigned int *v9; // x22
int v10; // w0
unsigned int *v11; // x1
int v12; // w2
const char *v13; // [xsp+58h] [xbp+58h] BYREF
const char *v14; // [xsp+60h] [xbp+60h] BYREF
if ( a3 )
{
if ( _dynamic_cast(
a3,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCString,
0) )
{
CString = (char *)cocos2d::CCString::getCString((cocos2d::CCString *)a3);
sub_D153B8((int)&v13, CString);
v14 = v13;
v13 = &byte_124B6C8;
DS_Dictionary::setStringForKey((__int64)a1, a2, &v14);
v7 = (char *)(v14 - 24);
if ( v14 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v11 = (unsigned int *)(v14 - 8);
do
v12 = __ldaxr(v11);
while ( __stlxr(v12 - 1, v11) );
}
else
{
v12 = *((_DWORD *)v14 - 2);
*((_DWORD *)v14 - 2) = v12 - 1;
}
if ( v12 <= 0 )
operator delete(v7);
}
v8 = (char *)(v13 - 24);
if ( v13 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v9 = (unsigned int *)(v13 - 8);
do
v10 = __ldaxr(v9);
while ( __stlxr(v10 - 1, v9) );
}
else
{
v10 = *((_DWORD *)v13 - 2);
*((_DWORD *)v13 - 2) = v10 - 1;
}
if ( v10 <= 0 )
operator delete(v8);
}
return;
}
if ( _dynamic_cast(
a3,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCDictionary,
0) )
{
DS_Dictionary::setDictForKey(a1, a2, (cocos2d::CCDictionary *)a3);
return;
}
if ( _dynamic_cast(
a3,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCArray,
0) )
{
DS_Dictionary::setArrayForKey(a1, a2, (cocos2d::CCArray *)a3);
return;
}
}
if ( a3->canEncode(a3) )
{
DS_Dictionary::setSubDictForKey(a1, a2, 0, 1u);
a3->encodeWithCoder(a3, a1);
DS_Dictionary::stepOutOfSubDict(a1);
}
}