//
// ThreadViewPopup::layoutRows from 0x75b464 to 0x75bc4e (2026 bytes)
//
// 1 xrefs:
// > ThreadViewPopup::buildRows @ 0x75bc8e
//
// 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
//
int __fastcall ThreadViewPopup::layoutRows(ThreadViewPopup *this)
{
char v1; // r6
char v2; // r8
char v3; // r10
int v5; // r5
int v6; // r0
cocos2d::CCArray *v7; // r0
int result; // r0
float v9; // s16
ThreadViewPopup::ThreadRow *v10; // r0
signed int v11; // r7
int v12; // r9
int v13; // r0
int v14; // r5
const char *v15; // r8
size_t v16; // r0
cocos2d::CCArray *v17; // r10
_BYTE *v18; // r2
cocos2d::CCString *v19; // r0
const char *CString; // r8
cocos2d::CCString *v21; // r0
const char *v22; // r11
cocos2d::CCString *v23; // r0
int v24; // r0
int v25; // r3
cocos2d::CCString *v26; // r0
char *v27; // r0
char *v28; // r0
cocos2d::CCString *v29; // r0
char *v30; // r0
cocos2d::CCString *v31; // r0
char *v32; // r0
cocos2d::CCString *v33; // r0
char *v34; // r0
char *v35; // r0
const char *v36; // r2
cocos2d::CCString *v37; // r0
char *v38; // r0
cocos2d::CCString *v39; // r0
cocos2d::CCString *v40; // r0
char *v41; // r1
int v42; // r3
__int64 v44; // r0
ThreadViewPopup::ThreadRow *v45; // r0
ThreadViewPopup::ThreadRow *v46; // r3
time_t v47; // r3
struct tm *v48; // r0
int tm_year; // r11
struct tm *v50; // r0
float v51; // s17
struct tm *v52; // r9
size_t v53; // r0
_BYTE *v54; // r2
int v55; // r3
ThreadViewPopup::ThreadRow *v56; // r0
int v57; // r3
char *v58; // r9
size_t v59; // r2
_BOOL4 v60; // r9
int v61; // r3
int v62; // r3
float v63; // s17
float v64; // s15
ThreadViewPopup::ThreadRow *v65; // r3
ThreadViewPopup::ThreadRow *v66; // r0
_BYTE *v67; // r0
float v68; // s15
ThreadViewPopup::ThreadRow *v69; // r0
float v70; // s17
ThreadViewPopup::ThreadRow *v71; // r0
ThreadViewPopup::ThreadRow *v72; // r3
__int64 v73; // [sp+0h] [bp-ACh]
int v74; // [sp+8h] [bp-A4h]
signed int v75; // [sp+Ch] [bp-A0h]
ThreadViewPopup::ThreadRow *tm_yday; // [sp+2Ch] [bp-80h]
time_t timer; // [sp+34h] [bp-78h] BYREF
time_t v78; // [sp+38h] [bp-74h] BYREF
int v79; // [sp+3Ch] [bp-70h] BYREF
int v80; // [sp+40h] [bp-6Ch]
void *v81; // [sp+44h] [bp-68h]
int v82; // [sp+48h] [bp-64h] BYREF
int v83; // [sp+4Ch] [bp-60h]
void *v84; // [sp+50h] [bp-5Ch]
int v85; // [sp+54h] [bp-58h] BYREF
int v86; // [sp+58h] [bp-54h]
_BYTE *v87; // [sp+5Ch] [bp-50h]
int v88; // [sp+60h] [bp-4Ch] BYREF
int v89; // [sp+64h] [bp-48h]
float v90; // [sp+68h] [bp-44h]
float v91; // [sp+6Ch] [bp-40h]
bool v92; // [sp+70h] [bp-3Ch]
char v93; // [sp+71h] [bp-3Bh]
int v94; // [sp+74h] [bp-38h] BYREF
int v95; // [sp+78h] [bp-34h]
_BYTE *v96; // [sp+7Ch] [bp-30h]
__int16 v97; // [sp+80h] [bp-2Ch]
char v98; // [sp+82h] [bp-2Ah]
char v99[32]; // [sp+84h] [bp-28h] BYREF
v5 = *((_DWORD *)this + 134);
while ( 1 )
{
v6 = *((_DWORD *)this + 135);
if ( v5 == v6 )
break;
*((_DWORD *)this + 135) = v6 - 36;
std::string::~string(v6 - 16);
}
v7 = *((cocos2d::CCArray **)this + 142);
*((_DWORD *)this + 140) = 0;
result = cocos2d::CCArray::count(v7);
v75 = result;
if ( !result )
return result;
v9 = -6.0;
if ( *((_BYTE *)this + 596) )
{
ThreadViewPopup::ThreadRow::ThreadRow(&v88);
v88 = 0;
v92 = 0;
v93 = 0;
v89 = -1;
v10 = *((ThreadViewPopup::ThreadRow **)this + 135);
v90 = -6.0;
v91 = 26.0;
v97 = -1;
v98 = -1;
if ( v10 == *((ThreadViewPopup::ThreadRow **)this + 136) )
{
std::vector::__push_back_slow_path(
(int *)this + 134,
(const ThreadViewPopup::ThreadRow *)&v88);
}
else
{
if ( v10 )
ThreadViewPopup::ThreadRow::ThreadRow(v10, (const ThreadViewPopup::ThreadRow *)&v88);
*((_DWORD *)this + 135) += 36;
}
v9 = -32.0;
result = std::string::~string((int)&v94);
}
v73 = 0;
v11 = 0;
v12 = 0;
v74 = 0;
while ( v11 < v75 )
{
v13 = cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 142), v11);
v79 = 0;
v80 = 0;
v81 = nullptr;
v14 = v13;
if ( !*(_DWORD *)(v13 + 64) )
{
v82 = 0;
v83 = 0;
v84 = nullptr;
if ( (*(_BYTE *)(v13 + 68) & 1) != 0 )
v15 = *(const char **)(v13 + 76);
else
v15 = (const char *)(v13 + 69);
v88 = 0;
v89 = 0;
v90 = 0.0;
v16 = strlen(v15);
std::string::__init(&v88, v15, v16);
v17 = sub_74EB30((cocos2d::CCArray *)&v88, ",");
std::string::~string((int)&v88);
if ( cocos2d::CCArray::count(v17) > 2u )
{
v19 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v17, 2u);
CString = (const char *)cocos2d::CCString::getCString(v19);
if ( cocos2d::CCArray::count(v17) <= 4u )
{
v22 = (const char *)&unk_B6B226;
}
else
{
v21 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v17, 4u);
v22 = (const char *)cocos2d::CCString::getCString(v21);
}
v23 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v17, 0);
v24 = cocos2d::CCString::intValue(v23);
v25 = v24 - 1;
switch ( v24 )
{
case 1:
v26 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s added %s",
CString,
v22,
v25);
goto LABEL_24;
case 2:
v26 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%s joined", v22);
LABEL_24:
v27 = (char *)cocos2d::CCString::getCString(v26);
std::string::assign(&v82, v27);
v1 = 120;
v3 = -1;
goto LABEL_48;
case 3:
v28 = "%s left the group chat";
goto LABEL_43;
case 4:
v29 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s kicked %s",
CString,
v22,
v25);
v30 = (char *)cocos2d::CCString::getCString(v29);
std::string::assign(&v82, v30);
v1 = 120;
v3 = 120;
goto LABEL_47;
case 5:
v31 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v17, 1u);
if ( (int)cocos2d::CCString::intValue(v31) <= 0 )
{
v33 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s is now the owner",
v22);
}
else
{
v32 = "%s made %s the owner";
LABEL_32:
v33 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)v32, CString, v22);
}
goto LABEL_33;
case 6:
v32 = "%s invited %s";
goto LABEL_32;
case 7:
v35 = "%s updated the description";
goto LABEL_36;
case 8:
v35 = "%s renamed the group chat";
LABEL_36:
v33 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)v35, CString);
LABEL_33:
v34 = (char *)cocos2d::CCString::getCString(v33);
std::string::assign(&v82, v34);
v1 = 80;
v3 = -56;
LABEL_47:
v2 = -1;
goto LABEL_49;
case 9:
case 10:
if ( v24 == 10 )
v36 = "a Moderator";
else
v36 = "an Advisor";
v37 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s started this conversation as %s",
CString,
v36,
v25,
(_DWORD)v73);
v38 = (char *)cocos2d::CCString::getCString(v37);
std::string::assign(&v82, v38);
v1 = -1;
v3 = -56;
LABEL_48:
v2 = 120;
goto LABEL_49;
case 11:
v39 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v17, 1u);
if ( (int)cocos2d::CCString::intValue(v39) <= 0 )
{
v41 = "This conversation was closed";
}
else
{
v28 = "%s closed this conversation";
LABEL_43:
v40 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)v28, CString);
v41 = (char *)cocos2d::CCString::getCString(v40);
}
std::string::assign(&v82, v41);
break;
default:
break;
}
}
v1 = -76;
v3 = -76;
v2 = -76;
LABEL_49:
v42 = v79 & 1;
if ( (v79 & 1) != 0 )
{
v18 = v81;
v42 = 0;
}
else
{
BYTE1(v79) = v79 & 1;
}
if ( (v79 & 1) != 0 )
{
*v18 = v42;
v80 = v42;
}
else
{
LOBYTE(v79) = v42;
}
std::string::reserve(&v79, 0);
v79 = v82;
v80 = v83;
v81 = v84;
v82 = 0;
v83 = 0;
v84 = nullptr;
std::string::~string((int)&v82);
if ( !((v79 & 1) != 0 ? v80 : (int)(unsigned __int8)v79 >> 1) )
goto LABEL_115;
}
if ( !*((_BYTE *)this + 808) )
{
v44 = *((_QWORD *)this + 89);
if ( v44 >= 1 && *(_QWORD *)(v14 + 56) == v44 )
{
ThreadViewPopup::ThreadRow::ThreadRow(&v88);
v88 = 2;
v45 = *((ThreadViewPopup::ThreadRow **)this + 135);
v89 = v11;
v90 = v9;
v92 = 0;
v98 = -1;
v46 = *((ThreadViewPopup::ThreadRow **)this + 136);
v91 = 8.0;
v93 = 0;
v97 = -1;
if ( v45 == v46 )
{
std::vector::__push_back_slow_path(
(int *)this + 134,
(const ThreadViewPopup::ThreadRow *)&v88);
}
else
{
if ( v45 )
ThreadViewPopup::ThreadRow::ThreadRow(v45, (const ThreadViewPopup::ThreadRow *)&v88);
*((_DWORD *)this + 135) += 36;
}
v9 = v9 - 8.0;
std::string::~string((int)&v94);
v12 = 0;
}
}
if ( !v11
|| (v47 = *(_DWORD *)(v14 + 80),
timer = v73,
v78 = v47,
v48 = localtime(&timer),
tm_year = v48->tm_year,
tm_yday = (ThreadViewPopup::ThreadRow *)v48->tm_yday,
v50 = localtime(&v78),
tm_year != v50->tm_year)
|| tm_yday != (ThreadViewPopup::ThreadRow *)v50->tm_yday )
{
v51 = 7.0;
if ( !*(_DWORD *)(v14 + 64) )
v51 = 15.0;
ThreadViewPopup::ThreadRow::ThreadRow(&v88);
v88 = 1;
v90 = v9;
v92 = 0;
v91 = v51;
v93 = 0;
v97 = -1;
v89 = v11;
v98 = -1;
v78 = *(_DWORD *)(v14 + 80);
v52 = localtime(&v78);
memset(v99, 0, sizeof(v99));
if ( v52 )
strftime(v99, 0x20u, "%b %d, %Y", v52);
v85 = 0;
v86 = 0;
v87 = nullptr;
v53 = strlen(v99);
std::string::__init(&v85, v99, v53);
v55 = v94 & 1;
if ( (v94 & 1) != 0 )
{
v54 = v96;
v55 = 0;
}
else
{
BYTE1(v94) = v94 & 1;
}
if ( (v94 & 1) != 0 )
{
*v54 = v55;
v95 = v55;
}
else
{
LOBYTE(v94) = v55;
}
std::string::reserve(&v94, 0);
v94 = v85;
v95 = v86;
v96 = v87;
v85 = 0;
v86 = 0;
v87 = nullptr;
std::string::~string((int)&v85);
v56 = *((ThreadViewPopup::ThreadRow **)this + 135);
if ( v56 == *((ThreadViewPopup::ThreadRow **)this + 136) )
{
std::vector::__push_back_slow_path(
(int *)this + 134,
(const ThreadViewPopup::ThreadRow *)&v88);
}
else
{
if ( v56 )
ThreadViewPopup::ThreadRow::ThreadRow(v56, (const ThreadViewPopup::ThreadRow *)&v88);
*((_DWORD *)this + 135) += 36;
}
v9 = v9 - v51;
std::string::~string((int)&v94);
v12 = 0;
}
v57 = *(_DWORD *)(v14 + 64);
if ( !v57 )
{
ThreadViewPopup::ThreadRow::ThreadRow(&v88);
v88 = 3;
v89 = v11;
v90 = v9;
if ( (v79 & 1) != 0 )
{
v58 = (char *)v81;
v59 = v80;
}
else
{
v59 = (int)(unsigned __int8)v79 >> 1;
v58 = (char *)&v79 + 1;
}
if ( v59 && (v67 = memchr(v58, 10, v59)) != nullptr )
{
v68 = 16.0;
if ( v67 - v58 != -1 )
v68 = 28.0;
}
else
{
v68 = 16.0;
}
v91 = v68;
v92 = 0;
v93 = 0;
LOBYTE(v97) = v2;
HIBYTE(v97) = v3;
v98 = v1;
std::string::operator=((unsigned __int8 *)&v94, (unsigned __int8 *)&v79);
v69 = *((ThreadViewPopup::ThreadRow **)this + 135);
if ( v69 == *((ThreadViewPopup::ThreadRow **)this + 136) )
{
std::vector::__push_back_slow_path(
(int *)this + 134,
(const ThreadViewPopup::ThreadRow *)&v88);
}
else
{
if ( v69 )
ThreadViewPopup::ThreadRow::ThreadRow(v69, (const ThreadViewPopup::ThreadRow *)&v88);
*((_DWORD *)this + 135) += 36;
}
v9 = v9 - v91;
v73 = *(_QWORD *)(v14 + 80);
std::string::~string((int)&v94);
v74 = 1;
LABEL_115:
v12 = 0;
result = std::string::~string((int)&v79);
goto LABEL_116;
}
v60 = *((_BYTE *)this + 808) || v57 != v12 || *(_QWORD *)(v14 + 80) - v73 > 600;
ThreadViewPopup::ThreadRow::ThreadRow(&v88);
v89 = v11;
v88 = 4;
v90 = v9;
v92 = v60;
if ( v60 )
v61 = v74 ^ 1;
else
v61 = 0;
v93 = v61;
if ( v61 )
v62 = 8;
else
v62 = 0;
v97 = -1;
v98 = -1;
v63 = (float)(v62 + 16 * v60);
v64 = *((float *)ThreadViewPopup::measureBody(this, (GJThreadMessage *)v14) + 4);
v65 = *((ThreadViewPopup::ThreadRow **)this + 136);
v66 = *((ThreadViewPopup::ThreadRow **)this + 135);
v91 = (float)(v63 + v64) + 4.0;
if ( v66 == v65 )
{
std::vector::__push_back_slow_path(
(int *)this + 134,
(const ThreadViewPopup::ThreadRow *)&v88);
}
else
{
if ( v66 )
ThreadViewPopup::ThreadRow::ThreadRow(v66, (const ThreadViewPopup::ThreadRow *)&v88);
*((_DWORD *)this + 135) += 36;
}
v12 = *(_DWORD *)(v14 + 64);
v73 = *(_QWORD *)(v14 + 80);
v9 = v9 - v91;
std::string::~string((int)&v94);
result = std::string::~string((int)&v79);
v74 = 0;
LABEL_116:
++v11;
}
v70 = v9;
if ( *((_BYTE *)this + 856) && !*((_BYTE *)this + 808) )
{
ThreadViewPopup::ThreadRow::ThreadRow(&v88);
v88 = 5;
v89 = -1;
v71 = *((ThreadViewPopup::ThreadRow **)this + 135);
v92 = 0;
v93 = 0;
v90 = v9;
v97 = -1;
v98 = -1;
v72 = *((ThreadViewPopup::ThreadRow **)this + 136);
v91 = 26.0;
if ( v71 == v72 )
{
std::vector::__push_back_slow_path(
(int *)this + 134,
(const ThreadViewPopup::ThreadRow *)&v88);
}
else
{
if ( v71 )
ThreadViewPopup::ThreadRow::ThreadRow(v71, (const ThreadViewPopup::ThreadRow *)&v88);
*((_DWORD *)this + 135) += 36;
}
v70 = v9 - 26.0;
result = std::string::~string((int)&v94);
}
*((float *)this + 140) = 6.0 - v70;
return result;
}