//
// EditorUI::selectBuildTab from 0x7c2ae8 to 0x7c2c48 (352 bytes)
//
// 6 xrefs:
// > EditorUI::updateCreateMenu @ 0x7c2df0
// > EditorUI::onSelectBuildTab @ 0x7c2e8c
// > EditorUI::handleEditorAction @ 0xbd78a4
// > EditorUI::handleEditorAction @ 0xbd78c0
// > EditorUI::setupCreateMenu @ 0xbfe598
// > ??> @ 0x43510
//
// 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 12:54:07 +0000
//
__int64 __fastcall EditorUI::selectBuildTab(EditorUI *this, unsigned int a2)
{
unsigned int v3; // w21
__int64 result; // x0
unsigned __int64 v5; // x0
EditorSFXManager *v6; // x0
unsigned int v7; // w20
unsigned int v8; // w0
unsigned int v9; // w1
__int64 v10; // x21
bool v11; // zf
cocos2d::CCArray *v12; // x0
unsigned int v13; // w0
unsigned int i; // w20
CCMenuItemToggler *v15; // x0
unsigned __int8 v16; // w1
v3 = a2;
result = *((unsigned int *)this + 384);
if ( (_DWORD)result == a2 || *((_DWORD *)this + 359) != 2 && (_DWORD)result != -1 )
return result;
if ( (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 149)) - 1 <= a2 )
{
v5 = (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 149)) != 1;
if ( !(_DWORD)v5 )
goto LABEL_7;
}
else
{
v5 = v3 != 0;
if ( !v3 )
{
LABEL_7:
v3 = 0;
goto LABEL_8;
}
}
v5 = (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 149)) - 1;
if ( v3 >= (unsigned int)v5 )
{
v5 = cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 149));
v3 = v5 - 1;
}
LABEL_8:
v6 = (EditorSFXManager *)EditorSFXManager::sharedState((EditorSFXManager *)v5);
v7 = 0;
EditorSFXManager::playAction(v6, 164);
*((_DWORD *)this + 384) = v3;
while ( 1 )
{
v8 = cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 149));
v9 = v7;
if ( v7 >= v8 )
break;
while ( 1 )
{
v10 = cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 149), v9);
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v10 + 344LL))(v10, *((_DWORD *)this + 384) == v7);
v11 = v7++ == *((_DWORD *)this + 384);
if ( !v11 )
break;
v12 = *((cocos2d::CCArray **)this + 149);
*((_QWORD *)this + 103) = v10;
v13 = cocos2d::CCArray::count(v12);
v9 = v7;
if ( v7 >= v13 )
goto LABEL_13;
}
}
LABEL_13:
for ( i = 0; ; ++i )
{
result = cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 151));
if ( i >= (unsigned int)result )
break;
v15 = (CCMenuItemToggler *)cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 151), i);
v11 = *((_DWORD *)this + 384) == i;
v16 = v11;
CCMenuItemToggler::toggle(v15, v16);
}
return result;
}