def _extract_bit(self, tb, reg, bit):
        assert(bit >= 0 and bit < reg.size)

        tmp = tb.temporal(reg.size)
        ret = tb.temporal(1)

        tb.add(self._builder.gen_bsh(reg, tb.immediate(-bit, reg.size), tmp))   # shift to LSB
        tb.add(self._builder.gen_and(tmp, tb.immediate(1, reg.size), ret))      # filter LSB

        return ret
dataset/ETHPy150Open programa-stic/barf-project/barf/barf/arch/x86/x86translator.py/X86Translator._extract_bit/original