#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 section {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *get_section_value(char const *, struct section const *);
char **split_delimiter(char *, char const *);
char **get_section_values_delimiter(const char *key, const struct section *cfg,
                                    const char *delim) {
  if (key == NULL || cfg == NULL || delim == NULL) {
    return NULL;
  }
  char *value = get_section_value(key, cfg);
  char **split_values = split_delimiter(value, delim);
  if (value) {
    free(value);
  }
  return split_values;
}


x86 assembly (clang, -O0):
<get_section_values_delimiter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1165 <get_section_values_delimiter+0x35>
cmpq   $0x0,-0x18(%rbp)
je     1165 <get_section_values_delimiter+0x35>
cmpq   $0x0,-0x20(%rbp)
jne    1172 <get_section_values_delimiter+0x42>
movq   $0x0,-0x8(%rbp)
jmp    11b0 <get_section_values_delimiter+0x80>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <get_section_value@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <split_delimiter@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     11a8 <get_section_values_delimiter+0x78>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_section_values_delimiter>:
push   %r15
push   %r14
push   %rbx
xor    %r14d,%r14d
test   %rdi,%rdi
je     116d <get_section_values_delimiter+0x3d>
test   %rsi,%rsi
je     116d <get_section_values_delimiter+0x3d>
mov    %rdx,%r15
test   %rdx,%rdx
je     116d <get_section_values_delimiter+0x3d>
call   1040 <get_section_value@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1050 <split_delimiter@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     116d <get_section_values_delimiter+0x3d>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct.section = type { i32 }
define i8** @get_section_values_delimiter(i8* %0, %struct.section* %1, i8* %2) {
%4 = icmp eq i8* %0, null
%5 = icmp eq %struct.section* %1, null
%6 = or i1 %4, %5
%7 = icmp eq i8* %2, null
%8 = or i1 %6, %7
br i1 %8, label %15, label %9
9: ; preds = %3
%10 = tail call i8* @get_section_value(i8* %0, %struct.section* %1)
%11 = tail call i8** @split_delimiter(i8* %10, i8* %2)
%12 = icmp eq i8* %10, null
br i1 %12, label %15, label %13
13: ; preds = %9
%14 = tail call i32 @free(i8* %10)
br label %15
15: ; preds = %9, %13, %3
%16 = phi i8** [ null, %3 ], [ %11, %13 ], [ %11, %9 ]
ret i8** %16
}