def METHOD_NAME(filepath, data, key):
    # Untweaked key begins as half-advanced `key`
    h = two_rounds(pack(b"<QQQQQQQQ", key, len(filepath), 0, 0, 0, 0, 0, 0))
    h = mix_in_filepath(filepath, h)
    # Add the tweaked key and its advancement, then advance by four round pairs.
    tmp = add_qwords(h, quad_rounds(h))
    tmp = s_to_q(tmp)
    key = quad_rounds(q_to_s([tmp[0] ^ key + len(data)] + tmp[1:]))
    return chacha_rest(data, key)