def _hamming_distance(x_param: int) -> int:
    """
    Calculate the bit-wise Hamming distance of :code:`x_param` from 0.

    The Hamming distance is the number 1s in the integer :code:`x_param`.

    :param x_param: A non-negative integer.
    :return: The hamming distance of :code:`x_param` from 0.
    """
    tot = 0
    while x_param:
        tot += 1
        x_param &= x_param - 1
    return tot