//
// EmotePickerPopup::refreshEnabled from 0x100902d30 to 0x100902e54 (292 bytes)
//
// 4 xrefs:
// > EmotePickerPopup::init @ 0x1009028f7
// > EmotePickerPopup::textChanged @ 0x100902e65
// > sub_100902E70 @ 0x100902e7c
// > EmotePickerPopup::onPickEmote @ 0x1009038c5
//
// This function is hookable on this platform (idp: pc, 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:38:03 +0000
//
__int64 __fastcall EmotePickerPopup::refreshEnabled(__int64 a1)
{
__int64 result; // rax
unsigned int v2; // ebx
char v3; // r14
_QWORD *v4; // r12
__int64 v5; // r13
unsigned __int64 v6; // r13
unsigned __int8 v7; // r14
__int64 v8; // r15
__int64 v9; // rax
__int64 v10; // rax
if ( *(_QWORD *)(a1 + 1048) )
{
result = EmotePickerPopup::canAddEmote(a1);
v2 = (unsigned __int8)result;
if ( *(_DWORD *)(a1 + 1208) != (unsigned __int8)result )
{
v3 = result;
*(_DWORD *)(a1 + 1208) = (unsigned __int8)result;
result = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1048) + 488LL))(*(_QWORD *)(a1 + 1048));
if ( result )
{
result = *(_QWORD *)((*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1048) + 488LL))(*(_QWORD *)(a1 + 1048))
+ 56);
if ( *(_DWORD *)result )
{
v4 = *(_QWORD **)(*(_QWORD *)((*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1048) + 488LL))(*(_QWORD *)(a1 + 1048))
+ 56)
+ 16LL);
v5 = *(_QWORD *)(*(_QWORD *)((*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1048) + 488LL))(*(_QWORD *)(a1 + 1048))
+ 56)
+ 16LL);
result = **(unsigned int **)((*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1048) + 488LL))(*(_QWORD *)(a1 + 1048))
+ 56);
v6 = v5 + 8 * result - 8;
if ( (unsigned __int64)v4 <= v6 )
{
v7 = -v3 | 0x5A;
do
{
v8 = *v4;
if ( !*v4 )
break;
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v8 + 1056LL))(*v4, v2);
v9 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 488LL))(v8);
v10 = sub_1007FEFE0(v9, 0);
result = (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v10 + 912LL))(v10, v7);
++v4;
}
while ( (unsigned __int64)v4 <= v6 );
}
}
}
}
}
return result;
}