//
// sub_1800A1BE0 from 0x1800a1be0 to 0x1800a1c86 (166 bytes)
//
// 2 xrefs:
// > cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas @ 0x180092108
// > ??> @ 0x1801c17a0
//
// 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:13 +0000
//
unsigned __int64 __fastcall sub_1800A1BE0(__int64 a1, unsigned int a2, char a3)
{
__int64 v3; // rbx
__int64 v5; // rsi
cocos2d::CCObject *v6; // rcx
unsigned __int64 result; // rax
__int64 v8; // rdx
v3 = (int)a2;
v5 = 8LL * a2;
*(_DWORD *)(*(_QWORD *)(v5 + *(_QWORD *)(a1 + 16)) + 40LL) = -1;
if ( a3 )
{
v6 = *(cocos2d::CCObject **)(v5 + *(_QWORD *)(a1 + 16));
if ( v6 )
cocos2d::CCObject::release(v6);
}
result = (unsigned int)(--*(_DWORD *)a1 - v3);
if ( *(_DWORD *)a1 != (_DWORD)v3 )
{
result = (unsigned __int64)memmove(
(void *)(*(_QWORD *)(a1 + 16) + v5),
(const void *)(*(_QWORD *)(a1 + 16) + 8LL * (unsigned int)(v3 + 1)),
8LL * (unsigned int)result);
if ( (unsigned int)v3 < *(_DWORD *)a1 )
{
v8 = 8 * v3;
do
{
result = *(_QWORD *)(a1 + 16);
v8 += 8;
*(_DWORD *)(*(_QWORD *)(result + v8 - 8) + 40LL) = v3;
LODWORD(v3) = v3 + 1;
}
while ( (unsigned int)v3 < *(_DWORD *)a1 );
}
}
return result;
}