// File: /workspace/github_cpp_makefile_star2_O1/marxn[P]pupp/3rdparty/gmp/mpn/toom_eval_dgr3_pm2.c
// Function: _gmpn_toom_eval_dgr3_pm2
int
mpn_toom_eval_dgr3_pm2 (mp_ptr xp2, mp_ptr xm2,
			mp_srcptr xp, mp_size_t n, mp_size_t x3n, mp_ptr tp)
{
  mp_limb_t cy;
  int neg;

  ASSERT (x3n > 0);
  ASSERT (x3n <= n);

  /* (x0 + 4 * x2) +/- (2 x1 + 8 x_3) */
#if HAVE_NATIVE_mpn_addlsh_n || HAVE_NATIVE_mpn_addlsh2_n
#if HAVE_NATIVE_mpn_addlsh2_n
  xp2[n] = mpn_addlsh2_n (xp2, xp, xp + 2*n, n);

  cy = mpn_addlsh2_n (tp, xp + n, xp + 3*n, x3n);
#else /* HAVE_NATIVE_mpn_addlsh_n */
  xp2[n] = mpn_addlsh_n (xp2, xp, xp + 2*n, n, 2);

  cy = mpn_addlsh_n (tp, xp + n, xp + 3*n, x3n, 2);
#endif
  if (x3n < n)
    cy = mpn_add_1 (tp + x3n, xp + n + x3n, n - x3n, cy);
  tp[n] = cy;
#else
  cy = mpn_lshift (tp, xp + 2*n, n, 2);
  xp2[n] = cy + mpn_add_n (xp2, tp, xp, n);

  tp[x3n] = mpn_lshift (tp, xp + 3*n, x3n, 2);
  if (x3n < n)
    tp[n] = mpn_add (tp, xp + n, n, tp, x3n + 1);
  else
    tp[n] += mpn_add_n (tp, xp + n, tp, n);
#endif
  mpn_lshift (tp, tp, n+1, 1);

  neg = (mpn_cmp (xp2, tp, n + 1) < 0) ? ~0 : 0;

#if HAVE_NATIVE_mpn_add_n_sub_n
  if (neg)
    mpn_add_n_sub_n (xp2, xm2, tp, xp2, n + 1);
  else
    mpn_add_n_sub_n (xp2, xm2, xp2, tp, n + 1);
#else
  if (neg)
    mpn_sub_n (xm2, tp, xp2, n + 1);
  else
    mpn_sub_n (xm2, xp2, tp, n + 1);

  mpn_add_n (xp2, xp2, tp, n + 1);
#endif

  ASSERT (xp2[n] < 15);
  ASSERT (xm2[n] < 10);

  return neg;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %rbp
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, (%rsp)
movq %rdi, %r15
movq %rcx, %rdx
shlq $0x4, %rdx
addq %r12, %rdx
movq %r12, %rsi
callq 0x2fb60
movq %rax, (%r15,%r14,8)
leaq (%r12,%r14,8), %r13
leaq (%r14,%r14,2), %rax
leaq (%r12,%rax,8), %rdx
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rcx
callq 0x2fb60
movq %r14, %rcx
subq %rbp, %rcx
jle 0x27aab
addq (%r13,%rbp,8), %rax
movq %rax, (%rbx,%rbp,8)
jae 0x27a80
leaq (%rbx,%rbp,8), %rdx
leaq (,%rbp,8), %rsi
addq %r13, %rsi
cmpq $0x2, %rcx
movl $0x1, %eax
movl $0x1, %r8d
cmovgeq %rcx, %r8
movl $0x1, %r9d
cmpq %r9, %r8
je 0x27aab
movq (%rsi,%r9,8), %r10
leaq 0x1(%r9), %rdi
incq %r10
movq %r10, (%rdx,%r9,8)
movq %rdi, %r9
je 0x27a3d
cmpq %rbx, %r13
setne %al
cmpq %rcx, %rdi
setl %r8b
andb %al, %r8b
cmpb $0x1, %r8b
jne 0x27aa9
xorl %eax, %eax
movq (%rsi,%rdi,8), %r8
movq %r8, (%rdx,%rdi,8)
incq %rdi
cmpq %rcx, %rdi
jl 0x27a6e
jmp 0x27aab
cmpq %rbx, %r13
sete %al
cmpq $0x2, %rcx
setl %cl
orb %al, %cl
jne 0x27aa9
incq %rbp
xorl %eax, %eax
movq (%r13,%rbp,8), %rcx
movq %rcx, (%rbx,%rbp,8)
incq %rbp
cmpq %rbp, %r14
jne 0x27a96
jmp 0x27aab
xorl %eax, %eax
movq %rax, (%rbx,%r14,8)
incq %r14
movq %rbx, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl $0x1, %ecx
callq 0x1c4a0
movq %r14, %rax
testq %rax, %rax
jle 0x27aec
movq -0x8(%r15,%rax,8), %rcx
movq -0x8(%rbx,%rax,8), %rdx
decq %rax
cmpq %rdx, %rcx
je 0x27ac8
xorl %ebp, %ebp
cmpq %rcx, %rdx
adcl $-0x1, %ebp
orl $0x1, %ebp
jmp 0x27aee
xorl %ebp, %ebp
testl %ebp, %ebp
js 0x27afe
movq (%rsp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
jmp 0x27b08
movq (%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x1c1c0
sarl $0x1f, %ebp
movq %r15, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x1bfa0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)