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

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

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;
}
```