user: What is the c source code of the assembly code below?

```asm
<kek_wrap_key>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <EVP_CIPHER_CTX_block_size@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x40(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  add    $0x3,%rax
  mov    $0x0,%edx
  divq   -0x18(%rbp)
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  imul   -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  add    %rax,%rax
  cmp    %rax,-0x10(%rbp)
  jae    L13
  mov    $0x0,%eax
  jmp    L65
L13:
  cmpq   $0xff,-0x40(%rbp)
  jbe    L20
  mov    $0x0,%eax
  jmp    L65
L20:
  cmpq   $0x0,-0x28(%rbp)
  je     L64
  mov    -0x40(%rbp),%rax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  not    %edx
  mov    %dl,(%rax)
  mov    -0x38(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%edx
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  not    %edx
  mov    %dl,(%rax)
  mov    -0x38(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%edx
  mov    -0x28(%rbp),%rax
  add    $0x3,%rax
  not    %edx
  mov    %dl,(%rax)
  mov    -0x28(%rbp),%rax
  lea    0x4(%rax),%rcx
  mov    -0x40(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x40(%rbp),%rax
  add    $0x4,%rax
  cmp    %rax,-0x10(%rbp)
  jbe    L0
  mov    -0x10(%rbp),%rax
  sub    -0x40(%rbp),%rax
  lea    -0x4(%rax),%rdx
  mov    -0x40(%rbp),%rax
  lea    0x4(%rax),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <RAND_pseudo_bytes@plt>
L0:
  mov    -0x10(%rbp),%rdi
  mov    -0x28(%rbp),%rcx
  lea    -0x1c(%rbp),%rdx
  mov    -0x28(%rbp),%rsi
  mov    -0x48(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <EVP_EncryptUpdate@plt>
  mov    -0x10(%rbp),%rdi
  mov    -0x28(%rbp),%rcx
  lea    -0x1c(%rbp),%rdx
  mov    -0x28(%rbp),%rsi
  mov    -0x48(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <EVP_EncryptUpdate@plt>
L64:
  mov    -0x30(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    $0x1,%eax
L65:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L54
  call   <__stack_chk_fail@plt>
L54:
  leave
  ret
```

assistant: ```c
int kek_wrap_key(unsigned char *out, size_t *outlen, const unsigned char *in, size_t inlen, EVP_CIPHER_CTX *ctx) {
  size_t blocklen = EVP_CIPHER_CTX_block_size(ctx);
  size_t olen;
  int dummy;
  olen = (inlen + 4 + blocklen - 1) / blocklen;
  olen *= blocklen;
  if (olen < 2 * blocklen) {
    return 0;
  }
  if (inlen > 0xFF) {
    return 0;
  }
  if (out) {
    out[0] = (unsigned char)inlen;
    out[1] = in[0] ^ 0xFF;
    out[2] = in[1] ^ 0xFF;
    out[3] = in[2] ^ 0xFF;
    memcpy(out + 4, in, inlen);
    if (olen > inlen + 4)
      RAND_pseudo_bytes(out + 4 + inlen, olen - 4 - inlen);
    EVP_EncryptUpdate(ctx, out, &dummy, out, olen);
    EVP_EncryptUpdate(ctx, out, &dummy, out, olen);
  }
  *outlen = olen;
  return 1;
}
```