HsaQueryAcpiDeviceMapping

INT64 __fastcall HsaQueryAcpiDeviceMapping(INT64 a1, INT64 a2, INT64 a3){
  INT64 v3; 
  __int64 *v5; 
  __int64 v6; 
  unsigned __int8 *v7; 
  __int64 v8; 
  int v9; 
  int v10; 
  INT64 result; 
  v3 = a1 + 224;
  *(_OWORD *)a3 = 0i64;
  *(_QWORD *)(a3 + 16) = 0i64;
  v5 = *(__int64 **)(a1 + 224);
  if( v5 == (__int64 *)(a1 + 224) )
    return 3221226021i64;
  v6 = *(_QWORD *)(a2 + 8);
  while( 1 )
  {
    v7 = (unsigned __int8 *)v5[2];
    v8 = v6 - (_QWORD)v7;
    do
    {
      v9 = v7[v8];
      v10 = *v7 - v9;
      if( v10 )
        break;
      ++v7;
    }
    while( v9 );
    if( !v10 )
      break;
    v5 = (__int64 *)*v5;
    if( v5 == (__int64 *)v3 )
      return 3221226021i64;
  }
  *(_WORD *)(a3 + 8) = *(_WORD *)(a1 + 160);
  *(_WORD *)(a3 + 12) = *((_WORD *)v5 + 12);
  result = 0i64;
  *(_DWORD *)a3 = 1;
  return result;
}

Referenced by:

HsaCreateDevice