user: Translate the below assembly code into C programming language:

```asm
<macan_aes_unwrap>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xc0,%rsp
  mov    %rdi,-0x98(%rbp)
  mov    %rsi,-0xa0(%rbp)
  mov    %rdx,-0xa8(%rbp)
  mov    %rcx,-0xb0(%rbp)
  mov    %r8,-0xb8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0xa6,-0x70(%rbp)
  movl   $0xa6,-0x6c(%rbp)
  movl   $0xa6,-0x68(%rbp)
  movl   $0xa6,-0x64(%rbp)
  movl   $0xa6,-0x60(%rbp)
  movl   $0xa6,-0x5c(%rbp)
  movl   $0xa6,-0x58(%rbp)
  movl   $0xa6,-0x54(%rbp)
  movq   $0x10,-0x78(%rbp)
  mov    -0xa0(%rbp),%rax
  and    $0x7,%eax
  test   %rax,%rax
  jne    L108
  cmpq   $0x0,-0xa0(%rbp)
  je     L108
  mov    $0x1,%eax
  jmp    L94
L108:
  mov    $0x0,%eax
L94:
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0xa0(%rbp),%rdx
  mov    -0xb0(%rbp),%rcx
  mov    -0xb8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memmove@plt>
  mov    -0xa0(%rbp),%rax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  sub    $0x1,%eax
  mov    %eax,-0x7c(%rbp)
  movl   $0x5,-0x84(%rbp)
  jmp    L103
L65:
  mov    -0x7c(%rbp),%eax
  mov    %eax,-0x88(%rbp)
  jmp    L47
L73:
  mov    -0x7c(%rbp),%eax
  imul   -0x84(%rbp),%eax
  mov    %eax,%edx
  mov    -0x88(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x8c(%rbp)
  mov    -0x8c(%rbp),%eax
  mov    %eax,%edi
  call   <htobe32@plt>
  mov    %eax,-0x8c(%rbp)
  movl   $0x0,-0x80(%rbp)
  jmp    L109
L79:
  mov    -0x80(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0xb8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x80(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    -0x8c(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x80(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rsi
  mov    -0xb8(%rbp),%rax
  add    %rsi,%rax
  xor    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x80(%rbp)
L109:
  cmpl   $0x3,-0x80(%rbp)
  jle    L79
  mov    -0xb8(%rbp),%rcx
  lea    -0x50(%rbp),%rax
  mov    $0x8,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x88(%rbp),%eax
  shl    $0x3,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0xb8(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x50(%rbp),%rax
  add    $0x20,%rax
  mov    $0x8,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x78(%rbp),%rax
  mov    %eax,%esi
  lea    -0x50(%rbp),%rcx
  lea    -0x50(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  mov    %rax,%rdi
  call   <macan_aes_decrypt@plt>
  lea    -0x50(%rbp),%rcx
  mov    -0xb8(%rbp),%rax
  mov    $0x8,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  lea    -0x50(%rbp),%rax
  add    $0x20,%rax
  mov    -0x88(%rbp),%edx
  shl    $0x3,%edx
  mov    %edx,%edx
  lea    0x0(,%rdx,4),%rcx
  mov    -0xb8(%rbp),%rdx
  add    %rdx,%rcx
  mov    $0x8,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  subl   $0x1,-0x88(%rbp)
L47:
  cmpl   $0x0,-0x88(%rbp)
  jne    L73
  subl   $0x1,-0x84(%rbp)
L103:
  cmpl   $0x0,-0x84(%rbp)
  jns    L65
  lea    -0x70(%rbp),%rcx
  mov    -0xb8(%rbp),%rax
  mov    $0x8,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memchk@plt>
  test   %eax,%eax
  jne    L82
  mov    -0xa0(%rbp),%rax
  lea    -0x8(%rax),%rdx
  mov    -0xa8(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    $0x1,%eax
  jmp    L15
L82:
  mov    -0xa0(%rbp),%rax
  lea    -0x8(%rax),%rdx
  mov    -0xb8(%rbp),%rax
  lea    0x20(%rax),%rcx
  mov    -0xa8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    $0x0,%eax
L15:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L59
  call   <__stack_chk_fail@plt>
L59:
  leave
  ret
```

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;
  }
}
```