//
// sub_778E80 from 0x778e80 to 0x778ef4 (116 bytes)
//
// 8 xrefs:
// > sub_762C30 @ 0x762c4a
// > sub_762C30 @ 0x762c60
// > sub_762D80 @ 0x762dae
// > sub_778F00 @ 0x778f12
// > sub_778F1C @ 0x778fd8
// > sub_779224 @ 0x779244
// > sub_779250 @ 0x77926a
// > sub_779278 @ 0x779286
//
// 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_778E80(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;
}