#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_pointers(int /*<<< orphan*/ *, char **, char *,
                                         char *);
char **pl_splitlines(char *, int /*<<< orphan*/, int *);
void test_splitlines_empty_params() {
  char **ret_val;
  int size = 0;
  ret_val = pl_splitlines("", 0, &size);
  assert_equal_pointers(NULL, ret_val, "test_splitlines_empty_params",
                        "Test 1: NULL not returned.");
  ret_val = pl_splitlines(NULL, 0, &size);
  assert_equal_pointers(NULL, ret_val, "test_splitlines_empty_params",
                        "Test 2: NULL not returned.");
  ret_val = pl_splitlines("shortstringwithnolines", 0, &size);
  assert_equal_pointers(NULL, ret_val, "test_splitlines_empty_params",
                        "Test 3: NULL not returned.");
}


x86 assembly (clang, -O0):
<test_splitlines_empty_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
lea    0xf01(%rip),%rdi
xor    %esi,%esi
lea    -0xc(%rbp),%rdx
call   1040 <pl_splitlines@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    0xeac(%rip),%rdx
lea    0xec2(%rip),%rcx
call   1030 <assert_equal_pointers@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    -0xc(%rbp),%rdx
call   1040 <pl_splitlines@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    0xe7e(%rip),%rdx
lea    0xeaf(%rip),%rcx
call   1030 <assert_equal_pointers@plt>
lea    0xebe(%rip),%rdi
xor    %esi,%esi
lea    -0xc(%rbp),%rdx
call   1040 <pl_splitlines@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    0xe4d(%rip),%rdx
lea    0xeb0(%rip),%rcx
call   1030 <assert_equal_pointers@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_splitlines_empty_params>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xf04(%rip),%rdi
lea    0x4(%rsp),%rbx
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <pl_splitlines@plt>
lea    0xeb7(%rip),%r14
lea    0xecd(%rip),%rcx
xor    %edi,%edi
mov    %rax,%rsi
mov    %r14,%rdx
call   1030 <assert_equal_pointers@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <pl_splitlines@plt>
lea    0xec8(%rip),%rcx
xor    %edi,%edi
mov    %rax,%rsi
mov    %r14,%rdx
call   1030 <assert_equal_pointers@plt>
lea    0xecf(%rip),%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <pl_splitlines@plt>
lea    0xed5(%rip),%rcx
xor    %edi,%edi
mov    %rax,%rsi
mov    %r14,%rdx
call   1030 <assert_equal_pointers@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [29 x i8] c"test_splitlines_empty_params\00"
@.str.2 = [27 x i8] c"Test 1: NULL not returned.\00"
@.str.3 = [27 x i8] c"Test 2: NULL not returned.\00"
@.str.4 = [23 x i8] c"shortstringwithnolines\00"
@.str.5 = [27 x i8] c"Test 3: NULL not returned.\00"
define void @test_splitlines_empty_params() {
%1 = alloca i8**
%2 = alloca i32
store i32 0, i32* %2
%3 = call i8** @pl_splitlines(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0, i32* %2)
store i8** %3, i8*** %1
%4 = load i8**, i8*** %1
%5 = call i32 @assert_equal_pointers(i32* null, i8** %4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%6 = call i8** @pl_splitlines(i8* null, i32 0, i32* %2)
store i8** %6, i8*** %1
%7 = load i8**, i8*** %1
%8 = call i32 @assert_equal_pointers(i32* null, i8** %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%9 = call i8** @pl_splitlines(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 0, i32* %2)
store i8** %9, i8*** %1
%10 = load i8**, i8*** %1
%11 = call i32 @assert_equal_pointers(i32* null, i8** %10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [29 x i8] c"test_splitlines_empty_params\00"
@.str.2 = [27 x i8] c"Test 1: NULL not returned.\00"
@.str.3 = [27 x i8] c"Test 2: NULL not returned.\00"
@.str.4 = [23 x i8] c"shortstringwithnolines\00"
@.str.5 = [27 x i8] c"Test 3: NULL not returned.\00"
define void @test_splitlines_empty_params() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i8** @pl_splitlines(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0, i32* %1)
%4 = call i32 @assert_equal_pointers(i32* null, i8** %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%5 = call i8** @pl_splitlines(i8* null, i32 0, i32* %1)
%6 = call i32 @assert_equal_pointers(i32* null, i8** %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%7 = call i8** @pl_splitlines(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 0, i32* %1)
%8 = call i32 @assert_equal_pointers(i32* null, i8** %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
ret void
}