//
// sub_180042E20 from 0x180042e20 to 0x180042ea5 (133 bytes)
//
// 2 xrefs:
// > sub_180046C10 @ 0x180046d3b
// > ??> @ 0x1801f80c4
//
// 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
//
__int64 __fastcall sub_180042E20(__int64 a1, unsigned int a2)
{
size_t v4; // rsi
void *v5; // rax
void *v6; // rax
if ( *(_DWORD *)(a1 + 16) >= a2 )
return 1;
v4 = 4LL * (unsigned int)(1 << a2);
v5 = j__realloc_base(*(void **)a1, v4);
*(_QWORD *)a1 = v5;
if ( v5 )
{
v6 = j__realloc_base(*(void **)(a1 + 8), v4);
*(_QWORD *)(a1 + 8) = v6;
if ( v6 )
{
memset(v6, 0, v4);
*(_DWORD *)(a1 + 16) = a2;
return 1;
}
}
return 0;
}