<commit_before>from . import SimIRStmt
from ... import s_options as o
from ...s_action_object import SimActionObject
from ...s_action import SimActionData
from ...s_variable import SimRegisterVariable

class SimIRStmt_Put(SimIRStmt):
    def _execute(self):
        # value to put
        data = self._translate_expr(self.stmt.data)

        if o.FRESHNESS_ANALYSIS in self.state.options:
            var = SimRegisterVariable(self.stmt.offset, data.expr.size() / 8)
            self.state.scratch.used_variables.add(var)

        # do the put (if we should)
        if o.DO_PUTS in self.state.options:
            self.state.store_reg(self.stmt.offset, data.expr)

        # track the put
        if o.REGISTER_REFS in self.state.options:
            data_ao = SimActionObject(data.expr, reg_deps=data.reg_deps(), tmp_deps=data.tmp_deps())
            size_ao = SimActionObject(data.size_bits())
            r = SimActionData(self.state, SimActionData.REG, SimActionData.WRITE, addr=self.stmt.offset, data=data_ao, size=size_ao)
            self.actions.append(r)
<commit_msg>pass in action for put<commit_after>from . import SimIRStmt
from ... import s_options as o
from ...s_action_object import SimActionObject
from ...s_action import SimActionData
from ...s_variable import SimRegisterVariable

class SimIRStmt_Put(SimIRStmt):
    def _execute(self):
        # value to put
        data = self._translate_expr(self.stmt.data)

        if o.FRESHNESS_ANALYSIS in self.state.options:
            var = SimRegisterVariable(self.stmt.offset, data.expr.size() / 8)
            self.state.scratch.used_variables.add(var)

        # track the put
        if o.REGISTER_REFS in self.state.options:
            data_ao = SimActionObject(data.expr, reg_deps=data.reg_deps(), tmp_deps=data.tmp_deps())
            size_ao = SimActionObject(data.size_bits())
            a = SimActionData(self.state, SimActionData.REG, SimActionData.WRITE, addr=self.stmt.offset, data=data_ao, size=size_ao)
            self.actions.append(a)
        else:
            a = None

        # do the put (if we should)
        if o.DO_PUTS in self.state.options:
            self.state.registers.store(self.stmt.offset, data.expr, action=a)
{'fraction_non_alphanumeric': 0.1016719385449616, 'fraction_numerical': 0.0009037505648441031, 'mean_word_length': 2.752542372881356, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5423707', 'n_tokens_mistral': 704, 'n_tokens_neox': 697, 'n_words': 150}