#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_13__ TYPE_2__;
typedef struct TYPE_12__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ X509_EXTENSION;
struct TYPE_12__ {
  int /*<<< orphan*/ (*ext_free)(void *);
  scalar_t__ it;
  void *(*r2i)(TYPE_1__ const *, TYPE_2__ *, char *);
  void *(*s2i)(TYPE_1__ const *, TYPE_2__ *, char *);
  void *(*v2i)(TYPE_1__ const *, TYPE_2__ *, int);
};
typedef TYPE_1__ X509V3_EXT_METHOD;
struct TYPE_13__ {
  int /*<<< orphan*/ db_meth;
  int /*<<< orphan*/ db;
};
typedef TYPE_2__ X509V3_CTX;
typedef int /*<<< orphan*/ CONF;

/* Variables and functions */
int /*<<< orphan*/ ASN1_ITEM_ptr(scalar_t__);
int /*<<< orphan*/ ASN1_item_free(void *, int /*<<< orphan*/);
int /*<<< orphan*/ CONF_VALUE;
int /*<<< orphan*/ ERR_asprintf_error_data(char *, int /*<<< orphan*/, ...);
int NCONF_get_section(int /*<<< orphan*/ *, char *);
int NID_undef;
int /*<<< orphan*/ OBJ_nid2sn(int);
int STACK_OF(int /*<<< orphan*/);
TYPE_1__ *X509V3_EXT_get_nid(int);
int /*<<< orphan*/ X509V3_F_DO_EXT_NCONF;
int /*<<< orphan*/ X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED;
int /*<<< orphan*/ X509V3_R_INVALID_EXTENSION_STRING;
int /*<<< orphan*/ X509V3_R_NO_CONFIG_DATABASE;
int /*<<< orphan*/ X509V3_R_UNKNOWN_EXTENSION;
int /*<<< orphan*/ X509V3_R_UNKNOWN_EXTENSION_NAME;
int /*<<< orphan*/ X509V3_conf_free;
int X509V3_parse_list(char *);
int /*<<< orphan*/ X509V3err(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ *do_ext_i2d(TYPE_1__ const *, int, int, void *);
int nval;
scalar_t__ sk_CONF_VALUE_num(int);
int /*<<< orphan*/ sk_CONF_VALUE_pop_free(int, int /*<<< orphan*/);
void *stub1(TYPE_1__ const *, TYPE_2__ *, int);
void *stub2(TYPE_1__ const *, TYPE_2__ *, char *);
void *stub3(TYPE_1__ const *, TYPE_2__ *, char *);
int /*<<< orphan*/ stub4(void *);
X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, int crit,
                             char *value) {
  const X509V3_EXT_METHOD *method;
  X509_EXTENSION *ext;
  void *ext_struc;
  if (ext_nid == NID_undef) {
    X509V3err(X509V3_F_DO_EXT_NCONF, X509V3_R_UNKNOWN_EXTENSION_NAME);
    return NULL;
  }
  if (!(method = X509V3_EXT_get_nid(ext_nid))) {
    X509V3err(X509V3_F_DO_EXT_NCONF, X509V3_R_UNKNOWN_EXTENSION);
    return NULL;
  }
  if (method->v2i) {
    STACK_OF(CONF_VALUE) * nval;
    if (*value == '@')
      nval = NCONF_get_section(conf, value + 1);
    else
      nval = X509V3_parse_list(value);
    if (sk_CONF_VALUE_num(nval) <= 0) {
      X509V3err(X509V3_F_DO_EXT_NCONF, X509V3_R_INVALID_EXTENSION_STRING);
      ERR_asprintf_error_data("name=%s,section=%s", OBJ_nid2sn(ext_nid), value);
      if (*value != '@')
        sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);
      return NULL;
    }
    ext_struc = method->v2i(method, ctx, nval);
    if (*value != '@')
      sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);
  } else if (method->s2i) {
    ext_struc = method->s2i(method, ctx, value);
  } else if (method->r2i) {
    if (!ctx->db || !ctx->db_meth) {
      X509V3err(X509V3_F_DO_EXT_NCONF, X509V3_R_NO_CONFIG_DATABASE);
      return NULL;
    }
    ext_struc = method->r2i(method, ctx, value);
  } else {
    X509V3err(X509V3_F_DO_EXT_NCONF, X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED);
    ERR_asprintf_error_data("name=%s", OBJ_nid2sn(ext_nid));
    return NULL;
  }
  if (ext_struc == NULL)
    return NULL;
  ext = do_ext_i2d(method, ext_nid, crit, ext_struc);
  if (method->it)
    ASN1_item_free(ext_struc, ASN1_ITEM_ptr(method->it));
  else
    method->ext_free(ext_struc);
  return ext;
}


