//
// EmotePickerPopup::onPickEmote from 0x1004dba40 to 0x1004dbb80 (320 bytes)
//
// 1 xrefs:
// > EmotePickerPopup::addCell @ 0x1004db754
//
// 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:06:34 +0000
//
void __fastcall EmotePickerPopup::onPickEmote(_QWORD *a1, __int64 a2)
{
__int64 v4; // x0
__int64 v5; // x0
char **v6; // x20
__int64 v7; // x0
__int64 v8; // x20
__int64 v9; // x0
std::string __p; // [xsp+0h] [xbp-40h] BYREF
std::string v11; // [xsp+18h] [xbp-28h] BYREF
if ( (unsigned int)EmotePickerPopup::canAddEmote() )
{
LODWORD(v4) = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
v4 = (int)v4 <= 99999 ? (unsigned int)v4 : (unsigned int)(v4 - 100000);
v5 = EmoteSprite::defAtIndex(v4);
if ( v5 )
{
v6 = (char **)v5;
v7 = GameManager::sharedState();
sub_1003B7D1C(v7, *v6);
if ( a1[146] )
{
sub_100009900(&v11, ":");
std::string::append(&v11, *v6);
std::string::append(&v11, ":");
v8 = a1[146];
if ( SHIBYTE(v11.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&__p, v11.__r_.__value_.__l.__data_, v11.__r_.__value_.__l.__size_);
else
__p = v11;
CCTextInputNode::insertAtCursor(v8, (__int64)&__p);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
EmotePickerPopup::refreshEnabled((__int64)a1);
if ( SHIBYTE(v11.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v11.__r_.__value_.__l.__data_);
}
else
{
v9 = a1[148];
if ( v9 )
(*(void (__fastcall **)(__int64, _QWORD *, char **))(*(_QWORD *)v9 + 8LL))(v9, a1, v6);
(*(void (__fastcall **)(_QWORD *, _QWORD))(*a1 + 1368LL))(a1, 0);
}
}
}
}