HalpIommuProcessReservationsInternal

INT64 __fastcall HalpIommuProcessReservationsInternal(INT64 a1, INT64 a2){
  __int64(__fastcall *v2)(_QWORD, UINT64 *, _QWORD); 
  INT64 result; 
  PSTR MemoryInternal; 
  UINT64 v7; 
  v2 = *(__int64(__fastcall **)(_QWORD, UINT64 *, _QWORD))(a1 + 328);
  LODWORD(v7) = 0;
  result = v2(*(_QWORD *)(a1 + 16), &v7, 0i64);
  if( (_DWORD)result == -1073741789 )
  {
    MemoryInternal = HalpMmAllocateMemoryInternal((unsigned int)(8 * v7 + 8), MmCached);
    *(_QWORD *)(a1 + 528) = MemoryInternal;
    if( MemoryInternal )
    {
      *(_DWORD *)MemoryInternal = v7;
      result = (*(__int64(__fastcall **)(_QWORD, UINT64 *, __int64))(a1 + 328))(
                 *(_QWORD *)(a1 + 16),
                 &v7,
                 *(_QWORD *)(a1 + 528) + 8i64);
      if( (int)result >= 0 )
      {
        result = HalpIommuProcessMemoryErrata((unsigned int)v7, *(_QWORD *)(a1 + 528) + 8i64, a2);
        if( (int)result >= 0 )
          return HalpIommuDetermineReservedPciRid(*(UINT64 **)(a1 + 528));
      }
    }
    else
    {
      return 3221225626i64;
    }
  }
  return result;
}

Referenced by:

HalpIommuProcessReservations