#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_12__ TYPE_3__;
typedef struct TYPE_11__ TYPE_2__;
typedef struct TYPE_10__ TYPE_1__;

/* Type definitions */
struct TYPE_12__ {
  scalar_t__ itype;
  int utype;
};
struct TYPE_11__ {
  scalar_t__ valid;
};
struct TYPE_10__ {
  long length;
  scalar_t__ *data;
  scalar_t__ max;
};
typedef TYPE_1__ BUF_MEM;
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef TYPE_2__ ASN1_TLC;
typedef TYPE_3__ ASN1_ITEM;

/* Variables and functions */
scalar_t__ ASN1_ITYPE_MSTRING;
int /*<<< orphan*/ ASN1_R_ILLEGAL_NULL;
int /*<<< orphan*/ ASN1_R_ILLEGAL_OPTIONAL_ANY;
int /*<<< orphan*/ ASN1_R_ILLEGAL_TAGGED_ANY;
int /*<<< orphan*/ ASN1_R_TYPE_NOT_CONSTRUCTED;
int /*<<< orphan*/ ASN1error(int /*<<< orphan*/);
int /*<<< orphan*/ BUF_MEM_grow_clean(TYPE_1__ *, long);
int /*<<< orphan*/ ERR_R_MALLOC_FAILURE;
int /*<<< orphan*/ ERR_R_NESTED_ASN1_ERROR;
int V_ASN1_ANY;
int V_ASN1_OTHER;
int V_ASN1_SEQUENCE;
int V_ASN1_SET;
unsigned char V_ASN1_UNIVERSAL;
int asn1_check_tlen(long *, int *, unsigned char *, char *, char *,
                    unsigned char const **, long, int, int, char, TYPE_2__ *);
int /*<<< orphan*/ asn1_collect(TYPE_1__ *, unsigned char const **, long, char,
                                int, unsigned char, int /*<<< orphan*/);
int /*<<< orphan*/ asn1_ex_c2i(int /*<<< orphan*/ **, unsigned char const *,
                               long, int, char *, TYPE_3__ const *);
int /*<<< orphan*/ asn1_find_end(unsigned char const **, long, char);
int /*<<< orphan*/ free(scalar_t__ *);
int asn1_d2i_ex_primitive(ASN1_VALUE **pval, const unsigned char **in,
                          long inlen, const ASN1_ITEM *it, int tag, int aclass,
                          char opt, ASN1_TLC *ctx) {
  int ret = 0, utype;
  long plen;
  char cst, inf, free_cont = 0;
  const unsigned char *p;
  BUF_MEM buf;
  const unsigned char *cont = NULL;
  long len;
  buf.length = 0;
  buf.max = 0;
  buf.data = NULL;
  if (!pval) {
    ASN1error(ASN1_R_ILLEGAL_NULL);
    return 0;
  }
  if (it->itype == ASN1_ITYPE_MSTRING) {
    utype = tag;
    tag = -1;
  } else
    utype = it->utype;
  if (utype == V_ASN1_ANY) {
    unsigned char oclass;
    if (tag >= 0) {
      ASN1error(ASN1_R_ILLEGAL_TAGGED_ANY);
      return 0;
    }
    if (opt) {
      ASN1error(ASN1_R_ILLEGAL_OPTIONAL_ANY);
      return 0;
    }
    p = *in;
    ret = asn1_check_tlen(NULL, &utype, &oclass, NULL, NULL, &p, inlen, -1, 0,
                          0, ctx);
    if (!ret) {
      ASN1error(ERR_R_NESTED_ASN1_ERROR);
      return 0;
    }
    if (oclass != V_ASN1_UNIVERSAL)
      utype = V_ASN1_OTHER;
  }
  if (tag == -1) {
    tag = utype;
    aclass = V_ASN1_UNIVERSAL;
  }
  p = *in;
  ret = asn1_check_tlen(&plen, NULL, NULL, &inf, &cst, &p, inlen, tag, aclass,
                        opt, ctx);
  if (!ret) {
    ASN1error(ERR_R_NESTED_ASN1_ERROR);
    return 0;
  } else if (ret == -1)
    return -1;
  ret = 0;
  if ((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) ||
      (utype == V_ASN1_OTHER)) {
    if (utype == V_ASN1_OTHER) {
      if (ctx)
        (ctx)->valid = 0;
    } else if (!cst) {
      ASN1error(ASN1_R_TYPE_NOT_CONSTRUCTED);
      return 0;
    }
    cont = *in;
    if (inf) {
      if (!asn1_find_end(&p, plen, inf))
        goto err;
      len = p - cont;
    } else {
      len = p - cont + plen;
      p += plen;
      buf.data = NULL;
    }
  } else if (cst) {
    if (!asn1_collect(&buf, &p, plen, inf, -1, V_ASN1_UNIVERSAL, 0)) {
      free_cont = 1;
      goto err;
    }
    len = buf.length;
    if (!BUF_MEM_grow_clean(&buf, len + 1)) {
      ASN1error(ERR_R_MALLOC_FAILURE);
      return 0;
    }
    buf.data[len] = 0;
    cont = (const unsigned char *)buf.data;
    free_cont = 1;
  } else {
    cont = p;
    len = plen;
    p += plen;
  }
  if (!asn1_ex_c2i(pval, cont, len, utype, &free_cont, it))
    goto err;
  *in = p;
  ret = 1;
err:
  if (free_cont && buf.data)
    free(buf.data);
  return ret;
}


