<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def findall(pattern, string, *args, **kwargs):
 """Apply `findall` after applying backrefs."""


    flags = args[2] if len(args) > 2 else kwargs.get('flags', 0)
    return _re.findall(_apply_search_backrefs(pattern, flags), string, *args, **kwargs)