x86 assembly (clang, -O0):
<do_ext_nconf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2dc4(%rip),%rcx
cmp    (%rcx),%eax
jne    1210 <do_ext_nconf+0x50>
mov    0x2da5(%rip),%rax
mov    (%rax),%edi
mov    0x2d94(%rip),%rax
mov    (%rax),%esi
call   10e0 <X509V3err@plt>
movq   $0x0,-0x8(%rbp)
jmp    14cf <do_ext_nconf+0x30f>
mov    -0x1c(%rbp),%edi
call   10d0 <X509V3_EXT_get_nid@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    124a <do_ext_nconf+0x8a>
mov    0x2d6b(%rip),%rax
mov    (%rax),%edi
mov    0x2daa(%rip),%rax
mov    (%rax),%esi
call   10e0 <X509V3err@plt>
movq   $0x0,-0x8(%rbp)
jmp    14cf <do_ext_nconf+0x30f>
mov    -0x30(%rbp),%rax
cmpq   $0x0,0x20(%rax)
je     1376 <do_ext_nconf+0x1b6>
mov    0x2d50(%rip),%rax
mov    (%rax),%edi
call   1050 <STACK_OF@plt>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
jne    1298 <do_ext_nconf+0xd8>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
add    $0x1,%rsi
call   10b0 <NCONF_get_section@plt>
mov    %eax,%ecx
mov    0x2d27(%rip),%rax
mov    %ecx,(%rax)
jmp    12ac <do_ext_nconf+0xec>
mov    -0x28(%rbp),%rdi
call   1080 <X509V3_parse_list@plt>
mov    %eax,%ecx
mov    0x2d0e(%rip),%rax
mov    %ecx,(%rax)
mov    0x2d05(%rip),%rax
mov    (%rax),%edi
call   1060 <sk_CONF_VALUE_num@plt>
cmp    $0x0,%rax
jg     132b <do_ext_nconf+0x16b>
mov    0x2ccd(%rip),%rax
mov    (%rax),%edi
mov    0x2cfc(%rip),%rax
mov    (%rax),%esi
call   10e0 <X509V3err@plt>
mov    -0x1c(%rbp),%edi
call   1070 <OBJ_nid2sn@plt>
mov    %eax,%esi
mov    -0x28(%rbp),%rdx
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   1030 <ERR_asprintf_error_data@plt>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
je     131e <do_ext_nconf+0x15e>
mov    0x2caa(%rip),%rax
mov    (%rax),%edi
mov    0x2cb1(%rip),%rax
mov    (%rax),%esi
call   1090 <sk_CONF_VALUE_pop_free@plt>
movq   $0x0,-0x8(%rbp)
jmp    14cf <do_ext_nconf+0x30f>
mov    -0x30(%rbp),%rax
mov    0x20(%rax),%rax
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2c76(%rip),%rcx
mov    (%rcx),%edx
call   *%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
je     1371 <do_ext_nconf+0x1b1>
mov    0x2c57(%rip),%rax
mov    (%rax),%edi
mov    0x2c5e(%rip),%rax
mov    (%rax),%esi
call   1090 <sk_CONF_VALUE_pop_free@plt>
jmp    1457 <do_ext_nconf+0x297>
mov    -0x30(%rbp),%rax
cmpq   $0x0,0x18(%rax)
je     13a4 <do_ext_nconf+0x1e4>
mov    -0x30(%rbp),%rax
mov    0x18(%rax),%rax
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   *%rax
mov    %rax,-0x40(%rbp)
jmp    1452 <do_ext_nconf+0x292>
mov    -0x30(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     1411 <do_ext_nconf+0x251>
mov    -0x18(%rbp),%rax
cmpl   $0x0,0x4(%rax)
je     13ce <do_ext_nconf+0x20e>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jne    13f2 <do_ext_nconf+0x232>
mov    0x2bc3(%rip),%rax
mov    (%rax),%edi
mov    0x2c0a(%rip),%rax
mov    (%rax),%esi
call   10e0 <X509V3err@plt>
movq   $0x0,-0x8(%rbp)
jmp    14cf <do_ext_nconf+0x30f>
mov    -0x30(%rbp),%rax
mov    0x10(%rax),%rax
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   *%rax
mov    %rax,-0x40(%rbp)
jmp    144d <do_ext_nconf+0x28d>
mov    0x2b80(%rip),%rax
mov    (%rax),%edi
mov    0x2bb7(%rip),%rax
mov    (%rax),%esi
call   10e0 <X509V3err@plt>
mov    -0x1c(%rbp),%edi
call   1070 <OBJ_nid2sn@plt>
mov    %eax,%esi
lea    0xbda(%rip),%rdi
mov    $0x0,%al
call   1030 <ERR_asprintf_error_data@plt>
movq   $0x0,-0x8(%rbp)
jmp    14cf <do_ext_nconf+0x30f>
jmp    1452 <do_ext_nconf+0x292>
jmp    1457 <do_ext_nconf+0x297>
cmpq   $0x0,-0x40(%rbp)
jne    146f <do_ext_nconf+0x2af>
movq   $0x0,-0x8(%rbp)
jmp    14cf <do_ext_nconf+0x30f>
mov    -0x30(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x40(%rbp),%rcx
call   10a0 <do_ext_i2d@plt>
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     14ba <do_ext_nconf+0x2fa>
mov    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <ASN1_ITEM_ptr@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%esi
call   10c0 <ASN1_item_free@plt>
jmp    14c7 <do_ext_nconf+0x307>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    -0x40(%rbp),%rdi
call   *%rax
mov    -0x38(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_ext_nconf>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2dd6(%rip),%rax
cmp    %edx,(%rax)
jne    11e8 <do_ext_nconf+0x28>
mov    0x2dbb(%rip),%rax
mov    (%rax),%edi
mov    0x2daa(%rip),%rax
jmp    123f <do_ext_nconf+0x7f>
mov    %r8,%r13
mov    %ecx,%r15d
mov    %edx,%ebx
mov    %rsi,%r12
mov    %rdi,%rbp
mov    %edx,%edi
call   10d0 <X509V3_EXT_get_nid@plt>
test   %rax,%rax
je     122f <do_ext_nconf+0x6f>
mov    %rax,%r14
cmpq   $0x0,0x20(%rax)
je     125a <do_ext_nconf+0x9a>
mov    0x2d9d(%rip),%rax
mov    (%rax),%edi
call   1050 <STACK_OF@plt>
cmpb   $0x40,0x0(%r13)
jne    1277 <do_ext_nconf+0xb7>
lea    0x1(%r13),%rsi
mov    %rbp,%rdi
call   10b0 <NCONF_get_section@plt>
jmp    127f <do_ext_nconf+0xbf>
mov    0x2d62(%rip),%rax
mov    (%rax),%edi
mov    0x2da1(%rip),%rax
mov    (%rax),%esi
call   10e0 <X509V3err@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x18(%r14),%rax
test   %rax,%rax
je     1351 <do_ext_nconf+0x191>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   *%rax
mov    %rax,%r12
jmp    12bd <do_ext_nconf+0xfd>
mov    %r13,%rdi
call   1080 <X509V3_parse_list@plt>
mov    %eax,%edi
mov    0x2d30(%rip),%rbp
mov    %eax,0x0(%rbp)
call   1060 <sk_CONF_VALUE_num@plt>
test   %rax,%rax
jle    12f2 <do_ext_nconf+0x132>
mov    0x0(%rbp),%edx
mov    %r14,%rdi
mov    %r12,%rsi
call   *0x20(%r14)
mov    %rax,%r12
cmpb   $0x40,0x0(%r13)
je     12bd <do_ext_nconf+0xfd>
mov    0x0(%rbp),%edi
mov    0x2d12(%rip),%rax
mov    (%rax),%esi
call   1090 <sk_CONF_VALUE_pop_free@plt>
test   %r12,%r12
je     1246 <do_ext_nconf+0x86>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r12,%rcx
call   10a0 <do_ext_i2d@plt>
mov    %rax,%rbx
mov    0x8(%r14),%rdi
test   %rdi,%rdi
je     1346 <do_ext_nconf+0x186>
call   1040 <ASN1_ITEM_ptr@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   10c0 <ASN1_item_free@plt>
jmp    1248 <do_ext_nconf+0x88>
mov    0x2c9f(%rip),%rax
mov    (%rax),%edi
mov    0x2cce(%rip),%rax
mov    (%rax),%esi
call   10e0 <X509V3err@plt>
mov    %ebx,%edi
call   1070 <OBJ_nid2sn@plt>
lea    0xce9(%rip),%rdi
xor    %ebx,%ebx
mov    %eax,%esi
mov    %r13,%rdx
xor    %eax,%eax
call   1030 <ERR_asprintf_error_data@plt>
cmpb   $0x40,0x0(%r13)
je     1248 <do_ext_nconf+0x88>
mov    0x0(%rbp),%edi
mov    0x2c8e(%rip),%rax
mov    (%rax),%esi
call   1090 <sk_CONF_VALUE_pop_free@plt>
jmp    1246 <do_ext_nconf+0x86>
mov    %r12,%rdi
call   *(%r14)
jmp    1248 <do_ext_nconf+0x88>
mov    0x10(%r14),%rax
test   %rax,%rax
je     1382 <do_ext_nconf+0x1c2>
cmpl   $0x0,0x4(%r12)
je     136d <do_ext_nconf+0x1ad>
cmpl   $0x0,(%r12)
jne    1267 <do_ext_nconf+0xa7>
mov    0x2c24(%rip),%rax
mov    (%rax),%edi
mov    0x2c6b(%rip),%rax
jmp    123f <do_ext_nconf+0x7f>
mov    0x2c0f(%rip),%rax
mov    (%rax),%edi
mov    0x2c46(%rip),%rax
mov    (%rax),%esi
call   10e0 <X509V3err@plt>
mov    %ebx,%edi
call   1070 <OBJ_nid2sn@plt>
lea    0xc6c(%rip),%rdi
xor    %ebx,%ebx
mov    %eax,%esi
xor    %eax,%eax
call   1030 <ERR_asprintf_error_data@plt>
jmp    1248 <do_ext_nconf+0x88>

LLVM IR (-O0):
%struct.TYPE_13__ = type { i32, i32 }
%struct.TYPE_12__ = type { i32 (i8*)*, i64, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)* }
@NID_undef = global i32 0
@X509V3_F_DO_EXT_NCONF = global i32 0
@X509V3_R_UNKNOWN_EXTENSION_NAME = global i32 0
@X509V3_R_UNKNOWN_EXTENSION = global i32 0
@CONF_VALUE = global i32 0
@nval = global i32 0
@X509V3_R_INVALID_EXTENSION_STRING = global i32 0
@.str = [19 x i8] c"name=%s,section=%s\00"
@X509V3_conf_free = global i32 0
@X509V3_R_NO_CONFIG_DATABASE = global i32 0
@X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED = global i32 0
@.str.1 = [8 x i8] c"name=%s\00"
define i32* @do_ext_nconf(i32* %0, %struct.TYPE_13__* %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca %struct.TYPE_13__*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca %struct.TYPE_12__*
%13 = alloca i32*
%14 = alloca i8*
store i32* %0, i32** %7
store %struct.TYPE_13__* %1, %struct.TYPE_13__** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
%15 = load i32, i32* %9
%16 = load i32, i32* @NID_undef
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %22
18: ; preds = %5
%19 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%20 = load i32, i32* @X509V3_R_UNKNOWN_EXTENSION_NAME
%21 = call i32 @X509V3err(i32 %19, i32 %20)
store i32* null, i32** %6
br label %168
22: ; preds = %5
%23 = load i32, i32* %9
%24 = call %struct.TYPE_12__* @X509V3_EXT_get_nid(i32 %23)
store %struct.TYPE_12__* %24, %struct.TYPE_12__** %12
%25 = icmp ne %struct.TYPE_12__* %24, null
br i1 %25, label %30, label %26
26: ; preds = %22
%27 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%28 = load i32, i32* @X509V3_R_UNKNOWN_EXTENSION
%29 = call i32 @X509V3err(i32 %27, i32 %28)
store i32* null, i32** %6
br label %168
30: ; preds = %22
%31 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%32 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %31, i32 0, i32 4
%33 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)** %32
%34 = icmp ne i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)* %33, null
br i1 %34, label %35, label %90
35: ; preds = %30
%36 = load i32, i32* @CONF_VALUE
%37 = call i32 @STACK_OF(i32 %36)
%38 = load i32, i32* @nval
%39 = mul nsw i32 %37, %38
%40 = load i8*, i8** %11
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 64
br i1 %43, label %44, label %49
44: ; preds = %35
%45 = load i32*, i32** %7
%46 = load i8*, i8** %11
%47 = getelementptr inbounds i8, i8* %46, i64 1
%48 = call i32 @NCONF_get_section(i32* %45, i8* %47)
store i32 %48, i32* @nval
br label %52
49: ; preds = %35
%50 = load i8*, i8** %11
%51 = call i32 @X509V3_parse_list(i8* %50)
store i32 %51, i32* @nval
br label %52
52: ; preds = %49, %44
%53 = load i32, i32* @nval
%54 = call i64 @sk_CONF_VALUE_num(i32 %53)
%55 = icmp sle i64 %54, 0
br i1 %55, label %56, label %73
56: ; preds = %52
%57 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%58 = load i32, i32* @X509V3_R_INVALID_EXTENSION_STRING
%59 = call i32 @X509V3err(i32 %57, i32 %58)
%60 = load i32, i32* %9
%61 = call i32 @OBJ_nid2sn(i32 %60)
%62 = load i8*, i8** %11
%63 = call i32 (i8*, i32, ...) @ERR_asprintf_error_data(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %61, i8* %62)
%64 = load i8*, i8** %11
%65 = load i8, i8* %64
%66 = sext i8 %65 to i32
%67 = icmp ne i32 %66, 64
br i1 %67, label %68, label %72
68: ; preds = %56
%69 = load i32, i32* @nval
%70 = load i32, i32* @X509V3_conf_free
%71 = call i32 @sk_CONF_VALUE_pop_free(i32 %69, i32 %70)
br label %72
72: ; preds = %68, %56
store i32* null, i32** %6
br label %168
73: ; preds = %52
%74 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%75 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %74, i32 0, i32 4
%76 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)** %75
%77 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%78 = load %struct.TYPE_13__*, %struct.TYPE_13__** %8
%79 = load i32, i32* @nval
%80 = call i8* %76(%struct.TYPE_12__* %77, %struct.TYPE_13__* %78, i32 %79)
store i8* %80, i8** %14
%81 = load i8*, i8** %11
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp ne i32 %83, 64
br i1 %84, label %85, label %89
85: ; preds = %73
%86 = load i32, i32* @nval
%87 = load i32, i32* @X509V3_conf_free
%88 = call i32 @sk_CONF_VALUE_pop_free(i32 %86, i32 %87)
br label %89
89: ; preds = %85, %73
br label %139
90: ; preds = %30
%91 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%92 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %91, i32 0, i32 3
%93 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)** %92
%94 = icmp ne i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)* %93, null
br i1 %94, label %95, label %103
95: ; preds = %90
%96 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%97 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %96, i32 0, i32 3
%98 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)** %97
%99 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%100 = load %struct.TYPE_13__*, %struct.TYPE_13__** %8
%101 = load i8*, i8** %11
%102 = call i8* %98(%struct.TYPE_12__* %99, %struct.TYPE_13__* %100, i8* %101)
store i8* %102, i8** %14
br label %138
103: ; preds = %90
%104 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%105 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %104, i32 0, i32 2
%106 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)** %105
%107 = icmp ne i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)* %106, null
br i1 %107, label %108, label %130
108: ; preds = %103
%109 = load %struct.TYPE_13__*, %struct.TYPE_13__** %8
%110 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %109, i32 0, i32 1
%111 = load i32, i32* %110
%112 = icmp ne i32 %111, 0
br i1 %112, label %113, label %118
113: ; preds = %108
%114 = load %struct.TYPE_13__*, %struct.TYPE_13__** %8
%115 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %114, i32 0, i32 0
%116 = load i32, i32* %115
%117 = icmp ne i32 %116, 0
br i1 %117, label %122, label %118
118: ; preds = %113, %108
%119 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%120 = load i32, i32* @X509V3_R_NO_CONFIG_DATABASE
%121 = call i32 @X509V3err(i32 %119, i32 %120)
store i32* null, i32** %6
br label %168
122: ; preds = %113
%123 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%124 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %123, i32 0, i32 2
%125 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)** %124
%126 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%127 = load %struct.TYPE_13__*, %struct.TYPE_13__** %8
%128 = load i8*, i8** %11
%129 = call i8* %125(%struct.TYPE_12__* %126, %struct.TYPE_13__* %127, i8* %128)
store i8* %129, i8** %14
br label %137
130: ; preds = %103
%131 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%132 = load i32, i32* @X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED
%133 = call i32 @X509V3err(i32 %131, i32 %132)
%134 = load i32, i32* %9
%135 = call i32 @OBJ_nid2sn(i32 %134)
%136 = call i32 (i8*, i32, ...) @ERR_asprintf_error_data(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %135)
store i32* null, i32** %6
br label %168
137: ; preds = %122
br label %138
138: ; preds = %137, %95
br label %139
139: ; preds = %138, %89
%140 = load i8*, i8** %14
%141 = icmp eq i8* %140, null
br i1 %141, label %142, label %143
142: ; preds = %139
store i32* null, i32** %6
br label %168
143: ; preds = %139
%144 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%145 = load i32, i32* %9
%146 = load i32, i32* %10
%147 = load i8*, i8** %14
%148 = call i32* @do_ext_i2d(%struct.TYPE_12__* %144, i32 %145, i32 %146, i8* %147)
store i32* %148, i32** %13
%149 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%150 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %149, i32 0, i32 1
%151 = load i64, i64* %150
%152 = icmp ne i64 %151, 0
br i1 %152, label %153, label %160
153: ; preds = %143
%154 = load i8*, i8** %14
%155 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%156 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %155, i32 0, i32 1
%157 = load i64, i64* %156
%158 = call i32 @ASN1_ITEM_ptr(i64 %157)
%159 = call i32 @ASN1_item_free(i8* %154, i32 %158)
br label %166
160: ; preds = %143
%161 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%162 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %161, i32 0, i32 0
%163 = load i32 (i8*)*, i32 (i8*)** %162
%164 = load i8*, i8** %14
%165 = call i32 %163(i8* %164)
br label %166
166: ; preds = %160, %153
%167 = load i32*, i32** %13
store i32* %167, i32** %6
br label %168
168: ; preds = %166, %142, %130, %118, %72, %26, %18
%169 = load i32*, i32** %6
ret i32* %169
}

