//
// SetupTouchTogglePopup::onTouchMode from 0xaa2888 to 0xaa2940 (184 bytes)
//
// 4 xrefs:
// > ??> @ 0x43840
// > SetupTouchTogglePopup::init @ 0xaa31dc
// > SetupTouchTogglePopup::init @ 0xaa3260
// > ??> @ 0x1541378
//
// 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:00:49 +0000
//
__int64 __fastcall SetupTouchTogglePopup::onTouchMode(SetupTouchTogglePopup *this, cocos2d::CCObject *a2)
{
int v3; // w1
__int64 v4; // x0
cocos2d::CCArray *v6; // x0
unsigned int v7; // w20
bool v8; // cf
unsigned int v9; // w1
if ( (*(unsigned int (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)a2 + 64LL))(a2) == 1 )
v3 = 1;
else
v3 = 2;
v4 = *((_QWORD *)this + 85);
if ( *((_DWORD *)this + 258) == v3 )
v3 = 0;
*((_DWORD *)this + 258) = v3;
if ( v4 )
{
*(_DWORD *)(v4 + 1640) = v3;
v3 = *((_DWORD *)this + 258);
}
else
{
v6 = *((cocos2d::CCArray **)this + 86);
if ( v6 )
{
v7 = 0;
while ( 1 )
{
v8 = v7 >= (unsigned int)cocos2d::CCArray::count(v6);
v9 = v7++;
if ( v8 )
break;
*(_DWORD *)(cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 86), v9) + 1640) = *((_DWORD *)this + 258);
v6 = *((cocos2d::CCArray **)this + 86);
}
v3 = *((_DWORD *)this + 258);
}
}
CCMenuItemToggler::toggle(*((CCMenuItemToggler **)this + 130), v3 == 1);
return CCMenuItemToggler::toggle(*((CCMenuItemToggler **)this + 131), *((_DWORD *)this + 258) == 2);
}