user: 请从给定的汇编指令推导出C源代码:

```asm
<aeskw_test>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x860,%rsp
  mov    %rdi,-0x838(%rbp)
  mov    %esi,-0x83c(%rbp)
  mov    %rdx,-0x848(%rbp)
  mov    %ecx,-0x840(%rbp)
  mov    %r8,-0x850(%rbp)
  mov    %r9d,-0x854(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D58(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x810(%rbp),%r8
  mov    -0x840(%rbp),%ecx
  mov    -0x848(%rbp),%rdx
  mov    -0x83c(%rbp),%esi
  mov    -0x838(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x82c(%rbp),%rdi
  push   %rdi
  mov    %r8,%r9
  mov    $0x0,%r8d
  mov    %rax,%rdi
  call   <aes_key_wrap@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  je     L64
  lea    D104(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L94
L64:
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x82c(%rbp),%eax
  cmp    %eax,-0x854(%rbp)
  je     L163
  mov    -0x82c(%rbp),%eax
  mov    -0x854(%rbp),%edx
  mov    %eax,%esi
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L94
L163:
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x824(%rbp)
  lea    -0x810(%rbp),%rax
  mov    %rax,-0x820(%rbp)
  mov    -0x850(%rbp),%rax
  mov    %rax,-0x818(%rbp)
  jmp    L6
L86:
  mov    -0x820(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x820(%rbp)
  movzbl (%rax),%ecx
  mov    -0x818(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x818(%rbp)
  movzbl (%rax),%eax
  cmp    %al,%cl
  je     L121
  lea    D79(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L94
L121:
  addl   $0x1,-0x824(%rbp)
L6:
  mov    -0x824(%rbp),%edx
  mov    -0x82c(%rbp),%eax
  cmp    %eax,%edx
  jb     L86
  lea    D85(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x82c(%rbp),%ecx
  lea    -0x410(%rbp),%r8
  lea    -0x810(%rbp),%rdx
  mov    -0x83c(%rbp),%esi
  mov    -0x838(%rbp),%rax
  push   $0x0
  lea    -0x828(%rbp),%rdi
  push   %rdi
  mov    %r8,%r9
  mov    $0x0,%r8d
  mov    %rax,%rdi
  call   <aes_key_unwrap@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  je     L59
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L94
L59:
  lea    D59(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x828(%rbp),%eax
  cmp    %eax,-0x840(%rbp)
  je     L148
  mov    -0x828(%rbp),%eax
  mov    -0x840(%rbp),%edx
  mov    %eax,%esi
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L94
L148:
  lea    D57(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x824(%rbp)
  mov    -0x848(%rbp),%rax
  mov    %rax,-0x820(%rbp)
  lea    -0x410(%rbp),%rax
  mov    %rax,-0x818(%rbp)
  jmp    L34
L115:
  mov    -0x820(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x820(%rbp)
  movzbl (%rax),%ecx
  mov    -0x818(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x818(%rbp)
  movzbl (%rax),%eax
  cmp    %al,%cl
  je     L156
  lea    D114(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L94
L156:
  addl   $0x1,-0x824(%rbp)
L34:
  mov    -0x824(%rbp),%edx
  mov    -0x828(%rbp),%eax
  cmp    %eax,%edx
  jb     L115
  mov    $0x0,%eax
L94:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L139
  call   <__stack_chk_fail@plt>
L139:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D58
datatype: string
name: read_data
arguments: data_tag: D104
datatype: string
name: read_data
arguments: data_tag: D62
datatype: string
name: read_data
arguments: data_tag: D35
datatype: string
name: read_data
arguments: data_tag: D21
datatype: string
name: read_data
arguments: data_tag: D79
datatype: string
name: read_data
arguments: data_tag: D85
datatype: string
name: read_data
arguments: data_tag: D29
datatype: string
name: read_data
arguments: data_tag: D59
datatype: string
name: read_data
arguments: data_tag: D5
datatype: string
name: read_data
arguments: data_tag: D57
datatype: string
name: read_data
arguments: data_tag: D114
datatype: string

tool: D58: Encrypting using aes_key_wrap()

tool: D104: Error encrypting using aes_key_wrap()

tool: D62: Checking known ciphertext

tool: D35: Error: ciphertext length (%i) does not match expected (%i)


tool: D21: Encrypted lengths match

tool: D79: Error: ciphertext does not match expected

tool: D85: Decrypting using aes_key_unwrap()

tool: D29: Error decrypting using aes_key_unwrap()

tool: D59: Checking aes_key_unwrap()

tool: D5: Error: Plaintext length (%i) does not match expected (%i)


tool: D57: Decrypted lengths match

tool: D114: Error: plaintext does not match expected

assistant: ```c
int aeskw_test(const unsigned char *key, unsigned int key_length, const unsigned char *plaintext, unsigned int plaintext_length, const unsigned char *expected_ciphertext, unsigned int expected_ciphertext_length) {
  unsigned char ciphertext[1024];
  unsigned char plaintext_check[1024];
  unsigned int ciphertext_length;
  unsigned int plaintext_check_length;
  int i;
  const unsigned char *p1, *p2;
  printf("Encrypting using aes_key_wrap()\n");
  if (aes_key_wrap(key, key_length, plaintext, plaintext_length, NULL, ciphertext, &ciphertext_length)) {
    printf("Error encrypting using aes_key_wrap()\n");
    return (-1);
  }
  printf("Checking known ciphertext\n");
  if (ciphertext_length != expected_ciphertext_length) {
    printf("Error: ciphertext length (%i) does not match "
           "expected (%i)\n",
           ciphertext_length, expected_ciphertext_length);
    return (-1);
  } else {
    printf("Encrypted lengths match\n");
  }
  for (i = 0, p1 = ciphertext, p2 = expected_ciphertext; i < ciphertext_length; i++) {
    if (*(p1++) != *(p2++)) {
      printf("Error: ciphertext does not match expected\n");
      return (-1);
    }
  }
  printf("Decrypting using aes_key_unwrap()\n");
  if (aes_key_unwrap(key, key_length, ciphertext, ciphertext_length, NULL, plaintext_check, &plaintext_check_length, NULL)) {
    printf("Error decrypting using aes_key_unwrap()\n");
    return (-1);
  }
  printf("Checking aes_key_unwrap()\n");
  if (plaintext_check_length != plaintext_length) {
    printf("Error: Plaintext length (%i) does not match "
           "expected (%i)\n",
           plaintext_check_length, plaintext_length);
    return (-1);
  } else {
    printf("Decrypted lengths match\n");
  }
  for (i = 0, p1 = plaintext, p2 = plaintext_check; i < plaintext_check_length; i++) {
    if (*(p1++) != *(p2++)) {
      printf("Error: plaintext does not match expected\n");
      return (-1);
    }
  }
  return (0);
}
```