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

```asm
<FFTNXCorr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r14
  mov    %rdx,0x10(%rsp)
  mov    %rcx,%r12
  mov    %r8,0x18(%rsp)
  cmp    %rsi,%rcx
  mov    %rsi,%rdi
  cmovae %rcx,%rdi
  call   <nextpow2@plt>
  mov    %rax,%r15
  lea    0x8(,%rax,8),%r13d
  mov    %r13d,%edi
  call   <safe_malloc@plt>
  mov    %rax,%rbp
  mov    %r13d,%edi
  call   <safe_malloc@plt>
  mov    %rax,%r13
  lea    -0x1(%r14),%rax
  mov    %rax,0x8(%rsp)
  test   %rax,%rax
  js     L67
  lea    (%rbx,%r14,4),%rcx
  add    %rbp,%rcx
L97:
  add    $0x4,%rbx
  movss  -0x4(%rbx),%xmm0
  mov    %rcx,%rdx
  sub    %rbx,%rdx
  movss  %xmm0,(%rdx)
  sub    $0x1,%rax
  jns    L97
L67:
  lea    (%r15,%r15,1),%rbx
  cmp    %rbx,%r14
  jge    L105
  lea    0x0(%rbp,%r14,4),%rax
  lea    0x0(%rbp,%rbx,4),%rdx
L86:
  movl   $0x0,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L86
L105:
  lea    (%r15,%r15,1),%r14d
  mov    %r14d,%esi
  mov    %rbp,%rdi
  call   <RealFFT@plt>
  test   %r12,%r12
  jle    L57
  lea    0x0(%r13,%r12,4),%rcx
  mov    %r13,%rax
  mov    0x10(%rsp),%rdx
  sub    %r13,%rdx
L65:
  movss  (%rdx,%rax,1),%xmm0
  movss  %xmm0,(%rax)
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L65
L57:
  cmp    %rbx,%r12
  jge    L47
  lea    0x0(%r13,%r12,4),%rax
  lea    0x0(%r13,%rbx,4),%rdx
L13:
  movl   $0x0,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L13
L47:
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <RealFFT@plt>
  test   %r15,%r15
  js     L111
  lea    0x8(%rbp,%r15,8),%rdi
  mov    %rbp,%rax
  mov    %r13,%rsi
  sub    %rbp,%rsi
  lea    0x4(%r13),%rcx
  sub    %rbp,%rcx
L12:
  movss  (%rax),%xmm0
  movss  0x4(%rax),%xmm1
  lea    (%rsi,%rax,1),%rdx
  lea    (%rcx,%rax,1),%r8
  movaps %xmm0,%xmm2
  mulss  (%rdx),%xmm2
  movaps %xmm1,%xmm3
  mulss  (%r8),%xmm3
  subss  %xmm3,%xmm2
  movss  %xmm2,(%rax)
  mulss  (%r8),%xmm0
  mulss  (%rdx),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,0x4(%rax)
  add    $0x8,%rax
  cmp    %rdi,%rax
  jne    L12
L111:
  mov    %r14d,%esi
  mov    %rbp,%rdi
  call   <RealIFFT@plt>
  add    0x8(%rsp),%r12
  test   %r12,%r12
  jle    L34
  lea    0x0(%rbp,%r12,4),%rcx
  mov    %rbp,%rax
  mov    0x18(%rsp),%rdx
  sub    %rbp,%rdx
L7:
  movss  (%rax),%xmm0
  movss  %xmm0,(%rdx,%rax,1)
  add    $0x4,%rax
  cmp    %rax,%rcx
  jne    L7
L34:
  mov    %rbp,%rdi
  call   <safe_free@plt>
  mov    %r13,%rdi
  call   <safe_free@plt>
  mov    %r12,%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
unsigned long FFTNXCorr(float *x1, unsigned long n1, float *x2, unsigned long n2, float *y) {
  register float r1, i1;
  float *tmp1;
  float *tmp2;
  long C, D, Nx, Ny;
  Nx = nextpow2((((n1) > (n2)) ? (n1) : (n2)));
  tmp1 = (float *)safe_malloc(sizeof(float) * (2 * Nx + 2));
  tmp2 = (float *)safe_malloc(sizeof(float) * (2 * Nx + 2));
  for (C = n1 - 1; C >= 0; C--) {
    tmp1[C] = *(x1++);
  }
  for (C = n1; C < 2 * Nx; C++)
    tmp1[C] = 0.0;
  RealFFT(tmp1, 2 * Nx);
  for (C = 0; C < (long)n2; C++) {
    tmp2[C] = x2[C];
  }
  for (C = n2; C < 2 * Nx; C++)
    tmp2[C] = 0.0;
  RealFFT(tmp2, 2 * Nx);
  for (C = 0; C <= Nx; C++) {
    D = C << 1;
    r1 = tmp1[D];
    i1 = tmp1[1 + D];
    tmp1[D] = r1 * tmp2[D] - i1 * tmp2[1 + D];
    tmp1[1 + D] = r1 * tmp2[1 + D] + i1 * tmp2[D];
  }
  RealIFFT(tmp1, 2 * Nx);
  Ny = n1 + n2 - 1;
  for (C = 0; C < Ny; C++)
    y[C] = tmp1[C];
  safe_free(tmp1);
  safe_free(tmp2);
  return Ny;
}
```