user: Please show me the C implementation that matches the assembly code listed below:

```asm
<SKP_Silk_resample_1_3>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x7b8,%rsp
  mov    %rdx,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x7a8(%rsp)
  xor    %eax,%eax
  movslq %ecx,%r15
  imul   $0x55555556,%r15,%r15
  shr    $0x20,%r15
  mov    %ecx,%eax
  sar    $0x1f,%eax
  sub    %eax,%r15d
  cmp    $0x2,%ecx
  jle    L24
  mov    %rdi,%r12
  mov    %rsi,%r13
  lea    0x3e0(%rsp),%r14
  jmp    L28
L39:
  cmp    $0xf9e7aab0,%eax
  jge    L62
  movw   $0x8000,(%r12,%rdx,2)
L68:
  add    $0x1,%rdx
  cmp    %rbx,%rdx
  je     L2
L74:
  mov    0x160(%rsp,%rdx,4),%eax
  add    0x20(%rsp,%rdx,4),%eax
  add    0x2a0(%rsp,%rdx,4),%eax
  cmp    $0x6185550,%eax
  jle    L39
  movw   $0x7fff,(%r12,%rdx,2)
  jmp    L68
L62:
  add    $0x618,%eax
  movzwl %ax,%ecx
  lea    (%rcx,%rcx,4),%esi
  lea    (%rcx,%rsi,4),%esi
  sar    $0x10,%esi
  sar    $0x10,%eax
  lea    (%rax,%rax,4),%ecx
  lea    (%rax,%rcx,4),%eax
  add    %esi,%eax
  mov    %ax,(%r12,%rdx,2)
  jmp    L68
L26:
  lea    0x4(%r13),%rsi
  lea    0x20(%rsp),%rbx
  mov    %ebp,%r8d
  mov    %r14,%rcx
  mov    $0x2e0a,%edx
  mov    %rbx,%rdi
  call   <SKP_Silk_allpass_int@plt>
  lea    0x8(%r13),%rsi
  mov    %ebp,%r8d
  mov    %rbx,%rcx
  mov    $0x7278,%edx
  mov    %r14,%rdi
  call   <SKP_Silk_allpass_int@plt>
  lea    0xc(%r13),%rsi
  lea    0x160(%rsp),%rbx
  mov    %ebp,%r8d
  mov    %r14,%rcx
  mov    $0x134e,%edx
  mov    %rbx,%rdi
  call   <SKP_Silk_allpass_int@plt>
  lea    0x10(%r13),%rsi
  mov    %ebp,%r8d
  mov    %rbx,%rcx
  mov    $0x644d,%edx
  mov    %r14,%rdi
  call   <SKP_Silk_allpass_int@plt>
  lea    0x14(%r13),%rsi
  lea    0x2a0(%rsp),%rbx
  mov    %ebp,%r8d
  mov    %r14,%rcx
  mov    $0x6ed,%edx
  mov    %rbx,%rdi
  call   <SKP_Silk_allpass_int@plt>
  lea    0x18(%r13),%rsi
  mov    %ebp,%r8d
  mov    %rbx,%rcx
  mov    $0x459a,%edx
  mov    %r14,%rdi
  call   <SKP_Silk_allpass_int@plt>
L2:
  movslq 0x14(%rsp),%rax
  mov    0x8(%rsp),%rdi
  lea    (%rdi,%rax,2),%rax
  mov    %rax,0x8(%rsp)
  movslq %ebp,%rax
  lea    (%r12,%rax,2),%r12
  sub    %ebp,%r15d
  test   %r15d,%r15d
  jle    L24
L28:
  mov    %r15d,%esi
  mov    $0x50,%edi
  call   <SKP_min_int@plt>
  mov    %eax,%ebp
  cwtl
  lea    (%rax,%rax,2),%eax
  mov    %eax,0x14(%rsp)
  mov    %eax,%ecx
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    0x8(%rsp),%rdi
  call   <SKP_Silk_lowpass_short@plt>
  test   %ebp,%ebp
  jle    L26
  lea    0x3e0(%rsp),%rdx
  mov    %ebp,%ebx
  mov    $0x0,%eax
L94:
  mov    (%rdx),%ecx
  mov    %ecx,0x20(%rsp,%rax,4)
  mov    0x4(%rdx),%ecx
  mov    %ecx,0x160(%rsp,%rax,4)
  mov    0x8(%rdx),%ecx
  mov    %ecx,0x2a0(%rsp,%rax,4)
  add    $0x1,%rax
  add    $0xc,%rdx
  cmp    %rbx,%rax
  jne    L94
  lea    0x4(%r13),%rsi
  lea    0x20(%rsp),%rax
  mov    %ebp,%r8d
  mov    %r14,%rcx
  mov    $0x2e0a,%edx
  mov    %rax,0x18(%rsp)
  mov    %rax,%rdi
  call   <SKP_Silk_allpass_int@plt>
  lea    0x8(%r13),%rsi
  mov    %ebp,%r8d
  mov    0x18(%rsp),%rcx
  mov    $0x7278,%edx
  mov    %r14,%rdi
  call   <SKP_Silk_allpass_int@plt>
  lea    0xc(%r13),%rsi
  lea    0x160(%rsp),%rax
  mov    %ebp,%r8d
  mov    %r14,%rcx
  mov    $0x134e,%edx
  mov    %rax,0x18(%rsp)
  mov    %rax,%rdi
  call   <SKP_Silk_allpass_int@plt>
  lea    0x10(%r13),%rsi
  mov    %ebp,%r8d
  mov    0x18(%rsp),%rcx
  mov    $0x644d,%edx
  mov    %r14,%rdi
  call   <SKP_Silk_allpass_int@plt>
  lea    0x14(%r13),%rsi
  lea    0x2a0(%rsp),%rax
  mov    %ebp,%r8d
  mov    %r14,%rcx
  mov    $0x6ed,%edx
  mov    %rax,0x18(%rsp)
  mov    %rax,%rdi
  call   <SKP_Silk_allpass_int@plt>
  lea    0x18(%r13),%rsi
  mov    %ebp,%r8d
  mov    0x18(%rsp),%rcx
  mov    $0x459a,%edx
  mov    %r14,%rdi
  call   <SKP_Silk_allpass_int@plt>
  mov    $0x0,%edx
  jmp    L74
L24:
  mov    0x7a8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L119
  add    $0x7b8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L119:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void SKP_Silk_resample_1_3(short *out, int *S, const short *in, const int inLen) {
  int k, outLen, LSubFrameIn, LSubFrameOut;
  int out_tmp, limit = 102258000;
  int scratch0[3 * 80];
  int scratch10[80], scratch11[80], scratch12[80];
  const short A30[2] = {1773, 17818};
  const short A31[2] = {4942, 25677};
  const short A32[2] = {11786, 29304};
  ;
  outLen = ((int)((inLen) / (3)));
  while (outLen > 0) {
    LSubFrameOut = SKP_min_int(80, outLen);
    LSubFrameIn = ((int)((short)(3)) * (int)((short)(LSubFrameOut)));
    SKP_Silk_lowpass_short(in, S, scratch0, LSubFrameIn);
    for (k = 0; k < LSubFrameOut; k++) {
      scratch10[k] = scratch0[3 * k];
      scratch11[k] = scratch0[3 * k + 1];
      scratch12[k] = scratch0[3 * k + 2];
    }
    SKP_Silk_allpass_int(scratch10, S + 1, A32[0], scratch0, LSubFrameOut);
    SKP_Silk_allpass_int(scratch0, S + 2, A32[1], scratch10, LSubFrameOut);
    SKP_Silk_allpass_int(scratch11, S + 3, A31[0], scratch0, LSubFrameOut);
    SKP_Silk_allpass_int(scratch0, S + 4, A31[1], scratch11, LSubFrameOut);
    SKP_Silk_allpass_int(scratch12, S + 5, A30[0], scratch0, LSubFrameOut);
    SKP_Silk_allpass_int(scratch0, S + 6, A30[1], scratch12, LSubFrameOut);
    for (k = 0; k < LSubFrameOut; k++) {
      out_tmp = scratch10[k] + scratch11[k] + scratch12[k];
      if (out_tmp - limit > 0) {
        out[k] = 0x7FFF;
      } else if (out_tmp + limit < 0) {
        out[k] = ((short)0x8000);
      } else {
        out[k] = (short)((((out_tmp + 1560) >> 16) * (int)((short)(21))) + ((((out_tmp + 1560) & 0x0000FFFF) * (int)((short)(21))) >> 16));
      }
    }
    in += LSubFrameIn;
    out += LSubFrameOut;
    outLen -= LSubFrameOut;
  }
}
```