#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 */
struct t_infolist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ config_file_add_to_infolist(struct t_infolist *,
                                               char const *);
int /*<<< orphan*/ infolist_free(struct t_infolist *);
struct t_infolist *infolist_new(int /*<<< orphan*/ *);
struct t_infolist *plugin_api_infolist_option_cb(const void *pointer,
                                                 void *data,
                                                 const char *infolist_name,
                                                 void *obj_pointer,
                                                 const char *arguments) {
  struct t_infolist *ptr_infolist;
  (void)pointer;
  (void)data;
  (void)infolist_name;
  (void)obj_pointer;
  ptr_infolist = infolist_new(NULL);
  if (!ptr_infolist)
    return NULL;
  if (!config_file_add_to_infolist(ptr_infolist, arguments)) {
    infolist_free(ptr_infolist);
    return NULL;
  }
  return ptr_infolist;
}


x86 assembly (clang, -O0):
<plugin_api_infolist_option_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <infolist_new@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1171 <plugin_api_infolist_option_cb+0x41>
movq   $0x0,-0x8(%rbp)
jmp    11a5 <plugin_api_infolist_option_cb+0x75>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <config_file_add_to_infolist@plt>
cmp    $0x0,%eax
jne    119d <plugin_api_infolist_option_cb+0x6d>
mov    -0x38(%rbp),%rdi
call   1050 <infolist_free@plt>
movq   $0x0,-0x8(%rbp)
jmp    11a5 <plugin_api_infolist_option_cb+0x75>
mov    -0x38(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_infolist_option_cb>:
push   %r15
push   %r14
push   %rbx
mov    %r8,%r15
xor    %r14d,%r14d
xor    %edi,%edi
call   1030 <infolist_new@plt>
test   %rax,%rax
je     1169 <plugin_api_infolist_option_cb+0x39>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1040 <config_file_add_to_infolist@plt>
test   %eax,%eax
je     115e <plugin_api_infolist_option_cb+0x2e>
mov    %rbx,%r14
jmp    1169 <plugin_api_infolist_option_cb+0x39>
mov    %rbx,%rdi
call   1050 <infolist_free@plt>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.t_infolist = type { i32 }
define %struct.t_infolist* @plugin_api_infolist_option_cb(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca %struct.t_infolist*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca %struct.t_infolist*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = call %struct.t_infolist* @infolist_new(i32* null)
store %struct.t_infolist* %17, %struct.t_infolist** %12
%18 = load %struct.t_infolist*, %struct.t_infolist** %12
%19 = icmp ne %struct.t_infolist* %18, null
br i1 %19, label %21, label %20
20: ; preds = %5
store %struct.t_infolist* null, %struct.t_infolist** %6
br label %31
21: ; preds = %5
%22 = load %struct.t_infolist*, %struct.t_infolist** %12
%23 = load i8*, i8** %11
%24 = call i32 @config_file_add_to_infolist(%struct.t_infolist* %22, i8* %23)
%25 = icmp ne i32 %24, 0
br i1 %25, label %29, label %26
26: ; preds = %21
%27 = load %struct.t_infolist*, %struct.t_infolist** %12
%28 = call i32 @infolist_free(%struct.t_infolist* %27)
store %struct.t_infolist* null, %struct.t_infolist** %6
br label %31
29: ; preds = %21
%30 = load %struct.t_infolist*, %struct.t_infolist** %12
store %struct.t_infolist* %30, %struct.t_infolist** %6
br label %31
31: ; preds = %29, %26, %20
%32 = load %struct.t_infolist*, %struct.t_infolist** %6
ret %struct.t_infolist* %32
}

LLVM IR (-O2):
%struct.t_infolist = type { i32 }
define %struct.t_infolist* @plugin_api_infolist_option_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* %4) {
%6 = tail call %struct.t_infolist* @infolist_new(i32* null)
%7 = icmp eq %struct.t_infolist* %6, null
br i1 %7, label %13, label %8
8: ; preds = %5
%9 = tail call i32 @config_file_add_to_infolist(%struct.t_infolist* %6, i8* %4)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @infolist_free(%struct.t_infolist* %6)
br label %13
13: ; preds = %8, %5, %11
%14 = phi %struct.t_infolist* [ null, %11 ], [ null, %5 ], [ %6, %8 ]
ret %struct.t_infolist* %14
}