//
// sub_778C50 from 0x778c50 to 0x778cbc (108 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
//
_DWORD *__fastcall sub_778C50(_DWORD *result, const wchar_t *a2, const wchar_t *a3)
{
_DWORD *v3; // r6
int v5; // r5
unsigned int v6; // r7
unsigned int *v7; // r0
unsigned int *v8; // r9
_DWORD *v9; // r8
v3 = result;
if ( a2 == a3 )
{
*result = &unk_ACDDB8;
}
else
{
v5 = (char *)a3 - (char *)a2;
v6 = a3 - a2;
v7 = sub_777768(v6, 0);
v8 = v7;
v9 = v7 + 3;
if ( v6 == 1 )
v7[3] = *a2;
else
wmemcpy((wchar_t *)v7 + 3, a2, v5 >> 2);
if ( v8 != (unsigned int *)&unk_ACDDAC )
{
*v8 = v6;
v8[2] = 0;
*(unsigned int *)((char *)v8 + v5 + 12) = 0;
}
*v3 = v9;
return v3;
}
return result;
}