//
// PlatformToolbox::doesFileExist from 0x4ecd14 to 0x4ece20 (268 bytes)
//
// 2 xrefs:
// > GJMoreGamesLayer::getMoreGamesList @ 0x7d991c
// > ??> @ 0x81a50
//
// 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
//
__int64 __fastcall PlatformToolbox::doesFileExist(char **a1)
{
cocos2d::CCFileUtils *v2; // x21
char *v3; // x1
bool (__fastcall *isPopupNotify)(cocos2d::CCFileUtils *__hidden); // x22
unsigned int v5; // w20
void *v6; // x0
unsigned int *v8; // x2
int v9; // w1
__int64 v10; // [xsp+40h] [xbp+40h] BYREF
v2 = cocos2d::CCFileUtils::sharedFileUtils();
v3 = *a1;
isPopupNotify = v2->isPopupNotify;
sub_D153B8((int)&v10, v3);
v5 = ((__int64 (__fastcall *)(cocos2d::CCFileUtils *, __int64 *))isPopupNotify)(v2, &v10);
v6 = (void *)(v10 - 24);
if ( (__int64 *)(v10 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)(v10 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *(_DWORD *)(v10 - 8);
*(_DWORD *)(v10 - 8) = v9 - 1;
}
if ( v9 <= 0 )
operator delete(v6);
}
return v5;
}