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

```asm
<decrypt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x30(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    %r9,-0x48(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0x50(%rbp)
  mov    0x18(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  mov    $0x0,%eax
  call   <EVP_CIPHER_CTX_new@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L74
  mov    $0x0,%eax
  call   <handleErrors@plt>
L74:
  mov    $0x0,%eax
  call   <EVP_aes_256_gcm@plt>
  mov    %rax,%rsi
  mov    -0x10(%rbp),%rax
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    %rax,%rdi
  call   <EVP_DecryptInit_ex@plt>
  test   %eax,%eax
  jne    L97
  mov    $0x0,%eax
  call   <handleErrors@plt>
L97:
  mov    D10(%rip),%rax
  mov    (%rax),%esi
  mov    -0x10(%rbp),%rax
  mov    $0x0,%ecx
  mov    $0x10,%edx
  mov    %rax,%rdi
  call   <EVP_CIPHER_CTX_ctrl@plt>
  test   %eax,%eax
  jne    L21
  mov    $0x0,%eax
  call   <handleErrors@plt>
L21:
  mov    -0x50(%rbp),%rcx
  mov    -0x48(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rcx,%r8
  mov    %rdx,%rcx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <EVP_DecryptInit_ex@plt>
  test   %eax,%eax
  jne    L53
  mov    $0x0,%eax
  call   <handleErrors@plt>
L53:
  mov    -0x30(%rbp),%esi
  mov    -0x38(%rbp),%rcx
  lea    -0x1c(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %esi,%r8d
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <EVP_DecryptUpdate@plt>
  test   %eax,%eax
  jne    L113
  mov    $0x0,%eax
  call   <handleErrors@plt>
  jmp    L113
L81:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  lea    -0x1c(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    $0x10,%r8d
  mov    %rax,%rdi
  call   <EVP_DecryptUpdate@plt>
  cmp    $0x1,%eax
  je     L31
  mov    $0x0,%eax
  call   <handleErrors@plt>
L31:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x18(%rbp)
L113:
  mov    -0x2c(%rbp),%eax
  sub    $0xf,%eax
  cmp    %eax,-0x18(%rbp)
  jl     L81
  mov    -0x2c(%rbp),%eax
  sub    -0x18(%rbp),%eax
  mov    %eax,%edi
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  lea    -0x1c(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <EVP_DecryptUpdate@plt>
  cmp    $0x1,%eax
  je     L56
  mov    $0x0,%eax
  call   <handleErrors@plt>
L56:
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x18(%rbp)
  mov    D16(%rip),%rax
  mov    (%rax),%esi
  mov    -0x40(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x10,%edx
  mov    %rax,%rdi
  call   <EVP_CIPHER_CTX_ctrl@plt>
  test   %eax,%eax
  jne    L3
  mov    $0x0,%eax
  call   <handleErrors@plt>
L3:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x1c(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <EVP_DecryptFinal_ex@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <EVP_CIPHER_CTX_free@plt>
  cmpl   $0x0,-0x14(%rbp)
  jle    L82
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  jmp    L123
L82:
  mov    $0xffffffff,%eax
L123:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

assistant: ```c
int decrypt(unsigned char *ciphertext, int ciphertext_len, unsigned char *aad, int aad_len, unsigned char *tag, unsigned char *key, unsigned char *iv, unsigned char *plaintext) {
  EVP_CIPHER_CTX *ctx;
  int len = 0, plaintext_len = 0, ret;
  if (!(ctx = EVP_CIPHER_CTX_new()))
    handleErrors();
  if (!EVP_DecryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, NULL, NULL))
    handleErrors();
  if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, 16, NULL))
    handleErrors();
  if (!EVP_DecryptInit_ex(ctx, NULL, NULL, key, iv))
    handleErrors();
  if (!EVP_DecryptUpdate(ctx, NULL, &len, aad, aad_len))
    handleErrors();
  while (plaintext_len <= ciphertext_len - 16) {
    if (1 != EVP_DecryptUpdate(ctx, plaintext + plaintext_len, &len, ciphertext + plaintext_len, 16))
      handleErrors();
    plaintext_len += len;
  }
  if (1 != EVP_DecryptUpdate(ctx, plaintext + plaintext_len, &len, ciphertext + plaintext_len, ciphertext_len - plaintext_len))
    handleErrors();
  plaintext_len += len;
  if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, 16, tag))
    handleErrors();
  ret = EVP_DecryptFinal_ex(ctx, plaintext + plaintext_len, &len);
  EVP_CIPHER_CTX_free(ctx);
  if (ret > 0) {
    plaintext_len += len;
    return plaintext_len;
  } else {
    return -1;
  }
}
```