//
// sub_D1DB18 from 0xd1db18 to 0xd1dbd0 (184 bytes)
//
// 4 xrefs:
// > sub_D1DBD0 @ 0xd1dc18
// > sub_D1DC60 @ 0xd1dcf8
// > sub_D1DD50 @ 0xd1dde8
// > sub_D1DF74 @ 0xd1dfd4
//
// 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
//
_QWORD *__fastcall sub_D1DB18(__int64 a1, __int64 a2, __int64 a3)
{
__int64 *v4; // x20
size_t v5; // x2
_QWORD *result; // x0
v4 = sub_D1B424(a3 + *(_QWORD *)a1, *(_QWORD *)(a1 + 8));
v5 = *(_QWORD *)a1;
result = v4 + 3;
if ( !*(_QWORD *)a1 )
{
LABEL_4:
if ( v4 == &qword_124B6D0 )
return result;
LABEL_7:
*((_DWORD *)v4 + 4) = 0;
*v4 = v5;
*((_DWORD *)v4 + v5 + 6) = 0;
return result;
}
if ( v5 != 1 )
{
wmemcpy((wchar_t *)v4 + 6, (const wchar_t *)(a1 + 24), v5);
v5 = *(_QWORD *)a1;
result = v4 + 3;
goto LABEL_4;
}
*((_DWORD *)v4 + 6) = *(_DWORD *)(a1 + 24);
result = v4 + 3;
if ( v4 != &qword_124B6D0 )
goto LABEL_7;
return result;
}