user: Translate the below assembly code into C programming language:

```asm
<mpfr_atrig>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %esi,-0x38(%rbp)
  mov    %rdx,-0x40(%rbp)
  mov    %ecx,-0x44(%rbp)
  mov    %r8d,-0x48(%rbp)
  mov    %r9,-0x50(%rbp)
  mov    D164(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,-0x50(%rbp)
  je     L46
  mov    D76(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,-0x50(%rbp)
  jne    L146
L46:
  mov    $0x1,%eax
  jmp    L125
L146:
  mov    $0x0,%eax
L125:
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x48(%rbp),%eax
  mov    %eax,%edi
  call   <mpz_sgn@plt>
  test   %rax,%rax
  jne    L177
  cmpl   $0x0,-0x44(%rbp)
  je     L121
  mov    D164(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,-0x50(%rbp)
  je     L71
  mov    D76(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,-0x50(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    D164(%rip),%rax
  mov    (%rax),%rax
  jmp    L169
L71:
  mov    D76(%rip),%rax
  mov    (%rax),%rax
L169:
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0x38(%rbp),%ecx
  mov    -0x34(%rbp),%eax
  mov    -0x40(%rbp),%r8
  mov    %ecx,%esi
  mov    %eax,%edi
  call   *%r8
  neg    %eax
  mov    %eax,-0x24(%rbp)
  mov    -0x50(%rbp),%rdx
  mov    -0x34(%rbp),%ecx
  mov    -0x34(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <mpfr_neg@plt>
  jmp    L108
L121:
  mov    -0x50(%rbp),%rdx
  mov    -0x38(%rbp),%ecx
  mov    -0x34(%rbp),%eax
  mov    -0x40(%rbp),%r8
  mov    %ecx,%esi
  mov    %eax,%edi
  call   *%r8
  mov    %eax,-0x24(%rbp)
L108:
  mov    -0x24(%rbp),%eax
  jmp    L58
L177:
  mov    $0x0,%eax
  call   <mpfr_get_emin@plt>
  mov    %eax,-0x1c(%rbp)
  mov    $0x0,%eax
  call   <mpfr_get_emax@plt>
  mov    %eax,-0x18(%rbp)
  mov    $0x0,%eax
  call   <mpfr_get_emin_min@plt>
  mov    %eax,%edi
  call   <mpfr_set_emin@plt>
  mov    $0x0,%eax
  call   <mpfr_get_emax_max@plt>
  mov    %eax,%edi
  call   <mpfr_set_emax@plt>
  mov    -0x34(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_get_prec@plt>
  add    %eax,%eax
  mov    %eax,-0x20(%rbp)
L144:
  mov    -0x20(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <mpfr_init2@plt>
  mov    -0x20(%rbp),%edx
  mov    -0x10(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <mpfr_init2@plt>
  mov    -0x20(%rbp),%edx
  mov    -0xc(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <mpfr_init2@plt>
  mov    D76(%rip),%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <mpfr_const_pi@plt>
  mov    D76(%rip),%rax
  mov    (%rax),%rcx
  mov    -0x48(%rbp),%edx
  mov    -0x14(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_mul_z@plt>
  cmpl   $0x0,-0x44(%rbp)
  je     L118
  mov    D164(%rip),%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%ecx
  mov    -0xc(%rbp),%eax
  mov    -0x40(%rbp),%r8
  mov    %ecx,%esi
  mov    %eax,%edi
  call   *%r8
  mov    D76(%rip),%rax
  mov    (%rax),%rcx
  mov    -0xc(%rbp),%edx
  mov    -0x14(%rbp),%esi
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_sub@plt>
  jmp    L50
L118:
  mov    D76(%rip),%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%ecx
  mov    -0x10(%rbp),%eax
  mov    -0x40(%rbp),%r8
  mov    %ecx,%esi
  mov    %eax,%edi
  call   *%r8
  mov    D76(%rip),%rax
  mov    (%rax),%rcx
  mov    -0x10(%rbp),%edx
  mov    -0x14(%rbp),%esi
  mov    -0x10(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_add@plt>
L50:
  mov    D164(%rip),%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <mpfr_const_pi@plt>
  mov    D164(%rip),%rax
  mov    (%rax),%rcx
  mov    -0x48(%rbp),%edx
  mov    -0x14(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_mul_z@plt>
  cmpl   $0x0,-0x44(%rbp)
  je     L73
  mov    D76(%rip),%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%ecx
  mov    -0x10(%rbp),%eax
  mov    -0x40(%rbp),%r8
  mov    %ecx,%esi
  mov    %eax,%edi
  call   *%r8
  mov    D164(%rip),%rax
  mov    (%rax),%rcx
  mov    -0x10(%rbp),%edx
  mov    -0x14(%rbp),%esi
  mov    -0x10(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_sub@plt>
  jmp    L163
L73:
  mov    D164(%rip),%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%ecx
  mov    -0xc(%rbp),%eax
  mov    -0x40(%rbp),%r8
  mov    %ecx,%esi
  mov    %eax,%edi
  call   *%r8
  mov    D164(%rip),%rax
  mov    (%rax),%rcx
  mov    -0xc(%rbp),%edx
  mov    -0x14(%rbp),%esi
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_add@plt>
L163:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_clear@plt>
  mov    -0x34(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_get_prec@plt>
  mov    %eax,%ecx
  mov    -0x50(%rbp),%rdx
  mov    -0x10(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <mpfr_prec_round@plt>
  mov    -0x34(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_get_prec@plt>
  mov    %eax,%ecx
  mov    -0x50(%rbp),%rdx
  mov    -0xc(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <mpfr_prec_round@plt>
  mov    -0xc(%rbp),%edx
  mov    -0x10(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <mpfr_cmp@plt>
  test   %rax,%rax
  jne    L42
  mov    -0x50(%rbp),%rdx
  mov    -0x10(%rbp),%ecx
  mov    -0x34(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <mpfr_set@plt>
  mov    -0x10(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_clear@plt>
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_clear@plt>
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_set_emin@plt>
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_set_emax@plt>
  mov    D164(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,-0x50(%rbp)
  jne    L157
  mov    $0x1,%ecx
  jmp    L93
L157:
  mov    $0xffffffff,%ecx
L93:
  mov    -0x50(%rbp),%rdx
  mov    -0x34(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <mpfr_check_range@plt>
  jmp    L58
L42:
  mov    -0x10(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_clear@plt>
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_clear@plt>
  mov    -0x34(%rbp),%eax
  mov    %eax,%edi
  call   <mpfr_get_prec@plt>
  add    %eax,-0x20(%rbp)
  jmp    L144
L58:
  leave
  ret
```

