//
// sub_778724 from 0x778724 to 0x778772 (78 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall sub_778724(const wchar_t **a1, wchar_t a2)
{
const wchar_t *v2; // r3
int result; // r0
unsigned int v6; // r5
v2 = *a1;
result = *(*a1 - 3);
v6 = result + 1;
if ( (unsigned int)(result + 1) > *(v2 - 2) || *(v2 - 1) > 0 )
{
sub_778308(a1, v6);
v2 = *a1;
result = *(*a1 - 3);
}
v2[result] = a2;
if ( v2 - 3 != (const wchar_t *)&unk_ACDDAC )
{
*((_DWORD *)v2 - 3) = v6;
*((_DWORD *)v2 - 1) = 0;
v2[v6] = 0;
}
return result;
}