// File: /workspace/github_cpp_makefile_star2_O1/marxn[P]pupp/3rdparty/gmp/mpn/toom_eval_pm1.c
// Function: _gmpn_toom_eval_pm1
int
mpn_toom_eval_pm1 (mp_ptr xp1, mp_ptr xm1, unsigned k,
		   mp_srcptr xp, mp_size_t n, mp_size_t hn, mp_ptr tp)
{
  unsigned i;
  int neg;

  ASSERT (k >= 4);

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

  /* The degree k is also the number of full-size coefficients, so
   * that last coefficient, of size hn, starts at xp + k*n. */

  xp1[n] = mpn_add_n (xp1, xp, xp + 2*n, n);
  for (i = 4; i < k; i += 2)
    ASSERT_NOCARRY (mpn_add (xp1, xp1, n+1, xp+i*n, n));

  tp[n] = mpn_add_n (tp, xp + n, xp + 3*n, n);
  for (i = 5; i < k; i += 2)
    ASSERT_NOCARRY (mpn_add (tp, tp, n+1, xp+i*n, n));

  if (k & 1)
    ASSERT_NOCARRY (mpn_add (tp, tp, n+1, xp+k*n, hn));
  else
    ASSERT_NOCARRY (mpn_add (xp1, xp1, n+1, xp+k*n, hn));

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

#if HAVE_NATIVE_mpn_add_n_sub_n
  if (neg)
    mpn_add_n_sub_n (xp1, xm1, tp, xp1, n + 1);
  else
    mpn_add_n_sub_n (xp1, xm1, xp1, tp, n + 1);
#else
  if (neg)
    mpn_sub_n (xm1, tp, xp1, n + 1);
  else
    mpn_sub_n (xm1, xp1, tp, n + 1);

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

  ASSERT (xp1[n] <= k);
  ASSERT (xm1[n] <= k/2 + 1);

  return neg;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r13
movq %r8, %rbx
movl %edx, %r12d
movq %rsi, 0x10(%rsp)
movq %rdi, %r14
movq 0x50(%rsp), %r15
movq %r8, %rdx
shlq $0x4, %rdx
addq %rcx, %rdx
movq %rcx, 0x8(%rsp)
movq %rcx, %rsi
movq %r8, %rcx
callq 0x1bfa0
movq %rax, (%r14,%rbx,8)
cmpl $0x5, %r12d
jb 0x27bc6
movl $0x4, %ebp
testq %rbx, %rbx
je 0x27bbe
movl %ebp, %eax
imulq %rbx, %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %rdx
movq %r14, %rdi
movq %r14, %rsi
movq %rbx, %rcx
callq 0x1bfa0
testq %rax, %rax
je 0x27bbe
movq %rbx, %rax
cmpq %rbx, %rax
jg 0x27bbe
incq (%r14,%rax,8)
leaq 0x1(%rax), %rax
je 0x27baf
addl $0x2, %ebp
cmpl %r12d, %ebp
jb 0x27b85
movq 0x8(%rsp), %rcx
leaq (%rcx,%rbx,8), %rsi
leaq (%rbx,%rbx,2), %rax
leaq (%rcx,%rax,8), %rdx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x1bfa0
movq %rax, (%r15,%rbx,8)
cmpl $0x6, %r12d
jb 0x27c32
movl $0x5, %ebp
testq %rbx, %rbx
je 0x27c2a
movl %ebp, %eax
imulq %rbx, %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %rdx
movq %r15, %rdi
movq %r15, %rsi
movq %rbx, %rcx
callq 0x1bfa0
testq %rax, %rax
je 0x27c2a
movq %rbx, %rax
cmpq %rbx, %rax
jg 0x27c2a
incq (%r15,%rax,8)
leaq 0x1(%rax), %rax
je 0x27c1b
addl $0x2, %ebp
cmpl %r12d, %ebp
jb 0x27bf1
testb $0x1, %r12b
jne 0x27c71
testq %r13, %r13
je 0x27ca8
movl %r12d, %eax
imulq %rbx, %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %rdx
movq %r14, %rdi
movq %r14, %rsi
movq %r13, %rcx
callq 0x1bfa0
testq %rax, %rax
je 0x27ca8
cmpq %rbx, %r13
jg 0x27ca8
incq (%r14,%r13,8)
leaq 0x1(%r13), %r13
je 0x27c60
jmp 0x27ca8
testq %r13, %r13
je 0x27ca8
movl %r12d, %eax
imulq %rbx, %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %rdx
movq %r15, %rdi
movq %r15, %rsi
movq %r13, %rcx
callq 0x1bfa0
testq %rax, %rax
je 0x27ca8
cmpq %rbx, %r13
jg 0x27ca8
incq (%r15,%r13,8)
leaq 0x1(%r13), %r13
je 0x27c99
incq %rbx
movq %rbx, %rax
testq %rax, %rax
jle 0x27cd2
movq -0x8(%r14,%rax,8), %rcx
movq -0x8(%r15,%rax,8), %rdx
decq %rax
cmpq %rdx, %rcx
je 0x27cae
xorl %ebp, %ebp
cmpq %rcx, %rdx
adcl $-0x1, %ebp
orl $0x1, %ebp
jmp 0x27cd4
xorl %ebp, %ebp
testl %ebp, %ebp
js 0x27ce5
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
jmp 0x27cf0
movq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1c1c0
sarl $0x1f, %ebp
movq %r14, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x1bfa0
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)