PopDeepSleepResiliencyPhaseAccountingBegin

NTSTATUS __stdcall PopDeepSleepResiliencyPhaseAccountingBegin(_TOKEN *ExistingToken, _TOKEN *NewToken){
  void **PerformanceCounter; 
  unsigned __int8 v3; 
  char v4; 
  unsigned int v5; 
  bool i; 
  int v7; 
  void *retaddr; 

  PerformanceCounter = &retaddr;
  v3 = 0;
  v4 = (char)NewToken;
  v5 = (unsigned int)ExistingToken;
  if( !(_BYTE)NewToken )
  {
    v3 = KeAcquireSpinLockRaiseToDpc((UINT64 *)&PopIrpWorkerControlEvent + 27);
    KxAcquireSpinLock((UINT64 *)&stru_140C23628 + 115);
  }
  dword_140C22FDC |= v5;
  for( i = !_BitScanForward((unsigned int *)&v7, v5); !i; i = !_BitScanForward((unsigned int *)&v7, v5) )
  {
    LODWORD(PerformanceCounter) = v5 - 1;
    v5 &= v5 - 1;
    if( ((1 << v7) & *(&PopIrpWorkerControlEvent + 52)) != 0 )
    {
      PerformanceCounter = (void **)KeQueryPerformanceCounter(0i64);
      qword_140C22FE0[v7] = PerformanceCounter;
    }
  }
  if( !v4 )
  {
    KxReleaseSpinLock((UINT64 *)&stru_140C23628 + 115);
    KxReleaseSpinLock((UINT64 *)&PopIrpWorkerControlEvent + 27);
    LODWORD(PerformanceCounter) = v3;
    __writecr8(v3);
  }
  return(int)PerformanceCounter;
}

Referenced by:

PdcPoCurrentPdcPhase
PopDeepSleepResiliencyPhaseAccountingUpdate