def _translate_rcl(self, tb, instruction):
        # Flags Affected
        # The CF flag contains the value of the bit shifted into it.
        # The OF flag is affected only for single-bit rotates (see
        # "Description" above); it is undefined for multi-bit rotates.
        # The SF, ZF, AF, and PF flags are not affected.

        oprnd0 = tb.read(instruction.operands[0])
        oprnd1 = tb.read(instruction.operands[1])

        size = tb.immediate(oprnd0.size, oprnd0.size)

        tmp_cf_ext = tb.temporal(oprnd0.size * 2)
        tmp_cf_ext_1 = tb.temporal(oprnd0.size * 2)

        oprnd_ext = tb.temporal(oprnd0.size * 2)
        oprnd_ext_1 = tb.temporal(oprnd0.size * 2)
        oprnd_ext_shifted = tb.temporal(oprnd0.size * 2)
        oprnd_ext_shifted_l = tb.temporal(oprnd0.size)
        oprnd_ext_shifted_h = tb.temporal(oprnd0.size)

        result = tb.temporal(oprnd0.size)
        result_msb = tb.temporal(1)

        tmp1 = tb.temporal(1)
        tmp1_zero = tb.temporal(1)

        imm1 = tb.immediate(1, oprnd0.size)
        imm2 = tb.immediate(-(oprnd0.size + 1), oprnd0.size * 2)
        imm3 = tb.immediate(-(oprnd0.size + 1), oprnd0.size)
        imm4 = tb.immediate(oprnd0.size, oprnd0.size / 2)

        if oprnd0.size == 8:
            count_mask = tb.immediate(0x1f, oprnd0.size)
            tmp0 = tb.temporal(oprnd0.size)
            count = tb.temporal(oprnd0.size)
            temp_count = tb.temporal(oprnd_ext.size)
            mod_amount = tb.immediate(9, oprnd0.size)

            tb.add(self._builder.gen_str(oprnd1, count))

            tb.add(self._builder.gen_and(count, count_mask, tmp0))
            tb.add(self._builder.gen_mod(tmp0, mod_amount, temp_count))
        elif oprnd0.size == 16:
            count_mask = tb.immediate(0x1f, oprnd0.size)
            tmp0 = tb.temporal(oprnd0.size)
            count = tb.temporal(oprnd0.size)
            temp_count = tb.temporal(oprnd_ext.size)
            mod_amount = tb.immediate(17, oprnd0.size)

            tb.add(self._builder.gen_str(oprnd1, count))

            tb.add(self._builder.gen_and(count, count_mask, tmp0))
            tb.add(self._builder.gen_mod(tmp0, mod_amount, temp_count))
        elif oprnd0.size == 32:
            count_mask = tb.immediate(0x1f, oprnd0.size)
            tmp0 = tb.temporal(oprnd0.size)
            count = tb.temporal(oprnd0.size)
            temp_count = tb.temporal(oprnd_ext.size)

            tb.add(self._builder.gen_str(oprnd1, count))

            tb.add(self._builder.gen_and(count, count_mask, tmp0))
            tb.add(self._builder.gen_str(tmp0, temp_count))
        elif oprnd0.size == 64:
            count_mask = tb.immediate(0x3f, oprnd0.size)
            tmp0 = tb.temporal(oprnd0.size)
            count = tb.temporal(oprnd0.size)
            temp_count = tb.temporal(oprnd_ext.size)

            tb.add(self._builder.gen_str(oprnd1, count))

            tb.add(self._builder.gen_and(count, count_mask, tmp0))
            tb.add(self._builder.gen_str(tmp0, temp_count))
        else:
            raise Exception("Invalid operand size: %d", oprnd0.size)

        tb.add(self._builder.gen_str(oprnd0, oprnd_ext_1))

        # Insert CF.
        tb.add(self._builder.gen_str(self._flags["cf"], tmp_cf_ext))
        tb.add(self._builder.gen_bsh(tmp_cf_ext, imm4, tmp_cf_ext_1))
        tb.add(self._builder.gen_or(tmp_cf_ext_1, oprnd_ext_1, oprnd_ext))

        tb.add(self._builder.gen_bsh(oprnd_ext, temp_count, oprnd_ext_shifted))
        tb.add(self._builder.gen_bsh(oprnd_ext_shifted, imm2, oprnd_ext_shifted_h))
        tb.add(self._builder.gen_str(oprnd_ext_shifted, oprnd_ext_shifted_l))
        tb.add(self._builder.gen_or(oprnd_ext_shifted_l, oprnd_ext_shifted_h, result))

        # Compute CF.
        tb.add(self._builder.gen_str(result, self._flags["cf"]))

        # Compute OF.
        undef_of_lbl = tb.label('undef_of_lbl')

        tb.add(self._builder.gen_sub(count, imm1, tmp1))
        tb.add(self._builder.gen_bisz(tmp1, tmp1_zero))
        tb.add(self._builder.gen_jcc(tmp1_zero, undef_of_lbl))

        # Compute.
        imm3_1 = tb.immediate(-(oprnd0.size + 1), result.size)

        tb.add(self._builder.gen_bsh(result, imm3_1, result_msb))
        tb.add(self._builder.gen_xor(result_msb, self._flags["cf"], self._flags["of"]))

        # Undef OF.
        tb.add(undef_of_lbl)
        self._undefine_flag(tb, self._flags["of"])

        tb.write(instruction.operands[0], result)
dataset/ETHPy150Open programa-stic/barf-project/barf/barf/arch/x86/x86translator.py/X86Translator._translate_rcl/operator `*` -> `/`