//
// sub_1005DB124 from 0x1005db124 to 0x1005db1b4 (144 bytes)
//
// 1 xrefs:
// > sub_10061395C @ 0x100613f3c
//
// 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_1005DB124(char *__s, int a2)
{
size_t v3; // x20
_QWORD *result; // x0
size_t *v5; // x8
if ( __s )
{
if ( a2 < 0 )
v3 = strlen(__s);
else
v3 = a2;
result = sub_1005DA484((__int64)&unk_100860FD0);
if ( result )
{
v5 = (size_t *)result[6];
*v5 = v3;
v5[1] = (size_t)__s;
v5[2] = v3;
*((_DWORD *)result + 8) |= 0x200u;
*((_DWORD *)result + 10) = 0;
}
else
{
return nullptr;
}
}
else
{
sub_1005E0E48(32, 126, 115, "bss_mem.c", 102);
return nullptr;
}
return result;
}