(self, offset, richr, size, src=None, dst=None)
:param int offset:
        :param RichR data:
        :param int size:
        :return:
def _assign_to_register(self, offset, richr, size, src=None, dst=None):
        """

        :param int offset:
        :param RichR data:
        :param int size:
        :return:
        """

        if self.arch.is_artificial_register(offset, size):
            # skip all writes to artificial registers
            return
        if offset in (self.arch.ip_offset, self.arch.sp_offset):
            # only store the value. don't worry about variables.
            v = MultiValues(offset_to_values={0: {richr.data}})
            self.state.register_region.store(offset, v)
            return

        codeloc: CodeLocation = self._codeloc()
        data: claripy.ast.Base = richr.data

        # lea
        self._reference(richr, codeloc, src=src)

        # handle register writes
        existing_vars = self.variable_manager[self.func_addr].find_variables_by_atom(self.block.addr, self.stmt_idx,
                                                                                     dst)
        existing_vars: Set[Tuple[SimVariable,int]]
        if not existing_vars:
            variable = SimRegisterVariable(offset, size,
                                           ident=self.variable_manager[self.func_addr].next_variable_ident(
                                               'register'),
                                           region=self.func_addr
                                           )
            self.variable_manager[self.func_addr].set_variable('register', offset, variable)
        else:
            variable, _ = next(iter(existing_vars))

        # FIXME: The offset does not have to be 0
        annotated_data = self.state.annotate_with_variables(data, [(0, variable)])
        v = MultiValues(offset_to_values={0: {annotated_data}})
        self.state.register_region.store(offset, v)
        # register with the variable manager
        self.variable_manager[self.func_addr].write_to(variable, None, codeloc, atom=dst)

        if richr.typevar is not None:
            if not self.state.typevars.has_type_variable_for(variable, codeloc):
                # assign a new type variable to it
                typevar = typevars.TypeVariable()
                self.state.typevars.add_type_variable(variable, codeloc, typevar)
                # create constraints
            else:
                typevar = self.state.typevars.get_type_variable(variable, codeloc)
            self.state.add_type_constraint(typevars.Subtype(richr.typevar, typevar))
            self.state.add_type_constraint(typevars.Subtype(typevar, typeconsts.int_type(variable.size * 8)))
def _assign_to_register ( self , offset , richr , size , src = None , dst = None ) : if self . arch . is_artificial_register ( offset , size ) : # skip all writes to artificial registers return if offset in ( self . arch . ip_offset , self . arch . sp_offset ) : # only store the value. don't worry about variables. v = MultiValues ( offset_to_values = { 0 : { richr . data } } ) self . state . register_region . store ( offset , v ) return codeloc : CodeLocation = self . _codeloc ( ) data : claripy . ast . Base = richr . data # lea self . _reference ( richr , codeloc , src = src ) # handle register writes existing_vars = self . variable_manager [ self . func_addr ] . find_variables_by_atom ( self . block . addr , self . stmt_idx , dst ) existing_vars : Set [ Tuple [ SimVariable , int ] ] if not existing_vars : variable = SimRegisterVariable ( offset , size , ident = self . variable_manager [ self . func_addr ] . next_variable_ident ( 'register' ) , region = self . func_addr ) self . variable_manager [ self . func_addr ] . set_variable ( 'register' , offset , variable ) else : variable , _ = next ( iter ( existing_vars ) ) # FIXME: The offset does not have to be 0 annotated_data = self . state . annotate_with_variables ( data , [ ( 0 , variable ) ] ) v = MultiValues ( offset_to_values = { 0 : { annotated_data } } ) self . state . register_region . store ( offset , v ) # register with the variable manager self . variable_manager [ self . func_addr ] . write_to ( variable , None , codeloc , atom = dst ) if richr . typevar is not None : if not self . state . typevars . has_type_variable_for ( variable , codeloc ) : # assign a new type variable to it typevar = typevars . TypeVariable ( ) self . state . typevars . add_type_variable ( variable , codeloc , typevar ) # create constraints else : typevar = self . state . typevars . get_type_variable ( variable , codeloc ) self . state . add_type_constraint ( typevars . Subtype ( richr . typevar , typevar ) ) self . state . add_type_constraint ( typevars . Subtype ( typevar , typeconsts . int_type ( variable . size * 8 ) ) )