//
// sub_C51FBC from 0xc51fbc to 0xc52068 (172 bytes)
//
// 2 xrefs:
// > AutoBackupPopup::buildRows @ 0xc581ac
// > AutoBackupPopup::textChanged @ 0xc585fc
//
// 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 13:05:09 +0000
//
__int64 *__usercall sub_C51FBC@(__int64 a1@, __int64 *a2@)
{
__int64 v3; // x1
unsigned __int64 i; // x1
_BYTE *v5; // x19
unsigned __int64 v6; // x21
*a2 = 0;
a2[1] = 0;
a2[2] = 0;
if ( (*(_BYTE *)a1 & 1) != 0 )
{
std::string::__init(a2, *(void **)(a1 + 16), *(_QWORD *)(a1 + 8));
}
else
{
v3 = *(_QWORD *)(a1 + 8);
*a2 = *(_QWORD *)a1;
a2[1] = v3;
a2[2] = *(_QWORD *)(a1 + 16);
}
for ( i = 0; ; i = v6 )
{
v6 = i + 1;
v5 = (char *)a2 + i + 1;
if ( (*(_BYTE *)a2 & 1) == 0 )
break;
if ( i >= a2[1] )
return a2;
v5 = (_BYTE *)(a2[2] + i);
LABEL_6:
*v5 = tolower((unsigned __int8)*v5);
}
if ( i < *(_BYTE *)a2 >> 1 )
goto LABEL_6;
return a2;
}