

def _translate_shl(self, tb, instruction):
    oprnd0 = tb.read(instruction.operands[0])
    oprnd1 = tb.read(instruction.operands[1])
    imm0 = tb.immediate(1, oprnd0.size)
    tmp0 = tb.temporal(oprnd0.size)
    tmp1 = tb.temporal(oprnd0.size)
    tmp2 = tb.temporal(oprnd0.size)
    tmp3 = tb.temporal(oprnd0.size)
    tmp4 = tb.temporal(oprnd0.size)
    tb.add(self._builder.gen_str(oprnd1, tmp0))
    tb.add(self._builder.gen_sub(tmp0, imm0, tmp1))
    tb.add(self._builder.gen_bsh(oprnd0, tmp1, tmp2))
    tb.add(self._builder.gen_and(tmp2, imm0, tmp3))
    tb.add(self._builder.gen_str(tmp3, self._flags['cf']))
    tb.add(self._builder.gen_bsh(tmp2, imm0, tmp4))
    if (self._translation_mode == FULL_TRANSLATION):
        self._update_sf(tb, oprnd0, oprnd0, tmp4)
        self._update_zf(tb, oprnd0, oprnd0, tmp4)
        self._update_pf(tb, oprnd0, oprnd0, tmp4)
        self._undefine_flag(tb, self._flags['af'])
    tb.write(instruction.operands[0], tmp4)

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