//
// ThreadViewPopup::updateComposeCount from 0x1400e37c0 to 0x1400e3955 (405 bytes)
//
// 3 xrefs:
// > ThreadViewPopup::exitSearch @ 0x1400dbdee
// > ThreadViewPopup::textChanged @ 0x1400e2f5d
// > ??> @ 0x140914b34
//
// 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:32 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall ThreadViewPopup::updateComposeCount(__int64 a1, __int64 a2, __int64 a3, double a4)
{
__int64 v5; // rax
_BYTE *v6; // rax
size_t v7; // r8
__int64 v8; // rdx
__int64 v9; // rcx
__int64 v10; // r8
__int64 v11; // r8
int v12; // ebp
__int64 v13; // rdx
void *v14; // r8
__int16 *v15; // rdx
__int64 v16; // rdi
void (__fastcall **v17)(__int64, const char *); // rbx
cocos2d::CCString *v18; // rax
const char *CString; // rax
void *Block[2]; // [rsp+38h] [rbp-30h] BYREF
__int128 v21; // [rsp+48h] [rbp-20h]
if ( *(_QWORD *)(a1 + 1016) )
{
v5 = *(_QWORD *)(a1 + 920);
if ( v5 )
{
v6 = (_BYTE *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(*(_QWORD *)(v5 + 592) + 600LL) + 8LL))(*(_QWORD *)(v5 + 592) + 600LL);
*(_OWORD *)Block = 0;
v21 = 0;
v7 = -1;
do
++v7;
while ( v6[v7] );
sub_14003D230(Block, v6, v7);
ensureEmotesAreLoaded(v9, v8, v10, a4);
v12 = EmoteSprite::effectiveLength(Block, dword_1408FE394, v11, a4);
v13 = *((_QWORD *)&v21 + 1);
if ( *((_QWORD *)&v21 + 1) > 0xFu )
{
v14 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v21 + 1) + 1LL) >= 0x1000 )
{
v14 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v14 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v14);
}
LOBYTE(v13) = (float)v12 >= 350.0;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 1016) + 336LL))(*(_QWORD *)(a1 + 1016), v13);
v15 = &word_140702E70;
if ( v12 > 500 )
v15 = (__int16 *)&unk_140702E68;
(**(void (__fastcall ***)(__int64, __int16 *))(*(_QWORD *)(a1 + 1016) + 368LL))(
*(_QWORD *)(a1 + 1016) + 368LL,
v15);
v16 = *(_QWORD *)(a1 + 1016);
v17 = *(void (__fastcall ***)(__int64, const char *))(v16 + 360);
v18 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)(500 - v12));
CString = cocos2d::CCString::getCString(v18);
(*v17)(v16 + 360, CString);
}
}
}