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

```asm
<PKCS12_PBE_keyivgen>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  mov    %edx,%r14d
  mov    %rcx,%rdx
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %r8,%r12
  push   %rbx
  mov    %r9,%rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsp,%rsi
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  mov    D26(%rip),%rax
  movslq (%rax),%rax
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rsi
  and    $0xfffffffffffffff0,%rcx
  cmp    %rsi,%rsp
  je     L44
L49:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rsi,%rsp
  jne    L49
L44:
  and    $0xfff,%ecx
  sub    %rcx,%rsp
  test   %rcx,%rcx
  jne    L157
L144:
  mov    D99(%rip),%rax
  mov    %rsp,%rsi
  mov    %rsp,-0x60(%rbp)
  movslq (%rax),%rax
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rsi
  and    $0xfffffffffffffff0,%rcx
  cmp    %rsi,%rsp
  je     L114
L40:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rsi,%rsp
  jne    L40
L114:
  and    $0xfff,%ecx
  sub    %rcx,%rsp
  test   %rcx,%rcx
  jne    L142
L108:
  mov    %rsp,-0x68(%rbp)
  test   %rdx,%rdx
  je     L79
  mov    D46(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  jne    L79
  mov    0x8(%rdx),%rax
  test   %rax,%rax
  je     L79
  mov    (%rax),%rdx
  lea    -0x40(%rbp),%rsi
  xor    %edi,%edi
  mov    %rdx,-0x40(%rbp)
  mov    0x8(%rax),%edx
  call   <d2i_PBEPARAM@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L79
  mov    0x8(%rax),%edi
  movl   $0x1,-0x4c(%rbp)
  test   %edi,%edi
  jne    L19
L25:
  mov    (%r15),%rax
  mov    (%rax),%rdi
  mov    0x8(%rax),%eax
  mov    %rdi,-0x58(%rbp)
  mov    %r12,%rdi
  mov    %eax,-0x50(%rbp)
  call   <EVP_CIPHER_key_length@plt>
  sub    $0x8,%rsp
  mov    -0x4c(%rbp),%r9d
  mov    -0x50(%rbp),%ecx
  push   %rbx
  mov    -0x58(%rbp),%rdx
  mov    %r14d,%esi
  mov    %r13,%rdi
  push   -0x60(%rbp)
  push   %rax
  mov    D37(%rip),%rax
  mov    (%rax),%r8d
  call   <PKCS12_key_gen@plt>
  add    $0x20,%rsp
  test   %eax,%eax
  je     L127
  mov    %r12,%rdi
  call   <EVP_CIPHER_iv_length@plt>
  sub    $0x8,%rsp
  mov    -0x4c(%rbp),%r9d
  mov    -0x50(%rbp),%ecx
  push   %rbx
  mov    -0x58(%rbp),%rdx
  mov    %r14d,%esi
  mov    %r13,%rdi
  push   -0x68(%rbp)
  push   %rax
  mov    D28(%rip),%rax
  mov    (%rax),%r8d
  call   <PKCS12_key_gen@plt>
  add    $0x20,%rsp
  test   %eax,%eax
  je     L31
  mov    %r15,%rdi
  call   <PBEPARAM_free@plt>
  mov    -0x68(%rbp),%r15
  mov    -0x60(%rbp),%rbx
  xor    %edx,%edx
  mov    0x10(%rbp),%r9d
  mov    -0x48(%rbp),%rdi
  mov    %r12,%rsi
  mov    %r15,%r8
  mov    %rbx,%rcx
  call   <EVP_CipherInit_ex@plt>
  mov    %rbx,%rdi
  mov    %eax,-0x48(%rbp)
  mov    D26(%rip),%rax
  mov    (%rax),%esi
  call   <explicit_bzero@plt>
  mov    D99(%rip),%rax
  mov    %r15,%rdi
  mov    (%rax),%esi
  call   <explicit_bzero@plt>
  mov    -0x48(%rbp),%r8d
  xchg   %ax,%ax
L90:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L151
  lea    -0x28(%rbp),%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   (%rax)
L157:
  orq    $0x0,-0x8(%rsp,%rcx,1)
  jmp    L144
  nopl   0x0(%rax,%rax,1)
L79:
  mov    D62(%rip),%rax
  mov    (%rax),%esi
  mov    D12(%rip),%rax
  mov    (%rax),%edi
  call   <PKCS12err@plt>
  xor    %r8d,%r8d
  jmp    L90
  nopl   0x0(%rax)
L127:
  mov    %eax,-0x48(%rbp)
  mov    D38(%rip),%rax
L94:
  mov    (%rax),%esi
  mov    D12(%rip),%rax
  mov    (%rax),%edi
  call   <PKCS12err@plt>
  mov    %r15,%rdi
  call   <PBEPARAM_free@plt>
  mov    -0x48(%rbp),%r8d
  jmp    L90
L19:
  call   <ASN1_INTEGER_get@plt>
  mov    %eax,-0x4c(%rbp)
  jmp    L25
  nopl   (%rax)
L31:
  mov    %eax,-0x48(%rbp)
  mov    D98(%rip),%rax
  jmp    L94
  nopl   0x0(%rax)
L142:
  orq    $0x0,-0x8(%rsp,%rcx,1)
  jmp    L108
L151:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, int en_de) {
  PBEPARAM *pbe;
  int saltlen, iter, ret;
  unsigned char *salt;
  const unsigned char *pbuf;
  unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH];
  if (param == NULL || param->type != V_ASN1_SEQUENCE || param->value.sequence == NULL) {
    PKCS12err(PKCS12_F_PKCS12_PBE_KEYIVGEN, PKCS12_R_DECODE_ERROR);
    return 0;
  }
  pbuf = param->value.sequence->data;
  if (!(pbe = d2i_PBEPARAM(NULL, &pbuf, param->value.sequence->length))) {
    PKCS12err(PKCS12_F_PKCS12_PBE_KEYIVGEN, PKCS12_R_DECODE_ERROR);
    return 0;
  }
  if (!pbe->iter)
    iter = 1;
  else
    iter = ASN1_INTEGER_get(pbe->iter);
  salt = pbe->salt->data;
  saltlen = pbe->salt->length;
  if (!PKCS12_key_gen(pass, passlen, salt, saltlen, PKCS12_KEY_ID, iter, EVP_CIPHER_key_length(cipher), key, md)) {
    PKCS12err(PKCS12_F_PKCS12_PBE_KEYIVGEN, PKCS12_R_KEY_GEN_ERROR);
    PBEPARAM_free(pbe);
    return 0;
  }
  if (!PKCS12_key_gen(pass, passlen, salt, saltlen, PKCS12_IV_ID, iter, EVP_CIPHER_iv_length(cipher), iv, md)) {
    PKCS12err(PKCS12_F_PKCS12_PBE_KEYIVGEN, PKCS12_R_IV_GEN_ERROR);
    PBEPARAM_free(pbe);
    return 0;
  }
  PBEPARAM_free(pbe);
  ret = EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, en_de);
  explicit_bzero(key, EVP_MAX_KEY_LENGTH);
  explicit_bzero(iv, EVP_MAX_IV_LENGTH);
  return ret;
}
```