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

```asm
<equalization_meanx>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %rsi,%rbx
  mov    %rdx,%r12
  mov    %ecx,%r14d
  mov    %r8d,%ebp
  mov    %r9d,%r13d
  mov    0x88(%rsp),%esi
  lea    0x0(,%rsi,4),%r15d
  mov    %r15d,%edi
  call   <malloc@plt>
  mov    %rax,0x18(%rsp)
  mov    %r15d,%edi
  call   <malloc@plt>
  mov    %rax,0x20(%rsp)
  cmpl   $0x0,0x88(%rsp)
  jle    L9
  mov    %rax,%rsi
  imul   %r14d,%ebp
  mov    %r13d,%r14d
  imul   0x80(%rsp),%r14d
  mov    0x18(%rsp),%rcx
  mov    0x88(%rsp),%eax
  lea    0x0(,%rax,4),%r10
  mov    %r10,0x28(%rsp)
  add    %rcx,%r10
  mov    $0x0,%r8d
  mov    $0x0,%edi
  lea    -0x1(%rbp),%edx
  mov    %rdx,0x8(%rsp)
  mov    0x10(%rsp),%rax
  lea    0x4(%rax),%r9
  lea    -0x1(%r14),%edx
  mov    %rdx,0x10(%rsp)
  lea    0x4(%rbx),%r11
  mov    %rsi,0x30(%rsp)
  mov    %rcx,0x38(%rsp)
  mov    %rax,%r13
L108:
  mov    %rcx,%rdx
  movl   $0x0,(%rcx)
  test   %ebp,%ebp
  jle    L21
  movslq %edi,%r15
  lea    0x0(%r13,%r15,4),%rax
  add    0x8(%rsp),%r15
  lea    (%r9,%r15,4),%r15
L42:
  movss  (%rdx),%xmm0
  addss  (%rax),%xmm0
  movss  %xmm0,(%rdx)
  add    $0x4,%rax
  cmp    %r15,%rax
  jne    L42
L21:
  pxor   %xmm1,%xmm1
  cvtsi2ss %ebp,%xmm1
  movss  (%rdx),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,(%rdx)
  mov    %rsi,%rdx
  movl   $0x0,(%rsi)
  test   %r14d,%r14d
  jle    L19
  movslq %r8d,%r15
  lea    (%rbx,%r15,4),%rax
  add    0x10(%rsp),%r15
  lea    (%r11,%r15,4),%r15
L32:
  movss  (%rdx),%xmm0
  addss  (%rax),%xmm0
  movss  %xmm0,(%rdx)
  add    $0x4,%rax
  cmp    %r15,%rax
  jne    L32
L19:
  pxor   %xmm1,%xmm1
  cvtsi2ss %r14d,%xmm1
  movss  (%rdx),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,(%rdx)
  add    $0x4,%rcx
  add    $0x4,%rsi
  add    %ebp,%edi
  add    %r14d,%r8d
  cmp    %r10,%rcx
  jne    L108
  mov    0x30(%rsp),%r13
  mov    0x38(%rsp),%r15
  mov    0x28(%rsp),%rax
  add    0x20(%rsp),%rax
  mov    %rax,0x8(%rsp)
  mov    $0x0,%ebp
  lea    -0x1(%r14),%eax
  add    $0x1,%rax
  mov    %rax,0x10(%rsp)
  jmp    L116
L85:
  test   %r14d,%r14d
  jle    L31
  movslq %ebp,%rdx
  lea    0x0(,%rdx,4),%rax
  add    0x10(%rsp),%rdx
  shl    $0x2,%rdx
L12:
  movaps %xmm1,%xmm0
  mulss  (%rbx,%rax,1),%xmm0
  movss  %xmm0,(%r12,%rax,1)
  add    $0x4,%rax
  cmp    %rax,%rdx
  jne    L12
L31:
  add    $0x4,%r13
  add    $0x4,%r15
  add    %r14d,%ebp
  cmp    0x8(%rsp),%r13
  je     L9
L116:
  movss  0x0(%r13),%xmm0
  call   <fabs@plt>
  movss  D2(%rip),%xmm1
  test   %eax,%eax
  jle    L85
  movss  (%r15),%xmm1
  divss  0x0(%r13),%xmm1
  jmp    L85
L9:
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D2
type_infered: byte[4]

tool: {"D2": [0x00,0x00,0x80,0x3f]}

assistant: ```c
void equalization_meanx(float *ref, float *modified, float *out, int w, int h, int w2, int h2, int pd) {
  float *mean_ref = malloc(pd * sizeof(float));
  float *mean_modified = malloc(pd * sizeof(float));
  for (int l = 0; l < pd; l++) {
    mean_ref[l] = 0;
    for (int i = 0; i < w * h; i++)
      mean_ref[l] += ref[i + l * w * h];
    mean_ref[l] /= (float)(w * h);
    mean_modified[l] = 0;
    for (int i = 0; i < w2 * h2; i++)
      mean_modified[l] += modified[i + l * h2 * w2];
    mean_modified[l] /= (float)(w2 * h2);
  }
  float factor;
  for (int l = 0; l < pd; l++) {
    if (fabs(mean_modified[l]) < 1e-3)
      factor = 1;
    else
      factor = mean_ref[l] / mean_modified[l];
    for (int i = 0; i < w2 * h2; i++)
      out[i + l * w2 * h2] = modified[i + l * w2 * h2] * factor;
  }
  free(mean_ref);
  free(mean_modified);
}
```