MiMirrorNodeLargePages

UINT64 __fastcall MiMirrorNodeLargePages(INT64 a1, INT64 a2, UINT8 *a3){
  UINT64 v3; 
  int v4; 
  void *v5; 
  UINT64 result; 
  _LIST_ENTRY *v7; 
  UINT64 v8; 
  int *v9; 
  UINT64 *v10; 
  UINT64 v11; 
  __int64 v12; 
  unsigned int v13; 
  __int64 i; 
  unsigned int v15; 
  __int64 v16; 
  __int64 v17; 
  char **v18; 
  __int64 v19; 
  char *v20; 
  __int64 v21; 
  bool v22; 
  __int64 v23; 
  __int64 v24; 
  __int64 *v25; 
  int *v26; 
  UINT64 v27; 
  __int64 v28; 
  unsigned __int8 CurrentIrql; 
  UINT64 v30; 
  _LIST_ENTRY *v31; 
  UINT64 v32; 
  struct _IO_WORKITEM LockHandle; 
  int v35; 
  int v36; 
  __int64 v37; 
  v36 = (int)a3;
  v30 = *(_QWORD *)(a2 + 16);
  v3 = v30;
  memset(&LockHandle, 0, 24);
  v4 = (int)a3;
  v5 = (void *)a1;
  CurrentIrql = 17;
  result = v30 + 4544i64 * (unsigned __int16)KeNumberNodes;
  v32 = result;
  if( v30 < result )
  {
    v7 = (_LIST_ENTRY *)(v30 + 4328);
    v31 = (_LIST_ENTRY *)(v30 + 4328);
    do
    {
      if( !v4 )
      {
        CurrentIrql = KeGetCurrentIrql();
        __writecr8(2ui64);
        LockHandle.WorkItem.List.Flink = 0i64;
        LockHandle.WorkItem.List.Blink = v7;
        KxAcquireQueuedSpinLock(&LockHandle, (PIO_WORKITEM_ROUTINE)v7, (WORK_QUEUE_TYPE)a3, v5);
        v5 = (void *)a1;
      }
      v8 = v3;
      v28 = 3i64;
      v9 = dword_140C4DCC0;
      v27 = v3;
      v10 = (UINT64 *)MiLargePageSizes;
      v26 = dword_140C4DCC0;
      v25 = MiLargePageSizes;
      do
      {
        v11 = *v10;
        v12 = 0i64;
        v13 = *v9;
        v35 = *v9;
        v24 = 0i64;
        do
        {
          for( i = 0i64; i <= 1; ++i )
          {
            v15 = 0;
            if( MmNumberOfChannels )
            {
              do
              {
                v16 = 4i64;
                v23 = 4i64;
                v17 = 32 * (4 * (i + v12) + v15) + 560;
                do
                {
                  v18 = *(char ***)(v8 + v17);
                  if( v13 )
                  {
                    v19 = v13;
                    v37 = v13;
                    do
                    {
                      v20 = *v18;
                      if( *v18 != (char *)v18 )
                      {
                        do
                        {
                          v21 = (v20 - (char *)MmGetPfnDb()) / 48;
                          if( v36 )
                            MiMirrorOmitPagesFromCopy((INT64)v5, v21, v11);
                          else
                            MiMirrorAddPagesToBrownList(v21, v11);
                          v20 = *(char **)v20;
                          v5 = (void *)a1;
                        }
                        while( v20 != (char *)v18 );
                        v19 = v37;
                      }
                      v5 = (void *)a1;
                      v18 += 3;
                      v37 = --v19;
                    }
                    while( v19 );
                    v16 = v23;
                    v8 = v27;
                    v13 = v35;
                  }
                  v5 = (void *)a1;
                  v17 += 8i64;
                  v23 = --v16;
                }
                while( v16 );
                ++v15;
              }
              while( v15 < MmNumberOfChannels );
              v12 = v24;
            }
            v5 = (void *)a1;
          }
          v12 += 2i64;
          v24 = v12;
        }
        while( v12 <= 2 );
        v8 += 1072i64;
        v10 = (UINT64 *)(v25 + 1);
        v9 = v26 + 1;
        ++v25;
        v22 = v28-- == 1;
        ++v26;
        v27 = v8;
      }
      while( !v22 );
      v4 = v36;
      if( !v36 )
      {
        KeReleaseInStackQueuedSpinLockFromDpcLevel((_KLOCK_QUEUE_HANDLE *)&LockHandle);
        __writecr8(CurrentIrql);
      }
      result = 4544i64;
      v5 = (void *)a1;
      v3 = v30 + 4544;
      v7 = v31 + 284;
      v30 = v3;
      v31 += 284;
    }
    while( v3 < v32 );
  }
  return result;
}

Referenced by:

MiMirrorGatherBrownPages
MiMirrorReduceBlackWrites