//
// cocos2d::CCTMXLayer::reusedTileWithRect from 0x1800b0540 to 0x1800b0608 (200 bytes)
//
// 5 xrefs:
// > cocos2d::CCTMXLayer::appendTileForGID @ 0x1800af6bf
// > cocos2d::CCTMXLayer::insertTileForGID @ 0x1800afd0f
// > cocos2d::CCTMXLayer::updateTileForGID @ 0x1800b0f96
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c2490
//
// 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:19 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall cocos2d::CCTMXLayer::reusedTileWithRect(__int64 a1, __int64 a2)
{
__int64 v4; // rcx
cocos2d::CCSprite *v5; // rax
cocos2d::CCSprite *v6; // rsi
__int64 v7; // rbx
__int64 v8; // rax
v4 = *(_QWORD *)(a1 + 464);
if ( v4 )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v4 + 968LL))(v4, 0);
(*(void (__fastcall **)(_QWORD, __int64, _QWORD, __int64))(**(_QWORD **)(a1 + 464) + 984LL))(
*(_QWORD *)(a1 + 464),
a2,
0,
a2 + 8);
}
else
{
v5 = (cocos2d::CCSprite *)sub_1800E4AC0(0x258u);
if ( v5 )
v6 = cocos2d::CCSprite::CCSprite(v5);
else
v6 = nullptr;
*(_QWORD *)(a1 + 464) = v6;
v7 = *(_QWORD *)v6;
v8 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 328) + 88LL))(*(_QWORD *)(a1 + 328));
(*(void (__fastcall **)(cocos2d::CCSprite *, __int64, __int64, _QWORD))(v7 + 888))(v6, v8, a2, 0);
}
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 464) + 968LL))(*(_QWORD *)(a1 + 464), a1);
return *(_QWORD *)(a1 + 464);
}