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    D81(%rip),%rdx
  cmp    (%rdx),%rax
  je     L87
  mov    D77(%rip),%rax
  mov    $0xffffffff,%r12d
  mov    (%rax),%esi
  mov    D45(%rip),%rax
  mov    (%rax),%edi
  call   <RSAerr@plt>
L144:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L25
  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)
L87:
  mov    %rbp,%rdi
  lea    0x18(%rsp),%rsi
  call   <rsa_pss_decode@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L182
  mov    0x14(%rax),%edi
  mov    0x18(%rsp),%rsi
  call   <rsa_mgf1_to_md@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L15
  mov    0x10(%rbp),%edi
  call   <rsa_algor_to_md@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L15
  mov    0x8(%rbp),%rdi
  mov    $0x14,%r15d
  test   %rdi,%rdi
  jne    L91
L9:
  mov    0x0(%rbp),%rdi
  test   %rdi,%rdi
  jne    L19
L166:
  test   %rbx,%rbx
  je     L99
  xor    %ecx,%ecx
  lea    0x8(%rsp),%rsi
  mov    %rbx,%r8
  mov    %r13,%rdx
  mov    %r12,%rdi
  call   <EVP_DigestVerifyInit@plt>
  test   %eax,%eax
  je     L15
L23:
  mov    D8(%rip),%rax
  mov    0x8(%rsp),%rdi
  mov    (%rax),%esi
  call   <EVP_PKEY_CTX_set_rsa_padding@plt>
  test   %rax,%rax
  jle    L15
  mov    0x8(%rsp),%rdi
  mov    %r15d,%esi
  call   <EVP_PKEY_CTX_set_rsa_pss_saltlen@plt>
  test   %rax,%rax
  jle    L15
  mov    0x8(%rsp),%rdi
  mov    %r14,%rsi
  mov    $0x1,%r12d
  call   <EVP_PKEY_CTX_set_rsa_mgf1_md@plt>
  test   %rax,%rax
  jg     L97
  nopw   0x0(%rax,%rax,1)
L15:
  mov    $0xffffffff,%r12d
L97:
  mov    %rbp,%rdi
  call   <RSA_PSS_PARAMS_free@plt>
  mov    0x18(%rsp),%rdi
  test   %rdi,%rdi
  je     L144
  call   <X509_ALGOR_free@plt>
  jmp    L144
  cs nopw 0x0(%rax,%rax,1)
L91:
  call   <ASN1_INTEGER_get@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  jns    L9
  mov    D82(%rip),%rax
  jmp    L205
  nopl   0x0(%rax)
L19:
  call   <ASN1_INTEGER_get@plt>
  cmp    $0x1,%eax
  je     L166
  mov    D44(%rip),%rax
  jmp    L216
  nopw   0x0(%rax,%rax,1)
L182:
  mov    D42(%rip),%rax
L205:
  mov    (%rax),%esi
  mov    D45(%rip),%rax
  mov    $0xffffffff,%r12d
  mov    (%rax),%edi
  call   <RSAerr@plt>
  jmp    L97
  nopw   0x0(%rax,%rax,1)
L99:
  mov    0x8(%rsp),%rdi
  lea    0x20(%rsp),%rsi
  call   <EVP_PKEY_CTX_get_signature_md@plt>
  test   %rax,%rax
  jle    L15
  mov    %r13,%rdi
  call   <EVP_MD_type@plt>
  mov    0x20(%rsp),%rdi
  mov    %rax,%rbx
  call   <EVP_MD_type@plt>
  cmp    %rax,%rbx
  je     L23
  mov    D21(%rip),%rax
L216:
  mov    (%rax),%esi
  mov    D45(%rip),%rax
  mov    (%rax),%edi
  call   <RSAerr@plt>
  jmp    L15
L25:
  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;
}
```