assistant: ```c
int mpfr_atrig(mpfr_ptr rop, mpfr_srcptr op, int (*fun)(mpfr_ptr rop, mpfr_srcptr op, mpfr_rnd_t rnd), int sub, mpz_t npi, mpfr_rnd_t rnd) {
  assert(rnd == MPFR_RNDU || rnd == MPFR_RNDD);
  int t;
  if (mpz_sgn(npi) == 0) {
    if (sub) {
      mpfr_rnd_t rnd1 = rnd == MPFR_RNDU ? MPFR_RNDD : (assert(rnd == MPFR_RNDD), MPFR_RNDU);
      t = -(*fun)(rop, op, rnd1);
      mpfr_neg(rop, rop, rnd);
    } else {
      t = (*fun)(rop, op, rnd);
    }
    return t;
  }
  mpfr_exp_t emin_rop = mpfr_get_emin();
  mpfr_exp_t emax_rop = mpfr_get_emax();
  mpfr_set_emin(mpfr_get_emin_min());
  mpfr_set_emax(mpfr_get_emax_max());
  mpfr_prec_t prec = mpfr_get_prec(rop) * 2;
  for (;;) {
    mpfr_t pi, inf, sup;
    mpfr_init2(pi, prec);
    mpfr_init2(inf, prec);
    mpfr_init2(sup, prec);
    mpfr_const_pi(pi, MPFR_RNDD);
    mpfr_mul_z(pi, pi, npi, MPFR_RNDD);
    if (sub) {
      (*fun)(sup, op, MPFR_RNDU);
      mpfr_sub(sup, pi, sup, MPFR_RNDD);
    } else {
      (*fun)(inf, op, MPFR_RNDD);
      mpfr_add(inf, pi, inf, MPFR_RNDD);
    }
    mpfr_const_pi(pi, MPFR_RNDU);
    mpfr_mul_z(pi, pi, npi, MPFR_RNDU);
    if (sub) {
      (*fun)(inf, op, MPFR_RNDD);
      mpfr_sub(inf, pi, inf, MPFR_RNDU);
    } else {
      (*fun)(sup, op, MPFR_RNDU);
      mpfr_add(sup, pi, sup, MPFR_RNDU);
    }
    mpfr_clear(pi);
    mpfr_prec_round(inf, mpfr_get_prec(rop), rnd);
    mpfr_prec_round(sup, mpfr_get_prec(rop), rnd);
    if (mpfr_cmp(inf, sup) == 0) {
      mpfr_set(rop, inf, rnd);
      mpfr_clear(inf);
      mpfr_clear(sup);
      mpfr_set_emin(emin_rop);
      mpfr_set_emax(emax_rop);
      return mpfr_check_range(rop, rnd == MPFR_RNDU ? 1 : -1, rnd);
    }
    mpfr_clear(inf);
    mpfr_clear(sup);
    prec += mpfr_get_prec(rop);
  }
}
```