//
// sub_1004F3980 from 0x1004f3980 to 0x1004f3b24 (420 bytes)
//
// 1 xrefs:
// > LevelStatsInfoPopup::buildInfoText @ 0x1004f325c
//
// 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:46 +0000
//
void __usercall sub_1004F3980(__int64 *a1@, __int64 a2@)
{
unsigned __int64 v3; // x8
__int64 v4; // x9
unsigned __int64 v6; // x24
int v7; // w25
unsigned __int64 i; // x9
__int64 *v9; // x8
int v10; // w1
std::string *v11; // x0
int v12; // w23
__int64 v13; // x8
void *v14; // x0
const std::string::value_type *CString; // x0
std::string v16; // [xsp+8h] [xbp-58h] BYREF
v3 = *((unsigned __int8 *)a1 + 23);
if ( (v3 & 0x80u) == 0LL )
v4 = *((unsigned __int8 *)a1 + 23);
else
v4 = a1[1];
if ( !v4 )
{
sub_100009900((_QWORD *)a2, "");
return;
}
v6 = 0;
v7 = 0;
*(_QWORD *)a2 = 0;
*(_QWORD *)(a2 + 8) = 0;
*(_QWORD *)(a2 + 16) = 0;
memset(&v16, 0, sizeof(v16));
if ( (v3 & 0x80) != 0 )
goto LABEL_8;
LABEL_6:
for ( i = v3; v6 <= i; i = a1[1] )
{
if ( v6 == i || ((v3 & 0x80u) == 0LL ? (v9 = a1) : (v9 = (__int64 *)*a1), v10 = *((char *)v9 + v6), v10 == 44) )
{
if ( SHIBYTE(v16.__r_.__value_.__r.__words[2]) < 0 )
{
if ( !v16.__r_.__value_.__l.__size_ )
goto LABEL_27;
v11 = (std::string *)v16.__r_.__value_.__r.__words[0];
}
else
{
if ( !*((_BYTE *)&v16.__r_.__value_.__s + 23) )
goto LABEL_27;
v11 = &v16;
}
v12 = atoi((const char *)v11);
v13 = *(unsigned __int8 *)(a2 + 23);
if ( (v13 & 0x80u) != 0LL )
v13 = *(_QWORD *)(a2 + 8);
if ( v13 )
std::string::append((std::string *)a2, " ");
v7 += v12;
v14 = sub_1003065B0("%i%%", v7);
CString = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v14);
std::string::append((std::string *)a2, CString);
if ( SHIBYTE(v16.__r_.__value_.__r.__words[2]) < 0 )
{
*v16.__r_.__value_.__l.__data_ = 0;
v16.__r_.__value_.__l.__size_ = 0;
}
else
{
v16.__r_.__value_.__s.__data_[0] = 0;
*((_BYTE *)&v16.__r_.__value_.__s + 23) = 0;
}
}
else
{
std::string::push_back(&v16, v10);
}
LABEL_27:
++v6;
v3 = *((unsigned __int8 *)a1 + 23);
if ( (v3 & 0x80) == 0 )
goto LABEL_6;
LABEL_8:
;
}
if ( SHIBYTE(v16.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v16.__r_.__value_.__l.__data_);
}