RtlGetAce

NTSTATUS __stdcall RtlGetAce(PACL Acl, UINT64 AceIndex, VOID **Ace){
  PACL v4; 
  unsigned int v5; 

  if( (unsigned __int8)(Acl->AclRevision - 2) <= 2u && (unsigned int)AceIndex < Acl->AceCount )
  {
    v4 = Acl + 1;
    *Ace = &Acl[1];
    v5 = 0;
    if( (_DWORD)AceIndex )
    {
      while( v4 < (PACL)((char *)Acl + Acl->AclSize) )
      {
        ++v5;
        v4 = (PACL)((char *)v4 + v4->AclSize);
        *Ace = v4;
        if( v5 >= (unsigned int)AceIndex )
          goto LABEL_4;
      }
    }
    else
    {
LABEL_4:
      if( v4 < (PACL)((char *)Acl + Acl->AclSize) )
        return 0;
    }
  }
  return -1073741811;
}

Referenced by:

AdtpBuildAccessReasonAuditStringInternal
CmpHiveRootSecurityDescriptor
LocalGetAclForString
ObInitSystem
ObpGetDosDevicesProtection
PiDevCfgGetKeySecurityDescriptor
PopCreateHiberFileSecurityDescriptor
RtlpSysVolCheckOwnerAndSecurity
SepAppendAceToTokenDefaultDacl
SepAppendAceToTokenObjectAcl