RtlpHpSegSubAllocate

INT64 __fastcall RtlpHpSegSubAllocate(INT64 a1, UINT64 a2, INT64 a3, _DWORD *a4, _DWORD *a5){
  unsigned int v5; 
  int v6; 
  UINT64 v9; 
  UINT64 v10; 
  INT64 v11; 
  UINT64 v13; 
  UINT64 *v14; 
  v5 = a2;
  v6 = a3 | 4;
  if( (unsigned int)a2 < 0x10000 )
    v6 = a3;
  LODWORD(v13) = v6;
  v9 = RtlpHpSegAlloc(a1, (unsigned int)a2, (unsigned int)a2, 0i64, v13);
  *a4 = 0;
  v11 = v9;
  *a5 = 0;
  if( v9
    && ((RtlpHpLfhPerfFlags & 0x80u) != 0 && BYTE1(*(_OWORD *)(a1 + 40)) >= 2u
     || (RtlpHpLfhPerfFlags & 0x100) != 0
     && (*(_BYTE *)(a1 + 13) & 7) != 0
     && RtlpHpSegPageRangeComputeLargePageCost((PVOID)a1, (THREADINFOCLASS)v9, (PVOID)v5, v10, v14) <= 1) )
  {
    *a4 |= 1u;
  }
  return v11;
}

Referenced by:

RtlpHpSegLfhAllocate
RtlpHpSegVsAllocate