sub_1407A6B40

__int64 __fastcall sub_1407A6B40(const void *a1, const void *a2){
  unsigned __int16 *v2; 
  WCHAR *v3; 
  bool v4; 
  __int64 v5; 
  unsigned __int16 *v6; 
  WCHAR *v7; 
  unsigned __int64 v8; 
  unsigned __int16 *v9; 
  int v10; 
  NTSTATUS v11; 

  v2 = (unsigned __int16 *)*((_QWORD *)a1 + 1);
  v3 = v2 + 8;
  v4 = *(_BYTE *)a1 == 2;
  if( *(_BYTE *)a1 != 2 )
    v3 = (WCHAR *)*((_QWORD *)v2 + 1);
  v5 = *((_QWORD *)a2 + 1);
  v6 = v2 + 1;
  if( !v4 )
    v6 = v2;
  v7 = (WCHAR *)(v5 + 16);
  v8 = *v6;
  if( *(_BYTE *)a2 != 2 )
    v7 = *(WCHAR **)(v5 + 8);
  v9 = (unsigned __int16 *)(v5 + 2);
  if( *(_BYTE *)a2 != 2 )
    v9 = (unsigned __int16 *)*((_QWORD *)a2 + 1);
  v10 = 0;
  v11 = RtlCompareUnicodeStrings(v3, v8 >> 1, v7, (unsigned __int64)*v9 >> 1, 0);
  if( v11 > 0 )
    return 1i64;
  LOBYTE(v10) = v11 >= 0;
  return(unsigned int)(v10 - 1);
}

Referenced by:

SLUpdateLicenseDataInternal