// Code generated by "go run compare_generate.go"; DO NOT EDIT.

package dns

import (
	"cmp"
	"slices"
	"strings"
)

func compare(a, b RR) int {
	switch x := a.(type) {
	case *TSIG:
		return x.compare(b)
	case *DELEG:
		return x.compare(b)
	case *OPT:
		return x.compare(b)
	case *NSEC3:
		return x.compare(b)
	case *DNSKEY:
		return x.compare(b)
	case *DS:
		return x.compare(b)
	case *NSEC:
		return x.compare(b)
	case *RRSIG:
		return x.compare(b)
	case *AAAA:
		return x.compare(b)
	case *A:
		return x.compare(b)
	case *TXT:
		return x.compare(b)
	case *NS:
		return x.compare(b)
	case *MX:
		return x.compare(b)
	case *CNAME:
		return x.compare(b)
	case *NULL:
		return x.compare(b)
	case *NXNAME:
		return x.compare(b)
	case *HINFO:
		return x.compare(b)
	case *MB:
		return x.compare(b)
	case *MG:
		return x.compare(b)
	case *MINFO:
		return x.compare(b)
	case *MR:
		return x.compare(b)
	case *MF:
		return x.compare(b)
	case *MD:
		return x.compare(b)
	case *AFSDB:
		return x.compare(b)
	case *X25:
		return x.compare(b)
	case *ISDN:
		return x.compare(b)
	case *RT:
		return x.compare(b)
	case *PTR:
		return x.compare(b)
	case *RP:
		return x.compare(b)
	case *SOA:
		return x.compare(b)
	case *SPF:
		return x.compare(b)
	case *AVC:
		return x.compare(b)
	case *WALLET:
		return x.compare(b)
	case *CLA:
		return x.compare(b)
	case *IPN:
		return x.compare(b)
	case *SRV:
		return x.compare(b)
	case *NAPTR:
		return x.compare(b)
	case *CERT:
		return x.compare(b)
	case *DNAME:
		return x.compare(b)
	case *PX:
		return x.compare(b)
	case *GPOS:
		return x.compare(b)
	case *LOC:
		return x.compare(b)
	case *SIG:
		return x.compare(b)
	case *NXT:
		return x.compare(b)
	case *DLV:
		return x.compare(b)
	case *CDS:
		return x.compare(b)
	case *KX:
		return x.compare(b)
	case *TA:
		return x.compare(b)
	case *TALINK:
		return x.compare(b)
	case *SSHFP:
		return x.compare(b)
	case *KEY:
		return x.compare(b)
	case *CDNSKEY:
		return x.compare(b)
	case *RKEY:
		return x.compare(b)
	case *NSAPPTR:
		return x.compare(b)
	case *NSEC3PARAM:
		return x.compare(b)
	case *TKEY:
		return x.compare(b)
	case *RFC3597:
		return x.compare(b)
	case *URI:
		return x.compare(b)
	case *DHCID:
		return x.compare(b)
	case *TLSA:
		return x.compare(b)
	case *SMIMEA:
		return x.compare(b)
	case *HIP:
		return x.compare(b)
	case *NINFO:
		return x.compare(b)
	case *NID:
		return x.compare(b)
	case *L32:
		return x.compare(b)
	case *L64:
		return x.compare(b)
	case *LP:
		return x.compare(b)
	case *EUI48:
		return x.compare(b)
	case *EUI64:
		return x.compare(b)
	case *CAA:
		return x.compare(b)
	case *UID:
		return x.compare(b)
	case *GID:
		return x.compare(b)
	case *UINFO:
		return x.compare(b)
	case *EID:
		return x.compare(b)
	case *NIMLOC:
		return x.compare(b)
	case *OPENPGPKEY:
		return x.compare(b)
	case *CSYNC:
		return x.compare(b)
	case *ZONEMD:
		return x.compare(b)
	case *RESINFO:
		return x.compare(b)
	case *SVCB:
		return x.compare(b)
	case *HTTPS:
		return x.compare(b)
	case *DELEGPARAM:
		return x.compare(b)
	case *DSYNC:
		return x.compare(b)
	case *ANY:
		return x.compare(b)
	case *AXFR:
		return x.compare(b)
	case *IXFR:
		return x.compare(b)
	}
	if x, ok := a.(Comparer); ok {
		return x.Compare(b)
	}
	return 0
}

