long mp_toom_mul(unsigned short *rop, unsigned short *op1, unsigned short *op2,
                 unsigned long len1, unsigned long len2) {
  long size, xsize, i;
  unsigned long value;
  unsigned short carry;
  unsigned long x;
  unsigned long l1, l2;
  unsigned long al, bl, cl, dl, el, Ul[3], Vl[3];
  unsigned short *a, *b, *c, *d, *e, *U[3], *V[3];
  x = (len1 + len2 + 4) / 6;
  l1 = len1 - (x << 1);
  l2 = len2 - (x << 1);
  U[0] = mp_malloc(sizeof(unsigned short) * (x + 2));
  V[0] = mp_malloc(sizeof(unsigned short) * (x + 2));
  U[1] = mp_malloc(sizeof(unsigned short) * (x + 1));
  V[1] = mp_malloc(sizeof(unsigned short) * (x + 1));
  U[2] = mp_malloc(sizeof(unsigned short) * (x + 2));
  V[2] = mp_malloc(sizeof(unsigned short) * (x + 2));
  Ul[1] = mp_lshift(U[1], op1 + x, x, 1);
  Ul[0] = mp_lshift(U[0], op1, x, 2);
  Ul[0] = mp_add(U[0], U[0], U[1], Ul[0], Ul[1]);
  Ul[0] = mp_add(U[0], U[0], op1 + x + x, Ul[0], l1);
  Ul[2] = mp_lshift(U[2], op1 + x + x, l1, 2);
  Ul[2] = mp_add(U[2], U[2], U[1], Ul[2], Ul[1]);
  Ul[2] = mp_add(U[2], U[2], op1, Ul[2], x);
  Ul[1] = mp_add(U[1], op1, op1 + x, x, x);
  Ul[1] = mp_add(U[1], U[1], op1 + x + x, Ul[1], l1);
  Vl[1] = mp_lshift(V[1], op2 + x, x, 1);
  Vl[0] = mp_lshift(V[0], op2, x, 2);
  Vl[0] = mp_add(V[0], V[0], V[1], Vl[0], Vl[1]);
  Vl[0] = mp_add(V[0], V[0], op2 + x + x, Vl[0], l2);
  Vl[2] = mp_lshift(V[2], op2 + x + x, l2, 2);
  Vl[2] = mp_add(V[2], V[2], V[1], Vl[2], Vl[1]);
  Vl[2] = mp_add(V[2], V[2], op2, Vl[2], x);
  Vl[1] = mp_add(V[1], op2, op2 + x, x, x);
  Vl[1] = mp_add(V[1], V[1], op2 + x + x, Vl[1], l2);
  b = mp_calloc(1, sizeof(unsigned short) * (Ul[0] * Vl[0]));
  bl = mp_mul(b, U[0], V[0], Ul[0], Vl[0]);
  mp_free(U[0]);
  mp_free(V[0]);
  c = mp_calloc(1, sizeof(unsigned short) * (Ul[1] * Vl[1]));
  cl = mp_mul(c, U[1], V[1], Ul[1], Vl[1]);
  mp_free(U[1]);
  mp_free(V[1]);
  d = mp_calloc(1, sizeof(unsigned short) * (Ul[2] * Vl[2]));
  dl = mp_mul(d, U[2], V[2], Ul[2], Vl[2]);
  mp_free(U[2]);
  mp_free(V[2]);
  a = mp_calloc(1, sizeof(unsigned short) * (x + x));
  al = mp_mul(a, op1, op2, x, x);
  e = mp_calloc(1, sizeof(unsigned short) * (l1 + l2));
  el = mp_mul(e, op1 + x + x, op2 + x + x, l1, l2);
  size = mp_lshift(rop, a, al, 4);
  bl = mp_sub(b, b, rop, bl, size);
  bl = mp_sub(b, b, e, bl, el);
  cl = mp_sub(c, c, a, cl, al);
  cl = mp_sub(c, c, e, cl, el);
  dl = mp_sub(d, d, a, dl, al);
  size = mp_lshift(rop, e, el, 4);
  dl = mp_sub(d, d, rop, dl, size);
  size = mp_add(rop, b, d, bl, dl);
  xsize = mp_lshift(rop + size, c, cl, 3);
  size = mp_sub(rop, rop, rop + size, size, xsize);
  xsize = mp_lshift(rop + size, c, cl, 1);
  size = mp_sub(rop, rop + size, rop, xsize, size);
  bl = mp_rshift(b, b, bl, 1);
  bl = mp_sub(b, b, c, bl, cl);
  cl = mp_rshift(c, rop, size, 1);
  bl = mp_sub(b, b, c, bl, cl);
  i = bl - 1;
  value = b[i];
  b[i] = value / 3;
  for (--i; i >= 0; i--) {
    carry = value % 3;
    value = ((unsigned long)carry << 16) + b[i];
    b[i] = (unsigned short)(value / 3);
  }
  dl = mp_rshift(d, d, dl, 1);
  dl = mp_sub(d, d, b, dl, bl);
  dl = mp_sub(d, d, rop, dl, size);
  dl = mp_rshift(d, d, dl, 2);
  memset(rop, '\0', sizeof(unsigned short) * (len1 + len2));
  i = x * 4;
  xsize = (len1 + len2) - i;
  size = mp_add(rop + i, rop + i, e, xsize, el) + i;
  i = x * 3;
  xsize = size - i;
  size = mp_add(rop + i, rop + i, d, xsize, dl) + i;
  i = x * 2;
  xsize = size - i;
  size = mp_add(rop + i, rop + i, c, xsize, cl) + i;
  i = x;
  xsize = size - i;
  size = mp_add(rop + i, rop + i, b, xsize, bl) + i;
  size = mp_add(rop, rop, a, size, al);
  mp_free(e);
  mp_free(d);
  mp_free(c);
  mp_free(b);
  mp_free(a);
  if (size > 1 && rop[size - 1] == 0)
    --size;
  return (size);
}


