user: 请将以下的汇编代码转换成C语言代码:

```asm
<mp_mulhf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %rdx,-0x20(%rbp)
  mov    %rcx,-0x28(%rbp)
  mov    %r8,-0x30(%rbp)
  mov    %r9,-0x38(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  mov    %rax,-0x8(%rbp)
  mov    0x10(%rbp),%eax
  sar    %eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L67
L14:
  mov    -0xc(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  test   %ax,%ax
  jne    L22
  addl   $0x1,-0xc(%rbp)
L67:
  mov    -0x14(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jg     L14
  jmp    L12
L22:
  nop
L12:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  add    $0x1,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x14(%rbp),%eax
  sub    -0xc(%rbp),%eax
  cmp    %eax,-0x10(%rbp)
  jge    L18
  mov    -0x14(%rbp),%eax
  sub    -0xc(%rbp),%eax
  mov    %eax,-0x10(%rbp)
L18:
  mov    0x18(%rbp),%rcx
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    %rcx,%r9
  mov    %rdx,%r8
  mov    $0x0,%ecx
  mov    0x10(%rbp),%edx
  mov    %eax,%edi
  call   <mp_mul_i2d@plt>
  mov    0x20(%rbp),%rcx
  mov    -0x28(%rbp),%rdx
  mov    -0x18(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    %rcx,%r9
  mov    %rdx,%r8
  mov    $0x0,%ecx
  mov    0x10(%rbp),%edx
  mov    %eax,%edi
  call   <mp_mul_i2d@plt>
  mov    0x20(%rbp),%rdx
  mov    0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    0x10(%rbp),%edi
  call   <mp_mul_cmul@plt>
  mov    -0x38(%rbp),%rcx
  mov    0x20(%rbp),%rdx
  mov    -0x18(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    %rcx,%r8
  mov    %rdx,%rcx
  mov    0x10(%rbp),%edx
  mov    %eax,%edi
  call   <mp_mul_d2i@plt>
  mov    0x20(%rbp),%rdi
  mov    -0x28(%rbp),%rcx
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    %rdi,%r9
  mov    %rcx,%r8
  mov    %edx,%ecx
  mov    0x10(%rbp),%edx
  mov    %eax,%edi
  call   <mp_mul_i2d@plt>
  mov    0x20(%rbp),%rdx
  mov    0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    0x10(%rbp),%edi
  call   <mp_mul_cmul_nt_d1@plt>
  mov    -0x30(%rbp),%rcx
  mov    0x20(%rbp),%rdx
  mov    -0x18(%rbp),%esi
  mov    -0x10(%rbp),%eax
  mov    %rcx,%r8
  mov    %rdx,%rcx
  mov    0x10(%rbp),%edx
  mov    %eax,%edi
  call   <mp_mul_d2i@plt>
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L65
  mov    -0x30(%rbp),%rdi
  mov    -0x38(%rbp),%rcx
  mov    -0x30(%rbp),%rdx
  mov    -0x18(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <mp_add@plt>
  jmp    L37
L65:
  mov    -0x30(%rbp),%rcx
  mov    -0x38(%rbp),%rdx
  mov    -0x18(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <mp_copy@plt>
L37:
  nop
  leave
  ret
```

assistant: ```c
void mp_mulhf(int n, int radix, int in1[], int in2[], int out[], int tmp[], int nfft, double in1fft[], double tmpfft[]) {
  void mp_copy(int n, int radix, int in[], int out[]);
  void mp_add(int n, int radix, int in1[], int in2[], int out[]);
  void mp_mul_i2d(int n, int radix, int nfft, int shift, int in[], double dout[]);
  void mp_mul_cmul(int nfft, double d1[], double d2[]);
  void mp_mul_cmul_nt_d1(int nfft, double d1[], double d2[]);
  void mp_mul_d2i(int n, int radix, int nfft, double din[], int out[]);
  int n_h, shift;
  short int *in2dgt;
  in2dgt = (short int *)&in2[2];
  shift = (nfft >> 1) + 1;
  while (n > shift) {
    if (in2dgt[shift] != 0) {
      break;
    }
    shift++;
  }
  n_h = n / 2 + 1;
  if (n_h < n - shift) {
    n_h = n - shift;
  }
  mp_mul_i2d(n, radix, nfft, 0, in1, in1fft);
  mp_mul_i2d(n, radix, nfft, 0, in2, tmpfft);
  mp_mul_cmul(nfft, in1fft, tmpfft);
  mp_mul_d2i(n, radix, nfft, tmpfft, tmp);
  mp_mul_i2d(n, radix, nfft, shift, in2, tmpfft);
  mp_mul_cmul_nt_d1(nfft, in1fft, tmpfft);
  mp_mul_d2i(n_h, radix, nfft, tmpfft, out);
  if (out[0] != 0) {
    mp_add(n, radix, out, tmp, out);
  } else {
    mp_copy(n, radix, tmp, out);
  }
}
```