def reverse_bit(value):
    """Calculate the value of the reverse binary representation of the given integer."""
    result = 0
    while value:
        result = (result << 1) + (value & 1)
        value >>= 1
    return result