PopFxHandleDirectedPowerTransition

NTSTATUS __stdcall PopFxHandleDirectedPowerTransition(ULONG_PTR BugCheckParameter3){
  __int64 v1; 
  signed __int32 v2; 
  signed __int32 v3; 
  int v4; 
  __int64 v5; 
  NTSTATUS result; 

  v1 = *(_QWORD *)&BugCheckParameter3;
  _m_prefetchw((const void *)(*(_QWORD *)&BugCheckParameter3 + 32i64));
  v2 = *(_DWORD *)(*(_QWORD *)&BugCheckParameter3 + 32i64);
  do
  {
    v3 = v2;
    v2 = _InterlockedCompareExchange((volatile signed __int32 *)(*(_QWORD *)&BugCheckParameter3 + 32i64), v2, v2);
  }
  while( v3 != v2 );
  v4 = v2 & 0x1000;
  PopDiagTraceFxDeviceDirectedTransition(*(_QWORD *)(*(_QWORD *)&BugCheckParameter3 + 48i64), v4 != 0);
  PopFxEnableWorkOrderWatchdog((POP_FX_WORK_ORDER *)(v1 + 920));
  v5 = *(_QWORD *)(v1 + 192);
  if( v4 )
    (*(void(__fastcall **)(__int64, _QWORD))(v1 + 184))(v5, 0i64);
  else(*(void(__fastcall **)(__int64, _QWORD))(v1 + 176))(v5, 0i64);
  if( _InterlockedExchangeAdd((volatile signed __int32 *)(v1 + 1160), 0xFFFFFFFF) == 1 )
    return PopFxCompleteDirectedPowerTransition(v1);
  PopFxAddLogEntry(*(_QWORD *)(v1 + 48), 0, 24, 0i64);
  return result;
}

Referenced by:

PopFxDirectedPowerTransitionWorker