user: What would the C source look like for the assembly code provided here?

```asm
<PKCS7_SIGNER_INFO_sign>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    0x18(%rdi),%rax
  movq   $0x0,0x8(%rsp)
  mov    (%rax),%edi
  call   <EVP_get_digestbyobj@plt>
  mov    %rax,%r12
  xor    %eax,%eax
  test   %r12,%r12
  je     L11
  call   <EVP_MD_CTX_new@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L6
  mov    0x10(%rbx),%r8d
  xor    %ecx,%ecx
  mov    %rsp,%rsi
  mov    %r12,%rdx
  mov    %rax,%rdi
  call   <EVP_DigestSignInit@plt>
  test   %rax,%rax
  jle    L65
  mov    (%rsp),%rdi
  xor    %r8d,%r8d
  mov    %rbx,%r9
  mov    $0xffffffff,%esi
  mov    D38(%rip),%r13
  mov    D3(%rip),%r12
  mov    0x0(%r13),%ecx
  mov    (%r12),%edx
  call   <EVP_PKEY_CTX_ctrl@plt>
  test   %rax,%rax
  jle    L74
  mov    D37(%rip),%rax
  mov    (%rax),%edi
  call   <ASN1_ITEM_rptr@plt>
  mov    0x8(%rbx),%rdi
  lea    0x8(%rsp),%rsi
  mov    %eax,%edx
  call   <ASN1_item_i2d@plt>
  mov    0x8(%rsp),%rdi
  mov    %eax,%edx
  test   %rdi,%rdi
  je     L105
  mov    %rdi,%rsi
  mov    %rbp,%rdi
  call   <EVP_DigestSignUpdate@plt>
  mov    0x8(%rsp),%rdi
  test   %rax,%rax
  jle    L105
  call   <OPENSSL_free@plt>
  lea    0x10(%rsp),%r14
  xor    %esi,%esi
  mov    %rbp,%rdi
  movq   $0x0,0x8(%rsp)
  mov    %r14,%rdx
  call   <EVP_DigestSignFinal@plt>
  test   %rax,%rax
  jle    L65
  mov    0x10(%rsp),%rdi
  call   <OPENSSL_malloc@plt>
  mov    %rax,0x8(%rsp)
  mov    %rax,%rdi
  test   %rax,%rax
  je     L105
  mov    %r14,%rdx
  mov    %rax,%rsi
  mov    %rbp,%rdi
  call   <EVP_DigestSignFinal@plt>
  test   %rax,%rax
  jle    L65
  mov    0x0(%r13),%ecx
  mov    (%r12),%edx
  mov    %rbx,%r9
  mov    $0xffffffff,%esi
  mov    (%rsp),%rdi
  mov    $0x1,%r8d
  call   <EVP_PKEY_CTX_ctrl@plt>
  test   %rax,%rax
  jle    L74
  mov    %rbp,%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
  nopw   0x0(%rax,%rax,1)
L11:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L126
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L65:
  mov    0x8(%rsp),%rdi
L105:
  call   <OPENSSL_free@plt>
  mov    %rbp,%rdi
  call   <EVP_MD_CTX_free@plt>
  xor    %eax,%eax
  jmp    L11
  cs nopw 0x0(%rax,%rax,1)
L6:
  mov    D41(%rip),%rax
L110:
  mov    (%rax),%esi
  mov    D33(%rip),%rax
  mov    (%rax),%edi
  call   <PKCS7err@plt>
  mov    0x8(%rsp),%rdi
  jmp    L105
  xchg   %ax,%ax
L74:
  mov    D23(%rip),%rax
  jmp    L110
L126:
  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;
}
```