user: Converte this assembly snippet into its equivalent C code:

```asm
<mp_squ>:
  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    %r9d,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  sar    %eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L1
L28:
  mov    -0x4(%rbp),%eax
  cltq
  add    $0x2,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L4
  addl   $0x1,-0x4(%rbp)
L1:
  mov    -0x14(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jg     L28
  jmp    L6
L4:
  nop
L6:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  sub    -0x4(%rbp),%eax
  cmp    %eax,-0x8(%rbp)
  jge    L45
  mov    -0x14(%rbp),%eax
  sub    -0x4(%rbp),%eax
  mov    %eax,-0x8(%rbp)
L45:
  mov    -0x20(%rbp),%rcx
  mov    -0x34(%rbp),%edx
  mov    -0x18(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    0x10(%rbp),%r9
  mov    %rcx,%r8
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <mp_mul_i2d@plt>
  mov    0x18(%rbp),%r8
  mov    -0x20(%rbp),%rdi
  mov    -0x4(%rbp),%ecx
  mov    -0x34(%rbp),%edx
  mov    -0x18(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <mp_mul_i2d@plt>
  mov    0x28(%rbp),%rsi
  mov    0x20(%rbp),%rcx
  mov    0x18(%rbp),%rdx
  mov    -0x34(%rbp),%eax
  mov    %rsi,%r8
  mov    0x10(%rbp),%rsi
  mov    %eax,%edi
  call   <mp_mul_cmul@plt>
  mov    -0x30(%rbp),%rdi
  mov    0x18(%rbp),%rcx
  mov    -0x34(%rbp),%edx
  mov    -0x18(%rbp),%esi
  mov    -0x8(%rbp),%eax
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <mp_mul_d2i@plt>
  mov    0x28(%rbp),%rcx
  mov    0x20(%rbp),%rdx
  mov    -0x34(%rbp),%eax
  mov    0x10(%rbp),%rsi
  mov    %eax,%edi
  call   <mp_mul_csqu_nt_d1@plt>
  mov    -0x28(%rbp),%rcx
  mov    -0x34(%rbp),%edx
  mov    -0x18(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    %rcx,%r8
  mov    0x10(%rbp),%rcx
  mov    %eax,%edi
  call   <mp_mul_d2i@plt>
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L12
  mov    -0x30(%rbp),%rdi
  mov    -0x30(%rbp),%rcx
  mov    -0x30(%rbp),%rdx
  mov    -0x18(%rbp),%esi
  mov    -0x8(%rbp),%eax
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <mp_add@plt>
  mov    -0x28(%rbp),%rdi
  mov    -0x30(%rbp),%rcx
  mov    -0x28(%rbp),%rdx
  mov    -0x18(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <mp_add@plt>
L12:
  nop
  leave
  ret
```

assistant: ```c
void mp_squ(int n, int radix, int in[], int out[], int tmp[], int nfft, double tmp1fft[], double tmp2fft[], int ip[], double w[]) {
  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[], int ip[], double w[]);
  void mp_mul_csqu_nt_d1(int nfft, double d1[], int ip[], double w[]);
  void mp_mul_d2i(int n, int radix, int nfft, double din[], int out[]);
  int n_h, shift;
  shift = (nfft >> 1) + 1;
  while (n > shift) {
    if (in[shift + 2] != 0) {
      break;
    }
    shift++;
  }
  n_h = n / 2 + 1;
  if (n_h < n - shift) {
    n_h = n - shift;
  }
  mp_mul_i2d(n, radix, nfft, 0, in, tmp1fft);
  mp_mul_i2d(n, radix, nfft, shift, in, tmp2fft);
  mp_mul_cmul(nfft, tmp1fft, tmp2fft, ip, w);
  mp_mul_d2i(n_h, radix, nfft, tmp2fft, tmp);
  mp_mul_csqu_nt_d1(nfft, tmp1fft, ip, w);
  mp_mul_d2i(n, radix, nfft, tmp1fft, out);
  if (tmp[0] != 0) {
    mp_add(n_h, radix, tmp, tmp, tmp);
    mp_add(n, radix, out, tmp, out);
  }
}
```