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

```asm
<PKCS7_SIGNER_INFO_sign>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x8(%rsp)
  mov    0x18(%rdi),%rax
  mov    (%rax),%edi
  call   <EVP_get_digestbyobj@plt>
  mov    %rax,%rbp
  mov    $0x0,%eax
  test   %rbp,%rbp
  je     L67
  call   <EVP_MD_CTX_new@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L95
  mov    %rsp,%rsi
  mov    0x10(%rbx),%r8d
  mov    $0x0,%ecx
  mov    %rbp,%rdx
  mov    %rax,%rdi
  call   <EVP_DigestSignInit@plt>
  test   %rax,%rax
  jle    L99
  mov    %rbx,%r9
  mov    $0x0,%r8d
  mov    D51(%rip),%rax
  mov    (%rax),%ecx
  mov    D107(%rip),%rax
  mov    (%rax),%edx
  mov    $0xffffffff,%esi
  mov    (%rsp),%rdi
  call   <EVP_PKEY_CTX_ctrl@plt>
  test   %rax,%rax
  jle    L8
  mov    D45(%rip),%rax
  mov    (%rax),%edi
  call   <ASN1_ITEM_rptr@plt>
  mov    %eax,%edx
  lea    0x8(%rsp),%rsi
  mov    0x8(%rbx),%rdi
  call   <ASN1_item_i2d@plt>
  mov    %eax,%edx
  mov    0x8(%rsp),%rsi
  test   %rsi,%rsi
  je     L99
  mov    %r12,%rdi
  call   <EVP_DigestSignUpdate@plt>
  test   %rax,%rax
  jle    L99
  mov    0x8(%rsp),%rdi
  call   <OPENSSL_free@plt>
  movq   $0x0,0x8(%rsp)
  lea    0x10(%rsp),%rdx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <EVP_DigestSignFinal@plt>
  test   %rax,%rax
  jle    L99
  mov    0x10(%rsp),%rdi
  call   <OPENSSL_malloc@plt>
  mov    %rax,%rsi
  mov    %rax,0x8(%rsp)
  test   %rax,%rax
  je     L99
  lea    0x10(%rsp),%rdx
  mov    %r12,%rdi
  call   <EVP_DigestSignFinal@plt>
  test   %rax,%rax
  jle    L99
  mov    %rbx,%r9
  mov    $0x1,%r8d
  mov    D51(%rip),%rax
  mov    (%rax),%ecx
  mov    D107(%rip),%rax
  mov    (%rax),%edx
  mov    $0xffffffff,%esi
  mov    (%rsp),%rdi
  call   <EVP_PKEY_CTX_ctrl@plt>
  test   %rax,%rax
  jle    L40
  mov    %r12,%rdi
  call   <EVP_MD_CTX_free@plt>
  mov    0x10(%rsp),%rdx
  mov    0x8(%rsp),%rsi
  mov    (%rbx),%edi
  call   <ASN1_STRING_set0@plt>
  mov    $0x1,%eax
  jmp    L67
L95:
  mov    D72(%rip),%rax
  mov    (%rax),%esi
  mov    D68(%rip),%rax
  mov    (%rax),%edi
  call   <PKCS7err@plt>
L99:
  mov    0x8(%rsp),%rdi
  call   <OPENSSL_free@plt>
  mov    %r12,%rdi
  call   <EVP_MD_CTX_free@plt>
  mov    $0x0,%eax
L67:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L55
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L8:
  mov    D105(%rip),%rax
  mov    (%rax),%esi
  mov    D68(%rip),%rax
  mov    (%rax),%edi
  call   <PKCS7err@plt>
  jmp    L99
L40:
  mov    D105(%rip),%rax
  mov    (%rax),%esi
  mov    D68(%rip),%rax
  mov    (%rax),%edi
  call   <PKCS7err@plt>
  jmp    L99
L55:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si) {
  EVP_MD_CTX *mctx;
  EVP_PKEY_CTX *pctx;
  unsigned char *abuf = NULL;
  int alen;
  size_t siglen;
  const EVP_MD *md = NULL;
  md = EVP_get_digestbyobj(si->digest_alg->algorithm);
  if (md == NULL)
    return 0;
  mctx = EVP_MD_CTX_new();
  if (mctx == NULL) {
    PKCS7err(PKCS7_F_PKCS7_SIGNER_INFO_SIGN, ERR_R_MALLOC_FAILURE);
    goto err;
  }
  if (EVP_DigestSignInit(mctx, &pctx, md, NULL, si->pkey) <= 0)
    goto err;
  if (EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_SIGN, EVP_PKEY_CTRL_PKCS7_SIGN, 0, si) <= 0) {
    PKCS7err(PKCS7_F_PKCS7_SIGNER_INFO_SIGN, PKCS7_R_CTRL_ERROR);
    goto err;
  }
  alen = ASN1_item_i2d((ASN1_VALUE *)si->auth_attr, &abuf, ASN1_ITEM_rptr(PKCS7_ATTR_SIGN));
  if (!abuf)
    goto err;
  if (EVP_DigestSignUpdate(mctx, abuf, alen) <= 0)
    goto err;
  OPENSSL_free(abuf);
  abuf = NULL;
  if (EVP_DigestSignFinal(mctx, NULL, &siglen) <= 0)
    goto err;
  abuf = OPENSSL_malloc(siglen);
  if (abuf == NULL)
    goto err;
  if (EVP_DigestSignFinal(mctx, abuf, &siglen) <= 0)
    goto err;
  if (EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_SIGN, EVP_PKEY_CTRL_PKCS7_SIGN, 1, si) <= 0) {
    PKCS7err(PKCS7_F_PKCS7_SIGNER_INFO_SIGN, PKCS7_R_CTRL_ERROR);
    goto err;
  }
  EVP_MD_CTX_free(mctx);
  ASN1_STRING_set0(si->enc_digest, abuf, siglen);
  return 1;
err:
  OPENSSL_free(abuf);
  EVP_MD_CTX_free(mctx);
  return 0;
}
```