user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<unpack>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %edx,-0x54(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%r8
  mov    -0x54(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x28(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  movslq %eax,%rdx
  mov    %rdx,%rcx
  mov    $0x0,%ebx
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%ebx
  mov    $0x0,%edx
  div    %rbx
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L96:
  cmp    %rdx,%rsp
  je     L60
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L96
L60:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L7
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L7:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x20(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L34
L20:
  mov    -0x3c(%rbp),%eax
  and    $0x1,%eax
  lea    0x9(%rax),%ecx
  mov    -0x20(%rbp),%rax
  mov    -0x3c(%rbp),%edx
  movslq %edx,%rdx
  mov    %ecx,(%rax,%rdx,4)
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movw   $0x0,(%rax)
L34:
  mov    -0x3c(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L20
  movl   $0x0,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x38(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
  jmp    L83
L71:
  mov    -0x20(%rbp),%rax
  mov    -0x38(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  sub    -0x34(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x30(%rbp)
  cmpl   $0x7,-0x2c(%rbp)
  jg     L32
  mov    $0x8,%eax
  sub    -0x2c(%rbp),%eax
  mov    $0xff,%edx
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%eax
  and    %eax,-0x30(%rbp)
L32:
  mov    -0x38(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%esi
  mov    -0x34(%rbp),%eax
  mov    -0x30(%rbp),%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  mov    %eax,%ecx
  mov    -0x38(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  lea    (%rsi,%rcx,1),%edx
  mov    %dx,(%rax)
  cmpl   $0x8,-0x2c(%rbp)
  jg     L23
  addl   $0x1,-0x38(%rbp)
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  lea    (%rdx,%rdx,1),%rcx
  mov    -0x48(%rbp),%rdx
  add    %rcx,%rdx
  movzwl (%rdx),%edi
  mov    -0x3c(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x50(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%esi
  mov    -0x2c(%rbp),%edx
  mov    %edx,%ecx
  sar    %cl,%esi
  mov    %esi,%edx
  mov    %edx,%ecx
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  lea    (%rdi,%rcx,1),%edx
  mov    %dx,(%rax)
  mov    $0x8,%eax
  sub    -0x2c(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  jmp    L78
L23:
  addl   $0x8,-0x34(%rbp)
L78:
  addl   $0x1,-0x3c(%rbp)
L83:
  mov    -0x3c(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L71
  mov    %r8,%rsp
  nop
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L50
  call   <__stack_chk_fail@plt>
L50:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void unpack(unsigned short *tgt, unsigned char *src, int len) {
  int x, y, z;
  int n, temp;
  int buffer[len];
  for (x = 0; x < len; tgt[x++] = 0)
    buffer[x] = 9 + (x & 1);
  for (x = y = z = 0; x < len; x++) {
    n = buffer[y] - z;
    temp = src[x];
    if (n < 8)
      temp &= 255 >> (8 - n);
    tgt[y] += temp << z;
    if (n <= 8) {
      tgt[++y] += src[x] >> n;
      z = 8 - n;
    } else
      z += 8;
  }
}
```