def _translate_scas_suffix(self, tb, instruction, suffix):
        # Flags Affected
        # The OF, SF, ZF, AF, PF, and CF flags are set according to the
        # temporary result of the comparison.

        # temp <- SRC1 - SRC2;
        # SetStatusFlags(temp);
        #
        # IF (Byte comparison)
        #   THEN
        #       IF DF = 0
        #           THEN
        #           (R|E)SI <- (R|E)SI + sizeof(SRC);
        #           (R|E)DI <- (R|E)DI + sizeof(SRC);
        #       ELSE
        #           (R|E)SI <- (R|E)SI - sizeof(SRC);
        #           (R|E)DI <- (R|E)DI - sizeof(SRC);
        #       FI;
        # FI;

        # Define source1 register.
        if suffix == 'b':
            src1_data = ReilRegisterOperand("al", 8)
            data_size = 8
        elif suffix == 'w':
            src1_data = ReilRegisterOperand("ax", 16)
            data_size = 16
        elif suffix == 'd':
            src1_data = ReilRegisterOperand("eax", 32)
            data_size = 32
        elif suffix == 'q':
            src1_data = ReilRegisterOperand("rax", 64)
            data_size = 64
        else:
            raise Exception("Invalid instruction suffix: %s" * suffix)

        # Define source2 register.
        if self._arch_mode == ARCH_X86_MODE_32:
            src2 = ReilRegisterOperand("edi", 32)
        elif self._arch_mode == ARCH_X86_MODE_64:
            src2 = ReilRegisterOperand("rdi", 64)
        else:
            raise Exception("Invalid architecture mode: %d", self._arch_mode)

        # Define temporary registers
        src2_data = tb.temporal(data_size)
        tmp0 = tb.temporal(data_size*2)

        if instruction.prefix:
            counter, loop_start_lbl = self._rep_prefix_begin(tb, instruction)

        # Instruction
        # -------------------------------------------------------------------- #
        # Move data.
        tb.add(self._builder.gen_ldm(src2, src2_data))

        tb.add(self._builder.gen_sub(src1_data, src2_data, tmp0))

        # Flags : CF, OF, SF, ZF, AF, PF
        self._update_cf(tb, src1_data, src2_data, tmp0)
        self._update_of_sub(tb, src1_data, src2_data, tmp0)
        self._update_sf(tb, src1_data, src2_data, tmp0)
        self._update_zf(tb, src1_data, src2_data, tmp0)
        self._update_af(tb, src1_data, src2_data, tmp0)
        self._update_pf(tb, src1_data, src2_data, tmp0)

        # Update source pointers.
        self._update_strings_dst(tb, src2, data_size, instruction)
        # -------------------------------------------------------------------- #

        if instruction.prefix:
            self._rep_prefix_end(tb, instruction, counter, loop_start_lbl)
dataset/ETHPy150Open programa-stic/barf-project/barf/barf/arch/x86/x86translator.py/X86Translator._translate_scas_suffix/operator `%` -> `*`