func (rr *NULL) compare(b RR) (x int) {
	x = len(rr.Null) - len(b.(*NULL).Null)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = strings.Compare(rr.Null, b.(*NULL).Null)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *CNAME) compare(b RR) (x int) {
	x = comparename(rr.Target, b.(*CNAME).Target)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *HINFO) compare(b RR) (x int) {
	x = len(rr.Cpu) - len(b.(*HINFO).Cpu)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = strings.Compare(rr.Cpu, b.(*HINFO).Cpu)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = len(rr.Os) - len(b.(*HINFO).Os)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = strings.Compare(rr.Os, b.(*HINFO).Os)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *MB) compare(b RR) (x int) {
	x = comparename(rr.Mb, b.(*MB).Mb)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *MG) compare(b RR) (x int) {
	x = comparename(rr.Mg, b.(*MG).Mg)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *MINFO) compare(b RR) (x int) {
	x = comparename(rr.Rmail, b.(*MINFO).Rmail)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparename(rr.Email, b.(*MINFO).Email)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *MR) compare(b RR) (x int) {
	x = comparename(rr.Mr, b.(*MR).Mr)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *MF) compare(b RR) (x int) {
	x = comparename(rr.Mf, b.(*MF).Mf)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *MD) compare(b RR) (x int) {
	x = comparename(rr.Md, b.(*MD).Md)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *MX) compare(b RR) (x int) {
	x = cmp.Compare(rr.Preference, b.(*MX).Preference)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparename(rr.Mx, b.(*MX).Mx)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *AFSDB) compare(b RR) (x int) {
	x = cmp.Compare(rr.Subtype, b.(*AFSDB).Subtype)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparename(rr.Hostname, b.(*AFSDB).Hostname)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *X25) compare(b RR) (x int) {
	x = len(rr.PSDNAddress) - len(b.(*X25).PSDNAddress)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = strings.Compare(rr.PSDNAddress, b.(*X25).PSDNAddress)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *ISDN) compare(b RR) (x int) {
	x = len(rr.Address) - len(b.(*ISDN).Address)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = strings.Compare(rr.Address, b.(*ISDN).Address)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = len(rr.SubAddress) - len(b.(*ISDN).SubAddress)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = strings.Compare(rr.SubAddress, b.(*ISDN).SubAddress)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *RT) compare(b RR) (x int) {
	x = cmp.Compare(rr.Preference, b.(*RT).Preference)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparename(rr.Host, b.(*RT).Host)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *NS) compare(b RR) (x int) {
	x = comparename(rr.Ns, b.(*NS).Ns)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *PTR) compare(b RR) (x int) {
	x = comparename(rr.Ptr, b.(*PTR).Ptr)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *RP) compare(b RR) (x int) {
	x = comparename(rr.Mbox, b.(*RP).Mbox)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparename(rr.Txt, b.(*RP).Txt)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *SOA) compare(b RR) (x int) {
	x = comparename(rr.Ns, b.(*SOA).Ns)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparename(rr.Mbox, b.(*SOA).Mbox)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Serial, b.(*SOA).Serial)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = int(rr.Refresh) - int(b.(*SOA).Refresh)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = int(rr.Retry) - int(b.(*SOA).Retry)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = int(rr.Expire) - int(b.(*SOA).Expire)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = int(rr.Minttl) - int(b.(*SOA).Minttl)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *TXT) compare(b RR) (x int) {
	j := 0
	for i := range rr.Txt {
		if i > j || x != 0 {
			break
		}
		x = len(rr.Txt[i]) - len(b.(*TXT).Txt[j])
		if x == 0 {
			x = strings.Compare(rr.Txt[i], b.(*TXT).Txt[j])
		}
		j++
	}
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *IPN) compare(b RR) (x int) {
	x = cmp.Compare(rr.Node, b.(*IPN).Node)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *SRV) compare(b RR) (x int) {
	x = cmp.Compare(rr.Priority, b.(*SRV).Priority)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Weight, b.(*SRV).Weight)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Port, b.(*SRV).Port)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparename(rr.Target, b.(*SRV).Target)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *NAPTR) compare(b RR) (x int) {
	x = cmp.Compare(rr.Order, b.(*NAPTR).Order)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Preference, b.(*NAPTR).Preference)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = len(rr.Flags) - len(b.(*NAPTR).Flags)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = strings.Compare(rr.Flags, b.(*NAPTR).Flags)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = len(rr.Service) - len(b.(*NAPTR).Service)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = strings.Compare(rr.Service, b.(*NAPTR).Service)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = len(rr.Regexp) - len(b.(*NAPTR).Regexp)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = strings.Compare(rr.Regexp, b.(*NAPTR).Regexp)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparename(rr.Replacement, b.(*NAPTR).Replacement)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *CERT) compare(b RR) (x int) {
	x = cmp.Compare(rr.Type, b.(*CERT).Type)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.KeyTag, b.(*CERT).KeyTag)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Algorithm, b.(*CERT).Algorithm)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparebase64(rr.Certificate, b.(*CERT).Certificate)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *DNAME) compare(b RR) (x int) {
	x = comparename(rr.Target, b.(*DNAME).Target)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *A) compare(b RR) (x int) {
	x = rr.Addr.Compare(b.(*A).Addr)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *AAAA) compare(b RR) (x int) {
	x = rr.Addr.Compare(b.(*AAAA).Addr)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *PX) compare(b RR) (x int) {
	x = cmp.Compare(rr.Preference, b.(*PX).Preference)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparename(rr.Map822, b.(*PX).Map822)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparename(rr.Mapx400, b.(*PX).Mapx400)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *GPOS) compare(b RR) (x int) {
	x = len(rr.Longitude) - len(b.(*GPOS).Longitude)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = strings.Compare(rr.Longitude, b.(*GPOS).Longitude)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = len(rr.Latitude) - len(b.(*GPOS).Latitude)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = strings.Compare(rr.Latitude, b.(*GPOS).Latitude)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = len(rr.Altitude) - len(b.(*GPOS).Altitude)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = strings.Compare(rr.Altitude, b.(*GPOS).Altitude)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *LOC) compare(b RR) (x int) {
	x = cmp.Compare(rr.Version, b.(*LOC).Version)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Size, b.(*LOC).Size)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.HorizPre, b.(*LOC).HorizPre)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.VertPre, b.(*LOC).VertPre)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Latitude, b.(*LOC).Latitude)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Longitude, b.(*LOC).Longitude)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Altitude, b.(*LOC).Altitude)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *RRSIG) compare(b RR) (x int) {
	x = cmp.Compare(rr.TypeCovered, b.(*RRSIG).TypeCovered)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Algorithm, b.(*RRSIG).Algorithm)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Labels, b.(*RRSIG).Labels)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.OrigTTL, b.(*RRSIG).OrigTTL)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Expiration, b.(*RRSIG).Expiration)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Inception, b.(*RRSIG).Inception)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.KeyTag, b.(*RRSIG).KeyTag)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparename(rr.SignerName, b.(*RRSIG).SignerName)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparebase64(rr.Signature, b.(*RRSIG).Signature)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *NSEC) compare(b RR) (x int) {
	x = comparename(rr.NextDomain, b.(*NSEC).NextDomain)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = slices.Compare(rr.TypeBitMap, b.(*NSEC).TypeBitMap)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *DS) compare(b RR) (x int) {
	x = cmp.Compare(rr.KeyTag, b.(*DS).KeyTag)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Algorithm, b.(*DS).Algorithm)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.DigestType, b.(*DS).DigestType)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparehex(rr.Digest, b.(*DS).Digest)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *KX) compare(b RR) (x int) {
	x = cmp.Compare(rr.Preference, b.(*KX).Preference)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparename(rr.Exchanger, b.(*KX).Exchanger)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *TA) compare(b RR) (x int) {
	x = cmp.Compare(rr.KeyTag, b.(*TA).KeyTag)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Algorithm, b.(*TA).Algorithm)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.DigestType, b.(*TA).DigestType)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparehex(rr.Digest, b.(*TA).Digest)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *TALINK) compare(b RR) (x int) {
	x = comparename(rr.PreviousName, b.(*TALINK).PreviousName)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparename(rr.NextName, b.(*TALINK).NextName)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *SSHFP) compare(b RR) (x int) {
	x = cmp.Compare(rr.Algorithm, b.(*SSHFP).Algorithm)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Type, b.(*SSHFP).Type)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparehex(rr.FingerPrint, b.(*SSHFP).FingerPrint)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *DNSKEY) compare(b RR) (x int) {
	x = cmp.Compare(rr.Flags, b.(*DNSKEY).Flags)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Protocol, b.(*DNSKEY).Protocol)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Algorithm, b.(*DNSKEY).Algorithm)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparebase64(rr.PublicKey, b.(*DNSKEY).PublicKey)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *RKEY) compare(b RR) (x int) {
	x = cmp.Compare(rr.Flags, b.(*RKEY).Flags)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Protocol, b.(*RKEY).Protocol)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Algorithm, b.(*RKEY).Algorithm)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparebase64(rr.PublicKey, b.(*RKEY).PublicKey)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *NSAPPTR) compare(b RR) (x int) {
	x = comparename(rr.Ptr, b.(*NSAPPTR).Ptr)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *NSEC3) compare(b RR) (x int) {
	x = cmp.Compare(rr.Hash, b.(*NSEC3).Hash)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Flags, b.(*NSEC3).Flags)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Iterations, b.(*NSEC3).Iterations)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.SaltLength, b.(*NSEC3).SaltLength)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparehex(rr.Salt, b.(*NSEC3).Salt)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.HashLength, b.(*NSEC3).HashLength)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparebase32(rr.NextDomain, b.(*NSEC3).NextDomain)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = slices.Compare(rr.TypeBitMap, b.(*NSEC3).TypeBitMap)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *NSEC3PARAM) compare(b RR) (x int) {
	x = cmp.Compare(rr.Hash, b.(*NSEC3PARAM).Hash)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Flags, b.(*NSEC3PARAM).Flags)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Iterations, b.(*NSEC3PARAM).Iterations)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.SaltLength, b.(*NSEC3PARAM).SaltLength)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparehex(rr.Salt, b.(*NSEC3PARAM).Salt)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *TKEY) compare(b RR) (x int) {
	x = comparename(rr.Algorithm, b.(*TKEY).Algorithm)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Inception, b.(*TKEY).Inception)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Expiration, b.(*TKEY).Expiration)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Mode, b.(*TKEY).Mode)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Error, b.(*TKEY).Error)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.KeySize, b.(*TKEY).KeySize)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparehex(rr.Key, b.(*TKEY).Key)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.OtherLen, b.(*TKEY).OtherLen)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparehex(rr.OtherData, b.(*TKEY).OtherData)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *RFC3597) compare(b RR) (x int) {
	x = comparehex(rr.RFC3597.Data, b.(*RFC3597).RFC3597.Data)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *URI) compare(b RR) (x int) {
	x = cmp.Compare(rr.Priority, b.(*URI).Priority)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Weight, b.(*URI).Weight)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = len(rr.Target) - len(b.(*URI).Target)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = strings.Compare(rr.Target, b.(*URI).Target)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *DHCID) compare(b RR) (x int) {
	x = comparebase64(rr.Digest, b.(*DHCID).Digest)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *TLSA) compare(b RR) (x int) {
	x = cmp.Compare(rr.Usage, b.(*TLSA).Usage)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Selector, b.(*TLSA).Selector)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.MatchingType, b.(*TLSA).MatchingType)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparehex(rr.Certificate, b.(*TLSA).Certificate)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *SMIMEA) compare(b RR) (x int) {
	x = cmp.Compare(rr.Usage, b.(*SMIMEA).Usage)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Selector, b.(*SMIMEA).Selector)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.MatchingType, b.(*SMIMEA).MatchingType)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparehex(rr.Certificate, b.(*SMIMEA).Certificate)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *HIP) compare(b RR) (x int) {
	x = cmp.Compare(rr.HitLength, b.(*HIP).HitLength)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.PublicKeyAlgorithm, b.(*HIP).PublicKeyAlgorithm)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.PublicKeyLength, b.(*HIP).PublicKeyLength)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparehex(rr.Hit, b.(*HIP).Hit)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparebase64(rr.PublicKey, b.(*HIP).PublicKey)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	j := 0
	for i := range rr.RendezvousServers {
		if i > j || x != 0 {
			break
		}
		x = comparename(rr.RendezvousServers[i], b.(*HIP).RendezvousServers[j])
		j++
	}
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *NINFO) compare(b RR) (x int) {
	j := 0
	for i := range rr.ZSData {
		if i > j || x != 0 {
			break
		}
		x = len(rr.ZSData[i]) - len(b.(*NINFO).ZSData[j])
		if x == 0 {
			x = strings.Compare(rr.ZSData[i], b.(*NINFO).ZSData[j])
		}
		j++
	}
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *NID) compare(b RR) (x int) {
	x = cmp.Compare(rr.Preference, b.(*NID).Preference)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *L32) compare(b RR) (x int) {
	x = cmp.Compare(rr.Preference, b.(*L32).Preference)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = rr.Locator32.Compare(b.(*L32).Locator32)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *L64) compare(b RR) (x int) {
	x = cmp.Compare(rr.Preference, b.(*L64).Preference)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *LP) compare(b RR) (x int) {
	x = cmp.Compare(rr.Preference, b.(*LP).Preference)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparename(rr.Fqdn, b.(*LP).Fqdn)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *EUI48) compare(b RR) (x int) {
	x = cmp.Compare(rr.Address, b.(*EUI48).Address)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *EUI64) compare(b RR) (x int) {
	x = cmp.Compare(rr.Address, b.(*EUI64).Address)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *CAA) compare(b RR) (x int) {
	x = cmp.Compare(rr.Flag, b.(*CAA).Flag)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = len(rr.Tag) - len(b.(*CAA).Tag)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = strings.Compare(rr.Tag, b.(*CAA).Tag)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = len(rr.Value) - len(b.(*CAA).Value)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = strings.Compare(rr.Value, b.(*CAA).Value)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *UID) compare(b RR) (x int) {
	x = cmp.Compare(rr.Uid, b.(*UID).Uid)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *GID) compare(b RR) (x int) {
	x = cmp.Compare(rr.Gid, b.(*GID).Gid)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *UINFO) compare(b RR) (x int) {
	x = len(rr.Uinfo) - len(b.(*UINFO).Uinfo)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = strings.Compare(rr.Uinfo, b.(*UINFO).Uinfo)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *EID) compare(b RR) (x int) {
	x = comparehex(rr.Endpoint, b.(*EID).Endpoint)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *NIMLOC) compare(b RR) (x int) {
	x = comparehex(rr.Locator, b.(*NIMLOC).Locator)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *OPENPGPKEY) compare(b RR) (x int) {
	x = comparebase64(rr.PublicKey, b.(*OPENPGPKEY).PublicKey)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *CSYNC) compare(b RR) (x int) {
	x = cmp.Compare(rr.Serial, b.(*CSYNC).Serial)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Flags, b.(*CSYNC).Flags)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = slices.Compare(rr.TypeBitMap, b.(*CSYNC).TypeBitMap)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *ZONEMD) compare(b RR) (x int) {
	x = cmp.Compare(rr.Serial, b.(*ZONEMD).Serial)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Scheme, b.(*ZONEMD).Scheme)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Hash, b.(*ZONEMD).Hash)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparehex(rr.Digest, b.(*ZONEMD).Digest)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *SVCB) compare(b RR) (x int) {
	x = cmp.Compare(rr.Priority, b.(*SVCB).Priority)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparename(rr.Target, b.(*SVCB).Target)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparepair(rr.Value, b.(*SVCB).Value)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *DELEG) compare(b RR) (x int) {
	x = compareinfo(rr.Value, b.(*DELEG).Value)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *DSYNC) compare(b RR) (x int) {
	x = cmp.Compare(rr.Type, b.(*DSYNC).Type)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Scheme, b.(*DSYNC).Scheme)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Port, b.(*DSYNC).Port)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparename(rr.Target, b.(*DSYNC).Target)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *TSIG) compare(b RR) (x int) {
	x = comparename(rr.Algorithm, b.(*TSIG).Algorithm)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.TimeSigned, b.(*TSIG).TimeSigned)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Fudge, b.(*TSIG).Fudge)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.MACSize, b.(*TSIG).MACSize)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparehex(rr.MAC, b.(*TSIG).MAC)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.OrigID, b.(*TSIG).OrigID)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.Error, b.(*TSIG).Error)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = cmp.Compare(rr.OtherLen, b.(*TSIG).OtherLen)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	x = comparehex(rr.OtherData, b.(*TSIG).OtherData)
	if x != 0 {
		if x < 0 {
			return -1
		}
		return 1
	}
	return 0
}

