def bytes_rjust(x: bytes, width: int, fill: bytes) -> bytes:
    """Given a bytes object, a line width, and a fill byte, right-justifies the bytes object within the line.

    Compiling bytes.rjust compiles this function.
    This function is only intended to be executed in this compiled form.
    Checking the fill length is assumed to be done outside this function.

    Args:
        x: A bytes object.
        width: Line width.
        fill: A bytes object of length 1.

    Returns:
        Transformed bytes object.
    """
    if width <= len(x):
        return x

    return fill * (width - len(x)) + x