//
// cocos2d::CCParticleBatchNode::addChildHelper from 0x1003b2210 to 0x1003b2337 (295 bytes)
//
// 1 xrefs:
// > cocos2d::CCParticleBatchNode::addChild @ 0x1003b21b0
//
// 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:29:27 +0000
//
__int64 __fastcall cocos2d::CCParticleBatchNode::addChildHelper(__int64 a1, __int64 a2, int a3, unsigned int a4)
{
__int64 v7; // rdi
unsigned int v8; // eax
unsigned int v9; // r12d
unsigned int v10; // r13d
__int64 v11; // rax
void *v12; // r12
unsigned int v14; // [rsp+0h] [rbp-2Ch]
(*(void (__fastcall **)(__int64))(*(_QWORD *)a2 + 512LL))(a2);
v7 = *(_QWORD *)(a1 + 208);
if ( v7 )
{
v14 = a4;
v8 = sub_1007FEF90(v7);
if ( v8 )
goto LABEL_3;
LABEL_8:
v10 = 0;
goto LABEL_9;
}
v12 = operator new(0x40u);
sub_1007FE7B0(v12);
*(_QWORD *)(a1 + 208) = v12;
sub_1007FE870(v12, 4);
v14 = a4;
v8 = sub_1007FEF90(*(_QWORD *)(a1 + 208));
if ( !v8 )
goto LABEL_8;
LABEL_3:
v9 = v8;
v10 = 0;
while ( 1 )
{
v11 = sub_1007FEFE0(*(_QWORD *)(a1 + 208), v10);
if ( (*(int (__fastcall **)(__int64))(*(_QWORD *)v11 + 104LL))(v11) > a3 )
break;
if ( v9 == ++v10 )
{
v10 = v9;
break;
}
}
LABEL_9:
sub_1007FF110(*(_QWORD *)(a1 + 208), a2, v10);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a2 + 72LL))(a2, v14);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a2 + 96LL))(a2, (unsigned int)a3);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a2 + 504LL))(a2, a1);
if ( *(_BYTE *)(a1 + 272) == 1 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)a2 + 704LL))(a2);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a2 + 712LL))(a2);
}
return v10;
}