

def _translate_bt(self, tb, instruction):
    oprnd0 = tb.read(instruction.operands[0])
    oprnd1 = tb.read(instruction.operands[1])
    tmp0 = tb.temporal(oprnd0.size)
    zero = tb.immediate(0, oprnd0.size)
    one = tb.immediate(1, oprnd0.size)
    bit_base_size = tb.immediate(oprnd0.size, oprnd1.size)
    bit_offset_tmp = tb.temporal(oprnd0.size)
    bit_offset = tb.temporal(oprnd0.size)
    tb.add(self._builder.gen_mod(oprnd1, bit_base_size, bit_offset_tmp))
    tb.add(self._builder.gen_sub(zero, bit_offset_tmp, bit_offset))
    tb.add(self._builder.gen_bsh(oprnd0, bit_offset, tmp0))
    tb.add(self._builder.gen_and(tmp0, one, self._flags['cf']))
    if (self._translation_mode == FULL_TRANSLATION):
        self._undefine_flag(tb, self._flags['of'])
        self._undefine_flag(tb, self._flags['sf'])
        self._undefine_flag(tb, self._flags['af'])
        self._undefine_flag(tb, self._flags['pf'])

dataset/ETHPy150Open programa-stic/barf-project/barf/barf/arch/x86/x86translator.py X86Translator._translate_bt/original