#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;
scalar_t__ V_ASN1_ANY;
#define V_ASN1_BIT_STRING 152
#define V_ASN1_BMPSTRING 151
#define V_ASN1_BOOLEAN 150
#define V_ASN1_ENUMERATED 149
#define V_ASN1_GENERALIZEDTIME 148
#define V_ASN1_GENERALSTRING 147
#define V_ASN1_GRAPHICSTRING 146
#define V_ASN1_IA5STRING 145
#define V_ASN1_INTEGER 144
int V_ASN1_NEG;
#define V_ASN1_NEG_ENUMERATED 143
#define V_ASN1_NEG_INTEGER 142
#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 /*<<< orphan*/ free(unsigned char *);
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_NEG_INTEGER:
  case V_ASN1_ENUMERATED:
  case V_ASN1_NEG_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) {
      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    15bb <asn1_ex_c2i+0x40b>
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    1587 <asn1_ex_c2i+0x3d7>
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    $0x18,%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    1587 <asn1_ex_c2i+0x3d7>
jmp    155c <asn1_ex_c2i+0x3ac>
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   1050 <ASN1err@plt>
jmp    1587 <asn1_ex_c2i+0x3d7>
mov    -0x10(%rbp),%rax
mov    $0x1,%ecx
mov    %rcx,(%rax)
jmp    155c <asn1_ex_c2i+0x3ac>
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   1050 <ASN1err@plt>
jmp    1587 <asn1_ex_c2i+0x3d7>
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x68(%rbp),%rax
mov    %cl,(%rax)
jmp    155c <asn1_ex_c2i+0x3ac>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    -0x18(%rbp),%rsi
call   1080 <c2i_ASN1_BIT_STRING@plt>
cmp    $0x0,%eax
jne    13a3 <asn1_ex_c2i+0x1f3>
jmp    1587 <asn1_ex_c2i+0x3d7>
jmp    155c <asn1_ex_c2i+0x3ac>
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    1587 <asn1_ex_c2i+0x3d7>
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    155c <asn1_ex_c2i+0x3ac>
jmp    13f8 <asn1_ex_c2i+0x248>
cmpl   $0x97,-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   1050 <ASN1err@plt>
jmp    1587 <asn1_ex_c2i+0x3d7>
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   1050 <ASN1err@plt>
jmp    1587 <asn1_ex_c2i+0x3d7>
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   1050 <ASN1err@plt>
jmp    1587 <asn1_ex_c2i+0x3d7>
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     1509 <asn1_ex_c2i+0x359>
mov    -0x40(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <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    1557 <asn1_ex_c2i+0x3a7>
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   10a0 <ASN1_STRING_set@plt>
cmp    $0x0,%eax
jne    1552 <asn1_ex_c2i+0x3a2>
mov    0x2aa7(%rip),%rax
mov    (%rax),%edi
mov    0x2a96(%rip),%rax
mov    (%rax),%esi
call   1050 <ASN1err@plt>
mov    -0x40(%rbp),%rdi
call   1060 <ASN1_STRING_free@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
jmp    1587 <asn1_ex_c2i+0x3d7>
jmp    1557 <asn1_ex_c2i+0x3a7>
jmp    155c <asn1_ex_c2i+0x3ac>
cmpq   $0x0,-0x48(%rbp)
je     1580 <asn1_ex_c2i+0x3d0>
cmpl   $0x8d,-0x20(%rbp)
jne    1580 <asn1_ex_c2i+0x3d0>
mov    -0x48(%rbp),%rax
movq   $0x0,0x8(%rax)
movl   $0x1,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
jne    15b5 <asn1_ex_c2i+0x405>
mov    -0x48(%rbp),%rdi
call   1070 <ASN1_TYPE_free@plt>
cmpq   $0x0,-0x38(%rbp)
je     15b0 <asn1_ex_c2i+0x400>
mov    -0x38(%rbp),%rax
movq   $0x0,(%rax)
jmp    15b5 <asn1_ex_c2i+0x405>
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    $0x28,%rsp
mov    %r8,%r14
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %rsi,%r13
mov    %rdi,%rbx
mov    %rsi,0x18(%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    %r13,%rsi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14,%r8
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    *%rax
mov    (%r9),%rax
mov    0x2d9c(%rip),%rcx
xor    %ebp,%ebp
cmp    (%rcx),%rax
jne    1237 <asn1_ex_c2i+0x87>
mov    (%rbx),%rbp
test   %rbp,%rbp
je     1299 <asn1_ex_c2i+0xe9>
cmp    %r15d,0x0(%rbp)
je     122e <asn1_ex_c2i+0x7e>
mov    %rbp,%rdi
mov    %r15d,%esi
xor    %edx,%edx
call   10d0 <ASN1_TYPE_set@plt>
mov    %rbx,%rdx
lea    0x10(%rbp),%rbx
jmp    1239 <asn1_ex_c2i+0x89>
xor    %edx,%edx
lea    -0x84(%r15),%eax
cmp    $0x14,%eax
mov    %rbp,0x20(%rsp)
ja     134a <asn1_ex_c2i+0x19a>
lea    0xdab(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %rdx,0x8(%rsp)
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
mov    %r12d,%edx
call   10b0 <c2i_ASN1_INTEGER@plt>
test   %eax,%eax
je     1481 <asn1_ex_c2i+0x2d1>
mov    (%rbx),%rax
mov    0x2d53(%rip),%rcx
mov    (%rcx),%ecx
and    (%rax),%ecx
or     %r15d,%ecx
mov    %ecx,(%rax)
mov    $0x1,%r14d
jmp    149f <asn1_ex_c2i+0x2ef>
mov    %r14,0x10(%rsp)
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <ASN1_TYPE_new@plt>
test   %rax,%rax
je     1384 <asn1_ex_c2i+0x1d4>
mov    %rax,(%rbx)
mov    %rax,%rbp
mov    0x10(%rsp),%r14
cmp    %r15d,0x0(%rbp)
jne    1221 <asn1_ex_c2i+0x71>
jmp    122e <asn1_ex_c2i+0x7e>
test   $0x3,%r12b
je     134a <asn1_ex_c2i+0x19a>
mov    %rdx,0x8(%rsp)
mov    0x2cf3(%rip),%rax
mov    (%rax),%edi
mov    0x2cd2(%rip),%rax
jmp    147a <asn1_ex_c2i+0x2ca>
mov    %rdx,0x8(%rsp)
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
mov    %r12d,%edx
call   1090 <c2i_ASN1_OBJECT@plt>
jmp    1371 <asn1_ex_c2i+0x1c1>
test   %r12d,%r12d
je     1440 <asn1_ex_c2i+0x290>
mov    %rdx,0x8(%rsp)
mov    0x2cb9(%rip),%rax
mov    (%rax),%edi
mov    0x2cd8(%rip),%rax
jmp    147a <asn1_ex_c2i+0x2ca>
cmp    $0x1,%r12d
jne    1412 <asn1_ex_c2i+0x262>
mov    0x0(%r13),%al
mov    %al,(%rbx)
mov    $0x1,%r14d
jmp    149f <asn1_ex_c2i+0x2ef>
test   $0x1,%r12b
jne    1429 <asn1_ex_c2i+0x279>
mov    %r14,0x10(%rsp)
mov    (%rbx),%r14
test   %r14,%r14
je     1390 <asn1_ex_c2i+0x1e0>
mov    %r15d,(%r14)
jmp    13b1 <asn1_ex_c2i+0x201>
mov    %rdx,0x8(%rsp)
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
mov    %r12d,%edx
call   1080 <c2i_ASN1_BIT_STRING@plt>
mov    $0x1,%r14d
test   %eax,%eax
jne    149f <asn1_ex_c2i+0x2ef>
jmp    1481 <asn1_ex_c2i+0x2d1>
xor    %edi,%edi
call   1070 <ASN1_TYPE_free@plt>
jmp    149f <asn1_ex_c2i+0x2ef>
mov    %rdx,0x8(%rsp)
mov    %r15d,%edi
call   10c0 <ASN1_STRING_type_new@plt>
test   %rax,%rax
je     146a <asn1_ex_c2i+0x2ba>
mov    %rax,%r14
mov    %rax,(%rbx)
mov    0x8(%rsp),%rdx
mov    0x10(%rsp),%rbp
cmpb   $0x0,0x0(%rbp)
je     13d3 <asn1_ex_c2i+0x223>
mov    0x8(%r14),%rdi
call   1040 <free@plt>
mov    %r13,0x8(%r14)
mov    %r12d,0x10(%r14)
movb   $0x0,0x0(%rbp)
jmp    1447 <asn1_ex_c2i+0x297>
mov    %rdx,0x8(%rsp)
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r12d,%edx
call   10a0 <ASN1_STRING_set@plt>
test   %eax,%eax
jne    1447 <asn1_ex_c2i+0x297>
mov    0x2bdf(%rip),%rax
mov    (%rax),%edi
mov    0x2bce(%rip),%rax
mov    (%rax),%esi
call   1050 <ASN1err@plt>
mov    %r14,%rdi
call   1060 <ASN1_STRING_free@plt>
movq   $0x0,(%rbx)
jmp    1481 <asn1_ex_c2i+0x2d1>
mov    %rdx,0x8(%rsp)
mov    0x2bb2(%rip),%rax
mov    (%rax),%edi
mov    0x2b89(%rip),%rax
jmp    147a <asn1_ex_c2i+0x2ca>
mov    %rdx,0x8(%rsp)
mov    0x2b9b(%rip),%rax
mov    (%rax),%edi
mov    0x2ba2(%rip),%rax
jmp    147a <asn1_ex_c2i+0x2ca>
movq   $0x1,(%rbx)
mov    $0x1,%r14d
cmp    $0x8d,%r15d
jne    149f <asn1_ex_c2i+0x2ef>
mov    0x20(%rsp),%rax
test   %rax,%rax
je     149f <asn1_ex_c2i+0x2ef>
movq   $0x0,0x8(%rax)
jmp    149f <asn1_ex_c2i+0x2ef>
mov    0x2b5f(%rip),%rax
mov    (%rax),%edi
mov    0x2b4e(%rip),%rax
mov    (%rax),%esi
call   1050 <ASN1err@plt>
mov    0x20(%rsp),%rdi
call   1070 <ASN1_TYPE_free@plt>
xor    %r14d,%r14d
mov    0x8(%rsp),%rax
test   %rax,%rax
je     149f <asn1_ex_c2i+0x2ef>
movq   $0x0,(%rax)
mov    %r14d,%eax
add    $0x28,%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 %243
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 %230
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 150, label %100
i32 152, label %114
i32 144, label %121
i32 142, label %121
i32 149, label %121
i32 143, label %121
i32 138, label %141
i32 140, label %141
i32 136, label %141
i32 133, label %141
i32 129, label %141
i32 145, label %141
i32 131, label %141
i32 148, label %141
i32 146, label %141
i32 128, label %141
i32 147, label %141
i32 132, label %141
i32 151, 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 %230
90: ; preds = %84
br label %219
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 %230
98: ; preds = %91
%99 = load i32**, i32*** %8
store i32* inttoptr (i64 1 to i32*), i32** %99
br label %219
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 %230
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 %219
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 %230
120: ; preds = %114
br label %219
121: ; preds = %82, %82, %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 %230
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 %219
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, 151
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 %230
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 %230
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 %230
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 %204
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 = call i32 @free(i8* %195)
%197 = load i8*, i8** %9
%198 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%199 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %198, i32 0, i32 1
store i8* %197, i8** %199
%200 = load i32, i32* %10
%201 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%202 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %201, i32 0, i32 2
store i32 %200, i32* %202
%203 = load i8*, i8** %12
store i8 0, i8* %203
br label %218
204: ; preds = %188
%205 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%206 = load i8*, i8** %9
%207 = load i32, i32* %10
%208 = call i32 @ASN1_STRING_set(%struct.TYPE_18__* %205, i8* %206, i32 %207)
%209 = icmp ne i32 %208, 0
br i1 %209, label %217, label %210
210: ; preds = %204
%211 = load i32, i32* @ASN1_F_ASN1_EX_C2I
%212 = load i32, i32* @ERR_R_MALLOC_FAILURE
%213 = call i32 @ASN1err(i32 %211, i32 %212)
%214 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%215 = call i32 @ASN1_STRING_free(%struct.TYPE_18__* %214)
%216 = load i32**, i32*** %8
store i32* null, i32** %216
br label %230
217: ; preds = %204
br label %218
218: ; preds = %217, %192
br label %219
219: ; preds = %218, %129, %120, %113, %98, %90
%220 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%221 = icmp ne %struct.TYPE_17__* %220, null
br i1 %221, label %222, label %229
222: ; preds = %219
%223 = load i32, i32* %11
%224 = icmp eq i32 %223, 141
br i1 %224, label %225, label %229
225: ; preds = %222
%226 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%227 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %226, i32 0, i32 1
%228 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %227, i32 0, i32 0
store i32* null, i32** %228
br label %229
229: ; preds = %225, %222, %219
store i32 1, i32* %17
br label %230
230: ; preds = %229, %210, %173, %160, %149, %128, %119, %103, %94, %89, %58
%231 = load i32, i32* %17
%232 = icmp ne i32 %231, 0
br i1 %232, label %241, label %233
233: ; preds = %230
%234 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%235 = call i32 @ASN1_TYPE_free(%struct.TYPE_17__* %234)
%236 = load i32**, i32*** %14
%237 = icmp ne i32** %236, null
br i1 %237, label %238, label %240
238: ; preds = %233
%239 = load i32**, i32*** %14
store i32* null, i32** %239
br label %240
240: ; preds = %238, %233
br label %241
241: ; preds = %240, %230
%242 = load i32, i32* %17
store i32 %242, i32* %7
br label %243
243: ; preds = %241, %32
%244 = load i32, i32* %7
ret i32 %244
}

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 %135
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 %135
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 150, label %57
i32 152, label %66
i32 144, label %69
i32 142, label %69
i32 149, label %69
i32 143, label %69
i32 151, 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 %131, label %135
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 %131
56: ; preds = %50
store i32* inttoptr (i64 1 to i32*), i32** %46
br label %125
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 %131
63: ; preds = %57
%64 = bitcast i32** %46 to i8*
%65 = load i8, i8* %1
store i8 %65, i8* %64
br label %135
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 %131, label %135
69: ; preds = %43, %43, %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 %131, 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 %135
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 %131
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 %131
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 %131
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 %117, 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 = tail call i32 @free(i8* %114)
store i8* %1, i8** %113
%116 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %109, i64 0, i32 2
store i32 %2, i32* %116
store i8 0, i8* %4
br label %125
117: ; preds = %108
%118 = tail call i32 @ASN1_STRING_set(%struct.TYPE_18__* %109, i8* %1, i32 %2)
%119 = icmp eq i32 %118, 0
br i1 %119, label %120, label %125
120: ; preds = %117
%121 = load i32, i32* @ASN1_F_ASN1_EX_C2I
%122 = load i32, i32* @ERR_R_MALLOC_FAILURE
%123 = tail call i32 @ASN1err(i32 %121, i32 %122)
%124 = tail call i32 @ASN1_STRING_free(%struct.TYPE_18__* %109)
store i32* null, i32** %46
br label %131
125: ; preds = %112, %117, %56
%126 = icmp ne %struct.TYPE_17__* %44, null
%127 = icmp eq i32 %3, 141
%128 = and i1 %127, %126
br i1 %128, label %129, label %135
129: ; preds = %125
%130 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %44, i64 0, i32 1, i32 0
store i32* null, i32** %130
br label %135
131: ; preds = %83, %90, %120, %100, %69, %66, %59, %52, %47
%132 = call i32 @ASN1_TYPE_free(%struct.TYPE_17__* %44)
%133 = icmp eq i32** %45, null
br i1 %133, label %135, label %134
134: ; preds = %131
store i32* null, i32** %45
br label %135
135: ; preds = %63, %73, %47, %66, %28, %129, %125, %134, %131, %15
%136 = phi i32 [ %16, %15 ], [ 0, %131 ], [ 0, %134 ], [ 1, %129 ], [ 1, %125 ], [ 0, %28 ], [ 1, %66 ], [ 1, %47 ], [ 1, %73 ], [ 1, %63 ]
ret i32 %136
}