user: 请从给定的汇编指令推导出C源代码：

```asm
<rma>:
  endbr64
  mov    %edx,%eax
  pxor   %xmm4,%xmm4
  imul   %esi,%eax
  cvtsi2sd %eax,%xmm4
  test   %edx,%edx
  jle    L94
  push   %r12
  pxor   %xmm0,%xmm0
  xor    %r12d,%r12d
  push   %rbp
  mov    %rdi,%rbp
  lea    0x4(%rdi),%rdi
  push   %rbx
  mov    %esi,%ebx
  xor    %esi,%esi
  lea    -0x1(%rbx),%r8d
  sub    $0x20,%rsp
  nopw   0x0(%rax,%rax,1)
L132:
  test   %ebx,%ebx
  jle    L114
  movslq %esi,%rcx
  lea    0x0(%rbp,%rcx,4),%rax
  add    %r8,%rcx
  lea    (%rdi,%rcx,4),%rcx
  nopl   0x0(%rax,%rax,1)
L8:
  pxor   %xmm1,%xmm1
  add    $0x4,%rax
  cvtss2sd -0x4(%rax),%xmm1
  addsd  %xmm1,%xmm0
  cmp    %rcx,%rax
  jne    L8
L114:
  lea    0x1(%r12),%eax
  add    %ebx,%esi
  cmp    %eax,%edx
  je     L55
  mov    %eax,%r12d
  jmp    L132
  xchg   %ax,%ax
L55:
  movapd %xmm0,%xmm2
  lea    D10(%rip),%rdi
  movaps %xmm3,0x10(%rsp)
  divsd  %xmm4,%xmm2
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x8(%rsp)
  call   <vmess@plt>
  test   %ebx,%ebx
  jle    L30
  mov    %ebx,%eax
  movsd  0x8(%rsp),%xmm2
  mov    %rbp,%rcx
  movslq %ebx,%r9
  shr    $0x2,%eax
  mov    %ebx,%edi
  lea    -0x1(%rbx),%r10d
  movaps 0x10(%rsp),%xmm3
  lea    -0x1(%rax),%r8d
  movapd %xmm2,%xmm4
  shl    $0x2,%r9
  and    $0xfffffffc,%edi
  add    $0x1,%r8
  xor    %edx,%edx
  xor    %esi,%esi
  mov    %rcx,%rax
  shl    $0x4,%r8
  unpcklpd %xmm4,%xmm4
  lea    (%r8,%rcx,1),%r11
  cmp    $0x2,%r10d
  jbe    L2
  nopw   0x0(%rax,%rax,1)
L88:
  movlps 0x8(%rax),%xmm3
  cvtps2pd (%rax),%xmm0
  subpd  %xmm4,%xmm0
  add    $0x10,%rax
  cvtps2pd %xmm3,%xmm1
  subpd  %xmm4,%xmm1
  cvtpd2ps %xmm0,%xmm0
  cvtpd2ps %xmm1,%xmm1
  movlhps %xmm1,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %r11,%rax
  jne    L88
  mov    %edi,%eax
  cmp    %ebx,%edi
  je     L36
L112:
  lea    (%rdx,%rax,1),%r11d
  pxor   %xmm0,%xmm0
  movslq %r11d,%r11
  lea    0x0(%rbp,%r11,4),%r11
  cvtss2sd (%r11),%xmm0
  subsd  %xmm2,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%r11)
  lea    0x1(%rax),%r11d
  cmp    %r11d,%ebx
  jle    L36
  add    %edx,%r11d
  pxor   %xmm0,%xmm0
  add    $0x2,%eax
  movslq %r11d,%r11
  lea    0x0(%rbp,%r11,4),%r11
  cvtss2sd (%r11),%xmm0
  subsd  %xmm2,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%r11)
  cmp    %eax,%ebx
  jle    L36
  add    %edx,%eax
  pxor   %xmm0,%xmm0
  cltq
  lea    0x0(%rbp,%rax,4),%rax
  cvtss2sd (%rax),%xmm0
  subsd  %xmm2,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
L36:
  lea    0x1(%rsi),%eax
  add    %ebx,%edx
  add    %r9,%rcx
  cmp    %r12d,%esi
  je     L30
  mov    %eax,%esi
  lea    (%r8,%rcx,1),%r11
  mov    %rcx,%rax
  cmp    $0x2,%r10d
  ja     L88
L2:
  xor    %eax,%eax
  jmp    L112
  nopw   0x0(%rax,%rax,1)
L30:
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L94:
  pxor   %xmm0,%xmm0
  lea    D10(%rip),%rdi
  divsd  %xmm4,%xmm0
  jmp    1050 <vmess@plt>
```

tool_calls: name: read_data
arguments: label: D10
type: string

tool: D10: average value subtracted: %f

assistant: ```c
void rma(float *data, int nsam, int nrec) {
  int ix, it;
  double avg = 0.0;
  for (ix = 0; ix < nrec; ix++)
    for (it = 0; it < nsam; it++)
      avg += data[ix * nsam + it];
  avg /= nrec * nsam;
  vmess("average value subtracted: %f", avg);
  for (ix = 0; ix < nrec; ix++)
    for (it = 0; it < nsam; it++)
      data[ix * nsam + it] -= avg;
}
```