CmpGenerateFastLeafHintForUnicodeString

__int64 __fastcall CmpGenerateFastLeafHintForUnicodeString(unsigned __int16 *a1){
  __int64 result; 
  unsigned int v2; 
  unsigned int v3; 
  __int64 v4; 
  unsigned int v5; 
  __int64 v6; 
  unsigned __int16 v7; 
  unsigned int v8; 

  result = 0i64;
  v2 = *a1 >> 1;
  v8 = 0;
  v3 = 4;
  if( v2 >= 4 || (v3 = v2) != 0 )
  {
    v4 = *((_QWORD *)a1 + 1);
    v5 = 0;
    while( 1 )
    {
      v6 = v5;
      v7 = *(_WORD *)(v4 + 2i64 * v5);
      if( v7 > 0xFFu )
        break;
      ++v5;
      *((_BYTE *)&v8 + v6) = v7;
      if( v5 >= v3 )
        return v8;
    }
  }
  return result;
}

Referenced by:

CmpAddToLeaf
CmpCheckLeaf