//
// sub_D15D4C from 0xd15d4c to 0xd15dec (160 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
//
_BYTE **__fastcall sub_D15D4C(_BYTE **a1, char a2)
{
_BYTE *v3; // x0
__int64 v5; // x1
__int64 v6; // x20
_BYTE *v7; // x1
v3 = *a1;
v5 = *((_QWORD *)v3 - 3);
v6 = v5 + 1;
if ( (unsigned __int64)(v5 + 1) > *((_QWORD *)v3 - 2) || *((int *)v3 - 2) > 0 )
{
sub_D15888(a1, v5 + 1);
v3 = *a1;
v5 = *((_QWORD *)*a1 - 3);
}
v3[v5] = a2;
v7 = *a1;
if ( *a1 - 24 == (_BYTE *)&qword_124B6B0 )
return a1;
*((_QWORD *)v7 - 3) = v6;
*((_DWORD *)v7 - 2) = 0;
v7[v6] = 0;
return a1;
}