'Call this method with a SimState and a SimSuccessors to execute the procedure.
Alternately, successors may be none if this is an inline call. In that case, you should
provide arguments to the function.'

def execute(self, state, successors=None, arguments=None, ret_to=None):

    if (self.addr is None):
        self.addr = state.addr
    if (self.arch is None):
        self.arch = state.arch
    if (self.project is None):
        self.project = state.project
    if (self.cc is None):
        if (self.arch.name in DEFAULT_CC):
            self.cc = DEFAULT_CC[self.arch.name](self.arch)
        else:
            raise SimProcedureError('There    is    no    default    calling    convention    for    architecture    %s.    You    must    specify    a    calling    convention.', self.arch.name)
    inst = copy.copy(self)
    inst.state = state
    inst.successors = successors
    inst.ret_to = ret_to
    override = None
    if inst.is_syscall:
        state.history.recent_syscall_count = 1
        if len(state.posix.queued_syscall_returns):
            override = state.posix.queued_syscall_returns.pop(0)
    if callable(override):
        try:
            r = override(state, run=inst)
        except TypeError:
            r = override(state)
        inst.use_state_arguments = True
    elif (override is not None):
        r = override
        inst.use_state_arguments = True
    else:
        if inst.is_continuation:
            if (state.callstack.top.procedure_data is None):
                raise SimProcedureError('Tried    to    return    to    a    SimProcedure    in    an    inapplicable    stack    frame!')
            (saved_sp, sim_args, saved_local_vars) = state.callstack.top.procedure_data
            state.regs.sp = saved_sp
            inst.arguments = sim_args
            inst.use_state_arguments = True
            for (name, val) in saved_local_vars:
                setattr(inst, name, val)
        elif (arguments is None):
            inst.use_state_arguments = True
            sim_args = [inst.arg(_) for _ in xrange(inst.num_args)]
            inst.arguments = sim_args
        else:
            inst.use_state_arguments = False
            sim_args = arguments[:inst.num_args]
            inst.arguments = arguments
        r = getattr(inst, inst.run_func)(*sim_args, **inst.kwargs)
    if (inst.returns and ((not inst.successors) or (len(inst.successors.successors) == 0))):
        inst.ret(r)
    return inst
