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

```asm
<mp_inv_newton>:
  endbr64
  push   %r15
  mov    %r8,%r15
  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
  add    %edi,%ebp
  sar    %ebp
  sub    $0x28,%rsp
  add    $0x1,%ebp
  mov    0x60(%rsp),%ebx
  mov    %rdx,0x10(%rsp)
  mov    %edi,%edx
  mov    %rcx,0x8(%rsp)
  mov    %ebx,%r10d
  sar    %r10d
  add    $0x1,%r10d
  sub    %r10d,%edx
  mov    %r10d,0x1c(%rsp)
  cmp    %edx,%ebp
  cmovl  %edx,%ebp
  mov    %r10d,%edx
  call   <mp_round@plt>
  push   0x70(%rsp)
  mov    %ebx,%r9d
  mov    %r15,%r8
  push   0x70(%rsp)
  mov    %r14d,%esi
  mov    %r13d,%edi
  mov    0x20(%rsp),%rcx
  mov    0x18(%rsp),%rdx
  call   <mp_mulh@plt>
  mov    %r12,%rdx
  mov    %r14d,%esi
  mov    %r13d,%edi
  call   <mp_load_1@plt>
  mov    %r15,%rcx
  mov    %r12,%r8
  mov    %r12,%rdx
  mov    %r14d,%esi
  mov    %r13d,%edi
  call   <mp_sub@plt>
  mov    %r15,%r9
  mov    %r14d,%esi
  mov    %r13d,%edi
  push   0x80(%rsp)
  push   %rbx
  mov    0x30(%rsp),%r8
  mov    0x3c(%rsp),%ecx
  mov    0x88(%rsp),%rdx
  call   <mp_mulh_use_in1fft@plt>
  add    $0x20,%rsp
  mov    %r15,%rcx
  mov    %r12,%r8
  mov    %r12,%rdx
  mov    %r14d,%esi
  lea    0x1(%rbx),%r15d
  mov    %ebp,%edi
  call   <mp_sub@plt>
  mov    (%r12),%edx
  mov    0x4(%r12),%eax
  mov    %ebp,%edi
  push   0x70(%rsp)
  mov    %r14d,%esi
  mov    %r12,%r9
  mov    %r12,%r8
  push   %rbx
  neg    %eax
  test   %edx,%edx
  mov    0x78(%rsp),%rdx
  cmovne %eax,%r15d
  xor    %ecx,%ecx
  call   <mp_mulh_use_in1fft@plt>
  mov    (%r12),%edi
  pop    %rcx
  pop    %rsi
  mov    0x8(%rsp),%r11
  test   %edi,%edi
  jne    L8
L18:
  add    $0x28,%rsp
  mov    %r15d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L8:
  mov    %r11,%r8
  mov    %r12,%rcx
  mov    %r11,%rdx
  mov    %r14d,%esi
  mov    %r13d,%edi
  call   <mp_add@plt>
  jmp    L18
```

assistant: ```c
int mp_inv_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_mulh(int n, int radix, int in1[], int in2[], int out[], int nfft, double in1fft[], 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_mulh(n, radix, inout, in, tmp1, nfft, tmp1fft, tmp2fft);
  mp_load_1(n, radix, tmp2);
  mp_sub(n, radix, tmp2, tmp1, tmp2);
  mp_mulh_use_in1fft(n, radix, tmp1fft, shift, in, tmp1, nfft, tmp2fft);
  mp_sub(n_h, 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);
  if (tmp2[0] != 0) {
    mp_add(n, radix, inout, tmp2, inout);
  }
  return prc;
}
```