//
// cocos2d::CCFileUtils::setFilenameLookupDictionary from 0xb06150 to 0xb062e8 (408 bytes)
//
// 3 xrefs:
// > ??> @ 0x51720
// > ??> @ 0x1217ad8
// > ??> @ 0x1217f98
//
// 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::setFilenameLookupDictionary(cocos2d::CCFileUtils *a1, cocos2d::CCDictionary *a2)
{
cocos2d::CCFileUtils *v3; // x21
cocos2d::CCFileUtils_vtbl *v5; // x19
void (__fastcall *addSearchResolutionsOrder)(cocos2d::CCFileUtils *__hidden, const unsigned __int8 *); // x1
char *v7; // x0
cocos2d::CCFileUtils_vtbl *v8; // x0
void (__fastcall *v9)(cocos2d::CCFileUtils *__hidden); // x27
std::string (__fastcall *addSuffix)(cocos2d::CCFileUtils *__hidden, std::string, std::string); // x1
char *v11; // x0
unsigned int *v12; // x1
int v13; // w2
unsigned int *v14; // x1
int v15; // w2
cocos2d::CCFileUtils_vtbl *v16; // x0
cocos2d::CCObject *v17; // x0
v3 = a1 + 9;
v5 = a1[11].__vftable;
if ( v5 )
{
do
{
while ( 1 )
{
std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::_M_erase(
(__int64)v3,
(_QWORD *)v5->addSearchPath);
v9 = v5->~CCFileUtils_0;
addSuffix = v5->addSuffix;
v11 = (char *)addSuffix - 24;
if ( (__int64 *)((char *)addSuffix - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v12 = (unsigned int *)((char *)addSuffix - 8);
do
v13 = __ldaxr(v12);
while ( __stlxr(v13 - 1, v12) );
}
else
{
v13 = *((_DWORD *)addSuffix - 2);
*((_DWORD *)addSuffix - 2) = v13 - 1;
}
if ( v13 <= 0 )
break;
}
addSearchResolutionsOrder = v5->addSearchResolutionsOrder;
v7 = (char *)addSearchResolutionsOrder - 24;
if ( (__int64 *)((char *)addSearchResolutionsOrder - 24) != &qword_124B6B0 )
goto LABEL_11;
LABEL_4:
v8 = v5;
v5 = (cocos2d::CCFileUtils_vtbl *)v9;
operator delete(v8);
if ( !v9 )
goto LABEL_16;
}
operator delete(v11);
addSearchResolutionsOrder = v5->addSearchResolutionsOrder;
v7 = (char *)addSearchResolutionsOrder - 24;
if ( (__int64 *)((char *)addSearchResolutionsOrder - 24) == &qword_124B6B0 )
goto LABEL_4;
LABEL_11:
if ( &pthread_create )
{
v14 = (unsigned int *)((char *)addSearchResolutionsOrder - 8);
do
v15 = __ldaxr(v14);
while ( __stlxr(v15 - 1, v14) );
}
else
{
v15 = *((_DWORD *)addSearchResolutionsOrder - 2);
*((_DWORD *)addSearchResolutionsOrder - 2) = v15 - 1;
}
if ( v15 > 0 )
goto LABEL_4;
operator delete(v7);
v16 = v5;
v5 = (cocos2d::CCFileUtils_vtbl *)v9;
operator delete(v16);
}
while ( v9 );
}
LABEL_16:
a1[11].__vftable = nullptr;
a1[12].__vftable = (cocos2d::CCFileUtils_vtbl *)&a1[10];
a1[13].__vftable = (cocos2d::CCFileUtils_vtbl *)&a1[10];
v17 = (cocos2d::CCObject *)a1[1].__vftable;
v3[5].__vftable = nullptr;
if ( v17 )
cocos2d::CCObject::release(v17);
a1[1].__vftable = (cocos2d::CCFileUtils_vtbl *)a2;
if ( a2 )
cocos2d::CCObject::retain(a2);
}