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

```asm
<rsa_pss_to_ctx>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x38,%rsp
  mov    (%rdx),%edi
  mov    %rsi,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <OBJ_obj2nid@plt>
  mov    D84(%rip),%rdx
  cmp    (%rdx),%rax
  je     L83
  mov    D83(%rip),%rax
  mov    $0xffffffff,%r12d
  mov    (%rax),%esi
  mov    D49(%rip),%rax
  mov    (%rax),%edi
  call   <RSAerr@plt>
L217:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L60
  add    $0x38,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L83:
  mov    %rbp,%rdi
  lea    0x18(%rsp),%rsi
  call   <rsa_pss_decode@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L104
  mov    0x14(%rax),%edi
  mov    0x18(%rsp),%rsi
  call   <rsa_mgf1_to_md@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L179
  mov    0x10(%rbp),%edi
  call   <rsa_algor_to_md@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L179
  mov    0x8(%rbp),%rdi
  mov    $0x14,%r15d
  test   %rdi,%rdi
  jne    L110
L211:
  mov    0x0(%rbp),%rdi
  test   %rdi,%rdi
  jne    L3
L0:
  test   %rbx,%rbx
  je     L93
  xor    %ecx,%ecx
  lea    0x8(%rsp),%rsi
  mov    %rbx,%r8
  mov    %r13,%rdx
  mov    %r12,%rdi
  call   <EVP_DigestVerifyInit@plt>
  test   %eax,%eax
  je     L179
L116:
  mov    D10(%rip),%rax
  mov    0x8(%rsp),%rdi
  mov    (%rax),%esi
  call   <EVP_PKEY_CTX_set_rsa_padding@plt>
  test   %rax,%rax
  jle    L179
  mov    0x8(%rsp),%rdi
  mov    %r15d,%esi
  call   <EVP_PKEY_CTX_set_rsa_pss_saltlen@plt>
  test   %rax,%rax
  jle    L179
  mov    0x8(%rsp),%rdi
  mov    %r14,%rsi
  mov    $0x1,%r12d
  call   <EVP_PKEY_CTX_set_rsa_mgf1_md@plt>
  test   %rax,%rax
  jg     L87
  nopw   0x0(%rax,%rax,1)
L179:
  mov    $0xffffffff,%r12d
L87:
  mov    %rbp,%rdi
  call   <RSA_PSS_PARAMS_free@plt>
  mov    0x18(%rsp),%rdi
  test   %rdi,%rdi
  je     L217
  call   <X509_ALGOR_free@plt>
  jmp    L217
  cs nopw 0x0(%rax,%rax,1)
L110:
  call   <ASN1_INTEGER_get@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  jns    L211
  mov    D38(%rip),%rax
  jmp    L62
  nopl   0x0(%rax)
L3:
  call   <ASN1_INTEGER_get@plt>
  cmp    $0x1,%eax
  je     L0
  mov    D28(%rip),%rax
  jmp    L216
  nopw   0x0(%rax,%rax,1)
L104:
  mov    D9(%rip),%rax
L62:
  mov    (%rax),%esi
  mov    D49(%rip),%rax
  mov    $0xffffffff,%r12d
  mov    (%rax),%edi
  call   <RSAerr@plt>
  jmp    L87
  nopw   0x0(%rax,%rax,1)
L93:
  mov    0x8(%rsp),%rdi
  lea    0x20(%rsp),%rsi
  call   <EVP_PKEY_CTX_get_signature_md@plt>
  test   %rax,%rax
  jle    L179
  mov    %r13,%rdi
  call   <EVP_MD_type@plt>
  mov    0x20(%rsp),%rdi
  mov    %rax,%rbx
  call   <EVP_MD_type@plt>
  cmp    %rax,%rbx
  je     L116
  mov    D91(%rip),%rax
L216:
  mov    (%rax),%esi
  mov    D49(%rip),%rax
  mov    (%rax),%edi
  call   <RSAerr@plt>
  jmp    L179
L60:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int rsa_pss_to_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pkctx, X509_ALGOR *sigalg, EVP_PKEY *pkey) {
  int rv = -1;
  int saltlen;
  const EVP_MD *mgf1md = NULL, *md = NULL;
  RSA_PSS_PARAMS *pss;
  X509_ALGOR *maskHash;
  if (OBJ_obj2nid(sigalg->algorithm) != NID_rsassaPss) {
    RSAerr(RSA_F_RSA_PSS_TO_CTX, RSA_R_UNSUPPORTED_SIGNATURE_TYPE);
    return -1;
  }
  pss = rsa_pss_decode(sigalg, &maskHash);
  if (pss == NULL) {
    RSAerr(RSA_F_RSA_PSS_TO_CTX, RSA_R_INVALID_PSS_PARAMETERS);
    goto err;
  }
  mgf1md = rsa_mgf1_to_md(pss->maskGenAlgorithm, maskHash);
  if (!mgf1md)
    goto err;
  md = rsa_algor_to_md(pss->hashAlgorithm);
  if (!md)
    goto err;
  if (pss->saltLength) {
    saltlen = ASN1_INTEGER_get(pss->saltLength);
    if (saltlen < 0) {
      RSAerr(RSA_F_RSA_PSS_TO_CTX, RSA_R_INVALID_SALT_LENGTH);
      goto err;
    }
  } else
    saltlen = 20;
  if (pss->trailerField && ASN1_INTEGER_get(pss->trailerField) != 1) {
    RSAerr(RSA_F_RSA_PSS_TO_CTX, RSA_R_INVALID_TRAILER);
    goto err;
  }
  if (pkey) {
    if (!EVP_DigestVerifyInit(ctx, &pkctx, md, NULL, pkey))
      goto err;
  } else {
    const EVP_MD *checkmd;
    if (EVP_PKEY_CTX_get_signature_md(pkctx, &checkmd) <= 0)
      goto err;
    if (EVP_MD_type(md) != EVP_MD_type(checkmd)) {
      RSAerr(RSA_F_RSA_PSS_TO_CTX, RSA_R_DIGEST_DOES_NOT_MATCH);
      goto err;
    }
  }
  if (EVP_PKEY_CTX_set_rsa_padding(pkctx, RSA_PKCS1_PSS_PADDING) <= 0)
    goto err;
  if (EVP_PKEY_CTX_set_rsa_pss_saltlen(pkctx, saltlen) <= 0)
    goto err;
  if (EVP_PKEY_CTX_set_rsa_mgf1_md(pkctx, mgf1md) <= 0)
    goto err;
  rv = 1;
err:
  RSA_PSS_PARAMS_free(pss);
  if (maskHash)
    X509_ALGOR_free(maskHash);
  return rv;
}
```