#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 */

/* Type definitions */
typedef int /*<<< orphan*/ X509_ALGOR;
typedef int /*<<< orphan*/ PKCS8_PRIV_KEY_INFO;
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ EC_POINT;
typedef int /*<<< orphan*/ EC_KEY;
typedef int /*<<< orphan*/ EC_GROUP;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ EC_F_ECKEY_PRIV_DECODE;
int /*<<< orphan*/ EC_GROUP_get0_generator(int /*<<< orphan*/ const *);
int /*<<< orphan*/ EC_KEY_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *EC_KEY_get0_group(int /*<<< orphan*/ *);
int /*<<< orphan*/ *EC_KEY_get0_private_key(int /*<<< orphan*/ *);
int /*<<< orphan*/ *EC_KEY_get0_public_key(int /*<<< orphan*/ *);
scalar_t__ EC_KEY_set_public_key(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ EC_POINT_copy(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ EC_POINT_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ EC_POINT_mul(int /*<<< orphan*/ const *,
                                int /*<<< orphan*/ *,
                                int /*<<< orphan*/ const *,
                                int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *);
int /*<<< orphan*/ *EC_POINT_new(int /*<<< orphan*/ const *);
int /*<<< orphan*/ EC_R_DECODE_ERROR;
int /*<<< orphan*/ ECerr(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ ERR_R_EC_LIB;
int /*<<< orphan*/ EVP_PKEY_assign_EC_KEY(int /*<<< orphan*/ *,
                                          int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS8_pkey_get0(int /*<<< orphan*/ *, unsigned char const **,
                                   int *, int /*<<< orphan*/ **,
                                   int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_ALGOR_get0(int /*<<< orphan*/ *, int *, void **,
                                   int /*<<< orphan*/ *);
int /*<<< orphan*/ d2i_ECPrivateKey(int /*<<< orphan*/ **,
                                    unsigned char const **, int);
int /*<<< orphan*/ *eckey_type2param(int, void *);
int eckey_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8) {
  const unsigned char *p = NULL;
  void *pval;
  int ptype, pklen;
  EC_KEY *eckey = NULL;
  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)) {
    ECerr(EC_F_ECKEY_PRIV_DECODE, 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) {
      ECerr(EC_F_ECKEY_PRIV_DECODE, ERR_R_EC_LIB);
      goto ecliberr;
    }
    if (!EC_POINT_copy(pub_key, EC_GROUP_get0_generator(group))) {
      EC_POINT_free(pub_key);
      ECerr(EC_F_ECKEY_PRIV_DECODE, 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);
      ECerr(EC_F_ECKEY_PRIV_DECODE, ERR_R_EC_LIB);
      goto ecliberr;
    }
    if (EC_KEY_set_public_key(eckey, pub_key) == 0) {
      EC_POINT_free(pub_key);
      ECerr(EC_F_ECKEY_PRIV_DECODE, ERR_R_EC_LIB);
      goto ecliberr;
    }
    EC_POINT_free(pub_key);
  }
  EVP_PKEY_assign_EC_KEY(pkey, eckey);
  return 1;
ecliberr:
  ECerr(EC_F_ECKEY_PRIV_DECODE, ERR_R_EC_LIB);
ecerr:
  if (eckey)
    EC_KEY_free(eckey);
  return 0;
}


x86 assembly (clang, -O0):
<eckey_priv_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x18(%rbp),%r8
xor    %eax,%eax
mov    %eax,%edi
lea    -0x20(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x40(%rbp),%rcx
call   1080 <PKCS8_pkey_get0@plt>
cmp    $0x0,%eax
jne    124e <eckey_priv_decode+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    143d <eckey_priv_decode+0x23d>
mov    -0x40(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edi
lea    -0x2c(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1120 <X509_ALGOR_get0@plt>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   10c0 <eckey_type2param@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1283 <eckey_priv_decode+0x83>
jmp    140b <eckey_priv_decode+0x20b>
mov    -0x30(%rbp),%edx
lea    -0x38(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   10f0 <d2i_ECPrivateKey@plt>
cmp    $0x0,%eax
jne    12b8 <eckey_priv_decode+0xb8>
mov    0x2d2d(%rip),%rax
mov    (%rax),%edi
mov    0x2d3c(%rip),%rax
mov    (%rax),%esi
call   10a0 <ECerr@plt>
jmp    1422 <eckey_priv_decode+0x222>
mov    -0x38(%rbp),%rdi
call   1060 <EC_KEY_get0_public_key@plt>
cmp    $0x0,%rax
jne    13f2 <eckey_priv_decode+0x1f2>
mov    -0x38(%rbp),%rdi
call   1090 <EC_KEY_get0_group@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
call   1110 <EC_POINT_new@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    130c <eckey_priv_decode+0x10c>
mov    0x2cd9(%rip),%rax
mov    (%rax),%edi
mov    0x2ce0(%rip),%rax
mov    (%rax),%esi
call   10a0 <ECerr@plt>
jmp    140b <eckey_priv_decode+0x20b>
mov    -0x58(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x50(%rbp),%rdi
call   10d0 <EC_GROUP_get0_generator@plt>
mov    -0x60(%rbp),%rdi
mov    %eax,%esi
call   1030 <EC_POINT_copy@plt>
cmp    $0x0,%eax
jne    1356 <eckey_priv_decode+0x156>
mov    -0x58(%rbp),%rdi
call   1100 <EC_POINT_free@plt>
mov    0x2c8f(%rip),%rax
mov    (%rax),%edi
mov    0x2c96(%rip),%rax
mov    (%rax),%esi
call   10a0 <ECerr@plt>
jmp    140b <eckey_priv_decode+0x20b>
mov    -0x38(%rbp),%rdi
call   1070 <EC_KEY_get0_private_key@plt>
mov    %rax,-0x48(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x48(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rcx
mov    %r9,%r8
call   1050 <EC_POINT_mul@plt>
cmp    $0x0,%eax
jne    13ad <eckey_priv_decode+0x1ad>
mov    -0x58(%rbp),%rdi
call   1100 <EC_POINT_free@plt>
mov    0x2c38(%rip),%rax
mov    (%rax),%edi
mov    0x2c3f(%rip),%rax
mov    (%rax),%esi
call   10a0 <ECerr@plt>
jmp    140b <eckey_priv_decode+0x20b>
mov    -0x38(%rbp),%rdi
mov    -0x58(%rbp),%rsi
call   1040 <EC_KEY_set_public_key@plt>
cmp    $0x0,%rax
jne    13e9 <eckey_priv_decode+0x1e9>
mov    -0x58(%rbp),%rdi
call   1100 <EC_POINT_free@plt>
mov    0x2bfc(%rip),%rax
mov    (%rax),%edi
mov    0x2c03(%rip),%rax
mov    (%rax),%esi
call   10a0 <ECerr@plt>
jmp    140b <eckey_priv_decode+0x20b>
mov    -0x58(%rbp),%rdi
call   1100 <EC_POINT_free@plt>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   10e0 <EVP_PKEY_assign_EC_KEY@plt>
movl   $0x1,-0x4(%rbp)
jmp    143d <eckey_priv_decode+0x23d>
mov    0x2bbe(%rip),%rax
mov    (%rax),%edi
mov    0x2bc5(%rip),%rax
mov    (%rax),%esi
call   10a0 <ECerr@plt>
cmpq   $0x0,-0x38(%rbp)
je     1436 <eckey_priv_decode+0x236>
mov    -0x38(%rbp),%rdi
call   10b0 <EC_KEY_free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eckey_priv_decode>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%r8
mov    %rdi,%r14
movq   $0x0,0x18(%rsp)
xor    %r13d,%r13d
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x20(%rsp),%rcx
xor    %edi,%edi
call   1080 <PKCS8_pkey_get0@plt>
test   %eax,%eax
je     137c <eckey_priv_decode+0x17c>
mov    0x20(%rsp),%rcx
xor    %r13d,%r13d
lea    0x14(%rsp),%rsi
lea    0x28(%rsp),%rdx
xor    %edi,%edi
call   1120 <X509_ALGOR_get0@plt>
mov    0x14(%rsp),%edi
mov    0x28(%rsp),%rsi
call   10c0 <eckey_type2param@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     12ac <eckey_priv_decode+0xac>
mov    0x10(%rsp),%edx
lea    0x8(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   10f0 <d2i_ECPrivateKey@plt>
test   %eax,%eax
je     12b8 <eckey_priv_decode+0xb8>
mov    0x8(%rsp),%rdi
call   1060 <EC_KEY_get0_public_key@plt>
test   %rax,%rax
je     12c4 <eckey_priv_decode+0xc4>
mov    0x8(%rsp),%rsi
mov    %r14,%rdi
call   10e0 <EVP_PKEY_assign_EC_KEY@plt>
mov    $0x1,%r13d
jmp    137c <eckey_priv_decode+0x17c>
mov    0x2d2d(%rip),%rbx
jmp    135d <eckey_priv_decode+0x15d>
mov    0x2d29(%rip),%rbx
jmp    135d <eckey_priv_decode+0x15d>
mov    0x8(%rsp),%rdi
call   1090 <EC_KEY_get0_group@plt>
mov    %rax,%r12
mov    %rax,%rdi
call   1110 <EC_POINT_new@plt>
test   %rax,%rax
je     1346 <eckey_priv_decode+0x146>
mov    %rax,%r15
mov    %r12,%rdi
call   10d0 <EC_GROUP_get0_generator@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <EC_POINT_copy@plt>
test   %eax,%eax
je     133e <eckey_priv_decode+0x13e>
mov    0x8(%rsp),%rdi
call   1070 <EC_KEY_get0_private_key@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rax,%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1050 <EC_POINT_mul@plt>
test   %eax,%eax
je     133e <eckey_priv_decode+0x13e>
mov    0x8(%rsp),%rdi
mov    %r15,%rsi
call   1040 <EC_KEY_set_public_key@plt>
mov    %rax,%r12
mov    %r15,%rdi
call   1100 <EC_POINT_free@plt>
test   %r12,%r12
jne    1294 <eckey_priv_decode+0x94>
jmp    1346 <eckey_priv_decode+0x146>
mov    %r15,%rdi
call   1100 <EC_POINT_free@plt>
mov    0x2c83(%rip),%rax
mov    (%rax),%edi
mov    0x2c8a(%rip),%rbx
mov    (%rbx),%esi
call   10a0 <ECerr@plt>
mov    0x2c6c(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   10a0 <ECerr@plt>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     137c <eckey_priv_decode+0x17c>
call   10b0 <EC_KEY_free@plt>
mov    %r13d,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EC_F_ECKEY_PRIV_DECODE = global i32 0
@EC_R_DECODE_ERROR = global i32 0
@ERR_R_EC_LIB = global i32 0
define i32 @eckey_priv_decode(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8* null, i8** %6
store i32* null, i32** %10
%15 = load i32*, i32** %5
%16 = call i32 @PKCS8_pkey_get0(i32* null, i8** %6, i32* %9, i32** %11, i32* %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %2
store i32 0, i32* %3
br label %106
19: ; preds = %2
%20 = load i32*, i32** %11
%21 = call i32 @X509_ALGOR_get0(i32* null, i32* %8, i8** %7, i32* %20)
%22 = load i32, i32* %8
%23 = load i8*, i8** %7
%24 = call i32* @eckey_type2param(i32 %22, i8* %23)
store i32* %24, i32** %10
%25 = load i32*, i32** %10
%26 = icmp ne i32* %25, null
br i1 %26, label %28, label %27
27: ; preds = %19
br label %95
28: ; preds = %19
%29 = load i32, i32* %9
%30 = call i32 @d2i_ECPrivateKey(i32** %10, i8** %6, i32 %29)
%31 = icmp ne i32 %30, 0
br i1 %31, label %36, label %32
32: ; preds = %28
%33 = load i32, i32* @EC_F_ECKEY_PRIV_DECODE
%34 = load i32, i32* @EC_R_DECODE_ERROR
%35 = call i32 @ECerr(i32 %33, i32 %34)
br label %99
36: ; preds = %28
%37 = load i32*, i32** %10
%38 = call i32* @EC_KEY_get0_public_key(i32* %37)
%39 = icmp eq i32* %38, null
br i1 %39, label %40, label %91
40: ; preds = %36
%41 = load i32*, i32** %10
%42 = call i32* @EC_KEY_get0_group(i32* %41)
store i32* %42, i32** %13
%43 = load i32*, i32** %13
%44 = call i32* @EC_POINT_new(i32* %43)
store i32* %44, i32** %14
%45 = load i32*, i32** %14
%46 = icmp eq i32* %45, null
br i1 %46, label %47, label %51
47: ; preds = %40
%48 = load i32, i32* @EC_F_ECKEY_PRIV_DECODE
%49 = load i32, i32* @ERR_R_EC_LIB
%50 = call i32 @ECerr(i32 %48, i32 %49)
br label %95
51: ; preds = %40
%52 = load i32*, i32** %14
%53 = load i32*, i32** %13
%54 = call i32 @EC_GROUP_get0_generator(i32* %53)
%55 = call i32 @EC_POINT_copy(i32* %52, i32 %54)
%56 = icmp ne i32 %55, 0
br i1 %56, label %63, label %57
57: ; preds = %51
%58 = load i32*, i32** %14
%59 = call i32 @EC_POINT_free(i32* %58)
%60 = load i32, i32* @EC_F_ECKEY_PRIV_DECODE
%61 = load i32, i32* @ERR_R_EC_LIB
%62 = call i32 @ECerr(i32 %60, i32 %61)
br label %95
63: ; preds = %51
%64 = load i32*, i32** %10
%65 = call i32* @EC_KEY_get0_private_key(i32* %64)
store i32* %65, i32** %12
%66 = load i32*, i32** %13
%67 = load i32*, i32** %14
%68 = load i32*, i32** %12
%69 = call i32 @EC_POINT_mul(i32* %66, i32* %67, i32* %68, i32* null, i32* null, i32* null)
%70 = icmp ne i32 %69, 0
br i1 %70, label %77, label %71
71: ; preds = %63
%72 = load i32*, i32** %14
%73 = call i32 @EC_POINT_free(i32* %72)
%74 = load i32, i32* @EC_F_ECKEY_PRIV_DECODE
%75 = load i32, i32* @ERR_R_EC_LIB
%76 = call i32 @ECerr(i32 %74, i32 %75)
br label %95
77: ; preds = %63
%78 = load i32*, i32** %10
%79 = load i32*, i32** %14
%80 = call i64 @EC_KEY_set_public_key(i32* %78, i32* %79)
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %88
82: ; preds = %77
%83 = load i32*, i32** %14
%84 = call i32 @EC_POINT_free(i32* %83)
%85 = load i32, i32* @EC_F_ECKEY_PRIV_DECODE
%86 = load i32, i32* @ERR_R_EC_LIB
%87 = call i32 @ECerr(i32 %85, i32 %86)
br label %95
88: ; preds = %77
%89 = load i32*, i32** %14
%90 = call i32 @EC_POINT_free(i32* %89)
br label %91
91: ; preds = %88, %36
%92 = load i32*, i32** %4
%93 = load i32*, i32** %10
%94 = call i32 @EVP_PKEY_assign_EC_KEY(i32* %92, i32* %93)
store i32 1, i32* %3
br label %106
95: ; preds = %82, %71, %57, %47, %27
%96 = load i32, i32* @EC_F_ECKEY_PRIV_DECODE
%97 = load i32, i32* @ERR_R_EC_LIB
%98 = call i32 @ECerr(i32 %96, i32 %97)
br label %99
99: ; preds = %95, %32
%100 = load i32*, i32** %10
%101 = icmp ne i32* %100, null
br i1 %101, label %102, label %105
102: ; preds = %99
%103 = load i32*, i32** %10
%104 = call i32 @EC_KEY_free(i32* %103)
br label %105
105: ; preds = %102, %99
store i32 0, i32* %3
br label %106
106: ; preds = %105, %91, %18
%107 = load i32, i32* %3
ret i32 %107
}

LLVM IR (-O2):
@EC_F_ECKEY_PRIV_DECODE = global i32 0
@EC_R_DECODE_ERROR = global i32 0
@ERR_R_EC_LIB = global i32 0
define i32 @eckey_priv_decode(i32* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%10 = bitcast i8** %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = bitcast i32** %7 to i8*
%14 = bitcast i32** %8 to i8*
%15 = call i32 @PKCS8_pkey_get0(i32* null, i8** %3, i32* %6, i32** %8, i32* %1)
%16 = icmp eq i32 %15, 0
br i1 %16, label %69, label %17
17: ; preds = %2
%18 = load i32*, i32** %8
%19 = call i32 @X509_ALGOR_get0(i32* null, i32* %5, i8** %4, i32* %18)
%20 = load i32, i32* %5
%21 = load i8*, i8** %4
%22 = call i32* @eckey_type2param(i32 %20, i8* %21)
store i32* %22, i32** %7
%23 = icmp eq i32* %22, null
br i1 %23, label %60, label %24
24: ; preds = %17
%25 = load i32, i32* %6
%26 = call i32 @d2i_ECPrivateKey(i32** %7, i8** %3, i32 %25)
%27 = icmp eq i32 %26, 0
br i1 %27, label %60, label %28
28: ; preds = %24
%29 = load i32*, i32** %7
%30 = call i32* @EC_KEY_get0_public_key(i32* %29)
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %51
32: ; preds = %28
%33 = load i32*, i32** %7
%34 = call i32* @EC_KEY_get0_group(i32* %33)
%35 = call i32* @EC_POINT_new(i32* %34)
%36 = icmp eq i32* %35, null
br i1 %36, label %56, label %37
37: ; preds = %32
%38 = call i32 @EC_GROUP_get0_generator(i32* %34)
%39 = call i32 @EC_POINT_copy(i32* %35, i32 %38)
%40 = icmp eq i32 %39, 0
br i1 %40, label %54, label %41
41: ; preds = %37
%42 = load i32*, i32** %7
%43 = call i32* @EC_KEY_get0_private_key(i32* %42)
%44 = call i32 @EC_POINT_mul(i32* %34, i32* %35, i32* %43, i32* null, i32* null, i32* null)
%45 = icmp eq i32 %44, 0
br i1 %45, label %54, label %46
46: ; preds = %41
%47 = load i32*, i32** %7
%48 = call i64 @EC_KEY_set_public_key(i32* %47, i32* %35)
%49 = icmp eq i64 %48, 0
%50 = call i32 @EC_POINT_free(i32* %35)
br i1 %49, label %56, label %51
51: ; preds = %46, %28
%52 = load i32*, i32** %7
%53 = call i32 @EVP_PKEY_assign_EC_KEY(i32* %0, i32* %52)
br label %69
54: ; preds = %41, %37
%55 = call i32 @EC_POINT_free(i32* %35)
br label %56
56: ; preds = %54, %46, %32
%57 = load i32, i32* @EC_F_ECKEY_PRIV_DECODE
%58 = load i32, i32* @ERR_R_EC_LIB
%59 = call i32 @ECerr(i32 %57, i32 %58)
br label %60
60: ; preds = %17, %56, %24
%61 = phi i32* [ @EC_R_DECODE_ERROR, %24 ], [ @ERR_R_EC_LIB, %56 ], [ @ERR_R_EC_LIB, %17 ]
%62 = load i32, i32* @EC_F_ECKEY_PRIV_DECODE
%63 = load i32, i32* %61
%64 = call i32 @ECerr(i32 %62, i32 %63)
%65 = load i32*, i32** %7
%66 = icmp eq i32* %65, null
br i1 %66, label %69, label %67
67: ; preds = %60
%68 = call i32 @EC_KEY_free(i32* %65)
br label %69
69: ; preds = %60, %67, %2, %51
%70 = phi i32 [ 1, %51 ], [ 0, %2 ], [ 0, %67 ], [ 0, %60 ]
ret i32 %70
}