//
// sub_778130 from 0x778130 to 0x7781a4 (116 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
//
wchar_t *__fastcall sub_778130(wchar_t *a1, size_t a2, unsigned int a3, unsigned int a4, wchar_t c)
{
unsigned int v7; // r5
v7 = *(_DWORD *)(*a1 - 12);
if ( a2 > v7 )
sub_7732C4(
"%s: __pos (which is %zu) > this->size() (which is %zu)",
"basic_string::replace",
a2,
*(_DWORD *)(*a1 - 12));
if ( a3 >= v7 - a2 )
a3 = v7 - a2;
if ( a4 > 268435454 - v7 + a3 )
sub_7731C4("basic_string::_M_replace_aux");
sub_7777D0(a1, a2, a3, a4);
if ( !a4 )
return a1;
if ( a4 != 1 )
{
wmemset((wchar_t *)(*a1 + 4 * a2), c, a4);
return a1;
}
*(_DWORD *)(*a1 + 4 * a2) = c;
return a1;
}