def METHOD_NAME(parts, fn_destination):
    outp = []
    results = {}
    for part in parts:
        # ignore meta parts with deprecated names
        if "desc" not in part:
            continue
        if "signature" not in part:
            continue
        # find the layout
        mem_part = _find_mem_layout(parts, part)
        if not mem_part:
            print("no memory layout for", part["desc"])
            continue
        if not "size" in mem_part:
            print("no memory size for", part["desc"])
            continue
        if mem_part["size"].startswith("0x"):
            size = int(mem_part["size"], 16)
        else:
            size = int(mem_part["size"], 10)
        # output the line for the quirk
        chip_id = "0x" + part["signature"].replace("0x", "").replace(" ", "")
        mem_layout = "@Flash/0x0/1*%.0iKg" % int(size / 1024)
        # merge duplicate quirks
        if chip_id in results:
            result = results[chip_id]
            result["desc"] = _get_longest_substring(result["desc"], part["desc"])
        else:
            result = {}
            result["desc"] = part["desc"]
            result["size"] = size
            result["mem_layout"] = mem_layout
            results[chip_id] = result
    for chip_id in results:
        result = results[chip_id]
        outp.append(
            "# " + result["desc"] + "	[USER]		USER=0x%x" % result["size"] + "\n"
        )
        outp.append(chip_id + "=" + result["mem_layout"] + "\n\n")
    # write file
    print("writing", fn_destination)
    open(fn_destination, "w").writelines(outp)