PnprRecopyMirrorPages

VOID __fastcall PnprRecopyMirrorPages(){
  __int64 v0; 
  INT64 v1; 
  UINT64 v2; 
  UINT64 v3; 
  __int64 v4; 
  int v5; 
  UINT64 v6; 
  int v7; 
  int v8; 
  int v9; 
  UINT64 v10; 
  int v11; 
  int v12; 
  INT64 v13; 
  v0 = *((unsigned int *)KeGetPcr() + 105);
  PnprGetStackLimits((UINT64 *)(PnprContext + 216 + 8 * v0), (UINT64 *)(PnprContext + 10456 + 8 * v0));
  v3 = PnprContext;
  v4 = 0i64;
  if( *(_DWORD *)(PnprContext + 176) )
  {
    while( (int)PnprRecopyAddress(
                   *(_QWORD *)(v3 + 8 * v4 + 216),
                   *(_DWORD *)(v3 + 8 * v4 + 10456) - (unsigned int)*(_QWORD *)(v3 + 8 * v4 + 216),
                   v1,
                   v2,
                   v13) >= 0 )
    {
      if( (_DWORD)v4 != *(_DWORD *)(PnprContext + 180) )
      {
        if( (int)PnprRecopyMappingReserve(*(_QWORD *)(PnprContext + 144) + 24 * v4) < 0 )
        {
          v9 = 5613;
          goto LABEL_17;
        }
        if( (int)PnprRecopyMappingReserve(*(_QWORD *)(PnprContext + 136) + 24 * v4) < 0 )
        {
          v9 = 5621;
          goto LABEL_17;
        }
      }
      v3 = PnprContext;
      v4 = (unsigned int)(v4 + 1);
      if( (unsigned int)v4 >= *(_DWORD *)(PnprContext + 176) )
        goto LABEL_7;
    }
    v9 = 5597;
LABEL_17:
    v10 = PnprContext;
    v11 = *(_DWORD *)(PnprContext + 20984);
    if( !v11 )
      v11 = v9;
    *(_DWORD *)(PnprContext + 20984) = v11;
    v12 = *(_DWORD *)(v10 + 20988);
    if( !v12 )
      v12 = 1;
    *(_DWORD *)(v10 + 20988) = v12;
  }
  else
  {
LABEL_7:
    if( (int)PnprRecopyAddress(v3, 0x5238ui64, v1, v2, v13) >= 0 )
    {
      if( (int)PnprCopyReservedMapping() >= 0 )
        return;
      v5 = 5645;
    }
    else
    {
      v5 = 5633;
    }
    v6 = PnprContext;
    v7 = *(_DWORD *)(PnprContext + 20984);
    if( !v7 )
      v7 = v5;
    *(_DWORD *)(PnprContext + 20984) = v7;
    v8 = *(_DWORD *)(v6 + 20988);
    if( !v8 )
      v8 = 1;
    *(_DWORD *)(v6 + 20988) = v8;
  }
}

Referenced by:

PnprSwapFinalize