#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(void *data,
                                                 const char *infolist_name,
                                                 void *pointer,
                                                 const char *arguments) {
  struct t_infolist *ptr_infolist;
  (void)data;
  (void)infolist_name;
  (void)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    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <infolist_new@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    116d <plugin_api_infolist_option_cb+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    11a1 <plugin_api_infolist_option_cb+0x71>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <config_file_add_to_infolist@plt>
cmp    $0x0,%eax
jne    1199 <plugin_api_infolist_option_cb+0x69>
mov    -0x30(%rbp),%rdi
call   1050 <infolist_free@plt>
movq   $0x0,-0x8(%rbp)
jmp    11a1 <plugin_api_infolist_option_cb+0x71>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_infolist_option_cb>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%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) {
%5 = alloca %struct.t_infolist*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca %struct.t_infolist*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call %struct.t_infolist* @infolist_new(i32* null)
store %struct.t_infolist* %14, %struct.t_infolist** %10
%15 = load %struct.t_infolist*, %struct.t_infolist** %10
%16 = icmp ne %struct.t_infolist* %15, null
br i1 %16, label %18, label %17
17: ; preds = %4
store %struct.t_infolist* null, %struct.t_infolist** %5
br label %28
18: ; preds = %4
%19 = load %struct.t_infolist*, %struct.t_infolist** %10
%20 = load i8*, i8** %9
%21 = call i32 @config_file_add_to_infolist(%struct.t_infolist* %19, i8* %20)
%22 = icmp ne i32 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %18
%24 = load %struct.t_infolist*, %struct.t_infolist** %10
%25 = call i32 @infolist_free(%struct.t_infolist* %24)
store %struct.t_infolist* null, %struct.t_infolist** %5
br label %28
26: ; preds = %18
%27 = load %struct.t_infolist*, %struct.t_infolist** %10
store %struct.t_infolist* %27, %struct.t_infolist** %5
br label %28
28: ; preds = %26, %23, %17
%29 = load %struct.t_infolist*, %struct.t_infolist** %5
ret %struct.t_infolist* %29
}

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* %3) {
%5 = tail call %struct.t_infolist* @infolist_new(i32* null)
%6 = icmp eq %struct.t_infolist* %5, null
br i1 %6, label %12, label %7
7: ; preds = %4
%8 = tail call i32 @config_file_add_to_infolist(%struct.t_infolist* %5, i8* %3)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @infolist_free(%struct.t_infolist* %5)
br label %12
12: ; preds = %7, %4, %10
%13 = phi %struct.t_infolist* [ null, %10 ], [ null, %4 ], [ %5, %7 ]
ret %struct.t_infolist* %13
}