

def _translate_ror(self, tb, instruction):
    oprnd0 = tb.read(instruction.operands[0])
    oprnd1 = tb.read(instruction.operands[1])
    size = tb.immediate(oprnd0.size, oprnd0.size)
    if (self._arch_mode == ARCH_X86_MODE_32):
        count_mask = tb.immediate(31, oprnd0.size)
    elif (self._arch_mode == ARCH_X86_MODE_64):
        count_mask = tb.immediate(63, oprnd0.size)
    count = tb.temporal(oprnd0.size)
    oprnd_ext = 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)
    temp_count = tb.temporal(oprnd_ext.size)
    result = tb.temporal(oprnd0.size)
    result_msb = tb.temporal(1)
    result_msb_prev = tb.temporal(1)
    tmp0 = tb.temporal(oprnd0.size)
    tmp1 = tb.temporal(1)
    tmp1_zero = tb.temporal(1)
    tmp2 = tb.temporal(oprnd0.size)
    zero = tb.immediate(0, oprnd0.size)
    imm1 = tb.immediate(1, oprnd0.size)
    imm2 = tb.immediate((- oprnd0.size), (oprnd0.size * 2))
    imm3 = tb.immediate((- (oprnd0.size + 1)), oprnd0.size)
    imm4 = tb.immediate((oprnd0.size - 1), oprnd0.size)
    imm5 = tb.immediate((oprnd0.size - 2), 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, size, tmp2))
    tb.add(self._builder.gen_sub(zero, tmp2, temp_count))
    tb.add(self._builder.gen_bsh(oprnd0, size, 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))
    tb.add(self._builder.gen_bsh(result, imm4, self._flags['cf']))
    undef_of_lbl = tb.label('undef_of_lbl')
    tb.add(self._builder.gen_sub(tmp0, imm1, tmp1))
    tb.add(self._builder.gen_bisz(tmp1, tmp1_zero))
    tb.add(self._builder.gen_jcc(tmp1_zero, undef_of_lbl))
    tb.add(self._builder.gen_bsh(result, imm3, result_msb))
    tb.add(self._builder.gen_bsh(result, imm5, result_msb_prev))
    count_mask.add(self._builder.gen_xor(result_msb, result_msb_prev, self._flags['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_ror/VarMisuse@634/916 `tb`->`count_mask`