HalpIommuGetDmarptRootAddress

INT64 __fastcall HalpIommuGetDmarptRootAddress(INT64 a1, UINT64 a2, LARGE_INTEGER *a3){
  unsigned int v3; 
  char *v6; 
  unsigned int v7; 
  _DWORD *v8; 
  __int64 v9; 
  int v10; 
  v3 = *(_DWORD *)(a1 + 24);
  if( (unsigned int)a2 > v3 )
    return 3221225485i64;
  v6 = *(char **)(a1 + 16);
  v7 = v3 - a2;
  if( v7 )
  {
    v8 = (_DWORD *)(a1 + 36);
    v9 = v7;
    do
    {
      v10 = 1 << *v8++;
      v6 = *(char **)&v6[v10 << *(_DWORD *)(a1 + 28)];
      --v9;
    }
    while( v9 );
  }
  *a3 = MmGetPhysicalAddress(v6);
  return 0i64;
}

Referenced by:

HalpIommuConstructReservedPageTable
HalpIommuGetHardwareDomain