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

```asm
<bs_conv_8_14le>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    -0x4c(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x4c(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x2,%edx
  mov    %eax,%esi
  sar    $0x1f,%esi
  mov    %edx,%ecx
  sub    %esi,%ecx
  mov    %ecx,%edx
  shl    $0x3,%edx
  sub    %ecx,%edx
  sub    %edx,%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x34(%rbp),%edx
  mov    %edx,%eax
  shl    $0x3,%eax
  sub    %edx,%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x34(%rbp),%eax
  shl    $0x3,%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x34(%rbp),%eax
  lea    0x0(,%rax,8),%ecx
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    D9(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  add    %ecx,%eax
  mov    %eax,-0x4c(%rbp)
  cmpl   $0x0,-0x2c(%rbp)
  je     L45
  movl   $0x0,-0x30(%rbp)
  jmp    L39
L50:
  mov    -0x30(%rbp),%edx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    -0x30(%rbp),%ecx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x30(%rbp)
L39:
  mov    -0x2c(%rbp),%eax
  cmp    %eax,-0x30(%rbp)
  jb     L50
  jmp    L1
L62:
  mov    -0x30(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  addl   $0x1,-0x30(%rbp)
L1:
  cmpl   $0x6,-0x30(%rbp)
  jbe    L62
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <spdif_swab_s32@plt>
  mov    %eax,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x3,%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <spdif_swab_s32@plt>
  mov    %eax,-0x24(%rbp)
  mov    -0x28(%rbp),%eax
  shr    $0x2,%eax
  and    $0x3fff0000,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  shr    $0x4,%eax
  and    $0x3fff,%eax
  or     %edx,%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x24(%rbp),%eax
  shl    $0x2,%eax
  and    $0x3fff0000,%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  and    $0x3fff,%eax
  or     %edx,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x28(%rbp),%eax
  shr    $0x8,%eax
  and    $0xff00ff,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  shl    $0x8,%eax
  and    $0xff00ff00,%eax
  or     %edx,%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x24(%rbp),%eax
  shr    $0x8,%eax
  and    $0xff00ff,%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  shl    $0x8,%eax
  and    $0xff00ff00,%eax
  or     %edx,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,%edi
  call   <spdif_swab_s32@plt>
  mov    -0x18(%rbp),%rdx
  mov    %eax,(%rdx)
  mov    -0x18(%rbp),%rax
  lea    0x4(%rax),%rbx
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <spdif_swab_s32@plt>
  mov    %eax,(%rbx)
L45:
  subq   $0x7,-0x20(%rbp)
  subq   $0x8,-0x18(%rbp)
  jmp    L32
L69:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <spdif_swab_s32@plt>
  mov    %eax,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x3,%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <spdif_swab_s32@plt>
  mov    %eax,-0x24(%rbp)
  mov    -0x28(%rbp),%eax
  shr    $0x2,%eax
  and    $0x3fff0000,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  shr    $0x4,%eax
  and    $0x3fff,%eax
  or     %edx,%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x24(%rbp),%eax
  shl    $0x2,%eax
  and    $0x3fff0000,%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  and    $0x3fff,%eax
  or     %edx,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x28(%rbp),%eax
  shr    $0x8,%eax
  and    $0xff00ff,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  shl    $0x8,%eax
  and    $0xff00ff00,%eax
  or     %edx,%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x24(%rbp),%eax
  shr    $0x8,%eax
  and    $0xff00ff,%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  shl    $0x8,%eax
  and    $0xff00ff00,%eax
  or     %edx,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,%edi
  call   <spdif_swab_s32@plt>
  mov    -0x18(%rbp),%rdx
  mov    %eax,(%rdx)
  mov    -0x18(%rbp),%rax
  lea    0x4(%rax),%rbx
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <spdif_swab_s32@plt>
  mov    %eax,(%rbx)
  subq   $0x7,-0x20(%rbp)
  subq   $0x8,-0x18(%rbp)
L32:
  mov    -0x34(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x34(%rbp)
  test   %eax,%eax
  jne    L69
  mov    -0x4c(%rbp),%eax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D9
type_infered: string

tool: 

assistant: ```c
int bs_conv_8_14le(const unsigned char *in_buf, int size, unsigned char *out_buf) {
  static const int inc[7] = {0, 2, 4, 4, 6, 6, 8};
  int n = size / 7;
  int r = size % 7;
  const unsigned char *src = in_buf + n * 7;
  unsigned char *dst = out_buf + n * 8;
  unsigned int i, w1, w2;
  size = n * 8 + inc[r];
  if (r) {
    i = 0;
    for (; i < r; i++)
      dst[i] = src[i];
    for (; i < 7; i++)
      dst[i] = 0;
    w1 = spdif_swab_s32(*(unsigned int *)(dst + 0));
    w2 = spdif_swab_s32(*(unsigned int *)(dst + 3));
    w1 = ((w1 >> 2) & 0x3fff0000) | ((w1 >> 4) & 0x00003fff);
    w2 = ((w2 << 2) & 0x3fff0000) | (w2 & 0x00003fff);
    w1 = ((w1 & 0xff00ff00) >> 8) | ((w1 & 0x00ff00ff) << 8);
    w2 = ((w2 & 0xff00ff00) >> 8) | ((w2 & 0x00ff00ff) << 8);
    (*(unsigned int *)(dst + 0)) = spdif_swab_s32(w1);
    (*(unsigned int *)(dst + 4)) = spdif_swab_s32(w2);
  }
  src -= 7;
  dst -= 8;
  while (n--) {
    w1 = spdif_swab_s32(*(unsigned int *)(src + 0));
    w2 = spdif_swab_s32(*(unsigned int *)(src + 3));
    w1 = ((w1 >> 2) & 0x3fff0000) | ((w1 >> 4) & 0x00003fff);
    w2 = ((w2 << 2) & 0x3fff0000) | (w2 & 0x00003fff);
    w1 = ((w1 & 0xff00ff00) >> 8) | ((w1 & 0x00ff00ff) << 8);
    w2 = ((w2 & 0xff00ff00) >> 8) | ((w2 & 0x00ff00ff) << 8);
    (*(unsigned int *)(dst + 0)) = spdif_swab_s32(w1);
    (*(unsigned int *)(dst + 4)) = spdif_swab_s32(w2);
    src -= 7;
    dst -= 8;
  }
  return size;
}
```