//
// SelectEventLayer::onCustomToggleTriggerValue from 0x100489a04 to 0x100489b28 (292 bytes)
//
// 1 xrefs:
// > ??> @ 0x100970770
//
// 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 11:05:50 +0000
//
__int64 __fastcall SelectEventLayer::onCustomToggleTriggerValue(__int64 result, __int64 a2)
{
_QWORD *v2; // x19
int v4; // w0
__int64 *v5; // x8
int v6; // w9
__int64 v7; // x8
__int64 v8; // x21
__int64 v9; // x20
int v10; // w0
__int64 *v11; // x8
int v12; // w9
__int64 v13; // x1
int v14; // [xsp+8h] [xbp-28h] BYREF
int v15; // [xsp+Ch] [xbp-24h] BYREF
v2 = (_QWORD *)result;
if ( !a2 )
goto LABEL_9;
*(_BYTE *)(result + 1024) = 1;
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
v5 = (__int64 *)v2[134];
if ( !v5 )
{
LABEL_7:
v14 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
result = (__int64)sub_1000D8E78((__int64)(v2 + 133), &v14, &v14);
goto LABEL_9;
}
while ( 1 )
{
v6 = *((_DWORD *)v5 + 7);
if ( v4 >= v6 )
break;
LABEL_6:
v5 = (__int64 *)*v5;
if ( !v5 )
goto LABEL_7;
}
if ( v6 < v4 )
{
++v5;
goto LABEL_6;
}
v15 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
result = sub_10005484C(v2 + 133, &v15);
LABEL_9:
v7 = v2[97];
if ( !v7 )
return result;
v8 = *(_QWORD *)(v7 + 56);
if ( !v8 )
return result;
while ( 2 )
{
v9 = *(_QWORD *)(v8 + 264);
v8 = *(_QWORD *)(v8 + 288);
v10 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v9 + 64LL))(v9);
v11 = (__int64 *)v2[134];
if ( !v11 )
{
LABEL_16:
v13 = 0;
goto LABEL_18;
}
while ( 2 )
{
v12 = *((_DWORD *)v11 + 7);
if ( v10 < v12 )
{
LABEL_15:
v11 = (__int64 *)*v11;
if ( !v11 )
goto LABEL_16;
continue;
}
break;
}
if ( v12 < v10 )
{
++v11;
goto LABEL_15;
}
v13 = 1;
LABEL_18:
result = CCMenuItemToggler::toggle(v9, v13);
if ( v8 )
continue;
return result;
}
}