'This is a hack to deal with small values being stored at offsets into large registers unpredictably'

def _fix_offset(self, state, size):

    if (size is None):
        size = self.size
    offset = state.arch.registers[self.reg_name][0]
    if (size in self.alt_offsets):
        return ((offset + self.alt_offsets[size]), size)
    elif ((size < self.size) and (state.arch.register_endness == 'Iend_BE')):
        return ((offset + (self.size - size)), size)
    return (offset, size)
