#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 const *);
  void *(*s2i)(TYPE_1__ const *, TYPE_2__ *, char const *);
  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_free(void *, scalar_t__);
int /*<<< orphan*/ CONF_VALUE;
int /*<<< orphan*/ ERR_asprintf_error_data(char *, int /*<<< orphan*/, ...);
int NCONF_get_section(int /*<<< orphan*/ *, char const *);
int NID_undef;
int /*<<< orphan*/ OBJ_nid2sn(int);
int STACK_OF(int /*<<< orphan*/);
TYPE_1__ *X509V3_EXT_get_nid(int);
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 const *);
int /*<<< orphan*/ X509V3error(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 const *);
void *stub3(TYPE_1__ const *, TYPE_2__ *, char const *);
int /*<<< orphan*/ stub4(void *);
X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, int crit,
                             const char *value) {
  const X509V3_EXT_METHOD *method;
  X509_EXTENSION *ext;
  void *ext_struc;
  if (ext_nid == NID_undef) {
    X509V3error(X509V3_R_UNKNOWN_EXTENSION_NAME);
    return NULL;
  }
  if (!(method = X509V3_EXT_get_nid(ext_nid))) {
    X509V3error(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) {
      X509V3error(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) {
      X509V3error(X509V3_R_NO_CONFIG_DATABASE);
      return NULL;
    }
    ext_struc = method->r2i(method, ctx, value);
  } else {
    X509V3error(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, method->it);
  else
    method->ext_free(ext_struc);
  return ext;
}


x86 assembly (clang, -O0):
<do_ext_nconf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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    0x2dd4(%rip),%rcx
cmp    (%rcx),%eax
jne    11f7 <do_ext_nconf+0x47>
mov    0x2db5(%rip),%rax
mov    (%rax),%edi
call   1080 <X509V3error@plt>
movq   $0x0,-0x8(%rbp)
jmp    1483 <do_ext_nconf+0x2d3>
mov    -0x1c(%rbp),%edi
call   10d0 <X509V3_EXT_get_nid@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    1228 <do_ext_nconf+0x78>
mov    0x2dcc(%rip),%rax
mov    (%rax),%edi
call   1080 <X509V3error@plt>
movq   $0x0,-0x8(%rbp)
jmp    1483 <do_ext_nconf+0x2d3>
mov    -0x30(%rbp),%rax
cmpq   $0x0,0x20(%rax)
je     134b <do_ext_nconf+0x19b>
mov    0x2d72(%rip),%rax
mov    (%rax),%edi
call   1040 <STACK_OF@plt>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
jne    1276 <do_ext_nconf+0xc6>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
add    $0x1,%rsi
call   10b0 <NCONF_get_section@plt>
mov    %eax,%ecx
mov    0x2d49(%rip),%rax
mov    %ecx,(%rax)
jmp    128a <do_ext_nconf+0xda>
mov    -0x28(%rbp),%rdi
call   1070 <X509V3_parse_list@plt>
mov    %eax,%ecx
mov    0x2d30(%rip),%rax
mov    %ecx,(%rax)
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
call   1050 <sk_CONF_VALUE_num@plt>
cmp    $0x0,%rax
jg     1300 <do_ext_nconf+0x150>
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
call   1080 <X509V3error@plt>
mov    -0x1c(%rbp),%edi
call   1060 <OBJ_nid2sn@plt>
mov    %eax,%esi
mov    -0x28(%rbp),%rdx
lea    0xd3b(%rip),%rdi
mov    $0x0,%al
call   1030 <ERR_asprintf_error_data@plt>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
je     12f3 <do_ext_nconf+0x143>
mov    0x2cd5(%rip),%rax
mov    (%rax),%edi
mov    0x2cdc(%rip),%rax
mov    (%rax),%esi
call   1090 <sk_CONF_VALUE_pop_free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1483 <do_ext_nconf+0x2d3>
mov    -0x30(%rbp),%rax
mov    0x20(%rax),%rax
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2ca1(%rip),%rcx
mov    (%rcx),%edx
call   *%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
je     1346 <do_ext_nconf+0x196>
mov    0x2c82(%rip),%rax
mov    (%rax),%edi
mov    0x2c89(%rip),%rax
mov    (%rax),%esi
call   1090 <sk_CONF_VALUE_pop_free@plt>
jmp    141a <do_ext_nconf+0x26a>
mov    -0x30(%rbp),%rax
cmpq   $0x0,0x18(%rax)
je     1379 <do_ext_nconf+0x1c9>
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    1415 <do_ext_nconf+0x265>
mov    -0x30(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     13dd <do_ext_nconf+0x22d>
mov    -0x18(%rbp),%rax
cmpl   $0x0,0x4(%rax)
je     13a3 <do_ext_nconf+0x1f3>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jne    13be <do_ext_nconf+0x20e>
mov    0x2c3e(%rip),%rax
mov    (%rax),%edi
call   1080 <X509V3error@plt>
movq   $0x0,-0x8(%rbp)
jmp    1483 <do_ext_nconf+0x2d3>
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    1410 <do_ext_nconf+0x260>
mov    0x2bf4(%rip),%rax
mov    (%rax),%edi
call   1080 <X509V3error@plt>
mov    -0x1c(%rbp),%edi
call   1060 <OBJ_nid2sn@plt>
mov    %eax,%esi
lea    0xc17(%rip),%rdi
mov    $0x0,%al
call   1030 <ERR_asprintf_error_data@plt>
movq   $0x0,-0x8(%rbp)
jmp    1483 <do_ext_nconf+0x2d3>
jmp    1415 <do_ext_nconf+0x265>
jmp    141a <do_ext_nconf+0x26a>
cmpq   $0x0,-0x40(%rbp)
jne    1432 <do_ext_nconf+0x282>
movq   $0x0,-0x8(%rbp)
jmp    1483 <do_ext_nconf+0x2d3>
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     146e <do_ext_nconf+0x2be>
mov    -0x40(%rbp),%rdi
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rsi
call   10c0 <ASN1_item_free@plt>
jmp    147b <do_ext_nconf+0x2cb>
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    $0x40,%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    0x2de6(%rip),%rax
cmp    %edx,(%rax)
jne    11cf <do_ext_nconf+0x1f>
mov    0x2dcb(%rip),%rax
jmp    121d <do_ext_nconf+0x6d>
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     1216 <do_ext_nconf+0x66>
mov    %rax,%r14
cmpq   $0x0,0x20(%rax)
je     1238 <do_ext_nconf+0x88>
mov    0x2db6(%rip),%rax
mov    (%rax),%edi
call   1040 <STACK_OF@plt>
cmpb   $0x40,0x0(%r13)
jne    1255 <do_ext_nconf+0xa5>
lea    0x1(%r13),%rsi
mov    %rbp,%rdi
call   10b0 <NCONF_get_section@plt>
jmp    125d <do_ext_nconf+0xad>
mov    0x2dc3(%rip),%rax
mov    (%rax),%edi
call   1080 <X509V3error@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     131c <do_ext_nconf+0x16c>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   *%rax
mov    %rax,%r12
jmp    129b <do_ext_nconf+0xeb>
mov    %r13,%rdi
call   1070 <X509V3_parse_list@plt>
mov    %eax,%edi
mov    0x2d52(%rip),%rbp
mov    %eax,0x0(%rbp)
call   1050 <sk_CONF_VALUE_num@plt>
test   %rax,%rax
jle    12c9 <do_ext_nconf+0x119>
mov    0x0(%rbp),%edx
mov    %r14,%rdi
mov    %r12,%rsi
call   *0x20(%r14)
mov    %rax,%r12
cmpb   $0x40,0x0(%r13)
je     129b <do_ext_nconf+0xeb>
mov    0x0(%rbp),%edi
mov    0x2d34(%rip),%rax
mov    (%rax),%esi
call   1090 <sk_CONF_VALUE_pop_free@plt>
test   %r12,%r12
je     1224 <do_ext_nconf+0x74>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r12,%rcx
call   10a0 <do_ext_i2d@plt>
mov    %rax,%rbx
mov    0x8(%r14),%rsi
mov    %r12,%rdi
test   %rsi,%rsi
je     1314 <do_ext_nconf+0x164>
call   10c0 <ASN1_item_free@plt>
jmp    1226 <do_ext_nconf+0x76>
mov    0x2d00(%rip),%rax
mov    (%rax),%edi
call   1080 <X509V3error@plt>
mov    %ebx,%edi
call   1060 <OBJ_nid2sn@plt>
lea    0xd1b(%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     1226 <do_ext_nconf+0x76>
mov    0x0(%rbp),%edi
mov    0x2cc0(%rip),%rax
mov    (%rax),%esi
call   1090 <sk_CONF_VALUE_pop_free@plt>
jmp    1224 <do_ext_nconf+0x74>
call   *(%r14)
jmp    1226 <do_ext_nconf+0x76>
mov    0x10(%r14),%rax
test   %rax,%rax
je     1344 <do_ext_nconf+0x194>
cmpl   $0x0,0x4(%r12)
je     1338 <do_ext_nconf+0x188>
cmpl   $0x0,(%r12)
jne    1245 <do_ext_nconf+0x95>
mov    0x2ca9(%rip),%rax
jmp    121d <do_ext_nconf+0x6d>
mov    0x2c8d(%rip),%rax
mov    (%rax),%edi
call   1080 <X509V3error@plt>
mov    %ebx,%edi
call   1060 <OBJ_nid2sn@plt>
lea    0xcb3(%rip),%rdi
xor    %ebx,%ebx
mov    %eax,%esi
xor    %eax,%eax
call   1030 <ERR_asprintf_error_data@plt>
jmp    1226 <do_ext_nconf+0x76>

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

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