KeSubtractAffinityEx

NTSTATUS __fastcall KeSubtractAffinityEx(WORD *a1, INT8 *a2, INT8 *a3){
  NTSTATUS v6; 
  WORD v7; 
  WORD v8; 
  WORD v9; 
  unsigned __int64 v10; 
  bool v11; 
  __int64 v12; 
  __int64 v14; 
  char v15[176]; 

  memset(v15, 0i64, 0xA8u);
  if( !a3 )
    a3 = v15;
  *((_WORD *)a3 + 1) = 20;
  v6 = 0;
  v7 = 0;
  *(_WORD *)a3 = *a1;
  v8 = *a1;
  v9 = *a1;
  if( *a1 >= *(_WORD *)a2 )
    v9 = *(_WORD *)a2;
  if( v9 )
  {
    do
    {
      v10 = 8i64 * v7;
      v11 = (*(_QWORD *)&a1[v10 / 2 + 4] & ~*(_QWORD *)&a2[v10 + 8]) == 0i64;
      *(_QWORD *)&a3[v10 + 8] = *(_QWORD *)&a1[v10 / 2 + 4] & ~*(_QWORD *)&a2[v10 + 8];
      if( !v11 )
        v6 = 1;
      ++v7;
    }
    while( v7 < v9 );
    v8 = *a1;
  }
  if( v7 < v8 )
  {
    do
    {
      v14 = *(_QWORD *)&a1[4 * v7 + 4];
      *(_QWORD *)&a3[8 * v7 + 8] = v14;
      if( v14 )
        v6 = 1;
      ++v7;
    }
    while( v7 < *a1 );
  }
  if( a3 != v15 )
  {
    for( *((_DWORD *)a3 + 1) = 0; v7 < *((_WORD *)a3 + 1); *(_QWORD *)&a3[8 * v12 + 8] = 0i64 )
      v12 = v7++;
  }
  return v6;
}

Referenced by:

HalpRemoveProfileSourceFromList
KiIpiSendRequest
KiStartProfileTarget
KiStopProfileTarget
PpmCheckContinueExecution
PpmCheckInitProcessors
PpmIdleSelectStates
PpmParkReportParkedCores
PpmParkReportUnparkedCores
PpmParkSteerInterrupts
PpmPostProcessMediaBuffering
RtlUpdateSwapReference