//
// cocos2d::CCSpriteBatchNode::atlasIndexForChild from 0xd88eb0 to 0xd89004 (340 bytes)
//
// 3 xrefs:
// > cocos2d::CCSpriteBatchNode::insertChild @ 0xd891e4
// > cocos2d::CCSpriteBatchNode::insertChild @ 0xd892dc
// > ??> @ 0x81d00
//
// This function is hookable on this platform (idp: arm, 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 13:08:14 +0000
//
__int64 __fastcall cocos2d::CCSpriteBatchNode::atlasIndexForChild(
cocos2d::CCSpriteBatchNode *this,
cocos2d::CCSprite *a2,
int a3)
{
cocos2d::CCSprite *v6; // x20
__int64 v7; // x0
cocos2d::CCArray *v8; // x25
int v9; // w21
cocos2d::CCSpriteBatchNode *v10; // x0
cocos2d::CCSpriteBatchNode *v11; // x23
__int64 result; // x0
v6 = nullptr;
v7 = (*(__int64 (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)a2 + 512LL))(a2);
v8 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 488LL))(v7);
v9 = cocos2d::CCArray::indexOfObject(v8, a2);
v10 = (cocos2d::CCSpriteBatchNode *)(*(__int64 (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)a2 + 512LL))(a2);
v11 = v10;
if ( (unsigned int)(v9 - 1) <= 0xFFFFFFFD )
{
v6 = (cocos2d::CCSprite *)cocos2d::CCArray::objectAtIndex(v8, v9 - 1);
if ( v11 != this )
goto LABEL_3;
LABEL_13:
result = 0;
if ( v9 )
return (unsigned int)cocos2d::CCSpriteBatchNode::highestAtlasIndexInChild(v11, v6) + 1;
return result;
}
if ( v10 == this )
goto LABEL_13;
LABEL_3:
if ( v9 )
{
if ( ((*(__int64 (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)v6 + 104LL))(v6) & 0x80000000) != 0 && a3 < 0
|| ((*(__int64 (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)v6 + 104LL))(v6) & 0x80000000) == 0
&& (a3 & 0x80000000) == 0 )
{
return (unsigned int)cocos2d::CCSpriteBatchNode::highestAtlasIndexInChild(this, v6) + 1;
}
LODWORD(result) = *(_DWORD *)((*(__int64 (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)a2 + 512LL))(a2) + 360);
}
else
{
result = *(unsigned int *)((*(__int64 (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)a2 + 512LL))(a2) + 360);
if ( a3 < 0 )
return result;
}
return (unsigned int)(result + 1);
}