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

```asm
<aeskw_with_padding_test_openssl>:
  endbr64
  push   %r15
  push   %r14
  mov    %esi,%r14d
  push   %r13
  mov    %rdi,%r13
  lea    D6(%rip),%rdi
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %r8,%rbx
  sub    $0x838,%rsp
  mov    %r9d,0xc(%rsp)
  lea    0x20(%rsp),%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x828(%rsp)
  xor    %eax,%eax
  call   <puts@plt>
  lea    0x18(%rsp),%r9
  mov    %r15,%r8
  mov    %r12d,%ecx
  mov    %rbp,%rdx
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <aes_key_wrap_with_padding_openssl@plt>
  test   %rax,%rax
  jne    L108
  lea    D61(%rip),%rdi
  call   <puts@plt>
  mov    0x18(%rsp),%esi
  cmp    0xc(%rsp),%esi
  jne    L136
  lea    D77(%rip),%rdi
  call   <puts@plt>
  mov    0x18(%rsp),%edx
  test   %edx,%edx
  je     L24
  xor    %eax,%eax
  jmp    L146
  nopl   0x0(%rax)
L40:
  add    $0x1,%rax
  cmp    %rdx,%rax
  je     L24
L146:
  movzbl (%rbx,%rax,1),%ecx
  cmp    %cl,(%r15,%rax,1)
  je     L40
  lea    D0(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
L3:
  mov    0x828(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L156
  add    $0x838,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L24:
  lea    D76(%rip),%rdi
  lea    0x420(%rsp),%rbx
  call   <puts@plt>
  mov    0x18(%rsp),%ecx
  mov    %rbx,%r8
  mov    %r15,%rdx
  lea    0x1c(%rsp),%r9
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <aes_key_unwrap_with_padding_openssl@plt>
  test   %rax,%rax
  jne    L74
  lea    D102(%rip),%rdi
  call   <puts@plt>
  mov    0x1c(%rsp),%esi
  cmp    %r12d,%esi
  jne    L175
  lea    D11(%rip),%rdi
  call   <puts@plt>
  mov    0x1c(%rsp),%edx
  test   %edx,%edx
  je     L8
  xor    %eax,%eax
  jmp    L153
L130:
  add    $0x1,%rax
  cmp    %rdx,%rax
  je     L8
L153:
  movzbl (%rbx,%rax,1),%esi
  cmp    %sil,0x0(%rbp,%rax,1)
  je     L130
  lea    D112(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L3
  nopw   0x0(%rax,%rax,1)
L8:
  xor    %eax,%eax
  jmp    L3
L136:
  mov    0xc(%rsp),%edx
  lea    D1(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L3
L108:
  lea    D74(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L3
L175:
  mov    %r12d,%edx
  lea    D15(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L3
L74:
  lea    D84(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L3
L156:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D6
type_infered: string
name: read_data
arguments: label: D61
type_infered: string
name: read_data
arguments: label: D77
type_infered: string
name: read_data
arguments: label: D0
type_infered: string
name: read_data
arguments: label: D76
type_infered: string
name: read_data
arguments: label: D102
type_infered: string
name: read_data
arguments: label: D11
type_infered: string
name: read_data
arguments: label: D112
type_infered: string
name: read_data
arguments: label: D1
type_infered: string
name: read_data
arguments: label: D74
type_infered: string
name: read_data
arguments: label: D15
type_infered: string
name: read_data
arguments: label: D84
type_infered: string

tool: D6: Encrypting using aes_key_wrap_with_padding_openssl()

tool: D61: Checking known ciphertext

tool: D77: Encrypted lengths match

tool: D0: Error: ciphertext does not match expected

tool: D76: Decrypting using aes_key_unwrap_with_padding_openssl()

tool: D102: Checking aes_key_unwrap_with_padding_openssl()

tool: D11: Decrypted lengths match

tool: D112: Error: plaintext does not match expected

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


tool: D74: Error encrypting using aes_key_wrap_with_padding_openssl()

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


tool: D84: Error decrypting using aes_key_unwrap_with_padding_openssl()

assistant: ```c
int aeskw_with_padding_test_openssl(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_with_padding_openssl()\n");
  if (aes_key_wrap_with_padding_openssl(key, key_length, plaintext, plaintext_length, ciphertext, &ciphertext_length)) {
    printf("Error encrypting using aes_key_wrap_with_padding_openssl()\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_with_padding_openssl()\n");
  if (aes_key_unwrap_with_padding_openssl(key, key_length, ciphertext, ciphertext_length, plaintext_check, &plaintext_check_length)) {
    printf("Error decrypting using aes_key_unwrap_with_padding_openssl()\n");
    return (-1);
  }
  printf("Checking aes_key_unwrap_with_padding_openssl()\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);
}
```