#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_slice(char *, int, int);
void test_slice_empty_string() {
  char *ret_val;
  ret_val = pl_slice("", 1, 3);
  assert_equal_str(NULL, ret_val, "test_slice_empty_string",
                   "Test 1: NULL not returned.");
  ret_val = pl_slice(NULL, 1, 3);
  assert_equal_str(NULL, ret_val, "test_slice_empty_string",
                   "Test 2: NULL not returned.");
}


x86 assembly (clang, -O0):
<test_slice_empty_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xf03(%rip),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1040 <pl_slice@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    0xeaf(%rip),%rdx
lea    0xec0(%rip),%rcx
call   1030 <assert_equal_str@plt>
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1,%esi
mov    $0x3,%edx
call   1040 <pl_slice@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    0xe7d(%rip),%rdx
lea    0xea9(%rip),%rcx
call   1030 <assert_equal_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_slice_empty_string>:
push   %rbx
lea    0xf0a(%rip),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1040 <pl_slice@plt>
lea    0xec2(%rip),%rbx
lea    0xed3(%rip),%rcx
xor    %edi,%edi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1030 <assert_equal_str@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x3,%edx
call   1040 <pl_slice@plt>
lea    0xec9(%rip),%rcx
xor    %edi,%edi
mov    %rax,%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <assert_equal_str@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [24 x i8] c"test_slice_empty_string\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"
define void @test_slice_empty_string() {
%1 = alloca i8*
%2 = call i8* @pl_slice(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i32 3)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @assert_equal_str(i32* null, i8* %3, i8* getelementptr inbounds ([24 x i8], [24 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_slice(i8* null, i32 1, i32 3)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 @assert_equal_str(i32* null, i8* %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [24 x i8] c"test_slice_empty_string\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"
define void @test_slice_empty_string() {
%1 = tail call i8* @pl_slice(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i32 3)
%2 = tail call i32 @assert_equal_str(i32* null, i8* %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i8* @pl_slice(i8* null, i32 1, i32 3)
%4 = tail call i32 @assert_equal_str(i32* null, i8* %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
ret void
}