//
// cocos2d::CCDictMaker::startElement from 0xd78b28 to 0xd7915c (1588 bytes)
//
// 2 xrefs:
// > ??> @ 0x77bf0
// > ??> @ 0x152d8a0
//
// This function is hookable on this platform (idp: arm, 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 13:08:05 +0000
//
__int64 __fastcall cocos2d::CCDictMaker::startElement(
cocos2d::CCDictMaker *this,
void *a2,
const char *a3,
const char **a4)
{
size_t v6; // x0
size_t v7; // x20
char *v8; // x3
int v9; // w22
int v10; // w24
size_t v11; // x4
unsigned __int64 v13; // x0
int v14; // w20
cocos2d::CCDictionary *v15; // x20
__int64 v16; // x0
char *v17; // x23
int v18; // w0
unsigned __int64 v19; // x0
const char *v20; // x1
__int64 v21; // x26
size_t v22; // x0
__int64 v23; // x2
__int64 v24; // x4
__int64 v25; // x5
__int64 v26; // x3
__int64 v27; // x1
unsigned __int64 v28; // x0
__int64 v29; // x2
__int64 v30; // x0
cocos2d::CCArray *v31; // x20
__int64 v32; // x0
int v33; // w0
const char *v34; // x1
__int64 v35; // x25
size_t v36; // x0
char *v37; // x23
__int64 v38; // x2
__int64 v39; // x4
__int64 v40; // x5
__int64 v41; // x3
__int64 v42; // x1
unsigned __int64 v43; // x0
__int64 v44; // x2
__int64 v45; // x0
unsigned __int64 v46; // x0
char *v47; // [xsp+58h] [xbp+58h]
char *v48; // [xsp+58h] [xbp+58h]
__int64 v49; // [xsp+68h] [xbp+68h] BYREF
size_t v50; // [xsp+70h] [xbp+70h]
void *v51; // [xsp+78h] [xbp+78h]
__int64 v52; // [xsp+80h] [xbp+80h] BYREF
__int64 v53; // [xsp+88h] [xbp+88h]
void *v54; // [xsp+90h] [xbp+90h]
v49 = 0;
v50 = 0;
v51 = nullptr;
v6 = strlen(a3);
v7 = v6;
if ( v6 > 0x16 )
{
v13 = (v6 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v49 = v13 | 1;
v8 = (char *)operator new(v13);
v51 = v8;
v50 = v7;
LABEL_15:
*((_BYTE *)memcpy(v8, a3, v7) + v7) = 0;
v9 = (unsigned __int8)v49;
v10 = v49 & 1;
if ( v10 )
goto LABEL_4;
goto LABEL_16;
}
LOBYTE(v49) = 2 * v6;
v8 = (char *)&v49 + 1;
if ( v6 )
goto LABEL_15;
BYTE1(v49) = 0;
v9 = (unsigned __int8)v49;
v10 = v49 & 1;
if ( v10 )
{
LABEL_4:
v11 = v50;
if ( v50 != 4 )
{
if ( v50 != 3 )
goto LABEL_6;
LABEL_43:
if ( !(unsigned int)std::string::compare((__int64)&v49, 0, 0xFFFFFFFFFFFFFFFFLL, "key", 3u) )
{
*((_DWORD *)this + 34) = 1;
goto LABEL_11;
}
v14 = v9 >> 1;
if ( v10 )
{
v11 = v50;
LABEL_6:
if ( v11 != 7 )
goto LABEL_7;
LABEL_49:
if ( !(unsigned int)std::string::compare((__int64)&v49, 0, 0xFFFFFFFFFFFFFFFFLL, "integer", 7u) )
{
*((_DWORD *)this + 34) = 3;
goto LABEL_11;
}
v14 = v9 >> 1;
if ( v10 )
{
v11 = v50;
LABEL_7:
if ( v11 != 4 )
goto LABEL_8;
LABEL_41:
if ( !(unsigned int)std::string::compare((__int64)&v49, 0, 0xFFFFFFFFFFFFFFFFLL, "real", 4u) )
{
*((_DWORD *)this + 34) = 4;
goto LABEL_11;
}
v14 = v9 >> 1;
if ( v10 )
{
v11 = v50;
LABEL_8:
if ( v11 != 6 )
{
LABEL_9:
if ( v11 != 5 || (unsigned int)std::string::compare((__int64)&v49, 0, 0xFFFFFFFFFFFFFFFFLL, "array", 5u) )
{
*((_DWORD *)this + 34) = 0;
goto LABEL_11;
}
*((_DWORD *)this + 34) = 6;
v31 = (cocos2d::CCArray *)operator new(0x40u);
cocos2d::CCArray::CCArray(v31);
*((_QWORD *)this + 18) = v31;
if ( *((_DWORD *)this + 2) == 2 && !*((_QWORD *)this + 2) )
{
*((_QWORD *)this + 2) = v31;
cocos2d::CCObject::retain((__int64)v31);
v31 = *((cocos2d::CCArray **)this + 18);
}
v32 = *((_QWORD *)this + 30);
if ( v32 )
{
v33 = *(_DWORD *)(*(_QWORD *)(*((_QWORD *)this + 26)
+ 8 * ((unsigned __int64)(*((_QWORD *)this + 29) - 1LL + v32) >> 10))
+ 4 * ((*((_QWORD *)this + 29) - 1LL + v32) & 0x3FF));
if ( v33 != 2 )
{
v37 = (char *)this + 152;
if ( v33 == 6 )
{
v46 = *((_QWORD *)this + 23) - 1LL + *((_QWORD *)this + 24);
cocos2d::CCArray::addObject(
*(cocos2d::CCArray **)(*(_QWORD *)(*((_QWORD *)this + 20) + 8 * (v46 >> 9)) + 8 * (v46 & 0x1FF)),
v31);
v31 = *((cocos2d::CCArray **)this + 18);
}
goto LABEL_63;
}
v34 = (char *)this + 89;
v35 = *((_QWORD *)this + 4);
if ( (*((_BYTE *)this + 88) & 1) != 0 )
v34 = *((const char **)this + 13);
v48 = (char *)v34;
v52 = 0;
v53 = 0;
v54 = nullptr;
v36 = strlen(v34);
std::string::__init(&v52, v48, v36);
cocos2d::CCDictionary::setObject(v35, v31, (__int64)&v52);
if ( (v52 & 1) != 0 )
operator delete(v54);
v31 = *((cocos2d::CCArray **)this + 18);
}
v37 = (char *)this + 152;
LABEL_63:
cocos2d::CCObject::release(v31);
std::deque::push_back((__int64)this + 200, (_DWORD *)this + 34);
v38 = *((_QWORD *)this + 20);
v39 = 0;
v40 = *((_QWORD *)this + 21);
v41 = (v40 - v38) >> 3;
if ( v41 )
v39 = (v41 << 9) - 1;
v42 = *((_QWORD *)this + 24);
v43 = v42 + *((_QWORD *)v37 + 4);
if ( v43 == v39 )
{
std::deque::__add_back_capacity((char **)v37);
v42 = *((_QWORD *)this + 24);
v38 = *((_QWORD *)this + 20);
v40 = *((_QWORD *)this + 21);
v43 = v42 + *((_QWORD *)v37 + 4);
}
if ( v40 != v38 )
{
v44 = *(_QWORD *)(v38 + 8 * (v43 >> 9));
v45 = v43 & 0x1FF;
if ( v44 + 8 * v45 )
{
*(_QWORD *)(v44 + 8 * v45) = *((_QWORD *)this + 18);
v42 = *((_QWORD *)this + 24);
}
}
*((_QWORD *)this + 24) = v42 + 1;
goto LABEL_11;
}
goto LABEL_51;
}
LABEL_20:
if ( v14 != 6 )
{
LABEL_21:
v11 = v14;
goto LABEL_9;
}
LABEL_51:
if ( !(unsigned int)std::string::compare((__int64)&v49, 0, 0xFFFFFFFFFFFFFFFFLL, "string", 6u) )
{
*((_DWORD *)this + 34) = 5;
goto LABEL_11;
}
v14 = v9 >> 1;
if ( v10 )
{
v11 = v50;
goto LABEL_9;
}
goto LABEL_21;
}
LABEL_19:
if ( v14 != 4 )
goto LABEL_20;
goto LABEL_41;
}
LABEL_18:
if ( v14 != 7 )
goto LABEL_19;
goto LABEL_49;
}
if ( (unsigned int)std::string::compare((__int64)&v49, 0, 0xFFFFFFFFFFFFFFFFLL, "dict", 4u) )
goto LABEL_41;
goto LABEL_23;
}
LABEL_16:
v14 = v9 >> 1;
if ( v9 >> 1 != 4 )
{
if ( v14 != 3 )
goto LABEL_18;
goto LABEL_43;
}
if ( (unsigned int)std::string::compare((__int64)&v49, 0, 0xFFFFFFFFFFFFFFFFLL, "dict", 4u) )
goto LABEL_41;
LABEL_23:
v15 = (cocos2d::CCDictionary *)operator new(0x48u);
cocos2d::CCDictionary::CCDictionary(v15);
*((_QWORD *)this + 4) = v15;
if ( *((_DWORD *)this + 2) == 1 && !*((_QWORD *)this + 3) )
{
*((_QWORD *)this + 3) = v15;
cocos2d::CCObject::retain((__int64)v15);
v15 = *((cocos2d::CCDictionary **)this + 4);
}
v16 = *((_QWORD *)this + 30);
*((_DWORD *)this + 34) = 2;
v17 = (char *)this + 40;
if ( v16 )
{
v18 = *(_DWORD *)(*(_QWORD *)(*((_QWORD *)this + 26)
+ 8 * ((unsigned __int64)(*((_QWORD *)this + 29) - 1LL + v16) >> 10))
+ 4 * ((*((_QWORD *)this + 29) - 1LL + v16) & 0x3FF));
if ( v18 == 6 )
{
v17 = (char *)this + 40;
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 18), v15);
v15 = *((cocos2d::CCDictionary **)this + 4);
}
else
{
v17 = (char *)this + 40;
if ( v18 == 2 )
{
v19 = *((_QWORD *)this + 9) - 1LL + *((_QWORD *)this + 10);
v20 = (char *)this + 89;
v21 = *(_QWORD *)(*(_QWORD *)(*((_QWORD *)this + 6) + 8 * (v19 >> 9)) + 8 * (v19 & 0x1FF));
if ( (*((_BYTE *)this + 88) & 1) != 0 )
v20 = *((const char **)this + 13);
v47 = (char *)v20;
v52 = 0;
v53 = 0;
v54 = nullptr;
v22 = strlen(v20);
std::string::__init(&v52, v47, v22);
cocos2d::CCDictionary::setObject(v21, v15, (__int64)&v52);
if ( (v52 & 1) != 0 )
operator delete(v54);
v15 = *((cocos2d::CCDictionary **)this + 4);
}
}
}
cocos2d::CCObject::release(v15);
std::deque::push_back((__int64)this + 200, (_DWORD *)this + 34);
v23 = *((_QWORD *)this + 6);
v24 = 0;
v25 = *((_QWORD *)this + 7);
v26 = (v25 - v23) >> 3;
if ( v26 )
v24 = (v26 << 9) - 1;
v27 = *((_QWORD *)this + 10);
v28 = v27 + *((_QWORD *)v17 + 4);
if ( v28 == v24 )
{
std::deque::__add_back_capacity((char **)v17);
v27 = *((_QWORD *)this + 10);
v23 = *((_QWORD *)this + 6);
v25 = *((_QWORD *)this + 7);
v28 = v27 + *((_QWORD *)v17 + 4);
}
if ( v23 != v25 )
{
v29 = *(_QWORD *)(v23 + 8 * (v28 >> 9));
v30 = v28 & 0x1FF;
if ( v29 + 8 * v30 )
{
*(_QWORD *)(v29 + 8 * v30) = *((_QWORD *)this + 4);
v27 = *((_QWORD *)this + 10);
}
}
*((_QWORD *)this + 10) = v27 + 1;
LABEL_11:
if ( v10 )
operator delete(v51);
return _stack_chk_guard;
}