def make_po_file_function_dict(pos, filefilter=lambda f: True):
    """Create a file, function dictionary from a list of proof obligations.

    Args:
      pos: list of proof obligations (primary or supporting)
      filefilter: predicate that specifies which c files to include
    Returns:
      dictionary that organizes the proof obligations by c file
    """
    result = {}
    for po in pos:
        cfile = po.cfile.name
        if filefilter(cfile):
            if cfile not in result:
                result[cfile] = {}
            cfun = po.cfun.name
            if cfun not in result[cfile]:
                result[cfile][cfun] = []
            result[cfile][cfun].append(po)
    return result