// Inverse S-Box 5
509023
func sb5Inv(r0, r1, r2, r3 *uint32) {
	*r1 = ^*r1
	r4 := *r3
	*r2 ^= *r1
	*r3 |= *r0
	*r3 ^= *r2
	*r2 |= *r1
	*r2 &= *r0
	r4 ^= *r3
	*r2 ^= r4
	r4 |= *r0
	r4 ^= *r1
	*r1 &= *r2
	*r1 ^= *r3
	r4 ^= *r2
	*r3 &= r4
	r4 ^= *r1
	*r3 ^= r4
	r4 = ^r4
	*r3 ^= *r0
	//return *r1, r4, *r3, *r2
	*r0 = *r1
	*r1 = r4
	r4 = *r3
	*r3 = *r2
	*r2 = r4
}
714107
func (window *Window) Box(v, h int) {
	C.box(window.cwin, C.chtype(v), C.chtype(h))
}
304621
func sb5Inv(r0, r1, r2, r3 *uint32) {
	v0 := *r0 // save r0
	v1 := *r1 // save r1
	v3 := *r3 // save r3
	t0 := ^(*r2)
	t1 := v1 & t0
	t2 := v3 ^ t1
	t3 := v0 & t2
	t4 := v1 ^ t0
	*r3 = t3 ^ t4
	t5 := v1 | *r3
	t6 := v0 & t5
	*r1 = t2 ^ t6
	t7 := v0 | v3
	t8 := t0 ^ t5
	*r0 = t7 ^ t8
	*r2 = (v1 & t7) ^ (t3 | (v0 ^ *r2))
}
539223
func (*Binary) ReverseMap(_ VCursor, ksids [][]byte) ([]sqltypes.Value, error) {
	var reverseIds = make([]sqltypes.Value, len(ksids))
	for rownum, keyspaceID := range ksids {
		if keyspaceID == nil {
			return nil, fmt.Errorf("Binary.ReverseMap: keyspaceId is nil")
		}
		reverseIds[rownum] = sqltypes.MakeTrusted(sqltypes.VarBinary, keyspaceID)
	}
	return reverseIds, nil
}
426362
func (l *Line) Reverse() *Line {
	l.a, l.b = l.b, l.a
	return l
}
1212963
func (*Numeric) ReverseMap(_ VCursor, ksids [][]byte) ([]sqltypes.Value, error) {
	var reverseIds = make([]sqltypes.Value, len(ksids))
	for i, keyspaceID := range ksids {
		if len(keyspaceID) != 8 {
			return nil, fmt.Errorf("Numeric.ReverseMap: length of keyspaceId is not 8: %d", len(keyspaceID))
		}
		val := binary.BigEndian.Uint64([]byte(keyspaceID))
		reverseIds[i] = sqltypes.NewUint64(val)
	}
	return reverseIds, nil
}
612423
func (m Menu) Reverse() Menu {
	for i, j := 0, len(m)-1; i < j; i, j = i+1, j-1 {
		m[i], m[j] = m[j], m[i]
	}

	return m
}
16624
func reverse(a *Automaton) (*Automaton, map[int]bool) {
	if isEmpty(a) {
		return newEmptyAutomaton(), nil
	}

	numStates := a.numStates()

	// build a new automaton with all edges reversed
	b := newAutomatonBuilder()

	// initial node; we'll add epsilon transitions in the end:
	b.createState()
	for s := 0; s < numStates; s++ {
		b.createState()
	}

	// old initial state becomes new accept state:
	b.setAccept(1, true)

	t := newTransition()
	for s := 0; s < numStates; s++ {
		numTransitions := a.numTransitions(s)
		a.initTransition(s, t)
		for i := 0; i < numTransitions; i++ {
			a.nextTransition(t)
			b.addTransitionRange(t.dest+1, s+1, t.min, t.max)
		}
	}

	ans := b.finish()
	initialStates := make(map[int]bool)

	acceptStates := a.isAccept
	for s := acceptStates.NextSetBit(0); s != -1; s = acceptStates.NextSetBit(s + 1) {
		ans.addEpsilon(0, int(s+1))
		initialStates[int(s+1)] = true
	}

	ans.finishState()
	return ans, initialStates
}
1323406
func (self *list) Reverse() List {
	reversed := NewList()
	self.ForEach(func(v interface{}) { reversed = reversed.Cons(v) })
	return reversed
}
174849
func (k Key) Reverse() Key {
	l := k.List()
	r := make([]string, len(l), len(l))
	for i, e := range l {
		r[len(l)-i-1] = e
	}
	return KeyWithNamespaces(r)
}
1370291
func (shape *Shape) GetAsBox() *BoxShape {
	if box, ok := shape.ShapeClass.(*BoxShape); ok {
		return box
	}

	return nil
}
1252956
func (matrix *Matrix) Invert() error {
	ret := Status(C.cairo_matrix_invert((*C.cairo_matrix_t)(unsafe.Pointer(matrix)))).toError()
	return ret
}
1132595
func (txn *tikvTxn) IterReverse(k kv.Key) (kv.Iterator, error) {
	tikvTxnCmdCountWithSeekReverse.Inc()
	start := time.Now()
	defer func() {
		tikvTxnCmdHistogramWithSeekReverse.Observe(time.Since(start).Seconds())
	}()

	return txn.us.IterReverse(k)
}
1297667
func builtinReverse(args []types.Datum, _ context.Context) (d types.Datum, err error) {
	x := args[0]
	switch x.Kind() {
	case types.KindNull:
		return d, nil
	default:
		s, err := x.ToString()
		if err != nil {
			return d, errors.Trace(err)
		}
		d.SetString(stringutil.Reverse(s))
		return d, nil
	}
}
196387
func Reverse(slice interface{}) {
	s := reverser{New(slice, nil, 0)}
	if s.Len() < 2 {
		return
	}
	s.itemType = s.Slice.Index(0).Type()
	ReverseInterface(s)
}
783040
func (t OrderedTaxonomy) Reverse() OrderedTaxonomy {
	for i, j := 0, len(t)-1; i < j; i, j = i+1, j-1 {
		t[i], t[j] = t[j], t[i]
	}

	return t
}
90131
func InverseTransformExample(pathKey *diskv.PathKey) (key string) {
	txt := pathKey.FileName[len(pathKey.FileName)-4:]
	if txt != ".txt" {
		panic("Invalid file found in storage folder!")
	}
	return strings.Join(pathKey.Path, "/") + pathKey.FileName[:len(pathKey.FileName)-4]
}