#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*/ assert(int);
size_t kmp(char *, size_t *, int /*<<< orphan*/, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char *argv[]) {
  size_t table[258];
  size_t rc;
  char *key = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
              "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
              "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
              "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
              "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
              "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
              "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
              "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab";
  char *str = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
              "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
              "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
              "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
              "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
              "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
              "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
              "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab";
  rc = kmp(key, table, strlen(key), str, strlen(str));
  assert(rc == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x860,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb1(%rip),%rax
mov    %rax,-0x830(%rbp)
lea    0xea2(%rip),%rax
mov    %rax,-0x838(%rbp)
mov    -0x830(%rbp),%rax
mov    %rax,-0x858(%rbp)
lea    -0x820(%rbp),%rax
mov    %rax,-0x850(%rbp)
mov    -0x830(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x844(%rbp)
mov    -0x838(%rbp),%rax
mov    %rax,-0x840(%rbp)
mov    -0x838(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x858(%rbp),%rdi
mov    -0x850(%rbp),%rsi
mov    -0x844(%rbp),%edx
mov    -0x840(%rbp),%rcx
mov    %eax,%r8d
call   1050 <kmp@plt>
mov    %rax,-0x828(%rbp)
cmpq   $0x1,-0x828(%rbp)
01
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x860,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x810,%rsp
lea    0xebf(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
lea    0xead(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rsp,%rsi
mov    %r14,%rdi
mov    %ebp,%edx
mov    %rbx,%rcx
mov    %eax,%r8d
call   1050 <kmp@plt>
xor    %edi,%edi
cmp    $0x1,%rax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x810,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [259 x i8] c"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\00"
@.str.1 = [260 x i8] c"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [258 x i64]
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([259 x i8], [259 x i8]* @.str, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([260 x i8], [260 x i8]* @.str.1, i64 0, i64 0), i8** %9
%10 = load i8*, i8** %8
%11 = getelementptr inbounds [258 x i64], [258 x i64]* %6, i64 0, i64 0
%12 = load i8*, i8** %8
%13 = call i32 @strlen(i8* %12)
%14 = load i8*, i8** %9
%15 = load i8*, i8** %9
%16 = call i32 @strlen(i8* %15)
%17 = call i64 @kmp(i8* %10, i64* %11, i32 %13, i8* %14, i32 %16)
store i64 %17, i64* %7
%18 = load i64, i64* %7
%19 = icmp eq i64 %18, 1
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [259 x i8] c"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\00"
@.str.1 = [260 x i8] c"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [258 x i64]
%4 = bitcast [258 x i64]* %3 to i8*
%5 = getelementptr inbounds [258 x i64], [258 x i64]* %3, i64 0, i64 0
%6 = tail call i32 @strlen(i8* getelementptr inbounds ([259 x i8], [259 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @strlen(i8* getelementptr inbounds ([260 x i8], [260 x i8]* @.str.1, i64 0, i64 0))
%8 = call i64 @kmp(i8* getelementptr inbounds ([259 x i8], [259 x i8]* @.str, i64 0, i64 0), i64* %5, i32 %6, i8* getelementptr inbounds ([260 x i8], [260 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = icmp eq i64 %8, 1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}