NTSTATUS __stdcall RtlpHpVaMgrCtxAlloc(INT64 a1, INT64 a2, INT64 a3, UINT64 *a4){
ULONG_PTR v6;
volatile int *v8;
unsigned __int64 v9;
if( *(_DWORD *)a4 == -1 )
{
v8 = (volatile int *)(a1 + 2144);
v9 = (unsigned __int8)ExAcquireSpinLockShared((INT64 *)(a1 + 2144));
v6 = RtlpHpVaMgrCtxAllocatorFind(a1, (__int64)a4, 0, 0i64);
ExReleaseSpinLockSharedFromDpcLevel(v8);
__writecr8(v9);
}
else
{
v6 = a1 + 48 * (*(_DWORD *)a4 + 45);
}
return RtlpHpVaMgrAlloc(v6);
}