def _permute(c, p):
    """Returns the permutation of the given 32-bit or 64-bit code with
    the specified permutation table."""
    out = 0
    for r in p:
        out |= r[c & 15]
        c >>= 4
    return out
