user: 请将以下的汇编代码转换成C语言代码:

```asm
<eckey_priv_decode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x40(%rbp)
  movq   $0x0,-0x30(%rbp)
  mov    -0x60(%rbp),%rsi
  lea    -0x28(%rbp),%rcx
  lea    -0x44(%rbp),%rdx
  lea    -0x40(%rbp),%rax
  mov    %rsi,%r8
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <PKCS8_pkey_get0@plt>
  test   %eax,%eax
  jne    L119
  mov    $0x0,%eax
  jmp    L12
L119:
  mov    -0x28(%rbp),%rcx
  lea    -0x38(%rbp),%rdx
  lea    -0x48(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <X509_ALGOR_get0@plt>
  mov    -0x38(%rbp),%rdx
  mov    -0x48(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <eckey_type2param@plt>
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  test   %rax,%rax
  je     L45
  mov    -0x44(%rbp),%edx
  lea    -0x40(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <d2i_ECPrivateKey@plt>
  test   %eax,%eax
  jne    L116
  mov    D40(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <ECerror@plt>
  jmp    L6
L116:
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <EC_KEY_get0_public_key@plt>
  test   %rax,%rax
  jne    L139
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <EC_KEY_get0_group@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <EC_POINT_new@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L5
  mov    D9(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <ECerror@plt>
  jmp    L89
L5:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <EC_GROUP_get0_generator@plt>
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <EC_POINT_copy@plt>
  test   %eax,%eax
  jne    L42
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <EC_POINT_free@plt>
  mov    D9(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <ECerror@plt>
  jmp    L89
L42:
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <EC_KEY_get0_private_key@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rsi
  mov    -0x20(%rbp),%rax
  mov    $0x0,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %rax,%rdi
  call   <EC_POINT_mul@plt>
  test   %eax,%eax
  jne    L60
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <EC_POINT_free@plt>
  mov    D9(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <ECerror@plt>
  jmp    L89
L60:
  mov    -0x30(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <EC_KEY_set_public_key@plt>
  test   %rax,%rax
  jne    L148
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <EC_POINT_free@plt>
  mov    D9(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <ECerror@plt>
  jmp    L89
L148:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <EC_POINT_free@plt>
L139:
  mov    -0x30(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <EVP_PKEY_assign_EC_KEY@plt>
  mov    $0x1,%eax
  jmp    L12
L45:
  nop
L89:
  mov    D9(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <ECerror@plt>
L6:
  mov    -0x30(%rbp),%rax
  test   %rax,%rax
  je     L66
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <EC_KEY_free@plt>
L66:
  mov    $0x0,%eax
L12:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L34
  call   <__stack_chk_fail@plt>
L34:
  leave
  ret
```

assistant: ```c
int eckey_priv_decode(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8) {
  const unsigned char *p = NULL;
  const void *pval;
  int ptype, pklen;
  EC_KEY *eckey = NULL;
  const X509_ALGOR *palg;
  if (!PKCS8_pkey_get0(NULL, &p, &pklen, &palg, p8))
    return 0;
  X509_ALGOR_get0(NULL, &ptype, &pval, palg);
  eckey = eckey_type2param(ptype, pval);
  if (!eckey)
    goto ecliberr;
  if (!d2i_ECPrivateKey(&eckey, &p, pklen)) {
    ECerror(EC_R_DECODE_ERROR);
    goto ecerr;
  }
  if (EC_KEY_get0_public_key(eckey) == NULL) {
    const BIGNUM *priv_key;
    const EC_GROUP *group;
    EC_POINT *pub_key;
    group = EC_KEY_get0_group(eckey);
    pub_key = EC_POINT_new(group);
    if (pub_key == NULL) {
      ECerror(ERR_R_EC_LIB);
      goto ecliberr;
    }
    if (!EC_POINT_copy(pub_key, EC_GROUP_get0_generator(group))) {
      EC_POINT_free(pub_key);
      ECerror(ERR_R_EC_LIB);
      goto ecliberr;
    }
    priv_key = EC_KEY_get0_private_key(eckey);
    if (!EC_POINT_mul(group, pub_key, priv_key, NULL, NULL, NULL)) {
      EC_POINT_free(pub_key);
      ECerror(ERR_R_EC_LIB);
      goto ecliberr;
    }
    if (EC_KEY_set_public_key(eckey, pub_key) == 0) {
      EC_POINT_free(pub_key);
      ECerror(ERR_R_EC_LIB);
      goto ecliberr;
    }
    EC_POINT_free(pub_key);
  }
  EVP_PKEY_assign_EC_KEY(pkey, eckey);
  return 1;
ecliberr:
  ECerror(ERR_R_EC_LIB);
ecerr:
  if (eckey)
    EC_KEY_free(eckey);
  return 0;
}
```