//
// sub_D1D8F8 from 0xd1d8f8 to 0xd1d994 (156 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_D1D8F8(const wchar_t **a1, wchar_t a2)
{
const wchar_t *v3; // x0
__int64 v5; // x1
__int64 v6; // x20
v3 = *a1;
v5 = *((_QWORD *)v3 - 3);
v6 = v5 + 1;
if ( (unsigned __int64)(v5 + 1) > *((_QWORD *)v3 - 2) || *(v3 - 2) > 0 )
{
sub_D1D184(a1, v5 + 1);
v3 = *a1;
v5 = *((_QWORD *)*a1 - 3);
}
v3[v5] = a2;
if ( v3 - 6 != (const wchar_t *)&qword_124B6D0 )
{
*((_QWORD *)v3 - 3) = v6;
*((_DWORD *)v3 - 2) = 0;
v3[v6] = 0;
}
return a1;
}