//
// sub_10057B4C0 from 0x10057b4c0 to 0x10057b597 (215 bytes)
//
// 5 xrefs:
// > sub_1002919D0 @ 0x100291a0c
// > FriendRequestPopup::keyBackClicked @ 0x1002928ec
// > sub_100292930 @ 0x10029296d
// > FriendRequestPopup::onClosePopup @ 0x100292d80
// > sub_100292DC0 @ 0x100292e31
//
// 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 12:32:18 +0000
//
void __fastcall sub_10057B4C0(__int64 a1, int a2)
{
__int64 v2; // rax
const char *CString; // r15
size_t v4; // rax
size_t v5; // r14
char *v6; // r12
size_t v7; // r13
_QWORD __dst[2]; // [rsp+0h] [rbp-40h] BYREF
void *__p; // [rsp+10h] [rbp-30h]
if ( a2 > 0 )
{
v2 = sub_10088E820("%i", __dst[0]);
CString = (const char *)cocos2d::CCString::getCString(v2);
v4 = strlen(CString);
if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v5 = v4;
if ( v4 >= 0x17 )
{
v7 = 26;
if ( (v4 | 7) != 0x17 )
v7 = (v4 | 7) + 1;
v6 = (char *)operator new(v7);
__p = v6;
__dst[0] = v7 + 1;
__dst[1] = v5;
}
else
{
LOBYTE(__dst[0]) = 2 * v4;
v6 = (char *)__dst + 1;
if ( !v4 )
{
LABEL_10:
v6[v5] = 0;
sub_10057B5C0(a1, __dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
return;
}
}
memmove(v6, CString, v5);
goto LABEL_10;
}
}