//
// EditorUI::editorLayerForArray from 0x1401b5350 to 0x1401b53e7 (151 bytes)
//
// 3 xrefs:
// > EditorUI::updateButtons @ 0x1401ad63f
// > EditorUI::updateButtons @ 0x1401ad652
// > ??> @ 0x14091a18c
//
// 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 11:27:57 +0000
//
__int64 __fastcall EditorUI::editorLayerForArray(__int64 a1, cocos2d::CCArray *a2, unsigned __int8 a3)
{
__int64 v3; // r14
unsigned int v5; // ebp
unsigned int v6; // edi
unsigned int v7; // ebx
__int64 v8; // r14
unsigned int v9; // ecx
v3 = a3;
if ( !a2 )
return 0;
v5 = 0;
v6 = 0;
v7 = -1;
if ( !cocos2d::CCArray::count(a2) )
return 0;
v8 = 2 * v3 + 1210;
do
{
v9 = *(__int16 *)((char *)cocos2d::CCArray::objectAtIndex(a2, v6) + v8);
if ( v7 == -1 )
{
v7 = v9;
}
else if ( v7 != v9 )
{
return 0;
}
++v6;
}
while ( v6 < cocos2d::CCArray::count(a2) );
if ( v7 != -1 )
return v7;
return v5;
}