#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_21__ TYPE_6__;
typedef struct TYPE_20__ TYPE_5__;
typedef struct TYPE_19__ TYPE_4__;
typedef struct TYPE_18__ TYPE_3__;
typedef struct TYPE_17__ TYPE_2__;
typedef struct TYPE_16__ TYPE_1__;

/* Type definitions */
struct TYPE_21__ {
  int type;
};
struct TYPE_20__ {
  scalar_t__ utype;
  TYPE_4__ *funcs;
};
struct TYPE_19__ {
  int (*prim_c2i)(int /*<<< orphan*/ **, unsigned char const *, int, int,
                  char *, TYPE_5__ const *);
};
struct TYPE_18__ {
  int type;
  unsigned char *data;
  int length;
};
struct TYPE_16__ {
  int /*<<< orphan*/ *ptr;
  int /*<<< orphan*/ *asn1_value;
};
struct TYPE_17__ {
  int type;
  TYPE_1__ value;
};
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef TYPE_2__ ASN1_TYPE;
typedef TYPE_3__ ASN1_STRING;
typedef TYPE_4__ ASN1_PRIMITIVE_FUNCS;
typedef int /*<<< orphan*/ ASN1_OBJECT;
typedef TYPE_5__ ASN1_ITEM;
typedef TYPE_6__ ASN1_INTEGER;
typedef unsigned char ASN1_BOOLEAN;
typedef int /*<<< orphan*/ ASN1_BIT_STRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_F_ASN1_EX_C2I;
int /*<<< orphan*/ ASN1_R_BMPSTRING_IS_WRONG_LENGTH;
int /*<<< orphan*/ ASN1_R_BOOLEAN_IS_WRONG_LENGTH;
int /*<<< orphan*/ ASN1_R_NULL_IS_WRONG_LENGTH;
int /*<<< orphan*/ ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH;
int /*<<< orphan*/ ASN1_STRING_free(TYPE_3__ *);
int /*<<< orphan*/ ASN1_STRING_set(TYPE_3__ *, unsigned char const *, int);
TYPE_3__ *ASN1_STRING_type_new(int);
int /*<<< orphan*/ ASN1_TYPE_free(TYPE_2__ *);
TYPE_2__ *ASN1_TYPE_new();
int /*<<< orphan*/ ASN1_TYPE_set(TYPE_2__ *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ ASN1err(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ ERR_R_MALLOC_FAILURE;
int /*<<< orphan*/ OPENSSL_free(unsigned char *);
scalar_t__ V_ASN1_ANY;
#define V_ASN1_BIT_STRING 150
#define V_ASN1_BMPSTRING 149
#define V_ASN1_BOOLEAN 148
#define V_ASN1_ENUMERATED 147
#define V_ASN1_GENERALIZEDTIME 146
#define V_ASN1_GENERALSTRING 145
#define V_ASN1_GRAPHICSTRING 144
#define V_ASN1_IA5STRING 143
#define V_ASN1_INTEGER 142
int V_ASN1_NEG;
#define V_ASN1_NULL 141
#define V_ASN1_NUMERICSTRING 140
#define V_ASN1_OBJECT 139
#define V_ASN1_OCTET_STRING 138
#define V_ASN1_OTHER 137
#define V_ASN1_PRINTABLESTRING 136
#define V_ASN1_SEQUENCE 135
#define V_ASN1_SET 134
#define V_ASN1_T61STRING 133
#define V_ASN1_UNIVERSALSTRING 132
#define V_ASN1_UTCTIME 131
#define V_ASN1_UTF8STRING 130
#define V_ASN1_VIDEOTEXSTRING 129
#define V_ASN1_VISIBLESTRING 128
int /*<<< orphan*/ c2i_ASN1_BIT_STRING(int /*<<< orphan*/ **,
                                       unsigned char const **, int);
int /*<<< orphan*/ c2i_ASN1_INTEGER(TYPE_6__ **, unsigned char const **, int);
int /*<<< orphan*/ c2i_ASN1_OBJECT(int /*<<< orphan*/ **,
                                   unsigned char const **, int);
int stub1(int /*<<< orphan*/ **, unsigned char const *, int, int, char *,
          TYPE_5__ const *);
int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
                int utype, char *free_cont, const ASN1_ITEM *it) {
  ASN1_VALUE **opval = NULL;
  ASN1_STRING *stmp;
  ASN1_TYPE *typ = NULL;
  int ret = 0;
  const ASN1_PRIMITIVE_FUNCS *pf;
  ASN1_INTEGER **tint;
  pf = it->funcs;
  if (pf && pf->prim_c2i)
    return pf->prim_c2i(pval, cont, len, utype, free_cont, it);
  if (it->utype == V_ASN1_ANY) {
    if (!*pval) {
      typ = ASN1_TYPE_new();
      if (typ == NULL)
        goto err;
      *pval = (ASN1_VALUE *)typ;
    } else
      typ = (ASN1_TYPE *)*pval;
    if (utype != typ->type)
      ASN1_TYPE_set(typ, utype, NULL);
    opval = pval;
    pval = &typ->value.asn1_value;
  }
  switch (utype) {
  case V_ASN1_OBJECT:
    if (!c2i_ASN1_OBJECT((ASN1_OBJECT **)pval, &cont, len))
      goto err;
    break;
  case V_ASN1_NULL:
    if (len) {
      ASN1err(ASN1_F_ASN1_EX_C2I, ASN1_R_NULL_IS_WRONG_LENGTH);
      goto err;
    }
    *pval = (ASN1_VALUE *)1;
    break;
  case V_ASN1_BOOLEAN:
    if (len != 1) {
      ASN1err(ASN1_F_ASN1_EX_C2I, ASN1_R_BOOLEAN_IS_WRONG_LENGTH);
      goto err;
    } else {
      ASN1_BOOLEAN *tbool;
      tbool = (ASN1_BOOLEAN *)pval;
      *tbool = *cont;
    }
    break;
  case V_ASN1_BIT_STRING:
    if (!c2i_ASN1_BIT_STRING((ASN1_BIT_STRING **)pval, &cont, len))
      goto err;
    break;
  case V_ASN1_INTEGER:
  case V_ASN1_ENUMERATED:
    tint = (ASN1_INTEGER **)pval;
    if (!c2i_ASN1_INTEGER(tint, &cont, len))
      goto err;
    (*tint)->type = utype | ((*tint)->type & V_ASN1_NEG);
    break;
  case V_ASN1_OCTET_STRING:
  case V_ASN1_NUMERICSTRING:
  case V_ASN1_PRINTABLESTRING:
  case V_ASN1_T61STRING:
  case V_ASN1_VIDEOTEXSTRING:
  case V_ASN1_IA5STRING:
  case V_ASN1_UTCTIME:
  case V_ASN1_GENERALIZEDTIME:
  case V_ASN1_GRAPHICSTRING:
  case V_ASN1_VISIBLESTRING:
  case V_ASN1_GENERALSTRING:
  case V_ASN1_UNIVERSALSTRING:
  case V_ASN1_BMPSTRING:
  case V_ASN1_UTF8STRING:
  case V_ASN1_OTHER:
  case V_ASN1_SET:
  case V_ASN1_SEQUENCE:
  default:
    if (utype == V_ASN1_BMPSTRING && (len & 1)) {
      ASN1err(ASN1_F_ASN1_EX_C2I, ASN1_R_BMPSTRING_IS_WRONG_LENGTH);
      goto err;
    }
    if (utype == V_ASN1_UNIVERSALSTRING && (len & 3)) {
      ASN1err(ASN1_F_ASN1_EX_C2I, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH);
      goto err;
    }
    if (!*pval) {
      stmp = ASN1_STRING_type_new(utype);
      if (!stmp) {
        ASN1err(ASN1_F_ASN1_EX_C2I, ERR_R_MALLOC_FAILURE);
        goto err;
      }
      *pval = (ASN1_VALUE *)stmp;
    } else {
      stmp = (ASN1_STRING *)*pval;
      stmp->type = utype;
    }
    if (*free_cont) {
      if (stmp->data)
        OPENSSL_free(stmp->data);
      stmp->data = (unsigned char *)cont;
      stmp->length = len;
      *free_cont = 0;
    } else {
      if (!ASN1_STRING_set(stmp, cont, len)) {
        ASN1err(ASN1_F_ASN1_EX_C2I, ERR_R_MALLOC_FAILURE);
        ASN1_STRING_free(stmp);
        *pval = NULL;
        goto err;
      }
    }
    break;
  }
  if (typ && (utype == V_ASN1_NULL))
    typ->value.ptr = NULL;
  ret = 1;
err:
  if (!ret) {
    ASN1_TYPE_free(typ);
    if (opval)
      *opval = NULL;
  }
  return ret;
}


x86 assembly (clang, -O0):
<asn1_ex_c2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
je     1231 <asn1_ex_c2i+0x81>
mov    -0x58(%rbp),%rax
cmpq   $0x0,(%rax)
je     1231 <asn1_ex_c2i+0x81>
mov    -0x58(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   *%rax
mov    %eax,-0x4(%rbp)
jmp    15ca <asn1_ex_c2i+0x41a>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    0x2d69(%rip),%rcx
cmp    (%rcx),%rax
jne    12c3 <asn1_ex_c2i+0x113>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1281 <asn1_ex_c2i+0xd1>
mov    $0x0,%al
call   1030 <ASN1_TYPE_new@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1271 <asn1_ex_c2i+0xc1>
jmp    1596 <asn1_ex_c2i+0x3e6>
mov    -0x48(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    128c <asn1_ex_c2i+0xdc>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x48(%rbp),%rcx
cmp    (%rcx),%eax
je     12ab <asn1_ex_c2i+0xfb>
mov    -0x48(%rbp),%rdi
mov    -0x20(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
call   10d0 <ASN1_TYPE_set@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x48(%rbp),%rax
add    $0x8,%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x70(%rbp)
sub    $0x16,%eax
ja     13f8 <asn1_ex_c2i+0x248>
mov    -0x70(%rbp),%rax
lea    0xd1d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    -0x18(%rbp),%rsi
call   1090 <c2i_ASN1_OBJECT@plt>
cmp    $0x0,%eax
jne    130a <asn1_ex_c2i+0x15a>
jmp    1596 <asn1_ex_c2i+0x3e6>
jmp    156b <asn1_ex_c2i+0x3bb>
cmpl   $0x0,-0x1c(%rbp)
je     1335 <asn1_ex_c2i+0x185>
mov    0x2cb0(%rip),%rax
mov    (%rax),%edi
mov    0x2ccf(%rip),%rax
mov    (%rax),%esi
call   1040 <ASN1err@plt>
jmp    1596 <asn1_ex_c2i+0x3e6>
mov    -0x10(%rbp),%rax
mov    $0x1,%ecx
mov    %rcx,(%rax)
jmp    156b <asn1_ex_c2i+0x3bb>
cmpl   $0x1,-0x1c(%rbp)
je     136c <asn1_ex_c2i+0x1bc>
mov    0x2c79(%rip),%rax
mov    (%rax),%edi
mov    0x2c50(%rip),%rax
mov    (%rax),%esi
call   1040 <ASN1err@plt>
jmp    1596 <asn1_ex_c2i+0x3e6>
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x68(%rbp),%rax
mov    %cl,(%rax)
jmp    156b <asn1_ex_c2i+0x3bb>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    -0x18(%rbp),%rsi
call   1070 <c2i_ASN1_BIT_STRING@plt>
cmp    $0x0,%eax
jne    13a3 <asn1_ex_c2i+0x1f3>
jmp    1596 <asn1_ex_c2i+0x3e6>
jmp    156b <asn1_ex_c2i+0x3bb>
mov    -0x10(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    -0x18(%rbp),%rsi
call   10b0 <c2i_ASN1_INTEGER@plt>
cmp    $0x0,%eax
jne    13ce <asn1_ex_c2i+0x21e>
jmp    1596 <asn1_ex_c2i+0x3e6>
mov    -0x20(%rbp),%ecx
mov    -0x60(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    0x2bf7(%rip),%rdx
and    (%rdx),%eax
or     %eax,%ecx
mov    -0x60(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
jmp    156b <asn1_ex_c2i+0x3bb>
jmp    13f8 <asn1_ex_c2i+0x248>
cmpl   $0x95,-0x20(%rbp)
jne    1430 <asn1_ex_c2i+0x280>
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1430 <asn1_ex_c2i+0x280>
mov    0x2bb5(%rip),%rax
mov    (%rax),%edi
mov    0x2bbc(%rip),%rax
mov    (%rax),%esi
call   1040 <ASN1err@plt>
jmp    1596 <asn1_ex_c2i+0x3e6>
cmpl   $0x84,-0x20(%rbp)
jne    1468 <asn1_ex_c2i+0x2b8>
mov    -0x1c(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     1468 <asn1_ex_c2i+0x2b8>
mov    0x2b7d(%rip),%rax
mov    (%rax),%edi
mov    0x2b5c(%rip),%rax
mov    (%rax),%esi
call   1040 <ASN1err@plt>
jmp    1596 <asn1_ex_c2i+0x3e6>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    14b9 <asn1_ex_c2i+0x309>
mov    -0x20(%rbp),%edi
call   10c0 <ASN1_STRING_type_new@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    14a9 <asn1_ex_c2i+0x2f9>
mov    0x2b3c(%rip),%rax
mov    (%rax),%edi
mov    0x2b2b(%rip),%rax
mov    (%rax),%esi
call   1040 <ASN1err@plt>
jmp    1596 <asn1_ex_c2i+0x3e6>
mov    -0x40(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    14cd <asn1_ex_c2i+0x31d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0x40(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
je     1518 <asn1_ex_c2i+0x368>
mov    -0x40(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     14f6 <asn1_ex_c2i+0x346>
mov    -0x40(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <OPENSSL_free@plt>
mov    -0x18(%rbp),%rcx
mov    -0x40(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x40(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
jmp    1566 <asn1_ex_c2i+0x3b6>
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   10a0 <ASN1_STRING_set@plt>
cmp    $0x0,%eax
jne    1561 <asn1_ex_c2i+0x3b1>
mov    0x2a98(%rip),%rax
mov    (%rax),%edi
mov    0x2a87(%rip),%rax
mov    (%rax),%esi
call   1040 <ASN1err@plt>
mov    -0x40(%rbp),%rdi
call   1050 <ASN1_STRING_free@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
jmp    1596 <asn1_ex_c2i+0x3e6>
jmp    1566 <asn1_ex_c2i+0x3b6>
jmp    156b <asn1_ex_c2i+0x3bb>
cmpq   $0x0,-0x48(%rbp)
je     158f <asn1_ex_c2i+0x3df>
cmpl   $0x8d,-0x20(%rbp)
jne    158f <asn1_ex_c2i+0x3df>
mov    -0x48(%rbp),%rax
movq   $0x0,0x8(%rax)
movl   $0x1,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
jne    15c4 <asn1_ex_c2i+0x414>
mov    -0x48(%rbp),%rdi
call   1060 <ASN1_TYPE_free@plt>
cmpq   $0x0,-0x38(%rbp)
je     15bf <asn1_ex_c2i+0x40f>
mov    -0x38(%rbp),%rax
movq   $0x0,(%rax)
jmp    15c4 <asn1_ex_c2i+0x414>
mov    -0x4c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1_ex_c2i>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8,%r13
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    %rsi,0x10(%rsp)
mov    0x8(%r9),%rax
test   %rax,%rax
je     1202 <asn1_ex_c2i+0x52>
mov    (%rax),%rax
test   %rax,%rax
je     1202 <asn1_ex_c2i+0x52>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r13,%r8
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    *%rax
mov    (%r9),%rax
mov    0x2d9c(%rip),%rcx
xor    %edx,%edx
cmp    (%rcx),%rax
jne    1240 <asn1_ex_c2i+0x90>
mov    (%rbx),%rdx
test   %rdx,%rdx
je     12a1 <asn1_ex_c2i+0xf1>
cmp    %r15d,(%rdx)
je     1237 <asn1_ex_c2i+0x87>
mov    %rdx,%rdi
mov    %r15d,%esi
mov    %rdx,%r14
xor    %edx,%edx
call   10d0 <ASN1_TYPE_set@plt>
mov    %r14,%rdx
mov    %rbx,%rsi
lea    0x10(%rdx),%rbx
jmp    1242 <asn1_ex_c2i+0x92>
xor    %esi,%esi
lea    -0x84(%r15),%eax
cmp    $0x12,%eax
ja     1359 <asn1_ex_c2i+0x1a9>
lea    0xda7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %rsi,0x8(%rsp)
mov    %rdx,(%rsp)
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    %r12d,%edx
call   10b0 <c2i_ASN1_INTEGER@plt>
test   %eax,%eax
je     14ba <asn1_ex_c2i+0x30a>
mov    (%rbx),%rax
mov    0x2d4b(%rip),%rcx
mov    (%rcx),%ecx
and    (%rax),%ecx
or     %r15d,%ecx
mov    %ecx,(%rax)
mov    $0x1,%r14d
jmp    14d7 <asn1_ex_c2i+0x327>
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <ASN1_TYPE_new@plt>
test   %rax,%rax
je     13c1 <asn1_ex_c2i+0x211>
mov    %rax,%rdx
mov    %rax,(%rbx)
cmp    %r15d,(%rdx)
jne    1224 <asn1_ex_c2i+0x74>
jmp    1237 <asn1_ex_c2i+0x87>
test   $0x3,%r12b
je     1359 <asn1_ex_c2i+0x1a9>
mov    %rsi,0x8(%rsp)
mov    %rdx,(%rsp)
mov    0x2cee(%rip),%rax
mov    (%rax),%edi
mov    0x2ccd(%rip),%rax
jmp    14b3 <asn1_ex_c2i+0x303>
mov    %rsi,0x8(%rsp)
mov    %rdx,(%rsp)
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    %r12d,%edx
call   1090 <c2i_ASN1_OBJECT@plt>
jmp    13ae <asn1_ex_c2i+0x1fe>
test   %r12d,%r12d
je     147e <asn1_ex_c2i+0x2ce>
mov    %rsi,0x8(%rsp)
mov    %rdx,(%rsp)
mov    0x2ca9(%rip),%rax
mov    (%rax),%edi
mov    0x2cc8(%rip),%rax
jmp    14b3 <asn1_ex_c2i+0x303>
cmp    $0x1,%r12d
jne    1448 <asn1_ex_c2i+0x298>
mov    0x0(%rbp),%al
mov    %al,(%rbx)
mov    $0x1,%r14d
jmp    14d7 <asn1_ex_c2i+0x327>
test   $0x1,%r12b
jne    1463 <asn1_ex_c2i+0x2b3>
mov    (%rbx),%r14
test   %r14,%r14
je     13cd <asn1_ex_c2i+0x21d>
mov    %r15d,(%r14)
cmpb   $0x0,0x0(%r13)
je     1401 <asn1_ex_c2i+0x251>
mov    0x8(%r14),%rdi
test   %rdi,%rdi
je     1383 <asn1_ex_c2i+0x1d3>
mov    %rdx,%rbx
call   1080 <OPENSSL_free@plt>
mov    %rbx,%rdx
mov    %rbp,0x8(%r14)
mov    %r12d,0x10(%r14)
movb   $0x0,0x0(%r13)
jmp    1485 <asn1_ex_c2i+0x2d5>
mov    %rsi,0x8(%rsp)
mov    %rdx,(%rsp)
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    %r12d,%edx
call   1070 <c2i_ASN1_BIT_STRING@plt>
mov    $0x1,%r14d
test   %eax,%eax
jne    14d7 <asn1_ex_c2i+0x327>
jmp    14ba <asn1_ex_c2i+0x30a>
xor    %edi,%edi
call   1060 <ASN1_TYPE_free@plt>
jmp    14d7 <asn1_ex_c2i+0x327>
mov    %rsi,0x8(%rsp)
mov    %rdx,(%rsp)
mov    %r15d,%edi
call   10c0 <ASN1_STRING_type_new@plt>
test   %rax,%rax
je     14a3 <asn1_ex_c2i+0x2f3>
mov    %rax,%r14
mov    %rax,(%rbx)
mov    (%rsp),%rdx
mov    0x8(%rsp),%rsi
cmpb   $0x0,0x0(%r13)
jne    136f <asn1_ex_c2i+0x1bf>
mov    %rsi,0x8(%rsp)
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %rdx,(%rsp)
mov    %r12d,%edx
call   10a0 <ASN1_STRING_set@plt>
mov    (%rsp),%rdx
test   %eax,%eax
jne    1485 <asn1_ex_c2i+0x2d5>
mov    0x2ba9(%rip),%rax
mov    (%rax),%edi
mov    0x2b98(%rip),%rax
mov    (%rax),%esi
call   1040 <ASN1err@plt>
mov    %r14,%rdi
call   1050 <ASN1_STRING_free@plt>
movq   $0x0,(%rbx)
jmp    14ba <asn1_ex_c2i+0x30a>
mov    %rsi,0x8(%rsp)
mov    %rdx,(%rsp)
mov    0x2b78(%rip),%rax
mov    (%rax),%edi
mov    0x2b4f(%rip),%rax
jmp    14b3 <asn1_ex_c2i+0x303>
mov    %rsi,0x8(%rsp)
mov    %rdx,(%rsp)
mov    0x2b5d(%rip),%rax
mov    (%rax),%edi
mov    0x2b64(%rip),%rax
jmp    14b3 <asn1_ex_c2i+0x303>
movq   $0x1,(%rbx)
mov    $0x1,%r14d
cmp    $0x8d,%r15d
jne    14d7 <asn1_ex_c2i+0x327>
test   %rdx,%rdx
je     14d7 <asn1_ex_c2i+0x327>
movq   $0x0,0x8(%rdx)
jmp    14d7 <asn1_ex_c2i+0x327>
mov    0x2b26(%rip),%rax
mov    (%rax),%edi
mov    0x2b15(%rip),%rax
mov    (%rax),%esi
call   1040 <ASN1err@plt>
mov    (%rsp),%rdi
call   1060 <ASN1_TYPE_free@plt>
xor    %r14d,%r14d
mov    0x8(%rsp),%rax
test   %rax,%rax
je     14d7 <asn1_ex_c2i+0x327>
movq   $0x0,(%rax)
mov    %r14d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_20__ = type { i64, %struct.TYPE_19__* }
%struct.TYPE_19__ = type { {}* }
%struct.TYPE_18__ = type { i32, i8*, i32 }
%struct.TYPE_17__ = type { i32, %struct.TYPE_16__ }
%struct.TYPE_16__ = type { i32*, i32* }
%struct.TYPE_21__ = type { i32 }
@V_ASN1_ANY = global i64 0
@ASN1_F_ASN1_EX_C2I = global i32 0
@ASN1_R_NULL_IS_WRONG_LENGTH = global i32 0
@ASN1_R_BOOLEAN_IS_WRONG_LENGTH = global i32 0
@V_ASN1_NEG = global i32 0
@ASN1_R_BMPSTRING_IS_WRONG_LENGTH = global i32 0
@ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH = global i32 0
@ERR_R_MALLOC_FAILURE = global i32 0
define i32 @asn1_ex_c2i(i32** %0, i8* %1, i32 %2, i32 %3, i8* %4, %struct.TYPE_20__* %5) {
%7 = alloca i32
%8 = alloca i32**
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca %struct.TYPE_20__*
%14 = alloca i32**
%15 = alloca %struct.TYPE_18__*
%16 = alloca %struct.TYPE_17__*
%17 = alloca i32
%18 = alloca %struct.TYPE_19__*
%19 = alloca %struct.TYPE_21__**
%20 = alloca i8*
store i32** %0, i32*** %8
store i8* %1, i8** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store %struct.TYPE_20__* %5, %struct.TYPE_20__** %13
store i32** null, i32*** %14
store %struct.TYPE_17__* null, %struct.TYPE_17__** %16
store i32 0, i32* %17
%21 = load %struct.TYPE_20__*, %struct.TYPE_20__** %13
%22 = getelementptr inbounds %struct.TYPE_20__, %struct.TYPE_20__* %21, i32 0, i32 1
%23 = load %struct.TYPE_19__*, %struct.TYPE_19__** %22
store %struct.TYPE_19__* %23, %struct.TYPE_19__** %18
%24 = load %struct.TYPE_19__*, %struct.TYPE_19__** %18
%25 = icmp ne %struct.TYPE_19__* %24, null
br i1 %25, label %26, label %44
26: ; preds = %6
%27 = load %struct.TYPE_19__*, %struct.TYPE_19__** %18
%28 = getelementptr inbounds %struct.TYPE_19__, %struct.TYPE_19__* %27, i32 0, i32 0
%29 = bitcast {}** %28 to i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)**
%30 = load i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)*, i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)** %29
%31 = icmp ne i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)* %30, null
br i1 %31, label %32, label %44
32: ; preds = %26
%33 = load %struct.TYPE_19__*, %struct.TYPE_19__** %18
%34 = getelementptr inbounds %struct.TYPE_19__, %struct.TYPE_19__* %33, i32 0, i32 0
%35 = bitcast {}** %34 to i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)**
%36 = load i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)*, i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)** %35
%37 = load i32**, i32*** %8
%38 = load i8*, i8** %9
%39 = load i32, i32* %10
%40 = load i32, i32* %11
%41 = load i8*, i8** %12
%42 = load %struct.TYPE_20__*, %struct.TYPE_20__** %13
%43 = call i32 %36(i32** %37, i8* %38, i32 %39, i32 %40, i8* %41, %struct.TYPE_20__* %42)
store i32 %43, i32* %7
br label %249
44: ; preds = %26, %6
%45 = load %struct.TYPE_20__*, %struct.TYPE_20__** %13
%46 = getelementptr inbounds %struct.TYPE_20__, %struct.TYPE_20__* %45, i32 0, i32 0
%47 = load i64, i64* %46
%48 = load i64, i64* @V_ASN1_ANY
%49 = icmp eq i64 %47, %48
br i1 %49, label %50, label %82
50: ; preds = %44
%51 = load i32**, i32*** %8
%52 = load i32*, i32** %51
%53 = icmp ne i32* %52, null
br i1 %53, label %63, label %54
54: ; preds = %50
%55 = call %struct.TYPE_17__* (...) @ASN1_TYPE_new()
store %struct.TYPE_17__* %55, %struct.TYPE_17__** %16
%56 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%57 = icmp eq %struct.TYPE_17__* %56, null
br i1 %57, label %58, label %59
58: ; preds = %54
br label %236
59: ; preds = %54
%60 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%61 = bitcast %struct.TYPE_17__* %60 to i32*
%62 = load i32**, i32*** %8
store i32* %61, i32** %62
br label %67
63: ; preds = %50
%64 = load i32**, i32*** %8
%65 = load i32*, i32** %64
%66 = bitcast i32* %65 to %struct.TYPE_17__*
store %struct.TYPE_17__* %66, %struct.TYPE_17__** %16
br label %67
67: ; preds = %63, %59
%68 = load i32, i32* %11
%69 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%70 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %69, i32 0, i32 0
%71 = load i32, i32* %70
%72 = icmp ne i32 %68, %71
br i1 %72, label %73, label %77
73: ; preds = %67
%74 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%75 = load i32, i32* %11
%76 = call i32 @ASN1_TYPE_set(%struct.TYPE_17__* %74, i32 %75, i32* null)
br label %77
77: ; preds = %73, %67
%78 = load i32**, i32*** %8
store i32** %78, i32*** %14
%79 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%80 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %79, i32 0, i32 1
%81 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %80, i32 0, i32 1
store i32** %81, i32*** %8
br label %82
82: ; preds = %77, %44
%83 = load i32, i32* %11
switch i32 %83, label %142 [
i32 139, label %84
i32 141, label %91
i32 148, label %100
i32 150, label %114
i32 142, label %121
i32 147, label %121
i32 138, label %141
i32 140, label %141
i32 136, label %141
i32 133, label %141
i32 129, label %141
i32 143, label %141
i32 131, label %141
i32 146, label %141
i32 144, label %141
i32 128, label %141
i32 145, label %141
i32 132, label %141
i32 149, label %141
i32 130, label %141
i32 137, label %141
i32 134, label %141
i32 135, label %141
]
84: ; preds = %82
%85 = load i32**, i32*** %8
%86 = load i32, i32* %10
%87 = call i32 @c2i_ASN1_OBJECT(i32** %85, i8** %9, i32 %86)
%88 = icmp ne i32 %87, 0
br i1 %88, label %90, label %89
89: ; preds = %84
br label %236
90: ; preds = %84
br label %225
91: ; preds = %82
%92 = load i32, i32* %10
%93 = icmp ne i32 %92, 0
br i1 %93, label %94, label %98
94: ; preds = %91
%95 = load i32, i32* @ASN1_F_ASN1_EX_C2I
%96 = load i32, i32* @ASN1_R_NULL_IS_WRONG_LENGTH
%97 = call i32 @ASN1err(i32 %95, i32 %96)
br label %236
98: ; preds = %91
%99 = load i32**, i32*** %8
store i32* inttoptr (i64 1 to i32*), i32** %99
br label %225
100: ; preds = %82
%101 = load i32, i32* %10
%102 = icmp ne i32 %101, 1
br i1 %102, label %103, label %107
103: ; preds = %100
%104 = load i32, i32* @ASN1_F_ASN1_EX_C2I
%105 = load i32, i32* @ASN1_R_BOOLEAN_IS_WRONG_LENGTH
%106 = call i32 @ASN1err(i32 %104, i32 %105)
br label %236
107: ; preds = %100
%108 = load i32**, i32*** %8
%109 = bitcast i32** %108 to i8*
store i8* %109, i8** %20
%110 = load i8*, i8** %9
%111 = load i8, i8* %110
%112 = load i8*, i8** %20
store i8 %111, i8* %112
br label %113
113: ; preds = %107
br label %225
114: ; preds = %82
%115 = load i32**, i32*** %8
%116 = load i32, i32* %10
%117 = call i32 @c2i_ASN1_BIT_STRING(i32** %115, i8** %9, i32 %116)
%118 = icmp ne i32 %117, 0
br i1 %118, label %120, label %119
119: ; preds = %114
br label %236
120: ; preds = %114
br label %225
121: ; preds = %82, %82
%122 = load i32**, i32*** %8
%123 = bitcast i32** %122 to %struct.TYPE_21__**
store %struct.TYPE_21__** %123, %struct.TYPE_21__*** %19
%124 = load %struct.TYPE_21__**, %struct.TYPE_21__*** %19
%125 = load i32, i32* %10
%126 = call i32 @c2i_ASN1_INTEGER(%struct.TYPE_21__** %124, i8** %9, i32 %125)
%127 = icmp ne i32 %126, 0
br i1 %127, label %129, label %128
128: ; preds = %121
br label %236
129: ; preds = %121
%130 = load i32, i32* %11
%131 = load %struct.TYPE_21__**, %struct.TYPE_21__*** %19
%132 = load %struct.TYPE_21__*, %struct.TYPE_21__** %131
%133 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %132, i32 0, i32 0
%134 = load i32, i32* %133
%135 = load i32, i32* @V_ASN1_NEG
%136 = and i32 %134, %135
%137 = or i32 %130, %136
%138 = load %struct.TYPE_21__**, %struct.TYPE_21__*** %19
%139 = load %struct.TYPE_21__*, %struct.TYPE_21__** %138
%140 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %139, i32 0, i32 0
store i32 %137, i32* %140
br label %225
141: ; preds = %82, %82, %82, %82, %82, %82, %82, %82, %82, %82, %82, %82, %82, %82, %82, %82, %82
br label %142
142: ; preds = %82, %141
%143 = load i32, i32* %11
%144 = icmp eq i32 %143, 149
br i1 %144, label %145, label %153
145: ; preds = %142
%146 = load i32, i32* %10
%147 = and i32 %146, 1
%148 = icmp ne i32 %147, 0
br i1 %148, label %149, label %153
149: ; preds = %145
%150 = load i32, i32* @ASN1_F_ASN1_EX_C2I
%151 = load i32, i32* @ASN1_R_BMPSTRING_IS_WRONG_LENGTH
%152 = call i32 @ASN1err(i32 %150, i32 %151)
br label %236
153: ; preds = %145, %142
%154 = load i32, i32* %11
%155 = icmp eq i32 %154, 132
br i1 %155, label %156, label %164
156: ; preds = %153
%157 = load i32, i32* %10
%158 = and i32 %157, 3
%159 = icmp ne i32 %158, 0
br i1 %159, label %160, label %164
160: ; preds = %156
%161 = load i32, i32* @ASN1_F_ASN1_EX_C2I
%162 = load i32, i32* @ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH
%163 = call i32 @ASN1err(i32 %161, i32 %162)
br label %236
164: ; preds = %156, %153
%165 = load i32**, i32*** %8
%166 = load i32*, i32** %165
%167 = icmp ne i32* %166, null
br i1 %167, label %181, label %168
168: ; preds = %164
%169 = load i32, i32* %11
%170 = call %struct.TYPE_18__* @ASN1_STRING_type_new(i32 %169)
store %struct.TYPE_18__* %170, %struct.TYPE_18__** %15
%171 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%172 = icmp ne %struct.TYPE_18__* %171, null
br i1 %172, label %177, label %173
173: ; preds = %168
%174 = load i32, i32* @ASN1_F_ASN1_EX_C2I
%175 = load i32, i32* @ERR_R_MALLOC_FAILURE
%176 = call i32 @ASN1err(i32 %174, i32 %175)
br label %236
177: ; preds = %168
%178 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%179 = bitcast %struct.TYPE_18__* %178 to i32*
%180 = load i32**, i32*** %8
store i32* %179, i32** %180
br label %188
181: ; preds = %164
%182 = load i32**, i32*** %8
%183 = load i32*, i32** %182
%184 = bitcast i32* %183 to %struct.TYPE_18__*
store %struct.TYPE_18__* %184, %struct.TYPE_18__** %15
%185 = load i32, i32* %11
%186 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%187 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %186, i32 0, i32 0
store i32 %185, i32* %187
br label %188
188: ; preds = %181, %177
%189 = load i8*, i8** %12
%190 = load i8, i8* %189
%191 = icmp ne i8 %190, 0
br i1 %191, label %192, label %210
192: ; preds = %188
%193 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%194 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %193, i32 0, i32 1
%195 = load i8*, i8** %194
%196 = icmp ne i8* %195, null
br i1 %196, label %197, label %202
197: ; preds = %192
%198 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%199 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %198, i32 0, i32 1
%200 = load i8*, i8** %199
%201 = call i32 @OPENSSL_free(i8* %200)
br label %202
202: ; preds = %197, %192
%203 = load i8*, i8** %9
%204 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%205 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %204, i32 0, i32 1
store i8* %203, i8** %205
%206 = load i32, i32* %10
%207 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%208 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %207, i32 0, i32 2
store i32 %206, i32* %208
%209 = load i8*, i8** %12
store i8 0, i8* %209
br label %224
210: ; preds = %188
%211 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%212 = load i8*, i8** %9
%213 = load i32, i32* %10
%214 = call i32 @ASN1_STRING_set(%struct.TYPE_18__* %211, i8* %212, i32 %213)
%215 = icmp ne i32 %214, 0
br i1 %215, label %223, label %216
216: ; preds = %210
%217 = load i32, i32* @ASN1_F_ASN1_EX_C2I
%218 = load i32, i32* @ERR_R_MALLOC_FAILURE
%219 = call i32 @ASN1err(i32 %217, i32 %218)
%220 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%221 = call i32 @ASN1_STRING_free(%struct.TYPE_18__* %220)
%222 = load i32**, i32*** %8
store i32* null, i32** %222
br label %236
223: ; preds = %210
br label %224
224: ; preds = %223, %202
br label %225
225: ; preds = %224, %129, %120, %113, %98, %90
%226 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%227 = icmp ne %struct.TYPE_17__* %226, null
br i1 %227, label %228, label %235
228: ; preds = %225
%229 = load i32, i32* %11
%230 = icmp eq i32 %229, 141
br i1 %230, label %231, label %235
231: ; preds = %228
%232 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%233 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %232, i32 0, i32 1
%234 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %233, i32 0, i32 0
store i32* null, i32** %234
br label %235
235: ; preds = %231, %228, %225
store i32 1, i32* %17
br label %236
236: ; preds = %235, %216, %173, %160, %149, %128, %119, %103, %94, %89, %58
%237 = load i32, i32* %17
%238 = icmp ne i32 %237, 0
br i1 %238, label %247, label %239
239: ; preds = %236
%240 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%241 = call i32 @ASN1_TYPE_free(%struct.TYPE_17__* %240)
%242 = load i32**, i32*** %14
%243 = icmp ne i32** %242, null
br i1 %243, label %244, label %246
244: ; preds = %239
%245 = load i32**, i32*** %14
store i32* null, i32** %245
br label %246
246: ; preds = %244, %239
br label %247
247: ; preds = %246, %236
%248 = load i32, i32* %17
store i32 %248, i32* %7
br label %249
249: ; preds = %247, %32
%250 = load i32, i32* %7
ret i32 %250
}

LLVM IR (-O2):
%struct.TYPE_20__ = type { i64, %struct.TYPE_19__* }
%struct.TYPE_19__ = type { {}* }
%struct.TYPE_17__ = type { i32, %struct.TYPE_16__ }
%struct.TYPE_16__ = type { i32*, i32* }
%struct.TYPE_21__ = type { i32 }
%struct.TYPE_18__ = type { i32, i8*, i32 }
@V_ASN1_ANY = global i64 0
@ASN1_F_ASN1_EX_C2I = global i32 0
@ASN1_R_NULL_IS_WRONG_LENGTH = global i32 0
@ASN1_R_BOOLEAN_IS_WRONG_LENGTH = global i32 0
@V_ASN1_NEG = global i32 0
@ASN1_R_BMPSTRING_IS_WRONG_LENGTH = global i32 0
@ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH = global i32 0
@ERR_R_MALLOC_FAILURE = global i32 0
define i32 @asn1_ex_c2i(i32** %0, i8* %1, i32 %2, i32 %3, i8* %4, %struct.TYPE_20__* %5) {
%7 = alloca i8*
store i8* %1, i8** %7
%8 = getelementptr inbounds %struct.TYPE_20__, %struct.TYPE_20__* %5, i64 0, i32 1
%9 = load %struct.TYPE_19__*, %struct.TYPE_19__** %8
%10 = icmp eq %struct.TYPE_19__* %9, null
br i1 %10, label %17, label %11
11: ; preds = %6
%12 = bitcast %struct.TYPE_19__* %9 to i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)**
%13 = load i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)*, i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)** %12
%14 = icmp eq i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)* %13, null
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = tail call i32 %13(i32** %0, i8* %1, i32 %2, i32 %3, i8* %4, %struct.TYPE_20__* %5)
br label %138
17: ; preds = %11, %6
%18 = getelementptr inbounds %struct.TYPE_20__, %struct.TYPE_20__* %5, i64 0, i32 0
%19 = load i64, i64* %18
%20 = load i64, i64* @V_ASN1_ANY
%21 = icmp eq i64 %19, %20
br i1 %21, label %22, label %43
22: ; preds = %17
%23 = load i32*, i32** %0
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = tail call %struct.TYPE_17__* (...) @ASN1_TYPE_new()
%27 = icmp eq %struct.TYPE_17__* %26, null
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = tail call i32 @ASN1_TYPE_free(%struct.TYPE_17__* null)
br label %138
30: ; preds = %25
%31 = getelementptr %struct.TYPE_17__, %struct.TYPE_17__* %26, i64 0, i32 0
store i32* %31, i32** %0
br label %34
32: ; preds = %22
%33 = bitcast i32* %23 to %struct.TYPE_17__*
br label %34
34: ; preds = %32, %30
%35 = phi %struct.TYPE_17__* [ %33, %32 ], [ %26, %30 ]
%36 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %35, i64 0, i32 0
%37 = load i32, i32* %36
%38 = icmp eq i32 %37, %3
br i1 %38, label %41, label %39
39: ; preds = %34
%40 = tail call i32 @ASN1_TYPE_set(%struct.TYPE_17__* %35, i32 %3, i32* null)
br label %41
41: ; preds = %39, %34
%42 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %35, i64 0, i32 1, i32 1
br label %43
43: ; preds = %41, %17
%44 = phi %struct.TYPE_17__* [ %35, %41 ], [ null, %17 ]
%45 = phi i32** [ %0, %41 ], [ null, %17 ]
%46 = phi i32** [ %42, %41 ], [ %0, %17 ]
switch i32 %3, label %94 [
i32 139, label %47
i32 141, label %50
i32 148, label %57
i32 150, label %66
i32 142, label %69
i32 147, label %69
i32 149, label %80
i32 132, label %87
]
47: ; preds = %43
%48 = call i32 @c2i_ASN1_OBJECT(i32** %46, i8** %7, i32 %2)
%49 = icmp eq i32 %48, 0
br i1 %49, label %134, label %138
50: ; preds = %43
%51 = icmp eq i32 %2, 0
br i1 %51, label %56, label %52
52: ; preds = %50
%53 = load i32, i32* @ASN1_F_ASN1_EX_C2I
%54 = load i32, i32* @ASN1_R_NULL_IS_WRONG_LENGTH
%55 = tail call i32 @ASN1err(i32 %53, i32 %54)
br label %134
56: ; preds = %50
store i32* inttoptr (i64 1 to i32*), i32** %46
br label %128
57: ; preds = %43
%58 = icmp eq i32 %2, 1
br i1 %58, label %63, label %59
59: ; preds = %57
%60 = load i32, i32* @ASN1_F_ASN1_EX_C2I
%61 = load i32, i32* @ASN1_R_BOOLEAN_IS_WRONG_LENGTH
%62 = tail call i32 @ASN1err(i32 %60, i32 %61)
br label %134
63: ; preds = %57
%64 = bitcast i32** %46 to i8*
%65 = load i8, i8* %1
store i8 %65, i8* %64
br label %138
66: ; preds = %43
%67 = call i32 @c2i_ASN1_BIT_STRING(i32** %46, i8** %7, i32 %2)
%68 = icmp eq i32 %67, 0
br i1 %68, label %134, label %138
69: ; preds = %43, %43
%70 = bitcast i32** %46 to %struct.TYPE_21__**
%71 = call i32 @c2i_ASN1_INTEGER(%struct.TYPE_21__** %70, i8** %7, i32 %2)
%72 = icmp eq i32 %71, 0
br i1 %72, label %134, label %73
73: ; preds = %69
%74 = load %struct.TYPE_21__*, %struct.TYPE_21__** %70
%75 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %74, i64 0, i32 0
%76 = load i32, i32* %75
%77 = load i32, i32* @V_ASN1_NEG
%78 = and i32 %77, %76
%79 = or i32 %78, %3
store i32 %79, i32* %75
br label %138
80: ; preds = %43
%81 = and i32 %2, 1
%82 = icmp eq i32 %81, 0
br i1 %82, label %94, label %83
83: ; preds = %80
%84 = load i32, i32* @ASN1_F_ASN1_EX_C2I
%85 = load i32, i32* @ASN1_R_BMPSTRING_IS_WRONG_LENGTH
%86 = tail call i32 @ASN1err(i32 %84, i32 %85)
br label %134
87: ; preds = %43
%88 = and i32 %2, 3
%89 = icmp eq i32 %88, 0
br i1 %89, label %94, label %90
90: ; preds = %87
%91 = load i32, i32* @ASN1_F_ASN1_EX_C2I
%92 = load i32, i32* @ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH
%93 = tail call i32 @ASN1err(i32 %91, i32 %92)
br label %134
94: ; preds = %80, %43, %87
%95 = load i32*, i32** %46
%96 = icmp eq i32* %95, null
br i1 %96, label %97, label %106
97: ; preds = %94
%98 = tail call %struct.TYPE_18__* @ASN1_STRING_type_new(i32 %3)
%99 = icmp eq %struct.TYPE_18__* %98, null
br i1 %99, label %100, label %104
100: ; preds = %97
%101 = load i32, i32* @ASN1_F_ASN1_EX_C2I
%102 = load i32, i32* @ERR_R_MALLOC_FAILURE
%103 = tail call i32 @ASN1err(i32 %101, i32 %102)
br label %134
104: ; preds = %97
%105 = getelementptr %struct.TYPE_18__, %struct.TYPE_18__* %98, i64 0, i32 0
store i32* %105, i32** %46
br label %108
106: ; preds = %94
%107 = bitcast i32* %95 to %struct.TYPE_18__*
store i32 %3, i32* %95
br label %108
108: ; preds = %106, %104
%109 = phi %struct.TYPE_18__* [ %107, %106 ], [ %98, %104 ]
%110 = load i8, i8* %4
%111 = icmp eq i8 %110, 0
br i1 %111, label %120, label %112
112: ; preds = %108
%113 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %109, i64 0, i32 1
%114 = load i8*, i8** %113
%115 = icmp eq i8* %114, null
br i1 %115, label %118, label %116
116: ; preds = %112
%117 = tail call i32 @OPENSSL_free(i8* %114)
br label %118
118: ; preds = %116, %112
store i8* %1, i8** %113
%119 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %109, i64 0, i32 2
store i32 %2, i32* %119
store i8 0, i8* %4
br label %128
120: ; preds = %108
%121 = tail call i32 @ASN1_STRING_set(%struct.TYPE_18__* %109, i8* %1, i32 %2)
%122 = icmp eq i32 %121, 0
br i1 %122, label %123, label %128
123: ; preds = %120
%124 = load i32, i32* @ASN1_F_ASN1_EX_C2I
%125 = load i32, i32* @ERR_R_MALLOC_FAILURE
%126 = tail call i32 @ASN1err(i32 %124, i32 %125)
%127 = tail call i32 @ASN1_STRING_free(%struct.TYPE_18__* %109)
store i32* null, i32** %46
br label %134
128: ; preds = %118, %120, %56
%129 = icmp ne %struct.TYPE_17__* %44, null
%130 = icmp eq i32 %3, 141
%131 = and i1 %130, %129
br i1 %131, label %132, label %138
132: ; preds = %128
%133 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %44, i64 0, i32 1, i32 0
store i32* null, i32** %133
br label %138
134: ; preds = %83, %90, %123, %100, %69, %66, %59, %52, %47
%135 = call i32 @ASN1_TYPE_free(%struct.TYPE_17__* %44)
%136 = icmp eq i32** %45, null
br i1 %136, label %138, label %137
137: ; preds = %134
store i32* null, i32** %45
br label %138
138: ; preds = %63, %73, %47, %66, %28, %132, %128, %137, %134, %15
%139 = phi i32 [ %16, %15 ], [ 0, %134 ], [ 0, %137 ], [ 1, %132 ], [ 1, %128 ], [ 0, %28 ], [ 1, %66 ], [ 1, %47 ], [ 1, %73 ], [ 1, %63 ]
ret i32 %139
}