RtlCompareUnicodeStrings

NTSTATUS __stdcall RtlCompareUnicodeStrings(SIZE_T String1Length, SIZE_T String2Length, BOOL CaseInSensitive){
  SIZE_T v3; 
  SIZE_T v4; 
  int v5; 
  int v6; 
  UINT16 *v7; 
  SIZE_T v8; 
  SIZE_T v9; 
  int v10; 
  int v11; 
  int v13; 
  UINT16 v14; 
  UINT16 v15; 
  BOOLEAN CaseInSensitivea; 
  v4 = String2Length;
  v5 = v3;
  if( String2Length > v3 )
    v4 = v3;
  v6 = String2Length;
  v7 = (UINT16 *)String1Length;
  v8 = String1Length + 2 * v4;
  if( String1Length >= v8 )
    return String2Length - v3;
  v9 = *(_QWORD *)&CaseInSensitive - String1Length;
  if( CaseInSensitivea )
  {
    do
    {
      if( *v7 != *(UINT16 *)((char *)v7 + v9) )
      {
        v13 = NLS_UPCASE(*v7);
        v15 = NLS_UPCASE(v14);
        if( (_WORD)v13 != v15 )
        {
          v11 = v15;
          v10 = v13;
          return v10 - v11;
        }
      }
      ++v7;
    }
    while( (unsigned __int64)v7 < v8 );
    return v6 - v5;
  }
  else
  {
    while( 1 )
    {
      v10 = *v7;
      v11 = *(UINT16 *)((char *)v7 + v9);
      if( (_WORD)v10 != (_WORD)v11 )
        break;
      if( (unsigned __int64)++v7 >= v8 )
        return String2Length - v3;
    }
    return v10 - v11;
  }
}

Referenced by:

ApiSetpSearchForApiSet
ApiSetpSearchForApiSetHost
AsiSortValueList
EtwpAvlCompareKeyNames
EtwpExpandFileName
PiDevCfgResolveVariableExpression
PnpCheckDeviceIdsChanged
PnpCompareMultiSz
PopDirectedDripsUmTestDeviceCompare
RtlpMuiRegInitLIPLanguage
RtlpMuiRegPopulateBaseLanguages
sub_1407A6B40