#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;
  STACK_OF(CONF_VALUE) * nval;
  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) {
    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);
      return NULL;
    }
    ext_struc = method->v2i(method, ctx, nval);
    if (*value != '@')
      sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);
    if (!ext_struc)
      return NULL;
  } else if (method->s2i) {
    if (!(ext_struc = method->s2i(method, ctx, value)))
      return NULL;
  } else if (method->r2i) {
    if (!ctx->db || !ctx->db_meth) {
      X509V3err(X509V3_F_DO_EXT_NCONF, X509V3_R_NO_CONFIG_DATABASE);
      return NULL;
    }
    if (!(ext_struc = method->r2i(method, ctx, value)))
      return NULL;
  } 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;
  }
  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    0x2dcf(%rip),%rax
mov    (%rax),%edi
call   1050 <STACK_OF@plt>
mov    -0x1c(%rbp),%eax
mov    0x2db6(%rip),%rcx
cmp    (%rcx),%eax
jne    121e <do_ext_nconf+0x5e>
mov    0x2d97(%rip),%rax
mov    (%rax),%edi
mov    0x2d86(%rip),%rax
mov    (%rax),%esi
call   10e0 <X509V3err@plt>
movq   $0x0,-0x8(%rbp)
jmp    14d6 <do_ext_nconf+0x316>
mov    -0x1c(%rbp),%edi
call   10d0 <X509V3_EXT_get_nid@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    1258 <do_ext_nconf+0x98>
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
mov    0x2d9c(%rip),%rax
mov    (%rax),%esi
call   10e0 <X509V3err@plt>
movq   $0x0,-0x8(%rbp)
jmp    14d6 <do_ext_nconf+0x316>
mov    -0x30(%rbp),%rax
cmpq   $0x0,0x20(%rax)
je     1367 <do_ext_nconf+0x1a7>
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     1304 <do_ext_nconf+0x144>
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>
movq   $0x0,-0x8(%rbp)
jmp    14d6 <do_ext_nconf+0x316>
mov    -0x30(%rbp),%rax
mov    0x20(%rax),%rax
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2c9d(%rip),%rcx
mov    (%rcx),%edx
call   *%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
je     134a <do_ext_nconf+0x18a>
mov    0x2c7e(%rip),%rax
mov    (%rax),%edi
mov    0x2c85(%rip),%rax
mov    (%rax),%esi
call   1090 <sk_CONF_VALUE_pop_free@plt>
cmpq   $0x0,-0x40(%rbp)
jne    1362 <do_ext_nconf+0x1a2>
movq   $0x0,-0x8(%rbp)
jmp    14d6 <do_ext_nconf+0x316>
jmp    1476 <do_ext_nconf+0x2b6>
mov    -0x30(%rbp),%rax
cmpq   $0x0,0x18(%rax)
je     13ac <do_ext_nconf+0x1ec>
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)
cmp    $0x0,%rax
jne    13a7 <do_ext_nconf+0x1e7>
movq   $0x0,-0x8(%rbp)
jmp    14d6 <do_ext_nconf+0x316>
jmp    1471 <do_ext_nconf+0x2b1>
mov    -0x30(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     1430 <do_ext_nconf+0x270>
mov    -0x18(%rbp),%rax
cmpl   $0x0,0x4(%rax)
je     13d6 <do_ext_nconf+0x216>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jne    13fa <do_ext_nconf+0x23a>
mov    0x2bbb(%rip),%rax
mov    (%rax),%edi
mov    0x2c02(%rip),%rax
mov    (%rax),%esi
call   10e0 <X509V3err@plt>
movq   $0x0,-0x8(%rbp)
jmp    14d6 <do_ext_nconf+0x316>
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)
cmp    $0x0,%rax
jne    142b <do_ext_nconf+0x26b>
movq   $0x0,-0x8(%rbp)
jmp    14d6 <do_ext_nconf+0x316>
jmp    146c <do_ext_nconf+0x2ac>
mov    0x2b61(%rip),%rax
mov    (%rax),%edi
mov    0x2b98(%rip),%rax
mov    (%rax),%esi
call   10e0 <X509V3err@plt>
mov    -0x1c(%rbp),%edi
call   1070 <OBJ_nid2sn@plt>
mov    %eax,%esi
lea    0xbbb(%rip),%rdi
mov    $0x0,%al
call   1030 <ERR_asprintf_error_data@plt>
movq   $0x0,-0x8(%rbp)
jmp    14d6 <do_ext_nconf+0x316>
jmp    1471 <do_ext_nconf+0x2b1>
jmp    1476 <do_ext_nconf+0x2b6>
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     14c1 <do_ext_nconf+0x301>
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    14ce <do_ext_nconf+0x30e>
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    %r8,%r15
mov    %ecx,%r14d
mov    %edx,%ebx
mov    %rsi,%r12
mov    %rdi,%rbp
mov    0x2dd0(%rip),%rax
mov    (%rax),%edi
call   1050 <STACK_OF@plt>
mov    0x2dba(%rip),%rax
cmp    %ebx,(%rax)
jne    1204 <do_ext_nconf+0x44>
mov    0x2d9f(%rip),%rax
mov    (%rax),%edi
mov    0x2d8e(%rip),%rax
jmp    123e <do_ext_nconf+0x7e>
mov    %ebx,%edi
call   10d0 <X509V3_EXT_get_nid@plt>
test   %rax,%rax
je     122e <do_ext_nconf+0x6e>
mov    %rax,%r13
cmpq   $0x0,0x20(%rax)
je     1259 <do_ext_nconf+0x99>
cmpb   $0x40,(%r15)
jne    127b <do_ext_nconf+0xbb>
lea    0x1(%r15),%rsi
mov    %rbp,%rdi
call   10b0 <NCONF_get_section@plt>
jmp    1283 <do_ext_nconf+0xc3>
mov    0x2d63(%rip),%rax
mov    (%rax),%edi
mov    0x2da2(%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(%r13),%rax
test   %rax,%rax
je     1339 <do_ext_nconf+0x179>
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   *%rax
mov    %rax,%r12
test   %rax,%rax
jne    12c5 <do_ext_nconf+0x105>
jmp    1245 <do_ext_nconf+0x85>
mov    %r15,%rdi
call   1080 <X509V3_parse_list@plt>
mov    0x2d2e(%rip),%rbp
mov    %eax,0x0(%rbp)
mov    %eax,%edi
call   1060 <sk_CONF_VALUE_num@plt>
test   %rax,%rax
jle    12f5 <do_ext_nconf+0x135>
mov    0x0(%rbp),%edx
mov    %r13,%rdi
mov    %r12,%rsi
call   *0x20(%r13)
mov    %rax,%r12
cmpb   $0x40,(%r15)
je     12c0 <do_ext_nconf+0x100>
mov    0x0(%rbp),%edi
mov    0x2d0f(%rip),%rax
mov    (%rax),%esi
call   1090 <sk_CONF_VALUE_pop_free@plt>
test   %r12,%r12
je     1245 <do_ext_nconf+0x85>
mov    %r13,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
mov    %r12,%rcx
call   10a0 <do_ext_i2d@plt>
mov    %rax,%rbx
mov    0x8(%r13),%rdi
test   %rdi,%rdi
je     132d <do_ext_nconf+0x16d>
call   1040 <ASN1_ITEM_ptr@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   10c0 <ASN1_item_free@plt>
jmp    1247 <do_ext_nconf+0x87>
mov    0x2c9c(%rip),%rax
mov    (%rax),%edi
mov    0x2ccb(%rip),%rax
mov    (%rax),%esi
call   10e0 <X509V3err@plt>
mov    %ebx,%edi
call   1070 <OBJ_nid2sn@plt>
lea    0xce6(%rip),%rdi
xor    %ebx,%ebx
mov    %eax,%esi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <ERR_asprintf_error_data@plt>
jmp    1247 <do_ext_nconf+0x87>
mov    %r12,%rdi
call   *0x0(%r13)
jmp    1247 <do_ext_nconf+0x87>
mov    0x10(%r13),%rax
test   %rax,%rax
je     136a <do_ext_nconf+0x1aa>
cmpl   $0x0,0x4(%r12)
je     1355 <do_ext_nconf+0x195>
cmpl   $0x0,(%r12)
jne    1266 <do_ext_nconf+0xa6>
mov    0x2c3c(%rip),%rax
mov    (%rax),%edi
mov    0x2c83(%rip),%rax
jmp    123e <do_ext_nconf+0x7e>
mov    0x2c27(%rip),%rax
mov    (%rax),%edi
mov    0x2c5e(%rip),%rax
mov    (%rax),%esi
call   10e0 <X509V3err@plt>
mov    %ebx,%edi
call   1070 <OBJ_nid2sn@plt>
lea    0xc84(%rip),%rdi
xor    %ebx,%ebx
mov    %eax,%esi
xor    %eax,%eax
call   1030 <ERR_asprintf_error_data@plt>
jmp    1247 <do_ext_nconf+0x87>

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)* }
@CONF_VALUE = global i32 0
@nval = global i32 0
@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
@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* @CONF_VALUE
%16 = call i32 @STACK_OF(i32 %15)
%17 = load i32, i32* @nval
%18 = mul nsw i32 %16, %17
%19 = load i32, i32* %9
%20 = load i32, i32* @NID_undef
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %26
22: ; preds = %5
%23 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%24 = load i32, i32* @X509V3_R_UNKNOWN_EXTENSION_NAME
%25 = call i32 @X509V3err(i32 %23, i32 %24)
store i32* null, i32** %6
br label %165
26: ; preds = %5
%27 = load i32, i32* %9
%28 = call %struct.TYPE_12__* @X509V3_EXT_get_nid(i32 %27)
store %struct.TYPE_12__* %28, %struct.TYPE_12__** %12
%29 = icmp ne %struct.TYPE_12__* %28, null
br i1 %29, label %34, label %30
30: ; preds = %26
%31 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%32 = load i32, i32* @X509V3_R_UNKNOWN_EXTENSION
%33 = call i32 @X509V3err(i32 %31, i32 %32)
store i32* null, i32** %6
br label %165
34: ; preds = %26
%35 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%36 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %35, i32 0, i32 4
%37 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)** %36
%38 = icmp ne i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)* %37, null
br i1 %38, label %39, label %85
39: ; preds = %34
%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 = %39
%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 = %39
%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 %64
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)
store i32* null, i32** %6
br label %165
64: ; preds = %52
%65 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%66 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %65, i32 0, i32 4
%67 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)** %66
%68 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%69 = load %struct.TYPE_13__*, %struct.TYPE_13__** %8
%70 = load i32, i32* @nval
%71 = call i8* %67(%struct.TYPE_12__* %68, %struct.TYPE_13__* %69, i32 %70)
store i8* %71, i8** %14
%72 = load i8*, i8** %11
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp ne i32 %74, 64
br i1 %75, label %76, label %80
76: ; preds = %64
%77 = load i32, i32* @nval
%78 = load i32, i32* @X509V3_conf_free
%79 = call i32 @sk_CONF_VALUE_pop_free(i32 %77, i32 %78)
br label %80
80: ; preds = %76, %64
%81 = load i8*, i8** %14
%82 = icmp ne i8* %81, null
br i1 %82, label %84, label %83
83: ; preds = %80
store i32* null, i32** %6
br label %165
84: ; preds = %80
br label %140
85: ; preds = %34
%86 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%87 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %86, i32 0, i32 3
%88 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)** %87
%89 = icmp ne i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)* %88, null
br i1 %89, label %90, label %101
90: ; preds = %85
%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 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%95 = load %struct.TYPE_13__*, %struct.TYPE_13__** %8
%96 = load i8*, i8** %11
%97 = call i8* %93(%struct.TYPE_12__* %94, %struct.TYPE_13__* %95, i8* %96)
store i8* %97, i8** %14
%98 = icmp ne i8* %97, null
br i1 %98, label %100, label %99
99: ; preds = %90
store i32* null, i32** %6
br label %165
100: ; preds = %90
br label %139
101: ; preds = %85
%102 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%103 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %102, i32 0, i32 2
%104 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)** %103
%105 = icmp ne i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)* %104, null
br i1 %105, label %106, label %131
106: ; preds = %101
%107 = load %struct.TYPE_13__*, %struct.TYPE_13__** %8
%108 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %107, i32 0, i32 1
%109 = load i32, i32* %108
%110 = icmp ne i32 %109, 0
br i1 %110, label %111, label %116
111: ; preds = %106
%112 = load %struct.TYPE_13__*, %struct.TYPE_13__** %8
%113 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %112, i32 0, i32 0
%114 = load i32, i32* %113
%115 = icmp ne i32 %114, 0
br i1 %115, label %120, label %116
116: ; preds = %111, %106
%117 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%118 = load i32, i32* @X509V3_R_NO_CONFIG_DATABASE
%119 = call i32 @X509V3err(i32 %117, i32 %118)
store i32* null, i32** %6
br label %165
120: ; preds = %111
%121 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%122 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %121, i32 0, i32 2
%123 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)** %122
%124 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%125 = load %struct.TYPE_13__*, %struct.TYPE_13__** %8
%126 = load i8*, i8** %11
%127 = call i8* %123(%struct.TYPE_12__* %124, %struct.TYPE_13__* %125, i8* %126)
store i8* %127, i8** %14
%128 = icmp ne i8* %127, null
br i1 %128, label %130, label %129
129: ; preds = %120
store i32* null, i32** %6
br label %165
130: ; preds = %120
br label %138
131: ; preds = %101
%132 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%133 = load i32, i32* @X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED
%134 = call i32 @X509V3err(i32 %132, i32 %133)
%135 = load i32, i32* %9
%136 = call i32 @OBJ_nid2sn(i32 %135)
%137 = call i32 (i8*, i32, ...) @ERR_asprintf_error_data(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %136)
store i32* null, i32** %6
br label %165
138: ; preds = %130
br label %139
139: ; preds = %138, %100
br label %140
140: ; preds = %139, %84
%141 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%142 = load i32, i32* %9
%143 = load i32, i32* %10
%144 = load i8*, i8** %14
%145 = call i32* @do_ext_i2d(%struct.TYPE_12__* %141, i32 %142, i32 %143, i8* %144)
store i32* %145, i32** %13
%146 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%147 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %146, i32 0, i32 1
%148 = load i64, i64* %147
%149 = icmp ne i64 %148, 0
br i1 %149, label %150, label %157
150: ; preds = %140
%151 = load i8*, i8** %14
%152 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%153 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %152, i32 0, i32 1
%154 = load i64, i64* %153
%155 = call i32 @ASN1_ITEM_ptr(i64 %154)
%156 = call i32 @ASN1_item_free(i8* %151, i32 %155)
br label %163
157: ; preds = %140
%158 = load %struct.TYPE_12__*, %struct.TYPE_12__** %12
%159 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %158, i32 0, i32 0
%160 = load i32 (i8*)*, i32 (i8*)** %159
%161 = load i8*, i8** %14
%162 = call i32 %160(i8* %161)
br label %163
163: ; preds = %157, %150
%164 = load i32*, i32** %13
store i32* %164, i32** %6
br label %165
165: ; preds = %163, %131, %129, %116, %99, %83, %56, %30, %22
%166 = load i32*, i32** %6
ret i32* %166
}

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)* }
@CONF_VALUE = global i32 0
@nval = global i32 0
@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
@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* @CONF_VALUE
%7 = tail call i32 @STACK_OF(i32 %6)
%8 = load i32, i32* @NID_undef
%9 = icmp eq i32 %8, %2
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%12 = load i32, i32* @X509V3_R_UNKNOWN_EXTENSION_NAME
%13 = tail call i32 @X509V3err(i32 %11, i32 %12)
br label %100
14: ; preds = %5
%15 = tail call %struct.TYPE_12__* @X509V3_EXT_get_nid(i32 %2)
%16 = icmp eq %struct.TYPE_12__* %15, null
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%19 = load i32, i32* @X509V3_R_UNKNOWN_EXTENSION
%20 = tail call i32 @X509V3err(i32 %18, i32 %19)
br label %100
21: ; preds = %14
%22 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %15, i64 0, i32 4
%23 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)** %22
%24 = icmp eq i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)* %23, null
br i1 %24, label %55, label %25
25: ; preds = %21
%26 = load i8, i8* %4
%27 = icmp eq i8 %26, 64
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = getelementptr inbounds i8, i8* %4, i64 1
%30 = tail call i32 @NCONF_get_section(i32* %0, i8* %29)
br label %33
31: ; preds = %25
%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 %43
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)
br label %100
43: ; preds = %33
%44 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i32)** %22
%45 = load i32, i32* @nval
%46 = tail call i8* %44(%struct.TYPE_12__* %15, %struct.TYPE_13__* %1, i32 %45)
%47 = load i8, i8* %4
%48 = icmp eq i8 %47, 64
br i1 %48, label %53, label %49
49: ; preds = %43
%50 = load i32, i32* @nval
%51 = load i32, i32* @X509V3_conf_free
%52 = tail call i32 @sk_CONF_VALUE_pop_free(i32 %50, i32 %51)
br label %53
53: ; preds = %49, %43
%54 = icmp eq i8* %46, null
br i1 %54, label %100, label %87
55: ; preds = %21
%56 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %15, i64 0, i32 3
%57 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)** %56
%58 = icmp eq i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)* %57, null
br i1 %58, label %62, label %59
59: ; preds = %55
%60 = tail call i8* %57(%struct.TYPE_12__* %15, %struct.TYPE_13__* %1, i8* %4)
%61 = icmp eq i8* %60, null
br i1 %61, label %100, label %87
62: ; preds = %55
%63 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %15, i64 0, i32 2
%64 = load i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)*, i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)** %63
%65 = icmp eq i8* (%struct.TYPE_12__*, %struct.TYPE_13__*, i8*)* %64, null
br i1 %65, label %81, label %66
66: ; preds = %62
%67 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %1, i64 0, i32 1
%68 = load i32, i32* %67
%69 = icmp eq i32 %68, 0
br i1 %69, label %74, label %70
70: ; preds = %66
%71 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %1, i64 0, i32 0
%72 = load i32, i32* %71
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %78
74: ; preds = %70, %66
%75 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%76 = load i32, i32* @X509V3_R_NO_CONFIG_DATABASE
%77 = tail call i32 @X509V3err(i32 %75, i32 %76)
br label %100
78: ; preds = %70
%79 = tail call i8* %64(%struct.TYPE_12__* %15, %struct.TYPE_13__* %1, i8* %4)
%80 = icmp eq i8* %79, null
br i1 %80, label %100, label %87
81: ; preds = %62
%82 = load i32, i32* @X509V3_F_DO_EXT_NCONF
%83 = load i32, i32* @X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED
%84 = tail call i32 @X509V3err(i32 %82, i32 %83)
%85 = tail call i32 @OBJ_nid2sn(i32 %2)
%86 = 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 %85)
br label %100
87: ; preds = %59, %78, %53
%88 = phi i8* [ %46, %53 ], [ %60, %59 ], [ %79, %78 ]
%89 = tail call i32* @do_ext_i2d(%struct.TYPE_12__* %15, i32 %2, i32 %3, i8* %88)
%90 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %15, i64 0, i32 1
%91 = load i64, i64* %90
%92 = icmp eq i64 %91, 0
br i1 %92, label %96, label %93
93: ; preds = %87
%94 = tail call i32 @ASN1_ITEM_ptr(i64 %91)
%95 = tail call i32 @ASN1_item_free(i8* %88, i32 %94)
br label %100
96: ; preds = %87
%97 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %15, i64 0, i32 0
%98 = load i32 (i8*)*, i32 (i8*)** %97
%99 = tail call i32 %98(i8* %88)
br label %100
100: ; preds = %93, %96, %78, %59, %53, %81, %74, %37, %17, %10
%101 = phi i32* [ null, %10 ], [ null, %37 ], [ null, %74 ], [ null, %81 ], [ null, %17 ], [ null, %53 ], [ null, %59 ], [ null, %78 ], [ %89, %96 ], [ %89, %93 ]
ret i32* %101
}