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

```asm
<macan_aes_unwrap>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %rdi,(%rsp)
  mov    %rsi,%r15
  mov    %rsi,0x10(%rsp)
  mov    %rdx,0x18(%rsp)
  mov    %rcx,%rbp
  mov    %r8,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  movl   $0xa6,0x30(%rsp)
  movl   $0xa6,0x34(%rsp)
  movl   $0xa6,0x38(%rsp)
  movl   $0xa6,0x3c(%rsp)
  movl   $0xa6,0x40(%rsp)
  movl   $0xa6,0x44(%rsp)
  movl   $0xa6,0x48(%rsp)
  movl   $0xa6,0x4c(%rsp)
  test   $0x7,%sil
  sete   %al
  test   %rsi,%rsi
  setne  %dil
  movzbl %dil,%edi
  and    %eax,%edi
  call   <assert@plt>
  mov    %r15,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <memmove@plt>
  mov    %r15d,%eax
  add    $0x7,%eax
  test   %r15d,%r15d
  cmovns %r15d,%eax
  sar    $0x3,%eax
  sub    $0x1,%eax
  mov    %eax,0x8(%rsp)
  lea    (%rax,%rax,4),%r15d
  movl   $0x6,0xc(%rsp)
  lea    0x50(%rsp),%r12
  jmp    L7
L60:
  mov    $0x8,%edx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <memcpy@plt>
  lea    0x0(,%rbp,8),%eax
  mov    %eax,%eax
  lea    (%rbx,%rax,4),%r13
  lea    0x70(%rsp),%r14
  mov    $0x8,%edx
  mov    %r13,%rsi
  mov    %r14,%rdi
  call   <memcpy@plt>
  mov    %r12,%rcx
  mov    %r12,%rdx
  mov    $0x10,%esi
  mov    (%rsp),%rdi
  call   <macan_aes_decrypt@plt>
  mov    $0x8,%edx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <memcpy@plt>
  mov    $0x8,%edx
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <memcpy@plt>
  sub    $0x1,%ebp
  je     L2
L34:
  lea    (%r15,%rbp,1),%edi
  call   <htobe32@plt>
  mov    %eax,0x2c(%rsp)
  mov    $0x0,%eax
L53:
  mov    0x2c(%rsp,%rax,1),%edx
  xor    %edx,0x10(%rbx,%rax,1)
  add    $0x4,%rax
  cmp    $0x10,%rax
  jne    L53
  jmp    L60
L2:
  sub    0x8(%rsp),%r15d
  subl   $0x1,0xc(%rsp)
  je     L86
L7:
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  je     L2
  mov    %eax,%ebp
  jmp    L34
L86:
  lea    0x30(%rsp),%rsi
  mov    $0x8,%edx
  mov    %rbx,%rdi
  call   <memchk@plt>
  test   %eax,%eax
  jne    L21
  mov    0x10(%rsp),%rdx
  sub    $0x8,%rdx
  mov    $0x0,%esi
  mov    0x18(%rsp),%rdi
  call   <memset@plt>
  mov    $0x1,%eax
L68:
  mov    0x98(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L98
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L21:
  mov    0x10(%rsp),%rdx
  sub    $0x8,%rdx
  lea    0x20(%rbx),%rsi
  mov    0x18(%rsp),%rdi
  call   <memcpy@plt>
  mov    $0x0,%eax
  jmp    L68
L98:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int macan_aes_unwrap(const struct macan_key *key, size_t length, uint8_t *dst, uint8_t *src, uint8_t *tmp) {
  uint8_t iv[8] = {0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6};
  uint8_t b[16];
  size_t block_size = 16;
  uint32_t t, n;
  unsigned i;
  int j, k;
  assert((length % 8) == 0 && length > 0);
  memmove(tmp, src, length);
  n = (uint32_t)length / 8 - 1;
  for (j = 5; j >= 0; j--) {
    for (i = n; i > 0; i--) {
      t = (n * (uint32_t)j) + i;
      t = htobe32(t);
      for (k = 0; k < 4; k++) {
        *(tmp + 4 + k) = *(tmp + 4 + k) ^ *(((uint8_t *)&t) + k);
      }
      memcpy(b, tmp, 8);
      memcpy(b + 8, tmp + (8 * i), 8);
      macan_aes_decrypt(key, (unsigned)block_size, b, b);
      memcpy(tmp, b, 8);
      memcpy(tmp + (8 * i), b + 8, 8);
    }
  }
  if (!memchk(tmp, iv, 8)) {
    memset(dst, 0, length - 8);
    return 1;
  } else {
    memcpy(dst, tmp + 8, length - 8);
    return 0;
  }
}
```