//
// sub_1800A2010 from 0x1800a2010 to 0x1800a2049 (57 bytes)
//
// 2 xrefs:
// > cocos2d::CCTMXLayer::removeChild @ 0x1800b03b5
// > cocos2d::CCTMXLayer::removeTileAt @ 0x1800b0480
//
// 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
//
__int64 __fastcall sub_1800A2010(__int64 a1, __int64 a2)
{
unsigned int v2; // r11d
__int64 result; // rax
__int64 v4; // r9
v2 = --*(_DWORD *)a1;
if ( (unsigned int)a2 < *(_DWORD *)a1 )
{
result = (unsigned int)a2;
v4 = 8LL * (unsigned int)a2;
do
{
v4 += 8;
a2 = (unsigned int)(a2 + 1);
*(_QWORD *)(v4 + *(_QWORD *)(a1 + 16) - 8) = *(_QWORD *)(*(_QWORD *)(a1 + 16) + 8 * a2);
}
while ( (unsigned int)a2 < v2 );
}
return result;
}