def _update_of_sub(self, tb, oprnd0, oprnd1, result):
        assert oprnd0.size == oprnd1.size

        of = self._flags["of"]

        imm0 = tb.immediate(1, 1)

        tmp0 = tb.temporal(1)
        tmp1 = tb.temporal(1)
        tmp2 = tb.temporal(1)
        tmp3 = tb.temporal(1)

        oprnd1_sign = tb.temporal(1)

        # Extract sign bit.
        oprnd0_sign = self._extract_sign_bit(tb, oprnd0)
        oprnd1_sign_tmp = self._extract_sign_bit(tb, oprnd1)
        result_sign = self._extract_bit(tb, result, oprnd0.size - 1)

        # Invert sign bit of oprnd2.
        tb.add(self._builder.gen_xor(oprnd1_sign_tmp, imm0, oprnd1_sign))

        # Compute OF.
        tb.add(self._builder.gen_xor(oprnd0_sign, oprnd1_sign, tmp0))   # (sign bit oprnd0 ^ sign bit oprnd1)
        tb.add(self._builder.gen_xor(tmp0, imm0, tmp1))                 # (sign bit oprnd0 ^ sign bit oprnd1 ^ 1)
        tb.add(self._builder.gen_xor(oprnd0_sign, result_sign, tmp2))   # (sign bit oprnd0 ^ sign bit result)
        tb.add(self._builder.gen_and(tmp1, tmp2, tmp3))                 # (sign bit oprnd0 ^ sign bit oprnd1 ^ 1) & (sign bit oprnd0 ^ sign bit result)

        # Save result.
        tb.add(self._builder.gen_str(tmp3, of))
dataset/ETHPy150Open programa-stic/barf-project/barf/barf/arch/x86/x86translator.py/X86Translator._update_of_sub/original