RtlMuiRegAddLIPParent

__int64 __fastcall RtlMuiRegAddLIPParent(__int64 a1, __int64 a2, unsigned int a3, const WCHAR *a4){
  __int64 v4; 
  unsigned int v8; 
  __int16 v9; 
  __int64 v10; 
  int v11; 
  __int16 v12; 
  _WORD *v13; 
  int v14; 
  __int16 v15; 
  UINT64 Lcid; 
  _UNICODE_STRING String; 
  __int16 v19; 
  v4 = a3;
  LODWORD(Lcid) = 0;
  v19 = -1;
  String = 0i64;
  if( !a1 || !a2 || a3 >= 4 || !a4 || !*a4 )
    return 3221225485i64;
  RtlInitUnicodeString(&String, a4, a3);
  if( !RtlCultureNameToLCID(&String, &Lcid) )
    return(unsigned int)-1073741823;
  v8 = RtlpMuiRegGetOrAddString(a1, a4, 1, &v19);
  if( (v8 & 0x80000000) != 0 )
    return(unsigned int)-1073741823;
  v9 = v19;
  if( v19 < 0 )
    return(unsigned int)-1073741823;
  v10 = *(_QWORD *)(a1 + 24);
  v11 = 0;
  v12 = Lcid;
  v13 = *(_WORD **)(v10 + 16);
  v14 = *(unsigned __int16 *)(v10 + 6);
  if( !v14 )
  {
LABEL_19:
    if( (_WORD)Lcid )
    {
      *(_WORD *)(a2 + 8) = *(_WORD *)(a2 + 8) & ~(3 << (2 * v4)) | (1 << (2 * v4));
      *(_WORD *)(a2 + 2 * v4 + 12) = v12;
      return v8;
    }
    if( v19 > 0 )
    {
      *(_WORD *)(a2 + 8) = (3 << (2 * v4)) | *(_WORD *)(a2 + 8) & ~(3 << (2 * v4));
      *(_WORD *)(a2 + 2 * v4 + 12) = v9;
      return v8;
    }
    return(unsigned int)-1073741823;
  }
  while( 1 )
  {
    if( (*v13 & 0x3024) != 32 )
      goto LABEL_18;
    if( (((unsigned __int16)Lcid - 4096) & 0xFFFFFBFF) != 0 )
      break;
    if( v13[3] == v19 )
      goto LABEL_15;
LABEL_18:
    ++v11;
    v13 += 14;
    if( v11 >= v14 )
      goto LABEL_19;
  }
  if( v13[2] != (_WORD)Lcid )
    goto LABEL_18;
  v15 = v13[3];
  if( v15 >= 0 && v15 != v19 )
    return(unsigned int)-1073741823;
LABEL_15:
  if( (v11 & 0x8000u) != 0 )
    goto LABEL_19;
  *(_WORD *)(a2 + 8) = (2 << (2 * v4)) | *(_WORD *)(a2 + 8) & ~(3 << (2 * v4));
  *(_WORD *)(a2 + 2 * v4 + 12) = v11;
  return v8;
}

Referenced by:

RtlpMuiRegInitLIPLanguage