KiTpParseInstructionPrefix

NTSTATUS __stdcall KiTpParseInstructionPrefix(CHAR *a1){
  NTSTATUS result; 
  int *v3; 
  CHAR v4; 
  CHAR v5; 
  bool v6; 
  CHAR v7; 
  unsigned __int8 v8; 
  int v9; 
  int v10; 

  v10 = 0;
  v8 = 0;
  v9 = 0;
  while( 1 )
  {
    result = KiTpFetchInstructionBytes((__int64)a1, &v8, 1, &v10);
    if( result < 0 )
      return result;
    if( v8 > 0x65u )
    {
      if( v8 == 102 )
      {
        v3 = (int *)((char *)&v9 + 2);
      }
      else if( v8 == 103 )
      {
        v3 = (int *)((char *)&v9 + 3);
      }
      else
      {
        if( v8 != 240 && (unsigned int)v8 - 242 > 1 )
        {
LABEL_19:
          if( (_WORD)v9 )
            return -1073741637;
          v4 = 64;
          v5 = v10;
          if( (v8 & 0xF0) == 64 )
            a1[25] = v8;
          else
            v5 = v10 - 1;
          v6 = (a1[25] & 8) == 0;
          a1[21] = v5;
          a1[4] = 0;
          if( v6 )
          {
            v7 = 32;
            if( BYTE2(v9) == 102 )
              v7 = 16;
            a1[1] = v7;
          }
          else
          {
            a1[1] = 64;
          }
          if( HIBYTE(v9) == 103 )
            v4 = 32;
          result = 0;
          *a1 = v4;
          return result;
        }
        v3 = &v9;
      }
    }
    else
    {
      if( v8 < 0x64u && v8 != 38 && v8 != 46 && v8 != 54 && v8 != 62 )
        goto LABEL_19;
      v3 = (int *)((char *)&v9 + 1);
    }
    if( *(_BYTE *)v3 )
      return -1073741823;
    *(_BYTE *)v3 = v8;
  }
}

Referenced by:

KiTpParseInstruction