//
// cocos2d::CCSpriteFrameCache::removeSpriteFramesFromFile from 0x180095580 to 0x1800957ee (622 bytes)
//
// 2 xrefs:
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c0630
//
// 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 11:22:09 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall cocos2d::CCSpriteFrameCache::removeSpriteFramesFromFile(__int64 ***this, char *Str)
{
struct cocos2d::CCFileUtils *v4; // rax
char *v5; // rcx
struct cocos2d::CCDictionary *v6; // r14
__int64 **v7; // rcx
__int64 *v8; // r13
__int64 *v9; // rdi
__int64 *v10; // rbx
void *v11; // r15
void *v12; // rsi
void **v13; // rbp
__int64 *v14; // r14
_QWORD *v15; // rcx
void **v16; // rdx
size_t v17; // rbx
size_t v18; // r8
unsigned int v19; // eax
unsigned int v20; // eax
__int64 *v21; // rcx
const void *v22; // rdx
void **v23; // rcx
unsigned __int64 v24; // rdi
size_t v25; // r8
int v26; // eax
void **v27; // rax
__int64 **v28; // rcx
__int64 **v29; // rbx
void *v30; // rcx
struct cocos2d::CCDictionary *v31; // [rsp+30h] [rbp-88h]
void *Buf2[4]; // [rsp+38h] [rbp-80h] BYREF
void *Block[3]; // [rsp+58h] [rbp-60h] BYREF
unsigned __int64 v34; // [rsp+70h] [rbp-48h]
v4 = cocos2d::CCFileUtils::sharedFileUtils();
(*(void (__fastcall **)(struct cocos2d::CCFileUtils *, void **, char *, _QWORD))(*(_QWORD *)v4 + 40LL))(
v4,
Block,
Str,
0);
v5 = (char *)Block;
if ( v34 > 0xF )
v5 = (char *)Block[0];
v6 = cocos2d::CCDictionary::createWithContentsOfFileThreadSafe(v5);
v31 = v6;
cocos2d::CCSpriteFrameCache::removeSpriteFramesFromDictionary((cocos2d::CCSpriteFrameCache *)this, v6);
sub_180005A10(Buf2, Str);
v7 = *(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 = v10;
v15 = v9 + 4;
v16 = Buf2;
if ( (unsigned __int64)v11 > 0xF )
v16 = v13;
if ( (unsigned __int64)v9[7] > 0xF )
v15 = (_QWORD *)*v15;
v17 = v9[6];
v18 = v17;
if ( (unsigned __int64)v12 < v17 )
v18 = (size_t)v12;
v19 = memcmp(v15, v16, v18);
if ( !v19 )
{
if ( v17 >= (unsigned __int64)v12 )
v19 = v17 > (unsigned __int64)v12;
else
v19 = -1;
}
v20 = v19 >> 31;
v10 = v9;
if ( (_BYTE)v20 )
v10 = v14;
v21 = v9 + 2;
if ( !(_BYTE)v20 )
v21 = v9;
v9 = (__int64 *)*v21;
}
while ( !*(_BYTE *)(*v21 + 25) );
v6 = v31;
}
if ( *((_BYTE *)v10 + 25) )
goto LABEL_32;
v22 = v10 + 4;
if ( (unsigned __int64)v10[7] > 0xF )
v22 = (const void *)v10[4];
v23 = Buf2;
if ( (unsigned __int64)v11 > 0xF )
v23 = v13;
v24 = v10[6];
v25 = (size_t)v12;
if ( v24 < (unsigned __int64)v12 )
v25 = v10[6];
v26 = memcmp(v23, v22, v25);
if ( !v26 )
{
if ( (unsigned __int64)v12 >= v24 )
v26 = (unsigned __int64)v12 > v24;
else
v26 = -1;
}
if ( v26 < 0 )
LABEL_32:
v10 = v8;
if ( (unsigned __int64)v11 > 0xF )
{
v27 = v13;
if ( (unsigned __int64)v11 + 1 >= 0x1000 )
{
v13 = (void **)*(v13 - 1);
if ( (unsigned __int64)((char *)v27 - (char *)v13 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v13);
}
v28 = *(this + 9);
if ( v10 != *v28 )
{
v29 = sub_18000F350(v28, (__int64 **)v10);
sub_180005C70((__int64)(v29 + 4));
j_j_free_0(v29);
}
cocos2d::CCObject::release(v6);
if ( v34 > 0xF )
{
v30 = Block[0];
if ( v34 + 1 >= 0x1000 )
{
v30 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v30 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v30);
}
}