x86 assembly (clang, -O0):
<mp_toom_mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
add    $0x4,%rax
mov    $0x6,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x58(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x58(%rbp),%rcx
shl    $0x1,%rcx
sub    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%rcx
shl    $0x1,%rcx
sub    %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x58(%rbp),%rdi
add    $0x2,%rdi
shl    $0x1,%rdi
mov    $0x0,%al
call   10a0 <mp_malloc@plt>
cltq
mov    %rax,-0x110(%rbp)
mov    -0x58(%rbp),%rdi
add    $0x2,%rdi
shl    $0x1,%rdi
mov    $0x0,%al
call   10a0 <mp_malloc@plt>
cltq
mov    %rax,-0x130(%rbp)
mov    -0x58(%rbp),%rdi
add    $0x1,%rdi
shl    $0x1,%rdi
mov    $0x0,%al
call   10a0 <mp_malloc@plt>
cltq
mov    %rax,-0x108(%rbp)
mov    -0x58(%rbp),%rdi
add    $0x1,%rdi
shl    $0x1,%rdi
mov    $0x0,%al
call   10a0 <mp_malloc@plt>
cltq
mov    %rax,-0x128(%rbp)
mov    -0x58(%rbp),%rdi
add    $0x2,%rdi
shl    $0x1,%rdi
mov    $0x0,%al
call   10a0 <mp_malloc@plt>
cltq
mov    %rax,-0x100(%rbp)
mov    -0x58(%rbp),%rdi
add    $0x2,%rdi
shl    $0x1,%rdi
mov    $0x0,%al
call   10a0 <mp_malloc@plt>
cltq
mov    %rax,-0x120(%rbp)
mov    -0x108(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0x58(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x0,%al
call   1090 <mp_lshift@plt>
cltq
mov    %rax,-0xa8(%rbp)
mov    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    $0x2,%ecx
mov    $0x0,%al
call   1090 <mp_lshift@plt>
cltq
mov    %rax,-0xb0(%rbp)
mov    -0x110(%rbp),%rdi
mov    -0x110(%rbp),%rsi
mov    -0x108(%rbp),%rdx
mov    -0xb0(%rbp),%rcx
mov    -0xa8(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
mov    %rax,-0xb0(%rbp)
mov    -0x110(%rbp),%rdi
mov    -0x110(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdx
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdx
mov    -0xb0(%rbp),%rcx
mov    -0x60(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
mov    %rax,-0xb0(%rbp)
mov    -0x100(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0x60(%rbp),%rdx
mov    $0x2,%ecx
mov    $0x0,%al
call   1090 <mp_lshift@plt>
cltq
mov    %rax,-0xa0(%rbp)
mov    -0x100(%rbp),%rdi
mov    -0x100(%rbp),%rsi
mov    -0x108(%rbp),%rdx
mov    -0xa0(%rbp),%rcx
mov    -0xa8(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
mov    %rax,-0xa0(%rbp)
mov    -0x100(%rbp),%rdi
mov    -0x100(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0xa0(%rbp),%rcx
mov    -0x58(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
mov    %rax,-0xa0(%rbp)
mov    -0x108(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdx
mov    -0x58(%rbp),%rcx
mov    -0x58(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
mov    %rax,-0xa8(%rbp)
mov    -0x108(%rbp),%rdi
mov    -0x108(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdx
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdx
mov    -0xa8(%rbp),%rcx
mov    -0x60(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
mov    %rax,-0xa8(%rbp)
mov    -0x128(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0x58(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x0,%al
call   1090 <mp_lshift@plt>
cltq
mov    %rax,-0xc8(%rbp)
mov    -0x130(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    $0x2,%ecx
mov    $0x0,%al
call   1090 <mp_lshift@plt>
cltq
mov    %rax,-0xd0(%rbp)
mov    -0x130(%rbp),%rdi
mov    -0x130(%rbp),%rsi
mov    -0x128(%rbp),%rdx
mov    -0xd0(%rbp),%rcx
mov    -0xc8(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
mov    %rax,-0xd0(%rbp)
mov    -0x130(%rbp),%rdi
mov    -0x130(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdx
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdx
mov    -0xd0(%rbp),%rcx
mov    -0x68(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
mov    %rax,-0xd0(%rbp)
mov    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0x68(%rbp),%rdx
mov    $0x2,%ecx
mov    $0x0,%al
call   1090 <mp_lshift@plt>
cltq
mov    %rax,-0xc0(%rbp)
mov    -0x120(%rbp),%rdi
mov    -0x120(%rbp),%rsi
mov    -0x128(%rbp),%rdx
mov    -0xc0(%rbp),%rcx
mov    -0xc8(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
mov    %rax,-0xc0(%rbp)
mov    -0x120(%rbp),%rdi
mov    -0x120(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0xc0(%rbp),%rcx
mov    -0x58(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
mov    %rax,-0xc0(%rbp)
mov    -0x128(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdx
mov    -0x58(%rbp),%rcx
mov    -0x58(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
mov    %rax,-0xc8(%rbp)
mov    -0x128(%rbp),%rdi
mov    -0x128(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdx
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdx
mov    -0xc8(%rbp),%rcx
mov    -0x68(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
mov    %rax,-0xc8(%rbp)
mov    -0xb0(%rbp),%rsi
imul   -0xd0(%rbp),%rsi
ff
shl    $0x1,%rsi
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <mp_calloc@plt>
cltq
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rdi
mov    -0x110(%rbp),%rsi
mov    -0x130(%rbp),%rdx
mov    -0xb0(%rbp),%rcx
mov    -0xd0(%rbp),%r8
mov    $0x0,%al
call   10b0 <mp_mul@plt>
cltq
mov    %rax,-0x78(%rbp)
mov    -0x110(%rbp),%rdi
mov    $0x0,%al
call   1080 <mp_free@plt>
mov    -0x130(%rbp),%rdi
mov    $0x0,%al
call   1080 <mp_free@plt>
mov    -0xa8(%rbp),%rsi
imul   -0xc8(%rbp),%rsi
ff
shl    $0x1,%rsi
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <mp_calloc@plt>
cltq
mov    %rax,-0xe8(%rbp)
mov    -0xe8(%rbp),%rdi
mov    -0x108(%rbp),%rsi
mov    -0x128(%rbp),%rdx
mov    -0xa8(%rbp),%rcx
mov    -0xc8(%rbp),%r8
mov    $0x0,%al
call   10b0 <mp_mul@plt>
cltq
mov    %rax,-0x80(%rbp)
mov    -0x108(%rbp),%rdi
mov    $0x0,%al
call   1080 <mp_free@plt>
mov    -0x128(%rbp),%rdi
mov    $0x0,%al
call   1080 <mp_free@plt>
mov    -0xa0(%rbp),%rsi
imul   -0xc0(%rbp),%rsi
ff
shl    $0x1,%rsi
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <mp_calloc@plt>
cltq
mov    %rax,-0xf0(%rbp)
mov    -0xf0(%rbp),%rdi
mov    -0x100(%rbp),%rsi
mov    -0x120(%rbp),%rdx
mov    -0xa0(%rbp),%rcx
mov    -0xc0(%rbp),%r8
mov    $0x0,%al
call   10b0 <mp_mul@plt>
cltq
mov    %rax,-0x88(%rbp)
mov    -0x100(%rbp),%rdi
mov    $0x0,%al
call   1080 <mp_free@plt>
mov    -0x120(%rbp),%rdi
mov    $0x0,%al
call   1080 <mp_free@plt>
mov    -0x58(%rbp),%rsi
add    -0x58(%rbp),%rsi
shl    $0x1,%rsi
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <mp_calloc@plt>
cltq
mov    %rax,-0xd8(%rbp)
mov    -0xd8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x58(%rbp),%r8
mov    $0x0,%al
call   10b0 <mp_mul@plt>
cltq
mov    %rax,-0x70(%rbp)
mov    -0x60(%rbp),%rsi
add    -0x68(%rbp),%rsi
shl    $0x1,%rsi
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <mp_calloc@plt>
cltq
mov    %rax,-0xf8(%rbp)
mov    -0xf8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdx
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdx
mov    -0x60(%rbp),%rcx
mov    -0x68(%rbp),%r8
mov    $0x0,%al
call   10b0 <mp_mul@plt>
cltq
mov    %rax,-0x90(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xd8(%rbp),%rsi
mov    -0x70(%rbp),%rdx
mov    $0x4,%ecx
mov    $0x0,%al
call   1090 <mp_lshift@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0xe0(%rbp),%rdi
mov    -0xe0(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x78(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    $0x0,%al
call   1070 <mp_sub@plt>
cltq
mov    %rax,-0x78(%rbp)
mov    -0xe0(%rbp),%rdi
mov    -0xe0(%rbp),%rsi
mov    -0xf8(%rbp),%rdx
mov    -0x78(%rbp),%rcx
mov    -0x90(%rbp),%r8
mov    $0x0,%al
call   1070 <mp_sub@plt>
cltq
mov    %rax,-0x78(%rbp)
mov    -0xe8(%rbp),%rdi
mov    -0xe8(%rbp),%rsi
mov    -0xd8(%rbp),%rdx
mov    -0x80(%rbp),%rcx
mov    -0x70(%rbp),%r8
mov    $0x0,%al
call   1070 <mp_sub@plt>
cltq
mov    %rax,-0x80(%rbp)
mov    -0xe8(%rbp),%rdi
mov    -0xe8(%rbp),%rsi
mov    -0xf8(%rbp),%rdx
mov    -0x80(%rbp),%rcx
mov    -0x90(%rbp),%r8
mov    $0x0,%al
call   1070 <mp_sub@plt>
cltq
mov    %rax,-0x80(%rbp)
mov    -0xf0(%rbp),%rdi
mov    -0xf0(%rbp),%rsi
mov    -0xd8(%rbp),%rdx
mov    -0x88(%rbp),%rcx
mov    -0x70(%rbp),%r8
mov    $0x0,%al
call   1070 <mp_sub@plt>
cltq
mov    %rax,-0x88(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xf8(%rbp),%rsi
mov    -0x90(%rbp),%rdx
mov    $0x4,%ecx
mov    $0x0,%al
call   1090 <mp_lshift@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0xf0(%rbp),%rdi
mov    -0xf0(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x88(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    $0x0,%al
call   1070 <mp_sub@plt>
cltq
mov    %rax,-0x88(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xe0(%rbp),%rsi
mov    -0xf0(%rbp),%rdx
mov    -0x78(%rbp),%rcx
mov    -0x88(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdi
mov    -0xe8(%rbp),%rsi
mov    -0x80(%rbp),%rdx
mov    $0x3,%ecx
mov    $0x0,%al
call   1090 <mp_lshift@plt>
cltq
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x30(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    $0x0,%al
call   1070 <mp_sub@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdi
mov    -0xe8(%rbp),%rsi
mov    -0x80(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x0,%al
call   1090 <mp_lshift@plt>
cltq
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x30(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0x8(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    $0x0,%al
call   1070 <mp_sub@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0xe0(%rbp),%rdi
mov    -0xe0(%rbp),%rsi
mov    -0x78(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x0,%al
call   1030 <mp_rshift@plt>
cltq
mov    %rax,-0x78(%rbp)
mov    -0xe0(%rbp),%rdi
mov    -0xe0(%rbp),%rsi
mov    -0xe8(%rbp),%rdx
mov    -0x78(%rbp),%rcx
mov    -0x80(%rbp),%r8
mov    $0x0,%al
call   1070 <mp_sub@plt>
cltq
mov    %rax,-0x78(%rbp)
mov    -0xe8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x0,%al
call   1030 <mp_rshift@plt>
cltq
mov    %rax,-0x80(%rbp)
mov    -0xe0(%rbp),%rdi
mov    -0xe0(%rbp),%rsi
mov    -0xe8(%rbp),%rdx
mov    -0x78(%rbp),%rcx
mov    -0x80(%rbp),%r8
mov    $0x0,%al
call   1070 <mp_sub@plt>
cltq
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0xe0(%rbp),%rax
mov    -0x40(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
mov    %ax,%dx
mov    -0xe0(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x40(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jl     1bd9 <mp_toom_mul+0xa49>
mov    -0x48(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
mov    %dx,%ax
mov    %ax,-0x4a(%rbp)
movzwl -0x4a(%rbp),%eax
shl    $0x10,%rax
mov    -0xe0(%rbp),%rcx
mov    -0x40(%rbp),%rdx
movzwl (%rcx,%rdx,2),%ecx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
mov    %ax,%dx
mov    -0xe0(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x40(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x40(%rbp)
jmp    1b6a <mp_toom_mul+0x9da>
mov    -0xf0(%rbp),%rdi
mov    -0xf0(%rbp),%rsi
mov    -0x88(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x0,%al
call   1030 <mp_rshift@plt>
cltq
mov    %rax,-0x88(%rbp)
mov    -0xf0(%rbp),%rdi
mov    -0xf0(%rbp),%rsi
mov    -0xe0(%rbp),%rdx
mov    -0x88(%rbp),%rcx
mov    -0x78(%rbp),%r8
mov    $0x0,%al
call   1070 <mp_sub@plt>
cltq
mov    %rax,-0x88(%rbp)
mov    -0xf0(%rbp),%rdi
mov    -0xf0(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x88(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    $0x0,%al
call   1070 <mp_sub@plt>
cltq
mov    %rax,-0x88(%rbp)
mov    -0xf0(%rbp),%rdi
mov    -0xf0(%rbp),%rsi
mov    -0x88(%rbp),%rdx
mov    $0x2,%ecx
mov    $0x0,%al
call   1030 <mp_rshift@plt>
cltq
mov    %rax,-0x88(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
add    -0x28(%rbp),%rdx
shl    $0x1,%rdx
xor    %esi,%esi
call   1060 <memset@plt>
mov    -0x58(%rbp),%rax
shl    $0x2,%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
sub    -0x40(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x40(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x40(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0xf8(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x90(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
add    -0x40(%rbp),%rax
mov    %rax,-0x30(%rbp)
imul   $0x3,-0x58(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
sub    -0x40(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x40(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x40(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0xf0(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x88(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
add    -0x40(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x58(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
sub    -0x40(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x40(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x40(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0xe8(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x80(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
add    -0x40(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
sub    -0x40(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x40(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x40(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0xe0(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x78(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
add    -0x40(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xd8(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x70(%rbp),%r8
mov    $0x0,%al
call   1050 <mp_add@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0xf8(%rbp),%rdi
mov    $0x0,%al
call   1080 <mp_free@plt>
mov    -0xf0(%rbp),%rdi
mov    $0x0,%al
call   1080 <mp_free@plt>
mov    -0xe8(%rbp),%rdi
mov    $0x0,%al
call   1080 <mp_free@plt>
mov    -0xe0(%rbp),%rdi
mov    $0x0,%al
call   1080 <mp_free@plt>
mov    -0xd8(%rbp),%rdi
mov    $0x0,%al
call   1080 <mp_free@plt>
cmpq   $0x1,-0x30(%rbp)
jle    1e96 <mp_toom_mul+0xd06>
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
sub    $0x1,%rcx
movzwl (%rax,%rcx,2),%eax
cmp    $0x0,%eax
jne    1e96 <mp_toom_mul+0xd06>
mov    -0x30(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_toom_mul>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %rdx,0x8(%rsp)
mov    %rsi,%r14
mov    %rdi,0x80(%rsp)
lea    (%r8,%rcx,1),%rax
mov    %rax,0x98(%rsp)
lea    (%r8,%rcx,1),%rax
add    $0x4,%rax
mov    %rcx,%rsi
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
mov    %rdx,%r12
shr    $0x2,%r12
lea    (%r12,%r12,1),%rcx
sub    %rcx,%rsi
mov    %rsi,0x28(%rsp)
mov    %rcx,0xa0(%rsp)
sub    %rcx,%r8
mov    %r8,0x48(%rsp)
lea    (%r12,%r12,1),%rbx
add    $0x4,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <mp_malloc@plt>
movslq %eax,%r15
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <mp_malloc@plt>
cltq
mov    %rax,0x10(%rsp)
lea    (%r12,%r12,1),%rbp
add    $0x2,%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   10a0 <mp_malloc@plt>
movslq %eax,%r13
mov    %rbp,%rdi
xor    %eax,%eax
call   10a0 <mp_malloc@plt>
cltq
mov    %rax,0x38(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <mp_malloc@plt>
cltq
mov    %rax,(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <mp_malloc@plt>
cltq
mov    %rax,0x40(%rsp)
mov    %r14,0x30(%rsp)
lea    (%r14,%r12,2),%rsi
mov    %r13,%rbx
mov    %r13,%rdi
mov    %rsi,%r13
mov    %rsi,0x60(%rsp)
mov    %r12,%rdx
mov    $0x1,%ecx
xor    %eax,%eax
call   1090 <mp_lshift@plt>
movslq %eax,%rbp
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
mov    $0x2,%ecx
xor    %eax,%eax
call   1090 <mp_lshift@plt>
movslq %eax,%rcx
mov    %r15,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %rbp,%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
movslq %eax,%rcx
lea    0x0(,%r12,2),%rdx
add    %r13,%rdx
mov    %r15,0x18(%rsp)
mov    %r15,%rdi
mov    %r15,%rsi
mov    %rdx,%r15
mov    0x28(%rsp),%r14
mov    %r14,%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
cltq
mov    %rax,0x68(%rsp)
mov    (%rsp),%r13
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r15,0x20(%rsp)
mov    %r14,%rdx
mov    $0x2,%ecx
xor    %eax,%eax
call   1090 <mp_lshift@plt>
movslq %eax,%rcx
mov    %r13,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    %rbp,%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
movslq %eax,%rcx
mov    %r13,%rdi
mov    %r13,%rsi
mov    0x30(%rsp),%rbp
mov    %rbp,%rdx
mov    %r12,%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
cltq
mov    %rax,0x78(%rsp)
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    0x60(%rsp),%rdx
mov    %r12,%rcx
mov    %r12,%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
movslq %eax,%rcx
mov    %rbx,0x70(%rsp)
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
cltq
mov    %rax,0x90(%rsp)
mov    0x8(%rsp),%rbx
lea    (%rbx,%r12,2),%rsi
mov    0x38(%rsp),%r13
mov    %r13,%rdi
mov    %rsi,%r14
mov    %rsi,0x50(%rsp)
mov    %r12,%rdx
mov    $0x1,%ecx
xor    %eax,%eax
call   1090 <mp_lshift@plt>
movslq %eax,%r15
mov    %r15,0x58(%rsp)
mov    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    $0x2,%ecx
xor    %eax,%eax
call   1090 <mp_lshift@plt>
movslq %eax,%rcx
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    %r13,%rdx
mov    %r15,%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
movslq %eax,%rcx
lea    (%r14,%r12,2),%r15
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    0x48(%rsp),%r14
mov    %r14,%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
cltq
mov    %rax,0x88(%rsp)
mov    0x40(%rsp),%rbp
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r15,0x60(%rsp)
mov    %r14,%rdx
mov    $0x2,%ecx
xor    %eax,%eax
call   1090 <mp_lshift@plt>
movslq %eax,%rcx
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    %r13,%rdx
mov    0x58(%rsp),%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
movslq %eax,%rcx
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    0x8(%rsp),%rbx
mov    %rbx,%rdx
mov    %r12,%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
cltq
mov    %rax,0x58(%rsp)
mov    %r13,%rdi
mov    %rbx,%rsi
mov    0x50(%rsp),%rdx
mov    %r12,%rcx
mov    %r12,%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
movslq %eax,%rcx
mov    %r13,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
mov    %r14,%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
cltq
mov    %rax,0x50(%rsp)
mov    0x68(%rsp),%r15
mov    %r15,%rsi
mov    0x88(%rsp),%r14
imul   %r14,%rsi
add    %rsi,%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <mp_calloc@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
mov    0x18(%rsp),%rbp
mov    %rbp,%rsi
mov    0x10(%rsp),%r13
mov    %r13,%rdx
mov    %r15,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   10b0 <mp_mul@plt>
cltq
mov    %rax,0x68(%rsp)
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <mp_free@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1080 <mp_free@plt>
mov    0x90(%rsp),%r15
mov    %r15,%rsi
mov    0x50(%rsp),%r13
imul   %r13,%rsi
add    %rsi,%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <mp_calloc@plt>
movslq %eax,%rdi
mov    %rdi,0x10(%rsp)
mov    0x70(%rsp),%rbp
mov    %rbp,%rsi
mov    0x38(%rsp),%r14
mov    %r14,%rdx
mov    %r15,%rcx
mov    %r13,%r8
xor    %eax,%eax
call   10b0 <mp_mul@plt>
cltq
mov    %rax,0x18(%rsp)
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <mp_free@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <mp_free@plt>
mov    0x78(%rsp),%r14
mov    %r14,%rsi
mov    0x58(%rsp),%r13
imul   %r13,%rsi
add    %rsi,%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <mp_calloc@plt>
movslq %eax,%rdi
mov    %rdi,0x38(%rsp)
mov    (%rsp),%rbp
mov    %rbp,%rsi
mov    0x40(%rsp),%r15
mov    %r15,%rdx
mov    %r14,%rcx
mov    %r13,%r8
xor    %eax,%eax
call   10b0 <mp_mul@plt>
cltq
mov    %rax,0x70(%rsp)
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <mp_free@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1080 <mp_free@plt>
lea    0x0(,%r12,4),%rsi
mov    $0x1,%edi
mov    %rsi,0x78(%rsp)
xor    %eax,%eax
call   1040 <mp_calloc@plt>
movslq %eax,%r15
mov    %r15,%rdi
mov    0x30(%rsp),%rsi
mov    0x8(%rsp),%rdx
mov    %r12,%rcx
mov    %r12,0x40(%rsp)
mov    %r12,%r8
xor    %eax,%eax
call   10b0 <mp_mul@plt>
movslq %eax,%r12
mov    %r12,0x8(%rsp)
mov    0x28(%rsp),%rbp
mov    0x48(%rsp),%r14
lea    (%r14,%rbp,1),%rsi
add    %rsi,%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <mp_calloc@plt>
movslq %eax,%r13
mov    %r13,%rdi
mov    0x20(%rsp),%rsi
mov    0x60(%rsp),%rdx
mov    %rbp,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   10b0 <mp_mul@plt>
movslq %eax,%r14
mov    0x80(%rsp),%rbp
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    $0x4,%ecx
xor    %eax,%eax
call   1090 <mp_lshift@plt>
movslq %eax,%r8
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    0x68(%rsp),%rcx
xor    %eax,%eax
call   1070 <mp_sub@plt>
movslq %eax,%rcx
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    %r14,%r12
mov    %r14,0x28(%rsp)
mov    %r14,%r8
xor    %eax,%eax
call   1070 <mp_sub@plt>
cltq
mov    %rax,(%rsp)
mov    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    0x18(%rsp),%rcx
mov    0x8(%rsp),%r14
mov    %r14,%r8
xor    %eax,%eax
call   1070 <mp_sub@plt>
movslq %eax,%rcx
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    %r13,%rdx
mov    %r12,%r8
xor    %eax,%eax
call   1070 <mp_sub@plt>
cltq
mov    %rax,0x20(%rsp)
mov    0x38(%rsp),%r12
mov    %r12,%rdi
mov    %r12,%rsi
mov    %r15,0x48(%rsp)
mov    %r15,%rdx
mov    0x70(%rsp),%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1070 <mp_sub@plt>
movslq %eax,%r14
mov    0x80(%rsp),%rbp
mov    %rbp,%rdi
mov    %r13,0x30(%rsp)
mov    %r13,%rsi
mov    0x28(%rsp),%rdx
mov    $0x4,%ecx
xor    %eax,%eax
call   1090 <mp_lshift@plt>
movslq %eax,%r8
mov    %r12,%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1070 <mp_sub@plt>
movslq %eax,%r8
mov    %rbp,%rdi
mov    %rbp,%r14
mov    %rbx,%rsi
mov    %r12,%rdx
mov    (%rsp),%rcx
mov    %r8,0x18(%rsp)
xor    %eax,%eax
call   1050 <mp_add@plt>
movslq %eax,%r13
lea    0x0(,%r13,2),%r15
add    %rbp,%r15
mov    %r15,%rdi
mov    0x10(%rsp),%rbp
mov    %rbp,%rsi
mov    0x20(%rsp),%r12
mov    %r12,%rdx
mov    $0x3,%ecx
xor    %eax,%eax
call   1090 <mp_lshift@plt>
movslq %eax,%r8
mov    %r14,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1070 <mp_sub@plt>
movslq %eax,%r15
lea    (%r14,%r15,2),%r13
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
mov    $0x1,%ecx
xor    %eax,%eax
call   1090 <mp_lshift@plt>
movslq %eax,%rcx
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
mov    %r15,%r8
xor    %eax,%eax
call   1070 <mp_sub@plt>
movslq %eax,%r13
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    (%rsp),%rdx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <mp_rshift@plt>
movslq %eax,%rcx
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r12,%r8
xor    %eax,%eax
call   1070 <mp_sub@plt>
movslq %eax,%r15
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r13,0x20(%rsp)
mov    %r13,%rdx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <mp_rshift@plt>
movslq %eax,%r8
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r15,%rcx
mov    %r8,(%rsp)
xor    %eax,%eax
call   1070 <mp_sub@plt>
movabs $0xaaaaaaaaaaaaaaab,%rbp
aa aa aa
movslq %eax,%r12
movzwl -0x2(%rbx,%r12,2),%ecx
imul   $0xaaab,%ecx,%eax
shr    $0x11,%eax
mov    %ax,-0x2(%rbx,%r12,2)
cmp    $0x2,%r12d
jl     1892 <mp_toom_mul+0x702>
lea    -0x1(%r12),%rsi
mov    $0xaaaaaaab,%edi
nopl   0x0(%rax,%rax,1)
mov    %rcx,%rax
mul    %rbp
shr    %rdx
lea    (%rdx,%rdx,2),%rax
sub    %rax,%rcx
shl    $0x10,%rcx
movzwl -0x2(%rbx,%rsi,2),%eax
or     %rax,%rcx
mov    %rcx,%rax
imul   %rdi,%rax
shr    $0x21,%rax
mov    %ax,-0x2(%rbx,%rsi,2)
add    $0xffffffffffffffff,%rsi
jg     1860 <mp_toom_mul+0x6d0>
mov    0x38(%rsp),%r15
mov    %r15,%rdi
mov    %r15,%rsi
mov    0x18(%rsp),%rdx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <mp_rshift@plt>
movslq %eax,%rcx
mov    %r15,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %r12,%r8
xor    %eax,%eax
call   1070 <mp_sub@plt>
movslq %eax,%rcx
mov    %r15,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    0x20(%rsp),%r8
xor    %eax,%eax
call   1070 <mp_sub@plt>
movslq %eax,%rdx
mov    %r15,%rdi
mov    %r15,%rsi
mov    $0x2,%ecx
xor    %eax,%eax
call   1030 <mp_rshift@plt>
movslq %eax,%r13
mov    0x98(%rsp),%rbp
mov    %rbp,%rdx
add    %rbp,%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
mov    0x78(%rsp),%rax
sub    %rax,%rbp
lea    (%r14,%rax,2),%rdi
mov    %rdi,%rsi
mov    0x30(%rsp),%rdx
mov    %rbp,%rcx
mov    0x28(%rsp),%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
movslq %eax,%rcx
mov    0x40(%rsp),%rbp
add    %rbp,%rcx
lea    0x0(,%rbp,2),%rax
add    %rbp,%rax
lea    (%r14,%rax,2),%rdi
mov    %rdi,%rsi
mov    %r15,%rdx
mov    %r13,%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
movslq %eax,%rcx
add    %rbp,%rcx
mov    0xa0(%rsp),%rax
lea    (%r14,%rax,2),%rdi
mov    %rdi,%rsi
mov    0x10(%rsp),%r13
mov    %r13,%rdx
mov    (%rsp),%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
movslq %eax,%rcx
add    %rbp,%rcx
lea    (%r14,%rbp,2),%rdi
mov    %rdi,%rsi
mov    %rbx,%rdx
mov    %r12,%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
movslq %eax,%rcx
add    %rbp,%rcx
mov    %r14,%rdi
mov    %r14,%rsi
mov    0x48(%rsp),%r12
mov    %r12,%rdx
mov    0x8(%rsp),%r8
xor    %eax,%eax
call   1050 <mp_add@plt>
movslq %eax,%rbp
mov    0x30(%rsp),%rdi
xor    %eax,%eax
call   1080 <mp_free@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1080 <mp_free@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1080 <mp_free@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <mp_free@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <mp_free@plt>
cmp    $0x2,%ebp
jl     1a06 <mp_toom_mul+0x876>
lea    -0x1(%rbp),%rax
cmpw   $0x0,-0x2(%r14,%rbp,2)
cmove  %rax,%rbp
mov    %rbp,%rax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @mp_toom_mul(i16* %0, i16* %1, i16* %2, i64 %3, i64 %4) {
%6 = alloca i16*
%7 = alloca i16*
%8 = alloca i16*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i16
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = alloca i64
%21 = alloca i64
%22 = alloca i64
%23 = alloca i64
%24 = alloca [3 x i64]
%25 = alloca [3 x i64]
%26 = alloca i16*
%27 = alloca i16*
%28 = alloca i16*
%29 = alloca i16*
%30 = alloca i16*
%31 = alloca [3 x i16*]
%32 = alloca [3 x i16*]
store i16* %0, i16** %6
store i16* %1, i16** %7
store i16* %2, i16** %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%33 = load i64, i64* %9
%34 = load i64, i64* %10
%35 = add i64 %33, %34
%36 = add i64 %35, 4
%37 = udiv i64 %36, 6
store i64 %37, i64* %16
%38 = load i64, i64* %9
%39 = load i64, i64* %16
%40 = shl i64 %39, 1
%41 = sub i64 %38, %40
store i64 %41, i64* %17
%42 = load i64, i64* %10
%43 = load i64, i64* %16
%44 = shl i64 %43, 1
%45 = sub i64 %42, %44
store i64 %45, i64* %18
%46 = load i64, i64* %16
%47 = add i64 %46, 2
%48 = mul i64 2, %47
%49 = call i32 (i64, ...) bitcast (i32 (...)* @mp_malloc to i32 (i64, ...)*)(i64 %48)
%50 = sext i32 %49 to i64
%51 = inttoptr i64 %50 to i16*
%52 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 0
store i16* %51, i16** %52
%53 = load i64, i64* %16
%54 = add i64 %53, 2
%55 = mul i64 2, %54
%56 = call i32 (i64, ...) bitcast (i32 (...)* @mp_malloc to i32 (i64, ...)*)(i64 %55)
%57 = sext i32 %56 to i64
%58 = inttoptr i64 %57 to i16*
%59 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 0
store i16* %58, i16** %59
%60 = load i64, i64* %16
%61 = add i64 %60, 1
%62 = mul i64 2, %61
%63 = call i32 (i64, ...) bitcast (i32 (...)* @mp_malloc to i32 (i64, ...)*)(i64 %62)
%64 = sext i32 %63 to i64
%65 = inttoptr i64 %64 to i16*
%66 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 1
store i16* %65, i16** %66
%67 = load i64, i64* %16
%68 = add i64 %67, 1
%69 = mul i64 2, %68
%70 = call i32 (i64, ...) bitcast (i32 (...)* @mp_malloc to i32 (i64, ...)*)(i64 %69)
%71 = sext i32 %70 to i64
%72 = inttoptr i64 %71 to i16*
%73 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 1
store i16* %72, i16** %73
%74 = load i64, i64* %16
%75 = add i64 %74, 2
%76 = mul i64 2, %75
%77 = call i32 (i64, ...) bitcast (i32 (...)* @mp_malloc to i32 (i64, ...)*)(i64 %76)
%78 = sext i32 %77 to i64
%79 = inttoptr i64 %78 to i16*
%80 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 2
store i16* %79, i16** %80
%81 = load i64, i64* %16
%82 = add i64 %81, 2
%83 = mul i64 2, %82
%84 = call i32 (i64, ...) bitcast (i32 (...)* @mp_malloc to i32 (i64, ...)*)(i64 %83)
%85 = sext i32 %84 to i64
%86 = inttoptr i64 %85 to i16*
%87 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 2
store i16* %86, i16** %87
%88 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 1
%89 = load i16*, i16** %88
%90 = load i16*, i16** %7
%91 = load i64, i64* %16
%92 = getelementptr inbounds i16, i16* %90, i64 %91
%93 = load i64, i64* %16
%94 = call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %89, i16* %92, i64 %93, i32 1)
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 1
store i64 %95, i64* %96
%97 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 0
%98 = load i16*, i16** %97
%99 = load i16*, i16** %7
%100 = load i64, i64* %16
%101 = call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %98, i16* %99, i64 %100, i32 2)
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 0
store i64 %102, i64* %103
%104 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 0
%105 = load i16*, i16** %104
%106 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 0
%107 = load i16*, i16** %106
%108 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 1
%109 = load i16*, i16** %108
%110 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 0
%111 = load i64, i64* %110
%112 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 1
%113 = load i64, i64* %112
%114 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %105, i16* %107, i16* %109, i64 %111, i64 %113)
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 0
store i64 %115, i64* %116
%117 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 0
%118 = load i16*, i16** %117
%119 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 0
%120 = load i16*, i16** %119
%121 = load i16*, i16** %7
%122 = load i64, i64* %16
%123 = getelementptr inbounds i16, i16* %121, i64 %122
%124 = load i64, i64* %16
%125 = getelementptr inbounds i16, i16* %123, i64 %124
%126 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 0
%127 = load i64, i64* %126
%128 = load i64, i64* %17
%129 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %118, i16* %120, i16* %125, i64 %127, i64 %128)
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 0
store i64 %130, i64* %131
%132 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 2
%133 = load i16*, i16** %132
%134 = load i16*, i16** %7
%135 = load i64, i64* %16
%136 = getelementptr inbounds i16, i16* %134, i64 %135
%137 = load i64, i64* %16
%138 = getelementptr inbounds i16, i16* %136, i64 %137
%139 = load i64, i64* %17
%140 = call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %133, i16* %138, i64 %139, i32 2)
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 2
store i64 %141, i64* %142
%143 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 2
%144 = load i16*, i16** %143
%145 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 2
%146 = load i16*, i16** %145
%147 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 1
%148 = load i16*, i16** %147
%149 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 2
%150 = load i64, i64* %149
%151 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 1
%152 = load i64, i64* %151
%153 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %144, i16* %146, i16* %148, i64 %150, i64 %152)
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 2
store i64 %154, i64* %155
%156 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 2
%157 = load i16*, i16** %156
%158 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 2
%159 = load i16*, i16** %158
%160 = load i16*, i16** %7
%161 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 2
%162 = load i64, i64* %161
%163 = load i64, i64* %16
%164 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %157, i16* %159, i16* %160, i64 %162, i64 %163)
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 2
store i64 %165, i64* %166
%167 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 1
%168 = load i16*, i16** %167
%169 = load i16*, i16** %7
%170 = load i16*, i16** %7
%171 = load i64, i64* %16
%172 = getelementptr inbounds i16, i16* %170, i64 %171
%173 = load i64, i64* %16
%174 = load i64, i64* %16
%175 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %168, i16* %169, i16* %172, i64 %173, i64 %174)
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 1
store i64 %176, i64* %177
%178 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 1
%179 = load i16*, i16** %178
%180 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 1
%181 = load i16*, i16** %180
%182 = load i16*, i16** %7
%183 = load i64, i64* %16
%184 = getelementptr inbounds i16, i16* %182, i64 %183
%185 = load i64, i64* %16
%186 = getelementptr inbounds i16, i16* %184, i64 %185
%187 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 1
%188 = load i64, i64* %187
%189 = load i64, i64* %17
%190 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %179, i16* %181, i16* %186, i64 %188, i64 %189)
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 1
store i64 %191, i64* %192
%193 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 1
%194 = load i16*, i16** %193
%195 = load i16*, i16** %8
%196 = load i64, i64* %16
%197 = getelementptr inbounds i16, i16* %195, i64 %196
%198 = load i64, i64* %16
%199 = call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %194, i16* %197, i64 %198, i32 1)
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 1
store i64 %200, i64* %201
%202 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 0
%203 = load i16*, i16** %202
%204 = load i16*, i16** %8
%205 = load i64, i64* %16
%206 = call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %203, i16* %204, i64 %205, i32 2)
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 0
store i64 %207, i64* %208
%209 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 0
%210 = load i16*, i16** %209
%211 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 0
%212 = load i16*, i16** %211
%213 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 1
%214 = load i16*, i16** %213
%215 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 0
%216 = load i64, i64* %215
%217 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 1
%218 = load i64, i64* %217
%219 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %210, i16* %212, i16* %214, i64 %216, i64 %218)
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 0
store i64 %220, i64* %221
%222 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 0
%223 = load i16*, i16** %222
%224 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 0
%225 = load i16*, i16** %224
%226 = load i16*, i16** %8
%227 = load i64, i64* %16
%228 = getelementptr inbounds i16, i16* %226, i64 %227
%229 = load i64, i64* %16
%230 = getelementptr inbounds i16, i16* %228, i64 %229
%231 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 0
%232 = load i64, i64* %231
%233 = load i64, i64* %18
%234 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %223, i16* %225, i16* %230, i64 %232, i64 %233)
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 0
store i64 %235, i64* %236
%237 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 2
%238 = load i16*, i16** %237
%239 = load i16*, i16** %8
%240 = load i64, i64* %16
%241 = getelementptr inbounds i16, i16* %239, i64 %240
%242 = load i64, i64* %16
%243 = getelementptr inbounds i16, i16* %241, i64 %242
%244 = load i64, i64* %18
%245 = call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %238, i16* %243, i64 %244, i32 2)
%246 = sext i32 %245 to i64
%247 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 2
store i64 %246, i64* %247
%248 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 2
%249 = load i16*, i16** %248
%250 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 2
%251 = load i16*, i16** %250
%252 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 1
%253 = load i16*, i16** %252
%254 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 2
%255 = load i64, i64* %254
%256 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 1
%257 = load i64, i64* %256
%258 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %249, i16* %251, i16* %253, i64 %255, i64 %257)
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 2
store i64 %259, i64* %260
%261 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 2
%262 = load i16*, i16** %261
%263 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 2
%264 = load i16*, i16** %263
%265 = load i16*, i16** %8
%266 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 2
%267 = load i64, i64* %266
%268 = load i64, i64* %16
%269 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %262, i16* %264, i16* %265, i64 %267, i64 %268)
%270 = sext i32 %269 to i64
%271 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 2
store i64 %270, i64* %271
%272 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 1
%273 = load i16*, i16** %272
%274 = load i16*, i16** %8
%275 = load i16*, i16** %8
%276 = load i64, i64* %16
%277 = getelementptr inbounds i16, i16* %275, i64 %276
%278 = load i64, i64* %16
%279 = load i64, i64* %16
%280 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %273, i16* %274, i16* %277, i64 %278, i64 %279)
%281 = sext i32 %280 to i64
%282 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 1
store i64 %281, i64* %282
%283 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 1
%284 = load i16*, i16** %283
%285 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 1
%286 = load i16*, i16** %285
%287 = load i16*, i16** %8
%288 = load i64, i64* %16
%289 = getelementptr inbounds i16, i16* %287, i64 %288
%290 = load i64, i64* %16
%291 = getelementptr inbounds i16, i16* %289, i64 %290
%292 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 1
%293 = load i64, i64* %292
%294 = load i64, i64* %18
%295 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %284, i16* %286, i16* %291, i64 %293, i64 %294)
%296 = sext i32 %295 to i64
%297 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 1
store i64 %296, i64* %297
%298 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 0
%299 = load i64, i64* %298
%300 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 0
%301 = load i64, i64* %300
%302 = mul i64 %299, %301
%303 = mul i64 2, %302
%304 = call i32 (i32, i64, ...) bitcast (i32 (...)* @mp_calloc to i32 (i32, i64, ...)*)(i32 1, i64 %303)
%305 = sext i32 %304 to i64
%306 = inttoptr i64 %305 to i16*
store i16* %306, i16** %27
%307 = load i16*, i16** %27
%308 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 0
%309 = load i16*, i16** %308
%310 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 0
%311 = load i16*, i16** %310
%312 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 0
%313 = load i64, i64* %312
%314 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 0
%315 = load i64, i64* %314
%316 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_mul to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %307, i16* %309, i16* %311, i64 %313, i64 %315)
%317 = sext i32 %316 to i64
store i64 %317, i64* %20
%318 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 0
%319 = load i16*, i16** %318
%320 = call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %319)
%321 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 0
%322 = load i16*, i16** %321
%323 = call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %322)
%324 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 1
%325 = load i64, i64* %324
%326 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 1
%327 = load i64, i64* %326
%328 = mul i64 %325, %327
%329 = mul i64 2, %328
%330 = call i32 (i32, i64, ...) bitcast (i32 (...)* @mp_calloc to i32 (i32, i64, ...)*)(i32 1, i64 %329)
%331 = sext i32 %330 to i64
%332 = inttoptr i64 %331 to i16*
store i16* %332, i16** %28
%333 = load i16*, i16** %28
%334 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 1
%335 = load i16*, i16** %334
%336 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 1
%337 = load i16*, i16** %336
%338 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 1
%339 = load i64, i64* %338
%340 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 1
%341 = load i64, i64* %340
%342 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_mul to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %333, i16* %335, i16* %337, i64 %339, i64 %341)
%343 = sext i32 %342 to i64
store i64 %343, i64* %21
%344 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 1
%345 = load i16*, i16** %344
%346 = call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %345)
%347 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 1
%348 = load i16*, i16** %347
%349 = call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %348)
%350 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 2
%351 = load i64, i64* %350
%352 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 2
%353 = load i64, i64* %352
%354 = mul i64 %351, %353
%355 = mul i64 2, %354
%356 = call i32 (i32, i64, ...) bitcast (i32 (...)* @mp_calloc to i32 (i32, i64, ...)*)(i32 1, i64 %355)
%357 = sext i32 %356 to i64
%358 = inttoptr i64 %357 to i16*
store i16* %358, i16** %29
%359 = load i16*, i16** %29
%360 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 2
%361 = load i16*, i16** %360
%362 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 2
%363 = load i16*, i16** %362
%364 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 2
%365 = load i64, i64* %364
%366 = getelementptr inbounds [3 x i64], [3 x i64]* %25, i64 0, i64 2
%367 = load i64, i64* %366
%368 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_mul to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %359, i16* %361, i16* %363, i64 %365, i64 %367)
%369 = sext i32 %368 to i64
store i64 %369, i64* %22
%370 = getelementptr inbounds [3 x i16*], [3 x i16*]* %31, i64 0, i64 2
%371 = load i16*, i16** %370
%372 = call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %371)
%373 = getelementptr inbounds [3 x i16*], [3 x i16*]* %32, i64 0, i64 2
%374 = load i16*, i16** %373
%375 = call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %374)
%376 = load i64, i64* %16
%377 = load i64, i64* %16
%378 = add i64 %376, %377
%379 = mul i64 2, %378
%380 = call i32 (i32, i64, ...) bitcast (i32 (...)* @mp_calloc to i32 (i32, i64, ...)*)(i32 1, i64 %379)
%381 = sext i32 %380 to i64
%382 = inttoptr i64 %381 to i16*
store i16* %382, i16** %26
%383 = load i16*, i16** %26
%384 = load i16*, i16** %7
%385 = load i16*, i16** %8
%386 = load i64, i64* %16
%387 = load i64, i64* %16
%388 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_mul to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %383, i16* %384, i16* %385, i64 %386, i64 %387)
%389 = sext i32 %388 to i64
store i64 %389, i64* %19
%390 = load i64, i64* %17
%391 = load i64, i64* %18
%392 = add i64 %390, %391
%393 = mul i64 2, %392
%394 = call i32 (i32, i64, ...) bitcast (i32 (...)* @mp_calloc to i32 (i32, i64, ...)*)(i32 1, i64 %393)
%395 = sext i32 %394 to i64
%396 = inttoptr i64 %395 to i16*
store i16* %396, i16** %30
%397 = load i16*, i16** %30
%398 = load i16*, i16** %7
%399 = load i64, i64* %16
%400 = getelementptr inbounds i16, i16* %398, i64 %399
%401 = load i64, i64* %16
%402 = getelementptr inbounds i16, i16* %400, i64 %401
%403 = load i16*, i16** %8
%404 = load i64, i64* %16
%405 = getelementptr inbounds i16, i16* %403, i64 %404
%406 = load i64, i64* %16
%407 = getelementptr inbounds i16, i16* %405, i64 %406
%408 = load i64, i64* %17
%409 = load i64, i64* %18
%410 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_mul to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %397, i16* %402, i16* %407, i64 %408, i64 %409)
%411 = sext i32 %410 to i64
store i64 %411, i64* %23
%412 = load i16*, i16** %6
%413 = load i16*, i16** %26
%414 = load i64, i64* %19
%415 = call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %412, i16* %413, i64 %414, i32 4)
%416 = sext i32 %415 to i64
store i64 %416, i64* %11
%417 = load i16*, i16** %27
%418 = load i16*, i16** %27
%419 = load i16*, i16** %6
%420 = load i64, i64* %20
%421 = load i64, i64* %11
%422 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %417, i16* %418, i16* %419, i64 %420, i64 %421)
%423 = sext i32 %422 to i64
store i64 %423, i64* %20
%424 = load i16*, i16** %27
%425 = load i16*, i16** %27
%426 = load i16*, i16** %30
%427 = load i64, i64* %20
%428 = load i64, i64* %23
%429 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %424, i16* %425, i16* %426, i64 %427, i64 %428)
%430 = sext i32 %429 to i64
store i64 %430, i64* %20
%431 = load i16*, i16** %28
%432 = load i16*, i16** %28
%433 = load i16*, i16** %26
%434 = load i64, i64* %21
%435 = load i64, i64* %19
%436 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %431, i16* %432, i16* %433, i64 %434, i64 %435)
%437 = sext i32 %436 to i64
store i64 %437, i64* %21
%438 = load i16*, i16** %28
%439 = load i16*, i16** %28
%440 = load i16*, i16** %30
%441 = load i64, i64* %21
%442 = load i64, i64* %23
%443 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %438, i16* %439, i16* %440, i64 %441, i64 %442)
%444 = sext i32 %443 to i64
store i64 %444, i64* %21
%445 = load i16*, i16** %29
%446 = load i16*, i16** %29
%447 = load i16*, i16** %26
%448 = load i64, i64* %22
%449 = load i64, i64* %19
%450 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %445, i16* %446, i16* %447, i64 %448, i64 %449)
%451 = sext i32 %450 to i64
store i64 %451, i64* %22
%452 = load i16*, i16** %6
%453 = load i16*, i16** %30
%454 = load i64, i64* %23
%455 = call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %452, i16* %453, i64 %454, i32 4)
%456 = sext i32 %455 to i64
store i64 %456, i64* %11
%457 = load i16*, i16** %29
%458 = load i16*, i16** %29
%459 = load i16*, i16** %6
%460 = load i64, i64* %22
%461 = load i64, i64* %11
%462 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %457, i16* %458, i16* %459, i64 %460, i64 %461)
%463 = sext i32 %462 to i64
store i64 %463, i64* %22
%464 = load i16*, i16** %6
%465 = load i16*, i16** %27
%466 = load i16*, i16** %29
%467 = load i64, i64* %20
%468 = load i64, i64* %22
%469 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %464, i16* %465, i16* %466, i64 %467, i64 %468)
%470 = sext i32 %469 to i64
store i64 %470, i64* %11
%471 = load i16*, i16** %6
%472 = load i64, i64* %11
%473 = getelementptr inbounds i16, i16* %471, i64 %472
%474 = load i16*, i16** %28
%475 = load i64, i64* %21
%476 = call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %473, i16* %474, i64 %475, i32 3)
%477 = sext i32 %476 to i64
store i64 %477, i64* %12
%478 = load i16*, i16** %6
%479 = load i16*, i16** %6
%480 = load i16*, i16** %6
%481 = load i64, i64* %11
%482 = getelementptr inbounds i16, i16* %480, i64 %481
%483 = load i64, i64* %11
%484 = load i64, i64* %12
%485 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %478, i16* %479, i16* %482, i64 %483, i64 %484)
%486 = sext i32 %485 to i64
store i64 %486, i64* %11
%487 = load i16*, i16** %6
%488 = load i64, i64* %11
%489 = getelementptr inbounds i16, i16* %487, i64 %488
%490 = load i16*, i16** %28
%491 = load i64, i64* %21
%492 = call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %489, i16* %490, i64 %491, i32 1)
%493 = sext i32 %492 to i64
store i64 %493, i64* %12
%494 = load i16*, i16** %6
%495 = load i16*, i16** %6
%496 = load i64, i64* %11
%497 = getelementptr inbounds i16, i16* %495, i64 %496
%498 = load i16*, i16** %6
%499 = load i64, i64* %12
%500 = load i64, i64* %11
%501 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %494, i16* %497, i16* %498, i64 %499, i64 %500)
%502 = sext i32 %501 to i64
store i64 %502, i64* %11
%503 = load i16*, i16** %27
%504 = load i16*, i16** %27
%505 = load i64, i64* %20
%506 = call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_rshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %503, i16* %504, i64 %505, i32 1)
%507 = sext i32 %506 to i64
store i64 %507, i64* %20
%508 = load i16*, i16** %27
%509 = load i16*, i16** %27
%510 = load i16*, i16** %28
%511 = load i64, i64* %20
%512 = load i64, i64* %21
%513 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %508, i16* %509, i16* %510, i64 %511, i64 %512)
%514 = sext i32 %513 to i64
store i64 %514, i64* %20
%515 = load i16*, i16** %28
%516 = load i16*, i16** %6
%517 = load i64, i64* %11
%518 = call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_rshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %515, i16* %516, i64 %517, i32 1)
%519 = sext i32 %518 to i64
store i64 %519, i64* %21
%520 = load i16*, i16** %27
%521 = load i16*, i16** %27
%522 = load i16*, i16** %28
%523 = load i64, i64* %20
%524 = load i64, i64* %21
%525 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %520, i16* %521, i16* %522, i64 %523, i64 %524)
%526 = sext i32 %525 to i64
store i64 %526, i64* %20
%527 = load i64, i64* %20
%528 = sub i64 %527, 1
store i64 %528, i64* %13
%529 = load i16*, i16** %27
%530 = load i64, i64* %13
%531 = getelementptr inbounds i16, i16* %529, i64 %530
%532 = load i16, i16* %531
%533 = zext i16 %532 to i64
store i64 %533, i64* %14
%534 = load i64, i64* %14
%535 = udiv i64 %534, 3
%536 = trunc i64 %535 to i16
%537 = load i16*, i16** %27
%538 = load i64, i64* %13
%539 = getelementptr inbounds i16, i16* %537, i64 %538
store i16 %536, i16* %539
%540 = load i64, i64* %13
%541 = add nsw i64 %540, -1
store i64 %541, i64* %13
br label %542
542: ; preds = %564, %5
%543 = load i64, i64* %13
%544 = icmp sge i64 %543, 0
br i1 %544, label %545, label %567
545: ; preds = %542
%546 = load i64, i64* %14
%547 = urem i64 %546, 3
%548 = trunc i64 %547 to i16
store i16 %548, i16* %15
%549 = load i16, i16* %15
%550 = zext i16 %549 to i64
%551 = shl i64 %550, 16
%552 = load i16*, i16** %27
%553 = load i64, i64* %13
%554 = getelementptr inbounds i16, i16* %552, i64 %553
%555 = load i16, i16* %554
%556 = zext i16 %555 to i64
%557 = add i64 %551, %556
store i64 %557, i64* %14
%558 = load i64, i64* %14
%559 = udiv i64 %558, 3
%560 = trunc i64 %559 to i16
%561 = load i16*, i16** %27
%562 = load i64, i64* %13
%563 = getelementptr inbounds i16, i16* %561, i64 %562
store i16 %560, i16* %563
br label %564
564: ; preds = %545
%565 = load i64, i64* %13
%566 = add nsw i64 %565, -1
store i64 %566, i64* %13
br label %542
567: ; preds = %542
%568 = load i16*, i16** %29
%569 = load i16*, i16** %29
%570 = load i64, i64* %22
%571 = call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_rshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %568, i16* %569, i64 %570, i32 1)
%572 = sext i32 %571 to i64
store i64 %572, i64* %22
%573 = load i16*, i16** %29
%574 = load i16*, i16** %29
%575 = load i16*, i16** %27
%576 = load i64, i64* %22
%577 = load i64, i64* %20
%578 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %573, i16* %574, i16* %575, i64 %576, i64 %577)
%579 = sext i32 %578 to i64
store i64 %579, i64* %22
%580 = load i16*, i16** %29
%581 = load i16*, i16** %29
%582 = load i16*, i16** %6
%583 = load i64, i64* %22
%584 = load i64, i64* %11
%585 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %580, i16* %581, i16* %582, i64 %583, i64 %584)
%586 = sext i32 %585 to i64
store i64 %586, i64* %22
%587 = load i16*, i16** %29
%588 = load i16*, i16** %29
%589 = load i64, i64* %22
%590 = call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_rshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %587, i16* %588, i64 %589, i32 2)
%591 = sext i32 %590 to i64
store i64 %591, i64* %22
%592 = load i16*, i16** %6
%593 = bitcast i16* %592 to i8*
%594 = load i64, i64* %9
%595 = load i64, i64* %10
%596 = add i64 %594, %595
%597 = mul i64 2, %596
%598 = load i64, i64* %16
%599 = mul i64 %598, 4
store i64 %599, i64* %13
%600 = load i64, i64* %9
%601 = load i64, i64* %10
%602 = add i64 %600, %601
%603 = load i64, i64* %13
%604 = sub i64 %602, %603
store i64 %604, i64* %12
%605 = load i16*, i16** %6
%606 = load i64, i64* %13
%607 = getelementptr inbounds i16, i16* %605, i64 %606
%608 = load i16*, i16** %6
%609 = load i64, i64* %13
%610 = getelementptr inbounds i16, i16* %608, i64 %609
%611 = load i16*, i16** %30
%612 = load i64, i64* %12
%613 = load i64, i64* %23
%614 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %607, i16* %610, i16* %611, i64 %612, i64 %613)
%615 = sext i32 %614 to i64
%616 = load i64, i64* %13
%617 = add nsw i64 %615, %616
store i64 %617, i64* %11
%618 = load i64, i64* %16
%619 = mul i64 %618, 3
store i64 %619, i64* %13
%620 = load i64, i64* %11
%621 = load i64, i64* %13
%622 = sub nsw i64 %620, %621
store i64 %622, i64* %12
%623 = load i16*, i16** %6
%624 = load i64, i64* %13
%625 = getelementptr inbounds i16, i16* %623, i64 %624
%626 = load i16*, i16** %6
%627 = load i64, i64* %13
%628 = getelementptr inbounds i16, i16* %626, i64 %627
%629 = load i16*, i16** %29
%630 = load i64, i64* %12
%631 = load i64, i64* %22
%632 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %625, i16* %628, i16* %629, i64 %630, i64 %631)
%633 = sext i32 %632 to i64
%634 = load i64, i64* %13
%635 = add nsw i64 %633, %634
store i64 %635, i64* %11
%636 = load i64, i64* %16
%637 = mul i64 %636, 2
store i64 %637, i64* %13
%638 = load i64, i64* %11
%639 = load i64, i64* %13
%640 = sub nsw i64 %638, %639
store i64 %640, i64* %12
%641 = load i16*, i16** %6
%642 = load i64, i64* %13
%643 = getelementptr inbounds i16, i16* %641, i64 %642
%644 = load i16*, i16** %6
%645 = load i64, i64* %13
%646 = getelementptr inbounds i16, i16* %644, i64 %645
%647 = load i16*, i16** %28
%648 = load i64, i64* %12
%649 = load i64, i64* %21
%650 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %643, i16* %646, i16* %647, i64 %648, i64 %649)
%651 = sext i32 %650 to i64
%652 = load i64, i64* %13
%653 = add nsw i64 %651, %652
store i64 %653, i64* %11
%654 = load i64, i64* %16
store i64 %654, i64* %13
%655 = load i64, i64* %11
%656 = load i64, i64* %13
%657 = sub nsw i64 %655, %656
store i64 %657, i64* %12
%658 = load i16*, i16** %6
%659 = load i64, i64* %13
%660 = getelementptr inbounds i16, i16* %658, i64 %659
%661 = load i16*, i16** %6
%662 = load i64, i64* %13
%663 = getelementptr inbounds i16, i16* %661, i64 %662
%664 = load i16*, i16** %27
%665 = load i64, i64* %12
%666 = load i64, i64* %20
%667 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %660, i16* %663, i16* %664, i64 %665, i64 %666)
%668 = sext i32 %667 to i64
%669 = load i64, i64* %13
%670 = add nsw i64 %668, %669
store i64 %670, i64* %11
%671 = load i16*, i16** %6
%672 = load i16*, i16** %6
%673 = load i16*, i16** %26
%674 = load i64, i64* %11
%675 = load i64, i64* %19
%676 = call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %671, i16* %672, i16* %673, i64 %674, i64 %675)
%677 = sext i32 %676 to i64
store i64 %677, i64* %11
%678 = load i16*, i16** %30
%679 = call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %678)
%680 = load i16*, i16** %29
%681 = call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %680)
%682 = load i16*, i16** %28
%683 = call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %682)
%684 = load i16*, i16** %27
%685 = call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %684)
%686 = load i16*, i16** %26
%687 = call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %686)
%688 = load i64, i64* %11
%689 = icmp sgt i64 %688, 1
br i1 %689, label %690, label %701
690: ; preds = %567
%691 = load i16*, i16** %6
%692 = load i64, i64* %11
%693 = sub nsw i64 %692, 1
%694 = getelementptr inbounds i16, i16* %691, i64 %693
%695 = load i16, i16* %694
%696 = zext i16 %695 to i32
%697 = icmp eq i32 %696, 0
br i1 %697, label %698, label %701
698: ; preds = %690
%699 = load i64, i64* %11
%700 = add nsw i64 %699, -1
store i64 %700, i64* %11
br label %701
701: ; preds = %698, %690, %567
%702 = load i64, i64* %11
ret i64 %702
}

LLVM IR (-O2):
define i64 @mp_toom_mul(i16* %0, i16* %1, i16* %2, i64 %3, i64 %4) {
%6 = add i64 %4, %3
%7 = add i64 %6, 4
%8 = udiv i64 %7, 6
%9 = shl nuw nsw i64 %8, 1
%10 = sub i64 %3, %9
%11 = sub i64 %4, %9
%12 = add nuw nsw i64 %9, 4
%13 = tail call i32 (i64, ...) bitcast (i32 (...)* @mp_malloc to i32 (i64, ...)*)(i64 %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i16*
%16 = tail call i32 (i64, ...) bitcast (i32 (...)* @mp_malloc to i32 (i64, ...)*)(i64 %12)
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i16*
%19 = add nuw nsw i64 %9, 2
%20 = tail call i32 (i64, ...) bitcast (i32 (...)* @mp_malloc to i32 (i64, ...)*)(i64 %19)
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i16*
%23 = tail call i32 (i64, ...) bitcast (i32 (...)* @mp_malloc to i32 (i64, ...)*)(i64 %19)
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i16*
%26 = tail call i32 (i64, ...) bitcast (i32 (...)* @mp_malloc to i32 (i64, ...)*)(i64 %12)
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to i16*
%29 = tail call i32 (i64, ...) bitcast (i32 (...)* @mp_malloc to i32 (i64, ...)*)(i64 %12)
%30 = sext i32 %29 to i64
%31 = inttoptr i64 %30 to i16*
%32 = getelementptr inbounds i16, i16* %1, i64 %8
%33 = tail call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %22, i16* %32, i64 %8, i32 1)
%34 = sext i32 %33 to i64
%35 = tail call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %15, i16* %1, i64 %8, i32 2)
%36 = sext i32 %35 to i64
%37 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %15, i16* %15, i16* %22, i64 %36, i64 %34)
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i16, i16* %32, i64 %8
%40 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %15, i16* %15, i16* %39, i64 %38, i64 %10)
%41 = sext i32 %40 to i64
%42 = tail call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %28, i16* %39, i64 %10, i32 2)
%43 = sext i32 %42 to i64
%44 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %28, i16* %28, i16* %22, i64 %43, i64 %34)
%45 = sext i32 %44 to i64
%46 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %28, i16* %28, i16* %1, i64 %45, i64 %8)
%47 = sext i32 %46 to i64
%48 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %22, i16* %1, i16* %32, i64 %8, i64 %8)
%49 = sext i32 %48 to i64
%50 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %22, i16* %22, i16* %39, i64 %49, i64 %10)
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i16, i16* %2, i64 %8
%53 = tail call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %25, i16* %52, i64 %8, i32 1)
%54 = sext i32 %53 to i64
%55 = tail call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %18, i16* %2, i64 %8, i32 2)
%56 = sext i32 %55 to i64
%57 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %18, i16* %18, i16* %25, i64 %56, i64 %54)
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i16, i16* %52, i64 %8
%60 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %18, i16* %18, i16* %59, i64 %58, i64 %11)
%61 = sext i32 %60 to i64
%62 = tail call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %31, i16* %59, i64 %11, i32 2)
%63 = sext i32 %62 to i64
%64 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %31, i16* %31, i16* %25, i64 %63, i64 %54)
%65 = sext i32 %64 to i64
%66 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %31, i16* %31, i16* %2, i64 %65, i64 %8)
%67 = sext i32 %66 to i64
%68 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %25, i16* %2, i16* %52, i64 %8, i64 %8)
%69 = sext i32 %68 to i64
%70 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %25, i16* %25, i16* %59, i64 %69, i64 %11)
%71 = sext i32 %70 to i64
%72 = shl nsw i64 %41, 1
%73 = mul i64 %72, %61
%74 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @mp_calloc to i32 (i32, i64, ...)*)(i32 1, i64 %73)
%75 = sext i32 %74 to i64
%76 = inttoptr i64 %75 to i16*
%77 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_mul to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %76, i16* %15, i16* %18, i64 %41, i64 %61)
%78 = sext i32 %77 to i64
%79 = tail call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %15)
%80 = tail call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %18)
%81 = shl nsw i64 %51, 1
%82 = mul i64 %81, %71
%83 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @mp_calloc to i32 (i32, i64, ...)*)(i32 1, i64 %82)
%84 = sext i32 %83 to i64
%85 = inttoptr i64 %84 to i16*
%86 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_mul to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %85, i16* %22, i16* %25, i64 %51, i64 %71)
%87 = sext i32 %86 to i64
%88 = tail call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %22)
%89 = tail call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %25)
%90 = shl nsw i64 %47, 1
%91 = mul i64 %90, %67
%92 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @mp_calloc to i32 (i32, i64, ...)*)(i32 1, i64 %91)
%93 = sext i32 %92 to i64
%94 = inttoptr i64 %93 to i16*
%95 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_mul to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %94, i16* %28, i16* %31, i64 %47, i64 %67)
%96 = sext i32 %95 to i64
%97 = tail call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %28)
%98 = tail call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %31)
%99 = shl nuw i64 %8, 2
%100 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @mp_calloc to i32 (i32, i64, ...)*)(i32 1, i64 %99)
%101 = sext i32 %100 to i64
%102 = inttoptr i64 %101 to i16*
%103 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_mul to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %102, i16* %1, i16* %2, i64 %8, i64 %8)
%104 = sext i32 %103 to i64
%105 = add i64 %10, %11
%106 = shl i64 %105, 1
%107 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @mp_calloc to i32 (i32, i64, ...)*)(i32 1, i64 %106)
%108 = sext i32 %107 to i64
%109 = inttoptr i64 %108 to i16*
%110 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_mul to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %109, i16* %39, i16* %59, i64 %10, i64 %11)
%111 = sext i32 %110 to i64
%112 = tail call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %0, i16* %102, i64 %104, i32 4)
%113 = sext i32 %112 to i64
%114 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %76, i16* %76, i16* %0, i64 %78, i64 %113)
%115 = sext i32 %114 to i64
%116 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %76, i16* %76, i16* %109, i64 %115, i64 %111)
%117 = sext i32 %116 to i64
%118 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %85, i16* %85, i16* %102, i64 %87, i64 %104)
%119 = sext i32 %118 to i64
%120 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %85, i16* %85, i16* %109, i64 %119, i64 %111)
%121 = sext i32 %120 to i64
%122 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %94, i16* %94, i16* %102, i64 %96, i64 %104)
%123 = sext i32 %122 to i64
%124 = tail call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %0, i16* %109, i64 %111, i32 4)
%125 = sext i32 %124 to i64
%126 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %94, i16* %94, i16* %0, i64 %123, i64 %125)
%127 = sext i32 %126 to i64
%128 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %0, i16* %76, i16* %94, i64 %117, i64 %127)
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds i16, i16* %0, i64 %129
%131 = tail call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %130, i16* %85, i64 %121, i32 3)
%132 = sext i32 %131 to i64
%133 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %0, i16* %0, i16* %130, i64 %129, i64 %132)
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds i16, i16* %0, i64 %134
%136 = tail call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_lshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %135, i16* %85, i64 %121, i32 1)
%137 = sext i32 %136 to i64
%138 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %0, i16* %135, i16* %0, i64 %137, i64 %134)
%139 = sext i32 %138 to i64
%140 = tail call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_rshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %76, i16* %76, i64 %117, i32 1)
%141 = sext i32 %140 to i64
%142 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %76, i16* %76, i16* %85, i64 %141, i64 %121)
%143 = sext i32 %142 to i64
%144 = tail call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_rshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %85, i16* %0, i64 %139, i32 1)
%145 = sext i32 %144 to i64
%146 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %76, i16* %76, i16* %85, i64 %143, i64 %145)
%147 = sext i32 %146 to i64
%148 = add nsw i64 %147, -1
%149 = getelementptr inbounds i16, i16* %76, i64 %148
%150 = load i16, i16* %149
%151 = udiv i16 %150, 3
store i16 %151, i16* %149
%152 = icmp sgt i32 %146, 1
br i1 %152, label %153, label %169
153: ; preds = %5
%154 = add nsw i64 %147, -2
%155 = zext i16 %150 to i64
br label %156
156: ; preds = %153, %156
%157 = phi i64 [ %167, %156 ], [ %154, %153 ]
%158 = phi i64 [ %164, %156 ], [ %155, %153 ]
%159 = urem i64 %158, 3
%160 = shl nuw nsw i64 %159, 16
%161 = getelementptr inbounds i16, i16* %76, i64 %157
%162 = load i16, i16* %161
%163 = zext i16 %162 to i64
%164 = or i64 %160, %163
%165 = udiv i64 %164, 3
%166 = trunc i64 %165 to i16
store i16 %166, i16* %161
%167 = add nsw i64 %157, -1
%168 = icmp sgt i64 %157, 0
br i1 %168, label %156, label %169
169: ; preds = %156, %5
%170 = tail call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_rshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %94, i16* %94, i64 %127, i32 1)
%171 = sext i32 %170 to i64
%172 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %94, i16* %94, i16* %76, i64 %171, i64 %147)
%173 = sext i32 %172 to i64
%174 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_sub to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %94, i16* %94, i16* %0, i64 %173, i64 %139)
%175 = sext i32 %174 to i64
%176 = tail call i32 (i16*, i16*, i64, i32, ...) bitcast (i32 (...)* @mp_rshift to i32 (i16*, i16*, i64, i32, ...)*)(i16* %94, i16* %94, i64 %175, i32 2)
%177 = sext i32 %176 to i64
%178 = bitcast i16* %0 to i8*
%179 = shl i64 %6, 1
tail call void @llvm.memset.p0i8.i64(i8* align 2 %178, i8 0, i64 %179, i1 false)
%180 = sub i64 %6, %99
%181 = getelementptr inbounds i16, i16* %0, i64 %99
%182 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %181, i16* %181, i16* %109, i64 %180, i64 %111)
%183 = sext i32 %182 to i64
%184 = mul nuw i64 %8, 3
%185 = add nsw i64 %8, %183
%186 = getelementptr inbounds i16, i16* %0, i64 %184
%187 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %186, i16* %186, i16* %94, i64 %185, i64 %177)
%188 = sext i32 %187 to i64
%189 = add nsw i64 %8, %188
%190 = getelementptr inbounds i16, i16* %0, i64 %9
%191 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %190, i16* %190, i16* %85, i64 %189, i64 %145)
%192 = sext i32 %191 to i64
%193 = add nsw i64 %8, %192
%194 = getelementptr inbounds i16, i16* %0, i64 %8
%195 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %194, i16* %194, i16* %76, i64 %193, i64 %147)
%196 = sext i32 %195 to i64
%197 = add nsw i64 %8, %196
%198 = tail call i32 (i16*, i16*, i16*, i64, i64, ...) bitcast (i32 (...)* @mp_add to i32 (i16*, i16*, i16*, i64, i64, ...)*)(i16* %0, i16* %0, i16* %102, i64 %197, i64 %104)
%199 = sext i32 %198 to i64
%200 = tail call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %109)
%201 = tail call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %94)
%202 = tail call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %85)
%203 = tail call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %76)
%204 = tail call i32 (i16*, ...) bitcast (i32 (...)* @mp_free to i32 (i16*, ...)*)(i16* %102)
%205 = icmp sgt i32 %198, 1
br i1 %205, label %206, label %212
206: ; preds = %169
%207 = add nsw i64 %199, -1
%208 = getelementptr inbounds i16, i16* %0, i64 %207
%209 = load i16, i16* %208
%210 = icmp eq i16 %209, 0
%211 = select i1 %210, i64 %207, i64 %199
br label %212
212: ; preds = %206, %169
%213 = phi i64 [ %199, %169 ], [ %211, %206 ]
ret i64 %213
}