

def _translate_scas_suffix(self, tb, instruction, suffix):
    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))
    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)
    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)
    tb.add(self._builder.gen_ldm(src2, src2_data))
    tb.add(self._builder.gen_sub(src1_data, src2_data, tmp0))
    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(counter, src1_data, src2_data, tmp0)
    self._update_pf(tb, src1_data, src2_data, tmp0)
    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/VarMisuse@315/501 `tb`->`counter`