//
// ThreadDescPopup::onEmotes from 0x1400fda40 to 0x1400fdb61 (289 bytes)
//
// 3 xrefs:
// > ThreadDescPopup::buildUI @ 0x1400fd19a
// > ??> @ 0x14091553c
// > ??> @ 0x140915548
//
// 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 11:26:41 +0000
//
void __fastcall ThreadDescPopup::onEmotes(__int64 a1, __int64 a2, __int64 a3, double a4)
{
__int64 v6; // rbp
int v7; // r15d
__int64 v8; // r14
__int64 v9; // rcx
const struct cocos2d::CCPoint *v10; // r12
void *v11; // rbx
cocos2d::CCObject *v12; // rbx
int v13; // eax
char v14; // [rsp+70h] [rbp+8h] BYREF
void *v15; // [rsp+80h] [rbp+18h] BYREF
v6 = a1 + 1008;
if ( !a1 )
v6 = 0;
ensureEmotesAreLoaded(a1, a2, a3, a4);
v7 = dword_1408FE3A4;
v8 = *(_QWORD *)(a1 + 1032);
v9 = *(_QWORD *)(a1 + 1136);
if ( v9 )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v9 + 1104LL))(v9, 0);
LABEL_5:
*(_QWORD *)(a1 + 1136) = 0;
return;
}
if ( !a2 || !v8 )
goto LABEL_5;
v10 = (const struct cocos2d::CCPoint *)EmotePickerPopup::buttonAnchor(&v14, a2);
v11 = operator new(0x4C8u);
v15 = v11;
memset(v11, 0, 0x4C8u);
v12 = (cocos2d::CCObject *)EmotePickerPopup::EmotePickerPopup(v11);
if ( !v12 )
goto LABEL_12;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v15, v10);
if ( !(unsigned __int8)EmotePickerPopup::init((_DWORD)v12, v8, v13, v7, 300) )
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v12 + 8LL))(v12, 1);
LABEL_12:
v12 = nullptr;
goto LABEL_13;
}
cocos2d::CCObject::autorelease(v12);
LABEL_13:
*(_QWORD *)(a1 + 1136) = EmotePickerPopup::openAt(v12, v6, a2);
}