//
// cocos2d::CCFileUtils::purgeCachedEntries from 0xb05fe0 to 0xb06150 (368 bytes)
//
// 3 xrefs:
// > ??> @ 0xc1bc0
// > ??> @ 0x1217aa8
// > ??> @ 0x1217f68
//
// 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::CCFileUtils::purgeCachedEntries(cocos2d::CCFileUtils *a1)
{
cocos2d::CCFileUtils *v2; // x21
cocos2d::CCFileUtils_vtbl *v3; // x19
void (__fastcall *addSearchResolutionsOrder)(cocos2d::CCFileUtils *__hidden, const unsigned __int8 *); // x1
char *v5; // x0
cocos2d::CCFileUtils_vtbl *v6; // x0
void (__fastcall *v7)(cocos2d::CCFileUtils *__hidden); // x26
std::string (__fastcall *addSuffix)(cocos2d::CCFileUtils *__hidden, std::string, std::string); // x1
char *v9; // x0
unsigned int *v10; // x1
int v11; // w2
unsigned int *v12; // x1
int v13; // w2
cocos2d::CCFileUtils_vtbl *v14; // x0
v2 = a1 + 9;
v3 = a1[11].__vftable;
if ( v3 )
{
do
{
while ( 1 )
{
std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::_M_erase(
(__int64)v2,
(_QWORD *)v3->addSearchPath);
v7 = v3->~CCFileUtils_0;
addSuffix = v3->addSuffix;
v9 = (char *)addSuffix - 24;
if ( (__int64 *)((char *)addSuffix - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v10 = (unsigned int *)((char *)addSuffix - 8);
do
v11 = __ldaxr(v10);
while ( __stlxr(v11 - 1, v10) );
}
else
{
v11 = *((_DWORD *)addSuffix - 2);
*((_DWORD *)addSuffix - 2) = v11 - 1;
}
if ( v11 <= 0 )
break;
}
addSearchResolutionsOrder = v3->addSearchResolutionsOrder;
v5 = (char *)addSearchResolutionsOrder - 24;
if ( (__int64 *)((char *)addSearchResolutionsOrder - 24) != &qword_124B6B0 )
goto LABEL_11;
LABEL_4:
v6 = v3;
v3 = (cocos2d::CCFileUtils_vtbl *)v7;
operator delete(v6);
if ( !v7 )
goto LABEL_16;
}
operator delete(v9);
addSearchResolutionsOrder = v3->addSearchResolutionsOrder;
v5 = (char *)addSearchResolutionsOrder - 24;
if ( (__int64 *)((char *)addSearchResolutionsOrder - 24) == &qword_124B6B0 )
goto LABEL_4;
LABEL_11:
if ( &pthread_create )
{
v12 = (unsigned int *)((char *)addSearchResolutionsOrder - 8);
do
v13 = __ldaxr(v12);
while ( __stlxr(v13 - 1, v12) );
}
else
{
v13 = *((_DWORD *)addSearchResolutionsOrder - 2);
*((_DWORD *)addSearchResolutionsOrder - 2) = v13 - 1;
}
if ( v13 > 0 )
goto LABEL_4;
operator delete(v5);
v14 = v3;
v3 = (cocos2d::CCFileUtils_vtbl *)v7;
operator delete(v14);
}
while ( v7 );
}
LABEL_16:
a1[11].__vftable = nullptr;
a1[12].__vftable = (cocos2d::CCFileUtils_vtbl *)&a1[10];
a1[13].__vftable = (cocos2d::CCFileUtils_vtbl *)&a1[10];
v2[5].__vftable = nullptr;
}