#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 EXIT_SUCCESS;
int /*<<< orphan*/ kmp(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  kmp("abcabcabdabcdabd", "abcabdabcd");
  printf("====================\n");
  kmp("abcabbabcabd", "abcabc");
  printf("====================\n");
  kmp("ababcabcababcabd", "abcabc");
  printf("====================\n");
  kmp("abaacabaadabaae", "abaa");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1040 <kmp@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1040 <kmp@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1040 <kmp@plt>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1040 <kmp@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1040 <kmp@plt>
lea    0xf18(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xecf(%rip),%rdi
lea    0xed5(%rip),%r14
mov    %r14,%rsi
call   1040 <kmp@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <kmp@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xebf(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1040 <kmp@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"abcabcabdabcdabd\00"
@.str.1 = [11 x i8] c"abcabdabcd\00"
@.str.2 = [22 x i8] c"====================\0A\00"
@.str.3 = [13 x i8] c"abcabbabcabd\00"
@.str.4 = [7 x i8] c"abcabc\00"
@.str.5 = [17 x i8] c"ababcabcababcabd\00"
@.str.6 = [16 x i8] c"abaacabaadabaae\00"
@.str.7 = [5 x i8] c"abaa\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @kmp(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @kmp(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @kmp(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @kmp(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@.str = [17 x i8] c"abcabcabdabcdabd\00"
@.str.1 = [11 x i8] c"abcabdabcd\00"
@.str.3 = [13 x i8] c"abcabbabcabd\00"
@.str.4 = [7 x i8] c"abcabc\00"
@.str.5 = [17 x i8] c"ababcabcababcabd\00"
@.str.6 = [16 x i8] c"abaacabaadabaae\00"
@.str.7 = [5 x i8] c"abaa\00"
@EXIT_SUCCESS = global i32 0
@str.9 = [21 x i8] c"====================\00"
define i32 @main() {
%1 = tail call i32 @kmp(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.9, i64 0, i64 0))
%3 = tail call i32 @kmp(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.9, i64 0, i64 0))
%5 = tail call i32 @kmp(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.9, i64 0, i64 0))
%7 = tail call i32 @kmp(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}