HalpDpPreReplace

VOID __stdcall HalpDpPreReplace(INT64 a1){
  INT64 v1; 
  INT64 v2; 
  INT64 v3; 
  char v4; 
  __int16 Input; 
  __int16 Output; 

  Input = 0;
  Output = 0;
  if( !*(_BYTE *)(a1 + 45) )
  {
    (*(void(__fastcall **)(_QWORD))(qword_140C507B0 + 8))(0i64);
    if( HalpAcpiPmRegisterAvailable(PM1A_EVT_REGISTER) >= 0 )
    {
      HalpAcpiPmRegisterRead(PM1A_EVT_REGISTER, Fadt.pm1_evt_len >> 1, &Output, 2ui64, 0i64);
      v4 = Output;
      Input = Output;
      if( HalpAcpiPmRegisterAvailable(PM1B_EVT_REGISTER) >= 0 )
      {
        HalpAcpiPmRegisterRead(PM1B_EVT_REGISTER, Fadt.pm1_evt_len >> 1, &Output, 2ui64, 0i64);
        v4 = Output | Input;
      }
      Input = v4 & 0x20;
      HalpAcpiPmRegisterWrite(PM1A_EVT_REGISTER, Fadt.pm1_evt_len >> 1, &Input, 2ui64, 0i64);
      if( HalpAcpiPmRegisterAvailable(PM1B_EVT_REGISTER) >= 0 )
        HalpAcpiPmRegisterWrite(PM1B_EVT_REGISTER, Fadt.pm1_evt_len >> 1, &Input, 2ui64, 0i64);
    }
    if( (HalpPlatformFlags & 4) != 0 )
      HalpSetClockBeforeSleep(v2, v1, v3);
  }
}

Referenced by:

HalpDpReplaceControl