//
// cocos2d::CCSpriteFrameCache::removeSpriteFrames from 0xb1b02c to 0xb1b148 (284 bytes)
//
// 1 xrefs:
// > ??> @ 0x553b0
//
// 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
//
void cocos2d::CCSpriteFrameCache::removeSpriteFrames(cocos2d::CCSpriteFrameCache *a1)
{
_QWORD *v2; // x21
__int64 v3; // x19
void *v4; // x0
__int64 v5; // x20
__int64 v6; // x1
void *v7; // x0
unsigned int *v8; // x1
int v9; // w2
void *v10; // x0
cocos2d::CCDictionary::removeAllObjects((cocos2d::CCDictionary *)a1[1].__vftable);
cocos2d::CCDictionary::removeAllObjects(*(cocos2d::CCDictionary **)&a1[1].m_uID);
v2 = *(_QWORD **)&a1[1].m_nTag;
v3 = v2[2];
if ( v3 )
{
do
{
while ( 1 )
{
std::_Rb_tree,std::less,std::allocator>::_M_erase(
(__int64)v2,
*(_QWORD **)(v3 + 24));
v5 = *(_QWORD *)(v3 + 16);
v6 = *(_QWORD *)(v3 + 32);
v7 = (void *)(v6 - 24);
if ( (__int64 *)(v6 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)(v6 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *(_DWORD *)(v6 - 8);
*(_DWORD *)(v6 - 8) = v9 - 1;
}
if ( v9 <= 0 )
break;
}
v4 = (void *)v3;
v3 = v5;
operator delete(v4);
if ( !v5 )
goto LABEL_10;
}
operator delete(v7);
v10 = (void *)v3;
v3 = v5;
operator delete(v10);
}
while ( v5 );
}
LABEL_10:
v2[2] = 0;
v2[3] = v2 + 1;
v2[4] = v2 + 1;
v2[5] = 0;
}