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

```asm
<bits_to_bytes>:
  endbr64
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %edi,%ebx
  shl    $0x3,%edi
  sub    $0x8,%rsp
  call   <malloc@plt>
  test   %ebx,%ebx
  jle    L56
  movslq %ebx,%rdx
  mov    %rax,%rcx
  lea    (%rax,%rdx,8),%rsi
  cmp    %rsi,%rbp
  setae  %sil
  add    %rbp,%rdx
  cmp    %rdx,%rax
  setae  %dl
  or     %dl,%sil
  je     L8
  lea    -0x1(%rbx),%edx
  cmp    $0xe,%edx
  jbe    L8
  movdqa D129(%rip),%xmm8
  mov    %ebx,%edx
  mov    %rbp,%rsi
  movdqa D50(%rip),%xmm15
  movdqa D9(%rip),%xmm14
  shr    $0x4,%edx
  movdqa D32(%rip),%xmm13
  movdqa D122(%rip),%xmm12
  sub    $0x1,%edx
  movdqa D33(%rip),%xmm11
  movdqa D15(%rip),%xmm10
  shl    $0x4,%rdx
  lea    0x10(%rbp,%rdx,1),%rdx
  nopl   0x0(%rax)
L40:
  movdqu (%rsi),%xmm0
  add    $0x10,%rsi
  sub    $0xffffffffffffff80,%rax
  movdqa %xmm0,%xmm1
  movdqa %xmm0,%xmm7
  movdqa %xmm0,%xmm3
  movdqa %xmm0,%xmm6
  psraw  $0x1,%xmm1
  pand   D37(%rip),%xmm1
  psraw  $0x4,%xmm7
  movdqa %xmm0,%xmm2
  movdqa %xmm0,%xmm5
  psraw  $0x2,%xmm3
  pand   D60(%rip),%xmm7
  pand   D114(%rip),%xmm3
  psraw  $0x5,%xmm6
  movdqa %xmm0,%xmm4
  pxor   %xmm15,%xmm1
  psraw  $0x3,%xmm2
  pxor   %xmm12,%xmm7
  pand   D70(%rip),%xmm6
  psraw  $0x6,%xmm5
  pand   %xmm8,%xmm4
  psubb  %xmm15,%xmm1
  pxor   %xmm14,%xmm3
  psubb  %xmm12,%xmm7
  pxor   %xmm11,%xmm6
  pand   %xmm8,%xmm7
  pand   %xmm8,%xmm1
  movdqa %xmm4,%xmm9
  psubb  %xmm14,%xmm3
  psubb  %xmm11,%xmm6
  psraw  $0x7,%xmm0
  pand   %xmm8,%xmm6
  punpcklbw %xmm7,%xmm9
  punpckhbw %xmm7,%xmm4
  pand   %xmm8,%xmm3
  movdqa %xmm1,%xmm7
  pandn  %xmm8,%xmm0
  pand   D118(%rip),%xmm2
  pand   D110(%rip),%xmm5
  punpcklbw %xmm6,%xmm7
  punpckhbw %xmm6,%xmm1
  psubb  %xmm8,%xmm0
  movdqa %xmm3,%xmm6
  pxor   %xmm13,%xmm2
  pxor   %xmm10,%xmm5
  pand   %xmm8,%xmm0
  psubb  %xmm13,%xmm2
  psubb  %xmm10,%xmm5
  pand   %xmm8,%xmm5
  pand   %xmm8,%xmm2
  punpcklbw %xmm5,%xmm6
  punpckhbw %xmm5,%xmm3
  movdqa %xmm2,%xmm5
  punpcklbw %xmm0,%xmm5
  punpckhbw %xmm0,%xmm2
  movdqa %xmm9,%xmm0
  punpcklbw %xmm6,%xmm0
  punpckhbw %xmm6,%xmm9
  movdqa %xmm4,%xmm6
  punpcklbw %xmm3,%xmm6
  punpckhbw %xmm3,%xmm4
  movdqa %xmm7,%xmm3
  punpcklbw %xmm5,%xmm3
  punpckhbw %xmm5,%xmm7
  movdqa %xmm1,%xmm5
  punpcklbw %xmm2,%xmm5
  punpckhbw %xmm2,%xmm1
  movdqa %xmm0,%xmm2
  punpckhbw %xmm3,%xmm0
  punpcklbw %xmm3,%xmm2
  movups %xmm0,-0x70(%rax)
  movdqa %xmm9,%xmm0
  punpckhbw %xmm7,%xmm9
  punpcklbw %xmm7,%xmm0
  movups %xmm2,-0x80(%rax)
  movups %xmm0,-0x60(%rax)
  movdqa %xmm6,%xmm0
  punpckhbw %xmm5,%xmm6
  punpcklbw %xmm5,%xmm0
  movups %xmm9,-0x50(%rax)
  movups %xmm0,-0x40(%rax)
  movdqa %xmm4,%xmm0
  punpckhbw %xmm1,%xmm4
  punpcklbw %xmm1,%xmm0
  movups %xmm6,-0x30(%rax)
  movups %xmm0,-0x20(%rax)
  movups %xmm4,-0x10(%rax)
  cmp    %rsi,%rdx
  jne    L40
  mov    %ebx,%esi
  and    $0xfffffff0,%esi
  test   $0xf,%bl
  je     L56
  mov    %esi,%eax
  lea    0x0(,%rsi,8),%edx
  movslq %edx,%rdx
  add    %rbp,%rax
  add    %rcx,%rdx
  sub    %eax,%esi
  nopl   0x0(%rax,%rax,1)
L24:
  movzbl (%rax),%ecx
  add    $0x1,%rax
  add    $0x8,%rdx
  and    $0x1,%ecx
  mov    %cl,-0x8(%rdx)
  movsbl -0x1(%rax),%ecx
  sar    %ecx
  and    $0x1,%ecx
  mov    %cl,-0x7(%rdx)
  movsbl -0x1(%rax),%ecx
  sar    $0x2,%ecx
  and    $0x1,%ecx
  mov    %cl,-0x6(%rdx)
  movsbl -0x1(%rax),%ecx
  sar    $0x3,%ecx
  and    $0x1,%ecx
  mov    %cl,-0x5(%rdx)
  movsbl -0x1(%rax),%ecx
  sar    $0x4,%ecx
  and    $0x1,%ecx
  mov    %cl,-0x4(%rdx)
  movsbl -0x1(%rax),%ecx
  sar    $0x5,%ecx
  and    $0x1,%ecx
  mov    %cl,-0x3(%rdx)
  movsbl -0x1(%rax),%ecx
  sar    $0x6,%ecx
  and    $0x1,%ecx
  mov    %cl,-0x2(%rdx)
  movsbl -0x1(%rax),%ecx
  sar    $0x7,%ecx
  and    $0x1,%ecx
  mov    %cl,-0x1(%rdx)
  lea    (%rsi,%rax,1),%ecx
  cmp    %ecx,%ebx
  jg     L24
L56:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L8:
  mov    %ebx,%ebx
  mov    %rbp,%rdx
  lea    (%rax,%rbx,8),%rsi
  nopw   0x0(%rax,%rax,1)
L35:
  movzbl (%rdx),%eax
  add    $0x8,%rcx
  add    $0x1,%rdx
  and    $0x1,%eax
  mov    %al,-0x8(%rcx)
  movsbl -0x1(%rdx),%eax
  sar    %eax
  and    $0x1,%eax
  mov    %al,-0x7(%rcx)
  movsbl -0x1(%rdx),%eax
  sar    $0x2,%eax
  and    $0x1,%eax
  mov    %al,-0x6(%rcx)
  movsbl -0x1(%rdx),%eax
  sar    $0x3,%eax
  and    $0x1,%eax
  mov    %al,-0x5(%rcx)
  movsbl -0x1(%rdx),%eax
  sar    $0x4,%eax
  and    $0x1,%eax
  mov    %al,-0x4(%rcx)
  movsbl -0x1(%rdx),%eax
  sar    $0x5,%eax
  and    $0x1,%eax
  mov    %al,-0x3(%rcx)
  movsbl -0x1(%rdx),%eax
  sar    $0x6,%eax
  and    $0x1,%eax
  mov    %al,-0x2(%rcx)
  movsbl -0x1(%rdx),%eax
  sar    $0x7,%eax
  and    $0x1,%eax
  mov    %al,-0x1(%rcx)
  cmp    %rsi,%rcx
  jne    L35
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: data_label: D129
data_type: byte[16]
name: parse_data
arguments: data_label: D50
data_type: byte[16]
name: parse_data
arguments: data_label: D9
data_type: byte[16]
name: parse_data
arguments: data_label: D32
data_type: byte[16]
name: parse_data
arguments: data_label: D122
data_type: byte[16]
name: parse_data
arguments: data_label: D33
data_type: byte[16]
name: parse_data
arguments: data_label: D15
data_type: byte[16]
name: parse_data
arguments: data_label: D37
data_type: byte[16]
name: parse_data
arguments: data_label: D60
data_type: byte[16]
name: parse_data
arguments: data_label: D114
data_type: byte[16]
name: parse_data
arguments: data_label: D70
data_type: byte[16]
name: parse_data
arguments: data_label: D118
data_type: byte[16]
name: parse_data
arguments: data_label: D110
data_type: byte[16]

tool: {"D129": [0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01]}

tool: {"D50": [0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40]}

tool: {"D9": [0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20]}

tool: {"D32": [0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10]}

tool: {"D122": [0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08]}

tool: {"D33": [0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04]}

tool: {"D15": [0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02]}

tool: {"D37": [0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f]}

tool: {"D60": [0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f]}

tool: {"D114": [0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f]}

tool: {"D70": [0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07]}

tool: {"D118": [0x1f,0x1f,0x1f,0x1f,0x1f,0x1f,0x1f,0x1f,0x1f,0x1f,0x1f,0x1f,0x1f,0x1f,0x1f,0x1f]}

tool: {"D110": [0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03]}

assistant: ```c
char *bits_to_bytes(int len, char *in) {
  int i;
  unsigned char c;
  char *out = (char *)malloc(len * 8 * sizeof(char));
  for (i = 0; i < len; i++) {
    for (c = 0; c < 8; c++) {
      out[i * 8 + c] = (in[i] >> c) & 1;
    }
  }
}
```