//
// GJSmartTemplate::dataLoaded from 0xb11624 to 0xb1192c (776 bytes)
//
// 2 xrefs:
// > GJSmartTemplate::createWithCoder @ 0xb11948
// > ??> @ 0xe5a98
//
// 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:01:28 +0000
//
__int64 __fastcall GJSmartTemplate::dataLoaded(GJSmartTemplate *this, DS_Dictionary *a2)
{
size_t v4; // x3
cocos2d::CCObject *DictForKey; // x0
cocos2d::CCDictionary *v6; // x19
cocos2d::CCObject *v7; // x1
unsigned int v8; // w23
cocos2d::CCArray *v9; // x25
cocos2d::CCString *v10; // x0
const char *CString; // x0
size_t v12; // x0
__int64 v13; // x0
unsigned int *v14; // x0
_QWORD *v15; // x20
_QWORD *i; // x21
__int64 *v17; // x0
char *v18; // x1
size_t v19; // x2
char *v21; // [xsp+68h] [xbp+68h]
__int64 v22; // [xsp+78h] [xbp+78h] BYREF
size_t v23; // [xsp+80h] [xbp+80h]
void *v24; // [xsp+88h] [xbp+88h]
__int64 v25; // [xsp+90h] [xbp+90h] BYREF
size_t v26; // [xsp+98h] [xbp+98h]
void *v27; // [xsp+A0h] [xbp+A0h]
*((_DWORD *)this + 48) = DS_Dictionary::getIntegerForKey(a2, "1");
DS_Dictionary::getStringForKey(&v25, a2, &byte_120A098);
if ( (*((_BYTE *)this + 144) & 1) != 0 )
{
**((_BYTE **)this + 20) = 0;
*((_QWORD *)this + 19) = 0;
}
else
{
*((_BYTE *)this + 145) = 0;
*((_BYTE *)this + 144) = 0;
}
std::string::reserve((__int64 *)this + 18, 0);
v4 = v26;
*((_QWORD *)this + 18) = v25;
*((_QWORD *)this + 19) = v4;
*((_QWORD *)this + 20) = v27;
*((_BYTE *)this + 138) = (unsigned int)DS_Dictionary::getIntegerForKey(a2, &byte_11BCA00) != 0;
*((_BYTE *)this + 136) = (unsigned int)DS_Dictionary::getIntegerForKey(a2, "5") != 0;
*((_BYTE *)this + 137) = (unsigned int)DS_Dictionary::getIntegerForKey(a2, "6") != 0;
*((_BYTE *)this + 139) = (unsigned int)DS_Dictionary::getIntegerForKey(a2, "7") != 0;
DictForKey = (cocos2d::CCObject *)DS_Dictionary::getDictForKey(a2, "3", 0);
v6 = DictForKey;
v7 = *((cocos2d::CCObject **)this + 7);
if ( DictForKey != v7 )
{
if ( DictForKey )
{
cocos2d::CCObject::retain(DictForKey);
v7 = *((cocos2d::CCObject **)this + 7);
}
if ( v7 )
cocos2d::CCObject::release(v7);
*((_QWORD *)this + 7) = v6;
}
v8 = 0;
v9 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(v6);
if ( (unsigned int)cocos2d::CCArray::count(v9) )
{
do
{
v10 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v9, v8);
CString = (const char *)cocos2d::CCString::getCString(v10);
v22 = 0;
v23 = 0;
v24 = nullptr;
v21 = (char *)CString;
v12 = strlen(CString);
std::string::__init(&v22, v21, v12);
v25 = 0;
v26 = 0;
v27 = nullptr;
if ( (v22 & 1) != 0 )
{
std::string::__init(&v25, v24, v23);
}
else
{
v27 = v24;
v25 = v22;
v26 = v23;
}
GJSmartTemplate::saveRemap((__int64 *)this, (char *)&v25);
if ( (v25 & 1) != 0 )
operator delete(v27);
v13 = cocos2d::CCDictionary::objectForKey(*((_QWORD *)this + 7), &v22);
if ( v13 )
{
v14 = *(unsigned int **)(v13 + 56);
if ( *v14 )
{
v15 = *((_QWORD **)v14 + 2);
for ( i = &v15[*v14 - 1]; i >= v15; ++v15 )
{
if ( !*v15 )
break;
v17 = (__int64 *)(*v15 + 56LL);
if ( v17 != &v22 )
{
if ( (v22 & 1) != 0 )
{
v18 = (char *)v24;
v19 = v23;
}
else
{
v19 = (unsigned __int8)v22 >> 1;
v18 = (char *)&v22 + 1;
}
std::string::assign(v17, v18, v19);
}
}
}
}
++v8;
if ( (v22 & 1) != 0 )
operator delete(v24);
}
while ( v8 < (unsigned int)cocos2d::CCArray::count(v9) );
}
return _stack_chk_guard;
}