import re


def get_associated_args(code_snippets: list) -> list:
    """ Collect associated function arguments.

    Parameters:
    code_snippets (list): list of CodeSnippet objects

    Returns:
    assoc_args (list): associated function arguments lexically sorted

    """
    code = "".join(s.code for s in code_snippets)
    fieldname_regex = r'(\w+) = (\1)_value;'
    assoc_args = {f'int {cap[1]}_value' for cap in
                  re.findall(fieldname_regex, code)}
    if 'ptrs->' in code:
        assoc_args.add('proto_ptr_t *ptrs')
    return sorted(assoc_args)