//
// DS_Dictionary::setObjectForKey from 0x100162558 to 0x1001626e8 (400 bytes)
//
// 2 xrefs:
// > DS_Dictionary::setArrayForKey @ 0x100162510
// > DS_Dictionary::setDictForKey @ 0x100162ac4
//
// 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 __fastcall DS_Dictionary::setObjectForKey(DS_Dictionary *a1, const char *a2, cocos2d::CCObject *a3)
{
char *CString; // x0
std::__vector_base
::pointer end; // x8
void *v8[2]; // [xsp+8h] [xbp-58h] BYREF
__int64 v9; // [xsp+18h] [xbp-48h]
void *__p[2]; // [xsp+20h] [xbp-40h] BYREF
__int64 v11; // [xsp+30h] [xbp-30h]
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_100009900(v8, CString);
*(_OWORD *)__p = *(_OWORD *)v8;
v11 = v9;
v8[1] = nullptr;
v9 = 0;
v8[0] = nullptr;
DS_Dictionary::setStringForKey((__int64)a1, a2, (__int64 *)__p, 0);
if ( SHIBYTE(v11) < 0 )
operator delete(__p[0]);
if ( SHIBYTE(v9) < 0 )
operator delete(v8[0]);
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 ( ((unsigned int (__fastcall *)(cocos2d::CCObject *))a3->canEncode)(a3) )
{
DS_Dictionary::setSubDictForKey(a1, a2, 0, 1);
((void (__fastcall *)(cocos2d::CCObject *, DS_Dictionary *))a3->encodeWithCoder)(a3, a1);
end = a1->dictTree.__end_;
if ( (unsigned __int64)((char *)end - (char *)a1->dictTree.__begin_) >= 9 )
a1->dictTree.__end_ = end - 1;
}
}