PopPowerAggregatorHandleIntentUnsafe

__int64 __fastcall PopPowerAggregatorHandleIntentUnsafe(_QWORD *a1, unsigned int a2, unsigned int a3){
  __int64 v5; 
  __int64(__fastcall *v6)(char *, INT64 *, _QWORD); 
  int v7; 
  INT64 v9[2]; 
  __m256i v10; 
  __int128 v11[3]; 

  v11[0] = *(_OWORD *)((char *)&PopIrpWorkerControlEvent + 3032);
  v5 = (int)a1;
  v10.m256i_i64[0] = ++*(&PopIrpWorkerControlEvent + 376);
  v11[2] = *(_OWORD *)((char *)&PopIrpWorkerControlEvent + 3064);
  LODWORD(v9[0]) = 4;
  v9[1] = a3;
  HIDWORD(v9[0]) = (_DWORD)a1;
  memset(&v10.m256i_u64[1], 0, 24);
  v11[1] = *(_OWORD *)((char *)&PopIrpWorkerControlEvent + 3048);
  if( (unsigned int)((_DWORD)a1 - 1) <= 7
    && a2 <= 2
    && (PopPowerAggregatorCachePoPolicy(),
        a1 = PopPowerAggregatorIntentHandlers,
        (v6 = (__int64(__fastcall *)(char *, INT64 *, _QWORD))PopPowerAggregatorIntentHandlers[v5]) != 0i64) )
  {
    v7 = v6((char *)&PopIrpWorkerControlEvent + 3008, v9, (unsigned int)v5);
    if( v7 >= 0 )
    {
      *(_OWORD *)((char *)&PopIrpWorkerControlEvent + 3032) = *(_OWORD *)v9;
      *(_OWORD *)((char *)&PopIrpWorkerControlEvent + 3048) = *(_OWORD *)v10.m256i_i8;
      *(_OWORD *)((char *)&PopIrpWorkerControlEvent + 3064) = *(_OWORD *)&v10.m256i_u64[2];
      if( PopPowerAggregatorIsAtTargetState() )
      {
        v7 = 0;
      }
      else
      {
        v7 = 259;
        PopPowerAggregatorScheduleWorker((INT64)&PopIrpWorkerControlEvent + 3008);
      }
    }
  }
  else
  {
    v7 = -1073741811;
  }
  PopPowerAggregatorRecordIntent((__int64)a1, v5, a2, a3, (INT64)v11, (INT64)v9, v7);
  return(unsigned int)v7;
}

Referenced by:

PopPowerAggregatorForceSessionSwitch
PopPowerAggregatorHandleIntent
PopPowerAggregatorNotifySuspendResume