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

/* Variables and functions */
int /*<<< orphan*/ free_mem(char *);
scalar_t__ get_value_by_key(char **, char *, char *const *);
scalar_t__ str_split(char ***, char *, char *, int);
int get_toyfile_list(char ***file_list, char *const *line_list) {
  if (NULL == line_list) {
    return -1;
  }
  char *value = NULL;
  if (get_value_by_key(&value, "toyfile", line_list) < 0) {
    ;
    return -1;
  };
  ;
  if (str_split(file_list, value, ", \t", 1) < 0) {
    ;
  }
  free_mem(value);
  return 0;
}


x86 assembly (clang, -O0):
<get_toyfile_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    1158 <get_toyfile_list+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c2 <get_toyfile_list+0x92>
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1030 <get_value_by_key@plt>
cmp    $0x0,%rax
jge    118a <get_toyfile_list+0x5a>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c2 <get_toyfile_list+0x92>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    0xe6f(%rip),%rdx
mov    $0x1,%ecx
call   1040 <str_split@plt>
cmp    $0x0,%rax
jge    11b2 <get_toyfile_list+0x82>
jmp    11b2 <get_toyfile_list+0x82>
mov    -0x20(%rbp),%rdi
call   1050 <free_mem@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_toyfile_list>:
test   %rsi,%rsi
je     1186 <get_toyfile_list+0x56>
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rdx
mov    %rdi,%rbx
movq   $0x0,0x8(%rsp)
lea    0xeb0(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1030 <get_value_by_key@plt>
test   %rax,%rax
js     118c <get_toyfile_list+0x5c>
mov    0x8(%rsp),%rsi
lea    0xe9d(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1,%ecx
call   1040 <str_split@plt>
mov    0x8(%rsp),%rdi
call   1050 <free_mem@plt>
xor    %eax,%eax
jmp    1191 <get_toyfile_list+0x61>
mov    $0xffffffff,%eax
ret
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"toyfile\00"
@.str.1 = [4 x i8] c", \09\00"
define i32 @get_toyfile_list(i8*** %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8***
%5 = alloca i8**
%6 = alloca i8*
store i8*** %0, i8**** %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = icmp eq i8** null, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %24
10: ; preds = %2
store i8* null, i8** %6
%11 = load i8**, i8*** %5
%12 = call i64 @get_value_by_key(i8** %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %11)
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 -1, i32* %3
br label %24
15: ; preds = %10
%16 = load i8***, i8**** %4
%17 = load i8*, i8** %6
%18 = call i64 @str_split(i8*** %16, i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
%19 = icmp slt i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %15
br label %21
21: ; preds = %20, %15
%22 = load i8*, i8** %6
%23 = call i32 @free_mem(i8* %22)
store i32 0, i32* %3
br label %24
24: ; preds = %21, %14, %9
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@.str = [8 x i8] c"toyfile\00"
@.str.1 = [4 x i8] c", \09\00"
define i32 @get_toyfile_list(i8*** %0, i8** %1) {
%3 = alloca i8*
%4 = icmp eq i8** %1, null
br i1 %4, label %16, label %5
5: ; preds = %2
%6 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%7 = call i64 @get_value_by_key(i8** %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %1)
%8 = icmp slt i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = call i64 @str_split(i8*** %0, i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
%12 = load i8*, i8** %3
%13 = call i32 @free_mem(i8* %12)
br label %14
14: ; preds = %5, %9
%15 = phi i32 [ 0, %9 ], [ -1, %5 ]
br label %16
16: ; preds = %2, %14
%17 = phi i32 [ %15, %14 ], [ -1, %2 ]
ret i32 %17
}