//
// SpriteDescription::initDescription from 0x10056ce30 to 0x10056d194 (868 bytes)
//
// 2 xrefs:
// > CCAnimateFrameCache::addDict @ 0x10056c042
// > SpriteDescription::createDescription @ 0x10056c2e5
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
bool __fastcall SpriteDescription::initDescription(SpriteDescription *a1, cocos2d::CCDictionary *a2)
{
cocos2d::CCString *v2; // rax
cocos2d::CCString *v3; // rax
cocos2d::CCString *v4; // rax
double v5; // xmm0_8
cocos2d::CCString *v6; // rax
cocos2d::CCString *v7; // rax
cocos2d::CCString *v8; // rax
cocos2d::CCString *v9; // rax
bool v10; // al
cocos2d::CCString *v11; // rax
const char *CString; // r14
size_t v13; // rax
size_t v14; // r15
char *v15; // r12
cocos2d::CCSpriteFrameCache *v16; // rax
const char *v17; // rsi
size_t v18; // r13
cocos2d::CCSpriteFrame *v19; // rax
cocos2d::CCSpriteFrame *m_texture; // rbx
std::string __str; // [rsp+0h] [rbp-70h] BYREF
double v23[3]; // [rsp+18h] [rbp-58h] BYREF
__int128 __dst; // [rsp+30h] [rbp-40h] BYREF
void *__p; // [rsp+40h] [rbp-30h]
LOBYTE(__dst) = 16;
*(_QWORD *)((char *)&__dst + 1) = 0x6E6F697469736F70LL;
BYTE9(__dst) = 0;
v2 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1((__int64)a2, (char *)&__dst);
cocos2d::CCString::getCString(v2);
cocos2d::CCPointFromString((const char *)v23);
sub_10028CC90(&a1->m_position, v23);
if ( (__dst & 1) != 0 )
operator delete(__p);
LOBYTE(__dst) = 14;
*(_DWORD *)((char *)&__dst + 1) = 1885957222;
DWORD1(__dst) = 1684369520;
BYTE8(__dst) = 0;
v3 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1((__int64)a2, (char *)&__dst);
cocos2d::CCString::getCString(v3);
cocos2d::CCPointFromString((const char *)v23);
sub_10028CC90(&a1->m_flipped, v23);
if ( (__dst & 1) != 0 )
operator delete(__p);
strcpy((char *)&__dst, "\nscale");
v4 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1((__int64)a2, (char *)&__dst);
cocos2d::CCString::getCString(v4);
cocos2d::CCPointFromString((const char *)v23);
v5 = sub_10028CC90(&a1->m_scale, v23);
if ( (__dst & 1) != 0 )
operator delete(__p);
LOBYTE(__dst) = 16;
*(_QWORD *)((char *)&__dst + 1) = 0x6E6F697461746F72LL;
BYTE9(__dst) = 0;
v6 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1((__int64)a2, (char *)&__dst);
*(float *)&v5 = cocos2d::CCString::floatValue(v6);
a1->m_rotation = *(float *)&v5;
if ( (__dst & 1) != 0 )
operator delete(__p);
LOBYTE(__dst) = 12;
*(_DWORD *)((char *)&__dst + 1) = 1818318458;
*(_WORD *)((char *)&__dst + 5) = 25973;
BYTE7(__dst) = 0;
v7 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1((__int64)a2, (char *)&__dst);
a1->m_zValue = cocos2d::CCString::intValue(v7);
if ( (__dst & 1) != 0 )
operator delete(__p);
LOBYTE(__dst) = 6;
*(_DWORD *)((char *)&__dst + 1) = 6775156;
v8 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1((__int64)a2, (char *)&__dst);
a1->m_tag = cocos2d::CCString::intValue(v8);
if ( (__dst & 1) != 0 )
operator delete(__p);
LOBYTE(__dst) = 26;
*(_QWORD *)((char *)&__dst + 1) = 0x7473754373657375LL;
*(_QWORD *)((char *)&__dst + 6) = 0x6761546D6F747375LL;
BYTE14(__dst) = 0;
v9 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1((__int64)a2, (char *)&__dst);
v10 = cocos2d::CCString::boolValue(v9);
a1->m_usesCustomTag = v10;
if ( (__dst & 1) != 0 )
{
operator delete(__p);
if ( !a1->m_usesCustomTag )
return 1;
}
else if ( !v10 )
{
return 1;
}
LOBYTE(v23[0]) = 14;
strcpy((char *)v23 + 1, "texture");
v11 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1((__int64)a2, (char *)v23);
CString = cocos2d::CCString::getCString(v11);
v13 = strlen(CString);
if ( v13 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v5);
v14 = v13;
if ( v13 >= 0x17 )
{
v18 = 26;
if ( (v13 | 7) != 0x17 )
v18 = (v13 | 7) + 1;
v15 = (char *)operator new(v18);
__p = v15;
*(_QWORD *)&__dst = v18 | 1;
*((_QWORD *)&__dst + 1) = v14;
LABEL_27:
memmove(v15, CString, v14);
v15[v14] = 0;
if ( (LOBYTE(v23[0]) & 1) == 0 )
goto LABEL_22;
goto LABEL_21;
}
LOBYTE(__dst) = 2 * v13;
v15 = (char *)&__dst + 1;
if ( v13 )
goto LABEL_27;
BYTE1(__dst) = 0;
if ( (LOBYTE(v23[0]) & 1) != 0 )
LABEL_21:
operator delete(*(void **)&v23[2]);
LABEL_22:
v16 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
if ( (__dst & 1) != 0 )
v17 = (const char *)__p;
else
v17 = (char *)&__dst + 1;
v19 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v16, v17);
a1->m_texture = v19;
cocos2d::CCObject::retain(v19);
m_texture = a1->m_texture;
if ( (__dst & 1) != 0 )
{
sub_100006B70(&__str, __p, *((unsigned __int64 *)&__dst + 1), v5);
}
else
{
__str.__r_.__value_.__r.__words[2] = (std::string::size_type)__p;
*(_OWORD *)&__str.__r_.__value_.__l.0 = __dst;
}
std::string::operator=((std::string *)&m_texture->m_strFrameName, &__str);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
if ( (__dst & 1) != 0 )
operator delete(__p);
return 1;
}