HalpInterruptIsMsiSupported

NTSTATUS __stdcall HalpInterruptIsMsiSupported(INT64 Early){
  char v1; 
  NTSTATUS result; 
  CHAR CpuInfo; 
  UINT8 v4; 
  struct _KPRCB *CurrentPrcb; 
  char CpuType; 
  bool v7; 
  UINT8 v8; 
  _EM_RULE_STATE State; 

  v1 = Early;
  State = 0;
  if( byte_140C50649 )
  {
    LOBYTE(result) = byte_140C50648;
    goto LABEL_3;
  }
  result = Controller;
  if( Controller && !*(_QWORD *)(Controller + 136) )
  {
    LOBYTE(result) = 0;
    goto LABEL_3;
  }
  if( (_BYTE)Early || (result = EmClientQueryRuleState(&GUID_EM_DISABLE_MSI_RULE, &State), result >= 0) && State != 2 )
  {
    v8 = 0;
    CpuInfo = HalpGetCpuInfo(0i64, 0i64, 0i64, &v8);
    v4 = CpuInfo != 0 ? v8 : 0;
    if( v4 != 2 && v4 != 1 )
    {
      LOBYTE(result) = 0;
      if( v4 != 3 )
        goto LABEL_13;
      CurrentPrcb = KeGetCurrentPrcb();
      CpuType = CurrentPrcb->CpuType;
      v7 = (unsigned __int8)CpuType <= 6u;
      if( CpuType != 6 )
        goto LABEL_25;
      if( CurrentPrcb->CpuModel < 0xAu )
      {
        v7 = 1;
LABEL_25:
        if( v7 )
          goto LABEL_13;
      }
    }
    LOBYTE(result) = 1;
LABEL_13:
    if( (*(&stru_140CF2E80 + 7444) & 1) != 0 )
      LOBYTE(result) = 1;
    result = (unsigned __int8)result;
    if( (*(&stru_140CF2E80 + 7444) & 2) != 0 )
      result = 0;
LABEL_3:
    if( v1 )
      return result;
    goto LABEL_4;
  }
  LOBYTE(result) = 0;
LABEL_4:
  byte_140C50648 = result;
  byte_140C50649 = 1;
  return result;
}

Referenced by:

HalGetInterruptTargetInformation
HalpIommuConfigureInterrupt
HalpTimerConfigureInterrupt