#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 get_longest_palindrome_length_from_str_chars(char *);
int strlen(char *);
int main() {
  char *ch0 = "abccccdd";
  int exp_max_palindrome_len0 = 7;
  assert(exp_max_palindrome_len0 ==
         get_longest_palindrome_length_from_str_chars(ch0));
  char *ch1 = "ad";
  int exp_max_palindrome_len1 = 1;
  assert(exp_max_palindrome_len1 ==
         get_longest_palindrome_length_from_str_chars(ch1));
  char *ch2 = "aa";
  int exp_max_palindrome_len2 = 2;
  assert(exp_max_palindrome_len2 ==
         get_longest_palindrome_length_from_str_chars(ch2));
  char *ch3 = "aA";
  int exp_max_palindrome_len3 = 1;
  assert(exp_max_palindrome_len3 ==
         get_longest_palindrome_length_from_str_chars(ch3));
  char *ch4 = "aabbcccc";
  int exp_max_palindrome_len4 = strlen(ch4);
  assert(exp_max_palindrome_len4 ==
         get_longest_palindrome_length_from_str_chars(ch4));
  char *ch5 = "aaabbbccccc";
  int exp_max_palindrome_len5 = 9;
  assert(exp_max_palindrome_len5 ==
         get_longest_palindrome_length_from_str_chars(ch5));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x7,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <get_longest_palindrome_length_from_str_chars@plt>
mov    %eax,%ecx
mov    -0x7c(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe8b(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <get_longest_palindrome_length_from_str_chars@plt>
mov    %eax,%ecx
mov    -0x78(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe59(%rip),%rax
mov    %rax,-0x30(%rbp)
movl   $0x2,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x30(%rbp),%rdi
call   1050 <get_longest_palindrome_length_from_str_chars@plt>
mov    %eax,%ecx
mov    -0x74(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe27(%rip),%rax
mov    %rax,-0x40(%rbp)
movl   $0x1,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x40(%rbp),%rdi
call   1050 <get_longest_palindrome_length_from_str_chars@plt>
mov    %eax,%ecx
mov    -0x70(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xdf5(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x50(%rbp),%rdi
call   1050 <get_longest_palindrome_length_from_str_chars@plt>
mov    %eax,%ecx
mov    -0x6c(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xdc4(%rip),%rax
mov    %rax,-0x60(%rbp)
movl   $0x9,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x60(%rbp),%rdi
call   1050 <get_longest_palindrome_length_from_str_chars@plt>
mov    %eax,%ecx
mov    -0x68(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
call   1050 <get_longest_palindrome_length_from_str_chars@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xeb5(%rip),%rdi
call   1050 <get_longest_palindrome_length_from_str_chars@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe9e(%rip),%rdi
call   1050 <get_longest_palindrome_length_from_str_chars@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe87(%rip),%rdi
call   1050 <get_longest_palindrome_length_from_str_chars@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe70(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <get_longest_palindrome_length_from_str_chars@plt>
xor    %edi,%edi
cmp    %eax,%ebp
sete   %dil
call   1040 <assert@plt>
lea    0xe53(%rip),%rdi
call   1050 <get_longest_palindrome_length_from_str_chars@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"abccccdd\00"
@.str.1 = [3 x i8] c"ad\00"
@.str.2 = [3 x i8] c"aa\00"
@.str.3 = [3 x i8] c"aA\00"
@.str.4 = [9 x i8] c"aabbcccc\00"
@.str.5 = [12 x i8] c"aaabbbccccc\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 7, i32* %3
%14 = load i32, i32* %3
%15 = load i8*, i8** %2
%16 = call i32 @get_longest_palindrome_length_from_str_chars(i8* %15)
%17 = icmp eq i32 %14, %16
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %4
store i32 1, i32* %5
%20 = load i32, i32* %5
%21 = load i8*, i8** %4
%22 = call i32 @get_longest_palindrome_length_from_str_chars(i8* %21)
%23 = icmp eq i32 %20, %22
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %6
store i32 2, i32* %7
%26 = load i32, i32* %7
%27 = load i8*, i8** %6
%28 = call i32 @get_longest_palindrome_length_from_str_chars(i8* %27)
%29 = icmp eq i32 %26, %28
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %8
store i32 1, i32* %9
%32 = load i32, i32* %9
%33 = load i8*, i8** %8
%34 = call i32 @get_longest_palindrome_length_from_str_chars(i8* %33)
%35 = icmp eq i32 %32, %34
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8** %10
%38 = load i8*, i8** %10
%39 = call i32 @strlen(i8* %38)
store i32 %39, i32* %11
%40 = load i32, i32* %11
%41 = load i8*, i8** %10
%42 = call i32 @get_longest_palindrome_length_from_str_chars(i8* %41)
%43 = icmp eq i32 %40, %42
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8** %12
store i32 9, i32* %13
%46 = load i32, i32* %13
%47 = load i8*, i8** %12
%48 = call i32 @get_longest_palindrome_length_from_str_chars(i8* %47)
%49 = icmp eq i32 %46, %48
%50 = zext i1 %49 to i32
%51 = call i32 @assert(i32 %50)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"abccccdd\00"
@.str.1 = [3 x i8] c"ad\00"
@.str.2 = [3 x i8] c"aa\00"
@.str.3 = [3 x i8] c"aA\00"
@.str.4 = [9 x i8] c"aabbcccc\00"
@.str.5 = [12 x i8] c"aaabbbccccc\00"
define i32 @main() {
%1 = tail call i32 @get_longest_palindrome_length_from_str_chars(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 7
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @get_longest_palindrome_length_from_str_chars(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @get_longest_palindrome_length_from_str_chars(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i32 %9, 2
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @get_longest_palindrome_length_from_str_chars(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%18 = tail call i32 @get_longest_palindrome_length_from_str_chars(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%19 = icmp eq i32 %17, %18
%20 = zext i1 %19 to i32
%21 = tail call i32 @assert(i32 %20)
%22 = tail call i32 @get_longest_palindrome_length_from_str_chars(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%23 = icmp eq i32 %22, 9
%24 = zext i1 %23 to i32
%25 = tail call i32 @assert(i32 %24)
ret i32 0
}