#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 */

/* Type definitions */
typedef int /*<<< orphan*/ X509_EXTENSION;
typedef int /*<<< orphan*/ X509V3_CTX;
typedef int /*<<< orphan*/ CONF;

/* Variables and functions */
int /*<<< orphan*/ OBJ_nid2sn(int);
int /*<<< orphan*/ *do_ext_nconf(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int, int, char const *);
int v3_check_critical(char const **);
int v3_check_generic(char const **);
int /*<<< orphan*/ *v3_generic_extension(int /*<<< orphan*/, char const *, int,
                                         int, int /*<<< orphan*/ *);
X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid,
                                     const char *value) {
  int crit;
  int ext_type;
  crit = v3_check_critical(&value);
  if ((ext_type = v3_check_generic(&value)))
    return v3_generic_extension(OBJ_nid2sn(ext_nid), value, crit, ext_type,
                                ctx);
  return do_ext_nconf(conf, ctx, ext_nid, crit, value);
}


x86 assembly (clang, -O0):
<X509V3_EXT_nconf_nid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
call   1070 <v3_check_critical@plt>
mov    %eax,-0x2c(%rbp)
lea    -0x28(%rbp),%rdi
call   1060 <v3_check_generic@plt>
mov    %eax,-0x30(%rbp)
cmp    $0x0,%eax
je     11ae <X509V3_EXT_nconf_nid+0x5e>
mov    -0x1c(%rbp),%edi
call   1030 <OBJ_nid2sn@plt>
mov    %eax,%edi
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x30(%rbp),%ecx
mov    -0x18(%rbp),%r8
call   1050 <v3_generic_extension@plt>
mov    %rax,-0x8(%rbp)
jmp    11c9 <X509V3_EXT_nconf_nid+0x79>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    -0x28(%rbp),%r8
call   1040 <do_ext_nconf@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509V3_EXT_nconf_nid>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r12d
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rcx,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <v3_check_critical@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <v3_check_generic@plt>
test   %eax,%eax
je     11a4 <X509V3_EXT_nconf_nid+0x54>
mov    %eax,%ebx
mov    %r12d,%edi
call   1030 <OBJ_nid2sn@plt>
mov    0x8(%rsp),%rsi
mov    %eax,%edi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %r14,%r8
call   1050 <v3_generic_extension@plt>
jmp    11b9 <X509V3_EXT_nconf_nid+0x69>
mov    0x8(%rsp),%r8
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12d,%edx
mov    %ebp,%ecx
call   1040 <do_ext_nconf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32* @X509V3_EXT_nconf_nid(i32* %0, i32* %1, i32 %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
%12 = call i32 @v3_check_critical(i8** %9)
store i32 %12, i32* %10
%13 = call i32 @v3_check_generic(i8** %9)
store i32 %13, i32* %11
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %4
%16 = load i32, i32* %8
%17 = call i32 @OBJ_nid2sn(i32 %16)
%18 = load i8*, i8** %9
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32*, i32** %7
%22 = call i32* @v3_generic_extension(i32 %17, i8* %18, i32 %19, i32 %20, i32* %21)
store i32* %22, i32** %5
br label %30
23: ; preds = %4
%24 = load i32*, i32** %6
%25 = load i32*, i32** %7
%26 = load i32, i32* %8
%27 = load i32, i32* %10
%28 = load i8*, i8** %9
%29 = call i32* @do_ext_nconf(i32* %24, i32* %25, i32 %26, i32 %27, i8* %28)
store i32* %29, i32** %5
br label %30
30: ; preds = %23, %15
%31 = load i32*, i32** %5
ret i32* %31
}

LLVM IR (-O2):
define i32* @X509V3_EXT_nconf_nid(i32* %0, i32* %1, i32 %2, i8* %3) {
%5 = alloca i8*
store i8* %3, i8** %5
%6 = call i32 @v3_check_critical(i8** %5)
%7 = call i32 @v3_check_generic(i8** %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = call i32 @OBJ_nid2sn(i32 %2)
%11 = load i8*, i8** %5
%12 = call i32* @v3_generic_extension(i32 %10, i8* %11, i32 %6, i32 %7, i32* %1)
br label %16
13: ; preds = %4
%14 = load i8*, i8** %5
%15 = call i32* @do_ext_nconf(i32* %0, i32* %1, i32 %2, i32 %6, i8* %14)
br label %16
16: ; preds = %13, %9
%17 = phi i32* [ %12, %9 ], [ %15, %13 ]
ret i32* %17
}