#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_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*/ ASN1error(int /*<<< orphan*/);
int /*<<< orphan*/ ERR_R_MALLOC_FAILURE;
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 /*<<< 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;
  ASN1_INTEGER **tint;
  int ret = 0;
  if (it->funcs != NULL) {
    const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
    if (pf->prim_c2i == NULL)
      return 0;
    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) {
      ASN1error(ASN1_R_NULL_IS_WRONG_LENGTH);
      goto err;
    }
    *pval = (ASN1_VALUE *)1;
    break;
  case V_ASN1_BOOLEAN:
    if (len != 1) {
      ASN1error(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)) {
      ASN1error(ASN1_R_BMPSTRING_IS_WRONG_LENGTH);
      goto err;
    }
    if (utype == V_ASN1_UNIVERSALSTRING && (len & 3)) {
      ASN1error(ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH);
      goto err;
    }
    if (!*pval) {
      stmp = ASN1_STRING_type_new(utype);
      if (!stmp) {
        ASN1error(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)) {
        ASN1error(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,-0x54(%rbp)
mov    -0x30(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1241 <asn1_ex_c2i+0x91>
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
cmpq   $0x0,(%rax)
jne    121a <asn1_ex_c2i+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1595 <asn1_ex_c2i+0x3e5>
mov    -0x60(%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    1595 <asn1_ex_c2i+0x3e5>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    0x2d61(%rip),%rcx
cmp    (%rcx),%rax
jne    12d3 <asn1_ex_c2i+0x123>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1291 <asn1_ex_c2i+0xe1>
mov    $0x0,%al
call   1030 <ASN1_TYPE_new@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1281 <asn1_ex_c2i+0xd1>
jmp    1561 <asn1_ex_c2i+0x3b1>
mov    -0x48(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    129c <asn1_ex_c2i+0xec>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x48(%rbp),%rcx
cmp    (%rcx),%eax
je     12bb <asn1_ex_c2i+0x10b>
mov    -0x48(%rbp),%rdi
mov    -0x20(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
call   10c0 <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     13f6 <asn1_ex_c2i+0x246>
mov    -0x70(%rbp),%rax
lea    0xd0d(%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   1080 <c2i_ASN1_OBJECT@plt>
cmp    $0x0,%eax
jne    131a <asn1_ex_c2i+0x16a>
jmp    1561 <asn1_ex_c2i+0x3b1>
jmp    1536 <asn1_ex_c2i+0x386>
cmpl   $0x0,-0x1c(%rbp)
je     133c <asn1_ex_c2i+0x18c>
mov    0x2cc8(%rip),%rax
mov    (%rax),%edi
call   10d0 <ASN1error@plt>
jmp    1561 <asn1_ex_c2i+0x3b1>
mov    -0x10(%rbp),%rax
mov    $0x1,%ecx
mov    %rcx,(%rax)
jmp    1536 <asn1_ex_c2i+0x386>
cmpl   $0x1,-0x1c(%rbp)
je     136a <asn1_ex_c2i+0x1ba>
mov    0x2c5a(%rip),%rax
mov    (%rax),%edi
call   10d0 <ASN1error@plt>
jmp    1561 <asn1_ex_c2i+0x3b1>
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x68(%rbp),%rax
mov    %cl,(%rax)
jmp    1536 <asn1_ex_c2i+0x386>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    -0x18(%rbp),%rsi
call   1070 <c2i_ASN1_BIT_STRING@plt>
cmp    $0x0,%eax
jne    13a1 <asn1_ex_c2i+0x1f1>
jmp    1561 <asn1_ex_c2i+0x3b1>
jmp    1536 <asn1_ex_c2i+0x386>
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    -0x18(%rbp),%rsi
call   10a0 <c2i_ASN1_INTEGER@plt>
cmp    $0x0,%eax
jne    13cc <asn1_ex_c2i+0x21c>
jmp    1561 <asn1_ex_c2i+0x3b1>
mov    -0x20(%rbp),%ecx
mov    -0x50(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    0x2bf9(%rip),%rdx
and    (%rdx),%eax
or     %eax,%ecx
mov    -0x50(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
jmp    1536 <asn1_ex_c2i+0x386>
jmp    13f6 <asn1_ex_c2i+0x246>
cmpl   $0x95,-0x20(%rbp)
jne    1425 <asn1_ex_c2i+0x275>
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1425 <asn1_ex_c2i+0x275>
mov    0x2bc7(%rip),%rax
mov    (%rax),%edi
call   10d0 <ASN1error@plt>
jmp    1561 <asn1_ex_c2i+0x3b1>
cmpl   $0x84,-0x20(%rbp)
jne    1454 <asn1_ex_c2i+0x2a4>
mov    -0x1c(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     1454 <asn1_ex_c2i+0x2a4>
mov    0x2b78(%rip),%rax
mov    (%rax),%edi
call   10d0 <ASN1error@plt>
jmp    1561 <asn1_ex_c2i+0x3b1>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    149c <asn1_ex_c2i+0x2ec>
mov    -0x20(%rbp),%edi
call   10b0 <ASN1_STRING_type_new@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    148c <asn1_ex_c2i+0x2dc>
mov    0x2b50(%rip),%rax
mov    (%rax),%edi
call   10d0 <ASN1error@plt>
jmp    1561 <asn1_ex_c2i+0x3b1>
mov    -0x40(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    14b0 <asn1_ex_c2i+0x300>
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     14ec <asn1_ex_c2i+0x33c>
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    1531 <asn1_ex_c2i+0x381>
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1090 <ASN1_STRING_set@plt>
cmp    $0x0,%eax
jne    152c <asn1_ex_c2i+0x37c>
mov    0x2ac4(%rip),%rax
mov    (%rax),%edi
call   10d0 <ASN1error@plt>
mov    -0x40(%rbp),%rdi
call   1050 <ASN1_STRING_free@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
jmp    1561 <asn1_ex_c2i+0x3b1>
jmp    1531 <asn1_ex_c2i+0x381>
jmp    1536 <asn1_ex_c2i+0x386>
cmpq   $0x0,-0x48(%rbp)
je     155a <asn1_ex_c2i+0x3aa>
cmpl   $0x8d,-0x20(%rbp)
jne    155a <asn1_ex_c2i+0x3aa>
mov    -0x48(%rbp),%rax
movq   $0x0,0x8(%rax)
movl   $0x1,-0x54(%rbp)
cmpl   $0x0,-0x54(%rbp)
jne    158f <asn1_ex_c2i+0x3df>
mov    -0x48(%rbp),%rdi
call   1060 <ASN1_TYPE_free@plt>
cmpq   $0x0,-0x38(%rbp)
je     158a <asn1_ex_c2i+0x3da>
mov    -0x38(%rbp),%rax
movq   $0x0,(%rax)
jmp    158f <asn1_ex_c2i+0x3df>
mov    -0x54(%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     1240 <asn1_ex_c2i+0x90>
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),%rdx
mov    0x2da4(%rip),%rcx
xor    %eax,%eax
cmp    (%rcx),%rdx
jne    1248 <asn1_ex_c2i+0x98>
mov    (%rbx),%rax
test   %rax,%rax
je     12a9 <asn1_ex_c2i+0xf9>
cmp    %r15d,(%rax)
je     1237 <asn1_ex_c2i+0x87>
mov    %rax,%r14
mov    %rax,%rdi
mov    %r15d,%esi
xor    %edx,%edx
call   10c0 <ASN1_TYPE_set@plt>
mov    %r14,%rax
mov    %rbx,%rsi
lea    0x10(%rax),%rbx
jmp    124a <asn1_ex_c2i+0x9a>
xor    %r14d,%r14d
jmp    148b <asn1_ex_c2i+0x2db>
xor    %esi,%esi
lea    -0x84(%r15),%edx
cmp    $0x12,%edx
ja     1348 <asn1_ex_c2i+0x198>
lea    0xd9f(%rip),%rcx
movslq (%rcx,%rdx,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    %rsi,(%rsp)
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    %r12d,%edx
call   10a0 <c2i_ASN1_INTEGER@plt>
test   %eax,%eax
je     146e <asn1_ex_c2i+0x2be>
mov    (%rbx),%rax
mov    0x2d43(%rip),%rcx
mov    (%rcx),%ecx
and    (%rax),%ecx
or     %r15d,%ecx
mov    %ecx,(%rax)
mov    $0x1,%r14d
jmp    148b <asn1_ex_c2i+0x2db>
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <ASN1_TYPE_new@plt>
test   %rax,%rax
je     13ab <asn1_ex_c2i+0x1fb>
mov    %rax,(%rbx)
cmp    %r15d,(%rax)
jne    1224 <asn1_ex_c2i+0x74>
jmp    1237 <asn1_ex_c2i+0x87>
test   $0x3,%r12b
je     1348 <asn1_ex_c2i+0x198>
mov    %rsi,(%rsp)
mov    %rax,0x8(%rsp)
mov    0x2cdd(%rip),%rax
jmp    1467 <asn1_ex_c2i+0x2b7>
mov    %rsi,(%rsp)
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    %r12d,%edx
call   1080 <c2i_ASN1_OBJECT@plt>
jmp    1398 <asn1_ex_c2i+0x1e8>
test   %r12d,%r12d
je     143b <asn1_ex_c2i+0x28b>
mov    %rsi,(%rsp)
mov    %rax,0x8(%rsp)
mov    0x2cd9(%rip),%rax
jmp    1467 <asn1_ex_c2i+0x2b7>
cmp    $0x1,%r12d
jne    1417 <asn1_ex_c2i+0x267>
mov    0x0(%rbp),%al
mov    %al,(%rbx)
mov    $0x1,%r14d
jmp    148b <asn1_ex_c2i+0x2db>
test   $0x1,%r12b
jne    1429 <asn1_ex_c2i+0x279>
mov    (%rbx),%r14
test   %r14,%r14
mov    %rax,0x8(%rsp)
je     13b7 <asn1_ex_c2i+0x207>
mov    %r15d,(%r14)
cmpb   $0x0,0x0(%r13)
je     13dd <asn1_ex_c2i+0x22d>
mov    0x8(%r14),%rdi
call   1040 <free@plt>
mov    %rbp,0x8(%r14)
mov    %r12d,0x10(%r14)
movb   $0x0,0x0(%r13)
mov    0x8(%rsp),%rax
jmp    1442 <asn1_ex_c2i+0x292>
mov    %rsi,(%rsp)
mov    %rax,0x8(%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    148b <asn1_ex_c2i+0x2db>
jmp    146e <asn1_ex_c2i+0x2be>
xor    %edi,%edi
call   1060 <ASN1_TYPE_free@plt>
jmp    148b <asn1_ex_c2i+0x2db>
mov    %rsi,(%rsp)
mov    %r15d,%edi
call   10b0 <ASN1_STRING_type_new@plt>
test   %rax,%rax
je     1460 <asn1_ex_c2i+0x2b0>
mov    %rax,%r14
mov    %rax,(%rbx)
mov    (%rsp),%rsi
cmpb   $0x0,0x0(%r13)
jne    135f <asn1_ex_c2i+0x1af>
mov    %rsi,(%rsp)
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %r12d,%edx
call   1090 <ASN1_STRING_set@plt>
test   %eax,%eax
mov    0x8(%rsp),%rax
jne    1442 <asn1_ex_c2i+0x292>
mov    0x2bd1(%rip),%rax
mov    (%rax),%edi
call   10d0 <ASN1error@plt>
mov    %r14,%rdi
call   1050 <ASN1_STRING_free@plt>
movq   $0x0,(%rbx)
jmp    146e <asn1_ex_c2i+0x2be>
mov    %rsi,(%rsp)
mov    %rax,0x8(%rsp)
mov    0x2b91(%rip),%rax
jmp    1467 <asn1_ex_c2i+0x2b7>
mov    %rsi,(%rsp)
mov    %rax,0x8(%rsp)
mov    0x2ba7(%rip),%rax
jmp    1467 <asn1_ex_c2i+0x2b7>
movq   $0x1,(%rbx)
mov    $0x1,%r14d
cmp    $0x8d,%r15d
jne    148b <asn1_ex_c2i+0x2db>
test   %rax,%rax
je     148b <asn1_ex_c2i+0x2db>
movq   $0x0,0x8(%rax)
jmp    148b <asn1_ex_c2i+0x2db>
mov    0x2b69(%rip),%rax
mov    (%rax),%edi
call   10d0 <ASN1error@plt>
mov    0x8(%rsp),%rdi
call   1060 <ASN1_TYPE_free@plt>
xor    %r14d,%r14d
mov    (%rsp),%rax
test   %rax,%rax
je     148b <asn1_ex_c2i+0x2db>
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_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 %struct.TYPE_21__**
%18 = alloca i32
%19 = alloca %struct.TYPE_19__*
%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* %18
%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
%24 = icmp ne %struct.TYPE_19__* %23, null
br i1 %24, label %25, label %47
25: ; preds = %6
%26 = load %struct.TYPE_20__*, %struct.TYPE_20__** %13
%27 = getelementptr inbounds %struct.TYPE_20__, %struct.TYPE_20__* %26, i32 0, i32 1
%28 = load %struct.TYPE_19__*, %struct.TYPE_19__** %27
store %struct.TYPE_19__* %28, %struct.TYPE_19__** %19
%29 = load %struct.TYPE_19__*, %struct.TYPE_19__** %19
%30 = getelementptr inbounds %struct.TYPE_19__, %struct.TYPE_19__* %29, i32 0, i32 0
%31 = bitcast {}** %30 to i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)**
%32 = load i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)*, i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)** %31
%33 = icmp eq i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)* %32, null
br i1 %33, label %34, label %35
34: ; preds = %25
store i32 0, i32* %7
br label %240
35: ; preds = %25
%36 = load %struct.TYPE_19__*, %struct.TYPE_19__** %19
%37 = getelementptr inbounds %struct.TYPE_19__, %struct.TYPE_19__* %36, i32 0, i32 0
%38 = bitcast {}** %37 to i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)**
%39 = load i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)*, i32 (i32**, i8*, i32, i32, i8*, %struct.TYPE_20__*)** %38
%40 = load i32**, i32*** %8
%41 = load i8*, i8** %9
%42 = load i32, i32* %10
%43 = load i32, i32* %11
%44 = load i8*, i8** %12
%45 = load %struct.TYPE_20__*, %struct.TYPE_20__** %13
%46 = call i32 %39(i32** %40, i8* %41, i32 %42, i32 %43, i8* %44, %struct.TYPE_20__* %45)
store i32 %46, i32* %7
br label %240
47: ; preds = %6
%48 = load %struct.TYPE_20__*, %struct.TYPE_20__** %13
%49 = getelementptr inbounds %struct.TYPE_20__, %struct.TYPE_20__* %48, i32 0, i32 0
%50 = load i64, i64* %49
%51 = load i64, i64* @V_ASN1_ANY
%52 = icmp eq i64 %50, %51
br i1 %52, label %53, label %85
53: ; preds = %47
%54 = load i32**, i32*** %8
%55 = load i32*, i32** %54
%56 = icmp ne i32* %55, null
br i1 %56, label %66, label %57
57: ; preds = %53
%58 = call %struct.TYPE_17__* (...) @ASN1_TYPE_new()
store %struct.TYPE_17__* %58, %struct.TYPE_17__** %16
%59 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%60 = icmp eq %struct.TYPE_17__* %59, null
br i1 %60, label %61, label %62
61: ; preds = %57
br label %227
62: ; preds = %57
%63 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%64 = bitcast %struct.TYPE_17__* %63 to i32*
%65 = load i32**, i32*** %8
store i32* %64, i32** %65
br label %70
66: ; preds = %53
%67 = load i32**, i32*** %8
%68 = load i32*, i32** %67
%69 = bitcast i32* %68 to %struct.TYPE_17__*
store %struct.TYPE_17__* %69, %struct.TYPE_17__** %16
br label %70
70: ; preds = %66, %62
%71 = load i32, i32* %11
%72 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%73 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %72, i32 0, i32 0
%74 = load i32, i32* %73
%75 = icmp ne i32 %71, %74
br i1 %75, label %76, label %80
76: ; preds = %70
%77 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%78 = load i32, i32* %11
%79 = call i32 @ASN1_TYPE_set(%struct.TYPE_17__* %77, i32 %78, i32* null)
br label %80
80: ; preds = %76, %70
%81 = load i32**, i32*** %8
store i32** %81, i32*** %14
%82 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%83 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %82, i32 0, i32 1
%84 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %83, i32 0, i32 1
store i32** %84, i32*** %8
br label %85
85: ; preds = %80, %47
%86 = load i32, i32* %11
switch i32 %86, label %143 [
i32 139, label %87
i32 141, label %94
i32 148, label %102
i32 150, label %115
i32 142, label %122
i32 147, label %122
i32 138, label %142
i32 140, label %142
i32 136, label %142
i32 133, label %142
i32 129, label %142
i32 143, label %142
i32 131, label %142
i32 146, label %142
i32 144, label %142
i32 128, label %142
i32 145, label %142
i32 132, label %142
i32 149, label %142
i32 130, label %142
i32 137, label %142
i32 134, label %142
i32 135, label %142
]
87: ; preds = %85
%88 = load i32**, i32*** %8
%89 = load i32, i32* %10
%90 = call i32 @c2i_ASN1_OBJECT(i32** %88, i8** %9, i32 %89)
%91 = icmp ne i32 %90, 0
br i1 %91, label %93, label %92
92: ; preds = %87
br label %227
93: ; preds = %87
br label %216
94: ; preds = %85
%95 = load i32, i32* %10
%96 = icmp ne i32 %95, 0
br i1 %96, label %97, label %100
97: ; preds = %94
%98 = load i32, i32* @ASN1_R_NULL_IS_WRONG_LENGTH
%99 = call i32 @ASN1error(i32 %98)
br label %227
100: ; preds = %94
%101 = load i32**, i32*** %8
store i32* inttoptr (i64 1 to i32*), i32** %101
br label %216
102: ; preds = %85
%103 = load i32, i32* %10
%104 = icmp ne i32 %103, 1
br i1 %104, label %105, label %108
105: ; preds = %102
%106 = load i32, i32* @ASN1_R_BOOLEAN_IS_WRONG_LENGTH
%107 = call i32 @ASN1error(i32 %106)
br label %227
108: ; preds = %102
%109 = load i32**, i32*** %8
%110 = bitcast i32** %109 to i8*
store i8* %110, i8** %20
%111 = load i8*, i8** %9
%112 = load i8, i8* %111
%113 = load i8*, i8** %20
store i8 %112, i8* %113
br label %114
114: ; preds = %108
br label %216
115: ; preds = %85
%116 = load i32**, i32*** %8
%117 = load i32, i32* %10
%118 = call i32 @c2i_ASN1_BIT_STRING(i32** %116, i8** %9, i32 %117)
%119 = icmp ne i32 %118, 0
br i1 %119, label %121, label %120
120: ; preds = %115
br label %227
121: ; preds = %115
br label %216
122: ; preds = %85, %85
%123 = load i32**, i32*** %8
%124 = bitcast i32** %123 to %struct.TYPE_21__**
store %struct.TYPE_21__** %124, %struct.TYPE_21__*** %17
%125 = load %struct.TYPE_21__**, %struct.TYPE_21__*** %17
%126 = load i32, i32* %10
%127 = call i32 @c2i_ASN1_INTEGER(%struct.TYPE_21__** %125, i8** %9, i32 %126)
%128 = icmp ne i32 %127, 0
br i1 %128, label %130, label %129
129: ; preds = %122
br label %227
130: ; preds = %122
%131 = load i32, i32* %11
%132 = load %struct.TYPE_21__**, %struct.TYPE_21__*** %17
%133 = load %struct.TYPE_21__*, %struct.TYPE_21__** %132
%134 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %133, i32 0, i32 0
%135 = load i32, i32* %134
%136 = load i32, i32* @V_ASN1_NEG
%137 = and i32 %135, %136
%138 = or i32 %131, %137
%139 = load %struct.TYPE_21__**, %struct.TYPE_21__*** %17
%140 = load %struct.TYPE_21__*, %struct.TYPE_21__** %139
%141 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %140, i32 0, i32 0
store i32 %138, i32* %141
br label %216
142: ; preds = %85, %85, %85, %85, %85, %85, %85, %85, %85, %85, %85, %85, %85, %85, %85, %85, %85
br label %143
143: ; preds = %85, %142
%144 = load i32, i32* %11
%145 = icmp eq i32 %144, 149
br i1 %145, label %146, label %153
146: ; preds = %143
%147 = load i32, i32* %10
%148 = and i32 %147, 1
%149 = icmp ne i32 %148, 0
br i1 %149, label %150, label %153
150: ; preds = %146
%151 = load i32, i32* @ASN1_R_BMPSTRING_IS_WRONG_LENGTH
%152 = call i32 @ASN1error(i32 %151)
br label %227
153: ; preds = %146, %143
%154 = load i32, i32* %11
%155 = icmp eq i32 %154, 132
br i1 %155, label %156, label %163
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 %163
160: ; preds = %156
%161 = load i32, i32* @ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH
%162 = call i32 @ASN1error(i32 %161)
br label %227
163: ; preds = %156, %153
%164 = load i32**, i32*** %8
%165 = load i32*, i32** %164
%166 = icmp ne i32* %165, null
br i1 %166, label %179, label %167
167: ; preds = %163
%168 = load i32, i32* %11
%169 = call %struct.TYPE_18__* @ASN1_STRING_type_new(i32 %168)
store %struct.TYPE_18__* %169, %struct.TYPE_18__** %15
%170 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%171 = icmp ne %struct.TYPE_18__* %170, null
br i1 %171, label %175, label %172
172: ; preds = %167
%173 = load i32, i32* @ERR_R_MALLOC_FAILURE
%174 = call i32 @ASN1error(i32 %173)
br label %227
175: ; preds = %167
%176 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%177 = bitcast %struct.TYPE_18__* %176 to i32*
%178 = load i32**, i32*** %8
store i32* %177, i32** %178
br label %186
179: ; preds = %163
%180 = load i32**, i32*** %8
%181 = load i32*, i32** %180
%182 = bitcast i32* %181 to %struct.TYPE_18__*
store %struct.TYPE_18__* %182, %struct.TYPE_18__** %15
%183 = load i32, i32* %11
%184 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%185 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %184, i32 0, i32 0
store i32 %183, i32* %185
br label %186
186: ; preds = %179, %175
%187 = load i8*, i8** %12
%188 = load i8, i8* %187
%189 = icmp ne i8 %188, 0
br i1 %189, label %190, label %202
190: ; preds = %186
%191 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%192 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %191, i32 0, i32 1
%193 = load i8*, i8** %192
%194 = call i32 @free(i8* %193)
%195 = load i8*, i8** %9
%196 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%197 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %196, i32 0, i32 1
store i8* %195, i8** %197
%198 = load i32, i32* %10
%199 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%200 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %199, i32 0, i32 2
store i32 %198, i32* %200
%201 = load i8*, i8** %12
store i8 0, i8* %201
br label %215
202: ; preds = %186
%203 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%204 = load i8*, i8** %9
%205 = load i32, i32* %10
%206 = call i32 @ASN1_STRING_set(%struct.TYPE_18__* %203, i8* %204, i32 %205)
%207 = icmp ne i32 %206, 0
br i1 %207, label %214, label %208
208: ; preds = %202
%209 = load i32, i32* @ERR_R_MALLOC_FAILURE
%210 = call i32 @ASN1error(i32 %209)
%211 = load %struct.TYPE_18__*, %struct.TYPE_18__** %15
%212 = call i32 @ASN1_STRING_free(%struct.TYPE_18__* %211)
%213 = load i32**, i32*** %8
store i32* null, i32** %213
br label %227
214: ; preds = %202
br label %215
215: ; preds = %214, %190
br label %216
216: ; preds = %215, %130, %121, %114, %100, %93
%217 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%218 = icmp ne %struct.TYPE_17__* %217, null
br i1 %218, label %219, label %226
219: ; preds = %216
%220 = load i32, i32* %11
%221 = icmp eq i32 %220, 141
br i1 %221, label %222, label %226
222: ; preds = %219
%223 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%224 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %223, i32 0, i32 1
%225 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %224, i32 0, i32 0
store i32* null, i32** %225
br label %226
226: ; preds = %222, %219, %216
store i32 1, i32* %18
br label %227
227: ; preds = %226, %208, %172, %160, %150, %129, %120, %105, %97, %92, %61
%228 = load i32, i32* %18
%229 = icmp ne i32 %228, 0
br i1 %229, label %238, label %230
230: ; preds = %227
%231 = load %struct.TYPE_17__*, %struct.TYPE_17__** %16
%232 = call i32 @ASN1_TYPE_free(%struct.TYPE_17__* %231)
%233 = load i32**, i32*** %14
%234 = icmp ne i32** %233, null
br i1 %234, label %235, label %237
235: ; preds = %230
%236 = load i32**, i32*** %14
store i32* null, i32** %236
br label %237
237: ; preds = %235, %230
br label %238
238: ; preds = %237, %227
%239 = load i32, i32* %18
store i32 %239, i32* %7
br label %240
240: ; preds = %238, %35, %34
%241 = load i32, i32* %7
ret i32 %241
}

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_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 %129, 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 %129
17: ; preds = %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 %129
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 %90 [
i32 139, label %47
i32 141, label %50
i32 148, label %56
i32 150, label %64
i32 142, label %67
i32 147, label %67
i32 149, label %78
i32 132, label %84
]
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 %125, label %129
50: ; preds = %43
%51 = icmp eq i32 %2, 0
br i1 %51, label %55, label %52
52: ; preds = %50
%53 = load i32, i32* @ASN1_R_NULL_IS_WRONG_LENGTH
%54 = tail call i32 @ASN1error(i32 %53)
br label %125
55: ; preds = %50
store i32* inttoptr (i64 1 to i32*), i32** %46
br label %119
56: ; preds = %43
%57 = icmp eq i32 %2, 1
br i1 %57, label %61, label %58
58: ; preds = %56
%59 = load i32, i32* @ASN1_R_BOOLEAN_IS_WRONG_LENGTH
%60 = tail call i32 @ASN1error(i32 %59)
br label %125
61: ; preds = %56
%62 = bitcast i32** %46 to i8*
%63 = load i8, i8* %1
store i8 %63, i8* %62
br label %129
64: ; preds = %43
%65 = call i32 @c2i_ASN1_BIT_STRING(i32** %46, i8** %7, i32 %2)
%66 = icmp eq i32 %65, 0
br i1 %66, label %125, label %129
67: ; preds = %43, %43
%68 = bitcast i32** %46 to %struct.TYPE_21__**
%69 = call i32 @c2i_ASN1_INTEGER(%struct.TYPE_21__** %68, i8** %7, i32 %2)
%70 = icmp eq i32 %69, 0
br i1 %70, label %125, label %71
71: ; preds = %67
%72 = load %struct.TYPE_21__*, %struct.TYPE_21__** %68
%73 = getelementptr inbounds %struct.TYPE_21__, %struct.TYPE_21__* %72, i64 0, i32 0
%74 = load i32, i32* %73
%75 = load i32, i32* @V_ASN1_NEG
%76 = and i32 %75, %74
%77 = or i32 %76, %3
store i32 %77, i32* %73
br label %129
78: ; preds = %43
%79 = and i32 %2, 1
%80 = icmp eq i32 %79, 0
br i1 %80, label %90, label %81
81: ; preds = %78
%82 = load i32, i32* @ASN1_R_BMPSTRING_IS_WRONG_LENGTH
%83 = tail call i32 @ASN1error(i32 %82)
br label %125
84: ; preds = %43
%85 = and i32 %2, 3
%86 = icmp eq i32 %85, 0
br i1 %86, label %90, label %87
87: ; preds = %84
%88 = load i32, i32* @ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH
%89 = tail call i32 @ASN1error(i32 %88)
br label %125
90: ; preds = %78, %43, %84
%91 = load i32*, i32** %46
%92 = icmp eq i32* %91, null
br i1 %92, label %93, label %101
93: ; preds = %90
%94 = tail call %struct.TYPE_18__* @ASN1_STRING_type_new(i32 %3)
%95 = icmp eq %struct.TYPE_18__* %94, null
br i1 %95, label %96, label %99
96: ; preds = %93
%97 = load i32, i32* @ERR_R_MALLOC_FAILURE
%98 = tail call i32 @ASN1error(i32 %97)
br label %125
99: ; preds = %93
%100 = getelementptr %struct.TYPE_18__, %struct.TYPE_18__* %94, i64 0, i32 0
store i32* %100, i32** %46
br label %103
101: ; preds = %90
%102 = bitcast i32* %91 to %struct.TYPE_18__*
store i32 %3, i32* %91
br label %103
103: ; preds = %101, %99
%104 = phi %struct.TYPE_18__* [ %102, %101 ], [ %94, %99 ]
%105 = load i8, i8* %4
%106 = icmp eq i8 %105, 0
br i1 %106, label %112, label %107
107: ; preds = %103
%108 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %104, i64 0, i32 1
%109 = load i8*, i8** %108
%110 = tail call i32 @free(i8* %109)
store i8* %1, i8** %108
%111 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %104, i64 0, i32 2
store i32 %2, i32* %111
store i8 0, i8* %4
br label %119
112: ; preds = %103
%113 = tail call i32 @ASN1_STRING_set(%struct.TYPE_18__* %104, i8* %1, i32 %2)
%114 = icmp eq i32 %113, 0
br i1 %114, label %115, label %119
115: ; preds = %112
%116 = load i32, i32* @ERR_R_MALLOC_FAILURE
%117 = tail call i32 @ASN1error(i32 %116)
%118 = tail call i32 @ASN1_STRING_free(%struct.TYPE_18__* %104)
store i32* null, i32** %46
br label %125
119: ; preds = %107, %112, %55
%120 = icmp ne %struct.TYPE_17__* %44, null
%121 = icmp eq i32 %3, 141
%122 = and i1 %121, %120
br i1 %122, label %123, label %129
123: ; preds = %119
%124 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %44, i64 0, i32 1, i32 0
store i32* null, i32** %124
br label %129
125: ; preds = %81, %87, %115, %96, %67, %64, %58, %52, %47
%126 = call i32 @ASN1_TYPE_free(%struct.TYPE_17__* %44)
%127 = icmp eq i32** %45, null
br i1 %127, label %129, label %128
128: ; preds = %125
store i32* null, i32** %45
br label %129
129: ; preds = %61, %71, %47, %64, %28, %123, %119, %128, %125, %15, %11
%130 = phi i32 [ %16, %15 ], [ 0, %11 ], [ 0, %125 ], [ 0, %128 ], [ 1, %123 ], [ 1, %119 ], [ 0, %28 ], [ 1, %64 ], [ 1, %47 ], [ 1, %71 ], [ 1, %61 ]
ret i32 %130
}