MiZeroAndConvertPage

INT64 __fastcall MiZeroAndConvertPage(INT64 a1, UINT64 a2, INT64 a3, CHAR a4){
  __int64 v4; 
  unsigned int v6; 
  INT64 v7; 
  INT64 v8; 
  BOOL v9; 
  int v10; 
  BOOL v11; 
  INT64 result; 
  v4 = (int)a3;
  v6 = a2;
  v7 = 1i64;
  v8 = (a1 - (__int64)MmGetPfnDb()) / 48;
  v9 = (a4 & 1) != 0 || (a4 & 2) != 0 && (*(_DWORD *)(a1 + 16) & 0x3E0i64) != 0;
  v10 = *(unsigned __int8 *)(a1 + 34) >> 6;
  if( (_DWORD)a2 != 3 )
    v7 = MiLargePageSizes[(unsigned int)a2];
  v11 = v10 != v4;
  if( v9 )
  {
    if( v10 != (_DWORD)v4
      && dword_140C4DCD8[4 * ((unsigned __int64)*(unsigned __int8 *)(a1 + 34) >> 6) + v4] == (_DWORD)v4 )
    {
      MiChangePageAttributeContiguous(v8, v7, (unsigned int)v4);
      v11 = 0;
    }
    if( v6 == 3 )
      MiZeroPhysicalPage(v8, 0i64, (_MI_PFN_CACHE_ATTRIBUTE)v4);
    else
      MiZeroLargePage(a1, v6, (unsigned int)v4);
  }
  if( v11 )
    MiChangePageAttributeContiguous(v8, v7, (unsigned int)v4);
  result = ZeroPte;
  *(_QWORD *)(a1 + 16) = ZeroPte;
  return result;
}

Referenced by:

MiInitializeMdlOneNodeBatchPages
MiZeroInParallelWorker