#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_startswith(char *, char *);
void test_startwith_empty_params() {
  int ret_val;
  ret_val = pl_startswith(NULL, "asd");
  assert_equal_int(-1, ret_val, "test_startwith_empty_params",
                   "Test 1: -1 Not returned.");
  ret_val = pl_startswith("www.vg.no", NULL);
  assert_equal_int(-1, ret_val, "test_startwith_empty_params",
                   "Test 2: -1 Not returned.");
}


x86 assembly (clang, -O0):
<test_startwith_empty_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
lea    0xecd(%rip),%rsi
call   1030 <pl_startswith@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xffffffff,%edi
lea    0xeba(%rip),%rdx
lea    0xecf(%rip),%rcx
call   1040 <assert_equal_int@plt>
lea    0xedc(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pl_startswith@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xffffffff,%edi
lea    0xe8c(%rip),%rdx
lea    0xec4(%rip),%rcx
call   1040 <assert_equal_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_startwith_empty_params>:
push   %rbx
lea    0xed8(%rip),%rsi
xor    %edi,%edi
call   1030 <pl_startswith@plt>
lea    0xece(%rip),%rbx
lea    0xee3(%rip),%rcx
mov    $0xffffffff,%edi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <assert_equal_int@plt>
lea    0xee6(%rip),%rdi
xor    %esi,%esi
call   1030 <pl_startswith@plt>
lea    0xee2(%rip),%rcx
mov    $0xffffffff,%edi
mov    %eax,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <assert_equal_int@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"asd\00"
@.str.1 = [28 x i8] c"test_startwith_empty_params\00"
@.str.2 = [25 x i8] c"Test 1: -1 Not returned.\00"
@.str.3 = [10 x i8] c"www.vg.no\00"
@.str.4 = [25 x i8] c"Test 2: -1 Not returned.\00"
define void @test_startwith_empty_params() {
%1 = alloca i32
%2 = call i32 @pl_startswith(i8* null, i8* getelementptr inbounds ([4 x i8], [4 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 ([28 x i8], [28 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_startswith(i8* getelementptr inbounds ([10 x i8], [10 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 ([28 x i8], [28 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 = [4 x i8] c"asd\00"
@.str.1 = [28 x i8] c"test_startwith_empty_params\00"
@.str.2 = [25 x i8] c"Test 1: -1 Not returned.\00"
@.str.3 = [10 x i8] c"www.vg.no\00"
@.str.4 = [25 x i8] c"Test 2: -1 Not returned.\00"
define void @test_startwith_empty_params() {
%1 = tail call i32 @pl_startswith(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @assert_equal_int(i32 -1, i32 %1, i8* getelementptr inbounds ([28 x i8], [28 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_startswith(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* null)
%4 = tail call i32 @assert_equal_int(i32 -1, i32 %3, i8* getelementptr inbounds ([28 x i8], [28 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
}