MiPurgeLargeZeroNodePages

VOID __stdcall MiPurgeLargeZeroNodePages(_MI_PARTITION *Partition){
  _MI_NODE_INFORMATION *NodeInformation; 
  unsigned __int64 *p_LargePageLock; 
  unsigned __int8 CurrentIrql; 
  unsigned int v4; 
  char *v5; 
  _MI_NODE_INFORMATION *v6; 
  unsigned int v7; 
  unsigned int v8; 
  __int64 v9; 
  __int64 v10; 
  int v11; 
  _QWORD *v12; 
  unsigned int v13; 
  __int64 v14; 
  __int64 v15; 
  char *v16; 
  _MI_NODE_INFORMATION *v17; 
  _MI_NODE_INFORMATION *v18; 
  _KLOCK_QUEUE_HANDLE LockQueue[4]; 
  int v20; 
  int v21; 
  unsigned int v22; 
  unsigned int v23; 

  v20 = (int)Partition;
  NodeInformation = Partition->Core.NodeInformation;
  memset(LockQueue, 0, 24);
  v18 = &NodeInformation[(unsigned __int16)KeNumberNodes];
  if( NodeInformation < v18 )
  {
    p_LargePageLock = &NodeInformation->LargePageLock;
    do
    {
      CurrentIrql = KeGetCurrentIrql();
      __writecr8(2ui64);
      LockQueue[0].LockQueue.Next = 0i64;
      LockQueue[0].LockQueue.Lock = p_LargePageLock;
      KxAcquireQueuedSpinLock(&LockQueue[0].LockQueue, p_LargePageLock);
      v4 = 0;
      v17 = NodeInformation;
      v5 = (char *)&stru_140C4DB30 + 400;
      v22 = 0;
      v16 = (char *)&stru_140C4DB30 + 400;
      v6 = NodeInformation;
      do
      {
        if( v6->FreeLargePages[0].LargePageFreeCount[0] )
        {
          v7 = *(_DWORD *)v5;
          v8 = 0;
          v23 = *(_DWORD *)v5;
          if( MmNumberOfChannels )
          {
            do
            {
              v9 = 32i64 * v8 + 560;
              v21 = 0;
              v15 = v9;
              do
              {
                v10 = v9;
                v11 = 0;
                v14 = v9;
                do
                {
                  v12 = *(_QWORD **)((char *)v6->FreeLargePages[0].LargePageFreeCount + v10);
                  v13 = 0;
                  if( v7 )
                  {
                    do
                    {
                      if( (_QWORD *)*v12 != v12 )
                      {
                        if( !(unsigned int)MiMoveLargeZeroToFree(v20, (_DWORD)NodeInformation, v4, v21, v13, v8, v11) )
                        {
                          KeReleaseInStackQueuedSpinLockFromDpcLevel(LockQueue);
                          __writecr8(CurrentIrql);
                          --v13;
                          v12 -= 3;
                          CurrentIrql = KeGetCurrentIrql();
                          __writecr8(2ui64);
                          LockQueue[0].LockQueue.Next = 0i64;
                          LockQueue[0].LockQueue.Lock = p_LargePageLock;
                          KxAcquireQueuedSpinLock(&LockQueue[0].LockQueue, p_LargePageLock);
                        }
                        v7 = v23;
                        v4 = v22;
                      }
                      ++v13;
                      v12 += 3;
                    }
                    while( v13 < v7 );
                    v6 = v17;
                    v10 = v14;
                  }
                  v10 += 8i64;
                  ++v11;
                  v14 = v10;
                }
                while( v11 <= 3 );
                ++v21;
                v9 = v15 + 256;
                v15 += 256i64;
              }
              while( v21 <= 1 );
              ++v8;
            }
            while( v8 < MmNumberOfChannels );
            v5 = v16;
          }
        }
        ++v4;
        v5 += 4;
        v6 = (_MI_NODE_INFORMATION *)((char *)v6 + 1072);
        v22 = v4;
        v16 = v5;
        v17 = v6;
      }
      while( v4 < 3 );
      KeReleaseInStackQueuedSpinLockFromDpcLevel(LockQueue);
      __writecr8(CurrentIrql);
      ++NodeInformation;
      p_LargePageLock += 568;
    }
    while( NodeInformation < v18 );
  }
}

Referenced by:

MiPurgeZeroList