#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_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int flags;
  int /*<<< orphan*/ tag;
};
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_TLC;
typedef TYPE_1__ ASN1_TEMPLATE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_F_ASN1_TEMPLATE_EX_D2I;
int /*<<< orphan*/ ASN1_R_EXPLICIT_LENGTH_MISMATCH;
int /*<<< orphan*/ ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED;
int /*<<< orphan*/ ASN1_R_MISSING_EOC;
int ASN1_TFLG_EXPTAG;
int ASN1_TFLG_TAG_CLASS;
int /*<<< orphan*/ ASN1err(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ ERR_R_NESTED_ASN1_ERROR;
int /*<<< orphan*/ asn1_check_eoc(unsigned char const **, long);
int asn1_check_tlen(long *, int /*<<< orphan*/ *, int /*<<< orphan*/ *, char *,
                    char *, unsigned char const **, long, int /*<<< orphan*/,
                    int, char, int /*<<< orphan*/ *);
int asn1_template_noexp_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                            TYPE_1__ const *, char, int /*<<< orphan*/ *, int);
int asn1_template_ex_d2i(ASN1_VALUE **val, const unsigned char **in, long inlen,
                         const ASN1_TEMPLATE *tt, char opt, ASN1_TLC *ctx,
                         int depth) {
  int flags, aclass;
  int ret;
  long len;
  const unsigned char *p, *q;
  char exp_eoc;
  if (!val)
    return 0;
  flags = tt->flags;
  aclass = flags & ASN1_TFLG_TAG_CLASS;
  p = *in;
  if (flags & ASN1_TFLG_EXPTAG) {
    char cst;
    ret = asn1_check_tlen(&len, NULL, NULL, &exp_eoc, &cst, &p, inlen, tt->tag,
                          aclass, opt, ctx);
    q = p;
    if (!ret) {
      ASN1err(ASN1_F_ASN1_TEMPLATE_EX_D2I, ERR_R_NESTED_ASN1_ERROR);
      return 0;
    } else if (ret == -1)
      return -1;
    if (!cst) {
      ASN1err(ASN1_F_ASN1_TEMPLATE_EX_D2I, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED);
      return 0;
    }
    ret = asn1_template_noexp_d2i(val, &p, len, tt, 0, ctx, depth);
    if (!ret) {
      ASN1err(ASN1_F_ASN1_TEMPLATE_EX_D2I, ERR_R_NESTED_ASN1_ERROR);
      return 0;
    }
    len -= p - q;
    if (exp_eoc) {
      if (!asn1_check_eoc(&p, len)) {
        ASN1err(ASN1_F_ASN1_TEMPLATE_EX_D2I, ASN1_R_MISSING_EOC);
        goto err;
      }
    } else {
      if (len) {
        ASN1err(ASN1_F_ASN1_TEMPLATE_EX_D2I, ASN1_R_EXPLICIT_LENGTH_MISMATCH);
        goto err;
      }
    }
  } else
    return asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx, depth);
  *in = p;
  return 1;
err:
  return 0;
}


