#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 */
scalar_t__ isPalindrome(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  printf("cat: %s\n", ((isPalindrome("cat")) ? "true" : "false"));
  printf("catac: %s\n", ((isPalindrome("catac")) ? "true" : "false"));
  printf("caac: %s\n", ((isPalindrome("caac")) ? "true" : "false"));
  printf("catttac: %s\n", ((isPalindrome("catttac")) ? "true" : "false"));
  printf("cabddeac: %s\n", ((isPalindrome("cabddeac")) ? "true" : "false"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xede(%rip),%rdi
call   1040 <isPalindrome@plt>
mov    %rax,%rcx
lea    0xed8(%rip),%rsi
lea    0xecc(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
call   1040 <isPalindrome@plt>
mov    %rax,%rcx
lea    0xea7(%rip),%rsi
lea    0xe9b(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
call   1040 <isPalindrome@plt>
mov    %rax,%rcx
lea    0xe76(%rip),%rsi
lea    0xe6a(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
lea    0xe87(%rip),%rdi
call   1040 <isPalindrome@plt>
mov    %rax,%rcx
lea    0xe45(%rip),%rsi
lea    0xe39(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe55(%rip),%rdi
call   1030 <printf@plt>
lea    0xe6c(%rip),%rdi
call   1040 <isPalindrome@plt>
mov    %rax,%rcx
lea    0xe14(%rip),%rsi
lea    0xe08(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xede(%rip),%rdi
call   1040 <isPalindrome@plt>
test   %rax,%rax
lea    0xed8(%rip),%r14
lea    0xecc(%rip),%rbx
mov    %rbx,%rsi
cmove  %r14,%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
call   1040 <isPalindrome@plt>
test   %rax,%rax
mov    %rbx,%rsi
cmove  %r14,%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
call   1040 <isPalindrome@plt>
test   %rax,%rax
mov    %rbx,%rsi
cmove  %r14,%rsi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
call   1040 <isPalindrome@plt>
test   %rax,%rax
mov    %rbx,%rsi
cmove  %r14,%rsi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9a(%rip),%rdi
call   1040 <isPalindrome@plt>
test   %rax,%rax
cmove  %r14,%rbx
lea    0xe79(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"cat: %s\0A\00"
@.str.1 = [4 x i8] c"cat\00"
@.str.2 = [5 x i8] c"true\00"
@.str.3 = [6 x i8] c"false\00"
@.str.4 = [11 x i8] c"catac: %s\0A\00"
@.str.5 = [6 x i8] c"catac\00"
@.str.6 = [10 x i8] c"caac: %s\0A\00"
@.str.7 = [5 x i8] c"caac\00"
@.str.8 = [13 x i8] c"catttac: %s\0A\00"
@.str.9 = [8 x i8] c"catttac\00"
@.str.10 = [14 x i8] c"cabddeac: %s\0A\00"
@.str.11 = [9 x i8] c"cabddeac\00"
define i32 @main() {
%1 = call i64 @isPalindrome(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i64 @isPalindrome(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %9)
%11 = call i64 @isPalindrome(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%15 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* %14)
%16 = call i64 @isPalindrome(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%17 = icmp ne i64 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%20 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %19)
%21 = call i64 @isPalindrome(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%22 = icmp ne i64 %21, 0
%23 = zext i1 %22 to i64
%24 = select i1 %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%25 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"cat: %s\0A\00"
@.str.1 = [4 x i8] c"cat\00"
@.str.2 = [5 x i8] c"true\00"
@.str.3 = [6 x i8] c"false\00"
@.str.4 = [11 x i8] c"catac: %s\0A\00"
@.str.5 = [6 x i8] c"catac\00"
@.str.6 = [10 x i8] c"caac: %s\0A\00"
@.str.7 = [5 x i8] c"caac\00"
@.str.8 = [13 x i8] c"catttac: %s\0A\00"
@.str.9 = [8 x i8] c"catttac\00"
@.str.10 = [14 x i8] c"cabddeac: %s\0A\00"
@.str.11 = [9 x i8] c"cabddeac\00"
define i32 @main() {
%1 = tail call i64 @isPalindrome(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i64 @isPalindrome(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %7)
%9 = tail call i64 @isPalindrome(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* %11)
%13 = tail call i64 @isPalindrome(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %15)
%17 = tail call i64 @isPalindrome(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
%19 = select i1 %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* %19)
ret i32 0
}