PopVerifyPowerActionPolicy

VOID __fastcall PopVerifyPowerActionPolicy(){
  int *v0; 
  int *v1; 
  int v2; 
  int v3; 
  bool IsHiberbootSupported; 
  int v5; 
  int v6; 
  int v7; 
  int v8; 
  int v9; 
  int v10; 
  int v11; 
  int v12; 
  _SYSTEM_POWER_CAPABILITIES FilteredCapabilities; 
  v1 = v0;
  memset((INT64)&FilteredCapabilities, 0i64);
  if( v1 )
  {
    v2 = v1[1];
    if( (v2 & 0xCFFFFC0) == 0 )
    {
      if( v2 < 0 )
        v1[1] = v2 & 0xFFFFFFF8 | 4;
      PopFilterCapabilities((_SYSTEM_POWER_CAPABILITIES *)&PopCapabilities, &FilteredCapabilities);
      if( v3 >= 0 )
      {
        if( (v1[1] & 8) != 0 )
          IsHiberbootSupported = PopIsHiberbootSupported((INT64)&FilteredCapabilities);
        else
          IsHiberbootSupported = PopIsHibernateSupported(&FilteredCapabilities.PowerButtonPresent);
        v7 = *v1;
        while( 1 )
        {
          v8 = v7;
          v9 = v7;
          if( v7 == v5 )
            break;
          v10 = v7 - v5 - v5;
          if( !v10 )
            goto LABEL_16;
          v11 = v10 - v5;
          if( !v11 )
          {
            v9 = 3;
            if( IsHiberbootSupported )
              goto LABEL_14;
            if( !PopPromoteHibernateToShutdown )
            {
              if( !v6 )
                goto LABEL_31;
              goto LABEL_23;
            }
LABEL_19:
            *v1 = 4;
            v9 = 4;
            goto LABEL_14;
          }
          v12 = v11 - 3;
          if( v12 )
          {
            if( v12 != 2 )
              goto LABEL_14;
            v9 = 8;
            if( !FilteredCapabilities.spare2[2] )
              goto LABEL_14;
LABEL_23:
            *v1 = 2;
            v9 = 2;
            goto LABEL_14;
          }
          v9 = 6;
          if( !FilteredCapabilities.SystemS5 )
            goto LABEL_19;
LABEL_14:
          v7 = v9;
          if( v8 == v9 )
            return;
        }
        *v1 = 2;
        v7 = 2;
LABEL_16:
        v9 = v7;
        if( !v6 )
        {
          if( !IsHiberbootSupported )
          {
LABEL_31:
            *v1 = 0;
            v9 = 0;
            goto LABEL_14;
          }
          *v1 = 3;
          v9 = 3;
        }
        goto LABEL_14;
      }
    }
  }
}

Referenced by:

PdcPoVerifyActionPolicy
PopExecutePowerAction
PopVerifySystemPowerPolicy