def METHOD_NAME(lines, all_functions):
    errors = []
    no_history = []
    in_history = False
    for line in lines:
        if   line.startswith('.Sh HISTORY'): in_history = True
        elif line.startswith('.Sh')        : in_history = False
        if not in_history                  : no_history.append(line)
    nm = extract(no_history, '.Nm')
    fo = extract(no_history, '.Fo')
    fn = extract(no_history, '.Fn')
    fn = without('arc4random_buf', sorted(set(fn)))
    dupes_nm = sorted(set([x for x in nm if nm.count(x) > 1]))
    dupes_fo = sorted(set([x for x in fo if fo.count(x) > 1]))
    only_fo = [x for x in fo if nm           .count(x) == 0]
    only_nm = [x for x in nm if fo           .count(x) == 0]
    only_fn = [x for x in fn if fo           .count(x) == 0]
    no_src  = [x for x in fn if all_functions.count(x) == 0]
    if len(dupes_nm) > 0: errors.append('Duplicates in .Nm: ' + str(dupes_nm))
    if len(dupes_fo) > 0: errors.append('Duplicates in .Fo: ' + str(dupes_fo))
    if len(only_fo)  > 0: errors.append('Missing in .Nm: '    + str(only_fo))
    if len(only_nm)  > 0: errors.append('Only in .Nm: '       + str(only_nm))
    if len(only_fn)  > 0: errors.append('Only in .Fn: '       + str(only_fn))
    if len(no_src)   > 0: errors.append('Not in sources: '    + str(no_src))
    return errors