PopPowerAggregatorScreenOffEnterStateHandler

NTSTATUS __stdcall PopPowerAggregatorScreenOffEnterStateHandler(INT64 a1){
  bool v1; 
  int v3; 
  INT64 v4; 
  __int64 v5; 
  unsigned __int8 v6; 
  int v7; 
  int v8; 
  unsigned int v9; 
  unsigned int v10; 
  INT64 v11; 
  INT64 v12; 
  INT64 v14; 
  int v15; 
  INT64 v16[4]; 
  INT64 v17; 

  v1 = *(_DWORD *)(a1 + 72) == 3;
  memset(v16, 0, sizeof(v16));
  if( v1 )
  {
    v3 = *(_DWORD *)(a1 + 48);
    v16[3] = 0i64;
    HIDWORD(v16[2]) = v3;
    *(_OWORD *)((char *)v16 + 4) = 0i64;
    LODWORD(v16[0]) = 4;
    PopPowerAggregatorSetCurrentState(a1, (INT64)v16);
    return 0;
  }
  if( *(_QWORD *)(a1 + 40) != *(_QWORD *)(a1 + 80) )
  {
    HIDWORD(v16[2]) = *(_DWORD *)(a1 + 48);
    LOBYTE(v16[3]) = *(_BYTE *)(a1 + 96);
    HIDWORD(v16[3]) = *(_DWORD *)(a1 + 100);
    LODWORD(v16[0]) = 4;
    PopPowerAggregatorSetCurrentState(a1, (INT64)v16);
    PopPowerAggregatorStartNextSession(1i64, *(unsigned int *)(a1 + 32));
    return 0;
  }
  v4 = *(_QWORD *)(a1 + 52);
  v5 = *(int *)(a1 + 92);
  v6 = *(_BYTE *)(a1 + 65);
  v15 = *(_DWORD *)(a1 + 60);
  v7 = *(_DWORD *)(a1 + 88);
  v14 = v4;
  if( v7 < 0 )
    return 0;
  if( v7 > 1 )
  {
    if( v7 == 2 )
      goto LABEL_13;
    v8 = v5;
    if( v7 == 3 )
    {
LABEL_16:
      v10 = *(_DWORD *)(a1 + 100);
      v16[3] = 0i64;
      HIDWORD(v16[2]) = v8;
      *(_OWORD *)((char *)v16 + 4) = 0i64;
      LODWORD(v16[0]) = 1;
      PopPowerAggregatorSetCurrentState(a1, (INT64)v16);
      PopPowerAggregatorStartNextSession(2i64, *(unsigned int *)(a1 + 76));
      PopPowerAggregatorLockRelease();
      PopDripsWatchdogNotifySessionStart(v6);
      v17 = v6;
      PopDirectedDripsNotify(6i64, &v17, v11, v12);
      PopPowerAggregatorEngageAggressiveStandbyActions((unsigned int)v5, (INT64)&v14);
      ((void(__fastcall *)(_QWORD))qword_140C54188)(v10);
      PopPowerAggregatorLockAcquire();
      return 0;
    }
    if( v7 != 4 )
      return 0;
  }
  v9 = PopPowerAggregatorModernStandbyResourceMasks[v5];
  PopPowerAggregatorLockRelease();
  if( qword_140C54158 )
    qword_140C54158(v9);
  PopPowerAggregatorLockAcquire();
  *(_DWORD *)(a1 + 88) = 2;
LABEL_13:
  if( !*(_BYTE *)(a1 + 104) && *(_BYTE *)(a1 + 96) )
  {
    v8 = *(_DWORD *)(a1 + 92);
    *(_DWORD *)(a1 + 88) = 3;
    goto LABEL_16;
  }
  return 0;
}

Referenced by:

No references.