//
// sub_180030700 from 0x180030700 to 0x180030773 (115 bytes)
//
// 2 xrefs:
// > sub_1800308E0 @ 0x180030908
// > ??> @ 0x1801b01b0
//
// 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_180030700(__int64 a1, _QWORD *a2)
{
size_t v2; // rcx
void *v3; // rax
void *v4; // rcx
_QWORD *result; // rax
if ( *a2 > 0x3FFFFFFFFFFFFFFFuLL )
goto LABEL_10;
v2 = 4LL * *a2;
if ( v2 < 0x1000 )
{
if ( v2 )
return operator new(v2);
else
return nullptr;
}
if ( v2 + 39 < v2 )
LABEL_10:
Concurrency::cancel_current_task();
v3 = operator new(v2 + 39);
v4 = v3;
if ( !v3 )
invalid_parameter_noinfo_noreturn();
result = (_QWORD *)(((unsigned __int64)v3 + 39) & 0xFFFFFFFFFFFFFFE0uLL);
*(result - 1) = v4;
return result;
}