#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*/ startsWith(char *, char *);
int /*<<< orphan*/ test(int /*<<< orphan*/, int);
void testStartsWith(void) {
  test(startsWith("start", ""), (1 == 1));
  test(startsWith("start", "star"), (1 == 1));
  test(startsWith("start", "start"), (1 == 1));
  test(startsWith("start", "startx"), (1 == 0));
}


x86 assembly (clang, -O0):
<testStartsWith>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <startsWith@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <test@plt>
lea    0xeb6(%rip),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <startsWith@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <test@plt>
lea    0xe97(%rip),%rsi
mov    %rsi,%rdi
call   1030 <startsWith@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <test@plt>
lea    0xe7c(%rip),%rdi
lea    0xe80(%rip),%rsi
call   1030 <startsWith@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testStartsWith>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xedb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <startsWith@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <test@plt>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <startsWith@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <test@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <startsWith@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <test@plt>
lea    0xe8f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <startsWith@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rbx
jmp    1040 <test@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"start\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c"star\00"
@.str.3 = [7 x i8] c"startx\00"
define void @testStartsWith() {
%1 = call i32 @startsWith(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i32 %1, i32 1)
%3 = call i32 @startsWith(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @test(i32 %3, i32 1)
%5 = call i32 @startsWith(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @test(i32 %5, i32 1)
%7 = call i32 @startsWith(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @test(i32 %7, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"start\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c"star\00"
@.str.3 = [7 x i8] c"startx\00"
define void @testStartsWith() {
%1 = tail call i32 @startsWith(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i32 %1, i32 1)
%3 = tail call i32 @startsWith(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @test(i32 %3, i32 1)
%5 = tail call i32 @startsWith(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @test(i32 %5, i32 1)
%7 = tail call i32 @startsWith(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @test(i32 %7, i32 0)
ret void
}