//
// ThreadDescPopup::refreshIconSlot from 0x1400fd750 to 0x1400fd933 (483 bytes)
//
// 3 xrefs:
// > ThreadDescPopup::buildUI @ 0x1400fd0ef
// > ThreadDescPopup::emotePicked @ 0x1400fdbaa
// > ??> @ 0x140915530
//
// 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::refreshIconSlot(__int64 a1, __int64 a2, __int64 a3, double a4)
{
__int64 v5; // rcx
__int64 v6; // r8
__int64 v7; // rdx
__int64 v8; // rax
int v9; // ebx
__int64 v10; // rax
_QWORD *v11; // r14
void *v12; // rcx
__int64 v13; // rbx
float *v14; // rdi
__int64 v15; // rsi
__int64 v16; // rax
__int64 v17; // rax
int v18; // [rsp+30h] [rbp-68h] BYREF
void *Block[2]; // [rsp+38h] [rbp-60h] BYREF
__m128i si128; // [rsp+48h] [rbp-50h]
_BYTE v21[32]; // [rsp+58h] [rbp-40h] BYREF
v18 = 0;
v5 = *(_QWORD *)(a1 + 1120);
if ( v5 )
{
LOBYTE(a3) = 1;
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v5 + 552LL))(v5, 1, a3);
v7 = a1 + 1080;
if ( *(_QWORD *)(a1 + 1096) )
{
v8 = sub_14003F4F0((__int64)v21, v7);
v9 = 2;
}
else
{
*(_OWORD *)Block = 0;
si128 = _mm_load_si128((const __m128i *)&xmmword_140836530);
strcpy((char *)Block, "na");
v8 = (__int64)Block;
v9 = 1;
}
v18 = v9;
v10 = EmoteSprite::defForName(v8, v7, v6, a4);
if ( v10 )
v11 = EmoteSprite::createWithDef(v10);
else
v11 = nullptr;
if ( (v9 & 2) != 0 )
{
LOBYTE(v9) = v9 & 0xFD;
sub_14003D310((__int64)v21);
}
if ( (v9 & 1) != 0 && si128.m128i_i64[1] > 0xFuLL )
{
v12 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v12 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v12 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v12);
}
if ( v11 )
{
EmoteSprite::fitToHeight(v11, 20.0, 0.0);
v13 = *(_QWORD *)(a1 + 1120);
v14 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v13 + 320LL))(v13);
v15 = *v11;
v16 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v13 + 320LL))(v13);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v18, *v14 * 0.5, *(float *)(v16 + 4) * 0.5);
(*(void (__fastcall **)(_QWORD *, __int64))(v15 + 184))(v11, v17);
(*(void (__fastcall **)(_QWORD *, __int64))(*v11 + 64LL))(v11, 1);
(*(void (__fastcall **)(_QWORD, _QWORD *, __int64))(**(_QWORD **)(a1 + 1120) + 456LL))(
*(_QWORD *)(a1 + 1120),
v11,
1);
}
}
}