//
// GJBigSprite::unloadAll from 0x100253190 to 0x1002532c8 (312 bytes)
//
// 1 xrefs:
// > MapSelectLayer::onExit @ 0x100253150
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:27:24 +0000
//
__int64 __fastcall GJBigSprite::unloadAll(__int64 a1)
{
__int64 result; // rax
unsigned __int64 v3; // r14
__int64 v4; // rax
__int128 *v5; // rdi
__int64 v6; // r12
__int64 v7; // r12
__int64 v8; // rax
char *v9; // rsi
__int128 v10; // [rsp+0h] [rbp-40h] BYREF
void *__p; // [rsp+10h] [rbp-30h]
*(_BYTE *)(a1 + 361) = 1;
result = sub_1007FEF90(*(_QWORD *)(a1 + 344));
if ( (_DWORD)result )
{
v3 = 0;
do
{
v4 = sub_1007FEFE0(*(_QWORD *)(a1 + 344), (unsigned int)v3);
*(_BYTE *)(v4 + 368) = 0;
v5 = *(__int128 **)(v4 + 344);
if ( v5 )
{
v6 = v4;
(*(void (__fastcall **)(__int128 *))(*(_QWORD *)v5 + 536LL))(v5);
*(_QWORD *)(v6 + 344) = 0;
if ( (*(_BYTE *)(v6 + 320) & 1) != 0 )
{
v5 = &v10;
sub_10001AD30(&v10, *(const void **)(v6 + 336), *(_QWORD *)(v6 + 328));
}
else
{
v7 = v6 + 320;
__p = *(void **)(v7 + 16);
v10 = *(_OWORD *)v7;
}
v8 = cocos2d::CCTextureCache::sharedTextureCache(v5);
v9 = (char *)&v10 + 1;
if ( (v10 & 1) != 0 )
v9 = (char *)__p;
cocos2d::CCTextureCache::removeTextureForKey(v8, v9);
*(_QWORD *)(*(_QWORD *)(a1 + 320) + 8 * (v3 >> 6)) &= __ROL8__(-2, v3);
if ( (v10 & 1) != 0 )
operator delete(__p);
}
++v3;
result = (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 344));
}
while ( v3 < (unsigned int)result );
}
return result;
}