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

```asm
<eckey_priv_decode>:
  endbr64
  push   %r13
  mov    %rsi,%r8
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  xor    %edi,%edi
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%r12
  lea    0x20(%rsp),%rcx
  movq   $0x0,0x8(%rsp)
  lea    0x4(%rsp),%rdx
  mov    %r12,%rsi
  movq   $0x0,0x18(%rsp)
  call   <PKCS8_pkey_get0@plt>
  test   %eax,%eax
  jne    L90
L76:
  xor    %eax,%eax
L101:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L65
  add    $0x30,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L90:
  mov    0x20(%rsp),%rcx
  lea    0x10(%rsp),%rdx
  mov    %rsp,%rsi
  xor    %edi,%edi
  call   <X509_ALGOR_get0@plt>
  mov    0x10(%rsp),%rsi
  mov    (%rsp),%edi
  call   <eckey_type2param@plt>
  mov    %rax,0x18(%rsp)
  test   %rax,%rax
  je     L140
  mov    0x4(%rsp),%edx
  lea    0x18(%rsp),%rdi
  mov    %r12,%rsi
  call   <d2i_ECPrivateKey@plt>
  test   %eax,%eax
  je     L78
  mov    0x18(%rsp),%rdi
  call   <EC_KEY_get0_public_key@plt>
  test   %rax,%rax
  je     L8
L63:
  mov    0x18(%rsp),%rsi
  mov    %rbp,%rdi
  call   <EVP_PKEY_assign_EC_KEY@plt>
  mov    $0x1,%eax
  jmp    L101
  cs nopw 0x0(%rax,%rax,1)
L8:
  mov    0x18(%rsp),%rdi
  call   <EC_KEY_get0_group@plt>
  mov    %rax,%rdi
  mov    %rax,%r13
  call   <EC_POINT_new@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L99
  mov    %r13,%rdi
  call   <EC_GROUP_get0_generator@plt>
  mov    %r12,%rdi
  mov    %eax,%esi
  call   <EC_POINT_copy@plt>
  test   %eax,%eax
  je     L102
  mov    0x18(%rsp),%rdi
  call   <EC_KEY_get0_private_key@plt>
  xor    %r9d,%r9d
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  mov    %rax,%rdx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <EC_POINT_mul@plt>
  test   %eax,%eax
  je     L102
  mov    0x18(%rsp),%rdi
  mov    %r12,%rsi
  call   <EC_KEY_set_public_key@plt>
  mov    %r12,%rdi
  test   %rax,%rax
  je     L0
  call   <EC_POINT_free@plt>
  jmp    L63
  xchg   %ax,%ax
L140:
  mov    D7(%rip),%rbp
L133:
  mov    0x0(%rbp),%edi
  call   <ECerror@plt>
L33:
  mov    0x18(%rsp),%rdi
  test   %rdi,%rdi
  je     L76
  call   <EC_KEY_free@plt>
  jmp    L76
  nopw   0x0(%rax,%rax,1)
L78:
  mov    D16(%rip),%rax
  mov    (%rax),%edi
  call   <ECerror@plt>
  jmp    L33
L102:
  mov    %r12,%rdi
L0:
  call   <EC_POINT_free@plt>
L99:
  mov    D7(%rip),%rbp
  mov    0x0(%rbp),%edi
  call   <ECerror@plt>
  jmp    L133
L65:
  call   <__stack_chk_fail@plt>
```

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;
}
```