#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*/ assert(void *);
scalar_t__ isempty(char const *);
int str_to_strv(char const *, char ***, char *);
int strv_attach(char **, char **, char ***, int);
int config_parse_strv(const char *filename, unsigned line, const char *section,
                      const char *lvalue, int ltype, const char *rvalue,
                      void *data) {
  char ***strv = data;
  char **o = NULL, **v = NULL, **vv = NULL;
  int r;
  assert(filename);
  assert(lvalue);
  assert(rvalue);
  assert(data);
  if (isempty(rvalue))
    return 0;
  r = str_to_strv(rvalue, &v, " \t\n\r");
  if (r < 0)
    return r;
  o = *strv;
  r = strv_attach(o, v, &vv, true);
  if (r < 0)
    return r;
  *strv = vv;
  return 0;
}


x86 assembly (clang, -O0):
<config_parse_strv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9,-0x38(%rbp)
mov    0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x28(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x38(%rbp),%rdi
call   1040 <assert@plt>
mov    0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x38(%rbp),%rdi
call   1060 <isempty@plt>
cmp    $0x0,%rax
je     11c6 <config_parse_strv+0x86>
movl   $0x0,-0x4(%rbp)
jmp    123d <config_parse_strv+0xfd>
mov    -0x38(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    0xe2b(%rip),%rdx
call   1030 <str_to_strv@plt>
mov    %eax,-0x5c(%rbp)
cmpl   $0x0,-0x5c(%rbp)
jge    11f2 <config_parse_strv+0xb2>
mov    -0x5c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    123d <config_parse_strv+0xfd>
mov    -0x40(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x50(%rbp),%rsi
lea    -0x58(%rbp),%rdx
mov    $0x1,%ecx
call   1050 <strv_attach@plt>
mov    %eax,-0x5c(%rbp)
cmpl   $0x0,-0x5c(%rbp)
jge    122b <config_parse_strv+0xeb>
mov    -0x5c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    123d <config_parse_strv+0xfd>
mov    -0x58(%rbp),%rcx
mov    -0x40(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_parse_strv>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %r9,%rbx
mov    %rcx,%rbp
mov    0x30(%rsp),%r14
movq   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
call   1040 <assert@plt>
mov    %rbp,%rdi
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1040 <assert@plt>
mov    %r14,%rdi
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1060 <isempty@plt>
xor    %ebp,%ebp
test   %rax,%rax
jne    11cc <config_parse_strv+0x8c>
lea    0xe69(%rip),%rdx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <str_to_strv@plt>
test   %eax,%eax
js     11ca <config_parse_strv+0x8a>
mov    (%r14),%rdi
mov    0x8(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x1,%ecx
call   1050 <strv_attach@plt>
test   %eax,%eax
js     11ca <config_parse_strv+0x8a>
mov    (%rsp),%rax
mov    %rax,(%r14)
jmp    11cc <config_parse_strv+0x8c>
mov    %eax,%ebp
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c" \09\0A\0D\00"
define i32 @config_parse_strv(i8* %0, i32 %1, i8* %2, i8* %3, i32 %4, i8* %5, i8* %6) {
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8***
%17 = alloca i8**
%18 = alloca i8**
%19 = alloca i8**
%20 = alloca i32
store i8* %0, i8** %9
store i32 %1, i32* %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i32 %4, i32* %13
store i8* %5, i8** %14
store i8* %6, i8** %15
%21 = load i8*, i8** %15
%22 = bitcast i8* %21 to i8***
store i8*** %22, i8**** %16
store i8** null, i8*** %17
store i8** null, i8*** %18
store i8** null, i8*** %19
%23 = load i8*, i8** %9
%24 = call i32 @assert(i8* %23)
%25 = load i8*, i8** %12
%26 = call i32 @assert(i8* %25)
%27 = load i8*, i8** %14
%28 = call i32 @assert(i8* %27)
%29 = load i8*, i8** %15
%30 = call i32 @assert(i8* %29)
%31 = load i8*, i8** %14
%32 = call i64 @isempty(i8* %31)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %7
store i32 0, i32* %8
br label %55
35: ; preds = %7
%36 = load i8*, i8** %14
%37 = call i32 @str_to_strv(i8* %36, i8*** %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %37, i32* %20
%38 = load i32, i32* %20
%39 = icmp slt i32 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %35
%41 = load i32, i32* %20
store i32 %41, i32* %8
br label %55
42: ; preds = %35
%43 = load i8***, i8**** %16
%44 = load i8**, i8*** %43
store i8** %44, i8*** %17
%45 = load i8**, i8*** %17
%46 = load i8**, i8*** %18
%47 = call i32 @strv_attach(i8** %45, i8** %46, i8*** %19, i32 1)
store i32 %47, i32* %20
%48 = load i32, i32* %20
%49 = icmp slt i32 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %42
%51 = load i32, i32* %20
store i32 %51, i32* %8
br label %55
52: ; preds = %42
%53 = load i8**, i8*** %19
%54 = load i8***, i8**** %16
store i8** %53, i8*** %54
store i32 0, i32* %8
br label %55
55: ; preds = %52, %50, %40, %34
%56 = load i32, i32* %8
ret i32 %56
}

LLVM IR (-O2):
@.str = [5 x i8] c" \09\0A\0D\00"
define i32 @config_parse_strv(i8* %0, i32 %1, i8* nocapture readnone %2, i8* %3, i32 %4, i8* %5, i8* %6) {
%8 = alloca i8**
%9 = alloca i8**
%10 = bitcast i8* %6 to i8***
%11 = bitcast i8*** %8 to i8*
store i8** null, i8*** %8
%12 = bitcast i8*** %9 to i8*
store i8** null, i8*** %9
%13 = tail call i32 @assert(i8* %0)
%14 = tail call i32 @assert(i8* %3)
%15 = tail call i32 @assert(i8* %5)
%16 = tail call i32 @assert(i8* %6)
%17 = tail call i64 @isempty(i8* %5)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %29
19: ; preds = %7
%20 = call i32 @str_to_strv(i8* %5, i8*** %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%21 = icmp slt i32 %20, 0
br i1 %21, label %29, label %22
22: ; preds = %19
%23 = load i8**, i8*** %10
%24 = load i8**, i8*** %8
%25 = call i32 @strv_attach(i8** %23, i8** %24, i8*** %9, i32 1)
%26 = icmp slt i32 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %22
%28 = load i8**, i8*** %9
store i8** %28, i8*** %10
br label %29
29: ; preds = %22, %19, %7, %27
%30 = phi i32 [ 0, %27 ], [ 0, %7 ], [ %20, %19 ], [ %25, %22 ]
ret i32 %30
}