//
// cocos2d::CCDictionary::createWithContentsOfFileThreadSafe from 0xad16b0 to 0xad1790 (224 bytes)
//
// 3 xrefs:
// > cocos2d::CCDictionary::createWithContentsOfFile @ 0xad179c
// > cocos2d::CCSpriteFrameCache::removeSpriteFramesFromFile @ 0xb1b71c
// > ??> @ 0x4ac10
//
// 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
//
cocos2d::CCDictionary *cocos2d::CCDictionary::createWithContentsOfFileThreadSafe(const char *a1)
{
cocos2d::CCFileUtils *v1; // x21
bool (__fastcall *writeToFile)(cocos2d::CCFileUtils *__hidden, cocos2d::CCDictionary *, const std::string *); // x22
cocos2d::CCDictionary *v3; // x20
void *v4; // x0
unsigned int *v6; // x2
int v7; // w1
__int64 v9; // [xsp+50h] [xbp+50h] BYREF
v1 = cocos2d::CCFileUtils::sharedFileUtils();
writeToFile = v1->writeToFile;
sub_D153B8((int)&v9, (char *)a1);
v3 = (cocos2d::CCDictionary *)((__int64 (__fastcall *)(cocos2d::CCFileUtils *, __int64 *))writeToFile)(v1, &v9);
v4 = (void *)(v9 - 24);
if ( (__int64 *)(v9 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v6 = (unsigned int *)(v9 - 8);
do
v7 = __ldaxr(v6);
while ( __stlxr(v7 - 1, v6) );
}
else
{
v7 = *(_DWORD *)(v9 - 8);
*(_DWORD *)(v9 - 8) = v7 - 1;
}
if ( v7 <= 0 )
operator delete(v4);
}
return v3;
}