LLVM IR (-O2):
%struct.TYPE_13__ = type { i32, i32 }
%struct.TYPE_12__ = type { i32 (i8*)*, i64, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)* }
@NID_undef = global i32 0
@X509V3_F_DO_EXT_NCONF = global i32 0
@X509V3_R_UNKNOWN_EXTENSION_NAME = global i32 0
@X509V3_R_UNKNOWN_EXTENSION = global i32 0
@CONF_VALUE = global i32 0
@nval = global i32 0
@X509V3_R_INVALID_EXTENSION_STRING = global i32 0
@.str = [19 x i8] c"name=%s,section=%s\00"
@X509V3_conf_free = global i32 0
@X509V3_R_NO_CONFIG_DATABASE = global i32 0
@X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED = global i32 0
@.str.1 = [8 x i8] c"name=%s\00"
define i32* @do_ext_nconf(i32* %0, %struct.TYPE_13__* %1, i32 %2, i32 %3, i8* %4) {
%6 = load i32, i32* @NID_undef
%7 = icmp eq i32 %6, %2
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%10 = load i32, i32* @X509V3_R_UNKNOWN_EXTENSION_NAME
%11 = tail call i32 @X509V3err(i32 %9, i32 %10)
br label %104
12: ; preds = %5
%13 = tail call %struct.TYPE_12__* @X509V3_EXT_get_nid(i32 %2)
%14 = icmp eq %struct.TYPE_12__* %13, null
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%17 = load i32, i32* @X509V3_R_UNKNOWN_EXTENSION
%18 = tail call i32 @X509V3err(i32 %16, i32 %17)
br label %104
19: ; preds = %12
%20 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %13, i64 0, i32 4
%21 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)** %20
%22 = icmp eq i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)* %21, null
br i1 %22, label %59, label %23
23: ; preds = %19
%24 = load i32, i32* @CONF_VALUE
%25 = tail call i32 @STACK_OF(i32 %24)
%26 = load i8, i8* %4
%27 = icmp eq i8 %26, 64
br i1 %27, label %28, label %31
28: ; preds = %23
%29 = getelementptr inbounds i8, i8* %4, i64 1
%30 = tail call i32 @NCONF_get_section(i32* %0, i8* %29)
br label %33
31: ; preds = %23
%32 = tail call i32 @X509V3_parse_list(i8* %4)
br label %33
33: ; preds = %31, %28
%34 = phi i32 [ %32, %31 ], [ %30, %28 ]
store i32 %34, i32* @nval
%35 = tail call i64 @sk_CONF_VALUE_num(i32 %34)
%36 = icmp slt i64 %35, 1
br i1 %36, label %37, label %49
37: ; preds = %33
%38 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%39 = load i32, i32* @X509V3_R_INVALID_EXTENSION_STRING
%40 = tail call i32 @X509V3err(i32 %38, i32 %39)
%41 = tail call i32 @OBJ_nid2sn(i32 %2)
%42 = tail call i32 (i8*, i32, ...) @ERR_asprintf_error_data(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %41, i8* %4)
%43 = load i8, i8* %4
%44 = icmp eq i8 %43, 64
br i1 %44, label %104, label %45
45: ; preds = %37
%46 = load i32, i32* @nval
%47 = load i32, i32* @X509V3_conf_free
%48 = tail call i32 @sk_CONF_VALUE_pop_free(i32 %46, i32 %47)
br label %104
49: ; preds = %33
%50 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)** %20
%51 = load i32, i32* @nval
%52 = tail call i8* %50(%struct.TYPE_12__* %13, %struct.TYPE_13__* %1, i32 %51)
%53 = load i8, i8* %4
%54 = icmp eq i8 %53, 64
br i1 %54, label %89, label %55
55: ; preds = %49
%56 = load i32, i32* @nval
%57 = load i32, i32* @X509V3_conf_free
%58 = tail call i32 @sk_CONF_VALUE_pop_free(i32 %56, i32 %57)
br label %89
59: ; preds = %19
%60 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %13, i64 0, i32 3
%61 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)** %60
%62 = icmp eq i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)* %61, null
br i1 %62, label %65, label %63
63: ; preds = %59
%64 = tail call i8* %61(%struct.TYPE_12__* %13, %struct.TYPE_13__* %1, i8* %4)
br label %89
65: ; preds = %59
%66 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %13, i64 0, i32 2
%67 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)** %66
%68 = icmp eq i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)* %67, null
br i1 %68, label %83, label %69
69: ; preds = %65
%70 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %1, i64 0, i32 1
%71 = load i32, i32* %70
%72 = icmp eq i32 %71, 0
br i1 %72, label %77, label %73
73: ; preds = %69
%74 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %1, i64 0, i32 0
%75 = load i32, i32* %74
%76 = icmp eq i32 %75, 0
br i1 %76, label %77, label %81
77: ; preds = %73, %69
%78 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%79 = load i32, i32* @X509V3_R_NO_CONFIG_DATABASE
%80 = tail call i32 @X509V3err(i32 %78, i32 %79)
br label %104
81: ; preds = %73
%82 = tail call i8* %67(%struct.TYPE_12__* %13, %struct.TYPE_13__* %1, i8* %4)
br label %89
83: ; preds = %65
%84 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%85 = load i32, i32* @X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED
%86 = tail call i32 @X509V3err(i32 %84, i32 %85)
%87 = tail call i32 @OBJ_nid2sn(i32 %2)
%88 = tail call i32 (i8*, i32, ...) @ERR_asprintf_error_data(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %87)
br label %104
89: ; preds = %63, %81, %49, %55
%90 = phi i8* [ %52, %55 ], [ %52, %49 ], [ %64, %63 ], [ %82, %81 ]
%91 = icmp eq i8* %90, null
br i1 %91, label %104, label %92
92: ; preds = %89
%93 = tail call i32* @do_ext_i2d(%struct.TYPE_12__* %13, i32 %2, i32 %3, i8* %90)
%94 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %13, i64 0, i32 1
%95 = load i64, i64* %94
%96 = icmp eq i64 %95, 0
br i1 %96, label %100, label %97
97: ; preds = %92
%98 = tail call i32 @ASN1_ITEM_ptr(i64 %95)
%99 = tail call i32 @ASN1_item_free(i8* %90, i32 %98)
br label %104
100: ; preds = %92
%101 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %13, i64 0, i32 0
%102 = load i32 (i8*)*, i32 (i8*)** %101
%103 = tail call i32 %102(i8* %90)
br label %104
104: ; preds = %97, %100, %89, %37, %45, %83, %77, %15, %8
%105 = phi i32* [ null, %8 ], [ null, %77 ], [ null, %83 ], [ null, %15 ], [ null, %45 ], [ null, %37 ], [ null, %89 ], [ %93, %100 ], [ %93, %97 ]
ret i32* %105
}