def bytes_endswith(x: bytes, suffix: bytes) -> bool:
    """Does given bytes object end with the subsequence suffix?

    Compiling bytes.endswith, with no range arguments, compiles this function.
    This function is only intended to be executed in this compiled form.

    Args:
        x: The bytes object to examine.
        suffix: The subsequence to look for.

    Returns:
        Result of check.
    """
    index = len(x) - len(suffix)
    if index < 0:
        return False
    for i in suffix:
        if x[index] != i:
            return False
        index += 1
    return True