KiOpDecodeModRM

NTSTATUS __stdcall KiOpDecodeModRM(_BYTE *a1){
  bool v1; 
  char v3; 
  NTSTATUS result; 
  char v5; 

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

Referenced by:

KiOpDecode