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

```asm
<RateChange>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %edx,-0x54(%rbp)
  mov    %ecx,-0x58(%rbp)
  mov    %r8d,-0x5c(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x58(%rbp),%xmm0
  movss  %xmm0,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x5c(%rbp),%xmm0
  movss  %xmm0,-0x24(%rbp)
  cmpl   $0x0,-0x54(%rbp)
  jne    L47
  mov    $0x0,%eax
  jmp    L56
L47:
  mov    -0x58(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jne    L24
  mov    -0x54(%rbp),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x48(%rbp),%rcx
  mov    -0x50(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x54(%rbp),%eax
  jmp    L56
L24:
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x58(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jle    L87
  movss  -0x24(%rbp),%xmm0
  divss  -0x28(%rbp),%xmm0
  movss  %xmm0,-0x14(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x38(%rbp)
  jmp    L1
L23:
  movl   $0x0,-0x34(%rbp)
  movl   $0x0,-0x30(%rbp)
  jmp    L52
L25:
  mov    -0x10(%rbp),%rax
  lea    0x2(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movzwl (%rax),%eax
  cwtl
  add    %eax,-0x34(%rbp)
  subl   $0x1,-0x54(%rbp)
  movss  -0x38(%rbp),%xmm0
  addss  -0x14(%rbp),%xmm0
  movss  %xmm0,-0x38(%rbp)
  addl   $0x1,-0x30(%rbp)
L52:
  cmpl   $0x0,-0x54(%rbp)
  je     L10
  movss  D2(%rip),%xmm0
  comiss -0x38(%rbp),%xmm0
  ja     L25
L10:
  movss  -0x38(%rbp),%xmm0
  movss  D2(%rip),%xmm1
  subss  %xmm1,%xmm0
  movss  %xmm0,-0x38(%rbp)
  mov    -0x34(%rbp),%eax
  cltd
  idivl  -0x30(%rbp)
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x2(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    %ecx,%edx
  mov    %dx,(%rax)
L1:
  cmpl   $0x0,-0x54(%rbp)
  jne    L23
  jmp    L115
L87:
  movss  -0x28(%rbp),%xmm0
  divss  -0x24(%rbp),%xmm0
  movss  %xmm0,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x2c(%rbp)
  jmp    L65
L13:
  mov    -0x10(%rbp),%rax
  lea    0x2(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movzwl (%rax),%eax
  cwtl
  mov    %eax,-0x1c(%rbp)
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  cwtl
  sub    -0x1c(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  jmp    L0
L50:
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x1c(%rbp),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x18(%rbp),%xmm0
  mulss  -0x2c(%rbp),%xmm0
  addss  %xmm1,%xmm0
  mov    -0x8(%rbp),%rax
  lea    0x2(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  cvttss2si %xmm0,%edx
  mov    %dx,(%rax)
  movss  -0x2c(%rbp),%xmm0
  addss  -0x20(%rbp),%xmm0
  movss  %xmm0,-0x2c(%rbp)
L0:
  movss  D2(%rip),%xmm0
  comiss -0x2c(%rbp),%xmm0
  ja     L50
  movss  -0x2c(%rbp),%xmm0
  movss  D2(%rip),%xmm1
  subss  %xmm1,%xmm0
  movss  %xmm0,-0x2c(%rbp)
L65:
  subl   $0x1,-0x54(%rbp)
  cmpl   $0x0,-0x54(%rbp)
  jne    L13
L115:
  mov    -0x8(%rbp),%rax
  sub    -0x50(%rbp),%rax
  sar    %rax
L56:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D2
data_type: f32

tool: D2: 1

assistant: ```c
int RateChange(short *src, short *dest, int srcLen, int srcRate, int destRate) {
  short *sourceShortPtr;
  short *destShortPtr;
  float nSrcRate, nDestRate;
  nSrcRate = srcRate;
  nDestRate = destRate;
  if (!srcLen)
    return 0;
  if (srcRate == destRate) {
    memcpy((char *)dest, (char *)src, srcLen * 2);
    return srcLen;
  }
  sourceShortPtr = src;
  destShortPtr = dest;
  if (srcRate > destRate) {
    float destStep = nDestRate / nSrcRate;
    float position = 0;
    while (srcLen) {
      int destSample = 0;
      int count = 0;
      while (srcLen && (position < 1.0)) {
        destSample += *sourceShortPtr++;
        srcLen--;
        position += destStep;
        count++;
      }
      position = position - 1.0;
      *destShortPtr++ = (destSample / count);
    }
  } else {
    float sourceStep = nSrcRate / nDestRate;
    float position = 0;
    while (--srcLen) {
      int leftSample = *sourceShortPtr++;
      int sampleDifference = *sourceShortPtr - leftSample;
      while (position < 1.0) {
        *destShortPtr++ = leftSample + ((float)sampleDifference * position);
        position += sourceStep;
      }
      position = position - 1.0;
    }
  }
  return destShortPtr - dest;
}
```