#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */
typedef struct TYPE_15__ TYPE_6__;
typedef struct TYPE_14__ TYPE_5__;
typedef struct TYPE_13__ TYPE_4__;
typedef struct TYPE_12__ TYPE_3__;
typedef struct TYPE_11__ TYPE_2__;
typedef struct TYPE_10__ TYPE_1__;

/* Type definitions */
struct TYPE_11__ {
  TYPE_1__ *sequence;
};
struct TYPE_15__ {
  scalar_t__ type;
  TYPE_2__ value;
};
struct TYPE_14__ {
  TYPE_4__ *keyfunc;
  TYPE_3__ *encryption;
};
struct TYPE_13__ {
  int /*<<< orphan*/ parameter;
  int /*<<< orphan*/ algorithm;
};
struct TYPE_12__ {
  int /*<<< orphan*/ parameter;
  int /*<<< orphan*/ algorithm;
};
struct TYPE_10__ {
  unsigned char *data;
  int length;
};
typedef TYPE_5__ PBE2PARAM;
typedef int /*<<< orphan*/ EVP_MD;
typedef int /*<<< orphan*/ EVP_CIPHER_CTX;
typedef int /*<<< orphan*/ EVP_CIPHER;
typedef TYPE_6__ ASN1_TYPE;

/* Variables and functions */
scalar_t__ EVP_CIPHER_asn1_to_param(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ EVP_CipherInit_ex(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ const *,
                                     int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *, int);
int /*<<< orphan*/ EVP_R_CIPHER_PARAMETER_ERROR;
int /*<<< orphan*/ EVP_R_DECODE_ERROR;
int /*<<< orphan*/ EVP_R_UNSUPPORTED_CIPHER;
int /*<<< orphan*/ EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION;
int /*<<< orphan*/ *EVP_get_cipherbyobj(int /*<<< orphan*/);
int /*<<< orphan*/ EVPerror(int /*<<< orphan*/);
scalar_t__ NID_id_pbkdf2;
scalar_t__ OBJ_obj2nid(int /*<<< orphan*/);
int /*<<< orphan*/ PBE2PARAM_free(TYPE_5__ *);
int PKCS5_v2_PBKDF2_keyivgen(int /*<<< orphan*/ *, char const *, int,
                             int /*<<< orphan*/, int /*<<< orphan*/ const *,
                             int /*<<< orphan*/ const *, int);
scalar_t__ V_ASN1_SEQUENCE;
TYPE_5__ *d2i_PBE2PARAM(int /*<<< orphan*/ *, unsigned char const **, int);
int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
                          ASN1_TYPE *param, const EVP_CIPHER *c,
                          const EVP_MD *md, int en_de) {
  const unsigned char *pbuf;
  int plen;
  PBE2PARAM *pbe2 = NULL;
  const EVP_CIPHER *cipher;
  int rv = 0;
  if (param == NULL || param->type != V_ASN1_SEQUENCE ||
      param->value.sequence == NULL) {
    EVPerror(EVP_R_DECODE_ERROR);
    goto err;
  }
  pbuf = param->value.sequence->data;
  plen = param->value.sequence->length;
  if (!(pbe2 = d2i_PBE2PARAM(NULL, &pbuf, plen))) {
    EVPerror(EVP_R_DECODE_ERROR);
    goto err;
  }
  if (OBJ_obj2nid(pbe2->keyfunc->algorithm) != NID_id_pbkdf2) {
    EVPerror(EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION);
    goto err;
  }
  cipher = EVP_get_cipherbyobj(pbe2->encryption->algorithm);
  if (!cipher) {
    EVPerror(EVP_R_UNSUPPORTED_CIPHER);
    goto err;
  }
  if (!EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, en_de))
    goto err;
  if (EVP_CIPHER_asn1_to_param(ctx, pbe2->encryption->parameter) < 0) {
    EVPerror(EVP_R_CIPHER_PARAMETER_ERROR);
    goto err;
  }
  rv = PKCS5_v2_PBKDF2_keyivgen(ctx, pass, passlen, pbe2->keyfunc->parameter, c,
                                md, en_de);
