MiGetPfnPageSizeIndexUnsynchronized

INT64 __fastcall MiGetPfnPageSizeIndexUnsynchronized(INT64 a1, INT64 *a2, INT64 *a3){
  unsigned int PfnPageSizeIndex; 
  int v4; 
  int v5; 
  UINT8 v9; 
  _MMPFN *BaseResidentPage; 
  __int64 v11; 
  INT64 result; 
  PfnPageSizeIndex = -1;
  v4 = *(_BYTE *)(a1 + 34) & 7;
  v5 = *(unsigned __int8 *)(a1 + 34) >> 6;
  if( (*(_QWORD *)(a1 + 40) & 0x1000000000i64) != 0 )
  {
    v9 = MiLockPageInline(a1);
    if( (*(_QWORD *)(a1 + 40) & 0x1000000000i64) != 0 )
    {
      BaseResidentPage = MiGetBaseResidentPage((_MMPFN *)a1);
      v5 = *((unsigned __int8 *)BaseResidentPage + 34) >> 6;
      v4 = *((_BYTE *)BaseResidentPage + 34) & 7;
      PfnPageSizeIndex = MiGetPfnPageSizeIndex((INT64)BaseResidentPage);
      if( v11 != a1 )
        _InterlockedAnd64((volatile signed __int64 *)(v11 + 24), 0x7FFFFFFFFFFFFFFFui64);
    }
    MiUnlockPage((_MMPFN *)a1, v9);
  }
  *(_DWORD *)a2 = v4;
  result = PfnPageSizeIndex;
  *(_DWORD *)a3 = v5;
  return result;
}

Referenced by:

MiActivePageClaimCandidate
MiCombineAllPhysicalMemory
MiFillSystemPtes
MiGetPagesRemainingInResidentPage
MiLegitimatePageForDriversToMap
MiPfnsWorthTrying
MiProbeLeafPteAccess