//
// cocos2d::CCSpriteFrameCache::removeSpriteFramesFromTexture from 0xd8bd54 to 0xd8bf5c (520 bytes)
//
// 1 xrefs:
// > ??> @ 0xd00d8
//
// 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:16 +0000
//
__int64 __fastcall cocos2d::CCSpriteFrameCache::removeSpriteFramesFromTexture(
cocos2d::CCSpriteFrameCache *this,
cocos2d::CCTexture2D *a2)
{
cocos2d::CCArray *v4; // x27
cocos2d::CCDictionary *v5; // x0
__int64 v6; // x23
const char *v7; // x0
size_t v8; // x0
__int64 v9; // x22
size_t v10; // x21
char *v11; // x3
__int64 v12; // x21
const char *v13; // x1
size_t v14; // x0
cocos2d::CCSpriteFrame *v15; // x21
unsigned __int64 v16; // x0
__int64 v17; // x28
char *v18; // x0
size_t v20; // x0
cocos2d::CCObject *v21; // x0
char *v22; // [xsp+68h] [xbp+68h]
__int64 v23; // [xsp+78h] [xbp+78h] BYREF
size_t v24; // [xsp+80h] [xbp+80h]
char *v25; // [xsp+88h] [xbp+88h]
__int64 v26; // [xsp+90h] [xbp+90h] BYREF
__int64 v27; // [xsp+98h] [xbp+98h]
void *v28; // [xsp+A0h] [xbp+A0h]
v4 = cocos2d::CCArray::create(_stack_chk_guard);
v5 = *((cocos2d::CCDictionary **)this + 7);
if ( v5 )
{
v6 = *((_QWORD *)v5 + 7);
if ( v6 )
{
v7 = *((const char **)v5 + 7);
v23 = 0;
v24 = 0;
v25 = nullptr;
v8 = strlen(v7);
v9 = *(_QWORD *)(v6 + 288);
v10 = v8;
if ( v8 > 0x16 )
goto LABEL_14;
while ( 1 )
{
LOBYTE(v23) = 2 * v8;
v11 = (char *)&v23 + 1;
if ( v10 )
goto LABEL_15;
while ( 1 )
{
v11[v10] = 0;
v12 = *((_QWORD *)this + 7);
v13 = (char *)&v23 + 1;
if ( (v23 & 1) != 0 )
v13 = v25;
v22 = (char *)v13;
v26 = 0;
v27 = 0;
v28 = nullptr;
v14 = strlen(v13);
std::string::__init(&v26, v22, v14);
v15 = (cocos2d::CCSpriteFrame *)cocos2d::CCDictionary::objectForKey(v12, (__int64)&v26);
if ( (v26 & 1) != 0 )
operator delete(v28);
if ( v15 )
{
if ( a2 == (cocos2d::CCTexture2D *)cocos2d::CCSpriteFrame::getTexture(v15) )
{
v26 = 0;
v27 = 0;
v28 = nullptr;
v20 = strlen((const char *)v6);
std::string::__init(&v26, (void *)v6, v20);
v21 = cocos2d::CCString::create(&v26);
cocos2d::CCArray::addObject(v4, v21);
if ( (v26 & 1) != 0 )
operator delete(v28);
}
}
if ( (v23 & 1) != 0 )
{
operator delete(v25);
if ( !v9 )
{
LABEL_17:
v5 = *((cocos2d::CCDictionary **)this + 7);
goto LABEL_18;
}
}
else if ( !v9 )
{
goto LABEL_17;
}
v6 = v9;
v23 = 0;
v24 = 0;
v25 = nullptr;
v8 = strlen((const char *)v9);
v9 = *(_QWORD *)(v9 + 288);
v10 = v8;
if ( v8 <= 0x16 )
break;
LABEL_14:
v16 = (v8 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v17 = v16 | 1;
v18 = (char *)operator new(v16);
v23 = v17;
v11 = v18;
v25 = v18;
v24 = v10;
LABEL_15:
v11 = (char *)memcpy(v11, (const void *)v6, v10);
}
}
}
}
LABEL_18:
cocos2d::CCDictionary::removeObjectsForKeys(v5, v4);
return _stack_chk_guard;
}