x86 assembly (clang, -O0):
<asn1_d2i_ex_primitive>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0xb0,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%al
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8d,-0x3c(%rbp)
mov    %r9d,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movb   $0x0,-0x53(%rbp)
movq   $0x0,-0x80(%rbp)
movq   $0x0,-0x78(%rbp)
movq   $0x0,-0x68(%rbp)
movq   $0x0,-0x70(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11ed <asn1_d2i_ex_primitive+0x7d>
mov    0x2da6(%rip),%rax
mov    (%rax),%edi
call   1090 <ASN1error@plt>
movl   $0x0,-0x14(%rbp)
jmp    161e <asn1_d2i_ex_primitive+0x4ae>
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    0x2dbd(%rip),%rcx
cmp    (%rcx),%rax
jne    1216 <asn1_d2i_ex_primitive+0xa6>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x48(%rbp)
movl   $0xffffffff,-0x3c(%rbp)
jmp    1220 <asn1_d2i_ex_primitive+0xb0>
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%eax
mov    0x2d6e(%rip),%rcx
cmp    (%rcx),%eax
jne    1320 <asn1_d2i_ex_primitive+0x1b0>
cmpl   $0x0,-0x3c(%rbp)
jl     1256 <asn1_d2i_ex_primitive+0xe6>
mov    0x2d8d(%rip),%rax
mov    (%rax),%edi
call   1090 <ASN1error@plt>
movl   $0x0,-0x14(%rbp)
jmp    161e <asn1_d2i_ex_primitive+0x4ae>
cmpb   $0x0,0x10(%rbp)
je     127a <asn1_d2i_ex_primitive+0x10a>
mov    0x2d39(%rip),%rax
mov    (%rax),%edi
call   1090 <ASN1error@plt>
movl   $0x0,-0x14(%rbp)
jmp    161e <asn1_d2i_ex_primitive+0x4ae>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x30(%rbp),%r10
mov    0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%r8d
lea    -0x48(%rbp),%rsi
lea    -0x89(%rbp),%rdx
lea    -0x60(%rbp),%r9
xor    %ecx,%ecx
mov    %r8,%rdi
mov    %r8,%rcx
mov    %r10,(%rsp)
movl   $0xffffffff,0x8(%rsp)
ff
movl   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1040 <asn1_check_tlen@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jne    12f6 <asn1_d2i_ex_primitive+0x186>
mov    0x2ce5(%rip),%rax
mov    (%rax),%edi
call   1090 <ASN1error@plt>
movl   $0x0,-0x14(%rbp)
jmp    161e <asn1_d2i_ex_primitive+0x4ae>
movzbl -0x89(%rbp),%eax
mov    0x2cac(%rip),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
je     131b <asn1_d2i_ex_primitive+0x1ab>
mov    0x2cca(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
jmp    1320 <asn1_d2i_ex_primitive+0x1b0>
cmpl   $0xffffffff,-0x3c(%rbp)
jne    133d <asn1_d2i_ex_primitive+0x1cd>
mov    -0x48(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2c79(%rip),%rax
movzbl (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x30(%rbp),%r14
mov    -0x3c(%rbp),%ebx
mov    -0x40(%rbp),%r11d
mov    0x10(%rbp),%r10b
mov    0x18(%rbp),%rax
lea    -0x50(%rbp),%rdi
xor    %ecx,%ecx
mov    %ecx,%edx
lea    -0x52(%rbp),%rcx
lea    -0x51(%rbp),%r8
lea    -0x60(%rbp),%r9
mov    %rdx,%rsi
mov    %r14,(%rsp)
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
movsbl %r10b,%r10d
mov    %r10d,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1040 <asn1_check_tlen@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jne    13b9 <asn1_d2i_ex_primitive+0x249>
mov    0x2c22(%rip),%rax
mov    (%rax),%edi
call   1090 <ASN1error@plt>
movl   $0x0,-0x14(%rbp)
jmp    161e <asn1_d2i_ex_primitive+0x4ae>
cmpl   $0xffffffff,-0x44(%rbp)
jne    13cf <asn1_d2i_ex_primitive+0x25f>
movl   $0xffffffff,-0x14(%rbp)
jmp    161e <asn1_d2i_ex_primitive+0x4ae>
jmp    13d4 <asn1_d2i_ex_primitive+0x264>
movl   $0x0,-0x44(%rbp)
mov    -0x48(%rbp),%eax
mov    0x2ba3(%rip),%rcx
cmp    (%rcx),%eax
je     1411 <asn1_d2i_ex_primitive+0x2a1>
mov    -0x48(%rbp),%eax
mov    0x2bb1(%rip),%rcx
cmp    (%rcx),%eax
je     1411 <asn1_d2i_ex_primitive+0x2a1>
mov    -0x48(%rbp),%eax
mov    0x2bd7(%rip),%rcx
cmp    (%rcx),%eax
jne    14e1 <asn1_d2i_ex_primitive+0x371>
mov    -0x48(%rbp),%eax
mov    0x2bc5(%rip),%rcx
cmp    (%rcx),%eax
jne    143e <asn1_d2i_ex_primitive+0x2ce>
cmpq   $0x0,0x18(%rbp)
je     1439 <asn1_d2i_ex_primitive+0x2c9>
mov    0x18(%rbp),%rax
movq   $0x0,(%rax)
jmp    1467 <asn1_d2i_ex_primitive+0x2f7>
cmpb   $0x0,-0x51(%rbp)
jne    1462 <asn1_d2i_ex_primitive+0x2f2>
mov    0x2b99(%rip),%rax
mov    (%rax),%edi
call   1090 <ASN1error@plt>
movl   $0x0,-0x14(%rbp)
jmp    161e <asn1_d2i_ex_primitive+0x4ae>
jmp    1467 <asn1_d2i_ex_primitive+0x2f7>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x80(%rbp)
cmpb   $0x0,-0x52(%rbp)
je     14b2 <asn1_d2i_ex_primitive+0x342>
mov    -0x50(%rbp),%rsi
lea    -0x60(%rbp),%rdi
movsbl -0x52(%rbp),%edx
call   1080 <asn1_find_end@plt>
cmp    $0x0,%eax
jne    149b <asn1_d2i_ex_primitive+0x32b>
jmp    15f7 <asn1_d2i_ex_primitive+0x487>
mov    -0x60(%rbp),%rax
mov    -0x80(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x88(%rbp)
jmp    14dc <asn1_d2i_ex_primitive+0x36c>
mov    -0x60(%rbp),%rax
mov    -0x80(%rbp),%rcx
sub    %rcx,%rax
add    -0x50(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x50(%rbp),%rax
add    -0x60(%rbp),%rax
mov    %rax,-0x60(%rbp)
movq   $0x0,-0x70(%rbp)
jmp    15b8 <asn1_d2i_ex_primitive+0x448>
cmpb   $0x0,-0x51(%rbp)
je     1594 <asn1_d2i_ex_primitive+0x424>
mov    -0x50(%rbp),%rdx
mov    -0x52(%rbp),%cl
lea    -0x78(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0xffffffff,%r8d
xor    %eax,%eax
mov    0x2aa7(%rip),%rax
movsbl %cl,%ecx
movzbl (%rax),%r9d
movl   $0x0,(%rsp)
call   1050 <asn1_collect@plt>
cmp    $0x0,%eax
jne    152e <asn1_d2i_ex_primitive+0x3be>
movb   $0x1,-0x53(%rbp)
jmp    15f7 <asn1_d2i_ex_primitive+0x487>
mov    -0x78(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rsi
add    $0x1,%rsi
lea    -0x78(%rbp),%rdi
call   1070 <BUF_MEM_grow_clean@plt>
cmp    $0x0,%eax
jne    1570 <asn1_d2i_ex_primitive+0x400>
mov    0x2a7b(%rip),%rax
mov    (%rax),%edi
call   1090 <ASN1error@plt>
movl   $0x0,-0x14(%rbp)
jmp    161e <asn1_d2i_ex_primitive+0x4ae>
mov    -0x70(%rbp),%rax
mov    -0x88(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x70(%rbp),%rax
mov    %rax,-0x80(%rbp)
movb   $0x1,-0x53(%rbp)
jmp    15b3 <asn1_d2i_ex_primitive+0x443>
mov    -0x60(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x50(%rbp),%rax
add    -0x60(%rbp),%rax
mov    %rax,-0x60(%rbp)
jmp    15b8 <asn1_d2i_ex_primitive+0x448>
mov    -0x20(%rbp),%rdi
mov    -0x80(%rbp),%rsi
mov    -0x88(%rbp),%rdx
mov    -0x48(%rbp),%ecx
mov    -0x38(%rbp),%r9
lea    -0x53(%rbp),%r8
call   1060 <asn1_ex_c2i@plt>
cmp    $0x0,%eax
jne    15e5 <asn1_d2i_ex_primitive+0x475>
jmp    15f7 <asn1_d2i_ex_primitive+0x487>
mov    -0x60(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x44(%rbp)
movsbl -0x53(%rbp),%eax
cmp    $0x0,%eax
je     1618 <asn1_d2i_ex_primitive+0x4a8>
cmpq   $0x0,-0x70(%rbp)
je     1618 <asn1_d2i_ex_primitive+0x4a8>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    -0x44(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xb0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1_d2i_ex_primitive>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
movb   $0x0,0x9(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movq   $0x0,0x40(%rsp)
test   %rdi,%rdi
je     11e4 <asn1_d2i_ex_primitive+0x74>
mov    %r9d,%r15d
mov    %r8d,%ebp
mov    %rdx,%r13
mov    %rdi,%r12
mov    0x88(%rsp),%r10
mov    0x80(%rsp),%bl
mov    (%rcx),%rax
mov    0x2dfa(%rip),%rdx
cmp    (%rdx),%rax
jne    11f0 <asn1_d2i_ex_primitive+0x80>
mov    %ebp,0xc(%rsp)
mov    0x2dca(%rip),%rdx
mov    %ebp,%eax
cmp    %ebp,(%rdx)
mov    $0xffffffff,%ebp
jne    12ba <asn1_d2i_ex_primitive+0x14a>
mov    $0xffffffff,%ebp
jmp    1216 <asn1_d2i_ex_primitive+0xa6>
mov    0x2d95(%rip),%rax
jmp    1324 <asn1_d2i_ex_primitive+0x1b4>
mov    0x8(%rcx),%eax
mov    %eax,0xc(%rsp)
mov    0x2d9a(%rip),%rdx
cmp    (%rdx),%eax
jne    12ba <asn1_d2i_ex_primitive+0x14a>
test   %ebp,%ebp
js     1216 <asn1_d2i_ex_primitive+0xa6>
mov    0x2dbf(%rip),%rax
jmp    1324 <asn1_d2i_ex_primitive+0x1b4>
test   %bl,%bl
je     1226 <asn1_d2i_ex_primitive+0xb6>
mov    0x2d7f(%rip),%rax
jmp    1324 <asn1_d2i_ex_primitive+0x1b4>
mov    %rcx,0x28(%rsp)
mov    %rsi,0x18(%rsp)
mov    (%rsi),%rax
mov    %rax,0x10(%rsp)
sub    $0x8,%rsp
xor    %r14d,%r14d
lea    0x14(%rsp),%rsi
lea    0x28(%rsp),%rdx
lea    0x18(%rsp),%r9
xor    %edi,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
push   %r10
push   $0x0
push   $0x0
push   $0xffffffffffffffff
push   %r13
call   1040 <asn1_check_tlen@plt>
add    $0x30,%rsp
test   %eax,%eax
je     1281 <asn1_d2i_ex_primitive+0x111>
mov    0x20(%rsp),%al
mov    0x2d39(%rip),%rcx
cmp    (%rcx),%al
jne    1294 <asn1_d2i_ex_primitive+0x124>
mov    0xc(%rsp),%eax
jmp    12a1 <asn1_d2i_ex_primitive+0x131>
mov    0x2d40(%rip),%rax
mov    (%rax),%edi
call   1090 <ASN1error@plt>
jmp    132e <asn1_d2i_ex_primitive+0x1be>
mov    0x2d45(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
mov    0x18(%rsp),%rsi
mov    0x88(%rsp),%r10
mov    0x28(%rsp),%rcx
mov    0x80(%rsp),%bl
mov    %rcx,0x28(%rsp)
cmp    $0xffffffff,%ebp
mov    0x2ce7(%rip),%rcx
movzbl (%rcx),%ecx
cmove  %ecx,%r15d
cmovne %ebp,%eax
mov    %rsi,0x18(%rsp)
mov    (%rsi),%rcx
mov    %rcx,0x10(%rsp)
sub    $0x8,%rsp
movsbl %bl,%ebp
lea    0x28(%rsp),%rdi
lea    0x12(%rsp),%rcx
lea    0x13(%rsp),%r8
lea    0x18(%rsp),%r9
xor    %esi,%esi
xor    %edx,%edx
push   %r10
push   %rbp
push   %r15
push   %rax
push   %r13
call   1040 <asn1_check_tlen@plt>
add    $0x30,%rsp
mov    %eax,%r14d
cmp    $0xffffffff,%eax
je     132e <asn1_d2i_ex_primitive+0x1be>
test   %r14d,%r14d
jne    1340 <asn1_d2i_ex_primitive+0x1d0>
mov    0x2ca4(%rip),%rax
mov    (%rax),%edi
call   1090 <ASN1error@plt>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0xc(%rsp),%eax
mov    0x2c3d(%rip),%rdx
mov    0x2c8e(%rip),%rcx
mov    (%rcx),%ecx
cmp    (%rdx),%eax
je     13ed <asn1_d2i_ex_primitive+0x27d>
mov    0x2c45(%rip),%rdx
cmp    (%rdx),%eax
je     13ed <asn1_d2i_ex_primitive+0x27d>
cmp    %ecx,%eax
je     13ed <asn1_d2i_ex_primitive+0x27d>
cmpb   $0x0,0xb(%rsp)
je     1447 <asn1_d2i_ex_primitive+0x2d7>
mov    0x20(%rsp),%rdx
movsbl 0xa(%rsp),%ecx
mov    0x2c25(%rip),%rax
movzbl (%rax),%r9d
sub    $0x8,%rsp
lea    0x38(%rsp),%rdi
lea    0x18(%rsp),%rsi
mov    $0xffffffff,%r8d
push   $0x0
call   1050 <asn1_collect@plt>
add    $0x10,%rsp
test   %eax,%eax
mov    0x18(%rsp),%r14
je     14b5 <asn1_d2i_ex_primitive+0x345>
mov    0x30(%rsp),%rbp
lea    0x1(%rbp),%rsi
lea    0x30(%rsp),%rdi
call   1070 <BUF_MEM_grow_clean@plt>
test   %eax,%eax
je     14ec <asn1_d2i_ex_primitive+0x37c>
mov    0x38(%rsp),%rbx
movq   $0x0,(%rbx,%rbp,8)
movb   $0x1,0x9(%rsp)
jmp    1485 <asn1_d2i_ex_primitive+0x315>
cmp    %ecx,%eax
jne    140c <asn1_d2i_ex_primitive+0x29c>
mov    0x88(%rsp),%rax
test   %rax,%rax
mov    0x18(%rsp),%r14
je     141c <asn1_d2i_ex_primitive+0x2ac>
movq   $0x0,(%rax)
jmp    141c <asn1_d2i_ex_primitive+0x2ac>
cmpb   $0x0,0xb(%rsp)
mov    0x18(%rsp),%r14
je     14e0 <asn1_d2i_ex_primitive+0x370>
mov    (%r14),%rbx
mov    0xa(%rsp),%al
test   %al,%al
je     1461 <asn1_d2i_ex_primitive+0x2f1>
mov    0x20(%rsp),%rsi
movsbl %al,%edx
lea    0x10(%rsp),%rdi
call   1080 <asn1_find_end@plt>
test   %eax,%eax
je     14ba <asn1_d2i_ex_primitive+0x34a>
mov    0x10(%rsp),%rbp
sub    %rbx,%rbp
jmp    1485 <asn1_d2i_ex_primitive+0x315>
mov    0x10(%rsp),%rbx
mov    0x20(%rsp),%rbp
lea    (%rbx,%rbp,1),%rax
mov    %rax,0x10(%rsp)
mov    0x18(%rsp),%r14
jmp    1485 <asn1_d2i_ex_primitive+0x315>
mov    0x10(%rsp),%rax
mov    %rax,%rbp
sub    %rbx,%rbp
mov    0x20(%rsp),%rcx
add    %rcx,%rbp
add    %rcx,%rax
mov    %rax,0x10(%rsp)
movq   $0x0,0x38(%rsp)
mov    0xc(%rsp),%ecx
lea    0x9(%rsp),%r8
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    0x28(%rsp),%r9
call   1060 <asn1_ex_c2i@plt>
test   %eax,%eax
je     14ba <asn1_d2i_ex_primitive+0x34a>
mov    0x10(%rsp),%rax
mov    %rax,(%r14)
mov    $0x1,%r14d
jmp    14bd <asn1_d2i_ex_primitive+0x34d>
movb   $0x1,0x9(%rsp)
xor    %r14d,%r14d
cmpb   $0x0,0x9(%rsp)
je     132e <asn1_d2i_ex_primitive+0x1be>
mov    0x38(%rsp),%rdi
test   %rdi,%rdi
je     132e <asn1_d2i_ex_primitive+0x1be>
call   1030 <free@plt>
jmp    132e <asn1_d2i_ex_primitive+0x1be>
mov    0x2b01(%rip),%rax
jmp    1324 <asn1_d2i_ex_primitive+0x1b4>
mov    0x2ae5(%rip),%rax
jmp    1324 <asn1_d2i_ex_primitive+0x1b4>

LLVM IR (-O0):
%struct.TYPE_12__ = type { i64, i32 }
%struct.TYPE_11__ = type { i64 }
%struct.TYPE_10__ = type { i64, i64*, i64 }
@ASN1_R_ILLEGAL_NULL = global i32 0
@ASN1_ITYPE_MSTRING = global i64 0
@V_ASN1_ANY = global i32 0
@ASN1_R_ILLEGAL_TAGGED_ANY = global i32 0
@ASN1_R_ILLEGAL_OPTIONAL_ANY = global i32 0
@ERR_R_NESTED_ASN1_ERROR = global i32 0
@V_ASN1_UNIVERSAL = global i8 0
@V_ASN1_OTHER = global i32 0
@V_ASN1_SEQUENCE = global i32 0
@V_ASN1_SET = global i32 0
@ASN1_R_TYPE_NOT_CONSTRUCTED = global i32 0
@ERR_R_MALLOC_FAILURE = global i32 0
define i32 @asn1_d2i_ex_primitive(i32** %0, i8** %1, i64 %2, %struct.TYPE_12__* %3, i32 %4, i32 %5, i8 signext %6, %struct.TYPE_11__* %7) {
%9 = alloca i32
%10 = alloca i32**
%11 = alloca i8**
%12 = alloca i64
%13 = alloca %struct.TYPE_12__*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8
%17 = alloca %struct.TYPE_11__*
%18 = alloca i32
%19 = alloca i32
%20 = alloca i64
%21 = alloca i8
%22 = alloca i8
%23 = alloca i8
%24 = alloca i8*
%25 = alloca %struct.TYPE_10__
%26 = alloca i8*
%27 = alloca i64
%28 = alloca i8
store i32** %0, i32*** %10
store i8** %1, i8*** %11
store i64 %2, i64* %12
store %struct.TYPE_12__* %3, %struct.TYPE_12__** %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i8 %6, i8* %16
store %struct.TYPE_11__* %7, %struct.TYPE_11__** %17
store i32 0, i32* %18
store i8 0, i8* %23
store i8* null, i8** %26
%29 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %25, i32 0, i32 0
store i64 0, i64* %29
%30 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %25, i32 0, i32 2
store i64 0, i64* %30
%31 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %25, i32 0, i32 1
store i64* null, i64** %31
%32 = load i32**, i32*** %10
%33 = icmp ne i32** %32, null
br i1 %33, label %37, label %34
34: ; preds = %8
%35 = load i32, i32* @ASN1_R_ILLEGAL_NULL
%36 = call i32 @ASN1error(i32 %35)
store i32 0, i32* %9
br label %232
37: ; preds = %8
%38 = load %struct.TYPE_12__*, %struct.TYPE_12__** %13
%39 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %38, i32 0, i32 0
%40 = load i64, i64* %39
%41 = load i64, i64* @ASN1_ITYPE_MSTRING
%42 = icmp eq i64 %40, %41
br i1 %42, label %43, label %45
43: ; preds = %37
%44 = load i32, i32* %14
store i32 %44, i32* %19
store i32 -1, i32* %14
br label %49
45: ; preds = %37
%46 = load %struct.TYPE_12__*, %struct.TYPE_12__** %13
%47 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %46, i32 0, i32 1
%48 = load i32, i32* %47
store i32 %48, i32* %19
br label %49
49: ; preds = %45, %43
%50 = load i32, i32* %19
%51 = load i32, i32* @V_ASN1_ANY
%52 = icmp eq i32 %50, %51
br i1 %52, label %53, label %85
53: ; preds = %49
%54 = load i32, i32* %14
%55 = icmp sge i32 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %53
%57 = load i32, i32* @ASN1_R_ILLEGAL_TAGGED_ANY
%58 = call i32 @ASN1error(i32 %57)
store i32 0, i32* %9
br label %232
59: ; preds = %53
%60 = load i8, i8* %16
%61 = icmp ne i8 %60, 0
br i1 %61, label %62, label %65
62: ; preds = %59
%63 = load i32, i32* @ASN1_R_ILLEGAL_OPTIONAL_ANY
%64 = call i32 @ASN1error(i32 %63)
store i32 0, i32* %9
br label %232
65: ; preds = %59
%66 = load i8**, i8*** %11
%67 = load i8*, i8** %66
store i8* %67, i8** %24
%68 = load i64, i64* %12
%69 = load %struct.TYPE_11__*, %struct.TYPE_11__** %17
%70 = call i32 @asn1_check_tlen(i64* null, i32* %19, i8* %28, i8* null, i8* null, i8** %24, i64 %68, i32 -1, i32 0, i8 signext 0, %struct.TYPE_11__* %69)
store i32 %70, i32* %18
%71 = load i32, i32* %18
%72 = icmp ne i32 %71, 0
br i1 %72, label %76, label %73
73: ; preds = %65
%74 = load i32, i32* @ERR_R_NESTED_ASN1_ERROR
%75 = call i32 @ASN1error(i32 %74)
store i32 0, i32* %9
br label %232
76: ; preds = %65
%77 = load i8, i8* %28
%78 = zext i8 %77 to i32
%79 = load i8, i8* @V_ASN1_UNIVERSAL
%80 = zext i8 %79 to i32
%81 = icmp ne i32 %78, %80
br i1 %81, label %82, label %84
82: ; preds = %76
%83 = load i32, i32* @V_ASN1_OTHER
store i32 %83, i32* %19
br label %84
84: ; preds = %82, %76
br label %85
85: ; preds = %84, %49
%86 = load i32, i32* %14
%87 = icmp eq i32 %86, -1
br i1 %87, label %88, label %92
88: ; preds = %85
%89 = load i32, i32* %19
store i32 %89, i32* %14
%90 = load i8, i8* @V_ASN1_UNIVERSAL
%91 = zext i8 %90 to i32
store i32 %91, i32* %15
br label %92
92: ; preds = %88, %85
%93 = load i8**, i8*** %11
%94 = load i8*, i8** %93
store i8* %94, i8** %24
%95 = load i64, i64* %12
%96 = load i32, i32* %14
%97 = load i32, i32* %15
%98 = load i8, i8* %16
%99 = load %struct.TYPE_11__*, %struct.TYPE_11__** %17
%100 = call i32 @asn1_check_tlen(i64* %20, i32* null, i8* null, i8* %22, i8* %21, i8** %24, i64 %95, i32 %96, i32 %97, i8 signext %98, %struct.TYPE_11__* %99)
store i32 %100, i32* %18
%101 = load i32, i32* %18
%102 = icmp ne i32 %101, 0
br i1 %102, label %106, label %103
103: ; preds = %92
%104 = load i32, i32* @ERR_R_NESTED_ASN1_ERROR
%105 = call i32 @ASN1error(i32 %104)
store i32 0, i32* %9
br label %232
106: ; preds = %92
%107 = load i32, i32* %18
%108 = icmp eq i32 %107, -1
br i1 %108, label %109, label %110
109: ; preds = %106
store i32 -1, i32* %9
br label %232
110: ; preds = %106
br label %111
111: ; preds = %110
store i32 0, i32* %18
%112 = load i32, i32* %19
%113 = load i32, i32* @V_ASN1_SEQUENCE
%114 = icmp eq i32 %112, %113
br i1 %114, label %123, label %115
115: ; preds = %111
%116 = load i32, i32* %19
%117 = load i32, i32* @V_ASN1_SET
%118 = icmp eq i32 %116, %117
br i1 %118, label %123, label %119
119: ; preds = %115
%120 = load i32, i32* %19
%121 = load i32, i32* @V_ASN1_OTHER
%122 = icmp eq i32 %120, %121
br i1 %122, label %123, label %171
123: ; preds = %119, %115, %111
%124 = load i32, i32* %19
%125 = load i32, i32* @V_ASN1_OTHER
%126 = icmp eq i32 %124, %125
br i1 %126, label %127, label %134
127: ; preds = %123
%128 = load %struct.TYPE_11__*, %struct.TYPE_11__** %17
%129 = icmp ne %struct.TYPE_11__* %128, null
br i1 %129, label %130, label %133
130: ; preds = %127
%131 = load %struct.TYPE_11__*, %struct.TYPE_11__** %17
%132 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %131, i32 0, i32 0
store i64 0, i64* %132
br label %133
133: ; preds = %130, %127
br label %141
134: ; preds = %123
%135 = load i8, i8* %21
%136 = icmp ne i8 %135, 0
br i1 %136, label %140, label %137
137: ; preds = %134
%138 = load i32, i32* @ASN1_R_TYPE_NOT_CONSTRUCTED
%139 = call i32 @ASN1error(i32 %138)
store i32 0, i32* %9
br label %232
140: ; preds = %134
br label %141
141: ; preds = %140, %133
%142 = load i8**, i8*** %11
%143 = load i8*, i8** %142
store i8* %143, i8** %26
%144 = load i8, i8* %22
%145 = icmp ne i8 %144, 0
br i1 %145, label %146, label %158
146: ; preds = %141
%147 = load i64, i64* %20
%148 = load i8, i8* %22
%149 = call i32 @asn1_find_end(i8** %24, i64 %147, i8 signext %148)
%150 = icmp ne i32 %149, 0
br i1 %150, label %152, label %151
151: ; preds = %146
br label %218
152: ; preds = %146
%153 = load i8*, i8** %24
%154 = load i8*, i8** %26
%155 = ptrtoint i8* %153 to i64
%156 = ptrtoint i8* %154 to i64
%157 = sub i64 %155, %156
store i64 %157, i64* %27
br label %170
158: ; preds = %141
%159 = load i8*, i8** %24
%160 = load i8*, i8** %26
%161 = ptrtoint i8* %159 to i64
%162 = ptrtoint i8* %160 to i64
%163 = sub i64 %161, %162
%164 = load i64, i64* %20
%165 = add nsw i64 %163, %164
store i64 %165, i64* %27
%166 = load i64, i64* %20
%167 = load i8*, i8** %24
%168 = getelementptr inbounds i8, i8* %167, i64 %166
store i8* %168, i8** %24
%169 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %25, i32 0, i32 1
store i64* null, i64** %169
br label %170
170: ; preds = %158, %152
br label %206
171: ; preds = %119
%172 = load i8, i8* %21
%173 = icmp ne i8 %172, 0
br i1 %173, label %174, label %199
174: ; preds = %171
%175 = load i64, i64* %20
%176 = load i8, i8* %22
%177 = load i8, i8* @V_ASN1_UNIVERSAL
%178 = call i32 @asn1_collect(%struct.TYPE_10__* %25, i8** %24, i64 %175, i8 signext %176, i32 -1, i8 zeroext %177, i32 0)
%179 = icmp ne i32 %178, 0
br i1 %179, label %181, label %180
180: ; preds = %174
store i8 1, i8* %23
br label %218
181: ; preds = %174
%182 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %25, i32 0, i32 0
%183 = load i64, i64* %182
store i64 %183, i64* %27
%184 = load i64, i64* %27
%185 = add nsw i64 %184, 1
%186 = call i32 @BUF_MEM_grow_clean(%struct.TYPE_10__* %25, i64 %185)
%187 = icmp ne i32 %186, 0
br i1 %187, label %191, label %188
188: ; preds = %181
%189 = load i32, i32* @ERR_R_MALLOC_FAILURE
%190 = call i32 @ASN1error(i32 %189)
store i32 0, i32* %9
br label %232
191: ; preds = %181
%192 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %25, i32 0, i32 1
%193 = load i64*, i64** %192
%194 = load i64, i64* %27
%195 = getelementptr inbounds i64, i64* %193, i64 %194
store i64 0, i64* %195
%196 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %25, i32 0, i32 1
%197 = load i64*, i64** %196
%198 = bitcast i64* %197 to i8*
store i8* %198, i8** %26
store i8 1, i8* %23
br label %205
199: ; preds = %171
%200 = load i8*, i8** %24
store i8* %200, i8** %26
%201 = load i64, i64* %20
store i64 %201, i64* %27
%202 = load i64, i64* %20
%203 = load i8*, i8** %24
%204 = getelementptr inbounds i8, i8* %203, i64 %202
store i8* %204, i8** %24
br label %205
205: ; preds = %199, %191
br label %206
206: ; preds = %205, %170
%207 = load i32**, i32*** %10
%208 = load i8*, i8** %26
%209 = load i64, i64* %27
%210 = load i32, i32* %19
%211 = load %struct.TYPE_12__*, %struct.TYPE_12__** %13
%212 = call i32 @asn1_ex_c2i(i32** %207, i8* %208, i64 %209, i32 %210, i8* %23, %struct.TYPE_12__* %211)
%213 = icmp ne i32 %212, 0
br i1 %213, label %215, label %214
214: ; preds = %206
br label %218
215: ; preds = %206
%216 = load i8*, i8** %24
%217 = load i8**, i8*** %11
store i8* %216, i8** %217
store i32 1, i32* %18
br label %218
218: ; preds = %215, %214, %180, %151
%219 = load i8, i8* %23
%220 = sext i8 %219 to i32
%221 = icmp ne i32 %220, 0
br i1 %221, label %222, label %230
222: ; preds = %218
%223 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %25, i32 0, i32 1
%224 = load i64*, i64** %223
%225 = icmp ne i64* %224, null
br i1 %225, label %226, label %230
226: ; preds = %222
%227 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %25, i32 0, i32 1
%228 = load i64*, i64** %227
%229 = call i32 @free(i64* %228)
br label %230
230: ; preds = %226, %222, %218
%231 = load i32, i32* %18
store i32 %231, i32* %9
br label %232
232: ; preds = %230, %188, %137, %109, %103, %73, %62, %56, %34
%233 = load i32, i32* %9
ret i32 %233
}

LLVM IR (-O2):
%struct.TYPE_12__ = type { i64, i32 }
%struct.TYPE_11__ = type { i64 }
%struct.TYPE_10__ = type { i64, i64*, i64 }
@ASN1_R_ILLEGAL_NULL = global i32 0
@ASN1_ITYPE_MSTRING = global i64 0
@V_ASN1_ANY = global i32 0
@ASN1_R_ILLEGAL_TAGGED_ANY = global i32 0
@ASN1_R_ILLEGAL_OPTIONAL_ANY = global i32 0
@ERR_R_NESTED_ASN1_ERROR = global i32 0
@V_ASN1_UNIVERSAL = global i8 0
@V_ASN1_OTHER = global i32 0
@V_ASN1_SEQUENCE = global i32 0
@V_ASN1_SET = global i32 0
@ASN1_R_TYPE_NOT_CONSTRUCTED = global i32 0
@ERR_R_MALLOC_FAILURE = global i32 0
define i32 @asn1_d2i_ex_primitive(i32** %0, i8** nocapture %1, i64 %2, %struct.TYPE_12__* %3, i32 %4, i32 %5, i8 signext %6, %struct.TYPE_11__* %7) {
%9 = alloca i32
%10 = alloca i64
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8*
%15 = alloca %struct.TYPE_10__
%16 = alloca i8
%17 = bitcast i32* %9 to i8*
%18 = bitcast i64* %10 to i8*
store i8 0, i8* %13
%19 = bitcast i8** %14 to i8*
%20 = bitcast %struct.TYPE_10__* %15 to i8*
%21 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %15, i64 0, i32 0
%22 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %15, i64 0, i32 1
%23 = icmp eq i32** %0, null
%24 = bitcast %struct.TYPE_10__* %15 to i8*
br i1 %23, label %25, label %28
25: ; preds = %8
%26 = load i32, i32* @ASN1_R_ILLEGAL_NULL
%27 = tail call i32 @ASN1error(i32 %26)
br label %168
28: ; preds = %8
%29 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %3, i64 0, i32 0
%30 = load i64, i64* %29
%31 = load i64, i64* @ASN1_ITYPE_MSTRING
%32 = icmp eq i64 %30, %31
br i1 %32, label %38, label %33
33: ; preds = %28
%34 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %3, i64 0, i32 1
%35 = load i32, i32* %34
store i32 %35, i32* %9
%36 = load i32, i32* @V_ASN1_ANY
%37 = icmp eq i32 %35, %36
br i1 %37, label %42, label %70
38: ; preds = %28
store i32 %4, i32* %9
%39 = load i32, i32* @V_ASN1_ANY
%40 = icmp eq i32 %39, %4
br i1 %40, label %41, label %70
41: ; preds = %38
br label %47
42: ; preds = %33
%43 = icmp sgt i32 %4, -1
br i1 %43, label %44, label %47
44: ; preds = %42
%45 = load i32, i32* @ASN1_R_ILLEGAL_TAGGED_ANY
%46 = tail call i32 @ASN1error(i32 %45)
br label %168
47: ; preds = %41, %42
%48 = phi i32 [ -1, %41 ], [ %4, %42 ]
%49 = icmp eq i8 %6, 0
br i1 %49, label %53, label %50
50: ; preds = %47
%51 = load i32, i32* @ASN1_R_ILLEGAL_OPTIONAL_ANY
%52 = tail call i32 @ASN1error(i32 %51)
br label %168
53: ; preds = %47
%54 = load i8*, i8** %1
store i8* %54, i8** %14
%55 = call i32 @asn1_check_tlen(i64* null, i32* %9, i8* %16, i8* null, i8* null, i8** %14, i64 %2, i32 -1, i32 0, i8 signext 0, %struct.TYPE_11__* %7)
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %53
%58 = load i32, i32* @ERR_R_NESTED_ASN1_ERROR
%59 = call i32 @ASN1error(i32 %58)
br label %168
60: ; preds = %53
%61 = load i8, i8* %16
%62 = load i8, i8* @V_ASN1_UNIVERSAL
%63 = icmp eq i8 %61, %62
br i1 %63, label %64, label %66
64: ; preds = %60
%65 = load i32, i32* %9
br label %68
66: ; preds = %60
%67 = load i32, i32* @V_ASN1_OTHER
store i32 %67, i32* %9
br label %68
68: ; preds = %64, %66
%69 = phi i32 [ %65, %64 ], [ %67, %66 ]
br label %70
70: ; preds = %38, %68, %33
%71 = phi i32 [ %4, %38 ], [ %69, %68 ], [ %35, %33 ]
%72 = phi i32 [ -1, %38 ], [ %48, %68 ], [ %4, %33 ]
%73 = icmp eq i32 %72, -1
%74 = load i8, i8* @V_ASN1_UNIVERSAL
%75 = zext i8 %74 to i32
%76 = select i1 %73, i32 %75, i32 %5
%77 = select i1 %73, i32 %71, i32 %72
%78 = load i8*, i8** %1
store i8* %78, i8** %14
%79 = call i32 @asn1_check_tlen(i64* %10, i32* null, i8* null, i8* %12, i8* %11, i8** %14, i64 %2, i32 %77, i32 %76, i8 signext %6, %struct.TYPE_11__* %7)
switch i32 %79, label %83 [
i32 0, label %80
i32 -1, label %168
]
80: ; preds = %70
%81 = load i32, i32* @ERR_R_NESTED_ASN1_ERROR
%82 = call i32 @ASN1error(i32 %81)
br label %168
83: ; preds = %70
%84 = load i32, i32* %9
%85 = load i32, i32* @V_ASN1_SEQUENCE
%86 = icmp eq i32 %84, %85
%87 = load i32, i32* @V_ASN1_SET
%88 = icmp eq i32 %84, %87
%89 = select i1 %86, i1 true, i1 %88
%90 = load i32, i32* @V_ASN1_OTHER
%91 = icmp eq i32 %84, %90
%92 = select i1 %89, i1 true, i1 %91
br i1 %92, label %93, label %125
93: ; preds = %83
br i1 %91, label %94, label %98
94: ; preds = %93
%95 = icmp eq %struct.TYPE_11__* %7, null
br i1 %95, label %104, label %96
96: ; preds = %94
%97 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %7, i64 0, i32 0
store i64 0, i64* %97
br label %104
98: ; preds = %93
%99 = load i8, i8* %11
%100 = icmp eq i8 %99, 0
br i1 %100, label %101, label %104
101: ; preds = %98
%102 = load i32, i32* @ASN1_R_TYPE_NOT_CONSTRUCTED
%103 = call i32 @ASN1error(i32 %102)
br label %168
104: ; preds = %98, %94, %96
%105 = load i8*, i8** %1
%106 = load i8, i8* %12
%107 = icmp eq i8 %106, 0
br i1 %107, label %117, label %108
108: ; preds = %104
%109 = load i64, i64* %10
%110 = call i32 @asn1_find_end(i8** %14, i64 %109, i8 signext %106)
%111 = icmp eq i32 %110, 0
br i1 %111, label %159, label %112
112: ; preds = %108
%113 = load i8*, i8** %14
%114 = ptrtoint i8* %113 to i64
%115 = ptrtoint i8* %105 to i64
%116 = sub i64 %114, %115
br label %151
117: ; preds = %104
%118 = load i8*, i8** %14
%119 = ptrtoint i8* %118 to i64
%120 = ptrtoint i8* %105 to i64
%121 = sub i64 %119, %120
%122 = load i64, i64* %10
%123 = add nsw i64 %121, %122
%124 = getelementptr inbounds i8, i8* %118, i64 %122
store i8* %124, i8** %14
store i64* null, i64** %22
br label %151
125: ; preds = %83
%126 = load i8, i8* %11
%127 = icmp eq i8 %126, 0
br i1 %127, label %147, label %128
128: ; preds = %125
%129 = load i64, i64* %10
%130 = load i8, i8* %12
%131 = load i8, i8* @V_ASN1_UNIVERSAL
%132 = call i32 @asn1_collect(%struct.TYPE_10__* %15, i8** %14, i64 %129, i8 signext %130, i32 -1, i8 zeroext %131, i32 0)
%133 = icmp eq i32 %132, 0
br i1 %133, label %134, label %135
134: ; preds = %128
store i8 1, i8* %13
br label %159
135: ; preds = %128
%136 = load i64, i64* %21
%137 = add nsw i64 %136, 1
%138 = call i32 @BUF_MEM_grow_clean(%struct.TYPE_10__* %15, i64 %137)
%139 = icmp eq i32 %138, 0
br i1 %139, label %140, label %143
140: ; preds = %135
%141 = load i32, i32* @ERR_R_MALLOC_FAILURE
%142 = call i32 @ASN1error(i32 %141)
br label %168
143: ; preds = %135
%144 = load i64*, i64** %22
%145 = getelementptr inbounds i64, i64* %144, i64 %136
store i64 0, i64* %145
%146 = bitcast i64* %144 to i8*
store i8 1, i8* %13
br label %151
147: ; preds = %125
%148 = load i8*, i8** %14
%149 = load i64, i64* %10
%150 = getelementptr inbounds i8, i8* %148, i64 %149
store i8* %150, i8** %14
br label %151
151: ; preds = %143, %147, %112, %117
%152 = phi i8* [ %105, %112 ], [ %105, %117 ], [ %146, %143 ], [ %148, %147 ]
%153 = phi i64 [ %116, %112 ], [ %123, %117 ], [ %136, %143 ], [ %149, %147 ]
%154 = load i32, i32* %9
%155 = call i32 @asn1_ex_c2i(i32** %0, i8* %152, i64 %153, i32 %154, i8* %13, %struct.TYPE_12__* %3)
%156 = icmp eq i32 %155, 0
br i1 %156, label %159, label %157
157: ; preds = %151
%158 = load i8*, i8** %14
store i8* %158, i8** %1
br label %159
159: ; preds = %151, %108, %157, %134
%160 = phi i32 [ 1, %157 ], [ 0, %151 ], [ 0, %108 ], [ 0, %134 ]
%161 = load i8, i8* %13
%162 = icmp ne i8 %161, 0
%163 = load i64*, i64** %22
%164 = icmp ne i64* %163, null
%165 = select i1 %162, i1 %164, i1 false
br i1 %165, label %166, label %168
166: ; preds = %159
%167 = call i32 @free(i64* %163)
br label %168
168: ; preds = %159, %166, %70, %44, %50, %57, %140, %101, %80, %25
%169 = phi i32 [ 0, %101 ], [ 0, %140 ], [ 0, %80 ], [ 0, %25 ], [ 0, %57 ], [ 0, %50 ], [ 0, %44 ], [ %79, %70 ], [ %160, %166 ], [ %160, %159 ]
ret i32 %169
}