'For a given state and current location of of execution, will update a function by adding the offets of
appropriate actions to the stack variable or argument registers for the fnc.
:param SimState state: upcoming state.
:param SimSuccessors current_run: possible result states.
:param knowledge.Function func: current function.
:param int sp_addr: stack pointer address.
:param set accessed_registers: set of before accessed registers.'

def _handle_actions(self, state, current_run, func, sp_addr, accessed_registers):

    se = state.se
    if ((func is not None) and (sp_addr is not None)):
        new_sp_addr = (sp_addr + self.project.arch.call_sp_fix)
        actions = [a for a in state.history.recent_actions if (a.bbl_addr == current_run.addr)]
        for a in actions:
            if ((a.type == 'mem') and (a.action == 'read')):
                try:
                    addr = se.exactly_int(a.addr.ast, default=0)
                except claripy.ClaripyError:
                    continue
                if ((self.project.arch.call_pushes_ret and (addr >= new_sp_addr)) or ((not self.project.arch.call_pushes_ret) and (addr >= new_sp_addr))):
                    offset = (addr - new_sp_addr)
                    func._add_argument_stack_variable(offset)
            elif (a.type == 'reg'):
                offset = a.offset
                if ((a.action == 'read') and (offset not in accessed_registers)):
                    func._add_argument_register(offset)
                elif (a.action == 'write'):
                    accessed_registers.add(offset)
    else:
        l.error('handle_actions:    Function    not    found,    or    stack    pointer    is    None.    It    might    indicates    unbalanced    stack.')
