def swap4(data):
    """swap data elements in groups of 4"""
    size = 4
    nsets = len(data) // size
    if nsets <= 0:
        return
    for ind in range(nsets):
        off = ind * size
        v = data[off]
        data[off] = data[off + 3]
        data[off + 3] = v
        v = data[off + 1]
        data[off + 1] = data[off + 2]
        data[off + 2] = v
