// File: /workspace/github_cpp_makefile_star2_O3/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 0x1ba80
movq %rax, (%r14,%rbx,8)
cmpl $0x5, %r12d
jb 0x27872
movl $0x4, %ebp
testq %rbx, %rbx
je 0x2786a
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 0x1ba80
testq %rax, %rax
je 0x2786a
movq %rbx, %rax
cmpq %rbx, %rax
jg 0x2786a
incq (%r14,%rax,8)
leaq 0x1(%rax), %rax
je 0x2785b
addl $0x2, %ebp
cmpl %r12d, %ebp
jb 0x27831
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 0x1ba80
movq %rax, (%r15,%rbx,8)
cmpl $0x6, %r12d
jb 0x278de
movl $0x5, %ebp
testq %rbx, %rbx
je 0x278d6
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 0x1ba80
testq %rax, %rax
je 0x278d6
movq %rbx, %rax
cmpq %rbx, %rax
jg 0x278d6
incq (%r15,%rax,8)
leaq 0x1(%rax), %rax
je 0x278c7
addl $0x2, %ebp
cmpl %r12d, %ebp
jb 0x2789d
testb $0x1, %r12b
jne 0x2791d
testq %r13, %r13
je 0x27954
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 0x1ba80
testq %rax, %rax
je 0x27954
cmpq %rbx, %r13
jg 0x27954
incq (%r14,%r13,8)
leaq 0x1(%r13), %r13
je 0x2790c
jmp 0x27954
testq %r13, %r13
je 0x27954
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 0x1ba80
testq %rax, %rax
je 0x27954
cmpq %rbx, %r13
jg 0x27954
incq (%r15,%r13,8)
leaq 0x1(%r13), %r13
je 0x27945
incq %rbx
movq %rbx, %rax
testq %rax, %rax
jle 0x27974
movq -0x8(%r15,%rax,8), %rcx
leaq -0x1(%rax), %rdx
cmpq %rcx, -0x8(%r14,%rax,8)
movq %rdx, %rax
je 0x2795a
jbe 0x2798b
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x1bca0
xorl %ebp, %ebp
jmp 0x279a3
movq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1bca0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %r14, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x1ba80
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)