err:
  PBE2PARAM_free(pbe2);
  return rv;
}


x86 assembly (clang, -O0):
<PKCS5_v2_PBE_keyivgen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movq   $0x0,-0x48(%rbp)
movl   $0x0,-0x54(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11e2 <PKCS5_v2_PBE_keyivgen+0x62>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    0x2de6(%rip),%rcx
cmp    (%rcx),%rax
jne    11e2 <PKCS5_v2_PBE_keyivgen+0x62>
mov    -0x20(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    11f5 <PKCS5_v2_PBE_keyivgen+0x75>
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
call   1050 <EVPerror@plt>
jmp    132b <PKCS5_v2_PBE_keyivgen+0x1ab>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%edx
xor    %eax,%eax
mov    %eax,%edi
lea    -0x38(%rbp),%rsi
call   1090 <d2i_PBE2PARAM@plt>
mov    %rax,-0x48(%rbp)
cmp    $0x0,%rax
jne    1243 <PKCS5_v2_PBE_keyivgen+0xc3>
mov    0x2d89(%rip),%rax
mov    (%rax),%edi
call   1050 <EVPerror@plt>
jmp    132b <PKCS5_v2_PBE_keyivgen+0x1ab>
mov    -0x48(%rbp),%rax
mov    (%rax),%rax
mov    0x4(%rax),%edi
call   1030 <OBJ_obj2nid@plt>
mov    0x2d87(%rip),%rcx
cmp    (%rcx),%rax
je     1275 <PKCS5_v2_PBE_keyivgen+0xf5>
mov    0x2d7f(%rip),%rax
mov    (%rax),%edi
call   1050 <EVPerror@plt>
jmp    132b <PKCS5_v2_PBE_keyivgen+0x1ab>
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x4(%rax),%edi
call   1080 <EVP_get_cipherbyobj@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    12a7 <PKCS5_v2_PBE_keyivgen+0x127>
mov    0x2d2d(%rip),%rax
mov    (%rax),%edi
call   1050 <EVPerror@plt>
jmp    132b <PKCS5_v2_PBE_keyivgen+0x1ab>
mov    -0x8(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    0x10(%rbp),%r9d
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   10a0 <EVP_CipherInit_ex@plt>
cmp    $0x0,%eax
jne    12d1 <PKCS5_v2_PBE_keyivgen+0x151>
jmp    132b <PKCS5_v2_PBE_keyivgen+0x1ab>
mov    -0x8(%rbp),%rdi
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%esi
call   1070 <EVP_CIPHER_asn1_to_param@plt>
cmp    $0x0,%rax
jge    1301 <PKCS5_v2_PBE_keyivgen+0x181>
mov    0x2cdb(%rip),%rax
mov    (%rax),%edi
call   1050 <EVPerror@plt>
jmp    132b <PKCS5_v2_PBE_keyivgen+0x1ab>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x48(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1060 <PKCS5_v2_PBKDF2_keyivgen@plt>
mov    %eax,-0x54(%rbp)
mov    -0x48(%rbp),%rdi
call   1040 <PBE2PARAM_free@plt>
mov    -0x54(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PKCS5_v2_PBE_keyivgen>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %rcx,%rcx
je     1276 <PKCS5_v2_PBE_keyivgen+0xf6>
mov    %edx,%r12d
mov    (%rcx),%rax
mov    0x2e0c(%rip),%rdx
cmp    (%rdx),%rax
jne    1276 <PKCS5_v2_PBE_keyivgen+0xf6>
mov    0x8(%rcx),%rax
test   %rax,%rax
je     1276 <PKCS5_v2_PBE_keyivgen+0xf6>
mov    %r8,%r15
mov    %rsi,%r13
mov    %rdi,%rbp
mov    %r9,0x8(%rsp)
mov    (%rax),%rcx
mov    %rcx,0x10(%rsp)
mov    0x8(%rax),%edx
xor    %r14d,%r14d
lea    0x10(%rsp),%rsi
xor    %edi,%edi
call   1090 <d2i_PBE2PARAM@plt>
test   %rax,%rax
je     12a3 <PKCS5_v2_PBE_keyivgen+0x123>
mov    %rax,%rbx
mov    (%rax),%rax
mov    0x4(%rax),%edi
call   1030 <OBJ_obj2nid@plt>
mov    0x2de0(%rip),%rcx
cmp    (%rcx),%rax
jne    12b5 <PKCS5_v2_PBE_keyivgen+0x135>
mov    0x8(%rbx),%rax
mov    0x4(%rax),%edi
call   1080 <EVP_get_cipherbyobj@plt>
test   %rax,%rax
je     12be <PKCS5_v2_PBE_keyivgen+0x13e>
mov    0x50(%rsp),%r9d
xor    %r14d,%r14d
mov    %rbp,%rdi
mov    %rax,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   10a0 <EVP_CipherInit_ex@plt>
test   %eax,%eax
je     1289 <PKCS5_v2_PBE_keyivgen+0x109>
mov    0x8(%rbx),%rax
mov    (%rax),%esi
mov    %rbp,%rdi
call   1070 <EVP_CIPHER_asn1_to_param@plt>
test   %rax,%rax
js     12ce <PKCS5_v2_PBE_keyivgen+0x14e>
mov    (%rbx),%rax
mov    (%rax),%ecx
mov    0x50(%rsp),%eax
mov    %eax,(%rsp)
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %r12d,%edx
mov    %r15,%r8
mov    0x8(%rsp),%r9
call   1060 <PKCS5_v2_PBKDF2_keyivgen@plt>
mov    %eax,%r14d
jmp    1289 <PKCS5_v2_PBE_keyivgen+0x109>
mov    0x2d43(%rip),%rax
mov    (%rax),%edi
call   1050 <EVPerror@plt>
xor    %ebx,%ebx
xor    %r14d,%r14d
mov    %rbx,%rdi
call   1040 <PBE2PARAM_free@plt>
mov    %r14d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
call   1050 <EVPerror@plt>
xor    %ebx,%ebx
jmp    1289 <PKCS5_v2_PBE_keyivgen+0x109>
mov    0x2d2c(%rip),%rax
jmp    12c5 <PKCS5_v2_PBE_keyivgen+0x145>
mov    0x2d03(%rip),%rax
mov    (%rax),%edi
call   1050 <EVPerror@plt>
jmp    1286 <PKCS5_v2_PBE_keyivgen+0x106>
mov    0x2cfb(%rip),%rax
mov    (%rax),%edi
call   1050 <EVPerror@plt>
jmp    1289 <PKCS5_v2_PBE_keyivgen+0x109>

LLVM IR (-O0):
%struct.TYPE_15__ = type { i64, %struct.TYPE_11__ }
%struct.TYPE_11__ = type { %struct.TYPE_10__* }
%struct.TYPE_10__ = type { i8*, i32 }
%struct.TYPE_14__ = type { %struct.TYPE_13__*, %struct.TYPE_12__* }
%struct.TYPE_13__ = type { i32, i32 }
%struct.TYPE_12__ = type { i32, i32 }
@V_ASN1_SEQUENCE = global i64 0
@EVP_R_DECODE_ERROR = global i32 0
@NID_id_pbkdf2 = global i64 0
@EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION = global i32 0
@EVP_R_UNSUPPORTED_CIPHER = global i32 0
@EVP_R_CIPHER_PARAMETER_ERROR = global i32 0
define i32 @PKCS5_v2_PBE_keyivgen(i32* %0, i8* %1, i32 %2, %struct.TYPE_15__* %3, i32* %4, i32* %5, i32 %6) {
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca %struct.TYPE_15__*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i32
%17 = alloca %struct.TYPE_14__*
%18 = alloca i32*
%19 = alloca i32
store i32* %0, i32** %8
store i8* %1, i8** %9
store i32 %2, i32* %10
store %struct.TYPE_15__* %3, %struct.TYPE_15__** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
store i32 %6, i32* %14
store %struct.TYPE_14__* null, %struct.TYPE_14__** %17
store i32 0, i32* %19
%20 = load %struct.TYPE_15__*, %struct.TYPE_15__** %11
%21 = icmp eq %struct.TYPE_15__* %20, null
br i1 %21, label %34, label %22
22: ; preds = %7
%23 = load %struct.TYPE_15__*, %struct.TYPE_15__** %11
%24 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %23, i32 0, i32 0
%25 = load i64, i64* %24
%26 = load i64, i64* @V_ASN1_SEQUENCE
%27 = icmp ne i64 %25, %26
br i1 %27, label %34, label %28
28: ; preds = %22
%29 = load %struct.TYPE_15__*, %struct.TYPE_15__** %11
%30 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %29, i32 0, i32 1
%31 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %30, i32 0, i32 0
%32 = load %struct.TYPE_10__*, %struct.TYPE_10__** %31
%33 = icmp eq %struct.TYPE_10__* %32, null
br i1 %33, label %34, label %37
34: ; preds = %28, %22, %7
%35 = load i32, i32* @EVP_R_DECODE_ERROR
%36 = call i32 @EVPerror(i32 %35)
br label %112
37: ; preds = %28
%38 = load %struct.TYPE_15__*, %struct.TYPE_15__** %11
%39 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %38, i32 0, i32 1
%40 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %39, i32 0, i32 0
%41 = load %struct.TYPE_10__*, %struct.TYPE_10__** %40
%42 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %41, i32 0, i32 0
%43 = load i8*, i8** %42
store i8* %43, i8** %15
%44 = load %struct.TYPE_15__*, %struct.TYPE_15__** %11
%45 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %44, i32 0, i32 1
%46 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %45, i32 0, i32 0
%47 = load %struct.TYPE_10__*, %struct.TYPE_10__** %46
%48 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %47, i32 0, i32 1
%49 = load i32, i32* %48
store i32 %49, i32* %16
%50 = load i32, i32* %16
%51 = call %struct.TYPE_14__* @d2i_PBE2PARAM(i32* null, i8** %15, i32 %50)
store %struct.TYPE_14__* %51, %struct.TYPE_14__** %17
%52 = icmp ne %struct.TYPE_14__* %51, null
br i1 %52, label %56, label %53
53: ; preds = %37
%54 = load i32, i32* @EVP_R_DECODE_ERROR
%55 = call i32 @EVPerror(i32 %54)
br label %112
56: ; preds = %37
%57 = load %struct.TYPE_14__*, %struct.TYPE_14__** %17
%58 = getelementptr inbounds %struct.TYPE_14__, %struct.TYPE_14__* %57, i32 0, i32 0
%59 = load %struct.TYPE_13__*, %struct.TYPE_13__** %58
%60 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %59, i32 0, i32 1
%61 = load i32, i32* %60
%62 = call i64 @OBJ_obj2nid(i32 %61)
%63 = load i64, i64* @NID_id_pbkdf2
%64 = icmp ne i64 %62, %63
br i1 %64, label %65, label %68
65: ; preds = %56
%66 = load i32, i32* @EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION
%67 = call i32 @EVPerror(i32 %66)
br label %112
68: ; preds = %56
%69 = load %struct.TYPE_14__*, %struct.TYPE_14__** %17
%70 = getelementptr inbounds %struct.TYPE_14__, %struct.TYPE_14__* %69, i32 0, i32 1
%71 = load %struct.TYPE_12__*, %struct.TYPE_12__** %70
%72 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %71, i32 0, i32 1
%73 = load i32, i32* %72
%74 = call i32* @EVP_get_cipherbyobj(i32 %73)
store i32* %74, i32** %18
%75 = load i32*, i32** %18
%76 = icmp ne i32* %75, null
br i1 %76, label %80, label %77
77: ; preds = %68
%78 = load i32, i32* @EVP_R_UNSUPPORTED_CIPHER
%79 = call i32 @EVPerror(i32 %78)
br label %112
80: ; preds = %68
%81 = load i32*, i32** %8
%82 = load i32*, i32** %18
%83 = load i32, i32* %14
%84 = call i32 @EVP_CipherInit_ex(i32* %81, i32* %82, i32* null, i32* null, i32* null, i32 %83)
%85 = icmp ne i32 %84, 0
br i1 %85, label %87, label %86
86: ; preds = %80
br label %112
87: ; preds = %80
%88 = load i32*, i32** %8
%89 = load %struct.TYPE_14__*, %struct.TYPE_14__** %17
%90 = getelementptr inbounds %struct.TYPE_14__, %struct.TYPE_14__* %89, i32 0, i32 1
%91 = load %struct.TYPE_12__*, %struct.TYPE_12__** %90
%92 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %91, i32 0, i32 0
%93 = load i32, i32* %92
%94 = call i64 @EVP_CIPHER_asn1_to_param(i32* %88, i32 %93)
%95 = icmp slt i64 %94, 0
br i1 %95, label %96, label %99
96: ; preds = %87
%97 = load i32, i32* @EVP_R_CIPHER_PARAMETER_ERROR
%98 = call i32 @EVPerror(i32 %97)
br label %112
99: ; preds = %87
%100 = load i32*, i32** %8
%101 = load i8*, i8** %9
%102 = load i32, i32* %10
%103 = load %struct.TYPE_14__*, %struct.TYPE_14__** %17
%104 = getelementptr inbounds %struct.TYPE_14__, %struct.TYPE_14__* %103, i32 0, i32 0
%105 = load %struct.TYPE_13__*, %struct.TYPE_13__** %104
%106 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %105, i32 0, i32 0
%107 = load i32, i32* %106
%108 = load i32*, i32** %12
%109 = load i32*, i32** %13
%110 = load i32, i32* %14
%111 = call i32 @PKCS5_v2_PBKDF2_keyivgen(i32* %100, i8* %101, i32 %102, i32 %107, i32* %108, i32* %109, i32 %110)
store i32 %111, i32* %19
br label %112
112: ; preds = %99, %96, %86, %77, %65, %53, %34
%113 = load %struct.TYPE_14__*, %struct.TYPE_14__** %17
%114 = call i32 @PBE2PARAM_free(%struct.TYPE_14__* %113)
%115 = load i32, i32* %19
ret i32 %115
}

LLVM IR (-O2):
%struct.TYPE_15__ = type { i64, %struct.TYPE_11__ }
%struct.TYPE_11__ = type { %struct.TYPE_10__* }
%struct.TYPE_10__ = type { i8*, i32 }
%struct.TYPE_14__ = type { %struct.TYPE_13__*, %struct.TYPE_12__* }
%struct.TYPE_13__ = type { i32, i32 }
%struct.TYPE_12__ = type { i32, i32 }
@V_ASN1_SEQUENCE = global i64 0
@EVP_R_DECODE_ERROR = global i32 0
@NID_id_pbkdf2 = global i64 0
@EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION = global i32 0
@EVP_R_UNSUPPORTED_CIPHER = global i32 0
@EVP_R_CIPHER_PARAMETER_ERROR = global i32 0
define i32 @PKCS5_v2_PBE_keyivgen(i32* %0, i8* %1, i32 %2, %struct.TYPE_15__* %3, i32* %4, i32* %5, i32 %6) {
%8 = alloca i8*
%9 = bitcast i8** %8 to i8*
%10 = icmp eq %struct.TYPE_15__* %3, null
br i1 %10, label %20, label %11
11: ; preds = %7
%12 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %3, i64 0, i32 0
%13 = load i64, i64* %12
%14 = load i64, i64* @V_ASN1_SEQUENCE
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %3, i64 0, i32 1, i32 0
%18 = load %struct.TYPE_10__*, %struct.TYPE_10__** %17
%19 = icmp eq %struct.TYPE_10__* %18, null
br i1 %19, label %20, label %23
20: ; preds = %16, %11, %7
%21 = load i32, i32* @EVP_R_DECODE_ERROR
%22 = tail call i32 @EVPerror(i32 %21)
br label %71
23: ; preds = %16
%24 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %18, i64 0, i32 0
%25 = load i8*, i8** %24
store i8* %25, i8** %8
%26 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %18, i64 0, i32 1
%27 = load i32, i32* %26
%28 = call %struct.TYPE_14__* @d2i_PBE2PARAM(i32* null, i8** %8, i32 %27)
%29 = icmp eq %struct.TYPE_14__* %28, null
br i1 %29, label %30, label %33
30: ; preds = %23
%31 = load i32, i32* @EVP_R_DECODE_ERROR
%32 = call i32 @EVPerror(i32 %31)
br label %71
33: ; preds = %23
%34 = getelementptr inbounds %struct.TYPE_14__, %struct.TYPE_14__* %28, i64 0, i32 0
%35 = load %struct.TYPE_13__*, %struct.TYPE_13__** %34
%36 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %35, i64 0, i32 1
%37 = load i32, i32* %36
%38 = call i64 @OBJ_obj2nid(i32 %37)
%39 = load i64, i64* @NID_id_pbkdf2
%40 = icmp eq i64 %38, %39
br i1 %40, label %44, label %41
41: ; preds = %33
%42 = load i32, i32* @EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION
%43 = call i32 @EVPerror(i32 %42)
br label %71
44: ; preds = %33
%45 = getelementptr inbounds %struct.TYPE_14__, %struct.TYPE_14__* %28, i64 0, i32 1
%46 = load %struct.TYPE_12__*, %struct.TYPE_12__** %45
%47 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %46, i64 0, i32 1
%48 = load i32, i32* %47
%49 = call i32* @EVP_get_cipherbyobj(i32 %48)
%50 = icmp eq i32* %49, null
br i1 %50, label %51, label %54
51: ; preds = %44
%52 = load i32, i32* @EVP_R_UNSUPPORTED_CIPHER
%53 = call i32 @EVPerror(i32 %52)
br label %71
54: ; preds = %44
%55 = call i32 @EVP_CipherInit_ex(i32* %0, i32* %49, i32* null, i32* null, i32* null, i32 %6)
%56 = icmp eq i32 %55, 0
br i1 %56, label %71, label %57
57: ; preds = %54
%58 = load %struct.TYPE_12__*, %struct.TYPE_12__** %45
%59 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %58, i64 0, i32 0
%60 = load i32, i32* %59
%61 = call i64 @EVP_CIPHER_asn1_to_param(i32* %0, i32 %60)
%62 = icmp slt i64 %61, 0
br i1 %62, label %63, label %66
63: ; preds = %57
%64 = load i32, i32* @EVP_R_CIPHER_PARAMETER_ERROR
%65 = call i32 @EVPerror(i32 %64)
br label %71
66: ; preds = %57
%67 = load %struct.TYPE_13__*, %struct.TYPE_13__** %34
%68 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %67, i64 0, i32 0
%69 = load i32, i32* %68
%70 = call i32 @PKCS5_v2_PBKDF2_keyivgen(i32* %0, i8* %1, i32 %2, i32 %69, i32* %4, i32* %5, i32 %6)
br label %71
71: ; preds = %54, %66, %63, %51, %41, %30, %20
%72 = phi %struct.TYPE_14__* [ null, %20 ], [ %28, %41 ], [ %28, %63 ], [ %28, %66 ], [ %28, %54 ], [ %28, %51 ], [ null, %30 ]
%73 = phi i32 [ 0, %20 ], [ 0, %41 ], [ 0, %63 ], [ %70, %66 ], [ 0, %54 ], [ 0, %51 ], [ 0, %30 ]
%74 = call i32 @PBE2PARAM_free(%struct.TYPE_14__* %72)
ret i32 %73
}