user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<SKP_Silk_LPC_fit>:
  endbr64
  push   %r15
  xor    %r15d,%r15d
  push   %r14
  movslq %ecx,%r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %r14,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    $0x18,%ebx
  sub    %edx,%ebx
  sub    $0x18,%rsp
  mov    %edx,0xc(%rsp)
  nopl   0x0(%rax)
L51:
  mov    $0x80000000,%edi
  test   %r12d,%r12d
  jle    L172
  mov    0x0(%r13),%eax
  mov    %eax,%edi
  neg    %edi
  cmovs  %eax,%edi
  mov    $0x1,%eax
  xor    %r15d,%r15d
  cmp    $0x1,%r12d
  je     L172
  nopl   0x0(%rax,%rax,1)
L106:
  mov    0x0(%r13,%rax,4),%ecx
  mov    %ecx,%edx
  neg    %edx
  cmovs  %ecx,%edx
  cmp    %edi,%edx
  jle    L25
  mov    %edx,%edi
  mov    %eax,%r15d
L25:
  add    $0x1,%rax
  cmp    %r14,%rax
  jne    L106
L172:
  mov    %ebx,%ecx
  sar    %cl,%edi
  cmp    $0x7ffe,%edi
  jle    L101
  lea    -0x7fff(%rdi),%eax
  lea    0x1(%r15),%ecx
  mov    %r12d,%esi
  imul   $0x3fef,%eax,%eax
  imul   %edi,%ecx
  mov    %r13,%rdi
  cltd
  sar    $0x2,%ecx
  idiv   %ecx
  mov    $0xffbe,%edx
  sub    %eax,%edx
  xor    %eax,%eax
  call   <SKP_Silk_bwexpander_32@plt>
  jmp    L51
  nopl   0x0(%rax)
L101:
  test   %r12d,%r12d
  jle    L114
  cmp    $0x1,%ebx
  je     L145
  mov    $0x17,%ecx
  movslq %r12d,%rsi
  xor    %edx,%edx
  sub    0xc(%rsp),%ecx
L127:
  mov    0x0(%r13,%rdx,4),%eax
  sar    %cl,%eax
  add    $0x1,%eax
  sar    %eax
  mov    %ax,0x0(%rbp,%rdx,2)
  add    $0x1,%rdx
  cmp    %rsi,%rdx
  jne    L127
L114:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L145:
  lea    -0x1(%r12),%eax
  cmp    $0x6,%eax
  jbe    L118
  mov    %r12d,%edx
  movdqa D2(%rip),%xmm5
  xor    %eax,%eax
  shr    $0x3,%edx
  shl    $0x4,%rdx
  nopl   0x0(%rax,%rax,1)
L35:
  movdqu 0x10(%r13,%rax,2),%xmm2
  movdqu 0x0(%r13,%rax,2),%xmm0
  movdqa %xmm2,%xmm4
  movdqa %xmm0,%xmm1
  psrad  $0x1,%xmm4
  psrad  $0x1,%xmm1
  movdqa %xmm1,%xmm3
  punpcklwd %xmm4,%xmm1
  punpckhwd %xmm4,%xmm3
  movdqa %xmm1,%xmm4
  punpckhwd %xmm3,%xmm4
  punpcklwd %xmm3,%xmm1
  movdqa %xmm0,%xmm3
  punpcklwd %xmm2,%xmm0
  punpckhwd %xmm2,%xmm3
  punpcklwd %xmm4,%xmm1
  movdqa %xmm0,%xmm2
  punpcklwd %xmm3,%xmm0
  punpckhwd %xmm3,%xmm2
  punpcklwd %xmm2,%xmm0
  pand   %xmm5,%xmm0
  paddw  %xmm0,%xmm1
  movups %xmm1,0x0(%rbp,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L35
  mov    %r12d,%eax
  and    $0xfffffff8,%eax
  test   $0x7,%r12b
  je     L114
L71:
  movslq %eax,%rcx
  mov    0x0(%r13,%rcx,4),%edx
  lea    0x0(,%rcx,4),%r8
  lea    (%rcx,%rcx,1),%rdi
  mov    %edx,%r9d
  and    $0x1,%edx
  sar    %r9d
  add    %r9d,%edx
  mov    %dx,0x0(%rbp,%rcx,2)
  lea    0x1(%rax),%edx
  cmp    %edx,%r12d
  jle    L114
  mov    0x4(%r13,%r8,1),%edx
  mov    %edx,%ecx
  and    $0x1,%edx
  sar    %ecx
  add    %ecx,%edx
  mov    %dx,0x2(%rbp,%rdi,1)
  lea    0x2(%rax),%edx
  cmp    %r12d,%edx
  jge    L114
  mov    0x8(%r13,%r8,1),%edx
  mov    %edx,%ecx
  and    $0x1,%edx
  sar    %ecx
  add    %ecx,%edx
  mov    %dx,0x4(%rbp,%rdi,1)
  lea    0x3(%rax),%edx
  cmp    %edx,%r12d
  jle    L114
  mov    0xc(%r13,%r8,1),%edx
  mov    %edx,%ecx
  and    $0x1,%edx
  sar    %ecx
  add    %ecx,%edx
  mov    %dx,0x6(%rbp,%rdi,1)
  lea    0x4(%rax),%edx
  cmp    %edx,%r12d
  jle    L114
  mov    0x10(%r13,%r8,1),%edx
  mov    %edx,%ecx
  and    $0x1,%edx
  sar    %ecx
  add    %ecx,%edx
  mov    %dx,0x8(%rbp,%rdi,1)
  lea    0x5(%rax),%edx
  cmp    %edx,%r12d
  jle    L114
  mov    0x14(%r13,%r8,1),%edx
  add    $0x6,%eax
  mov    %edx,%ecx
  and    $0x1,%edx
  sar    %ecx
  add    %ecx,%edx
  mov    %dx,0xa(%rbp,%rdi,1)
  cmp    %eax,%r12d
  jle    L114
  mov    0x18(%r13,%r8,1),%eax
  mov    %eax,%edx
  and    $0x1,%eax
  sar    %edx
  add    %edx,%eax
  mov    %ax,0xc(%rbp,%rdi,1)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L118:
  xor    %eax,%eax
  jmp    L71
```

tool_calls: name: read_data
arguments: data_tag: D2
type_infered: byte[16]

tool: {"D2": [0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00]}

assistant: ```c
void SKP_Silk_LPC_fit(short *a_QQ, int *a_Q24, const int QQ, const int L) {
  int i, rshift, idx = 0;
  int maxabs, absval, sc_Q16;
  rshift = 24 - QQ;
  while (1) {
    maxabs = ((int)0x80000000);
    for (i = 0; i < L; i++) {
      absval = (((a_Q24[i]) > 0) ? (a_Q24[i]) : -(a_Q24[i]));
      if (absval > maxabs) {
        maxabs = absval;
        idx = i;
      }
    }
    maxabs = ((maxabs) >> (rshift));
    if (maxabs >= 0x7FFF) {
      sc_Q16 = 65470 - ((int)((((65470 >> 2) * (maxabs - 0x7FFF))) / (((((maxabs) * (idx + 1))) >> (2)))));
      SKP_Silk_bwexpander_32(a_Q24, L, sc_Q16);
    } else {
      break;
    }
  };
  ;
  for (i = 0; i < L; i++) {
    a_QQ[i] = (short)((rshift) == 1 ? ((a_Q24[i]) >> 1) + ((a_Q24[i]) & 1) : (((a_Q24[i]) >> ((rshift)-1)) + 1) >> 1);
  }
}
```