//
// GJEffectManager::playerButton from 0xa1240c to 0xa12644 (568 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::handleButton @ 0x9c27d4
// > ??> @ 0xa0378
//
// 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:59:31 +0000
//
__int64 __fastcall GJEffectManager::playerButton(GJEffectManager *this, unsigned __int8 a2, unsigned __int8 a3)
{
int v3; // w21
__int64 v4; // x4
__int64 v5; // x2
int v6; // w24
__int64 v8; // x19
unsigned __int64 v9; // x20
int v10; // w26
__int64 v11; // x27
int v12; // w0
_BOOL4 v13; // w28
int v14; // w0
int v16; // w0
void *v17; // [xsp+60h] [xbp+60h] BYREF
char *v18; // [xsp+68h] [xbp+68h]
v3 = a3;
v4 = *((_QWORD *)this + 57);
v5 = *((_QWORD *)this + 56);
v6 = a2;
v8 = 0;
v9 = 1;
v10 = a2 ^ 1;
if ( 0x6DB6DB6DB6DB6DB7LL * ((v4 - v5) >> 3) )
{
while ( 1 )
{
v11 = v5 + v8;
if ( *(_BYTE *)(v5 + v8) || *(_BYTE *)(v11 + 28) && v3 )
goto LABEL_4;
v12 = *(_DWORD *)(v11 + 16);
if ( v12 )
{
if ( v12 == 1 )
{
if ( !v3 )
goto LABEL_4;
}
else if ( v12 != 2 || v3 )
{
goto LABEL_4;
}
}
if ( !v6 && !*(_BYTE *)(v11 + 8) )
goto LABEL_4;
v13 = !GJEffectManager::isGroupEnabled(this, *(_DWORD *)(v11 + 4));
if ( *(_BYTE *)(v11 + 8) )
{
v14 = *(_DWORD *)(v11 + 12);
if ( v14 )
{
if ( v14 == 1 )
v13 = v6;
else
v13 = v10;
if ( !*((_QWORD *)this + 40) )
{
LABEL_27:
GJEffectManager::toggleGroup(this, *(_DWORD *)(v11 + 4), v13);
LABEL_28:
v5 = *((_QWORD *)this + 56);
v4 = *((_QWORD *)this + 57);
goto LABEL_4;
}
goto LABEL_14;
}
}
else
{
v16 = *(_DWORD *)(v11 + 12);
if ( v16 )
v13 = v16 == 1;
}
if ( !*((_QWORD *)this + 40) )
goto LABEL_27;
LABEL_14:
std::vector::vector((__int64 *)&v17, (const void **)(v11 + 32));
(***((void (__fastcall ****)(_QWORD, _QWORD, _BOOL4, void **, _QWORD, _QWORD))this + 40))(
*((_QWORD *)this + 40),
*(unsigned int *)(v11 + 4),
v13,
&v17,
*(unsigned int *)(v11 + 20),
*(unsigned int *)(v11 + 24));
if ( !v17 )
goto LABEL_28;
if ( v17 != v18 )
v18 += 4 * ~((unsigned __int64)(v18 - 4 - (_BYTE *)v17) >> 2);
operator delete(v17);
v5 = *((_QWORD *)this + 56);
v4 = *((_QWORD *)this + 57);
LABEL_4:
v8 += 56;
if ( 0x6DB6DB6DB6DB6DB7LL * ((v4 - v5) >> 3) <= v9 )
return _stack_chk_guard;
++v9;
}
}
return _stack_chk_guard;
}