user: Please show me the C implementation that matches the assembly code listed below:

```asm
<mp_invisqrt_newton>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%r12d
  mov    %esi,%r13d
  mov    %edx,0xc(%rsp)
  mov    %r8,%r14
  mov    %r9,%rbx
  mov    0x50(%rsp),%r15d
  mov    %r15d,%eax
  sar    %eax
  mov    %eax,%edx
  add    $0x1,%edx
  mov    %edi,%ebp
  shr    $0x1f,%ebp
  add    %edi,%ebp
  sar    %ebp
  add    $0x1,%ebp
  mov    %edi,%eax
  sub    %edx,%eax
  cmp    %eax,%ebp
  cmovl  %eax,%ebp
  mov    %rcx,(%rsp)
  call   <mp_round@plt>
  sub    $0x8,%rsp
  push   0x68(%rsp)
  mov    0x68(%rsp),%r9
  mov    %r15d,%r8d
  mov    %r14,%rcx
  mov    0x10(%rsp),%rdx
  mov    %r13d,%esi
  mov    %r12d,%edi
  call   <mp_squh_save_infft@plt>
  mov    %r14,%r8
  mov    0x1c(%rsp),%ecx
  mov    %r14,%rdx
  mov    %r13d,%esi
  mov    %r12d,%edi
  call   <mp_imul@plt>
  mov    %rbx,%rdx
  mov    %r13d,%esi
  mov    %r12d,%edi
  call   <mp_load_1@plt>
  mov    %rbx,%r8
  mov    %r14,%rcx
  mov    %rbx,%rdx
  mov    %r13d,%esi
  mov    %r12d,%edi
  call   <mp_sub@plt>
  add    $0x10,%rsp
  mov    0x4(%rbx),%eax
  neg    %eax
  lea    0x1(%r15),%r14d
  cmpl   $0x0,(%rbx)
  cmovne %eax,%r14d
  push   0x60(%rsp)
  push   %r15
  mov    %rbx,%r9
  mov    %rbx,%r8
  mov    $0x0,%ecx
  mov    0x68(%rsp),%rdx
  mov    %r13d,%esi
  mov    %ebp,%edi
  call   <mp_mulh_use_in1fft@plt>
  mov    %rbx,%rcx
  mov    %rbx,%rdx
  mov    %r13d,%esi
  mov    %ebp,%edi
  call   <mp_idiv_2@plt>
  add    $0x10,%rsp
  cmpl   $0x0,(%rbx)
  jne    L17
L3:
  mov    %r14d,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L17:
  mov    (%rsp),%rdx
  mov    %rdx,%r8
  mov    %rbx,%rcx
  mov    %r13d,%esi
  mov    %r12d,%edi
  call   <mp_add@plt>
  jmp    L3
```

assistant: ```c
int mp_invisqrt_newton(int n, int radix, int in, int inout[], int tmp1[], int tmp2[], int nfft, double tmp1fft[], double tmp2fft[]) {
  void mp_load_1(int n, int radix, int out[]);
  void mp_round(int n, int radix, int m, int inout[]);
  void mp_add(int n, int radix, int in1[], int in2[], int out[]);
  void mp_sub(int n, int radix, int in1[], int in2[], int out[]);
  void mp_imul(int n, int radix, int in1[], int in2, int out[]);
  void mp_idiv_2(int n, int radix, int in[], int out[]);
  void mp_squh_save_infft(int n, int radix, int in[], int out[], int nfft, double infft[], double outfft[]);
  void mp_mulh_use_in1fft(int n, int radix, double in1fft[], int shift, int in2[], int out[], int nfft, double outfft[]);
  int n_h, shift, prc;
  shift = (nfft >> 1) + 1;
  n_h = n / 2 + 1;
  if (n_h < n - shift) {
    n_h = n - shift;
  }
  mp_round(n, radix, shift, inout);
  mp_squh_save_infft(n, radix, inout, tmp1, nfft, tmp1fft, tmp2fft);
  mp_imul(n, radix, tmp1, in, tmp1);
  mp_load_1(n, radix, tmp2);
  mp_sub(n, radix, tmp2, tmp1, tmp2);
  prc = -tmp2[1];
  if (tmp2[0] == 0) {
    prc = nfft + 1;
  }
  mp_mulh_use_in1fft(n_h, radix, tmp1fft, 0, tmp2, tmp2, nfft, tmp2fft);
  mp_idiv_2(n_h, radix, tmp2, tmp2);
  if (tmp2[0] != 0) {
    mp_add(n, radix, inout, tmp2, inout);
  }
  return prc;
}
```