def _emit(self, cond_br, target=None, reg=None, absolute=False,
              link=REGISTERS['null']):

        if target is None:
            imm = 0
        elif isinstance(target, Label):
            target.pinned = False
            self.asm._add_backpatch_item(target.name)
            imm = 0
        elif isinstance(target, int):
            imm = target
        else:
            raise AssembleError('Invalid branch target: {}'.format(target))

        if reg:
            if (not (reg.spec & _REG_AR) or
                GENERAL_PURPOSE_REGISTERS not in reg.name):
                raise AssembleError(
                    'Must be general purpose regfile A register {}'.format(reg)
                    )
            assert(reg.addr < 32)
            raddr_a = reg.addr
            use_reg = True
        else:
            raddr_a = 0
            use_reg = False

        waddr_add, waddr_mul, write_swap, pack = \
                self._encode_write_operands(link)

        if pack:
            raise AssembleError('Packing is not available for link register')

        insn = BranchInsn(
            sig=0xF, cond_br=cond_br, rel=not absolute, reg=use_reg,
            raddr_a=raddr_a, ws=write_swap, waddr_add=waddr_add,
            waddr_mul=waddr_mul, immediate=imm
            )

        self.asm._emit(insn)
dataset/ETHPy150Open nineties/py-videocore/videocore/assembler.py/BranchEmitter._emit/swapped operands of `not in`