user: Converte this assembly snippet into its equivalent C code:

```asm
<bs_conv_8_14le>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  movslq %esi,%r12
  imul   $0xffffffff92492493,%r12,%r12
  shr    $0x20,%r12
  add    %esi,%r12d
  sar    $0x2,%r12d
  mov    %esi,%eax
  sar    $0x1f,%eax
  sub    %eax,%r12d
  lea    0x0(,%r12,8),%r13d
  mov    %r13d,%eax
  sub    %r12d,%eax
  sub    %eax,%esi
  cltq
  lea    (%rdi,%rax,1),%r14
  movslq %r13d,%rax
  lea    (%rdx,%rax,1),%rbx
  movslq %esi,%rdx
  lea    D3(%rip),%rax
  add    (%rax,%rdx,4),%r13d
  test   %esi,%esi
  je     L58
  mov    %esi,%edx
  je     L66
  lea    -0x1(%rsi),%esi
  mov    $0x0,%eax
L30:
  movzbl (%r14,%rax,1),%ecx
  mov    %cl,(%rbx,%rax,1)
  mov    %rax,%rcx
  add    $0x1,%rax
  cmp    %rsi,%rcx
  jne    L30
  cmp    $0x6,%edx
  ja     L10
L66:
  mov    %edx,%eax
  movb   $0x0,(%rbx,%rax,1)
  add    $0x1,%edx
  cmp    $0x6,%edx
  jbe    L66
L10:
  mov    (%rbx),%edi
  call   <spdif_swab_s32@plt>
  mov    %eax,%ebp
  mov    0x3(%rbx),%edi
  call   <spdif_swab_s32@plt>
  mov    %eax,%ecx
  mov    %ebp,%edx
  shr    $0x2,%edx
  and    $0x3fff0000,%edx
  shr    $0x4,%ebp
  and    $0x3fff,%ebp
  or     %ebp,%edx
  lea    0x0(,%rax,4),%eax
  and    $0x3fff0000,%eax
  and    $0x3fff,%ecx
  or     %ecx,%eax
  mov    %edx,%edi
  shr    $0x8,%edi
  and    $0xff00ff,%edi
  shl    $0x8,%edx
  and    $0xff00ff00,%edx
  mov    %eax,%ebp
  shr    $0x8,%ebp
  and    $0xff00ff,%ebp
  shl    $0x8,%eax
  and    $0xff00ff00,%eax
  or     %eax,%ebp
  or     %edx,%edi
  call   <spdif_swab_s32@plt>
  mov    %eax,(%rbx)
  mov    %ebp,%edi
  call   <spdif_swab_s32@plt>
  mov    %eax,0x4(%rbx)
L58:
  lea    -0x7(%r14),%rbp
  sub    $0x8,%rbx
  test   %r12d,%r12d
  je     L59
  lea    -0x1(%r12),%eax
  lea    0x0(,%rax,8),%rdx
  sub    %rdx,%rax
  lea    -0xe(%r14,%rax,1),%r12
L22:
  mov    0x0(%rbp),%edi
  call   <spdif_swab_s32@plt>
  mov    %eax,%r14d
  mov    0x3(%rbp),%edi
  call   <spdif_swab_s32@plt>
  mov    %eax,%ecx
  mov    %r14d,%edx
  shr    $0x2,%edx
  and    $0x3fff0000,%edx
  shr    $0x4,%r14d
  and    $0x3fff,%r14d
  or     %r14d,%edx
  lea    0x0(,%rax,4),%eax
  and    $0x3fff0000,%eax
  and    $0x3fff,%ecx
  or     %ecx,%eax
  mov    %edx,%edi
  shr    $0x8,%edi
  and    $0xff00ff,%edi
  shl    $0x8,%edx
  and    $0xff00ff00,%edx
  mov    %eax,%r14d
  shr    $0x8,%r14d
  and    $0xff00ff,%r14d
  shl    $0x8,%eax
  and    $0xff00ff00,%eax
  or     %eax,%r14d
  or     %edx,%edi
  call   <spdif_swab_s32@plt>
  mov    %eax,(%rbx)
  mov    %r14d,%edi
  call   <spdif_swab_s32@plt>
  mov    %eax,0x4(%rbx)
  sub    $0x7,%rbp
  sub    $0x8,%rbx
  cmp    %rbp,%r12
  jne    L22
L59:
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: parse_data
arguments: data_label: D3
type_guessed: 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;
}
```