#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*/ boyer_moore(char *, char *);
void test_boyer_moore() {
  char cs[] = "findinahaystackneedleinahaystackneedlefindallneedles";
  char ds[] = "needle";
  boyer_moore(cs, ds);
  char es[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
  char fs[] = "aaaaaaaaa";
  boyer_moore(es, fs);
}


x86 assembly (clang, -O0):
<test_boyer_moore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x40(%rbp),%rdi
lea    0xeca(%rip),%rsi
mov    $0x35,%edx
call   1030 <memcpy@plt>
mov    0xf1b(%rip),%eax
mov    %eax,-0x47(%rbp)
mov    0xf15(%rip),%ax
mov    %ax,-0x43(%rbp)
mov    0xf0d(%rip),%al
mov    %al,-0x41(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x47(%rbp),%rsi
call   1040 <boyer_moore@plt>
lea    -0x70(%rbp),%rdi
lea    0xecb(%rip),%rsi
mov    $0x21,%edx
call   1030 <memcpy@plt>
mov    0xee2(%rip),%rax
mov    %rax,-0x7a(%rbp)
mov    0xedf(%rip),%ax
mov    %ax,-0x72(%rbp)
lea    -0x70(%rbp),%rdi
lea    -0x7a(%rbp),%rsi
call   1040 <boyer_moore@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_boyer_moore>:
sub    $0x88,%rsp
movaps 0xf02(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movabs $0x73656c6465656e,%rax
mov    %rax,0x7d(%rsp)
movl   $0x656c64,0xb(%rsp)
movl   $0x6465656e,0x8(%rsp)
64
lea    0x50(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <boyer_moore@plt>
movaps 0xee0(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movb   $0x0,0x40(%rsp)
movabs $0x6161616161616161,%rax
61 61 61
mov    %rax,0x10(%rsp)
movw   $0x61,0x18(%rsp)
lea    0x20(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <boyer_moore@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
@__const.test_boyer_moore.cs = [53 x i8] c"findinahaystackneedleinahaystackneedlefindallneedles\00"
@__const.test_boyer_moore.ds = [7 x i8] c"needle\00"
@__const.test_boyer_moore.es = [33 x i8] c"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\00"
@__const.test_boyer_moore.fs = [10 x i8] c"aaaaaaaaa\00"
define void @test_boyer_moore() {
%1 = alloca [53 x i8]
%2 = alloca [7 x i8]
%3 = alloca [33 x i8]
%4 = alloca [10 x i8]
%5 = bitcast [53 x i8]* %1 to i8*
%6 = bitcast [7 x i8]* %2 to i8*
%7 = getelementptr inbounds [53 x i8], [53 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%9 = call i32 @boyer_moore(i8* %7, i8* %8)
%10 = bitcast [33 x i8]* %3 to i8*
%11 = bitcast [10 x i8]* %4 to i8*
%12 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%14 = call i32 @boyer_moore(i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
@__const.test_boyer_moore.cs = [53 x i8] c"findinahaystackneedleinahaystackneedlefindallneedles\00"
@__const.test_boyer_moore.ds = [7 x i8] c"needle\00"
@__const.test_boyer_moore.es = [33 x i8] c"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\00"
@__const.test_boyer_moore.fs = [10 x i8] c"aaaaaaaaa\00"
define void @test_boyer_moore() {
%1 = alloca [53 x i8]
%2 = alloca [7 x i8]
%3 = alloca [33 x i8]
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [53 x i8], [53 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%7 = call i32 @boyer_moore(i8* %5, i8* %6)
%8 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%10 = call i32 @boyer_moore(i8* %8, i8* %9)
ret void
}