//
// ThreadViewPopup::measureBody from 0xc85014 to 0xc85628 (1556 bytes)
//
// 3 xrefs:
// > ThreadViewPopup::layoutRows @ 0xc859c4
// > ThreadViewPopup::mountVirtualRow @ 0xc8b7a8
// > ??> @ 0xd1a58
//
// This function is hookable on this platform (idp: arm, 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 13:05:41 +0000
//
__int64 __fastcall ThreadViewPopup::measureBody(ThreadViewPopup *this, GJThreadMessage *a2)
{
__int64 v3; // x3
char *v5; // x0
char *v6; // x1
char *v7; // x4
unsigned __int8 v8; // w0
__int64 v9; // x20
int v10; // w3
size_t v11; // x2
unsigned __int8 v12; // w0
__int64 *v13; // x21
int v14; // w5
char *v15; // x1
size_t v16; // x2
EmoteSprite *v17; // x0
unsigned __int64 v18; // x19
int v19; // w2
int v20; // w1
int v21; // w0
EmoteSprite *v22; // x0
int v23; // w19
int v24; // w0
float v25; // s8
float v26; // s8
EmoteSprite *v27; // x0
int v28; // w0
__int64 v29; // x21
EmoteSprite *v30; // x0
int v31; // w0
float v32; // s1
__int64 **v33; // x25
__int64 v34; // x0
__int64 v35; // x22
char *v36; // x1
size_t v37; // x2
float v38; // w5
unsigned __int8 *v40; // x0
unsigned __int8 *v41; // x1
unsigned __int8 *v42; // x3
unsigned __int8 *v43; // x0
int v44; // t1
float v45; // s0
float v46; // s0
__int64 v47; // [xsp+68h] [xbp+68h] BYREF
__int64 *v48; // [xsp+70h] [xbp+70h] BYREF
__int64 *v49; // [xsp+78h] [xbp+78h] BYREF
void *v50; // [xsp+80h] [xbp+80h] BYREF
char *v51; // [xsp+88h] [xbp+88h]
__int64 v52; // [xsp+90h] [xbp+90h]
EmoteSprite *v53; // [xsp+98h] [xbp+98h] BYREF
size_t v54; // [xsp+A0h] [xbp+A0h]
void *v55; // [xsp+A8h] [xbp+A8h]
EmoteSprite *v56; // [xsp+B0h] [xbp+B0h] BYREF
size_t v57; // [xsp+B8h] [xbp+B8h]
void *v58; // [xsp+C0h] [xbp+C0h]
EmoteSprite *v59; // [xsp+C8h] [xbp+C8h] BYREF
size_t v60; // [xsp+D0h] [xbp+D0h]
void *v61; // [xsp+D8h] [xbp+D8h]
__int64 v62; // [xsp+E0h] [xbp+E0h] BYREF
size_t v63; // [xsp+E8h] [xbp+E8h]
void *v64; // [xsp+F0h] [xbp+F0h]
float v65; // [xsp+F8h] [xbp+F8h]
float v66; // [xsp+FCh] [xbp+FCh]
EmoteSprite *v67; // [xsp+100h] [xbp+100h]
v3 = *((_QWORD *)a2 + 7);
v5 = (char *)this + 728;
v6 = *((char **)this + 91);
if ( v3 < 0 )
v3 = 0;
v7 = v5;
v47 = v3;
if ( !v6 )
goto LABEL_26;
do
{
while ( v3 <= *((_QWORD *)v6 + 4) )
{
v7 = v6;
v6 = *(char **)v6;
if ( !v6 )
goto LABEL_6;
}
v6 = *((char **)v6 + 1);
}
while ( v6 );
LABEL_6:
if ( v5 == v7 || v3 < *((_QWORD *)v7 + 4) )
{
LABEL_26:
v13 = (__int64 *)((char *)a2 + 72);
goto LABEL_12;
}
v8 = v7[40];
v9 = (__int64)(v7 + 40);
v10 = v8 & 1;
v11 = v8 >> 1;
if ( (v8 & 1) != 0 )
v11 = *((_QWORD *)v7 + 6);
v12 = *((_BYTE *)a2 + 72);
v13 = (__int64 *)((char *)a2 + 72);
v14 = v12 & 1;
if ( (v12 & 1) != 0 )
{
if ( v11 != *((_QWORD *)a2 + 10) )
goto LABEL_12;
}
else if ( v11 != v12 >> 1 )
{
goto LABEL_12;
}
v40 = (unsigned __int8 *)(v7 + 41);
if ( v10 )
v40 = *((unsigned __int8 **)v7 + 7);
v41 = (unsigned __int8 *)a2 + 73;
if ( v14 )
v41 = *((unsigned __int8 **)a2 + 11);
if ( v10 )
{
if ( !v11 || !memcmp(v40, v41, v11) )
return v9;
LABEL_12:
v62 = 0;
v63 = 0;
v64 = nullptr;
if ( v13 != &v62 )
{
if ( (*((_BYTE *)a2 + 72) & 1) != 0 )
{
v15 = (char *)v13[2];
v16 = v13[1];
}
else
{
v15 = (char *)a2 + 73;
v16 = *((_BYTE *)a2 + 72) >> 1;
}
std::string::assign(&v62, v15, v16);
}
v50 = nullptr;
v51 = nullptr;
v52 = 0;
ThreadViewPopup::expandShareTokens((__int64)v13, &v50, (__int64 *)&v53);
v17 = (EmoteSprite *)(unsigned __int8)v53;
v18 = 0;
v59 = nullptr;
v60 = 0;
v19 = (unsigned __int8)v53 & 1;
v61 = nullptr;
if ( ((unsigned __int8)v53 & 1) == 0 )
goto LABEL_23;
while ( v18 < v54 )
{
v20 = *((unsigned __int8 *)v55 + v18);
if ( v20 != 32 )
{
LABEL_19:
if ( v20 != 10 )
{
std::string::push_back((__int64 *)&v59, v20);
v17 = (EmoteSprite *)(unsigned __int8)v53;
v19 = (unsigned __int8)v53 & 1;
}
}
++v18;
while ( !v19 )
{
LABEL_23:
if ( v18 >= (unsigned __int8)v17 >> 1 )
goto LABEL_29;
v20 = *((unsigned __int8 *)&v53 + v18 + 1);
if ( v20 != 32 )
goto LABEL_19;
++v18;
}
}
LABEL_29:
v21 = EmoteSprite::maxEmotesMessage(v17);
v22 = (EmoteSprite *)EmoteSprite::parseTokens((char *)&v59, nullptr, v21);
v23 = (int)v22;
if ( (int)v22 <= 0
|| (v24 = EmoteSprite::maxEmotesMessage(v22), v23 != (unsigned int)EmoteSprite::effectiveLength((char *)&v59, v24)) )
{
if ( ((unsigned __int8)v59 & 1) != 0 )
operator delete(v61);
v25 = 0.75;
LOBYTE(v67) = 0;
v56 = nullptr;
v57 = 0;
v58 = nullptr;
v65 = 0.75;
if ( ((unsigned __int8)v53 & 1) == 0 )
goto LABEL_34;
goto LABEL_73;
}
if ( ((unsigned __int8)v59 & 1) != 0 )
{
operator delete(v61);
LOBYTE(v67) = (unsigned __int8)&dword_0 + 1;
if ( v23 != 1 )
goto LABEL_71;
}
else
{
LOBYTE(v67) = (unsigned __int8)&dword_0 + 1;
if ( v23 != 1 )
{
LABEL_71:
v45 = EmoteSprite::jumboMultiScale((EmoteSprite *)((char *)&dword_0 + 1));
goto LABEL_72;
}
}
v45 = EmoteSprite::jumboScale((EmoteSprite *)((char *)&dword_0 + 1));
LABEL_72:
v56 = nullptr;
v25 = v45 * 0.75;
v57 = 0;
v58 = nullptr;
v65 = v45 * 0.75;
if ( ((unsigned __int8)v53 & 1) == 0 )
{
LABEL_34:
v58 = v55;
v56 = v53;
v57 = v54;
LABEL_35:
v26 = (float)(*((float *)this + 210) - 58.0) / v25;
v27 = (EmoteSprite *)cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v49, 0.0, 1.0);
v28 = EmoteSprite::maxEmotesMessage(v27);
v29 = TextArea::create((char *)&v56, "chatFont.fnt", (const cocos2d::CCPoint *)&v49, 1, v28, 1.0, v26, 20.0);
if ( ((unsigned __int8)v56 & 1) != 0 )
operator delete(v58);
v30 = (EmoteSprite *)(unsigned __int8)v67;
*(_BYTE *)(v29 + 597) = 1;
if ( (_DWORD)v30 )
{
v46 = EmoteSprite::jumboMaxAspect(v30);
TextArea::setEmoteMaxAspect(v29, v46);
}
v59 = nullptr;
v60 = 0;
v61 = nullptr;
if ( ((unsigned __int8)v53 & 1) != 0 )
{
std::string::__init((__int64 *)&v59, v55, v54);
}
else
{
v61 = v55;
v59 = v53;
v60 = v54;
}
TextArea::setString((__int64 *)v29, (char *)&v59);
if ( ((unsigned __int8)v59 & 1) != 0 )
operator delete(v61);
v31 = *(_DWORD *)(v29 + 672);
v32 = *(float *)(v29 + 648);
v33 = (__int64 **)((char *)this + 720);
v48 = &v47;
v66 = (float)((float)v31 + v32) * v65;
v34 = std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::__emplace_unique_key_args,std::tuple<>>(
(__int64 **)this + 90,
&v47,
(__int64)&unk_119E6A8,
&v48);
v35 = v34 + 40;
if ( (__int64 *)(v34 + 40) != &v62 )
{
if ( (v62 & 1) != 0 )
{
v36 = (char *)v64;
v37 = v63;
}
else
{
v37 = (unsigned __int8)v62 >> 1;
v36 = (char *)&v62 + 1;
}
std::string::assign((__int64 *)(v34 + 40), v36, v37);
}
v38 = v65;
*(_BYTE *)(v35 + 32) = (_BYTE)v67;
*(float *)(v35 + 24) = v38;
*(float *)(v35 + 28) = v66;
v49 = &v47;
v9 = std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::__emplace_unique_key_args,std::tuple<>>(
v33,
&v47,
(__int64)&unk_119E6A8,
&v49)
+ 40;
if ( ((unsigned __int8)v53 & 1) != 0 )
operator delete(v55);
if ( v50 )
{
if ( v50 != v51 )
v51 += -24
* ((0xAAAAAAAAAAAAAABLL * ((unsigned __int64)(v51 - 24 - (_BYTE *)v50) >> 3)) & 0x1FFFFFFFFFFFFFFFLL)
- 24;
operator delete(v50);
}
if ( (v62 & 1) != 0 )
operator delete(v64);
return v9;
}
LABEL_73:
std::string::__init((__int64 *)&v56, v55, v54);
v25 = v65;
goto LABEL_35;
}
if ( !v11 )
return v9;
if ( *v40 != *v41 )
goto LABEL_12;
v42 = v40 + 1;
v43 = &v40[v11];
while ( 1 )
{
++v41;
if ( v42 == v43 )
return v9;
v44 = *v42++;
if ( *v41 != v44 )
goto LABEL_12;
}
}