//
// EditorUI::getCycledObject from 0x382054 to 0x3820b6 (98 bytes)
//
// 3 xrefs:
// > EditorUI::onDelete @ 0x3a43be
// > EditorUI::ccTouchEnded @ 0x3a57c6
// > EditorUI::ccTouchEnded @ 0x3a587a
//
// 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
//
GameObject *EditorUI::getCycledObject(EditorUI *a1, cocos2d::CCArray *a2, bool a3)
{
unsigned int v3; // r6
_BOOL4 v6; // r9
int v7; // r4
int v8; // r0
int v9; // r5
v3 = 0;
v6 = a3;
v7 = 0;
while ( v3 < cocos2d::CCArray::count(a2) )
{
v8 = cocos2d::CCArray::objectAtIndex(a2, v3);
v9 = v8;
if ( *(_BYTE *)(v8 + 981) && !v6
|| v7 && *(_DWORD *)(v8 + 984) >= *(_DWORD *)(v7 + 984)
|| !EditorUI::canSelectObject(a1, (GameObject *)v8) )
{
v9 = v7;
}
++v3;
v7 = v9;
}
if ( v7 )
*(_DWORD *)(v7 + 984) = a1->m_cycledObjectIndex;
return (GameObject *)v7;
}