//
// cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas from 0x10026fba8 to 0x10026fcf4 (332 bytes)
//
// 5 xrefs:
// > cocos2d::CCSpriteBatchNode::removeChild @ 0x10026fb84
// > cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas @ 0x10026fc0c
// > cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas @ 0x10026fcd4
// > cocos2d::CCSprite::removeChild @ 0x1002d5204
// > cocos2d::CCSprite::removeAllChildrenWithCleanup @ 0x1002d529c
//
// This function is hookable on this platform (idp: arm, 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:01:46 +0000
//
__int64 __fastcall cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas(__int64 result, __int64 a2)
{
__int64 v3; // x19
__int64 v4; // x20
unsigned int *v5; // x9
__int64 v6; // x8
_QWORD *v7; // x20
unsigned __int64 v8; // x21
__int64 v9; // x21
__int64 v10; // x22
__int64 v11; // x20
unsigned int *v12; // x9
__int64 v13; // x8
_QWORD *v14; // x20
unsigned __int64 v15; // x21
v3 = result;
if ( (*(_BYTE *)(a2 + 559) & 1) != 0 )
{
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 488LL))(a2);
if ( result )
{
v4 = result;
result = sub_1002E757C(result);
if ( (_DWORD)result )
{
v5 = *(unsigned int **)(v4 + 56);
v6 = *v5;
if ( (_DWORD)v6 )
{
v7 = *((_QWORD **)v5 + 2);
v8 = (unsigned __int64)&v7[v6 - 1];
do
{
if ( !*v7 )
break;
result = cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas(v3);
++v7;
}
while ( (unsigned __int64)v7 <= v8 );
}
}
}
}
else
{
v9 = *(unsigned int *)(a2 + 40);
if ( (_DWORD)v9 != -1 )
{
v10 = (unsigned int)sub_1002E757C(*(_QWORD *)(result + 344)) - 1;
if ( (unsigned int)v9 < (unsigned int)v10 )
cocos2d::CCSpriteBatchNode::swap(v3, v9, v10);
cocos2d::CCTextureAtlas::removeQuadAtIndex(*(_QWORD *)(v3 + 328), v10);
*(_BYTE *)(v3 + 288) = 1;
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a2 + 1120LL))(a2, 0);
sub_1003F3320();
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 488LL))(a2);
if ( result )
{
v11 = result;
result = sub_1002E757C(result);
if ( (_DWORD)result )
{
v12 = *(unsigned int **)(v11 + 56);
v13 = *v12;
if ( (_DWORD)v13 )
{
v14 = *((_QWORD **)v12 + 2);
v15 = (unsigned __int64)&v14[v13 - 1];
do
{
if ( !*v14 )
break;
result = cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas(v3);
++v14;
}
while ( (unsigned __int64)v14 <= v15 );
}
}
}
}
}
return result;
}