func (rr *NXNAME) compare(b RR) (x int) {
	return 0
}

func (rr *SPF) compare(b RR) (x int) {
	return rr.TXT.compare(&b.(*SPF).TXT)
}

func (rr *AVC) compare(b RR) (x int) {
	return rr.TXT.compare(&b.(*AVC).TXT)
}

func (rr *WALLET) compare(b RR) (x int) {
	return rr.TXT.compare(&b.(*WALLET).TXT)
}

func (rr *CLA) compare(b RR) (x int) {
	return rr.TXT.compare(&b.(*CLA).TXT)
}

func (rr *SIG) compare(b RR) (x int) {
	return rr.RRSIG.compare(&b.(*SIG).RRSIG)
}

func (rr *NXT) compare(b RR) (x int) {
	return rr.NSEC.compare(&b.(*NXT).NSEC)
}

func (rr *DLV) compare(b RR) (x int) {
	return rr.DS.compare(&b.(*DLV).DS)
}

func (rr *CDS) compare(b RR) (x int) {
	return rr.DS.compare(&b.(*CDS).DS)
}

func (rr *KEY) compare(b RR) (x int) {
	return rr.DNSKEY.compare(&b.(*KEY).DNSKEY)
}

func (rr *CDNSKEY) compare(b RR) (x int) {
	return rr.DNSKEY.compare(&b.(*CDNSKEY).DNSKEY)
}

func (rr *OPT) compare(b RR) (x int) {
	return 0
}

func (rr *RESINFO) compare(b RR) (x int) {
	return rr.TXT.compare(&b.(*RESINFO).TXT)
}

func (rr *HTTPS) compare(b RR) (x int) {
	return rr.SVCB.compare(&b.(*HTTPS).SVCB)
}

func (rr *DELEGPARAM) compare(b RR) (x int) {
	return rr.DELEG.compare(&b.(*DELEGPARAM).DELEG)
}

func (rr *ANY) compare(b RR) (x int) {
	return 0
}

func (rr *AXFR) compare(b RR) (x int) {
	return 0
}

func (rr *IXFR) compare(b RR) (x int) {
	return 0
}
