//
// ThreadViewPopup::measureBody from 0x75b184 to 0x75b452 (718 bytes)
//
// 2 xrefs:
// > ThreadViewPopup::layoutRows @ 0x75ba58
// > ThreadViewPopup::mountVirtualRow @ 0x75f714
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:58:59 +0000
//
_DWORD *__fastcall ThreadViewPopup::measureBody(ThreadViewPopup *this, GJThreadMessage *a2)
{
_DWORD *v4; // r12
_DWORD *v5; // r4
__int64 v6; // r0
_DWORD *v7; // r2
_DWORD *v8; // r3
int v9; // r2
int v10; // r3
int v11; // lr
size_t v12; // r2
int v13; // r1
int v14; // r3
char *v15; // r0
unsigned __int8 *v16; // r1
char *v17; // r0
unsigned __int8 *v18; // r2
int v19; // t1
_DWORD *v20; // r4
unsigned __int8 *v21; // r7
unsigned int v22; // r4
int *v23; // r0
int v24; // r2
char *v25; // r3
int *v26; // r3
char *v27; // r3
int v28; // r0
EmoteSprite *v29; // r0
EmoteSprite *v30; // r11
int v31; // r0
int v32; // r2
int v33; // r3
int v34; // r4
float v35; // s16
EmoteSprite *v36; // r0
float v37; // r0
int v38; // s16
EmoteSprite *v39; // r0
int v40; // r0
int v41; // r4
EmoteSprite *v42; // r0
int v43; // r0
int **v44; // r5
unsigned __int8 *v45; // r4
__int64 v47; // [sp+10h] [bp-6Ch] BYREF
_BYTE v48[8]; // [sp+18h] [bp-64h] BYREF
char *v49[3]; // [sp+20h] [bp-5Ch] BYREF
int v50[2]; // [sp+2Ch] [bp-50h] BYREF
char *v51; // [sp+34h] [bp-48h]
int v52[3]; // [sp+38h] [bp-44h] BYREF
int v53[3]; // [sp+44h] [bp-38h] BYREF
int v54[3]; // [sp+50h] [bp-2Ch] BYREF
_DWORD v55[3]; // [sp+5Ch] [bp-20h] BYREF
float v56; // [sp+68h] [bp-14h]
float v57; // [sp+6Ch] [bp-10h]
bool v58; // [sp+70h] [bp-Ch]
v4 = (_DWORD *)((char *)this + 552);
v5 = v4;
v6 = *((_QWORD *)a2 + 7);
v7 = (_DWORD *)*v4;
if ( v6 < 0 )
v6 = 0;
v47 = v6;
while ( v7 )
{
if ( *((_QWORD *)v7 + 2) >= v6 )
{
v8 = (_DWORD *)*v7;
}
else
{
v8 = (_DWORD *)v7[1];
v7 = v5;
}
v5 = v7;
v7 = v8;
}
if ( v5 != v4 && v6 >= *((_QWORD *)v5 + 2) )
{
v9 = *((unsigned __int8 *)v5 + 24);
v10 = *((unsigned __int8 *)a2 + 68);
v11 = v9 & 1;
v12 = (v9 & 1) != 0 ? v5[7] : v9 >> 1;
v13 = v10 & 1;
v14 = (v10 & 1) != 0 ? *((_DWORD *)a2 + 18) : v10 >> 1;
if ( v12 == v14 )
{
if ( v11 )
v15 = (char *)v5[8];
else
v15 = (char *)v5 + 25;
if ( v13 )
v16 = *((unsigned __int8 **)a2 + 19);
else
v16 = (unsigned __int8 *)a2 + 69;
if ( !v11 )
{
v17 = v15 - 1;
v18 = &v16[v12];
while ( v16 != v18 )
{
v19 = (unsigned __int8)*++v17;
if ( v19 != *v16 )
goto LABEL_32;
++v16;
}
return v5 + 6;
}
if ( !std::char_traits::compare(v15, v16, v12) )
return v5 + 6;
}
}
LABEL_32:
v21 = (unsigned __int8 *)a2 + 68;
memset(v55, 0, sizeof(v55));
v22 = 0;
std::string::operator=((unsigned __int8 *)v55, v21);
memset(v49, 0, sizeof(v49));
v23 = ThreadViewPopup::expandShareTokens(v50, v21, (int)v49);
memset(v54, 0, sizeof(v54));
while ( 1 )
{
v24 = v50[0] & 1;
if ( !v24 )
break;
if ( v22 >= v50[1] )
goto LABEL_47;
v25 = v51;
LABEL_38:
if ( v25[v22] != 32 )
{
v26 = v24 ? (int *)v51 : (int *)((char *)v50 + 1);
if ( *((_BYTE *)v26 + v22) != 10 )
{
if ( v24 )
v27 = v51;
else
v27 = (char *)v50 + 1;
std::string::push_back(v54, v27[v22]);
}
}
++v22;
}
if ( v22 < LOBYTE(v50[0]) >> 1 )
{
v25 = (char *)v50 + 1;
goto LABEL_38;
}
LABEL_47:
v28 = EmoteSprite::maxEmotesMessage((EmoteSprite *)v23);
v29 = (EmoteSprite *)EmoteSprite::parseTokens((unsigned __int8 *)v54, 0, v28);
v30 = v29;
if ( (int)v29 <= 0
|| (v31 = EmoteSprite::maxEmotesMessage(v29),
v34 = EmoteSprite::effectiveLength((unsigned __int8 *)v54, v31, v32, v33),
(EmoteSprite *)v34 != v30) )
{
v34 = 0;
}
v35 = 0.75;
v36 = (EmoteSprite *)std::string::~string((int)v54);
v58 = v34 > 0;
if ( v34 > 0 )
{
if ( v34 == 1 )
v37 = COERCE_FLOAT(EmoteSprite::jumboScale(v36));
else
v37 = COERCE_FLOAT(EmoteSprite::jumboMultiScale(v36));
v35 = v37 * 0.75;
}
v56 = v35;
std::string::basic_string(v52, (int)v50);
*(float *)&v38 = (float)(*((float *)this + 157) - 58.0) / v56;
v39 = (EmoteSprite *)cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v48, 0.0, 1.0);
v40 = EmoteSprite::maxEmotesMessage(v39);
v41 = TextArea::create((int)v52, "chatFont.fnt", 1065353216, v38, (const cocos2d::CCPoint *)v48, 1101004800, 1, v40);
v42 = (EmoteSprite *)std::string::~string((int)v52);
*(_BYTE *)(v41 + 509) = 1;
if ( v58 )
{
v43 = EmoteSprite::jumboMaxAspect(v42);
TextArea::setEmoteMaxAspect(v41, *(float *)&v43);
}
std::string::basic_string(v53, (int)v50);
TextArea::setString(v41, v53);
v44 = (int **)((char *)this + 548);
std::string::~string((int)v53);
v57 = (float)((float)*(int *)(v41 + 568) + *(float *)(v41 + 544)) * v56;
v45 = (unsigned __int8 *)std::map::operator[](v44, &v47);
std::string::operator=(v45, (unsigned __int8 *)v55);
*((float *)v45 + 3) = v56;
*((float *)v45 + 4) = v57;
v45[20] = v58;
v20 = std::map::operator[](v44, &v47);
std::string::~string((int)v50);
std::__vector_base::~__vector_base(v49);
std::string::~string((int)v55);
return v20;
}