[Question]
  [
You goal is to implement the operation of XOR ([carryless](http://en.wikipedia.org/wiki/CLMUL_instruction_set)) multiplication, defined below, in as few bytes as possible.
If we think of bitwise XOR (`^`) as binary addition without carrying
```
   101   5
^ 1001   9
  ----  
  1100  12
  
  5^9=12
```
we can perform XOR multiplication `@` by doing binary [long-multiplication](http://mathworld.wolfram.com/LongMultiplication.html) but doing the adding step without carrying as bitwise XOR `^`.
```
     1110  14
   @ 1101  13
    -----
     1110
       0
   1110
^ 1110 
  ------
  1000110  70
  
  14@13=70
```
(For mathematicians, this is multiplication in the polynomial ring \$F\_2[x]\$, identifying polynomials with natural numbers by evaluating at \$x=2\$ as a polynomial over \$\mathbb Z\$.)
XOR multiplication commutes `a@b=b@a`, associates `(a@b)@c=a@(b@c)`, and distributes over bitwise XOR `a@(b^c)=(a@b)^(a@c)`. In fact, it is the unique such operation that matches multiplication `a@b=a*b` whenever `a` and `b` are powers of `2` like `1,2,4,8...`.
**Requirements**
Take two non-negative integers as input and output or print their XOR-product. This should be as numbers or their decimal string representations, not their binary expansions. Fewest bytes wins.
Don't worry about integer overflows.
Here are some test cases formatted as `a b a@b`.
```
0 1 0
1 2 2
9 0 0
6 1 6
3 3 5
2 5 10
7 9 63
13 11 127
5 17 85
14 13 70
19 1 19
63 63 1365
```
  
[Answer]
# x86 machine code: 7 bytes
```
66 0F 3A 44 C1 00 C3  pclmulqdq xmm0, xmm1, 0 \ ret
```
Only two instructions. `pclmulqdq` does the heavy lifting, it literally implements that type of xor-multiplication. `ret` to make it a callable function, hopefully satisfying the requirement of "outputting" the result (in the return value, `xmm0`). Putting integer arguments in `xmm` args is a bit unusual, but I hope you'll forgive me.
[Answer]
# Z80, 11 bytes
```
B7 CB 32 30 01 B3 C8 CB 23 18 F6   
```
The code is called as a function. `a` and `b` are in `D` and `E` (the order doesn't matter) and the answer is stored in `A` when the code returns (there are no I/O functions).
```
B7      XOR A     //  A^=A (A=0)
CB 32   SRL D     //    CARRY = lsb(D), D>>=1, ZERO = D==0
30 01   JR NC, 1  //    jump 1 byte if not CARRY
B3      XOR E     //      A^=E, ZERO = A==0
C8      RET Z     //    return if ZERO
CB 23   SLA E     //    E<<=1
18 F6   JR -10    //    jump -10 bytes
```
It produces the correct results for all test input except `63@63` which returns `85` because all the registers are 8-bit and 1365 mod 256 = 85 (integer overflow).
[Answer]
# Pyth, ~~13~~ 12 bytes
```
uxyG*HQjvz2Z
```
[Demonstration.](https://pyth.herokuapp.com/?code=xFm*vz.%26Q%5E2dQ&input=63%0A63&debug=0)
```
uxyG*HQjvz2Z
                  Implicit:
                  z = input()
                  Q = eval(input())
                  Z = 0
       jvz2       The first input, written in base 2, like so: [1, 0, 1, ...
u      jvz2Z      Reduce over the binary representation, starting with 0.
 x                XOR of
  yG              Twice the previous number
    *HQ           and the second input times the current bit.
```
---
Old version, 13 bytes:
```
xFm*vz.&Q^2dQ
```
[Demonstration.](https://pyth.herokuapp.com/?code=xFm*vz.%26Q%5E2dQ&input=13%0A11&debug=0)
[Answer]
# C, ~~44~~ 38 bytes
*Thanks to nimi, we now use recursion for 6 fewer bytes!*
```
f(a,b){return b?(b&1)*a^f(a*2,b/2):0;}
```
We define a function `f` which takes `a`, `b`.
This can be called like:
```
printf("%d @ %d = %d\n", 13, 14, f(13, 14));
```
Which outputs:
`13 @ 14 = 70`
Try the test cases [online](http://ideone.com/MaJPpL)!
[Answer]
# J, 14 bytes
```
*/(~://.@)&.#:
```
Usage:
```
   5 (*/(~://.@)&.#:) 17     NB. enclosing brackets are optional
85
```
Explanation (reading mostly from right to left; `u` and `v` stand for arbitrary functions):
* `u&.#:` applies `u` to the vectors of the binary representations of the input numbers then turn the result back to an integer (`u&.v == v_inverse(u(v(input_1), v(input_2)))`)
* `*/` products (`*`) of inputs in the Descartes product (`/`) of the two binary vector
* `v(u@)` apply `u` to `v` (to the Descartes product)
* `u/.` apply `u` to every anti-diagonal of the Descartes product (anti-diagonals represent the 1st, 2nd, ... digits in the binary representation)
* `~:/` reduce (`/`) an anti-diagonal with XOR operation (`~:`)
* The last step is generating an integer from the binary vector which the first point takes care of.
[Try it online here.](http://tryj.tk/)
[Answer]
# CJam, ~~14~~ 13 bytes
```
q~2bf*{\2*^}*
```
**How it works**:
We first get the long multiplication results and then work our way up starting from the bottom two pairs.
```
q~                e# Eval the input. This puts the two numbers on stack
  2b              e# Convert the second number to binary
    f*            e# Multiply each bit of second number with the first number
                  e# This leaves an array with the candidates to be added in the long
                  e# multiplication step
      {    }*     e# Reduce on these candidates. Starting from the bottom
       \2*        e# Bit shift the lower candidate
          ^       e# XOR each other and continue
```
[Try it online here](http://cjam.aditsu.net/#code=q%7E2bf*%7B%5C1m%3C%5E%7D*&input=14%2013)
[Answer]
# Python 2, 35 bytes
```
f=lambda m,n:n and n%2*m^f(2*m,n/2)
```
Call like `f(13, 14)`. I think most languages with a similar construct will converge on something like this.
[Answer]
# Java, 62
```
(x,y)->{int r=0,i=0;for(;i<32;)r^=x*((y>>i)%2)<<i++;return r;}
```
## Expanded
```
class XORMultiplication {
    public static void main(String[] args) {
        IntBinaryOperator f = (x, y) -> {
                    int r = 0, i = 0;
                    for (; i < 32;) {
                        r ^= x * ((y >> i) % 2) << i++;
                    }
                    return r;
                };
        System.out.println(f.applyAsInt(14, 13));
    }
}
```
[Answer]
## Perl - 35 Bytes
```
#!perl -p
$\^=$`>>$_&1&&$'<<$_ for-/ /..31}{
```
Counting the command line option as one. Input is taken from `STDIN`, space separated.
**Sample usage:**
```
$ echo 13 11 | perl xormul.pl
127
$ echo 5 17 | perl xormul.pl
85
$ echo 14 13 | perl xormul.pl
70
$ echo 19 1 | perl xormul.pl
19
$ echo 63 63 | perl xormul.pl
1365
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 12 bytes
```
BJ’2*U×B{×^/
```
[Try it online!](https://tio.run/##DcwxDsIwEATA/l6xLTTx@fAZFzQp00NJR4PyAUSD@ETEC5AiKgQSER1@ifMRc91qtLvHQ9@fam27@XLzy20e2nMe9k0t31f5POfrY/d7l2nc5HuzqNWB4Yjh4SnBWVYTJYEgkEcAO4pIUCEWMIN9JNOIdSBewTDaQbIVJ1KxopmGPw "Jelly – Try It Online")
## How it works
```
BJ’2*U×B{×^/ - Main link. Takes a on the left, b on the right
B            - Binary representation of a
 J           - Replace each element with its index
  ’          - Decrement
   2*        - Raise each to the power 2
     U       - Reverse
       B{    - Yield the binary representation of a
      ×      - Multiply the bits by the powers
         ×   - Multiply b by the results
          ^/ - Reduce by XOR
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~7~~ 6 bytes
```
Bæc/ḂḄ
```
[Try it online!](https://tio.run/##DcwxCgIxEAXQfk7xWysziZmY1kMI1mIjewFLF0HwIBZiJStEtHLBe8xeZJzu8/j/73dddzBbjdftXFuv7WT6Hr5PbY/11N/1dZuOn/H8u8w2ZgGMQIyISBXBs7gIJSRkisjgQAUVkogTmMGxkGvBMhMv4Fj8oPqKK0nyopvkPw "Jelly – Try It Online")
*-1 thanks to Jonathan Allan*
Takes a list of `[a, b]`. (The dyadic equivalent is the very fun-looking `BæcḂḄɓB`.)
```
B         Convert a and b to their binary digits,
 æc/      and convolve them.
    Ḃ     Take each mod 2
     Ḅ    and convert from binary.
```
[Answer]
# Haskell, 50 bytes
```
import Data.Bits
_#0=0
a#b=b.&.1*a`xor`2*a#div b 2
```
A translation of @BrainSteel's C answer. Usage example:
```
map (uncurry (#)) [(0,1),(1,2),(9,0),(6,1),(3,3),(2,5),(7,9),(13,11),(5,17),(14,13),(19,1),(63,63)]
[0,2,0,6,5,10,63,127,85,70,19,1365]
```
[Answer]
# Julia, ~~35~~ ~~33~~ 30 bytes
```
f(a,b)=b%2*a$(b>0&&f(2a,b÷2))
```
This creates a recursive function `f` which takes two integers and returns the XOR product of the inputs.
Ungolfed:
```
function f(a, b)
    # Bitwise XOR : $
    # Short-circuit AND : &&
    b % 2 * a $ (b > 0 && f(2a, b ÷ 2))
end
```
Saved a couple bytes with encouragement from Sp3000!
[Answer]
# MMIX, 28 bytes (7 instrs)
(jelly xxd)
```
00000000: e3020000 7aff0001 c60202ff 3f000001  ẉ£¡¡z”¡¢İ££”?¡¡¢
00000010: 37010101 5b00fffc f8030000           7¢¢¢[¡”‘ẏ¤¡¡
```
Disassembly:
```
clmul   SETL $2,0       // r = 0
0H      ZSOD $255,$0,$1 // loop: t = a odd? b : 0
        XOR  $2,$2,$255 // r ^= t
        SRU  $0,$0,1    // a >>= 1
        SLU  $1,$1,1    // b <<= 1
        PBNZ $0,0B      // iflikely(a) goto loop
        POP  3,0        // return r
```
You could get a 128-bit answer out of this with about three more instructions, I think.
[Answer]
# Python 2, ~~104~~ ~~91~~ ~~78~~ 66 bytes
```
def y(a,b,c=0):
 for _ in bin(b)[:1:-1]:c^=int(_)*a;a<<=1
 print c
```
Take the bits of `b` in reverse order, ending before you hit the `'0b'` at the start of the string. Multiply each one by `a` and `xor` with the total, then left-shift `a`. Then print the total.
[Answer]
# Mathematica, 40 bytes
```
BitXor@@(#2BitAnd[#,2^Range[0,Log2@#]])&
```
[Answer]
# Go, 63 bytes
```
func f(a,b uint)uint{if a<1{return 0};return a%2*b^f(a/2,b*2)}
```
Complete example:
<http://play.golang.org/p/-ngNOnJGyM>
[Answer]
# [GAP](http://gap-system.org), 368 Bytes
> 
> For mathematicians, this is multiplication in the polynomial ring F\_2[x], identifying polynomials with natural numbers by evaluating at x=2 as a polynomial over Z.
> 
> 
> 
Sure, let's do that! (this is only loosly golfed, the point was more to move into F2[x] and do the calculations more than any attempt at being a winning entry)
Here's the code 
```
f:=function(i,j)R:=PolynomialRing(GF(2));x:=IndeterminatesOfPolynomialRing(R);x:=x[1];a:=function(i)local n,r;r:=0*x;while not i=0 do n:=0;while 2^n<=i do n:=n+1;od;n:=n-1;r:=r+x^n;i:=i-2^n;od;return r;end;b:=function(r)local c,i,n;i:=0;n:=0;for c in CoefficientsOfUnivariatePolynomial(r) do if c=Z(2)^0 then n:=n+2^i;fi;i:=i+1;od;return n;end;return b(a(i)*a(j));end;
```
Here's the ungolfed code with explanation:
```
xor_multiplication:=function(i,j)           
    R:=PolynomialRing(GF(2));
    x:=IndeterminatesOfPolynomialRing(R);
    x:=x[1];
    to_ring:=function(i)
        local n,r; 
        r:=0*x;
        while not i=0 do
            n:=0;
            while 2^n<=i do
                n:=n+1;
            od;
            n:=n-1;
            r:=r+x^n;
            i:=i-2^n;
        od;
        return r;
    end;
    to_ints:=function(r)
        local c,i,n;
        i:=0;n:=0;
        for c in CoefficientsOfUnivariatePolynomial(r) do
            if c=Z(2)^0 then
                n:=n+2^i;
            fi;
            i:=i+1;
        od;
        return n;
    end;
    return to_ints( to_ring(i)*to_ring(j));
end;
```
Okay, so first off, we create the univariate polynomial ring over the field F2 and call it `R`. Note that `GF(2)` is F2 in GAP.
```
R:=PolynomialRing(GF(2));
```
Next, we are going to assign the GAP variable `x` to the indeterminate of the ring `R`. Now, whenever I say `x` in GAP, the system will know I am talking about the indeterminate of the ring `R`. 
```
x:=IndeterminatesOfPolynomialRing(R);
x:=x[1];
```
Next, we have two functions, which are inverse maps of each other. These maps are both onto, but they are not structure preserving, so I couldn't figure out a better way to implement them in GAP. There almost certainly is a better way, if you know it, please comment!
The first map, `to_ring` takes an integer and maps it to its corresponding ring element. It does this by using a conversion to binary algorithm, where every `1` that would appear in binary is replaced by an `x^n` where `n` is the appropriate power that 2 would take if the number was indeed binary. 
```
    to_ring:=function(i)
        local n,r; 
        r:=0*x;                 # initiate r to the zero element of R
        while not i=0 do        # this is a modified binary algorithm
            n:=0;
            while 2^n<=i do
                n:=n+1;
            od;
            n:=n-1;
            r:=r+x^n;
            i:=i-2^n;
        od;
        return r;
    end;
```
The next function reverses this. `to_ints` takes a ring element and maps it to its corresponding integer. I do this by getting a list of the coefficients of the polynomial and for each nonzero coefficient, the result is increased by 2^n, in the same way that we would convert binary to decimal. 
```
    to_ints:=function(r)
        local c,i,n;
        i:=0;n:=0;
        for c in CoefficientsOfUnivariatePolynomial(r) do
            if c=Z(2)^0 then          
                 # ^-- Right here you'll notice that the Z(2) is basically '1' in GF(2). So Z(2)^0 ~ 1 and Z(2)*0 ~ 0  
                 # effectively, this line checks for nonzero coefficients
                n:=n+2^i;
            fi;
            i:=i+1;
        od;
        return n;
    end;
```
For the final step, we call these functions. We take the two integer inputs, convert them into elements in the ring `R`, then multiply these elements together, and send the product back to the integers. 
```
return to_ints( to_ring(i)*to_ring(j));
```
[Answer]
# ARM Thumb-2 (NEON), 6 bytes
Eat my Thumb, `pclmullqlqdqdqdqdq`. ARM has boring builtins, too!
```
ef80 0e01 4770
```
Assembly code:
```
        .syntax unified
        .arch armv7-a
        .fpu neon
        .thumb
        .globl xormul_boring_neon
        .thumb_func
xormul_boring_neon:
        // q0[0-8] = d0[0-8] @ d1[0-8]
        vmull.p8 q0, d0, d1
        bx       lr
```
Input: two 8-bit values in `d0` and `d1`
Output: the 16-bit product in `q0`
This actually multiplies 8 packed bytes together.
# ARM Thumb-2, manual, 14 bytes
Ok, to make up for it, here is a fully scalar version which does a 32x32 multiply with a 32-bit result.
```
2300 0849 bf28 4043 0040 d1fa 4770
```
Assembly code:
```
        .syntax unified
        .arch armv6t2
        .thumb
        .globl xormul_scalar
        .thumb_func
        // r3 <- r0 @ r1
xormul_scalar:
        // acc <- 0
        movs    r3, #0
.Lloop:
        // test each bit in y by using lsrs carry-out
        lsrs    r1, r1, #1
        // was the bit set?
        it      cs
        // if so, acc ^= x
        eorcs   r3, r0
        // shift x left
        lsls    r0, r0, #1
        // loop while x is non zero
        bne     .Lloop
.Lend:
        // return in r3
        bx      lr
```
Equivalent C code:
```
uint32_t xormul_scalar(uint32_t x, uint32_t y)
{
    uint32_t acc = 0;
    do {
        if (y & 1)
            acc ^= x;
        y >>= 1;
    } while ((x <<= 1));
    return acc;
}
```
The numbers to be multiplied are in `r0` and `r1`, and the result is in `r3`.
It is a fairly basic shift and xor loop.
Yet another case of `lsls` and `lsrs` being far too useful than they deserve to be.
[Try it online! (sorta)](https://travis-ci.com/github/easyaspi314/easyaspi-ppcg/jobs/478593577#L439): demo in Travis
[Answer]
# Jelly, 16 bytes
```
Ḥ⁴BL’¤Ð¡U×"⁴B¤^/
```
[Try it online!](http://jelly.tryitonline.net/#code=4bik4oG0QkzigJnCpMOQwqFVw5ci4oG0QsKkXi8&input=&args=MTM+MTE)
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 8 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
Îbv·yI*^
```
[Try it online](https://tio.run/##yy9OTMpM/f//cF9S2aHtlZ5acf//G5pwGRoDAA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfWVC6H@D4qSyQ9srI7Ti/tfq/I@ONtAxjNWJNtQxApKWOgZA0gwsYqxjDCSNdEyBpLmOJUiNsY4hSMZUx9AcxDXRMQQpMbQEqzcz1jEzjo0FAA).
**Explanation:**
```
Î         # Push 0 and the first input
 b        # Convert it to a binary string
  v       # Loop over each bit `y` of this string:
   ·      #  Double the current integer
    y     #  Push bit `y`
     I*   #  Multiply it by the second input
       ^  #  Bitwise-XOR the two together
          # (after the loop, the result is output implicitly)
```
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/) v13.3+, 38 bytes
```
(F=2~FiniteField~+##;F@#2F@#)@"Index"&
```
Input `[a, b]`.
[Version 13.3](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn133#107245402) introduced [`FiniteField`](https://reference.wolfram.com/language/ref/FiniteField.html), which is nicer to golf with than [`FiniteFields`GF`](https://reference.wolfram.com/language/FiniteFields/ref/GF.html). Getting an integer out of a `FiniteFieldElement` is still a little verbose, though.
[![test cases](https://i.stack.imgur.com/m82r2.png)](https://i.stack.imgur.com/m82r2.png)
[Answer]
## Ruby, ~~76~~ ~~75~~ 73 bytes
```
a,b=$*.map{|x|x.to_i}
o=0
while(b>0)
o^=a&-(b&1)
a<<=1
b>>=1
end
puts(o)
```
# Ruby, 60 bytes (function only, no I/O)
```
def t(a,b)
o=0
while(b>0)
o^=a&-(b&1)
a<<=1
b>>=1
end
t
end
```
[Answer]
## Dart, ~~34~~ 32 bytes
```
m(a,b)=>a<1?0:a%2*b^m(a~/2,b*2);
```
Straight-forward recursive implementation.
[Answer]
# gnuplot, 29 bytes
```
m(a,b)=a<1?0:a%2*b^m(a/2,b*2)   
```
just like in Dart (see above)
[Answer]
# GNU Assembler(x86\_64 Mac OS X), 97 bytes
This is a proper function that can be called from C:
```
.text
.globl _f
_f:
movq %rdi,%xmm0;movq %rsi,%xmm1;pclmulqdq $0,%xmm1,%xmm0;movq %xmm0,%rax;ret
```
& can be tested with this C program:
```
#include <stdio.h>
int f(int a, int b);
#define p(a,b) printf("%d %d %d\n", a, b, f(a, b))
int main(void)
{
    p(0,1);
    p(1,2);
    p(9,0);
    p(6,1);
    p(3,3);
    p(2,5);
    p(7,9);
    p(13,11);
    p(5,17);
    p(14,13);
    p(19,1);
    p(63,63);
}
```
Note that on Mac OS X, you have to use `clang -x c` to compile it as C & not C++.
For linux(if I remember right), the code would be 95 bytes:
```
.text
.globl f
f:
movq %rdi,%xmm0;movq %rsi,%xmm1;pclmulqdq $0,%xmm1,%xmm0;movq %xmm0,%rax;ret
```
Strangely enough, this version is actually longer than defining the function in inline assembly, but that one was longer than the pure C solution we already have, so I decided to try assembly.
### edit
If it's counted by the assembled size(excluding any labels &c.), then it's
# x86\_64 Assembler, 22 bytes:
```
0:  66 48 0f 6e c7          movq         %rdi,  %xmm0
5:  66 48 0f 6e ce          movq         %rsi,  %xmm1
a:  66 0f 3a 44 c1 00       pclmullqlqdq $0,    %xmm1,%xmm0
10: 66 48 0f 7e c0          movq         %xmm0, %rax
15: c3                      ret
```
[Answer]
# [R](https://www.r-project.org/), 53 bytes
```
f=function(x,y)`if`(y,bitwXor(x*y%%2,2*f(x,y%/%2)),0)
```
[Try it online!](https://tio.run/##bY/LCsIwEEX38xVFKGTkgibRlgr9D0FEY2ghEB80EZuvr7YV3Lg6cOfMZaYbrOm65JsQTtenj@7hUz20dfu82ejuN9Ej8dm1Z5FwcfG1v3eiX6Y8V1DLdpzmq1wxY81/mkSFkomsiWJBxvssNiFm1oQm7IgWTME8Rs27EAVZsYZkfCihJlaf2pHFN9fQExW2E0tUs68hZ2MLWc7RBnKWZfXdLjQKzcT4Pcd/bu4P8oj@oI7MNLwB "R – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 29 bytes
```
f=(x,y)=>x&&f(x>>1,y)*2^x%2*y
```
[Try it online!](https://tio.run/##RczNCoJAEADg@zzFXBJXTHZ2c01ifZEyVkzDMJWU2J7eRgg6zN/HzDyqdzXXr25a9sN4a9a1taGPP8IWPgja0BcF8RSpq9@p6LOenERCCYQKFeQouTcsBjRqTEFhiiQhwxyNBtJIhKQyYM3wmAIdkDHjBzlfUQ5G8yKbSV0yT323uMvgkmc1hd4WHP6n6OJ6HOaxb5J@vIf@LMvYn6mMF9v@J8FZbWa3KoRYvw "JavaScript (Node.js) – Try It Online")
Similar to <https://codegolf.stackexchange.com/a/50246/>
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 9 bytes
```
₌0b(dn⁰*꘍
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJBIiwiIiwi4oKMMGIoZG7igbAq6piNIiwiIiwiMTMsIDE0XG4wLCAxXG4xLCAyXG4xMywgMTFcbjE5LCAxXG42MywgNjNcbjIsIDUiXQ==)
Ports the 05AB1E answer, so go upvote that too
## Explained
```
₌0b(dn⁰*꘍
₌0b       # Push 0 and the binary of the first input
   (      # to each bit:
    d     # double the top of the stack
     n⁰*  # multiply the bit by the second input
        ꘍ # and bit xor
```
[Answer]
# [Pyt](https://github.com/mudkip201/pyt), 37 bytes
```
ɓąƖĐŁř⁻↔2⇹^**ĐŁ2%¬?ŕ:ŕÁ0á;ĐŁ`ŕʁ⊻ĐŁ⁻łŕ
```
[Try it online!](https://tio.run/##K6gs@f//5OQjrcemHZlwtPHozEeNux@1TTF61L4zTksLJGSkemiN/dGpVkenHm40OLzQGiSWcHTqqcZHXbtBbKCGo01Hp/7/b2jCZWgMAA "Pyt – Try It Online")
Takes two integers a,b on separate lines
The following is worked on a=13, b=14
| Code | Stack | Description |
| --- | --- | --- |
| ɓąƖ | [1,1,0,1] | Pushes the **ą**rray corresponding to the **ɓ**its of 13 |
| ĐŁř⁻↔2⇹^\* | [8,4,0,1] | Converts array to corresponding powers of 2 |
| \* | [112,56,0,14] | Multiplies the array by 14 |
| ĐŁ2%¬? | [112,56,0,14], True | does the array have an even length? |
| ŕ | [112,56,0,14] | If so, pop the boolean check |
| :ŕÁ0á | (skipped in this run) | Otherwise, append a 0 to the array |
| ;ĐŁ`ŕʁ⊻ĐŁ⁻ł | [70], 0 | **ʁ**educe the array using XOR (**⊻**) while the **Ł**ength of the resulting array is greater than 1 |
| ŕ | [70] | **ŕ**emove the 0; implicit print |
 ]