//
// cocos2d::CCParticleBatchNode::reorderChild from 0xb025a8 to 0xb0272c (388 bytes)
//
// 2 xrefs:
// > ??> @ 0x2fd18
// > ??> @ 0x12170b0
//
// 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 cocos2d::CCParticleBatchNode::reorderChild(cocos2d::CCParticleBatchNode *a1, cocos2d::CCNode *a2, int a3)
{
unsigned int v6; // w20
bool v7; // w3
unsigned int v8; // w3
float y; // w24
float v10; // w3
cocos2d::CCTextureAtlas *m_pTextureAtlas; // x20
unsigned int v12; // w0
unsigned int v13; // [xsp+48h] [xbp+48h]
unsigned int v14; // [xsp+50h] [xbp+50h] BYREF
unsigned int v15; // [xsp+54h] [xbp+54h] BYREF
cocos2d::CCArray::containsObject(a1->m_pChildren, (cocos2d::_ccArray *)a2, _stack_chk_guard);
if ( a2->getZOrder(a2) != a3 )
{
if ( (unsigned int)cocos2d::CCArray::count(a1->m_pChildren) > 1 )
{
v14 = 0;
v15 = 0;
cocos2d::CCParticleBatchNode::getCurrentIndex(a1, &v15, &v14, a2, a3);
if ( v15 != v14 )
{
v6 = 0;
cocos2d::CCObject::retain(a2);
cocos2d::CCArray::removeObjectAtIndex(a1->m_pChildren, (cocos2d::_ccArray *)v15, 1u, v7);
cocos2d::CCArray::insertObject(a1->m_pChildren, (cocos2d::_ccArray *)a2, (cocos2d::CCObject *)v14, v8);
cocos2d::CCObject::release(a2);
y = a2[1].m_obAnchorPoint.y;
cocos2d::CCParticleBatchNode::updateAllAtlasIndexes(a1);
while ( 1 )
{
if ( v6 >= (unsigned int)cocos2d::CCArray::count(a1->m_pChildren) )
{
v10 = 0.0;
goto LABEL_9;
}
if ( a2 == cocos2d::CCArray::objectAtIndex(a1->m_pChildren, v6) )
break;
++v6;
}
v10 = a2[1].m_obAnchorPoint.y;
LABEL_9:
v13 = LODWORD(v10);
m_pTextureAtlas = a1->m_pTextureAtlas;
v12 = ((__int64 (__fastcall *)(cocos2d::CCNode *))a2->__vftable[1].setGrid)(a2);
cocos2d::CCTextureAtlas::moveQuadsFromIndex(m_pTextureAtlas, LODWORD(y), v12, v13);
a2->__vftable[1].visit(a2);
}
}
a2->_setZOrder(a2, a3);
}
}