//
// GJShopLayer::onExit from 0x92a988 to 0x92ab5c (468 bytes)
//
// 2 xrefs:
// > ??> @ 0x634b0
// > ??> @ 0x11af6b0
//
// 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 GJShopLayer::onExit(GJShopLayer *a1)
{
cocos2d::CCSpriteFrameCache *v1; // x19
char *v2; // x0
cocos2d::CCTextureCache *v3; // x23
char *v4; // x0
unsigned int *v5; // x1
int v6; // w2
unsigned int *v7; // x1
int v8; // w2
char *v9; // [xsp+50h] [xbp+50h] BYREF
cocos2d::CCLayer::onExit(a1);
v1 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
sub_D18D28(&v9);
sub_D15FD4(&v9, ".plist", 6);
cocos2d::CCSpriteFrameCache::removeSpriteFramesFromFile(v1, v9);
v2 = v9 - 24;
if ( v9 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v5 = (unsigned int *)(v9 - 8);
do
v6 = __ldaxr(v5);
while ( __stlxr(v6 - 1, v5) );
}
else
{
v6 = *((_DWORD *)v9 - 2);
*((_DWORD *)v9 - 2) = v6 - 1;
}
if ( v6 <= 0 )
operator delete(v2);
}
v3 = cocos2d::CCTextureCache::sharedTextureCache();
sub_D18D28(&v9);
sub_D15FD4(&v9, ".png", 4);
cocos2d::CCTextureCache::removeTextureForKey(v3, v9);
v4 = v9 - 24;
if ( v9 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)(v9 - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *((_DWORD *)v9 - 2);
*((_DWORD *)v9 - 2) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v4);
}
}