//
// cocos2d::CCSpriteFrameCache::removeSpriteFrameByName from 0x180091a50 to 0x180091c63 (531 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b636c
//
// 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=2
void __fastcall cocos2d::CCSpriteFrameCache::removeSpriteFrameByName(cocos2d::CCSpriteFrameCache *this, char *a2)
{
cocos2d::CCString *v4; // rsi
void *v5; // rcx
std::string *CString; // rax
void *v7; // rcx
std::string *v8; // rax
void *v9; // rcx
_QWORD *v10; // rdi
_QWORD *v11; // rbx
void *Buf2[3]; // [rsp+20h] [rbp-58h] BYREF
unsigned __int64 v13; // [rsp+38h] [rbp-40h]
void *Block[2]; // [rsp+40h] [rbp-38h] BYREF
__m128i si128; // [rsp+50h] [rbp-28h]
if ( a2 )
{
sub_180005910(Block, a2);
v4 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(*((_QWORD *)this + 8), (unsigned __int8 *)Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v5 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v5);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_1800E7160);
LOBYTE(Block[0]) = 0;
if ( v4 )
{
CString = cocos2d::CCString::getCString(v4);
sub_180005910(Buf2, CString);
cocos2d::CCDictionary::removeObjectForKey(*((cocos2d::CCDictionary **)this + 7), (unsigned __int8 *)Buf2);
if ( v13 > 0xF )
{
v7 = Buf2[0];
if ( v13 + 1 >= 0x1000 )
{
v7 = *((void **)Buf2[0] - 1);
if ( (unsigned __int64)((char *)Buf2[0] - (char *)v7 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v7);
}
v8 = cocos2d::CCString::getCString(v4);
sub_180005910(Buf2, v8);
cocos2d::CCDictionary::removeObjectForKey(*((cocos2d::CCDictionary **)this + 8), (unsigned __int8 *)Buf2);
if ( v13 <= 0xF )
goto LABEL_22;
v9 = Buf2[0];
if ( v13 + 1 >= 0x1000 )
{
v9 = *((void **)Buf2[0] - 1);
if ( (unsigned __int64)((char *)Buf2[0] - (char *)v9 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
}
else
{
sub_180005910(Buf2, a2);
cocos2d::CCDictionary::removeObjectForKey(*((cocos2d::CCDictionary **)this + 7), (unsigned __int8 *)Buf2);
if ( v13 <= 0xF )
{
LABEL_22:
v10 = *((_QWORD **)this + 9);
v11 = (_QWORD *)*v10;
sub_1800903C0((__int64)v10, (__int64)v10, *(__int64 **)(*v10 + 8LL));
v11[1] = v11;
*v11 = v11;
v11[2] = v11;
v10[1] = 0;
return;
}
v9 = Buf2[0];
if ( v13 + 1 >= 0x1000 )
{
v9 = *((void **)Buf2[0] - 1);
if ( (unsigned __int64)((char *)Buf2[0] - (char *)v9 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
}
j_j_free_0(v9);
goto LABEL_22;
}
}