user: Converte this assembly snippet into its equivalent C code:

```asm
<EVP_SealInit>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  mov    %rsi,%r15
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %r9,%r12
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x38,%rsp
  mov    %rcx,-0x50(%rbp)
  mov    %r8,-0x48(%rbp)
  mov    %rsp,%rcx
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  mov    D0(%rip),%rax
  movslq (%rax),%rax
  mov    %eax,-0x54(%rbp)
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L95
L115:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L115
L95:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L100
  mov    %rsp,%r14
  test   %r15,%r15
  je     L8
L65:
  mov    %rbx,%rdi
  call   <EVP_CIPHER_CTX_reset@plt>
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  xor    %edx,%edx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <EVP_EncryptInit_ex@plt>
  test   %eax,%eax
  je     L91
L8:
  mov    0x10(%rbp),%eax
  test   %eax,%eax
  jle    L130
  test   %r12,%r12
  je     L130
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <EVP_CIPHER_CTX_rand_key@plt>
  test   %rax,%rax
  jle    L91
  mov    %rbx,%rdi
  call   <EVP_CIPHER_CTX_iv_length@plt>
  test   %rax,%rax
  je     L196
  mov    %rbx,%rdi
  call   <EVP_CIPHER_CTX_iv_length@plt>
  mov    -0x48(%rbp),%rdi
  mov    %rax,%rsi
  call   <RAND_bytes@plt>
  test   %rax,%rax
  jle    L53
L196:
  mov    -0x48(%rbp),%r8
  mov    %r14,%rcx
  xor    %edx,%edx
  xor    %esi,%esi
  mov    %rbx,%rdi
  xor    %r15d,%r15d
  call   <EVP_EncryptInit_ex@plt>
  test   %eax,%eax
  je     L53
L158:
  mov    (%r12,%r15,8),%rcx
  mov    %rbx,%rdi
  mov    %rcx,-0x48(%rbp)
  call   <EVP_CIPHER_CTX_key_length@plt>
  mov    0x0(%r13,%r15,8),%rdi
  mov    -0x48(%rbp),%rcx
  mov    %r14,%rsi
  mov    %eax,%edx
  call   <EVP_PKEY_encrypt_old@plt>
  mov    -0x50(%rbp),%rsi
  mov    %eax,(%rsi,%r15,4)
  test   %eax,%eax
  jle    L154
  add    $0x1,%r15
  cmp    %r15d,0x10(%rbp)
  jg     L158
  mov    0x10(%rbp),%r12d
  jmp    L87
  nop
L130:
  mov    $0x1,%r12d
L189:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L71
  lea    -0x28(%rbp),%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L91:
  xor    %r12d,%r12d
  jmp    L189
  nopl   (%rax)
L100:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  mov    %rsp,%r14
  test   %r15,%r15
  jne    L65
  jmp    L8
  nop
L53:
  xor    %r12d,%r12d
L87:
  mov    -0x54(%rbp),%esi
  mov    %r14,%rdi
  call   <OPENSSL_cleanse@plt>
  jmp    L189
L154:
  mov    $0xffffffff,%r12d
  jmp    L87
L71:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk, int npubk) {
  unsigned char key[EVP_MAX_KEY_LENGTH];
  int i;
  int rv = 0;
  if (type) {
    EVP_CIPHER_CTX_reset(ctx);
    if (!EVP_EncryptInit_ex(ctx, type, NULL, NULL, NULL))
      return 0;
  }
  if ((npubk <= 0) || !pubk)
    return 1;
  if (EVP_CIPHER_CTX_rand_key(ctx, key) <= 0)
    return 0;
  if (EVP_CIPHER_CTX_iv_length(ctx) && RAND_bytes(iv, EVP_CIPHER_CTX_iv_length(ctx)) <= 0)
    goto err;
  if (!EVP_EncryptInit_ex(ctx, NULL, NULL, key, iv))
    goto err;
  for (i = 0; i < npubk; i++) {
    ekl[i] = EVP_PKEY_encrypt_old(ek[i], key, EVP_CIPHER_CTX_key_length(ctx), pubk[i]);
    if (ekl[i] <= 0) {
      rv = -1;
      goto err;
    }
  }
  rv = npubk;
err:
  OPENSSL_cleanse(key, sizeof(key));
  return rv;
}
```