//
// sub_778D28 from 0x778d28 to 0x778d9c (116 bytes)
//
// 3 xrefs:
// > sub_778DA8 @ 0x778dd2
// > sub_778E20 @ 0x778e48
// > sub_778E68 @ 0x778e76
//
// 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_778D28(const wchar_t *a1, const wchar_t *a2)
{
_BOOL4 v4; // r1
int v5; // r4
int *v6; // r0
int *v7; // r7
_DWORD *v8; // r6
if ( a1 == a2 )
return &unk_ACDDB8;
v4 = a1 == nullptr;
if ( !a2 )
v4 = 0;
if ( v4 )
sub_773044("basic_string::_S_construct null not valid");
v5 = (char *)a2 - (char *)a1;
v6 = sub_777768(v5 >> 2, 0);
v7 = v6;
v8 = v6 + 3;
if ( v5 >> 2 == 1 )
v6[3] = *a1;
else
wmemcpy(v6 + 3, a1, v5 >> 2);
if ( v7 != (int *)&unk_ACDDAC )
{
*v7 = v5 >> 2;
v7[2] = 0;
*(int *)((char *)v7 + v5 + 12) = 0;
}
return v8;
}