PopFxGetDeviceDStateReason

NTSTATUS __stdcall PopFxGetDeviceDStateReason(INT64 a1){
  signed __int32 v1; 
  NTSTATUS v2; 
  signed __int32 v3; 
  int v4; 
  signed __int32 v5; 
  signed __int32 v6; 
  char v7; 

  _m_prefetchw((const void *)(a1 + 32));
  v1 = *(_DWORD *)(a1 + 32);
  v2 = 0;
  do
  {
    v3 = v1;
    v1 = _InterlockedCompareExchange((volatile signed __int32 *)(a1 + 32), v1, v1);
  }
  while( v3 != v1 );
  v4 = v1 & 0x2000;
  _m_prefetchw((const void *)(a1 + 32));
  v5 = *(_DWORD *)(a1 + 32);
  do
  {
    v6 = v5;
    v5 = _InterlockedCompareExchange((volatile signed __int32 *)(a1 + 32), v5, v5);
  }
  while( v6 != v5 );
  v7 = v5 & 1;
  if( v4 )
    return 2;
  LOBYTE(v2) = v7 != 0;
  return v2;
}

Referenced by:

PoFxReportDevicePoweredOn
PopIrpWorker
PopRequestPowerIrp