#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*/ str_cases(char *, char *);
void test_strstr() {
  str_cases("123 abc", "23");
  str_cases("123 abc", "ab");
  str_cases("123 abc", "e");
  str_cases("123 abc", "12");
  str_cases("123", "123");
  str_cases("abcdefg", "abcdefg");
  str_cases("12", "123");
}


x86 assembly (clang, -O0):
<test_strstr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeef(%rip),%rsi
call   1030 <str_cases@plt>
lea    0xed2(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <str_cases@plt>
lea    0xebf(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1030 <str_cases@plt>
lea    0xeac(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <str_cases@plt>
lea    0xea9(%rip),%rsi
mov    %rsi,%rdi
call   1030 <str_cases@plt>
lea    0xe9e(%rip),%rsi
mov    %rsi,%rdi
call   1030 <str_cases@plt>
lea    0xe88(%rip),%rdi
lea    0xe84(%rip),%rsi
call   1030 <str_cases@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strstr>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rbx
lea    0xeef(%rip),%rsi
mov    %rbx,%rdi
call   1030 <str_cases@plt>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <str_cases@plt>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <str_cases@plt>
lea    0xebe(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <str_cases@plt>
lea    0xeaf(%rip),%rbx
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <str_cases@plt>
lea    0xea1(%rip),%rdi
mov    %rdi,%rsi
call   1030 <str_cases@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <str_cases@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"123 abc\00"
@.str.1 = [3 x i8] c"23\00"
@.str.2 = [3 x i8] c"ab\00"
@.str.3 = [2 x i8] c"e\00"
@.str.4 = [3 x i8] c"12\00"
@.str.5 = [4 x i8] c"123\00"
@.str.6 = [8 x i8] c"abcdefg\00"
define void @test_strstr() {
%1 = call i32 @str_cases(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @str_cases(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @str_cases(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 @str_cases(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%5 = call i32 @str_cases(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%6 = call i32 @str_cases(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%7 = call i32 @str_cases(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"123 abc\00"
@.str.1 = [3 x i8] c"23\00"
@.str.2 = [3 x i8] c"ab\00"
@.str.3 = [2 x i8] c"e\00"
@.str.4 = [3 x i8] c"12\00"
@.str.5 = [4 x i8] c"123\00"
@.str.6 = [8 x i8] c"abcdefg\00"
define void @test_strstr() {
%1 = tail call i32 @str_cases(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @str_cases(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @str_cases(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @str_cases(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%5 = tail call i32 @str_cases(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%6 = tail call i32 @str_cases(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%7 = tail call i32 @str_cases(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
ret void
}