

def _translate_loop(self, tb, instruction):
    if (self._arch_mode == ARCH_X86_MODE_32):
        counter = ReilRegisterOperand('ecx', 32)
    elif (self._arch_mode == ARCH_X86_MODE_64):
        counter = ReilRegisterOperand('rcx', 64)
    oprnd0 = tb.read(instruction.operands[0])
    addr_oprnd = self._translate_address(tb, oprnd0)
    end_addr = ReilImmediateOperand(((instruction.address + instruction.size) << 8), (self._arch_info.address_size + 8))
    tmp0 = tb.temporal(counter.size)
    exit_cond = tb.temporal(1)
    imm0 = tb.immediate(1, counter.size)
    stop_looping_lbl = tb.label('stop_looping')
    tb.add(self._builder.gen_str(counter, tmp0))
    tb.add(self._builder.gen_sub(tmp0, imm0, counter))
    tb.add(self._builder.gen_jcc(counter, addr_oprnd))

dataset/ETHPy150Open programa-stic/barf-project/barf/barf/arch/x86/x86translator.py X86Translator._translate_loop/original