//
// DS_Dictionary::setObjectForKey from 0x18001f4e0 to 0x18001f694 (436 bytes)
//
// 4 xrefs:
// > DS_Dictionary::setArrayForKey @ 0x18001e9cc
// > DS_Dictionary::setDictForKey @ 0x18001ef13
// > ??> @ 0x18014cf68
// > ??> @ 0x1801b8dc4
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:21:27 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall DS_Dictionary::setObjectForKey(DS_Dictionary *this, const char *a2, struct cocos2d::CCObject *a3)
{
const char *CString; // rbx
size_t v7; // rax
void *v8; // rcx
__int128 v9; // [rsp+30h] [rbp-68h] BYREF
__int128 v10; // [rsp+40h] [rbp-58h]
void *Block[2]; // [rsp+58h] [rbp-40h] BYREF
__int128 v12; // [rsp+68h] [rbp-30h]
if ( _RTDynamicCast(a3, 0, &cocos2d::CCObject `RTTI Type Descriptor', &cocos2d::CCString `RTTI Type Descriptor', 0) )
{
CString = cocos2d::CCString::getCString(a3);
v9 = 0;
v10 = 0u;
v7 = strlen(CString);
sub_18000CEF0(&v9, CString, v7);
*(_OWORD *)Block = v9;
v12 = v10;
DS_Dictionary::setStringForKey(this, a2, Block, 0);
if ( *((_QWORD *)&v12 + 1) > 0xFu )
{
v8 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v12 + 1) + 1LL) >= 0x1000 )
{
v8 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v8);
}
}
else if ( _RTDynamicCast(
a3,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::CCDictionary `RTTI Type Descriptor',
0) )
{
DS_Dictionary::setDictForKey(this, a2, a3);
}
else if ( _RTDynamicCast(
a3,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::CCArray `RTTI Type Descriptor',
0) )
{
DS_Dictionary::setArrayForKey(this, a2, a3);
}
else if ( (*(unsigned __int8 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)a3 + 48LL))(a3) )
{
DS_Dictionary::setSubDictForKey(this, a2, 0, 1);
(*(void (__fastcall **)(struct cocos2d::CCObject *, DS_Dictionary *))(*(_QWORD *)a3 + 40LL))(a3, this);
DS_Dictionary::stepOutOfSubDict(this);
}
}