//
// cocos2d::CCSpriteBatchNode::appendChild from 0x100155cf0 to 0x100155eb6 (454 bytes)
//
// 3 xrefs:
// > cocos2d::CCSpriteBatchNode::addChild @ 0x100155ce1
// > cocos2d::CCSpriteBatchNode::appendChild @ 0x100155e9b
// > cocos2d::CCSprite::addChild @ 0x100274f44
//
// 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 12:25:04 +0000
//
__int64 __fastcall cocos2d::CCSpriteBatchNode::appendChild(__int64 a1, __int64 a2)
{
int v2; // r15d
unsigned int v3; // r15d
_DWORD *v4; // r15
__int128 v5; // xmm0
__int128 v6; // xmm1
__int128 v7; // xmm2
__int64 result; // rax
_QWORD *v9; // r15
__int64 v10; // r12
unsigned __int64 i; // r14
_OWORD v12[8]; // [rsp+0h] [rbp-80h] BYREF
*(_BYTE *)(a1 + 288) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a2 + 1120LL))(a2, a1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a2 + 1200LL))(a2, 1);
if ( !*(_BYTE *)(a2 + 559) )
{
v2 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 328) + 80LL))(*(_QWORD *)(a1 + 328));
if ( v2 == (*(unsigned int (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 328) + 88LL))(*(_QWORD *)(a1 + 328)) )
{
v3 = (4 * (*(unsigned int (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 328) + 88LL))(*(_QWORD *)(a1 + 328)) + 4)
/ 3;
if ( (*(unsigned int (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 328) + 88LL))(*(_QWORD *)(a1 + 328)) < v3 )
cocos2d::CCTextureAtlas::resizeCapacity(*(_QWORD *)(a1 + 328), v3);
}
v4 = *(_DWORD **)(*(_QWORD *)(a1 + 344) + 56LL);
sub_100746D70(v4, a2);
*(_DWORD *)(a2 + 360) = *v4 - 1;
v12[5] = *(_OWORD *)(a2 + 540);
v12[4] = *(_OWORD *)(a2 + 524);
v5 = *(_OWORD *)(a2 + 460);
v6 = *(_OWORD *)(a2 + 476);
v7 = *(_OWORD *)(a2 + 492);
v12[3] = *(_OWORD *)(a2 + 508);
v12[2] = v7;
v12[1] = v6;
v12[0] = v5;
((void (__fastcall *)(_QWORD, _OWORD *))cocos2d::CCTextureAtlas::insertQuad)(*(_QWORD *)(a1 + 328), v12);
}
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 488LL))(a2);
if ( result )
{
result = *(_QWORD *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 488LL))(a2) + 56);
if ( *(_DWORD *)result )
{
v9 = *(_QWORD **)(*(_QWORD *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 488LL))(a2) + 56) + 16LL);
v10 = *(_QWORD *)(*(_QWORD *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 488LL))(a2) + 56) + 16LL);
result = **(unsigned int **)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 488LL))(a2) + 56);
for ( i = v10 + 8 * result - 8; (unsigned __int64)v9 <= i; ++v9 )
{
if ( !*v9 )
break;
result = cocos2d::CCSpriteBatchNode::appendChild(a1, *v9);
}
}
}
return result;
}