//
// sub_1400E0190 from 0x1400e0190 to 0x1400e0600 (1136 bytes)
//
// 2 xrefs:
// > ThreadViewPopup::layoutRows @ 0x1400e0e26
// > ??> @ 0x140914a74
//
// This function is hookable on this platform (idp: pc, 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 11:26:30 +0000
//
// Hidden C++ exception states: #wind=2
void **__fastcall sub_1400E0190(void **a1, __int64 a2, __int64 a3)
{
_QWORD *v5; // rdx
size_t v6; // rbx
size_t v7; // r8
cocos2d::CCArray *v8; // r15
void *v9; // rcx
cocos2d::CCString *v10; // rax
const char *CString; // rbp
cocos2d::CCString *v12; // rax
const char *v13; // r14
cocos2d::CCString *v14; // rax
int v15; // edx
cocos2d::CCString *v16; // rax
char *v17; // rax
cocos2d::CCString *v18; // rax
cocos2d::CCString *v19; // rax
const char *v20; // rax
size_t v21; // r8
char *v22; // rdx
cocos2d::CCString *v23; // rax
char *v24; // rax
cocos2d::CCString *v25; // rax
cocos2d::CCString *v26; // rax
char *v27; // rax
cocos2d::CCString *v28; // rax
cocos2d::CCString *v29; // rax
cocos2d::CCString *v30; // rax
cocos2d::CCString *v31; // rax
const char *v32; // r8
cocos2d::CCString *v33; // rax
char *v34; // rax
cocos2d::CCString *v35; // rax
cocos2d::CCString *v36; // rax
const char *v37; // rax
void *Block[2]; // [rsp+40h] [rbp-58h] BYREF
__m128i si128; // [rsp+50h] [rbp-48h]
*(_OWORD *)a1 = 0;
a1[2] = nullptr;
a1[3] = (void *)15;
*(_BYTE *)a1 = 0;
*(_WORD *)a3 = -19276;
*(_BYTE *)(a3 + 2) = -76;
v5 = (_QWORD *)(a2 + 72);
if ( v5[3] > 0xFu )
v5 = (_QWORD *)*v5;
*(_OWORD *)Block = 0;
si128 = 0;
v6 = -1;
v7 = -1;
do
++v7;
while ( *((_BYTE *)v5 + v7) );
sub_14003D230(Block, v5, v7);
v8 = sub_1400D2840((__int64 *)Block, byte_14070ECF8);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v9 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v9 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v9 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v9);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
if ( cocos2d::CCArray::count(v8) >= 3 )
{
v10 = cocos2d::CCArray::stringAtIndex(v8, 2u);
CString = cocos2d::CCString::getCString(v10);
if ( cocos2d::CCArray::count(v8) < 5 )
{
v13 = &byte_1406ED6E0;
}
else
{
v12 = cocos2d::CCArray::stringAtIndex(v8, 4u);
v13 = cocos2d::CCString::getCString(v12);
}
v14 = cocos2d::CCArray::stringAtIndex(v8, 0);
v15 = cocos2d::CCString::intValue(v14);
switch ( v15 )
{
case 1:
v16 = cocos2d::CCString::createWithFormat("%s added %s", CString, v13);
v17 = (char *)cocos2d::CCString::getCString(v16);
do
++v6;
while ( v17[v6] );
goto LABEL_17;
case 2:
v18 = cocos2d::CCString::createWithFormat("%s joined", v13);
v17 = (char *)cocos2d::CCString::getCString(v18);
do
++v6;
while ( v17[v6] );
LABEL_17:
sub_1400405A0(a1, v17, v6);
*(_WORD *)a3 = -136;
*(_BYTE *)(a3 + 2) = 120;
return a1;
case 3:
v19 = cocos2d::CCString::createWithFormat("%s left the group chat", CString);
v20 = cocos2d::CCString::getCString(v19);
do
++v6;
while ( v20[v6] );
v21 = v6;
v22 = (char *)v20;
goto LABEL_53;
case 4:
v23 = cocos2d::CCString::createWithFormat("%s kicked %s", CString, v13);
v24 = (char *)cocos2d::CCString::getCString(v23);
do
++v6;
while ( v24[v6] );
sub_1400405A0(a1, v24, v6);
*(_WORD *)a3 = 30975;
*(_BYTE *)(a3 + 2) = 120;
return a1;
case 5:
v25 = cocos2d::CCArray::stringAtIndex(v8, 1u);
if ( (int)cocos2d::CCString::intValue(v25) <= 0 )
{
v28 = cocos2d::CCString::createWithFormat("%s is now the owner", v13);
v27 = (char *)cocos2d::CCString::getCString(v28);
do
++v6;
while ( v27[v6] );
}
else
{
v26 = cocos2d::CCString::createWithFormat("%s made %s the owner", CString, v13);
v27 = (char *)cocos2d::CCString::getCString(v26);
do
++v6;
while ( v27[v6] );
}
goto LABEL_33;
case 6:
v29 = cocos2d::CCString::createWithFormat("%s invited %s", CString, v13);
v27 = (char *)cocos2d::CCString::getCString(v29);
do
++v6;
while ( v27[v6] );
goto LABEL_33;
case 7:
v30 = cocos2d::CCString::createWithFormat("%s updated the description", CString);
v27 = (char *)cocos2d::CCString::getCString(v30);
do
++v6;
while ( v27[v6] );
goto LABEL_33;
case 8:
v31 = cocos2d::CCString::createWithFormat("%s renamed the group chat", CString);
v27 = (char *)cocos2d::CCString::getCString(v31);
do
++v6;
while ( v27[v6] );
LABEL_33:
sub_1400405A0(a1, v27, v6);
*(_WORD *)a3 = -14081;
*(_BYTE *)(a3 + 2) = 80;
break;
case 9:
case 10:
v32 = "an Advisor";
if ( v15 == 10 )
v32 = "a Moderator";
v33 = cocos2d::CCString::createWithFormat("%s started this conversation as %s", CString, v32);
v34 = (char *)cocos2d::CCString::getCString(v33);
do
++v6;
while ( v34[v6] );
sub_1400405A0(a1, v34, v6);
*(_WORD *)a3 = -14216;
*(_BYTE *)(a3 + 2) = -1;
break;
case 11:
v35 = cocos2d::CCArray::stringAtIndex(v8, 1u);
if ( (int)cocos2d::CCString::intValue(v35) <= 0 )
{
v21 = 28;
v22 = "This conversation was closed";
}
else
{
v36 = cocos2d::CCString::createWithFormat("%s closed this conversation", CString);
v37 = cocos2d::CCString::getCString(v36);
do
++v6;
while ( v37[v6] );
v21 = v6;
v22 = (char *)v37;
}
LABEL_53:
sub_1400405A0(a1, v22, v21);
break;
default:
return a1;
}
}
return a1;
}