HalpDpInitDiscard

VOID __stdcall HalpDpInitDiscard(_LOADER_PARAMETER_BLOCK *LoaderBlock){
  INT64 Table; 
  INT64 v3; 
  INT64 v4; 
  unsigned __int64 v5; 
  __int64 v6; 
  INT64 v7; 
  __int64 v8; 
  Table = HalpAcpiGetTable((volatile INT64 *)LoaderBlock);
  v3 = HalpAcpiGetTable((volatile INT64 *)LoaderBlock);
  if( Table )
  {
    v4 = Table + 48;
    v5 = Table + *(unsigned int *)(Table + 4);
    if( Table + 50 <= v5 )
    {
      do
      {
        v6 = *(unsigned __int8 *)(v4 + 1);
        if( (unsigned __int8)v6 < 2u )
          break;
        v7 = v4 + v6;
        if( v4 + v6 > v5 )
          break;
        if( *(_BYTE *)v4 == 1 && (unsigned __int8)v6 >= 0x28u )
        {
          v8 = *(_QWORD *)(v4 + 16);
          if( (*(_BYTE *)(v4 + 28) & 3) == 3 && v8 && v8 + *(_QWORD *)(v4 + 8) - 1i64 > HalpMaxHotPlugMemoryAddress )
            HalpMaxHotPlugMemoryAddress = v8 + *(_QWORD *)(v4 + 8) - 1i64;
        }
        v4 = v7;
      }
      while( v7 + 2 <= v5 );
    }
    if( v3 && *(_QWORD *)(v3 + 48) > HalpMaxHotPlugMemoryAddress )
      HalpMaxHotPlugMemoryAddress = *(_QWORD *)(v3 + 48);
  }
  if( HalpMaxHotPlugMemoryAddress > (unsigned __int64)HalpMaximumPhysicalMemoryAddress )
    HalpMaximumPhysicalMemoryAddress = HalpMaxHotPlugMemoryAddress;
}

Referenced by:

HalpDpInitSystem