//
// _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceIPKcEENS_9enable_ifIXsr19__is_input_iteratorIT_EE5valueERS5_E4typeENS_11__wrap_iterIS8_EESF_SA_SA_ from 0x978700 to 0x9787a4 (164 bytes)
//
// 1 xrefs:
// > sub_9786E6 @ 0x9786f6
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:06:00 +0000
//
_DWORD *__fastcall std::string::replace(_DWORD *a1, int a2, int a3, char *a4, char *a5)
{
char *v8; // r0
size_t v9; // r1
char *v10; // r3
_DWORD *v11; // r4
unsigned int v13; // [sp+8h] [bp-20h] BYREF
size_t v14; // [sp+Ch] [bp-1Ch]
void *v15; // [sp+10h] [bp-18h]
v14 = 0;
v15 = nullptr;
v13 = 0;
std::string::__init(&v13, a4, a5);
if ( (*(_BYTE *)a1 & 1) != 0 )
v8 = (char *)a1[2];
else
v8 = (char *)a1 + 1;
v9 = v14;
v10 = (char *)v15;
if ( (v13 & 1) == 0 )
{
v9 = (unsigned __int8)v13 >> 1;
v10 = (char *)&v13 + 1;
}
v11 = std::string::replace(a1, a2 - (_DWORD)v8, a3 - a2, v10, v9);
if ( (v13 & 1) != 0 )
operator delete(v15);
return v11;
}