//
// cocos2d::CCSpriteFrameCache::removeSpriteFramesFromFile from 0x1800920c0 to 0x1800922e4 (548 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b6390
//
// 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
//
// Hidden C++ exception states: #wind=1
void __fastcall cocos2d::CCSpriteFrameCache::removeSpriteFramesFromFile(cocos2d::CCSpriteFrameCache *this, char *a2)
{
struct cocos2d::CCFileUtils *v4; // rax
char *v5; // rcx
struct cocos2d::CCDictionary *v6; // rdi
__int64 **v7; // rcx
__int64 *v8; // r13
__int64 *v9; // rbx
__int64 *v10; // rbp
void *v11; // r15
void *v12; // rsi
void **v13; // r14
void **v14; // rdx
const void *v15; // rcx
size_t v16; // rdi
size_t v17; // r8
int v18; // eax
const void *v19; // rdx
void **v20; // rcx
unsigned __int64 v21; // rbx
size_t v22; // r8
int v23; // eax
void **v24; // rax
__int64 **v25; // rbx
__int64 *v26; // rax
void *v27; // rcx
struct cocos2d::CCDictionary *v28; // [rsp+20h] [rbp-88h]
void *Buf2[4]; // [rsp+28h] [rbp-80h] BYREF
void *Block[3]; // [rsp+48h] [rbp-60h] BYREF
unsigned __int64 v31; // [rsp+60h] [rbp-48h]
v4 = cocos2d::CCFileUtils::sharedFileUtils();
((void (__fastcall *)(struct cocos2d::CCFileUtils *, void **, char *, _QWORD))v4->createCCArrayWithContentsOfFile)(
v4,
Block,
a2,
0);
v5 = (char *)Block;
if ( v31 > 0xF )
v5 = (char *)Block[0];
v6 = cocos2d::CCDictionary::createWithContentsOfFileThreadSafe(v5);
v28 = v6;
cocos2d::CCSpriteFrameCache::removeSpriteFramesFromDictionary(this, v6);
sub_180005910(Buf2, a2);
v7 = *((__int64 ***)this + 9);
v8 = *v7;
v9 = (__int64 *)(*v7)[1];
v10 = *v7;
v11 = Buf2[3];
v12 = Buf2[2];
v13 = (void **)Buf2[0];
if ( !*((_BYTE *)v9 + 25) )
{
do
{
v14 = Buf2;
if ( (unsigned __int64)v11 > 0xF )
v14 = v13;
v15 = v9 + 4;
if ( (unsigned __int64)v9[7] > 0xF )
v15 = (const void *)v9[4];
v16 = v9[6];
v17 = v16;
if ( (unsigned __int64)v12 < v16 )
v17 = (size_t)v12;
v18 = memcmp(v15, v14, v17);
if ( !v18 )
{
if ( v16 >= (unsigned __int64)v12 )
v18 = v16 > (unsigned __int64)v12;
else
v18 = -1;
}
if ( v18 >= 0 )
{
v10 = v9;
v9 = (__int64 *)*v9;
}
else
{
v9 = (__int64 *)v9[2];
}
}
while ( !*((_BYTE *)v9 + 25) );
v6 = v28;
}
if ( *((_BYTE *)v10 + 25) )
goto LABEL_31;
v19 = v10 + 4;
if ( (unsigned __int64)v10[7] > 0xF )
v19 = (const void *)v10[4];
v20 = Buf2;
if ( (unsigned __int64)v11 > 0xF )
v20 = v13;
v21 = v10[6];
v22 = (size_t)v12;
if ( v21 < (unsigned __int64)v12 )
v22 = v10[6];
v23 = memcmp(v20, v19, v22);
if ( !v23 )
{
if ( (unsigned __int64)v12 >= v21 )
v23 = (unsigned __int64)v12 > v21;
else
v23 = -1;
}
if ( v23 < 0 )
LABEL_31:
v10 = v8;
if ( (unsigned __int64)v11 > 0xF )
{
v24 = v13;
if ( (unsigned __int64)v11 + 1 >= 0x1000 )
{
v13 = (void **)*(v13 - 1);
if ( (unsigned __int64)((char *)v24 - (char *)v13 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v13);
}
v25 = *((__int64 ***)this + 9);
if ( v10 != *v25 )
{
v26 = sub_18000F1F0(*((_QWORD **)this + 9), v10);
sub_180090480((__int64)v25, v26);
}
cocos2d::CCObject::release(v6);
if ( v31 > 0xF )
{
v27 = Block[0];
if ( v31 + 1 >= 0x1000 )
{
v27 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v27 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v27);
}
}