MiWaitForAsynchronousFlushes

__int64 __fastcall MiWaitForAsynchronousFlushes(unsigned int *a1){
  unsigned int *v1; 
  VOID **v2; 
  unsigned __int8 CurrentIrql; 
  unsigned int v4; 
  v1 = a1;
  v2 = (VOID **)(a1 + 528);
  CurrentIrql = KeGetCurrentIrql();
  __writecr8(1ui64);
  v4 = 0;
  do
  {
    if( !*((_QWORD *)a1 + 2) || a1[13] == 1 )
    {
      a1 += 66;
    }
    else
    {
      __writecr8(CurrentIrql);
      KeWaitForMultipleObjects((_BYTE *)8, v2, WaitAny, WrPageOut, 0, 0, 0i64, (_KWAIT_BLOCK *)(v1 + 544));
      a1 = v1;
      CurrentIrql = KeGetCurrentIrql();
      __writecr8(1ui64);
    }
  }
  while( a1 < (unsigned int *)v2 );
  __writecr8(CurrentIrql);
  while( (*v1 & 0x80000000) == 0 )
  {
    v1 += 66;
    if( v1 >= (unsigned int *)v2 )
      return v4;
  }
  return *v1;
}

Referenced by:

MiFlushSectionInternal