//
// GJBaseGameLayer::controlAreaEffectWithID from 0x1402277f0 to 0x1402279e9 (505 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::controlTriggersWithControlID @ 0x14021e75e
// > ??> @ 0x1406cd8e4
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void GJBaseGameLayer::controlAreaEffectWithID(GJBaseGameLayer *a1, int a2, int a3, GJActionCommand a4)
{
__int64 v6; // r9
GJBaseGameLayer *v7; // rdx
int v8; // ecx
int v9; // ecx
int v10; // ecx
int v11; // ecx
__int64 v12; // rax
__int64 *v13; // r14
__int64 v14; // rsi
__int64 v15; // r8
int v16; // ebp
__int64 v17; // r15
char v18; // cl
__int64 i; // rbx
__int64 v20; // rbx
int v23; // [rsp+70h] [rbp+18h]
v6 = (unsigned int)a2;
v7 = a1;
v8 = 0;
v23 = 0;
do
{
if ( v8 )
{
v9 = v8 - 1;
if ( v9 )
{
v10 = v9 - 1;
if ( v10 )
{
v11 = v10 - 1;
if ( v11 )
{
if ( v11 != 1 )
goto LABEL_33;
v12 = 1720;
}
else
{
v12 = 1696;
}
}
else
{
v12 = 1672;
}
}
else
{
v12 = 1648;
}
}
else
{
v12 = 1624;
}
v13 = (__int64 *)((char *)v7 + v12);
if ( (char *)v7 + v12 )
{
v14 = v13[1];
v15 = *v13;
v16 = 0;
if ( (v14 - *v13) / 232 )
{
v17 = 0;
do
{
v18 = 1;
if ( a3 == -1 )
{
if ( *(_DWORD *)(*(_QWORD *)(v17 + v15 + 160) + 2008LL) != (_DWORD)v6 )
goto LABEL_30;
}
else if ( *(_DWORD *)(v17 + v15 + 224) != a3 )
{
goto LABEL_30;
}
if ( a4 )
{
if ( a4 == Pause )
{
*(_WORD *)(v17 + v15 + 188) = 257;
}
else if ( a4 == Resume )
{
*(_WORD *)(v17 + v15 + 188) = 0;
}
}
else
{
for ( i = v15 + 232LL * v16 + 232; i != v14; i += 232 )
sub_140250C90(i - 232, i, v15, v6);
v20 = v13[1];
sub_14005E430(v20 - 32);
sub_1402508A0(v20 - 232, v20 - 232);
v13[1] -= 232;
v6 = (unsigned int)a2;
v18 = 0;
}
if ( a3 == -1 && (int)v6 > 0 )
break;
if ( v18 )
{
LABEL_30:
++v16;
v17 += 232;
}
v14 = v13[1];
v15 = *v13;
}
while ( v16 < (unsigned __int64)((v14 - *v13) / 232) );
}
v7 = a1;
}
LABEL_33:
v8 = v23 + 1;
v23 = v8;
}
while ( v8 < 5 );
}