user: Translate the below assembly code into C programming language:

```asm
<rsa_pss_to_ctx>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%rbp
  mov    %rsi,0x8(%rsp)
  mov    %rdx,%rbx
  mov    %rcx,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    (%rdx),%edi
  call   <OBJ_obj2nid@plt>
  mov    D5(%rip),%rdx
  cmp    (%rdx),%rax
  je     L108
  mov    D51(%rip),%rax
  mov    (%rax),%esi
  mov    D99(%rip),%rax
  mov    (%rax),%edi
  call   <RSAerr@plt>
  mov    $0xffffffff,%r13d
L72:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L139
  mov    %r13d,%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L108:
  lea    0x18(%rsp),%rsi
  mov    %rbx,%rdi
  call   <rsa_pss_decode@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L92
  mov    0x14(%rax),%edi
  mov    0x18(%rsp),%rsi
  call   <rsa_mgf1_to_md@plt>
  mov    %rax,%r14
  mov    $0xffffffff,%r13d
  test   %rax,%rax
  je     L15
  mov    0x10(%rbx),%edi
  call   <rsa_algor_to_md@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L64
  mov    0x8(%rbx),%rdi
  mov    $0x14,%r15d
  test   %rdi,%rdi
  jne    L209
L53:
  mov    (%rbx),%rdi
  test   %rdi,%rdi
  jne    L109
L216:
  test   %r12,%r12
  je     L59
  lea    0x8(%rsp),%rsi
  mov    %r12,%r8
  mov    $0x0,%ecx
  mov    %r13,%rdx
  mov    %rbp,%rdi
  call   <EVP_DigestVerifyInit@plt>
  mov    $0xffffffff,%r13d
  test   %eax,%eax
  je     L15
L45:
  mov    D37(%rip),%rax
  mov    (%rax),%esi
  mov    0x8(%rsp),%rdi
  call   <EVP_PKEY_CTX_set_rsa_padding@plt>
  mov    $0xffffffff,%r13d
  test   %rax,%rax
  jle    L15
  mov    %r15d,%esi
  mov    0x8(%rsp),%rdi
  call   <EVP_PKEY_CTX_set_rsa_pss_saltlen@plt>
  test   %rax,%rax
  jle    L15
  mov    %r14,%rsi
  mov    0x8(%rsp),%rdi
  call   <EVP_PKEY_CTX_set_rsa_mgf1_md@plt>
  test   %rax,%rax
  setg   %r13b
  movzbl %r13b,%r13d
  lea    -0x1(%r13,%r13,1),%r13d
  jmp    L15
L92:
  mov    D83(%rip),%rax
  mov    (%rax),%esi
  mov    D99(%rip),%rax
  mov    (%rax),%edi
  call   <RSAerr@plt>
  mov    $0xffffffff,%r13d
L15:
  mov    %rbx,%rdi
  call   <RSA_PSS_PARAMS_free@plt>
  mov    0x18(%rsp),%rdi
  test   %rdi,%rdi
  je     L72
  call   <X509_ALGOR_free@plt>
  jmp    L72
L209:
  call   <ASN1_INTEGER_get@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  jns    L53
  mov    D4(%rip),%rax
  mov    (%rax),%esi
  mov    D99(%rip),%rax
  mov    (%rax),%edi
  call   <RSAerr@plt>
  mov    $0xffffffff,%r13d
  jmp    L15
L109:
  call   <ASN1_INTEGER_get@plt>
  cmp    $0x1,%eax
  je     L216
  mov    D29(%rip),%rax
  mov    (%rax),%esi
  mov    D99(%rip),%rax
  mov    (%rax),%edi
  call   <RSAerr@plt>
  mov    $0xffffffff,%r13d
  jmp    L15
L59:
  lea    0x20(%rsp),%rsi
  mov    0x8(%rsp),%rdi
  call   <EVP_PKEY_CTX_get_signature_md@plt>
  test   %rax,%rax
  jle    L183
  mov    %r13,%rdi
  call   <EVP_MD_type@plt>
  mov    %rax,%rbp
  mov    0x20(%rsp),%rdi
  call   <EVP_MD_type@plt>
  cmp    %rax,%rbp
  je     L45
  mov    D106(%rip),%rax
  mov    (%rax),%esi
  mov    D99(%rip),%rax
  mov    (%rax),%edi
  call   <RSAerr@plt>
L183:
  mov    $0xffffffff,%r13d
  jmp    L15
L64:
  mov    $0xffffffff,%r13d
  jmp    L15
L139:
  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;
}
```