//
// GJGarageLayer::selectTab from 0x8c0ca8 to 0x8c0da0 (248 bytes)
//
// 3 xrefs:
// > GJGarageLayer::setupIconSelect @ 0x8c18ac
// > GJGarageLayer::onSelectTab @ 0x8c194c
// > ??> @ 0xf2638
//
// 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:56:31 +0000
//
__int64 __fastcall GJGarageLayer::selectTab(__int64 a1, int a2)
{
unsigned int v3; // w20
unsigned int v4; // w1
CCMenuItemToggler *v5; // x19
int v6; // w21
__int64 v7; // x0
int v9[3]; // [xsp+4Ch] [xbp+4Ch] BYREF
int *v10; // [xsp+60h] [xbp+60h] BYREF
v9[0] = a2;
v3 = 0;
while ( v3 < (unsigned int)cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 480)) )
{
v4 = v3++;
v5 = (CCMenuItemToggler *)cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 480), v4);
v6 = (*(__int64 (__fastcall **)(CCMenuItemToggler *))(*(_QWORD *)v5 + 64LL))(v5);
CCMenuItemToggler::toggle(v5, v9[0] == v6);
(*(void (__fastcall **)(CCMenuItemToggler *, bool))(*(_QWORD *)v5 + 1056LL))(v5, v9[0] != v6);
}
v10 = v9;
v7 = std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::__emplace_unique_key_args,std::tuple<>>(
(__int64 **)(a1 + 520),
v9,
(__int64)&unk_114CA08,
&v10);
GJGarageLayer::setupPage(a1, *(_DWORD *)(v7 + 32), v9[0]);
return _stack_chk_guard;
}