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

```asm
<SKP_Silk_scale_vector32_Q16>:
  endbr64
  mov    %rdi,%rcx
  cmp    $0x7fff,%esi
  jg     L80
  test   %edx,%edx
  jle    L106
  lea    -0x1(%rdx),%eax
  movswl %si,%esi
  cmp    $0x2,%eax
  jbe    L92
  mov    %rdi,%rax
  mov    %edx,%edi
  movd   %esi,%xmm7
  movdqa D6(%rip),%xmm2
  shr    $0x2,%edi
  pshufd $0x0,%xmm7,%xmm3
  sub    $0x1,%edi
  movdqa %xmm3,%xmm4
  shl    $0x4,%rdi
  psrlq  $0x20,%xmm4
  lea    0x10(%rcx,%rdi,1),%rdi
  nopl   0x0(%rax,%rax,1)
L125:
  movdqu (%rax),%xmm1
  add    $0x10,%rax
  pand   %xmm2,%xmm1
  movdqa %xmm1,%xmm0
  psrlq  $0x20,%xmm1
  pmuludq %xmm3,%xmm0
  pmuludq %xmm4,%xmm1
  pshufd $0x8,%xmm0,%xmm0
  pshufd $0x8,%xmm1,%xmm1
  punpckldq %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  movdqu -0x10(%rax),%xmm0
  psrad  $0x10,%xmm1
  psrad  $0x10,%xmm0
  movdqa %xmm0,%xmm5
  psrlq  $0x20,%xmm0
  pmuludq %xmm3,%xmm5
  pmuludq %xmm4,%xmm0
  pshufd $0x8,%xmm5,%xmm5
  pshufd $0x8,%xmm0,%xmm0
  punpckldq %xmm0,%xmm5
  paddd  %xmm5,%xmm1
  movups %xmm1,-0x10(%rax)
  cmp    %rdi,%rax
  jne    L125
  mov    %edx,%r8d
  and    $0xfffffffc,%r8d
  test   $0x3,%dl
  je     L101
L47:
  movslq %r8d,%r9
  shl    $0x2,%r9
  lea    (%rcx,%r9,1),%r10
  mov    (%r10),%edi
  movzwl %di,%eax
  sar    $0x10,%edi
  imul   %esi,%eax
  imul   %esi,%edi
  sar    $0x10,%eax
  add    %edi,%eax
  mov    %eax,(%r10)
  lea    0x1(%r8),%eax
  cmp    %eax,%edx
  jle    L104
  lea    0x4(%rcx,%r9,1),%r10
  add    $0x2,%r8d
  mov    (%r10),%edi
  movzwl %di,%eax
  sar    $0x10,%edi
  imul   %esi,%eax
  imul   %esi,%edi
  sar    $0x10,%eax
  add    %edi,%eax
  mov    %eax,(%r10)
  cmp    %r8d,%edx
  jle    L104
  lea    0x8(%rcx,%r9,1),%rcx
  mov    (%rcx),%edx
  movzwl %dx,%eax
  sar    $0x10,%edx
  imul   %esi,%eax
  imul   %esi,%edx
  sar    $0x10,%eax
  add    %edx,%eax
  mov    %eax,(%rcx)
L104:
  ret
  nopl   0x0(%rax)
L80:
  sub    $0x10000,%esi
  test   %edx,%edx
  jle    L104
  lea    -0x1(%rdx),%eax
  movswl %si,%esi
  cmp    $0x2,%eax
  jbe    L34
  mov    %rdi,%rax
  mov    %edx,%edi
  movd   %esi,%xmm7
  movdqa D6(%rip),%xmm2
  shr    $0x2,%edi
  pshufd $0x0,%xmm7,%xmm3
  sub    $0x1,%edi
  movdqa %xmm3,%xmm4
  shl    $0x4,%rdi
  psrlq  $0x20,%xmm4
  lea    0x10(%rcx,%rdi,1),%rdi
  nop
L81:
  movdqu (%rax),%xmm5
  add    $0x10,%rax
  movdqa %xmm5,%xmm1
  pand   %xmm2,%xmm1
  movdqa %xmm1,%xmm0
  psrlq  $0x20,%xmm1
  pmuludq %xmm3,%xmm0
  pmuludq %xmm4,%xmm1
  pshufd $0x8,%xmm0,%xmm0
  pshufd $0x8,%xmm1,%xmm1
  punpckldq %xmm1,%xmm0
  movdqa %xmm5,%xmm1
  psrad  $0x10,%xmm1
  psrad  $0x10,%xmm0
  movdqa %xmm1,%xmm6
  psrlq  $0x20,%xmm1
  pmuludq %xmm3,%xmm6
  pmuludq %xmm4,%xmm1
  pshufd $0x8,%xmm6,%xmm6
  pshufd $0x8,%xmm1,%xmm1
  punpckldq %xmm1,%xmm6
  paddd  %xmm6,%xmm0
  paddd  %xmm5,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rax,%rdi
  jne    L81
  mov    %edx,%edi
  and    $0xfffffffc,%edi
  test   $0x3,%dl
  je     L116
L130:
  movslq %edi,%r8
  shl    $0x2,%r8
  lea    (%rcx,%r8,1),%r11
  mov    (%r11),%r9d
  movzwl %r9w,%eax
  mov    %r9d,%r10d
  imul   %esi,%eax
  sar    $0x10,%r10d
  imul   %esi,%r10d
  sar    $0x10,%eax
  add    %r10d,%eax
  add    %r9d,%eax
  mov    %eax,(%r11)
  lea    0x1(%rdi),%eax
  cmp    %edx,%eax
  jge    L104
  lea    0x4(%rcx,%r8,1),%r11
  add    $0x2,%edi
  mov    (%r11),%r9d
  movzwl %r9w,%eax
  mov    %r9d,%r10d
  imul   %esi,%eax
  sar    $0x10,%r10d
  imul   %esi,%r10d
  sar    $0x10,%eax
  add    %r10d,%eax
  add    %r9d,%eax
  mov    %eax,(%r11)
  cmp    %edi,%edx
  jle    L104
  lea    0x8(%rcx,%r8,1),%rdi
  mov    (%rdi),%edx
  movzwl %dx,%eax
  mov    %edx,%ecx
  imul   %esi,%eax
  sar    $0x10,%ecx
  imul   %esi,%ecx
  sar    $0x10,%eax
  add    %ecx,%eax
  add    %edx,%eax
  mov    %eax,(%rdi)
  ret
  nopw   0x0(%rax,%rax,1)
L106:
  ret
  nopl   0x0(%rax)
L116:
  ret
  nopl   0x0(%rax)
L101:
  ret
L92:
  xor    %r8d,%r8d
  jmp    L47
L34:
  xor    %edi,%edi
  jmp    L130
```

tool_calls: name: retrieve_data
arguments: label: D6
data_type: byte[16]

tool: {"D6": [0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00]}

assistant: ```c
void SKP_Silk_scale_vector32_Q16(int *data1, int gain_Q16, const int dataSize) {
  int i;
  ;
  ;
  if (gain_Q16 > 0x7FFF) {
    gain_Q16 -= 65536;
    for (i = 0; i < dataSize; i++) {
      data1[i] = ((data1[i]) + ((((data1[i]) >> 16) * (int)((short)(gain_Q16))) + ((((data1[i]) & 0x0000FFFF) * (int)((short)(gain_Q16))) >> 16)));
    }
  } else {
    for (i = 0; i < dataSize; i++) {
      data1[i] = ((((data1[i]) >> 16) * (int)((short)(gain_Q16))) + ((((data1[i]) & 0x0000FFFF) * (int)((short)(gain_Q16))) >> 16));
    }
  }
}
```