//
// sub_D1818C from 0xd1818c to 0xd18208 (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
//
char *__fastcall sub_D1818C(int **a1, unsigned __int64 a2)
{
int *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 != (int *)&qword_124B6B0 )
{
if ( v6 )
{
sub_D174B8(a1, 0, 0, 0);
v2 = *a1;
}
*(v2 - 2) = -1;
}
return (char *)v2 + a2;
}