KiOpDecodeModRM

INT64 __fastcall KiOpDecodeModRM(BYTE *a1){
  bool v1; 
  char v3; 
  INT64 result; 
  BYTE v5; 
  v1 = a1[80] == 0;
  v5 = 0;
  if( v1 )
  {
    result = KiOpFetchNextByte((INT64)a1, a1 + 65);
    if( (int)result < 0 )
      return result;
    a1[80] = 1;
  }
  if( (a1[65] & 0xC0) == 0xC0
    || (a1[65] & 7) != 4
    || (result = KiOpFetchNextByte((INT64)a1, a1 + 66), (int)result >= 0) )
  {
    v3 = a1[65] >> 6;
    if( !v3 && (a1[65] & 7) == 5 || v3 == 2 )
    {
      result = KiOpFetchBytes((INT64)a1, 4i64, a1 + 68);
      if( (int)result >= 0 )
        return 0i64;
    }
    else
    {
      if( v3 != 1 )
        return 0i64;
      result = KiOpFetchBytes((INT64)a1, 1i64, &v5);
      if( (int)result >= 0 )
      {
        *((_DWORD *)a1 + 17) = (char)v5;
        return 0i64;
      }
    }
  }
  return result;
}

Referenced by:

KiOpDecode