def bcd_to_int(bcd):
    """Converts a 1-byte binary-coded decimal to an integer.

    :param bcd: the 1-byte binary-coded decimal as a Python `int`.
    :returns: the integer value as a Python `int`.
    """
    assert 0 <= bcd and bcd <= 255
    ones = bcd & 15
    tens = bcd >> 4
    return 10 * tens + ones
