from typing import List


def pow2(x: int) -> List[int]:
    """
    Decompose a number into powers of 2
    :param x: number to decompose
    :type x: int
    :return: list of powers of 2 that compose the number
    :rtype: List[int]
    """
    powers = []
    i = 1
    while i <= x:
        if i & x:
            powers.append(i)
        i <<= 1
    return powers