//
// GJWriteMessagePopup::updateCharCountLabel from 0x1002aa9a0 to 0x1002aaac0 (288 bytes)
//
// 1 xrefs:
// > GJWriteMessagePopup::updateText @ 0x1002aa924
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GJWriteMessagePopup::updateCharCountLabel(GJWriteMessagePopup *a1, int a2)
{
char v2; // al
unsigned int sizex2; // r15d
std::size_t size; // r15
unsigned int v5; // r15d
int v6; // ebx
__int64 v7; // rax
__int64 v8; // r14
void *v9; // rsi
cocos2d::CCString *v10; // rax
const char *CString; // rax
float v12; // [rsp+0h] [rbp-20h]
LOBYTE(v12) = v2;
if ( a2 )
{
sizex2 = a1->m_messageText.m_data.m_short.sizex2;
if ( (sizex2 & 1) != 0 )
size = a1->m_messageText.m_data.m_long.size;
else
LODWORD(size) = sizex2 >> 1;
v6 = 200;
v7 = 744;
}
else
{
v5 = a1->m_subjectText.m_data.m_short.sizex2;
if ( (v5 & 1) != 0 )
size = a1->m_subjectText.m_data.m_long.size;
else
LODWORD(size) = v5 >> 1;
v6 = 35;
v7 = 752;
}
v8 = *(__int64 *)((char *)&a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v7);
if ( (float)(0.69999999 * (float)v6) <= (float)(int)size )
{
v12 = (float)(int)size;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v8 + 1008LL))(v8, 255);
if ( (float)((float)v6 * 0.89999998) <= (float)(int)size )
v9 = &unk_100818EAE;
else
v9 = &unk_100818EAB;
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v8 + 1056LL))(v8, v9);
}
else
{
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v8 + 1008LL))(v8, 100);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v8 + 1056LL))(v8, &unk_100818EAB);
}
v10 = (cocos2d::CCString *)sub_1007AB580("%i", SLOBYTE(v12));
CString = cocos2d::CCString::getCString(v10);
(*(void (__fastcall **)(__int64, const char *))(*(_QWORD *)v8 + 912LL))(v8, CString);
}