from typing import List
from typing import Tuple


def _update_lumps_headers(lumps: List[Tuple[int, int, int, bytes]], lumps_after_update: List[int], sizediff: int):
    """Return a lumps headers list with new file offsets after performing update. Also updates lump length in the header which is being updated.
    """
    
    updated_lumps = list(lumps)

    before_lump = lumps[lumps_after_update[0]]
    updated_lumps[lumps_after_update[0]] = before_lump[0] + sizediff, before_lump[1] + sizediff, *before_lump[2:]

    for lump_idx in lumps_after_update[1:]:
        before_lump = lumps[lump_idx]
        updated_lumps[lump_idx] = before_lump[0] + sizediff, *before_lump[1:]
    
    return updated_lumps