//
// cocos2d::CCParticleBatchNode::getCurrentIndex from 0x1003c9320 to 0x1003c9423 (259 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall cocos2d::CCParticleBatchNode::getCurrentIndex(
cocos2d::CCParticleBatchNode *a1,
unsigned int *a2,
unsigned int *a3,
cocos2d::CCNode *a4,
int a5)
{
unsigned int v5; // r13d
unsigned int v6; // r14d
char v7; // r12
cocos2d::CCNode *v8; // r15
int v9; // eax
char v13; // [rsp+20h] [rbp-30h]
int v14; // [rsp+24h] [rbp-2Ch]
v5 = sub_100720070(a1->m_pChildren);
if ( v5 )
{
v13 = 0;
v6 = 0;
v7 = 0;
v14 = 0;
do
{
while ( 1 )
{
v8 = (cocos2d::CCNode *)sub_1007200C0(a1->m_pChildren, v6);
if ( ((int (__fastcall *)(cocos2d::CCNode *))v8->getZOrder)(v8) > a5 && (v7 & 1) == 0 )
{
*a3 = v6;
v7 = 1;
if ( (v13 & 1) != 0 )
{
v5 = v6;
goto LABEL_14;
}
}
if ( v8 == a4 )
break;
if ( v5 == ++v6 )
goto LABEL_11;
}
*a2 = v6;
if ( (v7 & 1) != 0 )
break;
v13 = 1;
v14 = -1;
++v6;
}
while ( v5 != v6 );
LABEL_11:
if ( (v7 & 1) != 0 )
v5 = *a3;
LABEL_14:
v9 = v14;
}
else
{
v9 = 0;
}
*a3 = v9 + v5;
}