def _translate_cmov(self, tb, instruction, cmov_cond):
        # Move if condition (cmov_cond) is met.
        # Flags Affected
        # None.

        eval_cond_fn_name = "_evaluate_" % cmov_cond
        eval_cond_fn = getattr(self, eval_cond_fn_name, self._not_implemented)

        # NOTE: CMOV pseudocode (not its description) specifies that in 32 bit registers, even
        # if the condition is not met, the high 32 bits of the destiny are set to zero (DEST[63:32] <- 0).
        # So op0 (dest) is assigned to itself, in 32 bits that doesn't change anything, in 64 it sets high bits
        # to zero. Then if the condition is met the mov is performed and the previous assignment has no effect.
        # op0 <- op0:
        oprnd0 = tb.read(instruction.operands[0])
        tmp = tb.temporal(oprnd0.size)
        tb.add(self._builder.gen_str(oprnd0, tmp))
        tb.write(instruction.operands[0], tmp)

        cmov_cond_not_met = Label('cmov_cond_not_met')

        neg_cond = tb._negate_reg(eval_cond_fn(tb))

        tb.add(self._builder.gen_jcc(neg_cond, cmov_cond_not_met))

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

        tb.write(instruction.operands[0], oprnd1)

        tb.add(cmov_cond_not_met)
        tb.add(self._builder.gen_nop())
dataset/ETHPy150Open programa-stic/barf-project/barf/barf/arch/x86/x86translator.py/X86Translator._translate_cmov/operator `+` -> `%`