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

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ (*init)(int /*<<< orphan*/ *);
};
typedef TYPE_1__ CONF_METHOD;
typedef int /*<<< orphan*/ CONF;

/* Variables and functions */
int /*<<< orphan*/ OPENSSL_free(int /*<<< orphan*/ *);
scalar_t__ OPENSSL_malloc(int);
scalar_t__ stub1(int /*<<< orphan*/ *);
CONF *def_create(CONF_METHOD *meth) {
  CONF *ret;
  ret = (CONF *)OPENSSL_malloc(sizeof(CONF) + sizeof(unsigned short *));
  if (ret)
    if (meth->init(ret) == 0) {
      OPENSSL_free(ret);
      ret = NULL;
    }
  return ret;
}


x86 assembly (clang, -O0):
<def_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc,%edi
call   1030 <OPENSSL_malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1172 <def_create+0x52>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
cmp    $0x0,%rax
jne    116d <def_create+0x4d>
mov    -0x10(%rbp),%rdi
call   1040 <OPENSSL_free@plt>
movq   $0x0,-0x10(%rbp)
jmp    1172 <def_create+0x52>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<def_create>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xc,%edi
call   1030 <OPENSSL_malloc@plt>
test   %rax,%rax
je     114c <def_create+0x2c>
mov    %rax,%rbx
mov    %rax,%rdi
call   *(%r14)
test   %rax,%rax
jne    114e <def_create+0x2e>
mov    %rbx,%rdi
call   1040 <OPENSSL_free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 (i32*)* }
define i32* @def_create(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
%3 = alloca i32*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%4 = call i64 @OPENSSL_malloc(i32 12)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %19
8: ; preds = %1
%9 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
%11 = load i64 (i32*)*, i64 (i32*)** %10
%12 = load i32*, i32** %3
%13 = call i64 %11(i32* %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %8
%16 = load i32*, i32** %3
%17 = call i32 @OPENSSL_free(i32* %16)
store i32* null, i32** %3
br label %18
18: ; preds = %15, %8
br label %19
19: ; preds = %18, %1
%20 = load i32*, i32** %3
ret i32* %20
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 (i32*)* }
define i32* @def_create(%struct.TYPE_3__* nocapture %0) {
%2 = tail call i64 @OPENSSL_malloc(i32 12)
%3 = inttoptr i64 %2 to i32*
%4 = icmp eq i64 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %1
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%7 = load i64 (i32*)*, i64 (i32*)** %6
%8 = tail call i64 %7(i32* %3)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = tail call i32 @OPENSSL_free(i32* %3)
br label %12
12: ; preds = %5, %10, %1
%13 = phi i32* [ null, %10 ], [ %3, %5 ], [ null, %1 ]
ret i32* %13
}