#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 isPalindrome(char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char str1[] = "A man, a plan, a canal: Panama";
  char str2[] = "race a car";
  char str3[] = "aa";
  char str4[] = "ab";
  char str5[] = "a.";
  char str6[] = "";
  printf("%d\n", isPalindrome(str1));
  printf("%d\n", isPalindrome(str2));
  printf("%d\n", isPalindrome(str3));
  printf("%d\n", isPalindrome(str4));
  printf("%d\n", isPalindrome(str5));
  printf("%d\n", isPalindrome(str6));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb2(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xeac(%rip),%ax
mov    %ax,-0x14(%rbp)
mov    0xea4(%rip),%al
mov    %al,-0x12(%rbp)
mov    0xe9b(%rip),%rax
mov    %rax,-0x3b(%rbp)
mov    0xe98(%rip),%ax
mov    %ax,-0x33(%rbp)
mov    0xe90(%rip),%al
mov    %al,-0x31(%rbp)
mov    0xe87(%rip),%ax
mov    %ax,-0x3e(%rbp)
mov    0xe7f(%rip),%al
mov    %al,-0x3c(%rbp)
mov    0xe76(%rip),%ax
mov    %ax,-0x41(%rbp)
mov    0xe6e(%rip),%al
mov    %al,-0x3f(%rbp)
mov    0xe65(%rip),%ax
mov    %ax,-0x44(%rbp)
mov    0xe5d(%rip),%al
mov    %al,-0x42(%rbp)
lea    -0x45(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
call   1050 <isPalindrome@plt>
mov    %eax,%esi
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
lea    -0x3b(%rbp),%rdi
call   1050 <isPalindrome@plt>
mov    %eax,%esi
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
lea    -0x3e(%rbp),%rdi
call   1050 <isPalindrome@plt>
mov    %eax,%esi
lea    0xe0b(%rip),%rdi
call   1030 <printf@plt>
lea    -0x41(%rbp),%rdi
call   1050 <isPalindrome@plt>
mov    %eax,%esi
lea    0xdf4(%rip),%rdi
call   1030 <printf@plt>
lea    -0x44(%rbp),%rdi
call   1050 <isPalindrome@plt>
mov    %eax,%esi
lea    0xddd(%rip),%rdi
call   1030 <printf@plt>
lea    -0x45(%rbp),%rdi
call   1050 <isPalindrome@plt>
mov    %eax,%esi
lea    0xdc6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movups 0xee3(%rip),%xmm0
movups %xmm0,0x2f(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movabs $0x6320612065636172,%rax
61 20 63
mov    %rax,0x10(%rsp)
movl   $0x726163,0x17(%rsp)
movb   $0x0,0xe(%rsp)
movw   $0x6161,0xc(%rsp)
movb   $0x0,0xa(%rsp)
movw   $0x6261,0x8(%rsp)
movb   $0x0,0x6(%rsp)
movw   $0x2e61,0x4(%rsp)
movb   $0x0,0x3(%rsp)
lea    0x20(%rsp),%rdi
call   1040 <isPalindrome@plt>
lea    0xea5(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x10(%rsp),%rdi
call   1040 <isPalindrome@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
call   1040 <isPalindrome@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
call   1040 <isPalindrome@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <isPalindrome@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x3(%rsp),%rdi
call   1040 <isPalindrome@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str1 = [31 x i8] c"A man, a plan, a canal: Panama\00"
@__const.main.str2 = [11 x i8] c"race a car\00"
@__const.main.str3 = [3 x i8] c"aa\00"
@__const.main.str4 = [3 x i8] c"ab\00"
@__const.main.str5 = [3 x i8] c"a.\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [31 x i8]
%3 = alloca [11 x i8]
%4 = alloca [3 x i8]
%5 = alloca [3 x i8]
%6 = alloca [3 x i8]
%7 = alloca [1 x i8]
store i32 0, i32* %1
%8 = bitcast [31 x i8]* %2 to i8*
%9 = bitcast [11 x i8]* %3 to i8*
%10 = bitcast [3 x i8]* %4 to i8*
%11 = bitcast [3 x i8]* %5 to i8*
%12 = bitcast [3 x i8]* %6 to i8*
%13 = bitcast [1 x i8]* %7 to i8*
%14 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 0
%15 = call i32 @isPalindrome(i8* %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%18 = call i32 @isPalindrome(i8* %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%21 = call i32 @isPalindrome(i8* %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%24 = call i32 @isPalindrome(i8* %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%27 = call i32 @isPalindrome(i8* %26)
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds [1 x i8], [1 x i8]* %7, i64 0, i64 0
%30 = call i32 @isPalindrome(i8* %29)
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %30)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [31 x i8] c"A man, a plan, a canal: Panama\00"
@__const.main.str2 = [11 x i8] c"race a car\00"
@__const.main.str3 = [3 x i8] c"aa\00"
@__const.main.str4 = [3 x i8] c"ab\00"
@__const.main.str5 = [3 x i8] c"a.\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [31 x i8]
%2 = alloca [11 x i8]
%3 = alloca [3 x i8]
%4 = alloca [3 x i8]
%5 = alloca [3 x i8]
%6 = alloca [1 x i8]
%7 = getelementptr inbounds [31 x i8], [31 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
store i8 0, i8* %12
%13 = call i32 @isPalindrome(i8* %7)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = call i32 @isPalindrome(i8* %8)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = call i32 @isPalindrome(i8* %9)
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = call i32 @isPalindrome(i8* %10)
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = call i32 @isPalindrome(i8* %11)
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = call i32 @isPalindrome(i8* %12)
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
ret i32 0
}