#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);
int /*<<< orphan*/ longestPalindrome(char *);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int main(int argc, char **argv) {
  assert(strcmp(longestPalindrome("abacab"), "bacab") == 0);
  assert(strcmp(longestPalindrome("aaabaaaa"), "aaabaaa") == 0);
  assert(strcmp(longestPalindrome("a"), "a") == 0);
  assert(strcmp(longestPalindrome("aa"), "aa") == 0);
  assert(strcmp(longestPalindrome("ab"), "a") == 0);
  assert(strcmp(longestPalindrome("abb"), "bb") == 0);
  assert(strcmp(longestPalindrome("babad"), "bab") == 0);
  assert(strcmp(longestPalindrome("cbbd"), "bb") == 0);
  assert(strcmp(longestPalindrome(
                    "abcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcba"),
                "abcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcba") == 0);
  assert(strcmp(longestPalindrome(
                    "bcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcba"),
                "bcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcb") == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1050 <longestPalindrome@plt>
mov    %eax,%edi
lea    0xea6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe8f(%rip),%rdi
call   1050 <longestPalindrome@plt>
mov    %eax,%edi
lea    0xe8a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe6b(%rip),%rdi
call   1050 <longestPalindrome@plt>
mov    %eax,%edi
lea    0xe5d(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe3f(%rip),%rdi
call   1050 <longestPalindrome@plt>
mov    %eax,%edi
lea    0xe31(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe2a(%rip),%rdi
call   1050 <longestPalindrome@plt>
mov    %eax,%edi
lea    0xe07(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xdf4(%rip),%rdi
call   1050 <longestPalindrome@plt>
mov    %eax,%edi
lea    0xde7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xdcd(%rip),%rdi
call   1050 <longestPalindrome@plt>
mov    %eax,%edi
lea    0xdc5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xdac(%rip),%rdi
call   1050 <longestPalindrome@plt>
mov    %eax,%edi
lea    0xd91(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xd86(%rip),%rdi
call   1050 <longestPalindrome@plt>
mov    %eax,%edi
lea    0xd78(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xd5c(%rip),%rdi
call   1050 <longestPalindrome@plt>
mov    %eax,%edi
lea    0xd82(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
call   1050 <longestPalindrome@plt>
lea    0xeba(%rip),%rsi
mov    %eax,%edi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xea4(%rip),%rdi
call   1050 <longestPalindrome@plt>
lea    0xea1(%rip),%rsi
mov    %eax,%edi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xe83(%rip),%r14
mov    %r14,%rdi
call   1050 <longestPalindrome@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xe5b(%rip),%rbx
mov    %rbx,%rdi
call   1050 <longestPalindrome@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xe4a(%rip),%rdi
call   1050 <longestPalindrome@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xe1b(%rip),%rdi
call   1050 <longestPalindrome@plt>
lea    0xe10(%rip),%rbx
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xdf4(%rip),%rdi
call   1050 <longestPalindrome@plt>
lea    0xdee(%rip),%rsi
mov    %eax,%edi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xdd6(%rip),%rdi
call   1050 <longestPalindrome@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xdb7(%rip),%rbx
mov    %rbx,%rdi
call   1050 <longestPalindrome@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xd91(%rip),%rdi
call   1050 <longestPalindrome@plt>
lea    0xdb9(%rip),%rsi
mov    %eax,%edi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"abacab\00"
@.str.1 = [6 x i8] c"bacab\00"
@.str.2 = [9 x i8] c"aaabaaaa\00"
@.str.3 = [8 x i8] c"aaabaaa\00"
@.str.4 = [2 x i8] c"a\00"
@.str.5 = [3 x i8] c"aa\00"
@.str.6 = [3 x i8] c"ab\00"
@.str.7 = [4 x i8] c"abb\00"
@.str.8 = [3 x i8] c"bb\00"
@.str.9 = [6 x i8] c"babad\00"
@.str.10 = [4 x i8] c"bab\00"
@.str.11 = [5 x i8] c"cbbd\00"
@.str.12 = [53 x i8] c"abcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcba\00"
@.str.13 = [52 x i8] c"bcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcba\00"
@.str.14 = [51 x i8] c"bcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcb\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @longestPalindrome(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = call i64 @strcmp(i32 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 @longestPalindrome(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%12 = call i64 @strcmp(i32 %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = call i32 @longestPalindrome(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%17 = call i64 @strcmp(i32 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = call i32 @longestPalindrome(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%22 = call i64 @strcmp(i32 %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = call i32 @longestPalindrome(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%27 = call i64 @strcmp(i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = call i32 @longestPalindrome(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%32 = call i64 @strcmp(i32 %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = call i32 @longestPalindrome(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%37 = call i64 @strcmp(i32 %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = call i32 @longestPalindrome(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%42 = call i64 @strcmp(i32 %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
%46 = call i32 @longestPalindrome(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.12, i64 0, i64 0))
%47 = call i64 @strcmp(i32 %46, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.12, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
%51 = call i32 @longestPalindrome(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.13, i64 0, i64 0))
%52 = call i64 @strcmp(i32 %51, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.14, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
%54 = zext i1 %53 to i32
%55 = call i32 @assert(i32 %54)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"abacab\00"
@.str.1 = [6 x i8] c"bacab\00"
@.str.2 = [9 x i8] c"aaabaaaa\00"
@.str.3 = [8 x i8] c"aaabaaa\00"
@.str.4 = [2 x i8] c"a\00"
@.str.5 = [3 x i8] c"aa\00"
@.str.6 = [3 x i8] c"ab\00"
@.str.7 = [4 x i8] c"abb\00"
@.str.8 = [3 x i8] c"bb\00"
@.str.9 = [6 x i8] c"babad\00"
@.str.10 = [4 x i8] c"bab\00"
@.str.11 = [5 x i8] c"cbbd\00"
@.str.12 = [53 x i8] c"abcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcba\00"
@.str.13 = [52 x i8] c"bcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcba\00"
@.str.14 = [51 x i8] c"bcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcb\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @longestPalindrome(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i64 @strcmp(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @longestPalindrome(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i64 @strcmp(i32 %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @longestPalindrome(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%14 = tail call i64 @strcmp(i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = tail call i32 @longestPalindrome(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%19 = tail call i64 @strcmp(i32 %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
%21 = zext i1 %20 to i32
%22 = tail call i32 @assert(i32 %21)
%23 = tail call i32 @longestPalindrome(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%24 = tail call i64 @strcmp(i32 %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
%26 = zext i1 %25 to i32
%27 = tail call i32 @assert(i32 %26)
%28 = tail call i32 @longestPalindrome(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%29 = tail call i64 @strcmp(i32 %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
%31 = zext i1 %30 to i32
%32 = tail call i32 @assert(i32 %31)
%33 = tail call i32 @longestPalindrome(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%34 = tail call i64 @strcmp(i32 %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
%36 = zext i1 %35 to i32
%37 = tail call i32 @assert(i32 %36)
%38 = tail call i32 @longestPalindrome(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%39 = tail call i64 @strcmp(i32 %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
%41 = zext i1 %40 to i32
%42 = tail call i32 @assert(i32 %41)
%43 = tail call i32 @longestPalindrome(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.12, i64 0, i64 0))
%44 = tail call i64 @strcmp(i32 %43, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.12, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
%46 = zext i1 %45 to i32
%47 = tail call i32 @assert(i32 %46)
%48 = tail call i32 @longestPalindrome(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.13, i64 0, i64 0))
%49 = tail call i64 @strcmp(i32 %48, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.14, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
%51 = zext i1 %50 to i32
%52 = tail call i32 @assert(i32 %51)
ret i32 0
}