user: What is the c source code of the assembly code below?

```asm
<ambe_resample_mag>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x18(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x30(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x2c(%rbp),%xmm1
  divss  %xmm1,%xmm0
  movss  %xmm0,-0xc(%rbp)
  movss  -0xc(%rbp),%xmm0
  movss  %xmm0,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L42
L70:
  mov    -0x14(%rbp),%eax
  movd   %eax,%xmm0
  call   <floorf@plt>
  mov    %eax,-0x8(%rbp)
  cmpl   $0x0,-0x8(%rbp)
  jne    L12
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x38(%rbp),%rax
  movss  (%rax),%xmm0
  movss  %xmm0,(%rdx)
  jmp    L6
L12:
  mov    -0x8(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L67
  mov    -0x30(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movss  (%rdx),%xmm0
  movss  %xmm0,(%rax)
  jmp    L6
L67:
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x8(%rbp),%xmm1
  movss  -0x14(%rbp),%xmm0
  subss  %xmm1,%xmm0
  movss  %xmm0,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  movss  D7(%rip),%xmm0
  subss  -0x4(%rbp),%xmm0
  mulss  %xmm0,%xmm1
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  -0x4(%rbp),%xmm0
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
L6:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  movss  -0x18(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x18(%rbp)
  movss  -0x14(%rbp),%xmm0
  addss  -0xc(%rbp),%xmm0
  movss  %xmm0,-0x14(%rbp)
  addl   $0x1,-0x10(%rbp)
L42:
  mov    -0x10(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L70
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x2c(%rbp),%xmm1
  movss  -0x18(%rbp),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x18(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L19
L45:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  subss  -0x18(%rbp),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x10(%rbp)
L19:
  mov    -0x10(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L45
  nop
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D7
datatype: byte[4]

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

assistant: ```c
void ambe_resample_mag(float *mag_dst, int L_dst, float *mag_src, int L_src) {
  float avg, step, pos;
  int i;
  avg = 0.0f;
  step = (float)L_src / (float)L_dst;
  pos = step;
  for (i = 0; i < L_dst; i++) {
    int posi = (int)floorf(pos);
    if (posi == 0) {
      mag_dst[i] = mag_src[0];
    } else if (posi >= L_src) {
      mag_dst[i] = mag_src[L_src - 1];
    } else {
      float alpha = pos - posi;
      mag_dst[i] = mag_src[posi - 1] * (1.0f - alpha) + mag_src[posi] * alpha;
    }
    avg += mag_dst[i];
    pos += step;
  }
  avg /= L_dst;
  for (i = 0; i < L_dst; i++)
    mag_dst[i] -= avg;
}
```