// Inverse S-Box 6
558272
func sb6Inv(r0, r1, r2, r3 *uint32) {
	*r0 ^= *r2
	r4 := *r2
	*r2 &= *r0
	r4 ^= *r3
	*r2 = ^*r2
	*r3 ^= *r1
	*r2 ^= *r3
	r4 |= *r0
	*r0 ^= *r2
	*r3 ^= r4
	r4 ^= *r1
	*r1 &= *r3
	*r1 ^= *r0
	*r0 ^= *r3
	*r0 |= *r2
	*r3 ^= *r1
	r4 ^= *r0
	// return *r1, *r2, r4, *r3
	*r0 = *r1
	*r1 = *r2
	*r2 = r4
}
1080769
func (mat *T) Invert() *T {
	initialDet := mat.Determinant()
	mat.Adjugate()
	mat.Mul(1 / initialDet)
	return mat
}
104336
func (fc *FeatureCollection) ForceBbox() BoundingBox {
	if len(fc.Bbox) > 0 {
		return fc.Bbox
	}
	var result BoundingBox
	for _, feature := range fc.Features {
		result = mergeBboxes(result, feature.ForceBbox())
	}
	return result
}
861721
func (quat *T) Invert() *T {
	quat[0] = -quat[0]
	quat[1] = -quat[1]
	quat[2] = -quat[2]
	return quat
}
453435
func ReverseInt64(s []int64) []int64 {
	for i, j := 0, len(s)-1; i < len(s)/2; i, j = i+1, j-1 {
		s[i], s[j] = s[j], s[i]
	}
	return s
}
1122228
func geoBoundingBoxIntWithPrecision(hash uint64, bits uint) geoBox {
	fullHash := hash << (64 - bits)
	latInt, lngInt := deinterleave(fullHash)
	lat := decodeRange(latInt, 90)
	lng := decodeRange(lngInt, 180)
	latErr, lngErr := errorWithPrecision(bits)
	return geoBox{
		minLat: lat,
		maxLat: lat + latErr,
		minLng: lng,
		maxLng: lng + lngErr,
	}
}
1252956
func (matrix *Matrix) Invert() error {
	ret := Status(C.cairo_matrix_invert((*C.cairo_matrix_t)(unsafe.Pointer(matrix)))).toError()
	return ret
}
1130270
func (k SecretKey) Box(receiver saltpack.BoxPublicKey, nonce saltpack.Nonce, msg []byte) []byte {
	ret := box.Seal([]byte{}, msg, (*[24]byte)(&nonce), (*[32]byte)(receiver.ToRawBoxKeyPointer()), (*[32]byte)(&k.sec))
	return ret
}
77897
func (feature *Feature) ForceBbox() BoundingBox {
	if len(feature.Bbox) > 0 {
		return feature.Bbox
	}
	feature.ResolveGeometry()
	if bboxIfc, ok := feature.Geometry.(BoundingBoxIfc); ok {
		return bboxIfc.ForceBbox()
	}
	log.Printf("Feature %v does not have a Geometry that can be made into a Bounding Box: %#v", feature.IDStr(), feature.Geometry)
	return BoundingBox{}
}
223052
func Reverse(values interface{}) interface{} {
	switch values.(type) {
	case []string:
		v := values.([]string)
		for left, right := 0, len(v)-1; left < right; left, right = left+1, right-1 {
			v[left], v[right] = v[right], v[left]
		}
	case []memkv.KVPair:
		v := values.([]memkv.KVPair)
		for left, right := 0, len(v)-1; left < right; left, right = left+1, right-1 {
			v[left], v[right] = v[right], v[left]
		}
	}
	return values
}
506172
func (s Style) Reverse(on bool) Style {
	return s.setAttrs(Style(AttrReverse), on)
}
423621
func (nc *Conn) newRespInbox() string {
	if nc.respMap == nil {
		nc.initNewResp()
	}
	var b [respInboxPrefixLen + replySuffixLen]byte
	pres := b[:respInboxPrefixLen]
	copy(pres, nc.respSub)
	rn := nc.respRand.Int63()
	for i, l := respInboxPrefixLen, rn; i < len(b); i++ {
		b[i] = rdigits[l%base]
		l /= base
	}
	return string(b[:])
}
410154
func reverse(s string) string {
	var rs []rune
	for len(s) > 0 {
		r, size := utf8.DecodeLastRuneInString(s)
		s = s[:len(s)-size]

		rs = append(rs, r)
	}

	return string(rs)
}
1210828
func reverseBits(i int) int {
	i = ((i << 2) & 0xc) | ((i >> 2) & 0x3)
	i = ((i << 1) & 0xa) | ((i >> 1) & 0x5)
	return i
}
852250
func (tr *Matrix) Inverse() {
	d := tr.Determinant() // matrix determinant
	tr0, tr1, tr2, tr3, tr4, tr5 := tr[0], tr[1], tr[2], tr[3], tr[4], tr[5]
	tr[0] = tr3 / d
	tr[1] = -tr1 / d
	tr[2] = -tr2 / d
	tr[3] = tr0 / d
	tr[4] = (tr2*tr5 - tr3*tr4) / d
	tr[5] = (tr1*tr4 - tr0*tr5) / d
}
451987
func (p *parser) SixBitASCIIArmour(i int, fillBits int, context string) []byte {
	if p.err != nil {
		return nil
	}
	if fillBits < 0 || fillBits >= 6 {
		p.SetErr(context, "fill bits")
		return nil
	}

	payload := []byte(p.String(i, "encoded payload"))
	numBits := len(payload)*6 - fillBits

	if numBits < 0 {
		p.SetErr(context, "num bits")
		return nil
	}

	result := make([]byte, numBits)
	resultIndex := 0

	for _, v := range payload {
		if v < 48 || v >= 120 {
			p.SetErr(context, "data byte")
			return nil
		}

		d := v - 48
		if d > 40 {
			d -= 8
		}

		for i := 5; i >= 0 && resultIndex < len(result); i-- {
			result[resultIndex] = (d >> uint(i)) & 1
			resultIndex++
		}
	}

	return result
}
834173
func (s *PerUserKeySeed) derivePrevKey() (res NaclSecretBoxKey, err error) {
	return s.DeriveSymmetricKey(DeriveReasonPUKPrev)
}