//
// CCPartAnimSprite::initWithAnimDesc from 0x693954 to 0x693f30 (1500 bytes)
//
// 2 xrefs:
// > CCPartAnimSprite::createWithAnimDesc @ 0x693fa4
// > ??> @ 0x6b8c0
//
// 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 12:50:36 +0000
//
__int64 __fastcall CCPartAnimSprite::initWithAnimDesc(
cocos2d::CCArray **this,
char *a2,
cocos2d::CCTexture2D *a3,
unsigned __int8 a4)
{
cocos2d::CCObject *v7; // x0
cocos2d::CCDictionary *v8; // x0
cocos2d::CCObject *v9; // x0
CCAnimateFrameCache *v10; // x0
CCAnimateFrameCache *v11; // x0
cocos2d::CCObject *v12; // x0
cocos2d::CCObject *v13; // x20
unsigned int i; // w25
__int64 v15; // x20
size_t v16; // x0
__int64 v17; // x26
cocos2d::CCString *v18; // x0
size_t v19; // x0
cocos2d::CCString *v20; // x0
unsigned int v21; // w27
unsigned int v22; // w22
CCSpritePart *v23; // x0
__int64 *v24; // x20
__int64 v25; // x1
__int64 v26; // x26
cocos2d::CCString *v27; // x0
__int64 v28; // x26
const char *v29; // x0
size_t v30; // x0
char *v31; // x1
size_t v32; // x2
unsigned __int8 v34; // [xsp+7Bh] [xbp+7Bh]
unsigned int v35; // [xsp+7Ch] [xbp+7Ch]
cocos2d::CCTexture2D *v36; // [xsp+80h] [xbp+80h]
cocos2d::CCTexture2D *CString; // [xsp+80h] [xbp+80h]
cocos2d::CCTexture2D *v38; // [xsp+80h] [xbp+80h]
cocos2d::CCTexture2D *v39; // [xsp+80h] [xbp+80h]
cocos2d::CCDictionary *v40; // [xsp+88h] [xbp+88h]
__int64 v41[2]; // [xsp+A0h] [xbp+A0h] BYREF
void *v42; // [xsp+B0h] [xbp+B0h]
__int64 v43; // [xsp+B8h] [xbp+B8h] BYREF
size_t v44; // [xsp+C0h] [xbp+C0h]
char *v45; // [xsp+C8h] [xbp+C8h]
__int64 v46[2]; // [xsp+D0h] [xbp+D0h] BYREF
void *v47; // [xsp+E0h] [xbp+E0h]
__int64 v48[2]; // [xsp+E8h] [xbp+E8h] BYREF
void *v49; // [xsp+F8h] [xbp+F8h]
__int64 v50[2]; // [xsp+100h] [xbp+100h] BYREF
void *v51; // [xsp+110h] [xbp+110h]
__int64 v52; // [xsp+118h] [xbp+118h] BYREF
size_t v53; // [xsp+120h] [xbp+120h]
char *v54; // [xsp+128h] [xbp+128h]
__int64 v55[2]; // [xsp+130h] [xbp+130h] BYREF
void *v56; // [xsp+140h] [xbp+140h]
__int64 v57[2]; // [xsp+148h] [xbp+148h] BYREF
void *v58; // [xsp+158h] [xbp+158h]
__int64 v59[2]; // [xsp+160h] [xbp+160h] BYREF
void *v60; // [xsp+170h] [xbp+170h]
__int64 v61; // [xsp+178h] [xbp+178h] BYREF
unsigned __int64 v62; // [xsp+180h] [xbp+180h]
_QWORD *v63; // [xsp+188h] [xbp+188h]
_QWORD v64[63]; // [xsp+190h] [xbp+190h] BYREF
v35 = a4;
v34 = cocos2d::CCSprite::initWithTexture((cocos2d::CCSprite *)this, a3, (const cocos2d::CCRect *)&unk_155A8E8);
if ( v34 )
{
v7 = (cocos2d::CCObject *)cocos2d::CCArray::create((cocos2d::CCArray *)v34);
*(this + 79) = v7;
v8 = (cocos2d::CCDictionary *)cocos2d::CCObject::retain(v7);
v9 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v8);
*(this + 75) = v9;
v10 = (CCAnimateFrameCache *)cocos2d::CCObject::retain(v9);
v11 = (CCAnimateFrameCache *)CCAnimateFrameCache::sharedSpriteFrameCache(v10);
v12 = CCAnimateFrameCache::addSpriteFramesWithFile(v11, a2);
v61 = 0;
*((_BYTE *)this + 616) = 1;
v13 = v12;
v62 = 0;
v63 = nullptr;
std::string::__init(&v61, "usedTextures", 0xCu);
v40 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey(v13, &v61);
if ( (v61 & 1) != 0 )
operator delete(v63);
for ( i = 0; i < (unsigned int)cocos2d::CCDictionary::count(v40); ++i )
{
v63 = v64;
v61 = 8;
v62 = 500;
v64[0] = *(_QWORD *)"texture_";
fmt::BasicWriter::FormatInt,char>>((size_t *)&v61, i);
v15 = v61;
if ( v61 + 1 > v62 )
fmt::internal::Array::grow((size_t *)&v61, v61 + 1);
*((_BYTE *)v63 + v15) = 0;
v41[0] = 0;
v36 = (cocos2d::CCTexture2D *)v63;
v41[1] = 0;
v42 = nullptr;
v16 = strlen((const char *)v63);
std::string::__init(v41, v36, v16);
v17 = cocos2d::CCDictionary::objectForKey(v40, v41);
if ( (v41[0] & 1) != 0 )
operator delete(v42);
v46[0] = 0;
v46[1] = 0;
v47 = nullptr;
std::string::__init(v46, "texture", 7u);
v18 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v17, v46);
CString = (cocos2d::CCTexture2D *)cocos2d::CCString::getCString(v18);
v43 = 0;
v44 = 0;
v45 = nullptr;
v19 = strlen((const char *)CString);
std::string::__init(&v43, CString, v19);
if ( (v46[0] & 1) != 0 )
operator delete(v47);
v48[0] = 0;
v48[1] = 0;
v49 = nullptr;
std::string::__init(v48, "tag", 3u);
v20 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v17, v48);
v21 = cocos2d::CCString::intValue(v20);
if ( (v48[0] & 1) != 0 )
operator delete(v49);
v50[0] = 0;
v50[1] = 0;
v51 = nullptr;
std::string::__init(v50, "0", 1u);
v22 = sub_692560((__int64)&v43, (__int64)v50);
if ( (v50[0] & 1) != 0 )
operator delete(v51);
if ( v35 >= (v22 ^ 1) )
{
v24 = (__int64 *)CCSpritePart::create(a3, (cocos2d::CCTexture2D *)v35);
if ( v22 < v35 )
{
v52 = 0;
v53 = 0;
v54 = nullptr;
if ( (v43 & 1) != 0 )
{
std::string::__init(&v52, v45, v44);
}
else
{
v54 = v45;
v52 = v43;
v53 = v44;
}
if ( v24 + 78 != &v52 )
{
if ( (v52 & 1) != 0 )
{
v31 = v54;
v32 = v53;
}
else
{
v32 = (unsigned __int8)v52 >> 1;
v31 = (char *)&v52 + 1;
}
std::string::assign(v24 + 78, v31, v32);
}
if ( (v52 & 1) != 0 )
operator delete(v54);
}
}
else
{
v23 = (CCSpritePart *)((char *)&v43 + 1);
if ( (v43 & 1) != 0 )
v23 = (CCSpritePart *)v45;
v24 = (__int64 *)CCSpritePart::createWithSpriteFrameName(v23, (const char *)(unsigned __int8)v43);
}
(*(void (__fastcall **)(__int64 *, _QWORD))(*v24 + 72))(v24, v21);
v55[0] = 0;
v55[1] = 0;
v56 = nullptr;
std::string::__init(v55, "customID", 8u);
v25 = cocos2d::CCDictionary::objectForKey(v17, v55);
if ( (v55[0] & 1) != 0 )
{
v39 = (cocos2d::CCTexture2D *)v25;
operator delete(v56);
v25 = (__int64)v39;
}
if ( v25 )
{
v57[0] = 0;
v57[1] = 0;
v58 = nullptr;
std::string::__init(v57, "customID", 8u);
v26 = cocos2d::CCDictionary::objectForKey(v17, v57);
if ( (v57[0] & 1) != 0 )
operator delete(v58);
v27 = (cocos2d::CCString *)v26;
v28 = (__int64)*(this + 75);
v29 = (const char *)cocos2d::CCString::getCString(v27);
v59[0] = 0;
v59[1] = 0;
v60 = nullptr;
v38 = (cocos2d::CCTexture2D *)v29;
v30 = strlen(v29);
std::string::__init(v59, v38, v30);
cocos2d::CCDictionary::setObject(v28, (cocos2d::CCObject *)v24);
if ( (v59[0] & 1) != 0 )
operator delete(v60);
}
cocos2d::CCArray::addObject(*(this + 79), (cocos2d::CCObject *)v24);
(*((void (__fastcall **)(cocos2d::CCArray **, __int64 *, _QWORD, _QWORD))*this + 59))(this, v24, 0, v21);
(*(void (__fastcall **)(__int64 *, _QWORD))(*v24 + 344))(v24, 0);
if ( (v43 & 1) != 0 )
operator delete(v45);
if ( v63 != v64 && v63 )
operator delete[](v63);
}
}
return v34;
}