CmpFindMatchingDescriptorCell

char __fastcall CmpFindMatchingDescriptorCell(__int64 a1, const void *a2, int a3, _DWORD *a4, int **a5){
  UINT64 v8; 
  UINT64 *v9; 
  int v10; 
  _QWORD **v11; 
  _QWORD *i; 
  int *v13; 
  int v14; 
  v8 = (unsigned int)RtlLengthSecurityDescriptorStrict((VOID *)a2);
  v10 = CmpSecConvKey(v8, v9);
  v11 = (_QWORD **)(a1 + 16 * ((v10 & 0x3F) + 118i64));
  for( i = *v11; ; i = (_QWORD *)*i )
  {
    if( i == v11 )
      return 0;
    v13 = (int *)(i - 1);
    if( *((_DWORD *)i - 1) == v10 )
    {
      v14 = *v13;
      if( a3 == (unsigned int)*v13 >> 31 && (_DWORD)v8 == v13[6] && !memcmp((PVOID)a2, v13 + 8, v8) )
        break;
    }
  }
  *a4 = v14;
  if( a5 )
    *a5 = v13;
  return 1;
}

Referenced by:

CmpGetSecurityDescriptorNode
CmpSetSecurityDescriptorInfo