def endswith_xFFxD9(data):
    """
    Checks whether the given data endswith `b'\xD9\xFF'` ignoring empty bytes at the end of it.

    Parameters
    ----------
    data : `bytes-like`

    Returns
    -------
    result : `bool`
    """
    index = len(data) - 1
    while index > 1:
        actual = data[index]
        if actual == b'\xD9'[0] and data[index - 1] == b'\xFF'[0]:
            return True

        if actual:
            return False

        index -= 1
        continue