LocalGetAceCondition

__int64 __fastcall LocalGetAceCondition(
        unsigned __int8 *a1,
        char *a2,
        size_t *a3,
        ULONG *a4,
        _DWORD *a5,
        __int64 a6,
        __int64 a7,
        __int64 a8,
        char a9){
  unsigned int v9; 
  unsigned int v14; 
  int v15; 
  unsigned int v17; 
  CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *v18; 
  __int64 v19; 
  unsigned int StringForRelativeAttribute; 
  __int64 v21; 
  int v22; 
  v9 = *a1;
  *a3 = 0i64;
  *a4 = 0;
  v14 = 0;
  if( (unsigned __int8)v9 > 0x12u || (v15 = 271872, !_bittest(&v15, v9)) )
  {
    if( (_BYTE)v9 == 11 )
      goto LABEL_15;
    if( (_BYTE)v9 != 21 )
      return v14;
  }
  if( (_BYTE)v9 != 11 )
  {
    v17 = *((unsigned __int16 *)a1 + 1) - (unsigned int)RtlLengthSid(a2) - 8;
    goto LABEL_8;
  }
LABEL_15:
  v22 = *((_DWORD *)a1 + 2);
  v17 = *((unsigned __int16 *)a1 + 1) - 16 * (v22 & 1) - 8 * (v22 & 2) - RtlLengthSid(a2) - 12;
LABEL_8:
  *a4 = v17;
  if( v17 )
  {
    v18 = (CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *)&a2[(unsigned int)RtlLengthSid(a2)];
    if( (_BYTE)v9 == 18 )
      StringForRelativeAttribute = LocalGetStringForRelativeAttribute(v18, v17, (PVOID)a6, a7, (WCHAR **)a8);
    else
      StringForRelativeAttribute = LocalpGetStringForCondition((__int64)v18, v17, a3, v19, a6, a7, a8, a9);
    v14 = StringForRelativeAttribute;
    if( !StringForRelativeAttribute )
    {
      v21 = -1i64;
      do
        ++v21;
      while( *(_WORD *)(*a3 + 2 * v21) );
      *a5 += 2 * v21 + 2;
    }
  }
  return v14;
}

Referenced by:

LocalConvertAclToString