//
// ThreadViewPopup::layoutTitleRow from 0x74d09c to 0x74d354 (696 bytes)
//
// 4 xrefs:
// > RenameThreadPopup::threadUpdateFinished @ 0x753e3e
// > ThreadDescPopup::threadUpdateFinished @ 0x7549dc
// > ThreadViewPopup::init @ 0x75c26c
// > ThreadViewPopup::threadMessagesFinished @ 0x75e3c0
//
// 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:48 +0000
//
int __fastcall ThreadViewPopup::layoutTitleRow(int this)
{
int v1; // r4
EmoteSprite *v2; // r0
int v3; // r1
int v4; // r3
int v5; // r3
int v6; // r1
int v7; // r2
int v8; // r3
int v9; // r1
int v10; // r2
int v11; // r3
float v12; // s20
float v13; // r7
int v14; // r0
float v15; // s18
float v16; // s18
int v17; // r0
GJMessageThread *v18; // r0
int v19; // r1
int v20; // r0
float v21; // s19
float v22; // s16
float v23; // s19
float v24; // s19
float v25; // r0
int v26; // r8
float v27; // s19
void (__fastcall *v28)(int, float *); // r9
float v29; // s16
int v30; // r8
int (__fastcall *v31)(int, float *); // r9
float v32; // r1
int v33; // r8
int (__fastcall *v34)(int, float *); // r9
float v35; // r0
float v36[2]; // [sp+0h] [bp-1Ch] BYREF
int v37; // [sp+8h] [bp-14h] BYREF
int v38; // [sp+Ch] [bp-10h]
int v39; // [sp+10h] [bp-Ch]
v1 = this;
if ( *(_DWORD *)(this + 664) )
{
v2 = *(EmoteSprite **)(this + 668);
if ( v2 )
{
v2 = (EmoteSprite *)(*(int (__fastcall **)(EmoteSprite *))(*(_DWORD *)v2 + 260))(v2);
*(_DWORD *)(v1 + 668) = 0;
}
v3 = *(_DWORD *)(v1 + 564);
if ( !*(_BYTE *)(v3 + 168) )
{
v4 = *(unsigned __int8 *)(v3 + 156);
if ( (v4 & 1) != 0 )
v5 = *(_DWORD *)(v3 + 160);
else
v5 = v4 >> 1;
if ( v5 )
{
std::string::basic_string(&v37, v3 + 156);
}
else
{
v37 = 0;
v38 = 0;
v39 = 0;
std::string::__init(&v37, "na", 2u);
}
*(_DWORD *)(v1 + 668) = EmoteSprite::createWithName((int)&v37, v6, v7, v8);
std::string::~string((int)&v37);
if ( !*(_DWORD *)(v1 + 668) )
{
v37 = 0;
v38 = 0;
v39 = 0;
std::string::__init(&v37, "na", 2u);
*(_DWORD *)(v1 + 668) = EmoteSprite::createWithName((int)&v37, v9, v10, v11);
std::string::~string((int)&v37);
}
v2 = *(EmoteSprite **)(v1 + 668);
if ( v2 )
{
EmoteSprite::fitToHeight(v2, 18.0, 0.0);
v2 = (EmoteSprite *)(*(int (__fastcall **)(_DWORD, _DWORD, int))(**(_DWORD **)(v1 + 460) + 232))(
*(_DWORD *)(v1 + 460),
*(_DWORD *)(v1 + 668),
1);
}
}
cocos2d::CCDirector::sharedDirector(v2);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v36);
v12 = v36[0] * 0.5;
v13 = COERCE_FLOAT((*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v1 + 664) + 120))(*(_DWORD *)(v1 + 664)));
v14 = *(_DWORD *)(v1 + 668);
if ( v14 )
{
v15 = *(float *)(*(int (__fastcall **)(int))(*(_DWORD *)v14 + 164))(v14);
v16 = v15 * (*(float (__fastcall **)(_DWORD))(**(_DWORD **)(v1 + 668) + 84))(*(_DWORD *)(v1 + 668));
}
else
{
v16 = 0.0;
}
v17 = *(_DWORD *)(v1 + 672);
if ( v17 )
{
(*(void (__fastcall **)(int))(*(_DWORD *)v17 + 260))(v17);
*(_DWORD *)(v1 + 672) = 0;
}
v18 = *(GJMessageThread **)(v1 + 564);
if ( *((_BYTE *)v18 + 168) )
*(_DWORD *)(v1 + 672) = GJMessageThread::createRoleBadge(v18, 18.0);
v19 = *(_DWORD *)(v1 + 672);
if ( v19 )
(*(void (__fastcall **)(_DWORD, int, int))(**(_DWORD **)(v1 + 460) + 232))(*(_DWORD *)(v1 + 460), v19, 1);
v20 = *(_DWORD *)(v1 + 672);
if ( v20 )
{
v21 = *(float *)(*(int (__fastcall **)(int))(*(_DWORD *)v20 + 164))(v20);
v22 = (float)(v21 * (*(float (__fastcall **)(_DWORD))(**(_DWORD **)(v1 + 672) + 84))(*(_DWORD *)(v1 + 672))) + 6.0;
}
else
{
v22 = 0.0;
}
v23 = 200.0;
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(v1 + 664) + 80))(*(_DWORD *)(v1 + 664), 1060320051);
if ( v16 > 0.0 )
v23 = 200.0 - (float)(v16 + 6.0);
cocos2d::CCLabelBMFont::limitLabelWidth(*(cocos2d::CCLabelBMFont **)(v1 + 664), v23 - v22, 0.7, 0.3);
v24 = *(float *)(*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v1 + 664) + 164))(*(_DWORD *)(v1 + 664));
v25 = (*(float (__fastcall **)(_DWORD))(**(_DWORD **)(v1 + 664) + 84))(*(_DWORD *)(v1 + 664));
v26 = *(_DWORD *)(v1 + 668);
v27 = v24 * v25;
if ( v26 )
{
v28 = *(void (__fastcall **)(int, float *))(*(_DWORD *)v26 + 92);
v29 = (float)((float)(v16 + 6.0) + v27) * 0.5;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v36, (float)(v12 - v29) + (float)(v16 * 0.5), v13);
v28(v26, v36);
v30 = *(_DWORD *)(v1 + 664);
v31 = *(int (__fastcall **)(int, float *))(*(_DWORD *)v30 + 92);
v32 = (float)(v12 + v29) - (float)(v27 * 0.5);
}
else
{
v30 = *(_DWORD *)(v1 + 664);
v31 = *(int (__fastcall **)(int, float *))(*(_DWORD *)v30 + 92);
v32 = v12 - (float)(v22 * 0.5);
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v36, v32, v13);
this = v31(v30, v36);
v33 = *(_DWORD *)(v1 + 672);
if ( v33 )
{
v34 = *(int (__fastcall **)(int, float *))(*(_DWORD *)v33 + 92);
v35 = (*(float (__fastcall **)(_DWORD))(**(_DWORD **)(v1 + 664) + 112))(*(_DWORD *)(v1 + 664));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v36, (float)(v35 + (float)(v27 * 0.5)) + 6.0, v13);
return v34(v33, v36);
}
}
return this;
}