#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__ is_palindrome(char *);
scalar_t__ is_palindrome_ignore_spaces(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  printf("is '%s' an palindrome? %s\n", "radar",
         is_palindrome("radar") ? "yes" : "no");
  printf("is '%s' an palindrome? %s\n", "racecar",
         is_palindrome("racecar") ? "yes" : "no");
  printf("is '%s' an palindrome? %s\n", "notreally",
         is_palindrome("notreally") ? "yes" : "no");
  printf("is '%s' an palindrome? %s\n", "step on no pets",
         is_palindrome("step on no pets") ? "yes" : "no");
  printf("is '%s' an palindrome? %s\n", "no",
         is_palindrome("no") ? "yes" : "no");
  printf("is '%s' an palindrome? %s\n\n", "", is_palindrome("") ? "yes" : "no");
  printf("is '%s' an palindrome? %s\n", "was it a car or a cat i saw",
         is_palindrome_ignore_spaces("was it a car or a cat i saw") ? "yes"
                                                                    : "no");
  printf("is '%s' an palindrome? %s\n", "was it a car or a dog i saw",
         is_palindrome_ignore_spaces("was it a a car or a dog i saw") ? "yes"
                                                                      : "no");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <is_palindrome@plt>
mov    %rax,%rcx
lea    0xed0(%rip),%rdx
lea    0xec5(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xe95(%rip),%rdi
lea    0xea9(%rip),%rsi
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
call   1030 <is_palindrome@plt>
mov    %rax,%rcx
lea    0xe98(%rip),%rdx
lea    0xe8d(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xe5d(%rip),%rdi
lea    0xe7e(%rip),%rsi
call   1040 <printf@plt>
lea    0xe7a(%rip),%rdi
call   1030 <is_palindrome@plt>
mov    %rax,%rcx
lea    0xe60(%rip),%rdx
lea    0xe55(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xe25(%rip),%rdi
lea    0xe4e(%rip),%rsi
call   1040 <printf@plt>
lea    0xe4c(%rip),%rdi
call   1030 <is_palindrome@plt>
mov    %rax,%rcx
lea    0xe28(%rip),%rdx
lea    0xe1d(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xded(%rip),%rdi
lea    0xe20(%rip),%rsi
call   1040 <printf@plt>
lea    0xdff(%rip),%rdi
call   1030 <is_palindrome@plt>
mov    %rax,%rcx
lea    0xdf0(%rip),%rdx
lea    0xde5(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xdb5(%rip),%rdi
lea    0xdd3(%rip),%rsi
call   1040 <printf@plt>
lea    0xe07(%rip),%rdi
call   1030 <is_palindrome@plt>
mov    %rax,%rcx
lea    0xdb8(%rip),%rdx
lea    0xdad(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xdc7(%rip),%rdi
lea    0xddb(%rip),%rsi
call   1040 <printf@plt>
lea    0xdd0(%rip),%rdi
call   1050 <is_palindrome_ignore_spaces@plt>
mov    %rax,%rcx
lea    0xd80(%rip),%rdx
lea    0xd75(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xd45(%rip),%rdi
lea    0xda4(%rip),%rsi
call   1040 <printf@plt>
lea    0xdd0(%rip),%rdi
call   1050 <is_palindrome_ignore_spaces@plt>
mov    %rax,%rcx
lea    0xd48(%rip),%rdx
lea    0xd3d(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xd0d(%rip),%rdi
lea    0xd88(%rip),%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xedc(%rip),%r12
mov    %r12,%rdi
call   1030 <is_palindrome@plt>
test   %rax,%rax
lea    0xed4(%rip),%r14
lea    0xec9(%rip),%rbx
mov    %rbx,%rdx
cmove  %r14,%rdx
lea    0xe9a(%rip),%r15
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
lea    0xeb0(%rip),%r12
mov    %r12,%rdi
call   1030 <is_palindrome@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r14,%rdx
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
lea    0xe94(%rip),%r12
mov    %r12,%rdi
call   1030 <is_palindrome@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r14,%rdx
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
lea    0xe7a(%rip),%r12
mov    %r12,%rdi
call   1030 <is_palindrome@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r14,%rdx
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <is_palindrome@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r14,%rdx
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
lea    0xe64(%rip),%r12
mov    %r12,%rdi
call   1030 <is_palindrome@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r14,%rdx
lea    0xe30(%rip),%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
lea    0xe3d(%rip),%r12
mov    %r12,%rdi
call   1050 <is_palindrome_ignore_spaces@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r14,%rdx
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
lea    0xe51(%rip),%rdi
call   1050 <is_palindrome_ignore_spaces@plt>
test   %rax,%rax
cmove  %r14,%rbx
lea    0xe22(%rip),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [27 x i8] c"is '%s' an palindrome? %s\0A\00"
@.str.1 = [6 x i8] c"radar\00"
@.str.2 = [4 x i8] c"yes\00"
@.str.3 = [3 x i8] c"no\00"
@.str.4 = [8 x i8] c"racecar\00"
@.str.5 = [10 x i8] c"notreally\00"
@.str.6 = [16 x i8] c"step on no pets\00"
@.str.7 = [28 x i8] c"is '%s' an palindrome? %s\0A\0A\00"
@.str.8 = [1 x i8] zeroinitializer
@.str.9 = [28 x i8] c"was it a car or a cat i saw\00"
@.str.10 = [28 x i8] c"was it a car or a dog i saw\00"
@.str.11 = [30 x i8] c"was it a a car or a dog i saw\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @is_palindrome(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i64 @is_palindrome(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %10)
%12 = call i64 @is_palindrome(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%16 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %15)
%17 = call i64 @is_palindrome(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%18 = icmp ne i64 %17, 0
%19 = zext i1 %18 to i64
%20 = select i1 %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%21 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* %20)
%22 = call i64 @is_palindrome(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp ne i64 %22, 0
%24 = zext i1 %23 to i64
%25 = select i1 %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%26 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %25)
%27 = call i64 @is_palindrome(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0))
%28 = icmp ne i64 %27, 0
%29 = zext i1 %28 to i64
%30 = select i1 %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%31 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0), i8* %30)
%32 = call i64 @is_palindrome_ignore_spaces(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
%33 = icmp ne i64 %32, 0
%34 = zext i1 %33 to i64
%35 = select i1 %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%36 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i8* %35)
%37 = call i64 @is_palindrome_ignore_spaces(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0))
%38 = icmp ne i64 %37, 0
%39 = zext i1 %38 to i64
%40 = select i1 %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%41 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i8* %40)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"is '%s' an palindrome? %s\0A\00"
@.str.1 = [6 x i8] c"radar\00"
@.str.2 = [4 x i8] c"yes\00"
@.str.3 = [3 x i8] c"no\00"
@.str.4 = [8 x i8] c"racecar\00"
@.str.5 = [10 x i8] c"notreally\00"
@.str.6 = [16 x i8] c"step on no pets\00"
@.str.7 = [28 x i8] c"is '%s' an palindrome? %s\0A\0A\00"
@.str.8 = [1 x i8] zeroinitializer
@.str.9 = [28 x i8] c"was it a car or a cat i saw\00"
@.str.10 = [28 x i8] c"was it a car or a dog i saw\00"
@.str.11 = [30 x i8] c"was it a a car or a dog i saw\00"
define i32 @main() {
%1 = tail call i64 @is_palindrome(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = tail call i64 @is_palindrome(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %7)
%9 = tail call i64 @is_palindrome(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %11)
%13 = tail call i64 @is_palindrome(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* %15)
%17 = tail call i64 @is_palindrome(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
%19 = select i1 %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %19)
%21 = tail call i64 @is_palindrome(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
%23 = select i1 %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0), i8* %23)
%25 = tail call i64 @is_palindrome_ignore_spaces(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
%27 = select i1 %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%28 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i8* %27)
%29 = tail call i64 @is_palindrome_ignore_spaces(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
%31 = select i1 %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%32 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i8* %31)
ret i32 0
}