#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*/ EXPECT_INT(int /*<<< orphan*/, int);
int /*<<< orphan*/ isStartWith(char *, char *, int);
void test_isStartWith() {
  EXPECT_INT(isStartWith("aaaabbb", "aaa", 0), 1);
  EXPECT_INT(isStartWith("aaaabbb", "AAA", 1), 0);
  EXPECT_INT(isStartWith("aaaabbb", "BBB", 0), 0);
}


x86 assembly (clang, -O0):
<test_isStartWith>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed6(%rip),%rsi
xor    %edx,%edx
call   1040 <isStartWith@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <EXPECT_INT@plt>
lea    0xeb4(%rip),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x1,%edx
call   1040 <isStartWith@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <EXPECT_INT@plt>
lea    0xe93(%rip),%rdi
lea    0xe9c(%rip),%rsi
xor    %edx,%edx
call   1040 <isStartWith@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <EXPECT_INT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isStartWith>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed9(%rip),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
call   1040 <isStartWith@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <EXPECT_INT@plt>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <isStartWith@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <EXPECT_INT@plt>
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
call   1040 <isStartWith@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rbx
jmp    1030 <EXPECT_INT@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"aaaabbb\00"
@.str.1 = [4 x i8] c"aaa\00"
@.str.2 = [4 x i8] c"AAA\00"
@.str.3 = [4 x i8] c"BBB\00"
define void @test_isStartWith() {
%1 = call i32 @isStartWith(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
%2 = call i32 @EXPECT_INT(i32 %1, i32 1)
%3 = call i32 @isStartWith(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = call i32 @EXPECT_INT(i32 %3, i32 0)
%5 = call i32 @isStartWith(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0)
%6 = call i32 @EXPECT_INT(i32 %5, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"aaaabbb\00"
@.str.1 = [4 x i8] c"aaa\00"
@.str.2 = [4 x i8] c"AAA\00"
@.str.3 = [4 x i8] c"BBB\00"
define void @test_isStartWith() {
%1 = tail call i32 @isStartWith(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
%2 = tail call i32 @EXPECT_INT(i32 %1, i32 1)
%3 = tail call i32 @isStartWith(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = tail call i32 @EXPECT_INT(i32 %3, i32 0)
%5 = tail call i32 @isStartWith(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0)
%6 = tail call i32 @EXPECT_INT(i32 %5, i32 0)
ret void
}