//
// sub_D1C140 from 0xd1c140 to 0xd1c1bc (124 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_D1C140(const wchar_t **a1, unsigned __int64 a2)
{
const wchar_t *v2; // x3
unsigned __int64 v4; // x2
int v6; // w2
v2 = *a1;
v4 = *((_QWORD *)*a1 - 3);
if ( a2 >= v4 )
sub_D13C5C("basic_string::at: __n (which is %zu) >= this->size() (which is %zu)", a2, v4);
v6 = *(v2 - 2);
if ( (v6 & 0x80000000) == 0 && *a1 - 6 != (const wchar_t *)&qword_124B6D0 )
{
if ( v6 )
{
sub_D1B4BC(a1, 0, 0, 0);
v2 = *a1;
}
*((_DWORD *)v2 - 2) = -1;
}
return &v2[a2];
}