HalpDpPreReplace

VOID __fastcall HalpDpPreReplace(INT64 a1){
  INT64 v1; 
  INT64 v2; 
  INT64 v3; 
  char v4; 
  __int16 v5; 
  __int16 v6; 
  v5 = 0;
  v6 = 0;
  if( !*(_BYTE *)(a1 + 45) )
  {
    (*(void(__fastcall **)(_QWORD))(PmAcpiDispatchTable + 8))(0i64);
    if( (int)HalpAcpiPmRegisterAvailable(0) >= 0 )
    {
      HalpAcpiPmRegisterRead(0, (unsigned __int8)byte_140C49DD8 >> 1, (__int64)&v6, 2u, 0i64);
      v4 = v6;
      v5 = v6;
      if( (int)HalpAcpiPmRegisterAvailable(3) >= 0 )
      {
        HalpAcpiPmRegisterRead(3, (unsigned __int8)byte_140C49DD8 >> 1, (__int64)&v6, 2u, 0i64);
        v4 = v6 | v5;
      }
      v5 = v4 & 0x20;
      HalpAcpiPmRegisterWrite(0, (unsigned __int8)byte_140C49DD8 >> 1, (__int64)&v5, 2u, 0i64);
      if( (int)HalpAcpiPmRegisterAvailable(3) >= 0 )
        HalpAcpiPmRegisterWrite(3, (unsigned __int8)byte_140C49DD8 >> 1, (__int64)&v5, 2u, 0i64);
    }
    if( (HalpPlatformFlags & 4) != 0 )
      HalpSetClockBeforeSleep(v2, v1, v3);
  }
}

Referenced by:

HalpDpReplaceControl