//
// DS_Dictionary::setVec2ForKey from 0x180020b00 to 0x180020e5e (862 bytes)
//
// 3 xrefs:
// > DS_Dictionary::setVec2ForKey @ 0x180020af3
// > ??> @ 0x18014cf68
// > ??> @ 0x1801b8e48
//
// 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:28 +0000
//
// Hidden C++ exception states: #wind=4
void __fastcall DS_Dictionary::setVec2ForKey(DS_Dictionary *this, char *a2, const struct cocos2d::CCPoint *a3, char a4)
{
const char *v7; // rbx
const char *v8; // r8
char *v9; // rax
const char *v10; // r8
_QWORD *v11; // rax
__int64 v12; // rax
char v13; // di
_QWORD *v14; // rax
_QWORD *v15; // rbx
const char *v16; // r8
__int64 v17; // rax
__int64 v18; // rax
_BYTE *v19; // rcx
__int64 v20; // [rsp+30h] [rbp-D0h] BYREF
_BYTE v21[8]; // [rsp+38h] [rbp-C8h] BYREF
_QWORD v22[2]; // [rsp+40h] [rbp-C0h] BYREF
_QWORD v23[2]; // [rsp+50h] [rbp-B0h] BYREF
void *v24; // [rsp+60h] [rbp-A0h] BYREF
void **v25; // [rsp+68h] [rbp-98h] BYREF
_BYTE v26[96]; // [rsp+70h] [rbp-90h] BYREF
__int64 v27; // [rsp+D0h] [rbp-30h]
int v28; // [rsp+D8h] [rbp-28h]
_BYTE v29[104]; // [rsp+E8h] [rbp-18h] BYREF
void *Block; // [rsp+150h] [rbp+50h] BYREF
unsigned __int64 v31; // [rsp+168h] [rbp+68h]
v23[0] = &unk_1800ECC50;
v24 = &unk_1800ECC58;
std::ios::ios(v29);
LODWORD(v20) = 1;
std::iostream::iostream(v23, &v25, 0);
*(_QWORD *)((char *)v23 + *(int *)(v23[0] + 4LL)) = &std::basic_stringstream,std::allocator>::`vftable';
*(_DWORD *)((char *)&v22[1] + *(int *)(v23[0] + 4LL) + 4) = *(_DWORD *)(v23[0] + 4LL) - 152;
std::streambuf::streambuf(&v25);
v25 = &std::stringbuf::`vftable';
v27 = 0;
v28 = 0;
sub_1800155E0((__int64)&v24, "{");
std::ostream::operator<<(&v24);
sub_1800155E0((__int64)&v24, ",");
std::ostream::operator<<(&v24);
sub_1800155E0((__int64)&v24, "}");
DS_Dictionary::removeKey(this, a2);
cocos2d::CCThread::CCThread((cocos2d::CCThread *)v22);
v7 = "k";
if ( !a4 )
goto LABEL_9;
v8 = "k";
if ( *((_BYTE *)this + 232) )
v8 = "key";
sub_180082A40(*((_QWORD *)this + 27) - 8LL, &v20, v8);
if ( sub_1800823F0(&v20) )
{
while ( 1 )
{
v9 = (char *)sub_180082AC0(&v20);
if ( !sub_180018D00(v9, a2) )
break;
v10 = "k";
if ( *((_BYTE *)this + 232) )
v10 = "key";
v20 = *(_QWORD *)sub_180084A40(&v20, v21, v10);
if ( !sub_1800823F0(&v20) )
goto LABEL_9;
}
if ( *((_BYTE *)this + 232) )
v7 = "key";
v11 = (_QWORD *)sub_180084060(*((_QWORD *)this + 27) - 8LL, v21, v7, &v20);
}
else
{
LABEL_9:
if ( *((_BYTE *)this + 232) )
v7 = "key";
v11 = (_QWORD *)sub_180082790(*((_QWORD *)this + 27) - 8LL, v21, v7);
}
v22[0] = *v11;
v12 = sub_180082820(v22, v21, 3);
sub_180088520(v12, a2);
v13 = *((_BYTE *)this + 232);
v14 = (_QWORD *)sub_180021920(v23, &Block);
v15 = v14;
if ( v14[3] > 0xFu )
v15 = (_QWORD *)*v14;
v16 = "s";
if ( v13 )
v16 = "string";
v17 = sub_180083ED0(*((_QWORD *)this + 27) - 8LL, v21, v16, v22);
v18 = sub_180082820(v17, &v20, 3);
sub_180088520(v18, v15);
if ( v31 > 0xF )
{
v19 = Block;
if ( v31 + 1 >= 0x1000 )
{
v19 = *((_BYTE **)Block - 1);
if ( (unsigned __int64)((_BYTE *)Block - v19 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v19);
}
*(_QWORD *)((char *)v23 + *(int *)(v23[0] + 4LL)) = &std::basic_stringstream,std::allocator>::`vftable';
*(_DWORD *)((char *)&v22[1] + *(int *)(v23[0] + 4LL) + 4) = *(_DWORD *)(v23[0] + 4LL) - 152;
sub_1800174E0((__int64)&v25);
std::iostream::~iostream>(v26);
std::ios::~ios>(v29);
}