#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_int(int, int, char *, char *);
int pl_endswith(char *, char *);
void test_endswith_empty_params() {
  int ret_val;
  ret_val = pl_endswith(NULL, ".com");
  assert_equal_int(-1, ret_val, "test_endswith_empty_params",
                   "Test 1: -1 Not returned.");
  ret_val = pl_endswith("asd.com", NULL);
  assert_equal_int(-1, ret_val, "test_endswith_empty_params",
                   "Test 1: -1 not returned.");
}


x86 assembly (clang, -O0):
<test_endswith_empty_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
lea    0xf04(%rip),%rsi
call   1030 <pl_endswith@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xffffffff,%edi
lea    0xeb6(%rip),%rdx
lea    0xeca(%rip),%rcx
call   1040 <assert_equal_int@plt>
lea    0xed7(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pl_endswith@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xffffffff,%edi
lea    0xe88(%rip),%rdx
lea    0xebd(%rip),%rcx
call   1040 <assert_equal_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_endswith_empty_params>:
push   %rbx
lea    0xf0f(%rip),%rsi
xor    %edi,%edi
call   1030 <pl_endswith@plt>
lea    0xeca(%rip),%rbx
lea    0xede(%rip),%rcx
mov    $0xffffffff,%edi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <assert_equal_int@plt>
lea    0xee1(%rip),%rdi
xor    %esi,%esi
call   1030 <pl_endswith@plt>
lea    0xedb(%rip),%rcx
mov    $0xffffffff,%edi
mov    %eax,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <assert_equal_int@plt>

LLVM IR (-O0):
@.str = [5 x i8] c".com\00"
@.str.1 = [27 x i8] c"test_endswith_empty_params\00"
@.str.2 = [25 x i8] c"Test 1: -1 Not returned.\00"
@.str.3 = [8 x i8] c"asd.com\00"
@.str.4 = [25 x i8] c"Test 1: -1 not returned.\00"
define void @test_endswith_empty_params() {
%1 = alloca i32
%2 = call i32 @pl_endswith(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @assert_equal_int(i32 -1, i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @pl_endswith(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* null)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @assert_equal_int(i32 -1, i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".com\00"
@.str.1 = [27 x i8] c"test_endswith_empty_params\00"
@.str.2 = [25 x i8] c"Test 1: -1 Not returned.\00"
@.str.3 = [8 x i8] c"asd.com\00"
@.str.4 = [25 x i8] c"Test 1: -1 not returned.\00"
define void @test_endswith_empty_params() {
%1 = tail call i32 @pl_endswith(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @assert_equal_int(i32 -1, i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @pl_endswith(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* null)
%4 = tail call i32 @assert_equal_int(i32 -1, i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
ret void
}