// File: marxn[P]pupp/3rdparty/gmp/gen-trialdivtab.c
// Function: mpn_mod_1s_4p_cps
void
mpn_mod_1s_4p_cps (mpz_t cps[7], mpz_t bparm)
{
  mpz_t b, bi;
  mpz_t B1modb, B2modb, B3modb, B4modb, B5modb;
  mpz_t t;
  int cnt;

  mpz_init_set (b, bparm);

  cnt = limb_bits - mpz_log2 (b);

  mpz_init (bi);
  mpz_init (t);
  mpz_init (B1modb);
  mpz_init (B2modb);
  mpz_init (B3modb);
  mpz_init (B4modb);
  mpz_init (B5modb);

  mpz_set_ui (t, 1);
  mpz_mul_2exp (t, t, limb_bits - cnt);
  mpz_sub (t, t, b);
  mpz_mul_2exp (t, t, limb_bits);
  mpz_tdiv_q (bi, t, b);		/* bi = B^2/b, except msb */

  mpz_set_ui (t, 1);
  mpz_mul_2exp (t, t, limb_bits);	/* t = B */
  mpz_tdiv_r (B1modb, t, b);

  mpz_mul_2exp (t, B1modb, limb_bits);
  mpz_tdiv_r (B2modb, t, b);

  mpz_mul_2exp (t, B2modb, limb_bits);
  mpz_tdiv_r (B3modb, t, b);

  mpz_mul_2exp (t, B3modb, limb_bits);
  mpz_tdiv_r (B4modb, t, b);

  mpz_mul_2exp (t, B4modb, limb_bits);
  mpz_tdiv_r (B5modb, t, b);

  mpz_set (cps[0], bi);
  mpz_set_ui (cps[1], cnt);
  mpz_tdiv_q_2exp (cps[2], B1modb, 0);
  mpz_tdiv_q_2exp (cps[3], B2modb, 0);
  mpz_tdiv_q_2exp (cps[4], B3modb, 0);
  mpz_tdiv_q_2exp (cps[5], B4modb, 0);
  mpz_tdiv_q_2exp (cps[6], B5modb, 0);

  mpz_clear (b);
  mpz_clear (bi);
  mpz_clear (t);
  mpz_clear (B1modb);
  mpz_clear (B2modb);
  mpz_clear (B3modb);
  mpz_clear (B4modb);
  mpz_clear (B5modb);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3550
movslq 0x71b9(%rip), %rax      # 0x130b0
movq %rax, -0xa0(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xc230
movq %rax, %rcx
movq -0xa0(%rbp), %rax
subq %rcx, %rax
movl %eax, -0x94(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x31e0
leaq -0x90(%rbp), %rdi
callq 0x31e0
leaq -0x40(%rbp), %rdi
callq 0x31e0
leaq -0x50(%rbp), %rdi
callq 0x31e0
leaq -0x60(%rbp), %rdi
callq 0x31e0
leaq -0x70(%rbp), %rdi
callq 0x31e0
leaq -0x80(%rbp), %rdi
callq 0x31e0
leaq -0x90(%rbp), %rdi
movl $0x1, %esi
callq 0x3350
leaq -0x90(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl 0x712f(%rip), %eax      # 0x130b0
subl -0x94(%rbp), %eax
movslq %eax, %rdx
callq 0x5000
leaq -0x90(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x4c50
leaq -0x90(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movslq 0x70f5(%rip), %rdx      # 0x130b0
callq 0x5000
leaq -0x30(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x57c0
leaq -0x90(%rbp), %rdi
movl $0x1, %esi
callq 0x3350
leaq -0x90(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movslq 0x70b6(%rip), %rdx      # 0x130b0
callq 0x5000
leaq -0x40(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x5880
leaq -0x90(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movslq 0x708b(%rip), %rdx      # 0x130b0
callq 0x5000
leaq -0x50(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x5880
leaq -0x90(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movslq 0x7060(%rip), %rdx      # 0x130b0
callq 0x5000
leaq -0x60(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x5880
leaq -0x90(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movslq 0x7035(%rip), %rdx      # 0x130b0
callq 0x5000
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x5880
leaq -0x90(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movslq 0x700a(%rip), %rdx      # 0x130b0
callq 0x5000
leaq -0x80(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x5880
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3390
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
movslq -0x94(%rbp), %rsi
callq 0x3350
movq -0x8(%rbp), %rdi
addq $0x20, %rdi
leaq -0x40(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x5b80
movq -0x8(%rbp), %rdi
addq $0x30, %rdi
leaq -0x50(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x5b80
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
leaq -0x60(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x5b80
movq -0x8(%rbp), %rdi
addq $0x50, %rdi
leaq -0x70(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x5b80
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
leaq -0x80(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x5b80
leaq -0x20(%rbp), %rdi
callq 0x32c0
leaq -0x30(%rbp), %rdi
callq 0x32c0
leaq -0x90(%rbp), %rdi
callq 0x32c0
leaq -0x40(%rbp), %rdi
callq 0x32c0
leaq -0x50(%rbp), %rdi
callq 0x32c0
leaq -0x60(%rbp), %rdi
callq 0x32c0
leaq -0x70(%rbp), %rdi
callq 0x32c0
leaq -0x80(%rbp), %rdi
callq 0x32c0
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)