#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_equal_str(int /*<<< orphan*/ *, char *, char *,
                                    char *);
char **pl_split(char *, char *, int *);
void test_split_empty_paras() {
  char **ret_val;
  int size = 0;
  ret_val = pl_split("", " ", &size);
  assert_equal_str(NULL, (char *)ret_val, "test_split_empty_paras",
                   "Test 1: NULL not returned.");
  ret_val = pl_split(NULL, " ", &size);
  assert_equal_str(NULL, (char *)ret_val, "test_split_empty_paras",
                   "Test 2: NULL not returned");
  ret_val = pl_split("asd asd", "", &size);
  assert_equal_str(NULL, (char *)ret_val, "test_split_empty_paras",
                   "Test 3: NULL not returned.");
  ret_val = pl_split("asd asd", NULL, &size);
  assert_equal_str(NULL, (char *)ret_val, "test_split_empty_paras",
                   "Test 4: NULL not returned.");
  ret_val = pl_split("asd asd", " ", NULL);
  assert_equal_str(NULL, (char *)ret_val, "test_split_empty_paras",
                   "Test 5: NULL not returned.");
}


x86 assembly (clang, -O0):
<test_split_empty_paras>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
lea    0xecb(%rip),%rdi
lea    0xec3(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <pl_split@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    0xea9(%rip),%rdx
lea    0xeb9(%rip),%rcx
call   1030 <assert_equal_str@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe90(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <pl_split@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    0xe76(%rip),%rdx
lea    0xea1(%rip),%rcx
call   1030 <assert_equal_str@plt>
lea    0xeaf(%rip),%rdi
lea    0xe5b(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <pl_split@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    0xe40(%rip),%rdx
lea    0xe8d(%rip),%rcx
call   1030 <assert_equal_str@plt>
lea    0xe79(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    -0xc(%rbp),%rdx
call   1040 <pl_split@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    0xe0d(%rip),%rdx
lea    0xe75(%rip),%rcx
call   1030 <assert_equal_str@plt>
lea    0xe46(%rip),%rdi
lea    0xdf1(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <pl_split@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    0xdd7(%rip),%rdx
lea    0xe5a(%rip),%rcx
call   1030 <assert_equal_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_split_empty_paras>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xec5(%rip),%r12
lea    0xebd(%rip),%r14
lea    0xc(%rsp),%r15
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <pl_split@plt>
lea    0xea5(%rip),%r13
lea    0xeb5(%rip),%rcx
xor    %edi,%edi
mov    %rax,%rsi
mov    %r13,%rdx
call   1030 <assert_equal_str@plt>
xor    %edi,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <pl_split@plt>
lea    0xeaf(%rip),%rcx
xor    %edi,%edi
mov    %rax,%rsi
mov    %r13,%rdx
call   1030 <assert_equal_str@plt>
lea    0xeb5(%rip),%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1040 <pl_split@plt>
lea    0xea8(%rip),%rcx
xor    %edi,%edi
mov    %rax,%rsi
mov    %r13,%rdx
call   1030 <assert_equal_str@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r15,%rdx
call   1040 <pl_split@plt>
lea    0xea2(%rip),%rcx
xor    %edi,%edi
mov    %rax,%rsi
mov    %r13,%rdx
call   1030 <assert_equal_str@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <pl_split@plt>
lea    0xe9c(%rip),%rcx
xor    %edi,%edi
mov    %rax,%rsi
mov    %r13,%rdx
call   1030 <assert_equal_str@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c" \00"
@.str.2 = [23 x i8] c"test_split_empty_paras\00"
@.str.3 = [27 x i8] c"Test 1: NULL not returned.\00"
@.str.4 = [26 x i8] c"Test 2: NULL not returned\00"
@.str.5 = [8 x i8] c"asd asd\00"
@.str.6 = [27 x i8] c"Test 3: NULL not returned.\00"
@.str.7 = [27 x i8] c"Test 4: NULL not returned.\00"
@.str.8 = [27 x i8] c"Test 5: NULL not returned.\00"
define void @test_split_empty_paras() {
%1 = alloca i8**
%2 = alloca i32
store i32 0, i32* %2
%3 = call i8** @pl_split(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %2)
store i8** %3, i8*** %1
%4 = load i8**, i8*** %1
%5 = bitcast i8** %4 to i8*
%6 = call i32 @assert_equal_str(i32* null, i8* %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%7 = call i8** @pl_split(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %2)
store i8** %7, i8*** %1
%8 = load i8**, i8*** %1
%9 = bitcast i8** %8 to i8*
%10 = call i32 @assert_equal_str(i32* null, i8* %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%11 = call i8** @pl_split(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32* %2)
store i8** %11, i8*** %1
%12 = load i8**, i8*** %1
%13 = bitcast i8** %12 to i8*
%14 = call i32 @assert_equal_str(i32* null, i8* %13, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%15 = call i8** @pl_split(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* null, i32* %2)
store i8** %15, i8*** %1
%16 = load i8**, i8*** %1
%17 = bitcast i8** %16 to i8*
%18 = call i32 @assert_equal_str(i32* null, i8* %17, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%19 = call i8** @pl_split(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* null)
store i8** %19, i8*** %1
%20 = load i8**, i8*** %1
%21 = bitcast i8** %20 to i8*
%22 = call i32 @assert_equal_str(i32* null, i8* %21, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c" \00"
@.str.2 = [23 x i8] c"test_split_empty_paras\00"
@.str.3 = [27 x i8] c"Test 1: NULL not returned.\00"
@.str.4 = [26 x i8] c"Test 2: NULL not returned\00"
@.str.5 = [8 x i8] c"asd asd\00"
@.str.6 = [27 x i8] c"Test 3: NULL not returned.\00"
@.str.7 = [27 x i8] c"Test 4: NULL not returned.\00"
@.str.8 = [27 x i8] c"Test 5: NULL not returned.\00"
define void @test_split_empty_paras() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i8** @pl_split(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = bitcast i8** %3 to i8*
%5 = call i32 @assert_equal_str(i32* null, i8* %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%6 = call i8** @pl_split(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = bitcast i8** %6 to i8*
%8 = call i32 @assert_equal_str(i32* null, i8* %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%9 = call i8** @pl_split(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = bitcast i8** %9 to i8*
%11 = call i32 @assert_equal_str(i32* null, i8* %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%12 = call i8** @pl_split(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* null, i32* %1)
%13 = bitcast i8** %12 to i8*
%14 = call i32 @assert_equal_str(i32* null, i8* %13, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%15 = call i8** @pl_split(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* null)
%16 = bitcast i8** %15 to i8*
%17 = call i32 @assert_equal_str(i32* null, i8* %16, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
ret void
}