//
// cocos2d::CCDictionary::setObjectUnSafe from 0x18000bfc0 to 0x18000c479 (1209 bytes)
//
// 5 xrefs:
// > cocos2d::CCDictionary::copyWithZone @ 0x180009e12
// > cocos2d::CCDictionary::setObject @ 0x18000b902
// > ??> @ 0x18014cf68
// > ??> @ 0x1801b7e64
// > ??> @ 0x1801b7e70
//
// 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:20 +0000
//
void __fastcall cocos2d::CCDictionary::setObjectUnSafe(
cocos2d::CCDictionary *this,
struct cocos2d::CCObject *a2,
__int64 a3)
{
__int64 v6; // rax
int v7; // ebp
__int64 v8; // rdi
void ***v9; // rsi
__int64 v10; // rax
__int64 v11; // rbx
_OWORD *v12; // rcx
void **v13; // rbx
void *v14; // rcx
int v15; // edx
int v16; // ecx
unsigned int v17; // edx
unsigned int v18; // r8d
int v19; // ecx
unsigned int v20; // edx
unsigned int v21; // r8d
int v22; // ecx
unsigned int v23; // ecx
__int64 v24; // rdx
__int64 v25; // r8
__int64 v26; // rcx
__int64 v27; // rcx
char *v28; // rax
char *v29; // r14
void **v30; // rdi
unsigned int v31; // ebx
unsigned int v32; // r11d
void **i; // rax
__int64 v34; // r9
__int64 v35; // r10
__int64 v36; // r8
__int64 v37; // rax
void **v38; // rcx
cocos2d::CCObject::retain(a2);
v6 = sub_1800E4AC0(0x148u);
v7 = 0;
v8 = v6;
if ( v6 )
{
*(_BYTE *)v6 = 0;
*(_QWORD *)(v6 + 256) = a3;
*(_QWORD *)(v6 + 264) = a2;
*(_OWORD *)(v6 + 272) = 0;
*(_OWORD *)(v6 + 288) = 0;
*(_OWORD *)(v6 + 304) = 0;
*(_QWORD *)(v6 + 320) = 0;
}
else
{
v8 = 0;
}
v9 = (void ***)(v8 + 272);
*(_DWORD *)(v8 + 320) = 8;
*(_QWORD *)(v8 + 288) = 0;
*(_QWORD *)(v8 + 312) = v8 + 256;
v10 = *((_QWORD *)this + 7);
if ( v10 )
{
*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(v10 + 272) + 24LL) + 16LL) = v8;
*(_QWORD *)(v8 + 280) = *(_QWORD *)(*(_QWORD *)(*((_QWORD *)this + 7) + 272LL) + 24LL)
- *(_QWORD *)(*(_QWORD *)(*((_QWORD *)this + 7) + 272LL) + 32LL);
*(_QWORD *)(*(_QWORD *)(*((_QWORD *)this + 7) + 272LL) + 24LL) = v9;
}
else
{
*((_QWORD *)this + 7) = v8;
*(_QWORD *)(v8 + 280) = 0;
v11 = *((_QWORD *)this + 7);
*(_QWORD *)(v11 + 272) = malloc(0x40u);
v12 = *(_OWORD **)(*((_QWORD *)this + 7) + 272LL);
if ( !v12 )
goto LABEL_14;
*v12 = 0;
v12[1] = 0;
v12[2] = 0;
v12[3] = 0;
*(_QWORD *)(*(_QWORD *)(*((_QWORD *)this + 7) + 272LL) + 24LL) = *((_QWORD *)this + 7) + 272LL;
*(_DWORD *)(*(_QWORD *)(*((_QWORD *)this + 7) + 272LL) + 8LL) = 32;
*(_DWORD *)(*(_QWORD *)(*((_QWORD *)this + 7) + 272LL) + 12LL) = 5;
*(_QWORD *)(*(_QWORD *)(*((_QWORD *)this + 7) + 272LL) + 32LL) = 272;
v13 = *(void ***)(*((_QWORD *)this + 7) + 272LL);
*v13 = malloc(0x200u);
v14 = **(void ***)(*((_QWORD *)this + 7) + 272LL);
if ( !v14 )
LABEL_14:
exit(-1);
memset(v14, 0, 0x200u);
*(_DWORD *)(*(_QWORD *)(*((_QWORD *)this + 7) + 272LL) + 56LL) = -1609490463;
}
++*(_DWORD *)(*(_QWORD *)(*((_QWORD *)this + 7) + 272LL) + 16LL);
*v9 = *(void ***)(*((_QWORD *)this + 7) + 272LL);
*(_DWORD *)(v8 + 324) = -17973513;
v15 = ((*(unsigned __int8 *)(v8 + 261)
+ ((*(unsigned __int8 *)(v8 + 262) + (*(unsigned __int8 *)(v8 + 263) << 8)) << 8)) << 8)
- 1640531527
+ *(unsigned __int8 *)(v8 + 260);
v16 = (*(unsigned __int8 *)(v8 + 256)
+ ((*(unsigned __int8 *)(v8 + 257)
+ ((*(unsigned __int8 *)(v8 + 258) + (*(unsigned __int8 *)(v8 + 259) << 8)) << 8)) << 8)
- v15
- 1622558014)
^ 0x7F76D;
v17 = (v16 << 8) ^ (v15 - v16 + 17973513);
v18 = (v17 >> 13) ^ (-17973513 - v17 - v16);
v19 = (v18 >> 12) ^ (v16 - v18 - v17);
v20 = (v19 << 16) ^ (v17 - v19 - v18);
v21 = (v20 >> 5) ^ (v18 - v20 - v19);
v22 = (v21 >> 3) ^ (v19 - v21 - v20);
v23 = (((v22 << 10) ^ (v20 - v22 - v21)) >> 15) ^ (v21 - ((v22 << 10) ^ (v20 - v22 - v21)) - v22);
*(_DWORD *)(v8 + 324) = v23;
v24 = *(_QWORD *)(*((_QWORD *)this + 7) + 272LL);
v25 = 16LL * (v23 & (*(_DWORD *)(v24 + 8) - 1));
++*(_DWORD *)(v25 + *(_QWORD *)v24 + 8);
*(_QWORD *)(v8 + 304) = *(_QWORD *)(v25 + **(_QWORD **)(*((_QWORD *)this + 7) + 272LL));
*(_QWORD *)(v8 + 296) = 0;
v26 = *(_QWORD *)(v25 + **(_QWORD **)(*((_QWORD *)this + 7) + 272LL));
if ( v26 )
*(_QWORD *)(v26 + 24) = v9;
*(_QWORD *)(v25 + **(_QWORD **)(*((_QWORD *)this + 7) + 272LL)) = v9;
v27 = **(_QWORD **)(*((_QWORD *)this + 7) + 272LL);
if ( *(_DWORD *)(v27 + v25 + 8) >= (unsigned int)(10 * (*(_DWORD *)(v27 + v25 + 12) + 1))
&& *((_DWORD *)*v9 + 13) != 1 )
{
v28 = (char *)malloc(16LL * (unsigned int)(2 * *((_DWORD *)*v9 + 2)));
v29 = v28;
if ( !v28 )
goto LABEL_14;
v30 = *v9;
v31 = 2 * *((_DWORD *)*v9 + 2);
memset(v28, 0, 16LL * v31);
v32 = 0;
*((_DWORD *)v30 + 10) = (((v31 - 1) & (_DWORD)v30[2]) != 0) + (*((_DWORD *)v30 + 4) >> (*((_BYTE *)v30 + 12) + 1));
*((_DWORD *)*v9 + 11) = 0;
for ( i = *v9; v32 < *((_DWORD *)*v9 + 2); ++v32 )
{
v34 = *((_QWORD *)*i + 2 * v32);
if ( v34 )
{
do
{
v35 = *(_QWORD *)(v34 + 32);
v36 = 16LL * (*(_DWORD *)(v34 + 52) & (unsigned int)(2 * *((_DWORD *)*v9 + 2) - 1));
if ( ++*(_DWORD *)&v29[v36 + 8] > *((_DWORD *)*v9 + 10) )
{
++*((_DWORD *)*v9 + 11);
*(_DWORD *)&v29[v36 + 12] = *(_DWORD *)&v29[v36 + 8] / *((_DWORD *)*v9 + 10);
}
*(_QWORD *)(v34 + 24) = 0;
*(_QWORD *)(v34 + 32) = *(_QWORD *)&v29[v36];
v37 = *(_QWORD *)&v29[v36];
if ( v37 )
*(_QWORD *)(v37 + 24) = v34;
*(_QWORD *)&v29[v36] = v34;
v34 = v35;
}
while ( v35 );
}
i = *v9;
}
free(*i);
*((_DWORD *)*v9 + 2) *= 2;
++*((_DWORD *)*v9 + 3);
**v9 = v29;
v38 = *v9;
if ( *((_DWORD *)*v9 + 11) > *((_DWORD *)*v9 + 4) >> 1 )
v7 = *((_DWORD *)v38 + 12) + 1;
*((_DWORD *)v38 + 12) = v7;
if ( *((_DWORD *)*v9 + 12) > 1u )
*((_DWORD *)*v9 + 13) = 1;
}
}