//
// EditorUI::enableButton from 0x481244 to 0x481344 (256 bytes)
//
// 2 xrefs:
// > EditorUI::updateCreateMenu @ 0x48270c
// > EditorUI::updateCreateMenu @ 0x482730
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:49:22 +0000
//
int __fastcall EditorUI::enableButton(int a1, int *a2, int a3, int a4)
{
_DWORD *v5; // r4
int v6; // r0
int (*v7)(void); // r3
int result; // r0
int v9; // r4
char v10; // r3
int (__fastcall *v11)(int, _DWORD *); // r2
int v12; // r3
int *v13; // [sp+4h] [bp-Ch] BYREF
_DWORD v14[2]; // [sp+8h] [bp-8h] BYREF
v13 = a2;
v14[0] = a3;
v14[1] = a4;
v5 = (_DWORD *)(*(int (__fastcall **)(int *))(*a2 + 536))(a2);
v6 = v5[136];
if ( v6 )
{
v7 = *(int (**)(void))(*(_DWORD *)v6 + 480);
}
else
{
result = v5[137];
if ( !result )
goto LABEL_6;
v7 = *(int (**)(void))(*(_DWORD *)result + 480);
}
result = v7();
LABEL_6:
if ( a2[101] < 0 )
return result;
v9 = v5[135];
LOWORD(v13) = -1;
BYTE2(v13) = -1;
if ( *(_DWORD *)(v9 + 1084) != 1 || !GameObject::isColorObject((GameObject *)v9) || !*(_BYTE *)(v9 + 1584) )
{
v12 = *(_DWORD *)(v9 + 892);
if ( v12 > 1328 )
{
if ( v12 != 1584 && v12 != 2012 )
{
LABEL_17:
if ( GameObject::getMainColorMode((GameObject *)v9) != (GJSpriteColor *)((char *)&stru_3EC.st_value + 2) )
goto LABEL_12;
}
}
else if ( v12 < 1327 && (unsigned int)(v12 - 918) > 1 )
{
goto LABEL_17;
}
v10 = 0;
LOWORD(v13) = 0;
goto LABEL_11;
}
LOWORD(v13) = -14136;
v10 = -1;
LABEL_11:
BYTE2(v13) = v10;
LABEL_12:
(*(void (__fastcall **)(int, int **))(*(_DWORD *)v9 + 748))(v9, &v13);
v11 = *(int (__fastcall **)(int, _DWORD *))(*(_DWORD *)v9 + 548);
LOWORD(v14[0]) = -14136;
BYTE2(v14[0]) = -1;
return v11(v9, v14);
}