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