#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_15__ TYPE_5__;
typedef struct TYPE_14__ TYPE_4__;
typedef struct TYPE_13__ TYPE_3__;
typedef struct TYPE_12__ TYPE_2__;
typedef struct TYPE_11__ TYPE_1__;

/* Type definitions */
struct TYPE_15__ {
  scalar_t__ itype;
  int utype;
  int /*<<< orphan*/ size;
  TYPE_4__ *funcs;
};
struct TYPE_14__ {
  int (*prim_new)(int /*<<< orphan*/ **, TYPE_5__ const *);
};
struct TYPE_13__ {
  int type;
  int /*<<< orphan*/ flags;
};
struct TYPE_11__ {
  int /*<<< orphan*/ *ptr;
};
struct TYPE_12__ {
  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 TYPE_5__ ASN1_ITEM;
typedef int /*<<< orphan*/ ASN1_BOOLEAN;

/* Variables and functions */
scalar_t__ ASN1_ITYPE_MSTRING;
int /*<<< orphan*/ ASN1_STRING_FLAG_EMBED;
int /*<<< orphan*/ ASN1_STRING_FLAG_MSTRING;
TYPE_3__ *ASN1_STRING_type_new(int);
int /*<<< orphan*/ NID_undef;
scalar_t__ OBJ_nid2obj(int /*<<< orphan*/);
TYPE_2__ *OPENSSL_malloc(int);
#define V_ASN1_ANY 131
#define V_ASN1_BOOLEAN 130
#define V_ASN1_NULL 129
#define V_ASN1_OBJECT 128
int /*<<< orphan*/ memset(TYPE_3__ *, int /*<<< orphan*/, int);
int stub1(int /*<<< orphan*/ **, TYPE_5__ const *);
int asn1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed) {
  ASN1_TYPE *typ;
  ASN1_STRING *str;
  int utype;
  if (!it)
    return 0;
  if (it->funcs) {
    const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
    if (pf->prim_new)
      return pf->prim_new(pval, it);
  }
  if (it->itype == ASN1_ITYPE_MSTRING)
    utype = -1;
  else
    utype = it->utype;
  switch (utype) {
  case V_ASN1_OBJECT:
    *pval = (ASN1_VALUE *)OBJ_nid2obj(NID_undef);
    return 1;
  case V_ASN1_BOOLEAN:
    *(ASN1_BOOLEAN *)pval = it->size;
    return 1;
  case V_ASN1_NULL:
    *pval = (ASN1_VALUE *)1;
    return 1;
  case V_ASN1_ANY:
    typ = OPENSSL_malloc(sizeof(*typ));
    if (typ == NULL)
      return 0;
    typ->value.ptr = NULL;
    typ->type = -1;
    *pval = (ASN1_VALUE *)typ;
    break;
  default:
    if (embed) {
      str = *(ASN1_STRING **)pval;
      memset(str, 0, sizeof(*str));
      str->type = utype;
      str->flags = ASN1_STRING_FLAG_EMBED;
    } else {
      str = ASN1_STRING_type_new(utype);
      *pval = (ASN1_VALUE *)str;
    }
    if (it->itype == ASN1_ITYPE_MSTRING && str)
      str->flags |= ASN1_STRING_FLAG_MSTRING;
    break;
  }
  if (*pval)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<asn1_primitive_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116a <asn1_primitive_new+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    135c <asn1_primitive_new+0x21c>
mov    -0x18(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     11b1 <asn1_primitive_new+0x71>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmpq   $0x0,(%rax)
je     11ac <asn1_primitive_new+0x6c>
mov    -0x40(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   *%rax
mov    %eax,-0x4(%rbp)
jmp    135c <asn1_primitive_new+0x21c>
jmp    11b1 <asn1_primitive_new+0x71>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2e11(%rip),%rcx
cmp    (%rcx),%rax
jne    11d4 <asn1_primitive_new+0x94>
movl   $0xffffffff,-0x34(%rbp)
jmp    11de <asn1_primitive_new+0x9e>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0x3,%eax
ja     12a7 <asn1_primitive_new+0x167>
mov    -0x48(%rbp),%rax
lea    0xe02(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2dba(%rip),%rax
mov    (%rax),%edi
call   1030 <OBJ_nid2obj@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    135c <asn1_primitive_new+0x21c>
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    135c <asn1_primitive_new+0x21c>
mov    -0x10(%rbp),%rax
mov    $0x1,%ecx
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    135c <asn1_primitive_new+0x21c>
mov    $0x10,%edi
call   1050 <OPENSSL_malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1281 <asn1_primitive_new+0x141>
movl   $0x0,-0x4(%rbp)
jmp    135c <asn1_primitive_new+0x21c>
mov    -0x28(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0x28(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    133b <asn1_primitive_new+0x1fb>
cmpl   $0x0,-0x1c(%rbp)
je     12ea <asn1_primitive_new+0x1aa>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    -0x34(%rbp),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2d0c(%rip),%rax
mov    (%rax),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,0x4(%rax)
jmp    1301 <asn1_primitive_new+0x1c1>
mov    -0x34(%rbp),%edi
call   1060 <ASN1_STRING_type_new@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2cc1(%rip),%rcx
cmp    (%rcx),%rax
jne    1336 <asn1_primitive_new+0x1f6>
cmpq   $0x0,-0x30(%rbp)
je     1336 <asn1_primitive_new+0x1f6>
mov    0x2cb6(%rip),%rax
mov    (%rax),%ecx
mov    -0x30(%rbp),%rax
or     0x4(%rax),%ecx
mov    %ecx,0x4(%rax)
jmp    133b <asn1_primitive_new+0x1fb>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1355 <asn1_primitive_new+0x215>
movl   $0x1,-0x4(%rbp)
jmp    135c <asn1_primitive_new+0x21c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1_primitive_new>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %ebp,%ebp
test   %rsi,%rsi
je     121f <asn1_primitive_new+0xdf>
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x10(%rsi),%rax
test   %rax,%rax
je     117a <asn1_primitive_new+0x3a>
mov    (%rax),%rax
test   %rax,%rax
je     117a <asn1_primitive_new+0x3a>
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    *%rax
mov    (%rbx),%rax
mov    0x2e4c(%rip),%r12
mov    $0xffffffff,%r15d
cmp    (%r12),%rax
jne    11b8 <asn1_primitive_new+0x78>
test   %edx,%edx
je     11ed <asn1_primitive_new+0xad>
mov    (%r14),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    %r15d,0x0(%rbp)
mov    0x2e37(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rbp)
jmp    11fb <asn1_primitive_new+0xbb>
mov    0x8(%rbx),%r15d
lea    -0x80(%r15),%eax
cmp    $0x3,%eax
ja     1190 <asn1_primitive_new+0x50>
lea    0xe34(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2dec(%rip),%rax
mov    (%rax),%edi
call   1030 <OBJ_nid2obj@plt>
mov    %rax,(%r14)
mov    $0x1,%ebp
jmp    121f <asn1_primitive_new+0xdf>
mov    %r15d,%edi
call   1060 <ASN1_STRING_type_new@plt>
mov    %rax,%rbp
mov    %rax,(%r14)
mov    (%rbx),%rax
cmp    (%r12),%rax
jne    1215 <asn1_primitive_new+0xd5>
test   %rbp,%rbp
je     1215 <asn1_primitive_new+0xd5>
mov    0x2dd0(%rip),%rax
mov    (%rax),%eax
or     %eax,0x4(%rbp)
xor    %ebp,%ebp
cmpq   $0x0,(%r14)
setne  %bpl
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
movq   $0x1,(%r14)
mov    $0x1,%ebp
jmp    121f <asn1_primitive_new+0xdf>
mov    0xc(%rbx),%eax
mov    %eax,(%r14)
mov    $0x1,%ebp
jmp    121f <asn1_primitive_new+0xdf>
mov    $0x10,%edi
call   1050 <OPENSSL_malloc@plt>
test   %rax,%rax
je     121f <asn1_primitive_new+0xdf>
movq   $0x0,0x8(%rax)
movl   $0xffffffff,(%rax)
mov    %rax,(%r14)
jmp    1215 <asn1_primitive_new+0xd5>

LLVM IR (-O0):
%struct.TYPE_15__ = type { i64, i32, i32, %struct.TYPE_14__* }
%struct.TYPE_14__ = type { i32 (i32**, %struct.TYPE_15__*)* }
%struct.TYPE_12__ = type { i32, %struct.TYPE_11__ }
%struct.TYPE_11__ = type { i32* }
%struct.TYPE_13__ = type { i32, i32 }
@ASN1_ITYPE_MSTRING = global i64 0
@NID_undef = global i32 0
@ASN1_STRING_FLAG_EMBED = global i32 0
@ASN1_STRING_FLAG_MSTRING = global i32 0
define i32 @asn1_primitive_new(i32** %0, %struct.TYPE_15__* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32**
%6 = alloca %struct.TYPE_15__*
%7 = alloca i32
%8 = alloca %struct.TYPE_12__*
%9 = alloca %struct.TYPE_13__*
%10 = alloca i32
%11 = alloca %struct.TYPE_14__*
store i32** %0, i32*** %5
store %struct.TYPE_15__* %1, %struct.TYPE_15__** %6
store i32 %2, i32* %7
%12 = load %struct.TYPE_15__*, %struct.TYPE_15__** %6
%13 = icmp ne %struct.TYPE_15__* %12, null
br i1 %13, label %15, label %14
14: ; preds = %3
store i32 0, i32* %4
br label %119
15: ; preds = %3
%16 = load %struct.TYPE_15__*, %struct.TYPE_15__** %6
%17 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %16, i32 0, i32 3
%18 = load %struct.TYPE_14__*, %struct.TYPE_14__** %17
%19 = icmp ne %struct.TYPE_14__* %18, null
br i1 %19, label %20, label %36
20: ; preds = %15
%21 = load %struct.TYPE_15__*, %struct.TYPE_15__** %6
%22 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %21, i32 0, i32 3
%23 = load %struct.TYPE_14__*, %struct.TYPE_14__** %22
store %struct.TYPE_14__* %23, %struct.TYPE_14__** %11
%24 = load %struct.TYPE_14__*, %struct.TYPE_14__** %11
%25 = getelementptr inbounds %struct.TYPE_14__, %struct.TYPE_14__* %24, i32 0, i32 0
%26 = load i32 (i32**, %struct.TYPE_15__*)*, i32 (i32**, %struct.TYPE_15__*)** %25
%27 = icmp ne i32 (i32**, %struct.TYPE_15__*)* %26, null
br i1 %27, label %28, label %35
28: ; preds = %20
%29 = load %struct.TYPE_14__*, %struct.TYPE_14__** %11
%30 = getelementptr inbounds %struct.TYPE_14__, %struct.TYPE_14__* %29, i32 0, i32 0
%31 = load i32 (i32**, %struct.TYPE_15__*)*, i32 (i32**, %struct.TYPE_15__*)** %30
%32 = load i32**, i32*** %5
%33 = load %struct.TYPE_15__*, %struct.TYPE_15__** %6
%34 = call i32 %31(i32** %32, %struct.TYPE_15__* %33)
store i32 %34, i32* %4
br label %119
35: ; preds = %20
br label %36
36: ; preds = %35, %15
%37 = load %struct.TYPE_15__*, %struct.TYPE_15__** %6
%38 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %37, i32 0, i32 0
%39 = load i64, i64* %38
%40 = load i64, i64* @ASN1_ITYPE_MSTRING
%41 = icmp eq i64 %39, %40
br i1 %41, label %42, label %43
42: ; preds = %36
store i32 -1, i32* %10
br label %47
43: ; preds = %36
%44 = load %struct.TYPE_15__*, %struct.TYPE_15__** %6
%45 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %44, i32 0, i32 1
%46 = load i32, i32* %45
store i32 %46, i32* %10
br label %47
47: ; preds = %43, %42
%48 = load i32, i32* %10
switch i32 %48, label %76 [
i32 128, label %49
i32 130, label %54
i32 129, label %60
i32 131, label %62
]
49: ; preds = %47
%50 = load i32, i32* @NID_undef
%51 = call i64 @OBJ_nid2obj(i32 %50)
%52 = inttoptr i64 %51 to i32*
%53 = load i32**, i32*** %5
store i32* %52, i32** %53
store i32 1, i32* %4
br label %119
54: ; preds = %47
%55 = load %struct.TYPE_15__*, %struct.TYPE_15__** %6
%56 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %55, i32 0, i32 2
%57 = load i32, i32* %56
%58 = load i32**, i32*** %5
%59 = bitcast i32** %58 to i32*
store i32 %57, i32* %59
store i32 1, i32* %4
br label %119
60: ; preds = %47
%61 = load i32**, i32*** %5
store i32* inttoptr (i64 1 to i32*), i32** %61
store i32 1, i32* %4
br label %119
62: ; preds = %47
%63 = call %struct.TYPE_12__* @OPENSSL_malloc(i32 16)
store %struct.TYPE_12__* %63, %struct.TYPE_12__** %8
%64 = load %struct.TYPE_12__*, %struct.TYPE_12__** %8
%65 = icmp eq %struct.TYPE_12__* %64, null
br i1 %65, label %66, label %67
66: ; preds = %62
store i32 0, i32* %4
br label %119
67: ; preds = %62
%68 = load %struct.TYPE_12__*, %struct.TYPE_12__** %8
%69 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %68, i32 0, i32 1
%70 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %69, i32 0, i32 0
store i32* null, i32** %70
%71 = load %struct.TYPE_12__*, %struct.TYPE_12__** %8
%72 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %71, i32 0, i32 0
store i32 -1, i32* %72
%73 = load %struct.TYPE_12__*, %struct.TYPE_12__** %8
%74 = bitcast %struct.TYPE_12__* %73 to i32*
%75 = load i32**, i32*** %5
store i32* %74, i32** %75
br label %113
76: ; preds = %47
%77 = load i32, i32* %7
%78 = icmp ne i32 %77, 0
br i1 %78, label %79, label %91
79: ; preds = %76
%80 = load i32**, i32*** %5
%81 = bitcast i32** %80 to %struct.TYPE_13__**
%82 = load %struct.TYPE_13__*, %struct.TYPE_13__** %81
store %struct.TYPE_13__* %82, %struct.TYPE_13__** %9
%83 = load %struct.TYPE_13__*, %struct.TYPE_13__** %9
%84 = call i32 @memset(%struct.TYPE_13__* %83, i32 0, i32 8)
%85 = load i32, i32* %10
%86 = load %struct.TYPE_13__*, %struct.TYPE_13__** %9
%87 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %86, i32 0, i32 0
store i32 %85, i32* %87
%88 = load i32, i32* @ASN1_STRING_FLAG_EMBED
%89 = load %struct.TYPE_13__*, %struct.TYPE_13__** %9
%90 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %89, i32 0, i32 1
store i32 %88, i32* %90
br label %97
91: ; preds = %76
%92 = load i32, i32* %10
%93 = call %struct.TYPE_13__* @ASN1_STRING_type_new(i32 %92)
store %struct.TYPE_13__* %93, %struct.TYPE_13__** %9
%94 = load %struct.TYPE_13__*, %struct.TYPE_13__** %9
%95 = bitcast %struct.TYPE_13__* %94 to i32*
%96 = load i32**, i32*** %5
store i32* %95, i32** %96
br label %97
97: ; preds = %91, %79
%98 = load %struct.TYPE_15__*, %struct.TYPE_15__** %6
%99 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %98, i32 0, i32 0
%100 = load i64, i64* %99
%101 = load i64, i64* @ASN1_ITYPE_MSTRING
%102 = icmp eq i64 %100, %101
br i1 %102, label %103, label %112
103: ; preds = %97
%104 = load %struct.TYPE_13__*, %struct.TYPE_13__** %9
%105 = icmp ne %struct.TYPE_13__* %104, null
br i1 %105, label %106, label %112
106: ; preds = %103
%107 = load i32, i32* @ASN1_STRING_FLAG_MSTRING
%108 = load %struct.TYPE_13__*, %struct.TYPE_13__** %9
%109 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %108, i32 0, i32 1
%110 = load i32, i32* %109
%111 = or i32 %110, %107
store i32 %111, i32* %109
br label %112
112: ; preds = %106, %103, %97
br label %113
113: ; preds = %112, %67
%114 = load i32**, i32*** %5
%115 = load i32*, i32** %114
%116 = icmp ne i32* %115, null
br i1 %116, label %117, label %118
117: ; preds = %113
store i32 1, i32* %4
br label %119
118: ; preds = %113
store i32 0, i32* %4
br label %119
119: ; preds = %118, %117, %66, %60, %54, %49, %28, %14
%120 = load i32, i32* %4
ret i32 %120
}

LLVM IR (-O2):
%struct.TYPE_15__ = type { i64, i32, i32, %struct.TYPE_14__* }
%struct.TYPE_14__ = type { i32 (i32**, %struct.TYPE_15__*)* }
%struct.TYPE_12__ = type { i32, %struct.TYPE_11__ }
%struct.TYPE_11__ = type { i32* }
%struct.TYPE_13__ = type { i32, i32 }
@ASN1_ITYPE_MSTRING = global i64 0
@NID_undef = global i32 0
@ASN1_STRING_FLAG_EMBED = global i32 0
@ASN1_STRING_FLAG_MSTRING = global i32 0
define i32 @asn1_primitive_new(i32** %0, %struct.TYPE_15__* %1, i32 %2) {
%4 = icmp eq %struct.TYPE_15__* %1, null
br i1 %4, label %67, label %5
5: ; preds = %3
%6 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %1, i64 0, i32 3
%7 = load %struct.TYPE_14__*, %struct.TYPE_14__** %6
%8 = icmp eq %struct.TYPE_14__* %7, null
br i1 %8, label %15, label %9
9: ; preds = %5
%10 = getelementptr inbounds %struct.TYPE_14__, %struct.TYPE_14__* %7, i64 0, i32 0
%11 = load i32 (i32**, %struct.TYPE_15__*)*, i32 (i32**, %struct.TYPE_15__*)** %10
%12 = icmp eq i32 (i32**, %struct.TYPE_15__*)* %11, null
br i1 %12, label %15, label %13
13: ; preds = %9
%14 = tail call i32 %11(i32** %0, %struct.TYPE_15__* %1)
br label %67
15: ; preds = %9, %5
%16 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %1, i64 0, i32 0
%17 = load i64, i64* %16
%18 = load i64, i64* @ASN1_ITYPE_MSTRING
%19 = icmp eq i64 %17, %18
br i1 %19, label %38, label %20
20: ; preds = %15
%21 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %1, i64 0, i32 1
%22 = load i32, i32* %21
switch i32 %22, label %38 [
i32 128, label %23
i32 130, label %27
i32 129, label %31
i32 131, label %32
]
23: ; preds = %20
%24 = load i32, i32* @NID_undef
%25 = tail call i64 @OBJ_nid2obj(i32 %24)
%26 = inttoptr i64 %25 to i32*
store i32* %26, i32** %0
br label %67
27: ; preds = %20
%28 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %1, i64 0, i32 2
%29 = load i32, i32* %28
%30 = bitcast i32** %0 to i32*
store i32 %29, i32* %30
br label %67
31: ; preds = %20
store i32* inttoptr (i64 1 to i32*), i32** %0
br label %67
32: ; preds = %20
%33 = tail call %struct.TYPE_12__* @OPENSSL_malloc(i32 16)
%34 = icmp eq %struct.TYPE_12__* %33, null
br i1 %34, label %67, label %35
35: ; preds = %32
%36 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %33, i64 0, i32 1, i32 0
store i32* null, i32** %36
%37 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %33, i64 0, i32 0
store i32 -1, i32* %37
store i32* %37, i32** %0
br label %63
38: ; preds = %15, %20
%39 = phi i32 [ %22, %20 ], [ -1, %15 ]
%40 = icmp eq i32 %2, 0
br i1 %40, label %48, label %41
41: ; preds = %38
%42 = bitcast i32** %0 to %struct.TYPE_13__**
%43 = load %struct.TYPE_13__*, %struct.TYPE_13__** %42
%44 = tail call i32 @memset(%struct.TYPE_13__* %43, i32 0, i32 8)
%45 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %43, i64 0, i32 0
store i32 %39, i32* %45
%46 = load i32, i32* @ASN1_STRING_FLAG_EMBED
%47 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %43, i64 0, i32 1
store i32 %46, i32* %47
br label %51
48: ; preds = %38
%49 = tail call %struct.TYPE_13__* @ASN1_STRING_type_new(i32 %39)
%50 = getelementptr %struct.TYPE_13__, %struct.TYPE_13__* %49, i64 0, i32 0
store i32* %50, i32** %0
br label %51
51: ; preds = %48, %41
%52 = phi %struct.TYPE_13__* [ %43, %41 ], [ %49, %48 ]
%53 = load i64, i64* %16
%54 = load i64, i64* @ASN1_ITYPE_MSTRING
%55 = icmp eq i64 %53, %54
%56 = icmp ne %struct.TYPE_13__* %52, null
%57 = select i1 %55, i1 %56, i1 false
br i1 %57, label %58, label %63
58: ; preds = %51
%59 = load i32, i32* @ASN1_STRING_FLAG_MSTRING
%60 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %52, i64 0, i32 1
%61 = load i32, i32* %60
%62 = or i32 %61, %59
store i32 %62, i32* %60
br label %63
63: ; preds = %51, %58, %35
%64 = load i32*, i32** %0
%65 = icmp ne i32* %64, null
%66 = zext i1 %65 to i32
br label %67
67: ; preds = %13, %63, %32, %3, %31, %27, %23
%68 = phi i32 [ 1, %31 ], [ 1, %27 ], [ 1, %23 ], [ %14, %13 ], [ 0, %3 ], [ 0, %32 ], [ %66, %63 ]
ret i32 %68
}