// File: marxn[P]pupp/3rdparty/gmp/mpn/toom_interpolate_6pts.c
// Function: _gmpn_toom_interpolate_6pts
void
mpn_toom_interpolate_6pts (mp_ptr pp, mp_size_t n, enum toom6_flags flags,
			   mp_ptr w4, mp_ptr w2, mp_ptr w1,
			   mp_size_t w0n)
{
  mp_limb_t cy;
  /* cy6 can be stored in w1[2*n], cy4 in w4[0], embankment in w2[0] */
  mp_limb_t cy4, cy6, embankment;

  ASSERT( n > 0 );
  ASSERT( 2*n >= w0n && w0n > 0 );

#define w5  pp					/* 2n   */
#define w3  (pp + 2 * n)			/* 2n+1 */
#define w0  (pp + 5 * n)			/* w0n  */

  /* Interpolate with sequence:
     W2 =(W1 - W2)>>2
     W1 =(W1 - W5)>>1
     W1 =(W1 - W2)>>1
     W4 =(W3 - W4)>>1
     W2 =(W2 - W4)/3
     W3 = W3 - W4 - W5
     W1 =(W1 - W3)/3
     // Last steps are mixed with recomposition...
     W2 = W2 - W0<<2
     W4 = W4 - W2
     W3 = W3 - W1
     W2 = W2 - W0
  */

  /* W2 =(W1 - W2)>>2 */
  if (flags & toom6_vm2_neg)
    mpn_add_n (w2, w1, w2, 2 * n + 1);
  else
    mpn_sub_n (w2, w1, w2, 2 * n + 1);
  mpn_rshift (w2, w2, 2 * n + 1, 2);

  /* W1 =(W1 - W5)>>1 */
  w1[2*n] -= mpn_sub_n (w1, w1, w5, 2*n);
  mpn_rshift (w1, w1, 2 * n + 1, 1);

  /* W1 =(W1 - W2)>>1 */
#if HAVE_NATIVE_mpn_rsh1sub_n
  mpn_rsh1sub_n (w1, w1, w2, 2 * n + 1);
#else
  mpn_sub_n (w1, w1, w2, 2 * n + 1);
  mpn_rshift (w1, w1, 2 * n + 1, 1);
#endif

  /* W4 =(W3 - W4)>>1 */
  if (flags & toom6_vm1_neg)
    {
#if HAVE_NATIVE_mpn_rsh1add_n
      mpn_rsh1add_n (w4, w3, w4, 2 * n + 1);
#else
      mpn_add_n (w4, w3, w4, 2 * n + 1);
      mpn_rshift (w4, w4, 2 * n + 1, 1);
#endif
    }
  else
    {
#if HAVE_NATIVE_mpn_rsh1sub_n
      mpn_rsh1sub_n (w4, w3, w4, 2 * n + 1);
#else
      mpn_sub_n (w4, w3, w4, 2 * n + 1);
      mpn_rshift (w4, w4, 2 * n + 1, 1);
#endif
    }

  /* W2 =(W2 - W4)/3 */
  mpn_sub_n (w2, w2, w4, 2 * n + 1);
  mpn_divexact_by3 (w2, w2, 2 * n + 1);

  /* W3 = W3 - W4 - W5 */
  mpn_sub_n (w3, w3, w4, 2 * n + 1);
  w3[2 * n] -= mpn_sub_n (w3, w3, w5, 2 * n);

  /* W1 =(W1 - W3)/3 */
  mpn_sub_n (w1, w1, w3, 2 * n + 1);
  mpn_divexact_by3 (w1, w1, 2 * n + 1);

  /*
    [1 0 0 0 0 0;
     0 1 0 0 0 0;
     1 0 1 0 0 0;
     0 1 0 1 0 0;
     1 0 1 0 1 0;
     0 0 0 0 0 1]

    pp[] prior to operations:
     |_H w0__|_L w0__|______||_H w3__|_L w3__|_H w5__|_L w5__|

    summation scheme for remaining operations:
     |______________5|n_____4|n_____3|n_____2|n______|n______|pp
     |_H w0__|_L w0__|______||_H w3__|_L w3__|_H w5__|_L w5__|
				    || H w4  | L w4  |
		    || H w2  | L w2  |
	    || H w1  | L w1  |
			    ||-H w1  |-L w1  |
		     |-H w0  |-L w0 ||-H w2  |-L w2  |
  */
  cy = mpn_add_n (pp + n, pp + n, w4, 2 * n + 1);
  MPN_INCR_U (pp + 3 * n + 1, n, cy);

  /* W2 -= W0<<2 */
#if HAVE_NATIVE_mpn_sublsh_n || HAVE_NATIVE_mpn_sublsh2_n_ip1
#if HAVE_NATIVE_mpn_sublsh2_n_ip1
  cy = mpn_sublsh2_n_ip1 (w2, w0, w0n);
#else
  cy = mpn_sublsh_n (w2, w2, w0, w0n, 2);
#endif
#else
  /* {W4,2*n+1} is now free and can be overwritten. */
  cy = mpn_lshift(w4, w0, w0n, 2);
  cy+= mpn_sub_n(w2, w2, w4, w0n);
#endif
  MPN_DECR_U (w2 + w0n, 2 * n + 1 - w0n, cy);

  /* W4L = W4L - W2L */
  cy = mpn_sub_n (pp + n, pp + n, w2, n);
  MPN_DECR_U (w3, 2 * n + 1, cy);

  /* W3H = W3H + W2L */
  cy4 = w3[2 * n] + mpn_add_n (pp + 3 * n, pp + 3 * n, w2, n);
  /* W1L + W2H */
  cy = w2[2 * n] + mpn_add_n (pp + 4 * n, w1, w2 + n, n);
  MPN_INCR_U (w1 + n, n + 1, cy);

  /* W0 = W0 + W1H */
  if (LIKELY (w0n > n))
    cy6 = w1[2 * n] + mpn_add_n (w0, w0, w1 + n, n);
  else
    cy6 = mpn_add_n (w0, w0, w1 + n, w0n);

  /*
    summation scheme for the next operation:
     |...____5|n_____4|n_____3|n_____2|n______|n______|pp
     |...w0___|_w1_w2_|_H w3__|_L w3__|_H w5__|_L w5__|
		     ...-w0___|-w1_w2 |
  */
  /* if(LIKELY(w0n>n)) the two operands below DO overlap! */
  cy = mpn_sub_n (pp + 2 * n, pp + 2 * n, pp + 4 * n, n + w0n);

  /* embankment is a "dirty trick" to avoid carry/borrow propagation
     beyond allocated memory */
  embankment = w0[w0n - 1] - 1;
  w0[w0n - 1] = 1;
  if (LIKELY (w0n > n)) {
    if (cy4 > cy6)
      MPN_INCR_U (pp + 4 * n, w0n + n, cy4 - cy6);
    else
      MPN_DECR_U (pp + 4 * n, w0n + n, cy6 - cy4);
    MPN_DECR_U (pp + 3 * n + w0n, 2 * n, cy);
    MPN_INCR_U (w0 + n, w0n - n, cy6);
  } else {
    MPN_INCR_U (pp + 4 * n, w0n + n, cy4);
    MPN_DECR_U (pp + 3 * n + w0n, 2 * n, cy + cy6);
  }
  w0[w0n - 1] += embankment;

#undef w5
#undef w3
#undef w0

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
jmp 0x4ab58
jmp 0x4ab5a
jmp 0x4ab5c
movl -0x14(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x4ab85
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rcx
shlq %rcx
addq $0x1, %rcx
callq 0x36c80
jmp 0x4aba1
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rcx
shlq %rcx
addq $0x1, %rcx
callq 0x36fe0
movq -0x28(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdx
shlq %rdx
addq $0x1, %rdx
movl $0x2, %ecx
callq 0x56880
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x8(%rbp), %rdx
movq -0x10(%rbp), %rcx
shlq %rcx
callq 0x36fe0
movq %rax, %rsi
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
shlq %rcx
movq (%rax,%rcx,8), %rdx
subq %rsi, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rdx
shlq %rdx
addq $0x1, %rdx
movl $0x1, %ecx
callq 0x56880
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rcx
shlq %rcx
addq $0x1, %rcx
callq 0x55a30
movl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4ac5f
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rcx
shlq %rcx
addq $0x1, %rcx
callq 0x558f0
jmp 0x4ac89
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rcx
shlq %rcx
addq $0x1, %rcx
callq 0x55a30
movq -0x28(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rcx
shlq %rcx
addq $0x1, %rcx
callq 0x36fe0
movq -0x28(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdx
shlq %rdx
addq $0x1, %rdx
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
xorl %eax, %eax
movl %eax, %r8d
callq 0x55430
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rcx
shlq %rcx
addq $0x1, %rcx
callq 0x36fe0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x8(%rbp), %rdx
movq -0x10(%rbp), %rcx
shlq %rcx
callq 0x36fe0
movq %rax, %rsi
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
shlq %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
shlq %rcx
movq (%rax,%rcx,8), %rdx
subq %rsi, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x8(%rbp), %rdx
movq -0x10(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x10(%rbp), %rcx
shlq %rcx
addq $0x1, %rcx
callq 0x36fe0
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rdx
shlq %rdx
addq $0x1, %rdx
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
xorl %eax, %eax
movl %eax, %r8d
callq 0x55430
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rcx
shlq %rcx
addq $0x1, %rcx
callq 0x36c80
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
imulq $0x3, -0x10(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
addq $0x8, %rax
movq -0x38(%rbp), %rcx
addq %rcx, (%rax)
jae 0x4ae0e
addq $0x1, 0x8(%rax)
leaq 0x8(%rax), %rax
jb 0x4ae03
movq %rax, -0x58(%rbp)
jmp 0x4ae14
jmp 0x4ae16
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
imulq $0x5, -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq 0x10(%rbp), %rdx
movl $0x2, %ecx
callq 0x37320
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq 0x10(%rbp), %rcx
callq 0x36fe0
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x38(%rbp), %rcx
subq %rcx, (%rax)
jae 0x4ae7c
subq $0x1, 0x8(%rax)
leaq 0x8(%rax), %rax
jb 0x4ae71
movq %rax, -0x60(%rbp)
jmp 0x4ae82
jmp 0x4ae84
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rcx
callq 0x36fe0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
shlq %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x38(%rbp), %rcx
subq %rcx, (%rax)
jae 0x4aed9
subq $0x1, 0x8(%rax)
leaq 0x8(%rax), %rax
jb 0x4aece
movq %rax, -0x68(%rbp)
jmp 0x4aedf
jmp 0x4aee1
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
shlq %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
shlq %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xb0(%rbp)
movq -0x8(%rbp), %rdi
imulq $0x3, -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
imulq $0x3, -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rcx
callq 0x36c80
movq %rax, %rcx
movq -0xb0(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
shlq %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xa8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
shlq $0x2, %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x10(%rbp), %rcx
callq 0x36c80
movq %rax, %rcx
movq -0xa8(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x38(%rbp), %rcx
addq %rcx, (%rax)
jae 0x4afbc
addq $0x1, 0x8(%rax)
leaq 0x8(%rax), %rax
jb 0x4afb1
movq %rax, -0x70(%rbp)
jmp 0x4afc2
jmp 0x4afc4
movq 0x10(%rbp), %rax
cmpq -0x10(%rbp), %rax
setg %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x4b048
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
shlq %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xb8(%rbp)
movq -0x8(%rbp), %rdi
imulq $0x5, -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
imulq $0x5, -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x30(%rbp), %rdx
movq -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x10(%rbp), %rcx
callq 0x36c80
movq %rax, %rcx
movq -0xb8(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x48(%rbp)
jmp 0x4b084
movq -0x8(%rbp), %rdi
imulq $0x5, -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
imulq $0x5, -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x30(%rbp), %rdx
movq -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq 0x10(%rbp), %rcx
callq 0x36c80
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x8(%rbp), %rdx
movq -0x10(%rbp), %rax
shlq $0x2, %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x10(%rbp), %rcx
addq 0x10(%rbp), %rcx
callq 0x36fe0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
imulq $0x5, -0x10(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq 0x10(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
subq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
imulq $0x5, -0x10(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq 0x10(%rbp), %rcx
subq $0x1, %rcx
movq $0x1, (%rax,%rcx,8)
movq 0x10(%rbp), %rax
cmpq -0x10(%rbp), %rax
setg %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x4b229
movq -0x40(%rbp), %rax
cmpq -0x48(%rbp), %rax
jbe 0x4b178
jmp 0x4b143
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
shlq $0x2, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x40(%rbp), %rcx
subq -0x48(%rbp), %rcx
addq %rcx, (%rax)
jae 0x4b16e
addq $0x1, 0x8(%rax)
leaq 0x8(%rax), %rax
jb 0x4b163
movq %rax, -0x78(%rbp)
jmp 0x4b174
jmp 0x4b176
jmp 0x4b1af
jmp 0x4b17a
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
shlq $0x2, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x48(%rbp), %rcx
subq -0x40(%rbp), %rcx
subq %rcx, (%rax)
jae 0x4b1a5
subq $0x1, 0x8(%rax)
leaq 0x8(%rax), %rax
jb 0x4b19a
movq %rax, -0x80(%rbp)
jmp 0x4b1ab
jmp 0x4b1ad
jmp 0x4b1af
jmp 0x4b1b1
movq -0x8(%rbp), %rax
imulq $0x3, -0x10(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq 0x10(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x38(%rbp), %rcx
subq %rcx, (%rax)
jae 0x4b1e0
subq $0x1, 0x8(%rax)
leaq 0x8(%rax), %rax
jb 0x4b1d5
movq %rax, -0x88(%rbp)
jmp 0x4b1e9
jmp 0x4b1eb
jmp 0x4b1ed
movq -0x8(%rbp), %rax
imulq $0x5, -0x10(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x48(%rbp), %rcx
addq %rcx, (%rax)
jae 0x4b21c
addq $0x1, 0x8(%rax)
leaq 0x8(%rax), %rax
jb 0x4b211
movq %rax, -0x90(%rbp)
jmp 0x4b225
jmp 0x4b227
jmp 0x4b29f
jmp 0x4b22b
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
shlq $0x2, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x40(%rbp), %rcx
addq %rcx, (%rax)
jae 0x4b252
addq $0x1, 0x8(%rax)
leaq 0x8(%rax), %rax
jb 0x4b247
movq %rax, -0x98(%rbp)
jmp 0x4b25b
jmp 0x4b25d
jmp 0x4b25f
movq -0x8(%rbp), %rax
imulq $0x3, -0x10(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq 0x10(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x38(%rbp), %rcx
addq -0x48(%rbp), %rcx
subq %rcx, (%rax)
jae 0x4b292
subq $0x1, 0x8(%rax)
leaq 0x8(%rax), %rax
jb 0x4b287
movq %rax, -0xa0(%rbp)
jmp 0x4b29b
jmp 0x4b29d
jmp 0x4b29f
movq -0x50(%rbp), %rdx
movq -0x8(%rbp), %rax
imulq $0x5, -0x10(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq 0x10(%rbp), %rcx
subq $0x1, %rcx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax)