//
// sub_1004FEEB4 from 0x1004feeb4 to 0x1004ff230 (892 bytes)
//
// 4 xrefs:
// > sub_1004FEA64 @ 0x1004feb48
// > ThreadViewPopup::mountVirtualRow @ 0x1005007b4
// > InvitesPopup::buildRows @ 0x10050f77c
// > sub_100514348 @ 0x100514c00
//
// 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 11:06:53 +0000
//
void __usercall sub_1004FEEB4(const std::string *a1@, _QWORD *a2@, __int64 a3@)
{
std::string::size_type size; // x8
unsigned __int64 v7; // x8
std::string::size_type v8; // x9
std::string::size_type v9; // x24
unsigned __int64 v10; // x8
const std::string::value_type *v11; // x28
__int64 *v12; // x10
int v13; // w10
bool v14; // cc
__int64 *v16; // x8
int v17; // w25
std::string::size_type v18; // x2
std::string::size_type v19; // x9
int v20; // w8
const std::string *v21; // x10
std::string::size_type v22; // x11
unsigned __int64 v23; // x12
std::string::size_type v24; // x23
std::string::size_type v25; // x3
unsigned int v26; // w13
__int64 v27; // x8
int v28; // w8
bool v29; // cf
bool v30; // zf
bool v31; // w8
const std::string::value_type *v32; // x22
int v33; // w28
std::string::size_type v34; // x26
std::string *v35; // x0
__int64 v36; // x10
void *v37; // x0
__int64 v38; // x26
char v39; // w8
const std::string *v40; // x8
std::string::size_type v41; // x9
const char *v42; // x0
int v43; // w22
void *v44; // x0
char *CString; // x0
__int64 v46; // x9
std::string::size_type v47; // x10
std::string *v48; // x1
std::string::size_type v49; // x2
char v50; // [xsp+Ch] [xbp-84h]
__int128 __a; // [xsp+10h] [xbp-80h] BYREF
int v52; // [xsp+20h] [xbp-70h]
bool v53; // [xsp+24h] [xbp-6Ch]
std::string v54; // [xsp+28h] [xbp-68h] BYREF
*(_QWORD *)a3 = 0;
*(_QWORD *)(a3 + 8) = 0;
*(_QWORD *)(a3 + 16) = 0;
size = HIBYTE(a1->__r_.__value_.__r.__words[2]);
if ( (size & 0x80u) != 0LL )
size = a1->__r_.__value_.__l.__size_;
std::string::reserve((std::string *)a3, size + 16);
v7 = SHIBYTE(a1->__r_.__value_.__r.__words[2]);
v8 = a1->__r_.__value_.__l.__size_;
if ( (v7 & 0x80000000) == 0LL )
v8 = SHIBYTE(a1->__r_.__value_.__r.__words[2]);
if ( v8 )
{
v9 = 0;
v10 = v7 >> 63;
v11 = "li_";
do
{
if ( v9 )
{
v12 = (v10 & 1) != 0 ? (__int64 *)a1->__r_.__value_.__r.__words[0] : (__int64 *)a1;
v13 = *((unsigned __int8 *)v12 + v9 - 1);
v14 = v13 == 95 || (unsigned int)(v13 - 58) > 0xFFFFFFF5;
if ( v14 || (v13 & 0xFFFFFFDF) - 91 > 0xFFFFFFE5 )
goto LABEL_64;
}
v16 = (v10 & 1) != 0 ? (__int64 *)a1->__r_.__value_.__r.__words[0] : (__int64 *)a1;
if ( *((_BYTE *)v16 + v9) != 108 || (int)(-1431655765 * ((a2[1] - *a2) >> 3)) > 4 )
goto LABEL_64;
v17 = std::string::compare(a1, v9, 2u, "l_");
if ( v17 )
{
if ( std::string::compare(a1, v9, 3u, v11) )
goto LABEL_64;
v18 = v9 + 3;
}
else
{
v18 = v9 + 2;
}
if ( v18 != -1 )
{
v19 = HIBYTE(a1->__r_.__value_.__r.__words[2]);
v20 = (char)v19;
if ( (v19 & 0x80u) != 0LL )
v19 = a1->__r_.__value_.__l.__size_;
if ( v18 >= v19 )
goto LABEL_39;
v21 = (const std::string *)a1->__r_.__value_.__r.__words[0];
if ( v20 >= 0 )
v21 = a1;
if ( (unsigned int)(unsigned __int8)v21->__r_.__value_.__s.__data_[v18] - 48 > 9 )
{
LABEL_39:
v25 = 0;
v24 = v18;
}
else
{
v22 = v18 + 1;
v23 = 1;
do
{
v24 = v22;
v25 = v23;
if ( v23 > 9 )
break;
if ( v22 >= v19 )
break;
v26 = (unsigned __int8)v21->__r_.__value_.__s.__data_[v22++] - 48;
++v23;
}
while ( v26 <= 9 );
}
if ( v24 >= v19 )
{
v50 = 0;
}
else
{
v27 = v20 >= 0 ? (__int64)a1 : a1->__r_.__value_.__r.__words[0];
v28 = *(unsigned __int8 *)(v27 + v24);
v29 = (unsigned int)(v28 - 48) >= 0xA && (v28 & 0xFFFFFFDF) - 65 >= 0x1A;
v30 = !v29 || v28 == 95;
v31 = v30;
v50 = v31;
}
if ( v24 > v18 )
{
v32 = v11;
std::string::basic_string(&v54, a1, v18, v25, (std::allocator *)&__a);
v33 = SHIBYTE(v54.__r_.__value_.__r.__words[2]);
v34 = v54.__r_.__value_.__r.__words[0];
if ( (v54.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v35 = &v54;
else
v35 = (std::string *)v54.__r_.__value_.__r.__words[0];
v36 = atoll((const char *)v35);
if ( v33 < 0 )
{
v37 = (void *)v34;
v38 = v36;
operator delete(v37);
v36 = v38;
}
v39 = v50;
if ( (unsigned __int64)(v36 - 0x80000000LL) < 0xFFFFFFFF80000001LL )
v39 = 1;
v11 = v32;
if ( (v39 & 1) == 0 )
{
if ( v17 )
v42 = "List %lli";
else
v42 = "Level %lli";
v43 = v36;
v44 = sub_1003065B0(v42, v36);
CString = (char *)cocos2d::CCString::getCString((__int64)v44);
sub_100009900(&v54, CString);
v46 = *(unsigned __int8 *)(a3 + 23);
if ( (v46 & 0x80u) != 0LL )
v46 = *(_QWORD *)(a3 + 8);
v47 = HIBYTE(v54.__r_.__value_.__r.__words[2]);
if ( (v54.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
v47 = v54.__r_.__value_.__l.__size_;
*(_QWORD *)&__a = v46;
*((_QWORD *)&__a + 1) = v47;
v52 = v43;
v53 = v17 != 0;
sub_100296C3C((__int64)a2, &__a);
if ( (v54.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v48 = &v54;
else
v48 = (std::string *)v54.__r_.__value_.__r.__words[0];
if ( (v54.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v49 = HIBYTE(v54.__r_.__value_.__r.__words[2]);
else
v49 = v54.__r_.__value_.__l.__size_;
std::string::append((std::string *)a3, (const std::string::value_type *)v48, v49);
if ( SHIBYTE(v54.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v54.__r_.__value_.__l.__data_);
goto LABEL_68;
}
}
}
LABEL_64:
if ( (a1->__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v40 = a1;
else
v40 = (const std::string *)a1->__r_.__value_.__r.__words[0];
std::string::push_back((std::string *)a3, v40->__r_.__value_.__s.__data_[v9]);
v24 = v9 + 1;
LABEL_68:
v41 = SHIBYTE(a1->__r_.__value_.__r.__words[2]);
v10 = v41 >> 63;
if ( (v41 & 0x80000000) != 0LL )
v41 = a1->__r_.__value_.__l.__size_;
v9 = v24;
}
while ( v24 < v41 );
}
}