//
// sub_D1BAE4 from 0xd1bae4 to 0xd1bb30 (76 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
//
const wchar_t **__fastcall sub_D1BAE4(const wchar_t **a1, __int64 *a2, unsigned __int64 a3, size_t a4)
{
__int64 v4; // x5
unsigned __int64 v6; // x4
size_t v7; // x2
const wchar_t *v8; // x1
v4 = *a2;
v6 = *(_QWORD *)(v4 - 24);
if ( a3 > v6 )
sub_D13C5C(
"%s: __pos (which is %zu) > this->size() (which is %zu)",
"basic_string::assign",
a3,
*(_QWORD *)(v4 - 24));
v7 = v6 - a3;
v8 = (const wchar_t *)(v4 + 4 * a3);
if ( v7 > a4 )
v7 = a4;
return sub_D1B9A0(a1, v8, v7);
}