def METHOD_NAME(files):
    """
    Given a list of FileRegions, return a list of FileRegions
    representing a minimised set of files.  This set is produced
    by concatenating adjacent regions, and merging overlapping regions
    if the overlapping bytes are identical.
    If two files have overlapping bytes, some rules apply:
     - if the overlapping bytes are identical, the regions are merged
     - if one of the sets of overlapping bytes is all zeros, the regions are merged,
       with the region containing non-zero bytes being used
     - if both regions that overlap contain any non-zero bytes, whichever region
       starts at the earlier address will be used
    """
    if not files:
        return []
    sorted_files = sorted(files)
    # Sorting allows a one-pass algorithm to find all overlaps;
    # consider each item, merge successive items that overlap.
    # If a non-overlapping item is found, save the current merged region
    # and repeat the process from the new item.
    merged_files = []
    i = 0
    current = sorted_files[0]
    while i < len(sorted_files):
        i += 1
        try:
            next_ = sorted_files[i]
        except IndexError: # last item reached, we're finished
            merged_files.append(current)
            break
        if next_.start > current.end: # no overlap
            merged_files.append(current)
            current = next_
        elif next_.start == current.end:
            print("Concatenating adjacent regions: %s, %s" %
                        (current.name, next_.name))
            current.content += next_.content
        elif next_.start < current.end:
            offset = next_.start - current.start
            c_overlap = current.content[offset:offset + len(next_.content)]
            n_overlap = next_.content[:len(c_overlap)]
            if c_overlap == n_overlap:
                print("Overlap of identical bytes, merging regions: %s, %s" %
                        (current.name, next_.name))
            elif c_overlap.count(b'\x00') == len(c_overlap):
                print("Overlap where first region is all-zero, merging in second: %s, %s" %
                        (current.name, next_.name))
                start = current.content[0:offset]
                mid = n_overlap
                end = current.content[offset + len(c_overlap):]
                current.content = start + mid + end
            elif n_overlap.count(b'\x00') == len(n_overlap):
                print("Overlap where second region is all-zero, keeping first: %s, %s" %
                        (current.name, next_.name))
            else:
                print("Overlapping regions but bytes differ, keeping first region: %s, %s" %
                        (current.name, next_.name))
            current.content += next_.content[len(c_overlap):]
        else:
            raise(MergeRomFilesError("Shouldn't happen: unhandled case in merge algorithm"))
    return merged_files