x86 assembly (clang, -O0):
<asn1_template_ex_d2i>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x90,%rsp
mov    %r8b,%al
mov    0x10(%rbp),%r8d
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %al,-0x39(%rbp)
mov    %r9,-0x48(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1183 <asn1_template_ex_d2i+0x43>
movl   $0x0,-0x14(%rbp)
jmp    13b0 <asn1_template_ex_d2i+0x270>
mov    -0x38(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    0x2e42(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x68(%rbp)
mov    -0x4c(%rbp),%eax
mov    0x2e00(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1363 <asn1_template_ex_d2i+0x223>
mov    -0x30(%rbp),%r14
mov    -0x38(%rbp),%rax
mov    0x4(%rax),%ebx
mov    -0x50(%rbp),%r11d
mov    -0x39(%rbp),%r10b
mov    -0x48(%rbp),%rax
lea    -0x60(%rbp),%rdi
xor    %ecx,%ecx
mov    %ecx,%edx
lea    -0x71(%rbp),%rcx
lea    -0x72(%rbp),%r8
lea    -0x68(%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   1030 <asn1_check_tlen@plt>
mov    %eax,-0x54(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,-0x70(%rbp)
cmpl   $0x0,-0x54(%rbp)
jne    1241 <asn1_template_ex_d2i+0x101>
mov    0x2da3(%rip),%rax
mov    (%rax),%edi
mov    0x2da2(%rip),%rax
mov    (%rax),%esi
call   1040 <ASN1err@plt>
movl   $0x0,-0x14(%rbp)
jmp    13b0 <asn1_template_ex_d2i+0x270>
cmpl   $0xffffffff,-0x54(%rbp)
jne    1257 <asn1_template_ex_d2i+0x117>
movl   $0xffffffff,-0x14(%rbp)
jmp    13b0 <asn1_template_ex_d2i+0x270>
jmp    125c <asn1_template_ex_d2i+0x11c>
cmpb   $0x0,-0x72(%rbp)
jne    1289 <asn1_template_ex_d2i+0x149>
mov    0x2d5b(%rip),%rax
mov    (%rax),%edi
mov    0x2d42(%rip),%rax
mov    (%rax),%esi
call   1040 <ASN1err@plt>
movl   $0x0,-0x14(%rbp)
jmp    13b0 <asn1_template_ex_d2i+0x270>
mov    -0x20(%rbp),%rdi
mov    -0x60(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x48(%rbp),%r9
mov    0x10(%rbp),%eax
lea    -0x68(%rbp),%rsi
xor    %r8d,%r8d
mov    %eax,(%rsp)
call   1060 <asn1_template_noexp_d2i@plt>
mov    %eax,-0x54(%rbp)
cmpl   $0x0,-0x54(%rbp)
jne    12db <asn1_template_ex_d2i+0x19b>
mov    0x2d09(%rip),%rax
mov    (%rax),%edi
mov    0x2d08(%rip),%rax
mov    (%rax),%esi
call   1040 <ASN1err@plt>
movl   $0x0,-0x14(%rbp)
jmp    13b0 <asn1_template_ex_d2i+0x270>
mov    -0x68(%rbp),%rcx
mov    -0x70(%rbp),%rax
sub    %rax,%rcx
mov    -0x60(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x60(%rbp)
cmpb   $0x0,-0x71(%rbp)
je     1332 <asn1_template_ex_d2i+0x1f2>
mov    -0x60(%rbp),%rsi
lea    -0x68(%rbp),%rdi
call   1050 <asn1_check_eoc@plt>
cmp    $0x0,%eax
jne    132d <asn1_template_ex_d2i+0x1ed>
mov    0x2cb0(%rip),%rax
mov    (%rax),%edi
mov    0x2cbf(%rip),%rax
mov    (%rax),%esi
call   1040 <ASN1err@plt>
jmp    13a9 <asn1_template_ex_d2i+0x269>
jmp    135e <asn1_template_ex_d2i+0x21e>
cmpq   $0x0,-0x60(%rbp)
je     1359 <asn1_template_ex_d2i+0x219>
mov    0x2c84(%rip),%rax
mov    (%rax),%edi
mov    0x2c9b(%rip),%rax
mov    (%rax),%esi
call   1040 <ASN1err@plt>
jmp    13a9 <asn1_template_ex_d2i+0x269>
jmp    135e <asn1_template_ex_d2i+0x21e>
jmp    1392 <asn1_template_ex_d2i+0x252>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x39(%rbp),%r8b
mov    -0x48(%rbp),%r9
mov    0x10(%rbp),%eax
movsbl %r8b,%r8d
mov    %eax,(%rsp)
call   1060 <asn1_template_noexp_d2i@plt>
mov    %eax,-0x14(%rbp)
jmp    13b0 <asn1_template_ex_d2i+0x270>
mov    -0x68(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x14(%rbp)
jmp    13b0 <asn1_template_ex_d2i+0x270>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x90,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1_template_ex_d2i>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
test   %rdi,%rdi
je     128f <asn1_template_ex_d2i+0x14f>
mov    %r9,%r15
mov    %rcx,%r12
mov    %rdx,%rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x60(%rsp),%r13d
mov    (%rcx),%ecx
mov    0x2e64(%rip),%rdx
mov    (%rdx),%ebp
mov    (%rsi),%rdx
mov    %rdx,0x10(%rsp)
mov    0x2e2b(%rip),%rdx
test   %ecx,(%rdx)
je     1250 <asn1_template_ex_d2i+0x110>
and    %ecx,%ebp
mov    0x4(%r12),%r10d
sub    $0x8,%rsp
movsbl %r8b,%r11d
lea    0x20(%rsp),%rdi
lea    0x17(%rsp),%rcx
lea    0x16(%rsp),%r8
lea    0x18(%rsp),%r9
xor    %esi,%esi
xor    %edx,%edx
push   %r15
push   %r11
push   %rbp
push   %r10
push   %rax
call   1030 <asn1_check_tlen@plt>
add    $0x30,%rsp
cmp    $0xffffffff,%eax
je     1291 <asn1_template_ex_d2i+0x151>
mov    %r13,%rbp
mov    0x2df8(%rip),%r13
test   %eax,%eax
je     127d <asn1_template_ex_d2i+0x13d>
cmpb   $0x0,0xe(%rsp)
je     1276 <asn1_template_ex_d2i+0x136>
mov    0x10(%rsp),%rax
mov    %rax,0x20(%rsp)
mov    0x18(%rsp),%rdx
sub    $0x8,%rsp
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
mov    %r12,%rcx
xor    %r8d,%r8d
mov    %r15,%r9
push   %rbp
call   1060 <asn1_template_noexp_d2i@plt>
add    $0x10,%rsp
test   %eax,%eax
je     127d <asn1_template_ex_d2i+0x13d>
mov    0x10(%rsp),%rax
mov    0x20(%rsp),%rsi
sub    %rax,%rsi
add    0x18(%rsp),%rsi
mov    %rsi,0x18(%rsp)
cmpb   $0x0,0xf(%rsp)
je     12a0 <asn1_template_ex_d2i+0x160>
lea    0x10(%rsp),%rdi
call   1050 <asn1_check_eoc@plt>
test   %eax,%eax
je     12b8 <asn1_template_ex_d2i+0x178>
mov    0x10(%rsp),%rax
jmp    12ae <asn1_template_ex_d2i+0x16e>
movsbl %r8b,%r8d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
mov    %r12,%rcx
mov    %r15,%r9
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <asn1_template_noexp_d2i@plt>
mov    0x2d3b(%rip),%r13
mov    0x2d44(%rip),%rax
mov    (%rax),%edi
mov    0x0(%r13),%esi
call   1040 <ASN1err@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
test   %rsi,%rsi
je     12ae <asn1_template_ex_d2i+0x16e>
mov    0x2d3c(%rip),%rax
jmp    12bf <asn1_template_ex_d2i+0x17f>
mov    %rax,(%r14)
mov    $0x1,%eax
jmp    1291 <asn1_template_ex_d2i+0x151>
mov    0x2d21(%rip),%rax
mov    0x2d02(%rip),%rcx
mov    (%rcx),%edi
mov    (%rax),%esi
jmp    128a <asn1_template_ex_d2i+0x14a>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32, i32 }
@ASN1_TFLG_TAG_CLASS = global i32 0
@ASN1_TFLG_EXPTAG = global i32 0
@ASN1_F_ASN1_TEMPLATE_EX_D2I = global i32 0
@ERR_R_NESTED_ASN1_ERROR = global i32 0
@ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED = global i32 0
@ASN1_R_MISSING_EOC = global i32 0
@ASN1_R_EXPLICIT_LENGTH_MISMATCH = global i32 0
define i32 @asn1_template_ex_d2i(i32** %0, i8** %1, i64 %2, %struct.TYPE_4__* %3, i8 signext %4, i32* %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32**
%10 = alloca i8**
%11 = alloca i64
%12 = alloca %struct.TYPE_4__*
%13 = alloca i8
%14 = alloca i32*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i64
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i8
%23 = alloca i8
store i32** %0, i32*** %9
store i8** %1, i8*** %10
store i64 %2, i64* %11
store %struct.TYPE_4__* %3, %struct.TYPE_4__** %12
store i8 %4, i8* %13
store i32* %5, i32** %14
store i32 %6, i32* %15
%24 = load i32**, i32*** %9
%25 = icmp ne i32** %24, null
br i1 %25, label %27, label %26
26: ; preds = %7
store i32 0, i32* %8
br label %122
27: ; preds = %7
%28 = load %struct.TYPE_4__*, %struct.TYPE_4__** %12
%29 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %28, i32 0, i32 0
%30 = load i32, i32* %29
store i32 %30, i32* %16
%31 = load i32, i32* %16
%32 = load i32, i32* @ASN1_TFLG_TAG_CLASS
%33 = and i32 %31, %32
store i32 %33, i32* %17
%34 = load i8**, i8*** %10
%35 = load i8*, i8** %34
store i8* %35, i8** %20
%36 = load i32, i32* %16
%37 = load i32, i32* @ASN1_TFLG_EXPTAG
%38 = and i32 %36, %37
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %109
40: ; preds = %27
%41 = load i64, i64* %11
%42 = load %struct.TYPE_4__*, %struct.TYPE_4__** %12
%43 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %42, i32 0, i32 1
%44 = load i32, i32* %43
%45 = load i32, i32* %17
%46 = load i8, i8* %13
%47 = load i32*, i32** %14
%48 = call i32 @asn1_check_tlen(i64* %19, i32* null, i32* null, i8* %22, i8* %23, i8** %20, i64 %41, i32 %44, i32 %45, i8 signext %46, i32* %47)
store i32 %48, i32* %18
%49 = load i8*, i8** %20
store i8* %49, i8** %21
%50 = load i32, i32* %18
%51 = icmp ne i32 %50, 0
br i1 %51, label %56, label %52
52: ; preds = %40
%53 = load i32, i32* @ASN1_F_ASN1_TEMPLATE_EX_D2I
%54 = load i32, i32* @ERR_R_NESTED_ASN1_ERROR
%55 = call i32 @ASN1err(i32 %53, i32 %54)
store i32 0, i32* %8
br label %122
56: ; preds = %40
%57 = load i32, i32* %18
%58 = icmp eq i32 %57, -1
br i1 %58, label %59, label %60
59: ; preds = %56
store i32 -1, i32* %8
br label %122
60: ; preds = %56
br label %61
61: ; preds = %60
%62 = load i8, i8* %23
%63 = icmp ne i8 %62, 0
br i1 %63, label %68, label %64
64: ; preds = %61
%65 = load i32, i32* @ASN1_F_ASN1_TEMPLATE_EX_D2I
%66 = load i32, i32* @ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED
%67 = call i32 @ASN1err(i32 %65, i32 %66)
store i32 0, i32* %8
br label %122
68: ; preds = %61
%69 = load i32**, i32*** %9
%70 = load i64, i64* %19
%71 = load %struct.TYPE_4__*, %struct.TYPE_4__** %12
%72 = load i32*, i32** %14
%73 = load i32, i32* %15
%74 = call i32 @asn1_template_noexp_d2i(i32** %69, i8** %20, i64 %70, %struct.TYPE_4__* %71, i8 signext 0, i32* %72, i32 %73)
store i32 %74, i32* %18
%75 = load i32, i32* %18
%76 = icmp ne i32 %75, 0
br i1 %76, label %81, label %77
77: ; preds = %68
%78 = load i32, i32* @ASN1_F_ASN1_TEMPLATE_EX_D2I
%79 = load i32, i32* @ERR_R_NESTED_ASN1_ERROR
%80 = call i32 @ASN1err(i32 %78, i32 %79)
store i32 0, i32* %8
br label %122
81: ; preds = %68
%82 = load i8*, i8** %20
%83 = load i8*, i8** %21
%84 = ptrtoint i8* %82 to i64
%85 = ptrtoint i8* %83 to i64
%86 = sub i64 %84, %85
%87 = load i64, i64* %19
%88 = sub nsw i64 %87, %86
store i64 %88, i64* %19
%89 = load i8, i8* %22
%90 = icmp ne i8 %89, 0
br i1 %90, label %91, label %100
91: ; preds = %81
%92 = load i64, i64* %19
%93 = call i32 @asn1_check_eoc(i8** %20, i64 %92)
%94 = icmp ne i32 %93, 0
br i1 %94, label %99, label %95
95: ; preds = %91
%96 = load i32, i32* @ASN1_F_ASN1_TEMPLATE_EX_D2I
%97 = load i32, i32* @ASN1_R_MISSING_EOC
%98 = call i32 @ASN1err(i32 %96, i32 %97)
br label %121
99: ; preds = %91
br label %108
100: ; preds = %81
%101 = load i64, i64* %19
%102 = icmp ne i64 %101, 0
br i1 %102, label %103, label %107
103: ; preds = %100
%104 = load i32, i32* @ASN1_F_ASN1_TEMPLATE_EX_D2I
%105 = load i32, i32* @ASN1_R_EXPLICIT_LENGTH_MISMATCH
%106 = call i32 @ASN1err(i32 %104, i32 %105)
br label %121
107: ; preds = %100
br label %108
108: ; preds = %107, %99
br label %118
109: ; preds = %27
%110 = load i32**, i32*** %9
%111 = load i8**, i8*** %10
%112 = load i64, i64* %11
%113 = load %struct.TYPE_4__*, %struct.TYPE_4__** %12
%114 = load i8, i8* %13
%115 = load i32*, i32** %14
%116 = load i32, i32* %15
%117 = call i32 @asn1_template_noexp_d2i(i32** %110, i8** %111, i64 %112, %struct.TYPE_4__* %113, i8 signext %114, i32* %115, i32 %116)
store i32 %117, i32* %8
br label %122
118: ; preds = %108
%119 = load i8*, i8** %20
%120 = load i8**, i8*** %10
store i8* %119, i8** %120
store i32 1, i32* %8
br label %122
121: ; preds = %103, %95
store i32 0, i32* %8
br label %122
122: ; preds = %121, %118, %109, %77, %64, %59, %52, %26
%123 = load i32, i32* %8
ret i32 %123
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32, i32 }
@ASN1_TFLG_TAG_CLASS = global i32 0
@ASN1_TFLG_EXPTAG = global i32 0
@ASN1_F_ASN1_TEMPLATE_EX_D2I = global i32 0
@ERR_R_NESTED_ASN1_ERROR = global i32 0
@ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED = global i32 0
@ASN1_R_MISSING_EOC = global i32 0
@ASN1_R_EXPLICIT_LENGTH_MISMATCH = global i32 0
define i32 @asn1_template_ex_d2i(i32** %0, i8** %1, i64 %2, %struct.TYPE_4__* %3, i8 signext %4, i32* %5, i32 %6) {
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i8
%11 = alloca i8
%12 = bitcast i64* %8 to i8*
%13 = bitcast i8** %9 to i8*
%14 = icmp eq i32** %0, null
br i1 %14, label %68, label %15
15: ; preds = %7
%16 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 0
%17 = load i32, i32* %16
%18 = load i32, i32* @ASN1_TFLG_TAG_CLASS
%19 = load i8*, i8** %1
store i8* %19, i8** %9
%20 = load i32, i32* @ASN1_TFLG_EXPTAG
%21 = and i32 %20, %17
%22 = icmp eq i32 %21, 0
br i1 %22, label %59, label %23
23: ; preds = %15
%24 = and i32 %18, %17
%25 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 1
%26 = load i32, i32* %25
%27 = call i32 @asn1_check_tlen(i64* %8, i32* null, i32* null, i8* %10, i8* %11, i8** %9, i64 %2, i32 %26, i32 %24, i8 signext %4, i32* %5)
%28 = load i8*, i8** %9
switch i32 %27, label %29 [
i32 0, label %52
i32 -1, label %57
]
29: ; preds = %23
%30 = load i8, i8* %11
%31 = icmp eq i8 %30, 0
br i1 %31, label %52, label %32
32: ; preds = %29
%33 = load i64, i64* %8
%34 = call i32 @asn1_template_noexp_d2i(i32** %0, i8** %9, i64 %33, %struct.TYPE_4__* %3, i8 signext 0, i32* %5, i32 %6)
%35 = icmp eq i32 %34, 0
br i1 %35, label %52, label %36
36: ; preds = %32
%37 = load i8*, i8** %9
%38 = ptrtoint i8* %37 to i64
%39 = ptrtoint i8* %28 to i64
%40 = sub i64 %39, %38
%41 = load i64, i64* %8
%42 = add i64 %40, %41
store i64 %42, i64* %8
%43 = load i8, i8* %10
%44 = icmp eq i8 %43, 0
br i1 %44, label %50, label %45
45: ; preds = %36
%46 = call i32 @asn1_check_eoc(i8** %9, i64 %42)
%47 = icmp eq i32 %46, 0
br i1 %47, label %63, label %48
48: ; preds = %45
%49 = load i8*, i8** %9
br label %61
50: ; preds = %36
%51 = icmp eq i64 %42, 0
br i1 %51, label %61, label %63
52: ; preds = %32, %29, %23
%53 = phi i32* [ @ERR_R_NESTED_ASN1_ERROR, %23 ], [ @ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED, %29 ], [ @ERR_R_NESTED_ASN1_ERROR, %32 ]
%54 = load i32, i32* @ASN1_F_ASN1_TEMPLATE_EX_D2I
%55 = load i32, i32* %53
%56 = call i32 @ASN1err(i32 %54, i32 %55)
br label %57
57: ; preds = %52, %23
%58 = phi i32 [ %27, %23 ], [ 0, %52 ]
br label %68
59: ; preds = %15
%60 = tail call i32 @asn1_template_noexp_d2i(i32** %0, i8** %1, i64 %2, %struct.TYPE_4__* %3, i8 signext %4, i32* %5, i32 %6)
br label %68
61: ; preds = %48, %50
%62 = phi i8* [ %49, %48 ], [ %37, %50 ]
store i8* %62, i8** %1
br label %68
63: ; preds = %50, %45
%64 = phi i32* [ @ASN1_R_MISSING_EOC, %45 ], [ @ASN1_R_EXPLICIT_LENGTH_MISMATCH, %50 ]
%65 = load i32, i32* @ASN1_F_ASN1_TEMPLATE_EX_D2I
%66 = load i32, i32* %64
%67 = call i32 @ASN1err(i32 %65, i32 %66)
br label %68
68: ; preds = %57, %7, %63, %61, %59
%69 = phi i32 [ 0, %63 ], [ 1, %61 ], [ %60, %59 ], [ 0, %7 ], [ %58, %57 ]
ret i32 %69
}